summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--.gitignore4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp12
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore58
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py183
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/LICENSE22
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/README.md29
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/icons_font_awesome.h611
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/icons_kenney.h234
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/icons_material_design.h938
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp12
-rw-r--r--3rdparty/bgfx/README.md3
-rw-r--r--3rdparty/bgfx/examples/10-font/font.cpp26
-rw-r--r--3rdparty/bgfx/examples/common/bounds.cpp96
-rw-r--r--3rdparty/bgfx/examples/common/bounds.h6
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp7
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h24
-rw-r--r--3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp10
-rw-r--r--3rdparty/bgfx/examples/runtime/font/kenney-icon-font.ttfbin0 -> 46184 bytes
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfx.h23
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfxdefines.h10
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfxplatform.h3
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfx.h11
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h2
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua8
-rw-r--r--3rdparty/bgfx/scripts/example-common.lua5
-rw-r--r--3rdparty/bgfx/scripts/genie.lua10
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp32
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h32
-rw-r--r--3rdparty/bgfx/src/image.cpp52
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp43
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.h4
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.cpp10
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.h4
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp10
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.h2
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp30
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h5
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.h2
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.mm8
-rw-r--r--3rdparty/bgfx/src/renderer_null.cpp2
-rw-r--r--3rdparty/bgfx/tools/geometryc/geometryc.cpp2
-rw-r--r--3rdparty/bx/include/bx/fpumath.h79
-rw-r--r--3rdparty/bx/include/bx/hash.h2
-rw-r--r--3rdparty/bx/scripts/toolchain.lua8
-rw-r--r--3rdparty/bx/tools/bin/darwin/geniebin422176 -> 422176 bytes
-rw-r--r--3rdparty/bx/tools/bin/linux/geniebin396856 -> 396856 bytes
-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin400384 -> 400896 bytes
-rw-r--r--3rdparty/genie/src/actions/xcode/xcode_common.lua3
-rw-r--r--3rdparty/genie/src/host/scripts.c6
-rw-r--r--3rdparty/lua-zlib/.gitattributes1
-rw-r--r--3rdparty/lua-zlib/CMakeLists.txt62
-rw-r--r--3rdparty/lua-zlib/Makefile62
-rw-r--r--3rdparty/lua-zlib/README151
-rw-r--r--3rdparty/lua-zlib/amnon_david.gzbin0 -> 65 bytes
-rw-r--r--3rdparty/lua-zlib/cmake/Modules/FindLuaJIT.cmake63
-rw-r--r--3rdparty/lua-zlib/lua_zlib.c401
-rw-r--r--3rdparty/lua-zlib/rockspec35
-rw-r--r--3rdparty/lua-zlib/tap.lua24
-rw-r--r--3rdparty/lua-zlib/test.lua198
-rw-r--r--3rdparty/lua-zlib/tom_macwright.gz4
-rw-r--r--3rdparty/lua-zlib/tom_macwright.outbin0 -> 245 bytes
-rw-r--r--3rdparty/lua-zlib/zlib.def2
-rw-r--r--3rdparty/luafilesystem/.travis.yml33
-rw-r--r--3rdparty/luafilesystem/.travis/platform.sh15
-rw-r--r--3rdparty/luafilesystem/.travis/setup_lua.sh101
-rw-r--r--3rdparty/luafilesystem/LICENSE21
-rw-r--r--3rdparty/luafilesystem/Makefile25
-rw-r--r--3rdparty/luafilesystem/Makefile.win25
-rw-r--r--3rdparty/luafilesystem/README23
-rw-r--r--3rdparty/luafilesystem/config24
-rw-r--r--3rdparty/luafilesystem/config.win19
-rw-r--r--3rdparty/luafilesystem/doc/us/doc.css212
-rw-r--r--3rdparty/luafilesystem/doc/us/examples.html103
-rw-r--r--3rdparty/luafilesystem/doc/us/index.html218
-rw-r--r--3rdparty/luafilesystem/doc/us/license.html122
-rw-r--r--3rdparty/luafilesystem/doc/us/luafilesystem.pngbin0 -> 8535 bytes
-rw-r--r--3rdparty/luafilesystem/doc/us/manual.html280
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.3.0-1.rockspec27
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-1.rockspec27
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-2.rockspec43
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1-1.rockspec43
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1rc1-1.rockspec43
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.2-1.rockspec26
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.5.0-1.rockspec27
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.0-1.rockspec27
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.1-1.rockspec27
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.2-1.rockspec27
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.3-1.rockspec28
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-1.rockspec44
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-2.rockspec26
-rw-r--r--3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-3.rockspec27
-rw-r--r--3rdparty/luafilesystem/src/.gitignore2
-rw-r--r--3rdparty/luafilesystem/src/lfs.c906
-rw-r--r--3rdparty/luafilesystem/src/lfs.def4
-rw-r--r--3rdparty/luafilesystem/src/lfs.h34
-rw-r--r--3rdparty/luafilesystem/tests/test.lua175
-rw-r--r--3rdparty/luafilesystem/vc6/lfs.def5
-rw-r--r--3rdparty/luafilesystem/vc6/luafilesystem.dsw33
-rw-r--r--3rdparty/luafilesystem/vc6/luafilesystem_dll.dsp127
-rw-r--r--3rdparty/luv/.ci/install.bat270
-rw-r--r--3rdparty/luv/.ci/platform.sh15
-rw-r--r--3rdparty/luv/.ci/set_compiler_env.bat40
-rw-r--r--3rdparty/luv/.ci/setenv_lua.sh3
-rw-r--r--3rdparty/luv/.ci/setup_lua.sh122
-rw-r--r--3rdparty/luv/.ci/winmake.bat457
-rw-r--r--3rdparty/luv/.gitignore10
-rw-r--r--3rdparty/luv/.travis.yml36
-rw-r--r--3rdparty/luv/CMakeLists.txt191
-rw-r--r--3rdparty/luv/LICENSE.txt202
-rw-r--r--3rdparty/luv/Makefile61
-rw-r--r--3rdparty/luv/README.md213
-rw-r--r--3rdparty/luv/appveyor.yml42
-rw-r--r--3rdparty/luv/cmake/Modules/FindLibuv.cmake11
-rw-r--r--3rdparty/luv/cmake/Modules/FindLuaJIT.cmake55
-rw-r--r--3rdparty/luv/deps/lua.cmake128
-rw-r--r--3rdparty/luv/deps/lua_one.c97
-rw-r--r--3rdparty/luv/deps/luajit.cmake407
-rw-r--r--3rdparty/luv/deps/uv.cmake224
-rw-r--r--3rdparty/luv/docs.md1309
-rw-r--r--3rdparty/luv/examples/cqueues-main.lua31
-rw-r--r--3rdparty/luv/examples/cqueues-slave.lua55
-rw-r--r--3rdparty/luv/examples/echo-server-client.lua68
-rw-r--r--3rdparty/luv/examples/killing-children.lua24
-rw-r--r--3rdparty/luv/examples/lots-o-dns.lua49
-rw-r--r--3rdparty/luv/examples/repl.lua89
-rw-r--r--3rdparty/luv/examples/talking-to-children.lua47
-rw-r--r--3rdparty/luv/examples/tcp-cluster.lua84
-rw-r--r--3rdparty/luv/examples/timers.lua68
-rw-r--r--3rdparty/luv/examples/uvbook/helloworld.lua5
-rw-r--r--3rdparty/luv/examples/uvbook/idle-basic.lua14
-rw-r--r--3rdparty/luv/examples/uvbook/onchange.lua30
-rw-r--r--3rdparty/luv/examples/uvbook/queue-work.lua19
-rw-r--r--3rdparty/luv/examples/uvbook/tcp-echo-client.lua21
-rw-r--r--3rdparty/luv/examples/uvbook/tcp-echo-server.lua22
-rw-r--r--3rdparty/luv/examples/uvbook/thread-create.lua38
-rw-r--r--3rdparty/luv/examples/uvbook/uvcat.lua37
-rw-r--r--3rdparty/luv/examples/uvbook/uvtee.lua35
-rw-r--r--3rdparty/luv/lib/tap.lua165
-rw-r--r--3rdparty/luv/lib/utils.lua165
-rw-r--r--3rdparty/luv/luv-1.8.0-4.rockspec34
-rw-r--r--3rdparty/luv/msvcbuild.bat13
-rw-r--r--3rdparty/luv/src/async.c63
-rw-r--r--3rdparty/luv/src/check.c59
-rw-r--r--3rdparty/luv/src/constants.c649
-rw-r--r--3rdparty/luv/src/dns.c296
-rw-r--r--3rdparty/luv/src/fs.c614
-rw-r--r--3rdparty/luv/src/fs_event.c97
-rw-r--r--3rdparty/luv/src/fs_poll.c90
-rw-r--r--3rdparty/luv/src/handle.c173
-rw-r--r--3rdparty/luv/src/idle.c59
-rw-r--r--3rdparty/luv/src/lhandle.c116
-rw-r--r--3rdparty/luv/src/lhandle.h67
-rw-r--r--3rdparty/luv/src/loop.c92
-rw-r--r--3rdparty/luv/src/lreq.c71
-rw-r--r--3rdparty/luv/src/lreq.h43
-rw-r--r--3rdparty/luv/src/lthreadpool.h48
-rw-r--r--3rdparty/luv/src/luv.c519
-rw-r--r--3rdparty/luv/src/luv.h109
-rw-r--r--3rdparty/luv/src/misc.c316
-rw-r--r--3rdparty/luv/src/pipe.c114
-rw-r--r--3rdparty/luv/src/poll.c100
-rw-r--r--3rdparty/luv/src/prepare.c59
-rw-r--r--3rdparty/luv/src/process.c266
-rw-r--r--3rdparty/luv/src/req.c52
-rw-r--r--3rdparty/luv/src/schema.c16
-rw-r--r--3rdparty/luv/src/signal.c72
-rw-r--r--3rdparty/luv/src/stream.c263
-rw-r--r--3rdparty/luv/src/tcp.c182
-rw-r--r--3rdparty/luv/src/thread.c353
-rw-r--r--3rdparty/luv/src/timer.c84
-rw-r--r--3rdparty/luv/src/tty.c65
-rw-r--r--3rdparty/luv/src/udp.c260
-rw-r--r--3rdparty/luv/src/util.c56
-rw-r--r--3rdparty/luv/src/util.h26
-rw-r--r--3rdparty/luv/src/work.c224
-rw-r--r--3rdparty/luv/tests/manual-test-cluster.lua213
-rw-r--r--3rdparty/luv/tests/run.lua33
-rw-r--r--3rdparty/luv/tests/test-async.lua32
-rw-r--r--3rdparty/luv/tests/test-conversions.lua6
-rw-r--r--3rdparty/luv/tests/test-dns.lua125
-rw-r--r--3rdparty/luv/tests/test-fs.lua90
-rw-r--r--3rdparty/luv/tests/test-leaks.lua186
-rw-r--r--3rdparty/luv/tests/test-misc.lua85
-rw-r--r--3rdparty/luv/tests/test-prepare-check-idle-async.lua49
-rw-r--r--3rdparty/luv/tests/test-process.lua101
-rw-r--r--3rdparty/luv/tests/test-sigchld-after-lua_close.sh45
-rw-r--r--3rdparty/luv/tests/test-signal.lua40
-rw-r--r--3rdparty/luv/tests/test-tcp.lua114
-rw-r--r--3rdparty/luv/tests/test-thread.lua47
-rw-r--r--3rdparty/luv/tests/test-timer.lua87
-rw-r--r--3rdparty/luv/tests/test-work.lua48
-rw-r--r--3rdparty/rapidjson/.gitignore24
-rw-r--r--3rdparty/rapidjson/.gitmodules3
-rw-r--r--3rdparty/rapidjson/.travis.yml54
-rw-r--r--3rdparty/rapidjson/CHANGELOG.md79
-rw-r--r--3rdparty/rapidjson/CMakeLists.txt128
-rw-r--r--3rdparty/rapidjson/CMakeModules/FindGTestSrc.cmake30
-rw-r--r--3rdparty/rapidjson/RapidJSON.pc.in7
-rw-r--r--3rdparty/rapidjson/RapidJSONConfig.cmake.in3
-rw-r--r--3rdparty/rapidjson/RapidJSONConfigVersion.cmake.in10
-rw-r--r--3rdparty/rapidjson/appveyor.yml28
-rw-r--r--3rdparty/rapidjson/bin/data/glossary.json22
-rw-r--r--3rdparty/rapidjson/bin/data/menu.json27
-rw-r--r--3rdparty/rapidjson/bin/data/readme.txt1
-rw-r--r--3rdparty/rapidjson/bin/data/sample.json3315
-rw-r--r--3rdparty/rapidjson/bin/data/webapp.json88
-rw-r--r--3rdparty/rapidjson/bin/data/widget.json26
-rw-r--r--3rdparty/rapidjson/bin/draft-04/schema150
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf16be.jsonbin0 -> 368 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf16bebom.jsonbin0 -> 370 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf16le.jsonbin0 -> 368 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf16lebom.jsonbin0 -> 370 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf32be.jsonbin0 -> 736 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf32bebom.jsonbin0 -> 740 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf32le.jsonbin0 -> 736 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf32lebom.jsonbin0 -> 740 bytes
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf8.json7
-rw-r--r--3rdparty/rapidjson/bin/encodings/utf8bom.json7
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail1.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail10.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail11.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail12.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail13.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail14.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail15.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail16.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail17.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail18.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail19.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail2.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail20.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail21.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail22.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail23.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail24.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail25.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail26.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail27.json2
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail28.json2
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail29.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail3.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail30.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail31.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail32.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail33.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail4.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail5.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail6.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail7.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail8.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/fail9.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/pass1.json58
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/pass2.json1
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/pass3.json6
-rw-r--r--3rdparty/rapidjson/bin/jsonchecker/readme.txt3
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/.gitignore1
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/.travis.yml4
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/LICENSE19
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/README.md148
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/bin/jsonschema_suite283
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/remotes/.DS_Storebin0 -> 6148 bytes
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json3
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/remotes/integer.json3
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/remotes/subSchemas.json8
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/.DS_Storebin0 -> 6148 bytes
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json82
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json88
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/default.json49
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/dependencies.json108
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/disallow.json80
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json60
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/enum.json71
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/extends.json94
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/items.json46
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxItems.json28
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxLength.json33
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/maximum.json42
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/minItems.json28
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/minLength.json33
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/minimum.json42
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json107
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/format.json222
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json18
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json15
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/pattern.json34
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json110
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/properties.json92
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/ref.json159
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/refRemote.json74
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/required.json53
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/type.json474
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json79
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/.DS_Storebin0 -> 6148 bytes
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json82
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json88
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/allOf.json112
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/anyOf.json68
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/default.json49
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/definitions.json32
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/dependencies.json113
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/enum.json72
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/items.json46
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxItems.json28
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxLength.json33
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json28
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/maximum.json42
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/minItems.json28
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/minLength.json33
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/minProperties.json28
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/minimum.json42
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json60
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/not.json96
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json68
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json107
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/format.json148
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json15
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/pattern.json34
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json110
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/properties.json92
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/ref.json159
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/refRemote.json74
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/required.json39
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/type.json330
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json79
-rw-r--r--3rdparty/rapidjson/bin/jsonschema/tox.ini8
-rw-r--r--3rdparty/rapidjson/bin/types/booleans.json102
-rw-r--r--3rdparty/rapidjson/bin/types/floats.json102
-rw-r--r--3rdparty/rapidjson/bin/types/guids.json102
-rw-r--r--3rdparty/rapidjson/bin/types/integers.json102
-rw-r--r--3rdparty/rapidjson/bin/types/mixed.json592
-rw-r--r--3rdparty/rapidjson/bin/types/nulls.json102
-rw-r--r--3rdparty/rapidjson/bin/types/paragraphs.json102
-rw-r--r--3rdparty/rapidjson/bin/types/readme.txt1
-rw-r--r--3rdparty/rapidjson/doc/CMakeLists.txt25
-rw-r--r--3rdparty/rapidjson/doc/Doxyfile.in2368
-rw-r--r--3rdparty/rapidjson/doc/Doxyfile.zh-cn.in2368
-rw-r--r--3rdparty/rapidjson/doc/diagram/architecture.dot50
-rw-r--r--3rdparty/rapidjson/doc/diagram/architecture.pngbin0 -> 16569 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/insituparsing.dot65
-rw-r--r--3rdparty/rapidjson/doc/diagram/insituparsing.pngbin0 -> 37281 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.dot62
-rw-r--r--3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.pngbin0 -> 92378 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/makefile8
-rw-r--r--3rdparty/rapidjson/doc/diagram/move1.dot47
-rw-r--r--3rdparty/rapidjson/doc/diagram/move1.pngbin0 -> 16081 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/move2.dot62
-rw-r--r--3rdparty/rapidjson/doc/diagram/move2.pngbin0 -> 41517 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/move3.dot60
-rw-r--r--3rdparty/rapidjson/doc/diagram/move3.pngbin0 -> 36371 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/normalparsing.dot56
-rw-r--r--3rdparty/rapidjson/doc/diagram/normalparsing.pngbin0 -> 32887 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/simpledom.dot54
-rw-r--r--3rdparty/rapidjson/doc/diagram/simpledom.pngbin0 -> 43670 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/tutorial.dot58
-rw-r--r--3rdparty/rapidjson/doc/diagram/tutorial.pngbin0 -> 44634 bytes
-rw-r--r--3rdparty/rapidjson/doc/diagram/utilityclass.dot73
-rw-r--r--3rdparty/rapidjson/doc/diagram/utilityclass.pngbin0 -> 99993 bytes
-rw-r--r--3rdparty/rapidjson/doc/dom.md277
-rw-r--r--3rdparty/rapidjson/doc/dom.zh-cn.md281
-rw-r--r--3rdparty/rapidjson/doc/encoding.md146
-rw-r--r--3rdparty/rapidjson/doc/encoding.zh-cn.md152
-rw-r--r--3rdparty/rapidjson/doc/faq.md289
-rw-r--r--3rdparty/rapidjson/doc/faq.zh-cn.md290
-rw-r--r--3rdparty/rapidjson/doc/features.md98
-rw-r--r--3rdparty/rapidjson/doc/features.zh-cn.md97
-rw-r--r--3rdparty/rapidjson/doc/internals.md365
-rw-r--r--3rdparty/rapidjson/doc/logo/rapidjson.pngbin0 -> 5259 bytes
-rw-r--r--3rdparty/rapidjson/doc/logo/rapidjson.svg119
-rw-r--r--3rdparty/rapidjson/doc/misc/DoxygenLayout.xml194
-rw-r--r--3rdparty/rapidjson/doc/misc/doxygenextra.css274
-rw-r--r--3rdparty/rapidjson/doc/misc/footer.html27
-rw-r--r--3rdparty/rapidjson/doc/misc/header.html33
-rw-r--r--3rdparty/rapidjson/doc/performance.md26
-rw-r--r--3rdparty/rapidjson/doc/performance.zh-cn.md26
-rw-r--r--3rdparty/rapidjson/doc/pointer.md234
-rw-r--r--3rdparty/rapidjson/doc/pointer.zh-cn.md234
-rw-r--r--3rdparty/rapidjson/doc/sax.md475
-rw-r--r--3rdparty/rapidjson/doc/sax.zh-cn.md476
-rw-r--r--3rdparty/rapidjson/doc/schema.md237
-rw-r--r--3rdparty/rapidjson/doc/schema.zh-cn.md237
-rw-r--r--3rdparty/rapidjson/doc/stream.md426
-rw-r--r--3rdparty/rapidjson/doc/stream.zh-cn.md426
-rw-r--r--3rdparty/rapidjson/doc/tutorial.md517
-rw-r--r--3rdparty/rapidjson/doc/tutorial.zh-cn.md515
-rw-r--r--3rdparty/rapidjson/example/CMakeLists.txt36
-rw-r--r--3rdparty/rapidjson/example/capitalize/capitalize.cpp66
-rw-r--r--3rdparty/rapidjson/example/condense/condense.cpp32
-rw-r--r--3rdparty/rapidjson/example/jsonx/jsonx.cpp200
-rw-r--r--3rdparty/rapidjson/example/messagereader/messagereader.cpp105
-rw-r--r--3rdparty/rapidjson/example/pretty/pretty.cpp30
-rw-r--r--3rdparty/rapidjson/example/prettyauto/prettyauto.cpp56
-rw-r--r--3rdparty/rapidjson/example/schemavalidator/schemavalidator.cpp72
-rw-r--r--3rdparty/rapidjson/example/serialize/serialize.cpp173
-rw-r--r--3rdparty/rapidjson/example/simpledom/simpledom.cpp29
-rw-r--r--3rdparty/rapidjson/example/simplereader/simplereader.cpp38
-rw-r--r--3rdparty/rapidjson/example/simplewriter/simplewriter.cpp35
-rw-r--r--3rdparty/rapidjson/example/tutorial/tutorial.cpp151
-rw-r--r--3rdparty/rapidjson/include/rapidjson/allocators.h263
-rw-r--r--3rdparty/rapidjson/include/rapidjson/document.h2189
-rw-r--r--3rdparty/rapidjson/include/rapidjson/encodedstream.h270
-rw-r--r--3rdparty/rapidjson/include/rapidjson/encodings.h712
-rw-r--r--3rdparty/rapidjson/include/rapidjson/error/en.h74
-rw-r--r--3rdparty/rapidjson/include/rapidjson/error/error.h155
-rw-r--r--3rdparty/rapidjson/include/rapidjson/filereadstream.h99
-rw-r--r--3rdparty/rapidjson/include/rapidjson/filewritestream.h104
-rw-r--r--3rdparty/rapidjson/include/rapidjson/fwd.h151
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/biginteger.h290
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/diyfp.h258
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/dtoa.h243
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/ieee754.h78
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/itoa.h304
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/meta.h181
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/pow10.h55
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/regex.h696
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/stack.h230
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/strfunc.h55
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/strtod.h269
-rw-r--r--3rdparty/rapidjson/include/rapidjson/internal/swap.h46
-rw-r--r--3rdparty/rapidjson/include/rapidjson/istreamwrapper.h105
-rw-r--r--3rdparty/rapidjson/include/rapidjson/memorybuffer.h70
-rw-r--r--3rdparty/rapidjson/include/rapidjson/memorystream.h71
-rw-r--r--3rdparty/rapidjson/include/rapidjson/msinttypes/inttypes.h316
-rw-r--r--3rdparty/rapidjson/include/rapidjson/msinttypes/stdint.h300
-rw-r--r--3rdparty/rapidjson/include/rapidjson/ostreamwrapper.h76
-rw-r--r--3rdparty/rapidjson/include/rapidjson/pointer.h1345
-rw-r--r--3rdparty/rapidjson/include/rapidjson/prettywriter.h223
-rw-r--r--3rdparty/rapidjson/include/rapidjson/rapidjson.h569
-rw-r--r--3rdparty/rapidjson/include/rapidjson/reader.h1696
-rw-r--r--3rdparty/rapidjson/include/rapidjson/schema.h1979
-rw-r--r--3rdparty/rapidjson/include/rapidjson/stream.h179
-rw-r--r--3rdparty/rapidjson/include/rapidjson/stringbuffer.h117
-rw-r--r--3rdparty/rapidjson/include/rapidjson/writer.h558
-rw-r--r--3rdparty/rapidjson/library.json12
-rw-r--r--3rdparty/rapidjson/license.txt57
-rw-r--r--3rdparty/rapidjson/rapidjson.autopkg75
-rw-r--r--3rdparty/rapidjson/readme.md129
-rw-r--r--3rdparty/rapidjson/readme.zh-cn.md121
-rw-r--r--3rdparty/rapidjson/test/CMakeLists.txt20
-rw-r--r--3rdparty/rapidjson/test/perftest/CMakeLists.txt17
-rw-r--r--3rdparty/rapidjson/test/perftest/misctest.cpp974
-rw-r--r--3rdparty/rapidjson/test/perftest/perftest.cpp24
-rw-r--r--3rdparty/rapidjson/test/perftest/perftest.h180
-rw-r--r--3rdparty/rapidjson/test/perftest/platformtest.cpp166
-rw-r--r--3rdparty/rapidjson/test/perftest/rapidjsontest.cpp422
-rw-r--r--3rdparty/rapidjson/test/perftest/schematest.cpp216
-rw-r--r--3rdparty/rapidjson/test/unittest/CMakeLists.txt61
-rw-r--r--3rdparty/rapidjson/test/unittest/allocatorstest.cpp102
-rw-r--r--3rdparty/rapidjson/test/unittest/bigintegertest.cpp133
-rw-r--r--3rdparty/rapidjson/test/unittest/documenttest.cpp589
-rw-r--r--3rdparty/rapidjson/test/unittest/dtoatest.cpp91
-rw-r--r--3rdparty/rapidjson/test/unittest/encodedstreamtest.cpp313
-rw-r--r--3rdparty/rapidjson/test/unittest/encodingstest.cpp425
-rw-r--r--3rdparty/rapidjson/test/unittest/filestreamtest.cpp112
-rw-r--r--3rdparty/rapidjson/test/unittest/fwdtest.cpp227
-rw-r--r--3rdparty/rapidjson/test/unittest/istreamwrappertest.cpp171
-rw-r--r--3rdparty/rapidjson/test/unittest/itoatest.cpp158
-rw-r--r--3rdparty/rapidjson/test/unittest/jsoncheckertest.cpp99
-rw-r--r--3rdparty/rapidjson/test/unittest/namespacetest.cpp70
-rw-r--r--3rdparty/rapidjson/test/unittest/ostreamwrappertest.cpp91
-rw-r--r--3rdparty/rapidjson/test/unittest/pointertest.cpp1524
-rw-r--r--3rdparty/rapidjson/test/unittest/prettywritertest.cpp180
-rw-r--r--3rdparty/rapidjson/test/unittest/readertest.cpp1517
-rw-r--r--3rdparty/rapidjson/test/unittest/regextest.cpp576
-rw-r--r--3rdparty/rapidjson/test/unittest/schematest.cpp1157
-rw-r--r--3rdparty/rapidjson/test/unittest/simdtest.cpp159
-rw-r--r--3rdparty/rapidjson/test/unittest/strfunctest.cpp30
-rw-r--r--3rdparty/rapidjson/test/unittest/stringbuffertest.cpp163
-rw-r--r--3rdparty/rapidjson/test/unittest/strtodtest.cpp132
-rw-r--r--3rdparty/rapidjson/test/unittest/unittest.cpp50
-rw-r--r--3rdparty/rapidjson/test/unittest/unittest.h135
-rw-r--r--3rdparty/rapidjson/test/unittest/valuetest.cpp1498
-rw-r--r--3rdparty/rapidjson/test/unittest/writertest.cpp441
-rw-r--r--3rdparty/rapidjson/travis-doxygen.sh122
-rw-r--r--bgfx/chains/test.json98
-rw-r--r--bgfx/effects/gui_add.json22
-rw-r--r--bgfx/effects/gui_blend.json22
-rw-r--r--bgfx/effects/gui_multiply.json22
-rw-r--r--bgfx/effects/gui_opaque.json22
-rw-r--r--bgfx/effects/screen_add.json23
-rw-r--r--bgfx/effects/screen_blend.json23
-rw-r--r--bgfx/effects/screen_multiply.json23
-rw-r--r--bgfx/effects/screen_opaque.json23
-rw-r--r--docs/luaengine.md35
-rw-r--r--hash/a2600.xml52
-rw-r--r--hash/a800_flop.xml352
-rw-r--r--hash/c128_cart.xml45
-rw-r--r--hash/c64_cart.xml16
-rw-r--r--hash/m5_cart.xml8
-rw-r--r--hash/m5_flop.xml2
-rw-r--r--hash/snotec.xml38
-rw-r--r--language/Afrikaans/strings.po1084
-rw-r--r--language/Albanian/strings.po1084
-rw-r--r--language/Arabic/strings.po1084
-rw-r--r--language/Basque/strings.po1085
-rw-r--r--language/Belarusian/strings.po1087
-rw-r--r--language/Bosnian/strings.po1084
-rw-r--r--language/Bulgarian/strings.po1086
-rw-r--r--language/Burmese/strings.po1084
-rw-r--r--language/Catalan/strings.po1085
-rw-r--r--language/Chinese_Simplified/strings.po1119
-rw-r--r--language/Chinese_Traditional/strings.po1119
-rw-r--r--language/Croatian/strings.po1086
-rw-r--r--language/Czech/strings.po1085
-rw-r--r--language/Danish/strings.po1086
-rw-r--r--language/Dutch/strings.po1086
-rw-r--r--language/English/strings.po1115
-rw-r--r--language/Estonian/strings.po1085
-rw-r--r--language/Finnish/strings.po1086
-rw-r--r--language/French/strings.po1086
-rw-r--r--language/French_Canada/strings.po1086
-rw-r--r--language/Georgian/strings.po1084
-rw-r--r--language/German/strings.po1116
-rw-r--r--language/Greek/strings.po1085
-rw-r--r--language/Hebrew/strings.po1085
-rw-r--r--language/Hindi/strings.po1084
-rw-r--r--language/Hungarian/strings.po1085
-rw-r--r--language/Indonesian/strings.po1085
-rw-r--r--language/Italian/strings.po1086
-rw-r--r--language/Japanese/strings.po1086
-rw-r--r--language/Korean/strings.po1086
-rw-r--r--language/Latvian/strings.po1086
-rw-r--r--language/Lithuanian/strings.po1086
-rw-r--r--language/Macedonian/strings.po1084
-rw-r--r--language/Norwegian/strings.po1085
-rw-r--r--language/Persian/strings.po1084
-rw-r--r--language/Polish/strings.po1087
-rw-r--r--language/Portuguese/strings.po1085
-rw-r--r--language/Portuguese_Brazil/strings.po1086
-rw-r--r--language/Romanian/strings.po1087
-rw-r--r--language/Russian/strings.po1116
-rw-r--r--language/Serbian/strings.po1086
-rw-r--r--language/Serbian_Cyrillic/strings.po1098
-rw-r--r--language/Slovak/strings.po1086
-rw-r--r--language/Slovenian/strings.po1087
-rw-r--r--language/Spanish/strings.po1086
-rw-r--r--language/Spanish_Mexico/strings.po1086
-rw-r--r--language/Swedish/strings.po1085
-rw-r--r--language/Thai/strings.po1084
-rw-r--r--language/Turkish/strings.po1086
-rw-r--r--language/Ukrainian/strings.po1086
-rw-r--r--language/Vietnamese/strings.po1085
-rw-r--r--makefile65
-rw-r--r--plugins/boot.lua24
-rw-r--r--plugins/coro-channel/LICENSE22
-rw-r--r--plugins/coro-channel/README.md2
-rw-r--r--plugins/coro-channel/init.lua128
-rw-r--r--plugins/coro-channel/plugin.json8
-rw-r--r--plugins/coro-fs/LICENSE22
-rw-r--r--plugins/coro-fs/README.md2
-rw-r--r--plugins/coro-fs/init.lua222
-rw-r--r--plugins/coro-fs/plugin.json8
-rw-r--r--plugins/coro-http/LICENSE22
-rw-r--r--plugins/coro-http/README.md2
-rw-r--r--plugins/coro-http/init.lua187
-rw-r--r--plugins/coro-http/plugin.json8
-rw-r--r--plugins/coro-net/LICENSE22
-rw-r--r--plugins/coro-net/README.md2
-rw-r--r--plugins/coro-net/init.lua113
-rw-r--r--plugins/coro-net/plugin.json8
-rw-r--r--plugins/coro-tls/LICENSE22
-rw-r--r--plugins/coro-tls/README.md2
-rw-r--r--plugins/coro-tls/init.lua122
-rw-r--r--plugins/coro-tls/plugin.json8
-rw-r--r--plugins/coro-wrapper/LICENSE22
-rw-r--r--plugins/coro-wrapper/README.md2
-rw-r--r--plugins/coro-wrapper/init.lua41
-rw-r--r--plugins/coro-wrapper/plugin.json8
-rw-r--r--plugins/dummy/init.lua20
-rw-r--r--plugins/dummy/plugin.json9
-rw-r--r--plugins/http-codec/LICENSE202
-rw-r--r--plugins/http-codec/README.md2
-rw-r--r--plugins/http-codec/init.lua291
-rw-r--r--plugins/http-codec/plugin.json8
-rw-r--r--plugins/json/LICENSE22
-rw-r--r--plugins/json/README.md2
-rw-r--r--plugins/json/init.lua732
-rw-r--r--plugins/json/plugin.json8
-rw-r--r--plugins/mime/LICENSE22
-rw-r--r--plugins/mime/README.md2
-rw-r--r--plugins/mime/init.lua194
-rw-r--r--plugins/mime/plugin.json8
-rw-r--r--plugins/path/LICENSE202
-rw-r--r--plugins/path/README.md2
-rw-r--r--plugins/path/init.lua139
-rw-r--r--plugins/path/plugin.json8
-rw-r--r--plugins/pretty-print/LICENSE202
-rw-r--r--plugins/pretty-print/README.md2
-rw-r--r--plugins/pretty-print/init.lua362
-rw-r--r--plugins/pretty-print/plugin.json8
-rw-r--r--plugins/querystring/LICENSE202
-rw-r--r--plugins/querystring/README.md2
-rw-r--r--plugins/querystring/init.lua105
-rw-r--r--plugins/querystring/plugin.json8
-rw-r--r--plugins/weblit/LICENSE22
-rw-r--r--plugins/weblit/README.md239
-rw-r--r--plugins/weblit/app.lua261
-rw-r--r--plugins/weblit/auto-headers.lua92
-rw-r--r--plugins/weblit/etag-cache.lua39
-rw-r--r--plugins/weblit/init.lua8
-rw-r--r--plugins/weblit/logger.lua10
-rw-r--r--plugins/weblit/plugin.json8
-rw-r--r--plugins/weblit/static.lua62
-rw-r--r--plugins/weblit/websocket.lua82
-rw-r--r--plugins/webserver/init.lua34
-rw-r--r--plugins/webserver/plugin.json9
-rw-r--r--plugins/websocket-codec/LICENSE22
-rw-r--r--plugins/websocket-codec/README.md2
-rw-r--r--plugins/websocket-codec/init.lua261
-rw-r--r--plugins/websocket-codec/plugin.json8
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal10h8-as-ampal18p8.txt97
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal10l8-as-ampal18p8.txt97
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal12h6-as-ampal18p8.txt75
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal12l6-as-ampal18p8.txt75
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal14h4-as-ampal18p8.txt53
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal14l4-as-ampal18p8.txt53
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal16h2-as-ampal18p8.txt31
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal16l2-as-ampal18p8.txt31
-rw-r--r--regtests/jedutil/baseline/ampal18p8/pal16l8-as-ampal18p8.txt89
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal10h8-as-ampal18p8.pds119
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal10l8-as-ampal18p8.pds119
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal12h6-as-ampal18p8.pds101
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal12l6-as-ampal18p8.pds101
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal14h4-as-ampal18p8.pds83
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal14l4-as-ampal18p8.pds83
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal16h2-as-ampal18p8.pds65
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal16l2-as-ampal18p8.pds65
-rw-r--r--regtests/jedutil/eqns/PALASM/ampal18p8/pal16l8-as-ampal18p8.pds119
-rw-r--r--regtests/jedutil/eqns/pal10l8/pal10l8.eqn0
-rw-r--r--regtests/jedutil/eqns/pal12h6/pal12h6.eqn0
-rw-r--r--regtests/jedutil/eqns/pal12l6/pal12l6.eqn0
-rw-r--r--regtests/jedutil/eqns/pal14h4/pal14h4.eqn0
-rw-r--r--regtests/jedutil/eqns/pal14l4/pal14l4.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16c1/pal16c1.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16h2/pal16h2.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16l2/pal16l2.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16l8/pal16l8.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16r4/pal16r4.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16r6/pal16r6.eqn0
-rw-r--r--regtests/jedutil/eqns/pal16r8/pal16r8.eqn0
-rw-r--r--regtests/jedutil/eqns/pal20l10/pal20l10.eqn0
-rw-r--r--regtests/jedutil/eqns/pal20l8/pal20l8.eqn0
-rw-r--r--regtests/jedutil/eqns/pal20r4/pal20r4.eqn0
-rw-r--r--regtests/jedutil/eqns/pal20r6/pal20r6.eqn0
-rw-r--r--regtests/jedutil/eqns/pal20r8/pal20r8.eqn0
-rw-r--r--regtests/jedutil/eqns/readme.txt0
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal10h8-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal10l8-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal12h6-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal12l6-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal14h4-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal14l4-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal16h2-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal16l2-as-ampal18p8.jed90
-rw-r--r--regtests/jedutil/jeds/ampal18p8/pal16l8-as-ampal18p8.jed90
-rw-r--r--scripts/build/msgfmt.py226
-rw-r--r--scripts/genie.lua59
-rw-r--r--scripts/src/3rdparty.lua104
-rw-r--r--scripts/src/emu.lua2
-rw-r--r--scripts/src/machine.lua12
-rw-r--r--scripts/src/main.lua26
-rw-r--r--scripts/src/osd/modules.lua60
-rw-r--r--scripts/src/osd/sdl.lua124
-rw-r--r--scripts/src/osd/sdl_cfg.lua18
-rw-r--r--scripts/src/osd/windows.lua10
-rw-r--r--scripts/src/osd/windows_cfg.lua2
-rw-r--r--scripts/src/tools.lua111
-rw-r--r--scripts/target/mame/mess.lua3
-rw-r--r--scripts/toolchain.lua59
-rw-r--r--shaders/dx11/fs_gui.bin (renamed from shaders/dx11/fs_quad_texture.bin)bin396 -> 396 bytes
-rw-r--r--shaders/dx11/fs_line.binbin260 -> 0 bytes
-rw-r--r--shaders/dx11/fs_quad.binbin260 -> 0 bytes
-rw-r--r--shaders/dx11/fs_screen.binbin0 -> 457 bytes
-rw-r--r--shaders/dx11/vs_gui.bin (renamed from shaders/dx11/vs_quad_texture.bin)bin575 -> 575 bytes
-rw-r--r--shaders/dx11/vs_line.binbin465 -> 0 bytes
-rw-r--r--shaders/dx11/vs_quad.binbin465 -> 0 bytes
-rw-r--r--shaders/dx11/vs_screen.binbin0 -> 575 bytes
-rw-r--r--shaders/dx9/fs_gui.bin (renamed from shaders/dx9/fs_quad_texture.bin)bin241 -> 237 bytes
-rw-r--r--shaders/dx9/fs_line.binbin141 -> 0 bytes
-rw-r--r--shaders/dx9/fs_quad.binbin141 -> 0 bytes
-rw-r--r--shaders/dx9/fs_screen.binbin0 -> 310 bytes
-rw-r--r--shaders/dx9/vs_gui.bin (renamed from shaders/dx9/vs_quad_texture.bin)bin330 -> 326 bytes
-rw-r--r--shaders/dx9/vs_line.binbin294 -> 0 bytes
-rw-r--r--shaders/dx9/vs_quad.binbin294 -> 0 bytes
-rw-r--r--shaders/dx9/vs_screen.binbin0 -> 326 bytes
-rw-r--r--shaders/gles/fs_gui.bin (renamed from shaders/gles/fs_quad_texture.bin)bin238 -> 238 bytes
-rw-r--r--shaders/gles/fs_line.binbin89 -> 0 bytes
-rw-r--r--shaders/gles/fs_quad.binbin89 -> 0 bytes
-rw-r--r--shaders/gles/fs_screen.binbin0 -> 289 bytes
-rw-r--r--shaders/gles/vs_gui.bin (renamed from shaders/gles/vs_quad_texture.bin)bin419 -> 419 bytes
-rw-r--r--shaders/gles/vs_line.binbin324 -> 0 bytes
-rw-r--r--shaders/gles/vs_screen.bin (renamed from shaders/gles/vs_quad.bin)bin324 -> 419 bytes
-rw-r--r--shaders/glsl/fs_gui.bin (renamed from shaders/glsl/fs_quad_texture.bin)bin181 -> 181 bytes
-rw-r--r--shaders/glsl/fs_line.binbin83 -> 0 bytes
-rw-r--r--shaders/glsl/fs_quad.binbin83 -> 0 bytes
-rw-r--r--shaders/glsl/fs_screen.binbin0 -> 226 bytes
-rw-r--r--shaders/glsl/vs_gui.bin (renamed from shaders/glsl/vs_quad_texture.bin)bin377 -> 377 bytes
-rw-r--r--shaders/glsl/vs_quad.binbin294 -> 0 bytes
-rw-r--r--shaders/glsl/vs_screen.bin (renamed from shaders/glsl/vs_line.bin)bin294 -> 377 bytes
-rw-r--r--shaders/metal/fs_gui.bin (renamed from shaders/metal/fs_quad_texture.bin)bin634 -> 634 bytes
-rw-r--r--shaders/metal/fs_line.binbin404 -> 0 bytes
-rw-r--r--shaders/metal/fs_quad.binbin404 -> 0 bytes
-rw-r--r--shaders/metal/fs_screen.binbin0 -> 686 bytes
-rw-r--r--shaders/metal/vs_gui.bin (renamed from shaders/metal/vs_quad_texture.bin)bin757 -> 757 bytes
-rw-r--r--shaders/metal/vs_quad.binbin653 -> 0 bytes
-rw-r--r--shaders/metal/vs_screen.bin (renamed from shaders/metal/vs_line.bin)bin653 -> 757 bytes
-rw-r--r--src/devices/bus/isa/3c505.cpp22
-rw-r--r--src/devices/bus/isa/3c505.h1
-rw-r--r--src/devices/bus/isa/omti8621.cpp108
-rw-r--r--src/devices/bus/isa/omti8621.h3
-rw-r--r--src/devices/bus/isa/sc499.cpp25
-rw-r--r--src/devices/bus/isa/sc499.h1
-rw-r--r--src/devices/cpu/h8/h8.cpp2
-rw-r--r--src/devices/cpu/hphybrid/hphybrid.cpp9
-rw-r--r--src/devices/cpu/i386/i386.cpp31
-rw-r--r--src/devices/cpu/i386/i386.h1
-rw-r--r--src/devices/cpu/i386/i386op32.inc16
-rw-r--r--src/devices/cpu/i386/i386ops.h1
-rw-r--r--src/devices/cpu/i386/i386ops.inc61
-rw-r--r--src/devices/cpu/i386/i386priv.h17
-rw-r--r--src/devices/machine/com8116.cpp42
-rw-r--r--src/devices/machine/com8116.h6
-rw-r--r--src/devices/machine/corvushd.cpp2
-rw-r--r--src/devices/machine/hp_taco.cpp1467
-rw-r--r--src/devices/machine/hp_taco.h169
-rw-r--r--src/devices/video/upd7220.cpp9
-rw-r--r--src/emu/clifront.cpp21
-rw-r--r--src/emu/debug/debugcpu.cpp3
-rw-r--r--src/emu/emu.h1
-rw-r--r--src/emu/emuopts.cpp7
-rw-r--r--src/emu/emuopts.h19
-rw-r--r--src/emu/info.cpp19
-rw-r--r--src/emu/ioport.cpp2
-rw-r--r--src/emu/language.cpp78
-rw-r--r--src/emu/language.h32
-rw-r--r--src/emu/luaengine.cpp642
-rw-r--r--src/emu/luaengine.h37
-rw-r--r--src/emu/machine.cpp4
-rw-r--r--src/emu/mame.cpp15
-rw-r--r--src/emu/mame.h11
-rw-r--r--src/emu/render.cpp8
-rw-r--r--src/emu/render.h10
-rw-r--r--src/emu/romload.cpp8
-rw-r--r--src/emu/save.cpp5
-rw-r--r--src/emu/ui/auditmenu.cpp2
-rw-r--r--src/emu/ui/barcode.cpp6
-rw-r--r--src/emu/ui/cheatopt.cpp22
-rw-r--r--src/emu/ui/ctrlmenu.cpp22
-rw-r--r--src/emu/ui/custmenu.cpp24
-rw-r--r--src/emu/ui/custui.cpp172
-rw-r--r--src/emu/ui/custui.h5
-rw-r--r--src/emu/ui/datmenu.cpp18
-rw-r--r--src/emu/ui/dirmenu.cpp632
-rw-r--r--src/emu/ui/dirmenu.h43
-rw-r--r--src/emu/ui/dsplmenu.cpp8
-rw-r--r--src/emu/ui/filesel.cpp5
-rw-r--r--src/emu/ui/mainmenu.cpp57
-rw-r--r--src/emu/ui/menu.cpp75
-rw-r--r--src/emu/ui/menu.h1
-rw-r--r--src/emu/ui/miscmenu.cpp36
-rw-r--r--src/emu/ui/moptions.cpp4
-rw-r--r--src/emu/ui/moptions.h11
-rw-r--r--src/emu/ui/optsmenu.cpp20
-rw-r--r--src/emu/ui/selector.cpp4
-rw-r--r--src/emu/ui/selgame.cpp63
-rw-r--r--src/emu/ui/selsoft.cpp46
-rw-r--r--src/emu/ui/simpleselgame.cpp12
-rw-r--r--src/emu/ui/sliders.cpp24
-rw-r--r--src/emu/ui/sliders.h5
-rw-r--r--src/emu/ui/slotopt.cpp4
-rw-r--r--src/emu/ui/sndmenu.cpp10
-rw-r--r--src/emu/ui/swlist.cpp5
-rw-r--r--src/emu/ui/ui.cpp152
-rw-r--r--src/emu/ui/ui.h9
-rw-r--r--src/emu/ui/utils.cpp1
-rw-r--r--src/emu/ui/utils.h1
-rw-r--r--src/emu/ui/videoopt.cpp16
-rw-r--r--src/emu/ui/viewgfx.cpp2
-rw-r--r--src/emu/video.cpp2
-rw-r--r--src/emu/video.h2
-rw-r--r--src/ldplayer/ldplayer.cpp26
-rw-r--r--src/lib/util/aviio.cpp2
-rw-r--r--src/mame/arcade.lst11
-rw-r--r--src/mame/drivers/1943.cpp2
-rw-r--r--src/mame/drivers/8080bw.cpp2
-rw-r--r--src/mame/drivers/at.cpp15
-rw-r--r--src/mame/drivers/avigo.cpp237
-rw-r--r--src/mame/drivers/blmbycar.cpp95
-rw-r--r--src/mame/drivers/elecbowl.cpp8
-rw-r--r--src/mame/drivers/esq5505.cpp79
-rw-r--r--src/mame/drivers/esqkt.cpp4
-rw-r--r--src/mame/drivers/fidel6502.cpp103
-rw-r--r--src/mame/drivers/fidel68k.cpp387
-rw-r--r--src/mame/drivers/fidelz80.cpp119
-rw-r--r--src/mame/drivers/galaxy.cpp8
-rw-r--r--src/mame/drivers/glass.cpp60
-rw-r--r--src/mame/drivers/goldstar.cpp154
-rw-r--r--src/mame/drivers/hh_cop400.cpp74
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp9
-rw-r--r--src/mame/drivers/hh_melps4.cpp7
-rw-r--r--src/mame/drivers/hh_pic16.cpp7
-rw-r--r--src/mame/drivers/hh_tms1k.cpp1187
-rw-r--r--src/mame/drivers/hh_ucom4.cpp7
-rw-r--r--src/mame/drivers/hp9845.cpp75
-rw-r--r--src/mame/drivers/k28.cpp27
-rw-r--r--src/mame/drivers/kurukuru.cpp131
-rw-r--r--src/mame/drivers/m5.cpp228
-rw-r--r--src/mame/drivers/mbdtower.cpp4
-rw-r--r--src/mame/drivers/mitchell.cpp149
-rw-r--r--src/mame/drivers/mstation.cpp167
-rw-r--r--src/mame/drivers/namcops2.cpp13
-rw-r--r--src/mame/drivers/pc9801.cpp595
-rw-r--r--src/mame/drivers/rex6000.cpp188
-rw-r--r--src/mame/drivers/sigmab52.cpp73
-rw-r--r--src/mame/drivers/ticalc1x.cpp79
-rw-r--r--src/mame/drivers/tispeak.cpp6
-rw-r--r--src/mame/drivers/tispellb.cpp9
-rw-r--r--src/mame/drivers/viper.cpp7
-rw-r--r--src/mame/includes/avigo.h24
-rw-r--r--src/mame/includes/blmbycar.h35
-rw-r--r--src/mame/includes/fidelz80.h8
-rw-r--r--src/mame/includes/glass.h40
-rw-r--r--src/mame/includes/goldstar.h1
-rw-r--r--src/mame/includes/hh_tms1k.h4
-rw-r--r--src/mame/includes/hh_ucom4.h2
-rw-r--r--src/mame/includes/xbox.h26
-rw-r--r--src/mame/layout/amaztron.lay235
-rw-r--r--src/mame/layout/cnfball2.lay185
-rw-r--r--src/mame/layout/cnsector.lay23
-rw-r--r--src/mame/layout/cqback.lay178
-rw-r--r--src/mame/layout/esq2by16.lay980
-rw-r--r--src/mame/layout/fidel_eag.lay420
-rw-r--r--src/mame/layout/fidel_fev.lay3
-rw-r--r--src/mame/layout/h2hfootb.lay3
-rw-r--r--src/mame/layout/lostreas.lay181
-rw-r--r--src/mame/layout/mathmagi.lay27
-rw-r--r--src/mame/layout/mdndclab.lay271
-rw-r--r--src/mame/layout/zodiac.lay83
-rw-r--r--src/mame/machine/esqlcd.cpp403
-rw-r--r--src/mame/machine/esqlcd.h45
-rw-r--r--src/mame/machine/esqpanel.cpp23
-rw-r--r--src/mame/machine/esqpanel.h28
-rw-r--r--src/mame/machine/xbox.cpp73
-rw-r--r--src/mame/mame.cpp21
-rw-r--r--src/mame/mess.cpp21
-rw-r--r--src/mame/mess.lst8
-rw-r--r--src/mame/video/apollo.cpp4
-rw-r--r--src/mame/video/blmbycar.cpp6
-rw-r--r--src/mame/video/chihiro.cpp4
-rw-r--r--src/mame/video/glass.cpp14
-rw-r--r--src/osd/modules/font/font_sdl.cpp4
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp43
-rw-r--r--src/osd/modules/lib/osdobj_common.h2
-rw-r--r--src/osd/modules/opengl/SDL1211_opengl.h6553
-rw-r--r--src/osd/modules/opengl/osd_opengl.h20
-rw-r--r--src/osd/modules/osdwindow.cpp63
-rw-r--r--src/osd/modules/osdwindow.h151
-rw-r--r--src/osd/modules/render/bgfx/blendreader.cpp51
-rw-r--r--src/osd/modules/render/bgfx/blendreader.h31
-rw-r--r--src/osd/modules/render/bgfx/chain.cpp33
-rw-r--r--src/osd/modules/render/bgfx/chain.h38
-rw-r--r--src/osd/modules/render/bgfx/chainentry.cpp44
-rw-r--r--src/osd/modules/render/bgfx/chainentry.h45
-rw-r--r--src/osd/modules/render/bgfx/chainentryreader.cpp56
-rw-r--r--src/osd/modules/render/bgfx/chainentryreader.h30
-rw-r--r--src/osd/modules/render/bgfx/chainreader.cpp95
-rw-r--r--src/osd/modules/render/bgfx/chainreader.h30
-rw-r--r--src/osd/modules/render/bgfx/cullreader.cpp22
-rw-r--r--src/osd/modules/render/bgfx/cullreader.h25
-rw-r--r--src/osd/modules/render/bgfx/depthreader.cpp36
-rw-r--r--src/osd/modules/render/bgfx/depthreader.h25
-rw-r--r--src/osd/modules/render/bgfx/effect.cpp52
-rw-r--r--src/osd/modules/render/bgfx/effect.h40
-rw-r--r--src/osd/modules/render/bgfx/effectmanager.cpp66
-rw-r--r--src/osd/modules/render/bgfx/effectmanager.h41
-rw-r--r--src/osd/modules/render/bgfx/effectreader.cpp77
-rw-r--r--src/osd/modules/render/bgfx/effectreader.h28
-rw-r--r--src/osd/modules/render/bgfx/fs_gui.sc (renamed from src/osd/modules/render/bgfx/fs_quad_texture.sc)2
-rw-r--r--src/osd/modules/render/bgfx/fs_line.sc11
-rw-r--r--src/osd/modules/render/bgfx/fs_quad.sc11
-rw-r--r--src/osd/modules/render/bgfx/fs_screen.sc16
-rw-r--r--src/osd/modules/render/bgfx/inputpair.cpp26
-rw-r--r--src/osd/modules/render/bgfx/inputpair.h37
-rw-r--r--src/osd/modules/render/bgfx/parameter.cpp56
-rw-r--r--src/osd/modules/render/bgfx/parameter.h43
-rw-r--r--src/osd/modules/render/bgfx/paramreader.cpp38
-rw-r--r--src/osd/modules/render/bgfx/paramreader.h30
-rw-r--r--src/osd/modules/render/bgfx/shadermanager.cpp84
-rw-r--r--src/osd/modules/render/bgfx/shadermanager.h37
-rw-r--r--src/osd/modules/render/bgfx/slider.cpp65
-rw-r--r--src/osd/modules/render/bgfx/slider.h49
-rw-r--r--src/osd/modules/render/bgfx/sliderreader.cpp74
-rw-r--r--src/osd/modules/render/bgfx/sliderreader.h31
-rw-r--r--src/osd/modules/render/bgfx/statereader.cpp107
-rw-r--r--src/osd/modules/render/bgfx/statereader.h38
-rw-r--r--src/osd/modules/render/bgfx/target.cpp26
-rw-r--r--src/osd/modules/render/bgfx/target.h30
-rw-r--r--src/osd/modules/render/bgfx/targetmanager.cpp55
-rw-r--r--src/osd/modules/render/bgfx/targetmanager.h44
-rw-r--r--src/osd/modules/render/bgfx/texture.cpp38
-rw-r--r--src/osd/modules/render/bgfx/texture.h39
-rw-r--r--src/osd/modules/render/bgfx/texturemanager.cpp47
-rw-r--r--src/osd/modules/render/bgfx/texturemanager.h41
-rw-r--r--src/osd/modules/render/bgfx/uniform.cpp81
-rw-r--r--src/osd/modules/render/bgfx/uniform.h48
-rw-r--r--src/osd/modules/render/bgfx/uniformreader.cpp53
-rw-r--r--src/osd/modules/render/bgfx/uniformreader.h41
-rw-r--r--src/osd/modules/render/bgfx/vs_gui.sc (renamed from src/osd/modules/render/bgfx/vs_quad_texture.sc)0
-rw-r--r--src/osd/modules/render/bgfx/vs_quad.sc13
-rw-r--r--src/osd/modules/render/bgfx/vs_screen.sc (renamed from src/osd/modules/render/bgfx/vs_line.sc)5
-rw-r--r--src/osd/modules/render/bgfx/writereader.cpp24
-rw-r--r--src/osd/modules/render/bgfx/writereader.h19
-rw-r--r--src/osd/modules/render/binpacker.cpp195
-rw-r--r--src/osd/modules/render/binpacker.h183
-rw-r--r--src/osd/modules/render/d3d/d3d9intf.cpp36
-rw-r--r--src/osd/modules/render/d3d/d3dcomm.h102
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.cpp381
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.h61
-rw-r--r--src/osd/modules/render/d3d/d3dintf.h45
-rw-r--r--src/osd/modules/render/d3dtarget.h14
-rw-r--r--src/osd/modules/render/draw13.cpp429
-rw-r--r--src/osd/modules/render/draw13.h229
-rw-r--r--src/osd/modules/render/drawbgfx.cpp1196
-rw-r--r--src/osd/modules/render/drawbgfx.h123
-rw-r--r--src/osd/modules/render/drawd3d.cpp398
-rw-r--r--src/osd/modules/render/drawd3d.h124
-rw-r--r--src/osd/modules/render/drawdd.cpp1317
-rw-r--r--src/osd/modules/render/drawgdi.cpp148
-rw-r--r--src/osd/modules/render/drawgdi.h55
-rw-r--r--src/osd/modules/render/drawnone.cpp96
-rw-r--r--src/osd/modules/render/drawnone.h34
-rw-r--r--src/osd/modules/render/drawogl.cpp815
-rw-r--r--src/osd/modules/render/drawogl.h233
-rw-r--r--src/osd/modules/render/drawsdl.cpp482
-rw-r--r--src/osd/modules/render/drawsdl.h85
-rw-r--r--src/osd/modules/render/sdlglcontext.h67
-rw-r--r--src/osd/modules/render/winglcontext.h170
-rw-r--r--src/osd/modules/sound/direct_sound.cpp9
-rw-r--r--src/osd/modules/sound/js_sound.js24
-rw-r--r--src/osd/modules/sound/sdl_sound.cpp4
-rw-r--r--src/osd/modules/sync/sync_sdl.cpp4
-rw-r--r--src/osd/osdepend.h4
-rw-r--r--src/osd/sdl/SDLMain_tmpl.h13
-rw-r--r--src/osd/sdl/SDLMain_tmpl.mm386
-rw-r--r--src/osd/sdl/input.cpp236
-rw-r--r--src/osd/sdl/osdsdl.h8
-rw-r--r--src/osd/sdl/sdlinc.h9
-rw-r--r--src/osd/sdl/sdlmain.cpp60
-rw-r--r--src/osd/sdl/sdlos_unix.cpp106
-rw-r--r--src/osd/sdl/testkeys.cpp72
-rw-r--r--src/osd/sdl/video.cpp242
-rw-r--r--src/osd/sdl/video.h125
-rw-r--r--src/osd/sdl/window.cpp299
-rw-r--r--src/osd/sdl/window.h25
-rw-r--r--src/osd/windows/video.cpp30
-rw-r--r--src/osd/windows/video.h119
-rw-r--r--src/osd/windows/window.cpp261
-rw-r--r--src/osd/windows/window.h6
-rw-r--r--src/osd/windows/winmain.cpp141
-rw-r--r--src/osd/windows/winmain.h10
-rw-r--r--src/tools/jedutil.cpp126
963 files changed, 148214 insertions, 15792 deletions
diff --git a/.gitattributes b/.gitattributes
index 8ed64ccc8cf..1e631f6f107 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -37,3 +37,4 @@ src/osd/sdl/shader/*.fsh svneol=native#text/plain
readme svneol=native#text/plain
README svneol=native#text/plain
*.ppm -text svneol=unset#image/x-portable-pixmap
+*.po eol=lf \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index a3357981d32..a2f4aa1c861 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,11 +4,14 @@
!/3rdparty/
!/benchmarks/
!/artwork/
+!/bgfx/
!/docs/
!/hash/
!/hlsl/
!/keymaps/
+!/language/
!/nl_examples/
+!/plugins/
!/regtests/
!/samples/
!/scripts/
@@ -27,6 +30,7 @@
regtests/chdman/temp
regtests/jedutil/output
*.pyc
+*.mo
/CMakeLists.txt
/src/devices/cpu/m68000/m68kops.cpp
/src/devices/cpu/m68000/m68kops.h
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
index f9988a31f61..9f7071d9564 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_metal_visitor.cpp
@@ -1020,7 +1020,17 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
const bool halfCast = (arg_prec == glsl_precision_medium || arg_prec == glsl_precision_low);
buffer.asprintf_append (halfCast ? "((half)1.0/(" : "(1.0/(");
} else {
- buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]);
+ switch(ir->operation) {
+ case ir_unop_dFdy:
+ case ir_unop_dFdy_coarse:
+ case ir_unop_dFdy_fine:
+ buffer.asprintf_append ("%s(-", operator_glsl_strs[ir->operation]);
+ break;
+
+ default:
+ buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]);
+ break;
+ }
}
if (ir->operands[0])
ir->operands[0]->accept(this);
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore b/3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore
new file mode 100644
index 00000000000..31b83a9bc9a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore
@@ -0,0 +1,58 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+.idea/
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py b/3rdparty/bgfx/3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py
new file mode 100644
index 00000000000..09eae5c4566
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/GenerateIconFontCppHeaders.py
@@ -0,0 +1,183 @@
+#!/usr/bin/python
+# Convert Font Awesome, Google Material Design and Kenney Game icon font
+# parameters to C++11 and C89 compatible formats.
+#
+#------------------------------------------------------------------------------
+# 1 - Source material
+#
+# 1.1 - Font Awesome - https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/src/icons.yml
+# 1.2 - Material Design - https://raw.githubusercontent.com/google/material-design-icons/master/iconfont/codepoints
+# 1.3 - Kenney icons - https://raw.githubusercontent.com/SamBrishes/kenney-icon-font/master/css/kenney-icons.css
+#
+#------------------------------------------------------------------------------
+# 2 - Data samples
+#
+# 2.1 - Font Awesome
+# - input: - name: Music
+# id: music
+# unicode: f001
+# created: 1.0
+# filter:
+# - note
+# - sound
+# categories:
+# - Web Application Icons
+# - output C++11: #define ICON_FA_MUSIC u8"\uf001"
+# - output C89: #define ICON_FA_MUSIC "\xEF\x80\x81"
+#
+# 2.2 - Google Material Design icons
+# - input: 3d_rotation e84d
+# - output C++11: #define ICON_MD_3D_ROTATION u8"\ue84d"
+# - output C89: #define ICON_MD_3D_ROTATION "\xEE\xA1\x8D"
+#
+# 2.3 - Kenney Game icons
+# - input: .ki-home:before{ content: "\e900"; }
+# - output C++11: #define ICON_KI_HOME u8"\ue900"
+# - output C89: #define ICON_KI_HOME "\xEE\xA4\x80"
+#
+# 2.4 - All fonts
+# - computed min and max unicode fonts ICON_MIN and ICON_MAX
+# - output: #define ICON_MIN_FA 0xf000
+# #define ICON_MAX_FA 0xf295
+#
+#------------------------------------------------------------------------------
+# 3 - Script dependencies
+#
+# 3.1 - Python 2.7 - https://www.python.org/download/releases/2.7/
+# 3.2 - Requests - http://docs.python-requests.org/
+# 3.3 - PyYAML - http://pyyaml.org/
+#
+#------------------------------------------------------------------------------
+
+
+import requests
+import yaml
+
+
+LINE_FORMAT_MINMAX = '#define ICON_{!s}_{!s} 0x{!s}\n'
+
+UNICODE_MIN = 'ffff'
+UNICODE_MAX = '0'
+TIMEOUT = 2
+
+MESSAGE_SUCCESS = '{!s} fonts - conversion success: {!s}'
+MESSAGE_ERROR = '{!s} fonts - error \n\t{!s}'
+
+
+def get_prelude( url ):
+ prelude = '// Generated by GenerateIconFontCppHeaders.py \n// from {!s}\n#pragma once\n\n'.format( url )
+ return prelude
+
+
+def line_format( font_abbr, font, unicode, cpp11 = True ):
+ if cpp11:
+ result = '#define ICON_{!s}_{!s} u8"\u{!s}"\n'.format( font_abbr, font, unicode )
+ else:
+ unicode_base = ''.join([ '{0:x}'.format( ord( x )) for x in unichr( int( unicode, 16 )).encode( 'utf-8' )]).upper()
+ unicode = '\\x' + unicode_base[ :2 ] + '\\x' + unicode_base[ 2:4 ] + '\\x' + unicode_base[ 4: ]
+ result = '#define ICON_{!s}_{!s} "{!s}"\n'.format( font_abbr, font, unicode )
+ return result
+
+
+def convert_font_awesome( font_name, font_abbr, source_url, output_file, cpp11 ):
+ try:
+ response = requests.get( source_url, timeout = TIMEOUT )
+ if response.status_code == 200:
+ input = yaml.safe_load( response.content )
+ min = UNICODE_MIN
+ max = UNICODE_MAX
+ output_fonts = ''
+ for item in input[ 'icons' ]:
+ font = ''
+ for char in item[ 'id' ]:
+ font += '_' if ( char == '-' ) else str.upper( char )
+ unicode = item[ 'unicode' ]
+ if unicode < min:
+ min = unicode
+ elif unicode >= max:
+ max = unicode
+ output_fonts += line_format( font_abbr, font, unicode, cpp11 )
+ output = get_prelude( source_url ) + \
+ LINE_FORMAT_MINMAX.format( 'MIN', font_abbr, min ) + \
+ LINE_FORMAT_MINMAX.format( 'MAX', font_abbr, max ) + \
+ output_fonts
+ with open( output_file, 'w' ) as f:
+ f.write( output )
+ print( MESSAGE_SUCCESS.format( font_name, output_file ))
+ except Exception as e:
+ print( MESSAGE_ERROR.format( font_name, e ))
+
+
+def convert_material_design( font_name, font_abbr, source_url, output_file, cpp11 ):
+ try:
+ response = requests.get( source_url, timeout = TIMEOUT )
+ if response.status_code == 200:
+ input = str.split( response.content, '\n' )
+ min = UNICODE_MIN
+ max = UNICODE_MAX
+ output_fonts = ''
+ for line in input:
+ words = str.split( line )
+ if words:
+ font = ''
+ for char in words[ 0 ]:
+ font += '_' if ( char == '-' ) else str.upper( char )
+ unicode = words[ 1 ]
+ if unicode < min:
+ min = unicode
+ elif unicode >= max:
+ max = unicode
+ output_fonts += line_format( font_abbr, font, unicode, cpp11 )
+ output = get_prelude( source_url ) + \
+ LINE_FORMAT_MINMAX.format( 'MIN', font_abbr, min ) + \
+ LINE_FORMAT_MINMAX.format( 'MAX', font_abbr, max ) + \
+ output_fonts
+ with open( output_file, 'w' ) as f:
+ f.write( output )
+ print( MESSAGE_SUCCESS.format( font_name, output_file ))
+ except Exception as e:
+ print( MESSAGE_ERROR.format( font_name, e ))
+
+
+def convert_kenney( font_name, font_abbr, source_url, output_file, cpp11 ):
+ try:
+ response = requests.get( source_url, timeout = TIMEOUT )
+ if response.status_code == 200:
+ input = str.split( response.content, '\n' )
+ min = UNICODE_MIN
+ max = UNICODE_MAX
+ output_fonts = ''
+ font_begin= '.ki-'
+ font_end = ':before'
+ unicode_begin = '"\\'
+ unicode_end = '";'
+ for line in input:
+ words = str.split( line )
+ if words:
+ if font_begin in words[ 0 ]:
+ font = ''
+ word = words[ 0 ][( words[ 0 ].find( font_begin ) + len( font_begin )) : ( words[ 0 ].find( font_end ))]
+ for char in word:
+ font += '_' if ( char == '-' ) else str.upper( char )
+ unicode = str( words[ 2 ][( words[ 2 ].find( unicode_begin ) + len( unicode_begin )) : words[ 2 ].find( unicode_end )])
+ if unicode < min:
+ min = unicode
+ elif unicode >= max:
+ max = unicode
+ output_fonts += line_format( font_abbr, font, unicode, cpp11 )
+ output = get_prelude( source_url ) + \
+ LINE_FORMAT_MINMAX.format( 'MIN', font_abbr, min ) + \
+ LINE_FORMAT_MINMAX.format( 'MAX', font_abbr, max ) + \
+ output_fonts
+ with open( output_file, 'w' ) as f:
+ f.write( output )
+ print( MESSAGE_SUCCESS.format( font_name, output_file ))
+ except Exception as e:
+ print( MESSAGE_ERROR.format( font_name, e ))
+
+
+# Main
+
+convert_font_awesome( 'Font Awesome', 'FA', 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/src/icons.yml', 'icons_font_awesome.h', False )
+convert_material_design( 'Material Design', 'MD', 'https://raw.githubusercontent.com/google/material-design-icons/master/iconfont/codepoints', 'icons_material_design.h', False )
+convert_kenney( 'Kenney', 'KI', 'https://raw.githubusercontent.com/SamBrishes/kenney-icon-font/master/css/kenney-icons.css', 'icons_kenney.h', False )
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/LICENSE b/3rdparty/bgfx/3rdparty/iconfontheaders/LICENSE
new file mode 100644
index 00000000000..f54b795b715
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Juliette Foucaut
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/README.md b/3rdparty/bgfx/3rdparty/iconfontheaders/README.md
new file mode 100644
index 00000000000..2170dee402f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/README.md
@@ -0,0 +1,29 @@
+# IconFontCHeaders
+C++11 and C89 headers for icon fonts Font Awesome, Google Material Design icons and Kenney game icons.
+
+A set of header files for using icon fonts in C and C++, along with the python generator used to create the files.
+
+Each header contains defines for one font, with each icon code point defined as ICON_*, along with the min and max code points for font loading purposes.
+
+## Fonts
+
+* [Font Awesome](http://fortawesome.github.io/Font-Awesome/) - [github repository](https://github.com/FortAwesome/Font-Awesome/)
+* [Google Material Design icons](https://design.google.com/icons/) - [github repository](https://github.com/google/material-design-icons/)
+* [Kenney Game icons](http://kenney.nl/assets/game-icons) and [Game icons expansion](http://kenney.nl/assets/game-icons-expansion) - [github repository](https://github.com/SamBrishes/kenney-icon-font)
+
+## Usage
+
+Using [dear imgui](https://github.com/ocornut/imgui) as an example UI library:
+
+ #include "IconsFontAwesome.h"
+
+ ImGuiIO& io = ImGui::GetIO();
+ io.Fonts->AddFontDefault();
+
+ // merge in icons from Font Awesome
+ static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
+ ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
+ io.Fonts->AddFontFromFileTTF( fontFile.c_str(), 16.0f, &icons_config, icons_ranges);
+
+ // in an imgui window somewhere...
+ ImGui::Text( ICON_FA_FILE " File" ); // use string literal concatenation, ouputs a file icon and File as a string.
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/icons_font_awesome.h b/3rdparty/bgfx/3rdparty/iconfontheaders/icons_font_awesome.h
new file mode 100644
index 00000000000..346358f0044
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/icons_font_awesome.h
@@ -0,0 +1,611 @@
+// Generated by GenerateIconFontCppHeaders.py
+// from https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/src/icons.yml
+#pragma once
+
+#define ICON_MIN_FA 0xf000
+#define ICON_MAX_FA 0xf295
+#define ICON_FA_GLASS "\xEF\x80\x80"
+#define ICON_FA_MUSIC "\xEF\x80\x81"
+#define ICON_FA_SEARCH "\xEF\x80\x82"
+#define ICON_FA_ENVELOPE_O "\xEF\x80\x83"
+#define ICON_FA_HEART "\xEF\x80\x84"
+#define ICON_FA_STAR "\xEF\x80\x85"
+#define ICON_FA_STAR_O "\xEF\x80\x86"
+#define ICON_FA_USER "\xEF\x80\x87"
+#define ICON_FA_FILM "\xEF\x80\x88"
+#define ICON_FA_TH_LARGE "\xEF\x80\x89"
+#define ICON_FA_TH "\xEF\x80\x8A"
+#define ICON_FA_TH_LIST "\xEF\x80\x8B"
+#define ICON_FA_CHECK "\xEF\x80\x8C"
+#define ICON_FA_TIMES "\xEF\x80\x8D"
+#define ICON_FA_SEARCH_PLUS "\xEF\x80\x8E"
+#define ICON_FA_SEARCH_MINUS "\xEF\x80\x90"
+#define ICON_FA_POWER_OFF "\xEF\x80\x91"
+#define ICON_FA_SIGNAL "\xEF\x80\x92"
+#define ICON_FA_COG "\xEF\x80\x93"
+#define ICON_FA_TRASH_O "\xEF\x80\x94"
+#define ICON_FA_HOME "\xEF\x80\x95"
+#define ICON_FA_FILE_O "\xEF\x80\x96"
+#define ICON_FA_CLOCK_O "\xEF\x80\x97"
+#define ICON_FA_ROAD "\xEF\x80\x98"
+#define ICON_FA_DOWNLOAD "\xEF\x80\x99"
+#define ICON_FA_ARROW_CIRCLE_O_DOWN "\xEF\x80\x9A"
+#define ICON_FA_ARROW_CIRCLE_O_UP "\xEF\x80\x9B"
+#define ICON_FA_INBOX "\xEF\x80\x9C"
+#define ICON_FA_PLAY_CIRCLE_O "\xEF\x80\x9D"
+#define ICON_FA_REPEAT "\xEF\x80\x9E"
+#define ICON_FA_REFRESH "\xEF\x80\xA1"
+#define ICON_FA_LIST_ALT "\xEF\x80\xA2"
+#define ICON_FA_LOCK "\xEF\x80\xA3"
+#define ICON_FA_FLAG "\xEF\x80\xA4"
+#define ICON_FA_HEADPHONES "\xEF\x80\xA5"
+#define ICON_FA_VOLUME_OFF "\xEF\x80\xA6"
+#define ICON_FA_VOLUME_DOWN "\xEF\x80\xA7"
+#define ICON_FA_VOLUME_UP "\xEF\x80\xA8"
+#define ICON_FA_QRCODE "\xEF\x80\xA9"
+#define ICON_FA_BARCODE "\xEF\x80\xAA"
+#define ICON_FA_TAG "\xEF\x80\xAB"
+#define ICON_FA_TAGS "\xEF\x80\xAC"
+#define ICON_FA_BOOK "\xEF\x80\xAD"
+#define ICON_FA_BOOKMARK "\xEF\x80\xAE"
+#define ICON_FA_PRINT "\xEF\x80\xAF"
+#define ICON_FA_CAMERA "\xEF\x80\xB0"
+#define ICON_FA_FONT "\xEF\x80\xB1"
+#define ICON_FA_BOLD "\xEF\x80\xB2"
+#define ICON_FA_ITALIC "\xEF\x80\xB3"
+#define ICON_FA_TEXT_HEIGHT "\xEF\x80\xB4"
+#define ICON_FA_TEXT_WIDTH "\xEF\x80\xB5"
+#define ICON_FA_ALIGN_LEFT "\xEF\x80\xB6"
+#define ICON_FA_ALIGN_CENTER "\xEF\x80\xB7"
+#define ICON_FA_ALIGN_RIGHT "\xEF\x80\xB8"
+#define ICON_FA_ALIGN_JUSTIFY "\xEF\x80\xB9"
+#define ICON_FA_LIST "\xEF\x80\xBA"
+#define ICON_FA_OUTDENT "\xEF\x80\xBB"
+#define ICON_FA_INDENT "\xEF\x80\xBC"
+#define ICON_FA_VIDEO_CAMERA "\xEF\x80\xBD"
+#define ICON_FA_PICTURE_O "\xEF\x80\xBE"
+#define ICON_FA_PENCIL "\xEF\x81\x80"
+#define ICON_FA_MAP_MARKER "\xEF\x81\x81"
+#define ICON_FA_ADJUST "\xEF\x81\x82"
+#define ICON_FA_TINT "\xEF\x81\x83"
+#define ICON_FA_PENCIL_SQUARE_O "\xEF\x81\x84"
+#define ICON_FA_SHARE_SQUARE_O "\xEF\x81\x85"
+#define ICON_FA_CHECK_SQUARE_O "\xEF\x81\x86"
+#define ICON_FA_ARROWS "\xEF\x81\x87"
+#define ICON_FA_STEP_BACKWARD "\xEF\x81\x88"
+#define ICON_FA_FAST_BACKWARD "\xEF\x81\x89"
+#define ICON_FA_BACKWARD "\xEF\x81\x8A"
+#define ICON_FA_PLAY "\xEF\x81\x8B"
+#define ICON_FA_PAUSE "\xEF\x81\x8C"
+#define ICON_FA_STOP "\xEF\x81\x8D"
+#define ICON_FA_FORWARD "\xEF\x81\x8E"
+#define ICON_FA_FAST_FORWARD "\xEF\x81\x90"
+#define ICON_FA_STEP_FORWARD "\xEF\x81\x91"
+#define ICON_FA_EJECT "\xEF\x81\x92"
+#define ICON_FA_CHEVRON_LEFT "\xEF\x81\x93"
+#define ICON_FA_CHEVRON_RIGHT "\xEF\x81\x94"
+#define ICON_FA_PLUS_CIRCLE "\xEF\x81\x95"
+#define ICON_FA_MINUS_CIRCLE "\xEF\x81\x96"
+#define ICON_FA_TIMES_CIRCLE "\xEF\x81\x97"
+#define ICON_FA_CHECK_CIRCLE "\xEF\x81\x98"
+#define ICON_FA_QUESTION_CIRCLE "\xEF\x81\x99"
+#define ICON_FA_INFO_CIRCLE "\xEF\x81\x9A"
+#define ICON_FA_CROSSHAIRS "\xEF\x81\x9B"
+#define ICON_FA_TIMES_CIRCLE_O "\xEF\x81\x9C"
+#define ICON_FA_CHECK_CIRCLE_O "\xEF\x81\x9D"
+#define ICON_FA_BAN "\xEF\x81\x9E"
+#define ICON_FA_ARROW_LEFT "\xEF\x81\xA0"
+#define ICON_FA_ARROW_RIGHT "\xEF\x81\xA1"
+#define ICON_FA_ARROW_UP "\xEF\x81\xA2"
+#define ICON_FA_ARROW_DOWN "\xEF\x81\xA3"
+#define ICON_FA_SHARE "\xEF\x81\xA4"
+#define ICON_FA_EXPAND "\xEF\x81\xA5"
+#define ICON_FA_COMPRESS "\xEF\x81\xA6"
+#define ICON_FA_PLUS "\xEF\x81\xA7"
+#define ICON_FA_MINUS "\xEF\x81\xA8"
+#define ICON_FA_ASTERISK "\xEF\x81\xA9"
+#define ICON_FA_EXCLAMATION_CIRCLE "\xEF\x81\xAA"
+#define ICON_FA_GIFT "\xEF\x81\xAB"
+#define ICON_FA_LEAF "\xEF\x81\xAC"
+#define ICON_FA_FIRE "\xEF\x81\xAD"
+#define ICON_FA_EYE "\xEF\x81\xAE"
+#define ICON_FA_EYE_SLASH "\xEF\x81\xB0"
+#define ICON_FA_EXCLAMATION_TRIANGLE "\xEF\x81\xB1"
+#define ICON_FA_PLANE "\xEF\x81\xB2"
+#define ICON_FA_CALENDAR "\xEF\x81\xB3"
+#define ICON_FA_RANDOM "\xEF\x81\xB4"
+#define ICON_FA_COMMENT "\xEF\x81\xB5"
+#define ICON_FA_MAGNET "\xEF\x81\xB6"
+#define ICON_FA_CHEVRON_UP "\xEF\x81\xB7"
+#define ICON_FA_CHEVRON_DOWN "\xEF\x81\xB8"
+#define ICON_FA_RETWEET "\xEF\x81\xB9"
+#define ICON_FA_SHOPPING_CART "\xEF\x81\xBA"
+#define ICON_FA_FOLDER "\xEF\x81\xBB"
+#define ICON_FA_FOLDER_OPEN "\xEF\x81\xBC"
+#define ICON_FA_ARROWS_V "\xEF\x81\xBD"
+#define ICON_FA_ARROWS_H "\xEF\x81\xBE"
+#define ICON_FA_BAR_CHART "\xEF\x82\x80"
+#define ICON_FA_TWITTER_SQUARE "\xEF\x82\x81"
+#define ICON_FA_FACEBOOK_SQUARE "\xEF\x82\x82"
+#define ICON_FA_CAMERA_RETRO "\xEF\x82\x83"
+#define ICON_FA_KEY "\xEF\x82\x84"
+#define ICON_FA_COGS "\xEF\x82\x85"
+#define ICON_FA_COMMENTS "\xEF\x82\x86"
+#define ICON_FA_THUMBS_O_UP "\xEF\x82\x87"
+#define ICON_FA_THUMBS_O_DOWN "\xEF\x82\x88"
+#define ICON_FA_STAR_HALF "\xEF\x82\x89"
+#define ICON_FA_HEART_O "\xEF\x82\x8A"
+#define ICON_FA_SIGN_OUT "\xEF\x82\x8B"
+#define ICON_FA_LINKEDIN_SQUARE "\xEF\x82\x8C"
+#define ICON_FA_THUMB_TACK "\xEF\x82\x8D"
+#define ICON_FA_EXTERNAL_LINK "\xEF\x82\x8E"
+#define ICON_FA_SIGN_IN "\xEF\x82\x90"
+#define ICON_FA_TROPHY "\xEF\x82\x91"
+#define ICON_FA_GITHUB_SQUARE "\xEF\x82\x92"
+#define ICON_FA_UPLOAD "\xEF\x82\x93"
+#define ICON_FA_LEMON_O "\xEF\x82\x94"
+#define ICON_FA_PHONE "\xEF\x82\x95"
+#define ICON_FA_SQUARE_O "\xEF\x82\x96"
+#define ICON_FA_BOOKMARK_O "\xEF\x82\x97"
+#define ICON_FA_PHONE_SQUARE "\xEF\x82\x98"
+#define ICON_FA_TWITTER "\xEF\x82\x99"
+#define ICON_FA_FACEBOOK "\xEF\x82\x9A"
+#define ICON_FA_GITHUB "\xEF\x82\x9B"
+#define ICON_FA_UNLOCK "\xEF\x82\x9C"
+#define ICON_FA_CREDIT_CARD "\xEF\x82\x9D"
+#define ICON_FA_RSS "\xEF\x82\x9E"
+#define ICON_FA_HDD_O "\xEF\x82\xA0"
+#define ICON_FA_BULLHORN "\xEF\x82\xA1"
+#define ICON_FA_BELL "\xEF\x83\xB3"
+#define ICON_FA_CERTIFICATE "\xEF\x82\xA3"
+#define ICON_FA_HAND_O_RIGHT "\xEF\x82\xA4"
+#define ICON_FA_HAND_O_LEFT "\xEF\x82\xA5"
+#define ICON_FA_HAND_O_UP "\xEF\x82\xA6"
+#define ICON_FA_HAND_O_DOWN "\xEF\x82\xA7"
+#define ICON_FA_ARROW_CIRCLE_LEFT "\xEF\x82\xA8"
+#define ICON_FA_ARROW_CIRCLE_RIGHT "\xEF\x82\xA9"
+#define ICON_FA_ARROW_CIRCLE_UP "\xEF\x82\xAA"
+#define ICON_FA_ARROW_CIRCLE_DOWN "\xEF\x82\xAB"
+#define ICON_FA_GLOBE "\xEF\x82\xAC"
+#define ICON_FA_WRENCH "\xEF\x82\xAD"
+#define ICON_FA_TASKS "\xEF\x82\xAE"
+#define ICON_FA_FILTER "\xEF\x82\xB0"
+#define ICON_FA_BRIEFCASE "\xEF\x82\xB1"
+#define ICON_FA_ARROWS_ALT "\xEF\x82\xB2"
+#define ICON_FA_USERS "\xEF\x83\x80"
+#define ICON_FA_LINK "\xEF\x83\x81"
+#define ICON_FA_CLOUD "\xEF\x83\x82"
+#define ICON_FA_FLASK "\xEF\x83\x83"
+#define ICON_FA_SCISSORS "\xEF\x83\x84"
+#define ICON_FA_FILES_O "\xEF\x83\x85"
+#define ICON_FA_PAPERCLIP "\xEF\x83\x86"
+#define ICON_FA_FLOPPY_O "\xEF\x83\x87"
+#define ICON_FA_SQUARE "\xEF\x83\x88"
+#define ICON_FA_BARS "\xEF\x83\x89"
+#define ICON_FA_LIST_UL "\xEF\x83\x8A"
+#define ICON_FA_LIST_OL "\xEF\x83\x8B"
+#define ICON_FA_STRIKETHROUGH "\xEF\x83\x8C"
+#define ICON_FA_UNDERLINE "\xEF\x83\x8D"
+#define ICON_FA_TABLE "\xEF\x83\x8E"
+#define ICON_FA_MAGIC "\xEF\x83\x90"
+#define ICON_FA_TRUCK "\xEF\x83\x91"
+#define ICON_FA_PINTEREST "\xEF\x83\x92"
+#define ICON_FA_PINTEREST_SQUARE "\xEF\x83\x93"
+#define ICON_FA_GOOGLE_PLUS_SQUARE "\xEF\x83\x94"
+#define ICON_FA_GOOGLE_PLUS "\xEF\x83\x95"
+#define ICON_FA_MONEY "\xEF\x83\x96"
+#define ICON_FA_CARET_DOWN "\xEF\x83\x97"
+#define ICON_FA_CARET_UP "\xEF\x83\x98"
+#define ICON_FA_CARET_LEFT "\xEF\x83\x99"
+#define ICON_FA_CARET_RIGHT "\xEF\x83\x9A"
+#define ICON_FA_COLUMNS "\xEF\x83\x9B"
+#define ICON_FA_SORT "\xEF\x83\x9C"
+#define ICON_FA_SORT_DESC "\xEF\x83\x9D"
+#define ICON_FA_SORT_ASC "\xEF\x83\x9E"
+#define ICON_FA_ENVELOPE "\xEF\x83\xA0"
+#define ICON_FA_LINKEDIN "\xEF\x83\xA1"
+#define ICON_FA_UNDO "\xEF\x83\xA2"
+#define ICON_FA_GAVEL "\xEF\x83\xA3"
+#define ICON_FA_TACHOMETER "\xEF\x83\xA4"
+#define ICON_FA_COMMENT_O "\xEF\x83\xA5"
+#define ICON_FA_COMMENTS_O "\xEF\x83\xA6"
+#define ICON_FA_BOLT "\xEF\x83\xA7"
+#define ICON_FA_SITEMAP "\xEF\x83\xA8"
+#define ICON_FA_UMBRELLA "\xEF\x83\xA9"
+#define ICON_FA_CLIPBOARD "\xEF\x83\xAA"
+#define ICON_FA_LIGHTBULB_O "\xEF\x83\xAB"
+#define ICON_FA_EXCHANGE "\xEF\x83\xAC"
+#define ICON_FA_CLOUD_DOWNLOAD "\xEF\x83\xAD"
+#define ICON_FA_CLOUD_UPLOAD "\xEF\x83\xAE"
+#define ICON_FA_USER_MD "\xEF\x83\xB0"
+#define ICON_FA_STETHOSCOPE "\xEF\x83\xB1"
+#define ICON_FA_SUITCASE "\xEF\x83\xB2"
+#define ICON_FA_BELL_O "\xEF\x82\xA2"
+#define ICON_FA_COFFEE "\xEF\x83\xB4"
+#define ICON_FA_CUTLERY "\xEF\x83\xB5"
+#define ICON_FA_FILE_TEXT_O "\xEF\x83\xB6"
+#define ICON_FA_BUILDING_O "\xEF\x83\xB7"
+#define ICON_FA_HOSPITAL_O "\xEF\x83\xB8"
+#define ICON_FA_AMBULANCE "\xEF\x83\xB9"
+#define ICON_FA_MEDKIT "\xEF\x83\xBA"
+#define ICON_FA_FIGHTER_JET "\xEF\x83\xBB"
+#define ICON_FA_BEER "\xEF\x83\xBC"
+#define ICON_FA_H_SQUARE "\xEF\x83\xBD"
+#define ICON_FA_PLUS_SQUARE "\xEF\x83\xBE"
+#define ICON_FA_ANGLE_DOUBLE_LEFT "\xEF\x84\x80"
+#define ICON_FA_ANGLE_DOUBLE_RIGHT "\xEF\x84\x81"
+#define ICON_FA_ANGLE_DOUBLE_UP "\xEF\x84\x82"
+#define ICON_FA_ANGLE_DOUBLE_DOWN "\xEF\x84\x83"
+#define ICON_FA_ANGLE_LEFT "\xEF\x84\x84"
+#define ICON_FA_ANGLE_RIGHT "\xEF\x84\x85"
+#define ICON_FA_ANGLE_UP "\xEF\x84\x86"
+#define ICON_FA_ANGLE_DOWN "\xEF\x84\x87"
+#define ICON_FA_DESKTOP "\xEF\x84\x88"
+#define ICON_FA_LAPTOP "\xEF\x84\x89"
+#define ICON_FA_TABLET "\xEF\x84\x8A"
+#define ICON_FA_MOBILE "\xEF\x84\x8B"
+#define ICON_FA_CIRCLE_O "\xEF\x84\x8C"
+#define ICON_FA_QUOTE_LEFT "\xEF\x84\x8D"
+#define ICON_FA_QUOTE_RIGHT "\xEF\x84\x8E"
+#define ICON_FA_SPINNER "\xEF\x84\x90"
+#define ICON_FA_CIRCLE "\xEF\x84\x91"
+#define ICON_FA_REPLY "\xEF\x84\x92"
+#define ICON_FA_GITHUB_ALT "\xEF\x84\x93"
+#define ICON_FA_FOLDER_O "\xEF\x84\x94"
+#define ICON_FA_FOLDER_OPEN_O "\xEF\x84\x95"
+#define ICON_FA_SMILE_O "\xEF\x84\x98"
+#define ICON_FA_FROWN_O "\xEF\x84\x99"
+#define ICON_FA_MEH_O "\xEF\x84\x9A"
+#define ICON_FA_GAMEPAD "\xEF\x84\x9B"
+#define ICON_FA_KEYBOARD_O "\xEF\x84\x9C"
+#define ICON_FA_FLAG_O "\xEF\x84\x9D"
+#define ICON_FA_FLAG_CHECKERED "\xEF\x84\x9E"
+#define ICON_FA_TERMINAL "\xEF\x84\xA0"
+#define ICON_FA_CODE "\xEF\x84\xA1"
+#define ICON_FA_REPLY_ALL "\xEF\x84\xA2"
+#define ICON_FA_STAR_HALF_O "\xEF\x84\xA3"
+#define ICON_FA_LOCATION_ARROW "\xEF\x84\xA4"
+#define ICON_FA_CROP "\xEF\x84\xA5"
+#define ICON_FA_CODE_FORK "\xEF\x84\xA6"
+#define ICON_FA_CHAIN_BROKEN "\xEF\x84\xA7"
+#define ICON_FA_QUESTION "\xEF\x84\xA8"
+#define ICON_FA_INFO "\xEF\x84\xA9"
+#define ICON_FA_EXCLAMATION "\xEF\x84\xAA"
+#define ICON_FA_SUPERSCRIPT "\xEF\x84\xAB"
+#define ICON_FA_SUBSCRIPT "\xEF\x84\xAC"
+#define ICON_FA_ERASER "\xEF\x84\xAD"
+#define ICON_FA_PUZZLE_PIECE "\xEF\x84\xAE"
+#define ICON_FA_MICROPHONE "\xEF\x84\xB0"
+#define ICON_FA_MICROPHONE_SLASH "\xEF\x84\xB1"
+#define ICON_FA_SHIELD "\xEF\x84\xB2"
+#define ICON_FA_CALENDAR_O "\xEF\x84\xB3"
+#define ICON_FA_FIRE_EXTINGUISHER "\xEF\x84\xB4"
+#define ICON_FA_ROCKET "\xEF\x84\xB5"
+#define ICON_FA_MAXCDN "\xEF\x84\xB6"
+#define ICON_FA_CHEVRON_CIRCLE_LEFT "\xEF\x84\xB7"
+#define ICON_FA_CHEVRON_CIRCLE_RIGHT "\xEF\x84\xB8"
+#define ICON_FA_CHEVRON_CIRCLE_UP "\xEF\x84\xB9"
+#define ICON_FA_CHEVRON_CIRCLE_DOWN "\xEF\x84\xBA"
+#define ICON_FA_HTML5 "\xEF\x84\xBB"
+#define ICON_FA_CSS3 "\xEF\x84\xBC"
+#define ICON_FA_ANCHOR "\xEF\x84\xBD"
+#define ICON_FA_UNLOCK_ALT "\xEF\x84\xBE"
+#define ICON_FA_BULLSEYE "\xEF\x85\x80"
+#define ICON_FA_ELLIPSIS_H "\xEF\x85\x81"
+#define ICON_FA_ELLIPSIS_V "\xEF\x85\x82"
+#define ICON_FA_RSS_SQUARE "\xEF\x85\x83"
+#define ICON_FA_PLAY_CIRCLE "\xEF\x85\x84"
+#define ICON_FA_TICKET "\xEF\x85\x85"
+#define ICON_FA_MINUS_SQUARE "\xEF\x85\x86"
+#define ICON_FA_MINUS_SQUARE_O "\xEF\x85\x87"
+#define ICON_FA_LEVEL_UP "\xEF\x85\x88"
+#define ICON_FA_LEVEL_DOWN "\xEF\x85\x89"
+#define ICON_FA_CHECK_SQUARE "\xEF\x85\x8A"
+#define ICON_FA_PENCIL_SQUARE "\xEF\x85\x8B"
+#define ICON_FA_EXTERNAL_LINK_SQUARE "\xEF\x85\x8C"
+#define ICON_FA_SHARE_SQUARE "\xEF\x85\x8D"
+#define ICON_FA_COMPASS "\xEF\x85\x8E"
+#define ICON_FA_CARET_SQUARE_O_DOWN "\xEF\x85\x90"
+#define ICON_FA_CARET_SQUARE_O_UP "\xEF\x85\x91"
+#define ICON_FA_CARET_SQUARE_O_RIGHT "\xEF\x85\x92"
+#define ICON_FA_EUR "\xEF\x85\x93"
+#define ICON_FA_GBP "\xEF\x85\x94"
+#define ICON_FA_USD "\xEF\x85\x95"
+#define ICON_FA_INR "\xEF\x85\x96"
+#define ICON_FA_JPY "\xEF\x85\x97"
+#define ICON_FA_RUB "\xEF\x85\x98"
+#define ICON_FA_KRW "\xEF\x85\x99"
+#define ICON_FA_BTC "\xEF\x85\x9A"
+#define ICON_FA_FILE "\xEF\x85\x9B"
+#define ICON_FA_FILE_TEXT "\xEF\x85\x9C"
+#define ICON_FA_SORT_ALPHA_ASC "\xEF\x85\x9D"
+#define ICON_FA_SORT_ALPHA_DESC "\xEF\x85\x9E"
+#define ICON_FA_SORT_AMOUNT_ASC "\xEF\x85\xA0"
+#define ICON_FA_SORT_AMOUNT_DESC "\xEF\x85\xA1"
+#define ICON_FA_SORT_NUMERIC_ASC "\xEF\x85\xA2"
+#define ICON_FA_SORT_NUMERIC_DESC "\xEF\x85\xA3"
+#define ICON_FA_THUMBS_UP "\xEF\x85\xA4"
+#define ICON_FA_THUMBS_DOWN "\xEF\x85\xA5"
+#define ICON_FA_YOUTUBE_SQUARE "\xEF\x85\xA6"
+#define ICON_FA_YOUTUBE "\xEF\x85\xA7"
+#define ICON_FA_XING "\xEF\x85\xA8"
+#define ICON_FA_XING_SQUARE "\xEF\x85\xA9"
+#define ICON_FA_YOUTUBE_PLAY "\xEF\x85\xAA"
+#define ICON_FA_DROPBOX "\xEF\x85\xAB"
+#define ICON_FA_STACK_OVERFLOW "\xEF\x85\xAC"
+#define ICON_FA_INSTAGRAM "\xEF\x85\xAD"
+#define ICON_FA_FLICKR "\xEF\x85\xAE"
+#define ICON_FA_ADN "\xEF\x85\xB0"
+#define ICON_FA_BITBUCKET "\xEF\x85\xB1"
+#define ICON_FA_BITBUCKET_SQUARE "\xEF\x85\xB2"
+#define ICON_FA_TUMBLR "\xEF\x85\xB3"
+#define ICON_FA_TUMBLR_SQUARE "\xEF\x85\xB4"
+#define ICON_FA_LONG_ARROW_DOWN "\xEF\x85\xB5"
+#define ICON_FA_LONG_ARROW_UP "\xEF\x85\xB6"
+#define ICON_FA_LONG_ARROW_LEFT "\xEF\x85\xB7"
+#define ICON_FA_LONG_ARROW_RIGHT "\xEF\x85\xB8"
+#define ICON_FA_APPLE "\xEF\x85\xB9"
+#define ICON_FA_WINDOWS "\xEF\x85\xBA"
+#define ICON_FA_ANDROID "\xEF\x85\xBB"
+#define ICON_FA_LINUX "\xEF\x85\xBC"
+#define ICON_FA_DRIBBBLE "\xEF\x85\xBD"
+#define ICON_FA_SKYPE "\xEF\x85\xBE"
+#define ICON_FA_FOURSQUARE "\xEF\x86\x80"
+#define ICON_FA_TRELLO "\xEF\x86\x81"
+#define ICON_FA_FEMALE "\xEF\x86\x82"
+#define ICON_FA_MALE "\xEF\x86\x83"
+#define ICON_FA_GRATIPAY "\xEF\x86\x84"
+#define ICON_FA_SUN_O "\xEF\x86\x85"
+#define ICON_FA_MOON_O "\xEF\x86\x86"
+#define ICON_FA_ARCHIVE "\xEF\x86\x87"
+#define ICON_FA_BUG "\xEF\x86\x88"
+#define ICON_FA_VK "\xEF\x86\x89"
+#define ICON_FA_WEIBO "\xEF\x86\x8A"
+#define ICON_FA_RENREN "\xEF\x86\x8B"
+#define ICON_FA_PAGELINES "\xEF\x86\x8C"
+#define ICON_FA_STACK_EXCHANGE "\xEF\x86\x8D"
+#define ICON_FA_ARROW_CIRCLE_O_RIGHT "\xEF\x86\x8E"
+#define ICON_FA_ARROW_CIRCLE_O_LEFT "\xEF\x86\x90"
+#define ICON_FA_CARET_SQUARE_O_LEFT "\xEF\x86\x91"
+#define ICON_FA_DOT_CIRCLE_O "\xEF\x86\x92"
+#define ICON_FA_WHEELCHAIR "\xEF\x86\x93"
+#define ICON_FA_VIMEO_SQUARE "\xEF\x86\x94"
+#define ICON_FA_TRY "\xEF\x86\x95"
+#define ICON_FA_PLUS_SQUARE_O "\xEF\x86\x96"
+#define ICON_FA_SPACE_SHUTTLE "\xEF\x86\x97"
+#define ICON_FA_SLACK "\xEF\x86\x98"
+#define ICON_FA_ENVELOPE_SQUARE "\xEF\x86\x99"
+#define ICON_FA_WORDPRESS "\xEF\x86\x9A"
+#define ICON_FA_OPENID "\xEF\x86\x9B"
+#define ICON_FA_UNIVERSITY "\xEF\x86\x9C"
+#define ICON_FA_GRADUATION_CAP "\xEF\x86\x9D"
+#define ICON_FA_YAHOO "\xEF\x86\x9E"
+#define ICON_FA_GOOGLE "\xEF\x86\xA0"
+#define ICON_FA_REDDIT "\xEF\x86\xA1"
+#define ICON_FA_REDDIT_SQUARE "\xEF\x86\xA2"
+#define ICON_FA_STUMBLEUPON_CIRCLE "\xEF\x86\xA3"
+#define ICON_FA_STUMBLEUPON "\xEF\x86\xA4"
+#define ICON_FA_DELICIOUS "\xEF\x86\xA5"
+#define ICON_FA_DIGG "\xEF\x86\xA6"
+#define ICON_FA_PIED_PIPER "\xEF\x86\xA7"
+#define ICON_FA_PIED_PIPER_ALT "\xEF\x86\xA8"
+#define ICON_FA_DRUPAL "\xEF\x86\xA9"
+#define ICON_FA_JOOMLA "\xEF\x86\xAA"
+#define ICON_FA_LANGUAGE "\xEF\x86\xAB"
+#define ICON_FA_FAX "\xEF\x86\xAC"
+#define ICON_FA_BUILDING "\xEF\x86\xAD"
+#define ICON_FA_CHILD "\xEF\x86\xAE"
+#define ICON_FA_PAW "\xEF\x86\xB0"
+#define ICON_FA_SPOON "\xEF\x86\xB1"
+#define ICON_FA_CUBE "\xEF\x86\xB2"
+#define ICON_FA_CUBES "\xEF\x86\xB3"
+#define ICON_FA_BEHANCE "\xEF\x86\xB4"
+#define ICON_FA_BEHANCE_SQUARE "\xEF\x86\xB5"
+#define ICON_FA_STEAM "\xEF\x86\xB6"
+#define ICON_FA_STEAM_SQUARE "\xEF\x86\xB7"
+#define ICON_FA_RECYCLE "\xEF\x86\xB8"
+#define ICON_FA_CAR "\xEF\x86\xB9"
+#define ICON_FA_TAXI "\xEF\x86\xBA"
+#define ICON_FA_TREE "\xEF\x86\xBB"
+#define ICON_FA_SPOTIFY "\xEF\x86\xBC"
+#define ICON_FA_DEVIANTART "\xEF\x86\xBD"
+#define ICON_FA_SOUNDCLOUD "\xEF\x86\xBE"
+#define ICON_FA_DATABASE "\xEF\x87\x80"
+#define ICON_FA_FILE_PDF_O "\xEF\x87\x81"
+#define ICON_FA_FILE_WORD_O "\xEF\x87\x82"
+#define ICON_FA_FILE_EXCEL_O "\xEF\x87\x83"
+#define ICON_FA_FILE_POWERPOINT_O "\xEF\x87\x84"
+#define ICON_FA_FILE_IMAGE_O "\xEF\x87\x85"
+#define ICON_FA_FILE_ARCHIVE_O "\xEF\x87\x86"
+#define ICON_FA_FILE_AUDIO_O "\xEF\x87\x87"
+#define ICON_FA_FILE_VIDEO_O "\xEF\x87\x88"
+#define ICON_FA_FILE_CODE_O "\xEF\x87\x89"
+#define ICON_FA_VINE "\xEF\x87\x8A"
+#define ICON_FA_CODEPEN "\xEF\x87\x8B"
+#define ICON_FA_JSFIDDLE "\xEF\x87\x8C"
+#define ICON_FA_LIFE_RING "\xEF\x87\x8D"
+#define ICON_FA_CIRCLE_O_NOTCH "\xEF\x87\x8E"
+#define ICON_FA_REBEL "\xEF\x87\x90"
+#define ICON_FA_EMPIRE "\xEF\x87\x91"
+#define ICON_FA_GIT_SQUARE "\xEF\x87\x92"
+#define ICON_FA_GIT "\xEF\x87\x93"
+#define ICON_FA_HACKER_NEWS "\xEF\x87\x94"
+#define ICON_FA_TENCENT_WEIBO "\xEF\x87\x95"
+#define ICON_FA_QQ "\xEF\x87\x96"
+#define ICON_FA_WEIXIN "\xEF\x87\x97"
+#define ICON_FA_PAPER_PLANE "\xEF\x87\x98"
+#define ICON_FA_PAPER_PLANE_O "\xEF\x87\x99"
+#define ICON_FA_HISTORY "\xEF\x87\x9A"
+#define ICON_FA_CIRCLE_THIN "\xEF\x87\x9B"
+#define ICON_FA_HEADER "\xEF\x87\x9C"
+#define ICON_FA_PARAGRAPH "\xEF\x87\x9D"
+#define ICON_FA_SLIDERS "\xEF\x87\x9E"
+#define ICON_FA_SHARE_ALT "\xEF\x87\xA0"
+#define ICON_FA_SHARE_ALT_SQUARE "\xEF\x87\xA1"
+#define ICON_FA_BOMB "\xEF\x87\xA2"
+#define ICON_FA_FUTBOL_O "\xEF\x87\xA3"
+#define ICON_FA_TTY "\xEF\x87\xA4"
+#define ICON_FA_BINOCULARS "\xEF\x87\xA5"
+#define ICON_FA_PLUG "\xEF\x87\xA6"
+#define ICON_FA_SLIDESHARE "\xEF\x87\xA7"
+#define ICON_FA_TWITCH "\xEF\x87\xA8"
+#define ICON_FA_YELP "\xEF\x87\xA9"
+#define ICON_FA_NEWSPAPER_O "\xEF\x87\xAA"
+#define ICON_FA_WIFI "\xEF\x87\xAB"
+#define ICON_FA_CALCULATOR "\xEF\x87\xAC"
+#define ICON_FA_PAYPAL "\xEF\x87\xAD"
+#define ICON_FA_GOOGLE_WALLET "\xEF\x87\xAE"
+#define ICON_FA_CC_VISA "\xEF\x87\xB0"
+#define ICON_FA_CC_MASTERCARD "\xEF\x87\xB1"
+#define ICON_FA_CC_DISCOVER "\xEF\x87\xB2"
+#define ICON_FA_CC_AMEX "\xEF\x87\xB3"
+#define ICON_FA_CC_PAYPAL "\xEF\x87\xB4"
+#define ICON_FA_CC_STRIPE "\xEF\x87\xB5"
+#define ICON_FA_BELL_SLASH "\xEF\x87\xB6"
+#define ICON_FA_BELL_SLASH_O "\xEF\x87\xB7"
+#define ICON_FA_TRASH "\xEF\x87\xB8"
+#define ICON_FA_COPYRIGHT "\xEF\x87\xB9"
+#define ICON_FA_AT "\xEF\x87\xBA"
+#define ICON_FA_EYEDROPPER "\xEF\x87\xBB"
+#define ICON_FA_PAINT_BRUSH "\xEF\x87\xBC"
+#define ICON_FA_BIRTHDAY_CAKE "\xEF\x87\xBD"
+#define ICON_FA_AREA_CHART "\xEF\x87\xBE"
+#define ICON_FA_PIE_CHART "\xEF\x88\x80"
+#define ICON_FA_LINE_CHART "\xEF\x88\x81"
+#define ICON_FA_LASTFM "\xEF\x88\x82"
+#define ICON_FA_LASTFM_SQUARE "\xEF\x88\x83"
+#define ICON_FA_TOGGLE_OFF "\xEF\x88\x84"
+#define ICON_FA_TOGGLE_ON "\xEF\x88\x85"
+#define ICON_FA_BICYCLE "\xEF\x88\x86"
+#define ICON_FA_BUS "\xEF\x88\x87"
+#define ICON_FA_IOXHOST "\xEF\x88\x88"
+#define ICON_FA_ANGELLIST "\xEF\x88\x89"
+#define ICON_FA_CC "\xEF\x88\x8A"
+#define ICON_FA_ILS "\xEF\x88\x8B"
+#define ICON_FA_MEANPATH "\xEF\x88\x8C"
+#define ICON_FA_BUYSELLADS "\xEF\x88\x8D"
+#define ICON_FA_CONNECTDEVELOP "\xEF\x88\x8E"
+#define ICON_FA_DASHCUBE "\xEF\x88\x90"
+#define ICON_FA_FORUMBEE "\xEF\x88\x91"
+#define ICON_FA_LEANPUB "\xEF\x88\x92"
+#define ICON_FA_SELLSY "\xEF\x88\x93"
+#define ICON_FA_SHIRTSINBULK "\xEF\x88\x94"
+#define ICON_FA_SIMPLYBUILT "\xEF\x88\x95"
+#define ICON_FA_SKYATLAS "\xEF\x88\x96"
+#define ICON_FA_CART_PLUS "\xEF\x88\x97"
+#define ICON_FA_CART_ARROW_DOWN "\xEF\x88\x98"
+#define ICON_FA_DIAMOND "\xEF\x88\x99"
+#define ICON_FA_SHIP "\xEF\x88\x9A"
+#define ICON_FA_USER_SECRET "\xEF\x88\x9B"
+#define ICON_FA_MOTORCYCLE "\xEF\x88\x9C"
+#define ICON_FA_STREET_VIEW "\xEF\x88\x9D"
+#define ICON_FA_HEARTBEAT "\xEF\x88\x9E"
+#define ICON_FA_VENUS "\xEF\x88\xA1"
+#define ICON_FA_MARS "\xEF\x88\xA2"
+#define ICON_FA_MERCURY "\xEF\x88\xA3"
+#define ICON_FA_TRANSGENDER "\xEF\x88\xA4"
+#define ICON_FA_TRANSGENDER_ALT "\xEF\x88\xA5"
+#define ICON_FA_VENUS_DOUBLE "\xEF\x88\xA6"
+#define ICON_FA_MARS_DOUBLE "\xEF\x88\xA7"
+#define ICON_FA_VENUS_MARS "\xEF\x88\xA8"
+#define ICON_FA_MARS_STROKE "\xEF\x88\xA9"
+#define ICON_FA_MARS_STROKE_V "\xEF\x88\xAA"
+#define ICON_FA_MARS_STROKE_H "\xEF\x88\xAB"
+#define ICON_FA_NEUTER "\xEF\x88\xAC"
+#define ICON_FA_GENDERLESS "\xEF\x88\xAD"
+#define ICON_FA_FACEBOOK_OFFICIAL "\xEF\x88\xB0"
+#define ICON_FA_PINTEREST_P "\xEF\x88\xB1"
+#define ICON_FA_WHATSAPP "\xEF\x88\xB2"
+#define ICON_FA_SERVER "\xEF\x88\xB3"
+#define ICON_FA_USER_PLUS "\xEF\x88\xB4"
+#define ICON_FA_USER_TIMES "\xEF\x88\xB5"
+#define ICON_FA_BED "\xEF\x88\xB6"
+#define ICON_FA_VIACOIN "\xEF\x88\xB7"
+#define ICON_FA_TRAIN "\xEF\x88\xB8"
+#define ICON_FA_SUBWAY "\xEF\x88\xB9"
+#define ICON_FA_MEDIUM "\xEF\x88\xBA"
+#define ICON_FA_Y_COMBINATOR "\xEF\x88\xBB"
+#define ICON_FA_OPTIN_MONSTER "\xEF\x88\xBC"
+#define ICON_FA_OPENCART "\xEF\x88\xBD"
+#define ICON_FA_EXPEDITEDSSL "\xEF\x88\xBE"
+#define ICON_FA_BATTERY_FULL "\xEF\x89\x80"
+#define ICON_FA_BATTERY_THREE_QUARTERS "\xEF\x89\x81"
+#define ICON_FA_BATTERY_HALF "\xEF\x89\x82"
+#define ICON_FA_BATTERY_QUARTER "\xEF\x89\x83"
+#define ICON_FA_BATTERY_EMPTY "\xEF\x89\x84"
+#define ICON_FA_MOUSE_POINTER "\xEF\x89\x85"
+#define ICON_FA_I_CURSOR "\xEF\x89\x86"
+#define ICON_FA_OBJECT_GROUP "\xEF\x89\x87"
+#define ICON_FA_OBJECT_UNGROUP "\xEF\x89\x88"
+#define ICON_FA_STICKY_NOTE "\xEF\x89\x89"
+#define ICON_FA_STICKY_NOTE_O "\xEF\x89\x8A"
+#define ICON_FA_CC_JCB "\xEF\x89\x8B"
+#define ICON_FA_CC_DINERS_CLUB "\xEF\x89\x8C"
+#define ICON_FA_CLONE "\xEF\x89\x8D"
+#define ICON_FA_BALANCE_SCALE "\xEF\x89\x8E"
+#define ICON_FA_HOURGLASS_O "\xEF\x89\x90"
+#define ICON_FA_HOURGLASS_START "\xEF\x89\x91"
+#define ICON_FA_HOURGLASS_HALF "\xEF\x89\x92"
+#define ICON_FA_HOURGLASS_END "\xEF\x89\x93"
+#define ICON_FA_HOURGLASS "\xEF\x89\x94"
+#define ICON_FA_HAND_ROCK_O "\xEF\x89\x95"
+#define ICON_FA_HAND_PAPER_O "\xEF\x89\x96"
+#define ICON_FA_HAND_SCISSORS_O "\xEF\x89\x97"
+#define ICON_FA_HAND_LIZARD_O "\xEF\x89\x98"
+#define ICON_FA_HAND_SPOCK_O "\xEF\x89\x99"
+#define ICON_FA_HAND_POINTER_O "\xEF\x89\x9A"
+#define ICON_FA_HAND_PEACE_O "\xEF\x89\x9B"
+#define ICON_FA_TRADEMARK "\xEF\x89\x9C"
+#define ICON_FA_REGISTERED "\xEF\x89\x9D"
+#define ICON_FA_CREATIVE_COMMONS "\xEF\x89\x9E"
+#define ICON_FA_GG "\xEF\x89\xA0"
+#define ICON_FA_GG_CIRCLE "\xEF\x89\xA1"
+#define ICON_FA_TRIPADVISOR "\xEF\x89\xA2"
+#define ICON_FA_ODNOKLASSNIKI "\xEF\x89\xA3"
+#define ICON_FA_ODNOKLASSNIKI_SQUARE "\xEF\x89\xA4"
+#define ICON_FA_GET_POCKET "\xEF\x89\xA5"
+#define ICON_FA_WIKIPEDIA_W "\xEF\x89\xA6"
+#define ICON_FA_SAFARI "\xEF\x89\xA7"
+#define ICON_FA_CHROME "\xEF\x89\xA8"
+#define ICON_FA_FIREFOX "\xEF\x89\xA9"
+#define ICON_FA_OPERA "\xEF\x89\xAA"
+#define ICON_FA_INTERNET_EXPLORER "\xEF\x89\xAB"
+#define ICON_FA_TELEVISION "\xEF\x89\xAC"
+#define ICON_FA_CONTAO "\xEF\x89\xAD"
+#define ICON_FA_500PX "\xEF\x89\xAE"
+#define ICON_FA_AMAZON "\xEF\x89\xB0"
+#define ICON_FA_CALENDAR_PLUS_O "\xEF\x89\xB1"
+#define ICON_FA_CALENDAR_MINUS_O "\xEF\x89\xB2"
+#define ICON_FA_CALENDAR_TIMES_O "\xEF\x89\xB3"
+#define ICON_FA_CALENDAR_CHECK_O "\xEF\x89\xB4"
+#define ICON_FA_INDUSTRY "\xEF\x89\xB5"
+#define ICON_FA_MAP_PIN "\xEF\x89\xB6"
+#define ICON_FA_MAP_SIGNS "\xEF\x89\xB7"
+#define ICON_FA_MAP_O "\xEF\x89\xB8"
+#define ICON_FA_MAP "\xEF\x89\xB9"
+#define ICON_FA_COMMENTING "\xEF\x89\xBA"
+#define ICON_FA_COMMENTING_O "\xEF\x89\xBB"
+#define ICON_FA_HOUZZ "\xEF\x89\xBC"
+#define ICON_FA_VIMEO "\xEF\x89\xBD"
+#define ICON_FA_BLACK_TIE "\xEF\x89\xBE"
+#define ICON_FA_FONTICONS "\xEF\x8A\x80"
+#define ICON_FA_REDDIT_ALIEN "\xEF\x8A\x81"
+#define ICON_FA_EDGE "\xEF\x8A\x82"
+#define ICON_FA_CREDIT_CARD_ALT "\xEF\x8A\x83"
+#define ICON_FA_CODIEPIE "\xEF\x8A\x84"
+#define ICON_FA_MODX "\xEF\x8A\x85"
+#define ICON_FA_FORT_AWESOME "\xEF\x8A\x86"
+#define ICON_FA_USB "\xEF\x8A\x87"
+#define ICON_FA_PRODUCT_HUNT "\xEF\x8A\x88"
+#define ICON_FA_MIXCLOUD "\xEF\x8A\x89"
+#define ICON_FA_SCRIBD "\xEF\x8A\x8A"
+#define ICON_FA_PAUSE_CIRCLE "\xEF\x8A\x8B"
+#define ICON_FA_PAUSE_CIRCLE_O "\xEF\x8A\x8C"
+#define ICON_FA_STOP_CIRCLE "\xEF\x8A\x8D"
+#define ICON_FA_STOP_CIRCLE_O "\xEF\x8A\x8E"
+#define ICON_FA_SHOPPING_BAG "\xEF\x8A\x90"
+#define ICON_FA_SHOPPING_BASKET "\xEF\x8A\x91"
+#define ICON_FA_HASHTAG "\xEF\x8A\x92"
+#define ICON_FA_BLUETOOTH "\xEF\x8A\x93"
+#define ICON_FA_BLUETOOTH_B "\xEF\x8A\x94"
+#define ICON_FA_PERCENT "\xEF\x8A\x95"
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/icons_kenney.h b/3rdparty/bgfx/3rdparty/iconfontheaders/icons_kenney.h
new file mode 100644
index 00000000000..dbbcb48d904
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/icons_kenney.h
@@ -0,0 +1,234 @@
+// Generated by GenerateIconFontCppHeaders.py
+// from https://raw.githubusercontent.com/SamBrishes/kenney-icon-font/master/css/kenney-icons.css
+#pragma once
+
+#define ICON_MIN_KI 0xe900
+#define ICON_MAX_KI 0xe9e3
+#define ICON_KI_HOME "\xEE\xA4\x80"
+#define ICON_KI_ADJUST "\xEE\xA4\x81"
+#define ICON_KI_WRENCH "\xEE\xA4\x82"
+#define ICON_KI_COG "\xEE\xA4\x83"
+#define ICON_KI_OFF "\xEE\xA4\x84"
+#define ICON_KI_EXPAND "\xEE\xA4\x85"
+#define ICON_KI_REDUCE "\xEE\xA4\x86"
+#define ICON_KI_MOVIE "\xEE\xA4\x87"
+#define ICON_KI_FLAP "\xEE\xA4\x88"
+#define ICON_KI_SHOPPING_CART "\xEE\xA4\x89"
+#define ICON_KI_SHOPPING_CASE "\xEE\xA4\x8A"
+#define ICON_KI_EXTERNAL "\xEE\xA4\x8B"
+#define ICON_KI_NETWORK "\xEE\xA4\x8C"
+#define ICON_KI_CHECK "\xEE\xA4\x8D"
+#define ICON_KI_TIMES "\xEE\xA4\x8E"
+#define ICON_KI_TIMES_CIRCLE "\xEE\xA4\x8F"
+#define ICON_KI_PLUS "\xEE\xA4\x90"
+#define ICON_KI_PLUS_CIRCLE "\xEE\xA4\x91"
+#define ICON_KI_MINUS "\xEE\xA4\x92"
+#define ICON_KI_MINUS_CIRCLE "\xEE\xA4\x93"
+#define ICON_KI_INFO "\xEE\xA4\x94"
+#define ICON_KI_INFO_CIRCLE "\xEE\xA4\x95"
+#define ICON_KI_QUESTION "\xEE\xA4\x96"
+#define ICON_KI_QUESTION_CIRCLE "\xEE\xA4\x97"
+#define ICON_KI_EXLAMATION "\xEE\xA4\x98"
+#define ICON_KI_EXCLAMATION_CIRCLE "\xEE\xA4\x99"
+#define ICON_KI_EXCLAMATION_TRIANGLE "\xEE\xA4\x9A"
+#define ICON_KI_PAINT_BRUSH "\xEE\xA4\x9B"
+#define ICON_KI_PENCIL "\xEE\xA4\x9C"
+#define ICON_KI_CHECKBOX "\xEE\xA4\x9D"
+#define ICON_KI_CHECKBOX_CHECKED "\xEE\xA4\x9E"
+#define ICON_KI_RADIO "\xEE\xA4\x9F"
+#define ICON_KI_RADIO_CHECKED "\xEE\xA4\xA0"
+#define ICON_KI_SORT_VERTICAL "\xEE\xA4\xA1"
+#define ICON_KI_SORT_HORIZONTAL "\xEE\xA4\xA2"
+#define ICON_KI_GRID "\xEE\xA4\xA3"
+#define ICON_KI_LIST "\xEE\xA4\xA4"
+#define ICON_KI_ROWS "\xEE\xA4\xA5"
+#define ICON_KI_CELLS "\xEE\xA4\xA6"
+#define ICON_KI_SIGNAL_LOW "\xEE\xA4\xA7"
+#define ICON_KI_SIGNAL_MEDIUM "\xEE\xA4\xA8"
+#define ICON_KI_SIGNAL_HIGH "\xEE\xA4\xA9"
+#define ICON_KI_TRASH "\xEE\xA4\xAA"
+#define ICON_KI_TRASH_ALT "\xEE\xA4\xAB"
+#define ICON_KI_RELOAD_INVERSE "\xEE\xA4\xAC"
+#define ICON_KI_RELOAD "\xEE\xA4\xAD"
+#define ICON_KI_TOP "\xEE\xA4\xAE"
+#define ICON_KI_BOTTOM "\xEE\xA4\xAF"
+#define ICON_KI_UPLOAD "\xEE\xA4\xB0"
+#define ICON_KI_DOWNLOAD "\xEE\xA4\xB1"
+#define ICON_KI_CLOUD "\xEE\xA4\xB2"
+#define ICON_KI_CLOUD_UPLOAD "\xEE\xA4\xB3"
+#define ICON_KI_CLOUD_DOWNLOAD "\xEE\xA4\xB4"
+#define ICON_KI_SEARCH "\xEE\xA4\xB5"
+#define ICON_KI_SEARCH_PLUS "\xEE\xA4\xB6"
+#define ICON_KI_SEARCH_MINUS "\xEE\xA4\xB7"
+#define ICON_KI_SEARCH_EQUAL "\xEE\xA4\xB8"
+#define ICON_KI_LOCK "\xEE\xA4\xB9"
+#define ICON_KI_UNLOCK "\xEE\xA4\xBA"
+#define ICON_KI_USER "\xEE\xA4\xBB"
+#define ICON_KI_USERS "\xEE\xA4\xBC"
+#define ICON_KI_USERS_ALT "\xEE\xA4\xBD"
+#define ICON_KI_SIGN_IN "\xEE\xA4\xBE"
+#define ICON_KI_SIGN_IN_INVERSE "\xEE\xA4\xBF"
+#define ICON_KI_SIGN_OUT "\xEE\xA5\x80"
+#define ICON_KI_SIGN_OUT_INVERSE "\xEE\xA5\x81"
+#define ICON_KI_ARROW_TOP "\xEE\xA5\x82"
+#define ICON_KI_ARROW_RIGHT "\xEE\xA5\x83"
+#define ICON_KI_ARROW_BOTTOM "\xEE\xA5\x84"
+#define ICON_KI_ARROW_LEFT "\xEE\xA5\x85"
+#define ICON_KI_ARROW_TOP_LEFT "\xEE\xA5\x86"
+#define ICON_KI_ARROW_TOP_RIGHT "\xEE\xA5\x87"
+#define ICON_KI_ARROW_BOTTOM_RIGHT "\xEE\xA5\x88"
+#define ICON_KI_ARROW_BOTTOM_LEFT "\xEE\xA5\x89"
+#define ICON_KI_CARET_TOP "\xEE\xA5\x8A"
+#define ICON_KI_CARET_RIGHT "\xEE\xA5\x8B"
+#define ICON_KI_CARET_BOTTOM "\xEE\xA5\x8C"
+#define ICON_KI_CARET_LEFT "\xEE\xA5\x8D"
+#define ICON_KI_NEXT_ALT "\xEE\xA5\x8E"
+#define ICON_KI_NEXT "\xEE\xA5\x8F"
+#define ICON_KI_PREVIOUS "\xEE\xA5\x90"
+#define ICON_KI_PREVIOUS_ALT "\xEE\xA5\x91"
+#define ICON_KI_FILL "\xEE\xA5\x92"
+#define ICON_KI_ERASER "\xEE\xA5\x93"
+#define ICON_KI_SAVE "\xEE\xA5\x94"
+#define ICON_KI_STEP_BACKWARD "\xEE\xA5\x95"
+#define ICON_KI_BACKWARD "\xEE\xA5\x96"
+#define ICON_KI_PAUSE "\xEE\xA5\x97"
+#define ICON_KI_FORWARD "\xEE\xA5\x98"
+#define ICON_KI_STEP_FORWARD "\xEE\xA5\x99"
+#define ICON_KI_STOP "\xEE\xA5\x9A"
+#define ICON_KI_REC "\xEE\xA5\x9B"
+#define ICON_KI_CURSOR "\xEE\xA5\x9C"
+#define ICON_KI_POINTER "\xEE\xA5\x9D"
+#define ICON_KI_EXIT "\xEE\xA5\x9E"
+#define ICON_KI_FIGURE "\xEE\xA5\x9F"
+#define ICON_KI_CAR "\xEE\xA5\xA0"
+#define ICON_KI_COIN "\xEE\xA5\xA1"
+#define ICON_KI_KEY "\xEE\xA5\xA2"
+#define ICON_KI_CUB "\xEE\xA5\xA3"
+#define ICON_KI_DIAMOND "\xEE\xA5\xA4"
+#define ICON_KI_BADGE "\xEE\xA5\xA5"
+#define ICON_KI_BADGE_ALT "\xEE\xA5\xA6"
+#define ICON_KI_PODIUM "\xEE\xA5\xA7"
+#define ICON_KI_PODIUM_ALT "\xEE\xA5\xA8"
+#define ICON_KI_FLAG "\xEE\xA5\xA9"
+#define ICON_KI_FIST "\xEE\xA5\xAA"
+#define ICON_KI_FIST_CIRCLE "\xEE\xA5\xAB"
+#define ICON_KI_HEART "\xEE\xA5\xAC"
+#define ICON_KI_HEART_HALF "\xEE\xA5\xAD"
+#define ICON_KI_HEART_HALF_O "\xEE\xA5\xAE"
+#define ICON_KI_HEART_O "\xEE\xA5\xAF"
+#define ICON_KI_STAR "\xEE\xA5\xB0"
+#define ICON_KI_STAR_HALF "\xEE\xA5\xB1"
+#define ICON_KI_STAR_HALF_O "\xEE\xA5\xB2"
+#define ICON_KI_STAR_O "\xEE\xA5\xB3"
+#define ICON_KI_BUTTON_B "\xEE\xA5\xB4"
+#define ICON_KI_MUSIC_ON "\xEE\xA5\xB5"
+#define ICON_KI_MUSIC_OFF "\xEE\xA5\xB6"
+#define ICON_KI_SOUND_ON "\xEE\xA5\xB7"
+#define ICON_KI_SOUND_OFF "\xEE\xA5\xB8"
+#define ICON_KI_SOUND_OFF_ALT "\xEE\xA5\xB9"
+#define ICON_KI_ROBOT "\xEE\xA5\xBA"
+#define ICON_KI_COMPUTER "\xEE\xA5\xBB"
+#define ICON_KI_TABLET "\xEE\xA5\xBC"
+#define ICON_KI_SMARTPHONE "\xEE\xA5\xBD"
+#define ICON_KI_DEVICE "\xEE\xA5\xBE"
+#define ICON_KI_DEVICE_TILT_LEFT "\xEE\xA5\xBF"
+#define ICON_KI_DEVICE_TILT_RIGHT "\xEE\xA6\x80"
+#define ICON_KI_GAMEPAD "\xEE\xA6\x81"
+#define ICON_KI_GAMEPAD_ALT "\xEE\xA6\x82"
+#define ICON_KI_GAMEPAD_TILT_LEFT "\xEE\xA6\x83"
+#define ICON_KI_GAMEPAD_TILT_RIGHT "\xEE\xA6\x84"
+#define ICON_KI_PLAYER_ONE "\xEE\xA6\x85"
+#define ICON_KI_PLAYER_TWO "\xEE\xA6\x86"
+#define ICON_KI_PLAYER_THREE "\xEE\xA6\x87"
+#define ICON_KI_PLAYER_FOUR "\xEE\xA6\x88"
+#define ICON_KI_JOYSTICK "\xEE\xA6\x89"
+#define ICON_KI_JOYSTICK_ALT "\xEE\xA6\x8A"
+#define ICON_KI_JOYSTICK_LEFT "\xEE\xA6\x8B"
+#define ICON_KI_JOYSTICK_RIGHT "\xEE\xA6\x8C"
+#define ICON_KI_MOUSE_ALT "\xEE\xA6\x8D"
+#define ICON_KI_MOUSE "\xEE\xA6\x8E"
+#define ICON_KI_MOUSE_LEFT_BUTTON "\xEE\xA6\x8F"
+#define ICON_KI_MOUSE_RIGHT_BUTTON "\xEE\xA6\x90"
+#define ICON_KI_BUTTON_ONE "\xEE\xA6\x91"
+#define ICON_KI_BUTTON_TWO "\xEE\xA6\x92"
+#define ICON_KI_BUTTON_THREE "\xEE\xA6\x93"
+#define ICON_KI_BUTTON_A "\xEE\xA6\x94"
+#define ICON_KI_BUTTON_X "\xEE\xA6\x95"
+#define ICON_KI_BUTON_Y "\xEE\xA6\x96"
+#define ICON_KI_BUTTON_TIMES "\xEE\xA6\x97"
+#define ICON_KI_BUTTON_SQUARE "\xEE\xA6\x98"
+#define ICON_KI_BUTTON_CIRCLE "\xEE\xA6\x99"
+#define ICON_KI_BUTTON_TRIANGLE "\xEE\xA6\x9A"
+#define ICON_KI_BUTTON_LEFT "\xEE\xA6\x9B"
+#define ICON_KI_BUTTON_L "\xEE\xA6\x9C"
+#define ICON_KI_BUTTON_L1 "\xEE\xA6\x9D"
+#define ICON_KI_BUTTON_L2 "\xEE\xA6\x9E"
+#define ICON_KI_BUTTON_LB "\xEE\xA6\x9F"
+#define ICON_KI_BUTTON_LT "\xEE\xA6\xA0"
+#define ICON_KI_BUTTON_RT "\xEE\xA6\xA1"
+#define ICON_KI_BUTTON_RB "\xEE\xA6\xA2"
+#define ICON_KI_BUTTON_R2 "\xEE\xA6\xA3"
+#define ICON_KI_BUTTON_R1 "\xEE\xA6\xA4"
+#define ICON_KI_BUTTON_R "\xEE\xA6\xA5"
+#define ICON_KI_BUTTON_RIGHT "\xEE\xA6\xA6"
+#define ICON_KI_BUTTON_EMPTY "\xEE\xA6\xA7"
+#define ICON_KI_BUTTON_START "\xEE\xA6\xA8"
+#define ICON_KI_BUTTON_SELECT "\xEE\xA6\xA9"
+#define ICON_KI_DPAD "\xEE\xA6\xAA"
+#define ICON_KI_DPAD_ALT "\xEE\xA6\xAB"
+#define ICON_KI_DPAD_TOP "\xEE\xA6\xAC"
+#define ICON_KI_DPAD_RIGHT "\xEE\xA6\xAD"
+#define ICON_KI_DPAD_BOTTOM "\xEE\xA6\xAE"
+#define ICON_KI_DPAD_LEFT "\xEE\xA6\xAF"
+#define ICON_KI_KEY_LARGE "\xEE\xA6\xB0"
+#define ICON_KI_KEY_LARGE_3D "\xEE\xA6\xB1"
+#define ICON_KI_KEY_SMALL "\xEE\xA6\xB2"
+#define ICON_KI_KEY_SMALL_3D "\xEE\xA6\xB3"
+#define ICON_KI_STICK_LEFT_TOP "\xEE\xA6\xB4"
+#define ICON_KI_STICK_LEFT_SIDE "\xEE\xA6\xB5"
+#define ICON_KI_STICK_RIGHT_SIDE "\xEE\xA6\xB6"
+#define ICON_KI_STICK_RIGHT_TOP "\xEE\xA6\xB7"
+#define ICON_KI_STICK_SIDE "\xEE\xA6\xB8"
+#define ICON_KI_STICK_TILT_LEFT "\xEE\xA6\xB9"
+#define ICON_KI_STICK_TILT_RIGHT "\xEE\xA6\xBA"
+#define ICON_KI_MOVE_BL "\xEE\xA6\xBB"
+#define ICON_KI_MOVE_BR "\xEE\xA6\xBC"
+#define ICON_KI_MOVE_BT "\xEE\xA6\xBD"
+#define ICON_KI_MOVE_BT_ALT "\xEE\xA6\xBE"
+#define ICON_KI_MOVE_LB "\xEE\xA6\xBF"
+#define ICON_KI_MOVE_LR "\xEE\xA7\x80"
+#define ICON_KI_MOVE_LR_ALT "\xEE\xA7\x81"
+#define ICON_KI_MOVE_LT "\xEE\xA7\x82"
+#define ICON_KI_MOVE_RB "\xEE\xA7\x83"
+#define ICON_KI_MOVE_RL "\xEE\xA7\x84"
+#define ICON_KI_MOVE_RL_ALT "\xEE\xA7\x85"
+#define ICON_KI_MOVE_RT "\xEE\xA7\x86"
+#define ICON_KI_MOVE_TB "\xEE\xA7\x87"
+#define ICON_KI_MOVE_TB_ALT "\xEE\xA7\x88"
+#define ICON_KI_MOVE_TL "\xEE\xA7\x89"
+#define ICON_KI_MOVE_TR "\xEE\xA7\x8A"
+#define ICON_KI_STICK_MOVE_BL "\xEE\xA7\x8B"
+#define ICON_KI_STICK_MOVE_BR "\xEE\xA7\x8C"
+#define ICON_KI_STICK_MOVE_BT "\xEE\xA7\x8D"
+#define ICON_KI_STICK_MOVE_BT_ALT "\xEE\xA7\x8E"
+#define ICON_KI_STICK_MOVE_LB "\xEE\xA7\x8F"
+#define ICON_KI_STICK_MOVE_LR "\xEE\xA7\x90"
+#define ICON_KI_STICK_MOVE_LR_ALT "\xEE\xA7\x91"
+#define ICON_KI_STICK_MOVE_LT "\xEE\xA7\x92"
+#define ICON_KI_STICK_MOVE_RB "\xEE\xA7\x93"
+#define ICON_KI_STICK_MOVE_RL "\xEE\xA7\x94"
+#define ICON_KI_STICK_MOVE_RL_ALT "\xEE\xA7\x95"
+#define ICON_KI_STICK_MOVE_RT "\xEE\xA7\x96"
+#define ICON_KI_STICK_MOVE_TB "\xEE\xA7\x97"
+#define ICON_KI_STICK_MOVE_TB_ALT "\xEE\xA7\x98"
+#define ICON_KI_STICK_MOVE_TL "\xEE\xA7\x99"
+#define ICON_KI_STICK_MOVE_TR "\xEE\xA7\x9A"
+#define ICON_KI_GITHUB "\xEE\xA7\x9B"
+#define ICON_KI_GITHUB_ALT "\xEE\xA7\x9C"
+#define ICON_KI_TWITTER "\xEE\xA7\x9D"
+#define ICON_KI_FACEBOOK "\xEE\xA7\x9E"
+#define ICON_KI_GOOGLE_PLUS "\xEE\xA7\x9F"
+#define ICON_KI_YOUTUBE "\xEE\xA7\xA2"
+#define ICON_KI_WE_HEART "\xEE\xA7\xA3"
+#define ICON_KI_WOLFCMS "\xEE\xA7\xA0"
+#define ICON_KI_WOLFCMS_ALT "\xEE\xA7\xA1"
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/icons_material_design.h b/3rdparty/bgfx/3rdparty/iconfontheaders/icons_material_design.h
new file mode 100644
index 00000000000..00ec9f68e91
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/iconfontheaders/icons_material_design.h
@@ -0,0 +1,938 @@
+// Generated by GenerateIconFontCppHeaders.py
+// from https://raw.githubusercontent.com/google/material-design-icons/master/iconfont/codepoints
+#pragma once
+
+#define ICON_MIN_MD 0xe000
+#define ICON_MAX_MD 0xeb4c
+#define ICON_MD_3D_ROTATION "\xEE\xA1\x8D"
+#define ICON_MD_AC_UNIT "\xEE\xAC\xBB"
+#define ICON_MD_ACCESS_ALARM "\xEE\x86\x90"
+#define ICON_MD_ACCESS_ALARMS "\xEE\x86\x91"
+#define ICON_MD_ACCESS_TIME "\xEE\x86\x92"
+#define ICON_MD_ACCESSIBILITY "\xEE\xA1\x8E"
+#define ICON_MD_ACCESSIBLE "\xEE\xA4\x94"
+#define ICON_MD_ACCOUNT_BALANCE "\xEE\xA1\x8F"
+#define ICON_MD_ACCOUNT_BALANCE_WALLET "\xEE\xA1\x90"
+#define ICON_MD_ACCOUNT_BOX "\xEE\xA1\x91"
+#define ICON_MD_ACCOUNT_CIRCLE "\xEE\xA1\x93"
+#define ICON_MD_ADB "\xEE\x98\x8E"
+#define ICON_MD_ADD "\xEE\x85\x85"
+#define ICON_MD_ADD_A_PHOTO "\xEE\x90\xB9"
+#define ICON_MD_ADD_ALARM "\xEE\x86\x93"
+#define ICON_MD_ADD_ALERT "\xEE\x80\x83"
+#define ICON_MD_ADD_BOX "\xEE\x85\x86"
+#define ICON_MD_ADD_CIRCLE "\xEE\x85\x87"
+#define ICON_MD_ADD_CIRCLE_OUTLINE "\xEE\x85\x88"
+#define ICON_MD_ADD_LOCATION "\xEE\x95\xA7"
+#define ICON_MD_ADD_SHOPPING_CART "\xEE\xA1\x94"
+#define ICON_MD_ADD_TO_PHOTOS "\xEE\x8E\x9D"
+#define ICON_MD_ADD_TO_QUEUE "\xEE\x81\x9C"
+#define ICON_MD_ADJUST "\xEE\x8E\x9E"
+#define ICON_MD_AIRLINE_SEAT_FLAT "\xEE\x98\xB0"
+#define ICON_MD_AIRLINE_SEAT_FLAT_ANGLED "\xEE\x98\xB1"
+#define ICON_MD_AIRLINE_SEAT_INDIVIDUAL_SUITE "\xEE\x98\xB2"
+#define ICON_MD_AIRLINE_SEAT_LEGROOM_EXTRA "\xEE\x98\xB3"
+#define ICON_MD_AIRLINE_SEAT_LEGROOM_NORMAL "\xEE\x98\xB4"
+#define ICON_MD_AIRLINE_SEAT_LEGROOM_REDUCED "\xEE\x98\xB5"
+#define ICON_MD_AIRLINE_SEAT_RECLINE_EXTRA "\xEE\x98\xB6"
+#define ICON_MD_AIRLINE_SEAT_RECLINE_NORMAL "\xEE\x98\xB7"
+#define ICON_MD_AIRPLANEMODE_ACTIVE "\xEE\x86\x95"
+#define ICON_MD_AIRPLANEMODE_INACTIVE "\xEE\x86\x94"
+#define ICON_MD_AIRPLAY "\xEE\x81\x95"
+#define ICON_MD_AIRPORT_SHUTTLE "\xEE\xAC\xBC"
+#define ICON_MD_ALARM "\xEE\xA1\x95"
+#define ICON_MD_ALARM_ADD "\xEE\xA1\x96"
+#define ICON_MD_ALARM_OFF "\xEE\xA1\x97"
+#define ICON_MD_ALARM_ON "\xEE\xA1\x98"
+#define ICON_MD_ALBUM "\xEE\x80\x99"
+#define ICON_MD_ALL_INCLUSIVE "\xEE\xAC\xBD"
+#define ICON_MD_ALL_OUT "\xEE\xA4\x8B"
+#define ICON_MD_ANDROID "\xEE\xA1\x99"
+#define ICON_MD_ANNOUNCEMENT "\xEE\xA1\x9A"
+#define ICON_MD_APPS "\xEE\x97\x83"
+#define ICON_MD_ARCHIVE "\xEE\x85\x89"
+#define ICON_MD_ARROW_BACK "\xEE\x97\x84"
+#define ICON_MD_ARROW_DOWNWARD "\xEE\x97\x9B"
+#define ICON_MD_ARROW_DROP_DOWN "\xEE\x97\x85"
+#define ICON_MD_ARROW_DROP_DOWN_CIRCLE "\xEE\x97\x86"
+#define ICON_MD_ARROW_DROP_UP "\xEE\x97\x87"
+#define ICON_MD_ARROW_FORWARD "\xEE\x97\x88"
+#define ICON_MD_ARROW_UPWARD "\xEE\x97\x98"
+#define ICON_MD_ART_TRACK "\xEE\x81\xA0"
+#define ICON_MD_ASPECT_RATIO "\xEE\xA1\x9B"
+#define ICON_MD_ASSESSMENT "\xEE\xA1\x9C"
+#define ICON_MD_ASSIGNMENT "\xEE\xA1\x9D"
+#define ICON_MD_ASSIGNMENT_IND "\xEE\xA1\x9E"
+#define ICON_MD_ASSIGNMENT_LATE "\xEE\xA1\x9F"
+#define ICON_MD_ASSIGNMENT_RETURN "\xEE\xA1\xA0"
+#define ICON_MD_ASSIGNMENT_RETURNED "\xEE\xA1\xA1"
+#define ICON_MD_ASSIGNMENT_TURNED_IN "\xEE\xA1\xA2"
+#define ICON_MD_ASSISTANT "\xEE\x8E\x9F"
+#define ICON_MD_ASSISTANT_PHOTO "\xEE\x8E\xA0"
+#define ICON_MD_ATTACH_FILE "\xEE\x88\xA6"
+#define ICON_MD_ATTACH_MONEY "\xEE\x88\xA7"
+#define ICON_MD_ATTACHMENT "\xEE\x8A\xBC"
+#define ICON_MD_AUDIOTRACK "\xEE\x8E\xA1"
+#define ICON_MD_AUTORENEW "\xEE\xA1\xA3"
+#define ICON_MD_AV_TIMER "\xEE\x80\x9B"
+#define ICON_MD_BACKSPACE "\xEE\x85\x8A"
+#define ICON_MD_BACKUP "\xEE\xA1\xA4"
+#define ICON_MD_BATTERY_ALERT "\xEE\x86\x9C"
+#define ICON_MD_BATTERY_CHARGING_FULL "\xEE\x86\xA3"
+#define ICON_MD_BATTERY_FULL "\xEE\x86\xA4"
+#define ICON_MD_BATTERY_STD "\xEE\x86\xA5"
+#define ICON_MD_BATTERY_UNKNOWN "\xEE\x86\xA6"
+#define ICON_MD_BEACH_ACCESS "\xEE\xAC\xBE"
+#define ICON_MD_BEENHERE "\xEE\x94\xAD"
+#define ICON_MD_BLOCK "\xEE\x85\x8B"
+#define ICON_MD_BLUETOOTH "\xEE\x86\xA7"
+#define ICON_MD_BLUETOOTH_AUDIO "\xEE\x98\x8F"
+#define ICON_MD_BLUETOOTH_CONNECTED "\xEE\x86\xA8"
+#define ICON_MD_BLUETOOTH_DISABLED "\xEE\x86\xA9"
+#define ICON_MD_BLUETOOTH_SEARCHING "\xEE\x86\xAA"
+#define ICON_MD_BLUR_CIRCULAR "\xEE\x8E\xA2"
+#define ICON_MD_BLUR_LINEAR "\xEE\x8E\xA3"
+#define ICON_MD_BLUR_OFF "\xEE\x8E\xA4"
+#define ICON_MD_BLUR_ON "\xEE\x8E\xA5"
+#define ICON_MD_BOOK "\xEE\xA1\xA5"
+#define ICON_MD_BOOKMARK "\xEE\xA1\xA6"
+#define ICON_MD_BOOKMARK_BORDER "\xEE\xA1\xA7"
+#define ICON_MD_BORDER_ALL "\xEE\x88\xA8"
+#define ICON_MD_BORDER_BOTTOM "\xEE\x88\xA9"
+#define ICON_MD_BORDER_CLEAR "\xEE\x88\xAA"
+#define ICON_MD_BORDER_COLOR "\xEE\x88\xAB"
+#define ICON_MD_BORDER_HORIZONTAL "\xEE\x88\xAC"
+#define ICON_MD_BORDER_INNER "\xEE\x88\xAD"
+#define ICON_MD_BORDER_LEFT "\xEE\x88\xAE"
+#define ICON_MD_BORDER_OUTER "\xEE\x88\xAF"
+#define ICON_MD_BORDER_RIGHT "\xEE\x88\xB0"
+#define ICON_MD_BORDER_STYLE "\xEE\x88\xB1"
+#define ICON_MD_BORDER_TOP "\xEE\x88\xB2"
+#define ICON_MD_BORDER_VERTICAL "\xEE\x88\xB3"
+#define ICON_MD_BRANDING_WATERMARK "\xEE\x81\xAB"
+#define ICON_MD_BRIGHTNESS_1 "\xEE\x8E\xA6"
+#define ICON_MD_BRIGHTNESS_2 "\xEE\x8E\xA7"
+#define ICON_MD_BRIGHTNESS_3 "\xEE\x8E\xA8"
+#define ICON_MD_BRIGHTNESS_4 "\xEE\x8E\xA9"
+#define ICON_MD_BRIGHTNESS_5 "\xEE\x8E\xAA"
+#define ICON_MD_BRIGHTNESS_6 "\xEE\x8E\xAB"
+#define ICON_MD_BRIGHTNESS_7 "\xEE\x8E\xAC"
+#define ICON_MD_BRIGHTNESS_AUTO "\xEE\x86\xAB"
+#define ICON_MD_BRIGHTNESS_HIGH "\xEE\x86\xAC"
+#define ICON_MD_BRIGHTNESS_LOW "\xEE\x86\xAD"
+#define ICON_MD_BRIGHTNESS_MEDIUM "\xEE\x86\xAE"
+#define ICON_MD_BROKEN_IMAGE "\xEE\x8E\xAD"
+#define ICON_MD_BRUSH "\xEE\x8E\xAE"
+#define ICON_MD_BUBBLE_CHART "\xEE\x9B\x9D"
+#define ICON_MD_BUG_REPORT "\xEE\xA1\xA8"
+#define ICON_MD_BUILD "\xEE\xA1\xA9"
+#define ICON_MD_BURST_MODE "\xEE\x90\xBC"
+#define ICON_MD_BUSINESS "\xEE\x82\xAF"
+#define ICON_MD_BUSINESS_CENTER "\xEE\xAC\xBF"
+#define ICON_MD_CACHED "\xEE\xA1\xAA"
+#define ICON_MD_CAKE "\xEE\x9F\xA9"
+#define ICON_MD_CALL "\xEE\x82\xB0"
+#define ICON_MD_CALL_END "\xEE\x82\xB1"
+#define ICON_MD_CALL_MADE "\xEE\x82\xB2"
+#define ICON_MD_CALL_MERGE "\xEE\x82\xB3"
+#define ICON_MD_CALL_MISSED "\xEE\x82\xB4"
+#define ICON_MD_CALL_MISSED_OUTGOING "\xEE\x83\xA4"
+#define ICON_MD_CALL_RECEIVED "\xEE\x82\xB5"
+#define ICON_MD_CALL_SPLIT "\xEE\x82\xB6"
+#define ICON_MD_CALL_TO_ACTION "\xEE\x81\xAC"
+#define ICON_MD_CAMERA "\xEE\x8E\xAF"
+#define ICON_MD_CAMERA_ALT "\xEE\x8E\xB0"
+#define ICON_MD_CAMERA_ENHANCE "\xEE\xA3\xBC"
+#define ICON_MD_CAMERA_FRONT "\xEE\x8E\xB1"
+#define ICON_MD_CAMERA_REAR "\xEE\x8E\xB2"
+#define ICON_MD_CAMERA_ROLL "\xEE\x8E\xB3"
+#define ICON_MD_CANCEL "\xEE\x97\x89"
+#define ICON_MD_CARD_GIFTCARD "\xEE\xA3\xB6"
+#define ICON_MD_CARD_MEMBERSHIP "\xEE\xA3\xB7"
+#define ICON_MD_CARD_TRAVEL "\xEE\xA3\xB8"
+#define ICON_MD_CASINO "\xEE\xAD\x80"
+#define ICON_MD_CAST "\xEE\x8C\x87"
+#define ICON_MD_CAST_CONNECTED "\xEE\x8C\x88"
+#define ICON_MD_CENTER_FOCUS_STRONG "\xEE\x8E\xB4"
+#define ICON_MD_CENTER_FOCUS_WEAK "\xEE\x8E\xB5"
+#define ICON_MD_CHANGE_HISTORY "\xEE\xA1\xAB"
+#define ICON_MD_CHAT "\xEE\x82\xB7"
+#define ICON_MD_CHAT_BUBBLE "\xEE\x83\x8A"
+#define ICON_MD_CHAT_BUBBLE_OUTLINE "\xEE\x83\x8B"
+#define ICON_MD_CHECK "\xEE\x97\x8A"
+#define ICON_MD_CHECK_BOX "\xEE\xA0\xB4"
+#define ICON_MD_CHECK_BOX_OUTLINE_BLANK "\xEE\xA0\xB5"
+#define ICON_MD_CHECK_CIRCLE "\xEE\xA1\xAC"
+#define ICON_MD_CHEVRON_LEFT "\xEE\x97\x8B"
+#define ICON_MD_CHEVRON_RIGHT "\xEE\x97\x8C"
+#define ICON_MD_CHILD_CARE "\xEE\xAD\x81"
+#define ICON_MD_CHILD_FRIENDLY "\xEE\xAD\x82"
+#define ICON_MD_CHROME_READER_MODE "\xEE\xA1\xAD"
+#define ICON_MD_CLASS "\xEE\xA1\xAE"
+#define ICON_MD_CLEAR "\xEE\x85\x8C"
+#define ICON_MD_CLEAR_ALL "\xEE\x82\xB8"
+#define ICON_MD_CLOSE "\xEE\x97\x8D"
+#define ICON_MD_CLOSED_CAPTION "\xEE\x80\x9C"
+#define ICON_MD_CLOUD "\xEE\x8A\xBD"
+#define ICON_MD_CLOUD_CIRCLE "\xEE\x8A\xBE"
+#define ICON_MD_CLOUD_DONE "\xEE\x8A\xBF"
+#define ICON_MD_CLOUD_DOWNLOAD "\xEE\x8B\x80"
+#define ICON_MD_CLOUD_OFF "\xEE\x8B\x81"
+#define ICON_MD_CLOUD_QUEUE "\xEE\x8B\x82"
+#define ICON_MD_CLOUD_UPLOAD "\xEE\x8B\x83"
+#define ICON_MD_CODE "\xEE\xA1\xAF"
+#define ICON_MD_COLLECTIONS "\xEE\x8E\xB6"
+#define ICON_MD_COLLECTIONS_BOOKMARK "\xEE\x90\xB1"
+#define ICON_MD_COLOR_LENS "\xEE\x8E\xB7"
+#define ICON_MD_COLORIZE "\xEE\x8E\xB8"
+#define ICON_MD_COMMENT "\xEE\x82\xB9"
+#define ICON_MD_COMPARE "\xEE\x8E\xB9"
+#define ICON_MD_COMPARE_ARROWS "\xEE\xA4\x95"
+#define ICON_MD_COMPUTER "\xEE\x8C\x8A"
+#define ICON_MD_CONFIRMATION_NUMBER "\xEE\x98\xB8"
+#define ICON_MD_CONTACT_MAIL "\xEE\x83\x90"
+#define ICON_MD_CONTACT_PHONE "\xEE\x83\x8F"
+#define ICON_MD_CONTACTS "\xEE\x82\xBA"
+#define ICON_MD_CONTENT_COPY "\xEE\x85\x8D"
+#define ICON_MD_CONTENT_CUT "\xEE\x85\x8E"
+#define ICON_MD_CONTENT_PASTE "\xEE\x85\x8F"
+#define ICON_MD_CONTROL_POINT "\xEE\x8E\xBA"
+#define ICON_MD_CONTROL_POINT_DUPLICATE "\xEE\x8E\xBB"
+#define ICON_MD_COPYRIGHT "\xEE\xA4\x8C"
+#define ICON_MD_CREATE "\xEE\x85\x90"
+#define ICON_MD_CREATE_NEW_FOLDER "\xEE\x8B\x8C"
+#define ICON_MD_CREDIT_CARD "\xEE\xA1\xB0"
+#define ICON_MD_CROP "\xEE\x8E\xBE"
+#define ICON_MD_CROP_16_9 "\xEE\x8E\xBC"
+#define ICON_MD_CROP_3_2 "\xEE\x8E\xBD"
+#define ICON_MD_CROP_5_4 "\xEE\x8E\xBF"
+#define ICON_MD_CROP_7_5 "\xEE\x8F\x80"
+#define ICON_MD_CROP_DIN "\xEE\x8F\x81"
+#define ICON_MD_CROP_FREE "\xEE\x8F\x82"
+#define ICON_MD_CROP_LANDSCAPE "\xEE\x8F\x83"
+#define ICON_MD_CROP_ORIGINAL "\xEE\x8F\x84"
+#define ICON_MD_CROP_PORTRAIT "\xEE\x8F\x85"
+#define ICON_MD_CROP_ROTATE "\xEE\x90\xB7"
+#define ICON_MD_CROP_SQUARE "\xEE\x8F\x86"
+#define ICON_MD_DASHBOARD "\xEE\xA1\xB1"
+#define ICON_MD_DATA_USAGE "\xEE\x86\xAF"
+#define ICON_MD_DATE_RANGE "\xEE\xA4\x96"
+#define ICON_MD_DEHAZE "\xEE\x8F\x87"
+#define ICON_MD_DELETE "\xEE\xA1\xB2"
+#define ICON_MD_DELETE_FOREVER "\xEE\xA4\xAB"
+#define ICON_MD_DELETE_SWEEP "\xEE\x85\xAC"
+#define ICON_MD_DESCRIPTION "\xEE\xA1\xB3"
+#define ICON_MD_DESKTOP_MAC "\xEE\x8C\x8B"
+#define ICON_MD_DESKTOP_WINDOWS "\xEE\x8C\x8C"
+#define ICON_MD_DETAILS "\xEE\x8F\x88"
+#define ICON_MD_DEVELOPER_BOARD "\xEE\x8C\x8D"
+#define ICON_MD_DEVELOPER_MODE "\xEE\x86\xB0"
+#define ICON_MD_DEVICE_HUB "\xEE\x8C\xB5"
+#define ICON_MD_DEVICES "\xEE\x86\xB1"
+#define ICON_MD_DEVICES_OTHER "\xEE\x8C\xB7"
+#define ICON_MD_DIALER_SIP "\xEE\x82\xBB"
+#define ICON_MD_DIALPAD "\xEE\x82\xBC"
+#define ICON_MD_DIRECTIONS "\xEE\x94\xAE"
+#define ICON_MD_DIRECTIONS_BIKE "\xEE\x94\xAF"
+#define ICON_MD_DIRECTIONS_BOAT "\xEE\x94\xB2"
+#define ICON_MD_DIRECTIONS_BUS "\xEE\x94\xB0"
+#define ICON_MD_DIRECTIONS_CAR "\xEE\x94\xB1"
+#define ICON_MD_DIRECTIONS_RAILWAY "\xEE\x94\xB4"
+#define ICON_MD_DIRECTIONS_RUN "\xEE\x95\xA6"
+#define ICON_MD_DIRECTIONS_SUBWAY "\xEE\x94\xB3"
+#define ICON_MD_DIRECTIONS_TRANSIT "\xEE\x94\xB5"
+#define ICON_MD_DIRECTIONS_WALK "\xEE\x94\xB6"
+#define ICON_MD_DISC_FULL "\xEE\x98\x90"
+#define ICON_MD_DNS "\xEE\xA1\xB5"
+#define ICON_MD_DO_NOT_DISTURB "\xEE\x98\x92"
+#define ICON_MD_DO_NOT_DISTURB_ALT "\xEE\x98\x91"
+#define ICON_MD_DO_NOT_DISTURB_OFF "\xEE\x99\x83"
+#define ICON_MD_DO_NOT_DISTURB_ON "\xEE\x99\x84"
+#define ICON_MD_DOCK "\xEE\x8C\x8E"
+#define ICON_MD_DOMAIN "\xEE\x9F\xAE"
+#define ICON_MD_DONE "\xEE\xA1\xB6"
+#define ICON_MD_DONE_ALL "\xEE\xA1\xB7"
+#define ICON_MD_DONUT_LARGE "\xEE\xA4\x97"
+#define ICON_MD_DONUT_SMALL "\xEE\xA4\x98"
+#define ICON_MD_DRAFTS "\xEE\x85\x91"
+#define ICON_MD_DRAG_HANDLE "\xEE\x89\x9D"
+#define ICON_MD_DRIVE_ETA "\xEE\x98\x93"
+#define ICON_MD_DVR "\xEE\x86\xB2"
+#define ICON_MD_EDIT "\xEE\x8F\x89"
+#define ICON_MD_EDIT_LOCATION "\xEE\x95\xA8"
+#define ICON_MD_EJECT "\xEE\xA3\xBB"
+#define ICON_MD_EMAIL "\xEE\x82\xBE"
+#define ICON_MD_ENHANCED_ENCRYPTION "\xEE\x98\xBF"
+#define ICON_MD_EQUALIZER "\xEE\x80\x9D"
+#define ICON_MD_ERROR "\xEE\x80\x80"
+#define ICON_MD_ERROR_OUTLINE "\xEE\x80\x81"
+#define ICON_MD_EURO_SYMBOL "\xEE\xA4\xA6"
+#define ICON_MD_EV_STATION "\xEE\x95\xAD"
+#define ICON_MD_EVENT "\xEE\xA1\xB8"
+#define ICON_MD_EVENT_AVAILABLE "\xEE\x98\x94"
+#define ICON_MD_EVENT_BUSY "\xEE\x98\x95"
+#define ICON_MD_EVENT_NOTE "\xEE\x98\x96"
+#define ICON_MD_EVENT_SEAT "\xEE\xA4\x83"
+#define ICON_MD_EXIT_TO_APP "\xEE\xA1\xB9"
+#define ICON_MD_EXPAND_LESS "\xEE\x97\x8E"
+#define ICON_MD_EXPAND_MORE "\xEE\x97\x8F"
+#define ICON_MD_EXPLICIT "\xEE\x80\x9E"
+#define ICON_MD_EXPLORE "\xEE\xA1\xBA"
+#define ICON_MD_EXPOSURE "\xEE\x8F\x8A"
+#define ICON_MD_EXPOSURE_NEG_1 "\xEE\x8F\x8B"
+#define ICON_MD_EXPOSURE_NEG_2 "\xEE\x8F\x8C"
+#define ICON_MD_EXPOSURE_PLUS_1 "\xEE\x8F\x8D"
+#define ICON_MD_EXPOSURE_PLUS_2 "\xEE\x8F\x8E"
+#define ICON_MD_EXPOSURE_ZERO "\xEE\x8F\x8F"
+#define ICON_MD_EXTENSION "\xEE\xA1\xBB"
+#define ICON_MD_FACE "\xEE\xA1\xBC"
+#define ICON_MD_FAST_FORWARD "\xEE\x80\x9F"
+#define ICON_MD_FAST_REWIND "\xEE\x80\xA0"
+#define ICON_MD_FAVORITE "\xEE\xA1\xBD"
+#define ICON_MD_FAVORITE_BORDER "\xEE\xA1\xBE"
+#define ICON_MD_FEATURED_PLAY_LIST "\xEE\x81\xAD"
+#define ICON_MD_FEATURED_VIDEO "\xEE\x81\xAE"
+#define ICON_MD_FEEDBACK "\xEE\xA1\xBF"
+#define ICON_MD_FIBER_DVR "\xEE\x81\x9D"
+#define ICON_MD_FIBER_MANUAL_RECORD "\xEE\x81\xA1"
+#define ICON_MD_FIBER_NEW "\xEE\x81\x9E"
+#define ICON_MD_FIBER_PIN "\xEE\x81\xAA"
+#define ICON_MD_FIBER_SMART_RECORD "\xEE\x81\xA2"
+#define ICON_MD_FILE_DOWNLOAD "\xEE\x8B\x84"
+#define ICON_MD_FILE_UPLOAD "\xEE\x8B\x86"
+#define ICON_MD_FILTER "\xEE\x8F\x93"
+#define ICON_MD_FILTER_1 "\xEE\x8F\x90"
+#define ICON_MD_FILTER_2 "\xEE\x8F\x91"
+#define ICON_MD_FILTER_3 "\xEE\x8F\x92"
+#define ICON_MD_FILTER_4 "\xEE\x8F\x94"
+#define ICON_MD_FILTER_5 "\xEE\x8F\x95"
+#define ICON_MD_FILTER_6 "\xEE\x8F\x96"
+#define ICON_MD_FILTER_7 "\xEE\x8F\x97"
+#define ICON_MD_FILTER_8 "\xEE\x8F\x98"
+#define ICON_MD_FILTER_9 "\xEE\x8F\x99"
+#define ICON_MD_FILTER_9_PLUS "\xEE\x8F\x9A"
+#define ICON_MD_FILTER_B_AND_W "\xEE\x8F\x9B"
+#define ICON_MD_FILTER_CENTER_FOCUS "\xEE\x8F\x9C"
+#define ICON_MD_FILTER_DRAMA "\xEE\x8F\x9D"
+#define ICON_MD_FILTER_FRAMES "\xEE\x8F\x9E"
+#define ICON_MD_FILTER_HDR "\xEE\x8F\x9F"
+#define ICON_MD_FILTER_LIST "\xEE\x85\x92"
+#define ICON_MD_FILTER_NONE "\xEE\x8F\xA0"
+#define ICON_MD_FILTER_TILT_SHIFT "\xEE\x8F\xA2"
+#define ICON_MD_FILTER_VINTAGE "\xEE\x8F\xA3"
+#define ICON_MD_FIND_IN_PAGE "\xEE\xA2\x80"
+#define ICON_MD_FIND_REPLACE "\xEE\xA2\x81"
+#define ICON_MD_FINGERPRINT "\xEE\xA4\x8D"
+#define ICON_MD_FIRST_PAGE "\xEE\x97\x9C"
+#define ICON_MD_FITNESS_CENTER "\xEE\xAD\x83"
+#define ICON_MD_FLAG "\xEE\x85\x93"
+#define ICON_MD_FLARE "\xEE\x8F\xA4"
+#define ICON_MD_FLASH_AUTO "\xEE\x8F\xA5"
+#define ICON_MD_FLASH_OFF "\xEE\x8F\xA6"
+#define ICON_MD_FLASH_ON "\xEE\x8F\xA7"
+#define ICON_MD_FLIGHT "\xEE\x94\xB9"
+#define ICON_MD_FLIGHT_LAND "\xEE\xA4\x84"
+#define ICON_MD_FLIGHT_TAKEOFF "\xEE\xA4\x85"
+#define ICON_MD_FLIP "\xEE\x8F\xA8"
+#define ICON_MD_FLIP_TO_BACK "\xEE\xA2\x82"
+#define ICON_MD_FLIP_TO_FRONT "\xEE\xA2\x83"
+#define ICON_MD_FOLDER "\xEE\x8B\x87"
+#define ICON_MD_FOLDER_OPEN "\xEE\x8B\x88"
+#define ICON_MD_FOLDER_SHARED "\xEE\x8B\x89"
+#define ICON_MD_FOLDER_SPECIAL "\xEE\x98\x97"
+#define ICON_MD_FONT_DOWNLOAD "\xEE\x85\xA7"
+#define ICON_MD_FORMAT_ALIGN_CENTER "\xEE\x88\xB4"
+#define ICON_MD_FORMAT_ALIGN_JUSTIFY "\xEE\x88\xB5"
+#define ICON_MD_FORMAT_ALIGN_LEFT "\xEE\x88\xB6"
+#define ICON_MD_FORMAT_ALIGN_RIGHT "\xEE\x88\xB7"
+#define ICON_MD_FORMAT_BOLD "\xEE\x88\xB8"
+#define ICON_MD_FORMAT_CLEAR "\xEE\x88\xB9"
+#define ICON_MD_FORMAT_COLOR_FILL "\xEE\x88\xBA"
+#define ICON_MD_FORMAT_COLOR_RESET "\xEE\x88\xBB"
+#define ICON_MD_FORMAT_COLOR_TEXT "\xEE\x88\xBC"
+#define ICON_MD_FORMAT_INDENT_DECREASE "\xEE\x88\xBD"
+#define ICON_MD_FORMAT_INDENT_INCREASE "\xEE\x88\xBE"
+#define ICON_MD_FORMAT_ITALIC "\xEE\x88\xBF"
+#define ICON_MD_FORMAT_LINE_SPACING "\xEE\x89\x80"
+#define ICON_MD_FORMAT_LIST_BULLETED "\xEE\x89\x81"
+#define ICON_MD_FORMAT_LIST_NUMBERED "\xEE\x89\x82"
+#define ICON_MD_FORMAT_PAINT "\xEE\x89\x83"
+#define ICON_MD_FORMAT_QUOTE "\xEE\x89\x84"
+#define ICON_MD_FORMAT_SHAPES "\xEE\x89\x9E"
+#define ICON_MD_FORMAT_SIZE "\xEE\x89\x85"
+#define ICON_MD_FORMAT_STRIKETHROUGH "\xEE\x89\x86"
+#define ICON_MD_FORMAT_TEXTDIRECTION_L_TO_R "\xEE\x89\x87"
+#define ICON_MD_FORMAT_TEXTDIRECTION_R_TO_L "\xEE\x89\x88"
+#define ICON_MD_FORMAT_UNDERLINED "\xEE\x89\x89"
+#define ICON_MD_FORUM "\xEE\x82\xBF"
+#define ICON_MD_FORWARD "\xEE\x85\x94"
+#define ICON_MD_FORWARD_10 "\xEE\x81\x96"
+#define ICON_MD_FORWARD_30 "\xEE\x81\x97"
+#define ICON_MD_FORWARD_5 "\xEE\x81\x98"
+#define ICON_MD_FREE_BREAKFAST "\xEE\xAD\x84"
+#define ICON_MD_FULLSCREEN "\xEE\x97\x90"
+#define ICON_MD_FULLSCREEN_EXIT "\xEE\x97\x91"
+#define ICON_MD_FUNCTIONS "\xEE\x89\x8A"
+#define ICON_MD_G_TRANSLATE "\xEE\xA4\xA7"
+#define ICON_MD_GAMEPAD "\xEE\x8C\x8F"
+#define ICON_MD_GAMES "\xEE\x80\xA1"
+#define ICON_MD_GAVEL "\xEE\xA4\x8E"
+#define ICON_MD_GESTURE "\xEE\x85\x95"
+#define ICON_MD_GET_APP "\xEE\xA2\x84"
+#define ICON_MD_GIF "\xEE\xA4\x88"
+#define ICON_MD_GOLF_COURSE "\xEE\xAD\x85"
+#define ICON_MD_GPS_FIXED "\xEE\x86\xB3"
+#define ICON_MD_GPS_NOT_FIXED "\xEE\x86\xB4"
+#define ICON_MD_GPS_OFF "\xEE\x86\xB5"
+#define ICON_MD_GRADE "\xEE\xA2\x85"
+#define ICON_MD_GRADIENT "\xEE\x8F\xA9"
+#define ICON_MD_GRAIN "\xEE\x8F\xAA"
+#define ICON_MD_GRAPHIC_EQ "\xEE\x86\xB8"
+#define ICON_MD_GRID_OFF "\xEE\x8F\xAB"
+#define ICON_MD_GRID_ON "\xEE\x8F\xAC"
+#define ICON_MD_GROUP "\xEE\x9F\xAF"
+#define ICON_MD_GROUP_ADD "\xEE\x9F\xB0"
+#define ICON_MD_GROUP_WORK "\xEE\xA2\x86"
+#define ICON_MD_HD "\xEE\x81\x92"
+#define ICON_MD_HDR_OFF "\xEE\x8F\xAD"
+#define ICON_MD_HDR_ON "\xEE\x8F\xAE"
+#define ICON_MD_HDR_STRONG "\xEE\x8F\xB1"
+#define ICON_MD_HDR_WEAK "\xEE\x8F\xB2"
+#define ICON_MD_HEADSET "\xEE\x8C\x90"
+#define ICON_MD_HEADSET_MIC "\xEE\x8C\x91"
+#define ICON_MD_HEALING "\xEE\x8F\xB3"
+#define ICON_MD_HEARING "\xEE\x80\xA3"
+#define ICON_MD_HELP "\xEE\xA2\x87"
+#define ICON_MD_HELP_OUTLINE "\xEE\xA3\xBD"
+#define ICON_MD_HIGH_QUALITY "\xEE\x80\xA4"
+#define ICON_MD_HIGHLIGHT "\xEE\x89\x9F"
+#define ICON_MD_HIGHLIGHT_OFF "\xEE\xA2\x88"
+#define ICON_MD_HISTORY "\xEE\xA2\x89"
+#define ICON_MD_HOME "\xEE\xA2\x8A"
+#define ICON_MD_HOT_TUB "\xEE\xAD\x86"
+#define ICON_MD_HOTEL "\xEE\x94\xBA"
+#define ICON_MD_HOURGLASS_EMPTY "\xEE\xA2\x8B"
+#define ICON_MD_HOURGLASS_FULL "\xEE\xA2\x8C"
+#define ICON_MD_HTTP "\xEE\xA4\x82"
+#define ICON_MD_HTTPS "\xEE\xA2\x8D"
+#define ICON_MD_IMAGE "\xEE\x8F\xB4"
+#define ICON_MD_IMAGE_ASPECT_RATIO "\xEE\x8F\xB5"
+#define ICON_MD_IMPORT_CONTACTS "\xEE\x83\xA0"
+#define ICON_MD_IMPORT_EXPORT "\xEE\x83\x83"
+#define ICON_MD_IMPORTANT_DEVICES "\xEE\xA4\x92"
+#define ICON_MD_INBOX "\xEE\x85\x96"
+#define ICON_MD_INDETERMINATE_CHECK_BOX "\xEE\xA4\x89"
+#define ICON_MD_INFO "\xEE\xA2\x8E"
+#define ICON_MD_INFO_OUTLINE "\xEE\xA2\x8F"
+#define ICON_MD_INPUT "\xEE\xA2\x90"
+#define ICON_MD_INSERT_CHART "\xEE\x89\x8B"
+#define ICON_MD_INSERT_COMMENT "\xEE\x89\x8C"
+#define ICON_MD_INSERT_DRIVE_FILE "\xEE\x89\x8D"
+#define ICON_MD_INSERT_EMOTICON "\xEE\x89\x8E"
+#define ICON_MD_INSERT_INVITATION "\xEE\x89\x8F"
+#define ICON_MD_INSERT_LINK "\xEE\x89\x90"
+#define ICON_MD_INSERT_PHOTO "\xEE\x89\x91"
+#define ICON_MD_INVERT_COLORS "\xEE\xA2\x91"
+#define ICON_MD_INVERT_COLORS_OFF "\xEE\x83\x84"
+#define ICON_MD_ISO "\xEE\x8F\xB6"
+#define ICON_MD_KEYBOARD "\xEE\x8C\x92"
+#define ICON_MD_KEYBOARD_ARROW_DOWN "\xEE\x8C\x93"
+#define ICON_MD_KEYBOARD_ARROW_LEFT "\xEE\x8C\x94"
+#define ICON_MD_KEYBOARD_ARROW_RIGHT "\xEE\x8C\x95"
+#define ICON_MD_KEYBOARD_ARROW_UP "\xEE\x8C\x96"
+#define ICON_MD_KEYBOARD_BACKSPACE "\xEE\x8C\x97"
+#define ICON_MD_KEYBOARD_CAPSLOCK "\xEE\x8C\x98"
+#define ICON_MD_KEYBOARD_HIDE "\xEE\x8C\x9A"
+#define ICON_MD_KEYBOARD_RETURN "\xEE\x8C\x9B"
+#define ICON_MD_KEYBOARD_TAB "\xEE\x8C\x9C"
+#define ICON_MD_KEYBOARD_VOICE "\xEE\x8C\x9D"
+#define ICON_MD_KITCHEN "\xEE\xAD\x87"
+#define ICON_MD_LABEL "\xEE\xA2\x92"
+#define ICON_MD_LABEL_OUTLINE "\xEE\xA2\x93"
+#define ICON_MD_LANDSCAPE "\xEE\x8F\xB7"
+#define ICON_MD_LANGUAGE "\xEE\xA2\x94"
+#define ICON_MD_LAPTOP "\xEE\x8C\x9E"
+#define ICON_MD_LAPTOP_CHROMEBOOK "\xEE\x8C\x9F"
+#define ICON_MD_LAPTOP_MAC "\xEE\x8C\xA0"
+#define ICON_MD_LAPTOP_WINDOWS "\xEE\x8C\xA1"
+#define ICON_MD_LAST_PAGE "\xEE\x97\x9D"
+#define ICON_MD_LAUNCH "\xEE\xA2\x95"
+#define ICON_MD_LAYERS "\xEE\x94\xBB"
+#define ICON_MD_LAYERS_CLEAR "\xEE\x94\xBC"
+#define ICON_MD_LEAK_ADD "\xEE\x8F\xB8"
+#define ICON_MD_LEAK_REMOVE "\xEE\x8F\xB9"
+#define ICON_MD_LENS "\xEE\x8F\xBA"
+#define ICON_MD_LIBRARY_ADD "\xEE\x80\xAE"
+#define ICON_MD_LIBRARY_BOOKS "\xEE\x80\xAF"
+#define ICON_MD_LIBRARY_MUSIC "\xEE\x80\xB0"
+#define ICON_MD_LIGHTBULB_OUTLINE "\xEE\xA4\x8F"
+#define ICON_MD_LINE_STYLE "\xEE\xA4\x99"
+#define ICON_MD_LINE_WEIGHT "\xEE\xA4\x9A"
+#define ICON_MD_LINEAR_SCALE "\xEE\x89\xA0"
+#define ICON_MD_LINK "\xEE\x85\x97"
+#define ICON_MD_LINKED_CAMERA "\xEE\x90\xB8"
+#define ICON_MD_LIST "\xEE\xA2\x96"
+#define ICON_MD_LIVE_HELP "\xEE\x83\x86"
+#define ICON_MD_LIVE_TV "\xEE\x98\xB9"
+#define ICON_MD_LOCAL_ACTIVITY "\xEE\x94\xBF"
+#define ICON_MD_LOCAL_AIRPORT "\xEE\x94\xBD"
+#define ICON_MD_LOCAL_ATM "\xEE\x94\xBE"
+#define ICON_MD_LOCAL_BAR "\xEE\x95\x80"
+#define ICON_MD_LOCAL_CAFE "\xEE\x95\x81"
+#define ICON_MD_LOCAL_CAR_WASH "\xEE\x95\x82"
+#define ICON_MD_LOCAL_CONVENIENCE_STORE "\xEE\x95\x83"
+#define ICON_MD_LOCAL_DINING "\xEE\x95\x96"
+#define ICON_MD_LOCAL_DRINK "\xEE\x95\x84"
+#define ICON_MD_LOCAL_FLORIST "\xEE\x95\x85"
+#define ICON_MD_LOCAL_GAS_STATION "\xEE\x95\x86"
+#define ICON_MD_LOCAL_GROCERY_STORE "\xEE\x95\x87"
+#define ICON_MD_LOCAL_HOSPITAL "\xEE\x95\x88"
+#define ICON_MD_LOCAL_HOTEL "\xEE\x95\x89"
+#define ICON_MD_LOCAL_LAUNDRY_SERVICE "\xEE\x95\x8A"
+#define ICON_MD_LOCAL_LIBRARY "\xEE\x95\x8B"
+#define ICON_MD_LOCAL_MALL "\xEE\x95\x8C"
+#define ICON_MD_LOCAL_MOVIES "\xEE\x95\x8D"
+#define ICON_MD_LOCAL_OFFER "\xEE\x95\x8E"
+#define ICON_MD_LOCAL_PARKING "\xEE\x95\x8F"
+#define ICON_MD_LOCAL_PHARMACY "\xEE\x95\x90"
+#define ICON_MD_LOCAL_PHONE "\xEE\x95\x91"
+#define ICON_MD_LOCAL_PIZZA "\xEE\x95\x92"
+#define ICON_MD_LOCAL_PLAY "\xEE\x95\x93"
+#define ICON_MD_LOCAL_POST_OFFICE "\xEE\x95\x94"
+#define ICON_MD_LOCAL_PRINTSHOP "\xEE\x95\x95"
+#define ICON_MD_LOCAL_SEE "\xEE\x95\x97"
+#define ICON_MD_LOCAL_SHIPPING "\xEE\x95\x98"
+#define ICON_MD_LOCAL_TAXI "\xEE\x95\x99"
+#define ICON_MD_LOCATION_CITY "\xEE\x9F\xB1"
+#define ICON_MD_LOCATION_DISABLED "\xEE\x86\xB6"
+#define ICON_MD_LOCATION_OFF "\xEE\x83\x87"
+#define ICON_MD_LOCATION_ON "\xEE\x83\x88"
+#define ICON_MD_LOCATION_SEARCHING "\xEE\x86\xB7"
+#define ICON_MD_LOCK "\xEE\xA2\x97"
+#define ICON_MD_LOCK_OPEN "\xEE\xA2\x98"
+#define ICON_MD_LOCK_OUTLINE "\xEE\xA2\x99"
+#define ICON_MD_LOOKS "\xEE\x8F\xBC"
+#define ICON_MD_LOOKS_3 "\xEE\x8F\xBB"
+#define ICON_MD_LOOKS_4 "\xEE\x8F\xBD"
+#define ICON_MD_LOOKS_5 "\xEE\x8F\xBE"
+#define ICON_MD_LOOKS_6 "\xEE\x8F\xBF"
+#define ICON_MD_LOOKS_ONE "\xEE\x90\x80"
+#define ICON_MD_LOOKS_TWO "\xEE\x90\x81"
+#define ICON_MD_LOOP "\xEE\x80\xA8"
+#define ICON_MD_LOUPE "\xEE\x90\x82"
+#define ICON_MD_LOW_PRIORITY "\xEE\x85\xAD"
+#define ICON_MD_LOYALTY "\xEE\xA2\x9A"
+#define ICON_MD_MAIL "\xEE\x85\x98"
+#define ICON_MD_MAIL_OUTLINE "\xEE\x83\xA1"
+#define ICON_MD_MAP "\xEE\x95\x9B"
+#define ICON_MD_MARKUNREAD "\xEE\x85\x99"
+#define ICON_MD_MARKUNREAD_MAILBOX "\xEE\xA2\x9B"
+#define ICON_MD_MEMORY "\xEE\x8C\xA2"
+#define ICON_MD_MENU "\xEE\x97\x92"
+#define ICON_MD_MERGE_TYPE "\xEE\x89\x92"
+#define ICON_MD_MESSAGE "\xEE\x83\x89"
+#define ICON_MD_MIC "\xEE\x80\xA9"
+#define ICON_MD_MIC_NONE "\xEE\x80\xAA"
+#define ICON_MD_MIC_OFF "\xEE\x80\xAB"
+#define ICON_MD_MMS "\xEE\x98\x98"
+#define ICON_MD_MODE_COMMENT "\xEE\x89\x93"
+#define ICON_MD_MODE_EDIT "\xEE\x89\x94"
+#define ICON_MD_MONETIZATION_ON "\xEE\x89\xA3"
+#define ICON_MD_MONEY_OFF "\xEE\x89\x9C"
+#define ICON_MD_MONOCHROME_PHOTOS "\xEE\x90\x83"
+#define ICON_MD_MOOD "\xEE\x9F\xB2"
+#define ICON_MD_MOOD_BAD "\xEE\x9F\xB3"
+#define ICON_MD_MORE "\xEE\x98\x99"
+#define ICON_MD_MORE_HORIZ "\xEE\x97\x93"
+#define ICON_MD_MORE_VERT "\xEE\x97\x94"
+#define ICON_MD_MOTORCYCLE "\xEE\xA4\x9B"
+#define ICON_MD_MOUSE "\xEE\x8C\xA3"
+#define ICON_MD_MOVE_TO_INBOX "\xEE\x85\xA8"
+#define ICON_MD_MOVIE "\xEE\x80\xAC"
+#define ICON_MD_MOVIE_CREATION "\xEE\x90\x84"
+#define ICON_MD_MOVIE_FILTER "\xEE\x90\xBA"
+#define ICON_MD_MULTILINE_CHART "\xEE\x9B\x9F"
+#define ICON_MD_MUSIC_NOTE "\xEE\x90\x85"
+#define ICON_MD_MUSIC_VIDEO "\xEE\x81\xA3"
+#define ICON_MD_MY_LOCATION "\xEE\x95\x9C"
+#define ICON_MD_NATURE "\xEE\x90\x86"
+#define ICON_MD_NATURE_PEOPLE "\xEE\x90\x87"
+#define ICON_MD_NAVIGATE_BEFORE "\xEE\x90\x88"
+#define ICON_MD_NAVIGATE_NEXT "\xEE\x90\x89"
+#define ICON_MD_NAVIGATION "\xEE\x95\x9D"
+#define ICON_MD_NEAR_ME "\xEE\x95\xA9"
+#define ICON_MD_NETWORK_CELL "\xEE\x86\xB9"
+#define ICON_MD_NETWORK_CHECK "\xEE\x99\x80"
+#define ICON_MD_NETWORK_LOCKED "\xEE\x98\x9A"
+#define ICON_MD_NETWORK_WIFI "\xEE\x86\xBA"
+#define ICON_MD_NEW_RELEASES "\xEE\x80\xB1"
+#define ICON_MD_NEXT_WEEK "\xEE\x85\xAA"
+#define ICON_MD_NFC "\xEE\x86\xBB"
+#define ICON_MD_NO_ENCRYPTION "\xEE\x99\x81"
+#define ICON_MD_NO_SIM "\xEE\x83\x8C"
+#define ICON_MD_NOT_INTERESTED "\xEE\x80\xB3"
+#define ICON_MD_NOTE "\xEE\x81\xAF"
+#define ICON_MD_NOTE_ADD "\xEE\xA2\x9C"
+#define ICON_MD_NOTIFICATIONS "\xEE\x9F\xB4"
+#define ICON_MD_NOTIFICATIONS_ACTIVE "\xEE\x9F\xB7"
+#define ICON_MD_NOTIFICATIONS_NONE "\xEE\x9F\xB5"
+#define ICON_MD_NOTIFICATIONS_OFF "\xEE\x9F\xB6"
+#define ICON_MD_NOTIFICATIONS_PAUSED "\xEE\x9F\xB8"
+#define ICON_MD_OFFLINE_PIN "\xEE\xA4\x8A"
+#define ICON_MD_ONDEMAND_VIDEO "\xEE\x98\xBA"
+#define ICON_MD_OPACITY "\xEE\xA4\x9C"
+#define ICON_MD_OPEN_IN_BROWSER "\xEE\xA2\x9D"
+#define ICON_MD_OPEN_IN_NEW "\xEE\xA2\x9E"
+#define ICON_MD_OPEN_WITH "\xEE\xA2\x9F"
+#define ICON_MD_PAGES "\xEE\x9F\xB9"
+#define ICON_MD_PAGEVIEW "\xEE\xA2\xA0"
+#define ICON_MD_PALETTE "\xEE\x90\x8A"
+#define ICON_MD_PAN_TOOL "\xEE\xA4\xA5"
+#define ICON_MD_PANORAMA "\xEE\x90\x8B"
+#define ICON_MD_PANORAMA_FISH_EYE "\xEE\x90\x8C"
+#define ICON_MD_PANORAMA_HORIZONTAL "\xEE\x90\x8D"
+#define ICON_MD_PANORAMA_VERTICAL "\xEE\x90\x8E"
+#define ICON_MD_PANORAMA_WIDE_ANGLE "\xEE\x90\x8F"
+#define ICON_MD_PARTY_MODE "\xEE\x9F\xBA"
+#define ICON_MD_PAUSE "\xEE\x80\xB4"
+#define ICON_MD_PAUSE_CIRCLE_FILLED "\xEE\x80\xB5"
+#define ICON_MD_PAUSE_CIRCLE_OUTLINE "\xEE\x80\xB6"
+#define ICON_MD_PAYMENT "\xEE\xA2\xA1"
+#define ICON_MD_PEOPLE "\xEE\x9F\xBB"
+#define ICON_MD_PEOPLE_OUTLINE "\xEE\x9F\xBC"
+#define ICON_MD_PERM_CAMERA_MIC "\xEE\xA2\xA2"
+#define ICON_MD_PERM_CONTACT_CALENDAR "\xEE\xA2\xA3"
+#define ICON_MD_PERM_DATA_SETTING "\xEE\xA2\xA4"
+#define ICON_MD_PERM_DEVICE_INFORMATION "\xEE\xA2\xA5"
+#define ICON_MD_PERM_IDENTITY "\xEE\xA2\xA6"
+#define ICON_MD_PERM_MEDIA "\xEE\xA2\xA7"
+#define ICON_MD_PERM_PHONE_MSG "\xEE\xA2\xA8"
+#define ICON_MD_PERM_SCAN_WIFI "\xEE\xA2\xA9"
+#define ICON_MD_PERSON "\xEE\x9F\xBD"
+#define ICON_MD_PERSON_ADD "\xEE\x9F\xBE"
+#define ICON_MD_PERSON_OUTLINE "\xEE\x9F\xBF"
+#define ICON_MD_PERSON_PIN "\xEE\x95\x9A"
+#define ICON_MD_PERSON_PIN_CIRCLE "\xEE\x95\xAA"
+#define ICON_MD_PERSONAL_VIDEO "\xEE\x98\xBB"
+#define ICON_MD_PETS "\xEE\xA4\x9D"
+#define ICON_MD_PHONE "\xEE\x83\x8D"
+#define ICON_MD_PHONE_ANDROID "\xEE\x8C\xA4"
+#define ICON_MD_PHONE_BLUETOOTH_SPEAKER "\xEE\x98\x9B"
+#define ICON_MD_PHONE_FORWARDED "\xEE\x98\x9C"
+#define ICON_MD_PHONE_IN_TALK "\xEE\x98\x9D"
+#define ICON_MD_PHONE_IPHONE "\xEE\x8C\xA5"
+#define ICON_MD_PHONE_LOCKED "\xEE\x98\x9E"
+#define ICON_MD_PHONE_MISSED "\xEE\x98\x9F"
+#define ICON_MD_PHONE_PAUSED "\xEE\x98\xA0"
+#define ICON_MD_PHONELINK "\xEE\x8C\xA6"
+#define ICON_MD_PHONELINK_ERASE "\xEE\x83\x9B"
+#define ICON_MD_PHONELINK_LOCK "\xEE\x83\x9C"
+#define ICON_MD_PHONELINK_OFF "\xEE\x8C\xA7"
+#define ICON_MD_PHONELINK_RING "\xEE\x83\x9D"
+#define ICON_MD_PHONELINK_SETUP "\xEE\x83\x9E"
+#define ICON_MD_PHOTO "\xEE\x90\x90"
+#define ICON_MD_PHOTO_ALBUM "\xEE\x90\x91"
+#define ICON_MD_PHOTO_CAMERA "\xEE\x90\x92"
+#define ICON_MD_PHOTO_FILTER "\xEE\x90\xBB"
+#define ICON_MD_PHOTO_LIBRARY "\xEE\x90\x93"
+#define ICON_MD_PHOTO_SIZE_SELECT_ACTUAL "\xEE\x90\xB2"
+#define ICON_MD_PHOTO_SIZE_SELECT_LARGE "\xEE\x90\xB3"
+#define ICON_MD_PHOTO_SIZE_SELECT_SMALL "\xEE\x90\xB4"
+#define ICON_MD_PICTURE_AS_PDF "\xEE\x90\x95"
+#define ICON_MD_PICTURE_IN_PICTURE "\xEE\xA2\xAA"
+#define ICON_MD_PICTURE_IN_PICTURE_ALT "\xEE\xA4\x91"
+#define ICON_MD_PIE_CHART "\xEE\x9B\x84"
+#define ICON_MD_PIE_CHART_OUTLINED "\xEE\x9B\x85"
+#define ICON_MD_PIN_DROP "\xEE\x95\x9E"
+#define ICON_MD_PLACE "\xEE\x95\x9F"
+#define ICON_MD_PLAY_ARROW "\xEE\x80\xB7"
+#define ICON_MD_PLAY_CIRCLE_FILLED "\xEE\x80\xB8"
+#define ICON_MD_PLAY_CIRCLE_OUTLINE "\xEE\x80\xB9"
+#define ICON_MD_PLAY_FOR_WORK "\xEE\xA4\x86"
+#define ICON_MD_PLAYLIST_ADD "\xEE\x80\xBB"
+#define ICON_MD_PLAYLIST_ADD_CHECK "\xEE\x81\xA5"
+#define ICON_MD_PLAYLIST_PLAY "\xEE\x81\x9F"
+#define ICON_MD_PLUS_ONE "\xEE\xA0\x80"
+#define ICON_MD_POLL "\xEE\xA0\x81"
+#define ICON_MD_POLYMER "\xEE\xA2\xAB"
+#define ICON_MD_POOL "\xEE\xAD\x88"
+#define ICON_MD_PORTABLE_WIFI_OFF "\xEE\x83\x8E"
+#define ICON_MD_PORTRAIT "\xEE\x90\x96"
+#define ICON_MD_POWER "\xEE\x98\xBC"
+#define ICON_MD_POWER_INPUT "\xEE\x8C\xB6"
+#define ICON_MD_POWER_SETTINGS_NEW "\xEE\xA2\xAC"
+#define ICON_MD_PREGNANT_WOMAN "\xEE\xA4\x9E"
+#define ICON_MD_PRESENT_TO_ALL "\xEE\x83\x9F"
+#define ICON_MD_PRINT "\xEE\xA2\xAD"
+#define ICON_MD_PRIORITY_HIGH "\xEE\x99\x85"
+#define ICON_MD_PUBLIC "\xEE\xA0\x8B"
+#define ICON_MD_PUBLISH "\xEE\x89\x95"
+#define ICON_MD_QUERY_BUILDER "\xEE\xA2\xAE"
+#define ICON_MD_QUESTION_ANSWER "\xEE\xA2\xAF"
+#define ICON_MD_QUEUE "\xEE\x80\xBC"
+#define ICON_MD_QUEUE_MUSIC "\xEE\x80\xBD"
+#define ICON_MD_QUEUE_PLAY_NEXT "\xEE\x81\xA6"
+#define ICON_MD_RADIO "\xEE\x80\xBE"
+#define ICON_MD_RADIO_BUTTON_CHECKED "\xEE\xA0\xB7"
+#define ICON_MD_RADIO_BUTTON_UNCHECKED "\xEE\xA0\xB6"
+#define ICON_MD_RATE_REVIEW "\xEE\x95\xA0"
+#define ICON_MD_RECEIPT "\xEE\xA2\xB0"
+#define ICON_MD_RECENT_ACTORS "\xEE\x80\xBF"
+#define ICON_MD_RECORD_VOICE_OVER "\xEE\xA4\x9F"
+#define ICON_MD_REDEEM "\xEE\xA2\xB1"
+#define ICON_MD_REDO "\xEE\x85\x9A"
+#define ICON_MD_REFRESH "\xEE\x97\x95"
+#define ICON_MD_REMOVE "\xEE\x85\x9B"
+#define ICON_MD_REMOVE_CIRCLE "\xEE\x85\x9C"
+#define ICON_MD_REMOVE_CIRCLE_OUTLINE "\xEE\x85\x9D"
+#define ICON_MD_REMOVE_FROM_QUEUE "\xEE\x81\xA7"
+#define ICON_MD_REMOVE_RED_EYE "\xEE\x90\x97"
+#define ICON_MD_REMOVE_SHOPPING_CART "\xEE\xA4\xA8"
+#define ICON_MD_REORDER "\xEE\xA3\xBE"
+#define ICON_MD_REPEAT "\xEE\x81\x80"
+#define ICON_MD_REPEAT_ONE "\xEE\x81\x81"
+#define ICON_MD_REPLAY "\xEE\x81\x82"
+#define ICON_MD_REPLAY_10 "\xEE\x81\x99"
+#define ICON_MD_REPLAY_30 "\xEE\x81\x9A"
+#define ICON_MD_REPLAY_5 "\xEE\x81\x9B"
+#define ICON_MD_REPLY "\xEE\x85\x9E"
+#define ICON_MD_REPLY_ALL "\xEE\x85\x9F"
+#define ICON_MD_REPORT "\xEE\x85\xA0"
+#define ICON_MD_REPORT_PROBLEM "\xEE\xA2\xB2"
+#define ICON_MD_RESTAURANT "\xEE\x95\xAC"
+#define ICON_MD_RESTAURANT_MENU "\xEE\x95\xA1"
+#define ICON_MD_RESTORE "\xEE\xA2\xB3"
+#define ICON_MD_RESTORE_PAGE "\xEE\xA4\xA9"
+#define ICON_MD_RING_VOLUME "\xEE\x83\x91"
+#define ICON_MD_ROOM "\xEE\xA2\xB4"
+#define ICON_MD_ROOM_SERVICE "\xEE\xAD\x89"
+#define ICON_MD_ROTATE_90_DEGREES_CCW "\xEE\x90\x98"
+#define ICON_MD_ROTATE_LEFT "\xEE\x90\x99"
+#define ICON_MD_ROTATE_RIGHT "\xEE\x90\x9A"
+#define ICON_MD_ROUNDED_CORNER "\xEE\xA4\xA0"
+#define ICON_MD_ROUTER "\xEE\x8C\xA8"
+#define ICON_MD_ROWING "\xEE\xA4\xA1"
+#define ICON_MD_RSS_FEED "\xEE\x83\xA5"
+#define ICON_MD_RV_HOOKUP "\xEE\x99\x82"
+#define ICON_MD_SATELLITE "\xEE\x95\xA2"
+#define ICON_MD_SAVE "\xEE\x85\xA1"
+#define ICON_MD_SCANNER "\xEE\x8C\xA9"
+#define ICON_MD_SCHEDULE "\xEE\xA2\xB5"
+#define ICON_MD_SCHOOL "\xEE\xA0\x8C"
+#define ICON_MD_SCREEN_LOCK_LANDSCAPE "\xEE\x86\xBE"
+#define ICON_MD_SCREEN_LOCK_PORTRAIT "\xEE\x86\xBF"
+#define ICON_MD_SCREEN_LOCK_ROTATION "\xEE\x87\x80"
+#define ICON_MD_SCREEN_ROTATION "\xEE\x87\x81"
+#define ICON_MD_SCREEN_SHARE "\xEE\x83\xA2"
+#define ICON_MD_SD_CARD "\xEE\x98\xA3"
+#define ICON_MD_SD_STORAGE "\xEE\x87\x82"
+#define ICON_MD_SEARCH "\xEE\xA2\xB6"
+#define ICON_MD_SECURITY "\xEE\x8C\xAA"
+#define ICON_MD_SELECT_ALL "\xEE\x85\xA2"
+#define ICON_MD_SEND "\xEE\x85\xA3"
+#define ICON_MD_SENTIMENT_DISSATISFIED "\xEE\xA0\x91"
+#define ICON_MD_SENTIMENT_NEUTRAL "\xEE\xA0\x92"
+#define ICON_MD_SENTIMENT_SATISFIED "\xEE\xA0\x93"
+#define ICON_MD_SENTIMENT_VERY_DISSATISFIED "\xEE\xA0\x94"
+#define ICON_MD_SENTIMENT_VERY_SATISFIED "\xEE\xA0\x95"
+#define ICON_MD_SETTINGS "\xEE\xA2\xB8"
+#define ICON_MD_SETTINGS_APPLICATIONS "\xEE\xA2\xB9"
+#define ICON_MD_SETTINGS_BACKUP_RESTORE "\xEE\xA2\xBA"
+#define ICON_MD_SETTINGS_BLUETOOTH "\xEE\xA2\xBB"
+#define ICON_MD_SETTINGS_BRIGHTNESS "\xEE\xA2\xBD"
+#define ICON_MD_SETTINGS_CELL "\xEE\xA2\xBC"
+#define ICON_MD_SETTINGS_ETHERNET "\xEE\xA2\xBE"
+#define ICON_MD_SETTINGS_INPUT_ANTENNA "\xEE\xA2\xBF"
+#define ICON_MD_SETTINGS_INPUT_COMPONENT "\xEE\xA3\x80"
+#define ICON_MD_SETTINGS_INPUT_COMPOSITE "\xEE\xA3\x81"
+#define ICON_MD_SETTINGS_INPUT_HDMI "\xEE\xA3\x82"
+#define ICON_MD_SETTINGS_INPUT_SVIDEO "\xEE\xA3\x83"
+#define ICON_MD_SETTINGS_OVERSCAN "\xEE\xA3\x84"
+#define ICON_MD_SETTINGS_PHONE "\xEE\xA3\x85"
+#define ICON_MD_SETTINGS_POWER "\xEE\xA3\x86"
+#define ICON_MD_SETTINGS_REMOTE "\xEE\xA3\x87"
+#define ICON_MD_SETTINGS_SYSTEM_DAYDREAM "\xEE\x87\x83"
+#define ICON_MD_SETTINGS_VOICE "\xEE\xA3\x88"
+#define ICON_MD_SHARE "\xEE\xA0\x8D"
+#define ICON_MD_SHOP "\xEE\xA3\x89"
+#define ICON_MD_SHOP_TWO "\xEE\xA3\x8A"
+#define ICON_MD_SHOPPING_BASKET "\xEE\xA3\x8B"
+#define ICON_MD_SHOPPING_CART "\xEE\xA3\x8C"
+#define ICON_MD_SHORT_TEXT "\xEE\x89\xA1"
+#define ICON_MD_SHOW_CHART "\xEE\x9B\xA1"
+#define ICON_MD_SHUFFLE "\xEE\x81\x83"
+#define ICON_MD_SIGNAL_CELLULAR_4_BAR "\xEE\x87\x88"
+#define ICON_MD_SIGNAL_CELLULAR_CONNECTED_NO_INTERNET_4_BAR "\xEE\x87\x8D"
+#define ICON_MD_SIGNAL_CELLULAR_NO_SIM "\xEE\x87\x8E"
+#define ICON_MD_SIGNAL_CELLULAR_NULL "\xEE\x87\x8F"
+#define ICON_MD_SIGNAL_CELLULAR_OFF "\xEE\x87\x90"
+#define ICON_MD_SIGNAL_WIFI_4_BAR "\xEE\x87\x98"
+#define ICON_MD_SIGNAL_WIFI_4_BAR_LOCK "\xEE\x87\x99"
+#define ICON_MD_SIGNAL_WIFI_OFF "\xEE\x87\x9A"
+#define ICON_MD_SIM_CARD "\xEE\x8C\xAB"
+#define ICON_MD_SIM_CARD_ALERT "\xEE\x98\xA4"
+#define ICON_MD_SKIP_NEXT "\xEE\x81\x84"
+#define ICON_MD_SKIP_PREVIOUS "\xEE\x81\x85"
+#define ICON_MD_SLIDESHOW "\xEE\x90\x9B"
+#define ICON_MD_SLOW_MOTION_VIDEO "\xEE\x81\xA8"
+#define ICON_MD_SMARTPHONE "\xEE\x8C\xAC"
+#define ICON_MD_SMOKE_FREE "\xEE\xAD\x8A"
+#define ICON_MD_SMOKING_ROOMS "\xEE\xAD\x8B"
+#define ICON_MD_SMS "\xEE\x98\xA5"
+#define ICON_MD_SMS_FAILED "\xEE\x98\xA6"
+#define ICON_MD_SNOOZE "\xEE\x81\x86"
+#define ICON_MD_SORT "\xEE\x85\xA4"
+#define ICON_MD_SORT_BY_ALPHA "\xEE\x81\x93"
+#define ICON_MD_SPA "\xEE\xAD\x8C"
+#define ICON_MD_SPACE_BAR "\xEE\x89\x96"
+#define ICON_MD_SPEAKER "\xEE\x8C\xAD"
+#define ICON_MD_SPEAKER_GROUP "\xEE\x8C\xAE"
+#define ICON_MD_SPEAKER_NOTES "\xEE\xA3\x8D"
+#define ICON_MD_SPEAKER_NOTES_OFF "\xEE\xA4\xAA"
+#define ICON_MD_SPEAKER_PHONE "\xEE\x83\x92"
+#define ICON_MD_SPELLCHECK "\xEE\xA3\x8E"
+#define ICON_MD_STAR "\xEE\xA0\xB8"
+#define ICON_MD_STAR_BORDER "\xEE\xA0\xBA"
+#define ICON_MD_STAR_HALF "\xEE\xA0\xB9"
+#define ICON_MD_STARS "\xEE\xA3\x90"
+#define ICON_MD_STAY_CURRENT_LANDSCAPE "\xEE\x83\x93"
+#define ICON_MD_STAY_CURRENT_PORTRAIT "\xEE\x83\x94"
+#define ICON_MD_STAY_PRIMARY_LANDSCAPE "\xEE\x83\x95"
+#define ICON_MD_STAY_PRIMARY_PORTRAIT "\xEE\x83\x96"
+#define ICON_MD_STOP "\xEE\x81\x87"
+#define ICON_MD_STOP_SCREEN_SHARE "\xEE\x83\xA3"
+#define ICON_MD_STORAGE "\xEE\x87\x9B"
+#define ICON_MD_STORE "\xEE\xA3\x91"
+#define ICON_MD_STORE_MALL_DIRECTORY "\xEE\x95\xA3"
+#define ICON_MD_STRAIGHTEN "\xEE\x90\x9C"
+#define ICON_MD_STREETVIEW "\xEE\x95\xAE"
+#define ICON_MD_STRIKETHROUGH_S "\xEE\x89\x97"
+#define ICON_MD_STYLE "\xEE\x90\x9D"
+#define ICON_MD_SUBDIRECTORY_ARROW_LEFT "\xEE\x97\x99"
+#define ICON_MD_SUBDIRECTORY_ARROW_RIGHT "\xEE\x97\x9A"
+#define ICON_MD_SUBJECT "\xEE\xA3\x92"
+#define ICON_MD_SUBSCRIPTIONS "\xEE\x81\xA4"
+#define ICON_MD_SUBTITLES "\xEE\x81\x88"
+#define ICON_MD_SUBWAY "\xEE\x95\xAF"
+#define ICON_MD_SUPERVISOR_ACCOUNT "\xEE\xA3\x93"
+#define ICON_MD_SURROUND_SOUND "\xEE\x81\x89"
+#define ICON_MD_SWAP_CALLS "\xEE\x83\x97"
+#define ICON_MD_SWAP_HORIZ "\xEE\xA3\x94"
+#define ICON_MD_SWAP_VERT "\xEE\xA3\x95"
+#define ICON_MD_SWAP_VERTICAL_CIRCLE "\xEE\xA3\x96"
+#define ICON_MD_SWITCH_CAMERA "\xEE\x90\x9E"
+#define ICON_MD_SWITCH_VIDEO "\xEE\x90\x9F"
+#define ICON_MD_SYNC "\xEE\x98\xA7"
+#define ICON_MD_SYNC_DISABLED "\xEE\x98\xA8"
+#define ICON_MD_SYNC_PROBLEM "\xEE\x98\xA9"
+#define ICON_MD_SYSTEM_UPDATE "\xEE\x98\xAA"
+#define ICON_MD_SYSTEM_UPDATE_ALT "\xEE\xA3\x97"
+#define ICON_MD_TAB "\xEE\xA3\x98"
+#define ICON_MD_TAB_UNSELECTED "\xEE\xA3\x99"
+#define ICON_MD_TABLET "\xEE\x8C\xAF"
+#define ICON_MD_TABLET_ANDROID "\xEE\x8C\xB0"
+#define ICON_MD_TABLET_MAC "\xEE\x8C\xB1"
+#define ICON_MD_TAG_FACES "\xEE\x90\xA0"
+#define ICON_MD_TAP_AND_PLAY "\xEE\x98\xAB"
+#define ICON_MD_TERRAIN "\xEE\x95\xA4"
+#define ICON_MD_TEXT_FIELDS "\xEE\x89\xA2"
+#define ICON_MD_TEXT_FORMAT "\xEE\x85\xA5"
+#define ICON_MD_TEXTSMS "\xEE\x83\x98"
+#define ICON_MD_TEXTURE "\xEE\x90\xA1"
+#define ICON_MD_THEATERS "\xEE\xA3\x9A"
+#define ICON_MD_THUMB_DOWN "\xEE\xA3\x9B"
+#define ICON_MD_THUMB_UP "\xEE\xA3\x9C"
+#define ICON_MD_THUMBS_UP_DOWN "\xEE\xA3\x9D"
+#define ICON_MD_TIME_TO_LEAVE "\xEE\x98\xAC"
+#define ICON_MD_TIMELAPSE "\xEE\x90\xA2"
+#define ICON_MD_TIMELINE "\xEE\xA4\xA2"
+#define ICON_MD_TIMER "\xEE\x90\xA5"
+#define ICON_MD_TIMER_10 "\xEE\x90\xA3"
+#define ICON_MD_TIMER_3 "\xEE\x90\xA4"
+#define ICON_MD_TIMER_OFF "\xEE\x90\xA6"
+#define ICON_MD_TITLE "\xEE\x89\xA4"
+#define ICON_MD_TOC "\xEE\xA3\x9E"
+#define ICON_MD_TODAY "\xEE\xA3\x9F"
+#define ICON_MD_TOLL "\xEE\xA3\xA0"
+#define ICON_MD_TONALITY "\xEE\x90\xA7"
+#define ICON_MD_TOUCH_APP "\xEE\xA4\x93"
+#define ICON_MD_TOYS "\xEE\x8C\xB2"
+#define ICON_MD_TRACK_CHANGES "\xEE\xA3\xA1"
+#define ICON_MD_TRAFFIC "\xEE\x95\xA5"
+#define ICON_MD_TRAIN "\xEE\x95\xB0"
+#define ICON_MD_TRAM "\xEE\x95\xB1"
+#define ICON_MD_TRANSFER_WITHIN_A_STATION "\xEE\x95\xB2"
+#define ICON_MD_TRANSFORM "\xEE\x90\xA8"
+#define ICON_MD_TRANSLATE "\xEE\xA3\xA2"
+#define ICON_MD_TRENDING_DOWN "\xEE\xA3\xA3"
+#define ICON_MD_TRENDING_FLAT "\xEE\xA3\xA4"
+#define ICON_MD_TRENDING_UP "\xEE\xA3\xA5"
+#define ICON_MD_TUNE "\xEE\x90\xA9"
+#define ICON_MD_TURNED_IN "\xEE\xA3\xA6"
+#define ICON_MD_TURNED_IN_NOT "\xEE\xA3\xA7"
+#define ICON_MD_TV "\xEE\x8C\xB3"
+#define ICON_MD_UNARCHIVE "\xEE\x85\xA9"
+#define ICON_MD_UNDO "\xEE\x85\xA6"
+#define ICON_MD_UNFOLD_LESS "\xEE\x97\x96"
+#define ICON_MD_UNFOLD_MORE "\xEE\x97\x97"
+#define ICON_MD_UPDATE "\xEE\xA4\xA3"
+#define ICON_MD_USB "\xEE\x87\xA0"
+#define ICON_MD_VERIFIED_USER "\xEE\xA3\xA8"
+#define ICON_MD_VERTICAL_ALIGN_BOTTOM "\xEE\x89\x98"
+#define ICON_MD_VERTICAL_ALIGN_CENTER "\xEE\x89\x99"
+#define ICON_MD_VERTICAL_ALIGN_TOP "\xEE\x89\x9A"
+#define ICON_MD_VIBRATION "\xEE\x98\xAD"
+#define ICON_MD_VIDEO_CALL "\xEE\x81\xB0"
+#define ICON_MD_VIDEO_LABEL "\xEE\x81\xB1"
+#define ICON_MD_VIDEO_LIBRARY "\xEE\x81\x8A"
+#define ICON_MD_VIDEOCAM "\xEE\x81\x8B"
+#define ICON_MD_VIDEOCAM_OFF "\xEE\x81\x8C"
+#define ICON_MD_VIDEOGAME_ASSET "\xEE\x8C\xB8"
+#define ICON_MD_VIEW_AGENDA "\xEE\xA3\xA9"
+#define ICON_MD_VIEW_ARRAY "\xEE\xA3\xAA"
+#define ICON_MD_VIEW_CAROUSEL "\xEE\xA3\xAB"
+#define ICON_MD_VIEW_COLUMN "\xEE\xA3\xAC"
+#define ICON_MD_VIEW_COMFY "\xEE\x90\xAA"
+#define ICON_MD_VIEW_COMPACT "\xEE\x90\xAB"
+#define ICON_MD_VIEW_DAY "\xEE\xA3\xAD"
+#define ICON_MD_VIEW_HEADLINE "\xEE\xA3\xAE"
+#define ICON_MD_VIEW_LIST "\xEE\xA3\xAF"
+#define ICON_MD_VIEW_MODULE "\xEE\xA3\xB0"
+#define ICON_MD_VIEW_QUILT "\xEE\xA3\xB1"
+#define ICON_MD_VIEW_STREAM "\xEE\xA3\xB2"
+#define ICON_MD_VIEW_WEEK "\xEE\xA3\xB3"
+#define ICON_MD_VIGNETTE "\xEE\x90\xB5"
+#define ICON_MD_VISIBILITY "\xEE\xA3\xB4"
+#define ICON_MD_VISIBILITY_OFF "\xEE\xA3\xB5"
+#define ICON_MD_VOICE_CHAT "\xEE\x98\xAE"
+#define ICON_MD_VOICEMAIL "\xEE\x83\x99"
+#define ICON_MD_VOLUME_DOWN "\xEE\x81\x8D"
+#define ICON_MD_VOLUME_MUTE "\xEE\x81\x8E"
+#define ICON_MD_VOLUME_OFF "\xEE\x81\x8F"
+#define ICON_MD_VOLUME_UP "\xEE\x81\x90"
+#define ICON_MD_VPN_KEY "\xEE\x83\x9A"
+#define ICON_MD_VPN_LOCK "\xEE\x98\xAF"
+#define ICON_MD_WALLPAPER "\xEE\x86\xBC"
+#define ICON_MD_WARNING "\xEE\x80\x82"
+#define ICON_MD_WATCH "\xEE\x8C\xB4"
+#define ICON_MD_WATCH_LATER "\xEE\xA4\xA4"
+#define ICON_MD_WB_AUTO "\xEE\x90\xAC"
+#define ICON_MD_WB_CLOUDY "\xEE\x90\xAD"
+#define ICON_MD_WB_INCANDESCENT "\xEE\x90\xAE"
+#define ICON_MD_WB_IRIDESCENT "\xEE\x90\xB6"
+#define ICON_MD_WB_SUNNY "\xEE\x90\xB0"
+#define ICON_MD_WC "\xEE\x98\xBD"
+#define ICON_MD_WEB "\xEE\x81\x91"
+#define ICON_MD_WEB_ASSET "\xEE\x81\xA9"
+#define ICON_MD_WEEKEND "\xEE\x85\xAB"
+#define ICON_MD_WHATSHOT "\xEE\xA0\x8E"
+#define ICON_MD_WIDGETS "\xEE\x86\xBD"
+#define ICON_MD_WIFI "\xEE\x98\xBE"
+#define ICON_MD_WIFI_LOCK "\xEE\x87\xA1"
+#define ICON_MD_WIFI_TETHERING "\xEE\x87\xA2"
+#define ICON_MD_WORK "\xEE\xA3\xB9"
+#define ICON_MD_WRAP_TEXT "\xEE\x89\x9B"
+#define ICON_MD_YOUTUBE_SEARCHED_FOR "\xEE\xA3\xBA"
+#define ICON_MD_ZOOM_IN "\xEE\xA3\xBF"
+#define ICON_MD_ZOOM_OUT "\xEE\xA4\x80"
+#define ICON_MD_ZOOM_OUT_MAP "\xEE\x95\xAB"
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
index 0949fe7de96..aa8d8f1d657 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
@@ -830,10 +830,9 @@ int ImStrnicmp(const char* str1, const char* str2, int count)
char* ImStrdup(const char *str)
{
- char *buff = (char*)ImGui::MemAlloc(strlen(str) + 1);
- IM_ASSERT(buff);
- strcpy(buff, str);
- return buff;
+ size_t len = strlen(str) + 1;
+ void* buff = ImGui::MemAlloc(len);
+ return (char*)memcpy(buff, (const void*)str, len);
}
int ImStrlenW(const ImWchar* str)
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
index 8fd48b0b01b..7c9653772d9 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
@@ -1894,6 +1894,11 @@ struct ExampleAppConsole
free(History[i]);
}
+ // Portable helpers
+ static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; }
+ static int Strnicmp(const char* str1, const char* str2, int n) { int d = 0; while (n > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; n--; } return d; }
+ static char* Strdup(const char *str) { size_t len = strlen(str) + 1; void* buff = ImGui::MemAlloc(len); return (char*)memcpy(buff, (const void*)str, len); }
+
void ClearLog()
{
for (int i = 0; i < Items.Size; i++)
@@ -1910,7 +1915,7 @@ struct ExampleAppConsole
vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args);
buf[IM_ARRAYSIZE(buf)-1] = 0;
va_end(args);
- Items.push_back(strdup(buf));
+ Items.push_back(Strdup(buf));
ScrollToBottom = true;
}
@@ -1987,9 +1992,6 @@ struct ExampleAppConsole
ImGui::End();
}
- static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; }
- static int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; } return d; }
-
void ExecCommand(const char* command_line)
{
AddLog("# %s\n", command_line);
@@ -2003,7 +2005,7 @@ struct ExampleAppConsole
History.erase(History.begin() + i);
break;
}
- History.push_back(strdup(command_line));
+ History.push_back(Strdup(command_line));
// Process command
if (Stricmp(command_line, "CLEAR") == 0)
diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index 2b444eb809f..521853b6f2b 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -37,6 +37,7 @@ Supported platforms:
* Native Client (PPAPI 37+, ARM, x86, x64, PNaCl)
* OSX (10.9+)
* RaspberryPi
+ * SteamLink
* Windows (XP, Vista, 7, 8, 10)
* WinRT (WinPhone 8.0+)
@@ -99,7 +100,7 @@ deployment model of web with the performance of native code and GPU acceleration
https://github.com/nem0/LumixEngine LumixEngine is a MIT licensed 3D engine.
The main goal is performance and Unity-like usability.
-![LumixEngine screenshot](https://cloud.githubusercontent.com/assets/153526/10109455/450c51be-63c7-11e5-9c87-96d9d00efe02.png)
+![LumixEngine screenshot](https://cloud.githubusercontent.com/assets/153526/12904252/3fcf130e-cece-11e5-878b-c9fe24c1b11a.png)
https://github.com/podgorskiy/KeplerOrbits KeplerOrbits - Tool that calculates
positions of celestial bodies using their orbital elements. [Web Demo](http://podgorskiy.com/KeplerOrbits/KeplerOrbits.html)
diff --git a/3rdparty/bgfx/examples/10-font/font.cpp b/3rdparty/bgfx/examples/10-font/font.cpp
index 97111e1b175..a15cef4baae 100644
--- a/3rdparty/bgfx/examples/10-font/font.cpp
+++ b/3rdparty/bgfx/examples/10-font/font.cpp
@@ -14,6 +14,9 @@
#include "font/text_buffer_manager.h"
#include "entry/input.h"
+#include <iconfontheaders/icons_font_awesome.h>
+#include <iconfontheaders/icons_kenney.h>
+
#include <stdio.h>
#include <wchar.h>
@@ -105,10 +108,12 @@ int _main_(int _argc, char** _argv)
}
TrueTypeHandle fontAwesomeTtf = loadTtf(fontManager, "font/fontawesome-webfont.ttf");
+ TrueTypeHandle fontKenneyTtf = loadTtf(fontManager, "font/kenney-icon-font.ttf");
// This font doesn't have any preloaded glyph's but the truetype file
// is loaded so glyph will be generated as needed.
FontHandle fontAwesome72 = fontManager->createFontByPixelSize(fontAwesomeTtf, 0, 72);
+ FontHandle fontKenney64 = fontManager->createFontByPixelSize(fontKenneyTtf, 0, 64);
TrueTypeHandle visitorTtf = loadTtf(fontManager, "font/visitor1.ttf");
@@ -160,7 +165,24 @@ int _main_(int _argc, char** _argv)
textBufferManager->appendText(staticText, fonts[0], L"dog\n");
textBufferManager->setStyle(staticText, STYLE_NORMAL);
- textBufferManager->appendText(staticText, fontAwesome72, L"\xf011 \xf02e \xf061 \xf087 \xf0d9 \xf099 \xf05c \xf021 \xf113\n");
+ textBufferManager->appendText(staticText, fontAwesome72,
+ " " ICON_FA_POWER_OFF
+ " " ICON_FA_TWITTER_SQUARE
+ " " ICON_FA_CERTIFICATE
+ " " ICON_FA_FLOPPY_O
+ " " ICON_FA_GITHUB
+ " " ICON_FA_GITHUB_ALT
+ "\n"
+ );
+ textBufferManager->appendText(staticText, fontKenney64,
+ " " ICON_KI_COMPUTER
+ " " ICON_KI_JOYSTICK
+ " " ICON_KI_EXLAMATION
+ " " ICON_KI_STAR
+ " " ICON_KI_BUTTON_START
+ " " ICON_KI_DOWNLOAD
+ "\n"
+ );
// Create a transient buffer for real-time data.
TextBufferHandle transientText = textBufferManager->createTextBuffer(FONT_TYPE_ALPHA, BufferType::Transient);
@@ -242,10 +264,12 @@ int _main_(int _argc, char** _argv)
bgfx::frame();
}
+ fontManager->destroyTtf(fontKenneyTtf);
fontManager->destroyTtf(fontAwesomeTtf);
fontManager->destroyTtf(visitorTtf);
// Destroy the fonts.
+ fontManager->destroyFont(fontKenney64);
fontManager->destroyFont(fontAwesome72);
fontManager->destroyFont(visitor10);
for (uint32_t ii = 0; ii < numFonts; ++ii)
diff --git a/3rdparty/bgfx/examples/common/bounds.cpp b/3rdparty/bgfx/examples/common/bounds.cpp
index d2228e7eb63..3937b550567 100644
--- a/3rdparty/bgfx/examples/common/bounds.cpp
+++ b/3rdparty/bgfx/examples/common/bounds.cpp
@@ -277,6 +277,102 @@ void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num
_sphere.m_radius = bx::fsqrt(maxDistSq);
}
+void buildFrustumPlanes(Plane* _result, const float* _viewProj)
+{
+ const float xw = _viewProj[ 3];
+ const float yw = _viewProj[ 7];
+ const float zw = _viewProj[11];
+ const float ww = _viewProj[15];
+
+ const float xz = _viewProj[ 2];
+ const float yz = _viewProj[ 6];
+ const float zz = _viewProj[10];
+ const float wz = _viewProj[14];
+
+ Plane& near = _result[0];
+ Plane& far = _result[1];
+ Plane& left = _result[2];
+ Plane& right = _result[3];
+ Plane& top = _result[4];
+ Plane& bottom = _result[5];
+
+ near.m_normal[0] = xw - xz;
+ near.m_normal[1] = yw - yz;
+ near.m_normal[2] = zw - zz;
+ near.m_dist = ww - wz;
+
+ far.m_normal[0] = xw + xz;
+ far.m_normal[1] = yw + yz;
+ far.m_normal[2] = zw + zz;
+ far.m_dist = ww + wz;
+
+ const float xx = _viewProj[ 0];
+ const float yx = _viewProj[ 4];
+ const float zx = _viewProj[ 8];
+ const float wx = _viewProj[12];
+
+ left.m_normal[0] = xw - xx;
+ left.m_normal[1] = yw - yx;
+ left.m_normal[2] = zw - zx;
+ left.m_dist = ww - wx;
+
+ right.m_normal[0] = xw + xx;
+ right.m_normal[1] = yw + yx;
+ right.m_normal[2] = zw + zx;
+ right.m_dist = ww + wx;
+
+ const float xy = _viewProj[ 1];
+ const float yy = _viewProj[ 5];
+ const float zy = _viewProj[ 9];
+ const float wy = _viewProj[13];
+
+ top.m_normal[0] = xw + xy;
+ top.m_normal[1] = yw + yy;
+ top.m_normal[2] = zw + zy;
+ top.m_dist = ww + wy;
+
+ bottom.m_normal[0] = xw - xy;
+ bottom.m_normal[1] = yw - yy;
+ bottom.m_normal[2] = zw - zy;
+ bottom.m_dist = ww - wy;
+
+ Plane* plane = _result;
+ for (uint32_t ii = 0; ii < 6; ++ii)
+ {
+ float invLen = 1.0f / bx::vec3Norm(plane->m_normal, plane->m_normal);
+ plane->m_dist *= invLen;
+ ++plane;
+ }
+}
+
+void intersectPlanes(float _result[3], const Plane& _pa, const Plane& _pb, const Plane& _pc)
+{
+ float axb[3];
+ bx::vec3Cross(axb, _pa.m_normal, _pb.m_normal);
+
+ float bxc[3];
+ bx::vec3Cross(bxc, _pb.m_normal, _pc.m_normal);
+
+ float cxa[3];
+ bx::vec3Cross(cxa, _pc.m_normal, _pa.m_normal);
+
+ float tmp0[3];
+ bx::vec3Mul(tmp0, bxc, _pa.m_dist);
+
+ float tmp1[3];
+ bx::vec3Mul(tmp1, cxa, _pb.m_dist);
+
+ float tmp2[3];
+ bx::vec3Mul(tmp2, axb, _pc.m_dist);
+
+ float tmp[3];
+ bx::vec3Add(tmp, tmp0, tmp1);
+ bx::vec3Add(tmp0, tmp, tmp2);
+
+ float denom = bx::vec3Dot(_pa.m_normal, bxc);
+ bx::vec3Mul(_result, tmp0, -1.0f/denom);
+}
+
Ray makeRay(float _x, float _y, const float* _invVp)
{
Ray ray;
diff --git a/3rdparty/bgfx/examples/common/bounds.h b/3rdparty/bgfx/examples/common/bounds.h
index f59c2b2230f..24f23414f10 100644
--- a/3rdparty/bgfx/examples/common/bounds.h
+++ b/3rdparty/bgfx/examples/common/bounds.h
@@ -94,6 +94,12 @@ void calcMaxBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num
/// Calculate minimum bounding sphere.
void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step = 0.01f);
+/// Returns 6 (near, far, left, right, top, bottom) planes representing frustum planes.
+void buildFrustumPlanes(Plane* _planes, const float* _viewProj);
+
+/// Returns point from 3 intersecting planes.
+void intersectPlanes(float _result[3], const Plane& _pa, const Plane& _pb, const Plane& _pc);
+
/// Make screen space ray from x, y coordinate and inverse view-projection matrix.
Ray makeRay(float _x, float _y, const float* _invVp);
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 2bff902302c..989d0ae0667 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -218,6 +218,8 @@ namespace entry
return wmi.info.cocoa.window;
# elif BX_PLATFORM_WINDOWS
return wmi.info.win.window;
+# elif BX_PLATFORM_STEAMLINK
+ return wmi.info.vivante.window;
# endif // BX_PLATFORM_
}
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 2655e6ce0a1..4cdc5f30fe5 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -3572,3 +3572,10 @@ bool imguiMouseOverArea()
{
return s_imgui.m_insideArea;
}
+
+bgfx::ProgramHandle imguiGetImageProgram(uint8_t _mip)
+{
+ const float lodEnabled[4] = { float(_mip), 1.0f, 0.0f, 0.0f };
+ bgfx::setUniform(s_imgui.u_imageLodEnabled, lodEnabled);
+ return s_imgui.m_imageProgram;
+}
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index 75269500c85..0ab18cb9f8a 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -208,12 +208,13 @@ bool imguiMouseOverArea();
namespace ImGui
{
-#define IMGUI_FLAGS_NONE UINT16_C(0x0000)
-#define IMGUI_FLAGS_ALPHA_BLEND UINT16_C(0x0001)
+#define IMGUI_FLAGS_NONE UINT8_C(0x00)
+#define IMGUI_FLAGS_ALPHA_BLEND UINT8_C(0x01)
// Helper function for passing bgfx::TextureHandle to ImGui::Image.
inline void Image(bgfx::TextureHandle _handle
- , uint16_t _flags
+ , uint8_t _flags
+ , uint8_t _mip
, const ImVec2& _size
, const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
, const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
@@ -221,9 +222,10 @@ namespace ImGui
, const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
)
{
- union { struct { uint16_t flags; bgfx::TextureHandle handle; } s; ImTextureID ptr; } texture;
- texture.s.flags = _flags;
+ union { struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; ImTextureID ptr; } texture;
texture.s.handle = _handle;
+ texture.s.flags = _flags;
+ texture.s.mip = _mip;
Image(texture.ptr, _size, _uv0, _uv1, _tintCol, _borderCol);
}
@@ -236,12 +238,13 @@ namespace ImGui
, const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
)
{
- Image(_handle, IMGUI_FLAGS_ALPHA_BLEND, _size, _uv0, _uv1, _tintCol, _borderCol);
+ Image(_handle, IMGUI_FLAGS_ALPHA_BLEND, 0, _size, _uv0, _uv1, _tintCol, _borderCol);
}
// Helper function for passing bgfx::TextureHandle to ImGui::ImageButton.
inline bool ImageButton(bgfx::TextureHandle _handle
- , uint16_t _flags
+ , uint8_t _flags
+ , uint8_t _mip
, const ImVec2& _size
, const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
, const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
@@ -250,9 +253,10 @@ namespace ImGui
, const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
)
{
- union { struct { uint16_t flags; bgfx::TextureHandle handle; } s; ImTextureID ptr; } texture;
- texture.s.flags = _flags;
+ union { struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; ImTextureID ptr; } texture;
texture.s.handle = _handle;
+ texture.s.flags = _flags;
+ texture.s.mip = _mip;
return ImageButton(texture.ptr, _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
}
@@ -266,7 +270,7 @@ namespace ImGui
, const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
)
{
- return ImageButton(_handle, IMGUI_FLAGS_ALPHA_BLEND, _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
+ return ImageButton(_handle, IMGUI_FLAGS_ALPHA_BLEND, 0, _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
}
} // namespace ImGui
diff --git a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
index 4545bb998a0..f6f0a4e2bdd 100644
--- a/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
@@ -305,15 +305,21 @@ struct OcornutImguiContext
;
bgfx::TextureHandle th = m_texture;
+ bgfx::ProgramHandle program = m_program;
if (NULL != cmd->TextureId)
{
- union { ImTextureID ptr; struct { uint16_t flags; bgfx::TextureHandle handle; } s; } texture = { cmd->TextureId };
+ union { ImTextureID ptr; struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; } texture = { cmd->TextureId };
state |= 0 != (IMGUI_FLAGS_ALPHA_BLEND & texture.s.flags)
? BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
: BGFX_STATE_NONE
;
th = texture.s.handle;
+ if (0 != texture.s.mip)
+ {
+ extern bgfx::ProgramHandle imguiGetImageProgram(uint8_t _mip);
+ program = imguiGetImageProgram(texture.s.mip);
+ }
}
else
{
@@ -331,7 +337,7 @@ struct OcornutImguiContext
bgfx::setTexture(0, s_tex, th);
bgfx::setVertexBuffer(&tvb, 0, numVertices);
bgfx::setIndexBuffer(&tib, offset, cmd->ElemCount);
- bgfx::submit(cmd->ViewId, m_program);
+ bgfx::submit(cmd->ViewId, program);
}
offset += cmd->ElemCount;
diff --git a/3rdparty/bgfx/examples/runtime/font/kenney-icon-font.ttf b/3rdparty/bgfx/examples/runtime/font/kenney-icon-font.ttf
new file mode 100644
index 00000000000..9a3e406003c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/font/kenney-icon-font.ttf
Binary files differ
diff --git a/3rdparty/bgfx/include/bgfx/bgfx.h b/3rdparty/bgfx/include/bgfx/bgfx.h
index 16c5e46a6e7..e30d7417158 100644
--- a/3rdparty/bgfx/include/bgfx/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/bgfx.h
@@ -532,6 +532,14 @@ namespace bgfx
bool cubeMap; //!< Texture is cubemap.
};
+ ///
+ struct Attachment
+ {
+ TextureHandle handle; //!< Texture handle.
+ uint16_t mip; //!< Mip level.
+ uint16_t layer; //!< Cubemap side or depth layer/slice.
+ };
+
/// Transform data.
///
/// @attention C99 equivalent is `bgfx_transform_t`.
@@ -1362,8 +1370,8 @@ namespace bgfx
/// Update Cube texture.
///
/// @param[in] _handle Texture handle.
- /// @param[in] _side Cubemap side, where 0 is +X, 1 is -X, 2 is +Y, 3 is
- /// -Y, 4 is +Z, and 5 is -Z.
+ /// @param[in] _side Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`,
+ /// where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.
///
/// +----------+
/// |-z 2|
@@ -1470,6 +1478,17 @@ namespace bgfx
///
FrameBufferHandle createFrameBuffer(uint8_t _num, const TextureHandle* _handles, bool _destroyTextures = false);
+ /// Create frame buffer.
+ ///
+ /// @param[in] _num Number of texture attachments.
+ /// @param[in] _attachment Attachment info. See: `Attachment`.
+ /// @param[in] _destroyTextures If true, textures will be destroyed when
+ /// frame buffer is destroyed.
+ ///
+ /// @attention C99 equivalent is `bgfx_create_frame_buffer_from_handles`.
+ ///
+ FrameBufferHandle createFrameBuffer(uint8_t _num, const Attachment* _attachment, bool _destroyTextures = false);
+
/// Create frame buffer for multiple window rendering.
///
/// @param[in] _nwh OS' target native window handle.
diff --git a/3rdparty/bgfx/include/bgfx/bgfxdefines.h b/3rdparty/bgfx/include/bgfx/bgfxdefines.h
index 3c1b3671a6b..b80622743a6 100644
--- a/3rdparty/bgfx/include/bgfx/bgfxdefines.h
+++ b/3rdparty/bgfx/include/bgfx/bgfxdefines.h
@@ -6,7 +6,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
-#define BGFX_API_VERSION UINT32_C(7)
+#define BGFX_API_VERSION UINT32_C(9)
///
#define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write.
@@ -422,4 +422,12 @@
#define BGFX_HMD_DEVICE_RESOLUTION UINT8_C(0x01) //!< Has HMD native resolution.
#define BGFX_HMD_RENDERING UINT8_C(0x02) //!< Rendering to HMD.
+///
+#define BGFX_CUBE_MAP_POSITIVE_X UINT8_C(0x00) //!< Cubemap +x.
+#define BGFX_CUBE_MAP_NEGATIVE_X UINT8_C(0x01) //!< Cubemap -x.
+#define BGFX_CUBE_MAP_POSITIVE_Y UINT8_C(0x02) //!< Cubemap +y.
+#define BGFX_CUBE_MAP_NEGATIVE_Y UINT8_C(0x03) //!< Cubemap -y.
+#define BGFX_CUBE_MAP_POSITIVE_Z UINT8_C(0x04) //!< Cubemap +z.
+#define BGFX_CUBE_MAP_NEGATIVE_Z UINT8_C(0x05) //!< Cubemap -z.
+
#endif // BGFX_DEFINES_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/include/bgfx/bgfxplatform.h b/3rdparty/bgfx/include/bgfx/bgfxplatform.h
index 1b6e336b675..52b330112d5 100644
--- a/3rdparty/bgfx/include/bgfx/bgfxplatform.h
+++ b/3rdparty/bgfx/include/bgfx/bgfxplatform.h
@@ -279,6 +279,9 @@ namespace bgfx
# elif BX_PLATFORM_WINDOWS
pd.ndt = NULL;
pd.nwh = wmi.info.win.window;
+# elif BX_PLATFORM_STEAMLINK
+ pd.ndt = wmi.info.vivante.display;
+ pd.nwh = wmi.info.vivante.window;
# endif // BX_PLATFORM_
pd.context = NULL;
pd.backBuffer = NULL;
diff --git a/3rdparty/bgfx/include/bgfx/c99/bgfx.h b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
index fa585759ce9..cba442ef0be 100644
--- a/3rdparty/bgfx/include/bgfx/c99/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
@@ -350,6 +350,15 @@ typedef struct bgfx_texture_info
} bgfx_texture_info_t;
/**/
+typedef struct bgfx_attachment
+{
+ bgfx_texture_handle_t handle;
+ uint16_t mip;
+ uint16_t layer;
+
+} bgfx_attachment_t;
+
+/**/
typedef struct bgfx_caps_gpu
{
uint16_t vendorId;
@@ -639,7 +648,7 @@ BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer(uint16_t _width,
BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_scaled(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, uint32_t _textureFlags);
/**/
-BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_handles(uint8_t _num, const bgfx_texture_handle_t* _handles, bool _destroyTextures);
+BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(uint8_t _num, const bgfx_attachment_t* _attachment, bool _destroyTextures);
/**/
BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_nwh(void* _nwh, uint16_t _width, uint16_t _height, bgfx_texture_format_t _depthFormat);
diff --git a/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h b/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
index 1fb82c974f8..61ff57d2b29 100644
--- a/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfxplatform.h
@@ -137,7 +137,7 @@ typedef struct bgfx_interface_vtbl
void (*destroy_texture)(bgfx_texture_handle_t _handle);
bgfx_frame_buffer_handle_t (*create_frame_buffer)(uint16_t _width, uint16_t _height, bgfx_texture_format_t _format, uint32_t _textureFlags);
bgfx_frame_buffer_handle_t (*create_frame_buffer_scaled)(bgfx_backbuffer_ratio_t _ratio, bgfx_texture_format_t _format, uint32_t _textureFlags);
- bgfx_frame_buffer_handle_t (*create_frame_buffer_from_handles)(uint8_t _num, const bgfx_texture_handle_t* _handles, bool _destroyTextures);
+ bgfx_frame_buffer_handle_t (*create_frame_buffer_from_attachment)(uint8_t _num, const bgfx_attachment_t* _attachment, bool _destroyTextures);
bgfx_frame_buffer_handle_t (*create_frame_buffer_from_nwh)(void* _nwh, uint16_t _width, uint16_t _height, bgfx_texture_format_t _depthFormat);
void (*destroy_frame_buffer)(bgfx_frame_buffer_handle_t _handle);
bgfx_uniform_handle_t (*create_uniform)(const char* _name, bgfx_uniform_type_t _type, uint16_t _num);
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index cc646b6e261..97ec723ddba 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -88,12 +88,18 @@ function bgfxProject(_name, _kind, _defines)
"-weak_framework Metal",
}
- configuration { "not nacl" }
+ configuration { "not nacl", "not linux-steamlink" }
includedirs {
--nacl has GLES2 headers modified...
+ --steamlink has EGL headers modified...
path.join(BGFX_DIR, "3rdparty/khronos"),
}
+ configuration { "linux-steamlink" }
+ defines {
+ "EGL_API_FB",
+ }
+
configuration {}
includedirs {
diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua
index 1832f9836ac..fcaca364f64 100644
--- a/3rdparty/bgfx/scripts/example-common.lua
+++ b/3rdparty/bgfx/scripts/example-common.lua
@@ -60,6 +60,11 @@ project ("example-common")
"ENTRY_CONFIG_USE_GLFW=1",
}
end
+
+ configuration { "linux-steamlink" }
+ defines {
+ "EGL_API_FB",
+ }
configuration { "osx or ios* or tvos*" }
files {
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index 77fe35d4cb6..52554366dfb 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -304,13 +304,21 @@ function exampleProject(_name)
kind "ConsoleApp"
targetextension ".bc"
- configuration { "linux-* or freebsd" }
+ configuration { "linux-* or freebsd", "not linux-steamlink" }
links {
"X11",
"GL",
"pthread",
}
+ configuration { "linux-steamlink" }
+ links {
+ "EGL",
+ "GLESv2",
+ "SDL2",
+ "pthread",
+ }
+
configuration { "rpi" }
links {
"X11",
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index aae0311ebd5..e16d4f71c3f 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -2259,13 +2259,10 @@ again:
uint8_t num;
_cmdbuf.read(num);
- TextureHandle textureHandles[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
- for (uint32_t ii = 0; ii < num; ++ii)
- {
- _cmdbuf.read(textureHandles[ii]);
- }
+ Attachment attachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ _cmdbuf.read(attachment, sizeof(Attachment) * num);
- m_renderCtx->createFrameBuffer(handle, num, textureHandles);
+ m_renderCtx->createFrameBuffer(handle, num, attachment);
}
}
break;
@@ -3112,14 +3109,27 @@ again:
FrameBufferHandle createFrameBuffer(uint8_t _num, const TextureHandle* _handles, bool _destroyTextures)
{
+ Attachment attachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ for (uint8_t ii = 0; ii < _num; ++ii)
+ {
+ Attachment& at = attachment[ii];
+ at.handle = _handles[ii];
+ at.mip = 0;
+ at.layer = 0;
+ }
+ return createFrameBuffer(_num, attachment, _destroyTextures);
+ }
+
+ FrameBufferHandle createFrameBuffer(uint8_t _num, const Attachment* _attachment, bool _destroyTextures)
+ {
BGFX_CHECK_MAIN_THREAD();
BX_CHECK(_num != 0, "Number of frame buffer attachments can't be 0.");
BX_CHECK(_num <= BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS, "Number of frame buffer attachments is larger than allowed %d (max: %d)."
, _num
, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
);
- BX_CHECK(NULL != _handles, "_handles can't be NULL");
- return s_ctx->createFrameBuffer(_num, _handles, _destroyTextures);
+ BX_CHECK(NULL != _attachment, "_attachment can't be NULL");
+ return s_ctx->createFrameBuffer(_num, _attachment, _destroyTextures);
}
FrameBufferHandle createFrameBuffer(void* _nwh, uint16_t _width, uint16_t _height, TextureFormat::Enum _depthFormat)
@@ -4114,10 +4124,10 @@ BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_scaled(bgfx_backb
return handle.c;
}
-BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_handles(uint8_t _num, const bgfx_texture_handle_t* _handles, bool _destroyTextures)
+BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(uint8_t _num, const bgfx_attachment_t* _attachment, bool _destroyTextures)
{
union { bgfx_frame_buffer_handle_t c; bgfx::FrameBufferHandle cpp; } handle;
- handle.cpp = bgfx::createFrameBuffer(_num, (const bgfx::TextureHandle*)_handles, _destroyTextures);
+ handle.cpp = bgfx::createFrameBuffer(_num, (const bgfx::Attachment*)_attachment, _destroyTextures);
return handle.c;
}
@@ -4560,7 +4570,7 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
BGFX_IMPORT_FUNC(destroy_texture) \
BGFX_IMPORT_FUNC(create_frame_buffer) \
BGFX_IMPORT_FUNC(create_frame_buffer_scaled) \
- BGFX_IMPORT_FUNC(create_frame_buffer_from_handles) \
+ BGFX_IMPORT_FUNC(create_frame_buffer_from_attachment) \
BGFX_IMPORT_FUNC(create_frame_buffer_from_nwh) \
BGFX_IMPORT_FUNC(destroy_frame_buffer) \
BGFX_IMPORT_FUNC(create_uniform) \
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index 594310d284f..1434b5ca41f 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -573,8 +573,14 @@ namespace bgfx
const char* getPredefinedUniformName(PredefinedUniform::Enum _enum);
PredefinedUniform::Enum nameToPredefinedUniformEnum(const char* _name);
- struct CommandBuffer
+ class CommandBuffer
{
+ BX_CLASS(CommandBuffer
+ , NO_COPY
+ , NO_ASSIGNMENT
+ );
+
+ public:
CommandBuffer()
: m_pos(0)
, m_size(BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE)
@@ -690,10 +696,6 @@ namespace bgfx
uint32_t m_pos;
uint32_t m_size;
uint8_t m_buffer[BGFX_CONFIG_MAX_COMMAND_BUFFER_SIZE];
-
- private:
- CommandBuffer(const CommandBuffer&);
- void operator=(const CommandBuffer&);
};
#define SORT_KEY_NUM_BITS_TRANS 2
@@ -2050,7 +2052,7 @@ namespace bgfx
virtual void overrideInternal(TextureHandle _handle, uintptr_t _ptr) = 0;
virtual uintptr_t getInternal(TextureHandle _handle) = 0;
virtual void destroyTexture(TextureHandle _handle) = 0;
- virtual void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) = 0;
+ virtual void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) = 0;
virtual void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) = 0;
virtual void destroyFrameBuffer(FrameBufferHandle _handle) = 0;
virtual void createUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name) = 0;
@@ -3182,14 +3184,14 @@ namespace bgfx
cmdbuf.write(_mem);
}
- bool checkFrameBuffer(uint8_t _num, const TextureHandle* _handles) const
+ bool checkFrameBuffer(uint8_t _num, const Attachment* _attachment) const
{
uint8_t color = 0;
uint8_t depth = 0;
for (uint32_t ii = 0; ii < _num; ++ii)
{
- TextureHandle texHandle = _handles[ii];
+ TextureHandle texHandle = _attachment[ii].handle;
if (isDepth(TextureFormat::Enum(m_textureRef[texHandle.idx].m_format)))
{
++depth;
@@ -3205,9 +3207,9 @@ namespace bgfx
;
}
- BGFX_API_FUNC(FrameBufferHandle createFrameBuffer(uint8_t _num, const TextureHandle* _handles, bool _destroyTextures) )
+ BGFX_API_FUNC(FrameBufferHandle createFrameBuffer(uint8_t _num, const Attachment* _attachment, bool _destroyTextures) )
{
- BX_CHECK(checkFrameBuffer(_num, _handles)
+ BX_CHECK(checkFrameBuffer(_num, _attachment)
, "Too many frame buffer attachments (num attachments: %d, max color attachments %d)!"
, _num
, g_caps.maxFBAttachments
@@ -3226,26 +3228,26 @@ namespace bgfx
FrameBufferRef& ref = m_frameBufferRef[handle.idx];
ref.m_window = false;
memset(ref.un.m_th, 0xff, sizeof(ref.un.m_th) );
- BackbufferRatio::Enum bbRatio = BackbufferRatio::Enum(m_textureRef[_handles[0].idx].m_bbRatio);
+ BackbufferRatio::Enum bbRatio = BackbufferRatio::Enum(m_textureRef[_attachment[0].handle.idx].m_bbRatio);
for (uint32_t ii = 0; ii < _num; ++ii)
{
- TextureHandle texHandle = _handles[ii];
+ TextureHandle texHandle = _attachment[ii].handle;
BGFX_CHECK_HANDLE("createFrameBuffer texture handle", m_textureHandle, texHandle);
BX_CHECK(bbRatio == m_textureRef[texHandle.idx].m_bbRatio, "Mismatch in texture back-buffer ratio.");
BX_UNUSED(bbRatio);
- cmdbuf.write(texHandle);
-
ref.un.m_th[ii] = texHandle;
textureIncRef(texHandle);
}
+
+ cmdbuf.write(_attachment, sizeof(Attachment) * _num);
}
if (_destroyTextures)
{
for (uint32_t ii = 0; ii < _num; ++ii)
{
- textureTakeOwnership(_handles[ii]);
+ textureTakeOwnership(_attachment[ii].handle);
}
}
diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp
index 6f8f79775fa..34dcae9e54c 100644
--- a/3rdparty/bgfx/src/image.cpp
+++ b/3rdparty/bgfx/src/image.cpp
@@ -4,8 +4,6 @@
*/
#include "bgfx_p.h"
-#include <math.h> // powf, sqrtf
-
#include "image.h"
namespace bgfx
@@ -345,30 +343,30 @@ namespace bgfx
const uint8_t* rgba = src;
for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba += 8, dst += 4)
{
- float rr = powf(rgba[ 0], 2.2f);
- float gg = powf(rgba[ 1], 2.2f);
- float bb = powf(rgba[ 2], 2.2f);
- float aa = rgba[ 3];
- rr += powf(rgba[ 4], 2.2f);
- gg += powf(rgba[ 5], 2.2f);
- bb += powf(rgba[ 6], 2.2f);
- aa += rgba[ 7];
- rr += powf(rgba[_pitch+0], 2.2f);
- gg += powf(rgba[_pitch+1], 2.2f);
- bb += powf(rgba[_pitch+2], 2.2f);
- aa += rgba[_pitch+3];
- rr += powf(rgba[_pitch+4], 2.2f);
- gg += powf(rgba[_pitch+5], 2.2f);
- bb += powf(rgba[_pitch+6], 2.2f);
- aa += rgba[_pitch+7];
+ float rr = bx::fpow(rgba[ 0], 2.2f);
+ float gg = bx::fpow(rgba[ 1], 2.2f);
+ float bb = bx::fpow(rgba[ 2], 2.2f);
+ float aa = rgba[ 3];
+ rr += bx::fpow(rgba[ 4], 2.2f);
+ gg += bx::fpow(rgba[ 5], 2.2f);
+ bb += bx::fpow(rgba[ 6], 2.2f);
+ aa += rgba[ 7];
+ rr += bx::fpow(rgba[_pitch+0], 2.2f);
+ gg += bx::fpow(rgba[_pitch+1], 2.2f);
+ bb += bx::fpow(rgba[_pitch+2], 2.2f);
+ aa += rgba[_pitch+3];
+ rr += bx::fpow(rgba[_pitch+4], 2.2f);
+ gg += bx::fpow(rgba[_pitch+5], 2.2f);
+ bb += bx::fpow(rgba[_pitch+6], 2.2f);
+ aa += rgba[_pitch+7];
rr *= 0.25f;
gg *= 0.25f;
bb *= 0.25f;
aa *= 0.25f;
- rr = powf(rr, 1.0f/2.2f);
- gg = powf(gg, 1.0f/2.2f);
- bb = powf(bb, 1.0f/2.2f);
+ rr = bx::fpow(rr, 1.0f/2.2f);
+ gg = bx::fpow(gg, 1.0f/2.2f);
+ bb = bx::fpow(bb, 1.0f/2.2f);
dst[0] = (uint8_t)rr;
dst[1] = (uint8_t)gg;
dst[2] = (uint8_t)bb;
@@ -3176,7 +3174,7 @@ namespace bgfx
{
float nx = temp[ii*4+2]*2.0f/255.0f - 1.0f;
float ny = temp[ii*4+1]*2.0f/255.0f - 1.0f;
- float nz = sqrtf(1.0f - nx*nx - ny*ny);
+ float nz = bx::fsqrt(1.0f - nx*nx - ny*ny);
temp[ii*4+0] = uint8_t( (nz + 1.0f)*255.0f/2.0f);
temp[ii*4+3] = 0;
}
@@ -3323,10 +3321,10 @@ namespace bgfx
const uint8_t* rgba = src;
for (uint32_t xx = 0; xx < dstwidth; ++xx, rgba += 4, dst += 4)
{
- dst[0] = powf(rgba[ 0], 2.2f);
- dst[1] = powf(rgba[ 1], 2.2f);
- dst[2] = powf(rgba[ 2], 2.2f);
- dst[3] = rgba[ 3];
+ dst[0] = bx::fpow(rgba[0], 2.2f);
+ dst[1] = bx::fpow(rgba[1], 2.2f);
+ dst[2] = bx::fpow(rgba[2], 2.2f);
+ dst[3] = rgba[3];
}
}
}
@@ -3395,7 +3393,7 @@ namespace bgfx
{
float nx = temp[ii*4+2]*2.0f/255.0f - 1.0f;
float ny = temp[ii*4+1]*2.0f/255.0f - 1.0f;
- float nz = sqrtf(1.0f - nx*nx - ny*ny);
+ float nz = bx::fsqrt(1.0f - nx*nx - ny*ny);
const uint32_t offset = (yy*4 + ii/4)*_width*16 + (xx*4 + ii%4)*16;
float* block = (float*)&dst[offset];
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index 5bacc5561d4..4446d6b0324 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -1778,9 +1778,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_textures[_handle.idx].destroy();
}
- void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) BX_OVERRIDE
{
- m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ m_frameBuffers[_handle.idx].create(_num, _attachment);
}
void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
@@ -4252,7 +4252,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
return handle;
}
- void FrameBufferD3D11::create(uint8_t _num, const TextureHandle* _handles)
+ void FrameBufferD3D11::create(uint8_t _num, const Attachment* _attachment)
{
for (uint32_t ii = 0; ii < BX_COUNTOF(m_rtv); ++ii)
{
@@ -4262,7 +4262,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_swapChain = NULL;
m_numTh = _num;
- memcpy(m_th, _handles, _num*sizeof(TextureHandle) );
+ memcpy(m_attachment, _attachment, _num*sizeof(Attachment) );
postReset();
}
@@ -4355,7 +4355,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_num = 0;
for (uint32_t ii = 0; ii < m_numTh; ++ii)
{
- TextureHandle handle = m_th[ii];
+ TextureHandle handle = m_attachment[ii].handle;
if (isValid(handle) )
{
const TextureD3D11& texture = s_renderD3D11->m_textures[handle.idx];
@@ -4404,7 +4404,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
: D3D11_DSV_DIMENSION_TEXTURE2D
;
dsvDesc.Flags = 0;
- dsvDesc.Texture2D.MipSlice = 0;
+ dsvDesc.Texture2D.MipSlice = m_attachment[ii].mip;
DX_CHECK(s_renderD3D11->m_device->CreateDepthStencilView(texture.m_ptr, &dsvDesc, &m_dsv) );
}
break;
@@ -4417,14 +4417,14 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY;
dsvDesc.Texture2DMSArray.ArraySize = 1;
- dsvDesc.Texture2DMSArray.FirstArraySlice = 0;
+ dsvDesc.Texture2DMSArray.FirstArraySlice = m_attachment[ii].layer;
}
else
{
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DARRAY;
dsvDesc.Texture2DArray.ArraySize = 1;
- dsvDesc.Texture2DArray.FirstArraySlice = 0;
- dsvDesc.Texture2DArray.MipSlice = 0;
+ dsvDesc.Texture2DArray.FirstArraySlice = m_attachment[ii].layer;
+ dsvDesc.Texture2DArray.MipSlice = m_attachment[ii].mip;
}
dsvDesc.Flags = 0;
DX_CHECK(s_renderD3D11->m_device->CreateDepthStencilView(texture.m_ptr, &dsvDesc, &m_dsv) );
@@ -4438,7 +4438,20 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
default:
case TextureD3D11::Texture2D:
- DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(texture.m_ptr, NULL, &m_rtv[m_num]) );
+ {
+ D3D11_RENDER_TARGET_VIEW_DESC desc;
+ desc.Format = s_textureFormat[texture.m_textureFormat].m_fmt;
+ if (1 < msaa.Count)
+ {
+ desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS;
+ }
+ else
+ {
+ desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
+ desc.Texture2D.MipSlice = m_attachment[ii].mip;
+ }
+ DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(texture.m_ptr, &desc, &m_rtv[m_num]) );
+ }
break;
case TextureD3D11::TextureCube:
@@ -4449,14 +4462,14 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY;
desc.Texture2DMSArray.ArraySize = 1;
- desc.Texture2DMSArray.FirstArraySlice = 0;
+ desc.Texture2DMSArray.FirstArraySlice = m_attachment[ii].layer;
}
else
{
desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
desc.Texture2DArray.ArraySize = 1;
- desc.Texture2DArray.FirstArraySlice = 0;
- desc.Texture2DArray.MipSlice = 0;
+ desc.Texture2DArray.FirstArraySlice = m_attachment[ii].layer;
+ desc.Texture2DArray.MipSlice = m_attachment[ii].mip;
}
DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(texture.m_ptr, &desc, &m_rtv[m_num]) );
}
@@ -4467,9 +4480,9 @@ BX_PRAGMA_DIAGNOSTIC_POP();
D3D11_RENDER_TARGET_VIEW_DESC desc;
desc.Format = s_textureFormat[texture.m_textureFormat].m_fmt;
desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
- desc.Texture3D.MipSlice = 0;
+ desc.Texture3D.MipSlice = m_attachment[ii].mip;
desc.Texture3D.WSize = 1;
- desc.Texture3D.FirstWSlice = 0;
+ desc.Texture3D.FirstWSlice = m_attachment[ii].layer;
DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(texture.m_ptr, &desc, &m_rtv[m_num]) );
}
break;
diff --git a/3rdparty/bgfx/src/renderer_d3d11.h b/3rdparty/bgfx/src/renderer_d3d11.h
index 151d3ce5cc7..833eda40e1a 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.h
+++ b/3rdparty/bgfx/src/renderer_d3d11.h
@@ -261,7 +261,7 @@ namespace bgfx { namespace d3d11
{
}
- void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint8_t _num, const Attachment* _attachment);
void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
uint16_t destroy();
void preReset(bool _force = false);
@@ -278,7 +278,7 @@ namespace bgfx { namespace d3d11
uint16_t m_denseIdx;
uint8_t m_num;
uint8_t m_numTh;
- TextureHandle m_th[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ Attachment m_attachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
};
struct TimerQueryD3D11
diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp
index 76eb52e0e21..409d33bce10 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d12.cpp
@@ -1388,9 +1388,9 @@ namespace bgfx { namespace d3d12
m_textures[_handle.idx].destroy();
}
- void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) BX_OVERRIDE
{
- m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ m_frameBuffers[_handle.idx].create(_num, _attachment);
}
void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
@@ -4184,10 +4184,10 @@ data.NumQualityLevels = 0;
return _state;
}
- void FrameBufferD3D12::create(uint8_t _num, const TextureHandle* _handles)
+ void FrameBufferD3D12::create(uint8_t _num, const Attachment* _attachment)
{
m_numTh = _num;
- memcpy(m_th, _handles, _num*sizeof(TextureHandle) );
+ memcpy(m_attachment, _attachment, _num*sizeof(Attachment) );
postReset();
}
@@ -4217,7 +4217,7 @@ data.NumQualityLevels = 0;
m_num = 0;
for (uint32_t ii = 0; ii < m_numTh; ++ii)
{
- TextureHandle handle = m_th[ii];
+ TextureHandle handle = m_attachment[ii].handle;
if (isValid(handle) )
{
const TextureD3D12& texture = s_renderD3D12->m_textures[handle.idx];
diff --git a/3rdparty/bgfx/src/renderer_d3d12.h b/3rdparty/bgfx/src/renderer_d3d12.h
index d046b275142..39f165a03da 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.h
+++ b/3rdparty/bgfx/src/renderer_d3d12.h
@@ -295,7 +295,7 @@ namespace bgfx { namespace d3d12
m_depth.idx = bgfx::invalidHandle;
}
- void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint8_t _num, const Attachment* _attachment);
void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
uint16_t destroy();
void preReset();
@@ -311,7 +311,7 @@ namespace bgfx { namespace d3d12
uint16_t m_denseIdx;
uint8_t m_num;
uint8_t m_numTh;
- TextureHandle m_th[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ Attachment m_attachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
};
struct CommandQueueD3D12
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index 4fb4d435b4a..919a952260b 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -1018,9 +1018,9 @@ namespace bgfx { namespace d3d9
m_textures[_handle.idx].destroy();
}
- void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) BX_OVERRIDE
{
- m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ m_frameBuffers[_handle.idx].create(_num, _attachment);
}
void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
@@ -3062,7 +3062,7 @@ namespace bgfx { namespace d3d9
}
}
- void FrameBufferD3D9::create(uint8_t _num, const TextureHandle* _handles)
+ void FrameBufferD3D9::create(uint8_t _num, const Attachment* _attachment)
{
for (uint32_t ii = 0; ii < BX_COUNTOF(m_color); ++ii)
{
@@ -3074,7 +3074,7 @@ namespace bgfx { namespace d3d9
m_needResolve = false;
for (uint32_t ii = 0; ii < _num; ++ii)
{
- TextureHandle handle = _handles[ii];
+ TextureHandle handle = _attachment[ii].handle;
if (isValid(handle) )
{
const TextureD3D9& texture = s_renderD3D9->m_textures[handle.idx];
@@ -3102,7 +3102,7 @@ namespace bgfx { namespace d3d9
}
else
{
- m_color[m_num] = texture.getSurface();
+ m_color[m_num] = texture.getSurface(uint8_t(_attachment[ii].layer) );
}
m_num++;
}
diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h
index aecfba57322..0b0e030dc5c 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.h
+++ b/3rdparty/bgfx/src/renderer_d3d9.h
@@ -389,7 +389,7 @@ namespace bgfx { namespace d3d9
m_depthHandle.idx = invalidHandle;
}
- void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint8_t _num, const Attachment* _attachment);
void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
uint16_t destroy();
HRESULT present();
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index ff6184ccc98..0feccaf9680 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -2243,9 +2243,9 @@ namespace bgfx { namespace gl
m_textures[_handle.idx].destroy();
}
- void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) BX_OVERRIDE
{
- m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ m_frameBuffers[_handle.idx].create(_num, _attachment);
}
void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
@@ -5017,12 +5017,12 @@ namespace bgfx { namespace gl
BX_UNUSED(complete);
}
- void FrameBufferGL::create(uint8_t _num, const TextureHandle* _handles)
+ void FrameBufferGL::create(uint8_t _num, const Attachment* _attachment)
{
GL_CHECK(glGenFramebuffers(1, &m_fbo[0]) );
m_numTh = _num;
- memcpy(m_th, _handles, _num*sizeof(TextureHandle) );
+ memcpy(m_attachment, _attachment, _num*sizeof(Attachment) );
postReset();
}
@@ -5040,15 +5040,15 @@ namespace bgfx { namespace gl
uint32_t colorIdx = 0;
for (uint32_t ii = 0; ii < m_numTh; ++ii)
{
- TextureHandle handle = m_th[ii];
+ TextureHandle handle = m_attachment[ii].handle;
if (isValid(handle) )
{
const TextureGL& texture = s_renderGL->m_textures[handle.idx];
if (0 == colorIdx)
{
- m_width = texture.m_width;
- m_height = texture.m_height;
+ m_width = bx::uint32_max(texture.m_width >> m_attachment[ii].mip, 1);
+ m_height = bx::uint32_max(texture.m_height >> m_attachment[ii].mip, 1);
}
GLenum attachment = GL_COLOR_ATTACHMENT0 + colorIdx;
@@ -5086,7 +5086,7 @@ namespace bgfx { namespace gl
else
{
GLenum target = GL_TEXTURE_CUBE_MAP == texture.m_target
- ? GL_TEXTURE_CUBE_MAP_POSITIVE_X
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + m_attachment[ii].layer
: texture.m_target
;
@@ -5094,7 +5094,7 @@ namespace bgfx { namespace gl
, attachment
, target
, texture.m_id
- , 0
+ , m_attachment[ii].mip
) );
}
@@ -5134,7 +5134,7 @@ namespace bgfx { namespace gl
colorIdx = 0;
for (uint32_t ii = 0; ii < m_numTh; ++ii)
{
- TextureHandle handle = m_th[ii];
+ TextureHandle handle = m_attachment[ii].handle;
if (isValid(handle) )
{
const TextureGL& texture = s_renderGL->m_textures[handle.idx];
@@ -5145,11 +5145,17 @@ namespace bgfx { namespace gl
if (!isDepth( (TextureFormat::Enum)texture.m_textureFormat) )
{
++colorIdx;
+
+ GLenum target = GL_TEXTURE_CUBE_MAP == texture.m_target
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + m_attachment[ii].layer
+ : texture.m_target
+ ;
+
GL_CHECK(glFramebufferTexture2D(GL_FRAMEBUFFER
, attachment
- , texture.m_target
+ , target
, texture.m_id
- , 0
+ , m_attachment[ii].mip
) );
}
}
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index 06b1525fd64..91c49c22f02 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -13,6 +13,7 @@
|| BX_PLATFORM_BSD \
|| BX_PLATFORM_QNX \
|| BX_PLATFORM_RPI \
+ || BX_PLATFORM_STEAMLINK \
|| BX_PLATFORM_WINDOWS \
) )
@@ -1169,7 +1170,7 @@ namespace bgfx { namespace gl
memset(m_fbo, 0, sizeof(m_fbo) );
}
- void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint8_t _num, const Attachment* _attachment);
void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
void postReset();
uint16_t destroy();
@@ -1183,7 +1184,7 @@ namespace bgfx { namespace gl
uint16_t m_denseIdx;
uint8_t m_num;
uint8_t m_numTh;
- TextureHandle m_th[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
+ Attachment m_attachment[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
};
struct ProgramGL
diff --git a/3rdparty/bgfx/src/renderer_mtl.h b/3rdparty/bgfx/src/renderer_mtl.h
index 2b683cff891..f471ee5d457 100644
--- a/3rdparty/bgfx/src/renderer_mtl.h
+++ b/3rdparty/bgfx/src/renderer_mtl.h
@@ -694,7 +694,7 @@ namespace bgfx { namespace mtl
m_depthHandle.idx = invalidHandle;
}
- void create(uint8_t _num, const TextureHandle* _handles);
+ void create(uint8_t _num, const Attachment* _attachment);
void create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat);
void postReset();
uint16_t destroy();
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm
index 833a53bea0d..08faee495f7 100644
--- a/3rdparty/bgfx/src/renderer_mtl.mm
+++ b/3rdparty/bgfx/src/renderer_mtl.mm
@@ -694,9 +694,9 @@ namespace bgfx { namespace mtl
m_textures[_handle.idx].destroy();
}
- void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const TextureHandle* _textureHandles) BX_OVERRIDE
+ void createFrameBuffer(FrameBufferHandle _handle, uint8_t _num, const Attachment* _attachment) BX_OVERRIDE
{
- m_frameBuffers[_handle.idx].create(_num, _textureHandles);
+ m_frameBuffers[_handle.idx].create(_num, _attachment);
}
void createFrameBuffer(FrameBufferHandle _handle, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _depthFormat) BX_OVERRIDE
@@ -2079,12 +2079,12 @@ namespace bgfx { namespace mtl
: m_sampler, _stage);
}
- void FrameBufferMtl::create(uint8_t _num, const TextureHandle* _handles)
+ void FrameBufferMtl::create(uint8_t _num, const Attachment* _attachment)
{
m_num = 0;
for (uint32_t ii = 0; ii < _num; ++ii)
{
- TextureHandle handle = _handles[ii];
+ TextureHandle handle = _attachment[ii].handle;
if (isValid(handle) )
{
const TextureMtl& texture = s_renderMtl->m_textures[handle.idx];
diff --git a/3rdparty/bgfx/src/renderer_null.cpp b/3rdparty/bgfx/src/renderer_null.cpp
index a68e66f0d68..9b3de91416b 100644
--- a/3rdparty/bgfx/src/renderer_null.cpp
+++ b/3rdparty/bgfx/src/renderer_null.cpp
@@ -134,7 +134,7 @@ namespace bgfx { namespace noop
{
}
- void createFrameBuffer(FrameBufferHandle /*_handle*/, uint8_t /*_num*/, const TextureHandle* /*_textureHandles*/) BX_OVERRIDE
+ void createFrameBuffer(FrameBufferHandle /*_handle*/, uint8_t /*_num*/, const Attachment* /*_attachment*/) BX_OVERRIDE
{
}
diff --git a/3rdparty/bgfx/tools/geometryc/geometryc.cpp b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
index b5fc62affe2..7687f3c5e38 100644
--- a/3rdparty/bgfx/tools/geometryc/geometryc.cpp
+++ b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
@@ -811,7 +811,7 @@ int main(int _argc, const char* _argv[])
PrimitiveArray primitives;
bx::CrtFileWriter writer;
- if (bx::open(&writer, outFilePath) )
+ if (!bx::open(&writer, outFilePath) )
{
printf("Unable to open output file '%s'.", outFilePath);
exit(EXIT_FAILURE);
diff --git a/3rdparty/bx/include/bx/fpumath.h b/3rdparty/bx/include/bx/fpumath.h
index b76da2f9a31..be125aa69eb 100644
--- a/3rdparty/bx/include/bx/fpumath.h
+++ b/3rdparty/bx/include/bx/fpumath.h
@@ -149,6 +149,11 @@ namespace bx
return _a - floorf(_a);
}
+ inline float fmod(float _a, float _b)
+ {
+ return fmodf(_a, _b);
+ }
+
inline bool fequal(float _a, float _b, float _epsilon)
{
// http://realtimecollisiondetection.net/blog/?p=89
@@ -169,7 +174,7 @@ namespace bx
inline float fwrap(float _a, float _wrap)
{
- const float mod = fmodf(_a, _wrap);
+ const float mod = fmod(_a, _wrap);
const float result = mod < 0.0f ? _wrap + mod : mod;
return result;
}
@@ -422,8 +427,8 @@ namespace bx
inline void quatRotateAxis(float* __restrict _result, const float* _axis, float _angle)
{
const float ha = _angle * 0.5f;
- const float ca = cosf(ha);
- const float sa = sinf(ha);
+ const float ca = fcos(ha);
+ const float sa = fsin(ha);
_result[0] = _axis[0] * sa;
_result[1] = _axis[1] * sa;
_result[2] = _axis[2] * sa;
@@ -433,8 +438,8 @@ namespace bx
inline void quatRotateX(float* _result, float _ax)
{
const float hx = _ax * 0.5f;
- const float cx = cosf(hx);
- const float sx = sinf(hx);
+ const float cx = fcos(hx);
+ const float sx = fsin(hx);
_result[0] = sx;
_result[1] = 0.0f;
_result[2] = 0.0f;
@@ -444,8 +449,8 @@ namespace bx
inline void quatRotateY(float* _result, float _ay)
{
const float hy = _ay * 0.5f;
- const float cy = cosf(hy);
- const float sy = sinf(hy);
+ const float cy = fcos(hy);
+ const float sy = fsin(hy);
_result[0] = 0.0f;
_result[1] = sy;
_result[2] = 0.0f;
@@ -455,8 +460,8 @@ namespace bx
inline void quatRotateZ(float* _result, float _az)
{
const float hz = _az * 0.5f;
- const float cz = cosf(hz);
- const float sz = sinf(hz);
+ const float cz = fcos(hz);
+ const float sz = fsin(hz);
_result[0] = 0.0f;
_result[1] = 0.0f;
_result[2] = sz;
@@ -736,8 +741,8 @@ namespace bx
inline void mtxRotateX(float* _result, float _ax)
{
- const float sx = sinf(_ax);
- const float cx = cosf(_ax);
+ const float sx = fsin(_ax);
+ const float cx = fcos(_ax);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = 1.0f;
@@ -750,8 +755,8 @@ namespace bx
inline void mtxRotateY(float* _result, float _ay)
{
- const float sy = sinf(_ay);
- const float cy = cosf(_ay);
+ const float sy = fsin(_ay);
+ const float cy = fcos(_ay);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = cy;
@@ -764,8 +769,8 @@ namespace bx
inline void mtxRotateZ(float* _result, float _az)
{
- const float sz = sinf(_az);
- const float cz = cosf(_az);
+ const float sz = fsin(_az);
+ const float cz = fcos(_az);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = cz;
@@ -778,10 +783,10 @@ namespace bx
inline void mtxRotateXY(float* _result, float _ax, float _ay)
{
- const float sx = sinf(_ax);
- const float cx = cosf(_ax);
- const float sy = sinf(_ay);
- const float cy = cosf(_ay);
+ const float sx = fsin(_ax);
+ const float cx = fcos(_ax);
+ const float sy = fsin(_ay);
+ const float cy = fcos(_ay);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = cy;
@@ -797,12 +802,12 @@ namespace bx
inline void mtxRotateXYZ(float* _result, float _ax, float _ay, float _az)
{
- const float sx = sinf(_ax);
- const float cx = cosf(_ax);
- const float sy = sinf(_ay);
- const float cy = cosf(_ay);
- const float sz = sinf(_az);
- const float cz = cosf(_az);
+ const float sx = fsin(_ax);
+ const float cx = fcos(_ax);
+ const float sy = fsin(_ay);
+ const float cy = fcos(_ay);
+ const float sz = fsin(_az);
+ const float cz = fcos(_az);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = cy*cz;
@@ -819,12 +824,12 @@ namespace bx
inline void mtxRotateZYX(float* _result, float _ax, float _ay, float _az)
{
- const float sx = sinf(_ax);
- const float cx = cosf(_ax);
- const float sy = sinf(_ay);
- const float cy = cosf(_ay);
- const float sz = sinf(_az);
- const float cz = cosf(_az);
+ const float sx = fsin(_ax);
+ const float cx = fcos(_ax);
+ const float sy = fsin(_ay);
+ const float cy = fcos(_ay);
+ const float sz = fsin(_az);
+ const float cz = fcos(_az);
memset(_result, 0, sizeof(float)*16);
_result[ 0] = cy*cz;
@@ -841,12 +846,12 @@ namespace bx
inline void mtxSRT(float* _result, float _sx, float _sy, float _sz, float _ax, float _ay, float _az, float _tx, float _ty, float _tz)
{
- const float sx = sinf(_ax);
- const float cx = cosf(_ax);
- const float sy = sinf(_ay);
- const float cy = cosf(_ay);
- const float sz = sinf(_az);
- const float cz = cosf(_az);
+ const float sx = fsin(_ax);
+ const float cx = fcos(_ax);
+ const float sy = fsin(_ay);
+ const float cy = fcos(_ay);
+ const float sz = fsin(_az);
+ const float cz = fcos(_az);
const float sxsz = sx*sz;
const float cycz = cy*cz;
diff --git a/3rdparty/bx/include/bx/hash.h b/3rdparty/bx/include/bx/hash.h
index de3f21c4c0e..4250115622f 100644
--- a/3rdparty/bx/include/bx/hash.h
+++ b/3rdparty/bx/include/bx/hash.h
@@ -103,7 +103,7 @@ namespace bx
static void readUnaligned(const void* _data, uint32_t& _out)
{
const uint8_t* data = (const uint8_t*)_data;
- if (BX_ENABLED(BX_CPU_ENDIAN_LITTLE) )
+ if (BX_ENABLED(BX_CPU_ENDIAN_BIG) )
{
_out = 0
| data[0]<<24
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index ad3a3e647e1..fc674de9570 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -1126,7 +1126,13 @@ function strip()
"$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
}
- configuration { "linux-* or rpi", "Release" }
+ configuration { "linux-steamlink", "Release" }
+ postbuildcommands {
+ "$(SILENT) echo Stripping symbols.",
+ "$(SILENT) $(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-strip -s \"$(TARGET)\""
+ }
+
+ configuration { "linux-* or rpi", "not linux-steamlink", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
"$(SILENT) strip -s \"$(TARGET)\""
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index f79dbd8456f..a7c61b7300e 100644
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index c3a323a0b1e..223ef23852e 100644
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index 7e62285f703..59575ce272e 100644
--- a/3rdparty/bx/tools/bin/windows/genie.exe
+++ b/3rdparty/bx/tools/bin/windows/genie.exe
Binary files differ
diff --git a/3rdparty/genie/src/actions/xcode/xcode_common.lua b/3rdparty/genie/src/actions/xcode/xcode_common.lua
index 5b69c9f1f17..3ba898d1882 100644
--- a/3rdparty/genie/src/actions/xcode/xcode_common.lua
+++ b/3rdparty/genie/src/actions/xcode/xcode_common.lua
@@ -899,7 +899,8 @@
table.insert(flags, flag)
end
end
- xcode.printlist(table.join(flags, cfg.buildoptions), 'OTHER_CFLAGS')
+ xcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_c), 'OTHER_CFLAGS')
+ xcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_cpp), 'OTHER_CPLUSPLUSFLAGS')
-- build list of "other" linked flags. All libraries that aren't frameworks
-- are listed here, so I don't have to try and figure out if they are ".a"
diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c
index f09e80a559e..1e479edf5de 100644
--- a/3rdparty/genie/src/host/scripts.c
+++ b/3rdparty/genie/src/host/scripts.c
@@ -337,9 +337,9 @@ const char* builtin_scripts[] = {
"me)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\n_p(4,'ALWAYS_SEARCH_USER_PATHS = NO;')\nif not cfg.flags.Symbols then\n_p(4,'DEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";')\nend\nif cfg.kind ~= \"StaticLib\" and cfg.buildtarget.prefix ~= \"\" then\n_p(4,'EXECUTABLE_PREFIX = %s;', cfg.buildtarget.prefix)\nend\nif cfg.targetextension then\nlocal ext = cfg.targetextension\next = iif(ext:startswith(\".\"), ext:sub(2), ext)\n_p(4,'EXECUTABLE_EXTENSION = %s;', ext)\nend\nlocal outdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif outdir ~= \".\" then\n_p(4,'CONFIGURATION_BUILD_DIR = %s;', outdir)\nend\n_p(4,'GCC_DYNAMIC_NO_PIC = NO;')\n_p(4,'GCC_MODEL_TUNING = G5;')\nif tr.infoplist then\n_p(4,'INFOPLIST_FILE = \"%s\";', tr.infoplist.cfg.name)\nend\ninstallpaths = {\nConsoleApp = '/usr/local/bin',\nWindowedApp = '\"$(HOME)/Applications\"',\nSharedLib = '/usr/local/lib',\nStaticLib = '/usr/local/lib',\n}\n_p(4,'INSTALL_PATH = %s;', installpaths[cfg.kind])\nlocal infoplist_file = nil\nfor _"
", v in ipairs(cfg.files) do\nif (string.find (string.lower (v), 'info.plist') ~= nil) then\ninfoplist_file = string.format('$(SRCROOT)/%s', v)\nend\nend\nif infoplist_file ~= nil then\n_p(4,'INFOPLIST_FILE = \"%s\";', infoplist_file)\nend\n_p(4,'PRODUCT_NAME = \"%s\";', cfg.buildtarget.basename)\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nfunction xcode.XCBuildConfiguration_Project(tr, cfg)\nlocal cfgname = xcode.getconfigname(cfg)\n_p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfgname)\n_p(3,'isa = XCBuildConfiguration;')\n_p(3,'buildSettings = {')\nlocal archs = {\nNative = \"$(NATIVE_ARCH_ACTUAL)\",\nx32 = \"i386\",\nx64 = \"x86_64\",\nUniversal32 = \"$(ARCHS_STANDARD_32_BIT)\",\nUniversal64 = \"$(ARCHS_STANDARD_64_BIT)\",\nUniversal = \"$(ARCHS_STANDARD_32_64_BIT)\",\n}\n_p(4,'ARCHS = \"%s\";', archs[cfg.platform])\n_p(4,'SDKROOT = \"%s\";', xcode.toolset)\nlocal targetdir = path.getdirectory(cfg.buildtarget.bundlepath)\nif targetdir ~= \".\" then\n_p(4,'CONFIGURATION_BUILD_DIR = \""
"$(SYMROOT)\";');\nend\n_p(4,'CONFIGURATION_TEMP_DIR = \"$(OBJROOT)\";')\nif cfg.flags.Symbols then\n_p(4,'COPY_PHASE_STRIP = NO;')\nend\n_p(4,'GCC_C_LANGUAGE_STANDARD = gnu99;')\nif cfg.flags.NoExceptions then\n_p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;')\nend\nif cfg.flags.NoRTTI then\n_p(4,'GCC_ENABLE_CPP_RTTI = NO;')\nend\nif _ACTION ~= \"xcode4\" and cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then\n_p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;')\nend\nif cfg.flags.NoExceptions then\n_p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;')\nend\nif cfg.flags.Optimize or cfg.flags.OptimizeSize then\n_p(4,'GCC_OPTIMIZATION_LEVEL = s;')\nelseif cfg.flags.OptimizeSpeed then\n_p(4,'GCC_OPTIMIZATION_LEVEL = 3;')\nelse\n_p(4,'GCC_OPTIMIZATION_LEVEL = 0;')\nend\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;')\n_p(4,'GCC_PREFIX_HEADER = \"%s\";', cfg.pchheader)\nend\nxcode.printlist(cfg.defines, 'GCC_PREPROCESSOR_DEFINITIONS')\n_p(4,'GCC_SYMBOLS_PRIVATE_EXTERN = NO;')\nif cfg.flags.FatalW"
- "arnings then\n_p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')\nend\n_p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')\n_p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')\nxcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS')\nxcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS')\n_p(4,'OBJROOT = \"%s\";', cfg.objectsdir)\n_p(4,'ONLY_ACTIVE_ARCH = %s;',iif(premake.config.isdebugbuild(cfg),'YES','NO'))\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nlocal flags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(flags, flag)\nend\nend\nxcode.printlist(table.join(flags, cfg.buildoptions), 'OTHER_CFLAGS')\nflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(flags, \"-l\" .. lib)\nend\nend\nflags = table.join(flags, cfg.linkoptions)\nxcode.printlist(flags, 'OTHER_LDFLAGS')\nif cfg.flags.StaticRuntime then\n_p(4,'STAN"
- "DARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')\nend\nif targetdir ~= \".\" then\n_p(4,'SYMROOT = \"%s\";', targetdir)\nend\nif cfg.flags.ExtraWarnings then\n_p(4,'WARNING_CFLAGS = \"-Wall\";')\nend\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nfunction xcode.XCBuildConfiguration(tr)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Target(tr, target, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Project(tr, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', target.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do"
- "\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;')\n_p('}')\nend\n",
+ "arnings then\n_p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')\nend\n_p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')\n_p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')\nxcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS')\nxcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS')\n_p(4,'OBJROOT = \"%s\";', cfg.objectsdir)\n_p(4,'ONLY_ACTIVE_ARCH = %s;',iif(premake.config.isdebugbuild(cfg),'YES','NO'))\nlocal checks = {\n[\"-ffast-math\"] = cfg.flags.FloatFast,\n[\"-ffloat-store\"] = cfg.flags.FloatStrict,\n[\"-fomit-frame-pointer\"] = cfg.flags.NoFramePointer,\n}\nlocal flags = { }\nfor flag, check in pairs(checks) do\nif check then\ntable.insert(flags, flag)\nend\nend\n xcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_c), 'OTHER_CFLAGS')\n xcode.printlist(table.join(flags, cfg.buildoptions, cfg.buildoptions_cpp), 'OTHER_CPLUSPLUSFLAGS')\nflags = { }\nfor _, lib in ipairs(premake.getlinks(cfg, \"system\")) do\nif not xcode.isframework(lib) then\ntable.insert(flags, \"-l\" .. lib)\nen"
+ "d\nend\nflags = table.join(flags, cfg.linkoptions)\nxcode.printlist(flags, 'OTHER_LDFLAGS')\nif cfg.flags.StaticRuntime then\n_p(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')\nend\nif targetdir ~= \".\" then\n_p(4,'SYMROOT = \"%s\";', targetdir)\nend\nif cfg.flags.ExtraWarnings then\n_p(4,'WARNING_CFLAGS = \"-Wall\";')\nend\n_p(3,'};')\n_p(3,'name = \"%s\";', cfgname)\n_p(2,'};')\nend\nfunction xcode.XCBuildConfiguration(tr)\n_p('/* Begin XCBuildConfiguration section */')\nfor _, target in ipairs(tr.products.children) do\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Target(tr, target, cfg)\nend\nend\nfor _, cfg in ipairs(tr.configs) do\nxcode.XCBuildConfiguration_Project(tr, cfg)\nend\n_p('/* End XCBuildConfiguration section */')\n_p('')\nend\nfunction xcode.XCBuildConfigurationList(tr)\nlocal sln = tr.project.solution\n_p('/* Begin XCConfigurationList section */')\nfor _, target in ipairs(tr.products.children) do\n_p(2,'%s /* Build configuration list for PBXNativeTarget \"%s\" */ = {', t"
+ "arget.cfgsection, target.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\nend\n_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject \"%s\" */ = {', tr.name)\n_p(3,'isa = XCConfigurationList;')\n_p(3,'buildConfigurations = (')\nfor _, cfg in ipairs(tr.configs) do\n_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))\nend\n_p(3,');')\n_p(3,'defaultConfigurationIsVisible = 0;')\n_p(3,'defaultConfigurationName = \"%s\";', xcode.getconfigname(tr.configs[1]))\n_p(2,'};')\n_p('/* End XCConfigurationList section */')\n_p('')\nend\nfunction xcode.Footer()\n_p(1,'};')\n_p('\\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;')\n_p('}')\nend\n",
/* actions/xcode/xcode_project.lua */
"local xcode = premake.xcode\nlocal tree = premake.tree\nfunction xcode.buildprjtree(prj)\nlocal tr = premake.project.buildsourcetree(prj)\ntr.configs = {}\nfor _, cfgname in ipairs(prj.solution.configurations) do\nfor _, platform in ipairs(prj.solution.xcode.platforms) do\nlocal cfg = premake.getconfig(prj, cfgname, platform)\ncfg.xcode = {}\ncfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)\ncfg.xcode.projectid = xcode.newid(tr, cfgname)\ntable.insert(tr.configs, cfg)\nend\nend\ntree.traverse(tr, {\nonbranch = function(node)\nif path.getextension(node.name) == \".lproj\" then\nlocal lang = path.getbasename(node.name) -- \"English\", \"French\", etc.\nfor _, filenode in ipairs(node.children) do\nlocal grpnode = node.parent.children[filenode.name]\nif not grpnode then\ngrpnode = tree.insert(node.parent, tree.new(filenode.name))\ngrpnode.kind = \"vgroup\"\nend\nfilenode.name = path.getbasename(lang)\ntree.insert(grpnode, filenode)\nend\ntree.remove(node)\nend\nend\n})\ntr.frameworks = tree.new(\""
diff --git a/3rdparty/lua-zlib/.gitattributes b/3rdparty/lua-zlib/.gitattributes
new file mode 100644
index 00000000000..54be6288857
--- /dev/null
+++ b/3rdparty/lua-zlib/.gitattributes
@@ -0,0 +1 @@
+lua_zlib.c export-subst ident
diff --git a/3rdparty/lua-zlib/CMakeLists.txt b/3rdparty/lua-zlib/CMakeLists.txt
new file mode 100644
index 00000000000..1cda6b7532b
--- /dev/null
+++ b/3rdparty/lua-zlib/CMakeLists.txt
@@ -0,0 +1,62 @@
+# Copyright (C) 2007-2009 LuaDist.
+# Submitted by David Manura
+# Redistribution and use of this file is allowed according to the
+# terms of the MIT license.
+# For details see the COPYRIGHT file distributed with LuaDist.
+# Please note that the package source code is licensed under its own
+# license.
+
+PROJECT(lua-zlib C)
+CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
+
+option(USE_LUA "Use Lua (also called 'C' Lua) includes (default)" ON)
+option(USE_LUAJIT "Use LuaJIT includes instead of 'C' Lua ones (recommended, if you're using LuaJIT, but disabled by default)")
+set(USE_LUA_VERSION 5.1 CACHE STRING "Set the Lua version to use (default: 5.1)")
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+
+if(USE_LUAJIT)
+# Find luajit
+ find_package(LuaJIT REQUIRED)
+ set(USE_LUA OFF)
+# / Find lua
+endif()
+
+if(USE_LUA)
+# Find lua
+ find_package(Lua ${USE_LUA_VERSION} EXACT REQUIRED)
+# / Find lua
+endif()
+
+
+# Basic configurations
+ SET(INSTALL_CMOD share/lua/cmod CACHE PATH "Directory to install Lua binary modules (configure lua via LUA_CPATH)")
+# / configs
+
+# Find zlib
+ FIND_PACKAGE(ZLIB REQUIRED)
+# / Find zlib
+
+# Define how to build zlib.so:
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS} ${LUA_INCLUDE_DIR})
+ ADD_LIBRARY(cmod_zlib MODULE
+ lua_zlib.c zlib.def)
+ SET_TARGET_PROPERTIES(cmod_zlib PROPERTIES PREFIX "")
+ SET_TARGET_PROPERTIES(cmod_zlib PROPERTIES OUTPUT_NAME zlib)
+ TARGET_LINK_LIBRARIES(cmod_zlib ${ZLIB_LIBRARIES})
+# / build zlib.so
+
+# Define how to test zlib.so:
+ INCLUDE(CTest)
+ SET(LUA_BIN "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+ FIND_PROGRAM(LUA NAMES ${LUA_BIN} lua luajit lua.bat)
+ ADD_TEST(basic ${LUA} ${CMAKE_CURRENT_SOURCE_DIR}/test.lua ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/)
+ SET_TESTS_PROPERTIES(basic
+ PROPERTIES
+ FAIL_REGULAR_EXPRESSION
+ "not ok")
+# / test zlib.so
+
+# Where to install stuff
+ INSTALL (TARGETS cmod_zlib DESTINATION ${INSTALL_CMOD})
+# / Where to install.
diff --git a/3rdparty/lua-zlib/Makefile b/3rdparty/lua-zlib/Makefile
new file mode 100644
index 00000000000..801ea0436f2
--- /dev/null
+++ b/3rdparty/lua-zlib/Makefile
@@ -0,0 +1,62 @@
+# This Makefile is based on LuaSec's Makefile. Thanks to the LuaSec developers.
+# Inform the location to intall the modules
+LUAPATH ?= /usr/share/lua/5.1
+LUACPATH ?= /usr/lib/lua/5.1
+INCDIR ?= -I/usr/include/lua5.1
+LIBDIR ?= -L/usr/lib
+
+# For Mac OS X: set the system version
+MACOSX_VERSION = 10.4
+
+CMOD = zlib.so
+OBJS = lua_zlib.o
+
+LIBS = -lz -llua -lm
+WARN = -Wall -pedantic
+
+BSD_CFLAGS = -O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
+BSD_LDFLAGS = -O -shared -fPIC $(LIBDIR)
+
+LNX_CFLAGS = -O2 -fPIC $(WARN) $(INCDIR) $(DEFS)
+LNX_LDFLAGS = -O -shared -fPIC $(LIBDIR)
+
+MAC_ENV = env MACOSX_DEPLOYMENT_TARGET='$(MACVER)'
+MAC_CFLAGS = -O2 -fPIC -fno-common $(WARN) $(INCDIR) $(DEFS)
+MAC_LDFLAGS = -bundle -undefined dynamic_lookup -fPIC $(LIBDIR)
+
+CC = gcc
+LD = $(MYENV) gcc
+CFLAGS = $(MYCFLAGS)
+LDFLAGS = $(MYLDFLAGS)
+
+.PHONY: all clean install none linux bsd macosx
+
+all:
+ @echo "Usage: $(MAKE) <platform>"
+ @echo " * linux"
+ @echo " * bsd"
+ @echo " * macosx"
+
+install: $(CMOD)
+ cp $(CMOD) $(LUACPATH)
+
+uninstall:
+ rm $(LUACPATH)/zlib.so
+
+linux:
+ @$(MAKE) $(CMOD) MYCFLAGS="$(LNX_CFLAGS)" MYLDFLAGS="$(LNX_LDFLAGS)" INCDIR="$(INCDIR)" LIBDIR="$(LIBDIR)" DEFS="$(DEFS)"
+
+bsd:
+ @$(MAKE) $(CMOD) MYCFLAGS="$(BSD_CFLAGS)" MYLDFLAGS="$(BSD_LDFLAGS)" INCDIR="$(INCDIR)" LIBDIR="$(LIBDIR)" DEFS="$(DEFS)"
+
+macosx:
+ @$(MAKE) $(CMOD) MYCFLAGS="$(MAC_CFLAGS)" MYLDFLAGS="$(MAC_LDFLAGS)" MYENV="$(MAC_ENV)" INCDIR="$(INCDIR)" LIBDIR="$(LIBDIR)" DEFS="$(DEFS)"
+
+clean:
+ rm -f $(OBJS) $(CMOD)
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(DEFS) $(INCDIR) -o $@ $<
+
+$(CMOD): $(OBJS)
+ $(LD) $(LDFLAGS) $(LIBDIR) $(OBJS) $(LIBS) -o $@
diff --git a/3rdparty/lua-zlib/README b/3rdparty/lua-zlib/README
new file mode 100644
index 00000000000..8c1ef8d5f8d
--- /dev/null
+++ b/3rdparty/lua-zlib/README
@@ -0,0 +1,151 @@
+**********************************************************************
+* Author : Brian Maher <maherb at brimworks dot com>
+* Library : lua_zlib - Lua 5.1 interface to zlib
+*
+* The MIT License
+*
+* Copyright (c) 2009 Brian Maher
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+**********************************************************************
+
+To use this library, you need zlib, get it here:
+ http://www.gzip.org/zlib/
+
+To build this library, you can use CMake and get it here:
+ http://www.cmake.org/cmake/resources/software.html
+
+...or you can use GNU Make.
+ make <platform>
+
+Loading the library:
+
+ If you built the library as a loadable package
+ [local] zlib = require 'zlib'
+
+ If you compiled the package statically into your application, call
+ the function "luaopen_zlib(L)". It will create a table with the zlib
+ functions and leave it on the stack.
+
+-- zlib functions --
+
+int major, int minor, int patch = zlib.version()
+
+ returns numeric zlib version for the major, minor, and patch
+ levels of the version dynamically linked in.
+
+function stream = zlib.deflate([ int compression_level ], [ int window_size ])
+
+ If no compression_level is provided uses Z_DEFAULT_COMPRESSION (6),
+ compression level is a number from 1-9 where zlib.BEST_SPEED is 1
+ and zlib.BEST_COMPRESSION is 9.
+
+ Returns a "stream" function that compresses (or deflates) all
+ strings passed in. Specifically, use it as such:
+
+ string deflated, bool eof, int bytes_in, int bytes_out =
+ stream(string input [, 'sync' | 'full' | 'finish'])
+
+ Takes input and deflates and returns a portion of it,
+ optionally forcing a flush.
+
+ A 'sync' flush will force all pending output to be flushed to
+ the return value and the output is aligned on a byte boundary,
+ so that the decompressor can get all input data available so
+ far. Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ A 'full' flush will flush all output as with 'sync', and the
+ compression state is reset so that decompression can restart
+ from this point if previous compressed data has been damaged
+ or if random access is desired. Using Z_FULL_FLUSH too often
+ can seriously degrade the compression.
+
+ A 'finish' flush will force all pending output to be processed
+ and results in the stream become unusable. Any future
+ attempts to print anything other than the empty string will
+ result in an error that begins with IllegalState.
+
+ The eof result is true if 'finish' was specified, otherwise
+ it is false.
+
+ The bytes_in is how many bytes of input have been passed to
+ stream, and bytes_out is the number of bytes returned in
+ deflated string chunks.
+
+function stream = zlib.inflate([int windowBits])
+
+ Returns a "stream" function that decompresses (or inflates) all
+ strings passed in. Optionally specify a windowBits argument
+ that is passed to inflateInit2(), see zlib.h for details about
+ this argument. By default, gzip header detection is done, and
+ the max window size is used.
+
+ The "stream" function should be used as such:
+
+ string inflated, bool eof, int bytes_in, int bytes_out =
+ stream(string input)
+
+ Takes input and inflates and returns a portion of it. If it
+ detects the end of a deflation stream, then total will be the
+ total number of bytes read from input and all future calls to
+ stream() with a non empty string will result in an error that
+ begins with IllegalState.
+
+ No flush options are provided since the maximal amount of
+ input is always processed.
+
+ eof will be true when the input string is determined to be at
+ the "end of the file".
+
+ The bytes_in is how many bytes of input have been passed to
+ stream, and bytes_out is the number of bytes returned in
+ inflated string chunks.
+
+
+function compute_checksum = zlib.adler32()
+function compute_checksum = zlib.crc32()
+
+ Create a new checksum computation function using either the
+ adler32 or crc32 algorithms. This resulting function should be
+ used as such:
+
+ int checksum = compute_checksum(string input |
+ function compute_checksum)
+
+ The compute_checksum function takes as input either a string
+ that is logically getting appended to or another
+ compute_checksum function that is logically getting appended.
+ The result is the updated checksum.
+
+ For example, these uses will all result in the same checksum:
+
+ -- All in one call:
+ local csum = zlib.crc32()("one two")
+
+ -- Multiple calls:
+ local compute = zlib.crc32()
+ compute("one")
+ assert(csum == compute(" two"))
+
+ -- Multiple compute_checksums joined:
+ local compute1, compute2 = zlib.crc32(), zlib.crc32()
+ compute1("one")
+ compute2(" two")
+ assert(csum == compute1(compute2))
diff --git a/3rdparty/lua-zlib/amnon_david.gz b/3rdparty/lua-zlib/amnon_david.gz
new file mode 100644
index 00000000000..c56de231d1a
--- /dev/null
+++ b/3rdparty/lua-zlib/amnon_david.gz
Binary files differ
diff --git a/3rdparty/lua-zlib/cmake/Modules/FindLuaJIT.cmake b/3rdparty/lua-zlib/cmake/Modules/FindLuaJIT.cmake
new file mode 100644
index 00000000000..e626a5a1d94
--- /dev/null
+++ b/3rdparty/lua-zlib/cmake/Modules/FindLuaJIT.cmake
@@ -0,0 +1,63 @@
+# Locate LuaJIT library
+# This module defines
+# LUAJIT_FOUND, if false, do not try to link to Lua
+# LUA_LIBRARIES
+# LUA_INCLUDE_DIR, where to find lua.h
+# LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
+
+## Copied from default CMake FindLua51.cmake
+
+find_path(LUA_INCLUDE_DIR luajit.h
+ HINTS
+ ENV LUA_DIR
+ PATH_SUFFIXES include/luajit-2.0 include
+ PATHS
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
+)
+
+find_library(LUA_LIBRARY
+ NAMES luajit-5.1
+ HINTS
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
+ PATHS
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+)
+
+if(LUA_LIBRARY)
+ # include the math library for Unix
+ if(UNIX AND NOT APPLE)
+ find_library(LUA_MATH_LIBRARY m)
+ set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
+ # For Windows and Mac, don't need to explicitly include the math library
+ else()
+ set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
+ endif()
+endif()
+
+if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/luajit.h")
+ file(STRINGS "${LUA_INCLUDE_DIR}/luajit.h" luajit_version_str REGEX "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT .+\"")
+
+ string(REGEX REPLACE "^#define[ \t]+LUAJIT_VERSION[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${luajit_version_str}")
+ unset(luajit_version_str)
+endif()
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT
+ REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
+ VERSION_VAR LUAJIT_VERSION_STRING)
+
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
+
diff --git a/3rdparty/lua-zlib/lua_zlib.c b/3rdparty/lua-zlib/lua_zlib.c
new file mode 100644
index 00000000000..b619258c75f
--- /dev/null
+++ b/3rdparty/lua-zlib/lua_zlib.c
@@ -0,0 +1,401 @@
+#include <ctype.h>
+#include <lauxlib.h>
+#include <lua.h>
+#include <stdlib.h>
+#include <string.h>
+#include <zlib.h>
+
+/*
+ * ** compatibility with Lua 5.2
+ * */
+#if (LUA_VERSION_NUM >= 502)
+#undef luaL_register
+#define luaL_register(L,n,f) \
+ { if ((n) == NULL) luaL_setfuncs(L,f,0); else luaL_newlib(L,f); }
+
+#endif
+
+#if (LUA_VERSION_NUM >= 503)
+#undef luaL_optint
+#define luaL_optint(L,n,d) ((int)luaL_optinteger(L,(n),(d)))
+#endif
+
+#define DEF_MEM_LEVEL 8
+
+typedef uLong (*checksum_t) (uLong crc, const Bytef *buf, uInt len);
+typedef uLong (*checksum_combine_t)(uLong crc1, uLong crc2, z_off_t len2);
+
+
+static int lz_deflate(lua_State *L);
+static int lz_deflate_delete(lua_State *L);
+static int lz_inflate_delete(lua_State *L);
+static int lz_inflate(lua_State *L);
+static int lz_checksum(lua_State *L);
+static int lz_checksum_new(lua_State *L, checksum_t checksum, checksum_combine_t combine);
+static int lz_adler32(lua_State *L);
+static int lz_crc32(lua_State *L);
+
+static int lz_version(lua_State *L) {
+ const char* version = zlibVersion();
+ int count = strlen(version) + 1;
+ char* cur = (char*)memcpy(lua_newuserdata(L, count),
+ version, count);
+
+ count = 0;
+ while ( *cur ) {
+ char* begin = cur;
+ /* Find all digits: */
+ while ( isdigit(*cur) ) cur++;
+ if ( begin != cur ) {
+ int is_end = *cur == '\0';
+ *cur = '\0';
+ lua_pushnumber(L, atoi(begin));
+ count++;
+ if ( is_end ) break;
+ cur++;
+ }
+ while ( *cur && ! isdigit(*cur) ) cur++;
+ }
+
+ return count;
+}
+
+static int lz_assert(lua_State *L, int result, const z_stream* stream, const char* file, int line) {
+ /* Both of these are "normal" return codes: */
+ if ( result == Z_OK || result == Z_STREAM_END ) return result;
+ switch ( result ) {
+ case Z_NEED_DICT:
+ lua_pushfstring(L, "RequiresDictionary: input stream requires a dictionary to be deflated (%s) at %s line %d",
+ stream->msg, file, line);
+ break;
+ case Z_STREAM_ERROR:
+ lua_pushfstring(L, "InternalError: inconsistent internal zlib stream (%s) at %s line %d",
+ stream->msg, file, line);
+ break;
+ case Z_DATA_ERROR:
+ lua_pushfstring(L, "InvalidInput: input string does not conform to zlib format or checksum failed at %s line %d",
+ file, line);
+ break;
+ case Z_MEM_ERROR:
+ lua_pushfstring(L, "OutOfMemory: not enough memory (%s) at %s line %d",
+ stream->msg, file, line);
+ break;
+ case Z_BUF_ERROR:
+ lua_pushfstring(L, "InternalError: no progress possible (%s) at %s line %d",
+ stream->msg, file, line);
+ break;
+ case Z_VERSION_ERROR:
+ lua_pushfstring(L, "IncompatibleLibrary: built with version %s, but dynamically linked with version %s (%s) at %s line %d",
+ ZLIB_VERSION, zlibVersion(), stream->msg, file, line);
+ break;
+ default:
+ lua_pushfstring(L, "ZLibError: unknown code %d (%s) at %s line %d",
+ result, stream->msg, file, line);
+ }
+ lua_error(L);
+ return result;
+}
+
+/**
+ * @upvalue z_stream - Memory for the z_stream.
+ * @upvalue remainder - Any remainder from the last deflate call.
+ *
+ * @param string - "print" to deflate stream.
+ * @param int - flush output buffer? Z_SYNC_FLUSH, Z_FULL_FLUSH, or Z_FINISH.
+ *
+ * if no params, terminates the stream (as if we got empty string and Z_FINISH).
+ */
+static int lz_filter_impl(lua_State *L, int (*filter)(z_streamp, int), int (*end)(z_streamp), const char* name) {
+ int flush = Z_NO_FLUSH, result;
+ z_stream* stream;
+ luaL_Buffer buff;
+ size_t avail_in;
+
+ if ( filter == deflate ) {
+ const char *const opts[] = { "none", "sync", "full", "finish", NULL };
+ flush = luaL_checkoption(L, 2, opts[0], opts);
+ if ( flush ) flush++;
+ /* Z_NO_FLUSH(0) Z_SYNC_FLUSH(2), Z_FULL_FLUSH(3), Z_FINISH (4) */
+
+ /* No arguments or nil, we are terminating the stream: */
+ if ( lua_gettop(L) == 0 || lua_isnil(L, 1) ) {
+ flush = Z_FINISH;
+ }
+ }
+
+ stream = (z_stream*)lua_touserdata(L, lua_upvalueindex(1));
+ if ( stream == NULL ) {
+ if ( lua_gettop(L) >= 1 && lua_isstring(L, 1) ) {
+ lua_pushfstring(L, "IllegalState: calling %s function when stream was previously closed", name);
+ lua_error(L);
+ }
+ lua_pushstring(L, "");
+ lua_pushboolean(L, 1);
+ return 2; /* Ignore duplicate calls to "close". */
+ }
+
+ luaL_buffinit(L, &buff);
+
+ if ( lua_gettop(L) > 1 ) lua_pushvalue(L, 1);
+
+ if ( lua_isstring(L, lua_upvalueindex(2)) ) {
+ lua_pushvalue(L, lua_upvalueindex(2));
+ if ( lua_gettop(L) > 1 && lua_isstring(L, -2) ) {
+ lua_concat(L, 2);
+ }
+ }
+
+ /* Do the actual deflate'ing: */
+ if (lua_gettop(L) > 0) {
+ stream->next_in = (unsigned char*)lua_tolstring(L, -1, &avail_in);
+ } else {
+ stream->next_in = NULL;
+ avail_in = 0;
+ }
+ stream->avail_in = avail_in;
+
+ if ( ! stream->avail_in && ! flush ) {
+ /* Passed empty string, make it a noop instead of erroring out. */
+ lua_pushstring(L, "");
+ lua_pushboolean(L, 0);
+ lua_pushinteger(L, stream->total_in);
+ lua_pushinteger(L, stream->total_out);
+ return 4;
+ }
+
+ do {
+ stream->next_out = (unsigned char*)luaL_prepbuffer(&buff);
+ stream->avail_out = LUAL_BUFFERSIZE;
+ result = filter(stream, flush);
+ if ( Z_BUF_ERROR != result ) {
+ /* Ignore Z_BUF_ERROR since that just indicates that we
+ * need a larger buffer in order to proceed. Thanks to
+ * Tobias Markmann for finding this bug!
+ */
+ lz_assert(L, result, stream, __FILE__, __LINE__);
+ }
+ luaL_addsize(&buff, LUAL_BUFFERSIZE - stream->avail_out);
+ } while ( stream->avail_out == 0 );
+
+ /* Need to do this before we alter the stack: */
+ luaL_pushresult(&buff);
+
+ /* Save remainder in lua_upvalueindex(2): */
+ if ( NULL != stream->next_in ) {
+ lua_pushlstring(L, (char*)stream->next_in, stream->avail_in);
+ lua_replace(L, lua_upvalueindex(2));
+ }
+
+ /* "close" the stream/remove finalizer: */
+ if ( result == Z_STREAM_END ) {
+ /* Clear-out the metatable so end is not called twice: */
+ lua_pushnil(L);
+ lua_setmetatable(L, lua_upvalueindex(1));
+
+ /* nil the upvalue: */
+ lua_pushnil(L);
+ lua_replace(L, lua_upvalueindex(1));
+
+ /* Close the stream: */
+ lz_assert(L, end(stream), stream, __FILE__, __LINE__);
+
+ lua_pushboolean(L, 1);
+ } else {
+ lua_pushboolean(L, 0);
+ }
+ lua_pushinteger(L, stream->total_in);
+ lua_pushinteger(L, stream->total_out);
+ return 4;
+}
+
+static void lz_create_deflate_mt(lua_State *L) {
+ luaL_newmetatable(L, "lz.deflate.meta"); /* {} */
+
+ lua_pushcfunction(L, lz_deflate_delete);
+ lua_setfield(L, -2, "__gc");
+
+ lua_pop(L, 1); /* <empty> */
+}
+
+static int lz_deflate_new(lua_State *L) {
+ int level = luaL_optint(L, 1, Z_DEFAULT_COMPRESSION);
+ int window_size = luaL_optint(L, 2, MAX_WBITS);
+
+ /* Allocate the stream: */
+ z_stream* stream = (z_stream*)lua_newuserdata(L, sizeof(z_stream));
+
+ stream->zalloc = Z_NULL;
+ stream->zfree = Z_NULL;
+
+ int result = deflateInit2(stream, level, Z_DEFLATED, window_size,
+ DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
+
+ lz_assert(L, result, stream, __FILE__, __LINE__);
+
+ /* Don't allow destructor to execute unless deflateInit2 was successful: */
+ luaL_getmetatable(L, "lz.deflate.meta");
+ lua_setmetatable(L, -2);
+
+ lua_pushnil(L);
+ lua_pushcclosure(L, lz_deflate, 2);
+ return 1;
+}
+
+static int lz_deflate(lua_State *L) {
+ return lz_filter_impl(L, deflate, deflateEnd, "deflate");
+}
+
+static int lz_deflate_delete(lua_State *L) {
+ z_stream* stream = (z_stream*)lua_touserdata(L, 1);
+
+ /* Ignore errors. */
+ deflateEnd(stream);
+
+ return 0;
+}
+
+
+static void lz_create_inflate_mt(lua_State *L) {
+ luaL_newmetatable(L, "lz.inflate.meta"); /* {} */
+
+ lua_pushcfunction(L, lz_inflate_delete);
+ lua_setfield(L, -2, "__gc");
+
+ lua_pop(L, 1); /* <empty> */
+}
+
+static int lz_inflate_new(lua_State *L) {
+ /* Allocate the stream */
+ z_stream* stream = (z_stream*)lua_newuserdata(L, sizeof(z_stream));
+
+ /* By default, we will do gzip header detection w/ max window size */
+ int window_size = lua_isnumber(L, 1) ? lua_tointeger(L, 1) : MAX_WBITS + 32;
+
+ stream->zalloc = Z_NULL;
+ stream->zfree = Z_NULL;
+ stream->next_in = Z_NULL;
+ stream->avail_in = 0;
+
+ lz_assert(L, inflateInit2(stream, window_size), stream, __FILE__, __LINE__);
+
+ /* Don't allow destructor to execute unless deflateInit was successful: */
+ luaL_getmetatable(L, "lz.inflate.meta");
+ lua_setmetatable(L, -2);
+
+ lua_pushnil(L);
+ lua_pushcclosure(L, lz_inflate, 2);
+ return 1;
+}
+
+static int lz_inflate(lua_State *L) {
+ return lz_filter_impl(L, inflate, inflateEnd, "inflate");
+}
+
+static int lz_inflate_delete(lua_State *L) {
+ z_stream* stream = (z_stream*)lua_touserdata(L, 1);
+
+ /* Ignore errors: */
+ inflateEnd(stream);
+
+ return 0;
+}
+
+static int lz_checksum(lua_State *L) {
+ if ( lua_gettop(L) <= 0 ) {
+ lua_pushvalue(L, lua_upvalueindex(3));
+ lua_pushvalue(L, lua_upvalueindex(4));
+ } else if ( lua_isfunction(L, 1) ) {
+ checksum_combine_t combine = (checksum_combine_t)
+ lua_touserdata(L, lua_upvalueindex(2));
+
+ lua_pushvalue(L, 1);
+ lua_call(L, 0, 2);
+ if ( ! lua_isnumber(L, -2) || ! lua_isnumber(L, -1) ) {
+ luaL_argerror(L, 1, "expected function to return two numbers");
+ }
+
+ /* Calculate and replace the checksum */
+ lua_pushnumber(L,
+ combine(lua_tonumber(L, lua_upvalueindex(3)),
+ lua_tonumber(L, -2),
+ lua_tonumber(L, -1)));
+ lua_pushvalue(L, -1);
+ lua_replace(L, lua_upvalueindex(3));
+
+ /* Calculate and replace the length */
+ lua_pushnumber(L,
+ lua_tonumber(L, lua_upvalueindex(4)) + lua_tonumber(L, -2));
+ lua_pushvalue(L, -1);
+ lua_replace(L, lua_upvalueindex(4));
+ } else {
+ const Bytef* str;
+ size_t len;
+
+ checksum_t checksum = (checksum_t)
+ lua_touserdata(L, lua_upvalueindex(1));
+ str = (const Bytef*)luaL_checklstring(L, 1, &len);
+
+ /* Calculate and replace the checksum */
+ lua_pushnumber(L,
+ checksum(lua_tonumber(L, lua_upvalueindex(3)),
+ str,
+ len));
+ lua_pushvalue(L, -1);
+ lua_replace(L, lua_upvalueindex(3));
+
+ /* Calculate and replace the length */
+ lua_pushnumber(L,
+ lua_tonumber(L, lua_upvalueindex(4)) + len);
+ lua_pushvalue(L, -1);
+ lua_replace(L, lua_upvalueindex(4));
+ }
+ return 2;
+}
+
+static int lz_checksum_new(lua_State *L, checksum_t checksum, checksum_combine_t combine) {
+ lua_pushlightuserdata(L, checksum);
+ lua_pushlightuserdata(L, combine);
+ lua_pushnumber(L, checksum(0L, Z_NULL, 0));
+ lua_pushnumber(L, 0);
+ lua_pushcclosure(L, lz_checksum, 4);
+ return 1;
+}
+
+static int lz_adler32(lua_State *L) {
+ return lz_checksum_new(L, adler32, adler32_combine);
+}
+
+static int lz_crc32(lua_State *L) {
+ return lz_checksum_new(L, crc32, crc32_combine);
+}
+
+static const luaL_Reg zlib_functions[] = {
+ { "deflate", lz_deflate_new },
+ { "inflate", lz_inflate_new },
+ { "adler32", lz_adler32 },
+ { "crc32", lz_crc32 },
+ { "version", lz_version },
+ { NULL, NULL }
+};
+
+#define SETLITERAL(n,v) (lua_pushliteral(L, n), lua_pushliteral(L, v), lua_settable(L, -3))
+#define SETINT(n,v) (lua_pushliteral(L, n), lua_pushinteger(L, v), lua_settable(L, -3))
+
+LUALIB_API int luaopen_zlib(lua_State * const L) {
+ lz_create_deflate_mt(L);
+ lz_create_inflate_mt(L);
+
+ luaL_register(L, "zlib", zlib_functions);
+
+ SETINT("BEST_SPEED", Z_BEST_SPEED);
+ SETINT("BEST_COMPRESSION", Z_BEST_COMPRESSION);
+
+ SETLITERAL("_COPYRIGHT", "Copyright (c) 2009-2010 Brian Maher");
+ SETLITERAL("_DESCRIPTION", "Yet another binding to the zlib library");
+ SETLITERAL("_VERSION", "lua-zlib $Id$ $Format:%d$");
+
+ /* Expose this to lua so we can do a test: */
+ SETINT("_TEST_BUFSIZ", LUAL_BUFFERSIZE);
+
+ return 1;
+}
diff --git a/3rdparty/lua-zlib/rockspec b/3rdparty/lua-zlib/rockspec
new file mode 100644
index 00000000000..d248bc099ed
--- /dev/null
+++ b/3rdparty/lua-zlib/rockspec
@@ -0,0 +1,35 @@
+package = "lua-zlib"
+version = "0.3-1"
+source = {
+ url = "git://github.com/brimworks/lua-zlib.git",
+ tag = "v0.4",
+}
+description = {
+ summary = "Simple streaming interface to zlib for Lua.",
+ detailed = [[
+ Simple streaming interface to zlib for Lua.
+ Consists of two functions: inflate and deflate.
+ Both functions return "stream functions" (takes a buffer of input and returns a buffer of output).
+ This project is hosted on github.
+ ]],
+ homepage = "https://github.com/brimworks/lua-zlib",
+ license = "MIT"
+}
+dependencies = {
+ "lua >= 5.1, < 5.3"
+}
+external_dependencies = {
+ ZLIB = {
+ header = "zlib.h"
+ }
+}
+
+build = {
+ type = "builtin",
+ modules = {
+ zlib = {
+ sources = { "lua_zlib.c" };
+ libraries = { "z" },
+ };
+ }
+}
diff --git a/3rdparty/lua-zlib/tap.lua b/3rdparty/lua-zlib/tap.lua
new file mode 100644
index 00000000000..05266a9c997
--- /dev/null
+++ b/3rdparty/lua-zlib/tap.lua
@@ -0,0 +1,24 @@
+local tap_module = {}
+
+local os = require("os")
+
+local counter = 1
+local failed = false
+
+function tap_module.ok(assert_true, desc)
+ local msg = ( assert_true and "ok " or "not ok " ) .. counter
+ if ( not assert_true ) then
+ failed = true
+ end
+ if ( desc ) then
+ msg = msg .. " - " .. desc
+ end
+ print(msg)
+ counter = counter + 1
+end
+
+function tap_module.exit()
+ os.exit(failed and 1 or 0)
+end
+
+return tap_module
diff --git a/3rdparty/lua-zlib/test.lua b/3rdparty/lua-zlib/test.lua
new file mode 100644
index 00000000000..d64e1835506
--- /dev/null
+++ b/3rdparty/lua-zlib/test.lua
@@ -0,0 +1,198 @@
+print "1..9"
+
+local src_dir, build_dir = ...
+package.path = (src_dir or "./") .. "?.lua;" .. package.path
+package.cpath = (build_dir or "./") .. "?.so;" .. package.cpath
+
+local tap = require("tap")
+local lz = require("zlib")
+local ok = tap.ok
+local table = require("table")
+local io = require("io")
+
+function main()
+ test_stats()
+ test_buff_err()
+ test_small_inputs()
+ test_basic()
+ test_large()
+ test_no_input()
+ test_invalid_input()
+ test_streaming()
+ test_illegal_state()
+ test_checksum()
+ test_version()
+ test_tom_macwright()
+ test_amnon_david()
+end
+
+function test_tom_macwright()
+ local deflated =
+ assert(io.open(src_dir.. "/tom_macwright.gz")):read("*a")
+
+ local inflated = lz.inflate()(deflated)
+
+ local expected_inflated =
+ assert(io.open(src_dir.. "/tom_macwright.out")):read("*a")
+
+ ok(expected_inflated == inflated, "Tom MacWright Test")
+end
+
+function test_amnon_david()
+ local body = assert(io.open(src_dir.."/amnon_david.gz")):read("*a")
+
+ local inflate = lz.inflate()
+ local inflated, eof, bytes_in, bytes_out = inflate(body)
+
+ local deflate = lz.deflate()
+ local deflated, eof, bytes_in, bytes_out = deflate(inflated, "full")
+end
+
+function test_stats()
+ local string = ("one"):rep(20)
+ local deflated, eof, bin, bout = lz.deflate()(string, 'finish')
+ ok(eof == true, "eof is true (" .. tostring(eof) .. ")");
+ ok(bin > bout, "bytes in is greater than bytes out?")
+ ok(#deflated == bout, "bytes out is the same size as deflated string length")
+ ok(#string == bin, "bytes in is the same size as the input string length")
+end
+
+-- Thanks to Tobias Markmann for the bug report! We are trying to
+-- force inflate() to return a Z_BUF_ERROR (which should be recovered
+-- from). For some reason this only happens when the input is exactly
+-- LUAL_BUFFERSIZE (at least on my machine).
+function test_buff_err()
+ local text = ("X"):rep(lz._TEST_BUFSIZ);
+
+ local deflated = lz.deflate()(text, 'finish')
+
+ for i=1,#deflated do
+ lz.inflate()(deflated:sub(1,i))
+ end
+end
+
+function test_small_inputs()
+ local text = ("X"):rep(lz._TEST_BUFSIZ);
+
+ local deflated = lz.deflate()(text, 'finish')
+
+ local inflated = {}
+ local inflator = lz.inflate()
+ for i=1,#deflated do
+ local part = inflator(deflated:sub(i,i))
+ table.insert(inflated, part)
+ end
+ inflated = table.concat(inflated)
+ ok(inflated == text, "Expected " .. #text .. " Xs got " .. #inflated)
+end
+
+function test_basic()
+ local test_string = "abcdefghijklmnopqrstuv"
+
+ ok(lz.inflate()(lz.deflate()(), "finish") == "")
+
+ -- Input to deflate is same as output to inflate:
+ local deflated = lz.deflate()(test_string, "finish")
+ local inflated = lz.inflate()(deflated, "finish")
+
+ ok(test_string == inflated, "'" .. tostring(test_string) .. "' == '" .. tostring(inflated) .. "'")
+end
+
+function test_large()
+ -- Try a larger string:
+ local numbers = ""
+ for i=1, 100 do numbers = numbers .. string.format("%3d", i) end
+ local numbers_table = {}
+ for i=1, 10000 do numbers_table[i] = numbers end
+ local test_string = table.concat(numbers_table, "\n")
+
+ local deflated = lz.deflate()(test_string, "finish")
+ local inflated = lz.inflate()(deflated, "finish")
+ ok(test_string == inflated, "large string")
+end
+
+function test_no_input()
+ local stream = lz.deflate()
+ local deflated = stream("")
+ deflated = deflated .. stream("")
+ deflated = deflated .. stream(nil, "finish")
+ ok("" == lz.inflate()(deflated, "finish"), "empty string")
+end
+
+function test_invalid_input()
+ local stream = lz.inflate()
+ local isok, err = pcall(
+ function()
+ stream("bad input")
+ end)
+ ok(not isok)
+ ok(string.find(err, "^InvalidInput"),
+ string.format("InvalidInput error (%s)", err))
+end
+
+function test_streaming()
+ local shrink = lz.deflate(lz.BEST_COMPRESSION)
+ local enlarge = lz.inflate()
+ local expected = {}
+ local got = {}
+ local chant = "Isn't He great, isn't He wonderful?\n"
+ for i=1,100 do
+ if ( i == 100 ) then
+ chant = nil
+ print "EOF round"
+ end
+ local shrink_part, shrink_eof = shrink(chant)
+ local enlarge_part, enlarge_eof = enlarge(shrink_part)
+ if ( i == 100 ) then
+ if not shrink_eof then error("expected eof after shrinking flush") end
+ if not enlarge_eof then error("expected eof after enlarging") end
+ else
+ if shrink_eof then error("unexpected eof after shrinking") end
+ if enlarge_eof then error("unexpected eof after enlarging") end
+ end
+ if enlarge_part then table.insert(got, enlarge_part) end
+ if chant then table.insert(expected, chant) end
+ end
+ ok(table.concat(got) == table.concat(expected), "streaming works")
+end
+
+function test_illegal_state()
+ local stream = lz.deflate()
+ stream("abc")
+ stream() -- eof/close
+
+ local _, emsg = pcall(
+ function()
+ stream("printing on 'closed' handle")
+ end)
+ ok(string.find(emsg, "^IllegalState"),
+ string.format("IllegalState error (%s)", emsg))
+
+ local enlarge = lz.inflate()
+end
+
+function test_checksum()
+ for _, factory in pairs{lz.crc32, lz.adler32} do
+ local csum = factory()("one two")
+
+ -- Multiple calls:
+ local compute = factory()
+ compute("one")
+ assert(csum == compute(" two"))
+
+ -- Multiple compute_checksums joined:
+ local compute1, compute2 = factory(), factory()
+ compute1("one")
+ compute2(" two")
+ assert(csum == compute1(compute2))
+ end
+end
+
+function test_version()
+ local major, minor, patch = lz.version()
+ ok(1 == major, "major version 1 == " .. major);
+ ok(type(minor) == "number", "minor version is number (" .. minor .. ")")
+ ok(type(patch) == "number", "patch version is number (" .. patch .. ")")
+end
+
+main()
diff --git a/3rdparty/lua-zlib/tom_macwright.gz b/3rdparty/lua-zlib/tom_macwright.gz
new file mode 100644
index 00000000000..bb9060b2535
--- /dev/null
+++ b/3rdparty/lua-zlib/tom_macwright.gz
@@ -0,0 +1,4 @@
+xŽ[
+Â0EýÎ*f–Igò(ˆèüüN“éL#mÄí[\‚—‡scÉy®Ðê*=&òNŒïƒ:'–…I˜1Yi[ØpŒ£z…U–
+Žóä¼íR?0J§îzãQê­ñÖ%I…wÊ
+÷’áâcÇ©Â)‡øù͢ÃülbÉgФÉ!·¤áˆŒ¨vºŸ¬ò§®®K‚½¾ ”E¶F}šÊHÙ \ No newline at end of file
diff --git a/3rdparty/lua-zlib/tom_macwright.out b/3rdparty/lua-zlib/tom_macwright.out
new file mode 100644
index 00000000000..ca88bcb6c2d
--- /dev/null
+++ b/3rdparty/lua-zlib/tom_macwright.out
Binary files differ
diff --git a/3rdparty/lua-zlib/zlib.def b/3rdparty/lua-zlib/zlib.def
new file mode 100644
index 00000000000..d6c5a916b64
--- /dev/null
+++ b/3rdparty/lua-zlib/zlib.def
@@ -0,0 +1,2 @@
+EXPORTS
+luaopen_zlib
diff --git a/3rdparty/luafilesystem/.travis.yml b/3rdparty/luafilesystem/.travis.yml
new file mode 100644
index 00000000000..67b5812e09e
--- /dev/null
+++ b/3rdparty/luafilesystem/.travis.yml
@@ -0,0 +1,33 @@
+language: c
+
+env:
+ global:
+ - LUAROCKS=2.2.0-rc1
+ matrix:
+ - LUA=lua5.1
+ - LUA=lua5.2
+ - LUA=lua5.3
+ - LUA=luajit
+
+branches:
+ only:
+ - master
+
+before_install:
+ - bash .travis/setup_lua.sh
+ - sudo pip install cpp-coveralls
+
+install:
+ - sudo luarocks make rockspecs/luafilesystem-cvs-3.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
+
+script:
+ - cd tests
+ - sudo lua test.lua
+
+after_success:
+ - coveralls -b .. -r .. -E usr
+
+notifications:
+ email:
+ on_success: change
+ on_failure: always
diff --git a/3rdparty/luafilesystem/.travis/platform.sh b/3rdparty/luafilesystem/.travis/platform.sh
new file mode 100644
index 00000000000..4a3af0d487e
--- /dev/null
+++ b/3rdparty/luafilesystem/.travis/platform.sh
@@ -0,0 +1,15 @@
+if [ -z "$PLATFORM" ]; then
+ PLATFORM=$TRAVIS_OS_NAME;
+fi
+
+if [ "$PLATFORM" == "osx" ]; then
+ PLATFORM="macosx";
+fi
+
+if [ -z "$PLATFORM" ]; then
+ if [ "$(uname)" == "Linux" ]; then
+ PLATFORM="linux";
+ else
+ PLATFORM="macosx";
+ fi;
+fi
diff --git a/3rdparty/luafilesystem/.travis/setup_lua.sh b/3rdparty/luafilesystem/.travis/setup_lua.sh
new file mode 100644
index 00000000000..373e24d979b
--- /dev/null
+++ b/3rdparty/luafilesystem/.travis/setup_lua.sh
@@ -0,0 +1,101 @@
+#! /bin/bash
+
+# A script for setting up environment for travis-ci testing.
+# Sets up Lua and Luarocks.
+# LUA must be "lua5.1", "lua5.2" or "luajit".
+# luajit2.0 - master v2.0
+# luajit2.1 - master v2.1
+
+LUAJIT_BASE="LuaJIT-2.0.3"
+
+source .travis/platform.sh
+
+LUAJIT="no"
+
+if [ "$PLATFORM" == "macosx" ]; then
+ if [ "$LUA" == "luajit" ]; then
+ LUAJIT="yes";
+ fi
+ if [ "$LUA" == "luajit2.0" ]; then
+ LUAJIT="yes";
+ fi
+ if [ "$LUA" == "luajit2.1" ]; then
+ LUAJIT="yes";
+ fi;
+elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
+ LUAJIT="yes";
+fi
+
+if [ "$LUAJIT" == "yes" ]; then
+
+ if [ "$LUA" == "luajit" ]; then
+ curl http://luajit.org/download/$LUAJIT_BASE.tar.gz | tar xz;
+ else
+ git clone http://luajit.org/git/luajit-2.0.git $LUAJIT_BASE;
+ fi
+
+ cd $LUAJIT_BASE
+
+ if [ "$LUA" == "luajit2.1" ]; then
+ git checkout v2.1;
+ fi
+
+ make && sudo make install
+
+ if [ "$LUA" == "luajit2.1" ]; then
+ sudo ln -s /usr/local/bin/luajit-2.1.0-alpha /usr/local/bin/luajit
+ sudo ln -s /usr/local/bin/luajit /usr/local/bin/lua;
+ else
+ sudo ln -s /usr/local/bin/luajit /usr/local/bin/lua;
+ fi;
+
+else
+ if [ "$LUA" == "lua5.1" ]; then
+ curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
+ cd lua-5.1.5;
+ elif [ "$LUA" == "lua5.2" ]; then
+ curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz
+ cd lua-5.2.3;
+ elif [ "$LUA" == "lua5.3" ]; then
+ curl http://www.lua.org/work/lua-5.3.0-beta.tar.gz | tar xz
+ cd lua-5.3.0-beta;
+ fi
+ sudo make $PLATFORM install;
+fi
+
+cd $TRAVIS_BUILD_DIR;
+
+LUAROCKS_BASE=luarocks-$LUAROCKS
+
+# curl http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
+
+git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE
+cd $LUAROCKS_BASE
+
+git checkout v$LUAROCKS
+
+if [ "$LUA" == "luajit" ]; then
+ ./configure --lua-suffix=jit --with-lua-include=/usr/local/include/luajit-2.0;
+elif [ "$LUA" == "luajit2.0" ]; then
+ ./configure --lua-suffix=jit --with-lua-include=/usr/local/include/luajit-2.0;
+elif [ "$LUA" == "luajit2.1" ]; then
+ ./configure --lua-suffix=jit --with-lua-include=/usr/local/include/luajit-2.1;
+else
+ ./configure;
+fi
+
+make build && sudo make install
+
+cd $TRAVIS_BUILD_DIR
+
+rm -rf $LUAROCKS_BASE
+
+if [ "$LUAJIT" == "yes" ]; then
+ rm -rf $LUAJIT_BASE;
+elif [ "$LUA" == "lua5.1" ]; then
+ rm -rf lua-5.1.5;
+elif [ "$LUA" == "lua5.2" ]; then
+ rm -rf lua-5.2.3;
+elif [ "$LUA" == "lua5.3" ]; then
+ rm -rf lua-5.3.0-beta;
+fi
diff --git a/3rdparty/luafilesystem/LICENSE b/3rdparty/luafilesystem/LICENSE
new file mode 100644
index 00000000000..8475345a64e
--- /dev/null
+++ b/3rdparty/luafilesystem/LICENSE
@@ -0,0 +1,21 @@
+Copyright © 2003-2014 Kepler Project.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/3rdparty/luafilesystem/Makefile b/3rdparty/luafilesystem/Makefile
new file mode 100644
index 00000000000..b834a4d51ab
--- /dev/null
+++ b/3rdparty/luafilesystem/Makefile
@@ -0,0 +1,25 @@
+# $Id: Makefile,v 1.36 2009/09/21 17:02:44 mascarenhas Exp $
+
+T= lfs
+
+CONFIG= ./config
+
+include $(CONFIG)
+
+SRCS= src/$T.c
+OBJS= src/$T.o
+
+lib: src/lfs.so
+
+src/lfs.so: $(OBJS)
+ MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/lfs.so $(OBJS)
+
+test: lib
+ LUA_CPATH=./src/?.so lua tests/test.lua
+
+install:
+ mkdir -p $(LUA_LIBDIR)
+ cp src/lfs.so $(LUA_LIBDIR)
+
+clean:
+ rm -f src/lfs.so $(OBJS)
diff --git a/3rdparty/luafilesystem/Makefile.win b/3rdparty/luafilesystem/Makefile.win
new file mode 100644
index 00000000000..65cab812408
--- /dev/null
+++ b/3rdparty/luafilesystem/Makefile.win
@@ -0,0 +1,25 @@
+# $Id: Makefile.win,v 1.11 2008/05/07 19:06:37 carregal Exp $
+
+T= lfs
+
+include config.win
+
+SRCS= src\$T.c
+OBJS= src\$T.obj
+
+lib: src\lfs.dll
+
+.c.obj:
+ $(CC) /c /Fo$@ $(CFLAGS) $<
+
+src\lfs.dll: $(OBJS)
+ link /dll /def:src\$T.def /out:src\lfs.dll $(OBJS) "$(LUA_LIB)"
+ IF EXIST src\lfs.dll.manifest mt -manifest src\lfs.dll.manifest -outputresource:src\lfs.dll;2
+
+install: src\lfs.dll
+ IF NOT EXIST "$(LUA_LIBDIR)" mkdir "$(LUA_LIBDIR)"
+ copy src\lfs.dll "$(LUA_LIBDIR)"
+
+clean:
+ del src\lfs.dll $(OBJS) src\$T.lib src\$T.exp
+ IF EXIST src\lfs.dll.manifest del src\lfs.dll.manifest \ No newline at end of file
diff --git a/3rdparty/luafilesystem/README b/3rdparty/luafilesystem/README
new file mode 100644
index 00000000000..9d37a4e2513
--- /dev/null
+++ b/3rdparty/luafilesystem/README
@@ -0,0 +1,23 @@
+LuaFileSystem - File System Library for Lua
+Copyright 2003-2015 Kepler Project
+
+http://keplerproject.github.io/luafilesystem
+
+Description
+-----------
+LuaFileSystem is a Lua library developed to complement the set of functions
+related to file systems offered by the standard Lua distribution.
+
+LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.
+LuaFileSystem is free software and uses the same license as Lua 5.1
+
+LuaRocks Installation
+---------------------
+
+```
+luarocks install luafilesystem
+```
+
+Documentation
+-------------
+Please check the documentation at doc/us/ for more information.
diff --git a/3rdparty/luafilesystem/config b/3rdparty/luafilesystem/config
new file mode 100644
index 00000000000..cfd4c6a6d3e
--- /dev/null
+++ b/3rdparty/luafilesystem/config
@@ -0,0 +1,24 @@
+# Installation directories
+
+# Default installation prefix
+PREFIX=/usr/local
+
+# System's libraries directory (where binary libraries are installed)
+LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
+
+# Lua includes directory
+LUA_INC= $(PREFIX)/include
+
+# OS dependent
+LIB_OPTION= -shared #for Linux
+#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
+
+LIBNAME= $T.so.$V
+
+# Compilation directives
+WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
+INCS= -I$(LUA_INC)
+CFLAGS= $(WARN) $(INCS)
+CC= gcc
+
+# $Id: config,v 1.21 2007/10/27 22:42:32 carregal Exp $
diff --git a/3rdparty/luafilesystem/config.win b/3rdparty/luafilesystem/config.win
new file mode 100644
index 00000000000..50e81f64206
--- /dev/null
+++ b/3rdparty/luafilesystem/config.win
@@ -0,0 +1,19 @@
+# Installation directories
+# System's libraries directory (where binary libraries are installed)
+LUA_LIBDIR= "c:\lua5.1"
+
+# Lua includes directory
+LUA_INC= "c:\lua5.1\include"
+
+# Lua library
+LUA_LIB= "c:\lua5.1\lua5.1.lib"
+
+LIBNAME= $T.dll
+
+# Compilation directives
+WARN= /O2
+INCS= /I$(LUA_INC)
+CFLAGS= /MD $(WARN) $(INCS)
+CC= cl
+
+# $Id: config.win,v 1.7 2008/03/25 17:39:29 mascarenhas Exp $
diff --git a/3rdparty/luafilesystem/doc/us/doc.css b/3rdparty/luafilesystem/doc/us/doc.css
new file mode 100644
index 00000000000..e816a7e2c63
--- /dev/null
+++ b/3rdparty/luafilesystem/doc/us/doc.css
@@ -0,0 +1,212 @@
+body {
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: arial, helvetica, geneva, sans-serif;
+ background-color:#ffffff; margin:0px;
+}
+
+code {
+ font-family: "Andale Mono", monospace;
+}
+
+tt {
+ font-family: "Andale Mono", monospace;
+}
+
+body, td, th { font-size: 11pt; }
+
+h1, h2, h3, h4 { margin-left: 0em; }
+
+textarea, pre, tt { font-size:10pt; }
+body, td, th { color:#000000; }
+small { font-size:0.85em; }
+h1 { font-size:1.5em; }
+h2 { font-size:1.25em; }
+h3 { font-size:1.15em; }
+h4 { font-size:1.06em; }
+
+a:link { font-weight:bold; color: #004080; text-decoration: none; }
+a:visited { font-weight:bold; color: #006699; text-decoration: none; }
+a:link:hover { text-decoration:underline; }
+hr { color:#cccccc }
+img { border-width: 0px; }
+
+h3 { padding-top: 1em; }
+
+p { margin-left: 1em; }
+
+p.name {
+ font-family: "Andale Mono", monospace;
+ padding-top: 1em;
+ margin-left: 0em;
+}
+
+blockquote { margin-left: 3em; }
+
+.example {
+ background-color: rgb(245, 245, 245);
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: silver;
+ border-right-color: silver;
+ border-bottom-color: silver;
+ border-left-color: silver;
+ padding: 1em;
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: "Andale Mono", monospace;
+ font-size: smaller;
+}
+
+hr {
+ margin-left: 0em;
+ background: #00007f;
+ border: 0px;
+ height: 1px;
+}
+
+ul { list-style-type: disc; }
+
+table.index { border: 1px #00007f; }
+table.index td { text-align: left; vertical-align: top; }
+table.index ul { padding-top: 0em; margin-top: 0em; }
+
+table {
+ border: 1px solid black;
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+th {
+ border: 1px solid black;
+ padding: 0.5em;
+}
+
+td {
+ border: 1px solid black;
+ padding: 0.5em;
+}
+div.header, div.footer { margin-left: 0em; }
+
+#container {
+ margin-left: 1em;
+ margin-right: 1em;
+ background-color: #f0f0f0;
+}
+
+#product {
+ text-align: center;
+ border-bottom: 1px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#product big {
+ font-size: 2em;
+}
+
+#product_logo {
+}
+
+#product_name {
+}
+
+#product_description {
+}
+
+#main {
+ background-color: #f0f0f0;
+ border-left: 2px solid #cccccc;
+}
+
+#navigation {
+ float: left;
+ width: 12em;
+ margin: 0;
+ vertical-align: top;
+ background-color: #f0f0f0;
+ overflow:visible;
+}
+
+#navigation h1 {
+ background-color:#e7e7e7;
+ font-size:1.1em;
+ color:#000000;
+ text-align:left;
+ margin:0px;
+ padding:0.2em;
+ border-top:1px solid #dddddd;
+ border-bottom:1px solid #dddddd;
+}
+
+#navigation ul {
+ font-size:1em;
+ list-style-type: none;
+ padding: 0;
+ margin: 1px;
+}
+
+#navigation li {
+ text-indent: -1em;
+ margin: 0em 0em 0em 0.5em;
+ display: block;
+ padding: 3px 0px 0px 12px;
+}
+
+#navigation li li a {
+ padding: 0px 3px 0px -1em;
+}
+
+#content {
+ margin-left: 12em;
+ padding: 1em;
+ border-left: 2px solid #cccccc;
+ border-right: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#about {
+ clear: both;
+ margin: 0;
+ padding: 5px;
+ border-top: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+@media print {
+ body {
+ font: 10pt "Times New Roman", "TimeNR", Times, serif;
+ }
+ a {
+ font-weight:bold; color: #004080; text-decoration: underline;
+ }
+ #main {
+ background-color: #ffffff; border-left: 0px;
+ }
+ #container {
+ margin-left: 2%; margin-right: 2%; background-color: #ffffff;
+ }
+ #content {
+ margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff;
+ }
+ #navigation {
+ display: none;
+ }
+ #product_logo {
+ display: none;
+ }
+ #about img {
+ display: none;
+ }
+ .example {
+ font-family: "Andale Mono", monospace;
+ font-size: 8pt;
+ page-break-inside: avoid;
+ }
+}
diff --git a/3rdparty/luafilesystem/doc/us/examples.html b/3rdparty/luafilesystem/doc/us/examples.html
new file mode 100644
index 00000000000..2c1644cb8a0
--- /dev/null
+++ b/3rdparty/luafilesystem/doc/us/examples.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>LuaFileSystem</title>
+ <link rel="stylesheet" href="doc.css" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo">
+ <a href="http://www.keplerproject.org">
+ <img alt="LuaFileSystem" src="luafilesystem.png"/>
+ </a>
+ </div>
+ <div id="product_name"><big><strong>LuaFileSystem</strong></big></div>
+ <div id="product_description">File System Library for the Lua Programming Language</div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+<h1>LuaFileSystem</h1>
+ <ul>
+ <li><a href="index.html">Home</a>
+ <ul>
+ <li><a href="index.html#overview">Overview</a></li>
+ <li><a href="index.html#status">Status</a></li>
+ <li><a href="index.html#download">Download</a></li>
+ <li><a href="index.html#history">History</a></li>
+ <li><a href="index.html#credits">Credits</a></li>
+ <li><a href="index.html#contact">Contact us</a></li>
+ </ul>
+ </li>
+ <li><a href="manual.html">Manual</a>
+ <ul>
+ <li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
+ <li><a href="manual.html#installation">Installation</a></li>
+ <li><a href="manual.html#reference">Reference</a></li>
+ </ul>
+ </li>
+ <li><strong>Examples</strong></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
+ <ul>
+ <li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
+ </ul>
+ </li>
+ <li><a href="license.html">License</a></li>
+ </ul>
+</div> <!-- id="navigation" -->
+
+<div id="content">
+
+<h2><a name="example"></a>Examples</h2>
+
+<h3>Directory iterator</h3>
+
+<p>The following example iterates over a directory and recursively lists the
+attributes for each file inside it.</p>
+
+<pre class="example">
+local lfs = require"lfs"
+
+function attrdir (path)
+ for file in lfs.dir(path) do
+ if file ~= "." and file ~= ".." then
+ local f = path..'/'..file
+ print ("\t "..f)
+ local attr = lfs.attributes (f)
+ assert (type(attr) == "table")
+ if attr.mode == "directory" then
+ attrdir (f)
+ else
+ for name, value in pairs(attr) do
+ print (name, value)
+ end
+ end
+ end
+ end
+end
+
+attrdir (".")
+</pre>
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: examples.html,v 1.8 2007/12/14 15:28:04 carregal Exp $</small></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+
+</body>
+</html>
diff --git a/3rdparty/luafilesystem/doc/us/index.html b/3rdparty/luafilesystem/doc/us/index.html
new file mode 100644
index 00000000000..2bb7f5d2cbb
--- /dev/null
+++ b/3rdparty/luafilesystem/doc/us/index.html
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>LuaFileSystem</title>
+ <link rel="stylesheet" href="doc.css" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo">
+ <a href="http://www.keplerproject.org">
+ <img alt="LuaFileSystem" src="luafilesystem.png"/>
+ </a>
+ </div>
+ <div id="product_name"><big><strong>LuaFileSystem</strong></big></div>
+ <div id="product_description">File System Library for the Lua Programming Language</div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+<h1>LuaFileSystem</h1>
+ <ul>
+ <li><strong>Home</strong>
+ <ul>
+ <li><a href="index.html#overview">Overview</a></li>
+ <li><a href="index.html#status">Status</a></li>
+ <li><a href="index.html#download">Download</a></li>
+ <li><a href="index.html#history">History</a></li>
+ <li><a href="index.html#credits">Credits</a></li>
+ <li><a href="index.html#contact">Contact us</a></li>
+ </ul>
+ </li>
+ <li><a href="manual.html">Manual</a>
+ <ul>
+ <li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
+ <li><a href="manual.html#installation">Installation</a></li>
+ <li><a href="manual.html#reference">Reference</a></li>
+ </ul>
+ </li>
+ <li><a href="examples.html">Examples</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
+ <ul>
+ <li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
+ </ul>
+ </li>
+ <li><a href="license.html">License</a></li>
+ </ul>
+</div> <!-- id="navigation" -->
+
+<div id="content">
+
+<h2><a name="overview"></a>Overview</h2>
+
+<p>LuaFileSystem is a <a href="http://www.lua.org">Lua</a> library
+developed to complement the set of functions related to file
+systems offered by the standard Lua distribution.</p>
+
+<p>LuaFileSystem offers a portable way to access
+the underlying directory structure and file attributes.</p>
+
+<p>LuaFileSystem is free software and uses the same
+<a href="license.html">license</a> as Lua 5.1.</p>
+
+<h2><a name="status"></a>Status</h2>
+
+<p>Current version is 1.6.3. It works with Lua 5.1, 5.2 and 5.3.</p>
+
+<h2><a name="download"></a>Download</h2>
+
+<p>LuaFileSystem source can be downloaded from its
+<a href="http://github.com/keplerproject/luafilesystem">Github</a>
+page.</p>
+
+<h2><a name="history"></a>History</h2>
+
+<dl class="history">
+ <dt><strong>Version 1.6.3</strong> [15/Jan/2015]</dt>
+ <dd><ul>
+ <li>Lua 5.3 support.</li>
+ <li>Assorted bugfixes.</li>
+ </ul></dd>
+
+ <dt><strong>Version 1.6.2</strong> [??/Oct/2012]</dt>
+ <dd><ul>
+ <li>Full Lua 5.2 compatibility (with Lua 5.1 fallbacks)</li>
+ </ul></dd>
+
+ <dt><strong>Version 1.6.1</strong> [01/Oct/2012]</dt>
+ <dd><ul>
+ <li>fix build for Lua 5.2</li>
+ </ul></dd>
+
+ <dt><strong>Version 1.6.0</strong> [26/Sep/2012]</dt>
+ <dd><ul>
+ <li>getcwd fix for Android</li>
+ <li>support for Lua 5.2</li>
+ <li>add lfs.link</li>
+ <li>other bug fixes</li>
+ </ul></dd>
+
+ <dt><strong>Version 1.5.0</strong> [20/Oct/2009]</dt>
+ <dd><ul>
+ <li>Added explicit next and close methods to second return value of lfs.dir
+(the directory object), for explicit iteration or explicit closing.</li>
+ <li>Added directory locking via lfs.lock_dir function (see the <a href="manual.html">manual</a>).</li>
+ </ul></dd>
+ <dt><strong>Version 1.4.2</strong> [03/Feb/2009]</dt>
+ <dd>
+ <ul>
+ <li>fixed bug [<a href="http://luaforge.net/tracker/?func=detail&amp;group_id=66&amp;aid=13198&amp;atid=356">#13198</a>]
+ lfs.attributes(filename, 'size') overflow on files > 2 Gb again (bug report and patch by KUBO Takehiro).</li>
+ <li>fixed bug [<a href="http://luaforge.net/tracker/?group_id=66&amp;atid=356&amp;func=detail&amp;aid=39794">#39794</a>]
+ Compile error on Solaris 10 (bug report and patch by Aaron B).</li>
+ <li>fixed compilation problems with Borland C.</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.4.1</strong> [07/May/2008]</dt>
+ <dd>
+ <ul>
+ <li>documentation review</li>
+ <li>fixed Windows compilation issues</li>
+ <li>fixed bug in the Windows tests (patch by Shmuel Zeigerman)</li>
+ <li>fixed bug [<a href="http://luaforge.net/tracker/?func=detail&amp;group_id=66&amp;aid=2185&amp;atid=356">#2185</a>]
+ <code>lfs.attributes(filename, 'size')</code> overflow on files > 2 Gb
+ </li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.4.0</strong> [13/Feb/2008]</dt>
+ <dd>
+ <ul>
+ <li>added function
+ <a href="manual.html#setmode"><code>lfs.setmode</code></a>
+ (works only in Windows systems).</li>
+ <li><a href="manual.html#attributes"><code>lfs.attributes</code></a>
+ raises an error if attribute does not exist</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.3.0</strong> [26/Oct/2007]</dt>
+ <dd>
+ <ul>
+ <li>added function
+ <a href="manual.html#symlinkattributes"><code>lfs.symlinkattributes</code></a>
+ (works only in non Windows systems).</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.2.1</strong> [08/May/2007]</dt>
+ <dd>
+ <ul>
+ <li>compatible only with Lua 5.1 (Lua 5.0 support was dropped)</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.2</strong> [15/Mar/2006]</dt>
+ <dd>
+ <ul>
+ <li>added optional argument to
+ <a href="manual.html#attributes"><code>lfs.attributes</code></a></li>
+ <li>added function
+ <a href="manual.html#rmdir"><code>lfs.rmdir</code></a></li>
+ <li>bug correction on <a href="manual.html#dir"><code>lfs.dir</code></a></li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.1</strong> [30/May/2005]</dt>
+ <dd>
+ <ul>
+ <li>added function <a href="manual.html#touch"><code>lfs.touch</code></a>.</li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.0</strong> [21/Jan/2005]</dt>
+ <dd />
+
+ <dt><strong>Version 1.0 Beta</strong> [10/Nov/2004]</dt>
+ <dd />
+</dl>
+
+<h2><a name="credits"></a>Credits</h2>
+
+<p>LuaFileSystem was designed by Roberto Ierusalimschy,
+Andr&eacute; Carregal and Tom&aacute;s Guisasola as part of the
+<a href="http://www.keplerproject.org">Kepler Project</a>,
+which holds its copyright. LuaFileSystem is currently maintained by F&aacute;bio Mascarenhas.</p>
+
+<h2><a name="contact"></a>Contact us</h2>
+
+<p>For more information please
+<a href="mailto:info-NO-SPAM-THANKS@keplerproject.org">contact us</a>.
+Comments are welcome!</p>
+
+<p>You can also reach other Kepler developers and users on the Kepler Project
+<a href="http://luaforge.net/mail/?group_id=104">mailing list</a>.</p>
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: index.html,v 1.44 2009/02/04 21:21:33 carregal Exp $</small></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+
+</body>
+</html>
diff --git a/3rdparty/luafilesystem/doc/us/license.html b/3rdparty/luafilesystem/doc/us/license.html
new file mode 100644
index 00000000000..30033817229
--- /dev/null
+++ b/3rdparty/luafilesystem/doc/us/license.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>LuaFileSystem</title>
+ <link rel="stylesheet" href="doc.css" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo">
+ <a href="http://www.keplerproject.org">
+ <img alt="LuaFileSystem" src="luafilesystem.png"/>
+ </a>
+ </div>
+ <div id="product_name"><big><strong>LuaFileSystem</strong></big></div>
+ <div id="product_description">File System Library for the Lua Programming Language</div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+<h1>LuaFileSystem</h1>
+ <ul>
+ <li><a href="index.html">Home</a>
+ <ul>
+ <li><a href="index.html#overview">Overview</a></li>
+ <li><a href="index.html#status">Status</a></li>
+ <li><a href="index.html#download">Download</a></li>
+ <li><a href="index.html#history">History</a></li>
+ <li><a href="index.html#credits">Credits</a></li>
+ <li><a href="index.html#contact">Contact us</a></li>
+ </ul>
+ </li>
+ <li><a href="manual.html">Manual</a>
+ <ul>
+ <li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
+ <li><a href="manual.html#installation">Installation</a></li>
+ <li><a href="manual.html#reference">Reference</a></li>
+ </ul>
+ </li>
+ <li><a href="examples.html">Examples</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
+ <ul>
+ <li><a href="https://github.com/keplerproject/luafilesystem/issues/">Bug Tracker</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
+ </ul>
+ </li>
+ <li><strong>License</strong></li>
+ </ul>
+</div> <!-- id="navigation" -->
+
+<div id="content">
+
+<h1>License</h1>
+
+<p>
+LuaFileSystem is free software: it can be used for both academic
+and commercial purposes at absolutely no cost. There are no
+royalties or GNU-like "copyleft" restrictions. LuaFileSystem
+qualifies as
+<a href="http://www.opensource.org/docs/definition.html">Open Source</a>
+software.
+Its licenses are compatible with
+<a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.
+LuaFileSystem is not in the public domain and the
+<a href="http://www.keplerproject.org">Kepler Project</a>
+keep its copyright.
+The legal details are below.
+</p>
+
+<p>The spirit of the license is that you are free to use
+LuaFileSystem for any purpose at no cost without having to ask us.
+The only requirement is that if you do use LuaFileSystem, then you
+should give us credit by including the appropriate copyright notice
+somewhere in your product or its documentation.</p>
+
+<p>The LuaFileSystem library is designed and implemented by Roberto
+Ierusalimschy, Andr&eacute; Carregal and Tom&aacute;s Guisasola.
+The implementation is not derived from licensed software.</p>
+
+<hr/>
+<p>Copyright &copy; 2003 Kepler Project.</p>
+
+<p>Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:</p>
+
+<p>The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.</p>
+
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.</p>
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: license.html,v 1.13 2008/02/11 22:42:21 carregal Exp $</small></p>
+</div><!-- id="about" -->
+
+</div><!-- id="container" -->
+
+</body>
+</html>
diff --git a/3rdparty/luafilesystem/doc/us/luafilesystem.png b/3rdparty/luafilesystem/doc/us/luafilesystem.png
new file mode 100644
index 00000000000..e1dd8c65b52
--- /dev/null
+++ b/3rdparty/luafilesystem/doc/us/luafilesystem.png
Binary files differ
diff --git a/3rdparty/luafilesystem/doc/us/manual.html b/3rdparty/luafilesystem/doc/us/manual.html
new file mode 100644
index 00000000000..33c1cbea573
--- /dev/null
+++ b/3rdparty/luafilesystem/doc/us/manual.html
@@ -0,0 +1,280 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>LuaFileSystem</title>
+ <link rel="stylesheet" href="doc.css" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+
+<body>
+
+<div id="container">
+
+<div id="product">
+ <div id="product_logo">
+ <a href="http://www.keplerproject.org"><img alt="LuaFileSystem" src="luafilesystem.png"/></a>
+ </div>
+ <div id="product_name"><big><strong>LuaFileSystem</strong></big></div>
+ <div id="product_description">File System Library for the Lua Programming Language</div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+<h1>LuaFileSystem</h1>
+ <ul>
+ <li><a href="index.html">Home</a>
+ <ul>
+ <li><a href="index.html#overview">Overview</a></li>
+ <li><a href="index.html#status">Status</a></li>
+ <li><a href="index.html#download">Download</a></li>
+ <li><a href="index.html#history">History</a></li>
+ <li><a href="index.html#credits">Credits</a></li>
+ <li><a href="index.html#contact">Contact us</a></li>
+ </ul>
+ </li>
+ <li><strong>Manual</strong>
+ <ul>
+ <li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
+ <li><a href="manual.html#installation">Installation</a></li>
+ <li><a href="manual.html#reference">Reference</a></li>
+ </ul>
+ </li>
+ <li><a href="examples.html">Examples</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
+ <ul>
+ <li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
+ <li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
+ </ul>
+ </li>
+ <li><a href="license.html">License</a></li>
+ </ul>
+</div> <!-- id="navigation" -->
+
+<div id="content">
+
+<h2><a name="introduction"></a>Introduction</h2>
+
+<p>LuaFileSystem is a <a href="http://www.lua.org">Lua</a> library
+developed to complement the set of functions related to file
+systems offered by the standard Lua distribution.</p>
+
+<p>LuaFileSystem offers a portable way to access
+the underlying directory structure and file attributes.</p>
+
+<h2><a name="building"></a>Building</h2>
+
+<p>
+LuaFileSystem should be built with Lua 5.1 so the language library
+and header files for the target version must be installed properly.
+</p>
+
+<p>
+LuaFileSystem offers a Makefile and a separate configuration file,
+<code>config</code>,
+which should be edited to suit your installation before running
+<code>make</code>.
+The file has some definitions like paths to the external libraries,
+compiler options and the like.
+</p>
+
+<p>On Windows, the C runtime used to compile LuaFileSystem must be the same
+runtime that Lua uses, or some LuaFileSystem functions will not work.</p>
+
+<h2><a name="installation"></a>Installation</h2>
+
+<p>The easiest way to install LuaFileSystem is to use LuaRocks:</p>
+
+<pre class="example">
+luarocks install luafilesystem
+</pre>
+
+<p>If you prefer to install LuaFileSystem manually, the compiled binary should be copied to a directory in your
+<a href="http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath">C path</a>.</p>
+
+<h2><a name="reference"></a>Reference</h2>
+
+<p>
+LuaFileSystem offers the following functions:
+</p>
+
+<dl class="reference">
+ <dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, aname])</code></strong></dt>
+ <dd>Returns a table with the file attributes corresponding to
+ <code>filepath</code> (or <code>nil</code> followed by an error message
+ in case of error).
+ If the second optional argument is given, then only the value of the
+ named attribute is returned (this use is equivalent to
+ <code>lfs.attributes(filepath).aname</code>, but the table is not created
+ and only one attribute is retrieved from the O.S.).
+ The attributes are described as follows;
+ attribute <code>mode</code> is a string, all the others are numbers,
+ and the time related attributes use the same time reference of
+ <a href="http://www.lua.org/manual/5.1/manual.html#pdf-os.time"><code>os.time</code></a>:
+ <dl>
+ <dt><strong><code>dev</code></strong></dt>
+ <dd>on Unix systems, this represents the device that the inode resides on. On Windows systems,
+ represents the drive number of the disk containing the file</dd>
+
+ <dt><strong><code>ino</code></strong></dt>
+ <dd>on Unix systems, this represents the inode number. On Windows systems this has no meaning</dd>
+
+ <dt><strong><code>mode</code></strong></dt>
+ <dd>string representing the associated protection mode (the values could be
+ <code>file</code>, <code>directory</code>, <code>link</code>, <code>socket</code>,
+ <code>named pipe</code>, <code>char device</code>, <code>block device</code> or
+ <code>other</code>)</dd>
+
+ <dt><strong><code>nlink</code></strong></dt>
+ <dd>number of hard links to the file</dd>
+
+ <dt><strong><code>uid</code></strong></dt>
+ <dd>user-id of owner (Unix only, always 0 on Windows)</dd>
+
+ <dt><strong><code>gid</code></strong></dt>
+ <dd>group-id of owner (Unix only, always 0 on Windows)</dd>
+
+ <dt><strong><code>rdev</code></strong></dt>
+ <dd>on Unix systems, represents the device type, for special file inodes.
+ On Windows systems represents the same as <code>dev</code></dd>
+
+ <dt><strong><code>access</code></strong></dt>
+ <dd>time of last access</dd>
+
+ <dt><strong><code>modification</code></strong></dt>
+ <dd>time of last data modification</dd>
+
+ <dt><strong><code>change</code></strong></dt>
+ <dd>time of last file status change</dd>
+
+ <dt><strong><code>size</code></strong></dt>
+ <dd>file size, in bytes</dd>
+
+ <dt><strong><code>blocks</code></strong></dt>
+ <dd>block allocated for file; (Unix only)</dd>
+
+ <dt><strong><code>blksize</code></strong></dt>
+ <dd>optimal file system I/O blocksize; (Unix only)</dd>
+ </dl>
+ This function uses <code>stat</code> internally thus if the given
+ <code>filepath</code> is a symbolic link, it is followed (if it points to
+ another link the chain is followed recursively) and the information
+ is about the file it refers to.
+ To obtain information about the link itself, see function
+ <a href="#symlinkattributes">lfs.symlinkattributes</a>.
+ </dd>
+
+ <dt><a name="chdir"></a><strong><code>lfs.chdir (path)</code></strong></dt>
+ <dd>Changes the current working directory to the given
+ <code>path</code>.<br />
+ Returns <code>true</code> in case of success or <code>nil</code> plus an
+ error string.</dd>
+
+ <dt><a name="chdir"></a><strong><code>lfs.lock_dir(path, [seconds_stale])</code></strong></dt>
+ <dd>Creates a lockfile (called lockfile.lfs) in <code>path</code> if it does not
+ exist and returns the lock. If the lock already exists checks if
+ it's stale, using the second parameter (default for the second
+ parameter is <code>INT_MAX</code>, which in practice means the lock will never
+ be stale. To free the the lock call <code>lock:free()</code>. <br/>
+ In case of any errors it returns nil and the error message. In
+ particular, if the lock exists and is not stale it returns the
+ "File exists" message.</dd>
+
+ <dt><a name="getcwd"></a><strong><code>lfs.currentdir ()</code></strong></dt>
+ <dd>Returns a string with the current working directory or <code>nil</code>
+ plus an error string.</dd>
+
+ <dt><a name="dir"></a><strong><code>iter, dir_obj = lfs.dir (path)</code></strong></dt>
+ <dd>
+ Lua iterator over the entries of a given directory.
+ Each time the iterator is called with <code>dir_obj</code> it returns a directory entry's name as a string, or
+ <code>nil</code> if there are no more entries. You can also iterate by calling <code>dir_obj:next()</code>, and
+ explicitly close the directory before the iteration finished with <code>dir_obj:close()</code>.
+ Raises an error if <code>path</code> is not a directory.
+ </dd>
+
+ <dt><a name="lock"></a><strong><code>lfs.lock (filehandle, mode[, start[, length]])</code></strong></dt>
+ <dd>Locks a file or a part of it. This function works on <em>open files</em>; the
+ file handle should be specified as the first argument.
+ The string <code>mode</code> could be either
+ <code>r</code> (for a read/shared lock) or <code>w</code> (for a
+ write/exclusive lock). The optional arguments <code>start</code>
+ and <code>length</code> can be used to specify a starting point and
+ its length; both should be numbers.<br />
+ Returns <code>true</code> if the operation was successful; in
+ case of error, it returns <code>nil</code> plus an error string.
+ </dd>
+
+ <dt><a name="link"></a><strong><code>lfs.link (old, new[, symlink])</code></strong></dt>
+ <dd>Creates a link. The first argument is the object to link to
+ and the second is the name of the link. If the optional third
+ argument is true, the link will by a symbolic link (by default, a
+ hard link is created).
+ </dd>
+
+ <dt><a name="mkdir"></a><strong><code>lfs.mkdir (dirname)</code></strong></dt>
+ <dd>Creates a new directory. The argument is the name of the new
+ directory.<br />
+ Returns <code>true</code> if the operation was successful;
+ in case of error, it returns <code>nil</code> plus an error string.
+ </dd>
+
+ <dt><a name="rmdir"></a><strong><code>lfs.rmdir (dirname)</code></strong></dt>
+ <dd>Removes an existing directory. The argument is the name of the directory.<br />
+ Returns <code>true</code> if the operation was successful;
+ in case of error, it returns <code>nil</code> plus an error string.</dd>
+
+ <dt><a name="setmode"></a><strong><code>lfs.setmode (file, mode)</code></strong></dt>
+ <dd>Sets the writing mode for a file. The mode string can be either <code>"binary"</code> or <code>"text"</code>.
+ Returns <code>true</code> followed the previous mode string for the file, or
+ <code>nil</code> followed by an error string in case of errors.
+ On non-Windows platforms, where the two modes are identical,
+ setting the mode has no effect, and the mode is always returned as <code>binary</code>.
+ </dd>
+
+ <dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt>
+ <dd>Identical to <a href="#attributes">lfs.attributes</a> except that
+ it obtains information about the link itself (not the file it refers to).
+ On Windows this function does not yet support links, and is identical to
+ <code>lfs.attributes</code>.
+ </dd>
+
+ <dt><a name="touch"></a><strong><code>lfs.touch (filepath [, atime [, mtime]])</code></strong></dt>
+ <dd>Set access and modification times of a file. This function is
+ a bind to <code>utime</code> function. The first argument is the
+ filename, the second argument (<code>atime</code>) is the access time,
+ and the third argument (<code>mtime</code>) is the modification time.
+ Both times are provided in seconds (which should be generated with
+ Lua standard function <code>os.time</code>).
+ If the modification time is omitted, the access time provided is used;
+ if both times are omitted, the current time is used.<br />
+ Returns <code>true</code> if the operation was successful;
+ in case of error, it returns <code>nil</code> plus an error string.
+ </dd>
+
+ <dt><a name="unlock"></a><strong><code>lfs.unlock (filehandle[, start[, length]])</code></strong></dt>
+ <dd>Unlocks a file or a part of it. This function works on
+ <em>open files</em>; the file handle should be specified as the first
+ argument. The optional arguments <code>start</code> and
+ <code>length</code> can be used to specify a starting point and its
+ length; both should be numbers.<br />
+ Returns <code>true</code> if the operation was successful;
+ in case of error, it returns <code>nil</code> plus an error string.
+ </dd>
+</dl>
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: manual.html,v 1.45 2009/06/03 20:53:55 mascarenhas Exp $</small></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->
+
+</body>
+</html>
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.3.0-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.3.0-1.rockspec
new file mode 100644
index 00000000000..d4d484f68a7
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.3.0-1.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+version = "1.3.0-1"
+source = {
+ url = "http://luaforge.net/frs/download.php/2679/luafilesystem-1.3.0.tar.gz"
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ type = "make",
+ build_variables = {
+ LUA_INC = "$(LUA_INCDIR)",
+ LIB_OPTION = "$(LIBFLAG)"
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)"
+ }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-1.rockspec
new file mode 100644
index 00000000000..b6936182394
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-1.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+version = "1.4.0-1"
+source = {
+ url = "http://luaforge.net/frs/download.php/3158/luafilesystem-1.4.0.tar.gz"
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ type = "make",
+ build_variables = {
+ LUA_INC = "$(LUA_INCDIR)",
+ LIB_OPTION = "$(LIBFLAG)"
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)"
+ }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-2.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-2.rockspec
new file mode 100644
index 00000000000..f7ed871527f
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.0-2.rockspec
@@ -0,0 +1,43 @@
+package = "LuaFileSystem"
+version = "1.4.0-2"
+source = {
+ url = "http://luaforge.net/frs/download.php/3158/luafilesystem-1.4.0.tar.gz"
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ platforms = {
+ unix = {
+ type = "make",
+ build_variables = {
+ LIB_OPTION = "$(LIBFLAG)",
+ CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)"
+ }
+ },
+ win32 = {
+ type = "make",
+ build_variables = {
+ LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
+ CFLAGS = "/MD $(CFLAGS) /I$(LUA_INCDIR)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)",
+ LUA_DIR = "$(LUADIR)",
+ BIN_DIR = "$(BINDIR)"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1-1.rockspec
new file mode 100644
index 00000000000..db3a3ebb6df
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1-1.rockspec
@@ -0,0 +1,43 @@
+package = "LuaFileSystem"
+version = "1.4.1-1"
+source = {
+ url = "http://luaforge.net/frs/download.php/3345/luafilesystem-1.4.1.tar.gz",
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ platforms = {
+ unix = {
+ type = "make",
+ build_variables = {
+ LIB_OPTION = "$(LIBFLAG)",
+ CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR) $(STAT64)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)"
+ }
+ },
+ win32 = {
+ type = "make",
+ build_variables = {
+ LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
+ CFLAGS = "/MD $(CFLAGS) /I$(LUA_INCDIR)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)",
+ LUA_DIR = "$(LUADIR)",
+ BIN_DIR = "$(BINDIR)"
+ }
+ }
+ }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1rc1-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1rc1-1.rockspec
new file mode 100644
index 00000000000..1194711715b
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.1rc1-1.rockspec
@@ -0,0 +1,43 @@
+package = "LuaFileSystem"
+version = "1.4.1rc1-1"
+source = {
+ url = "http://luafilesystem.luaforge.net/luafilesystem-1.4.1rc1.tar.gz",
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ platforms = {
+ unix = {
+ type = "make",
+ build_variables = {
+ LIB_OPTION = "$(LIBFLAG)",
+ CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR) $(STAT64)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)"
+ }
+ },
+ win32 = {
+ type = "make",
+ build_variables = {
+ LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
+ CFLAGS = "/MD $(CFLAGS) /I$(LUA_INCDIR)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)",
+ LUA_DIR = "$(LUADIR)",
+ BIN_DIR = "$(BINDIR)"
+ }
+ }
+ }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.2-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.2-1.rockspec
new file mode 100644
index 00000000000..7cfe92b78ef
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.4.2-1.rockspec
@@ -0,0 +1,26 @@
+package = "LuaFileSystem"
+
+version = "1.4.2-1"
+
+source = {
+ url = "http://luaforge.net/frs/download.php/3931/luafilesystem-1.4.2.tar.gz",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = "module",
+ modules = { lfs = "src/lfs.c" }
+} \ No newline at end of file
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.5.0-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.5.0-1.rockspec
new file mode 100644
index 00000000000..1170ad25c90
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.5.0-1.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+
+version = "1.5.0-1"
+
+source = {
+ url = "http://cloud.github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.5.0.tar.gz",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = "module",
+ modules = { lfs = "src/lfs.c" },
+ copy_directories = { "doc", "tests" }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.0-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.0-1.rockspec
new file mode 100644
index 00000000000..82d349cf016
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.0-1.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+
+version = "1.6.0-1"
+
+source = {
+ url = "https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.6.0.tar.gz",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = "builtin",
+ modules = { lfs = "src/lfs.c" },
+ copy_directories = { "doc", "tests" }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.1-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.1-1.rockspec
new file mode 100644
index 00000000000..7f45e332c44
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.1-1.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+
+version = "1.6.1-1"
+
+source = {
+ url = "https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.6.1.tar.gz",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = "builtin",
+ modules = { lfs = "src/lfs.c" },
+ copy_directories = { "doc", "tests" }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.2-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.2-1.rockspec
new file mode 100644
index 00000000000..1c11efc89e1
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.2-1.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+
+version = "1.6.2-1"
+
+source = {
+ url = "https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.6.2.tar.gz",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = "builtin",
+ modules = { lfs = "src/lfs.c" },
+ copy_directories = { "doc", "tests" }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.3-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.3-1.rockspec
new file mode 100644
index 00000000000..89b25d42fe3
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-1.6.3-1.rockspec
@@ -0,0 +1,28 @@
+package = "LuaFileSystem"
+version = "1.6.3-1"
+source = {
+ url = "git://github.com/keplerproject/luafilesystem",
+ tag = "v_1_6_3",
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]],
+ license = "MIT/X11",
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ type = "builtin",
+ modules = {
+ lfs = "src/lfs.c"
+ },
+ copy_directories = {
+ "doc", "tests"
+ }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-1.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-1.rockspec
new file mode 100644
index 00000000000..a02d4f14e71
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-1.rockspec
@@ -0,0 +1,44 @@
+package = "LuaFileSystem"
+version = "cvs-1"
+source = {
+ url = "cvs://:pserver:anonymous:@cvs.luaforge.net:/cvsroot/luafilesystem",
+ cvs_tag = "HEAD"
+}
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+dependencies = {
+ "lua >= 5.1"
+}
+build = {
+ platforms = {
+ unix = {
+ type = "make",
+ build_variables = {
+ LIB_OPTION = "$(LIBFLAG)",
+ CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)"
+ }
+ },
+ win32 = {
+ type = "make",
+ build_variables = {
+ LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
+ CFLAGS = "$(CFLAGS) /I$(LUA_INCDIR)",
+ },
+ install_variables = {
+ LUA_LIBDIR = "$(LIBDIR)",
+ LUA_DIR = "$(LUADIR)",
+ BIN_DIR = "$(BINDIR)"
+ }
+ }
+ }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-2.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-2.rockspec
new file mode 100644
index 00000000000..651c7cf1317
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-2.rockspec
@@ -0,0 +1,26 @@
+package = "LuaFileSystem"
+
+version = "cvs-2"
+
+source = {
+ url = "git://github.com/keplerproject/luafilesystem.git",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = "module",
+ modules = { lfs = "src/lfs.c" }
+}
diff --git a/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-3.rockspec b/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-3.rockspec
new file mode 100644
index 00000000000..a4388cd7619
--- /dev/null
+++ b/3rdparty/luafilesystem/rockspecs/luafilesystem-cvs-3.rockspec
@@ -0,0 +1,27 @@
+package = "LuaFileSystem"
+
+version = "cvs-3"
+
+source = {
+ url = "git://github.com/keplerproject/luafilesystem.git",
+}
+
+description = {
+ summary = "File System Library for the Lua Programming Language",
+ detailed = [[
+ LuaFileSystem is a Lua library developed to complement the set of
+ functions related to file systems offered by the standard Lua
+ distribution. LuaFileSystem offers a portable way to access the
+ underlying directory structure and file attributes.
+ ]]
+}
+
+dependencies = {
+ "lua >= 5.1, < 5.4"
+}
+
+build = {
+ type = "builtin",
+ modules = { lfs = "src/lfs.c" },
+ copy_directories = { "doc", "tests" }
+}
diff --git a/3rdparty/luafilesystem/src/.gitignore b/3rdparty/luafilesystem/src/.gitignore
new file mode 100644
index 00000000000..9d22eb46a9c
--- /dev/null
+++ b/3rdparty/luafilesystem/src/.gitignore
@@ -0,0 +1,2 @@
+*.o
+*.so
diff --git a/3rdparty/luafilesystem/src/lfs.c b/3rdparty/luafilesystem/src/lfs.c
new file mode 100644
index 00000000000..ac483fa067b
--- /dev/null
+++ b/3rdparty/luafilesystem/src/lfs.c
@@ -0,0 +1,906 @@
+/*
+** LuaFileSystem
+** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
+**
+** File system manipulation library.
+** This library offers these functions:
+** lfs.attributes (filepath [, attributename])
+** lfs.chdir (path)
+** lfs.currentdir ()
+** lfs.dir (path)
+** lfs.lock (fh, mode)
+** lfs.lock_dir (path)
+** lfs.mkdir (path)
+** lfs.rmdir (path)
+** lfs.setmode (filepath, mode)
+** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts
+** lfs.touch (filepath [, atime [, mtime]])
+** lfs.unlock (fh)
+**
+** $Id: lfs.c,v 1.61 2009/07/04 02:10:16 mascarenhas Exp $
+*/
+
+#ifndef LFS_DO_NOT_USE_LARGE_FILE
+#ifndef _WIN32
+#ifndef _AIX
+#define _FILE_OFFSET_BITS 64 /* Linux, Solaris and HP-UX */
+#else
+#define _LARGE_FILES 1 /* AIX */
+#endif
+#endif
+#endif
+
+#ifndef LFS_DO_NOT_USE_LARGE_FILE
+#define _LARGEFILE64_SOURCE
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+#include <direct.h>
+#include <windows.h>
+#include <io.h>
+#include <sys/locking.h>
+#ifdef __BORLANDC__
+ #include <utime.h>
+#else
+ #include <sys/utime.h>
+#endif
+#include <fcntl.h>
+#else
+#include <unistd.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <utime.h>
+#endif
+
+#include <lua.h>
+#include <lauxlib.h>
+#include <lualib.h>
+
+#include "lfs.h"
+
+#define LFS_VERSION "1.6.3"
+#define LFS_LIBNAME "lfs"
+
+#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
+
+#ifndef luaL_optlong
+#define luaL_optlong luaL_optinteger
+#endif
+
+#endif
+
+#if LUA_VERSION_NUM < 502
+# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
+#endif
+
+/* Define 'strerror' for systems that do not implement it */
+#ifdef NO_STRERROR
+#define strerror(_) "System unable to describe the error"
+#endif
+
+/* Define 'getcwd' for systems that do not implement it */
+#ifdef NO_GETCWD
+#define getcwd(p,s) NULL
+#define getcwd_error "Function 'getcwd' not provided by system"
+#else
+#define getcwd_error strerror(errno)
+ #ifdef _WIN32
+ /* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */
+ #define LFS_MAXPATHLEN MAX_PATH
+ #else
+ /* For MAXPATHLEN: */
+ #include <sys/param.h>
+ #define LFS_MAXPATHLEN MAXPATHLEN
+ #endif
+#endif
+
+#define DIR_METATABLE "directory metatable"
+typedef struct dir_data {
+ int closed;
+#ifdef _WIN32
+ intptr_t hFile;
+ char pattern[MAX_PATH+1];
+#else
+ DIR *dir;
+#endif
+} dir_data;
+
+#define LOCK_METATABLE "lock metatable"
+
+#ifdef _WIN32
+ #ifdef __BORLANDC__
+ #define lfs_setmode(L,file,m) ((void)L, setmode(_fileno(file), m))
+ #define STAT_STRUCT struct stati64
+ #else
+ #define lfs_setmode(L,file,m) ((void)L, _setmode(_fileno(file), m))
+ #define STAT_STRUCT struct _stati64
+ #endif
+#define STAT_FUNC _stati64
+#define LSTAT_FUNC STAT_FUNC
+#else
+#define _O_TEXT 0
+#define _O_BINARY 0
+#define lfs_setmode(L,file,m) ((void)L, (void)file, (void)m, 0)
+#define STAT_STRUCT struct stat
+#define STAT_FUNC stat
+#define LSTAT_FUNC lstat
+#endif
+
+/*
+** Utility functions
+*/
+static int pusherror(lua_State *L, const char *info)
+{
+ lua_pushnil(L);
+ if (info==NULL)
+ lua_pushstring(L, strerror(errno));
+ else
+ lua_pushfstring(L, "%s: %s", info, strerror(errno));
+ lua_pushinteger(L, errno);
+ return 3;
+}
+
+#ifndef _WIN32
+static int pushresult(lua_State *L, int i, const char *info)
+{
+ if (i==-1)
+ return pusherror(L, info);
+ lua_pushinteger(L, i);
+ return 1;
+}
+#endif
+/*
+** This function changes the working (current) directory
+*/
+static int change_dir (lua_State *L) {
+ const char *path = luaL_checkstring(L, 1);
+ if (chdir(path)) {
+ lua_pushnil (L);
+ lua_pushfstring (L,"Unable to change working directory to '%s'\n%s\n",
+ path, chdir_error);
+ return 2;
+ } else {
+ lua_pushboolean (L, 1);
+ return 1;
+ }
+}
+
+/*
+** This function returns the current directory
+** If unable to get the current directory, it returns nil
+** and a string describing the error
+*/
+static int get_dir (lua_State *L) {
+ char *path;
+ /* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */
+ char buf[LFS_MAXPATHLEN];
+ if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) {
+ lua_pushnil(L);
+ lua_pushstring(L, getcwd_error);
+ return 2;
+ }
+ else {
+ lua_pushstring(L, path);
+ return 1;
+ }
+}
+
+/*
+** Check if the given element on the stack is a file and returns it.
+*/
+static FILE *check_file (lua_State *L, int idx, const char *funcname) {
+#if LUA_VERSION_NUM == 501
+ FILE **fh = (FILE **)luaL_checkudata (L, idx, "FILE*");
+ if (*fh == NULL) {
+ luaL_error (L, "%s: closed file", funcname);
+ return 0;
+ } else
+ return *fh;
+#elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 503
+ luaL_Stream *fh = (luaL_Stream *)luaL_checkudata (L, idx, "FILE*");
+ if (fh->closef == 0 || fh->f == NULL) {
+ luaL_error (L, "%s: closed file", funcname);
+ return 0;
+ } else
+ return fh->f;
+#else
+#error unsupported Lua version
+#endif
+}
+
+
+/*
+**
+*/
+static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long start, long len, const char *funcname) {
+ int code;
+#ifdef _WIN32
+ /* lkmode valid values are:
+ LK_LOCK Locks the specified bytes. If the bytes cannot be locked, the program immediately tries again after 1 second. If, after 10 attempts, the bytes cannot be locked, the constant returns an error.
+ LK_NBLCK Locks the specified bytes. If the bytes cannot be locked, the constant returns an error.
+ LK_NBRLCK Same as _LK_NBLCK.
+ LK_RLCK Same as _LK_LOCK.
+ LK_UNLCK Unlocks the specified bytes, which must have been previously locked.
+
+ Regions should be locked only briefly and should be unlocked before closing a file or exiting the program.
+
+ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__locking.asp
+ */
+ int lkmode;
+ switch (*mode) {
+ case 'r': lkmode = LK_NBLCK; break;
+ case 'w': lkmode = LK_NBLCK; break;
+ case 'u': lkmode = LK_UNLCK; break;
+ default : return luaL_error (L, "%s: invalid mode", funcname);
+ }
+ if (!len) {
+ fseek (fh, 0L, SEEK_END);
+ len = ftell (fh);
+ }
+ fseek (fh, start, SEEK_SET);
+#ifdef __BORLANDC__
+ code = locking (fileno(fh), lkmode, len);
+#else
+ code = _locking (fileno(fh), lkmode, len);
+#endif
+#else
+ struct flock f;
+ switch (*mode) {
+ case 'w': f.l_type = F_WRLCK; break;
+ case 'r': f.l_type = F_RDLCK; break;
+ case 'u': f.l_type = F_UNLCK; break;
+ default : return luaL_error (L, "%s: invalid mode", funcname);
+ }
+ f.l_whence = SEEK_SET;
+ f.l_start = (off_t)start;
+ f.l_len = (off_t)len;
+ code = fcntl (fileno(fh), F_SETLK, &f);
+#endif
+ return (code != -1);
+}
+
+#ifdef _WIN32
+typedef struct lfs_Lock {
+ HANDLE fd;
+} lfs_Lock;
+static int lfs_lock_dir(lua_State *L) {
+ size_t pathl; HANDLE fd;
+ lfs_Lock *lock;
+ char *ln;
+ const char *lockfile = "/lockfile.lfs";
+ const char *path = luaL_checklstring(L, 1, &pathl);
+ ln = (char*)malloc(pathl + strlen(lockfile) + 1);
+ if(!ln) {
+ lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;
+ }
+ strcpy(ln, path); strcat(ln, lockfile);
+ if((fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_NEW,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL)) == INVALID_HANDLE_VALUE) {
+ int en = GetLastError();
+ free(ln); lua_pushnil(L);
+ if(en == ERROR_FILE_EXISTS || en == ERROR_SHARING_VIOLATION)
+ lua_pushstring(L, "File exists");
+ else
+ lua_pushstring(L, strerror(en));
+ return 2;
+ }
+ free(ln);
+ lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock));
+ lock->fd = fd;
+ luaL_getmetatable (L, LOCK_METATABLE);
+ lua_setmetatable (L, -2);
+ return 1;
+}
+static int lfs_unlock_dir(lua_State *L) {
+ lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);
+ if(lock->fd != INVALID_HANDLE_VALUE) {
+ CloseHandle(lock->fd);
+ lock->fd=INVALID_HANDLE_VALUE;
+ }
+ return 0;
+}
+#else
+typedef struct lfs_Lock {
+ char *ln;
+} lfs_Lock;
+static int lfs_lock_dir(lua_State *L) {
+ lfs_Lock *lock;
+ size_t pathl;
+ char *ln;
+ const char *lockfile = "/lockfile.lfs";
+ const char *path = luaL_checklstring(L, 1, &pathl);
+ lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock));
+ ln = (char*)malloc(pathl + strlen(lockfile) + 1);
+ if(!ln) {
+ lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;
+ }
+ strcpy(ln, path); strcat(ln, lockfile);
+ if(symlink("lock", ln) == -1) {
+ free(ln); lua_pushnil(L);
+ lua_pushstring(L, strerror(errno)); return 2;
+ }
+ lock->ln = ln;
+ luaL_getmetatable (L, LOCK_METATABLE);
+ lua_setmetatable (L, -2);
+ return 1;
+}
+static int lfs_unlock_dir(lua_State *L) {
+ lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);
+ if(lock->ln) {
+ unlink(lock->ln);
+ free(lock->ln);
+ lock->ln = NULL;
+ }
+ return 0;
+}
+#endif
+
+static int lfs_g_setmode (lua_State *L, FILE *f, int arg) {
+ static const int mode[] = {_O_BINARY, _O_TEXT};
+ static const char *const modenames[] = {"binary", "text", NULL};
+ int op = luaL_checkoption(L, arg, NULL, modenames);
+ int res = lfs_setmode(L, f, mode[op]);
+ if (res != -1) {
+ int i;
+ lua_pushboolean(L, 1);
+ for (i = 0; modenames[i] != NULL; i++) {
+ if (mode[i] == res) {
+ lua_pushstring(L, modenames[i]);
+ goto exit;
+ }
+ }
+ lua_pushnil(L);
+ exit:
+ return 2;
+ } else {
+ int en = errno;
+ lua_pushnil(L);
+ lua_pushfstring(L, "%s", strerror(en));
+ lua_pushinteger(L, en);
+ return 3;
+ }
+}
+
+static int lfs_f_setmode(lua_State *L) {
+ return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2);
+}
+
+/*
+** Locks a file.
+** @param #1 File handle.
+** @param #2 String with lock mode ('w'rite, 'r'ead).
+** @param #3 Number with start position (optional).
+** @param #4 Number with length (optional).
+*/
+static int file_lock (lua_State *L) {
+ FILE *fh = check_file (L, 1, "lock");
+ const char *mode = luaL_checkstring (L, 2);
+ const long start = (long) luaL_optinteger (L, 3, 0);
+ long len = (long) luaL_optinteger (L, 4, 0);
+ if (_file_lock (L, fh, mode, start, len, "lock")) {
+ lua_pushboolean (L, 1);
+ return 1;
+ } else {
+ lua_pushnil (L);
+ lua_pushfstring (L, "%s", strerror(errno));
+ return 2;
+ }
+}
+
+
+/*
+** Unlocks a file.
+** @param #1 File handle.
+** @param #2 Number with start position (optional).
+** @param #3 Number with length (optional).
+*/
+static int file_unlock (lua_State *L) {
+ FILE *fh = check_file (L, 1, "unlock");
+ const long start = (long) luaL_optinteger (L, 2, 0);
+ long len = (long) luaL_optinteger (L, 3, 0);
+ if (_file_lock (L, fh, "u", start, len, "unlock")) {
+ lua_pushboolean (L, 1);
+ return 1;
+ } else {
+ lua_pushnil (L);
+ lua_pushfstring (L, "%s", strerror(errno));
+ return 2;
+ }
+}
+
+
+/*
+** Creates a link.
+** @param #1 Object to link to.
+** @param #2 Name of link.
+** @param #3 True if link is symbolic (optional).
+*/
+static int make_link(lua_State *L)
+{
+#ifndef _WIN32
+ const char *oldpath = luaL_checkstring(L, 1);
+ const char *newpath = luaL_checkstring(L, 2);
+ return pushresult(L,
+ (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL);
+#else
+ return pusherror(L, "make_link is not supported on Windows");
+#endif
+}
+
+
+/*
+** Creates a directory.
+** @param #1 Directory path.
+*/
+static int make_dir (lua_State *L) {
+ const char *path = luaL_checkstring (L, 1);
+ int fail;
+#ifdef _WIN32
+ fail = _mkdir (path);
+#else
+ fail = mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
+ S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );
+#endif
+ if (fail) {
+ lua_pushnil (L);
+ lua_pushfstring (L, "%s", strerror(errno));
+ return 2;
+ }
+ lua_pushboolean (L, 1);
+ return 1;
+}
+
+
+/*
+** Removes a directory.
+** @param #1 Directory path.
+*/
+static int remove_dir (lua_State *L) {
+ const char *path = luaL_checkstring (L, 1);
+ int fail;
+
+ fail = rmdir (path);
+
+ if (fail) {
+ lua_pushnil (L);
+ lua_pushfstring (L, "%s", strerror(errno));
+ return 2;
+ }
+ lua_pushboolean (L, 1);
+ return 1;
+}
+
+
+/*
+** Directory iterator
+*/
+static int dir_iter (lua_State *L) {
+#ifdef _WIN32
+ struct _finddata_t c_file;
+#else
+ struct dirent *entry;
+#endif
+ dir_data *d = (dir_data *)luaL_checkudata (L, 1, DIR_METATABLE);
+ luaL_argcheck (L, d->closed == 0, 1, "closed directory");
+#ifdef _WIN32
+ if (d->hFile == 0L) { /* first entry */
+ if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) {
+ lua_pushnil (L);
+ lua_pushstring (L, strerror (errno));
+ d->closed = 1;
+ return 2;
+ } else {
+ lua_pushstring (L, c_file.name);
+ return 1;
+ }
+ } else { /* next entry */
+ if (_findnext (d->hFile, &c_file) == -1L) {
+ /* no more entries => close directory */
+ _findclose (d->hFile);
+ d->closed = 1;
+ return 0;
+ } else {
+ lua_pushstring (L, c_file.name);
+ return 1;
+ }
+ }
+#else
+ if ((entry = readdir (d->dir)) != NULL) {
+ lua_pushstring (L, entry->d_name);
+ return 1;
+ } else {
+ /* no more entries => close directory */
+ closedir (d->dir);
+ d->closed = 1;
+ return 0;
+ }
+#endif
+}
+
+
+/*
+** Closes directory iterators
+*/
+static int dir_close (lua_State *L) {
+ dir_data *d = (dir_data *)lua_touserdata (L, 1);
+#ifdef _WIN32
+ if (!d->closed && d->hFile) {
+ _findclose (d->hFile);
+ }
+#else
+ if (!d->closed && d->dir) {
+ closedir (d->dir);
+ }
+#endif
+ d->closed = 1;
+ return 0;
+}
+
+
+/*
+** Factory of directory iterators
+*/
+static int dir_iter_factory (lua_State *L) {
+ const char *path = luaL_checkstring (L, 1);
+ dir_data *d;
+ lua_pushcfunction (L, dir_iter);
+ d = (dir_data *) lua_newuserdata (L, sizeof(dir_data));
+ luaL_getmetatable (L, DIR_METATABLE);
+ lua_setmetatable (L, -2);
+ d->closed = 0;
+#ifdef _WIN32
+ d->hFile = 0L;
+ if (strlen(path) > MAX_PATH-2)
+ luaL_error (L, "path too long: %s", path);
+ else
+ sprintf (d->pattern, "%s/*", path);
+#else
+ d->dir = opendir (path);
+ if (d->dir == NULL)
+ luaL_error (L, "cannot open %s: %s", path, strerror (errno));
+#endif
+ return 2;
+}
+
+
+/*
+** Creates directory metatable.
+*/
+static int dir_create_meta (lua_State *L) {
+ luaL_newmetatable (L, DIR_METATABLE);
+
+ /* Method table */
+ lua_newtable(L);
+ lua_pushcfunction (L, dir_iter);
+ lua_setfield(L, -2, "next");
+ lua_pushcfunction (L, dir_close);
+ lua_setfield(L, -2, "close");
+
+ /* Metamethods */
+ lua_setfield(L, -2, "__index");
+ lua_pushcfunction (L, dir_close);
+ lua_setfield (L, -2, "__gc");
+ return 1;
+}
+
+
+/*
+** Creates lock metatable.
+*/
+static int lock_create_meta (lua_State *L) {
+ luaL_newmetatable (L, LOCK_METATABLE);
+
+ /* Method table */
+ lua_newtable(L);
+ lua_pushcfunction(L, lfs_unlock_dir);
+ lua_setfield(L, -2, "free");
+
+ /* Metamethods */
+ lua_setfield(L, -2, "__index");
+ lua_pushcfunction(L, lfs_unlock_dir);
+ lua_setfield(L, -2, "__gc");
+ return 1;
+}
+
+
+#ifdef _WIN32
+ #ifndef S_ISDIR
+ #define S_ISDIR(mode) (mode&_S_IFDIR)
+ #endif
+ #ifndef S_ISREG
+ #define S_ISREG(mode) (mode&_S_IFREG)
+ #endif
+ #ifndef S_ISLNK
+ #define S_ISLNK(mode) (0)
+ #endif
+ #ifndef S_ISSOCK
+ #define S_ISSOCK(mode) (0)
+ #endif
+ #ifndef S_ISFIFO
+ #define S_ISFIFO(mode) (0)
+ #endif
+ #ifndef S_ISCHR
+ #define S_ISCHR(mode) (mode&_S_IFCHR)
+ #endif
+ #ifndef S_ISBLK
+ #define S_ISBLK(mode) (0)
+ #endif
+#endif
+/*
+** Convert the inode protection mode to a string.
+*/
+#ifdef _WIN32
+static const char *mode2string (unsigned short mode) {
+#else
+static const char *mode2string (mode_t mode) {
+#endif
+ if ( S_ISREG(mode) )
+ return "file";
+ else if ( S_ISDIR(mode) )
+ return "directory";
+ else if ( S_ISLNK(mode) )
+ return "link";
+ else if ( S_ISSOCK(mode) )
+ return "socket";
+ else if ( S_ISFIFO(mode) )
+ return "named pipe";
+ else if ( S_ISCHR(mode) )
+ return "char device";
+ else if ( S_ISBLK(mode) )
+ return "block device";
+ else
+ return "other";
+}
+
+
+/*
+** Set access time and modification values for file
+*/
+static int file_utime (lua_State *L) {
+ const char *file = luaL_checkstring (L, 1);
+ struct utimbuf utb, *buf;
+
+ if (lua_gettop (L) == 1) /* set to current date/time */
+ buf = NULL;
+ else {
+ utb.actime = luaL_optnumber (L, 2, 0);
+ utb.modtime = (time_t) luaL_optinteger (L, 3, utb.actime);
+ buf = &utb;
+ }
+ if (utime (file, buf)) {
+ lua_pushnil (L);
+ lua_pushfstring (L, "%s", strerror (errno));
+ return 2;
+ }
+ lua_pushboolean (L, 1);
+ return 1;
+}
+
+
+/* inode protection mode */
+static void push_st_mode (lua_State *L, STAT_STRUCT *info) {
+ lua_pushstring (L, mode2string (info->st_mode));
+}
+/* device inode resides on */
+static void push_st_dev (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer) info->st_dev);
+}
+/* inode's number */
+static void push_st_ino (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer) info->st_ino);
+}
+/* number of hard links to the file */
+static void push_st_nlink (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer)info->st_nlink);
+}
+/* user-id of owner */
+static void push_st_uid (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer)info->st_uid);
+}
+/* group-id of owner */
+static void push_st_gid (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer)info->st_gid);
+}
+/* device type, for special file inode */
+static void push_st_rdev (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer) info->st_rdev);
+}
+/* time of last access */
+static void push_st_atime (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer) info->st_atime);
+}
+/* time of last data modification */
+static void push_st_mtime (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer) info->st_mtime);
+}
+/* time of last file status change */
+static void push_st_ctime (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer) info->st_ctime);
+}
+/* file size, in bytes */
+static void push_st_size (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer)info->st_size);
+}
+#ifndef _WIN32
+/* blocks allocated for file */
+static void push_st_blocks (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer)info->st_blocks);
+}
+/* optimal file system I/O blocksize */
+static void push_st_blksize (lua_State *L, STAT_STRUCT *info) {
+ lua_pushinteger (L, (lua_Integer)info->st_blksize);
+}
+#endif
+
+ /*
+** Convert the inode protection mode to a permission list.
+*/
+
+#ifdef _WIN32
+static const char *perm2string (unsigned short mode) {
+ static char perms[10] = "---------";
+ int i;
+ for (i=0;i<9;i++) perms[i]='-';
+ if (mode & _S_IREAD)
+ { perms[0] = 'r'; perms[3] = 'r'; perms[6] = 'r'; }
+ if (mode & _S_IWRITE)
+ { perms[1] = 'w'; perms[4] = 'w'; perms[7] = 'w'; }
+ if (mode & _S_IEXEC)
+ { perms[2] = 'x'; perms[5] = 'x'; perms[8] = 'x'; }
+ return perms;
+}
+#else
+static const char *perm2string (mode_t mode) {
+ static char perms[10] = "---------";
+ int i;
+ for (i=0;i<9;i++) perms[i]='-';
+ if (mode & S_IRUSR) perms[0] = 'r';
+ if (mode & S_IWUSR) perms[1] = 'w';
+ if (mode & S_IXUSR) perms[2] = 'x';
+ if (mode & S_IRGRP) perms[3] = 'r';
+ if (mode & S_IWGRP) perms[4] = 'w';
+ if (mode & S_IXGRP) perms[5] = 'x';
+ if (mode & S_IROTH) perms[6] = 'r';
+ if (mode & S_IWOTH) perms[7] = 'w';
+ if (mode & S_IXOTH) perms[8] = 'x';
+ return perms;
+}
+#endif
+
+/* permssions string */
+static void push_st_perm (lua_State *L, STAT_STRUCT *info) {
+ lua_pushstring (L, perm2string (info->st_mode));
+}
+
+typedef void (*_push_function) (lua_State *L, STAT_STRUCT *info);
+
+struct _stat_members {
+ const char *name;
+ _push_function push;
+};
+
+struct _stat_members members[] = {
+ { "mode", push_st_mode },
+ { "dev", push_st_dev },
+ { "ino", push_st_ino },
+ { "nlink", push_st_nlink },
+ { "uid", push_st_uid },
+ { "gid", push_st_gid },
+ { "rdev", push_st_rdev },
+ { "access", push_st_atime },
+ { "modification", push_st_mtime },
+ { "change", push_st_ctime },
+ { "size", push_st_size },
+ { "permissions", push_st_perm },
+#ifndef _WIN32
+ { "blocks", push_st_blocks },
+ { "blksize", push_st_blksize },
+#endif
+ { NULL, NULL }
+};
+
+/*
+** Get file or symbolic link information
+*/
+static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) {
+ STAT_STRUCT info;
+ const char *file = luaL_checkstring (L, 1);
+ int i;
+
+ if (st(file, &info)) {
+ lua_pushnil (L);
+ lua_pushfstring (L, "cannot obtain information from file `%s'", file);
+ return 2;
+ }
+ if (lua_isstring (L, 2)) {
+ const char *member = lua_tostring (L, 2);
+ for (i = 0; members[i].name; i++) {
+ if (strcmp(members[i].name, member) == 0) {
+ /* push member value and return */
+ members[i].push (L, &info);
+ return 1;
+ }
+ }
+ /* member not found */
+ return luaL_error(L, "invalid attribute name");
+ }
+ /* creates a table if none is given */
+ if (!lua_istable (L, 2)) {
+ lua_newtable (L);
+ }
+ /* stores all members in table on top of the stack */
+ for (i = 0; members[i].name; i++) {
+ lua_pushstring (L, members[i].name);
+ members[i].push (L, &info);
+ lua_rawset (L, -3);
+ }
+ return 1;
+}
+
+
+/*
+** Get file information using stat.
+*/
+static int file_info (lua_State *L) {
+ return _file_info_ (L, STAT_FUNC);
+}
+
+
+/*
+** Get symbolic link information using lstat.
+*/
+static int link_info (lua_State *L) {
+ return _file_info_ (L, LSTAT_FUNC);
+}
+
+
+/*
+** Assumes the table is on top of the stack.
+*/
+static void set_info (lua_State *L) {
+ lua_pushliteral (L, "_COPYRIGHT");
+ lua_pushliteral (L, "Copyright (C) 2003-2012 Kepler Project");
+ lua_settable (L, -3);
+ lua_pushliteral (L, "_DESCRIPTION");
+ lua_pushliteral (L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution");
+ lua_settable (L, -3);
+ lua_pushliteral (L, "_VERSION");
+ lua_pushliteral (L, "LuaFileSystem "LFS_VERSION);
+ lua_settable (L, -3);
+}
+
+
+static const struct luaL_Reg fslib[] = {
+ {"attributes", file_info},
+ {"chdir", change_dir},
+ {"currentdir", get_dir},
+ {"dir", dir_iter_factory},
+ {"link", make_link},
+ {"lock", file_lock},
+ {"mkdir", make_dir},
+ {"rmdir", remove_dir},
+ {"symlinkattributes", link_info},
+ {"setmode", lfs_f_setmode},
+ {"touch", file_utime},
+ {"unlock", file_unlock},
+ {"lock_dir", lfs_lock_dir},
+ {NULL, NULL},
+};
+
+int luaopen_lfs (lua_State *L) {
+ dir_create_meta (L);
+ lock_create_meta (L);
+ luaL_newlib (L, fslib);
+ lua_pushvalue(L, -1);
+ lua_setglobal(L, LFS_LIBNAME);
+ set_info (L);
+ return 1;
+}
diff --git a/3rdparty/luafilesystem/src/lfs.def b/3rdparty/luafilesystem/src/lfs.def
new file mode 100644
index 00000000000..6c782eb6968
--- /dev/null
+++ b/3rdparty/luafilesystem/src/lfs.def
@@ -0,0 +1,4 @@
+LIBRARY lfs.dll
+VERSION 1.6
+EXPORTS
+luaopen_lfs
diff --git a/3rdparty/luafilesystem/src/lfs.h b/3rdparty/luafilesystem/src/lfs.h
new file mode 100644
index 00000000000..ea1720dba75
--- /dev/null
+++ b/3rdparty/luafilesystem/src/lfs.h
@@ -0,0 +1,34 @@
+/*
+** LuaFileSystem
+** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
+**
+** $Id: lfs.h,v 1.5 2008/02/19 20:08:23 mascarenhas Exp $
+*/
+
+/* Define 'chdir' for systems that do not implement it */
+#ifdef NO_CHDIR
+#define chdir(p) (-1)
+#define chdir_error "Function 'chdir' not provided by system"
+#else
+#define chdir_error strerror(errno)
+
+#endif
+
+#ifdef _WIN32
+#define chdir(p) (_chdir(p))
+#define getcwd(d, s) (_getcwd(d, s))
+#define rmdir(p) (_rmdir(p))
+#ifndef fileno
+#define fileno(f) (_fileno(f))
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int luaopen_lfs (lua_State *L);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/luafilesystem/tests/test.lua b/3rdparty/luafilesystem/tests/test.lua
new file mode 100644
index 00000000000..abfbd4d9690
--- /dev/null
+++ b/3rdparty/luafilesystem/tests/test.lua
@@ -0,0 +1,175 @@
+#!/usr/bin/env lua5.1
+
+local tmp = "/tmp"
+local sep = string.match (package.config, "[^\n]+")
+local upper = ".."
+
+local lfs = require"lfs"
+print (lfs._VERSION)
+
+io.write(".")
+io.flush()
+
+function attrdir (path)
+ for file in lfs.dir(path) do
+ if file ~= "." and file ~= ".." then
+ local f = path..sep..file
+ print ("\t=> "..f.." <=")
+ local attr = lfs.attributes (f)
+ assert (type(attr) == "table")
+ if attr.mode == "directory" then
+ attrdir (f)
+ else
+ for name, value in pairs(attr) do
+ print (name, value)
+ end
+ end
+ end
+ end
+end
+
+-- Checking changing directories
+local current = assert (lfs.currentdir())
+local reldir = string.gsub (current, "^.*%"..sep.."([^"..sep.."])$", "%1")
+assert (lfs.chdir (upper), "could not change to upper directory")
+assert (lfs.chdir (reldir), "could not change back to current directory")
+assert (lfs.currentdir() == current, "error trying to change directories")
+assert (lfs.chdir ("this couldn't be an actual directory") == nil, "could change to a non-existent directory")
+
+io.write(".")
+io.flush()
+
+-- Changing creating and removing directories
+local tmpdir = current..sep.."lfs_tmp_dir"
+local tmpfile = tmpdir..sep.."tmp_file"
+-- Test for existence of a previous lfs_tmp_dir
+-- that may have resulted from an interrupted test execution and remove it
+if lfs.chdir (tmpdir) then
+ assert (lfs.chdir (upper), "could not change to upper directory")
+ assert (os.remove (tmpfile), "could not remove file from previous test")
+ assert (lfs.rmdir (tmpdir), "could not remove directory from previous test")
+end
+
+io.write(".")
+io.flush()
+
+-- tries to create a directory
+assert (lfs.mkdir (tmpdir), "could not make a new directory")
+local attrib, errmsg = lfs.attributes (tmpdir)
+if not attrib then
+ error ("could not get attributes of file `"..tmpdir.."':\n"..errmsg)
+end
+local f = io.open(tmpfile, "w")
+f:close()
+
+io.write(".")
+io.flush()
+
+-- Change access time
+local testdate = os.time({ year = 2007, day = 10, month = 2, hour=0})
+assert (lfs.touch (tmpfile, testdate))
+local new_att = assert (lfs.attributes (tmpfile))
+assert (new_att.access == testdate, "could not set access time")
+assert (new_att.modification == testdate, "could not set modification time")
+
+io.write(".")
+io.flush()
+
+-- Change access and modification time
+local testdate1 = os.time({ year = 2007, day = 10, month = 2, hour=0})
+local testdate2 = os.time({ year = 2007, day = 11, month = 2, hour=0})
+
+assert (lfs.touch (tmpfile, testdate2, testdate1))
+local new_att = assert (lfs.attributes (tmpfile))
+assert (new_att.access == testdate2, "could not set access time")
+assert (new_att.modification == testdate1, "could not set modification time")
+
+io.write(".")
+io.flush()
+
+-- Checking link (does not work on Windows)
+if lfs.link (tmpfile, "_a_link_for_test_", true) then
+ assert (lfs.attributes"_a_link_for_test_".mode == "file")
+ assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
+ assert (lfs.link (tmpfile, "_a_hard_link_for_test_"))
+ assert (lfs.attributes (tmpfile, "nlink") == 2)
+ assert (os.remove"_a_link_for_test_")
+ assert (os.remove"_a_hard_link_for_test_")
+end
+
+io.write(".")
+io.flush()
+
+-- Checking text/binary modes (only has an effect in Windows)
+local f = io.open(tmpfile, "w")
+local result, mode = lfs.setmode(f, "binary")
+assert(result) -- on non-Windows platforms, mode is always returned as "binary"
+result, mode = lfs.setmode(f, "text")
+assert(result and mode == "binary")
+f:close()
+
+io.write(".")
+io.flush()
+
+-- Restore access time to current value
+assert (lfs.touch (tmpfile, attrib.access, attrib.modification))
+new_att = assert (lfs.attributes (tmpfile))
+assert (new_att.access == attrib.access)
+assert (new_att.modification == attrib.modification)
+
+io.write(".")
+io.flush()
+
+-- Check consistency of lfs.attributes values
+local attr = lfs.attributes (tmpfile)
+for key, value in pairs(attr) do
+ assert (value == lfs.attributes (tmpfile, key),
+ "lfs.attributes values not consistent")
+end
+
+-- Remove new file and directory
+assert (os.remove (tmpfile), "could not remove new file")
+assert (lfs.rmdir (tmpdir), "could not remove new directory")
+assert (lfs.mkdir (tmpdir..sep.."lfs_tmp_dir") == nil, "could create a directory inside a non-existent one")
+
+io.write(".")
+io.flush()
+
+-- Trying to get attributes of a non-existent file
+assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file")
+assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory")
+
+io.write(".")
+io.flush()
+
+-- Stressing directory iterator
+count = 0
+for i = 1, 4000 do
+ for file in lfs.dir (tmp) do
+ count = count + 1
+ end
+end
+
+io.write(".")
+io.flush()
+
+-- Stressing directory iterator, explicit version
+count = 0
+for i = 1, 4000 do
+ local iter, dir = lfs.dir(tmp)
+ local file = dir:next()
+ while file do
+ count = count + 1
+ file = dir:next()
+ end
+ assert(not pcall(dir.next, dir))
+end
+
+io.write(".")
+io.flush()
+
+-- directory explicit close
+local iter, dir = lfs.dir(tmp)
+dir:close()
+assert(not pcall(dir.next, dir))
+print"Ok!"
diff --git a/3rdparty/luafilesystem/vc6/lfs.def b/3rdparty/luafilesystem/vc6/lfs.def
new file mode 100644
index 00000000000..55ec688d3c3
--- /dev/null
+++ b/3rdparty/luafilesystem/vc6/lfs.def
@@ -0,0 +1,5 @@
+LIBRARY lfs.dll
+DESCRIPTION "LuaFileSystem"
+VERSION 1.2
+EXPORTS
+luaopen_lfs
diff --git a/3rdparty/luafilesystem/vc6/luafilesystem.dsw b/3rdparty/luafilesystem/vc6/luafilesystem.dsw
new file mode 100644
index 00000000000..b4bb4b310f6
--- /dev/null
+++ b/3rdparty/luafilesystem/vc6/luafilesystem.dsw
@@ -0,0 +1,33 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "luafilesystem_dll"=.\luafilesystem_dll.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+ begin source code control
+ luafilesystem
+ ..
+ end source code control
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/3rdparty/luafilesystem/vc6/luafilesystem_dll.dsp b/3rdparty/luafilesystem/vc6/luafilesystem_dll.dsp
new file mode 100644
index 00000000000..efe6c720b6c
--- /dev/null
+++ b/3rdparty/luafilesystem/vc6/luafilesystem_dll.dsp
@@ -0,0 +1,127 @@
+# Microsoft Developer Studio Project File - Name="luafilesystem_dll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=luafilesystem_dll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "luafilesystem_dll.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "luafilesystem_dll.mak" CFG="luafilesystem_dll - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "luafilesystem_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "luafilesystem_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "luafilesystem_dll"
+# PROP Scc_LocalPath ".."
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "luafilesystem_dll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "../lib/vc6"
+# PROP Intermediate_Dir "luafilesystem_dll/Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../external-src/lua50/include" /I "../../compat/src" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 lua50.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../bin/vc6/lfs.dll" /libpath:"../../external-src/lua50/lib/dll"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=cd ../bin/vc6 zip.exe luafilesystem-1.2-win32.zip lfs.dll
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "luafilesystem_dll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "../lib/vc6"
+# PROP Intermediate_Dir "luafilesystem_dll/Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../external-src/lua50/include" /I "../../compat/src" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 lua50.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../bin/vc6/lfsd.dll" /pdbtype:sept /libpath:"../../external-src/lua50/lib/dll"
+
+!ENDIF
+
+# Begin Target
+
+# Name "luafilesystem_dll - Win32 Release"
+# Name "luafilesystem_dll - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE="..\..\compat\src\compat-5.1.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\lfs.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lfs.def
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE="..\..\compat\src\compat-5.1.h"
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\lfs.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/3rdparty/luv/.ci/install.bat b/3rdparty/luv/.ci/install.bat
new file mode 100644
index 00000000000..1ee346dccc9
--- /dev/null
+++ b/3rdparty/luv/.ci/install.bat
@@ -0,0 +1,270 @@
+@echo off
+
+cd %APPVEYOR_BUILD_FOLDER%
+
+:: =========================================================
+:: Set some defaults. Infer some variables.
+::
+:: These are set globally
+if "%LUA_VER%" NEQ "" (
+ set LUA=lua
+ set LUA_SHORTV=%LUA_VER:~0,3%
+) else (
+ set LUA=luajit
+ set LJ_SHORTV=%LJ_VER:~0,3%
+ set LUA_SHORTV=5.1
+)
+
+:: defines LUA_DIR so Cmake can find this Lua install
+if "%LUA%"=="luajit" (
+ set LUA_DIR=c:\lua\%platform%\lj%LJ_SHORTV%
+) else (
+ set LUA_DIR=c:\lua\%platform%\%LUA_VER%
+)
+
+:: Now we declare a scope
+Setlocal EnableDelayedExpansion EnableExtensions
+
+if not defined LUAROCKS_URL set LUAROCKS_URL=http://keplerproject.github.io/luarocks/releases
+if not defined LUAROCKS_REPO set LUAROCKS_REPO=https://luarocks.org
+if not defined LUA_URL set LUA_URL=http://www.lua.org/ftp
+if defined NOCOMPAT (
+ set COMPATFLAG=--nocompat
+) else (
+ set COMPATFLAG=
+)
+if not defined LUAJIT_GIT_REPO set LUAJIT_GIT_REPO=https://github.com/LuaJIT/LuaJIT.git
+if not defined LUAJIT_URL set LUAJIT_URL=https://github.com/LuaJIT/LuaJIT/archive
+
+if not defined LR_EXTERNAL set LR_EXTERNAL=c:\external
+if not defined LUAROCKS_INSTALL set LUAROCKS_INSTALL=%LUA_DIR%\LuaRocks
+
+
+:: LuaRocks <= 2.2.2 used a versioned directory
+:: HEAD and newer versions do not, so act accordingly.
+if defined LR_ROOT goto :skiplrver
+
+if "%LUAROCKS_VER%" EQU "HEAD" (
+ set LR_ROOT=%LUAROCKS_INSTALL%
+ goto :skiplrver
+)
+set LR_ROOT=%LUAROCKS_INSTALL%
+if %LUAROCKS_VER:~0,1% LEQ 2 (
+ if %LUAROCKS_VER:~2,1% LEQ 2 (
+ if %LUAROCKS_VER:~4,1% LEQ 3 (
+ set LR_ROOT=%LUAROCKS_INSTALL%\!LUAROCKS_VER:~0,3!
+ )
+ )
+)
+:skiplrver
+
+if not defined LR_SYSTREE set LR_SYSTREE=%LUAROCKS_INSTALL%\systree
+
+if not defined SEVENZIP set SEVENZIP=7z
+::
+:: =========================================================
+
+:: first create some necessary directories:
+mkdir downloads 2>NUL
+
+:: Download and compile Lua (or LuaJIT)
+if "%LUA%"=="luajit" (
+ if not exist %LUA_DIR% (
+ if "%LJ_SHORTV%"=="2.1" (
+ :: Clone repository and checkout 2.1 branch
+ set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
+ if not exist !lj_source_folder! (
+ echo Cloning git repo %LUAJIT_GIT_REPO% !lj_source_folder!
+ git clone %LUAJIT_GIT_REPO% !lj_source_folder! || call :die "Failed to clone repository"
+ ) else (
+ cd !lj_source_folder!
+ git pull || call :die "Failed to update repository"
+ )
+ cd !lj_source_folder!\src
+ git checkout v2.1 || call :die
+ ) else (
+ set lj_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luajit-%LJ_VER%
+ if not exist !lj_source_folder! (
+ echo Downloading... %LUAJIT_URL%/v%LJ_VER%.tar.gz
+ curl --location --silent --fail --max-time 120 --connect-timeout 30 %LUAJIT_URL%/v%LJ_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
+ )
+ cd !lj_source_folder!\src
+ )
+ :: Compiles LuaJIT
+ if "%Configuration%"=="MinGW" (
+ call mingw32-make
+ ) else (
+ call msvcbuild.bat
+ )
+
+ mkdir %LUA_DIR% 2> NUL
+ for %%a in (bin bin\lua bin\lua\jit include lib) do ( mkdir "%LUA_DIR%\%%a" )
+
+ for %%a in (luajit.exe lua51.dll) do ( move "!lj_source_folder!\src\%%a" "%LUA_DIR%\bin" )
+ copy "%LUA_DIR%\bin\luajit.exe" "%LUA_DIR%\bin\lua.exe"
+
+ move "!lj_source_folder!\src\lua51.lib" "%LUA_DIR%\lib"
+ for %%a in (lauxlib.h lua.h lua.hpp luaconf.h lualib.h luajit.h) do (
+ copy "!lj_source_folder!\src\%%a" "%LUA_DIR%\include"
+ )
+
+ copy "!lj_source_folder!\src\jit\*.lua" "%LUA_DIR%\bin\lua\jit"
+
+ ) else (
+ echo LuaJIT %LJ_VER% already installed at %LUA_DIR%
+ )
+) else (
+ if not exist %LUA_DIR% (
+ :: Download and compile Lua
+ if not exist downloads\lua-%LUA_VER% (
+ curl --silent --fail --max-time 120 --connect-timeout 30 %LUA_URL%/lua-%LUA_VER%.tar.gz | %SEVENZIP% x -si -so -tgzip | %SEVENZIP% x -si -ttar -aoa -odownloads
+ )
+
+ mkdir downloads\lua-%LUA_VER%\etc 2> NUL
+ copy %~dp0\winmake.bat downloads\lua-%LUA_VER%\etc\winmake.bat
+
+ cd downloads\lua-%LUA_VER%
+ call etc\winmake %COMPATFLAG%
+ call etc\winmake install %LUA_DIR%
+ ) else (
+ echo Lua %LUA_VER% already installed at %LUA_DIR%
+ )
+)
+
+if not exist %LUA_DIR%\bin\%LUA%.exe call :die "Missing Lua interpreter at %LUA_DIR%\bin\%LUA%.exe"
+
+set PATH=%LUA_DIR%\bin;%PATH%
+call !LUA! -v
+
+
+
+:: ==========================================================
+:: LuaRocks
+:: ==========================================================
+
+if not exist "%LR_ROOT%" (
+ :: Downloads and installs LuaRocks
+ cd %APPVEYOR_BUILD_FOLDER%
+
+ if %LUAROCKS_VER%==HEAD (
+ set lr_source_folder=%APPVEYOR_BUILD_FOLDER%\downloads\luarocks-%LUAROCKS_VER%-win32
+ if not exist !lr_source_folder! (
+ git clone https://github.com/keplerproject/luarocks.git --single-branch --depth 1 !lr_source_folder! || call :die "Failed to clone LuaRocks repository"
+ ) else (
+ cd !lr_source_folder!
+ git pull || call :die "Failed to update LuaRocks repository"
+ )
+ ) else (
+ if not exist downloads\luarocks-%LUAROCKS_VER%-win32.zip (
+ echo Downloading LuaRocks...
+ curl --silent --fail --max-time 120 --connect-timeout 30 --output downloads\luarocks-%LUAROCKS_VER%-win32.zip %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
+ %SEVENZIP% x -aoa -odownloads downloads\luarocks-%LUAROCKS_VER%-win32.zip
+ )
+ )
+
+ cd downloads\luarocks-%LUAROCKS_VER%-win32
+ if "%Configuration%"=="MinGW" (
+ call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%" /MW
+ ) else (
+ call install.bat /LUA %LUA_DIR% /Q /LV %LUA_SHORTV% /P "%LUAROCKS_INSTALL%" /TREE "%LR_SYSTREE%"
+ )
+
+ :: Configures LuaRocks to instruct CMake the correct generator to use. Else, CMake will pick the highest
+ :: Visual Studio version installed
+ if "%Configuration%"=="MinGW" (
+ echo cmake_generator = "MinGW Makefiles" >> %LUAROCKS_INSTALL%\config-%LUA_SHORTV%.lua
+ ) else (
+ set MSVS_GENERATORS[2008]=Visual Studio 9 2008
+ set MSVS_GENERATORS[2010]=Visual Studio 10 2010
+ set MSVS_GENERATORS[2012]=Visual Studio 11 2012
+ set MSVS_GENERATORS[2013]=Visual Studio 12 2013
+ set MSVS_GENERATORS[2015]=Visual Studio 14 2015
+
+ set CMAKE_GENERATOR=!MSVS_GENERATORS[%Configuration%]!
+ if "%platform%" EQU "x64" (set CMAKE_GENERATOR=!CMAKE_GENERATOR! Win64)
+
+ echo cmake_generator = "!CMAKE_GENERATOR!" >> %LUAROCKS_INSTALL%\config-%LUA_SHORTV%.lua
+ )
+)
+
+if not exist "%LR_ROOT%" call :die "LuaRocks not found at %LR_ROOT%"
+
+set PATH=%LR_ROOT%;%LR_SYSTREE%\bin;%PATH%
+
+:: Lua will use just the system rocks
+set LUA_PATH=%LR_ROOT%\lua\?.lua;%LR_ROOT%\lua\?\init.lua
+set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?.lua
+set LUA_PATH=%LUA_PATH%;%LR_SYSTREE%\share\lua\%LUA_SHORTV%\?\init.lua
+set LUA_PATH=%LUA_PATH%;.\?.lua;.\?\init.lua
+set LUA_CPATH=%LR_SYSTREE%\lib\lua\%LUA_SHORTV%\?.dll;.\?.dll
+
+call luarocks --version || call :die "Error with LuaRocks installation"
+call luarocks list
+
+
+if not exist "%LR_EXTERNAL%" (
+ mkdir "%LR_EXTERNAL%"
+ mkdir "%LR_EXTERNAL%\lib"
+ mkdir "%LR_EXTERNAL%\include"
+)
+
+set PATH=%LR_EXTERNAL%;%PATH%
+
+:: Exports the following variables:
+:: (beware of whitespace between & and ^ below)
+endlocal & set PATH=%PATH%&^
+set LR_SYSTREE=%LR_SYSTREE%&^
+set LUA_PATH=%LUA_PATH%&^
+set LUA_CPATH=%LUA_CPATH%&^
+set LR_EXTERNAL=%LR_EXTERNAL%
+
+echo.
+echo ======================================================
+if "%LUA%"=="luajit" (
+ echo Installation of LuaJIT %LJ_VER% and LuaRocks %LUAROCKS_VER% done.
+) else (
+ echo Installation of Lua %LUA_VER% and LuaRocks %LUAROCKS_VER% done.
+ if defined NOCOMPAT echo Lua was built with compatibility flags disabled.
+)
+echo Platform - %platform%
+echo LUA - %LUA%
+echo LUA_SHORTV - %LUA_SHORTV%
+echo LJ_SHORTV - %LJ_SHORTV%
+echo LUA_PATH - %LUA_PATH%
+echo LUA_CPATH - %LUA_CPATH%
+echo.
+echo LR_EXTERNAL - %LR_EXTERNAL%
+echo ======================================================
+echo.
+
+goto :eof
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+:: This blank space is intentional. If you see errors like "The system cannot find the batch label specified 'foo'"
+:: then try adding or removing blank lines lines above.
+:: Yes, really.
+:: http://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e
+
+:: helper functions:
+
+:: for bailing out when an error occurred
+:die %1
+echo %1
+exit /B 1
+goto :eof
diff --git a/3rdparty/luv/.ci/platform.sh b/3rdparty/luv/.ci/platform.sh
new file mode 100644
index 00000000000..7259a7d6369
--- /dev/null
+++ b/3rdparty/luv/.ci/platform.sh
@@ -0,0 +1,15 @@
+if [ -z "${PLATFORM:-}" ]; then
+ PLATFORM=$TRAVIS_OS_NAME;
+fi
+
+if [ "$PLATFORM" == "osx" ]; then
+ PLATFORM="macosx";
+fi
+
+if [ -z "$PLATFORM" ]; then
+ if [ "$(uname)" == "Linux" ]; then
+ PLATFORM="linux";
+ else
+ PLATFORM="macosx";
+ fi;
+fi
diff --git a/3rdparty/luv/.ci/set_compiler_env.bat b/3rdparty/luv/.ci/set_compiler_env.bat
new file mode 100644
index 00000000000..7e8462ec57e
--- /dev/null
+++ b/3rdparty/luv/.ci/set_compiler_env.bat
@@ -0,0 +1,40 @@
+@echo off
+
+:: Now we declare a scope
+Setlocal EnableDelayedExpansion EnableExtensions
+
+if not defined Configuration set Configuration=2015
+
+if "%Configuration%"=="MinGW" ( goto :mingw )
+
+set arch=x86
+
+if "%platform%" EQU "x64" ( set arch=x86_amd64 )
+
+if "%Configuration%"=="2015" (
+ set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
+)
+
+if "%Configuration%"=="2013" (
+ set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
+)
+
+if "%Configuration%"=="2012" (
+ set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
+)
+
+if "%Configuration%"=="2010" (
+ set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
+)
+
+if "%Configuration%"=="2008" (
+ set SET_VS_ENV="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
+)
+
+:: Visual Studio detected
+endlocal & call %SET_VS_ENV% %arch%
+goto :eof
+
+:: MinGW detected
+:mingw
+endlocal & set PATH=c:\mingw\bin;%PATH%
diff --git a/3rdparty/luv/.ci/setenv_lua.sh b/3rdparty/luv/.ci/setenv_lua.sh
new file mode 100644
index 00000000000..55454389398
--- /dev/null
+++ b/3rdparty/luv/.ci/setenv_lua.sh
@@ -0,0 +1,3 @@
+export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin
+bash .ci/setup_lua.sh
+eval `$HOME/.lua/luarocks path`
diff --git a/3rdparty/luv/.ci/setup_lua.sh b/3rdparty/luv/.ci/setup_lua.sh
new file mode 100644
index 00000000000..f8963331767
--- /dev/null
+++ b/3rdparty/luv/.ci/setup_lua.sh
@@ -0,0 +1,122 @@
+#! /bin/bash
+
+# A script for setting up environment for travis-ci testing.
+# Sets up Lua and Luarocks.
+# LUA must be "lua5.1", "lua5.2" or "luajit".
+# luajit2.0 - master v2.0
+# luajit2.1 - master v2.1
+
+set -eufo pipefail
+
+LUAJIT_VERSION="2.0.4"
+LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION"
+
+source .ci/platform.sh
+
+LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua
+
+LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks
+
+mkdir $HOME/.lua
+
+LUAJIT="no"
+
+if [ "$PLATFORM" == "macosx" ]; then
+ if [ "$LUA" == "luajit" ]; then
+ LUAJIT="yes";
+ fi
+ if [ "$LUA" == "luajit2.0" ]; then
+ LUAJIT="yes";
+ fi
+ if [ "$LUA" == "luajit2.1" ]; then
+ LUAJIT="yes";
+ fi;
+elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
+ LUAJIT="yes";
+fi
+
+mkdir -p "$LUA_HOME_DIR"
+
+if [ "$LUAJIT" == "yes" ]; then
+
+ if [ "$LUA" == "luajit" ]; then
+ curl --location https://github.com/LuaJIT/LuaJIT/archive/v$LUAJIT_VERSION.tar.gz | tar xz;
+ else
+ git clone https://github.com/LuaJIT/LuaJIT.git $LUAJIT_BASE;
+ fi
+
+ cd $LUAJIT_BASE
+
+ if [ "$LUA" == "luajit2.1" ]; then
+ git checkout v2.1;
+ # force the INSTALL_TNAME to be luajit
+ perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile
+ fi
+
+ make && make install PREFIX="$LUA_HOME_DIR"
+
+ ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit
+ ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua;
+
+else
+
+ if [ "$LUA" == "lua5.1" ]; then
+ curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
+ cd lua-5.1.5;
+ elif [ "$LUA" == "lua5.2" ]; then
+ curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz
+ cd lua-5.2.4;
+ elif [ "$LUA" == "lua5.3" ]; then
+ curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz
+ cd lua-5.3.2;
+ fi
+
+ # Build Lua without backwards compatibility for testing
+ perl -i -pe 's/-DLUA_COMPAT_(ALL|5_2)//' src/Makefile
+ make $PLATFORM
+ make INSTALL_TOP="$LUA_HOME_DIR" install;
+
+ ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua
+ ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac;
+
+fi
+
+cd $TRAVIS_BUILD_DIR
+
+lua -v
+
+LUAROCKS_BASE=luarocks-$LUAROCKS
+
+curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
+
+cd $LUAROCKS_BASE
+
+if [ "$LUA" == "luajit" ]; then
+ ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
+elif [ "$LUA" == "luajit2.0" ]; then
+ ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
+elif [ "$LUA" == "luajit2.1" ]; then
+ ./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR";
+else
+ ./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR"
+fi
+
+make build && make install
+
+ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks
+
+cd $TRAVIS_BUILD_DIR
+
+luarocks --version
+
+rm -rf $LUAROCKS_BASE
+
+if [ "$LUAJIT" == "yes" ]; then
+ rm -rf $LUAJIT_BASE;
+elif [ "$LUA" == "lua5.1" ]; then
+ rm -rf lua-5.1.5;
+elif [ "$LUA" == "lua5.2" ]; then
+ rm -rf lua-5.2.4;
+elif [ "$LUA" == "lua5.3" ]; then
+ rm -rf lua-5.3.2;
+fi
diff --git a/3rdparty/luv/.ci/winmake.bat b/3rdparty/luv/.ci/winmake.bat
new file mode 100644
index 00000000000..dcad55d36f7
--- /dev/null
+++ b/3rdparty/luv/.ci/winmake.bat
@@ -0,0 +1,457 @@
+@ECHO OFF
+SETLOCAL ENABLEDELAYEDEXPANSION
+
+REM *****************************
+REM * Customization section *
+REM *****************************
+
+REM use the /help option for generic usage information
+
+REM Where is the source code located (the unpacked Lua source archive, toplevel dir)
+SET SOURCETREE=.\
+
+REM set the toolchain to either MS or GCC (allcaps), leave blank to autodetect
+SET TOOLCHAIN=
+
+REM set the compatibility flags, defaults to empty for 5.1, -DLUA_COMPAT_ALL for 5.2,
+REM and -DLUA_COMPAT_5_2 for 5.3, which are the same as the unix make files
+REM This setting can be overridden with the --nocompat flag
+SET COMPATFLAG=
+
+
+
+
+
+
+
+
+
+REM **********************************
+REM * Nothing to customize below *
+REM **********************************
+
+SET BATCHNAME=%~n0
+SET SOURCE=%SOURCETREE%src\
+SET LUA_H=%SOURCE%lua.h
+SET CURDIR=%CD%
+
+REM the following line ends with a TAB. DO NOT REMOVE IT!
+SET TABCHAR=
+REM Define LF to contain a linefeed character
+set ^"LFCHAR=^
+
+^" The above empty line is critical. DO NOT REMOVE
+
+
+REM Supported toolchains (allcaps)
+SET TOOLCHAINS=MS GCC
+REM Commands which, if exiting without error, indicate presence of the toolchain
+SET CHECK_GCC=gcc --version
+SET CHECK_MS=cl
+
+REM **********************************
+REM * Check for help request *
+REM **********************************
+
+SET HELPCMDS=help -help --help /help ? -? /?
+for %%L in ("!LFCHAR!") do for /f %%a in ("!HELPCMDS: =%%~L!") do (
+ if "%%a"=="%~1" (
+ echo.
+ echo Builds a standalone Lua installation. Supports Lua version 5.1, 5.2 and 5.3.
+ echo Your compiler must be in the system path, and this "%BATCHNAME%.bat" file must be located
+ echo in ".\etc\" in the unpacked Lua source archive.
+ echo.
+ echo USAGE etc\%BATCHNAME% [FLAG] [COMMAND] [...]
+ echo ^(execute from the root of the unpacked archive^)
+ echo.
+ echo Commands;
+ echo clean : cleans the source tree of build ^(intermediate^) files
+ echo install [path] : installs the build results into "path"
+ echo local : installs into ".\local\" in the unpacked Lua source structure
+ echo [toolchain] : uses a specific toolchain to build. If not provided then supported
+ echo toolchains will be tested and the first available will be picked.
+ echo Supported toolchains are: "%TOOLCHAINS%" ^(must use ALLCAPS^)
+ echo.
+ echo Flags;
+ echo --nocompat : Specifies that no compatibility flags should be set when building.
+ echo If not specified, the default compatibility flags will be used.
+ echo.
+ echo Example use;
+ echo set PATH=C:\path\to\your\compiler\;%%PATH%%
+ echo etc\%BATCHNAME% clean
+ echo etc\%BATCHNAME%
+ echo etc\%BATCHNAME% --nocompat GCC
+ echo etc\%BATCHNAME% install "C:\Program Files\Lua"
+ echo.
+ goto :EXITOK
+ )
+)
+
+REM **********************************
+REM * Check commandline *
+REM **********************************
+
+SET CMDOK=FALSE
+if "%~1"=="" (
+ SET CMDOK=TRUE
+)
+for %%a in (local install clean) do (
+ if "%%a"=="%~1" (
+ SET CMDOK=TRUE
+ )
+)
+for %%a in (--nocompat) do (
+ if "%%a"=="%~1" (
+ SET NOCOMPAT=TRUE
+ if "%~2"=="" (
+ SET CMDOK=TRUE
+ )
+ SHIFT
+ )
+)
+for %%a in (%TOOLCHAINS%) do (
+ if "%%a"=="%~1" (
+ SET CMDOK=TRUE
+ SET TOOLCHAIN=%~1
+ )
+)
+if NOT %CMDOK%==TRUE (
+ echo.
+ echo Unknown command or toolchain specified.
+ goto :EXITERROR
+)
+
+REM **************************************
+REM * Check for cleaning *
+REM **************************************
+
+if "%1"=="clean" (
+ if NOT [%2]==[] (
+ echo.
+ echo ERROR: The clean command does not take extra parameters.
+ ) else (
+ echo Cleaning...
+ if exist "%SOURCE%*.exe" del "%SOURCE%*.exe"
+ if exist "%SOURCE%*.dll" del "%SOURCE%*.dll"
+ if exist "%SOURCE%*.o" del "%SOURCE%*.o"
+ if exist "%SOURCE%*.a" del "%SOURCE%*.a"
+ if exist "%SOURCE%*.obj" del "%SOURCE%*.obj"
+ if exist "%SOURCE%*.manifest" del "%SOURCE%*.manifest"
+ if exist "%SOURCE%*.lib" del "%SOURCE%*.lib"
+ echo Done.
+ )
+ goto :EXITOK
+)
+
+REM **************************************************
+REM * Fetch the Lua version from the source code *
+REM **************************************************
+
+Echo.
+Echo Checking source code to extract Lua version...
+IF NOT EXIST %LUA_H% (
+ Echo Cannot locate Lua header file; %LUA_H%
+ goto :EXITERROR
+)
+
+findstr /R /C:"#define[ %TABCHAR%][ %TABCHAR%]*LUA_VERSION_MAJOR" %LUA_H% > NUL
+if NOT %ERRORLEVEL%==0 (
+ rem ECHO We've got a Lua version 5.1
+ rem findstr /R /C:"#define[ %TABCHAR%][ %TABCHAR%]*LUA_VERSION[ %TABCHAR%]" %LUA_H%
+ SET LUA_VER=5.1
+) else (
+ rem ECHO We've got a Lua version 5.2+
+ rem findstr /R /C:"#define[ %TABCHAR%][ %TABCHAR%]*LUA_VERSION_MAJOR[ %TABCHAR%]" %LUA_H%
+ rem findstr /R /C:"#define[ %TABCHAR%][ %TABCHAR%]*LUA_VERSION_MINOR[ %TABCHAR%]" %LUA_H%
+
+ for /F "delims=" %%a in ('findstr /R /C:"#define[ %TABCHAR%][ %TABCHAR%]*LUA_VERSION_MAJOR[ %TABCHAR%]" %LUA_H%') do set LUA_MAJOR=%%a
+ SET LUA_MAJOR=!LUA_MAJOR:#define=!
+ SET LUA_MAJOR=!LUA_MAJOR:LUA_VERSION_MAJOR=!
+ SET LUA_MAJOR=!LUA_MAJOR: =!
+ SET LUA_MAJOR=!LUA_MAJOR:%TABCHAR%=!
+ SET LUA_MAJOR=!LUA_MAJOR:"=!
+ SET LUA_MAJOR=!LUA_MAJOR:~0,1!
+
+ for /F "delims=" %%a in ('findstr /R /C:"#define[ %TABCHAR%][ %TABCHAR%]*LUA_VERSION_MINOR[ %TABCHAR%]" %LUA_H%') do set LUA_MINOR=%%a
+ SET LUA_MINOR=!LUA_MINOR:#define=!
+ SET LUA_MINOR=!LUA_MINOR:LUA_VERSION_MINOR=!
+ SET LUA_MINOR=!LUA_MINOR: =!
+ SET LUA_MINOR=!LUA_MINOR:%TABCHAR%=!
+ SET LUA_MINOR=!LUA_MINOR:"=!
+ SET LUA_MINOR=!LUA_MINOR:~0,1!
+
+ SET LUA_VER=!LUA_MAJOR!.!LUA_MINOR!
+)
+SET LUA_SVER=!LUA_VER:.=!
+
+Echo Lua version found: %LUA_VER%
+Echo.
+
+REM **************************************
+REM * Set some Lua version specifics *
+REM **************************************
+
+REM FILES_CORE; files for Lua core (+lauxlib, needed for Luac)
+REM FILES_LIB; files for Lua standard libraries
+REM FILES_DLL; vm files to be build with dll option
+REM FILES_OTH; vm files to be build without dll, for static linking
+
+if %LUA_SVER%==51 (
+ set FILES_CORE=lapi lcode ldebug ldo ldump lfunc lgc llex lmem lobject lopcodes lparser lstate lstring ltable ltm lundump lvm lzio lauxlib
+ set FILES_LIB=lbaselib ldblib liolib lmathlib loslib ltablib lstrlib loadlib linit
+ set FILES_DLL=lua
+ set FILES_OTH=luac print
+ set INSTALL_H=lauxlib.h lua.h luaconf.h lualib.h ..\etc\lua.hpp
+)
+if %LUA_SVER%==52 (
+ set FILES_CORE=lapi lcode lctype ldebug ldo ldump lfunc lgc llex lmem lobject lopcodes lparser lstate lstring ltable ltm lundump lvm lzio lauxlib
+ set FILES_LIB=lbaselib lbitlib lcorolib ldblib liolib lmathlib loslib lstrlib ltablib loadlib linit
+ set FILES_DLL=lua
+ set FILES_OTH=luac
+ set INSTALL_H=lauxlib.h lua.h lua.hpp luaconf.h lualib.h
+ if "%COMPATFLAG%"=="" (
+ set COMPATFLAG=-DLUA_COMPAT_ALL
+ )
+)
+if %LUA_SVER%==53 (
+ set FILES_CORE=lapi lcode lctype ldebug ldo ldump lfunc lgc llex lmem lobject lopcodes lparser lstate lstring ltable ltm lundump lvm lzio lauxlib
+ set FILES_LIB=lbaselib lbitlib lcorolib ldblib liolib lmathlib loslib lstrlib ltablib lutf8lib loadlib linit
+ set FILES_DLL=lua
+ set FILES_OTH=luac
+ set INSTALL_H=lauxlib.h lua.h lua.hpp luaconf.h lualib.h
+ if "%COMPATFLAG%"=="" (
+ set COMPATFLAG=-DLUA_COMPAT_5_2
+ )
+)
+
+if "%NOCOMPAT%"=="TRUE" (
+ set COMPATFLAG=
+)
+
+SET FILES_BASE=%FILES_DLL% %FILES_CORE% %FILES_LIB%
+
+if "%FILES_BASE%"=="" (
+ Echo Unknown Lua version; %LUA_VER%
+ goto :EXITERROR
+)
+
+REM *********************************
+REM * Check available toolchain *
+REM *********************************
+
+if [%TOOLCHAIN%]==[] (
+ Echo Testing for MS...
+ %CHECK_MS%
+ IF !ERRORLEVEL!==0 SET TOOLCHAIN=MS
+)
+if [%TOOLCHAIN%]==[] (
+ Echo Testing for GCC...
+ %CHECK_GCC%
+ IF !ERRORLEVEL!==0 SET TOOLCHAIN=GCC
+)
+if [%TOOLCHAIN%]==[] (
+ Echo No supported toolchain found ^(please make sure it is in the system path^)
+ goto :EXITERROR
+)
+
+REM ***************************
+REM * Configure toolchain *
+REM ***************************
+
+if %TOOLCHAIN%==GCC (
+ echo Using GCC toolchain...
+ SET OBJEXT=o
+ SET LIBFILE=liblua%LUA_SVER%.a
+)
+if %TOOLCHAIN%==MS (
+ echo Using Microsoft toolchain...
+ SET OBJEXT=obj
+ SET LIBFILE=lua%LUA_SVER%.lib
+)
+echo.
+
+REM **************************************
+REM * Check for installing *
+REM **************************************
+
+if "%1"=="install" (
+ if "%~2"=="" (
+ echo.
+ echo ERROR: The install command requires a path where to install to.
+ goto :EXITERROR
+ )
+ SET TARGETPATH=%~2
+)
+if "%1"=="local" (
+ if NOT "%~2"=="" (
+ echo.
+ echo ERROR: The local command does not take extra parameters.
+ goto :EXITERROR
+ )
+ SET TARGETPATH=%SOURCETREE%local
+)
+if NOT "%TARGETPATH%"=="" (
+ mkdir "%TARGETPATH%\bin"
+ mkdir "%TARGETPATH%\include"
+ mkdir "%TARGETPATH%\lib\lua\%LUA_VER%"
+ mkdir "%TARGETPATH%\man\man1"
+ mkdir "%TARGETPATH%\share\lua\%LUA_VER%"
+ copy "%SOURCE%lua.exe" "%TARGETPATH%\bin"
+ copy "%SOURCE%luac.exe" "%TARGETPATH%\bin"
+ copy "%SOURCE%lua%LUA_SVER%.dll" "%TARGETPATH%\bin"
+ for %%a in (%INSTALL_H%) do ( copy "%SOURCE%%%a" "%TARGETPATH%\include" )
+ copy "%SOURCE%%LIBFILE%" "%TARGETPATH%\lib"
+ copy "%SOURCETREE%doc\lua.1" "%TARGETPATH%\man\man1"
+ copy "%SOURCETREE%doc\luac.1" "%TARGETPATH%\man\man1"
+
+ echo Installation completed in "%TARGETPATH%".
+ goto :EXITOK
+)
+
+REM ***********************
+REM * Compile sources *
+REM ***********************
+goto :after_compile_function
+:compile_function
+ REM Params: %1 is filelist (must be quoted)
+ REM Return: same list, with the object file extension included, will be stored in global OBJLIST
+
+ for %%a in (%~1) do (
+ SET FILENAME=%%a
+ if %TOOLCHAIN%==GCC (
+ SET COMPCMD=gcc -O2 -Wall !EXTRAFLAG! !COMPATFLAG! -c -o !FILENAME!.%OBJEXT% !FILENAME!.c
+ )
+ if %TOOLCHAIN%==MS (
+ SET COMPCMD=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE !COMPATFLAG! !EXTRAFLAG! !FILENAME!.c
+ )
+ echo !COMPCMD!
+ !COMPCMD!
+ SET OBJLIST=!OBJLIST! !FILENAME!.%OBJEXT%
+ )
+
+goto :eof
+:after_compile_function
+
+CD %SOURCE%
+REM Traverse the 4 lists of source files
+
+for %%b in (CORE LIB DLL OTH) do (
+ SET LTYPE=%%b
+ SET OBJLIST=
+ if !LTYPE!==OTH (
+ REM OTH is the only list of files build without DLL option
+ SET EXTRAFLAG=
+ ) else (
+ SET EXTRAFLAG=-DLUA_BUILD_AS_DLL
+ )
+ if !LTYPE!==CORE SET FILELIST=%FILES_CORE%
+ if !LTYPE!==LIB SET FILELIST=%FILES_LIB%
+ if !LTYPE!==DLL SET FILELIST=%FILES_DLL%
+ if !LTYPE!==OTH SET FILELIST=%FILES_OTH%
+
+ echo Now compiling !LTYPE! file set...
+ call:compile_function "!FILELIST!"
+
+ if !LTYPE!==CORE SET FILES_CORE_O=!OBJLIST!
+ if !LTYPE!==LIB SET FILES_LIB_O=!OBJLIST!
+ if !LTYPE!==DLL SET FILES_DLL_O=!OBJLIST!
+ if !LTYPE!==OTH SET FILES_OTH_O=!OBJLIST!
+)
+
+
+REM ****************************
+REM * Link GCC based files *
+REM ****************************
+
+if %TOOLCHAIN%==GCC (
+ REM Link the LuaXX.dll file
+ SET LINKCMD=gcc -shared -o lua%LUA_SVER%.dll %FILES_CORE_O% %FILES_LIB_O%
+ echo !LINKCMD!
+ !LINKCMD!
+
+ REM strip from LuaXX.dll
+ SET RANCMD=strip --strip-unneeded lua%LUA_SVER%.dll
+ echo !RANCMD!
+ !RANCMD!
+
+ REM Link the Lua.exe file
+ SET LINKCMD=gcc -o lua.exe -s lua.%OBJEXT% lua%LUA_SVER%.dll -lm
+ echo !LINKCMD!
+ !LINKCMD!
+
+ REM create lib archive
+ SET LIBCMD=ar rcu liblua%LUA_SVER%.a %FILES_CORE_O% %FILES_LIB_O%
+ echo !LIBCMD!
+ !LIBCMD!
+
+ REM Speedup index using ranlib
+ SET RANCMD=ranlib liblua%LUA_SVER%.a
+ echo !RANCMD!
+ !RANCMD!
+
+ REM Link Luac.exe file
+ SET LINKCMD=gcc -o luac.exe %FILES_OTH_O% liblua%LUA_SVER%.a -lm
+ echo !LINKCMD!
+ !LINKCMD!
+
+)
+
+
+REM ****************************
+REM * Link MS based files *
+REM ****************************
+
+if %TOOLCHAIN%==MS (
+ REM Link the LuaXX.dll file, and LuaXX.obj
+ SET LINKCMD=link /nologo /DLL /out:lua%LUA_SVER%.dll %FILES_CORE_O% %FILES_LIB_O%
+ echo !LINKCMD!
+ !LINKCMD!
+
+ REM handle dll manifest
+ if exist lua%LUA_SVER%.dll.manifest (
+ SET MANICMD=mt /nologo -manifest lua%LUA_SVER%.dll.manifest -outputresource:lua%LUA_SVER%.dll;2
+ echo !MANICMD!
+ !MANICMD!
+ )
+
+ REM Link Lua.exe
+ SET LINKCMD=link /nologo /out:lua.exe lua.%OBJEXT% lua%LUA_SVER%.lib
+ echo !LINKCMD!
+ !LINKCMD!
+
+ REM handle manifest
+ if exist lua.exe.manifest (
+ SET MANICMD=mt /nologo -manifest lua.exe.manifest -outputresource:lua.exe
+ echo !MANICMD!
+ !MANICMD!
+ )
+
+ REM Link Luac.exe
+ SET LINKCMD=link /nologo /out:luac.exe %FILES_OTH_O% %FILES_CORE_O%
+ echo !LINKCMD!
+ !LINKCMD!
+
+ REM handle manifest
+ if exist luac.exe.manifest (
+ SET MANICMD=mt /nologo -manifest luac.exe.manifest -outputresource:luac.exe
+ echo !MANICMD!
+ !MANICMD!
+ )
+)
+
+CD %CURDIR%
+
+REM ****************************
+REM * Finished building *
+REM ****************************
+
+echo.
+echo Build completed.
+goto :EXITOK
+
+:EXITOK
+exit /B 0
+
+:EXITERROR
+echo For help try; etc\%BATCHNAME% /help
+exit /B 1
diff --git a/3rdparty/luv/.gitignore b/3rdparty/luv/.gitignore
new file mode 100644
index 00000000000..8bcf497a42c
--- /dev/null
+++ b/3rdparty/luv/.gitignore
@@ -0,0 +1,10 @@
+build
+libluv.a
+libluv.so
+luv.so
+luv.dll
+luajit.exe
+luv-*.tar.gz
+luv-*.src.rock
+luv-*/
+build.luarocks/
diff --git a/3rdparty/luv/.travis.yml b/3rdparty/luv/.travis.yml
new file mode 100644
index 00000000000..b6909b894cc
--- /dev/null
+++ b/3rdparty/luv/.travis.yml
@@ -0,0 +1,36 @@
+language: c
+sudo: false
+
+addons:
+ apt:
+ sources:
+ - kalakris-cmake
+ packages:
+ - cmake
+
+env:
+ global:
+ - LUAROCKS=2.3.0
+ matrix:
+ - WITH_LUA_ENGINE=Lua LUA=lua5.3
+ - WITH_LUA_ENGINE=LuaJIT LUA=luajit2.1
+ - PROCESS_CLEANUP_TEST=1 LUA=lua5.2
+
+os:
+ - linux
+ - osx
+
+before_install:
+ - git submodule update --init --recursive
+ - git submodule update --recursive
+
+script:
+ - if [ "x$PROCESS_CLEANUP_TEST" = "x" ]; then make && make test; else ./tests/test-sigchld-after-lua_close.sh; fi
+ # Test rock installation
+ - source .ci/setenv_lua.sh
+ - luarocks make
+ - test $PWD = `lua -e "print(require'luv'.cwd())"`
+
+notifications:
+ email: true
+ irc: "irc.freenode.org#luvit"
diff --git a/3rdparty/luv/CMakeLists.txt b/3rdparty/luv/CMakeLists.txt
new file mode 100644
index 00000000000..9f079670de2
--- /dev/null
+++ b/3rdparty/luv/CMakeLists.txt
@@ -0,0 +1,191 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(POLICY CMP0053)
+ cmake_policy(SET CMP0053 NEW) # faster evaluation of variable references
+endif()
+
+project (luv C ASM)
+
+set(LUV_VERSION_MAJOR 1)
+set(LUV_VERSION_MINOR 8)
+set(LUV_VERSION_PATCH 0)
+set(LUV_VERSION ${LUV_VERSION_MAJOR}.${LUV_VERSION_MINOR}.${LUV_VERSION_PATCH})
+
+option(BUILD_MODULE "Build as module" ON)
+option(BUILD_SHARED_LIBS "Build shared library" OFF)
+option(WITH_SHARED_LIBUV "Link to a shared libuv library instead of static linking" OFF)
+
+if (NOT WITH_LUA_ENGINE)
+ set(WITH_LUA_ENGINE "LuaJIT"
+ CACHE STRING "Link to LuaJIT or PUC Lua" FORCE)
+ set_property(CACHE WITH_LUA_ENGINE
+ PROPERTY STRINGS "Lua;LuaJIT")
+endif (NOT WITH_LUA_ENGINE)
+
+if (NOT LUA_BUILD_TYPE)
+ set(LUA_BUILD_TYPE "Static"
+ CACHE STRING "Build Lua/LuaJIT as static, dynamic libary, or use system one" FORCE)
+ set_property(CACHE LUA_BUILD_TYPE
+ PROPERTY STRINGS "Static;Dynamic;System")
+endif (NOT LUA_BUILD_TYPE)
+
+if (WITH_LUA_ENGINE STREQUAL Lua)
+ add_definitions(-DLUA_USE_DLOPEN)
+ set(USE_LUAJIT OFF)
+else ()
+ set(USE_LUAJIT ON)
+endif ()
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+
+if (WITH_SHARED_LIBUV)
+ find_package(Libuv)
+ if (LIBUV_FOUND)
+ include_directories(${LIBUV_INCLUDE_DIR})
+ endif (LIBUV_FOUND)
+else (WITH_SHARED_LIBUV)
+ include(deps/uv.cmake)
+ if (BUILD_MODULE)
+ add_definitions( -DBUILDING_UV_SHARED )
+ endif (BUILD_MODULE)
+endif (WITH_SHARED_LIBUV)
+
+if (LUA)
+ MESSAGE(STATUS "Lua: using information from luarocks")
+
+ MESSAGE(STATUS "LUA_LIBDIR: " ${LUA_LIBDIR})
+ MESSAGE(STATUS "LUA_INCDIR: " ${LUA_INCDIR})
+ MESSAGE(STATUS "LUA: " ${LUA})
+
+ SET(LUA_EXECUTABLE "${LUA}")
+ SET(LUA_INCLUDE_DIR "${LUA_INCDIR}")
+ SET(LUA_PACKAGE_PATH "${LUADIR}")
+ SET(LUA_PACKAGE_CPATH "${LIBDIR}")
+
+ SET(INSTALL_LIB_DIR ${LIBDIR})
+
+ GET_FILENAME_COMPONENT(LUA_EXEC_NAME ${LUA_EXECUTABLE} NAME_WE)
+ IF(LUA_EXEC_NAME STREQUAL "luajit")
+ FIND_LIBRARY(LUA_LIBRARIES
+ NAMES luajit libluajit
+ PATHS ${LUA_LIBDIR}
+ NO_DEFAULT_PATH)
+ ELSEIF(LUA_EXEC_NAME STREQUAL "lua")
+ FIND_LIBRARY(LUA_LIBRARIES
+ NAMES lua lua53 lua52 lua51 liblua liblua53 liblua52 liblua51
+ PATHS ${LUA_LIBDIR}
+ NO_DEFAULT_PATH)
+ ENDIF()
+ MESSAGE(STATUS "Lua library: ${LUA_LIBRARIES}")
+
+ include_directories(${LUA_INCLUDE_DIR})
+else (LUA)
+ if (LUA_BUILD_TYPE STREQUAL System)
+ if (USE_LUAJIT)
+ find_package(LuaJIT)
+ if (LUAJIT_FOUND)
+ include_directories(${LUAJIT_INCLUDE_DIR})
+ link_directories(${LUAJIT_LIBRARIES})
+ endif (LUAJIT_FOUND)
+ else (USE_LUAJIT)
+ find_package(Lua)
+ if (LUA_FOUND)
+ include_directories(${LUA_INCLUDE_DIR})
+ endif (LUA_FOUND)
+ endif (USE_LUAJIT)
+
+ else (LUA_BUILD_TYPE STREQUAL System)
+ if (LUA_BUILD_TYPE STREQUAL Static)
+ SET(WITH_SHARED_LUA OFF)
+ else (LUA_BUILD_TYPE STREQUAL Static)
+ SET(WITH_SHARED_LUA ON)
+ endif (LUA_BUILD_TYPE STREQUAL Static)
+ if (USE_LUAJIT)
+ include(deps/luajit.cmake)
+ include_directories(deps/luajit/src)
+ else(USE_LUAJIT)
+ include(deps/lua.cmake)
+ include_directories(deps/lua/src)
+ endif (USE_LUAJIT)
+ endif (LUA_BUILD_TYPE STREQUAL System)
+endif (LUA)
+
+if (BUILD_MODULE)
+ add_library(luv MODULE src/luv.c)
+ set_target_properties(luv PROPERTIES PREFIX "")
+else (BUILD_MODULE)
+ add_library(luv src/luv.c)
+ if (BUILD_SHARED_LIBS)
+ set_target_properties(luv
+ PROPERTIES VERSION ${LUV_VERSION} SOVERSION ${LUV_VERSION_MAJOR})
+ endif (BUILD_SHARED_LIBS)
+endif (BUILD_MODULE)
+
+if(APPLE)
+ set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress"
+ )
+ # execute_process(COMMAND which luajit OUTPUT_VARIABLE LUAJIT)
+ # set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ # "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -bundle_loader ${LUAJIT}"
+ # )
+endif()
+
+if(WIN32)
+ add_definitions(-DLUA_BUILD_AS_DLL -DLUA_LIB)
+ if (LUA)
+ target_link_libraries(luv uv ${LUA_LIBRARIES})
+ else (LUA)
+ if (USE_LUAJIT)
+ target_link_libraries(luv uv luajit-5.1)
+ else (USE_LUAJIT)
+ if (LUA_BUILD_TYPE STREQUAL System)
+ target_link_libraries(luv uv ${LUA_LIBRARIES})
+ else (LUA_BUILD_TYPE STREQUAL System)
+ target_link_libraries(luv uv lualib)
+ endif (LUA_BUILD_TYPE STREQUAL System)
+ endif (USE_LUAJIT)
+ endif (LUA)
+ # replace /MD to /MT to avoid link msvcr*.dll
+ set(CompilerFlags
+ CMAKE_C_FLAGS
+ CMAKE_C_FLAGS_DEBUG
+ CMAKE_C_FLAGS_MINSIZEREL
+ CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_C_FLAGS_RELEASE)
+ foreach(CompilerFlag ${CompilerFlags})
+ string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
+ endforeach()
+elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ target_link_libraries(luv uv rt)
+else()
+ target_link_libraries(luv uv)
+endif()
+
+if (NOT LUA)
+ if (BUILD_MODULE)
+ if (WIN32)
+ set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+ else (WIN32)
+ set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+ endif (WIN32)
+ else (BUILD_MODULE)
+ set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib"
+ CACHE PATH "Installation directory for libraries")
+ set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include/luv"
+ CACHE PATH "Installation directory for headers")
+ endif (BUILD_MODULE)
+endif ()
+
+if (CMAKE_INSTALL_PREFIX)
+ install(TARGETS luv
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
+ )
+ if (NOT BUILD_MODULE)
+ install(
+ FILES src/luv.h src/util.h src/lhandle.h src/lreq.h
+ DESTINATION "${INSTALL_INC_DIR}"
+ )
+ endif (NOT BUILD_MODULE)
+endif (CMAKE_INSTALL_PREFIX)
diff --git a/3rdparty/luv/LICENSE.txt b/3rdparty/luv/LICENSE.txt
new file mode 100644
index 00000000000..d6456956733
--- /dev/null
+++ b/3rdparty/luv/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/3rdparty/luv/Makefile b/3rdparty/luv/Makefile
new file mode 100644
index 00000000000..1e7038c47ab
--- /dev/null
+++ b/3rdparty/luv/Makefile
@@ -0,0 +1,61 @@
+LUV_TAG=$(shell git describe --tags)
+
+ifdef WITHOUT_AMALG
+ CMAKE_OPTIONS+= -DWITH_AMALG=OFF
+endif
+
+BUILD_MODULE ?= ON
+BUILD_SHARED_LIBS ?= OFF
+WITH_SHARED_LIBUV ?= OFF
+WITH_LUA_ENGINE ?= LuaJIT
+LUA_BUILD_TYPE ?= Static
+
+
+ifeq ($(WITH_LUA_ENGINE), LuaJIT)
+ LUABIN=build/luajit
+else
+ LUABIN=build/lua
+endif
+
+CMAKE_OPTIONS += \
+ -DBUILD_MODULE=$(BUILD_MODULE) \
+ -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) \
+ -DWITH_SHARED_LIBUV=$(WITH_SHARED_LIBUV) \
+ -DWITH_LUA_ENGINE=$(WITH_LUA_ENGINE) \
+ -DLUA_BUILD_TYPE=$(LUA_BUILD_TYPE) \
+
+all: luv
+
+deps/libuv/include:
+ git submodule update --init deps/libuv
+
+deps/luajit/src:
+ git submodule update --init deps/luajit
+
+build/Makefile: deps/libuv/include deps/luajit/src
+ cmake -H. -Bbuild ${CMAKE_OPTIONS} -DWITH_AMALG=OFF
+
+luv: build/Makefile
+ cmake --build build --config Debug
+ ln -sf build/luv.so
+
+clean:
+ rm -rf build luv.so
+
+test: luv
+ ${LUABIN} tests/run.lua
+
+reset:
+ git submodule update --init --recursive && \
+ git clean -f -d && \
+ git checkout .
+
+publish-luarocks:
+ rm -rf luv-${LUV_TAG}
+ mkdir -p luv-${LUV_TAG}/deps
+ cp -r src cmake CMakeLists.txt LICENSE.txt README.md docs.md luv-${LUV_TAG}/
+ cp -r deps/libuv deps/*.cmake deps/lua_one.c luv-${LUV_TAG}/deps/
+ tar -czvf luv-${LUV_TAG}.tar.gz luv-${LUV_TAG}
+ github-release upload --user luvit --repo luv --tag ${LUV_TAG} \
+ --file luv-${LUV_TAG}.tar.gz --name luv-${LUV_TAG}.tar.gz
+ luarocks upload luv-${LUV_TAG}.rockspec --api-key=${LUAROCKS_TOKEN}
diff --git a/3rdparty/luv/README.md b/3rdparty/luv/README.md
new file mode 100644
index 00000000000..47059d01ee7
--- /dev/null
+++ b/3rdparty/luv/README.md
@@ -0,0 +1,213 @@
+luv
+===
+
+[![Linux Build Status](https://travis-ci.org/luvit/luv.svg?branch=master)](https://travis-ci.org/luvit/luv)
+
+[![Windows Build status](https://ci.appveyor.com/api/projects/status/uo1qhdcc0vcqsiok/branch/master?svg=true)](https://ci.appveyor.com/project/racker-buildbot/luv/branch/master)
+
+[libuv](https://github.com/joyent/libuv) bindings for
+[luajit](http://luajit.org/) and [lua](http://www.lua.org/)
+[5.1](http://www.lua.org/manual/5.1/manual.html)/
+[5.2](http://www.lua.org/manual/5.2/manual.html)/
+[5.3](http://www.lua.org/manual/5.3/manual.html).
+
+This library makes libuv available to lua scripts. It was made for the [luvit](http://luvit.io/) project but should usable from nearly any lua project.
+
+The library can be used by multiple threads at once. Each thread is assumed to load the library from a different `lua_State`. Luv will create a unique `uv_loop_t` for each state. You can't share uv handles between states/loops.
+
+The best docs currently are the [libuv docs](http://docs.libuv.org/) themselves. Hopfully soon we'll have a copy locally tailored for lua.
+
+```lua
+local uv = require('luv')
+
+-- Create a handle to a uv_timer_t
+local timer = uv.new_timer()
+
+-- This will wait 1000ms and then continue inside the callback
+timer:start(1000, 0, function ()
+ -- timer here is the value we passed in before from new_timer.
+
+ print ("Awake!")
+
+ -- You must always close your uv handles or you'll leak memory
+ -- We can't depend on the GC since it doesn't know enough about libuv.
+ timer:close()
+end)
+
+print("Sleeping");
+
+-- uv.run will block and wait for all events to run.
+-- When there are no longer any active handles, it will return
+uv.run()
+```
+
+
+Here is an example of an TCP echo server
+```lua
+local uv = require('luv')
+
+local function create_server(host, port, on_connection)
+
+ local server = uv.new_tcp()
+ server:bind(host, port)
+
+ server:listen(128, function(err)
+ -- Make sure there was no problem setting up listen
+ assert(not err, err)
+
+ -- Accept the client
+ local client = uv.new_tcp()
+ server:accept(client)
+
+ on_connection(client)
+ end)
+
+ return server
+end
+
+local server = create_server("0.0.0.0", 0, function (client)
+
+ client:read_start(function (err, chunk)
+
+ -- Crash on errors
+ assert(not err, err)
+
+ if chunk then
+ -- Echo anything heard
+ client:write(chunk)
+ else
+ -- When the stream ends, close the socket
+ client:close()
+ end
+ end)
+end)
+
+print("TCP Echo serverr listening on port " .. server:getsockname().port)
+
+uv.run()
+```
+
+More examples can be found in the [examples](examples) and [tests](tests) folders.
+
+## Building From Source
+
+To build, first install your compiler tools.
+
+### Get a Compiler
+
+On linux this probably means `gcc` and `make`. On Ubuntu, the `build-essential`
+package is good for this.
+
+On OSX, you probably want XCode which comes with `clang` and `make` and friends.
+
+For windows the free Visual Studio Express works. If you get the 2013 edition,
+make sure to get the `Windows Deskop` edition. The `Windows` version doesn't
+include a working C compiler. Make sure to run all of setup including getting a
+free license.
+
+### Install CMake
+
+Now install Cmake. The version in `brew` on OSX or most Linux package managers
+is good. The version on Travis CI is too old and so I use a PPA there. On
+windows use the installer and make sure to add cmake to your command prompt
+path.
+
+### Install Git
+
+If you haven't already, install git and make sure it's in your path. This comes
+with XCode on OSX. On Linux it's in your package manager. For windows, use the
+installer at <http://git-scm.com>. Make sure it's available to your windows
+command prompt.
+
+### Clone the Code
+
+Now open a terminal and clone the code. For windows I recommend the special
+developer command prompt that came with Visual Studio.
+
+```
+git clone https://github.com/luvit/luv.git --recursive
+cd luv
+```
+
+### Build the Code and Test
+
+On windows I wrote a small batch file that runs the correct cmake commands and
+copies the output files for easy access.
+
+```
+C:\Code\luv> msvcbuild.bat
+C:\Code\luv> luajit tests\run.lua
+```
+
+On unix systems, use the Makefile.
+
+```
+~/Code/luv> make test
+```
+
+This will build luv as a module library. Module libraries are plugins that are
+not linked into other targets.
+
+#### Build with PUC Lua 5.3
+By default luv is linked with LuaJIT 2.0.4. If you rather like to link luv
+with PUC Lua 5.3 you can run make with:
+
+```
+~/Code/luv> WITH_LUA_ENGINE=Lua make
+```
+
+#### Build as static library
+
+If you want to build luv as a static library run make with:
+
+```
+~/Code/luv> BUILD_MODULE=OFF make
+```
+
+This will create a static library `libluv.a`.
+
+#### Build as shared library
+
+If you want to build luv as a shared library run make with:
+
+```
+~/Code/luv> BUILD_MODULE=OFF BUILD_SHARED_LIBS=ON make
+```
+
+This will create a shared library `libluv.so`.
+
+#### Build with shared libraries
+
+By default the build system will build luv with the supplied dependencies.
+These are:
+ * libuv
+ * LuaJIT or Lua
+
+However, if your target system has already one or more of these dependencies
+installed you can link `luv` against them.
+
+##### Linking with shared libuv
+
+The default shared library name for libuv is `libuv`. To link against it use:
+
+```
+~/Code/luv> WITH_SHARED_LIBUV=ON make
+```
+
+##### Linking with shared LuaJIT
+
+The default shared library name for LuaJIT is `libluajit-5.1`. To link against
+it use:
+
+```
+~/Code/luv> LUA_BUILD_TYPE=System make
+```
+
+##### Linking with shared Lua 5.x
+
+The default shared library name for Lua 5.x is `liblua5.x`. To link against
+it use:
+
+```
+~/Code/luv> LUA_BUILD_TYPE=System WITH_LUA_ENGINE=Lua make
+```
diff --git a/3rdparty/luv/appveyor.yml b/3rdparty/luv/appveyor.yml
new file mode 100644
index 00000000000..b8d01898573
--- /dev/null
+++ b/3rdparty/luv/appveyor.yml
@@ -0,0 +1,42 @@
+os: Visual Studio 2015
+
+# Test with the latest two releases of MSVC
+configuration:
+ - 2015
+ - 2013
+
+# Test with the latest Lua and LuaJIT versions
+environment:
+ LUAROCKS_VER: 2.3.0
+ matrix:
+ - LUA_VER: 5.3.2
+ NOCOMPAT: true # with compatibility flags disabled.
+ - LJ_VER: 2.1
+
+platform:
+ - x86
+ - x64
+
+matrix:
+ fast_finish: true
+
+cache:
+ - c:\lua -> appveyor.yml
+ - c:\external -> appveyor.yml
+
+install:
+ - git submodule update --init
+
+build_script:
+ - msvcbuild.bat
+ - luajit.exe tests\run.lua
+ # Test rock installation
+ - call .ci\set_compiler_env.bat
+ - call .ci\install.bat
+ - luarocks make
+ - ps: if("$(Get-Location)" -eq $(lua -e "print(require'luv'.cwd())")) { "LuaRocks test OK" } else { "LuaRocks test failed"; exit 1 }
+ - luarocks remove luv
+
+artifacts:
+ - path: luv.dll
+ - path: luajit.exe
diff --git a/3rdparty/luv/cmake/Modules/FindLibuv.cmake b/3rdparty/luv/cmake/Modules/FindLibuv.cmake
new file mode 100644
index 00000000000..045362ae5db
--- /dev/null
+++ b/3rdparty/luv/cmake/Modules/FindLibuv.cmake
@@ -0,0 +1,11 @@
+# Locate libuv library
+# This module defines
+# LIBUV_FOUND, if false, do not try to link to libuv
+# LIBUV_LIBRARIES
+# LIBUV_INCLUDE_DIR, where to find uv.h
+
+FIND_PATH(LIBUV_INCLUDE_DIR NAMES uv.h)
+FIND_LIBRARY(LIBUV_LIBRARIES NAMES uv libuv)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUV DEFAULT_MSG LIBUV_LIBRARIES LIBUV_INCLUDE_DIR)
diff --git a/3rdparty/luv/cmake/Modules/FindLuaJIT.cmake b/3rdparty/luv/cmake/Modules/FindLuaJIT.cmake
new file mode 100644
index 00000000000..b9c2c3ee41a
--- /dev/null
+++ b/3rdparty/luv/cmake/Modules/FindLuaJIT.cmake
@@ -0,0 +1,55 @@
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2013 Rolf Eike Beer <eike@sf-mail.de>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# We use code from the CMake project to detect the Lua version.
+
+# Locate LuaJIT library
+# This module defines
+# LUAJIT_FOUND, if false, do not try to link to Lua JIT
+# LUAJIT_LIBRARIES
+# LUAJIT_INCLUDE_DIR, where to find lua.h
+#
+# Additionally it defines the Lua API/ABI version:
+# LUA_VERSION_STRING - the version of Lua found
+# LUA_VERSION_MAJOR - the major version of Lua
+# LUA_VERSION_MINOR - the minor version of Lua
+# LUA_VERSION_PATCH - the patch version of Lua
+
+FIND_PATH(LUAJIT_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES luajit-2.0)
+FIND_LIBRARY(LUAJIT_LIBRARIES NAMES luajit-5.1)
+
+if (LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/lua.h")
+ # At least 5.[012] have different ways to express the version
+ # so all of them need to be tested. Lua 5.2 defines LUA_VERSION
+ # and LUA_RELEASE as joined by the C preprocessor, so avoid those.
+ file(STRINGS "${LUAJIT_INCLUDE_DIR}/lua.h" lua_version_strings
+ REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
+
+ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
+ if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
+ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
+ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
+ set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
+ else ()
+ string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
+ if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
+ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
+ endif ()
+ string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
+ endif ()
+
+ unset(lua_version_strings)
+endif()
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LUAJIT DEFAULT_MSG LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR)
diff --git a/3rdparty/luv/deps/lua.cmake b/3rdparty/luv/deps/lua.cmake
new file mode 100644
index 00000000000..393e67a107a
--- /dev/null
+++ b/3rdparty/luv/deps/lua.cmake
@@ -0,0 +1,128 @@
+# Modfied from luajit.cmake
+# Added LUAJIT_ADD_EXECUTABLE Ryan Phillips <ryan at trolocsis.com>
+# This CMakeLists.txt has been first taken from LuaDist
+# Copyright (C) 2007-2011 LuaDist.
+# Created by Peter Drahoš
+# Redistribution and use of this file is allowed according to the terms of the MIT license.
+# Debugged and (now seriously) modified by Ronan Collobert, for Torch7
+
+#project(Lua53 C)
+
+SET(LUA_DIR ${CMAKE_CURRENT_LIST_DIR}/lua)
+
+SET(CMAKE_REQUIRED_INCLUDES
+ ${LUA_DIR}
+ ${LUA_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+OPTION(WITH_AMALG "Build eveything in one shot (needs memory)" ON)
+
+# Ugly warnings
+IF(MSVC)
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+ENDIF()
+
+# Various includes
+INCLUDE(CheckLibraryExists)
+INCLUDE(CheckFunctionExists)
+INCLUDE(CheckCSourceCompiles)
+INCLUDE(CheckTypeSize)
+
+CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P)
+IF(SIZEOF_VOID_P EQUAL 8)
+ ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
+ENDIF()
+
+IF(NOT WIN32)
+ FIND_LIBRARY(DL_LIBRARY "dl")
+ IF(DL_LIBRARY)
+ SET(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY})
+ LIST(APPEND LIBS ${DL_LIBRARY})
+ ENDIF(DL_LIBRARY)
+ CHECK_FUNCTION_EXISTS(dlopen LUA_USE_DLOPEN)
+ IF(NOT LUA_USE_DLOPEN)
+ MESSAGE(FATAL_ERROR "Cannot compile a useful lua.
+Function dlopen() seems not to be supported on your platform.
+Apparently you are not on a Windows platform as well.
+So lua has no way to deal with shared libraries!")
+ ENDIF(NOT LUA_USE_DLOPEN)
+ENDIF(NOT WIN32)
+
+check_library_exists(m sin "" LUA_USE_LIBM)
+if ( LUA_USE_LIBM )
+ list ( APPEND LIBS m )
+endif ()
+
+## SOURCES
+SET(SRC_LUALIB
+ ${LUA_DIR}/src/lbaselib.c
+ ${LUA_DIR}/src/lcorolib.c
+ ${LUA_DIR}/src/ldblib.c
+ ${LUA_DIR}/src/liolib.c
+ ${LUA_DIR}/src/lmathlib.c
+ ${LUA_DIR}/src/loadlib.c
+ ${LUA_DIR}/src/loslib.c
+ ${LUA_DIR}/src/lstrlib.c
+ ${LUA_DIR}/src/ltablib.c
+ ${LUA_DIR}/src/lutf8lib.c)
+
+SET(SRC_LUACORE
+ ${LUA_DIR}/src/lauxlib.c
+ ${LUA_DIR}/src/lapi.c
+ ${LUA_DIR}/src/lcode.c
+ ${LUA_DIR}/src/lctype.c
+ ${LUA_DIR}/src/ldebug.c
+ ${LUA_DIR}/src/ldo.c
+ ${LUA_DIR}/src/ldump.c
+ ${LUA_DIR}/src/lfunc.c
+ ${LUA_DIR}/src/lgc.c
+ ${LUA_DIR}/src/linit.c
+ ${LUA_DIR}/src/llex.c
+ ${LUA_DIR}/src/lmem.c
+ ${LUA_DIR}/src/lobject.c
+ ${LUA_DIR}/src/lopcodes.c
+ ${LUA_DIR}/src/lparser.c
+ ${LUA_DIR}/src/lstate.c
+ ${LUA_DIR}/src/lstring.c
+ ${LUA_DIR}/src/ltable.c
+ ${LUA_DIR}/src/ltm.c
+ ${LUA_DIR}/src/lundump.c
+ ${LUA_DIR}/src/lvm.c
+ ${LUA_DIR}/src/lzio.c
+ ${SRC_LUALIB})
+
+## GENERATE
+
+IF(WITH_SHARED_LUA)
+ IF(WITH_AMALG)
+ add_library(lualib SHARED ${LUA_DIR}/../lua_one.c ${DEPS})
+ ELSE()
+ add_library(lualib SHARED ${SRC_LUACORE} ${DEPS} )
+ ENDIF()
+ELSE()
+ IF(WITH_AMALG)
+ add_library(lualib STATIC ${LUA_DIR}/../lua_one.c ${DEPS} )
+ ELSE()
+ add_library(lualib STATIC ${SRC_LUACORE} ${DEPS} )
+ ENDIF()
+ set_target_properties(lualib PROPERTIES
+ PREFIX "lib" IMPORT_PREFIX "lib")
+ENDIF()
+
+target_link_libraries (lualib ${LIBS} )
+set_target_properties (lualib PROPERTIES OUTPUT_NAME "lua53")
+
+IF(WIN32)
+ add_executable(lua ${LUA_DIR}/src/lua.c)
+ target_link_libraries(lua lualib)
+ELSE()
+ IF(WITH_AMALG)
+ add_executable(lua ${LUA_DIR}/src/lua.c ${LUA_DIR}/lua_one.c ${DEPS})
+ ELSE()
+ add_executable(lua ${LUA_DIR}/src/lua.c ${SRC_LUACORE} ${DEPS})
+ ENDIF()
+ target_link_libraries(lua ${LIBS})
+ SET_TARGET_PROPERTIES(lua PROPERTIES ENABLE_EXPORTS ON)
+ENDIF(WIN32)
+
diff --git a/3rdparty/luv/deps/lua_one.c b/3rdparty/luv/deps/lua_one.c
new file mode 100644
index 00000000000..2531883cc67
--- /dev/null
+++ b/3rdparty/luv/deps/lua_one.c
@@ -0,0 +1,97 @@
+/*
+* one.c -- Lua core, libraries, and interpreter in a single file
+*/
+
+/* default is to build the full interpreter */
+#ifndef MAKE_LIB
+#ifndef MAKE_LUAC
+#ifndef MAKE_LUA
+#define MAKE_LIB
+#endif
+#endif
+#endif
+
+/* choose suitable platform-specific features */
+/* some of these may need extra libraries such as -ldl -lreadline -lncurses */
+#if 0
+#define LUA_USE_LINUX
+#define LUA_USE_MACOSX
+#define LUA_USE_POSIX
+#define LUA_ANSI
+#endif
+
+/* no need to change anything below this line ----------------------------- */
+
+/* setup for luaconf.h */
+#if HAVE_LPREFIX
+# include "lprefix.h"
+#endif
+
+#define LUA_CORE
+#define LUA_LIB
+#define ltable_c
+#define lvm_c
+#include "luaconf.h"
+
+/* do not export internal symbols */
+#undef LUAI_FUNC
+#undef LUAI_DDEC
+#undef LUAI_DDEF
+#define LUAI_FUNC static
+#define LUAI_DDEC static
+#define LUAI_DDEF static
+
+/* core -- used by all */
+#include "lapi.c"
+#include "lcode.c"
+#include "lctype.c"
+#include "ldebug.c"
+#include "ldo.c"
+#include "ldump.c"
+#include "lfunc.c"
+#include "lgc.c"
+#include "llex.c"
+#include "lmem.c"
+#include "lobject.c"
+#include "lopcodes.c"
+#include "lparser.c"
+#include "lstate.c"
+#include "lstring.c"
+#include "ltable.c"
+#include "ltm.c"
+#include "lundump.c"
+#include "lvm.c"
+#include "lzio.c"
+
+/* auxiliary library -- used by all */
+#include "lauxlib.c"
+
+/* standard library -- not used by luac */
+#ifndef MAKE_LUAC
+#include "lbaselib.c"
+#if LUA_VERSION_NUM == 502
+# include "lbitlib.c"
+#endif
+#include "lcorolib.c"
+#include "ldblib.c"
+#include "liolib.c"
+#include "lmathlib.c"
+#include "loadlib.c"
+#include "loslib.c"
+#include "lstrlib.c"
+#include "ltablib.c"
+#if LUA_VERSION_NUM >= 503
+# include "lutf8lib.c"
+#endif
+#include "linit.c"
+#endif
+
+/* lua */
+#ifdef MAKE_LUA
+#include "lua.c"
+#endif
+
+/* luac */
+#ifdef MAKE_LUAC
+#include "luac.c"
+#endif
diff --git a/3rdparty/luv/deps/luajit.cmake b/3rdparty/luv/deps/luajit.cmake
new file mode 100644
index 00000000000..e9d5b3582e1
--- /dev/null
+++ b/3rdparty/luv/deps/luajit.cmake
@@ -0,0 +1,407 @@
+# Added LUAJIT_ADD_EXECUTABLE Ryan Phillips <ryan at trolocsis.com>
+# This CMakeLists.txt has been first taken from LuaDist
+# Copyright (C) 2007-2011 LuaDist.
+# Created by Peter Drahoš
+# Redistribution and use of this file is allowed according to the terms of the MIT license.
+# Debugged and (now seriously) modified by Ronan Collobert, for Torch7
+
+#project(LuaJIT C ASM)
+
+SET(LUAJIT_DIR ${CMAKE_CURRENT_LIST_DIR}/luajit)
+
+SET(CMAKE_REQUIRED_INCLUDES
+ ${LUAJIT_DIR}
+ ${LUAJIT_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+OPTION(WITH_AMALG "Build eveything in one shot (needs memory)" ON)
+
+# Ugly warnings
+IF(MSVC)
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+ENDIF()
+
+# Various includes
+INCLUDE(CheckLibraryExists)
+INCLUDE(CheckFunctionExists)
+INCLUDE(CheckCSourceCompiles)
+INCLUDE(CheckTypeSize)
+
+# LuaJIT specific
+option(LUAJIT_DISABLE_FFI "Disable FFI." OFF)
+option(LUAJIT_ENABLE_LUA52COMPAT "Enable Lua 5.2 compatibility." ON)
+option(LUAJIT_DISABLE_JIT "Disable JIT." OFF)
+option(LUAJIT_CPU_SSE2 "Use SSE2 instead of x87 instructions." ON)
+option(LUAJIT_CPU_NOCMOV "Disable NOCMOV." OFF)
+MARK_AS_ADVANCED(LUAJIT_DISABLE_FFI LUAJIT_ENABLE_LUA52COMPAT LUAJIT_DISABLE_JIT LUAJIT_CPU_SSE2 LUAJIT_CPU_NOCMOV)
+
+IF(LUAJIT_DISABLE_FFI)
+ ADD_DEFINITIONS(-DLUAJIT_DISABLE_FFI)
+ENDIF()
+
+IF(LUAJIT_ENABLE_LUA52COMPAT)
+ ADD_DEFINITIONS(-DLUAJIT_ENABLE_LUA52COMPAT)
+ENDIF()
+
+IF(LUAJIT_DISABLE_JIT)
+ ADD_DEFINITIONS(-DLUAJIT_DISABLE_JIT)
+ENDIF()
+
+IF(LUAJIT_CPU_SSE2)
+ ADD_DEFINITIONS(-DLUAJIT_CPU_SSE2)
+ENDIF()
+
+IF(LUAJIT_CPU_NOCMOV)
+ ADD_DEFINITIONS(-DLUAJIT_CPU_NOCMOV)
+ENDIF()
+######
+
+
+CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P)
+IF(SIZEOF_VOID_P EQUAL 8)
+ ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
+ENDIF()
+
+if ( WIN32 AND NOT CYGWIN )
+ add_definitions ( -DLUAJIT_OS=LUAJIT_OS_WINDOWS)
+ set ( LJVM_MODE coffasm )
+elseif ( APPLE )
+ set ( CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000 ${CMAKE_EXE_LINKER_FLAGS}" )
+ set ( LJVM_MODE machasm )
+else ()
+ set ( LJVM_MODE elfasm )
+endif ()
+
+IF(NOT WIN32)
+ FIND_LIBRARY(DL_LIBRARY "dl")
+ IF(DL_LIBRARY)
+ SET(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY})
+ LIST(APPEND LIBS ${DL_LIBRARY})
+ ENDIF(DL_LIBRARY)
+ CHECK_FUNCTION_EXISTS(dlopen LUA_USE_DLOPEN)
+ IF(NOT LUA_USE_DLOPEN)
+ MESSAGE(FATAL_ERROR "Cannot compile a useful lua.
+Function dlopen() seems not to be supported on your platform.
+Apparently you are not on a Windows platform as well.
+So lua has no way to deal with shared libraries!")
+ ENDIF(NOT LUA_USE_DLOPEN)
+ENDIF(NOT WIN32)
+
+check_library_exists(m sin "" LUA_USE_LIBM)
+if ( LUA_USE_LIBM )
+ list ( APPEND LIBS m )
+endif ()
+
+## SOURCES
+MACRO(LJ_TEST_ARCH stuff)
+ CHECK_C_SOURCE_COMPILES("
+#undef ${stuff}
+#include \"lj_arch.h\"
+#if ${stuff}
+int main() { return 0; }
+#else
+#error \"not defined\"
+#endif
+" ${stuff})
+ENDMACRO()
+
+MACRO(LJ_TEST_ARCH_VALUE stuff value)
+ CHECK_C_SOURCE_COMPILES("
+#undef ${stuff}
+#include \"lj_arch.h\"
+#if ${stuff} == ${value}
+int main() { return 0; }
+#else
+#error \"not defined\"
+#endif
+" ${stuff}_${value})
+ENDMACRO()
+
+
+FOREACH(arch X64 X86 ARM PPC PPCSPE MIPS)
+ LJ_TEST_ARCH(LJ_TARGET_${arch})
+ if(LJ_TARGET_${arch})
+ STRING(TOLOWER ${arch} TARGET_LJARCH)
+ MESSAGE(STATUS "LuaJIT Target: ${TARGET_LJARCH}")
+ BREAK()
+ ENDIF()
+ENDFOREACH()
+
+IF(NOT TARGET_LJARCH)
+ MESSAGE(FATAL_ERROR "architecture not supported")
+ELSE()
+ MESSAGE(STATUS "LuaJIT target ${TARGET_LJARCH}")
+ENDIF()
+
+FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/jit)
+FILE(GLOB jit_files ${LUAJIT_DIR}/src/jit/*.lua)
+FILE(COPY ${jit_files} DESTINATION ${CMAKE_BINARY_DIR}/jit)
+
+SET(DASM_ARCH ${TARGET_LJARCH})
+SET(DASM_FLAGS)
+SET(TARGET_ARCH)
+LIST(APPEND TARGET_ARCH "LUAJIT_TARGET=LUAJIT_ARCH_${TARGET_LJARCH}")
+LJ_TEST_ARCH_VALUE(LJ_ARCH_BITS 64)
+IF(LJ_ARCH_BITS_64)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D P64)
+ENDIF()
+LJ_TEST_ARCH_VALUE(LJ_HASJIT 1)
+IF(LJ_HASJIT_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D JIT)
+ENDIF()
+LJ_TEST_ARCH_VALUE(LJ_HASFFI 1)
+IF(LJ_HASFFI_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D FFI)
+ENDIF()
+LJ_TEST_ARCH_VALUE(LJ_DUALNUM 1)
+IF(LJ_DUALNUM_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D DUALNUM)
+ENDIF()
+LJ_TEST_ARCH_VALUE(LJ_ARCH_HASFPU 1)
+IF(LJ_ARCH_HASFPU_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D FPU)
+ LIST(APPEND TARGET_ARCH "LJ_ARCH_HASFPU=1")
+ELSE()
+ LIST(APPEND TARGET_ARCH "LJ_ARCH_HASFPU=0")
+ENDIF()
+LJ_TEST_ARCH_VALUE(LJ_ABI_SOFTFP 1)
+IF(NOT LJ_ABI_SOFTFP_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D HFABI)
+ LIST(APPEND TARGET_ARCH "LJ_ABI_SOFTFP=0")
+ELSE()
+ LIST(APPEND TARGET_ARCH "LJ_ABI_SOFTFP=1")
+ENDIF()
+IF(WIN32)
+ SET(DASM_FLAGS ${DASM_FLAGS} -LN -D WIN)
+ENDIF()
+IF(TARGET_LJARCH STREQUAL "x86")
+ LJ_TEST_ARCH_VALUE(__SSE2__ 1)
+ IF(__SSE2__1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D SSE)
+ ENDIF()
+ENDIF()
+IF(TARGET_LJARCH STREQUAL "x64")
+ SET(DASM_ARCH "x86")
+ENDIF()
+IF(TARGET_LJARCH STREQUAL "ppc")
+ LJ_TEST_ARCH_VALUE(LJ_ARCH_SQRT 1)
+ IF(NOT LJ_ARCH_SQRT_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D SQRT)
+ ENDIF()
+ LJ_TEST_ARCH_VALUE(LJ_ARCH_PPC64 1)
+ IF(NOT LJ_ARCH_PPC64_1)
+ SET(DASM_FLAGS ${DASM_FLAGS} -D GPR64)
+ ENDIF()
+ENDIF()
+
+add_executable(minilua ${LUAJIT_DIR}/src/host/minilua.c)
+SET_TARGET_PROPERTIES(minilua PROPERTIES COMPILE_DEFINITIONS "${TARGET_ARCH}")
+CHECK_LIBRARY_EXISTS(m sin "" MINILUA_USE_LIBM)
+if(MINILUA_USE_LIBM)
+ TARGET_LINK_LIBRARIES(minilua m)
+endif()
+
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/buildvm_arch.h
+ COMMAND minilua ${LUAJIT_DIR}/dynasm/dynasm.lua ${DASM_FLAGS} -o ${CMAKE_CURRENT_BINARY_DIR}/buildvm_arch.h ${LUAJIT_DIR}/src/vm_${DASM_ARCH}.dasc
+ DEPENDS ${LUAJIT_DIR}/dynasm/dynasm.lua minilua
+)
+
+SET(SRC_LJLIB
+ ${LUAJIT_DIR}/src/lib_base.c
+ ${LUAJIT_DIR}/src/lib_math.c
+ ${LUAJIT_DIR}/src/lib_bit.c
+ ${LUAJIT_DIR}/src/lib_string.c
+ ${LUAJIT_DIR}/src/lib_table.c
+ ${LUAJIT_DIR}/src/lib_io.c
+ ${LUAJIT_DIR}/src/lib_os.c
+ ${LUAJIT_DIR}/src/lib_package.c
+ ${LUAJIT_DIR}/src/lib_debug.c
+ ${LUAJIT_DIR}/src/lib_jit.c
+ ${LUAJIT_DIR}/src/lib_ffi.c)
+
+SET(SRC_LJCORE
+ ${LUAJIT_DIR}/src/lj_gc.c
+ ${LUAJIT_DIR}/src/lj_err.c
+ ${LUAJIT_DIR}/src/lj_char.c
+ ${LUAJIT_DIR}/src/lj_buf.c
+ ${LUAJIT_DIR}/src/lj_profile.c
+ ${LUAJIT_DIR}/src/lj_strfmt.c
+ ${LUAJIT_DIR}/src/lj_bc.c
+ ${LUAJIT_DIR}/src/lj_obj.c
+ ${LUAJIT_DIR}/src/lj_str.c
+ ${LUAJIT_DIR}/src/lj_tab.c
+ ${LUAJIT_DIR}/src/lj_func.c
+ ${LUAJIT_DIR}/src/lj_udata.c
+ ${LUAJIT_DIR}/src/lj_meta.c
+ ${LUAJIT_DIR}/src/lj_debug.c
+ ${LUAJIT_DIR}/src/lj_state.c
+ ${LUAJIT_DIR}/src/lj_dispatch.c
+ ${LUAJIT_DIR}/src/lj_vmevent.c
+ ${LUAJIT_DIR}/src/lj_vmmath.c
+ ${LUAJIT_DIR}/src/lj_strscan.c
+ ${LUAJIT_DIR}/src/lj_api.c
+ ${LUAJIT_DIR}/src/lj_lex.c
+ ${LUAJIT_DIR}/src/lj_parse.c
+ ${LUAJIT_DIR}/src/lj_bcread.c
+ ${LUAJIT_DIR}/src/lj_bcwrite.c
+ ${LUAJIT_DIR}/src/lj_load.c
+ ${LUAJIT_DIR}/src/lj_ir.c
+ ${LUAJIT_DIR}/src/lj_opt_mem.c
+ ${LUAJIT_DIR}/src/lj_opt_fold.c
+ ${LUAJIT_DIR}/src/lj_opt_narrow.c
+ ${LUAJIT_DIR}/src/lj_opt_dce.c
+ ${LUAJIT_DIR}/src/lj_opt_loop.c
+ ${LUAJIT_DIR}/src/lj_opt_split.c
+ ${LUAJIT_DIR}/src/lj_opt_sink.c
+ ${LUAJIT_DIR}/src/lj_mcode.c
+ ${LUAJIT_DIR}/src/lj_snap.c
+ ${LUAJIT_DIR}/src/lj_record.c
+ ${LUAJIT_DIR}/src/lj_crecord.c
+ ${LUAJIT_DIR}/src/lj_ffrecord.c
+ ${LUAJIT_DIR}/src/lj_asm.c
+ ${LUAJIT_DIR}/src/lj_trace.c
+ ${LUAJIT_DIR}/src/lj_gdbjit.c
+ ${LUAJIT_DIR}/src/lj_ctype.c
+ ${LUAJIT_DIR}/src/lj_cdata.c
+ ${LUAJIT_DIR}/src/lj_cconv.c
+ ${LUAJIT_DIR}/src/lj_ccall.c
+ ${LUAJIT_DIR}/src/lj_ccallback.c
+ ${LUAJIT_DIR}/src/lj_carith.c
+ ${LUAJIT_DIR}/src/lj_clib.c
+ ${LUAJIT_DIR}/src/lj_cparse.c
+ ${LUAJIT_DIR}/src/lj_lib.c
+ ${LUAJIT_DIR}/src/lj_alloc.c
+ ${LUAJIT_DIR}/src/lj_vmmath.c
+ ${LUAJIT_DIR}/src/lib_aux.c
+ ${LUAJIT_DIR}/src/lib_init.c
+ ${SRC_LJLIB})
+
+SET(SRC_BUILDVM
+ ${LUAJIT_DIR}/src/host/buildvm.c
+ ${LUAJIT_DIR}/src/host/buildvm_asm.c
+ ${LUAJIT_DIR}/src/host/buildvm_peobj.c
+ ${LUAJIT_DIR}/src/host/buildvm_lib.c
+ ${LUAJIT_DIR}/src/host/buildvm_fold.c
+ ${CMAKE_CURRENT_BINARY_DIR}/buildvm_arch.h)
+
+## GENERATE
+ADD_EXECUTABLE(buildvm ${SRC_BUILDVM})
+SET_TARGET_PROPERTIES(buildvm PROPERTIES COMPILE_DEFINITIONS "${TARGET_ARCH}")
+
+macro(add_buildvm_target _target _mode)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}
+ COMMAND buildvm ARGS -m ${_mode} -o ${CMAKE_CURRENT_BINARY_DIR}/${_target} ${ARGN}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS buildvm ${ARGN}
+ )
+endmacro(add_buildvm_target)
+
+if (MSVC)
+ add_buildvm_target ( lj_vm.obj peobj )
+ set (LJ_VM_SRC ${CMAKE_CURRENT_BINARY_DIR}/lj_vm.obj)
+else ()
+ add_buildvm_target ( lj_vm.S ${LJVM_MODE} )
+ set (LJ_VM_SRC ${CMAKE_CURRENT_BINARY_DIR}/lj_vm.S)
+endif ()
+add_buildvm_target ( lj_ffdef.h ffdef ${SRC_LJLIB} )
+add_buildvm_target ( lj_bcdef.h bcdef ${SRC_LJLIB} )
+add_buildvm_target ( lj_folddef.h folddef ${LUAJIT_DIR}/src/lj_opt_fold.c )
+add_buildvm_target ( lj_recdef.h recdef ${SRC_LJLIB} )
+add_buildvm_target ( lj_libdef.h libdef ${SRC_LJLIB} )
+add_buildvm_target ( vmdef.lua vmdef ${SRC_LJLIB} )
+
+SET(DEPS
+ ${LJ_VM_SRC}
+ ${CMAKE_CURRENT_BINARY_DIR}/lj_ffdef.h
+ ${CMAKE_CURRENT_BINARY_DIR}/lj_bcdef.h
+ ${CMAKE_CURRENT_BINARY_DIR}/lj_libdef.h
+ ${CMAKE_CURRENT_BINARY_DIR}/lj_recdef.h
+ ${CMAKE_CURRENT_BINARY_DIR}/lj_folddef.h
+ ${CMAKE_CURRENT_BINARY_DIR}/vmdef.lua
+ )
+
+## COMPILE
+include_directories(
+ ${LUAJIT_DIR}/dynasm
+ ${LUAJIT_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+IF(WITH_SHARED_LUA)
+ IF(WITH_AMALG)
+ add_library(luajit-5.1 SHARED ${LUAJIT_DIR}/src/ljamalg.c ${DEPS} )
+ ELSE()
+ add_library(luajit-5.1 SHARED ${SRC_LJCORE} ${DEPS} )
+ ENDIF()
+ SET_TARGET_PROPERTIES(luajit-5.1 PROPERTIES OUTPUT_NAME "lua51")
+ELSE()
+ IF(WITH_AMALG)
+ add_library(luajit-5.1 STATIC ${LUAJIT_DIR}/src/ljamalg.c ${DEPS} )
+ ELSE()
+ add_library(luajit-5.1 STATIC ${SRC_LJCORE} ${DEPS} )
+ ENDIF()
+ SET_TARGET_PROPERTIES(luajit-5.1 PROPERTIES
+ PREFIX "lib" IMPORT_PREFIX "lib" OUTPUT_NAME "luajit")
+ENDIF()
+
+target_link_libraries (luajit-5.1 ${LIBS} )
+
+IF(WIN32)
+ add_executable(luajit ${LUAJIT_DIR}/src/luajit.c)
+ target_link_libraries(luajit luajit-5.1)
+ELSE()
+ IF(WITH_AMALG)
+ add_executable(luajit ${LUAJIT_DIR}/src/luajit.c ${LUAJIT_DIR}/src/ljamalg.c ${DEPS})
+ ELSE()
+ add_executable(luajit ${LUAJIT_DIR}/src/luajit.c ${SRC_LJCORE} ${DEPS})
+ ENDIF()
+ target_link_libraries(luajit ${LIBS})
+ SET_TARGET_PROPERTIES(luajit PROPERTIES ENABLE_EXPORTS ON)
+ENDIF()
+
+MACRO(LUAJIT_add_custom_commands luajit_target)
+ SET(target_srcs "")
+ FOREACH(file ${ARGN})
+ IF(${file} MATCHES ".*\\.lua$")
+ set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
+ set(source_file ${file})
+ string(LENGTH ${CMAKE_SOURCE_DIR} _luajit_source_dir_length)
+ string(LENGTH ${file} _luajit_file_length)
+ math(EXPR _begin "${_luajit_source_dir_length} + 1")
+ math(EXPR _stripped_file_length "${_luajit_file_length} - ${_luajit_source_dir_length} - 1")
+ string(SUBSTRING ${file} ${_begin} ${_stripped_file_length} stripped_file)
+
+ set(generated_file "${CMAKE_BINARY_DIR}/jitted_tmp/${stripped_file}_${luajit_target}_generated${CMAKE_C_OUTPUT_EXTENSION}")
+
+ add_custom_command(
+ OUTPUT ${generated_file}
+ MAIN_DEPENDENCY ${source_file}
+ DEPENDS luajit
+ COMMAND luajit
+ ARGS -bg
+ ${source_file}
+ ${generated_file}
+ COMMENT "Building Luajitted ${source_file}: ${generated_file}"
+ )
+
+ get_filename_component(basedir ${generated_file} PATH)
+ file(MAKE_DIRECTORY ${basedir})
+
+ set(target_srcs ${target_srcs} ${generated_file})
+ set_source_files_properties(
+ ${generated_file}
+ properties
+ external_object true # this is an object file
+ generated true # to say that "it is OK that the obj-files do not exist before build time"
+ )
+ ELSE()
+ set(target_srcs ${target_srcs} ${file})
+ ENDIF(${file} MATCHES ".*\\.lua$")
+ ENDFOREACH(file)
+ENDMACRO()
+
+MACRO(LUAJIT_ADD_EXECUTABLE luajit_target)
+ LUAJIT_add_custom_commands(${luajit_target} ${ARGN})
+ add_executable(${luajit_target} ${target_srcs})
+ENDMACRO(LUAJIT_ADD_EXECUTABLE luajit_target)
diff --git a/3rdparty/luv/deps/uv.cmake b/3rdparty/luv/deps/uv.cmake
new file mode 100644
index 00000000000..b6570b26b60
--- /dev/null
+++ b/3rdparty/luv/deps/uv.cmake
@@ -0,0 +1,224 @@
+## Modifications
+## Copyright 2014 The Luvit Authors. All Rights Reserved.
+
+## Original Copyright
+# Copyright (c) 2014 David Capello
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+include(CheckTypeSize)
+
+cmake_minimum_required(VERSION 2.8.9)
+
+set(LIBUVDIR ${CMAKE_CURRENT_LIST_DIR}/libuv)
+
+include_directories(
+ ${LIBUVDIR}/src
+ ${LIBUVDIR}/include
+)
+
+set(SOURCES
+ ${LIBUVDIR}/include/uv.h
+ ${LIBUVDIR}/include/tree.h
+ ${LIBUVDIR}/include/uv-errno.h
+ ${LIBUVDIR}/include/uv-threadpool.h
+ ${LIBUVDIR}/include/uv-version.h
+ ${LIBUVDIR}/src/fs-poll.c
+ ${LIBUVDIR}/src/heap-inl.h
+ ${LIBUVDIR}/src/inet.c
+ ${LIBUVDIR}/src/queue.h
+ ${LIBUVDIR}/src/threadpool.c
+ ${LIBUVDIR}/src/uv-common.c
+ ${LIBUVDIR}/src/uv-common.h
+ ${LIBUVDIR}/src/version.c
+)
+
+if(WIN32)
+ add_definitions(
+ -D_WIN32_WINNT=0x0600
+ -D_CRT_SECURE_NO_WARNINGS
+ -D_GNU_SOURCE
+ )
+ set(SOURCES ${SOURCES}
+ ${LIBUVDIR}/include/uv-win.h
+ ${LIBUVDIR}/src/win/async.c
+ ${LIBUVDIR}/src/win/atomicops-inl.h
+ ${LIBUVDIR}/src/win/core.c
+ ${LIBUVDIR}/src/win/dl.c
+ ${LIBUVDIR}/src/win/error.c
+ ${LIBUVDIR}/src/win/fs.c
+ ${LIBUVDIR}/src/win/fs-event.c
+ ${LIBUVDIR}/src/win/getaddrinfo.c
+ ${LIBUVDIR}/src/win/getnameinfo.c
+ ${LIBUVDIR}/src/win/handle.c
+ ${LIBUVDIR}/src/win/handle-inl.h
+ ${LIBUVDIR}/src/win/internal.h
+ ${LIBUVDIR}/src/win/loop-watcher.c
+ ${LIBUVDIR}/src/win/pipe.c
+ ${LIBUVDIR}/src/win/thread.c
+ ${LIBUVDIR}/src/win/poll.c
+ ${LIBUVDIR}/src/win/process.c
+ ${LIBUVDIR}/src/win/process-stdio.c
+ ${LIBUVDIR}/src/win/req.c
+ ${LIBUVDIR}/src/win/req-inl.h
+ ${LIBUVDIR}/src/win/signal.c
+ ${LIBUVDIR}/src/win/snprintf.c
+ ${LIBUVDIR}/src/win/stream.c
+ ${LIBUVDIR}/src/win/stream-inl.h
+ ${LIBUVDIR}/src/win/tcp.c
+ ${LIBUVDIR}/src/win/tty.c
+ ${LIBUVDIR}/src/win/timer.c
+ ${LIBUVDIR}/src/win/udp.c
+ ${LIBUVDIR}/src/win/util.c
+ ${LIBUVDIR}/src/win/winapi.c
+ ${LIBUVDIR}/src/win/winapi.h
+ ${LIBUVDIR}/src/win/winsock.c
+ ${LIBUVDIR}/src/win/winsock.h
+ )
+else()
+ include_directories(${LIBUVDIR}/src/unix)
+ set(SOURCES ${SOURCES}
+ ${LIBUVDIR}/include/uv-unix.h
+ ${LIBUVDIR}/include/uv-linux.h
+ ${LIBUVDIR}/include/uv-sunos.h
+ ${LIBUVDIR}/include/uv-darwin.h
+ ${LIBUVDIR}/include/uv-bsd.h
+ ${LIBUVDIR}/include/uv-aix.h
+ ${LIBUVDIR}/src/unix/async.c
+ ${LIBUVDIR}/src/unix/atomic-ops.h
+ ${LIBUVDIR}/src/unix/core.c
+ ${LIBUVDIR}/src/unix/dl.c
+ ${LIBUVDIR}/src/unix/fs.c
+ ${LIBUVDIR}/src/unix/getaddrinfo.c
+ ${LIBUVDIR}/src/unix/getnameinfo.c
+ ${LIBUVDIR}/src/unix/internal.h
+ ${LIBUVDIR}/src/unix/loop.c
+ ${LIBUVDIR}/src/unix/loop-watcher.c
+ ${LIBUVDIR}/src/unix/pipe.c
+ ${LIBUVDIR}/src/unix/poll.c
+ ${LIBUVDIR}/src/unix/process.c
+ ${LIBUVDIR}/src/unix/signal.c
+ ${LIBUVDIR}/src/unix/spinlock.h
+ ${LIBUVDIR}/src/unix/stream.c
+ ${LIBUVDIR}/src/unix/tcp.c
+ ${LIBUVDIR}/src/unix/thread.c
+ ${LIBUVDIR}/src/unix/timer.c
+ ${LIBUVDIR}/src/unix/tty.c
+ ${LIBUVDIR}/src/unix/udp.c
+ )
+endif()
+
+check_type_size("void*" SIZEOF_VOID_P)
+if(SIZEOF_VOID_P EQUAL 8)
+ add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
+endif()
+
+## Freebsd
+if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
+ set(SOURCES ${SOURCES}
+ ${LIBUVDIR}/src/unix/kqueue.c
+ ${LIBUVDIR}/src/unix/freebsd.c
+ )
+endif()
+
+## Linux
+if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ add_definitions(
+ -D_GNU_SOURCE
+ )
+ set(SOURCES ${SOURCES}
+ ${LIBUVDIR}/src/unix/proctitle.c
+ ${LIBUVDIR}/src/unix/linux-core.c
+ ${LIBUVDIR}/src/unix/linux-inotify.c
+ ${LIBUVDIR}/src/unix/linux-syscalls.c
+ ${LIBUVDIR}/src/unix/linux-syscalls.h
+ )
+endif()
+
+## SunOS
+if("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
+ add_definitions(
+ -D__EXTENSIONS__
+ -D_XOPEN_SOURCE=500
+ )
+ set(SOURCES ${SOURCES}
+ ${LIBUVDIR}/src/unix/sunos.c
+ )
+endif()
+
+## Darwin
+if(APPLE)
+ add_definitions(
+ -D=_DARWIN_USE_64_BIT_INODE
+ )
+ set(SOURCES ${SOURCES}
+ ${LIBUVDIR}/src/unix/proctitle.c
+ ${LIBUVDIR}/src/unix/darwin.c
+ ${LIBUVDIR}/src/unix/fsevents.c
+ ${LIBUVDIR}/src/unix/darwin-proctitle.c
+ ${LIBUVDIR}/src/unix/kqueue.c
+ )
+endif()
+
+add_library(uv STATIC ${SOURCES})
+set_property(TARGET uv PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+if("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
+ target_link_libraries(uv
+ pthread
+ kvm
+ )
+endif()
+
+if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ target_link_libraries(uv
+ pthread
+ )
+endif()
+
+if(WIN32)
+ target_link_libraries(uv
+ ws2_32.lib
+ shell32.lib
+ psapi.lib
+ iphlpapi.lib
+ advapi32.lib
+ Userenv.lib
+ )
+endif()
+
+if("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
+ target_link_libraries(uv
+ kstat
+ socket
+ sendfile
+ )
+endif()
+
+if(APPLE)
+ find_library(FOUNDATION_LIBRARY Foundation)
+ find_library(CORESERVICES_LIBRARY CoreServices)
+ find_library(APPLICATION_SERVICES_LIBRARY ApplicationServices)
+ target_link_libraries(uv
+ ${FOUNDATION_LIBRARY}
+ ${CORESERVICES_LIBRARY}
+ ${APPLICATION_SERVICES_LIBRARY}
+ )
+endif()
diff --git a/3rdparty/luv/docs.md b/3rdparty/luv/docs.md
new file mode 100644
index 00000000000..187dec24ff1
--- /dev/null
+++ b/3rdparty/luv/docs.md
@@ -0,0 +1,1309 @@
+# LibUV in Lua
+
+The [luv][] project provides access to the multi-platform support library
+[libuv][] to lua code. It was primariliy developed for the [luvit][] project as
+the `uv` builtin module, but can be used in other lua environments.
+
+### TCP Echo Server Example
+
+Here is a small example showing a TCP echo server:
+
+```lua
+local uv = require('uv')
+
+local server = uv.new_tcp()
+server:bind("127.0.0.1", 1337)
+server:listen(128, function (err)
+ assert(not err, err)
+ local client = uv.new_tcp()
+ server:accept(client)
+ client:read_start(function (err, chunk)
+ assert(not err, err)
+ if chunk then
+ client:write(chunk)
+ else
+ client:shutdown()
+ client:close()
+ end
+ end)
+end)
+print("TCP server listening at 127.0.0.1 port 1337")
+uv.run()
+```
+
+### Methods vs Functions
+
+As a quick note, [libuv][] is a C library and as such, there are no such things
+as methods. The [luv][] bindings allow calling the libuv functions as either
+functions or methods. For example, calling `server:bind(host, port)` is
+equivalent to calling `uv.tcp_bind(server, host, port)`. All wrapped uv types
+in lua have method shortcuts where is makes sense. Some are even renamed
+shorter like the `tcp_` prefix that removed in method form. Under the hood it's
+the exact same C function.
+
+## Table Of Contents
+
+The rest of the docs are organized by libuv type. There is some hierarchy as
+most types are considered handles and some are considered streams.
+
+ - [`uv_loop_t`][] — Event loop
+ - [`uv_handle_t`][] — Base handle
+ - [`uv_timer_t`][] — Timer handle
+ - [`uv_prepare_t`][] — Prepare handle
+ - [`uv_check_t`][] — Check handle
+ - [`uv_idle_t`][] — Idle handle
+ - [`uv_async_t`][] — Async handle
+ - [`uv_poll_t`][] — Poll handle
+ - [`uv_signal_t`][] — Signal handle
+ - [`uv_process_t`][] — Process handle
+ - [`uv_stream_t`][] — Stream handle
+ - [`uv_tcp_t`][] — TCP handle
+ - [`uv_pipe_t`][] — Pipe handle
+ - [`uv_tty_t`][] — TTY handle
+ - [`uv_udp_t`][] — UDP handle
+ - [`uv_fs_event_t`][] — FS Event handle
+ - [`uv_fs_poll_t`][] — FS Poll handle
+ - [Filesystem operations][]
+ - [DNS utility functions][]
+ - [Miscellaneous utilities][]
+
+## `uv_loop_t` — Event loop
+
+[`uv_loop_t`]: #uv_loop_t--event-loop
+
+The event loop is the central part of libuv’s functionality. It takes care of
+polling for i/o and scheduling callbacks to be run based on different sources of
+events.
+
+In [luv][], there is an implicit uv loop for every lua state that loads the
+library. You can use this library in an multithreaded environment as long as
+each thread has it's own lua state with corresponsding own uv loop.
+
+### `uv.loop_close()`
+
+Closes all internal loop resources. This function must only be called once the
+loop has finished its execution or it will raise a UV_EBUSY error.
+
+### `uv.run([mode])`
+
+> optional `mode` defaults to `"default"`
+
+This function runs the event loop. It will act differently depending on the
+specified mode:
+
+ - `"default"`: Runs the event loop until there are no more active and
+ referenced handles or requests. Always returns `false`.
+
+ - `"once"`: Poll for i/o once. Note that this function blocks if there are no
+ pending callbacks. Returns `false` when done (no active handles or requests
+ left), or `true` if more callbacks are expected (meaning you should run
+ the event loop again sometime in the future).
+
+ - `"nowait"`: Poll for i/o once but don’t block if there are no
+ pending callbacks. Returns `false` if done (no active handles or requests
+ left), or `true` if more callbacks are expected (meaning you should run
+ the event loop again sometime in the future).
+
+Luvit will implicitly call `uv.run()` after loading user code, but if you use
+the `luv` bindings directly, you need to call this after registering your
+initial set of event callbacks to start the event loop.
+
+### `uv.loop_alive()`
+
+Returns true if there are active handles or request in the loop.
+
+### `uv.stop()`
+
+Stop the event loop, causing `uv_run()` to end as soon as possible. This
+will happen not sooner than the next loop iteration. If this function was called
+before blocking for i/o, the loop won’t block for i/o on this iteration.
+
+### `uv.backend_fd()`
+
+Get backend file descriptor. Only kqueue, epoll and event ports are supported.
+
+This can be used in conjunction with `uv_run("nowait")` to poll in one thread
+and run the event loop’s callbacks in another.
+
+**Note**: Embedding a kqueue fd in another kqueue pollset doesn’t work on all
+platforms. It’s not an error to add the fd but it never generates events.
+
+### `uv.backend_timeout()`
+
+Get the poll timeout. The return value is in milliseconds, or -1 for no timeout.
+
+### `uv.now()`
+
+Return the current timestamp in milliseconds. The timestamp is cached at the
+start of the event loop tick, see `uv.update_time()` for details and rationale.
+
+The timestamp increases monotonically from some arbitrary point in time. Don’t
+make assumptions about the starting point, you will only get disappointed.
+
+**Note**: Use `uv.hrtime()` if you need sub-millisecond granularity.
+
+### `uv.update_time()`
+
+Update the event loop’s concept of “nowâ€. Libuv caches the current time at the
+start of the event loop tick in order to reduce the number of time-related
+system calls.
+
+You won’t normally need to call this function unless you have callbacks that
+block the event loop for longer periods of time, where “longer†is somewhat
+subjective but probably on the order of a millisecond or more.
+
+### `uv.walk(callback)`
+
+Walk the list of handles: `callback` will be executed with the handle.
+
+```lua
+-- Example usage of uv.walk to close all handles that aren't already closing.
+uv.walk(function (handle)
+ if not handle:is_closing() then
+ handle:close()
+ end
+end)
+```
+
+## `uv_handle_t` — Base handle
+
+[`uv_handle_t`]: #uv_handle_t--base-handle
+
+`uv_handle_t` is the base type for all libuv handle types.
+
+Structures are aligned so that any libuv handle can be cast to `uv_handle_t`.
+All API functions defined here work with any handle type.
+
+### `uv.is_active(handle)`
+
+> method form `handle:is_active()`
+
+Returns `true` if the handle is active, `false` if it’s inactive. What “activeâ€
+means depends on the type of handle:
+
+ - A [`uv_async_t`][] handle is always active and cannot be deactivated, except
+ by closing it with uv_close().
+
+ - A [`uv_pipe_t`][], [`uv_tcp_t`][], [`uv_udp_t`][], etc. handlebasically any
+ handle that deals with i/ois active when it is doing something that
+ involves i/o, like reading, writing, connecting, accepting new connections,
+ etc.
+
+ - A [`uv_check_t`][], [`uv_idle_t`][], [`uv_timer_t`][], etc. handle is active
+ when it has been started with a call to `uv.check_start()`,
+ `uv.idle_start()`, etc.
+
+Rule of thumb: if a handle of type `uv_foo_t` has a `uv.foo_start()` function,
+then it’s active from the moment that function is called. Likewise,
+`uv.foo_stop()` deactivates the handle again.
+
+### `uv.is_closing(handle)`
+
+> method form `handle:is_closing()`
+
+Returns `true` if the handle is closing or closed, `false` otherwise.
+
+**Note**: This function should only be used between the initialization of the
+handle and the arrival of the close callback.
+
+### `uv.close(handle, callback)`
+
+> method form `handle:close(callback)`
+
+Request handle to be closed. `callback` will be called asynchronously after this
+call. This MUST be called on each handle before memory is released.
+
+Handles that wrap file descriptors are closed immediately but `callback` will
+still be deferred to the next iteration of the event loop. It gives you a chance
+to free up any resources associated with the handle.
+
+In-progress requests, like `uv_connect_t` or `uv_write_t`, are cancelled and
+have their callbacks called asynchronously with `status=UV_ECANCELED`.
+
+### `uv.ref(handle)`
+
+> method form `handle:ref()`
+
+Reference the given handle. References are idempotent, that is, if a handle is
+already referenced calling this function again will have no effect.
+
+See [Reference counting][].
+
+### `uv.unref(handle)`
+
+> method form `handle:unref()`
+
+Un-reference the given handle. References are idempotent, that is, if a handle
+is not referenced calling this function again will have no effect.
+
+See [Reference counting][].
+
+### `uv.has_ref(handle)`
+
+> method form `handle:has_ref()`
+
+Returns `true` if the handle referenced, `false` otherwise.
+
+See [Reference counting][].
+
+### `uv.send_buffer_size(handle, [size]) -> size`
+
+> method form `handle:send_buffer_size(size)`
+
+Gets or sets the size of the send buffer that the operating system uses for the
+socket.
+
+If `size` is omitted, it will return the current send buffer size, otherwise it
+will use `size` to set the new send buffer size.
+
+This function works for TCP, pipe and UDP handles on Unix and for TCP and UDP
+handles on Windows.
+
+**Note**: Linux will set double the size and return double the size of the
+original set value.
+
+### `uv.recv_buffer_size(handle, [size])`
+
+> method form `handle:recv_buffer_size(size)`
+
+Gets or sets the size of the receive buffer that the operating system uses for
+the socket.
+
+If `size` is omitted, it will return the current receive buffer size, otherwise
+it will use `size` to set the new receive buffer size.
+
+This function works for TCP, pipe and UDP handles on Unix and for TCP and UDP
+handles on Windows.
+
+**Note**: Linux will set double the size and return double the size of the
+original set value.
+
+### `uv.fileno(handle)`
+
+> method form `handle:fileno()`
+
+Gets the platform dependent file descriptor equivalent.
+
+The following handles are supported: TCP, pipes, TTY, UDP and poll. Passing any
+other handle type will fail with UV_EINVAL.
+
+If a handle doesn’t have an attached file descriptor yet or the handle itself
+has been closed, this function will return UV_EBADF.
+
+**Warning**: Be very careful when using this function. libuv assumes it’s in
+control of the file descriptor so any change to it may lead to malfunction.
+
+## Reference counting
+
+[reference counting]: #reference-counting
+
+The libuv event loop (if run in the default mode) will run until there are no
+active and referenced handles left. The user can force the loop to exit early by
+unreferencing handles which are active, for example by calling `uv.unref()`
+after calling `uv.timer_start()`.
+
+A handle can be referenced or unreferenced, the refcounting scheme doesn’t use a
+counter, so both operations are idempotent.
+
+All handles are referenced when active by default, see `uv.is_active()` for a
+more detailed explanation on what being active involves.
+
+## `uv_timer_t` — Timer handle
+
+[`uv_timer_t`]: #uv_timer_t--timer-handle
+
+Timer handles are used to schedule callbacks to be called in the future.
+
+### `uv.new_timer() -> timer`
+
+Creates and initializes a new `uv_timer_t`. Returns the lua userdata wrapping
+it.
+
+```lua
+-- Creating a simple setTimeout wrapper
+local function setTimeout(timeout, callback)
+ local timer = uv.new_timer()
+ timer:start(timeout, 0, function ()
+ timer:stop()
+ timer:close()
+ callback()
+ end)
+ return timer
+end
+
+-- Creating a simple setInterval wrapper
+local function setInterval(interval, callback)
+ local timer = uv.new_timer()
+ timer:start(interval, interval, function ()
+ timer:stop()
+ timer:close()
+ callback()
+ end)
+ return timer
+end
+
+-- And clearInterval
+local function clearInterval(timer)
+ timer:stop()
+ timer:close()
+end
+```
+
+### `uv.timer_start(timer, timeout, repeat, callback)`
+
+> method form `timer:start(timeout, repeat, callback)`
+
+Start the timer. `timeout` and `repeat` are in milliseconds.
+
+If `timeout` is zero, the callback fires on the next event loop iteration. If
+`repeat` is non-zero, the callback fires first after timeout milliseconds and
+then repeatedly after repeat milliseconds.
+
+### `uv.timer_stop(timer)`
+
+> method form `timer:stop()`
+
+Stop the timer, the callback will not be called anymore.
+
+### `uv.timer_again(timer)`
+
+> method form `timer:again()`
+
+Stop the timer, and if it is repeating restart it using the repeat value as the
+timeout. If the timer has never been started before it raises `EINVAL`.
+
+### `uv.timer_set_repeat(timer, repeat)`
+
+> method form `timer:set_repeat(repeat)`
+
+Set the repeat value in milliseconds.
+
+**Note**: If the repeat value is set from a timer callback it does not
+immediately take effect. If the timer was non-repeating before, it will have
+been stopped. If it was repeating, then the old repeat value will have been
+used to schedule the next timeout.
+
+### `uv.timer_get_repeat(timer) -> repeat`
+
+> method form `timer:get_repeat() -> repeat`
+
+Get the timer repeat value.
+
+## `uv_prepare_t` — Prepare handle
+
+[`uv_prepare_t`]: #uv_prepare_t--prepare-handle
+
+Prepare handles will run the given callback once per loop iteration, right before polling for i/o.
+
+```lua
+local prepare = uv.new_prepare()
+prepare:start(function()
+ print("Before I/O polling")
+end)
+```
+
+### `uv.new_prepare() -> prepare`
+
+Creates and initializes a new `uv_prepare_t`. Returns the lua userdata wrapping
+it.
+
+### `uv.prepare_start(prepare, callback)`
+
+> method form `prepare:start(callback)`
+
+Start the handle with the given callback.
+
+### `uv.prepare_stop(prepare)`
+
+> method form `prepare:stop()`
+
+Stop the handle, the callback will no longer be called.
+
+## `uv_check_t` — Check handle
+
+[`uv_check_t`]: #uv_check_t--check-handle
+
+Check handles will run the given callback once per loop iteration, right after
+polling for i/o.
+
+```lua
+local check = uv.new_check()
+check:start(function()
+ print("After I/O polling")
+end)
+```
+
+### `uv.new_check() -> check`
+
+Creates and initializes a new `uv_check_t`. Returns the lua userdata wrapping
+it.
+
+### `uv.check_start(check, callback)`
+
+> method form `check:start(callback)`
+
+Start the handle with the given callback.
+
+### `uv.check_stop(check)`
+
+> method form `check:stop()`
+
+Stop the handle, the callback will no longer be called.
+
+## `uv_idle_t` — Idle handle
+
+[`uv_idle_t`]: #uv_idle_t--idle-handle
+
+Idle handles will run the given callback once per loop iteration, right before
+the [`uv_prepare_t`][] handles.
+
+**Note**: The notable difference with prepare handles is that when there are
+active idle handles, the loop will perform a zero timeout poll instead of
+blocking for i/o.
+
+**Warning**: Despite the name, idle handles will get their callbacks called on
+every loop iteration, not when the loop is actually “idleâ€.
+
+```lua
+local idle = uv.new_idle()
+idle:start(function()
+ print("Before I/O polling, no blocking")
+end)
+```
+### `uv.new_idle() -> idle`
+
+Creates and initializes a new `uv_idle_t`. Returns the lua userdata wrapping
+it.
+
+### `uv.idle_start(idle, callback)`
+
+> method form `idle:start(callback)`
+
+Start the handle with the given callback.
+
+### `uv.idle_stop(check)`
+
+> method form `idle:stop()`
+
+Stop the handle, the callback will no longer be called.
+
+## `uv_async_t` — Async handle
+
+[`uv_async_t`]: #uv_async_t--async-handle
+
+Async handles allow the user to “wakeup†the event loop and get a callback
+called from another thread.
+
+```lua
+local async
+async = uv.new_async(function()
+ print("async operation ran")
+ async:close()
+end)
+
+async:send()
+```
+
+### `uv.new_async(callback) -> async`
+
+Creates and initializes a new `uv_async_t`. Returns the lua userdata wrapping
+it. A NULL callback is allowed.
+
+**Note**: Unlike other handle initialization functions, it immediately starts
+the handle.
+
+### `uv.async_send(async)`
+
+> method form `async:send()`
+
+Wakeup the event loop and call the async handle’s callback.
+
+**Note**: It’s safe to call this function from any thread. The callback will be
+called on the loop thread.
+
+**Warning**: libuv will coalesce calls to `uv.async_send(async)`, that is, not
+every call to it will yield an execution of the callback, the only guarantee is
+that it will be called at least once. Thus, calling this function may not
+wakeup the event loop if it was already called previously within a short period
+of time.
+
+## `uv_poll_t` — Poll handle
+
+[`uv_poll_t`]: #uv_poll_t--poll-handle
+
+Poll handles are used to watch file descriptors for readability and writability,
+similar to the purpose of [poll(2)](http://linux.die.net/man/2/poll).
+
+The purpose of poll handles is to enable integrating external libraries that
+rely on the event loop to signal it about the socket status changes, like c-ares
+or libssh2. Using `uv_poll_t` for any other purpose is not recommended;
+`uv_tcp_t`, `uv_udp_t`, etc. provide an implementation that is faster and more
+scalable than what can be achieved with `uv_poll_t`, especially on Windows.
+
+It is possible that poll handles occasionally signal that a file descriptor is
+readable or writable even when it isn’t. The user should therefore always be
+prepared to handle EAGAIN or equivalent when it attempts to read from or write
+to the fd.
+
+It is not okay to have multiple active poll handles for the same socket, this
+can cause libuv to busyloop or otherwise malfunction.
+
+The user should not close a file descriptor while it is being polled by an
+active poll handle. This can cause the handle to report an error, but it might
+also start polling another socket. However the fd can be safely closed
+immediately after a call to `uv.poll_stop()` or `uv.close()`.
+
+**Note** On windows only sockets can be polled with poll handles. On Unix any
+file descriptor that would be accepted by poll(2) can be used.
+
+
+### `uv.new_poll(fd) -> poll`
+
+Initialize the handle using a file descriptor.
+
+The file descriptor is set to non-blocking mode.
+
+### `uv.new_socket_poll(fd) -> poll`
+
+Initialize the handle using a socket descriptor. On Unix this is identical to
+`uv.poll_init()`. On windows it takes a SOCKET handle.
+
+The socket is set to non-blocking mode.
+
+### `uv.poll_start(poll, events, callback)`
+
+> method form `poll:start()`
+
+Starts polling the file descriptor. `events` is `"r"`, `"w"`, or `"rw"` and
+translates to a bitmask made up of UV_READABLE and UV_WRITABLE. As soon as an
+event is detected the callback will be called with status set to 0, and the
+detected events set on the events field.
+
+The user should not close the socket while the handle is active. If the user
+does that anyway, the callback may be called reporting an error status, but this
+is not guaranteed.
+
+**Note** Calling `uv.poll_start()`` on a handle that is already active is fine.
+Doing so will update the events mask that is being watched for.
+
+## `uv.poll_stop(poll)`
+
+> method form `poll:stop()`
+
+Stop polling the file descriptor, the callback will no longer be called.
+
+## `uv_signal_t` — Signal handle
+
+[`uv_signal_t`]: #uv_signal_t--signal-handle
+
+Signal handles implement Unix style signal handling on a per-event loop bases.
+
+Reception of some signals is emulated on Windows:
+* SIGINT is normally delivered when the user presses CTRL+C. However, like on
+Unix, it is not generated when terminal raw mode is enabled.
+* SIGBREAK is delivered when the user pressed CTRL + BREAK.
+* SIGHUP is generated when the user closes the console window. On SIGHUP the
+program is given approximately 10 seconds to perform cleanup. After that
+Windows will unconditionally terminate it.
+* SIGWINCH is raised whenever libuv detects that the console has been resized.
+SIGWINCH is emulated by libuv when the program uses a uv_tty_t handle to write
+to the console. SIGWINCH may not always be delivered in a timely manner; libuv
+will only detect size changes when the cursor is being moved. When a readable
+[`uv_tty_t`][] handle is used in raw mode, resizing the console buffer will
+also trigger a SIGWINCH signal.
+
+Watchers for other signals can be successfully created, but these signals are
+never received. These signals are: SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGTERM
+and SIGKILL.
+
+Calls to raise() or abort() to programmatically raise a signal are not detected
+by libuv; these will not trigger a signal watcher.
+
+**Note**: On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL
+pthreads library to manage threads. Installing watchers for those signals will
+lead to unpredictable behavior and is strongly discouraged. Future versions of
+libuv may simply reject them.
+
+```lua
+-- Create a new signal handler
+local sigint = uv.new_signal()
+-- Define a handler function
+uv.signal_start(sigint, "sigint", function(signal)
+print("got " .. signal .. ", shutting down")
+os.exit(1)
+end)
+```
+
+### `uv.new_signal() -> signal`
+
+Creates and initializes a new `uv_signal_t`. Returns the lua userdata wrapping
+it.
+
+### `uv.signal_start(signal, signum, callback)`
+
+> method form `signal:start(signum, callback)`
+
+Start the handle with the given callback, watching for the given signal.
+
+### `uv.signal_stop(signal)`
+
+> method form `signal:stop()`
+
+Stop the handle, the callback will no longer be called.
+
+## `uv_process_t` — Process handle
+
+[`uv_process_t`]: #uv_process_t--process-handle
+
+Process handles will spawn a new process and allow the user to control it and
+establish communication channels with it using streams.
+
+### `uv.disable_stdio_inheritance()`
+
+Disables inheritance for file descriptors / handles that this process inherited
+from its parent. The effect is that child processes spawned by this process
+don’t accidentally inherit these handles.
+
+It is recommended to call this function as early in your program as possible,
+before the inherited file descriptors can be closed or duplicated.
+
+**Note** This function works on a best-effort basis: there is no guarantee that
+libuv can discover all file descriptors that were inherited. In general it does
+a better job on Windows than it does on Unix.
+
+### `uv.spawn(file, options, onexit) -> process, pid`
+
+Initializes the process handle and starts the process. If the process is
+successfully spawned, this function will return the handle and pid of the child
+process.
+
+Possible reasons for failing to spawn would include (but not be limited to) the
+file to execute not existing, not having permissions to use the setuid or setgid
+specified, or not having enough memory to allocate for the new process.
+
+
+```lua
+local stdout = uv.new_pipe(false)
+local stderr = uv.new_pipe(false)
+local stdin = uv.new_pipe(false)
+
+local handle, pid
+
+local function onexit(code, signal)
+ p("exit", {code=code,signal=signal})
+end
+
+local function onclose()
+ p("close")
+end
+
+local function onread(err, chunk)
+ assert(not err, err)
+ if (chunk) then
+ p("data", {data=chunk})
+ else
+ p("end")
+ end
+end
+
+local function onshutdown()
+ uv.close(handle, onclose)
+end
+
+handle, pid = uv.spawn("cat", {
+ stdio = {stdin, stdout, stderr}
+}, onexit)
+
+p{
+ handle=handle,
+ pid=pid
+}
+
+uv.read_start(stdout, onread)
+uv.read_start(stderr, onread)
+uv.write(stdin, "Hello World")
+uv.shutdown(stdin, onshutdown)
+```
+
+ - `options.args` - Command line arguments as a list of string. The first string
+ should be the path to the program. On Windows this uses CreateProcess which
+ concatenates the arguments into a string this can cause some strange errors.
+ (See `options.verbatim` below for Windows.)
+ - `options.stdio` - Set the file descriptors that will be made available to the
+ child process. The convention is that the first entries are stdin, stdout,
+ and stderr. (**Note** On Windows file descriptors after the third are
+ available to the child process only if the child processes uses the MSVCRT
+ runtime.)
+ - `options.env` - Set environment variables for the new process.
+ - `options.cwd` - Set current working directory for the subprocess.
+ - `options.uid` - Set the child process' user id.
+ - `options.gid` - Set the child process' group id.
+ - `options.verbatim` - If true, do not wrap any arguments in quotes, or perform
+ any other escaping, when converting the argument list into a command line
+ string. This option is only meaningful on Windows systems. On Unix it is
+ silently ignored.
+ - `options.detached` - If true, spawn the child process in a detached state -
+ this will make it a process group leader, and will effectively enable the
+ child to keep running after the parent exits. Note that the child process
+ will still keep the parent's event loop alive unless the parent process calls
+ `uv.unref()` on the child's process handle.
+ - `options.hide` - If true, hide the subprocess console window that would
+ normally be created. This option is only meaningful on Windows systems. On
+ Unix it is silently ignored.
+
+The `options.stdio` entries can take many shapes.
+
+- If they are numbers, then the child process inherits that same zero-indexed fd
+ from the parent process.
+- If `uv_stream_h` handles are passed in, those are used as a read-write pipe or
+ inherited stream depending if the stream has a valid fd.
+- Including `nil` placeholders means to ignore that fd in the child.
+
+When the child process exits, the `onexit` callback will be called with exit
+code and signal.
+
+### `uv.process_kill(process, sigmun)`
+
+> method form `process:kill(sigmun)`
+
+Sends the specified signal to the given process handle.
+
+### `uv.kill(pid, sigmun)`
+
+Sends the specified signal to the given PID.
+
+## `uv_stream_t` — Stream handle
+
+[`uv_stream_t`]: #uv_stream_t--stream-handle
+
+Stream handles provide an abstraction of a duplex communication channel.
+[`uv_stream_t`][] is an abstract type, libuv provides 3 stream implementations in
+the form of [`uv_tcp_t`][], [`uv_pipe_t`][] and [`uv_tty_t`][].
+
+### `uv.shutdown(stream, [callback]) -> req`
+
+> (method form `stream:shutdown([callback]) -> req`)
+
+Shutdown the outgoing (write) side of a duplex stream. It waits for pending
+write requests to complete. The callback is called after
+shutdown is complete.
+
+### `uv.listen(stream, backlog, callback)`
+
+> (method form `stream:listen(backlog, callback)`)
+
+Start listening for incoming connections. `backlog` indicates the number of
+connections the kernel might queue, same as `listen(2)`. When a new incoming
+connection is received the callback is called.
+
+### `uv.accept(stream, client_stream)`
+
+> (method form `stream:accept(client_stream)`)
+
+This call is used in conjunction with `uv.listen()` to accept incoming
+connections. Call this function after receiving a callback to accept the
+connection.
+
+When the connection callback is called it is guaranteed that this function
+will complete successfully the first time. If you attempt to use it more than
+once, it may fail. It is suggested to only call this function once per
+connection call.
+
+```lua
+server:listen(128, function (err)
+ local client = uv.new_tcp()
+ server:accept(client)
+end)
+```
+
+### `uv.read_start(stream, callback)`
+
+> (method form `stream:read_start(callback)`)
+
+Callback is of the form `(err, data)`.
+
+Read data from an incoming stream. The callback will be made several times until
+there is no more data to read or `uv.read_stop()` is called. When we’ve reached
+EOF, `data` will be `nil`.
+
+```lua
+stream:read_start(function (err, chunk)
+ if err then
+ -- handle read error
+ elseif chunk then
+ -- handle data
+ else
+ -- handle disconnect
+ end
+end)
+```
+
+### `uv.read_stop(stream)`
+
+> (method form `stream:read_stop()`)
+
+Stop reading data from the stream. The read callback will no longer be called.
+
+### `uv.write(stream, data, [callback])`
+
+> (method form `stream:write(data, [callback])`)
+
+Write data to stream.
+
+`data` can either be a lua string or a table of strings. If a table is passed
+in, the C backend will use writev to send all strings in a single system call.
+
+The optional `callback` is for knowing when the write is
+complete.
+
+### `uv.write2(stream, data, send_handle, callback)`
+
+> (method form `stream:write2(data, send_handle, callback)`)
+
+Extended write function for sending handles over a pipe. The pipe must be
+initialized with ip option to `true`.
+
+**Note: `send_handle` must be a TCP socket or pipe, which is a server or a
+connection (listening or connected state). Bound sockets or pipes will be
+assumed to be servers.
+
+### `uv.try_write(stream, data)`
+
+> (method form `stream:try_write(data)`)
+
+Same as `uv.write()`, but won’t queue a write request if it can’t be completed
+immediately.
+
+Will return number of bytes written (can be less than the supplied buffer size).
+
+### `uv.is_readable(stream)`
+
+> (method form `stream:is_readable()`)
+
+Returns `true` if the stream is readable, `false` otherwise.
+
+### `uv.is_writable(stream)`
+
+> (method form `stream:is_writable()`)
+
+Returns `true` if the stream is writable, `false` otherwise.
+
+### `uv.stream_set_blocking(stream, blocking)`
+
+> (method form `stream:set_blocking(blocking)`)
+
+Enable or disable blocking mode for a stream.
+
+When blocking mode is enabled all writes complete synchronously. The interface
+remains unchanged otherwise, e.g. completion or failure of the operation will
+still be reported through a callback which is made asynchronously.
+
+**Warning**: Relying too much on this API is not recommended. It is likely to
+change significantly in the future. Currently this only works on Windows and
+only for uv_pipe_t handles. Also libuv currently makes no ordering guarantee
+when the blocking mode is changed after write requests have already been
+submitted. Therefore it is recommended to set the blocking mode immediately
+after opening or creating the stream.
+
+## `uv_tcp_t` — TCP handle
+
+[`uv_tcp_t`]: #uv_tcp_t--tcp-handle
+
+TCP handles are used to represent both TCP streams and servers.
+
+`uv_tcp_t` is a ‘subclass’ of [`uv_stream_t`][](#uv_stream_t--stream-handle).
+
+### `uv.new_tcp() -> tcp`
+
+Creates and initializes a new `uv_tcp_t`. Returns the lua userdata wrapping it.
+
+### `uv.tcp_open(tcp, sock)`
+
+> (method form `tcp:open(sock)`)
+
+Open an existing file descriptor or SOCKET as a TCP handle.
+
+**Note: The user is responsible for setting the file descriptor in non-blocking
+mode.
+
+### `uv.tcp_nodelay(tcp, enable)`
+
+> (method form `tcp:nodelay(enable)`)
+
+Enable / disable Nagle’s algorithm.
+
+### `uv.tcp_keepalive(tcp, enable, [delay])`
+
+> (method form `tcp:keepalive(enable, [delay])`)
+
+Enable / disable TCP keep-alive. `delay` is the initial delay in seconds, ignored
+when enable is `false`.
+
+### `uv.tcp_simultaneous_accepts(tcp, enable)`
+
+> (method form `tcp:simultaneous_accepts(enable)`)
+
+Enable / disable simultaneous asynchronous accept requests that are queued by
+the operating system when listening for new TCP connections.
+
+This setting is used to tune a TCP server for the desired performance. Having
+simultaneous accepts can significantly improve the rate of accepting connections
+(which is why it is enabled by default) but may lead to uneven load distribution
+in multi-process setups.
+
+### `uv.tcp_bind(tcp, address, port)`
+
+> (method form `tcp:bind(address, port)`)
+
+Bind the handle to an address and port. `address` should be an IP address and
+not a domain name.
+
+When the port is already taken, you can expect to see an UV_EADDRINUSE error
+from either `uv.tcp_bind()`, `uv.listen()` or `uv.tcp_connect()`. That is, a
+successful call to this function does not guarantee that the call to `uv.listen()`
+or `uv.tcp_connect()` will succeed as well.
+
+Use a port of `0` to let the OS assign an ephemeral port. You can look it up
+later using `uv.tcp_getsockname()`.
+
+### `uv.tcp_getsockname(tcp)`
+
+> (method form `tcp:getsockname()`)
+
+Get the current address to which the handle is bound.
+
+### `uv.tcp_getpeername(tcp)`
+
+> (method form `tcp:getpeername()`)
+
+Get the address of the peer connected to the handle.
+
+### `uv.tcp_connect(tcp, address, port, callback) -> req`
+
+> (method form `tcp:connect(host, port, callback) -> req`)
+
+### `uv.tcp_write_queue_size(tcp) -> size`
+
+> (method form `tcp:write_queue_size() -> size`)
+
+Establish an IPv4 or IPv6 TCP connection.
+
+The callback is made when the connection has been established or when a
+connection error happened.
+
+```lua
+local client = uv.new_tcp()
+client:connect("127.0.0.1", 8080, function (err)
+ -- check error and carry on.
+end)
+```
+
+## `uv_pipe_t` — Pipe handle
+
+[`uv_pipe_t`]: #uv_pipe_t--pipe-handle
+
+Pipe handles provide an abstraction over local domain sockets on Unix and named
+pipes on Windows.
+
+```lua
+local pipe = uv.new_pipe(false)
+
+pipe:bind('/tmp/sock.test')
+
+pipe:listen(128, function()
+ local client = uv.new_pipe(false)
+ pipe:accept(client)
+ client:write("hello!\n")
+ client:close()
+end)
+```
+
+### `uv.new_pipe(ipc) -> pipe`
+
+Creates and initializes a new `uv_pipe_t`. Returns the lua userdata wrapping
+it. The `ipc` argument is a boolean to indicate if this pipe will be used for
+handle passing between processes.
+
+### `uv.pipe_open(file) -> pipe`
+
+Open an existing file descriptor or [`uv_handle_t`][] as a pipe.
+
+**Note**: The file descriptor is set to non-blocking mode.
+
+### `uv.pipe_bind(pipe, name)`
+
+> (method form `pipe:bind(name)`)
+
+Bind the pipe to a file path (Unix) or a name (Windows).
+
+**Note**: Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes,
+typically between 92 and 108 bytes.
+
+### `uv.pipe_connect(pipe, name, callback)`
+
+> (method form `pipe:connect(name, callback)`)
+
+Connect to the Unix domain socket or the named pipe.
+
+**Note**: Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes,
+typically between 92 and 108 bytes.
+
+### `uv.pipe_getsockname(pipe)`
+
+> (method form `pipe:getsockname()`)
+
+Returns the name of the Unix domain socket or the named pipe.
+
+### `uv.pipe_pending_instances(pipe, count)`
+
+> (method form `pipe:pending_instances(count)`)
+
+Set the number of pending pipe instance handles when the pipe server is waiting for connections.
+
+**Note**: This setting applies to Windows only.
+
+### `uv.pipe_pending_count(pipe)`
+
+> (method form `pipe:pending_count()`)
+
+Returns the pending pipe count for the named pipe.
+
+### `uv.pipe_pending_type(pipe)`
+
+> (method form `pipe:pending_type()`)
+
+Used to receive handles over IPC pipes.
+
+First - call [`uv.pipe_pending_count`][], if it’s > 0 then initialize a handle
+of the given type, returned by [`uv.pipe_pending_type`][] and call
+[`uv.accept(pipe, handle)`][].
+
+## `uv_tty_t` — TTY handle
+
+[`uv_tty_t`]: #uv_tty_t--tty-handle
+
+TTY handles represent a stream for the console.
+
+```lua
+-- Simple echo program
+local stdin = uv.new_tty(0, true)
+local stdout = uv.new_tty(1, false)
+
+stdin:read_start(function (err, data)
+ assert(not err, err)
+ if data then
+ stdout:write(data)
+ else
+ stdin:close()
+ stdout:close()
+ end
+end)
+```
+
+### uv.new_tty(fd, readable) -> tty
+
+Initialize a new TTY stream with the given file descriptor. Usually the file
+descriptor will be:
+
+ - 0 - stdin
+ - 1 - stdout
+ - 2 - stderr
+
+`readable, specifies if you plan on calling uv_read_start() with this stream.
+`stdin is readable, stdout is not.
+
+On Unix this function will try to open /dev/tty and use it if the passed file
+descriptor refers to a TTY. This lets libuv put the tty in non-blocking mode
+without affecting other processes that share the tty.
+
+Note: If opening `/dev/tty` fails, libuv falls back to blocking writes for
+non-readable TTY streams.
+
+### uv.tty_set_mode(mode)
+
+> (method form `tty:set_mode(mode)`)
+
+Set the TTY using the specified terminal mode.
+
+Parameter `mode` is a C enum with the following values:
+
+- 0 - UV_TTY_MODE_NORMAL: Initial/normal terminal mode
+
+- 1 - UV_TTY_MODE_RAW: Raw input mode (On Windows, ENABLE_WINDOW_INPUT is
+ also enabled)
+
+- 2 - UV_TTY_MODE_IO: Binary-safe I/O mode for IPC (Unix-only)
+
+## uv.tty_reset_mode()
+
+To be called when the program exits. Resets TTY settings to default values for
+the next process to take over.
+
+This function is async signal-safe on Unix platforms but can fail with error
+code UV_EBUSY if you call it when execution is inside uv_tty_set_mode().
+
+## uv.tty_get_winsize() -> w, h
+
+> (method form `tty:get_winsize() -> w, h`)
+
+Gets the current Window size.
+
+## `uv_udp_t` — UDP handle
+
+[`uv_udp_t`]: #uv_udp_t--udp-handle
+
+UDP handles encapsulate UDP communication for both clients and servers.
+
+### uv.new_udp() -> udp
+
+Initialize a new UDP handle. The actual socket is created lazily.
+
+### uv.udp_open(udp, fd)
+
+> (method form `udp:open(fd)`)
+
+Opens an existing file descriptor or Windows SOCKET as a UDP handle.
+
+Unix only: The only requirement of the sock argument is that it follows the
+datagram contract (works in unconnected mode, supports sendmsg()/recvmsg(),
+etc). In other words, other datagram-type sockets like raw sockets or netlink
+sockets can also be passed to this function.
+
+The file descriptor is set to non-blocking mode.
+
+Note: The passed file descriptor or SOCKET is not checked for its type, but
+it’s required that it represents a valid datagram socket.
+
+### uv.udp_bind(udp, host, port)
+
+> (method form `udp:bind(host, port)`)
+
+Bind the UDP handle to an IP address and port.
+
+### uv.udp_getsockname(udp)
+
+> (method form `udp:getsockname()`)
+
+Get the local IP and port of the UDP handle.
+
+### uv.udp_set_membership(udp, multicast_addr, interface_addr, membership)
+
+> (method form `udp:set_membership(multicast_addr, interface_addr, membership)`)
+
+Set membership for a multicast address.
+
+`multicast_addr` is multicast address to set membership for.
+
+`interface_addr` is interface address.
+
+`membership` can be the string `"leave"` or `"join"`.
+
+### uv.udp_set_multicast_loop(udp, on)
+
+> (method form `udp:set_multicast_loop(on)`)
+
+Set IP multicast loop flag. Makes multicast packets loop back to local
+sockets.
+
+`on` is a boolean.
+
+### uv.udp_set_multicast_ttl(udp, tty)
+
+> (method form `udp:set_multicast_ttl(tty)`)
+
+Set the multicast ttl.
+
+`ttl` is an integer 1 through 255.
+
+### uv.udp_set_multicast_interface(udp, interface_addr)
+
+> (method form `udp:set_multicast_interface(interface_addr)`)
+
+Set the multicast interface to send or receive data on.
+
+### uv.udp_set_broadcast(udp, on)
+
+Set broadcast on or off.
+
+> (method form `udp:set_broadcast(, on)`)
+
+### uv.udp_set_ttl(udp, ttl)
+
+> (method form `udp:set_ttl(ttl)`)
+
+Set the time to live.
+
+`ttl` is an integer 1 through 255.
+
+### uv.udp_send(udp, data, host, port, callback)
+
+> (method form `udp:send(data, host, port, callback)`)
+
+Send data over the UDP socket. If the socket has not previously been bound
+with `uv_udp_bind()` it will be bound to `0.0.0.0` (the “all interfaces†IPv4
+address) and a random port number.
+
+### uv.udp_try_send(udp, data, host, port)
+
+> (method form `udp:try_send(data, host, port)`)
+
+Same as `uv_udp_send()`, but won’t queue a send request if it can’t be
+completed immediately.
+
+### uv.udp_recv_start(udp, callback)
+
+> (method form `udp:recv_start(callback)`)
+
+Prepare for receiving data. If the socket has not previously been bound with
+`uv_udp_bind()` it is bound to `0.0.0.0` (the “all interfaces†IPv4 address)
+and a random port number.
+
+### uv.udp_recv_stop(udp)
+
+> (method form `udp:recv_stop()`)
+
+## `uv_fs_event_t` — FS Event handle
+
+[`uv_fs_event_t`]: #uv_fs_event_t--fs-event-handle
+
+**TODO**: port docs from [docs.libuv.org](http://docs.libuv.org/en/v1.x/fs_event.html)
+using [functions](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L174-L177)
+and [methods](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L265-L270)
+from [fs_event.c](https://github.com/luvit/luv/blob/master/src/fs_event.c)
+
+## `uv_fs_poll_t` — FS Poll handle
+
+[`uv_fs_poll_t`]: #uv_fs_poll_t--fs-poll-handle
+
+**TODO**: port docs from [docs.libuv.org](http://docs.libuv.org/en/v1.x/fs_poll.html)
+using [functions](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L180-L183)
+and [methods](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L272-L277)
+from [fs_poll.c](https://github.com/luvit/luv/blob/master/src/fs_poll.c)
+
+## Filesystem operations
+
+[Filesystem operations]:#filesystem-operations
+
+**TODO**: port docs from [docs.libuv.org](http://docs.libuv.org/en/v1.x/fs.html)
+using [functions](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L186-L213)
+from [fs.c](https://github.com/luvit/luv/blob/master/src/fs.c)
+
+## DNS utility functions
+
+[DNS utility functions]: #dns-utility-functions
+
+**TODO**: port docs from [docs.libuv.org](http://docs.libuv.org/en/v1.x/dns.html)
+using [functions](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L216-L217)
+from [dns.c](https://github.com/luvit/luv/blob/master/src/dns.c)
+
+## Miscellaneous utilities
+
+[Miscellaneous utilities]: #miscellaneous-utilities
+
+**TODO**: port docs from [docs.libuv.org](http://docs.libuv.org/en/v1.x/misc.html)
+using [functions](https://github.com/luvit/luv/blob/25278a3871962cab29763692fdc3b270a7e96fe9/src/luv.c#L220-L235)
+from [misc.c](https://github.com/luvit/luv/blob/master/src/misc.c)
+
+[luv]: https://github.com/luvit/luv
+[luvit]: https://github.com/luvit/luvit
+[libuv]: https://github.com/libuv/libuv
diff --git a/3rdparty/luv/examples/cqueues-main.lua b/3rdparty/luv/examples/cqueues-main.lua
new file mode 100644
index 00000000000..ff60ec2b1c9
--- /dev/null
+++ b/3rdparty/luv/examples/cqueues-main.lua
@@ -0,0 +1,31 @@
+--[[
+Demonstrates using luv with a cqueues mainloop
+]]
+
+local cqueues = require "cqueues"
+local uv = require "luv"
+
+local cq = cqueues.new()
+
+cq:wrap(function()
+ while cqueues.poll({
+ pollfd = uv.backend_fd();
+ timeout = uv.backend_timeout() / 1000;
+ events = "r";
+ }) do
+ uv.run("nowait")
+ end
+end)
+
+cq:wrap(function()
+ while true do
+ cqueues.sleep(1)
+ print("HELLO FROM CQUEUES")
+ end
+end)
+
+uv.new_timer():start(1000, 1000, function()
+ print("HELLO FROM LUV")
+end)
+
+assert(cq:loop())
diff --git a/3rdparty/luv/examples/cqueues-slave.lua b/3rdparty/luv/examples/cqueues-slave.lua
new file mode 100644
index 00000000000..599e7c6ded7
--- /dev/null
+++ b/3rdparty/luv/examples/cqueues-slave.lua
@@ -0,0 +1,55 @@
+--[[
+Demonstrates using cqueues with a luv mainloop
+
+Starts a simple sleep+print loop using each library's native form.
+They should print intertwined.
+]]
+
+local cqueues = require "cqueues"
+local uv = require "luv"
+
+local cq = cqueues.new()
+
+do
+ local timer = uv.new_timer()
+ local function reset_timer()
+ local timeout = cq:timeout()
+ if timeout then
+ -- libuv takes milliseconds as an integer,
+ -- while cqueues gives timeouts as a floating point number
+ -- use `math.ceil` as we'd rather wake up late than early
+ timer:set_repeat(math.ceil(timeout * 1000))
+ timer:again()
+ else
+ -- stop timer for now; it may be restarted later.
+ timer:stop()
+ end
+ end
+ local function onready()
+ -- Step the cqueues loop once (sleeping for max 0 seconds)
+ assert(cq:step(0))
+ reset_timer()
+ end
+ -- Need to call `start` on libuv timer now
+ -- to provide callback and so that `again` works
+ timer:start(0, 0, onready)
+ -- Ask libuv to watch the cqueue pollfd
+ uv.new_poll(cq:pollfd()):start(cq:events(), onready)
+end
+
+-- Adds a new function to the scheduler `cq`
+-- The functions is an infinite loop that sleeps for 1 second and prints
+cq:wrap(function()
+ while true do
+ cqueues.sleep(1)
+ print("HELLO FROM CQUEUES")
+ end
+end)
+
+-- Start a luv timer that fires every 1 second
+uv.new_timer():start(1000, 1000, function()
+ print("HELLO FROM LUV")
+end)
+
+-- Run luv mainloop
+uv.run()
diff --git a/3rdparty/luv/examples/echo-server-client.lua b/3rdparty/luv/examples/echo-server-client.lua
new file mode 100644
index 00000000000..ea4e6d2132d
--- /dev/null
+++ b/3rdparty/luv/examples/echo-server-client.lua
@@ -0,0 +1,68 @@
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+local function create_server(host, port, on_connection)
+
+ local server = uv.new_tcp()
+ p(1, server)
+ uv.tcp_bind(server, host, port)
+
+ uv.listen(server, 128, function(err)
+ assert(not err, err)
+ local client = uv.new_tcp()
+ uv.accept(server, client)
+ on_connection(client)
+ end)
+
+ return server
+end
+
+local server = create_server("0.0.0.0", 0, function (client)
+ p("new client", client, uv.tcp_getsockname(client), uv.tcp_getpeername(client))
+ uv.read_start(client, function (err, chunk)
+ p("onread", {err=err,chunk=chunk})
+
+ -- Crash on errors
+ assert(not err, err)
+
+ if chunk then
+ -- Echo anything heard
+ uv.write(client, chunk)
+ else
+ -- When the stream ends, close the socket
+ uv.close(client)
+ end
+ end)
+end)
+
+local address = uv.tcp_getsockname(server)
+p("server", server, address)
+
+local client = uv.new_tcp()
+uv.tcp_connect(client, "127.0.0.1", address.port, function (err)
+ assert(not err, err)
+
+ uv.read_start(client, function (err, chunk)
+ p("received at client", {err=err,chunk=chunk})
+ assert(not err, err)
+ if chunk then
+ uv.shutdown(client)
+ p("client done shutting down")
+ else
+ uv.close(client)
+ uv.close(server)
+ end
+ end)
+
+ p("writing from client")
+ uv.write(client, "Hello")
+ uv.write(client, "World")
+
+end)
+
+-- Start the main event loop
+uv.run()
+-- Close any stray handles when done
+uv.walk(uv.close)
+uv.run()
+uv.loop_close()
diff --git a/3rdparty/luv/examples/killing-children.lua b/3rdparty/luv/examples/killing-children.lua
new file mode 100644
index 00000000000..6aab693d0c1
--- /dev/null
+++ b/3rdparty/luv/examples/killing-children.lua
@@ -0,0 +1,24 @@
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+
+
+local child, pid
+child, pid = uv.spawn("sleep", {
+ args = {"100"}
+}, function (code, signal)
+ p("EXIT", {code=code,signal=signal})
+ uv.close(child)
+end)
+
+p{child=child, pid=pid}
+
+-- uv.kill(pid, "SIGTERM")
+uv.process_kill(child, "SIGTERM")
+
+repeat
+ print("\ntick.")
+until uv.run('once') == 0
+
+print("done")
+
diff --git a/3rdparty/luv/examples/lots-o-dns.lua b/3rdparty/luv/examples/lots-o-dns.lua
new file mode 100644
index 00000000000..59a1b0fe534
--- /dev/null
+++ b/3rdparty/luv/examples/lots-o-dns.lua
@@ -0,0 +1,49 @@
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+uv.getaddrinfo(nil, 80, nil, p)
+
+local domains = {
+ "facebook.com",
+ "google.com",
+ "mail.google.com",
+ "maps.google.com",
+ "plus.google.com",
+ "play.google.com",
+ "apple.com",
+ "hp.com",
+ "yahoo.com",
+ "mozilla.com",
+ "developer.mozilla.com",
+ "luvit.io",
+ "creationix.com",
+ "howtonode.org",
+ "github.com",
+ "gist.github.com"
+}
+
+local i = 1
+local function next()
+ uv.getaddrinfo(domains[i], nil, {
+ v4mapped = true,
+ all = true,
+ addrconfig = true,
+ canonname = true,
+ numericserv = true,
+ socktype = "STREAM"
+ }, function (err, data)
+ assert(not err, err)
+ p(data)
+ i = i + 1
+ if i <= #domains then
+ next()
+ end
+ end)
+end
+next();
+
+repeat
+ print("\nTick..")
+until uv.run('once') == 0
+
+print("done")
diff --git a/3rdparty/luv/examples/repl.lua b/3rdparty/luv/examples/repl.lua
new file mode 100644
index 00000000000..92be0f17d87
--- /dev/null
+++ b/3rdparty/luv/examples/repl.lua
@@ -0,0 +1,89 @@
+local uv = require('luv')
+local utils = require('lib/utils')
+
+if uv.guess_handle(0) ~= "tty" or
+ uv.guess_handle(1) ~= "tty" then
+ error "stdio must be a tty"
+end
+local stdin = uv.new_tty(0, true)
+local stdout = require('lib/utils').stdout
+
+local debug = require('debug')
+local c = utils.color
+
+local function gatherResults(success, ...)
+ local n = select('#', ...)
+ return success, { n = n, ... }
+end
+
+local function printResults(results)
+ for i = 1, results.n do
+ results[i] = utils.dump(results[i])
+ end
+ print(table.concat(results, '\t'))
+end
+
+local buffer = ''
+
+local function evaluateLine(line)
+ if line == "<3\n" then
+ print("I " .. c("Bred") .. "♥" .. c() .. " you too!")
+ return '>'
+ end
+ local chunk = buffer .. line
+ local f, err = loadstring('return ' .. chunk, 'REPL') -- first we prefix return
+
+ if not f then
+ f, err = loadstring(chunk, 'REPL') -- try again without return
+ end
+
+ if f then
+ buffer = ''
+ local success, results = gatherResults(xpcall(f, debug.traceback))
+
+ if success then
+ -- successful call
+ if results.n > 0 then
+ printResults(results)
+ end
+ else
+ -- error
+ print(results[1])
+ end
+ else
+
+ if err:match "'<eof>'$" then
+ -- Lua expects some more input; stow it away for next time
+ buffer = chunk .. '\n'
+ return '>>'
+ else
+ print(err)
+ buffer = ''
+ end
+ end
+
+ return '>'
+end
+
+local function displayPrompt(prompt)
+ uv.write(stdout, prompt .. ' ')
+end
+
+local function onread(err, line)
+ if err then error(err) end
+ if line then
+ local prompt = evaluateLine(line)
+ displayPrompt(prompt)
+ else
+ uv.close(stdin)
+ end
+end
+
+coroutine.wrap(function()
+ displayPrompt '>'
+ uv.read_start(stdin, onread)
+end)()
+
+uv.run()
+
+print("")
diff --git a/3rdparty/luv/examples/talking-to-children.lua b/3rdparty/luv/examples/talking-to-children.lua
new file mode 100644
index 00000000000..10a53ef8c88
--- /dev/null
+++ b/3rdparty/luv/examples/talking-to-children.lua
@@ -0,0 +1,47 @@
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+local stdout = uv.new_pipe(false)
+local stderr = uv.new_pipe( false)
+local stdin = uv.new_pipe(false)
+
+local handle, pid
+
+local function onexit(code, signal)
+ p("exit", {code=code,signal=signal})
+end
+
+local function onclose()
+ p("close")
+end
+
+local function onread(err, chunk)
+ assert(not err, err)
+ if (chunk) then
+ p("data", {data=chunk})
+ else
+ p("end")
+ end
+end
+
+local function onshutdown()
+ uv.close(handle, onclose)
+end
+
+handle, pid = uv.spawn("cat", {
+ stdio = {stdin, stdout, stderr}
+}, onexit)
+
+p{
+ handle=handle,
+ pid=pid
+}
+
+uv.read_start(stdout, onread)
+uv.read_start(stderr, onread)
+uv.write(stdin, "Hello World")
+uv.shutdown(stdin, onshutdown)
+
+uv.run()
+uv.walk(uv.close)
+uv.run()
diff --git a/3rdparty/luv/examples/tcp-cluster.lua b/3rdparty/luv/examples/tcp-cluster.lua
new file mode 100644
index 00000000000..e69ceffc62d
--- /dev/null
+++ b/3rdparty/luv/examples/tcp-cluster.lua
@@ -0,0 +1,84 @@
+
+-- This function will be run in a child process
+local child_code = string.dump(function ()
+ local p = require('lib/utils').prettyPrint
+ local uv = require('luv')
+
+ -- The parent is going to pass us the server handle over a pipe
+ -- This will be our local file descriptor at PIPE_FD
+ local pipe = uv.new_pipe(true)
+ local pipe_fd = tonumber(os.getenv("PIPE_FD"))
+ assert(uv.pipe_open(pipe, pipe_fd))
+
+ -- Configure the server handle
+ local server = uv.new_tcp()
+ local function onconnection()
+ local client = uv.new_tcp()
+ uv.accept(server, client)
+ p("New TCP", client, "on", server)
+ p{client=client}
+ uv.write(client, "BYE!\n");
+ uv.shutdown(client, function ()
+ uv.close(client)
+ uv.close(server)
+ end)
+ end
+
+ -- Read the server handle from the parent
+ local function onread(err, data)
+ p("onread", {err=err,data=data})
+ assert(not err, err)
+ if uv.pipe_pending_count(pipe) > 0 then
+ local pending_type = uv.pipe_pending_type(pipe)
+ p("pending_type", pending_type)
+ assert(pending_type == "tcp")
+ assert(uv.accept(pipe, server))
+ assert(uv.listen(server, 128, onconnection))
+ p("Received server handle from parent process", server)
+ elseif data then
+ p("ondata", data)
+ else
+ p("onend", data)
+ end
+ end
+ uv.read_start(pipe, onread)
+
+ -- Start the event loop!
+ uv.run()
+end)
+
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+local exepath = assert(uv.exepath())
+local cpu_count = # assert(uv.cpu_info())
+
+local server = uv.new_tcp()
+assert(uv.tcp_bind(server, "::1", 1337))
+print("Master process bound to TCP port 1337 on ::1")
+
+
+local function onexit(status, signal)
+ p("Child exited", {status=status,signal=signal})
+end
+
+local function spawnChild()
+ local pipe = uv.new_pipe(true)
+ local input = uv.new_pipe(false)
+ local _, pid = assert(uv.spawn(exepath, {
+ stdio = {input,1,2,pipe},
+ env= {"PIPE_FD=3"}
+ }, onexit))
+ uv.write(input, child_code)
+ uv.shutdown(input)
+ p("Spawned child", pid, "and sending handle", server)
+ assert(uv.write2(pipe, "123", server))
+ assert(uv.shutdown(pipe))
+end
+
+-- Spawn a child process for each CPU core
+for _ = 1, cpu_count do
+ spawnChild()
+end
+
+uv.run()
diff --git a/3rdparty/luv/examples/timers.lua b/3rdparty/luv/examples/timers.lua
new file mode 100644
index 00000000000..049235e6fb1
--- /dev/null
+++ b/3rdparty/luv/examples/timers.lua
@@ -0,0 +1,68 @@
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+local function set_timeout(timeout, callback)
+ local timer = uv.new_timer()
+ local function ontimeout()
+ p("ontimeout", timer)
+ uv.timer_stop(timer)
+ uv.close(timer)
+ callback(timer)
+ end
+ uv.timer_start(timer, timeout, 0, ontimeout)
+ return timer
+end
+
+local function clear_timeout(timer)
+ uv.timer_stop(timer)
+ uv.close(timer)
+end
+
+local function set_interval(interval, callback)
+ local timer = uv.new_timer()
+ local function ontimeout()
+ p("interval", timer)
+ callback(timer)
+ end
+ uv.timer_start(timer, interval, interval, ontimeout)
+ return timer
+end
+
+local clear_interval = clear_timeout
+
+local i = set_interval(300, function()
+ print("interval...")
+end)
+
+set_timeout(1000, function()
+ clear_interval(i)
+end)
+
+
+local handle = uv.new_timer()
+local delay = 1024
+local function ontimeout()
+ p("tick", delay)
+ delay = delay / 2
+ if delay >= 1 then
+ uv.timer_set_repeat(handle, delay)
+ uv.timer_again(handle)
+ else
+ uv.timer_stop(handle)
+ uv.close(handle)
+ p("done")
+ end
+end
+uv.timer_start(handle, delay, 0, ontimeout)
+
+
+repeat
+ print("\ntick.")
+until uv.run('once') == 0
+
+print("done")
+
+uv.walk(uv.close)
+uv.run()
+uv.loop_close()
+
diff --git a/3rdparty/luv/examples/uvbook/helloworld.lua b/3rdparty/luv/examples/uvbook/helloworld.lua
new file mode 100644
index 00000000000..2c77d0c51bc
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/helloworld.lua
@@ -0,0 +1,5 @@
+local uv = require('luv')
+
+print('Now quitting.')
+uv.run('default')
+uv.loop_close()
diff --git a/3rdparty/luv/examples/uvbook/idle-basic.lua b/3rdparty/luv/examples/uvbook/idle-basic.lua
new file mode 100644
index 00000000000..dc2a47b3c30
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/idle-basic.lua
@@ -0,0 +1,14 @@
+local uv = require('luv')
+
+local counter = 0
+local idle = uv.new_idle()
+idle:start(function()
+ counter = counter + 1
+ if counter >= 10e6 then
+ idle:stop()
+ end
+end)
+
+print("Idling...")
+uv.run('default')
+uv.loop_close() \ No newline at end of file
diff --git a/3rdparty/luv/examples/uvbook/onchange.lua b/3rdparty/luv/examples/uvbook/onchange.lua
new file mode 100644
index 00000000000..07b3f9b1d78
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/onchange.lua
@@ -0,0 +1,30 @@
+local uv = require('luv')
+
+if #arg==0 then
+ print(string.format("Usage: %s <command> <file1> [file2 ...]",arg[0]));
+ return
+end
+
+for i=1,#arg do
+ local fse = uv.new_fs_event()
+ assert(uv.fs_event_start(fse,arg[i],{
+ --"watch_entry"=true,"stat"=true,
+ recursive=true
+ },function (err,fname,status)
+ if(err) then
+ print("Error "..err)
+ else
+ print(string.format('Change detected in %s',
+ uv.fs_event_getpath(fse)))
+ for k,v in pairs(status) do
+ print(k,v)
+ end
+ print('file changed:'..(fname and fname or ''))
+ end
+ end))
+
+end
+
+uv.run('default')
+uv.loop_close()
+
diff --git a/3rdparty/luv/examples/uvbook/queue-work.lua b/3rdparty/luv/examples/uvbook/queue-work.lua
new file mode 100644
index 00000000000..cf52abfb216
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/queue-work.lua
@@ -0,0 +1,19 @@
+local uv = require('luv')
+
+local ctx = uv.new_work(
+ function(n) --work,in threadpool
+ local uv = require('luv')
+ local t = uv.thread_self()
+ uv.sleep(100)
+ return n*n,n
+ end,
+ function(r,n) print(string.format('%d => %d',n,r)) end --after work, in loop thread
+)
+uv.queue_work(ctx,2)
+uv.queue_work(ctx,4)
+uv.queue_work(ctx,6)
+uv.queue_work(ctx,8)
+uv.queue_work(ctx,10)
+
+uv.run('default')
+uv.loop_close()
diff --git a/3rdparty/luv/examples/uvbook/tcp-echo-client.lua b/3rdparty/luv/examples/uvbook/tcp-echo-client.lua
new file mode 100644
index 00000000000..40dd22a311f
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/tcp-echo-client.lua
@@ -0,0 +1,21 @@
+local uv = require('luv')
+
+
+local client = uv.new_tcp()
+uv.tcp_connect(client, "127.0.0.1", 1337, function (err)
+ assert(not err, err)
+ uv.read_start(client, function (err, chunk)
+ assert(not err, err)
+ if chunk then
+ print(chunk)
+ else
+ uv.close(client)
+ end
+ end)
+
+ uv.write(client, "Hello")
+ uv.write(client, "World")
+end)
+print('CTRL-C to break')
+uv.run('default')
+uv.loop_close()
diff --git a/3rdparty/luv/examples/uvbook/tcp-echo-server.lua b/3rdparty/luv/examples/uvbook/tcp-echo-server.lua
new file mode 100644
index 00000000000..269c49114cf
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/tcp-echo-server.lua
@@ -0,0 +1,22 @@
+local uv = require('luv')
+
+
+local server = uv.new_tcp()
+server:bind("127.0.0.1", 1337)
+server:listen(128, function (err)
+ assert(not err, err)
+ local client = uv.new_tcp()
+ server:accept(client)
+ client:read_start(function (err, chunk)
+ assert(not err, err)
+ if chunk then
+ client:write(chunk)
+ else
+ client:shutdown()
+ client:close()
+ end
+ end)
+end)
+
+uv.run('default')
+uv.loop_close()
diff --git a/3rdparty/luv/examples/uvbook/thread-create.lua b/3rdparty/luv/examples/uvbook/thread-create.lua
new file mode 100644
index 00000000000..4b42587adbf
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/thread-create.lua
@@ -0,0 +1,38 @@
+local uv = require('luv')
+
+local step = 10
+
+local hare_id = uv.new_thread(function(step,...)
+ local ffi = require'ffi'
+ local uv = require('luv')
+ local sleep
+ if ffi.os=='Windows' then
+ ffi.cdef "void Sleep(int ms);"
+ sleep = ffi.C.Sleep
+ else
+ ffi.cdef "unsigned int usleep(unsigned int seconds);"
+ sleep = ffi.C.usleep
+ end
+ while (step>0) do
+ step = step - 1
+ uv.sleep(math.random(1000))
+ print("Hare ran another step")
+ end
+ print("Hare done running!")
+end, step,true,'abcd','false')
+
+local tortoise_id = uv.new_thread(function(step,...)
+ local uv = require('luv')
+ while (step>0) do
+ step = step - 1
+ uv.sleep(math.random(100))
+ print("Tortoise ran another step")
+ end
+ print("Tortoise done running!")
+end,step,'abcd','false')
+
+print(hare_id==hare_id,uv.thread_equal(hare_id,hare_id))
+print(tortoise_id==hare_id,uv.thread_equal(tortoise_id,hare_id))
+
+uv.thread_join(hare_id)
+uv.thread_join(tortoise_id)
diff --git a/3rdparty/luv/examples/uvbook/uvcat.lua b/3rdparty/luv/examples/uvbook/uvcat.lua
new file mode 100644
index 00000000000..99fdd68000b
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/uvcat.lua
@@ -0,0 +1,37 @@
+local uv = require('luv')
+
+
+local fname = arg[1] and arg[1] or arg[0]
+
+uv.fs_open(fname, 'r', tonumber('644', 8), function(err,fd)
+ if err then
+ print("error opening file:"..err)
+ else
+ local stat = uv.fs_fstat(fd)
+ local off = 0
+ local block = 10
+
+ local function on_read(err,chunk)
+ if(err) then
+ print("Read error: "..err);
+ elseif #chunk==0 then
+ uv.fs_close(fd)
+ else
+ off = block + off
+ uv.fs_write(1,chunk,-1,function(err,chunk)
+ if err then
+ print("Write error: "..err)
+ else
+ uv.fs_read(fd, block, off, on_read)
+ end
+ end)
+ end
+ end
+ uv.fs_read(fd, block, off, on_read)
+ end
+end)
+
+
+
+uv.run('default')
+uv.loop_close()
diff --git a/3rdparty/luv/examples/uvbook/uvtee.lua b/3rdparty/luv/examples/uvbook/uvtee.lua
new file mode 100644
index 00000000000..c91b066ae21
--- /dev/null
+++ b/3rdparty/luv/examples/uvbook/uvtee.lua
@@ -0,0 +1,35 @@
+local uv = require('luv')
+
+if not arg[1] then
+ print(string.format("please run %s filename",arg[0]))
+ return
+end
+
+
+local stdin = uv.new_tty(0, true)
+local stdout = uv.new_tty(1, true)
+--local stdin_pipe = uv.new_pipe(false)
+--uv.pipe_open(stdin_pipe,0)
+
+local fname = arg[1]
+
+uv.fs_open(fname, 'w+', tonumber('644', 8), function(err,fd)
+ if err then
+ print("error opening file:"..err)
+ else
+ local fpipe = uv.new_pipe(false)
+ uv.pipe_open(fpipe, fd)
+
+ uv.read_start(stdin, function(err,chunk)
+ if err then
+ print('Read error: '..err)
+ else
+ uv.write(stdout,chunk)
+ uv.write(fpipe,chunk)
+ end
+ end);
+ end
+end)
+
+uv.run('default')
+uv.loop_close()
diff --git a/3rdparty/luv/lib/tap.lua b/3rdparty/luv/lib/tap.lua
new file mode 100644
index 00000000000..d1cfb59c249
--- /dev/null
+++ b/3rdparty/luv/lib/tap.lua
@@ -0,0 +1,165 @@
+local uv = require('luv')
+local dump = require('lib/utils').dump
+local stdout = require('lib/utils').stdout
+
+local function protect(...)
+ local n = select('#', ...)
+ local arguments = {...}
+ for i = 1, n do
+ arguments[i] = tostring(arguments[i])
+ end
+
+ local text = table.concat(arguments, "\t")
+ text = " " .. string.gsub(text, "\n", "\n ")
+ print(text)
+end
+
+local function pprotect(...)
+ local n = select('#', ...)
+ local arguments = { ... }
+
+ for i = 1, n do
+ arguments[i] = dump(arguments[i])
+ end
+
+ protect(table.concat(arguments, "\t"))
+end
+
+
+local tests = {};
+
+local function run()
+ local passed = 0
+
+ if #tests < 1 then
+ error("No tests specified!")
+ end
+
+ print("1.." .. #tests)
+ for i = 1, #tests do
+ local test = tests[i]
+ local cwd = uv.cwd()
+ local pass, err = xpcall(function ()
+ local expected = 0
+ local function expect(fn, count)
+ expected = expected + (count or 1)
+ return function (...)
+ expected = expected - 1
+ local ret = fn(...)
+ collectgarbage()
+ return ret
+ end
+ end
+ test.fn(protect, pprotect, expect, uv)
+ collectgarbage()
+ uv.run()
+ collectgarbage()
+ if expected > 0 then
+ error("Missing " .. expected .. " expected call" .. (expected == 1 and "" or "s"))
+ elseif expected < 0 then
+ error("Found " .. -expected .. " unexpected call" .. (expected == -1 and "" or "s"))
+ end
+ collectgarbage()
+ local unclosed = 0
+ uv.walk(function (handle)
+ if handle == stdout then return end
+ unclosed = unclosed + 1
+ print("UNCLOSED", handle)
+ end)
+ if unclosed > 0 then
+ error(unclosed .. " unclosed handle" .. (unclosed == 1 and "" or "s"))
+ end
+ if uv.cwd() ~= cwd then
+ error("Test moved cwd from " .. cwd .. " to " .. uv.cwd())
+ end
+ collectgarbage()
+ end, debug.traceback)
+
+ -- Flush out any more opened handles
+ uv.stop()
+ uv.walk(function (handle)
+ if handle == stdout then return end
+ if not uv.is_closing(handle) then uv.close(handle) end
+ end)
+ uv.run()
+ uv.chdir(cwd)
+
+ if pass then
+ print("ok " .. i .. " " .. test.name)
+ passed = passed + 1
+ else
+ protect(err)
+ print("not ok " .. i .. " " .. test.name)
+ end
+ end
+
+ local failed = #tests - passed
+ if failed == 0 then
+ print("# All tests passed")
+ else
+ print("#" .. failed .. " failed test" .. (failed == 1 and "" or "s"))
+ end
+
+ -- Close all then handles, including stdout
+ uv.walk(uv.close)
+ uv.run()
+
+ os.exit(-failed)
+end
+
+local single = true
+local prefix
+
+local function tap(suite)
+
+ if type(suite) == "function" then
+ -- Pass in suite directly for single mode
+ suite(function (name, fn)
+ if prefix then
+ name = prefix .. ' - ' .. name
+ end
+ tests[#tests + 1] = {
+ name = name,
+ fn = fn
+ }
+ end)
+ prefix = nil
+ elseif type(suite) == "string" then
+ prefix = suite
+ single = false
+ else
+ -- Or pass in false to collect several runs of tests
+ -- And then pass in true in a later call to flush tests queue.
+ single = suite
+ end
+
+ if single then run() end
+
+end
+
+
+--[[
+-- Sample Usage
+
+local passed, failed, total = tap(function (test)
+
+ test("add 1 to 2", function(print)
+ print("Adding 1 to 2")
+ assert(1 + 2 == 3)
+ end)
+
+ test("close handle", function (print, p, expect, uv)
+ local handle = uv.new_timer()
+ uv.close(handle, expect(function (self)
+ assert(self == handle)
+ end))
+ end)
+
+ test("simulate failure", function ()
+ error("Oopsie!")
+ end)
+
+end)
+]]
+
+return tap
diff --git a/3rdparty/luv/lib/utils.lua b/3rdparty/luv/lib/utils.lua
new file mode 100644
index 00000000000..777879ec28c
--- /dev/null
+++ b/3rdparty/luv/lib/utils.lua
@@ -0,0 +1,165 @@
+
+local uv = require('luv')
+local utils = {}
+local usecolors
+
+if uv.guess_handle(1) == "tty" then
+ utils.stdout = uv.new_tty(1, false)
+ usecolors = true
+else
+ utils.stdout = uv.new_pipe(false)
+ uv.pipe_open(utils.stdout, 1)
+ usecolors = false
+end
+
+local colors = {
+ black = "0;30",
+ red = "0;31",
+ green = "0;32",
+ yellow = "0;33",
+ blue = "0;34",
+ magenta = "0;35",
+ cyan = "0;36",
+ white = "0;37",
+ B = "1;",
+ Bblack = "1;30",
+ Bred = "1;31",
+ Bgreen = "1;32",
+ Byellow = "1;33",
+ Bblue = "1;34",
+ Bmagenta = "1;35",
+ Bcyan = "1;36",
+ Bwhite = "1;37"
+}
+
+function utils.color(color_name)
+ if usecolors then
+ return "\27[" .. (colors[color_name] or "0") .. "m"
+ else
+ return ""
+ end
+end
+
+function utils.colorize(color_name, string, reset_name)
+ return utils.color(color_name) .. tostring(string) .. utils.color(reset_name)
+end
+
+local backslash, null, newline, carriage, tab, quote, quote2, obracket, cbracket
+
+function utils.loadColors(n)
+ if n ~= nil then usecolors = n end
+ backslash = utils.colorize("Bgreen", "\\\\", "green")
+ null = utils.colorize("Bgreen", "\\0", "green")
+ newline = utils.colorize("Bgreen", "\\n", "green")
+ carriage = utils.colorize("Bgreen", "\\r", "green")
+ tab = utils.colorize("Bgreen", "\\t", "green")
+ quote = utils.colorize("Bgreen", '"', "green")
+ quote2 = utils.colorize("Bgreen", '"')
+ obracket = utils.colorize("B", '[')
+ cbracket = utils.colorize("B", ']')
+end
+
+utils.loadColors()
+
+function utils.dump(o, depth)
+ local t = type(o)
+ if t == 'string' then
+ return quote .. o:gsub("\\", backslash):gsub("%z", null):gsub("\n", newline):gsub("\r", carriage):gsub("\t", tab) .. quote2
+ end
+ if t == 'nil' then
+ return utils.colorize("Bblack", "nil")
+ end
+ if t == 'boolean' then
+ return utils.colorize("yellow", tostring(o))
+ end
+ if t == 'number' then
+ return utils.colorize("blue", tostring(o))
+ end
+ if t == 'userdata' then
+ return utils.colorize("magenta", tostring(o))
+ end
+ if t == 'thread' then
+ return utils.colorize("Bred", tostring(o))
+ end
+ if t == 'function' then
+ return utils.colorize("cyan", tostring(o))
+ end
+ if t == 'cdata' then
+ return utils.colorize("Bmagenta", tostring(o))
+ end
+ if t == 'table' then
+ if type(depth) == 'nil' then
+ depth = 0
+ end
+ if depth > 1 then
+ return utils.colorize("yellow", tostring(o))
+ end
+ local indent = (" "):rep(depth)
+
+ -- Check to see if this is an array
+ local is_array = true
+ local i = 1
+ for k,v in pairs(o) do
+ if not (k == i) then
+ is_array = false
+ end
+ i = i + 1
+ end
+
+ local first = true
+ local lines = {}
+ i = 1
+ local estimated = 0
+ for k,v in (is_array and ipairs or pairs)(o) do
+ local s
+ if is_array then
+ s = ""
+ else
+ if type(k) == "string" and k:find("^[%a_][%a%d_]*$") then
+ s = k .. ' = '
+ else
+ s = '[' .. utils.dump(k, 100) .. '] = '
+ end
+ end
+ s = s .. utils.dump(v, depth + 1)
+ lines[i] = s
+ estimated = estimated + #s
+ i = i + 1
+ end
+ if estimated > 200 then
+ return "{\n " .. indent .. table.concat(lines, ",\n " .. indent) .. "\n" .. indent .. "}"
+ else
+ return "{ " .. table.concat(lines, ", ") .. " }"
+ end
+ end
+ -- This doesn't happen right?
+ return tostring(o)
+end
+
+
+
+-- Print replacement that goes through libuv. This is useful on windows
+-- to use libuv's code to translate ansi escape codes to windows API calls.
+function print(...)
+ local n = select('#', ...)
+ local arguments = {...}
+ for i = 1, n do
+ arguments[i] = tostring(arguments[i])
+ end
+ uv.write(utils.stdout, table.concat(arguments, "\t") .. "\n")
+end
+
+-- A nice global data dumper
+function utils.prettyPrint(...)
+ local n = select('#', ...)
+ local arguments = { ... }
+
+ for i = 1, n do
+ arguments[i] = utils.dump(arguments[i])
+ end
+
+ print(table.concat(arguments, "\t"))
+end
+
+return utils
+
diff --git a/3rdparty/luv/luv-1.8.0-4.rockspec b/3rdparty/luv/luv-1.8.0-4.rockspec
new file mode 100644
index 00000000000..23855203e0d
--- /dev/null
+++ b/3rdparty/luv/luv-1.8.0-4.rockspec
@@ -0,0 +1,34 @@
+package = "luv"
+version = "1.8.0-4"
+source = {
+ url = 'https://github.com/luvit/luv/releases/download/1.8.0-4/luv-1.8.0-4.tar.gz',
+}
+
+description = {
+ summary = "Bare libuv bindings for lua",
+ detailed = [[
+libuv bindings for luajit and lua 5.1/5.2/5.3.
+
+This library makes libuv available to lua scripts. It was made for the luvit
+project but should usable from nearly any lua project.
+ ]],
+ homepage = "https://github.com/luvit/luv",
+ license = "Apache 2.0"
+}
+
+dependencies = {
+ "lua >= 5.1"
+}
+
+build = {
+ type = 'cmake',
+ variables = {
+ CMAKE_C_FLAGS="$(CFLAGS)",
+ CMAKE_MODULE_LINKER_FLAGS="$(LIBFLAG)",
+ LUA_LIBDIR="$(LUA_LIBDIR)",
+ LUA_INCDIR="$(LUA_INCDIR)",
+ LUA="$(LUA)",
+ LIBDIR="$(LIBDIR)",
+ LUADIR="$(LUADIR)",
+ },
+}
diff --git a/3rdparty/luv/msvcbuild.bat b/3rdparty/luv/msvcbuild.bat
new file mode 100644
index 00000000000..7a5c7bd4c31
--- /dev/null
+++ b/3rdparty/luv/msvcbuild.bat
@@ -0,0 +1,13 @@
+@echo off
+
+set VS=12
+if "%configuration%"=="2015" (set VS=14)
+if "%configuration%"=="2013" (set VS=12)
+
+if not defined platform set platform=x64
+if "%platform%" EQU "x64" (set VS=%VS% Win64)
+
+cmake -H. -Bbuild -G"Visual Studio %VS%"
+cmake --build build --config Release
+copy build\Release\luv.dll .
+copy build\Release\luajit.exe .
diff --git a/3rdparty/luv/src/async.c b/3rdparty/luv/src/async.c
new file mode 100644
index 00000000000..87ae0cc0460
--- /dev/null
+++ b/3rdparty/luv/src/async.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+#include "lthreadpool.h"
+
+static uv_async_t* luv_check_async(lua_State* L, int index) {
+ uv_async_t* handle = luv_checkudata(L, index, "uv_async");
+ luaL_argcheck(L, handle->type == UV_ASYNC && handle->data, index, "Expected uv_async_t");
+ return handle;
+}
+
+static void luv_async_cb(uv_async_t* handle) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ int n = luv_thread_arg_push(L, data->extra);
+ luv_call_callback(L, data, LUV_ASYNC, n);
+ luv_thread_arg_clear(data->extra);
+}
+
+static int luv_new_async(lua_State* L) {
+ uv_async_t* handle;
+ luv_handle_t* data;
+ int ret;
+ luaL_checktype(L, 1, LUA_TFUNCTION);
+ handle = luv_newuserdata(L, sizeof(*handle));
+ ret = uv_async_init(luv_loop(L), handle, luv_async_cb);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ data = luv_setup_handle(L);
+ data->extra = malloc(sizeof(luv_thread_arg_t));
+ memset(data->extra, 0, sizeof(luv_thread_arg_t));
+ handle->data = data;
+ luv_check_callback(L, handle->data, LUV_ASYNC, 1);
+ return 1;
+}
+
+static int luv_async_send(lua_State* L) {
+ int ret;
+ uv_async_t* handle = luv_check_async(L, 1);
+ luv_thread_arg_t* arg = ((luv_handle_t*) handle->data)->extra;
+
+ luv_thread_arg_set(L, arg, 2, lua_gettop(L), 0);
+ ret = uv_async_send(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
diff --git a/3rdparty/luv/src/check.c b/3rdparty/luv/src/check.c
new file mode 100644
index 00000000000..dbd330ae255
--- /dev/null
+++ b/3rdparty/luv/src/check.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_check_t* luv_check_check(lua_State* L, int index) {
+ uv_check_t* handle = luv_checkudata(L, index, "uv_check");
+ luaL_argcheck(L, handle->type == UV_CHECK && handle->data, index, "Expected uv_check_t");
+ return handle;
+}
+
+static int luv_new_check(lua_State* L) {
+ uv_check_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_check_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_check_cb(uv_check_t* handle) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ luv_call_callback(L, data, LUV_CHECK, 0);
+}
+
+static int luv_check_start(lua_State* L) {
+ uv_check_t* handle = luv_check_check(L, 1);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_CHECK, 2);
+ ret = uv_check_start(handle, luv_check_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_check_stop(lua_State* L) {
+ uv_check_t* handle = luv_check_check(L, 1);
+ int ret = uv_check_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
diff --git a/3rdparty/luv/src/constants.c b/3rdparty/luv/src/constants.c
new file mode 100644
index 00000000000..3417028c438
--- /dev/null
+++ b/3rdparty/luv/src/constants.c
@@ -0,0 +1,649 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+
+static int luv_constants(lua_State* L) {
+ lua_newtable(L);
+
+ // File open bitwise flags O_*
+#ifdef O_RDONLY
+ lua_pushinteger(L, O_RDONLY);
+ lua_setfield(L, -2, "O_RDONLY");
+#endif
+#ifdef O_WRONLY
+ lua_pushinteger(L, O_WRONLY);
+ lua_setfield(L, -2, "O_WRONLY");
+#endif
+#ifdef O_RDWR
+ lua_pushinteger(L, O_RDWR);
+ lua_setfield(L, -2, "O_RDWR");
+#endif
+#ifdef O_APPEND
+ lua_pushinteger(L, O_APPEND);
+ lua_setfield(L, -2, "O_APPEND");
+#endif
+#ifdef O_CREAT
+ lua_pushinteger(L, O_CREAT);
+ lua_setfield(L, -2, "O_CREAT");
+#endif
+#ifdef O_DSYNC
+ lua_pushinteger(L, O_DSYNC);
+ lua_setfield(L, -2, "O_DSYNC");
+#endif
+#ifdef O_EXCL
+ lua_pushinteger(L, O_EXCL);
+ lua_setfield(L, -2, "O_EXCL");
+#endif
+#ifdef O_EXLOCK
+ lua_pushinteger(L, O_EXLOCK);
+ lua_setfield(L, -2, "O_EXLOCK");
+#endif
+#ifdef O_NOCTTY
+ lua_pushinteger(L, O_NOCTTY);
+ lua_setfield(L, -2, "O_NOCTTY");
+#endif
+#ifdef O_NONBLOCK
+ lua_pushinteger(L, O_NONBLOCK);
+ lua_setfield(L, -2, "O_NONBLOCK");
+#endif
+#ifdef O_RSYNC
+ lua_pushinteger(L, O_RSYNC);
+ lua_setfield(L, -2, "O_RSYNC");
+#endif
+#ifdef O_SYNC
+ lua_pushinteger(L, O_SYNC);
+ lua_setfield(L, -2, "O_SYNC");
+#endif
+#ifdef O_TRUNC
+ lua_pushinteger(L, O_TRUNC);
+ lua_setfield(L, -2, "O_TRUNC");
+#endif
+
+ // Socket types SOCK_*
+#ifdef SOCK_STREAM
+ lua_pushinteger(L, SOCK_STREAM);
+ lua_setfield(L, -2, "SOCK_STREAM");
+#endif
+#ifdef SOCK_DGRAM
+ lua_pushinteger(L, SOCK_DGRAM);
+ lua_setfield(L, -2, "SOCK_DGRAM");
+#endif
+#ifdef SOCK_SEQPACKET
+ lua_pushinteger(L, SOCK_SEQPACKET);
+ lua_setfield(L, -2, "SOCK_SEQPACKET");
+#endif
+#ifdef SOCK_RAW
+ lua_pushinteger(L, SOCK_RAW);
+ lua_setfield(L, -2, "SOCK_RAW");
+#endif
+#ifdef SOCK_RDM
+ lua_pushinteger(L, SOCK_RDM);
+ lua_setfield(L, -2, "SOCK_RDM");
+#endif
+
+ // AF_*
+#ifdef AF_UNIX
+ lua_pushinteger(L, AF_UNIX);
+ lua_setfield(L, -2, "AF_UNIX");
+#endif
+#ifdef AF_INET
+ lua_pushinteger(L, AF_INET);
+ lua_setfield(L, -2, "AF_INET");
+#endif
+#ifdef AF_INET6
+ lua_pushinteger(L, AF_INET6);
+ lua_setfield(L, -2, "AF_INET6");
+#endif
+#ifdef AF_IPX
+ lua_pushinteger(L, AF_IPX);
+ lua_setfield(L, -2, "AF_IPX");
+#endif
+#ifdef AF_NETLINK
+ lua_pushinteger(L, AF_NETLINK);
+ lua_setfield(L, -2, "AF_NETLINK");
+#endif
+#ifdef AF_X25
+ lua_pushinteger(L, AF_X25);
+ lua_setfield(L, -2, "AF_X25");
+#endif
+#ifdef AF_AX25
+ lua_pushinteger(L, AF_AX25);
+ lua_setfield(L, -2, "AF_AX25");
+#endif
+#ifdef AF_ATMPVC
+ lua_pushinteger(L, AF_ATMPVC);
+ lua_setfield(L, -2, "AF_ATMPVC");
+#endif
+#ifdef AF_APPLETALK
+ lua_pushinteger(L, AF_APPLETALK);
+ lua_setfield(L, -2, "AF_APPLETALK");
+#endif
+#ifdef AF_PACKET
+ lua_pushinteger(L, AF_PACKET);
+ lua_setfield(L, -2, "AF_PACKET");
+#endif
+
+ // AI_*
+#ifdef AI_ADDRCONFIG
+ lua_pushinteger(L, AI_ADDRCONFIG);
+ lua_setfield(L, -2, "AI_ADDRCONFIG");
+#endif
+#ifdef AI_V4MAPPED
+ lua_pushinteger(L, AI_V4MAPPED);
+ lua_setfield(L, -2, "AI_V4MAPPED");
+#endif
+#ifdef AI_ALL
+ lua_pushinteger(L, AI_ALL);
+ lua_setfield(L, -2, "AI_ALL");
+#endif
+#ifdef AI_NUMERICHOST
+ lua_pushinteger(L, AI_NUMERICHOST);
+ lua_setfield(L, -2, "AI_NUMERICHOST");
+#endif
+#ifdef AI_PASSIVE
+ lua_pushinteger(L, AI_PASSIVE);
+ lua_setfield(L, -2, "AI_PASSIVE");
+#endif
+#ifdef AI_NUMERICSERV
+ lua_pushinteger(L, AI_NUMERICSERV);
+ lua_setfield(L, -2, "AI_NUMERICSERV");
+#endif
+
+ // Signals
+#ifdef SIGHUP
+ lua_pushinteger(L, SIGHUP);
+ lua_setfield(L, -2, "SIGHUP");
+#endif
+#ifdef SIGINT
+ lua_pushinteger(L, SIGINT);
+ lua_setfield(L, -2, "SIGINT");
+#endif
+#ifdef SIGQUIT
+ lua_pushinteger(L, SIGQUIT);
+ lua_setfield(L, -2, "SIGQUIT");
+#endif
+#ifdef SIGILL
+ lua_pushinteger(L, SIGILL);
+ lua_setfield(L, -2, "SIGILL");
+#endif
+#ifdef SIGTRAP
+ lua_pushinteger(L, SIGTRAP);
+ lua_setfield(L, -2, "SIGTRAP");
+#endif
+#ifdef SIGABRT
+ lua_pushinteger(L, SIGABRT);
+ lua_setfield(L, -2, "SIGABRT");
+#endif
+#ifdef SIGIOT
+ lua_pushinteger(L, SIGIOT);
+ lua_setfield(L, -2, "SIGIOT");
+#endif
+#ifdef SIGBUS
+ lua_pushinteger(L, SIGBUS);
+ lua_setfield(L, -2, "SIGBUS");
+#endif
+#ifdef SIGFPE
+ lua_pushinteger(L, SIGFPE);
+ lua_setfield(L, -2, "SIGFPE");
+#endif
+#ifdef SIGKILL
+ lua_pushinteger(L, SIGKILL);
+ lua_setfield(L, -2, "SIGKILL");
+#endif
+#ifdef SIGUSR1
+ lua_pushinteger(L, SIGUSR1);
+ lua_setfield(L, -2, "SIGUSR1");
+#endif
+#ifdef SIGSEGV
+ lua_pushinteger(L, SIGSEGV);
+ lua_setfield(L, -2, "SIGSEGV");
+#endif
+#ifdef SIGUSR2
+ lua_pushinteger(L, SIGUSR2);
+ lua_setfield(L, -2, "SIGUSR2");
+#endif
+#ifdef SIGPIPE
+ lua_pushinteger(L, SIGPIPE);
+ lua_setfield(L, -2, "SIGPIPE");
+#endif
+#ifdef SIGALRM
+ lua_pushinteger(L, SIGALRM);
+ lua_setfield(L, -2, "SIGALRM");
+#endif
+#ifdef SIGTERM
+ lua_pushinteger(L, SIGTERM);
+ lua_setfield(L, -2, "SIGTERM");
+#endif
+#ifdef SIGCHLD
+ lua_pushinteger(L, SIGCHLD);
+ lua_setfield(L, -2, "SIGCHLD");
+#endif
+#ifdef SIGSTKFLT
+ lua_pushinteger(L, SIGSTKFLT);
+ lua_setfield(L, -2, "SIGSTKFLT");
+#endif
+#ifdef SIGCONT
+ lua_pushinteger(L, SIGCONT);
+ lua_setfield(L, -2, "SIGCONT");
+#endif
+#ifdef SIGSTOP
+ lua_pushinteger(L, SIGSTOP);
+ lua_setfield(L, -2, "SIGSTOP");
+#endif
+#ifdef SIGTSTP
+ lua_pushinteger(L, SIGTSTP);
+ lua_setfield(L, -2, "SIGTSTP");
+#endif
+#ifdef SIGBREAK
+ lua_pushinteger(L, SIGBREAK);
+ lua_setfield(L, -2, "SIGBREAK");
+#endif
+#ifdef SIGTTIN
+ lua_pushinteger(L, SIGTTIN);
+ lua_setfield(L, -2, "SIGTTIN");
+#endif
+#ifdef SIGTTOU
+ lua_pushinteger(L, SIGTTOU);
+ lua_setfield(L, -2, "SIGTTOU");
+#endif
+#ifdef SIGURG
+ lua_pushinteger(L, SIGURG);
+ lua_setfield(L, -2, "SIGURG");
+#endif
+#ifdef SIGXCPU
+ lua_pushinteger(L, SIGXCPU);
+ lua_setfield(L, -2, "SIGXCPU");
+#endif
+#ifdef SIGXFSZ
+ lua_pushinteger(L, SIGXFSZ);
+ lua_setfield(L, -2, "SIGXFSZ");
+#endif
+#ifdef SIGVTALRM
+ lua_pushinteger(L, SIGVTALRM);
+ lua_setfield(L, -2, "SIGVTALRM");
+#endif
+#ifdef SIGPROF
+ lua_pushinteger(L, SIGPROF);
+ lua_setfield(L, -2, "SIGPROF");
+#endif
+#ifdef SIGWINCH
+ lua_pushinteger(L, SIGWINCH);
+ lua_setfield(L, -2, "SIGWINCH");
+#endif
+#ifdef SIGIO
+ lua_pushinteger(L, SIGIO);
+ lua_setfield(L, -2, "SIGIO");
+#endif
+#ifdef SIGPOLL
+ lua_pushinteger(L, SIGPOLL);
+ lua_setfield(L, -2, "SIGPOLL");
+#endif
+#ifdef SIGLOST
+ lua_pushinteger(L, SIGLOST);
+ lua_setfield(L, -2, "SIGLOST");
+#endif
+#ifdef SIGPWR
+ lua_pushinteger(L, SIGPWR);
+ lua_setfield(L, -2, "SIGPWR");
+#endif
+#ifdef SIGSYS
+ lua_pushinteger(L, SIGSYS);
+ lua_setfield(L, -2, "SIGSYS");
+#endif
+ return 1;
+}
+
+static int luv_af_string_to_num(const char* string) {
+ if (!string) return AF_UNSPEC;
+#ifdef AF_UNIX
+ if (strcmp(string, "unix") == 0) return AF_UNIX;
+#endif
+#ifdef AF_INET
+ if (strcmp(string, "inet") == 0) return AF_INET;
+#endif
+#ifdef AF_INET6
+ if (strcmp(string, "inet6") == 0) return AF_INET6;
+#endif
+#ifdef AF_IPX
+ if (strcmp(string, "ipx") == 0) return AF_IPX;
+#endif
+#ifdef AF_NETLINK
+ if (strcmp(string, "netlink") == 0) return AF_NETLINK;
+#endif
+#ifdef AF_X25
+ if (strcmp(string, "x25") == 0) return AF_X25;
+#endif
+#ifdef AF_AX25
+ if (strcmp(string, "ax25") == 0) return AF_AX25;
+#endif
+#ifdef AF_ATMPVC
+ if (strcmp(string, "atmpvc") == 0) return AF_ATMPVC;
+#endif
+#ifdef AF_APPLETALK
+ if (strcmp(string, "appletalk") == 0) return AF_APPLETALK;
+#endif
+#ifdef AF_PACKET
+ if (strcmp(string, "packet") == 0) return AF_PACKET;
+#endif
+ return 0;
+}
+
+static const char* luv_af_num_to_string(const int num) {
+ switch (num) {
+#ifdef AF_UNIX
+ case AF_UNIX: return "unix";
+#endif
+#ifdef AF_INET
+ case AF_INET: return "inet";
+#endif
+#ifdef AF_INET6
+ case AF_INET6: return "inet6";
+#endif
+#ifdef AF_IPX
+ case AF_IPX: return "ipx";
+#endif
+#ifdef AF_NETLINK
+ case AF_NETLINK: return "netlink";
+#endif
+#ifdef AF_X25
+ case AF_X25: return "x25";
+#endif
+#ifdef AF_AX25
+ case AF_AX25: return "ax25";
+#endif
+#ifdef AF_ATMPVC
+ case AF_ATMPVC: return "atmpvc";
+#endif
+#ifdef AF_APPLETALK
+ case AF_APPLETALK: return "appletalk";
+#endif
+#ifdef AF_PACKET
+ case AF_PACKET: return "packet";
+#endif
+ }
+ return NULL;
+}
+
+
+static int luv_sock_string_to_num(const char* string) {
+ if (!string) return 0;
+#ifdef SOCK_STREAM
+ if (strcmp(string, "stream") == 0) return SOCK_STREAM;
+#endif
+#ifdef SOCK_DGRAM
+ if (strcmp(string, "dgram") == 0) return SOCK_DGRAM;
+#endif
+#ifdef SOCK_SEQPACKET
+ if (strcmp(string, "seqpacket") == 0) return SOCK_SEQPACKET;
+#endif
+#ifdef SOCK_RAW
+ if (strcmp(string, "raw") == 0) return SOCK_RAW;
+#endif
+#ifdef SOCK_RDM
+ if (strcmp(string, "rdm") == 0) return SOCK_RDM;
+#endif
+ return 0;
+}
+
+static const char* luv_sock_num_to_string(const int num) {
+ switch (num) {
+#ifdef SOCK_STREAM
+ case SOCK_STREAM: return "stream";
+#endif
+#ifdef SOCK_DGRAM
+ case SOCK_DGRAM: return "dgram";
+#endif
+#ifdef SOCK_SEQPACKET
+ case SOCK_SEQPACKET: return "seqpacket";
+#endif
+#ifdef SOCK_RAW
+ case SOCK_RAW: return "raw";
+#endif
+#ifdef SOCK_RDM
+ case SOCK_RDM: return "rdm";
+#endif
+ }
+ return NULL;
+}
+
+static int luv_sig_string_to_num(const char* string) {
+ if (!string) return 0;
+#ifdef SIGHUP
+ if (strcmp(string, "sighup") == 0) return SIGHUP;
+#endif
+#ifdef SIGINT
+ if (strcmp(string, "sigint") == 0) return SIGINT;
+#endif
+#ifdef SIGQUIT
+ if (strcmp(string, "sigquit") == 0) return SIGQUIT;
+#endif
+#ifdef SIGILL
+ if (strcmp(string, "sigill") == 0) return SIGILL;
+#endif
+#ifdef SIGTRAP
+ if (strcmp(string, "sigtrap") == 0) return SIGTRAP;
+#endif
+#ifdef SIGABRT
+ if (strcmp(string, "sigabrt") == 0) return SIGABRT;
+#endif
+#ifdef SIGIOT
+ if (strcmp(string, "sigiot") == 0) return SIGIOT;
+#endif
+#ifdef SIGBUS
+ if (strcmp(string, "sigbus") == 0) return SIGBUS;
+#endif
+#ifdef SIGFPE
+ if (strcmp(string, "sigfpe") == 0) return SIGFPE;
+#endif
+#ifdef SIGKILL
+ if (strcmp(string, "sigkill") == 0) return SIGKILL;
+#endif
+#ifdef SIGUSR1
+ if (strcmp(string, "sigusr1") == 0) return SIGUSR1;
+#endif
+#ifdef SIGSEGV
+ if (strcmp(string, "sigsegv") == 0) return SIGSEGV;
+#endif
+#ifdef SIGUSR2
+ if (strcmp(string, "sigusr2") == 0) return SIGUSR2;
+#endif
+#ifdef SIGPIPE
+ if (strcmp(string, "sigpipe") == 0) return SIGPIPE;
+#endif
+#ifdef SIGALRM
+ if (strcmp(string, "sigalrm") == 0) return SIGALRM;
+#endif
+#ifdef SIGTERM
+ if (strcmp(string, "sigterm") == 0) return SIGTERM;
+#endif
+#ifdef SIGCHLD
+ if (strcmp(string, "sigchld") == 0) return SIGCHLD;
+#endif
+#ifdef SIGSTKFLT
+ if (strcmp(string, "sigstkflt") == 0) return SIGSTKFLT;
+#endif
+#ifdef SIGCONT
+ if (strcmp(string, "sigcont") == 0) return SIGCONT;
+#endif
+#ifdef SIGSTOP
+ if (strcmp(string, "sigstop") == 0) return SIGSTOP;
+#endif
+#ifdef SIGTSTP
+ if (strcmp(string, "sigtstp") == 0) return SIGTSTP;
+#endif
+#ifdef SIGBREAK
+ if (strcmp(string, "sigbreak") == 0) return SIGBREAK;
+#endif
+#ifdef SIGTTIN
+ if (strcmp(string, "sigttin") == 0) return SIGTTIN;
+#endif
+#ifdef SIGTTOU
+ if (strcmp(string, "sigttou") == 0) return SIGTTOU;
+#endif
+#ifdef SIGURG
+ if (strcmp(string, "sigurg") == 0) return SIGURG;
+#endif
+#ifdef SIGXCPU
+ if (strcmp(string, "sigxcpu") == 0) return SIGXCPU;
+#endif
+#ifdef SIGXFSZ
+ if (strcmp(string, "sigxfsz") == 0) return SIGXFSZ;
+#endif
+#ifdef SIGVTALRM
+ if (strcmp(string, "sigvtalrm") == 0) return SIGVTALRM;
+#endif
+#ifdef SIGPROF
+ if (strcmp(string, "sigprof") == 0) return SIGPROF;
+#endif
+#ifdef SIGWINCH
+ if (strcmp(string, "sigwinch") == 0) return SIGWINCH;
+#endif
+#ifdef SIGIO
+ if (strcmp(string, "sigio") == 0) return SIGIO;
+#endif
+#ifdef SIGPOLL
+ if (strcmp(string, "sigpoll") == 0) return SIGPOLL;
+#endif
+#ifdef SIGLOST
+ if (strcmp(string, "siglost") == 0) return SIGLOST;
+#endif
+#ifdef SIGPWR
+ if (strcmp(string, "sigpwr") == 0) return SIGPWR;
+#endif
+#ifdef SIGSYS
+ if (strcmp(string, "sigsys") == 0) return SIGSYS;
+#endif
+ return 0;
+}
+
+static const char* luv_sig_num_to_string(const int num) {
+ switch (num) {
+#ifdef SIGHUP
+ case SIGHUP: return "sighup";
+#endif
+#ifdef SIGINT
+ case SIGINT: return "sigint";
+#endif
+#ifdef SIGQUIT
+ case SIGQUIT: return "sigquit";
+#endif
+#ifdef SIGILL
+ case SIGILL: return "sigill";
+#endif
+#ifdef SIGTRAP
+ case SIGTRAP: return "sigtrap";
+#endif
+#ifdef SIGABRT
+ case SIGABRT: return "sigabrt";
+#endif
+#ifdef SIGIOT
+# if SIGIOT != SIGABRT
+ case SIGIOT: return "sigiot";
+# endif
+#endif
+#ifdef SIGBUS
+ case SIGBUS: return "sigbus";
+#endif
+#ifdef SIGFPE
+ case SIGFPE: return "sigfpe";
+#endif
+#ifdef SIGKILL
+ case SIGKILL: return "sigkill";
+#endif
+#ifdef SIGUSR1
+ case SIGUSR1: return "sigusr1";
+#endif
+#ifdef SIGSEGV
+ case SIGSEGV: return "sigsegv";
+#endif
+#ifdef SIGUSR2
+ case SIGUSR2: return "sigusr2";
+#endif
+#ifdef SIGPIPE
+ case SIGPIPE: return "sigpipe";
+#endif
+#ifdef SIGALRM
+ case SIGALRM: return "sigalrm";
+#endif
+#ifdef SIGTERM
+ case SIGTERM: return "sigterm";
+#endif
+#ifdef SIGCHLD
+ case SIGCHLD: return "sigchld";
+#endif
+#ifdef SIGSTKFLT
+ case SIGSTKFLT: return "sigstkflt";
+#endif
+#ifdef SIGCONT
+ case SIGCONT: return "sigcont";
+#endif
+#ifdef SIGSTOP
+ case SIGSTOP: return "sigstop";
+#endif
+#ifdef SIGTSTP
+ case SIGTSTP: return "sigtstp";
+#endif
+#ifdef SIGBREAK
+ case SIGBREAK: return "sigbreak";
+#endif
+#ifdef SIGTTIN
+ case SIGTTIN: return "sigttin";
+#endif
+#ifdef SIGTTOU
+ case SIGTTOU: return "sigttou";
+#endif
+#ifdef SIGURG
+ case SIGURG: return "sigurg";
+#endif
+#ifdef SIGXCPU
+ case SIGXCPU: return "sigxcpu";
+#endif
+#ifdef SIGXFSZ
+ case SIGXFSZ: return "sigxfsz";
+#endif
+#ifdef SIGVTALRM
+ case SIGVTALRM: return "sigvtalrm";
+#endif
+#ifdef SIGPROF
+ case SIGPROF: return "sigprof";
+#endif
+#ifdef SIGWINCH
+ case SIGWINCH: return "sigwinch";
+#endif
+#ifdef SIGIO
+ case SIGIO: return "sigio";
+#endif
+#ifdef SIGPOLL
+# if SIGPOLL != SIGIO
+ case SIGPOLL: return "sigpoll";
+# endif
+#endif
+#ifdef SIGLOST
+ case SIGLOST: return "siglost";
+#endif
+#ifdef SIGPWR
+# if SIGPWR != SIGLOST
+ case SIGPWR: return "sigpwr";
+# endif
+#endif
+#ifdef SIGSYS
+ case SIGSYS: return "sigsys";
+#endif
+ }
+ return NULL;
+}
diff --git a/3rdparty/luv/src/dns.c b/3rdparty/luv/src/dns.c
new file mode 100644
index 00000000000..f3446f30985
--- /dev/null
+++ b/3rdparty/luv/src/dns.c
@@ -0,0 +1,296 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+#ifndef WIN32
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#endif
+
+static void luv_pushaddrinfo(lua_State* L, struct addrinfo* res) {
+ char ip[INET6_ADDRSTRLEN];
+ int port, i = 0;
+ const char *addr;
+ struct addrinfo* curr = res;
+ lua_newtable(L);
+ for (curr = res; curr; curr = curr->ai_next) {
+ if (curr->ai_family == AF_INET || curr->ai_family == AF_INET6) {
+ lua_newtable(L);
+ if (curr->ai_family == AF_INET) {
+ addr = (char*) &((struct sockaddr_in*) curr->ai_addr)->sin_addr;
+ port = ((struct sockaddr_in*) curr->ai_addr)->sin_port;
+ } else {
+ addr = (char*) &((struct sockaddr_in6*) curr->ai_addr)->sin6_addr;
+ port = ((struct sockaddr_in6*) curr->ai_addr)->sin6_port;
+ }
+ lua_pushstring(L, luv_af_num_to_string(curr->ai_family));
+ lua_setfield(L, -2, "family");
+ uv_inet_ntop(curr->ai_family, addr, ip, INET6_ADDRSTRLEN);
+ lua_pushstring(L, ip);
+ lua_setfield(L, -2, "addr");
+ if (ntohs(port)) {
+ lua_pushinteger(L, ntohs(port));
+ lua_setfield(L, -2, "port");
+ }
+ lua_pushstring(L, luv_sock_num_to_string(curr->ai_socktype));
+ lua_setfield(L, -2, "socktype");
+ lua_pushstring(L, luv_af_num_to_string(curr->ai_protocol));
+ lua_setfield(L, -2, "protocol");
+ if (curr->ai_canonname) {
+ lua_pushstring(L, curr->ai_canonname);
+ lua_setfield(L, -2, "canonname");
+ }
+ lua_rawseti(L, -2, ++i);
+ }
+ }
+}
+
+static void luv_getaddrinfo_cb(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
+ lua_State* L = luv_state(req->loop);
+ int nargs;
+
+ if (status < 0) {
+ luv_status(L, status);
+ nargs = 1;
+ }
+ else {
+ lua_pushnil(L);
+ luv_pushaddrinfo(L, res);
+ nargs = 2;
+ }
+ luv_fulfill_req(L, req->data, nargs);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+ if (res) uv_freeaddrinfo(res);
+}
+
+
+static int luv_getaddrinfo(lua_State* L) {
+ uv_getaddrinfo_t* req;
+ const char* node;
+ const char* service;
+ struct addrinfo hints_s;
+ struct addrinfo* hints = &hints_s;
+ int ret, ref;
+ if (lua_isnoneornil(L, 1)) node = NULL;
+ else node = luaL_checkstring(L, 1);
+ if (lua_isnoneornil(L, 2)) service = NULL;
+ else service = luaL_checkstring(L, 2);
+ if (!lua_isnoneornil(L, 3)) luaL_checktype(L, 3, LUA_TTABLE);
+ else hints = NULL;
+ ref = lua_isnoneornil(L, 4) ? LUA_NOREF : luv_check_continuation(L, 4);
+ if (hints) {
+ // Initialize the hints
+ memset(hints, 0, sizeof(*hints));
+
+ // Process the `family` hint.
+ lua_getfield(L, 3, "family");
+ if (lua_isnumber(L, -1)) {
+ hints->ai_family = lua_tointeger(L, -1);
+ }
+ else if (lua_isstring(L, -1)) {
+ hints->ai_family = luv_af_string_to_num(lua_tostring(L, -1));
+ }
+ else if (lua_isnil(L, -1)) {
+ hints->ai_family = AF_UNSPEC;
+ }
+ else {
+ luaL_argerror(L, 3, "family hint must be string if set");
+ }
+ lua_pop(L, 1);
+
+ // Process `socktype` hint
+ lua_getfield(L, 3, "socktype");
+ if (lua_isnumber(L, -1)) {
+ hints->ai_socktype = lua_tointeger(L, -1);
+ }
+ else if (lua_isstring(L, -1)) {
+ hints->ai_socktype = luv_sock_string_to_num(lua_tostring(L, -1));
+ }
+ else if (!lua_isnil(L, -1)) {
+ return luaL_argerror(L, 3, "socktype hint must be string if set");
+ }
+ lua_pop(L, 1);
+
+ // Process the `protocol` hint
+ lua_getfield(L, 3, "protocol");
+ if (lua_isnumber(L, -1)) {
+ hints->ai_protocol = lua_tointeger(L, -1);
+ }
+ else if (lua_isstring(L, -1)) {
+ int protocol = luv_af_string_to_num(lua_tostring(L, -1));
+ if (protocol) {
+ hints->ai_protocol = protocol;
+ }
+ else {
+ return luaL_argerror(L, 3, "Invalid protocol hint");
+ }
+ }
+ else if (!lua_isnil(L, -1)) {
+ return luaL_argerror(L, 3, "protocol hint must be string if set");
+ }
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "addrconfig");
+ if (lua_toboolean(L, -1)) hints->ai_flags |= AI_ADDRCONFIG;
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "v4mapped");
+ if (lua_toboolean(L, -1)) hints->ai_flags |= AI_V4MAPPED;
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "all");
+ if (lua_toboolean(L, -1)) hints->ai_flags |= AI_ALL;
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "numerichost");
+ if (lua_toboolean(L, -1)) hints->ai_flags |= AI_NUMERICHOST;
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "passive");
+ if (lua_toboolean(L, -1)) hints->ai_flags |= AI_PASSIVE;
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "numericserv");
+ if (lua_toboolean(L, -1)) {
+ hints->ai_flags |= AI_NUMERICSERV;
+ /* On OS X upto at least OSX 10.9, getaddrinfo crashes
+ * if AI_NUMERICSERV is set and the servname is NULL or "0".
+ * This workaround avoids a segfault in libsystem.
+ */
+ if (NULL == service) service = "00";
+ }
+ lua_pop(L, 1);
+
+ lua_getfield(L, 3, "canonname");
+ if (lua_toboolean(L, -1)) hints->ai_flags |= AI_CANONNAME;
+ lua_pop(L, 1);
+ }
+
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+
+ ret = uv_getaddrinfo(luv_loop(L), req, ref == LUA_NOREF ? NULL : luv_getaddrinfo_cb, node, service, hints);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ if (ref == LUA_NOREF) {
+
+ lua_pop(L, 1);
+ luv_pushaddrinfo(L, req->addrinfo);
+ uv_freeaddrinfo(req->addrinfo);
+ luv_cleanup_req(L, req->data);
+ }
+ return 1;
+}
+
+static void luv_getnameinfo_cb(uv_getnameinfo_t* req, int status, const char* hostname, const char* service) {
+ lua_State* L = luv_state(req->loop);
+
+ int nargs;
+
+ if (status < 0) {
+ luv_status(L, status);
+ nargs = 1;
+ }
+ else {
+ lua_pushnil(L);
+ lua_pushstring(L, hostname);
+ lua_pushstring(L, service);
+ nargs = 3;
+ }
+
+ luv_fulfill_req(L, req->data, nargs);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+}
+
+static int luv_getnameinfo(lua_State* L) {
+ uv_getnameinfo_t* req;
+ struct sockaddr_storage addr;
+ const char* ip = NULL;
+ int flags = 0;
+ int ret, ref, port = 0;
+
+ luaL_checktype(L, 1, LUA_TTABLE);
+ memset(&addr, 0, sizeof(addr));
+
+ lua_getfield(L, 1, "ip");
+ if (lua_isstring(L, -1)) {
+ ip = lua_tostring(L, -1);
+ }
+ else if (!lua_isnil(L, -1)) {
+ luaL_argerror(L, 1, "ip property must be string if set");
+ }
+ lua_pop(L, 1);
+
+ lua_getfield(L, 1, "port");
+ if (lua_isnumber(L, -1)) {
+ port = lua_tointeger(L, -1);
+ }
+ else if (!lua_isnil(L, -1)) {
+ luaL_argerror(L, 1, "port property must be integer if set");
+ }
+ lua_pop(L, 1);
+
+ if (ip || port) {
+ if (!ip) ip = "0.0.0.0";
+ if (!uv_ip4_addr(ip, port, (struct sockaddr_in*)&addr)) {
+ addr.ss_family = AF_INET;
+ }
+ else if (!uv_ip6_addr(ip, port, (struct sockaddr_in6*)&addr)) {
+ addr.ss_family = AF_INET6;
+ }
+ else {
+ return luaL_argerror(L, 1, "Invalid ip address or port");
+ }
+ }
+
+ lua_getfield(L, 1, "family");
+ if (lua_isnumber(L, -1)) {
+ addr.ss_family = lua_tointeger(L, -1);
+ }
+ else if (lua_isstring(L, -1)) {
+ addr.ss_family = luv_af_string_to_num(lua_tostring(L, -1));
+ }
+ else if (!lua_isnil(L, -1)) {
+ luaL_argerror(L, 1, "family must be string if set");
+ }
+ lua_pop(L, 1);
+
+ ref = lua_isnoneornil(L, 2) ? LUA_NOREF : luv_check_continuation(L, 2);
+
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+
+ ret = uv_getnameinfo(luv_loop(L), req, ref == LUA_NOREF ? NULL : luv_getnameinfo_cb, (struct sockaddr*)&addr, flags);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ if (ref == LUA_NOREF) {
+ lua_pop(L, 1);
+ lua_pushstring(L, req->host);
+ lua_pushstring(L, req->service);
+ luv_cleanup_req(L, req->data);
+ return 2;
+ }
+ return 1;
+}
+
diff --git a/3rdparty/luv/src/fs.c b/3rdparty/luv/src/fs.c
new file mode 100644
index 00000000000..bacf11ea647
--- /dev/null
+++ b/3rdparty/luv/src/fs.c
@@ -0,0 +1,614 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+
+static uv_fs_t* luv_check_fs(lua_State* L, int index) {
+ uv_fs_t* req = luaL_checkudata(L, index, "uv_req");
+ luaL_argcheck(L, req->type = UV_FS && req->data, index, "Expected uv_fs_t");
+ return req;
+}
+
+static void luv_push_timespec_table(lua_State* L, const uv_timespec_t* t) {
+ lua_createtable(L, 0, 2);
+ lua_pushinteger(L, t->tv_sec);
+ lua_setfield(L, -2, "sec");
+ lua_pushinteger(L, t->tv_nsec);
+ lua_setfield(L, -2, "nsec");
+}
+
+static void luv_push_stats_table(lua_State* L, const uv_stat_t* s) {
+ const char* type = NULL;
+ lua_createtable(L, 0, 23);
+ lua_pushinteger(L, s->st_dev);
+ lua_setfield(L, -2, "dev");
+ lua_pushinteger(L, s->st_mode);
+ lua_setfield(L, -2, "mode");
+ lua_pushinteger(L, s->st_nlink);
+ lua_setfield(L, -2, "nlink");
+ lua_pushinteger(L, s->st_uid);
+ lua_setfield(L, -2, "uid");
+ lua_pushinteger(L, s->st_gid);
+ lua_setfield(L, -2, "gid");
+ lua_pushinteger(L, s->st_rdev);
+ lua_setfield(L, -2, "rdev");
+ lua_pushinteger(L, s->st_ino);
+ lua_setfield(L, -2, "ino");
+ lua_pushinteger(L, s->st_size);
+ lua_setfield(L, -2, "size");
+ lua_pushinteger(L, s->st_blksize);
+ lua_setfield(L, -2, "blksize");
+ lua_pushinteger(L, s->st_blocks);
+ lua_setfield(L, -2, "blocks");
+ lua_pushinteger(L, s->st_flags);
+ lua_setfield(L, -2, "flags");
+ lua_pushinteger(L, s->st_gen);
+ lua_setfield(L, -2, "gen");
+ luv_push_timespec_table(L, &s->st_atim);
+ lua_setfield(L, -2, "atime");
+ luv_push_timespec_table(L, &s->st_mtim);
+ lua_setfield(L, -2, "mtime");
+ luv_push_timespec_table(L, &s->st_ctim);
+ lua_setfield(L, -2, "ctime");
+ luv_push_timespec_table(L, &s->st_birthtim);
+ lua_setfield(L, -2, "birthtime");
+ if (S_ISREG(s->st_mode)) {
+ type = "file";
+ }
+ else if (S_ISDIR(s->st_mode)) {
+ type = "directory";
+ }
+ else if (S_ISLNK(s->st_mode)) {
+ type = "link";
+ }
+ else if (S_ISFIFO(s->st_mode)) {
+ type = "fifo";
+ }
+#ifdef S_ISSOCK
+ else if (S_ISSOCK(s->st_mode)) {
+ type = "socket";
+ }
+#endif
+ else if (S_ISCHR(s->st_mode)) {
+ type = "char";
+ }
+ else if (S_ISBLK(s->st_mode)) {
+ type = "block";
+ }
+ if (type) {
+ lua_pushstring(L, type);
+ lua_setfield(L, -2, "type");
+ }
+}
+
+static int luv_check_flags(lua_State* L, int index) {
+ const char* string;
+ if (lua_isnumber(L, index)) {
+ return lua_tointeger(L, index);
+ }
+ else if (!lua_isstring(L, index)) {
+ return luaL_argerror(L, index, "Expected string or integer for file open mode");
+ }
+ string = lua_tostring(L, index);
+
+ if (strcmp(string, "r") == 0) return O_RDONLY;
+#ifdef O_SYNC
+ if (strcmp(string, "rs") == 0 ||
+ strcmp(string, "sr") == 0) return O_RDONLY | O_SYNC;
+#endif
+ if (strcmp(string, "r+") == 0) return O_RDWR;
+#ifdef O_SYNC
+ if (strcmp(string, "rs+") == 0 ||
+ strcmp(string, "sr+") == 0) return O_RDWR | O_SYNC;
+#endif
+ if (strcmp(string, "w") == 0) return O_TRUNC | O_CREAT | O_WRONLY;
+ if (strcmp(string, "wx") == 0 ||
+ strcmp(string, "xw") == 0) return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL;
+ if (strcmp(string, "w+") == 0) return O_TRUNC | O_CREAT | O_RDWR;
+ if (strcmp(string, "wx+") == 0 ||
+ strcmp(string, "xw+") == 0) return O_TRUNC | O_CREAT | O_RDWR | O_EXCL;
+ if (strcmp(string, "a") == 0) return O_APPEND | O_CREAT | O_WRONLY;
+ if (strcmp(string, "ax") == 0 ||
+ strcmp(string, "xa") == 0) return O_APPEND | O_CREAT | O_WRONLY | O_EXCL;
+ if (strcmp(string, "a+") == 0) return O_APPEND | O_CREAT | O_RDWR;
+ if (strcmp(string, "ax+") == 0 ||
+ strcmp(string, "xa+") == 0) return O_APPEND | O_CREAT | O_RDWR | O_EXCL;
+
+ return luaL_error(L, "Unknown file open flag '%s'", string);
+}
+
+static int luv_check_amode(lua_State* L, int index) {
+ size_t i;
+ int mode;
+ const char* string;
+ if (lua_isnumber(L, index)) {
+ return lua_tointeger(L, index);
+ }
+ else if (!lua_isstring(L, index)) {
+ return luaL_argerror(L, index, "Expected string or integer for file access mode check");
+ }
+ string = lua_tostring(L, index);
+ mode = 0;
+ for (i = 0; i < strlen(string); ++i) {
+ switch (string[i]) {
+ case 'r': case 'R':
+ mode |= R_OK;
+ break;
+ case 'w': case 'W':
+ mode |= W_OK;
+ break;
+ case 'x': case 'X':
+ mode |= X_OK;
+ break;
+ default:
+ return luaL_argerror(L, index, "Unknown character in access mode string");
+ }
+ }
+ return mode;
+}
+
+/* Processes a result and pushes the data onto the stack
+ returns the number of items pushed */
+static int push_fs_result(lua_State* L, uv_fs_t* req) {
+ luv_req_t* data = req->data;
+
+ if (req->fs_type == UV_FS_ACCESS) {
+ lua_pushboolean(L, req->result >= 0);
+ return 1;
+ }
+
+ if (req->result < 0) {
+ lua_pushnil(L);
+ if (req->path) {
+ lua_pushfstring(L, "%s: %s: %s", uv_err_name(req->result), uv_strerror(req->result), req->path);
+ }
+ else {
+ lua_pushfstring(L, "%s: %s", uv_err_name(req->result), uv_strerror(req->result));
+ }
+ return 2;
+ }
+
+ switch (req->fs_type) {
+ case UV_FS_CLOSE:
+ case UV_FS_RENAME:
+ case UV_FS_UNLINK:
+ case UV_FS_RMDIR:
+ case UV_FS_MKDIR:
+ case UV_FS_FTRUNCATE:
+ case UV_FS_FSYNC:
+ case UV_FS_FDATASYNC:
+ case UV_FS_LINK:
+ case UV_FS_SYMLINK:
+ case UV_FS_CHMOD:
+ case UV_FS_FCHMOD:
+ case UV_FS_CHOWN:
+ case UV_FS_FCHOWN:
+ case UV_FS_UTIME:
+ case UV_FS_FUTIME:
+ lua_pushboolean(L, 1);
+ return 1;
+
+ case UV_FS_OPEN:
+ case UV_FS_SENDFILE:
+ case UV_FS_WRITE:
+ lua_pushinteger(L, req->result);
+ return 1;
+
+ case UV_FS_STAT:
+ case UV_FS_LSTAT:
+ case UV_FS_FSTAT:
+ luv_push_stats_table(L, &req->statbuf);
+ return 1;
+
+ case UV_FS_MKDTEMP:
+ lua_pushstring(L, req->path);
+ return 1;
+
+ case UV_FS_READLINK:
+ case UV_FS_REALPATH:
+ lua_pushstring(L, (char*)req->ptr);
+ return 1;
+
+ case UV_FS_READ:
+ lua_pushlstring(L, data->data, req->result);
+ return 1;
+
+ case UV_FS_SCANDIR:
+ // Expose the userdata for the request.
+ lua_rawgeti(L, LUA_REGISTRYINDEX, data->req_ref);
+ return 1;
+
+ default:
+ lua_pushnil(L);
+ lua_pushfstring(L, "UNKNOWN FS TYPE %d\n", req->fs_type);
+ return 2;
+ }
+
+}
+
+static void luv_fs_cb(uv_fs_t* req) {
+ lua_State* L = luv_state(req->loop);
+
+ int nargs = push_fs_result(L, req);
+ if (nargs == 2 && lua_isnil(L, -nargs)) {
+ // If it was an error, convert to (err, value) format.
+ lua_remove(L, -nargs);
+ nargs--;
+ }
+ else {
+ // Otherwise insert a nil in front to convert to (err, value) format.
+ lua_pushnil(L);
+ lua_insert(L, -nargs - 1);
+ nargs++;
+ }
+ luv_fulfill_req(L, req->data, nargs);
+ if (req->fs_type != UV_FS_SCANDIR) {
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+ uv_fs_req_cleanup(req);
+ }
+}
+
+#define FS_CALL(func, req, ...) { \
+ int ret, sync; \
+ luv_req_t* data = req->data; \
+ sync = data->callback_ref == LUA_NOREF; \
+ ret = uv_fs_##func(luv_loop(L), req, __VA_ARGS__, \
+ sync ? NULL : luv_fs_cb); \
+ if (req->fs_type != UV_FS_ACCESS && ret < 0) { \
+ lua_pushnil(L); \
+ if (req->path) { \
+ lua_pushfstring(L, "%s: %s: %s", uv_err_name(req->result), uv_strerror(req->result), req->path); \
+ } \
+ else { \
+ lua_pushfstring(L, "%s: %s", uv_err_name(req->result), uv_strerror(req->result)); \
+ } \
+ lua_pushstring(L, uv_err_name(req->result)); \
+ luv_cleanup_req(L, req->data); \
+ req->data = NULL; \
+ uv_fs_req_cleanup(req); \
+ return 3; \
+ } \
+ if (sync) { \
+ int nargs = push_fs_result(L, req); \
+ if (req->fs_type != UV_FS_SCANDIR) { \
+ luv_cleanup_req(L, req->data); \
+ req->data = NULL; \
+ uv_fs_req_cleanup(req); \
+ } \
+ return nargs; \
+ } \
+ lua_rawgeti(L, LUA_REGISTRYINDEX, data->req_ref); \
+ return 1; \
+}
+
+static int luv_fs_close(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(close, req, file);
+}
+
+static int luv_fs_open(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int flags = luv_check_flags(L, 2);
+ int mode = luaL_checkinteger(L, 3);
+ int ref = luv_check_continuation(L, 4);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(open, req, path, flags, mode);
+}
+
+static int luv_fs_read(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int64_t len = luaL_checkinteger(L, 2);
+ int64_t offset = luaL_checkinteger(L, 3);
+ uv_buf_t buf;
+ int ref;
+ uv_fs_t* req;
+ char* data = malloc(len);
+ if (!data) return luaL_error(L, "Failure to allocate buffer");
+ buf = uv_buf_init(data, len);
+ ref = luv_check_continuation(L, 4);
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ // TODO: find out why we can't just use req->ptr for the base
+ ((luv_req_t*)req->data)->data = buf.base;
+ FS_CALL(read, req, file, &buf, 1, offset);
+}
+
+static int luv_fs_unlink(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(unlink, req, path);
+}
+
+static int luv_fs_write(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ uv_buf_t buf;
+ int64_t offset;
+ int ref;
+ uv_fs_t* req;
+ size_t count;
+ uv_buf_t *bufs = NULL;
+
+ if (lua_istable(L, 2)) {
+ bufs = luv_prep_bufs(L, 2, &count);
+ buf.base = NULL;
+ }
+ else if (lua_isstring(L, 2)) {
+ luv_check_buf(L, 2, &buf);
+ count = 1;
+ }
+ else {
+ return luaL_argerror(L, 2, "data must be string or table of strings");
+ }
+
+ offset = luaL_checkinteger(L, 3);
+ ref = luv_check_continuation(L, 4);
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ req->ptr = buf.base;
+ ((luv_req_t*)req->data)->data = bufs;
+ FS_CALL(write, req, file, bufs ? bufs : &buf, count, offset);
+}
+
+static int luv_fs_mkdir(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int mode = luaL_checkinteger(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(mkdir, req, path, mode);
+}
+
+static int luv_fs_mkdtemp(lua_State* L) {
+ const char* tpl = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(mkdtemp, req, tpl);
+}
+
+static int luv_fs_rmdir(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(rmdir, req, path);
+}
+
+static int luv_fs_scandir(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int flags = 0; // TODO: find out what these flags are.
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(scandir, req, path, flags);
+}
+
+static int luv_fs_scandir_next(lua_State* L) {
+ uv_fs_t* req = luv_check_fs(L, 1);
+ uv_dirent_t ent;
+ int ret = uv_fs_scandir_next(req, &ent);
+ const char* type;
+ if (ret == UV_EOF) {
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+ uv_fs_req_cleanup(req);
+ return 0;
+ }
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushstring(L, ent.name);
+ switch (ent.type) {
+ case UV_DIRENT_UNKNOWN: return 1;
+ case UV_DIRENT_FILE: type = "file"; break;
+ case UV_DIRENT_DIR: type = "directory"; break;
+ case UV_DIRENT_LINK: type = "link"; break;
+ case UV_DIRENT_FIFO: type = "fifo"; break;
+ case UV_DIRENT_SOCKET: type = "socket"; break;
+ case UV_DIRENT_CHAR: type = "char"; break;
+ case UV_DIRENT_BLOCK: type = "block"; break;
+ default: assert(0);
+ }
+ lua_pushstring(L, type);
+ return 2;
+}
+
+static int luv_fs_stat(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(stat, req, path);
+}
+
+static int luv_fs_fstat(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(fstat, req, file);
+}
+
+static int luv_fs_lstat(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(lstat, req, path);
+}
+
+static int luv_fs_rename(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ const char* new_path = luaL_checkstring(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(rename, req, path, new_path);
+}
+
+static int luv_fs_fsync(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(fsync, req, file);
+}
+
+static int luv_fs_fdatasync(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(fdatasync, req, file);
+}
+
+static int luv_fs_ftruncate(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int64_t offset = luaL_checkinteger(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(ftruncate, req, file, offset);
+}
+
+static int luv_fs_sendfile(lua_State* L) {
+ uv_file out_fd = luaL_checkinteger(L, 1);
+ uv_file in_fd = luaL_checkinteger(L, 2);
+ int64_t in_offset = luaL_checkinteger(L, 3);
+ size_t length = luaL_checkinteger(L, 4);
+ int ref = luv_check_continuation(L, 5);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(sendfile, req, out_fd, in_fd, in_offset, length);
+}
+
+static int luv_fs_access(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int amode = luv_check_amode(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(access, req, path, amode);
+}
+
+static int luv_fs_chmod(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int mode = luaL_checkinteger(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(chmod, req, path, mode);
+}
+
+static int luv_fs_fchmod(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ int mode = luaL_checkinteger(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(fchmod, req, file, mode);
+}
+
+static int luv_fs_utime(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ double atime = luaL_checknumber(L, 2);
+ double mtime = luaL_checknumber(L, 3);
+ int ref = luv_check_continuation(L, 4);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(utime, req, path, atime, mtime);
+}
+
+static int luv_fs_futime(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ double atime = luaL_checknumber(L, 2);
+ double mtime = luaL_checknumber(L, 3);
+ int ref = luv_check_continuation(L, 4);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(futime, req, file, atime, mtime);
+}
+
+static int luv_fs_link(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ const char* new_path = luaL_checkstring(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(link, req, path, new_path);
+}
+
+static int luv_fs_symlink(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ const char* new_path = luaL_checkstring(L, 2);
+ int flags = 0, ref;
+ uv_fs_t* req;
+ if (lua_type(L, 3) == LUA_TTABLE) {
+ lua_getfield(L, 3, "dir");
+ if (lua_toboolean(L, -1)) flags |= UV_FS_SYMLINK_DIR;
+ lua_pop(L, 1);
+ lua_getfield(L, 3, "junction");
+ if (lua_toboolean(L, -1)) flags |= UV_FS_SYMLINK_JUNCTION;
+ lua_pop(L, 1);
+ }
+ ref = luv_check_continuation(L, 4);
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+
+ FS_CALL(symlink, req, path, new_path, flags);
+}
+
+static int luv_fs_readlink(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(readlink, req, path);
+}
+
+static int luv_fs_realpath(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(realpath, req, path);
+}
+
+static int luv_fs_chown(lua_State* L) {
+ const char* path = luaL_checkstring(L, 1);
+ uv_uid_t uid = luaL_checkinteger(L, 2);
+ uv_uid_t gid = luaL_checkinteger(L, 3);
+ int ref = luv_check_continuation(L, 4);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(chown, req, path, uid, gid);
+}
+
+static int luv_fs_fchown(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ uv_uid_t uid = luaL_checkinteger(L, 2);
+ uv_uid_t gid = luaL_checkinteger(L, 3);
+ int ref = luv_check_continuation(L, 4);
+ uv_fs_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ FS_CALL(fchown, req, file, uid, gid);
+}
diff --git a/3rdparty/luv/src/fs_event.c b/3rdparty/luv/src/fs_event.c
new file mode 100644
index 00000000000..52bda788421
--- /dev/null
+++ b/3rdparty/luv/src/fs_event.c
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+
+static uv_fs_event_t* luv_check_fs_event(lua_State* L, int index) {
+ uv_fs_event_t* handle = luv_checkudata(L, index, "uv_fs_event");
+ luaL_argcheck(L, handle->type == UV_FS_EVENT && handle->data, index, "Expected uv_fs_event_t");
+ return handle;
+}
+
+static int luv_new_fs_event(lua_State* L) {
+ uv_fs_event_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_fs_event_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_fs_event_cb(uv_fs_event_t* handle, const char* filename, int events, int status) {
+ lua_State* L = luv_state(handle->loop);
+
+ // err
+ luv_status(L, status);
+
+ // filename
+ lua_pushstring(L, filename);
+
+ // events
+ lua_newtable(L);
+ if (events & UV_RENAME) {
+ lua_pushboolean(L, 1);
+ lua_setfield(L, -2, "rename");
+ }
+ if (events & UV_CHANGE) {
+ lua_pushboolean(L, 1);
+ lua_setfield(L, -2, "change");
+ }
+
+ luv_call_callback(L, handle->data, LUV_FS_EVENT, 3);
+}
+
+static int luv_fs_event_start(lua_State* L) {
+ uv_fs_event_t* handle = luv_check_fs_event(L, 1);
+ const char* path = luaL_checkstring(L, 2);
+ int flags = 0, ret;
+ luaL_checktype(L, 3, LUA_TTABLE);
+ lua_getfield(L, 3, "watch_entry");
+ if (lua_toboolean(L, -1)) flags |= UV_FS_EVENT_WATCH_ENTRY;
+ lua_pop(L, 1);
+ lua_getfield(L, 3, "stat");
+ if (lua_toboolean(L, -1)) flags |= UV_FS_EVENT_STAT;
+ lua_pop(L, 1);
+ lua_getfield(L, 3, "recursive");
+ if (lua_toboolean(L, -1)) flags |= UV_FS_EVENT_RECURSIVE;
+ lua_pop(L, 1);
+ luv_check_callback(L, handle->data, LUV_FS_EVENT, 4);
+ ret = uv_fs_event_start(handle, luv_fs_event_cb, path, flags);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_fs_event_stop(lua_State* L) {
+ uv_fs_event_t* handle = luv_check_fs_event(L, 1);
+ int ret = uv_fs_event_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_fs_event_getpath(lua_State* L) {
+ uv_fs_event_t* handle = luv_check_fs_event(L, 1);
+ size_t len = 2*PATH_MAX;
+ char buf[2*PATH_MAX];
+ int ret = uv_fs_event_getpath(handle, buf, &len);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, buf, len);
+ return 1;
+}
diff --git a/3rdparty/luv/src/fs_poll.c b/3rdparty/luv/src/fs_poll.c
new file mode 100644
index 00000000000..7ead32f322c
--- /dev/null
+++ b/3rdparty/luv/src/fs_poll.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+
+static uv_fs_poll_t* luv_check_fs_poll(lua_State* L, int index) {
+ uv_fs_poll_t* handle = luv_checkudata(L, index, "uv_fs_poll");
+ luaL_argcheck(L, handle->type == UV_FS_POLL && handle->data, index, "Expected uv_fs_poll_t");
+ return handle;
+}
+
+static int luv_new_fs_poll(lua_State* L) {
+ uv_fs_poll_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_fs_poll_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_fs_poll_cb(uv_fs_poll_t* handle, int status, const uv_stat_t* prev, const uv_stat_t* curr) {
+ lua_State* L = luv_state(handle->loop);
+
+ // err
+ luv_status(L, status);
+
+ // prev
+ if (prev) {
+ luv_push_stats_table(L, prev);
+ }
+ else {
+ lua_pushnil(L);
+ }
+
+ // curr
+ if (curr) {
+ luv_push_stats_table(L, curr);
+ }
+ else {
+ lua_pushnil(L);
+ }
+
+ luv_call_callback(L, handle->data, LUV_FS_POLL, 3);
+}
+
+static int luv_fs_poll_start(lua_State* L) {
+ uv_fs_poll_t* handle = luv_check_fs_poll(L, 1);
+ const char* path = luaL_checkstring(L, 2);
+ unsigned int interval = luaL_checkinteger(L, 3);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_FS_POLL, 4);
+ ret = uv_fs_poll_start(handle, luv_fs_poll_cb, path, interval);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_fs_poll_stop(lua_State* L) {
+ uv_fs_poll_t* handle = luv_check_fs_poll(L, 1);
+ int ret = uv_fs_poll_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_fs_poll_getpath(lua_State* L) {
+ uv_fs_poll_t* handle = luv_check_fs_poll(L, 1);
+ size_t len = 2*PATH_MAX;
+ char buf[2*PATH_MAX];
+ int ret = uv_fs_poll_getpath(handle, buf, &len);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, buf, len);
+ return 1;
+}
diff --git a/3rdparty/luv/src/handle.c b/3rdparty/luv/src/handle.c
new file mode 100644
index 00000000000..3efd2982641
--- /dev/null
+++ b/3rdparty/luv/src/handle.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static void* luv_newuserdata(lua_State* L, size_t sz) {
+ void* handle = malloc(sz);
+ if (handle) {
+ *(void**)lua_newuserdata(L, sizeof(void*)) = handle;
+ }
+ return handle;
+}
+
+static void* luv_checkudata(lua_State* L, int ud, const char* tname) {
+ return *(void**) luaL_checkudata(L, ud, tname);
+}
+
+static uv_handle_t* luv_check_handle(lua_State* L, int index) {
+ int isHandle;
+ uv_handle_t* handle;
+ if (!(handle = *(void**)lua_touserdata(L, index))) { goto fail; }
+ lua_getfield(L, LUA_REGISTRYINDEX, "uv_handle");
+ lua_getmetatable(L, index < 0 ? index - 1 : index);
+ lua_rawget(L, -2);
+ isHandle = lua_toboolean(L, -1);
+ lua_pop(L, 2);
+ if (isHandle) { return handle; }
+ fail: luaL_argerror(L, index, "Expected uv_handle userdata");
+ return NULL;
+}
+
+// Show the libuv type instead of generic "userdata"
+static int luv_handle_tostring(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ switch (handle->type) {
+#define XX(uc, lc) case UV_##uc: lua_pushfstring(L, "uv_"#lc"_t: %p", handle); break;
+ UV_HANDLE_TYPE_MAP(XX)
+#undef XX
+ default: lua_pushfstring(L, "uv_handle_t: %p", handle); break;
+ }
+ return 1;
+}
+
+static int luv_is_active(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ int ret = uv_is_active(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushboolean(L, ret);
+ return 1;
+}
+
+static int luv_is_closing(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ int ret = uv_is_closing(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushboolean(L, ret);
+ return 1;
+}
+
+static void luv_close_cb(uv_handle_t* handle) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ if (!data) return;
+ luv_call_callback(L, data, LUV_CLOSED, 0);
+ luv_cleanup_handle(L, data);
+ handle->data = NULL;
+}
+
+static int luv_close(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ if (uv_is_closing(handle)) {
+ luaL_error(L, "handle %p is already closing", handle);
+ }
+ if (!lua_isnoneornil(L, 2)) {
+ luv_check_callback(L, handle->data, LUV_CLOSED, 2);
+ }
+ uv_close(handle, luv_close_cb);
+ return 0;
+}
+
+static void luv_gc_cb(uv_handle_t* handle) {
+ luv_close_cb(handle);
+ free(handle);
+}
+
+static int luv_handle_gc(lua_State* L) {
+ void** udata = lua_touserdata(L, 1);
+ uv_handle_t* handle = *udata;
+ if (handle != NULL) {
+ if (!uv_is_closing(handle))
+ uv_close(handle, luv_gc_cb);
+ else
+ free(*udata);
+
+ *udata = NULL;
+ }
+
+ return 0;
+}
+
+static int luv_ref(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ uv_ref(handle);
+ return 0;
+}
+
+static int luv_unref(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ uv_unref(handle);
+ return 0;
+}
+
+static int luv_has_ref(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ int ret = uv_has_ref(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushboolean(L, ret);
+ return 1;
+}
+
+static int luv_send_buffer_size(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ int value;
+ int ret;
+ if (lua_isnoneornil(L, 2)) {
+ value = 0;
+ }
+ else {
+ value = luaL_checkinteger(L, 2);
+ }
+ ret = uv_send_buffer_size(handle, &value);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_recv_buffer_size(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ int value;
+ int ret;
+ if (lua_isnoneornil(L, 2)) {
+ value = 0;
+ }
+ else {
+ value = luaL_checkinteger(L, 2);
+ }
+ ret = uv_recv_buffer_size(handle, &value);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_fileno(lua_State* L) {
+ uv_handle_t* handle = luv_check_handle(L, 1);
+ uv_os_fd_t fd;
+ int ret = uv_fileno(handle, &fd);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, (LUA_INTEGER)(ptrdiff_t)fd);
+ return 1;
+}
diff --git a/3rdparty/luv/src/idle.c b/3rdparty/luv/src/idle.c
new file mode 100644
index 00000000000..132cbe43c33
--- /dev/null
+++ b/3rdparty/luv/src/idle.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_idle_t* luv_check_idle(lua_State* L, int index) {
+ uv_idle_t* handle = luv_checkudata(L, index, "uv_idle");
+ luaL_argcheck(L, handle->type == UV_IDLE && handle->data, index, "Expected uv_idle_t");
+ return handle;
+}
+
+static int luv_new_idle(lua_State* L) {
+ uv_idle_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_idle_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_idle_cb(uv_idle_t* handle) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ luv_call_callback(L, data, LUV_IDLE, 0);
+}
+
+static int luv_idle_start(lua_State* L) {
+ uv_idle_t* handle = luv_check_idle(L, 1);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_IDLE, 2);
+ ret = uv_idle_start(handle, luv_idle_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_idle_stop(lua_State* L) {
+ uv_idle_t* handle = luv_check_idle(L, 1);
+ int ret = uv_idle_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
diff --git a/3rdparty/luv/src/lhandle.c b/3rdparty/luv/src/lhandle.c
new file mode 100644
index 00000000000..c8cf294504e
--- /dev/null
+++ b/3rdparty/luv/src/lhandle.c
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "lhandle.h"
+
+static luv_handle_t* luv_setup_handle(lua_State* L) {
+ luv_handle_t* data;
+ const uv_handle_t* handle = *(void**)lua_touserdata(L, -1);
+ luaL_checktype(L, -1, LUA_TUSERDATA);
+
+ data = malloc(sizeof(*data));
+ if (!data) luaL_error(L, "Can't allocate luv handle");
+
+ #define XX(uc, lc) case UV_##uc: \
+ luaL_getmetatable(L, "uv_"#lc); \
+ break;
+ switch (handle->type) {
+ UV_HANDLE_TYPE_MAP(XX)
+ default:
+ luaL_error(L, "Unknown handle type");
+ return NULL;
+ }
+ #undef XX
+
+ lua_setmetatable(L, -2);
+
+ lua_pushvalue(L, -1);
+
+ data->ref = luaL_ref(L, LUA_REGISTRYINDEX);
+ data->callbacks[0] = LUA_NOREF;
+ data->callbacks[1] = LUA_NOREF;
+ data->extra = NULL;
+ return data;
+}
+
+static void luv_check_callback(lua_State* L, luv_handle_t* data, luv_callback_id id, int index) {
+ luaL_checktype(L, index, LUA_TFUNCTION);
+ luaL_unref(L, LUA_REGISTRYINDEX, data->callbacks[id]);
+ lua_pushvalue(L, index);
+ data->callbacks[id] = luaL_ref(L, LUA_REGISTRYINDEX);
+}
+
+static int traceback (lua_State *L) {
+ if (!lua_isstring(L, 1)) /* 'message' not a string? */
+ return 1; /* keep it intact */
+ lua_pushglobaltable(L);
+ lua_getfield(L, -1, "debug");
+ lua_remove(L, -2);
+ if (!lua_istable(L, -1)) {
+ lua_pop(L, 1);
+ return 1;
+ }
+ lua_getfield(L, -1, "traceback");
+ if (!lua_isfunction(L, -1)) {
+ lua_pop(L, 2);
+ return 1;
+ }
+ lua_pushvalue(L, 1); /* pass error message */
+ lua_pushinteger(L, 2); /* skip this function and traceback */
+ lua_call(L, 2, 1); /* call debug.traceback */
+ return 1;
+}
+
+static void luv_call_callback(lua_State* L, luv_handle_t* data, luv_callback_id id, int nargs) {
+ int ref = data->callbacks[id];
+ if (ref == LUA_NOREF) {
+ lua_pop(L, nargs);
+ }
+ else {
+ // Get the traceback function in case of error
+ lua_pushcfunction(L, traceback);
+ // And insert it before the args if there are any.
+ if (nargs) {
+ lua_insert(L, -1 - nargs);
+ }
+ // Get the callback
+ lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
+ // And insert it before the args if there are any.
+ if (nargs) {
+ lua_insert(L, -1 - nargs);
+ }
+
+ if (lua_pcall(L, nargs, 0, -2 - nargs)) {
+ fprintf(stderr, "Uncaught Error: %s\n", lua_tostring(L, -1));
+ exit(-1);
+ }
+ // Remove the traceback function
+ lua_pop(L, 1);
+ }
+}
+
+static void luv_cleanup_handle(lua_State* L, luv_handle_t* data) {
+ luaL_unref(L, LUA_REGISTRYINDEX, data->ref);
+ luaL_unref(L, LUA_REGISTRYINDEX, data->callbacks[0]);
+ luaL_unref(L, LUA_REGISTRYINDEX, data->callbacks[1]);
+ if (data->extra)
+ free(data->extra);
+ free(data);
+}
+
+static void luv_find_handle(lua_State* L, luv_handle_t* data) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, data->ref);
+}
diff --git a/3rdparty/luv/src/lhandle.h b/3rdparty/luv/src/lhandle.h
new file mode 100644
index 00000000000..f6c0733719b
--- /dev/null
+++ b/3rdparty/luv/src/lhandle.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef LUV_LHANDLE_H
+#define LUV_LHANDLE_H
+
+#include "luv.h"
+
+/* There are two slots for holding callbacks. One is for the CLOSED event.
+ The other slot is for all others since they never conflict in practice.
+*/
+#define luv_callback_id int
+#define LUV_CLOSED 0
+#define LUV_TIMEOUT 1
+#define LUV_PREPARE 1
+#define LUV_IDLE 1
+#define LUV_CHECK 1
+#define LUV_ASYNC 1
+#define LUV_POLL 1
+#define LUV_SIGNAL 1
+#define LUV_EXIT 1
+#define LUV_CONNECTION 1
+#define LUV_READ 1
+#define LUV_RECV 1
+#define LUV_FS_EVENT 1
+#define LUV_FS_POLL 1
+
+/* Ref for userdata and event callbacks */
+typedef struct {
+ int ref;
+ int callbacks[2];
+ void* extra;
+} luv_handle_t;
+
+/* Setup the handle at the top of the stack */
+static luv_handle_t* luv_setup_handle(lua_State* L);
+
+/* Store a lua callback in a luv_handle for future callbacks.
+ Either replace an existing callback by id or append a new one at the end.
+*/
+static void luv_check_callback(lua_State* L, luv_handle_t* data, luv_callback_id id, int index);
+
+/* Lookup a function and call it with nargs
+ If there is no such function, pop the args.
+*/
+static void luv_call_callback(lua_State* L, luv_handle_t* data, luv_callback_id id, int nargs);
+
+/* Push a userdata on the stack from a handle */
+static void luv_find_handle(lua_State* L, luv_handle_t* data);
+
+/* Recursivly free the luv_handle and all event handlers */
+static void luv_cleanup_handle(lua_State* L, luv_handle_t* data);
+
+#endif
diff --git a/3rdparty/luv/src/loop.c b/3rdparty/luv/src/loop.c
new file mode 100644
index 00000000000..33c49d3f64c
--- /dev/null
+++ b/3rdparty/luv/src/loop.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static int luv_loop_close(lua_State* L) {
+ int ret = uv_loop_close(luv_loop(L));
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+// These are the same order as uv_run_mode which also starts at 0
+static const char *const luv_runmodes[] = {
+ "default", "once", "nowait", NULL
+};
+
+static int luv_run(lua_State* L) {
+ int mode = luaL_checkoption(L, 1, "default", luv_runmodes);
+ int ret = uv_run(luv_loop(L), mode);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushboolean(L, ret);
+ return 1;
+}
+
+static int luv_loop_alive(lua_State* L) {
+ int ret = uv_loop_alive(luv_loop(L));
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushboolean(L, ret);
+ return 1;
+}
+
+static int luv_stop(lua_State* L) {
+ uv_stop(luv_loop(L));
+ return 0;
+}
+
+static int luv_backend_fd(lua_State* L) {
+ int ret = uv_backend_fd(luv_loop(L));
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_backend_timeout(lua_State* L) {
+ int ret = uv_backend_timeout(luv_loop(L));
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_now(lua_State* L) {
+ uint64_t now = uv_now(luv_loop(L));
+ lua_pushinteger(L, now);
+ return 1;
+}
+
+static int luv_update_time(lua_State* L) {
+ uv_update_time(luv_loop(L));
+ return 0;
+}
+
+static void luv_walk_cb(uv_handle_t* handle, void* arg) {
+ lua_State* L = arg;
+ luv_handle_t* data = handle->data;
+
+ // Sanity check
+ // Most invalid values are large and refs are small, 0x1000000 is arbitrary.
+ assert(data && data->ref < 0x1000000);
+
+ lua_pushvalue(L, 1); // Copy the function
+ luv_find_handle(L, data); // Get the userdata
+ lua_call(L, 1, 0); // Call the function
+}
+
+static int luv_walk(lua_State* L) {
+ luaL_checktype(L, 1, LUA_TFUNCTION);
+ uv_walk(luv_loop(L), luv_walk_cb, L);
+ return 0;
+}
diff --git a/3rdparty/luv/src/lreq.c b/3rdparty/luv/src/lreq.c
new file mode 100644
index 00000000000..38ed6a77eb0
--- /dev/null
+++ b/3rdparty/luv/src/lreq.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "lreq.h"
+
+
+static int luv_check_continuation(lua_State* L, int index) {
+ if (lua_isnoneornil(L, index)) return LUA_NOREF;
+ luaL_checktype(L, index, LUA_TFUNCTION);
+ lua_pushvalue(L, index);
+ return luaL_ref(L, LUA_REGISTRYINDEX);
+}
+
+// Store a lua callback in a luv_req for the continuation.
+// The uv_req_t is assumed to be at the top of the stack
+static luv_req_t* luv_setup_req(lua_State* L, int callback_ref) {
+ luv_req_t* data;
+
+ luaL_checktype(L, -1, LUA_TUSERDATA);
+
+ data = malloc(sizeof(*data));
+ if (!data) luaL_error(L, "Problem allocating luv request");
+
+ luaL_getmetatable(L, "uv_req");
+ lua_setmetatable(L, -2);
+
+ lua_pushvalue(L, -1);
+ data->req_ref = luaL_ref(L, LUA_REGISTRYINDEX);
+ data->callback_ref = callback_ref;
+ data->data_ref = LUA_NOREF;
+ data->data = NULL;
+
+ return data;
+}
+
+
+static void luv_fulfill_req(lua_State* L, luv_req_t* data, int nargs) {
+ if (data->callback_ref == LUA_NOREF) {
+ lua_pop(L, nargs);
+ }
+ else {
+ // Get the callback
+ lua_rawgeti(L, LUA_REGISTRYINDEX, data->callback_ref);
+ // And insert it before the args if there are any.
+ if (nargs) {
+ lua_insert(L, -1 - nargs);
+ }
+ lua_call(L, nargs, 0);
+ }
+}
+
+static void luv_cleanup_req(lua_State* L, luv_req_t* data) {
+ luaL_unref(L, LUA_REGISTRYINDEX, data->req_ref);
+ luaL_unref(L, LUA_REGISTRYINDEX, data->callback_ref);
+ luaL_unref(L, LUA_REGISTRYINDEX, data->data_ref);
+ free(data->data);
+ free(data);
+}
diff --git a/3rdparty/luv/src/lreq.h b/3rdparty/luv/src/lreq.h
new file mode 100644
index 00000000000..a8b147e057b
--- /dev/null
+++ b/3rdparty/luv/src/lreq.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef LUV_LREQ_H
+#define LUV_LREQ_H
+
+#include "luv.h"
+
+typedef struct {
+ int req_ref; /* ref for uv_req_t's userdata */
+ int callback_ref; /* ref for callback */
+ int data_ref; /* ref for write data */
+ void* data; /* extra data */
+} luv_req_t;
+
+/* Used in the top of a setup function to check the arg
+ and ref the callback to an integer.
+*/
+static int luv_check_continuation(lua_State* L, int index);
+
+/* setup a luv_req_t. The userdata is assumed to be at the
+ top of the stack.
+*/
+static luv_req_t* luv_setup_req(lua_State* L, int ref);
+
+static void luv_fulfill_req(lua_State* L, luv_req_t* data, int nargs);
+
+static void luv_cleanup_req(lua_State* L, luv_req_t* data);
+
+#endif
diff --git a/3rdparty/luv/src/lthreadpool.h b/3rdparty/luv/src/lthreadpool.h
new file mode 100644
index 00000000000..0994746bc52
--- /dev/null
+++ b/3rdparty/luv/src/lthreadpool.h
@@ -0,0 +1,48 @@
+/*
+* Copyright 2014 The Luvit Authors. All Rights Reserved.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+#ifndef LUV_LTHREADPOOL_H
+#define LUV_LTHREADPOOL_H
+
+#include "luv.h"
+
+#define LUV_THREAD_MAXNUM_ARG 9
+
+typedef struct {
+ /* only support LUA_TNIL, LUA_TBOOLEAN, LUA_TLIGHTUSERDATA, LUA_TNUMBER, LUA_TSTRING*/
+ int type;
+ union
+ {
+ lua_Number num;
+ int boolean;
+ void* userdata;
+ struct {
+ const char* base;
+ size_t len;
+ } str;
+ } val;
+} luv_val_t;
+
+typedef struct {
+ int argc;
+ luv_val_t argv[LUV_THREAD_MAXNUM_ARG];
+} luv_thread_arg_t;
+
+static int luv_thread_arg_set(lua_State* L, luv_thread_arg_t* args, int idx, int top, int flag);
+static int luv_thread_arg_push(lua_State* L, const luv_thread_arg_t* args);
+static void luv_thread_arg_clear(luv_thread_arg_t* args);
+
+#endif //LUV_LTHREADPOOL_H
diff --git a/3rdparty/luv/src/luv.c b/3rdparty/luv/src/luv.c
new file mode 100644
index 00000000000..7b552d68d53
--- /dev/null
+++ b/3rdparty/luv/src/luv.c
@@ -0,0 +1,519 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+#include "util.c"
+#include "lhandle.c"
+#include "lreq.c"
+#include "loop.c"
+#include "req.c"
+#include "handle.c"
+#include "timer.c"
+#include "prepare.c"
+#include "check.c"
+#include "idle.c"
+#include "async.c"
+#include "poll.c"
+#include "signal.c"
+#include "process.c"
+#include "stream.c"
+#include "tcp.c"
+#include "pipe.c"
+#include "tty.c"
+#include "udp.c"
+#include "fs_event.c"
+#include "fs_poll.c"
+#include "fs.c"
+#include "dns.c"
+#include "thread.c"
+#include "work.c"
+#include "misc.c"
+#include "constants.c"
+
+static const luaL_Reg luv_functions[] = {
+ // loop.c
+ {"loop_close", luv_loop_close},
+ {"run", luv_run},
+ {"loop_alive", luv_loop_alive},
+ {"stop", luv_stop},
+ {"backend_fd", luv_backend_fd},
+ {"backend_timeout", luv_backend_timeout},
+ {"now", luv_now},
+ {"update_time", luv_update_time},
+ {"walk", luv_walk},
+
+ // req.c
+ {"cancel", luv_cancel},
+
+ // handle.c
+ {"is_active", luv_is_active},
+ {"is_closing", luv_is_closing},
+ {"close", luv_close},
+ {"ref", luv_ref},
+ {"unref", luv_unref},
+ {"has_ref", luv_has_ref},
+ {"send_buffer_size", luv_send_buffer_size},
+ {"recv_buffer_size", luv_recv_buffer_size},
+ {"fileno", luv_fileno},
+
+ // timer.c
+ {"new_timer", luv_new_timer},
+ {"timer_start", luv_timer_start},
+ {"timer_stop", luv_timer_stop},
+ {"timer_again", luv_timer_again},
+ {"timer_set_repeat", luv_timer_set_repeat},
+ {"timer_get_repeat", luv_timer_get_repeat},
+
+ // prepare.c
+ {"new_prepare", luv_new_prepare},
+ {"prepare_start", luv_prepare_start},
+ {"prepare_stop", luv_prepare_stop},
+
+ // check.c
+ {"new_check", luv_new_check},
+ {"check_start", luv_check_start},
+ {"check_stop", luv_check_stop},
+
+ // idle.c
+ {"new_idle", luv_new_idle},
+ {"idle_start", luv_idle_start},
+ {"idle_stop", luv_idle_stop},
+
+ // async.c
+ {"new_async", luv_new_async},
+ {"async_send", luv_async_send},
+
+ // poll.c
+ {"new_poll", luv_new_poll},
+ {"new_socket_poll", luv_new_socket_poll},
+ {"poll_start", luv_poll_start},
+ {"poll_stop", luv_poll_stop},
+
+ // signal.c
+ {"new_signal", luv_new_signal},
+ {"signal_start", luv_signal_start},
+ {"signal_stop", luv_signal_stop},
+
+ // process.c
+ {"disable_stdio_inheritance", luv_disable_stdio_inheritance},
+ {"spawn", luv_spawn},
+ {"process_kill", luv_process_kill},
+ {"kill", luv_kill},
+
+ // stream.c
+ {"shutdown", luv_shutdown},
+ {"listen", luv_listen},
+ {"accept", luv_accept},
+ {"read_start", luv_read_start},
+ {"read_stop", luv_read_stop},
+ {"write", luv_write},
+ {"write2", luv_write2},
+ {"try_write", luv_try_write},
+ {"is_readable", luv_is_readable},
+ {"is_writable", luv_is_writable},
+ {"stream_set_blocking", luv_stream_set_blocking},
+
+ // tcp.c
+ {"new_tcp", luv_new_tcp},
+ {"tcp_open", luv_tcp_open},
+ {"tcp_nodelay", luv_tcp_nodelay},
+ {"tcp_keepalive", luv_tcp_keepalive},
+ {"tcp_simultaneous_accepts", luv_tcp_simultaneous_accepts},
+ {"tcp_bind", luv_tcp_bind},
+ {"tcp_getpeername", luv_tcp_getpeername},
+ {"tcp_getsockname", luv_tcp_getsockname},
+ {"tcp_connect", luv_tcp_connect},
+ {"tcp_write_queue_size", luv_write_queue_size},
+
+ // pipe.c
+ {"new_pipe", luv_new_pipe},
+ {"pipe_open", luv_pipe_open},
+ {"pipe_bind", luv_pipe_bind},
+ {"pipe_connect", luv_pipe_connect},
+ {"pipe_getsockname", luv_pipe_getsockname},
+ {"pipe_getpeername", luv_pipe_getpeername},
+ {"pipe_pending_instances", luv_pipe_pending_instances},
+ {"pipe_pending_count", luv_pipe_pending_count},
+ {"pipe_pending_type", luv_pipe_pending_type},
+
+ // tty.c
+ {"new_tty", luv_new_tty},
+ {"tty_set_mode", luv_tty_set_mode},
+ {"tty_reset_mode", luv_tty_reset_mode},
+ {"tty_get_winsize", luv_tty_get_winsize},
+
+ // udp.c
+ {"new_udp", luv_new_udp},
+ {"udp_open", luv_udp_open},
+ {"udp_bind", luv_udp_bind},
+ {"udp_getsockname", luv_udp_getsockname},
+ {"udp_set_membership", luv_udp_set_membership},
+ {"udp_set_multicast_loop", luv_udp_set_multicast_loop},
+ {"udp_set_multicast_ttl", luv_udp_set_multicast_ttl},
+ {"udp_set_multicast_interface", luv_udp_set_multicast_interface},
+ {"udp_set_broadcast", luv_udp_set_broadcast},
+ {"udp_set_ttl", luv_udp_set_ttl},
+ {"udp_send", luv_udp_send},
+ {"udp_try_send", luv_udp_try_send},
+ {"udp_recv_start", luv_udp_recv_start},
+ {"udp_recv_stop", luv_udp_recv_stop},
+
+ // fs_event.c
+ {"new_fs_event", luv_new_fs_event},
+ {"fs_event_start", luv_fs_event_start},
+ {"fs_event_stop", luv_fs_event_stop},
+ {"fs_event_getpath", luv_fs_event_getpath},
+
+ // fs_poll.c
+ {"new_fs_poll", luv_new_fs_poll},
+ {"fs_poll_start", luv_fs_poll_start},
+ {"fs_poll_stop", luv_fs_poll_stop},
+ {"fs_poll_getpath", luv_fs_poll_getpath},
+
+ // fs.c
+ {"fs_close", luv_fs_close},
+ {"fs_open", luv_fs_open},
+ {"fs_read", luv_fs_read},
+ {"fs_unlink", luv_fs_unlink},
+ {"fs_write", luv_fs_write},
+ {"fs_mkdir", luv_fs_mkdir},
+ {"fs_mkdtemp", luv_fs_mkdtemp},
+ {"fs_rmdir", luv_fs_rmdir},
+ {"fs_scandir", luv_fs_scandir},
+ {"fs_scandir_next", luv_fs_scandir_next},
+ {"fs_stat", luv_fs_stat},
+ {"fs_fstat", luv_fs_fstat},
+ {"fs_lstat", luv_fs_lstat},
+ {"fs_rename", luv_fs_rename},
+ {"fs_fsync", luv_fs_fsync},
+ {"fs_fdatasync", luv_fs_fdatasync},
+ {"fs_ftruncate", luv_fs_ftruncate},
+ {"fs_sendfile", luv_fs_sendfile},
+ {"fs_access", luv_fs_access},
+ {"fs_chmod", luv_fs_chmod},
+ {"fs_fchmod", luv_fs_fchmod},
+ {"fs_utime", luv_fs_utime},
+ {"fs_futime", luv_fs_futime},
+ {"fs_link", luv_fs_link},
+ {"fs_symlink", luv_fs_symlink},
+ {"fs_readlink", luv_fs_readlink},
+ {"fs_realpath", luv_fs_realpath},
+ {"fs_chown", luv_fs_chown},
+ {"fs_fchown", luv_fs_fchown},
+
+ // dns.c
+ {"getaddrinfo", luv_getaddrinfo},
+ {"getnameinfo", luv_getnameinfo},
+
+ // misc.c
+ {"chdir", luv_chdir},
+ {"os_homedir", luv_os_homedir},
+ {"cpu_info", luv_cpu_info},
+ {"cwd", luv_cwd},
+ {"exepath", luv_exepath},
+ {"get_process_title", luv_get_process_title},
+ {"get_total_memory", luv_get_total_memory},
+ {"get_free_memory", luv_get_free_memory},
+ {"getpid", luv_getpid},
+#ifndef _WIN32
+ {"getuid", luv_getuid},
+ {"setuid", luv_setuid},
+ {"getgid", luv_getgid},
+ {"setgid", luv_setgid},
+#endif
+ {"getrusage", luv_getrusage},
+ {"guess_handle", luv_guess_handle},
+ {"hrtime", luv_hrtime},
+ {"interface_addresses", luv_interface_addresses},
+ {"loadavg", luv_loadavg},
+ {"resident_set_memory", luv_resident_set_memory},
+ {"set_process_title", luv_set_process_title},
+ {"uptime", luv_uptime},
+ {"version", luv_version},
+ {"version_string", luv_version_string},
+
+ // thread.c
+ {"new_thread", luv_new_thread},
+ {"thread_equal", luv_thread_equal},
+ {"thread_self", luv_thread_self},
+ {"thread_join", luv_thread_join},
+ {"sleep", luv_thread_sleep},
+
+ // work.c
+ {"new_work", luv_new_work},
+ {"queue_work", luv_queue_work},
+
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_handle_methods[] = {
+ // handle.c
+ {"is_active", luv_is_active},
+ {"is_closing", luv_is_closing},
+ {"close", luv_close},
+ {"ref", luv_ref},
+ {"unref", luv_unref},
+ {"has_ref", luv_has_ref},
+ {"send_buffer_size", luv_send_buffer_size},
+ {"recv_buffer_size", luv_recv_buffer_size},
+ {"fileno", luv_fileno},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_async_methods[] = {
+ {"send", luv_async_send},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_check_methods[] = {
+ {"start", luv_check_start},
+ {"stop", luv_check_stop},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_fs_event_methods[] = {
+ {"start", luv_fs_event_start},
+ {"stop", luv_fs_event_stop},
+ {"getpath", luv_fs_event_getpath},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_fs_poll_methods[] = {
+ {"start", luv_fs_poll_start},
+ {"stop", luv_fs_poll_stop},
+ {"getpath", luv_fs_poll_getpath},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_idle_methods[] = {
+ {"start", luv_idle_start},
+ {"stop", luv_idle_stop},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_stream_methods[] = {
+ {"shutdown", luv_shutdown},
+ {"listen", luv_listen},
+ {"accept", luv_accept},
+ {"read_start", luv_read_start},
+ {"read_stop", luv_read_stop},
+ {"write", luv_write},
+ {"write2", luv_write2},
+ {"try_write", luv_try_write},
+ {"is_readable", luv_is_readable},
+ {"is_writable", luv_is_writable},
+ {"set_blocking", luv_stream_set_blocking},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_pipe_methods[] = {
+ {"open", luv_pipe_open},
+ {"bind", luv_pipe_bind},
+ {"connect", luv_pipe_connect},
+ {"getsockname", luv_pipe_getsockname},
+ {"getpeername", luv_pipe_getpeername},
+ {"pending_instances", luv_pipe_pending_instances},
+ {"pending_count", luv_pipe_pending_count},
+ {"pending_type", luv_pipe_pending_type},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_poll_methods[] = {
+ {"start", luv_poll_start},
+ {"stop", luv_poll_stop},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_prepare_methods[] = {
+ {"start", luv_prepare_start},
+ {"stop", luv_prepare_stop},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_process_methods[] = {
+ {"kill", luv_process_kill},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_tcp_methods[] = {
+ {"open", luv_tcp_open},
+ {"nodelay", luv_tcp_nodelay},
+ {"keepalive", luv_tcp_keepalive},
+ {"simultaneous_accepts", luv_tcp_simultaneous_accepts},
+ {"bind", luv_tcp_bind},
+ {"getpeername", luv_tcp_getpeername},
+ {"getsockname", luv_tcp_getsockname},
+ {"connect", luv_tcp_connect},
+ {"write_queue_size", luv_write_queue_size},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_timer_methods[] = {
+ {"start", luv_timer_start},
+ {"stop", luv_timer_stop},
+ {"again", luv_timer_again},
+ {"set_repeat", luv_timer_set_repeat},
+ {"get_repeat", luv_timer_get_repeat},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_tty_methods[] = {
+ {"set_mode", luv_tty_set_mode},
+ {"get_winsize", luv_tty_get_winsize},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_udp_methods[] = {
+ {"open", luv_udp_open},
+ {"bind", luv_udp_bind},
+ {"bindgetsockname", luv_udp_getsockname},
+ {"set_membership", luv_udp_set_membership},
+ {"set_multicast_loop", luv_udp_set_multicast_loop},
+ {"set_multicast_ttl", luv_udp_set_multicast_ttl},
+ {"set_multicast_interface", luv_udp_set_multicast_interface},
+ {"set_broadcast", luv_udp_set_broadcast},
+ {"set_ttl", luv_udp_set_ttl},
+ {"send", luv_udp_send},
+ {"try_send", luv_udp_try_send},
+ {"recv_start", luv_udp_recv_start},
+ {"recv_stop", luv_udp_recv_stop},
+ {NULL, NULL}
+};
+
+static const luaL_Reg luv_signal_methods[] = {
+ {"start", luv_signal_start},
+ {"stop", luv_signal_stop},
+ {NULL, NULL}
+};
+
+static void luv_handle_init(lua_State* L) {
+
+ lua_newtable(L);
+#define XX(uc, lc) \
+ luaL_newmetatable (L, "uv_"#lc); \
+ lua_pushcfunction(L, luv_handle_tostring); \
+ lua_setfield(L, -2, "__tostring"); \
+ lua_pushcfunction(L, luv_handle_gc); \
+ lua_setfield(L, -2, "__gc"); \
+ luaL_newlib(L, luv_##lc##_methods); \
+ luaL_setfuncs(L, luv_handle_methods, 0); \
+ lua_setfield(L, -2, "__index"); \
+ lua_pushboolean(L, 1); \
+ lua_rawset(L, -3);
+
+ UV_HANDLE_TYPE_MAP(XX)
+#undef XX
+ lua_setfield(L, LUA_REGISTRYINDEX, "uv_handle");
+
+ lua_newtable(L);
+
+ luaL_getmetatable(L, "uv_pipe");
+ lua_getfield(L, -1, "__index");
+ luaL_setfuncs(L, luv_stream_methods, 0);
+ lua_pop(L, 1);
+ lua_pushboolean(L, 1);
+ lua_rawset(L, -3);
+
+ luaL_getmetatable(L, "uv_tcp");
+ lua_getfield(L, -1, "__index");
+ luaL_setfuncs(L, luv_stream_methods, 0);
+ lua_pop(L, 1);
+ lua_pushboolean(L, 1);
+ lua_rawset(L, -3);
+
+ luaL_getmetatable(L, "uv_tty");
+ lua_getfield(L, -1, "__index");
+ luaL_setfuncs(L, luv_stream_methods, 0);
+ lua_pop(L, 1);
+ lua_pushboolean(L, 1);
+ lua_rawset(L, -3);
+
+ lua_setfield(L, LUA_REGISTRYINDEX, "uv_stream");
+}
+
+LUALIB_API lua_State* luv_state(uv_loop_t* loop) {
+ return loop->data;
+}
+
+// TODO: find out if storing this somehow in an upvalue is faster
+LUALIB_API uv_loop_t* luv_loop(lua_State* L) {
+ uv_loop_t* loop;
+ lua_pushstring(L, "uv_loop");
+ lua_rawget(L, LUA_REGISTRYINDEX);
+ loop = lua_touserdata(L, -1);
+ lua_pop(L, 1);
+ return loop;
+}
+
+static void walk_cb(uv_handle_t *handle, void *arg)
+{
+ (void)arg;
+ if (!uv_is_closing(handle)) {
+ uv_close(handle, luv_close_cb);
+ }
+}
+
+static int loop_gc(lua_State *L) {
+ uv_loop_t* loop = luv_loop(L);
+ // Call uv_close on every active handle
+ uv_walk(loop, walk_cb, NULL);
+ // Run the event loop until all handles are successfully closed
+ while (uv_loop_close(loop)) {
+ uv_run(loop, UV_RUN_DEFAULT);
+ }
+ return 0;
+}
+
+LUALIB_API int luaopen_luv (lua_State *L) {
+
+ uv_loop_t* loop;
+ int ret;
+
+ // Setup the uv_loop meta table for a proper __gc
+ luaL_newmetatable(L, "uv_loop.meta");
+ lua_pushstring(L, "__gc");
+ lua_pushcfunction(L, loop_gc);
+ lua_settable(L, -3);
+
+ loop = lua_newuserdata(L, sizeof(*loop));
+ ret = uv_loop_init(loop);
+ if (ret < 0) {
+ return luaL_error(L, "%s: %s\n", uv_err_name(ret), uv_strerror(ret));
+ }
+ // setup the metatable for __gc
+ luaL_getmetatable(L, "uv_loop.meta");
+ lua_setmetatable(L, -2);
+ // Tell the state how to find the loop.
+ lua_pushstring(L, "uv_loop");
+ lua_insert(L, -2);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+ lua_pop(L, 1);
+
+ // Tell the loop how to find the state.
+ loop->data = L;
+
+ luv_req_init(L);
+ luv_handle_init(L);
+ luv_thread_init(L);
+ luv_work_init(L);
+
+ luaL_newlib(L, luv_functions);
+ luv_constants(L);
+ lua_setfield(L, -2, "constants");
+
+ return 1;
+}
diff --git a/3rdparty/luv/src/luv.h b/3rdparty/luv/src/luv.h
new file mode 100644
index 00000000000..681384da363
--- /dev/null
+++ b/3rdparty/luv/src/luv.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef LUV_H
+#define LUV_H
+#include <lua.h>
+#include <lualib.h>
+#include <lauxlib.h>
+#include "uv.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#if defined(_WIN32)
+# include <fcntl.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# ifndef __MINGW32__
+# define S_ISREG(x) (((x) & _S_IFMT) == _S_IFREG)
+# define S_ISDIR(x) (((x) & _S_IFMT) == _S_IFDIR)
+# define S_ISFIFO(x) (((x) & _S_IFMT) == _S_IFIFO)
+# define S_ISCHR(x) (((x) & _S_IFMT) == _S_IFCHR)
+# define S_ISBLK(x) 0
+# endif
+# define S_ISLNK(x) (((x) & S_IFLNK) == S_IFLNK)
+# define S_ISSOCK(x) 0
+#else
+# include <unistd.h>
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX (8096)
+#endif
+
+#ifndef MAX_TITLE_LENGTH
+#define MAX_TITLE_LENGTH (8192)
+#endif
+
+#if LUA_VERSION_NUM < 502
+# define lua_rawlen lua_objlen
+/* lua_...uservalue: Something very different, but it should get the job done */
+# define lua_getuservalue lua_getfenv
+# define lua_setuservalue lua_setfenv
+# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
+# define luaL_setfuncs(L,l,n) (assert(n==0), luaL_register(L,NULL,l))
+# define lua_resume(L,F,n) lua_resume(L,n)
+# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
+#endif
+
+/* There is a 1-1 relation between a lua_State and a uv_loop_t
+ These helpers will give you one if you have the other
+ These are exposed for extensions built with luv
+ This allows luv to be used in multithreaded applications.
+*/
+LUALIB_API lua_State* luv_state(uv_loop_t* loop);
+/* All libuv callbacks will lua_call directly from this root-per-thread state
+*/
+LUALIB_API uv_loop_t* luv_loop(lua_State* L);
+
+/* This is the main hook to load the library.
+ This can be called multiple times in a process as long
+ as you use a different lua_State and thread for each.
+*/
+LUALIB_API int luaopen_luv (lua_State *L);
+
+#include "util.h"
+#include "lhandle.h"
+#include "lreq.h"
+
+/* From stream.c */
+static uv_stream_t* luv_check_stream(lua_State* L, int index);
+static void luv_alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf);
+static void luv_check_buf(lua_State *L, int idx, uv_buf_t *pbuf);
+static uv_buf_t* luv_prep_bufs(lua_State* L, int index, size_t *count);
+
+/* from tcp.c */
+static void parse_sockaddr(lua_State* L, struct sockaddr_storage* address, int addrlen);
+static void luv_connect_cb(uv_connect_t* req, int status);
+
+/* From fs.c */
+static void luv_push_stats_table(lua_State* L, const uv_stat_t* s);
+
+/* from constants.c */
+static int luv_af_string_to_num(const char* string);
+static const char* luv_af_num_to_string(const int num);
+static int luv_sock_string_to_num(const char* string);
+static const char* luv_sock_num_to_string(const int num);
+static int luv_sig_string_to_num(const char* string);
+static const char* luv_sig_num_to_string(const int num);
+
+typedef lua_State* (*luv_acquire_vm)();
+typedef void (*luv_release_vm)(lua_State* L);
+LUALIB_API void luv_set_thread_cb(luv_acquire_vm acquire, luv_release_vm release);
+
+#endif
diff --git a/3rdparty/luv/src/misc.c b/3rdparty/luv/src/misc.c
new file mode 100644
index 00000000000..64c9e3d5822
--- /dev/null
+++ b/3rdparty/luv/src/misc.c
@@ -0,0 +1,316 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "luv.h"
+#ifdef _WIN32
+#include <process.h>
+#endif
+
+static int luv_guess_handle(lua_State* L) {
+ uv_file file = luaL_checkinteger(L, 1);
+ switch (uv_guess_handle(file)) {
+#define XX(uc, lc) case UV_##uc: lua_pushstring(L, #lc); break;
+ UV_HANDLE_TYPE_MAP(XX)
+#undef XX
+ case UV_FILE: lua_pushstring(L, "file"); break;
+ default: return 0;
+ }
+ return 1;
+}
+
+static int luv_version(lua_State* L) {
+ lua_pushinteger(L, uv_version());
+ return 1;
+}
+
+static int luv_version_string(lua_State* L) {
+ lua_pushstring(L, uv_version_string());
+ return 1;
+}
+
+static int luv_get_process_title(lua_State* L) {
+ char title[MAX_TITLE_LENGTH];
+ int ret = uv_get_process_title(title, MAX_TITLE_LENGTH);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushstring(L, title);
+ return 1;
+}
+
+static int luv_set_process_title(lua_State* L) {
+ const char* title = luaL_checkstring(L, 1);
+ int ret = uv_set_process_title(title);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_resident_set_memory(lua_State* L) {
+ size_t rss;
+ int ret = uv_resident_set_memory(&rss);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, rss);
+ return 1;
+}
+
+static int luv_uptime(lua_State* L) {
+ double uptime;
+ int ret = uv_uptime(&uptime);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushnumber(L, uptime);
+ return 1;
+}
+
+static void luv_push_timeval_table(lua_State* L, const uv_timeval_t* t) {
+ lua_createtable(L, 0, 2);
+ lua_pushinteger(L, t->tv_sec);
+ lua_setfield(L, -2, "sec");
+ lua_pushinteger(L, t->tv_usec);
+ lua_setfield(L, -2, "usec");
+}
+
+static int luv_getrusage(lua_State* L) {
+ uv_rusage_t rusage;
+ int ret = uv_getrusage(&rusage);
+ if (ret < 0) return luv_error(L, ret);
+ lua_createtable(L, 0, 16);
+ // user CPU time used
+ luv_push_timeval_table(L, &rusage.ru_utime);
+ lua_setfield(L, -2, "utime");
+ // system CPU time used
+ luv_push_timeval_table(L, &rusage.ru_stime);
+ lua_setfield(L, -2, "stime");
+ // maximum resident set size
+ lua_pushinteger(L, rusage.ru_maxrss);
+ lua_setfield(L, -2, "maxrss");
+ // integral shared memory size
+ lua_pushinteger(L, rusage.ru_ixrss);
+ lua_setfield(L, -2, "ixrss");
+ // integral unshared data size
+ lua_pushinteger(L, rusage.ru_idrss);
+ lua_setfield(L, -2, "idrss");
+ // integral unshared stack size
+ lua_pushinteger(L, rusage.ru_isrss);
+ lua_setfield(L, -2, "isrss");
+ // page reclaims (soft page faults)
+ lua_pushinteger(L, rusage.ru_minflt);
+ lua_setfield(L, -2, "minflt");
+ // page faults (hard page faults)
+ lua_pushinteger(L, rusage.ru_majflt);
+ lua_setfield(L, -2, "majflt");
+ // swaps
+ lua_pushinteger(L, rusage.ru_nswap);
+ lua_setfield(L, -2, "nswap");
+ // block input operations
+ lua_pushinteger(L, rusage.ru_inblock);
+ lua_setfield(L, -2, "inblock");
+ // block output operations
+ lua_pushinteger(L, rusage.ru_oublock);
+ lua_setfield(L, -2, "oublock");
+ // IPC messages sent
+ lua_pushinteger(L, rusage.ru_msgsnd);
+ lua_setfield(L, -2, "msgsnd");
+ // IPC messages received
+ lua_pushinteger(L, rusage.ru_msgrcv);
+ lua_setfield(L, -2, "msgrcv");
+ // signals received
+ lua_pushinteger(L, rusage.ru_nsignals);
+ lua_setfield(L, -2, "nsignals");
+ // voluntary context switches
+ lua_pushinteger(L, rusage.ru_nvcsw);
+ lua_setfield(L, -2, "nvcsw");
+ // involuntary context switches
+ lua_pushinteger(L, rusage.ru_nivcsw);
+ lua_setfield(L, -2, "nivcsw");
+ return 1;
+}
+
+static int luv_cpu_info(lua_State* L) {
+ uv_cpu_info_t* cpu_infos;
+ int count, i;
+ int ret = uv_cpu_info(&cpu_infos, &count);
+ if (ret < 0) return luv_error(L, ret);
+ lua_newtable(L);
+
+ for (i = 0; i < count; i++) {
+ lua_newtable(L);
+ lua_pushstring(L, cpu_infos[i].model);
+ lua_setfield(L, -2, "model");
+ lua_pushnumber(L, cpu_infos[i].speed);
+ lua_setfield(L, -2, "speed");
+ lua_newtable(L);
+ lua_pushnumber(L, cpu_infos[i].cpu_times.user);
+ lua_setfield(L, -2, "user");
+ lua_pushnumber(L, cpu_infos[i].cpu_times.nice);
+ lua_setfield(L, -2, "nice");
+ lua_pushnumber(L, cpu_infos[i].cpu_times.sys);
+ lua_setfield(L, -2, "sys");
+ lua_pushnumber(L, cpu_infos[i].cpu_times.idle);
+ lua_setfield(L, -2, "idle");
+ lua_pushnumber(L, cpu_infos[i].cpu_times.irq);
+ lua_setfield(L, -2, "irq");
+ lua_setfield(L, -2, "times");
+ lua_rawseti(L, -2, i + 1);
+ }
+
+ uv_free_cpu_info(cpu_infos, count);
+ return 1;
+}
+
+static int luv_interface_addresses(lua_State* L) {
+ uv_interface_address_t* interfaces;
+ int count, i;
+ char ip[INET6_ADDRSTRLEN];
+ char netmask[INET6_ADDRSTRLEN];
+
+ uv_interface_addresses(&interfaces, &count);
+
+ lua_newtable(L);
+
+ for (i = 0; i < count; i++) {
+ lua_getfield(L, -1, interfaces[i].name);
+ if (!lua_istable(L, -1)) {
+ lua_pop(L, 1);
+ lua_newtable(L);
+ lua_pushvalue(L, -1);
+ lua_setfield(L, -3, interfaces[i].name);
+ }
+ lua_newtable(L);
+ lua_pushboolean(L, interfaces[i].is_internal);
+ lua_setfield(L, -2, "internal");
+
+ lua_pushlstring(L, interfaces[i].phys_addr, sizeof(interfaces[i].phys_addr));
+ lua_setfield(L, -2, "mac");
+
+ if (interfaces[i].address.address4.sin_family == AF_INET) {
+ uv_ip4_name(&interfaces[i].address.address4, ip, sizeof(ip));
+ uv_ip4_name(&interfaces[i].netmask.netmask4, netmask, sizeof(netmask));
+ } else if (interfaces[i].address.address4.sin_family == AF_INET6) {
+ uv_ip6_name(&interfaces[i].address.address6, ip, sizeof(ip));
+ uv_ip6_name(&interfaces[i].netmask.netmask6, netmask, sizeof(netmask));
+ } else {
+ strncpy(ip, "<unknown sa family>", INET6_ADDRSTRLEN);
+ strncpy(netmask, "<unknown sa family>", INET6_ADDRSTRLEN);
+ }
+ lua_pushstring(L, ip);
+ lua_setfield(L, -2, "ip");
+ lua_pushstring(L, netmask);
+ lua_setfield(L, -2, "netmask");
+
+ lua_pushstring(L, luv_af_num_to_string(interfaces[i].address.address4.sin_family));
+ lua_setfield(L, -2, "family");
+ lua_rawseti(L, -2, lua_rawlen (L, -2) + 1);
+ lua_pop(L, 1);
+ }
+ uv_free_interface_addresses(interfaces, count);
+ return 1;
+}
+
+static int luv_loadavg(lua_State* L) {
+ double avg[3];
+ uv_loadavg(avg);
+ lua_pushnumber(L, avg[0]);
+ lua_pushnumber(L, avg[1]);
+ lua_pushnumber(L, avg[2]);
+ return 3;
+}
+
+static int luv_exepath(lua_State* L) {
+ size_t size = 2*PATH_MAX;
+ char exe_path[2*PATH_MAX];
+ int ret = uv_exepath(exe_path, &size);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, exe_path, size);
+ return 1;
+}
+
+static int luv_cwd(lua_State* L) {
+ size_t size = 2*PATH_MAX;
+ char path[2*PATH_MAX];
+ int ret = uv_cwd(path, &size);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, path, size);
+ return 1;
+}
+
+static int luv_chdir(lua_State* L) {
+ int ret = uv_chdir(luaL_checkstring(L, 1));
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_os_homedir(lua_State* L) {
+ size_t size = 2*PATH_MAX;
+ char homedir[2*PATH_MAX];
+ int ret = uv_os_homedir(homedir, &size);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, homedir, size);
+ return 1;
+}
+
+static int luv_get_total_memory(lua_State* L) {
+ lua_pushnumber(L, uv_get_total_memory());
+ return 1;
+}
+
+static int luv_get_free_memory(lua_State* L) {
+ lua_pushnumber(L, uv_get_free_memory());
+ return 1;
+}
+
+static int luv_hrtime(lua_State* L) {
+ lua_pushnumber(L, uv_hrtime());
+ return 1;
+}
+
+static int luv_getpid(lua_State* L){
+ int pid = getpid();
+ lua_pushinteger(L, pid);
+ return 1;
+}
+
+#ifndef _WIN32
+static int luv_getuid(lua_State* L){
+ int uid = getuid();
+ lua_pushinteger(L, uid);
+ return 1;
+}
+
+static int luv_getgid(lua_State* L){
+ int gid = getgid();
+ lua_pushinteger(L, gid);
+ return 1;
+}
+
+static int luv_setuid(lua_State* L){
+ int uid = luaL_checkinteger(L, 1);
+ int r = setuid(uid);
+ if (-1 == r) {
+ luaL_error(L, "Error setting UID");
+ }
+ return 0;
+}
+
+static int luv_setgid(lua_State* L){
+ int gid = luaL_checkinteger(L, 1);
+ int r = setgid(gid);
+ if (-1 == r) {
+ luaL_error(L, "Error setting GID");
+ }
+ return 0;
+}
+#endif
diff --git a/3rdparty/luv/src/pipe.c b/3rdparty/luv/src/pipe.c
new file mode 100644
index 00000000000..b490c1597b3
--- /dev/null
+++ b/3rdparty/luv/src/pipe.c
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_pipe_t* luv_check_pipe(lua_State* L, int index) {
+ uv_pipe_t* handle = luv_checkudata(L, index, "uv_pipe");
+ luaL_argcheck(L, handle->type == UV_NAMED_PIPE && handle->data, index, "Expected uv_pipe_t");
+ return handle;
+}
+
+static int luv_new_pipe(lua_State* L) {
+ uv_pipe_t* handle;
+ int ipc, ret;
+ luaL_checktype(L, 1, LUA_TBOOLEAN);
+ ipc = lua_toboolean(L, 1);
+ handle = luv_newuserdata(L, sizeof(*handle));
+ ret = uv_pipe_init(luv_loop(L), handle, ipc);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static int luv_pipe_open(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ uv_file file = luaL_checkinteger(L, 2);
+ int ret = uv_pipe_open(handle, file);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_pipe_bind(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ const char* name = luaL_checkstring(L, 2);
+ int ret = uv_pipe_bind(handle, name);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_pipe_connect(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ const char* name = luaL_checkstring(L, 2);
+ int ref = luv_check_continuation(L, 3);
+ uv_connect_t* req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ uv_pipe_connect(req, handle, name, luv_connect_cb);
+ return 1;
+}
+
+static int luv_pipe_getsockname(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ size_t len = 2*PATH_MAX;
+ char buf[2*PATH_MAX];
+ int ret = uv_pipe_getsockname(handle, buf, &len);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, buf, len);
+ return 1;
+}
+
+static int luv_pipe_getpeername(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ size_t len = 2*PATH_MAX;
+ char buf[2*PATH_MAX];
+ int ret = uv_pipe_getpeername(handle, buf, &len);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushlstring(L, buf, len);
+ return 1;
+}
+
+static int luv_pipe_pending_instances(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ int count = luaL_checkinteger(L, 2);
+ uv_pipe_pending_instances(handle, count);
+ return 0;
+}
+
+static int luv_pipe_pending_count(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ lua_pushinteger(L, uv_pipe_pending_count(handle));
+ return 1;
+}
+
+static int luv_pipe_pending_type(lua_State* L) {
+ uv_pipe_t* handle = luv_check_pipe(L, 1);
+ uv_handle_type type = uv_pipe_pending_type(handle);
+ const char* type_name;
+ switch (type) {
+#define XX(uc, lc) \
+ case UV_##uc: type_name = #lc; break;
+ UV_HANDLE_TYPE_MAP(XX)
+#undef XX
+ default: return 0;
+ }
+ lua_pushstring(L, type_name);
+ return 1;
+}
diff --git a/3rdparty/luv/src/poll.c b/3rdparty/luv/src/poll.c
new file mode 100644
index 00000000000..e007c9f9634
--- /dev/null
+++ b/3rdparty/luv/src/poll.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_poll_t* luv_check_poll(lua_State* L, int index) {
+ uv_poll_t* handle = luv_checkudata(L, index, "uv_poll");
+ luaL_argcheck(L, handle->type == UV_POLL && handle->data, index, "Expected uv_poll_t");
+ return handle;
+}
+
+static int luv_new_poll(lua_State* L) {
+ int fd = luaL_checkinteger(L, 1);
+ uv_poll_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_poll_init(luv_loop(L), handle, fd);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static int luv_new_socket_poll(lua_State* L) {
+ int fd = luaL_checkinteger(L, 1);
+ uv_poll_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_poll_init_socket(luv_loop(L), handle, fd);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+// These are the same order as uv_run_mode which also starts at 0
+static const char *const luv_pollevents[] = {
+ "r", "w", "rw", NULL
+};
+
+static void luv_poll_cb(uv_poll_t* handle, int status, int events) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ const char* evtstr;
+
+ if (status < 0) {
+ fprintf(stderr, "%s: %s\n", uv_err_name(status), uv_strerror(status));
+ lua_pushstring(L, uv_err_name(status));
+ }
+ else {
+ lua_pushnil(L);
+ }
+
+ switch (events) {
+ case UV_READABLE: evtstr = "r"; break;
+ case UV_WRITABLE: evtstr = "w"; break;
+ case UV_READABLE|UV_WRITABLE: evtstr = "rw"; break;
+ default: evtstr = ""; break;
+ }
+ lua_pushstring(L, evtstr);
+
+ luv_call_callback(L, data, LUV_POLL, 2);
+}
+
+static int luv_poll_start(lua_State* L) {
+ uv_poll_t* handle = luv_check_poll(L, 1);
+ int events, ret;
+ switch (luaL_checkoption(L, 2, "rw", luv_pollevents)) {
+ case 0: events = UV_READABLE; break;
+ case 1: events = UV_WRITABLE; break;
+ case 2: events = UV_READABLE | UV_WRITABLE; break;
+ default: events = 0; /* unreachable */
+ }
+ luv_check_callback(L, handle->data, LUV_POLL, 3);
+ ret = uv_poll_start(handle, events, luv_poll_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_poll_stop(lua_State* L) {
+ uv_poll_t* handle = luv_check_poll(L, 1);
+ int ret = uv_poll_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
diff --git a/3rdparty/luv/src/prepare.c b/3rdparty/luv/src/prepare.c
new file mode 100644
index 00000000000..6577439a466
--- /dev/null
+++ b/3rdparty/luv/src/prepare.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_prepare_t* luv_check_prepare(lua_State* L, int index) {
+ uv_prepare_t* handle = luv_checkudata(L, index, "uv_prepare");
+ luaL_argcheck(L, handle->type == UV_PREPARE && handle->data, index, "Expected uv_prepare_t");
+ return handle;
+}
+
+static int luv_new_prepare(lua_State* L) {
+ uv_prepare_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_prepare_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_prepare_cb(uv_prepare_t* handle) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ luv_call_callback(L, data, LUV_PREPARE, 0);
+}
+
+static int luv_prepare_start(lua_State* L) {
+ uv_prepare_t* handle = luv_check_prepare(L, 1);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_PREPARE, 2);
+ ret = uv_prepare_start(handle, luv_prepare_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_prepare_stop(lua_State* L) {
+ uv_prepare_t* handle = luv_check_prepare(L, 1);
+ int ret = uv_prepare_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
diff --git a/3rdparty/luv/src/process.c b/3rdparty/luv/src/process.c
new file mode 100644
index 00000000000..d939503868b
--- /dev/null
+++ b/3rdparty/luv/src/process.c
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static int luv_disable_stdio_inheritance(lua_State* L) {
+ (void)L;
+ uv_disable_stdio_inheritance();
+ return 0;
+}
+
+static uv_process_t* luv_check_process(lua_State* L, int index) {
+ uv_process_t* handle = luv_checkudata(L, index, "uv_process");
+ luaL_argcheck(L, handle->type == UV_PROCESS && handle->data, index, "Expected uv_process_t");
+ return handle;
+}
+
+static void exit_cb(uv_process_t* handle, int64_t exit_status, int term_signal) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ lua_pushinteger(L, exit_status);
+ lua_pushinteger(L, term_signal);
+ luv_call_callback(L, data, LUV_EXIT, 2);
+}
+
+static void luv_spawn_close_cb(uv_handle_t* handle) {
+ lua_State *L = luv_state(handle->loop);
+ luv_cleanup_handle(L, handle->data);
+}
+
+static void luv_clean_options(uv_process_options_t* options) {
+ free(options->args);
+ free(options->stdio);
+ free(options->env);
+}
+
+static int luv_spawn(lua_State* L) {
+ uv_process_t* handle;
+ uv_process_options_t options;
+ size_t i, len = 0;
+ int ret;
+
+ memset(&options, 0, sizeof(options));
+ options.exit_cb = exit_cb;
+ options.file = luaL_checkstring(L, 1);
+ options.flags = 0;
+
+ // Make sure the 2nd argument is a table
+ luaL_checktype(L, 2, LUA_TTABLE);
+
+ // get the args list
+ lua_getfield(L, 2, "args");
+ // +1 for inserted command at front
+ if (lua_type(L, -1) == LUA_TTABLE) {
+ len = 1 + lua_rawlen(L, -1);
+ }
+ else if (lua_type(L, -1) != LUA_TNIL) {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 3, "args option must be table");
+ }
+ else {
+ len = 1;
+ }
+ // +1 for null terminator at end
+ options.args = malloc((len + 1) * sizeof(*options.args));
+ if (!options.args) {
+ luv_clean_options(&options);
+ return luaL_error(L, "Problem allocating args");
+ }
+ options.args[0] = (char*)options.file;
+ for (i = 1; i < len; ++i) {
+ lua_rawgeti(L, -1, i);
+ options.args[i] = (char*)lua_tostring(L, -1);
+ lua_pop(L, 1);
+ }
+ options.args[len] = NULL;
+ lua_pop(L, 1);
+
+ // get the stdio list
+ lua_getfield(L, 2, "stdio");
+ if (lua_type(L, -1) == LUA_TTABLE) {
+ options.stdio_count = len = lua_rawlen(L, -1);
+ options.stdio = malloc(len * sizeof(*options.stdio));
+ if (!options.stdio) {
+ luv_clean_options(&options);
+ return luaL_error(L, "Problem allocating stdio");
+ }
+ for (i = 0; i < len; ++i) {
+ lua_rawgeti(L, -1, i + 1);
+ // integers are assumed to be file descripters
+ if (lua_type(L, -1) == LUA_TNUMBER) {
+ options.stdio[i].flags = UV_INHERIT_FD;
+ options.stdio[i].data.fd = lua_tointeger(L, -1);
+ }
+ // userdata is assumed to be a uv_stream_t instance
+ else if (lua_type(L, -1) == LUA_TUSERDATA) {
+ uv_os_fd_t fd;
+ uv_stream_t* stream = luv_check_stream(L, -1);
+ int err = uv_fileno((uv_handle_t*)stream, &fd);
+ if (err == UV_EINVAL || err == UV_EBADF) {
+ // stdin (fd 0) is read-only, stdout and stderr (fds 1 & 2) are
+ // write-only, and all fds > 2 are read-write
+ int flags = UV_CREATE_PIPE;
+ if (i == 0 || i > 2)
+ flags |= UV_READABLE_PIPE;
+ if (i != 0)
+ flags |= UV_WRITABLE_PIPE;
+ options.stdio[i].flags = flags;
+ }
+ else {
+ options.stdio[i].flags = UV_INHERIT_STREAM;
+ }
+ options.stdio[i].data.stream = stream;
+ }
+ else if (lua_type(L, -1) == LUA_TNIL) {
+ options.stdio[i].flags = UV_IGNORE;
+ }
+ else {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 2, "stdio table entries must be nil, uv_stream_t, or integer");
+ }
+ lua_pop(L, 1);
+ }
+ }
+ else if (lua_type(L, -1) != LUA_TNIL) {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 2, "stdio option must be table");
+ }
+ lua_pop(L, 1);
+
+ // Get the env
+ lua_getfield(L, 2, "env");
+ if (lua_type(L, -1) == LUA_TTABLE) {
+ len = lua_rawlen(L, -1);
+ options.env = malloc((len + 1) * sizeof(*options.env));
+ if (!options.env) {
+ luv_clean_options(&options);
+ return luaL_error(L, "Problem allocating env");
+ }
+ for (i = 0; i < len; ++i) {
+ lua_rawgeti(L, -1, i + 1);
+ options.env[i] = (char*)lua_tostring(L, -1);
+ lua_pop(L, 1);
+ }
+ options.env[len] = NULL;
+ }
+ else if (lua_type(L, -1) != LUA_TNIL) {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 2, "env option must be table");
+ }
+ lua_pop(L, 1);
+
+ // Get the cwd
+ lua_getfield(L, 2, "cwd");
+ if (lua_type(L, -1) == LUA_TSTRING) {
+ options.cwd = (char*)lua_tostring(L, -1);
+ }
+ else if (lua_type(L, -1) != LUA_TNIL) {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 2, "cwd option must be string");
+ }
+ lua_pop(L, 1);
+
+ // Check for uid
+ lua_getfield(L, 2, "uid");
+ if (lua_type(L, -1) == LUA_TNUMBER) {
+ options.uid = lua_tointeger(L, -1);
+ options.flags |= UV_PROCESS_SETUID;
+ }
+ else if (lua_type(L, -1) != LUA_TNIL) {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 2, "uid option must be number");
+ }
+ lua_pop(L, 1);
+
+ // Check for gid
+ lua_getfield(L, 2, "gid");
+ if (lua_type(L, -1) == LUA_TNUMBER) {
+ options.gid = lua_tointeger(L, -1);
+ options.flags |= UV_PROCESS_SETGID;
+ }
+ else if (lua_type(L, -1) != LUA_TNIL) {
+ luv_clean_options(&options);
+ return luaL_argerror(L, 2, "gid option must be number");
+ }
+ lua_pop(L, 1);
+
+ // Check for the boolean flags
+ lua_getfield(L, 2, "verbatim");
+ if (lua_toboolean(L, -1)) {
+ options.flags |= UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS;
+ }
+ lua_pop(L, 1);
+ lua_getfield(L, 2, "detached");
+ if (lua_toboolean(L, -1)) {
+ options.flags |= UV_PROCESS_DETACHED;
+ }
+ lua_pop(L, 1);
+ lua_getfield(L, 2, "hide");
+ if (lua_toboolean(L, -1)) {
+ options.flags |= UV_PROCESS_WINDOWS_HIDE;
+ }
+ lua_pop(L, 1);
+
+ handle = luv_newuserdata(L, sizeof(*handle));
+ handle->type = UV_PROCESS;
+ handle->data = luv_setup_handle(L);
+
+ if (!lua_isnoneornil(L, 3)) {
+ luv_check_callback(L, handle->data, LUV_EXIT, 3);
+ }
+
+ ret = uv_spawn(luv_loop(L), handle, &options);
+
+ luv_clean_options(&options);
+ if (ret < 0) {
+ /* The async callback is required here because luajit GC may reclaim the
+ * luv handle before libuv is done closing it down.
+ */
+ uv_close((uv_handle_t*)handle, luv_spawn_close_cb);
+ return luv_error(L, ret);
+ }
+ lua_pushinteger(L, handle->pid);
+ return 2;
+}
+
+static int luv_parse_signal(lua_State* L, int slot) {
+ if (lua_isnumber(L, slot)) {
+ return lua_tonumber(L, slot);
+ }
+ if (lua_isstring(L, slot)) {
+ return luv_sig_string_to_num(lua_tostring(L, slot));
+ }
+ return SIGTERM;
+}
+
+static int luv_process_kill(lua_State* L) {
+ uv_process_t* handle = luv_check_process(L, 1);
+ int signum = luv_parse_signal(L, 2);
+ int ret = uv_process_kill(handle, signum);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_kill(lua_State* L) {
+ int pid = luaL_checkinteger(L, 1);
+ int signum = luv_parse_signal(L, 2);
+ int ret = uv_kill(pid, signum);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
diff --git a/3rdparty/luv/src/req.c b/3rdparty/luv/src/req.c
new file mode 100644
index 00000000000..6d7b7e4a30b
--- /dev/null
+++ b/3rdparty/luv/src/req.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_req_t* luv_check_req(lua_State* L, int index) {
+ uv_req_t* req = luaL_checkudata(L, index, "uv_req");
+ luaL_argcheck(L, req->data, index, "Expected uv_req_t");
+ return req;
+}
+
+static int luv_req_tostring(lua_State* L) {
+ uv_req_t* req = luaL_checkudata(L, 1, "uv_req");
+ switch (req->type) {
+#define XX(uc, lc) case UV_##uc: lua_pushfstring(L, "uv_"#lc"_t: %p", req); break;
+ UV_REQ_TYPE_MAP(XX)
+#undef XX
+ default: lua_pushfstring(L, "uv_req_t: %p", req); break;
+ }
+ return 1;
+}
+
+static void luv_req_init(lua_State* L) {
+ luaL_newmetatable (L, "uv_req");
+ lua_pushcfunction(L, luv_req_tostring);
+ lua_setfield(L, -2, "__tostring");
+ lua_pop(L, 1);
+}
+
+// Metamethod to allow storing anything in the userdata's environment
+static int luv_cancel(lua_State* L) {
+ uv_req_t* req = luv_check_req(L, 1);
+ int ret = uv_cancel(req);
+ if (ret < 0) return luv_error(L, ret);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+ lua_pushinteger(L, ret);
+ return 1;
+}
diff --git a/3rdparty/luv/src/schema.c b/3rdparty/luv/src/schema.c
new file mode 100644
index 00000000000..e7b82e11d66
--- /dev/null
+++ b/3rdparty/luv/src/schema.c
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
diff --git a/3rdparty/luv/src/signal.c b/3rdparty/luv/src/signal.c
new file mode 100644
index 00000000000..48ace2bf601
--- /dev/null
+++ b/3rdparty/luv/src/signal.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_signal_t* luv_check_signal(lua_State* L, int index) {
+ uv_signal_t* handle = luv_checkudata(L, index, "uv_signal");
+ luaL_argcheck(L, handle->type == UV_SIGNAL && handle->data, index, "Expected uv_signal_t");
+ return handle;
+}
+
+static int luv_new_signal(lua_State* L) {
+ uv_signal_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_signal_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_signal_cb(uv_signal_t* handle, int signum) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ lua_pushstring(L, luv_sig_num_to_string(signum));
+ luv_call_callback(L, data, LUV_SIGNAL, 1);
+}
+
+static int luv_signal_start(lua_State* L) {
+ uv_signal_t* handle = luv_check_signal(L, 1);
+ int signum, ret;
+ if (lua_isnumber(L, 2)) {
+ signum = lua_tointeger(L, 2);
+ }
+ else if (lua_isstring(L, 2)) {
+ signum = luv_sig_string_to_num(luaL_checkstring(L, 2));
+ luaL_argcheck(L, signum, 2, "Invalid Signal name");
+ }
+ else {
+ return luaL_argerror(L, 2, "Missing Signal name");
+ }
+
+ if (!lua_isnoneornil(L, 3)) {
+ luv_check_callback(L, handle->data, LUV_SIGNAL, 3);
+ }
+ ret = uv_signal_start(handle, luv_signal_cb, signum);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_signal_stop(lua_State* L) {
+ uv_signal_t* handle = luv_check_signal(L, 1);
+ int ret = uv_signal_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
diff --git a/3rdparty/luv/src/stream.c b/3rdparty/luv/src/stream.c
new file mode 100644
index 00000000000..5009e04f097
--- /dev/null
+++ b/3rdparty/luv/src/stream.c
@@ -0,0 +1,263 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static void luv_check_buf(lua_State *L, int idx, uv_buf_t *pbuf) {
+ size_t len;
+ pbuf->base = (char*)luaL_checklstring(L, idx, &len);
+ pbuf->len = len;
+}
+
+static uv_stream_t* luv_check_stream(lua_State* L, int index) {
+ int isStream;
+ uv_stream_t* handle;
+ if (!(handle = *(void**) lua_touserdata(L, index))) { goto fail; }
+ lua_getfield(L, LUA_REGISTRYINDEX, "uv_stream");
+ lua_getmetatable(L, index < 0 ? index - 1 : index);
+ lua_rawget(L, -2);
+ isStream = lua_toboolean(L, -1);
+ lua_pop(L, 2);
+ if (isStream) { return handle; }
+ fail: luaL_argerror(L, index, "Expected uv_stream userdata");
+ return NULL;
+}
+
+static void luv_shutdown_cb(uv_shutdown_t* req, int status) {
+ lua_State* L = luv_state(req->handle->loop);
+ luv_status(L, status);
+ luv_fulfill_req(L, req->data, 1);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+}
+
+static int luv_shutdown(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ int ref = luv_check_continuation(L, 2);
+ uv_shutdown_t* req = lua_newuserdata(L, sizeof(*req));
+ int ret;
+ req->data = luv_setup_req(L, ref);
+ ret = uv_shutdown(req, handle, luv_shutdown_cb);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ return 1;
+}
+
+static void luv_connection_cb(uv_stream_t* handle, int status) {
+ lua_State* L = luv_state(handle->loop);
+ luv_status(L, status);
+ luv_call_callback(L, handle->data, LUV_CONNECTION, 1);
+}
+
+static int luv_listen(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ int backlog = luaL_checkinteger(L, 2);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_CONNECTION, 3);
+ ret = uv_listen(handle, backlog, luv_connection_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_accept(lua_State* L) {
+ uv_stream_t* server = luv_check_stream(L, 1);
+ uv_stream_t* client = luv_check_stream(L, 2);
+ int ret = uv_accept(server, client);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static void luv_alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
+ (void)handle;
+ buf->base = malloc(suggested_size);
+ assert(buf->base);
+ buf->len = suggested_size;
+}
+
+static void luv_read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
+ lua_State* L = luv_state(handle->loop);
+ int nargs;
+
+ if (nread > 0) {
+ lua_pushnil(L);
+ lua_pushlstring(L, buf->base, nread);
+ nargs = 2;
+ }
+
+ free(buf->base);
+ if (nread == 0) return;
+
+ if (nread == UV_EOF) {
+ nargs = 0;
+ }
+ else if (nread < 0) {
+ luv_status(L, nread);
+ nargs = 1;
+ }
+
+ luv_call_callback(L, handle->data, LUV_READ, nargs);
+}
+
+static int luv_read_start(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_READ, 2);
+ ret = uv_read_start(handle, luv_alloc_cb, luv_read_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_read_stop(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ int ret = uv_read_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static void luv_write_cb(uv_write_t* req, int status) {
+ lua_State* L = luv_state(req->handle->loop);
+ luv_status(L, status);
+ luv_fulfill_req(L, req->data, 1);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+}
+
+static uv_buf_t* luv_prep_bufs(lua_State* L, int index, size_t *count) {
+ uv_buf_t *bufs;
+ size_t i;
+ *count = lua_rawlen(L, index);
+ bufs = malloc(sizeof(uv_buf_t) * *count);
+ for (i = 0; i < *count; ++i) {
+ lua_rawgeti(L, index, i + 1);
+ luv_check_buf(L, -1, &bufs[i]);
+ lua_pop(L, 1);
+ }
+ return bufs;
+}
+
+static int luv_write(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ uv_write_t* req;
+ int ret, ref;
+ ref = luv_check_continuation(L, 3);
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ if (lua_istable(L, 2)) {
+ size_t count;
+ uv_buf_t *bufs = luv_prep_bufs(L, 2, &count);
+ ret = uv_write(req, handle, bufs, count, luv_write_cb);
+ free(bufs);
+ }
+ else if (lua_isstring(L, 2)) {
+ uv_buf_t buf;
+ luv_check_buf(L, 2, &buf);
+ ret = uv_write(req, handle, &buf, 1, luv_write_cb);
+ }
+ else {
+ return luaL_argerror(L, 2, "data must be string or table of strings");
+ }
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ lua_pushvalue(L, 2);
+ ((luv_req_t*)req->data)->data_ref = luaL_ref(L, LUA_REGISTRYINDEX);
+ return 1;
+}
+
+static int luv_write2(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ uv_write_t* req;
+ int ret, ref;
+ uv_stream_t* send_handle;
+ send_handle = luv_check_stream(L, 3);
+ ref = luv_check_continuation(L, 4);
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ if (lua_istable(L, 2)) {
+ size_t count;
+ uv_buf_t *bufs = luv_prep_bufs(L, 2, &count);
+ ret = uv_write2(req, handle, bufs, count, send_handle, luv_write_cb);
+ free(bufs);
+ }
+ else if (lua_isstring(L, 2)) {
+ uv_buf_t buf;
+ luv_check_buf(L, 2, &buf);
+ ret = uv_write2(req, handle, &buf, 1, send_handle, luv_write_cb);
+ }
+ else {
+ return luaL_argerror(L, 2, "data must be string or table of strings");
+ }
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ lua_pushvalue(L, 2);
+ ((luv_req_t*)req->data)->data_ref = luaL_ref(L, LUA_REGISTRYINDEX);
+ return 1;
+}
+
+static int luv_try_write(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ int ret;
+ if (lua_istable(L, 2)) {
+ size_t count;
+ uv_buf_t *bufs = luv_prep_bufs(L, 2, &count);
+ ret = uv_try_write(handle, bufs, count);
+ free(bufs);
+ }
+ else if (lua_isstring(L, 2)) {
+ uv_buf_t buf;
+ luv_check_buf(L, 2, &buf);
+ ret = uv_try_write(handle, &buf, 1);
+ }
+ else {
+ return luaL_argerror(L, 2, "data must be string or table of strings");
+ }
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_is_readable(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ lua_pushboolean(L, uv_is_readable(handle));
+ return 1;
+}
+
+static int luv_is_writable(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ lua_pushboolean(L, uv_is_writable(handle));
+ return 1;
+}
+
+static int luv_stream_set_blocking(lua_State* L) {
+ uv_stream_t* handle = luv_check_stream(L, 1);
+ int blocking, ret;
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ blocking = lua_toboolean(L, 2);
+ ret = uv_stream_set_blocking(handle, blocking);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
diff --git a/3rdparty/luv/src/tcp.c b/3rdparty/luv/src/tcp.c
new file mode 100644
index 00000000000..7ffef5ae763
--- /dev/null
+++ b/3rdparty/luv/src/tcp.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_tcp_t* luv_check_tcp(lua_State* L, int index) {
+ uv_tcp_t* handle = luv_checkudata(L, index, "uv_tcp");
+ luaL_argcheck(L, handle->type == UV_TCP && handle->data, index, "Expected uv_tcp_t");
+ return handle;
+}
+
+static int luv_new_tcp(lua_State* L) {
+ uv_tcp_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_tcp_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static int luv_tcp_open(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ uv_os_sock_t sock = luaL_checkinteger(L, 2);
+ int ret = uv_tcp_open(handle, sock);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_tcp_nodelay(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ int ret, enable;
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ enable = lua_toboolean(L, 2);
+ ret = uv_tcp_nodelay(handle, enable);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_tcp_keepalive(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ int ret, enable;
+ unsigned int delay = 0;
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ enable = lua_toboolean(L, 2);
+ if (enable) {
+ delay = luaL_checkinteger(L, 3);
+ }
+ ret = uv_tcp_keepalive(handle, enable, delay);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_tcp_simultaneous_accepts(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ int ret, enable;
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ enable = lua_toboolean(L, 2);
+ ret = uv_tcp_simultaneous_accepts(handle, enable);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_tcp_bind(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ const char* host = luaL_checkstring(L, 2);
+ int port = luaL_checkinteger(L, 3);
+ unsigned int flags = 0;
+ struct sockaddr_storage addr;
+ int ret;
+ if (uv_ip4_addr(host, port, (struct sockaddr_in*)&addr) &&
+ uv_ip6_addr(host, port, (struct sockaddr_in6*)&addr)) {
+ return luaL_error(L, "Invalid IP address or port [%s:%d]", host, port);
+ }
+ if (lua_type(L, 4) == LUA_TTABLE) {
+ lua_getfield(L, 4, "ipv6only");
+ if (lua_toboolean(L, -1)) flags |= UV_TCP_IPV6ONLY;
+ lua_pop(L, 1);
+ }
+ ret = uv_tcp_bind(handle, (struct sockaddr*)&addr, flags);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static void parse_sockaddr(lua_State* L, struct sockaddr_storage* address, int addrlen) {
+ char ip[INET6_ADDRSTRLEN];
+ int port = 0;
+ lua_newtable(L);
+ if (address->ss_family == AF_INET) {
+ struct sockaddr_in* addrin = (struct sockaddr_in*)address;
+ uv_inet_ntop(AF_INET, &(addrin->sin_addr), ip, addrlen);
+ port = ntohs(addrin->sin_port);
+ } else if (address->ss_family == AF_INET6) {
+ struct sockaddr_in6* addrin6 = (struct sockaddr_in6*)address;
+ uv_inet_ntop(AF_INET6, &(addrin6->sin6_addr), ip, addrlen);
+ port = ntohs(addrin6->sin6_port);
+ }
+
+ lua_pushstring(L, luv_af_num_to_string(address->ss_family));
+ lua_setfield(L, -2, "family");
+ lua_pushinteger(L, port);
+ lua_setfield(L, -2, "port");
+ lua_pushstring(L, ip);
+ lua_setfield(L, -2, "ip");
+}
+
+static int luv_tcp_getsockname(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ struct sockaddr_storage address;
+ int addrlen = sizeof(address);
+ int ret = uv_tcp_getsockname(handle, (struct sockaddr*)&address, &addrlen);
+ if (ret < 0) return luv_error(L, ret);
+ parse_sockaddr(L, &address, addrlen);
+ return 1;
+}
+
+static int luv_tcp_getpeername(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ struct sockaddr_storage address;
+ int addrlen = sizeof(address);
+ int ret = uv_tcp_getpeername(handle, (struct sockaddr*)&address, &addrlen);
+ if (ret < 0) return luv_error(L, ret);
+ parse_sockaddr(L, &address, addrlen);
+ return 1;
+}
+
+
+static void luv_connect_cb(uv_connect_t* req, int status) {
+ lua_State* L = luv_state(req->handle->loop);
+ luv_status(L, status);
+ luv_fulfill_req(L, req->data, 1);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+}
+
+static int luv_write_queue_size(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ lua_pushinteger(L, handle->write_queue_size);
+ return 1;
+}
+
+static int luv_tcp_connect(lua_State* L) {
+ uv_tcp_t* handle = luv_check_tcp(L, 1);
+ const char* host = luaL_checkstring(L, 2);
+ int port = luaL_checkinteger(L, 3);
+ struct sockaddr_storage addr;
+ uv_connect_t* req;
+ int ret, ref;
+ if (uv_ip4_addr(host, port, (struct sockaddr_in*)&addr) &&
+ uv_ip6_addr(host, port, (struct sockaddr_in6*)&addr)) {
+ return luaL_error(L, "Invalid IP address or port [%s:%d]", host, port);
+ }
+ ref = luv_check_continuation(L, 4);
+
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ ret = uv_tcp_connect(req, handle, (struct sockaddr*)&addr, luv_connect_cb);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ return 1;
+}
diff --git a/3rdparty/luv/src/thread.c b/3rdparty/luv/src/thread.c
new file mode 100644
index 00000000000..cc53011e6ed
--- /dev/null
+++ b/3rdparty/luv/src/thread.c
@@ -0,0 +1,353 @@
+/*
+* Copyright 2014 The Luvit Authors. All Rights Reserved.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+#include "luv.h"
+#include "lthreadpool.h"
+
+typedef struct {
+ uv_thread_t handle;
+ char* code;
+ int len;
+ int argc;
+ luv_thread_arg_t arg;
+} luv_thread_t;
+
+static luv_acquire_vm acquire_vm_cb = NULL;
+static luv_release_vm release_vm_cb = NULL;
+
+static lua_State* luv_thread_acquire_vm() {
+ lua_State* L = luaL_newstate();
+
+ // Add in the lua standard libraries
+ luaL_openlibs(L);
+
+ // Get package.loaded, so we can store uv in it.
+ lua_getglobal(L, "package");
+ lua_getfield(L, -1, "loaded");
+ lua_remove(L, -2); // Remove package
+
+ // Store uv module definition at loaded.uv
+ luaopen_luv(L);
+ lua_setfield(L, -2, "luv");
+ lua_pop(L, 1);
+
+ return L;
+}
+
+static void luv_thread_release_vm(lua_State* L) {
+ lua_close(L);
+}
+
+static int luv_thread_arg_set(lua_State* L, luv_thread_arg_t* args, int idx, int top, int flag)
+{
+ int i;
+ idx = idx > 0 ? idx : 1;
+ i = idx;
+ while (i <= top && i <= LUV_THREAD_MAXNUM_ARG + idx)
+ {
+ luv_val_t *arg = args->argv + i - idx;
+ arg->type = lua_type(L, i);
+ switch (arg->type)
+ {
+ case LUA_TNIL:
+ break;
+ case LUA_TBOOLEAN:
+ arg->val.boolean = lua_toboolean(L, i);
+ break;
+ case LUA_TNUMBER:
+ arg->val.num = lua_tonumber(L, i);
+ break;
+ case LUA_TLIGHTUSERDATA:
+ arg->val.userdata = lua_touserdata(L, i);
+ break;
+ case LUA_TSTRING:
+ {
+ const char* p = lua_tolstring(L, i, &arg->val.str.len);
+ arg->val.str.base = malloc(arg->val.str.len);
+ if (arg->val.str.base == NULL)
+ {
+ perror("out of memory");
+ return 0;
+ }
+ memcpy((void*)arg->val.str.base, p, arg->val.str.len);
+ break;
+ }
+ case LUA_TUSERDATA:
+ if (flag == 1) {
+ arg->val.userdata = luv_check_handle(L, i);
+ break;
+ }
+ default:
+ fprintf(stderr, "Error: thread arg not support type '%s' at %d",
+ luaL_typename(L, arg->type), i);
+ exit(-1);
+ break;
+ }
+ i++;
+ }
+ args->argc = i - idx;
+ return args->argc;
+}
+
+static void luv_thread_arg_clear(luv_thread_arg_t* args) {
+ int i;
+ for (i = 0; i < args->argc; i++)
+ {
+ if (args->argv[i].type == LUA_TSTRING)
+ {
+ free((void*)args->argv[i].val.str.base);
+ }
+ }
+ memset(args, 0, sizeof(*args));
+ args->argc = 0;
+}
+
+static void luv_thread_setup_handle(lua_State* L, uv_handle_t* handle) {
+ *(void**) lua_newuserdata(L, sizeof(void*)) = handle;
+
+#define XX(uc, lc) case UV_##uc: \
+ luaL_getmetatable(L, "uv_"#lc); \
+ break;
+ switch (handle->type) {
+ UV_HANDLE_TYPE_MAP(XX)
+ default:
+ luaL_error(L, "Unknown handle type");
+ }
+#undef XX
+
+ lua_setmetatable(L, -2);
+}
+
+static int luv_thread_arg_push(lua_State* L, const luv_thread_arg_t* args) {
+ int i = 0;
+ while (i < args->argc)
+ {
+ const luv_val_t* arg = args->argv + i;
+ switch (arg->type)
+ {
+ case LUA_TNIL:
+ lua_pushnil(L);
+ break;
+ case LUA_TBOOLEAN:
+ lua_pushboolean(L, arg->val.boolean);
+ break;
+ case LUA_TLIGHTUSERDATA:
+ lua_pushlightuserdata(L, arg->val.userdata);
+ break;
+ case LUA_TNUMBER:
+ lua_pushnumber(L, arg->val.num);
+ break;
+ case LUA_TSTRING:
+ lua_pushlstring(L, arg->val.str.base, arg->val.str.len);
+ break;
+ case LUA_TUSERDATA:
+ luv_thread_setup_handle(L, arg->val.userdata);
+ break;
+ default:
+ fprintf(stderr, "Error: thread arg not support type %s at %d",
+ luaL_typename(L, arg->type), i + 1);
+ }
+ i++;
+ };
+ return i;
+}
+
+int thread_dump(lua_State* L, const void* p, size_t sz, void* B)
+{
+ (void)L;
+ luaL_addlstring((luaL_Buffer*) B, (const char*) p, sz);
+ return 0;
+}
+
+static const char* luv_thread_dumped(lua_State* L, int idx, size_t* l) {
+ if (lua_isstring(L, idx)) {
+ return lua_tolstring(L, idx, l);
+ } else {
+ const char* buff = NULL;
+ int top = lua_gettop(L);
+ luaL_Buffer b;
+ luaL_checktype(L, idx, LUA_TFUNCTION);
+ lua_pushvalue(L, idx);
+ luaL_buffinit(L, &b);
+#if LUA_VERSION_NUM>=503
+ int test_lua_dump = (lua_dump(L, thread_dump, &b, 1) == 0);
+#else
+ int test_lua_dump = (lua_dump(L, thread_dump, &b) == 0);
+#endif
+ if (test_lua_dump) {
+ luaL_pushresult(&b);
+ buff = lua_tolstring(L, -1, l);
+ } else
+ luaL_error(L, "Error: unable to dump given function");
+ lua_settop(L, top);
+
+ return buff;
+ }
+}
+
+static luv_thread_t* luv_check_thread(lua_State* L, int index)
+{
+ luv_thread_t* thread = luaL_checkudata(L, index, "uv_thread");
+ return thread;
+}
+
+static int luv_thread_gc(lua_State* L) {
+ luv_thread_t* tid = luv_check_thread(L, 1);
+ free(tid->code);
+ tid->code = NULL;
+ tid->len = 0;
+ luv_thread_arg_clear(&tid->arg);
+ return 0;
+}
+
+static int luv_thread_tostring(lua_State* L)
+{
+ luv_thread_t* thd = luv_check_thread(L, 1);
+ lua_pushfstring(L, "uv_thread_t: %p", thd->handle);
+ return 1;
+}
+
+static void luv_thread_cb(void* varg) {
+ luv_thread_t* thd = (luv_thread_t*)varg;
+ lua_State* L = acquire_vm_cb();
+ if (luaL_loadbuffer(L, thd->code, thd->len, "=thread") == 0)
+ {
+ int top = lua_gettop(L);
+ int i = luv_thread_arg_push(L, &thd->arg);
+
+ for (i = 0; i < thd->arg.argc; i++) {
+ if (thd->arg.argv[i].type == LUA_TUSERDATA) {
+ lua_pushlightuserdata(L, thd->arg.argv[i].val.userdata);
+ lua_pushvalue(L, top + i + 1);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+ }
+ }
+
+ if (lua_pcall(L, i, 0, 0)) {
+ fprintf(stderr, "Uncaught Error in thread: %s\n", lua_tostring(L, -1));
+ }
+
+ for (i = 0; i < thd->arg.argc; i++) {
+ if (thd->arg.argv[i].type == LUA_TUSERDATA) {
+ lua_pushlightuserdata(L, thd->arg.argv[i].val.userdata);
+ lua_rawget(L, LUA_REGISTRYINDEX);
+ lua_pushnil(L);
+ lua_setmetatable(L, -2);
+ lua_pop(L, 1);
+
+ lua_pushlightuserdata(L, thd->arg.argv[i].val.userdata);
+ lua_pushnil(L);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+ }
+ }
+
+ } else {
+ fprintf(stderr, "Uncaught Error: %s\n", lua_tostring(L, -1));
+ }
+ release_vm_cb(L);
+}
+
+static int luv_new_thread(lua_State* L) {
+ int ret;
+ size_t len;
+ const char* buff;
+ luv_thread_t* thread;
+ thread = lua_newuserdata(L, sizeof(*thread));
+ memset(thread, 0, sizeof(*thread));
+ luaL_getmetatable(L, "uv_thread");
+ lua_setmetatable(L, -2);
+
+ buff = luv_thread_dumped(L, 1, &len);
+
+ thread->argc = luv_thread_arg_set(L, &thread->arg, 2, lua_gettop(L) - 1, 1);
+ thread->len = len;
+ thread->code = malloc(thread->len);
+ memcpy(thread->code, buff, len);
+
+ ret = uv_thread_create(&thread->handle, luv_thread_cb, thread);
+ if (ret < 0) return luv_error(L, ret);
+
+ return 1;
+}
+
+static int luv_thread_join(lua_State* L) {
+ luv_thread_t* tid = luv_check_thread(L, 1);
+ int ret = uv_thread_join(&tid->handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushboolean(L, 1);
+ return 1;
+}
+
+static int luv_thread_self(lua_State* L)
+{
+ luv_thread_t* thread;
+ uv_thread_t t = uv_thread_self();
+ thread = lua_newuserdata(L, sizeof(*thread));
+ memset(thread, 0, sizeof(*thread));
+ memcpy(&thread->handle, &t, sizeof(t));
+ luaL_getmetatable(L, "uv_thread");
+ lua_setmetatable(L, -2);
+ return 1;
+}
+
+static int luv_thread_equal(lua_State* L) {
+ luv_thread_t* t1 = luv_check_thread(L, 1);
+ luv_thread_t* t2 = luv_check_thread(L, 2);
+ int ret = uv_thread_equal(&t1->handle, &t2->handle);
+ lua_pushboolean(L, ret);
+ return 1;
+}
+
+/* Pause the calling thread for a number of milliseconds. */
+static int luv_thread_sleep(lua_State* L) {
+#ifdef _WIN32
+ DWORD msec = luaL_checkinteger(L, 1);
+ Sleep(msec);
+#else
+ lua_Integer msec = luaL_checkinteger(L, 1);
+ usleep(msec * 1000);
+#endif
+ return 0;
+}
+
+static const luaL_Reg luv_thread_methods[] = {
+ {"equal", luv_thread_equal},
+ {"join", luv_thread_join},
+ {NULL, NULL}
+};
+
+static void luv_thread_init(lua_State* L) {
+ luaL_newmetatable(L, "uv_thread");
+ lua_pushcfunction(L, luv_thread_tostring);
+ lua_setfield(L, -2, "__tostring");
+ lua_pushcfunction(L, luv_thread_equal);
+ lua_setfield(L, -2, "__eq");
+ lua_pushcfunction(L, luv_thread_gc);
+ lua_setfield(L, -2, "__gc");
+ lua_newtable(L);
+ luaL_setfuncs(L, luv_thread_methods, 0);
+ lua_setfield(L, -2, "__index");
+ lua_pop(L, 1);
+
+ if (acquire_vm_cb == NULL) acquire_vm_cb = luv_thread_acquire_vm;
+ if (release_vm_cb == NULL) release_vm_cb = luv_thread_release_vm;
+}
+
+LUALIB_API void luv_set_thread_cb(luv_acquire_vm acquire, luv_release_vm release)
+{
+ acquire_vm_cb = acquire;
+ release_vm_cb = release;
+}
diff --git a/3rdparty/luv/src/timer.c b/3rdparty/luv/src/timer.c
new file mode 100644
index 00000000000..b283f1fc8b2
--- /dev/null
+++ b/3rdparty/luv/src/timer.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_timer_t* luv_check_timer(lua_State* L, int index) {
+ uv_timer_t* handle = luv_checkudata(L, index, "uv_timer");
+ luaL_argcheck(L, handle->type == UV_TIMER && handle->data, index, "Expected uv_timer_t");
+ return handle;
+}
+
+static int luv_new_timer(lua_State* L) {
+ uv_timer_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_timer_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static void luv_timer_cb(uv_timer_t* handle) {
+ lua_State* L = luv_state(handle->loop);
+ luv_handle_t* data = handle->data;
+ luv_call_callback(L, data, LUV_TIMEOUT, 0);
+}
+
+static int luv_timer_start(lua_State* L) {
+ uv_timer_t* handle = luv_check_timer(L, 1);
+ uint64_t timeout;
+ uint64_t repeat;
+ int ret;
+ timeout = luaL_checkinteger(L, 2);
+ repeat = luaL_checkinteger(L, 3);
+ luv_check_callback(L, handle->data, LUV_TIMEOUT, 4);
+ ret = uv_timer_start(handle, luv_timer_cb, timeout, repeat);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_timer_stop(lua_State* L) {
+ uv_timer_t* handle = luv_check_timer(L, 1);
+ int ret = uv_timer_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_timer_again(lua_State* L) {
+ uv_timer_t* handle = luv_check_timer(L, 1);
+ int ret = uv_timer_again(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_timer_set_repeat(lua_State* L) {
+ uv_timer_t* handle = luv_check_timer(L, 1);
+ uint64_t repeat = luaL_checkinteger(L, 2);
+ uv_timer_set_repeat(handle, repeat);
+ return 0;
+}
+
+static int luv_timer_get_repeat(lua_State* L) {
+ uv_timer_t* handle = luv_check_timer(L, 1);
+ uint64_t repeat = uv_timer_get_repeat(handle);
+ lua_pushinteger(L, repeat);
+ return 1;
+}
diff --git a/3rdparty/luv/src/tty.c b/3rdparty/luv/src/tty.c
new file mode 100644
index 00000000000..9232dc07603
--- /dev/null
+++ b/3rdparty/luv/src/tty.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_tty_t* luv_check_tty(lua_State* L, int index) {
+ uv_tty_t* handle = luv_checkudata(L, index, "uv_tty");
+ luaL_argcheck(L, handle->type == UV_TTY && handle->data, index, "Expected uv_tty_t");
+ return handle;
+}
+
+static int luv_new_tty(lua_State* L) {
+ int readable, ret;
+ uv_tty_t* handle;
+ uv_file fd = luaL_checkinteger(L, 1);
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ readable = lua_toboolean(L, 2);
+ handle = luv_newuserdata(L, sizeof(*handle));
+ ret = uv_tty_init(luv_loop(L), handle, fd, readable);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static int luv_tty_set_mode(lua_State* L) {
+ uv_tty_t* handle = luv_check_tty(L, 1);
+ int mode = luaL_checkinteger(L, 2);
+ int ret = uv_tty_set_mode(handle, mode);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_tty_reset_mode(lua_State* L) {
+ int ret = uv_tty_reset_mode();
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_tty_get_winsize(lua_State* L) {
+ uv_tty_t* handle = luv_check_tty(L, 1);
+ int width, height;
+ int ret = uv_tty_get_winsize(handle, &width, &height);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, width);
+ lua_pushinteger(L, height);
+ return 2;
+}
diff --git a/3rdparty/luv/src/udp.c b/3rdparty/luv/src/udp.c
new file mode 100644
index 00000000000..9cc25555559
--- /dev/null
+++ b/3rdparty/luv/src/udp.c
@@ -0,0 +1,260 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+static uv_udp_t* luv_check_udp(lua_State* L, int index) {
+ uv_udp_t* handle = luv_checkudata(L, index, "uv_udp");
+ luaL_argcheck(L, handle->type == UV_UDP && handle->data, index, "Expected uv_udp_t");
+ return handle;
+}
+
+static int luv_new_udp(lua_State* L) {
+ uv_udp_t* handle = luv_newuserdata(L, sizeof(*handle));
+ int ret = uv_udp_init(luv_loop(L), handle);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ handle->data = luv_setup_handle(L);
+ return 1;
+}
+
+static int luv_udp_open(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ uv_os_sock_t sock = luaL_checkinteger(L, 2);
+ int ret = uv_udp_open(handle, sock);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_bind(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ const char* host = luaL_checkstring(L, 2);
+ int port = luaL_checkinteger(L, 3);
+ unsigned int flags = 0;
+ struct sockaddr_storage addr;
+ int ret;
+ if (uv_ip4_addr(host, port, (struct sockaddr_in*)&addr) &&
+ uv_ip6_addr(host, port, (struct sockaddr_in6*)&addr)) {
+ return luaL_error(L, "Invalid IP address or port [%s:%d]", host, port);
+ }
+ if (lua_type(L, 4) == LUA_TTABLE) {
+ luaL_checktype(L, 4, LUA_TTABLE);
+ lua_getfield(L, 4, "reuseaddr");
+ if (lua_toboolean(L, -1)) flags |= UV_UDP_REUSEADDR;
+ lua_pop(L, 1);
+ lua_getfield(L, 4, "ipv6only");
+ if (lua_toboolean(L, -1)) flags |= UV_UDP_IPV6ONLY;
+ lua_pop(L, 1);
+ }
+ ret = uv_udp_bind(handle, (struct sockaddr*)&addr, flags);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_getsockname(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ struct sockaddr_storage address;
+ int addrlen = sizeof(address);
+ int ret = uv_udp_getsockname(handle, (struct sockaddr*)&address, &addrlen);
+ if (ret < 0) return luv_error(L, ret);
+ parse_sockaddr(L, &address, addrlen);
+ return 1;
+}
+
+// These are the same order as uv_membership which also starts at 0
+static const char *const luv_membership_opts[] = {
+ "leave", "join", NULL
+};
+
+static int luv_udp_set_membership(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ const char* multicast_addr = luaL_checkstring(L, 2);
+ const char* interface_addr = luaL_checkstring(L, 3);
+ uv_membership membership = luaL_checkoption(L, 4, NULL, luv_membership_opts);
+ int ret = uv_udp_set_membership(handle, multicast_addr, interface_addr, membership);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_set_multicast_loop(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ int on, ret;
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ on = lua_toboolean(L, 2);
+ ret = uv_udp_set_multicast_loop(handle, on);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_set_multicast_ttl(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ int ttl, ret;
+ ttl = luaL_checkinteger(L, 2);
+ ret = uv_udp_set_multicast_ttl(handle, ttl);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_set_multicast_interface(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ const char* interface_addr = luaL_checkstring(L, 2);
+ int ret = uv_udp_set_multicast_interface(handle, interface_addr);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_set_broadcast(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ int on, ret;
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
+ on = lua_toboolean(L, 2);
+ ret =uv_udp_set_broadcast(handle, on);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_set_ttl(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ int ttl, ret;
+ ttl = luaL_checknumber(L, 2);
+ ret = uv_udp_set_ttl(handle, ttl);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static void luv_udp_send_cb(uv_udp_send_t* req, int status) {
+ lua_State* L = luv_state(req->handle->loop);
+ luv_status(L, status);
+ luv_fulfill_req(L, req->data, 1);
+ luv_cleanup_req(L, req->data);
+ req->data = NULL;
+}
+
+static int luv_udp_send(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ uv_udp_send_t* req;
+ uv_buf_t buf;
+ int ret, port, ref;
+ const char* host;
+ struct sockaddr_storage addr;
+ luv_check_buf(L, 2, &buf);
+ host = luaL_checkstring(L, 3);
+ port = luaL_checkinteger(L, 4);
+ if (uv_ip4_addr(host, port, (struct sockaddr_in*)&addr) &&
+ uv_ip6_addr(host, port, (struct sockaddr_in6*)&addr)) {
+ return luaL_error(L, "Invalid IP address or port [%s:%d]", host, port);
+ }
+ ref = luv_check_continuation(L, 5);
+ req = lua_newuserdata(L, sizeof(*req));
+ req->data = luv_setup_req(L, ref);
+ ret = uv_udp_send(req, handle, &buf, 1, (struct sockaddr*)&addr, luv_udp_send_cb);
+ if (ret < 0) {
+ lua_pop(L, 1);
+ return luv_error(L, ret);
+ }
+ return 1;
+
+}
+
+static int luv_udp_try_send(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ uv_buf_t buf;
+ int ret, port;
+ const char* host;
+ struct sockaddr_storage addr;
+ luv_check_buf(L, 2, &buf);
+ host = luaL_checkstring(L, 3);
+ port = luaL_checkinteger(L, 4);
+ if (uv_ip4_addr(host, port, (struct sockaddr_in*)&addr) &&
+ uv_ip6_addr(host, port, (struct sockaddr_in6*)&addr)) {
+ return luaL_error(L, "Invalid IP address or port [%s:%d]", host, port);
+ }
+ ret = uv_udp_try_send(handle, &buf, 1, (struct sockaddr*)&addr);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static void luv_udp_recv_cb(uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags) {
+ lua_State* L = luv_state(handle->loop);
+
+ // err
+ if (nread < 0) {
+ luv_status(L, nread);
+ }
+ else {
+ lua_pushnil(L);
+ }
+
+ // data
+ if (nread == 0) {
+ if (addr) {
+ lua_pushstring(L, "");
+ }
+ else {
+ lua_pushnil(L);
+ }
+ }
+ else if (nread > 0) {
+ lua_pushlstring(L, buf->base, nread);
+ }
+ if (buf) free(buf->base);
+
+ // address
+ if (addr) {
+ parse_sockaddr(L, (struct sockaddr_storage*)addr, sizeof *addr);
+ }
+ else {
+ lua_pushnil(L);
+ }
+
+ // flags
+ lua_newtable(L);
+ if (flags & UV_UDP_PARTIAL) {
+ lua_pushboolean(L, 1);
+ lua_setfield(L, -2, "partial");
+ }
+
+ luv_call_callback(L, handle->data, LUV_RECV, 4);
+}
+
+static int luv_udp_recv_start(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ int ret;
+ luv_check_callback(L, handle->data, LUV_RECV, 2);
+ ret = uv_udp_recv_start(handle, luv_alloc_cb, luv_udp_recv_cb);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
+
+static int luv_udp_recv_stop(lua_State* L) {
+ uv_udp_t* handle = luv_check_udp(L, 1);
+ int ret = uv_udp_recv_stop(handle);
+ if (ret < 0) return luv_error(L, ret);
+ lua_pushinteger(L, ret);
+ return 1;
+}
diff --git a/3rdparty/luv/src/util.c b/3rdparty/luv/src/util.c
new file mode 100644
index 00000000000..c7b98c1759a
--- /dev/null
+++ b/3rdparty/luv/src/util.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "luv.h"
+
+void luv_stack_dump(lua_State* L, const char* name) {
+ int i, l;
+ fprintf(stderr, "\nAPI STACK DUMP %p %d: %s\n", L, lua_status(L), name);
+ for (i = 1, l = lua_gettop(L); i <= l; i++) {
+ int type = lua_type(L, i);
+ switch (type) {
+ case LUA_TSTRING:
+ fprintf(stderr, " %d %s \"%s\"\n", i, lua_typename(L, type), lua_tostring(L, i));
+ break;
+ case LUA_TNUMBER:
+ fprintf(stderr, " %d %s %ld\n", i, lua_typename(L, type), (long int) lua_tointeger(L, i));
+ break;
+ case LUA_TUSERDATA:
+ fprintf(stderr, " %d %s %p\n", i, lua_typename(L, type), lua_touserdata(L, i));
+ break;
+ default:
+ fprintf(stderr, " %d %s\n", i, lua_typename(L, type));
+ break;
+ }
+ }
+ assert(l == lua_gettop(L));
+}
+
+static int luv_error(lua_State* L, int status) {
+ lua_pushnil(L);
+ lua_pushfstring(L, "%s: %s", uv_err_name(status), uv_strerror(status));
+ lua_pushstring(L, uv_err_name(status));
+ return 3;
+}
+
+static void luv_status(lua_State* L, int status) {
+ if (status < 0) {
+ lua_pushstring(L, uv_err_name(status));
+ }
+ else {
+ lua_pushnil(L);
+ }
+}
diff --git a/3rdparty/luv/src/util.h b/3rdparty/luv/src/util.h
new file mode 100644
index 00000000000..c669c0430db
--- /dev/null
+++ b/3rdparty/luv/src/util.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2014 The Luvit Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef LUV_UTIL_H
+#define LUV_UTIL_H
+
+#include "luv.h"
+
+void luv_stack_dump(lua_State* L, const char* name);
+static int luv_error(lua_State* L, int ret);
+static void luv_status(lua_State* L, int status);
+
+#endif
diff --git a/3rdparty/luv/src/work.c b/3rdparty/luv/src/work.c
new file mode 100644
index 00000000000..e40212f1e7c
--- /dev/null
+++ b/3rdparty/luv/src/work.c
@@ -0,0 +1,224 @@
+/*
+* Copyright 2014 The Luvit Authors. All Rights Reserved.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+#include "luv.h"
+
+#include "lthreadpool.h"
+
+typedef struct {
+ lua_State* L; /* vm in main */
+ char* code; /* thread entry code */
+ size_t len;
+
+ uv_async_t async;
+ int async_cb; /* ref, run in main, call when async message received, NYI */
+ int after_work_cb; /* ref, run in main ,call after work cb*/
+} luv_work_ctx_t;
+
+typedef struct {
+ uv_work_t work;
+ luv_work_ctx_t* ctx;
+
+ luv_thread_arg_t arg;
+} luv_work_t;
+
+static uv_key_t L_key;
+
+static luv_work_ctx_t* luv_check_work_ctx(lua_State* L, int index)
+{
+ luv_work_ctx_t* ctx = luaL_checkudata(L, index, "luv_work_ctx");
+ return ctx;
+}
+
+static int luv_work_ctx_gc(lua_State *L)
+{
+ luv_work_ctx_t* ctx = luv_check_work_ctx(L, 1);
+ free(ctx->code);
+ luaL_unref(L, LUA_REGISTRYINDEX, ctx->after_work_cb);
+ luaL_unref(L, LUA_REGISTRYINDEX, ctx->async_cb);
+
+ return 0;
+}
+
+static int luv_work_ctx_tostring(lua_State* L)
+{
+ luv_work_ctx_t* ctx = luv_check_work_ctx(L, 1);
+ lua_pushfstring(L, "luv_work_ctx_t: %p", ctx);
+ return 1;
+}
+
+static void luv_work_cb(uv_work_t* req)
+{
+ luv_work_t* work = req->data;
+ luv_work_ctx_t* ctx = work->ctx;
+ lua_State *L = uv_key_get(&L_key);
+ int top;
+ if (L == NULL) {
+ /* vm reuse in threadpool */
+ L = acquire_vm_cb();
+ uv_key_set(&L_key, L);
+ }
+
+ top = lua_gettop(L);
+ lua_pushlstring(L, ctx->code, ctx->len);
+ lua_rawget(L, LUA_REGISTRYINDEX);
+ if (lua_isnil(L, -1))
+ {
+ lua_pop(L, 1);
+
+ lua_pushlstring(L, ctx->code, ctx->len);
+ if (luaL_loadbuffer(L, ctx->code, ctx->len, "=pool") != 0)
+ {
+ fprintf(stderr, "Uncaught Error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+
+ lua_pushnil(L);
+ } else
+ {
+ lua_pushvalue(L, -1);
+ lua_insert(L, lua_gettop(L) - 2);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+ }
+ }
+
+ if (lua_isfunction(L, -1))
+ {
+ int i = luv_thread_arg_push(L, &work->arg);
+ if (lua_pcall(L, i, LUA_MULTRET, 0)) {
+ fprintf(stderr, "Uncaught Error in thread: %s\n", lua_tostring(L, -1));
+ }
+ luv_thread_arg_clear(&work->arg);
+ luv_thread_arg_set(L, &work->arg, top + 1, lua_gettop(L), 0);
+ lua_settop(L, top);
+ } else {
+ fprintf(stderr, "Uncaught Error: %s can't be work entry\n",
+ lua_typename(L, lua_type(L,-1)));
+ }
+}
+
+static void luv_after_work_cb(uv_work_t* req, int status) {
+ luv_work_t* work = req->data;
+ luv_work_ctx_t* ctx = work->ctx;
+ lua_State*L = ctx->L;
+ int i;
+ (void)status;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, ctx->after_work_cb);
+ i = luv_thread_arg_push(L, &work->arg);
+ if (lua_pcall(L, i, 0, 0))
+ {
+ fprintf(stderr, "Uncaught Error in thread: %s\n", lua_tostring(L, -1));
+ }
+
+ //ref down to ctx
+ lua_pushlightuserdata(L, work);
+ lua_pushnil(L);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+
+ luv_thread_arg_clear(&work->arg);
+ free(work);
+}
+
+static void async_cb(uv_async_t *handle)
+{
+ luv_work_t*work = handle->data;
+ luv_work_ctx_t* ctx = work->ctx;
+ lua_State*L = ctx->L;
+ int i;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, ctx->async_cb);
+ i = luv_thread_arg_push(L, &work->arg);
+ if (lua_pcall(L, i, 0, 0))
+ {
+ fprintf(stderr, "Uncaught Error in thread: %s\n", lua_tostring(L, -1));
+ }
+}
+
+static int luv_new_work(lua_State* L) {
+ size_t len;
+ const char* buff;
+ luv_work_ctx_t* ctx;
+
+ buff = luv_thread_dumped(L, 1, &len);
+ luaL_checktype(L, 2, LUA_TFUNCTION);
+ if(!lua_isnoneornil(L, 3))
+ luaL_checktype(L, 3, LUA_TFUNCTION);
+
+ ctx = lua_newuserdata(L, sizeof(*ctx));
+ memset(ctx, 0, sizeof(*ctx));
+
+ ctx->len = len;
+ ctx->code = malloc(ctx->len);
+ memcpy(ctx->code, buff, len);
+
+ lua_pushvalue(L, 2);
+ ctx->after_work_cb = luaL_ref(L, LUA_REGISTRYINDEX);
+ if (lua_gettop(L) == 4) {
+ lua_pushvalue(L, 3);
+ ctx->async_cb = luaL_ref(L, LUA_REGISTRYINDEX);
+ uv_async_init(luv_loop(L), &ctx->async, async_cb);
+ } else
+ ctx->async_cb = LUA_REFNIL;
+ ctx->L = L;
+ luaL_getmetatable(L, "luv_work_ctx");
+ lua_setmetatable(L, -2);
+ return 1;
+}
+
+static int luv_queue_work(lua_State* L) {
+ int top = lua_gettop(L);
+ luv_work_ctx_t* ctx = luv_check_work_ctx(L, 1);
+ luv_work_t* work = malloc(sizeof(*work));
+ int ret;
+
+ luv_thread_arg_set(L, &work->arg, 2, top, 0);
+ work->ctx = ctx;
+ work->work.data = work;
+ ret = uv_queue_work(luv_loop(L), &work->work, luv_work_cb, luv_after_work_cb);
+ if (ret < 0) {
+ free(work);
+ return luv_error(L, ret);
+ }
+
+ //ref up to ctx
+ lua_pushlightuserdata(L, work);
+ lua_pushvalue(L, 1);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+
+ lua_pushboolean(L, 1);
+ return 1;
+}
+
+static const luaL_Reg luv_work_ctx_methods[] = {
+ {"queue", luv_queue_work},
+ {NULL, NULL}
+};
+
+static int key_inited = 0;
+static void luv_work_init(lua_State* L) {
+ luaL_newmetatable(L, "luv_work_ctx");
+ lua_pushcfunction(L, luv_work_ctx_tostring);
+ lua_setfield(L, -2, "__tostring");
+ lua_pushcfunction(L, luv_work_ctx_gc);
+ lua_setfield(L, -2, "__gc");
+ lua_newtable(L);
+ luaL_setfuncs(L, luv_work_ctx_methods, 0);
+ lua_setfield(L, -2, "__index");
+ lua_pop(L, 1);
+
+ if (key_inited==0) {
+ key_inited = 1;
+ uv_key_create(&L_key);
+ }
+}
diff --git a/3rdparty/luv/tests/manual-test-cluster.lua b/3rdparty/luv/tests/manual-test-cluster.lua
new file mode 100644
index 00000000000..304e4be634d
--- /dev/null
+++ b/3rdparty/luv/tests/manual-test-cluster.lua
@@ -0,0 +1,213 @@
+-- This is quite the involved test. Basically it binds
+-- to a tcp port, spawns n children (one per CPU core)
+-- who all listen on the same shared port and act as a
+-- load balancing cluster.
+-- Then N clients are spawned that connect to the cluster
+-- The application itself kills the worker upon connection
+-- All N workers should accept exactly one request and all close.
+
+return require('lib/tap')(function (test)
+
+ -- This function will be run in a child process
+ local worker_code = string.dump(function ()
+ local dump = require('lib/utils').dump
+
+ local function print(...)
+ local n = select('#', ...)
+ local arguments = {...}
+ for i = 1, n do
+ arguments[i] = tostring(arguments[i])
+ end
+
+ local text = table.concat(arguments, "\t")
+ text = " " .. string.gsub(text, "\n", "\n ")
+ _G.print(text)
+ end
+
+ local function p(...)
+ local n = select('#', ...)
+ local arguments = { ... }
+
+ for i = 1, n do
+ arguments[i] = dump(arguments[i])
+ end
+
+ print(table.concat(arguments, "\t"))
+ end
+
+ local uv = require('luv')
+ local answer = -1
+
+ -- The parent is going to pass us the server handle over a pipe
+ -- This will be our local file descriptor at PIPE_FD
+ local pipe = uv.new_pipe(true)
+ local pipe_fd = tonumber(os.getenv("PIPE_FD"))
+ assert(uv.pipe_open(pipe, pipe_fd))
+
+ -- Configure the server handle
+ local server = uv.new_tcp()
+ local done = false
+ local function onconnection()
+ print("NOT ACCEPTING, already done")
+ if done then return end
+ local client = uv.new_tcp()
+ assert(uv.accept(server, client))
+ p("New TCP", client, "on", server)
+ p{client=client}
+ assert(uv.write(client, "BYE!\n"));
+ assert(uv.shutdown(client, function ()
+ uv.close(client)
+ uv.unref(server)
+ done = true
+ answer = 42
+ end))
+ end
+
+ -- Read the server handle from the parent
+ local function onread(err, data)
+ p("onread", {err=err,data=data})
+ assert(not err, err)
+ if uv.pipe_pending_count(pipe) > 0 then
+ local pending_type = uv.pipe_pending_type(pipe)
+ p("pending_type", pending_type)
+ assert(pending_type == "tcp")
+ assert(uv.accept(pipe, server))
+ assert(uv.listen(server, 0, onconnection))
+ p("Received server handle from parent process", server)
+ elseif data then
+ p("ondata", data)
+ else
+ p("onend", data)
+ end
+ end
+ uv.read_start(pipe, onread)
+
+ -- Start the event loop!
+ uv.run()
+
+ os.exit(answer)
+ end)
+
+ local client_code = string.dump(function ()
+ local dump = require('lib/utils').dump
+
+ local function print(...)
+ local n = select('#', ...)
+ local arguments = {...}
+ for i = 1, n do
+ arguments[i] = tostring(arguments[i])
+ end
+
+ local text = table.concat(arguments, "\t")
+ text = " " .. string.gsub(text, "\n", "\n ")
+ _G.print(text)
+ end
+
+ local function p(...)
+ local n = select('#', ...)
+ local arguments = { ... }
+
+ for i = 1, n do
+ arguments[i] = dump(arguments[i])
+ end
+
+ print(table.concat(arguments, "\t"))
+ end
+
+ local uv = require('luv')
+
+ local host = os.getenv("HOST")
+ local port = tonumber(os.getenv("PORT"))
+
+ local socket = uv.new_tcp()
+
+ assert(uv.tcp_connect(socket, host, port, function (err)
+ p("client connected", {err=err})
+ assert(not err, err)
+ end))
+
+ -- Start the event loop!
+ uv.run()
+ end)
+
+ test("tcp cluster", function (print, p, expect, uv)
+
+ local exepath = assert(uv.exepath())
+ local cpu_count = # assert(uv.cpu_info())
+ local left = cpu_count
+
+ local server = uv.new_tcp()
+ assert(uv.tcp_bind(server, "::1", 0))
+
+ local address = uv.tcp_getsockname(server)
+ p{server=server,address=address}
+
+ print("Master process bound to TCP port " .. address.port .. " on " .. address.ip)
+
+ local function spawnWorker()
+ local pipe = uv.new_pipe(true)
+ local input = uv.new_pipe(false)
+ local child, pid
+ child, pid = assert(uv.spawn(exepath, {
+ cwd = uv.cwd(),
+ stdio = {input,1,2,pipe},
+ env= {"PIPE_FD=3"}
+ }, expect(function (status, signal)
+ p("Worker exited", {status=status,signal=signal})
+ assert(status == 42, "worker should return 42")
+ assert(signal == 0)
+ left = left - 1
+ uv.close(child)
+ uv.close(input)
+ uv.close(pipe)
+ if left == 0 then
+ p("All workers are now dead")
+ uv.close(server)
+ end
+ end)))
+ p("Spawned worker", pid, "and sending handle", server)
+ assert(uv.write(input, worker_code))
+ assert(uv.write2(pipe, "123", server))
+ assert(uv.shutdown(input))
+ assert(uv.shutdown(pipe))
+ end
+
+ local function spawnClient()
+ local input = uv.new_pipe(false)
+ local child, pid
+ child, pid = assert(uv.spawn(exepath, {
+ stdio = {input,1,2},
+ cwd = uv.cwd(),
+ env= {
+ "HOST=" .. address.ip,
+ "PORT=" .. address.port,
+ }
+ }, expect(function (status, signal)
+ p("Client exited", {status=status,signal=signal})
+ assert(status == 0)
+ assert(signal == 0)
+ uv.close(child)
+ end, left)))
+ p("Spawned client", pid)
+ assert(uv.write(input, client_code))
+ assert(uv.shutdown(input))
+ uv.close(input)
+ end
+
+ -- Spawn a child process for each CPU core
+ for _ = 1, cpu_count do
+ spawnWorker()
+ end
+
+ -- Spawn the clients after a short delay
+ local timer = uv.new_timer()
+ uv.timer_start(timer, 1000, 0, expect(function ()
+ for _ = 1, cpu_count do
+ spawnClient()
+ end
+ uv.close(timer)
+ end))
+
+ end)
+end)
+
diff --git a/3rdparty/luv/tests/run.lua b/3rdparty/luv/tests/run.lua
new file mode 100644
index 00000000000..ea94e9bd58b
--- /dev/null
+++ b/3rdparty/luv/tests/run.lua
@@ -0,0 +1,33 @@
+-- Run this from the parent directory as
+--
+-- luajit tests/run.lua
+--
+
+local tap = require("lib/tap")
+local uv = require("luv")
+
+local isWindows
+if jit and jit.os then
+ -- Luajit provides explicit platform detection
+ isWindows = jit.os == "Windows"
+else
+ -- Normal lua will only have \ for path separator on windows.
+ isWindows = package.config:find("\\") and true or false
+end
+_G.isWindows = isWindows
+
+local req = uv.fs_scandir("tests")
+
+while true do
+ local name = uv.fs_scandir_next(req)
+ if not name then break end
+ local match = string.match(name, "^test%-(.*).lua$")
+ if match then
+ local path = "tests/test-" .. match
+ tap(match)
+ require(path)
+ end
+end
+
+-- run the tests!
+tap(true)
diff --git a/3rdparty/luv/tests/test-async.lua b/3rdparty/luv/tests/test-async.lua
new file mode 100644
index 00000000000..88527cdb88d
--- /dev/null
+++ b/3rdparty/luv/tests/test-async.lua
@@ -0,0 +1,32 @@
+return require('lib/tap')(function (test)
+
+ test("test pass async between threads", function(p, p, expect, uv)
+ local before = os.time()
+ local async
+ async = uv.new_async(expect(function (a,b,c)
+ p('in async notify callback')
+ p(a,b,c)
+ assert(a=='a')
+ assert(b==true)
+ assert(c==250)
+ uv.close(async)
+ end))
+ local args = {500, 'string', nil, false, 5, "helloworld",async}
+ local unpack = unpack or table.unpack
+ uv.new_thread(function(num,s,null,bool,five,hw,asy)
+ local uv = require'luv'
+ assert(type(num) == "number")
+ assert(type(s) == "string")
+ assert(null == nil)
+ assert(bool == false)
+ assert(five == 5)
+ assert(hw == 'helloworld')
+ assert(type(asy)=='userdata')
+ assert(uv.async_send(asy,'a',true,250)==0)
+ uv.sleep(1000)
+ end, unpack(args)):join()
+ local elapsed = (os.time() - before) * 1000
+ assert(elapsed >= 1000, "elapsed should be at least delay ")
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-conversions.lua b/3rdparty/luv/tests/test-conversions.lua
new file mode 100644
index 00000000000..f14056ddfb5
--- /dev/null
+++ b/3rdparty/luv/tests/test-conversions.lua
@@ -0,0 +1,6 @@
+return require('lib/tap')(function (test)
+ test("basic 64bit conversions", function (print, p, expect, uv)
+ assert(string.format("%x", 29913653248) == "6f6fe2000")
+ assert(string.format("%x", 32207650816) == "77fb9c000")
+ end)
+end)
diff --git a/3rdparty/luv/tests/test-dns.lua b/3rdparty/luv/tests/test-dns.lua
new file mode 100644
index 00000000000..c24adba7164
--- /dev/null
+++ b/3rdparty/luv/tests/test-dns.lua
@@ -0,0 +1,125 @@
+return require('lib/tap')(function (test)
+
+ test("Get all local http addresses", function (print, p, expect, uv)
+ assert(uv.getaddrinfo(nil, "http", nil, expect(function (err, res)
+ p(res, #res)
+ assert(not err, err)
+ assert(res[1].port == 80)
+ end)))
+ end)
+
+ test("Get all local http addresses sync", function (print, p, expect, uv)
+ local res = assert(uv.getaddrinfo(nil, "http"))
+ p(res, #res)
+ assert(res[1].port == 80)
+ end)
+
+ test("Get only ipv4 tcp adresses for luvit.io", function (print, p, expect, uv)
+ assert(uv.getaddrinfo("luvit.io", nil, {
+ socktype = "stream",
+ family = "inet",
+ }, expect(function (err, res)
+ assert(not err, err)
+ p(res, #res)
+ assert(#res == 1)
+ end)))
+ end)
+
+ -- FIXME: this test always fails on AppVeyor for some reason
+ if _G.isWindows and not os.getenv'APPVEYOR' then
+ test("Get only ipv6 tcp adresses for luvit.io", function (print, p, expect, uv)
+ assert(uv.getaddrinfo("luvit.io", nil, {
+ socktype = "stream",
+ family = "inet6",
+ }, expect(function (err, res)
+ assert(not err, err)
+ p(res, #res)
+ assert(#res == 1)
+ end)))
+ end)
+ end
+
+ test("Get ipv4 and ipv6 tcp adresses for luvit.io", function (print, p, expect, uv)
+ assert(uv.getaddrinfo("luvit.io", nil, {
+ socktype = "stream",
+ }, expect(function (err, res)
+ assert(not err, err)
+ p(res, #res)
+ assert(#res > 0)
+ end)))
+ end)
+
+ test("Get all adresses for luvit.io", function (print, p, expect, uv)
+ assert(uv.getaddrinfo("luvit.io", nil, nil, expect(function (err, res)
+ assert(not err, err)
+ p(res, #res)
+ assert(#res > 0)
+ end)))
+ end)
+
+ test("Lookup local ipv4 address", function (print, p, expect, uv)
+ assert(uv.getnameinfo({
+ family = "inet",
+ }, expect(function (err, hostname, service)
+ p{err=err,hostname=hostname,service=service}
+ assert(not err, err)
+ assert(hostname)
+ assert(service)
+ end)))
+ end)
+
+ test("Lookup local ipv4 address sync", function (print, p, expect, uv)
+ local hostname, service = assert(uv.getnameinfo({
+ family = "inet",
+ }))
+ p{hostname=hostname,service=service}
+ assert(hostname)
+ assert(service)
+ end)
+
+ test("Lookup local 127.0.0.1 ipv4 address", function (print, p, expect, uv)
+ assert(uv.getnameinfo({
+ ip = "127.0.0.1",
+ }, expect(function (err, hostname, service)
+ p{err=err,hostname=hostname,service=service}
+ assert(not err, err)
+ assert(hostname)
+ assert(service)
+ end)))
+ end)
+
+ test("Lookup local ipv6 address", function (print, p, expect, uv)
+ assert(uv.getnameinfo({
+ family = "inet6",
+ }, expect(function (err, hostname, service)
+ p{err=err,hostname=hostname,service=service}
+ assert(not err, err)
+ assert(hostname)
+ assert(service)
+ end)))
+ end)
+
+ test("Lookup local ::1 ipv6 address", function (print, p, expect, uv)
+ assert(uv.getnameinfo({
+ ip = "::1",
+ }, expect(function (err, hostname, service)
+ p{err=err,hostname=hostname,service=service}
+ assert(not err, err)
+ assert(hostname)
+ assert(service)
+ end)))
+ end)
+
+ test("Lookup local port 80 service", function (print, p, expect, uv)
+ assert(uv.getnameinfo({
+ port = 80,
+ family = "inet6",
+ }, expect(function (err, hostname, service)
+ p{err=err,hostname=hostname,service=service}
+ assert(not err, err)
+ assert(hostname)
+ assert(service == "http")
+ end)))
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-fs.lua b/3rdparty/luv/tests/test-fs.lua
new file mode 100644
index 00000000000..4bfd67e6578
--- /dev/null
+++ b/3rdparty/luv/tests/test-fs.lua
@@ -0,0 +1,90 @@
+return require('lib/tap')(function (test)
+
+ test("read a file sync", function (print, p, expect, uv)
+ local fd = assert(uv.fs_open('README.md', 'r', tonumber('644', 8)))
+ p{fd=fd}
+ local stat = assert(uv.fs_fstat(fd))
+ p{stat=stat}
+ local chunk = assert(uv.fs_read(fd, stat.size, 0))
+ assert(#chunk == stat.size)
+ assert(uv.fs_close(fd))
+ end)
+
+ test("read a file async", function (print, p, expect, uv)
+ uv.fs_open('README.md', 'r', tonumber('644', 8), expect(function (err, fd)
+ assert(not err, err)
+ p{fd=fd}
+ uv.fs_fstat(fd, expect(function (err, stat)
+ assert(not err, err)
+ p{stat=stat}
+ uv.fs_read(fd, stat.size, 0, expect(function (err, chunk)
+ assert(not err, err)
+ p{chunk=#chunk}
+ assert(#chunk == stat.size)
+ uv.fs_close(fd, expect(function (err)
+ assert(not err, err)
+ end))
+ end))
+ end))
+ end))
+ end)
+
+ test("fs.write", function (print, p, expect, uv)
+ local path = "_test_"
+ local fd = assert(uv.fs_open(path, "w", 438))
+ uv.fs_write(fd, "Hello World\n", -1)
+ uv.fs_write(fd, {"with\n", "more\n", "lines\n"}, -1)
+ uv.fs_close(fd)
+ uv.fs_unlink(path)
+ end)
+
+ test("fs.stat sync", function (print, p, expect, uv)
+ local stat = assert(uv.fs_stat("README.md"))
+ assert(stat.size)
+ end)
+
+ test("fs.stat async", function (print, p, expect, uv)
+ assert(uv.fs_stat("README.md", expect(function (err, stat)
+ assert(not err, err)
+ assert(stat.size)
+ end)))
+ end)
+
+ test("fs.stat sync error", function (print, p, expect, uv)
+ local stat, err, code = uv.fs_stat("BAD_FILE!")
+ p{err=err,code=code,stat=stat}
+ assert(not stat)
+ assert(err)
+ assert(code == "ENOENT")
+ end)
+
+ test("fs.stat async error", function (print, p, expect, uv)
+ assert(uv.fs_stat("BAD_FILE@", expect(function (err, stat)
+ p{err=err,stat=stat}
+ assert(err)
+ assert(not stat)
+ end)))
+ end)
+
+ test("fs.scandir", function (print, p, expect, uv)
+ local req = uv.fs_scandir('.')
+ local function iter()
+ return uv.fs_scandir_next(req)
+ end
+ for name, ftype in iter do
+ p{name=name, ftype=ftype}
+ assert(name)
+ -- ftype is not available in all filesystems; for example it's
+ -- provided for HFS+ (OSX), NTFS (Windows) but not for ext4 (Linux).
+ end
+ end)
+
+ test("fs.realpath", function (print, p, expect, uv)
+ p(assert(uv.fs_realpath('.')))
+ assert(uv.fs_realpath('.', expect(function (err, path)
+ assert(not err, err)
+ p(path)
+ end)))
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-leaks.lua b/3rdparty/luv/tests/test-leaks.lua
new file mode 100644
index 00000000000..06c6e49a0cf
--- /dev/null
+++ b/3rdparty/luv/tests/test-leaks.lua
@@ -0,0 +1,186 @@
+return require('lib/tap')(function (test)
+
+ local function bench(uv, p, count, fn)
+ collectgarbage()
+ local before
+ local notify = count / 8
+ for i = 1, count do
+ fn()
+ if i % notify == 0 then
+ uv.run()
+ collectgarbage()
+ local now = uv.resident_set_memory()
+ if not before then before = now end
+ p(i, now)
+ end
+ end
+ uv.run()
+ collectgarbage()
+ local after = uv.resident_set_memory()
+ p{
+ before = before,
+ after = after,
+ }
+ assert(after < before * 1.5)
+ end
+
+ test("fs-write", function (print, p, expect, uv)
+ bench(uv, p, 0x7000, function ()
+ local path = "_test_"
+ local fd = assert(uv.fs_open(path, "w", 438))
+ uv.fs_write(fd, "Hello World\n", -1)
+ uv.fs_write(fd, {"with\n", "more\n", "lines\n"}, -1)
+ uv.fs_close(fd)
+ uv.fs_unlink(path)
+ end)
+ end)
+
+ test("lots-o-timers", function (print, p, expect, uv)
+ bench(uv, p, 0x10000, function ()
+ local timer = uv.new_timer()
+ uv.close(timer)
+ end)
+ end)
+
+ test("lots-o-timers with canceled callbacks", function (print, p, expect, uv)
+ bench(uv, p, 0x10000, function ()
+ local timer = uv.new_timer()
+ uv.timer_start(timer, 100, 100, function ()
+ end)
+ uv.timer_stop(timer)
+ uv.close(timer, function ()
+ end)
+ uv.run()
+ end)
+ end)
+
+ test("lots-o-timers with real timeouts", function (print, p, expect, uv)
+ bench(uv, p, 0x500, function ()
+ local timer = uv.new_timer()
+ uv.timer_start(timer, 10, 0, expect(function ()
+ uv.timer_stop(timer)
+ uv.close(timer, function ()
+ end)
+ end))
+ end)
+ end)
+
+ test("reading file async", function (print, p, expect, uv)
+ local mode = tonumber("644", 8)
+ bench(uv, p, 0x500, function ()
+ local onOpen, onStat, onRead, onClose
+ local fd, stat
+
+ onOpen = expect(function (err, result)
+ assert(not err, err)
+ fd = result
+ uv.fs_fstat(fd, onStat)
+ end)
+
+ onStat = expect(function (err, result)
+ assert(not err, err)
+ stat = result
+ uv.fs_read(fd, stat.size, 0, onRead)
+ end)
+
+ onRead = expect(function (err, data)
+ assert(not err, err)
+ assert(#data == stat.size)
+ uv.fs_close(fd, onClose)
+ end)
+
+ onClose = expect(function (err)
+ assert(not err, err)
+ end)
+
+ assert(uv.fs_open("README.md", "r", mode, onOpen))
+ end)
+ end)
+
+ test("reading file sync", function (print, p, expect, uv)
+ local mode = tonumber("644", 8)
+ bench(uv, p, 0x2000, function ()
+ local fd = assert(uv.fs_open("README.md", "r", mode))
+ local stat = assert(uv.fs_fstat(fd))
+ local data = assert(uv.fs_read(fd, stat.size, 0))
+ assert(#data == stat.size)
+ assert(uv.fs_close(fd))
+ end)
+ end)
+
+ test("invalid file", function (print, p, expect, uv)
+ local mode = tonumber("644", 8)
+ bench(uv, p, 0x1500, function ()
+ local req = uv.fs_open("BAD_FILE", "r", mode, expect(function (err, fd)
+ assert(not fd)
+ assert(err)
+ end))
+ end)
+ end)
+
+ test("invalid file sync", function (print, p, expect, uv)
+ local mode = tonumber("644", 8)
+ bench(uv, p, 0x20000, function ()
+ local fd, err = uv.fs_open("BAD_FILE", "r", mode)
+ assert(not fd)
+ assert(err)
+ end)
+ end)
+
+ test("invalid spawn args", function (print, p, expect, uv)
+ -- Regression test for #73
+ bench(uv, p, 0x10000, function ()
+ local ret, err = pcall(function ()
+ return uv.spawn("ls", {
+ args = {"-l", "-h"},
+ stdio = {0, 1, 2},
+ env = {"EXTRA=true"},
+ gid = false, -- Should be integer
+ })
+ end)
+ assert(not ret)
+ assert(err)
+ end)
+ end)
+
+ test("stream writing with string and array", function (print, p, expect, uv)
+ local port = 0
+ local server = uv.new_tcp()
+ local data
+ local count = 0x800
+ server:unref()
+ server:bind("127.0.0.1", port)
+ server:listen(128, expect(function (err)
+ assert(not err, err)
+ local client = uv.new_tcp()
+ server:accept(client)
+ client:write(data)
+ client:read_start(expect(function (err, data)
+ assert(not err, err)
+ assert(data)
+ client:close()
+ end))
+ end, count))
+ local address = server:getsockname()
+ bench(uv, p, count, function ()
+ data = string.rep("Hello", 500)
+ local socket = uv.new_tcp()
+ socket:connect(address.ip, address.port, expect(function (err)
+ assert(not err, err)
+ socket:read_start(expect(function (err, chunk)
+ assert(not err, err)
+ assert(chunk)
+ local data = {}
+ for i = 0, 100 do
+ data[i + 1] = string.rep(string.char(i), 100)
+ end
+ socket:write(data)
+ socket:close()
+ end))
+ end))
+ uv.run()
+ end)
+ server:close()
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-misc.lua b/3rdparty/luv/tests/test-misc.lua
new file mode 100644
index 00000000000..72a7b30785e
--- /dev/null
+++ b/3rdparty/luv/tests/test-misc.lua
@@ -0,0 +1,85 @@
+return require('lib/tap')(function (test)
+
+ test("uv.guess_handle", function (print, p, expect, uv)
+ local types = {
+ [0] = assert(uv.guess_handle(0)),
+ assert(uv.guess_handle(1)),
+ assert(uv.guess_handle(2)),
+ }
+ p("stdio fd types", types)
+ end)
+
+ test("uv.version and uv.version_string", function (print, p, expect, uv)
+ local version = assert(uv.version())
+ local version_string = assert(uv.version_string())
+ p{version=version, version_string=version_string}
+ assert(type(version) == "number")
+ assert(type(version_string) == "string")
+ end)
+
+ test("memory size", function (print, p, expect, uv)
+ local rss = uv.resident_set_memory()
+ local total = uv.get_total_memory()
+ local free = uv.get_free_memory()
+ p{rss=rss,total=total,free=free}
+ assert(rss < total)
+ end)
+
+ test("uv.uptime", function (print, p, expect, uv)
+ local uptime = assert(uv.uptime())
+ p{uptime=uptime}
+ end)
+
+ test("uv.getrusage", function (print, p, expect, uv)
+ local rusage = assert(uv.getrusage())
+ p(rusage)
+ end)
+
+ test("uv.cpu_info", function (print, p, expect, uv)
+ local info = assert(uv.cpu_info())
+ p(info)
+ end)
+
+ test("uv.interface_addresses", function (print, p, expect, uv)
+ local addresses = assert(uv.interface_addresses())
+ for name, info in pairs(addresses) do
+ p(name, addresses[name])
+ end
+ end)
+
+ test("uv.loadavg", function (print, p, expect, uv)
+ local avg = {assert(uv.loadavg())}
+ p(avg)
+ assert(#avg == 3)
+ end)
+
+ test("uv.exepath", function (print, p, expect, uv)
+ local path = assert(uv.exepath())
+ p(path)
+ end)
+
+ test("uv.os_homedir", function (print, p, expect, uv)
+ local path = assert(uv.os_homedir())
+ p(path)
+ end)
+
+ test("uv.cwd and uv.chdir", function (print, p, expect, uv)
+ local old = assert(uv.cwd())
+ p(old)
+ assert(uv.chdir("/"))
+ local cwd = assert(uv.cwd())
+ p(cwd)
+ assert(cwd ~= old)
+ assert(uv.chdir(old))
+ end)
+
+ test("uv.hrtime", function (print, p, expect, uv)
+ local time = assert(uv.hrtime())
+ p(time)
+ end)
+
+ test("test_getpid", function (print, p, expect, uv)
+ assert(uv.getpid())
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-prepare-check-idle-async.lua b/3rdparty/luv/tests/test-prepare-check-idle-async.lua
new file mode 100644
index 00000000000..389c2633efb
--- /dev/null
+++ b/3rdparty/luv/tests/test-prepare-check-idle-async.lua
@@ -0,0 +1,49 @@
+return require('lib/tap')(function (test)
+
+ test("simple prepare", function (print, p, expect, uv)
+ local prepare = uv.new_prepare()
+ uv.prepare_start(prepare, expect(function ()
+ p("prepare", prepare)
+ uv.prepare_stop(prepare)
+ uv.close(prepare, expect(function ()
+ end))
+ end))
+ end)
+
+ test("simple check", function (print, p, expect, uv)
+ local check = uv.new_check()
+ uv.check_start(check, expect(function ()
+ p("check", check)
+ uv.check_stop(check)
+ uv.close(check, expect(function ()
+ end))
+ end))
+
+ -- Trigger with a timer
+ local timer = uv.new_timer()
+ uv.timer_start(timer, 10, 0, expect(function()
+ p("timeout", timer)
+ uv.timer_stop(timer)
+ uv.close(timer)
+ end))
+ end)
+
+ test("simple idle", function (print, p, expect, uv)
+ local idle = uv.new_idle()
+ uv.idle_start(idle, expect(function ()
+ p("idle", idle)
+ uv.idle_stop(idle)
+ uv.close(idle, expect(function ()
+ end))
+ end))
+ end)
+
+ test("simple async", function (print, p, expect, uv)
+ local async
+ async = uv.new_async(expect(function ()
+ uv.close(async)
+ end))
+ uv.async_send(async)
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-process.lua b/3rdparty/luv/tests/test-process.lua
new file mode 100644
index 00000000000..4d2b6fbfdab
--- /dev/null
+++ b/3rdparty/luv/tests/test-process.lua
@@ -0,0 +1,101 @@
+return require('lib/tap')(function (test)
+
+ test("test disable_stdio_inheritance", function (print, p, expect, uv)
+ uv.disable_stdio_inheritance()
+ end)
+
+ test("process stdout", function (print, p, expect, uv)
+ local stdout = uv.new_pipe(false)
+
+ local handle, pid
+ handle, pid = uv.spawn(uv.exepath(), {
+ args = {"-e", "print 'Hello World'"},
+ stdio = {nil, stdout},
+ }, expect(function (code, signal)
+ p("exit", {code=code, signal=signal})
+ uv.close(handle)
+ end))
+
+ p{
+ handle=handle,
+ pid=pid
+ }
+
+ uv.read_start(stdout, expect(function (err, chunk)
+ p("stdout", {err=err,chunk=chunk})
+ assert(not err, err)
+ uv.close(stdout)
+ end))
+
+ end)
+
+ if _G.isWindows then return end
+
+ test("spawn and kill by pid", function (print, p, expect, uv)
+ local handle, pid
+ handle, pid = uv.spawn("sleep", {
+ args = {1},
+ }, expect(function (status, signal)
+ p("exit", handle, {status=status,signal=signal})
+ assert(status == 0)
+ assert(signal == 2)
+ uv.close(handle)
+ end))
+ p{handle=handle,pid=pid}
+ uv.kill(pid, "sigint")
+ end)
+
+ test("spawn and kill by handle", function (print, p, expect, uv)
+ local handle, pid
+ handle, pid = uv.spawn("sleep", {
+ args = {1},
+ }, expect(function (status, signal)
+ p("exit", handle, {status=status,signal=signal})
+ assert(status == 0)
+ assert(signal == 15)
+ uv.close(handle)
+ end))
+ p{handle=handle,pid=pid}
+ uv.process_kill(handle, "sigterm")
+ end)
+
+ test("invalid command", function (print, p, expect, uv)
+ local handle, err
+ handle, err = uv.spawn("ksjdfksjdflkjsflksdf", {}, function(exit, code)
+ assert(false)
+ end)
+ assert(handle == nil)
+ assert(err)
+ end)
+
+ test("process stdio", function (print, p, expect, uv)
+ local stdin = uv.new_pipe(false)
+ local stdout = uv.new_pipe(false)
+
+ local handle, pid
+ handle, pid = uv.spawn("cat", {
+ stdio = {stdin, stdout},
+ }, expect(function (code, signal)
+ p("exit", {code=code, signal=signal})
+ uv.close(handle)
+ end))
+
+ p{
+ handle=handle,
+ pid=pid
+ }
+
+ uv.read_start(stdout, expect(function (err, chunk)
+ p("stdout", {err=err,chunk=chunk})
+ assert(not err, err)
+ uv.close(stdout)
+ end))
+
+ uv.write(stdin, "Hello World")
+ uv.shutdown(stdin, expect(function ()
+ uv.close(stdin)
+ end))
+
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-sigchld-after-lua_close.sh b/3rdparty/luv/tests/test-sigchld-after-lua_close.sh
new file mode 100644
index 00000000000..e7d22d3df36
--- /dev/null
+++ b/3rdparty/luv/tests/test-sigchld-after-lua_close.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Verifies that luv will cleanup libuv process handles correctly even if
+# not done by "userspace".
+# Details: https://github.com/luvit/luv/issues/193
+
+# This test modifies one of the examples to skip libuv process cleanup,
+# purposely making it leave SIGCHLD signal handler.
+#
+patch -p1 << "EOF"
+diff --git a/examples/talking-to-children.lua b/examples/talking-to-children.lua
+index 10a53ef..6c6c53f 100644
+--- a/examples/talking-to-children.lua
++++ b/examples/talking-to-children.lua
+@@ -41,7 +41,3 @@ uv.read_start(stdout, onread)
+ uv.read_start(stderr, onread)
+ uv.write(stdin, "Hello World")
+ uv.shutdown(stdin, onshutdown)
+-
+-uv.run()
+-uv.walk(uv.close)
+-uv.run()
+EOF
+
+# It also requires a patched lua standalone interpreter that sends SIGCHLD to
+# itself after calling lua_close, which would have freed all memory of the libuv
+# event loop associated with the lua state.
+(
+cd deps/lua
+patch -p1 << "EOF"
+diff --git a/src/lua.c b/src/lua.c
+index 7a47582..4dc19d5 100644
+--- a/src/lua.c
++++ b/src/lua.c
+@@ -608,6 +608,7 @@ int main (int argc, char **argv) {
+ result = lua_toboolean(L, -1); /* get result */
+ report(L, status);
+ lua_close(L);
++ kill(0, SIGCHLD);
+ return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
+ }
+EOF
+)
+
+WITH_LUA_ENGINE=Lua make
+./build/lua examples/talking-to-children.lua
diff --git a/3rdparty/luv/tests/test-signal.lua b/3rdparty/luv/tests/test-signal.lua
new file mode 100644
index 00000000000..c05db77c888
--- /dev/null
+++ b/3rdparty/luv/tests/test-signal.lua
@@ -0,0 +1,40 @@
+local child_code = string.dump(function ()
+ local uv = require('luv')
+ local signal = uv.new_signal()
+ uv.ref(signal)
+ uv.signal_start(signal, "sigint", function ()
+ uv.unref(signal)
+ end)
+ uv.run()
+ os.exit(7)
+end)
+
+return require('lib/tap')(function (test)
+
+ if _G.isWindows then return end
+
+ test("Catch SIGINT", function (print, p, expect, uv)
+ local child, pid
+ local input = uv.new_pipe(false)
+ child, pid = assert(uv.spawn(uv.exepath(), {
+ args = {"-"},
+ -- cwd = uv.cwd(),
+ stdio = {input,1,2}
+ }, expect(function (code, signal)
+ p("exit", {pid=pid,code=code,signal=signal})
+ assert(code == 7)
+ assert(signal == 0)
+ uv.close(input)
+ uv.close(child)
+ end)))
+ uv.write(input, child_code)
+ uv.shutdown(input)
+ local timer = uv.new_timer()
+ uv.timer_start(timer, 200, 0, expect(function ()
+ print("Sending child SIGINT")
+ uv.process_kill(child, "sigint")
+ uv.close(timer)
+ end))
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-tcp.lua b/3rdparty/luv/tests/test-tcp.lua
new file mode 100644
index 00000000000..885d381ebce
--- /dev/null
+++ b/3rdparty/luv/tests/test-tcp.lua
@@ -0,0 +1,114 @@
+return require('lib/tap')(function (test)
+ test("basic tcp server and client", function (print, p, expect, uv)
+ local server = uv.new_tcp()
+ uv.tcp_bind(server, "::", 0)
+ uv.listen(server, 128, expect(function (err)
+ p("server on connection", server)
+ assert(not err, err)
+ uv.close(server)
+ end))
+
+ local address = uv.tcp_getsockname(server)
+ p{server=server,address=address}
+
+ local client = uv.new_tcp()
+ local req = uv.tcp_connect(client, "::1", address.port, expect(function (err)
+ p("client on connect", client, err)
+ assert(not err, err)
+ uv.shutdown(client, expect(function (err)
+ p("client on shutdown", client, err)
+ assert(not err, err)
+ uv.close(client, expect(function ()
+ p("client on close", client)
+ end))
+ end))
+ end))
+ p{client=client,req=req}
+ end)
+
+ test("tcp echo server and client", function (print, p, expect, uv)
+ local server = uv.new_tcp()
+ assert(uv.tcp_bind(server, "127.0.0.1", 0))
+ assert(uv.listen(server, 1, expect(function ()
+ local client = uv.new_tcp()
+ assert(uv.accept(server, client))
+ assert(uv.read_start(client, expect(function (err, data)
+ p("server read", {err=err,data=data})
+ assert(not err, err)
+ if data then
+ assert(uv.write(client, data))
+ else
+ assert(uv.read_stop(client))
+ uv.close(client)
+ uv.close(server)
+ end
+ end, 2)))
+ end)))
+
+ local address = uv.tcp_getsockname(server)
+ p{server=server,address=address}
+
+ local socket = assert(uv.new_tcp())
+ assert(uv.tcp_connect(socket, "127.0.0.1", address.port, expect(function ()
+ assert(uv.read_start(socket, expect(function (err, data)
+ p("client read", {err=err,data=data})
+ assert(not err, err)
+ assert(uv.read_stop(socket))
+ uv.close(socket)
+ end)))
+ local req = assert(uv.write(socket, "Hello", function (err)
+ p("client onwrite", socket, err)
+ assert(not err, err)
+ end))
+ p{socket=socket,req=req}
+ end)))
+ end)
+
+ test("tcp echo server and client with methods", function (print, p, expect, uv)
+ local server = uv.new_tcp()
+ assert(server:bind("127.0.0.1", 0))
+ assert(server:listen(1, expect(function ()
+ local client = uv.new_tcp()
+ assert(server:accept(client))
+ assert(client:read_start(expect(function (err, data)
+ p("server read", {err=err,data=data})
+ assert(not err, err)
+ if data then
+ assert(client:write(data))
+ else
+ assert(client:read_stop())
+ client:close()
+ server:close()
+ end
+ end, 2)))
+ end)))
+
+ local address = server:getsockname()
+ p{server=server,address=address}
+
+ local socket = assert(uv.new_tcp())
+ assert(socket:connect("127.0.0.1", address.port, expect(function ()
+ assert(socket:read_start(expect(function (err, data)
+ p("client read", {err=err,data=data})
+ assert(not err, err)
+ assert(socket:read_stop())
+ socket:close()
+ end)))
+ local req = assert(socket:write("Hello", function (err)
+ p("client onwrite", socket, err)
+ assert(not err, err)
+ end))
+ p{socket=socket,req=req}
+ end)))
+ end)
+
+ test("tcp invalid ip address", function (print, p, expect, uv)
+ local ip = '127.0.0.100005'
+ local server = uv.new_tcp()
+ local status, err = pcall(function() uv.tcp_bind(server, ip, 1000) end)
+ assert(not status)
+ p(err)
+ assert(err:find(ip))
+ uv.close(server)
+ end)
+end)
diff --git a/3rdparty/luv/tests/test-thread.lua b/3rdparty/luv/tests/test-thread.lua
new file mode 100644
index 00000000000..838b51e4fff
--- /dev/null
+++ b/3rdparty/luv/tests/test-thread.lua
@@ -0,0 +1,47 @@
+return require('lib/tap')(function (test)
+
+ test("test thread create", function(print, p, expect, uv)
+ local delay = 1000
+ local before = os.time()
+ local thread = uv.new_thread(function(delay)
+ require('luv').sleep(delay)
+ end,delay)
+ uv.thread_join(thread)
+ local elapsed = (os.time() - before) * 1000
+ p({
+ delay = delay,
+ elapsed = elapsed
+ })
+ assert(elapsed >= delay, "elapsed should be at least delay ")
+ end)
+
+ test("test thread create with arguments", function(print, p, expect, uv)
+ local before = os.time()
+ local args = {500, 'string', nil, false, 5, "helloworld"}
+ local unpack = unpack or table.unpack
+ uv.new_thread(function(num,s,null,bool,five,hw)
+ assert(type(num) == "number")
+ assert(type(s) == "string")
+ assert(null == nil)
+ assert(bool == false)
+ assert(five == 5)
+ assert(hw == 'helloworld')
+ require('luv').sleep(1000)
+ end, unpack(args)):join()
+ local elapsed = (os.time() - before) * 1000
+ assert(elapsed >= 1000, "elapsed should be at least delay ")
+ end)
+
+ test("test thread sleep msecs in main thread", function(print, p, expect, uv)
+ local delay = 1000
+ local before = os.time()
+ uv.sleep(delay)
+ local elapsed = (os.time() - before) * 1000
+ p({
+ delay = delay,
+ elapsed = elapsed
+ })
+ assert(elapsed >= delay, "elapsed should be at least delay ")
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-timer.lua b/3rdparty/luv/tests/test-timer.lua
new file mode 100644
index 00000000000..f9eb9d89c5f
--- /dev/null
+++ b/3rdparty/luv/tests/test-timer.lua
@@ -0,0 +1,87 @@
+return require('lib/tap')(function (test)
+
+ -- This tests using timers for a simple timeout.
+ -- It also tests the handle close callback and
+ test("simple timeout", function (print, p, expect, uv)
+ local timer = uv.new_timer()
+ local function onclose()
+ p("closed", timer)
+ end
+ local function ontimeout()
+ p("timeout", timer)
+ uv.close(timer, expect(onclose))
+ end
+ uv.timer_start(timer, 10, 0, expect(ontimeout))
+ end)
+
+ -- This is like the previous test, but using repeat.
+ test("simple interval", function (print, p, expect, uv)
+ local timer = uv.new_timer()
+ local count = 3
+ local onclose = expect(function ()
+ p("closed", timer)
+ end)
+ local function oninterval()
+ p("interval", timer)
+ count = count - 1
+ if count == 0 then
+ uv.close(timer, onclose)
+ end
+ end
+ uv.timer_start(timer, 10, 10, oninterval)
+ end)
+
+ -- Test two concurrent timers
+ -- There is a small race condition, but there are 100ms of wiggle room.
+ -- 400ms is halfway between 100+200ms and 100+400ms
+ test("timeout with interval", function (print, p, expect, uv)
+ local a = uv.new_timer()
+ local b = uv.new_timer()
+ uv.timer_start(a, 400, 0, expect(function ()
+ p("timeout", a)
+ uv.timer_stop(b)
+ uv.close(a)
+ uv.close(b)
+ end))
+ uv.timer_start(b, 100, 200, expect(function ()
+ p("interval", b)
+ end, 2))
+ end)
+
+ -- This advanced test uses the rest of the uv_timer_t functions
+ -- to create an interval that shrinks over time.
+ test("shrinking interval", function (print, p, expect, uv)
+ local timer = uv.new_timer()
+ uv.timer_start(timer, 10, 0, expect(function ()
+ local r = uv.timer_get_repeat(timer)
+ p("interval", timer, r)
+ if r == 0 then
+ uv.timer_set_repeat(timer, 8)
+ uv.timer_again(timer)
+ elseif r == 2 then
+ uv.timer_stop(timer)
+ uv.close(timer)
+ else
+ uv.timer_set_repeat(timer, r / 2)
+ end
+ end, 4))
+ end)
+
+ test("shrinking interval using methods", function (print, p, expect, uv)
+ local timer = uv.new_timer()
+ timer:start(10, 0, expect(function ()
+ local r = timer:get_repeat()
+ p("interval", timer, r)
+ if r == 0 then
+ timer:set_repeat(8)
+ timer:again()
+ elseif r == 2 then
+ timer:stop()
+ timer:close()
+ else
+ timer:set_repeat(r / 2)
+ end
+ end, 4))
+ end)
+
+end)
diff --git a/3rdparty/luv/tests/test-work.lua b/3rdparty/luv/tests/test-work.lua
new file mode 100644
index 00000000000..3a98b15e6bc
--- /dev/null
+++ b/3rdparty/luv/tests/test-work.lua
@@ -0,0 +1,48 @@
+return require('lib/tap')(function (test)
+ test("test threadpool", function(print,p,expect,_uv)
+ p('Please be patient, the test cost a lots of time')
+ local count = 1000 --for memleaks dected
+ local step = 0
+ local ctx
+ ctx = _uv.new_work(
+ function(n,s) --work,in threadpool
+ local uv = require('luv')
+ local t = uv.thread_self()
+ uv.sleep(100)
+ return n,n*n, tostring(uv.thread_self()),s
+ end,
+ function(n,r,id, s)
+ assert(n*n==r)
+ if step < count then
+ _uv.queue_work(ctx,n,s)
+ step = step + 1
+ if (step % 100==0) then
+ p(string.format('run %d%%', math.floor(step*100/count)))
+ end
+ end
+ end --after work, in loop thread
+ )
+ local ls = string.rep('-',4096)
+
+ _uv.queue_work(ctx,2,ls)
+ _uv.queue_work(ctx,4,ls)
+ _uv.queue_work(ctx,6,ls)
+ _uv.queue_work(ctx,-2,ls)
+ _uv.queue_work(ctx,-11,ls)
+ _uv.queue_work(ctx,2,ls)
+ _uv.queue_work(ctx,4,ls)
+ _uv.queue_work(ctx,6,ls)
+ _uv.queue_work(ctx,-2,ls)
+ _uv.queue_work(ctx,-11,ls)
+ _uv.queue_work(ctx,2,ls)
+ _uv.queue_work(ctx,4,ls)
+ _uv.queue_work(ctx,6,ls)
+ _uv.queue_work(ctx,-2,ls)
+ _uv.queue_work(ctx,-11,ls)
+ _uv.queue_work(ctx,2,ls)
+ _uv.queue_work(ctx,4,ls)
+ _uv.queue_work(ctx,6,ls)
+ _uv.queue_work(ctx,-2,ls)
+ _uv.queue_work(ctx,-11,ls)
+ end)
+end)
diff --git a/3rdparty/rapidjson/.gitignore b/3rdparty/rapidjson/.gitignore
new file mode 100644
index 00000000000..2c412c2bba9
--- /dev/null
+++ b/3rdparty/rapidjson/.gitignore
@@ -0,0 +1,24 @@
+/bin/*
+!/bin/data
+!/bin/encodings
+!/bin/jsonchecker
+!/bin/types
+/build
+/doc/html
+/doc/doxygen_*.db
+*.a
+
+# Temporary files created during CMake build
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+CTestTestfile.cmake
+Makefile
+RapidJSON*.cmake
+RapidJSON.pc
+Testing
+/googletest
+install_manifest.txt
+Doxyfile
+DartConfiguration.tcl
+*.nupkg
diff --git a/3rdparty/rapidjson/.gitmodules b/3rdparty/rapidjson/.gitmodules
new file mode 100644
index 00000000000..8e9d1f376c2
--- /dev/null
+++ b/3rdparty/rapidjson/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "thirdparty/gtest"]
+ path = thirdparty/gtest
+ url = https://chromium.googlesource.com/external/googletest.git
diff --git a/3rdparty/rapidjson/.travis.yml b/3rdparty/rapidjson/.travis.yml
new file mode 100644
index 00000000000..78fe1d54615
--- /dev/null
+++ b/3rdparty/rapidjson/.travis.yml
@@ -0,0 +1,54 @@
+language: cpp
+
+compiler:
+ - clang
+ - gcc
+
+env:
+ matrix:
+ - CONF=debug ARCH=x86_64 CXX11=ON
+ - CONF=release ARCH=x86_64 CXX11=ON
+ - CONF=debug ARCH=x86 CXX11=ON
+ - CONF=release ARCH=x86 CXX11=ON
+ - CONF=debug ARCH=x86_64 CXX11=OFF
+ - CONF=debug ARCH=x86 CXX11=OFF
+ global:
+ - ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit
+ - ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit
+ - GITHUB_REPO='miloyip/rapidjson'
+ - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
+
+before_install:
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq cmake valgrind
+ - sudo apt-get --no-install-recommends install doxygen # Don't install LaTeX stuffs
+ - if [ "$ARCH" = "x86" ]; then sudo apt-get install -qq g++-multilib libc6-dbg:i386; fi
+ - if [ "$CC" = "gcc" ] && [ "$CONF" = "debug" ]; then sudo pip install cpp-coveralls; export GCOV_FLAGS='--coverage'; fi
+
+install: true
+
+before_script:
+# hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
+# exposed by merging PR#163 (using -march=native)
+ - sed -i "s/-march=native//" CMakeLists.txt
+ - mkdir build
+ - >
+ eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ;
+ (cd build && cmake
+ -DRAPIDJSON_HAS_STDSTRING=ON
+ -DRAPIDJSON_BUILD_CXX11=$CXX11
+ -DCMAKE_VERBOSE_MAKEFILE=ON
+ -DCMAKE_BUILD_TYPE=$CONF
+ -DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS"
+ -DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS
+ ..)
+
+script:
+ - cd build
+ - make tests
+ - make examples
+ - ctest -V `[ "$CONF" = "release" ] || echo "-E perftest"`
+ - make travis_doc
+
+after_success:
+ - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
diff --git a/3rdparty/rapidjson/CHANGELOG.md b/3rdparty/rapidjson/CHANGELOG.md
new file mode 100644
index 00000000000..8ad9b3c351f
--- /dev/null
+++ b/3rdparty/rapidjson/CHANGELOG.md
@@ -0,0 +1,79 @@
+# Change Log
+All notable changes to this project will be documented in this file.
+This project adheres to [Semantic Versioning](http://semver.org/).
+
+## [Unreleased]
+
+## [1.0.2] - 2015-05-14
+
+### Added
+* Add Value::XXXMember(...) overloads for std::string (#335)
+
+### Fixed
+* Include rapidjson.h for all internal/error headers.
+* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342)
+* Fix alignment of 64bit platforms (#328)
+* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4)
+
+### Changed
+* CMakeLists for include as a thirdparty in projects (#334, #337)
+* Change Document::ParseStream() to use stack allocator for Reader (ffbe38614732af8e0b3abdc8b50071f386a4a685)
+
+## [1.0.1] - 2015-04-25
+
+### Added
+* Changelog following [Keep a CHANGELOG](https://github.com/olivierlacan/keep-a-changelog) suggestions.
+
+### Fixed
+* Parsing of some numbers (e.g. "1e-00011111111111") causing assertion (#314).
+* Visual C++ 32-bit compilation error in `diyfp.h` (#317).
+
+## [1.0.0] - 2015-04-22
+
+### Added
+* 100% [Coverall](https://coveralls.io/r/miloyip/rapidjson?branch=master) coverage.
+* Version macros (#311)
+
+### Fixed
+* A bug in trimming long number sequence (4824f12efbf01af72b8cb6fc96fae7b097b73015).
+* Double quote in unicode escape (#288).
+* Negative zero roundtrip (double only) (#289).
+* Standardize behavior of `memcpy()` and `malloc()` (0c5c1538dcfc7f160e5a4aa208ddf092c787be5a, #305, 0e8bbe5e3ef375e7f052f556878be0bd79e9062d).
+
+### Removed
+* Remove an invalid `Document::ParseInsitu()` API (e7f1c6dd08b522cfcf9aed58a333bd9a0c0ccbeb).
+
+## 1.0-beta - 2015-04-8
+
+### Added
+* RFC 7159 (#101)
+* Optional Iterative Parser (#76)
+* Deep-copy values (#20)
+* Error code and message (#27)
+* ASCII Encoding (#70)
+* `kParseStopWhenDoneFlag` (#83)
+* `kParseFullPrecisionFlag` (881c91d696f06b7f302af6d04ec14dd08db66ceb)
+* Add `Key()` to handler concept (#134)
+* C++11 compatibility and support (#128)
+* Optimized number-to-string and vice versa conversions (#137, #80)
+* Short-String Optimization (#131)
+* Local stream optimization by traits (#32)
+* Travis & Appveyor Continuous Integration, with Valgrind verification (#24, #242)
+* Redo all documentation (English, Simplified Chinese)
+
+### Changed
+* Copyright ownership transfered to THL A29 Limited (a Tencent company).
+* Migrating from Premake to CMAKE (#192)
+* Resolve all warning reports
+
+### Removed
+* Remove other JSON libraries for performance comparison (#180)
+
+## 0.11 - 2012-11-16
+
+## 0.1 - 2011-11-18
+
+[Unreleased]: https://github.com/miloyip/rapidjson/compare/v1.0.2...HEAD
+[1.0.2]: https://github.com/miloyip/rapidjson/compare/v1.0.1...v1.0.2
+[1.0.1]: https://github.com/miloyip/rapidjson/compare/v1.0.0...v1.0.1
+[1.0.0]: https://github.com/miloyip/rapidjson/compare/v1.0-beta...v1.0.0
diff --git a/3rdparty/rapidjson/CMakeLists.txt b/3rdparty/rapidjson/CMakeLists.txt
new file mode 100644
index 00000000000..fcacbd3c5ec
--- /dev/null
+++ b/3rdparty/rapidjson/CMakeLists.txt
@@ -0,0 +1,128 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
+
+PROJECT(RapidJSON CXX)
+
+set(LIB_MAJOR_VERSION "1")
+set(LIB_MINOR_VERSION "0")
+set(LIB_PATCH_VERSION "2")
+set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")
+
+# compile in release with debug info mode by default
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
+endif()
+
+# Build all binaries in a separate directory
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON)
+option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON)
+option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON)
+option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
+ "Use gtest installation in `thirdparty/gtest` by default if available" OFF)
+
+option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11 (gcc/clang)" ON)
+
+option(RAPIDJSON_HAS_STDSTRING "" OFF)
+if(RAPIDJSON_HAS_STDSTRING)
+ add_definitions(-DRAPIDJSON_HAS_STDSTRING)
+endif()
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror")
+ if (RAPIDJSON_BUILD_CXX11)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif()
+ endif()
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers")
+ if (RAPIDJSON_BUILD_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif()
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
+endif()
+
+#add extra search paths for libraries and includes
+SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")
+SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "Directory where lib will install")
+SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation")
+
+IF(UNIX OR CYGWIN)
+ SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}")
+ELSEIF(WIN32)
+ SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake")
+ENDIF()
+SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake fiels are installed in")
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+if(RAPIDJSON_BUILD_DOC)
+ add_subdirectory(doc)
+endif()
+
+add_custom_target(travis_doc)
+add_custom_command(TARGET travis_doc
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/travis-doxygen.sh)
+
+if(RAPIDJSON_BUILD_EXAMPLES)
+ add_subdirectory(example)
+endif()
+
+if(RAPIDJSON_BUILD_TESTS)
+ if(MSVC11)
+ # required for VS2012 due to missing support for variadic templates
+ add_definitions(-D_VARIADIC_MAX=10)
+ endif(MSVC11)
+ add_subdirectory(test)
+ include(CTest)
+endif()
+
+# pkg-config
+IF (UNIX OR CYGWIN)
+ CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
+ @ONLY)
+ INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
+ DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
+ COMPONENT pkgconfig)
+ENDIF()
+
+install(FILES readme.md
+ DESTINATION "${DOC_INSTALL_DIR}"
+ COMPONENT doc)
+
+install(DIRECTORY include/rapidjson
+ DESTINATION "${INCLUDE_INSTALL_DIR}"
+ COMPONENT dev)
+
+install(DIRECTORY example/
+ DESTINATION "${DOC_INSTALL_DIR}/examples"
+ COMPONENT examples
+ # Following patterns are for excluding the intermediate/object files
+ # from an install of in-source CMake build.
+ PATTERN "CMakeFiles" EXCLUDE
+ PATTERN "Makefile" EXCLUDE
+ PATTERN "cmake_install.cmake" EXCLUDE)
+
+# Provide config and version files to be used by other applications
+# ===============================
+
+export(PACKAGE ${PROJECT_NAME})
+
+# cmake-modules
+CONFIGURE_FILE(${PROJECT_NAME}Config.cmake.in
+ ${PROJECT_NAME}Config.cmake
+ @ONLY)
+CONFIGURE_FILE(${PROJECT_NAME}ConfigVersion.cmake.in
+ ${PROJECT_NAME}ConfigVersion.cmake
+ @ONLY)
+INSTALL(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+ DESTINATION "${CMAKE_INSTALL_DIR}"
+ COMPONENT dev)
diff --git a/3rdparty/rapidjson/CMakeModules/FindGTestSrc.cmake b/3rdparty/rapidjson/CMakeModules/FindGTestSrc.cmake
new file mode 100644
index 00000000000..f942a8dafcd
--- /dev/null
+++ b/3rdparty/rapidjson/CMakeModules/FindGTestSrc.cmake
@@ -0,0 +1,30 @@
+
+SET(GTEST_SEARCH_PATH
+ "${GTEST_SOURCE_DIR}"
+ "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest")
+
+IF(UNIX)
+ IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST)
+ LIST(APPEND GTEST_SEARCH_PATH "/usr/src/gtest")
+ ELSE()
+ LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest")
+ ENDIF()
+ENDIF()
+
+FIND_PATH(GTEST_SOURCE_DIR
+ NAMES CMakeLists.txt src/gtest_main.cc
+ PATHS ${GTEST_SEARCH_PATH})
+
+
+# Debian installs gtest include directory in /usr/include, thus need to look
+# for include directory separately from source directory.
+FIND_PATH(GTEST_INCLUDE_DIR
+ NAMES gtest/gtest.h
+ PATH_SUFFIXES include
+ HINTS ${GTEST_SOURCE_DIR}
+ PATHS ${GTEST_SEARCH_PATH})
+
+INCLUDE(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GTestSrc DEFAULT_MSG
+ GTEST_SOURCE_DIR
+ GTEST_INCLUDE_DIR)
diff --git a/3rdparty/rapidjson/RapidJSON.pc.in b/3rdparty/rapidjson/RapidJSON.pc.in
new file mode 100644
index 00000000000..7467f9779b8
--- /dev/null
+++ b/3rdparty/rapidjson/RapidJSON.pc.in
@@ -0,0 +1,7 @@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: @PROJECT_NAME@
+Description: A fast JSON parser/generator for C++ with both SAX/DOM style API
+Version: @LIB_VERSION_STRING@
+URL: https://github.com/miloyip/rapidjson
+Cflags: -I${includedir}
diff --git a/3rdparty/rapidjson/RapidJSONConfig.cmake.in b/3rdparty/rapidjson/RapidJSONConfig.cmake.in
new file mode 100644
index 00000000000..9fa12186ab6
--- /dev/null
+++ b/3rdparty/rapidjson/RapidJSONConfig.cmake.in
@@ -0,0 +1,3 @@
+get_filename_component(RAPIDJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+set(RAPIDJSON_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@")
+message(STATUS "RapidJSON found. Headers: ${RAPIDJSON_INCLUDE_DIRS}")
diff --git a/3rdparty/rapidjson/RapidJSONConfigVersion.cmake.in b/3rdparty/rapidjson/RapidJSONConfigVersion.cmake.in
new file mode 100644
index 00000000000..25741fc0976
--- /dev/null
+++ b/3rdparty/rapidjson/RapidJSONConfigVersion.cmake.in
@@ -0,0 +1,10 @@
+SET(PACKAGE_VERSION "@LIB_VERSION_STRING@")
+
+IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
+ SET(PACKAGE_VERSION_EXACT "true")
+ENDIF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
+IF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
+ SET(PACKAGE_VERSION_COMPATIBLE "true")
+ELSE (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
+ SET(PACKAGE_VERSION_UNSUITABLE "true")
+ENDIF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
diff --git a/3rdparty/rapidjson/appveyor.yml b/3rdparty/rapidjson/appveyor.yml
new file mode 100644
index 00000000000..7d586e83a48
--- /dev/null
+++ b/3rdparty/rapidjson/appveyor.yml
@@ -0,0 +1,28 @@
+version: 1.0.2.{build}
+
+configuration:
+- Debug
+- Release
+
+environment:
+ matrix:
+ - VS_VERSION: 11
+ VS_PLATFORM: win32
+ - VS_VERSION: 11
+ VS_PLATFORM: x64
+ - VS_VERSION: 12
+ VS_PLATFORM: win32
+ - VS_VERSION: 12
+ VS_PLATFORM: x64
+
+before_build:
+- git submodule update --init --recursive
+- cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DBUILD_SHARED_LIBS=true -Wno-dev
+
+build:
+ project: Build\VS\RapidJSON.sln
+ parallel: true
+ verbosity: minimal
+
+test_script:
+- cd Build\VS && if %CONFIGURATION%==Debug (ctest --verbose -E perftest --build-config %CONFIGURATION%) else (ctest --verbose --build-config %CONFIGURATION%)
diff --git a/3rdparty/rapidjson/bin/data/glossary.json b/3rdparty/rapidjson/bin/data/glossary.json
new file mode 100644
index 00000000000..d5ca56d1950
--- /dev/null
+++ b/3rdparty/rapidjson/bin/data/glossary.json
@@ -0,0 +1,22 @@
+{
+ "glossary": {
+ "title": "example glossary",
+ "GlossDiv": {
+ "title": "S",
+ "GlossList": {
+ "GlossEntry": {
+ "ID": "SGML",
+ "SortAs": "SGML",
+ "GlossTerm": "Standard Generalized Markup Language",
+ "Acronym": "SGML",
+ "Abbrev": "ISO 8879:1986",
+ "GlossDef": {
+ "para": "A meta-markup language, used to create markup languages such as DocBook.",
+ "GlossSeeAlso": ["GML", "XML"]
+ },
+ "GlossSee": "markup"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/data/menu.json b/3rdparty/rapidjson/bin/data/menu.json
new file mode 100644
index 00000000000..acdf930ea5f
--- /dev/null
+++ b/3rdparty/rapidjson/bin/data/menu.json
@@ -0,0 +1,27 @@
+{"menu": {
+ "header": "SVG Viewer",
+ "items": [
+ {"id": "Open"},
+ {"id": "OpenNew", "label": "Open New"},
+ null,
+ {"id": "ZoomIn", "label": "Zoom In"},
+ {"id": "ZoomOut", "label": "Zoom Out"},
+ {"id": "OriginalView", "label": "Original View"},
+ null,
+ {"id": "Quality"},
+ {"id": "Pause"},
+ {"id": "Mute"},
+ null,
+ {"id": "Find", "label": "Find..."},
+ {"id": "FindAgain", "label": "Find Again"},
+ {"id": "Copy"},
+ {"id": "CopyAgain", "label": "Copy Again"},
+ {"id": "CopySVG", "label": "Copy SVG"},
+ {"id": "ViewSVG", "label": "View SVG"},
+ {"id": "ViewSource", "label": "View Source"},
+ {"id": "SaveAs", "label": "Save As"},
+ null,
+ {"id": "Help"},
+ {"id": "About", "label": "About Adobe CVG Viewer..."}
+ ]
+}} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/data/readme.txt b/3rdparty/rapidjson/bin/data/readme.txt
new file mode 100644
index 00000000000..c53bfb8b726
--- /dev/null
+++ b/3rdparty/rapidjson/bin/data/readme.txt
@@ -0,0 +1 @@
+sample.json is obtained from http://code.google.com/p/json-test-suite/downloads/detail?name=sample.zip
diff --git a/3rdparty/rapidjson/bin/data/sample.json b/3rdparty/rapidjson/bin/data/sample.json
new file mode 100644
index 00000000000..30930e765dc
--- /dev/null
+++ b/3rdparty/rapidjson/bin/data/sample.json
@@ -0,0 +1,3315 @@
+{
+ "a": {
+ "6U閆崬밺뀫颒myj츥휘:$è–ˆmYí–š#rzé£+玭V㭢뾿愴Yî°‘ê–šX亥ᮉ푊\u0006åž¡ã­ë£\"厓ᔧḅ^Sqpv媫\"⤽걒\"˽Ἆ?ꇆ䬔未tv{DV鯀Tἆl凸g\\㈭ĭ즿UH㽤": null,
+ "b茤z\\î¨.N": [[
+ "ZL:ᅣዎ*Y|çŒ«åŠæ«•è¾Oj为1糕쪥æ³S룂w࡛á²â¸¥èš™)",
+ {
+ "\"䬰á»wDæ¾V`邀⠕VDãºsH6[칑.:醥葹*뻵倻aD\"": true,
+ "e浱uî¿£p蔽Crà· JK軵xCʨ<뜡癙Yç©ï½¹é½ˆX/螗唻?<蘡+뷄㩤쳖3å‘犾&\\첊xzå崦ݻé´\"åµ¥B3㰃詤豺嚼aqJ⑆∥韼@\u000b㢊\u0015L臯.샥": false,
+ "l?Ǩ喳e6㔡$M꼄I,(3á縢,䊀疅뉲B㴔傳䂴\u0088㮰钘ꜵ!ᅛ韽>": -5514085325291784739,
+ "o㮚?\"춛㵉<\/﬊ࠃ䃪ä£wp6ἀ䱄[s*S嬈貒pᛥ㰉'ë€": [{
+ "(QP윤懊FI<ꃣ『䕷[\"ç’å¶®?%Ḭå£à²»ä‡Ÿ0è¤!è—²ë¹bdæµ¶tl\u2049#쯀@僞": {"î—i妾8홫": {
+ ",Mï£ë§ƒäž›K5nAㆴVNã’Ší–¬$n꩑&êŽæ¤žî·é˜«?/á¹ì„¸ë‰ª1x쥼㻤㪙`\"$쟒薟B煌܀ì¨à­2掳7㙟鴙Xå©¢\u0002": "Vዉèˆï ’᧷⦌kîŒï®žà°ˆnz*<?੃'ahhCFX(\u0007⮊Eã­ä±¾Gxꥩrâ£.æ´Ž",
+ "ë»´5bDDí¯O傆盓왻U?êž…êŠNé­á§¢Ï„\"迳豲8\u001b䃥ꂻ䴺ྸHç­´,": {
+ "\"L鸔SE㬡XV&~ÍŽ'놅蔞눶l匛?'.Kæ°\\ƢẨ疇má¿›'ê½³&!é¹ m'|{Pç—Š ç§„ì’¿u\u00111ä‹§î´¼gÏ©x7t丗D䊨䠻z0.A0": -1.50139930144708198E18,
+ "8é‹‚ë›·ïž”?ì²’B☚>ï·œFM\"è­7ê€-VR<\/';ä™E9$䩉\f @s?íªo3^è¡´cî˜à¶Žä§ªaK鼟q䆨c{ä³ 5mᒲՙ蘹ᮩ": {
+ "Fã²·JGoâ¯Pëµxë’³p䘧☔\"+ꨲå¿JfR㔹)4nç´¬G练Qáž!C|": true,
+ "p^㫮솎ocî’£.೚A㤠??r\u000f)⾽⌲們M2.䴘䩳:⫭胃\\á¾@Fá­Œ\\K": false,
+ "蟌Tk愙潦伩": {
+ "aï‘<\/@ᾛ慂侇瘎": -7271305752851720826,
+ "艓藬/>á„ṯ,XW~㲆w": {"Eç—§î–郶)㜓ha朗!N赻瞉駠uC\u20adè¾ <Ve?í±!ImäŽî­Ÿæ„:*s 9諚Prᵾ뒰髶B̌qWA8梸vS⫊⢳{t㺲q㺈랊뮣RqK밢쳪": [
+ false,
+ {
+ "\u000b=>x퓮⣫P1à «LMMX'M刼唳ë¤": null,
+ "P쓫晥%k覛ዩIUᇸ滨:å™í˜²lMR5䋈V梗>%å¹½ué –\\)쟟": null,
+ "eg+昉~矠䧞难\b?gQì­·ç­\\eê® Nl{ಢ哭|]Mn銌╥zê–˜zⱷ⭤ᮜ^": [
+ -1.30142114406914976E17,
+ -1.7555215491128452E-19,
+ null,
+ "渾ã¨ß牄귛r?ëŒ?w[âšžÓ»~廩輫㼧/",
+ -4.5737191805302129E18,
+ null,
+ "xyà¿‘M[ocì…’ç«“â’ºx?뜓y䊦>-Dì¼(&&?XKkc꩖ﺸá‹ëµžK伕6à§€)딀PæœyWæ™îž¢?훻魢傎EG碸9類៌g踲C⟌aEX舲:z꒸许",
+ 3808159498143417627,
+ null,
+ {"m試\u20df1{G8&뚈h홯J<\/": {
+ "3ஸ厠zs#1K7:rᥞoꅔꯧ&ë‡éµ¼éž«6è·œ#赿5l'8{7㕳(b/j\"厢aqç±€êš\u0015厼稥": [
+ -2226135764510113982,
+ true,
+ null,
+ {
+ "h%'ë§žï–±Sì‹…Hs&dï”l슾W0jé¿M×D놯L~S-㇡Rì­¬%": null,
+ "⟓咔謡칲\u0000孺ꛭx旑檉㶆?": null,
+ "æ‡I転;￸B2Y`z\\ç“w,ë†æ¿æ’埵䂄)!ä¶¢D=à´­ã´ŸjyY": {
+ "$ࡘt厛毣ൢIèŠ<겿骫⫦6tr惺a": [
+ 6.385779736989334E-20,
+ false,
+ true,
+ true,
+ [
+ -6.891946211462334E-19,
+ null,
+ {
+ "]-\\êŸ1/è–“â§á½Š\\l牑\u0007A郃)阜ᇒᓌ-塯`W峬G}SDb㬨Q臉⮻빌O鞟톴첂B㺱<ƈmu챑J㴹㷳픷Oㆩs": {
+ "\"â—‰B\"pᶉt骔J꩸ᄇá›iâ•°æ ›K쉷㉯é©!ãˆnì¹äŸ…難>盥yé“¿eà­”è’M貹ヅ8å˜‹í€¯ä‰¶áŒ¥ã¢æ®Šë»³\"絧╿ꉑ䠥?∃蓊{}㣣Gk긔H1哵峱": false,
+ "6.瀫cN䇮F㧺?\\椯=ÚˆT䘆4â˜ïšŒ8qv": -3.5687501019676885E-19,
+ "Q?yऴr혴{஀䳘p惭f1ﹸ䅷䕋贲<ྃᄊ繲hq\\b|#QSTî“¶s1c-7(äµ¢\u2069åŒçµ˜ê¯‰:læ¯´ï›æ±žt戀oà·Ÿáµ¶ë®±á£-醇Jx䙬äí–¢0࣫á¡grã„›": "\u0011_xM/蘇Chv;dhA5.嗀绱V爤ﰦiëµ²M",
+ "â‘[\"ugoy^儣횎~U\\섯겜ï¥l2jw஌yD腅̂\u0019": true,
+ "ⵯɇä²á«¿à¢š!㯢l샅笶戮1꣖0Xe": null,
+ "劅fë„€ï‹ï§¼bå®ç„ŠE찓橵G!ʱç“뭔雩괛": [{"p⹣켙[q>燣äƒãž½î›œá©²x:쓤삘7玑퇼0<\/qç’‚á‘[ï ™Z\\3䅵䧳\u0011㤧|妱緒C['ì·“Yꞟ3Z鳱雼P錻BUì”§U`ᢶg蓱>.1Ó§è­«'L_5VäµÐ¦": [
+ false,
+ false,
+ {"22ä‚盥N霂얢<F8î±ê¼µ7Gà°¸yhë€g᦭ꄢx硴嬢\u001a?Eê´†T|;7犟\"Wt%ä©O⨵t&#ᬋK'èœá²«æ”⾠鲂Të©·éƒ\u0018䓞cE": {"f=ä츜瞾zw?å­¡é£\\铀᫞yẆg(\u0011M6(s2]`ਫ": [[[{
+ "'y몱纣4S@\\,i㷯럹Ua充Tᣢ9躘Zଞ쥿äŠs<\/刎\\\"뉦-8/": "蜑.X0꭛낢륹iì ¨êš<8?s볕è¡|Q✬᯦@\\G㑢屿Mn졾J굤⥟JW뤵苑rì•툄嵵?â¾¥O",
+ "^1挲~[n귆誈央碠멪gI洷": -8214236471236116548,
+ "sሣ%娌暡clr蟜㑓2\u000bSâŸ_X㨔⚴5~蔷ꀇ|Xu㬖,꤭å¹îµ¿r(g믇ì©ïЍ%췸앙|æ £U\\2]䤉+å• è¡ê¯ŽT鉹m\n/`SzDᅼ鞶": 1.1217523390167132E-19,
+ "u톇=黚\\ ꂮ췵L>躰îe9â‘©_뵜斌n@B}$ê´»Yá±@ä§‹î´½V\"☒-諯cVë¯Ê ": true,
+ "Ű螧ᔼæªéŽë•’딜qꄃH뜣<ç§à¥‚CYå“â¸>XQ㵡趌oë¬k픀빯a(ܵç”ë†à­¯/6Nᪧ}æšá†šì§ŒP牰泱鈷^d꣟#Lì‚€\"㕹襻;k㸊\\f+": true,
+ "쎣\",|⫝̸阊x庿k잣v庅$éˆê´Žç‚”k쬪O_": [
+ "ìž©AzZGz3v愠ꉈⵎ?㊱}Så°³à¯p\r2>ì·IP䘈M)w|\u000eE",
+ -9222726055990423201,
+ null,
+ [
+ false,
+ {"´킮'뮤쯽Wxè®V,6ᩪ1ç´²aႈ\u205czD": [
+ -930994432421097536,
+ 3157232031581030121,
+ "l貚PY䃛5@䭄<nW\u001e",
+ [
+ 3.801747732605161E18,
+ [
+ null,
+ false,
+ {
+ "": 4.0442013775147072E16,
+ "2J[sᡪ㞿|n'#廲꯬乞": true,
+ "B[ç¹°`\\ãa̼㨀å›ã½“<\/꥖ᵈO让\r43⡩徑ﬓ๨ﮕx:㣜oçŽê‰Ÿã¢Cçµï›‰á½†á“žì‡“Qs氯였9é§µq혃Ljê‚”<\/昺+tä‹à¼»çŒ™c沪~櫆bpJ9Uá:칣妙!çš—F4㑄탎䕀櫳振讓": 7.3924182188256287E18,
+ "H磵ai委曷n柋T<\/å‹¿F&:ꣴfU@㿗榻Lb+?í„sp\"᪟~>ê·»m㎮ç¸fî§¡": 1.0318894506812084E-19,
+ "࢜⩢Ш䧔1肽씮+༎ᣰ闺馺窃䕨8Mƶqè…½xc(៯å¤J5굄ä•Qj_훨/~価.䢵慯틠퇱豠㼇Qﵘ$DuSp(8Uà¸<\/ಟ룴𥳐ݩ$": 8350772684161555590,
+ "ㆎQ䄾\u001bpᩭ${[諟^^骴᤮b^ㅥI┧T㉇⾞\"绦<AYJ⒃-oF<\/蛎mm;obh婃ᦢ": false,
+ "䔤䣈?æ±.p襟&dã±…\\Jᚠ@?Oì²à¢½íœ”VR蔩|㒢柺": [[
+ "-ꕨ岓棻r@鿆^3~䪤Ѐ狼︌ﹲ\\á¸MlEìµ Q+",
+ null,
+ false,
+ 3346674396990536343,
+ null,
+ {
+ "": null,
+ "/ä¨S쨑,&繷㉥8C엮赸3馢|뇲{鄎ꗇqFﶉ雕UD躢?Ꟛအï–꽡[hᕱᗅ㦋쭞MユèŒ?L槽암V#성å”%㣕嘵\\Ú¹(å˜èº¿&q": [
+ -1364715155337673920,
+ false,
+ -8197733031775379251,
+ "E팗鮲JwH\\觡܈áœ\"+뉞娂N휗vå™™á‚ê¹¼\u001dD帒l%-æ–”N",
+ -3.844267973858711E-20,
+ [{"쬯(褈Q 蟚뿢 /ⱖ㻥\u0017/?v邘䃡0U.Z1î­­x?鯔Vå° 8Emï•<": [[[
+ null,
+ [
+ null,
+ -5841406347577698873,
+ "í‚·\"S⋄籞繗솸ᵣ浵w쑿ퟗ7náŽx3ì•™z㘌쿸I葥覯ã¬0á†b汆狺뷘ႀnꋋ",
+ -1227911573141158702,
+ {
+ "u㉮PᾺV鵸A\\g*à¡—9슟晭+ͧↀ쿅H\u001c꾣犓}癇æ›á—¬é»©äŸ˜X梑é†e>rä°‚f矩'-î½7ä¡­æ¡¥Dz兔V9è°¶å±…ãºá”Šä©¯ë².\u001eL0ὅㅷ釣": [{
+ "<쯬Jå·^숞u࠯䌗艞R9닪gã¾ë³Ža䂈歖æ„:%é”|ﵤ|y}î¡»>;2,覂⶚啵tb*ä»›8ä¹’ã“¶B࿠㯉戩oX 貘5V嗆렽ë‚߼4hä§›êºM空\\b꿋貼": 8478577078537189402,
+ "VD*|吝z~h譺aᯒ": {
+ "YIì·¢K<\/濳xNne玗rJo쾘3í•°é´Š\"↱AR:ࢷ\"9?\"è‡ï¦¡)?誚êŠe)_D翾W?&F6J@뺾ê°NZ醊Z쾈വHï±å¶¿?炫㷱鬰M겈<bïž²S}㎥l|刖k": {"H7鷮퇢_k": [
+ true,
+ "s㟑瀭좾쮀â‘î¬Yì°ºk맢戲쀸俻àº6å„®ë—æ‰–puߖꜻ馶rꈞ痘?3ྚ畊惘䎗\"vv)*臔웅鿈䧲^v,껛㰙J <áš¶5",
+ 7950276470944656796,
+ 4.9392301536234746E17,
+ -4796050478201554639,
+ "yꬴc<3㻚",
+ "oå¡\u20a4蒵鮬裢Cá´§nBã­±f.",
+ false,
+ [
+ false,
+ "ã¡å¼‘V?瀆䰺q!출㇞yᘪ꼼(IS~Ka 烿ꟿ샕桤\u0005HQҹ㯪罂qè¾âš‡æ‡‹â¦•ë‘¡v",
+ 1862560050083946970,
+ "\u20b6[|(ë­¹gê’펉O轄Dl묽]ﯨ髯QEbAã’¾m@롴礠㕓2ë•«n6ْ엘঵篳R잷꙲m색摪|@ã¿«5aK设f胭r8/NI4ì¶«æ µ\\꯬2]",
+ false,
+ {
+ "\u000b7*ã™›ç‡.~?䔊pæ•e_拺艿ë·f{ê”»1sé©™`$Ė戧?q⋬沭?å¡·á­šè¹€unoa5": {
+ "Sê·¯o紞㾕ᅶä¾î—¶éЇ12|ÊŸç•´ï–iNAo?|Sw$M拲գ㭄紧螆+,梔": null,
+ "ã­š0?xB疱敻ேBPwv뾃熉(Ó pJ]ê°¢\"Bj'\u0016GE椱<\/zgៅx黢礇h},M9ï´¦?LḨ": "Si ïŸB%~㬒E",
+ "핇㉊살ã¢ìˆ¨~ȪRo䦅D桺0z]﬽蠆c9ᣨyPP㿷U~ãž?쯟í¸å®’뉆U|}㉓郾ࣻ*櫎꼪ä—s?~7\u001e㘔h9{aáž‹}:ã¶’P8": [{"\\R囡ì¬nNæŸ‹çØ›7ì¹¾ :㶃衇徜V æ·±f1æ·â™ i?3Sè§’íž^ᆞ\u20e8á¹°D\u0007ç§¡+躒臔&-6": {
+ "䨑g.fhã”—=8!\"狿ൻLU^ë»±g䲚ã»'W}k欤?๒鲇S꧗䫾$ĥ피": -794055816303360636,
+ "外頮詋~텡竆î™ç¹ƒä©è‹¨ë¾ºæœê¼ƒç˜¹f*㉀枙NH/\u2027ê¢}j묎ïƒvペq︉ì‹ëœ¡Od5 N顯ି烅仟Qfㆤ嚢(i䬅c;ë§§?嶰㩼츱ç¡?-": {
+ "e݆ã¡â¬¬î›–'2ã»’?U篲鿄\"隻Ҭ5NꭰꤺBꀈ拾᩺îº[刯î…5곑Na램ﴦ዆]ã“qwé’„\u001b\"Yæ´Šä—¿î¼ç¥å¡¥è¿µ[⼞⠳P$ê ±5먃0ï¦`": [{"ç°Eè³ï«šb먭N긆Ⰹå²2逶ꜛ?H짉~?P}jj}ä¾·ç¿_T>á­¨b,â»éˆµP䕡䀠८ⱄ홎鄣": {
+ "@?k2é¶–ã‹®\"Oರ K㨇廪儲\u0017ä¾î¿‚J?);\b*묀㗠섳햭1MC V": null,
+ "UIICP!BUA`î€á¢ˆã‹¸~袩㗪⾒=fBï®´l1ꡛ죘R辂여ҳ7쮡<䩲`熕8é ": 4481809488267626463,
+ "Y?+8먙ᚔ鋳蜩ï–럶1㥔y璜౩`": [
+ null,
+ 1.2850335807501874E-19,
+ "~V2",
+ 2035406654801997866,
+ {
+ "<숻1>\"": -8062468865199390827,
+ "Mã¿£ï€E]}qwG莎Gná¶(ê”™\\D⬲iꇲs寢t駇S뀡ꢜ": false,
+ "pê¤ãŽ9W%>M;-Uç’fî£(^j1?&RBéš§ å¿“b똊îƒE": "#G?C8.躬ꥯ'?냪#< 渟&헿란zpo왓Kj}é·§XﻘMツbä•–;㪻",
+ "vE풤幉xz뱕쫥Ug㦲aH} ᣟp:鬼Yá°Ÿ<Fɋ잣緂頒âºä‰²ç‘‘ä…‚,C~Þ…G!f熢-B7~9Pqà¡¢[츑#3ꕎ,Öඳèâ©…ãµ§ì¶€ë¿xyäŒÍ‚tdj!箧᳆|9èš¡ë¬": -2.54467378964089632E17,
+ "䵈䅦5ë¹–,궆-:໿댾仫î»0ᙚyá¦hqáš„": null,
+ "侯Y\"湛졯劇Uì…ŽYXçâ…¸2ä¼´|ç­§\\ä’ã¶¶á·ì‘WaᦵᗱãœëŠ¾è† <Jc63<G\u20fe䇹66僣k0O\"_@U": null,
+ "姪y$#sæ¼´JH璌Ӊ脛Jã¾íŽ”ï¹´oꈶ㚸PD:薠ì–%說ážè¹‚1]⾕5튄": {
+ "á¾Huw3䮅如쿺äŸå«]<鰨ݷ?꯯䫓傩|á¶à·ƒåª½\\澒≡闢": "Mm\"ì‡á¯„졽\"楇<\/ꥆí­å±€néš´@é¿£wâ Š4Pï«å¾ŽW㊋;䤞'.팇è’ä¡´egpxå—Žwà®…ç—å ®á›nË︖䀤4å™™?໚éƒá±‹Þ˜à¥Žtæ‘姫籕殥ï­é™ƒ\"4[ê¬qL4Wê Žx",
+ "ℇjéŒïš›5Bë’š\" U": "ç¡„ê˜{憠êµ:&t䌨m Cઌ쿣鞛XFê Ÿsä­ï¶ƒ\"æ ¼a0x闊昵å²L\\æšèˆaê¸j싹ç…\"î ²çŸï±¡é¦†*êµ–ç³ <ê”躎",
+ "톌賠弳êŸb\"èž–X50sĶ晠3fç§‚å¯Iⓟ:è˜": 5.573183333596288E18,
+ "%䴺": [[[[
+ -6957233336860166165,
+ false,
+ null,
+ {
+ "\"ïŸ\\௮茒袀ᕥ23ୃ괶?䕎.嚲◉ãžL+ᵡ艱hL콇붆@": null,
+ "%螥9ꭌ<\/-t": true,
+ ",9|î«è€¢æ¤¸ä“Xk죱\u0015$Ώ鲞[ï’—?ì—¢á²í˜ªì¦ˆâ´‚â–‚â„´ã—¯\"gî´ëº˜\\êœ#\u0002ヮ}ሎ芲P[鹮轧@냲䃦=#(": 2.78562909315899616E17,
+ "R?H䧰ⵇ<,憰쮼Q總iR>H3镔ᴚ斦\\é‘r*2橱Gâ¼”F/.j": true,
+ "RK좬뎂aí™ f*f㱉á®â¦‹æ½™ã¨‹Gu곌SGI3Ië¿\\F',)t`è蘯囯ﮉ裲뇟쥼_ገ驪▵æ’ᕤV": 1.52738225997956557E18,
+ "^k굲䪿꠹B逤%F㱢漥O披M㽯镞竇霒i꼂焅륓\u00059=皫之눃\u2047娤é–銤唫á•b<\/w踲䔼u솆맚,ä’á³'/it": "B餹饴is権ꖪ怯ꦂẉဎt\"!凢谵⧿ï™0\\<=(uLä·åˆ¨ì‘ª>俆æ“Cy襸Q힆䆭涷<\/á±0î É§îŠ‹䗾䚹\\ኜ?ꄢᇘ`ä´¢{囇}᠈䴥X4퓪檄]ꥷ/3謒ሴn+gé¨X",
+ "GgG꽬[(å«“ëª6\u0004ê¶宩㙻/>\u0011^è¾dTè…ªhxÇ‘%ꊇk,8(Wâ§‚çµP鬜O": [{
+ "Mã´¾c>\\ᓲ\u0019V{>ꤩ혙넪㭪躂TS-痴໸闓âµ/徯O.Mã¥Ê·D囎⧔ì³íœ¤T??鉬뇙=#ꢫ숣BXä­¼<\/d똬졬g榿)eꨋﯪ좇첻<?2K)": null,
+ "Z17縬z]愀䖌 ᾋBCg5ë”’êµ­æ†ê¾“aâ²·í„·u:U촳驿?雺楶\u0001\u001c{q*á°—è‹‘B@kæ°z.*è“—7ረIm\"Oá±@7?_": true,
+ "㺃Z<": -4349275766673120695,
+ "휃䠂fa塆ffixKe'ë¬é—੄뺾w࠾鑎kë•¢m*á‚‘î§·í–žé®6攊&虜h黚,Yä±³Sﭼ둺pN6": [
+ false,
+ "IΎ䣲,\"ᬮ˪癘P~Qlnxå–Sᮔ༬˨IçŒm䜛酛\u0003iê¸ã¦§cQ帲晼D' \\(粋ï›wQcN\\ëµ°è·ˆ",
+ [
+ "D0\\L?M1ì¥KaêŒsd+盌귤憊tz䌣ëŒ×‘Oå‚wÏ¢%á½’gpî•—,Aiï™âŽ§á¶†Iî«˜é¤¾ê¦æ£©å˜…᳉怴%m]á¶is纖D凜镧o심b Uî»·",
+ {
+ "?଼\u0011Rv&^[+匚I趈T媫\u0010.䥤ᆯ1q僤HydⲰl㒽K'ᅾiౕ豲초딨@\u0013J'쪪VD౼P4Ezg#8*㋤W馓]c쿯8": false,
+ "c/擯X5~JmKäµ¶^ìŽà´š|B|u[ì†(X뚤6v}W㤘⠛aR弌臌쾭諦eⒷ僡-;㩩⭖ⷴ徆龄갬{䱓ᥩ!ï¯âŠšá‡¨<v燡露`:볉癮꨽り★Ax7Ꮀ譥~舑\\Vê‹\"$)v": "e&sFF쬘OBï–†d슊寮f蠛জ봞mn~锆竒Gè„\"è¶µG刕䕳&L唽붵<\/I,X팚Bâ¥î¼¶X,kԇҗ眄_æ…¡:U附ᓚAè•§>\u001a\u0011\";~쓆BH4勿”Š7힪",
+ "iT:L闞椕윚*æ»›gI≀Wਟඊ'ꢆ縺뱹鮚Nê©á§¬è•¼21줧\\䋯``â\\ã±é³¨": 1927052677739832894,
+ "ì®ç¼¦è…ƒg]礿Y㬙 fî¼ãƒºSɪ꾾N㞈": [
+ null,
+ null,
+ {
+ "!t,çY 1䗉罵?c饃호䉂Cá­ì’˜z(즽sZG㬣sഖE4ï‚뢜㓕äžä¸®Qpç°6EZឪ겛fx'ꩱQ0ç½£i{k锩*㤴㯞r迎jTⲤ渔m炅肳": [
+ -3.3325685522591933E18,
+ [{"ã“5]A䢕1룥Bï²C?Ꙍ`r룔Ⳛ䙡uä¼²+\u0001àµo": [
+ null,
+ 4975309147809803991,
+ null,
+ null,
+ {"T팘8Dﯲ稟MM☻㧚䥧/8ﻥ⥯aXLaH\"顾S☟耲ît7fSà·‰ë†ë®”/ꕼ䓈ìº4\\霶䠴ᩢ<\/t4?죵>uDï›5➶༆쉌럮⢀秙䘥\u20972ETR3æ¿¡æ†vB? ~鸆\u0005": {
+ "`é––mç’㥉b뜴?Wf;?DV콜\u2020í‰à±“æ“å®ZMj3mJ먡-å‚·ë±™yח㸷꥿ ໘u=Mì!5å­L4v\\?ÇŽ7C홫": null,
+ "|": false,
+ "~Ztᛋ䚘\\æ“­ã—傪Wé™–+ã—¶qᵿ蘥ᙄp%䫎)}=â ”6ᮢS湟-èž¾-mXH?cp": 448751162044282216,
+ "\u209fad놹j檋䇌ᶾ梕ã‰bוּ<dä—±:줰Mé…„\u0000X#_rç¢A饓ê—ÙKo_è·”?ᪧ嵜鼲<": null,
+ "ꆘ)ubI@h@洭Ai㜎ä±k\u0003?Tä‰3é—´%j6jæ£j=â\\U毮ᬹ*8䀔v6cpjâ­¬~Q꿾뺶ï‰íŽµæ‚¡!ì©­åŽl六㽫6퇓ޭ2>": {"?è‹´ê© D䋓帘5騱qï±–PF?☸ç—é¡’yU á¡«cb䫎 S@㥚gꮒ쎘泴멖\\:Ié®±TZ듒ᶨQ3+f7캙\"?\fí’¾\\oæžç´Ÿï»½M.âŽï˜¸é‘OP": [
+ -2.6990368911551596E18,
+ [{"ä’–@<á°¿<\/⽬tTrè…ž&G%᳊秩蜰擻f㎳?Sãµ§\r*k뎾-乢겹隷j軛겷0ë£é®ï µ": {")DO0è…¦:ì¶é€¿:1㥨่!è›æ¨‹2": [{
+ ",ꌣf侴笾m๫ꆽ?1?U?\u0011ꌈꂇ": {
+ "xæ—ç” nVqä…¦w`CD⦂惺嘴0I#vỵ} \\ê·‚Së´Dì–¾?Ô’j溯\"v餄a": {
+ "@ç¿™c⢃趚痋i\u0015OQâlqë†Y0pࢥ3쉨䜩^<8g懥0w)]䊑næ´ºo5ì­QL댊랖L镈Qnt⪟㒅십q헎鳒⮤眉ᔹ梠@O縠u泌ㄘb榚癸Xî©­Þ”Ftj;iC": false,
+ "I&뱋゘|ï£è“”䔕측瓯%6á—»HW\\N1貇#?åƒá—œghá­ªo'䗈꽹Rcìš/蔳迄à¼!0邔䨷푪8ç–©)[쭶緄㇈୧á": {
+ "B+:ꉰ`sì¾­)ë¹¼Cç¾A䫊pMgjdxäHf9᥸W0!C樃'ï¤f䫤סи\u0017Jve? è¦f둀⬣퓉Whk\"஼=չï³î•¤çš†ç¬BIW虨쫓F廰饞": -642906201042308791,
+ "sb,XcZ<\/m㉹ ;䑷@c䵀s奤⬷7`ꘖ蕘戚?Feb#輜}p4nH⬮eKL트}": [
+ "RK鳗z=袤Pf|[,u욺",
+ "Ẏá»ç½¯ë‰‹âº–锅젯㷻{H䰞쬙-ì©“D]~\u0013Oã³¢gb@æ¶è”‰|kᦂâ—!\u001ebMè¤sca쨜襒y⺉룓",
+ null,
+ null,
+ true,
+ -1.650777344339075E-19,
+ false,
+ "☑lꄆs힨꤇]'uTന⌳ë†].1â‹”ê´æ²°\"IWà´©\u0019æ°œ8쟇䔻;3衲æ‹,窌zíŽå–íš—?4?Cë„é—®?ᥙ橭{稻Ⴗ_ì”",
+ "n?]讇빽å—}1å­…9#ê­¨é¶v\u0014å–ˆ)vw祔}룼쮿I",
+ -2.7033457331882025E18,
+ {
+ ";⚃^㱋x:饬ኡj'ê§µT☽O㔬RO婎?향ᒭæ©$渣y4i;(Q>꿘e8q": "j~錘}0g;Lèº*;á•­ê„®0l潛烢5H▄쳂ê’ï­‹ê™¶T犘≫x閦웧v",
+ "~î¢æ¯\u2018c4è·ë E~ᑅቚꈂ?nq뎤.:æ…¹`F햘+%鉎Oç€œìŸæ•›è®âŒæµ¢<\/㮺紿P鳆ࠉ8I-o?#jﮨîŸ7v3Dt赻J9": null,
+ "à£W䌈0êŽqC逖,íš…î·Žcáƒswj;jJSæ«5æ§—OaB>D踾Y": {"ã’°äµF%î©®?59.î„„ãˆcᕨï†í•틎á¸ã‹©B=9IÛⓌ{:9.ywï½å‘°ã†®è‚’᎒tIã¾´62\"ዃ抡C﹬B<\/<EO꽓ᇕu&é‹«\\禞í¹uê’.7훯ಶ2䩦͉ᶱf깵ᷣ늎": [
+ 5.5099570884646902E18,
+ "uQNæ¿¿m臇<%?谣鮢s]]x0躩慌闋<;(î³¥ 鋤.0á µd1#벘a:Gs?í–·'.)ㅴ䞟ç¯å´ˆFS@O㌛ᓬ抢íŒáž¾ëƒ·ì¿Ÿíˆ¥IZn[惵ê§3ë™[&v憙J>ì´‹jo朣",
+ [
+ -7675533242647793366,
+ {"ᙧ呃ï£:[㒺쳀쌡ì‚H稈㢤\u001dá¶—GG-{GHྻຊꡃ哸䵬;$?&d\\⥬ã“Nåœ´ë¤æŒ¨-'ê•®$î“‹PU%?冕눖ié­q騎Q": [
+ false,
+ [[
+ 7929823049157504248,
+ [[
+ true,
+ "Zè™\u0017'eꕤ᱕l,0\\X\u001c[=雿8è ¬L<\/낲긯W99g톉4ퟋbãº\u0007åŠ'!麕Q궈oW:@XáŽïœ¬z蘻m絙璩귓죉+3柚怫tSæ‡è’£ä -æ“¶D[0=퉿8)q0ÙŸ",
+ "唉\nFA椭穒巯\\䥴䅺鿤S#bè¿…ç˜ ï¶—ê¬˜\\?q1qN犠pX꜅^䤊⛤㢌[⬛휖岺q唻ⳡí‹\"ã™™Eh@oA賑㗠yå¿…Nꊑᗘ",
+ -2154220236962890773,
+ -3.2442003245397908E18,
+ "Wᄿ筠:瘫퀩?o貸q⊻(᎞KWf宛尨h^残3[U(='橄",
+ -7857990034281549164,
+ 1.44283696979059942E18,
+ null,
+ {"ꫯAwè·­å–€ ?_ï““9\"Aty背F=9缉ྦྷ@;?^鞀w:uN㘢Rá»": [
+ 7.393662029337442E15,
+ 3564680942654233068,
+ [
+ false,
+ -5253931502642112194,
+ "ç…‰\\îš¶î¶è¾Žî›¢à³†ç½5â’­1äªäƒ‘s䎢:[e5}峳ﴱn騎3?è…³Hyêƒè†¼N潭錖,Yá‹ËœYAá“㬠bG렣䰣:",
+ true,
+ null,
+ {
+ "⒛'P&%죮|:⫶춞": -3818336746965687085,
+ "钖m<\/0ݎMtF2Pk=瓰୮洽겎.": [[
+ -8757574841556350607,
+ -3045234949333270161,
+ null,
+ {
+ "áœî…½rè¼³>⫇9hU#î¦#w@ê·ªA\\Cî’¢ é‹ºã˜“ê–æ¢’뒬묹㹻+郸å¬ìœ¤'+g<\/碴,}ꙫ>ì†;情d齆Jä¬àº©æ’›ì±íƒ¹/R澡7剌tꤼ?ặ!`â²ç¤\u00002똥଴âŸ": null,
+ "\u20f2ܹe\\tAê¥Æ°\\x当뿖ï»ë ‰ç¦›;G檳ﯪï…Sà«°3~㘠#[J<}{奲 5箉⨔{ë†<\/釿抋,åš /曳m&WaOvT赋皺璑ï“í…": [[
+ false,
+ null,
+ true,
+ -5.7131445659795661E18,
+ "è­m䓪D5|3å©à°ž>î‰è ‡æ™¼6nï´ºPp禽羱î¤DS<ç“닫屚ì‚å§¿",
+ true,
+ [
+ -8759747687917306831,
+ {
+ ">ⓛ\t,odKr{䘠?b퓸C嶈=DyEᙬï¿@ᴔ쨺芛髿UT퓻春<\/yê¸>豚W釺N뜨^?꽴﨟5殺ᗃç¿%>í‚ဿ䄸沂Ea;A_\u0005閹殀W+窊?Ꭼd\u0013Pæ±´G5ì“æ˜": 4.342729067882445E-18,
+ "Q^즾眆@AN\u0011Kb榰냎Y#ä€ê€’ᳺ'q暇çµs\"!3#I⊆畼寤@HxJ9": false,
+ "⿾D[)袨㇩i]웪䀤ᛰMvR<èŸã£¨": {"v퇓L㪱ꖣ豛톤î£\\ê³±#ï–©kDTN": [{
+ "(ì¾´ä¡£,寴ph(C\"ã³¶w\"憳2s馆E!n!&柄<\/0Pꈗſ?㿳Qdéµ”": {"娇堰孹L錮h嵅⛤èºé¡’?CglNæŸ+쨣ﺜ\\MrH": {"çžäŽ‡ë‘ƒá‰²å¼­íŒ­^ꄞ踦涟XK錆쳞ឌ`;੶S炥騞ଋ褂B៎{Ú’ä­·á¶¼éœpIè—è™¶K$": [{"â—–S~躘蒉꫿輜è­Qã½™é—@ᢗ¥Eæ¦iØ¡5┄^B[絮跉ᰥé™PWi3wㄾⵀDJ9!w㞣ᄎ{ë“’ê““b6\\篴??c⼰鶹⟧\\鮇ꮇ": [[
+ 654120831325413520,
+ -1.9562073916357608E-19,
+ {
+ "DC(æ˜è¡µá¼¡ê¸™ê°µå§­|Ö›[t": 7.6979110359897907E18,
+ "Jâ…))嫼â³9Xfd飉j7猬ᩉ+⤻î®çœ—벎Eé°‰Zï¾¶63zá69}Zá¶L崭ᦥ⡦éšâ‹›êŽ¨î´µ~i㨃咊ꧭo䰠阀3C(": -3.5844809362512589E17,
+ "p꣑팱쒬ꎑ뛡Ꙩ挴æèƒ”&7ᔈ묒4Hdç¡¶í›ãŽ–zꢼè±ã¿¢aሃ=<\/湉鵲Eî„¡Ó…%$F!í¶æ£Œå­¼{Oé§à¨ºgeu+": ")\u001bìž“kÅ€Xì©«Aë°Â®Ú£ç™¦ç‹¢)扔弒p}k縕ꩋ,䃉tࣼi",
+ "ã‚¡F肿輸<솄G-䢹䛸êŠl`Tqê•—îŠè’ža氷⸅ᴉ蠰]S/{J왲m5{9.uá½³~㕚㣹u>x8Uè®Bëºè¥ªç›ŽQhVS맅킃i识{벂磄Ià·„ä™…xZy/æŠà«­Zï–Šé²î¦š-霳Væ®æŒ¦â„’": null,
+ "㯛|Nî½™ê¸b7âµb?æ‹ O\u0014Þ†?-(EꞨ4ꕷᄤYᯕï‘OW瞺~螸\"욿ќ<u鵵઎⸊î˜å€¾ì‘·à·»rT⪄牤銱;W殆͢芄ਰåší›šìƒ¢î™‡âŠ¿+ã²½": null,
+ "å˜ïƒé€†àº»%_ë§›d)zJ%3ì¹§_릟#95䌨怡\u001ci턠ॣî’i冘4èµ–'à¨ä§_æ ”!": {
+ "*?2~4㲌᭳ì¯ftá‚·1#oJ\bäŠ‡é•‡ë” \u2079xä›ãŠá®‚N;穽跖s휇ᣄ홄傷z⸷(霸!3yëºMì’¿í–Û½v㳉tở心3黎vì­» Rp཮Vr~T?&Ë´k糒븥쩩r*D": null,
+ "8@~홟ꔘk1[": -5570970366240640754,
+ "BZté¦ê¡¬c餖 s(má›´\u0000◄dè…‘t84CâŸå¯VṊ뉙'å™±ê”ç½GCé¡€?허0êž¹&ë‡ä›­Cä·«](": 2.4303828213012387E-20,
+ "yæ’”Z외放+}ḑ骈á™&\u0016`G便2|-e]঳?QF㜹YF\"ã¿’ç·„í–·ï€ãˆŸïƒ¦ï¨ä·¦à­€áŒ¤lM蘸N㾆▛럪㞂tᕬ镈ì‡å– l amcxPnm\u001a᱋<\/]_]ﻹïª?H": false,
+ "áæ°ë¬¢뜚I[♺뽛x?0Hë´¬Wpn꨹Raä¿ïŒ›ìŒ‘{㴂ni祻윸A'y|⺴ᚘ庌9{$æ²{톽=m#@ï–—6ᨧfgs44陎J#<Ễ쨓瀵â©a୛㷉㙉ܸ◠냔嬯~å‘„ç±ç¾¥é•³": false,
+ "㘱{<é ¬22?IF@곊I겂嶻Lá›D{@rì’‚?IAᣧ洪惒誸b徂zì·ºê¾ã ­\\刊%禨ìŒâ¶£ä»µ\\P[:47;<ᇅ<\/": {
+ "^U釳-v㢈ê—â—„è˜rᜨi;èµ·kR犺䵫\u0000é”ì™m-Ô™!lḃ꛸뻾F(Wê·›y": "#á ºH㸢5v8_æ´‘C",
+ "䔵໳$á™ 6èž\u206e摎q圩P|æ…sV4:㜾(I溞I?": -6569206717947549676,
+ "é€êž‚ç·µí‡8 >e㺰\"'㌢ÆW\u0004çž•>0?V鷵엳": true,
+ "뤥G\\î¡‹è¿‹ä ¿[庩'꼡\u001aiá©®Vì¯á³ªä¦ªÃ”î²…;倱ନë›èªˆ": null,
+ "쥹䄆䚟Qæ¦äŽá¢­<\/2ã•£p}HW蟔|äƒî‚꿈ꚉ锳2Pb7㙑Tⅹᵅ": {
+ "Y?Ö­$>#cVBꩨ:>ï†eLè’å‹™": {
+ "86柡0po äš&-æ‘Ћ祌<\/휃-G*㶢הּì©s㶟餇c걺yu꽎還5*í„§ç°•Ogå©¥Sê": null,
+ "a+葞h٥ࠆ裈嗫ﵢ5輙퀟ᛜ,QDﹼ⟶Y騠锪E_|x죗j侵;m蜫轘趥?븅w5+mi콛L": {
+ ";⯭ﱢ!ä¹°Fâ½æŸ¤é¶‚näµ£V㫚墱2ë ¾ELEl⣆": [
+ true,
+ -3.6479311868339015E-18,
+ -7270785619461995400,
+ 3.334081886177621E18,
+ 2.581457786298155E18,
+ -6.605252412954115E-20,
+ -3.9232347037744167E-20,
+ {
+ "B6㊕.k1": null,
+ "ZAꄮJ鮷ᳱo갘硥鈠䠒츼": {
+ "á•…}럡}.@y陪é¶r業'æ´î‰°í€‰x䉴ﵴlí˜):씭脴ᥞhiꃰblﲂ䡲엕8߇Mã¶­0燋標æŒ-?PCwe⾕J碻Ᾱ䬈䈥뷰憵賣뵓痬+": {"aì·©v礗X⋈耓áŠfç½…é®!㔽YYᣓwæ¾33⎔芲F|\"äœT↮輦挑6ᓘL侘?ᅥ]ë†1R௯✎餘6ê½<\/௨\\?qå–·ê«j~@ulq": {"嗫欆뾔Xꆹ4H㌋Fåµ§]à Ž]ã –1ꞤT<$më«O i댳0ä²iï—Œ": {"?à·©?\u20cd슮|ꯆjs{?îž…d7?eNs⢚嫥氂䡮쎱:鑵롟2hJꎒﯭ鱢3춲亄:ë¼£v䊭諱Yj択cVmR䩃㘬T\"Ní™*ै%x^F\\_s9ë³´zz4æ·—?q": [
+ null,
+ "?",
+ 2941869570821073737,
+ "{5{殇0ä¾ïž¢g6ë°–í‹è‡©ç¶¹R$ä–­j紋釰7î‹‘sXI繳漪행y",
+ false,
+ "aH磂?뛡#惇då©…?Fe,ì˜+늵ä˜\"3r瘆唊å‹ï¢Šj⳧࠴ꇓ<\/唕윈x⬌讣䋵%拗ᛆⰿ妴á”M2ã³—å¿…ê§‚æ·²?ゥ젯檢<8ë’ï¶MidXä’3á³»Qî”â–®ä½UT|⤪봦éâŠ",
+ [[{
+ "颉(&뜸귙{yîš’^\"P퟉ì¶á²Ÿä®­î‹ºDé¡¡9=?}Y誱<$bë±£RvO8cH煉@tk~4ǂ⤧â©å±‹Sî›ïž¢S;J{vV#剤餓ᯅc?#a6D,s": [
+ -7.8781018564821536E16,
+ true,
+ [
+ -2.28770899315832371E18,
+ false,
+ -1.0863912140143876E-20,
+ -6282721572097446995,
+ 6767121921199223078,
+ -2545487755405567831,
+ false,
+ null,
+ -9065970397975641765,
+ [
+ -5.928721243413937E-20,
+ {"6ì´Š\u001a홯kB0w撨燠룉{绎6⳹!í„è´‘y▾鱧ժ[;7ᨷ∀*땒䪮1x霆Hᩭ☔\"rî¹›ä7毟á°r惃3ꉭE+>僒æ¾": [
+ "Ta쎩aÆt쵯ⰪVb",
+ [
+ -5222472249213580702,
+ null,
+ -2851641861541559595,
+ null,
+ 4808804630502809099,
+ 5657671602244269874,
+ "5犲﨣4mᥣ?yf젫꾯|䋬ìž$`Iⳉﴷ扳å…,'î±c",
+ false,
+ [
+ null,
+ {
+ "DyUIN쎾M仼惀⮥裎岶泭lh扠\u001e礼.tEC癯튻@_Qd4cï…«5S熯A<\/ï¼¼6U윲蹴Q=%푫汹\\\u20614b[௒Câ’¥Xe⊇囙b,ï®æœ3ss땊ë¢i~逇PA쇸1": -2.63273619193485312E17,
+ "Mq꺋貘k휕=nKç¡ë«žè¼©>㾆~á¼žà¡¹ê¸æ¦µlâ‹™Hw뮢帋M엳뢯î¹…vâ…ƒ^": 1877913476688465125,
+ "á¶´ë»—`~ç­—å…⚽টW˃â½b犳䓺Iz篤p;乨A\u20efì©?ç–Šmã€ì»©ë«¡b탔鄃ᾈV(é¢ç³=뎲ିeF仢䆡谨8t0醄7㭧瘵⻰컆r厡궥d)a阄á·Ed&c﯄伮1p": null,
+ "â¯w4曢\"(欷輡": "\"Má­«]䣒頳B\\燧ࠃN㡇j姈g⊸⺌忉ꡥF矉স%^",
+ "㣡Oᄦ昵⫮Y祎Sì級㭻撥>{I$": -378474210562741663,
+ "䛒掷留Q%ì“—1*1J*ë“헩ᦢ﫫哉쩧EↅIcê…¡\\?â´Šl귛顮4": false,
+ "寔愆샠5]ä—„IHï©¥=d﯊/å¶?ॊn%晥D視Nò—˜ˆ'᫂⚦|X쵩넽z질tsî¦kxDQ莮Aoﱻ뛓": true,
+ "钣xp?&\u001e侉/y䴼~?U篔蘚缣/I畚�Q绊": -3034854258736382234,
+ "꺲໣眀)â¿·J暘î©pИfAVì‚•ì³­Nꯗ4々'唄ⶑ伻㷯騑倭D*Okï¯ê§3bâ½_ï„¡<\/ì±£Xm톰á•䆄`*fl㭀暮滠毡?": [
+ "Dç”·p`V뙸擨å¿ë¸ª9c麺`淂⢦Yw⡢+kzÜ–\fY1䬡Hæ­)ë²¾Z♤溊-혰셢?1ï”<-\u0005;æ¢Tále\\ᛵߓﭩ榩<QF;t=?Qꀞ",
+ [
+ null,
+ [{"-ì·«æ²î«§á¬¨å¢Šè‡¸<à ’Hè·¥ 㔭쥃㫯W=z[wধ╌<~yW楄S!â‘»h즓lÄ–N￧篌W듷튗乵᪪템먵Pf悥ᘀk䷭焼\\讄ræ“é¬y6VF<\/6ëž¿p)麡ê ãª\"pà®´e": [
+ "#幎æ´é¢’嶈)ã„›J.嶤26_⋌东챯ꠉ⤋ؚ/âš%ç§¼Q룠QGztᄎ㎷អIç¿°Xpç”éœê¨",
+ {",T?": [
+ false,
+ [[
+ true,
+ 7974824014498027996,
+ false,
+ [
+ 4.3305464880956252E18,
+ {
+ "᱿W^A]'rᮢ)é¥zï­é¤;Hu\\Fk?ï´º?IGæµ…-ä™§>è¨-xJ;å·¡8깊è ï»“U$K": {
+ "Vê•¡è«…æ“W=斸s︪vﲜ츧$)iꡟ싉eî®å¯³?ጭムVથ嵬iæ¥Fg<\/Z|៪ꩆ-5'@ꃱ80!燱R쇤tç³³]罛逇dṌ֣XHiͦ{": true,
+ "Ya矲Cë©—Q9膲墅æºíœ»c\\ë”¶Gç””<\/.齵휴": -1.1456247877031811E-19,
+ "z#.OOï¿J": -8263224695871959017,
+ "å´_3夼ᮟ1Fë¸ë½¯á¦“é´­V豈Ь": [{
+ "Nè’¬74": null,
+ "yuB?厅vK笗!ᔸcXQ旦컶P-ë…«mᄉ麟_": "1R@ 톘xa_|﩯é˜î¥§sæ§žd!d껀筤⬫è–焵먑D{\\ïƒïŽ¿6k共倌☀G~AS_D\"딟쬚뮥馲렓쓠攥WTMÜ­8nX㩴䕅檹E\u0007ï­¨N 2 ℆æ¶ê¥ê µï“3▙玽|ë¨_\u2048",
+ "æA Cä§©G": {":Mí£5e들\\ê€æ¼á”„é¸|Iï¨$)n": {
+ "|U䬫㟯SKV6ꛤ㗮\bn봻䲄fXT:㾯쳤'笓0b/à³¢Cì³–?2浓uO.ä°´": "à½ê¼‹e?``,ᚇæ…^8ꜙNM䂱\u0001Iá–™ê§M'vKdꌊH牮r\\O@䊷ᓵ쀆(fî »yè»i툺\"?<\/峧ࣞ⓺ᤤ쵒߯ꎺ騬?)刦\u2072læ…ªy꺜ﲖTjî’•+u",
+ "뽫<G;稳UL⸙q2n쵿C396炿Jè“¡zâ£zဩSOU?<\/ë™oEí¸Oé¿…à·´êˆEm#\"[瑦⤫á†glâ¡—q8\"í˜ë¥ä¿‚@ᆤ=\u0001爖ç¾ì·€ã¸©b9\\jeqt㟿㮸龾m㳳긄": {
+ "9\"î²–V霟釜{/o0嫲Cå’€-饷äˆ[ë…©î)\r䤴tMW\\龟ϣ^ي㪙忩䞞N湆Y笕)è¨ê–¤èª¥ç…½:14â«»57U$æ“’ä²è–¡Qvↇ櫲현誧?nà®·6": {"l웾䌵.ä…‹ä¦ic碳g[糲Ƿ-ឈᚱ4ì‘§\u0004C࿼\u0018&쬑?멲<\/fD_檼픃pd쪼n㕊渪V䛉mæˆW儅톳뗳䓆7㭽諤Tç… ï–ŠNey?î¼…0᪵鈑&": [
+ false,
+ null,
+ {
+ "\rî´’;é¼¶já ‚ê¼RLz~â™”9gf?Ó¡æµ": -1.4843072575250897E-19,
+ "&ꊒ\"ꋟä­E诮ﯚO?SWë’훪mb旙⎕ᗕ⶙|á·¤5y4甥": "j5|庠t铱?v íš‹0\"'rxz䃢æºêž«!\u0002",
+ "Q á©ãŸ§": {"Hﬔ\u2058䪠틙izZㅛ탟H^ﶲA??R6å‘ Z솋R.à¿¶g8": [
+ -8762672252886298799,
+ -1.9486830507000208E17,
+ null,
+ -7157359405410123024,
+ null,
+ null,
+ -995856734219489233,
+ "呧㫹A4!",
+ null,
+ -1.9105609358624648E-19,
+ 5888184370445333848,
+ 2.25460605078245E-19,
+ 2.5302739297121987E18,
+ "뢹sbEfæµ2丯ï‡?뗾耸(Wdë™SବꭖrtU?ç­¤P똙Qpbbï‘¡KqaE$æ¥Vì›°3i/lK퉜,8︸e= gèž“t竦컼?.寋8éµ—",
+ 7377742975895263424,
+ 2.4218442017790503E-19,
+ {
+ "y꒚ཫ쨘醬킃糟}î‘yTSt䡀⇂뿽4ൢ戰U": [[
+ 3600537227234741875,
+ 4435474101760273035,
+ -1.42274517007951795E18,
+ -5567915915496026866,
+ null,
+ null,
+ [
+ -3204084299154861161,
+ {
+ "7梧慸æ†.a瘎\u00041Uéµ®CkÖ¨d惥è€â³¡Y,â­ì¨EåžFFI鱑ⳬ줢7â§µBﴠ耘줕햸qì»´~*ç‘W.떛ࡆ@'á€+è½³": -961121410259132975,
+ "⥅]l黭㣓绶;!!⎃=朼ã¿e&ἂ繤C﯀lä£ãŒ€6TMì‘®w懃ꡡ#ᤆ䰓,墼湼゙뽸㲿䧽쫨xᵖ듨<\/ T0峸iQ:溫è„\\\"쎪ὴ砇宖^Mæ³¼í¥âž…鈫@ᄟ༩\u2008⥼": true,
+ "â©\"籽汎P싯鲘蟼sRá¯ä…©\u0019R(kRá–&ಌ 0\"é³¶!馼YH": null,
+ "鮼ꚇ싋։刟\rRLd步Nⴗ5Eࡆ訛갚[I醵NC(郴ṉy5D뤺౳QY壯5苴y훨(W\\Cଇ姚C艄깹\u001c歷㋵ZC᥂": [
+ -6806235313106257498,
+ null,
+ "}N⸿讽sꚪ;ï‘¶\\p繇jè‹„î¡ä«¨\u20e7%5x?î•¥t#",
+ {
+ "O〗k<墻yV$à°rs-c1ఌ唪.C7_Yobᦜ褷'b帰mã„‘l⌅": {"qB뗗擄3éš‚5ëºæ«‚䱟eì´¸P/é©,3æŽê—©=冉棓㑉|ËžF襴뿴,:㞦<퓂⧙礞♗g뚎ᛩ<\/뉽ⶳ⸻A?_x2Iã½å‹’*Ií™±î¢é§ç²¿~曟㤙2绥Ly6+ìƒuu鿜בfí˜|æ­à£–É": [
+ ">hh䈵î”w>1â²ì­V[â…Ž\\헑벑F_ã–⠗㫇hæ½;á¿æ±°á±¼ç€–J옆9RRì…vsZ柺鶶툤r뢱橾/ꉇ囦FGm\"謗ꉦ⨶쒿⥡%]鵩#ᖣ_蹎 u5|祥?O",
+ null,
+ 2.0150326776036215E-19,
+ null,
+ true,
+ false,
+ true,
+ {"\faá­¶Pæ¤WWcá Ÿf뚉á¬í“—â³€Wç¹5:HXH=q7xì°™X$)모r뚥ᆟ!Jﳸf": [
+ -2995806398034583407,
+ [
+ 6441377066589744683,
+ "Mﶒ醹i)Gἦ廃s6몞 KJ౹礎VZ螺费힀\u0000冺업{è°¥'꡾뱻:.ꘘ굄奉攼Diá·‘Ké¶²y繈욊阓v㻘}枭캗e矮1c?íœ\"4\u0005厑莔뀾墓ë‚⽴洗ṹ䇃糞@b1\u0016즽Yè½¹",
+ {
+ "1⽕⌰鉟í”M㤭n⧴ỼD#%é˜âŠ¯ì¿¼ç¨ë¸£ëªç´§á…‡ã“•ᛖcw嬀~ഌ㖓(0r⧦Qä‘•é«à´°é“‚㓻Rå„®\"@ꇱmâˆà¯¿á¦¯é Œ8}㿹犴?xn잆꥽R": 2.07321075750427366E18,
+ "˳b18㗈䃟柵Z曆VTAu7+㛂cb0﯑Wp執<\/臋뭡뚋刼틮è‹ë²²î·´TLP预庰܈G\\O@VD'鱃#ä¹–ëº*鑪ꬳ?MÞždï­¹{â‡åœ¯ì‡œã¼ž顄︖Y홡g": [{
+ "0a,FZ": true,
+ "2z̬è£î’®ê§¦é©¸\u0006L↛Ḣ4๚뿀'?lcwá„§ã®!蓚䃦-|7.飑挴.樵*+1ﮊ\u0010ꛌ%貨啺/JdM:ë˜ïˆ!FBe?鰴㨗0Oè´¢I藻ʔWAá«“Gì³›u`<\/I": [{
+ "$Ï„5Vé´a뾆両環iZp頻යn븃v": -4869131188151215571,
+ "*즢[⦃b礞R◚nΰꕢH=귰燙[yc誘g䆌?ଜ臛": {
+ "洤湌鲒)⟻\\䥳va}PeAMnï¼®[": "ã³Éª/(軆lZR,Cpæ®È®Nå•·\"3Bå©´?i=r$펽á¤ì€¸",
+ "阄R4㒿㯔ڀ69ZᲦ2ç™í•Œå™—På´œîž#\\-ì­è¢›îˆµ&é‘/$4ç«¥Vê©‘_ZHAæ¾¢fZ3": {"x;P{긳:Gé–‰:9?æ´»H": [
+ "繺漮6?z犞焃슳\">á»[Ⳛ䌜ë…䂹>èµâ¼¶ç…œï’˜Yæ¡¥[泥뚩MvK$4ï‰jtï¾›",
+ "E#갶霠좭㦻ୗ먵F+䪀oè’ba쮎4X㣵 h",
+ -335836610224228782,
+ null,
+ null,
+ [
+ "r1᫩0>danjY짿bs{",
+ [
+ -9.594464059325631E-23,
+ 1.0456894622831624E-20,
+ null,
+ 5.803973284253454E-20,
+ -8141787905188892123,
+ true,
+ -4735305442504973382,
+ 9.513150514479281E-20,
+ "7넳$螔忷㶪}䪪lì§´\u0007é¹Pé°šHFéŠZJﳴ/âŽ1ᷓ忉ç‡áœ‹ì“ˆxëµ mä·çª¥á”^\u0019á¶Œå­#ヂt☆áƒpáŽè‡¶äŸ±5ï‰$ä°µ&๵分ìˆ]äˆë‰â™‚åŽ\u0011<>",
+ "C蒑貑è—lï°°}X喇몛;të°¿O7/᯹f\u0015îµ¼kI嘦<ዴ㟮ᗎZ`GWퟩ瑹࡮ᅴB꿊칈??Ræ ¡s脚",
+ {
+ "9çµæˆ¬+AU^洘拻ቒy柭床'ç²™XG鞕᠜繀伪%]hï ¾C,$è¼™?Utä¹–Qmë–šWï¶8઼}~qâ ªrU䤶CQ痗ig@#≲t샌f㈥酧l;yé—¥ZHæ–¦e⸬]j⸗?ঢ拻퀆滌": null,
+ "畯}ã§¢J罚å¸VX㨑>1ꢶkT⿄蘥ã‘o|<嗸層沈挄GEOM@-äžšä§°$만峬è¼ä ±V✩5宸-æ‚î¡§D'ã—ªyP掶7bâ ŸJã•»SfP?d}v㼂á…'猘": {
+ "陓y잀v>╪": null,
+ "鬿L+7:ë‘Y=ç„ U;킻䯌잫!韎ஔ\f": {
+ "駫WmGጶ": {
+ "\\~m6ç‹©K": -2586304199791962143,
+ "ႜࠀ%Í‘lâ¿…D.ç‘¢Dk%0ç´ªdḨTI픸%뗜☓s榗኉\"?V籄7w髄♲쟗翛歂E䤓皹t ?)ᄟ鬲éœ6Cî³´": {
+ "_ì·¤a圷1\u000eB-XOy缿請∎$`쳌eZ~æï€§íŠ»/蜞`塣৙\"⪰\"æ²’l}蕌\\ë¡ƒè«æ°Œ.望wZ|o!)Hnçqg}": null,
+ "kOSܧ䖨钨:಼é‰ê­O醧Sî…¨`ì‹­`ꓭì­ï¯¢N&Et㺪馻ã¢â…³ã¢ºå´¡àºŠèœšé”«\\%ahx켨|ż劻ꎄ㢄ìŸA躊᰹p譞綨Ir쿯\u0016ﵚOd럂*僨郀N*bã•·63z": {
+ ":L5r+T㡲": [{
+ "VK泓ë²á®™Ry㓤➙Ⱗ38oi}LJቨ7Ó㹡৘*q)1豢⛃e᫛뙪壥镇æž7Gè—¯g㨛oI䄽 孂L缊ꋕ'EN`": -2148138481412096818,
+ "`â›á˜‘$(खꊲ⤖á„ꤒ䦦3=)]Y㢌跨NĴ驳줟秠++då­³>8ᎊ떩Eê¡£Sv룃 쯫أ?#Eî·°|á­™ãŽ?zv:5ï©^â‹‘V": [
+ -1.4691944435285607E-19,
+ 3.4128661569395795E17,
+ "ãƒì´—^G9ä½­é¾¶n募8R厞eEw⺡_ㆱ%⼨D뉄퉠2ê©µá›…â³æ¿L팹Là·€n=\"æ…‰ë…á›®y>!`g!í’²î¦ï¨’[/;?[vï®ê²è»‡}⤳â¤í•∌Tã½²R홓é‰ã“¥",
+ "æ„°_⮹T䓒妒閤둥?0î°šaB@㈧gç„»-#~è·¬x<\/èˆPÝ„ê¡=\\׳P\u0015jᳪá¢qï‹¶;ã¯l%á­—;砢觨â–,è¬ê°Gy?躤O黩í‹Yã’a擯\n7覌똟_䔡]fJ晋IAS",
+ 4367930106786121250,
+ -4.9421193149720582E17,
+ null,
+ {
+ ";ᄌ똾柉곟ⰺKpá‡ä±»à¸ºä–{o~h!ï½…ê¿àª»ìš„Úš\u0002y?xUd\u207c悜ꌭ": [
+ 1.6010824122815255E-19,
+ [
+ "宨︩9앉檥pr쇷?WxLb",
+ "æ°‡9】J玚\u000f옛呲~ è¼ 1D嬛,î•*mW3?n휂糊γ虻*á´«ê¾ ?qîžå‡è¶—Ko↦GTé“®",
+ "ã¶¢ážmOã”k'诔栀Z蛟}GZé’¹D",
+ false,
+ -6.366995517736813E-20,
+ -4894479530745302899,
+ null,
+ "V%᫡IIç’…ï»ä…›ä“Ží’¹ï±¢/pU9seë˜ë›žx梔~C)䨧䩻蜺(g㘚R?/á»°[å¿“C뾠ࢤc왈邠买?嫥挤풜隊枕",
+ ",vç¢å–”㌲쟚蔚톬៓ꭶ",
+ 3.9625444752577524E-19,
+ null,
+ [
+ "kO8란뿒䱕馔b臻âŸéš¨\"㜮鲣Yq5mí”<u뷆cè­†\u001bN?<",
+ [{
+ ";涉c蒀ᴧN䘱䤳 ÿꭷ,핉dSTDB>K#ꢘug㼈á¦=P^6탲@ä§”%$CqSw铜랊0&m⟭<\/a逎ym\u0013îš¡vᯗ": true,
+ "æ´«`|XN뤮\u0018詞=ç´©é´˜_sX)㯅鿻á»ì‹¹": 7.168252736947373E-20,
+ "ꛊ饤ï´è¢(逊+~⽫얢鈮ï«è‰¬O힉7Dç­—S곯wæ“I斞᠈븘蓷x": [[[[
+ -7.3136069426336952E18,
+ -2.13572396712722688E18,
+ {
+ "ç¡¢3㇩R:o칢行E<=\u0018á¬YuH!\u00044U%å炼2>\u001eSi$â“·ê’ˆ'ï‘¿ë ¢gᙫ番ꯒ㛹럥嶀澈v;è‘·é„•x蓎\\惩+稘Uî“´Eᖸﳊ㊈壋Nå«¿â¾æŒŽ,袯苷ኢ\\x|3c": 7540762493381776411,
+ "?!*^á¢çª¯?\u0001ڔꙃw虜ë³îšFgJ?&⨫*uo籤:?}ꃹ=ٴ惨瓜Z媊@ત戹ã”똩Ԛ耦Wtè½\\æž’^\\ꩵ}}}ꀣD\\]6M_⌫)Hè±£:36섘㑜": {
+ ";í™—á°°U஋㙛`D왔ཿЃS회çˆ\u001b-㢈`ë´†?盂㛣듿ᦾ蒽_AD~EEຆ㊋(eNwk=RÉ å³­qï’«\"5Ἠ婾^>'ls\n8QAK<l_⭨穟": [
+ true,
+ true,
+ {"ﳷm箅6qⷈ?ﲈ憟b۷⫉἞V뚴少U呡瓴ꉆs~嘵得㌶4XR漊": [
+ "í†ä»‹fM暪$9K[ㄇìƒí³æ’¦gæ’Ÿæ¸jÒFã¹¹aj bHᘀ踉êŽï¼£ç²„ a?\u000fKì¦‰î¶¯éƒ å¹¨9D舢槷Xh뵎u훩Ꜿ턾ƅ埂P埆kë©€{䢹~?D<\/ê¼¢XR\u001b〱ä½ê¼¨i㘀ḟ㚺A-挸",
+ false,
+ null,
+ -1.1710758021294953E-20,
+ 3996737830256461142,
+ true,
+ null,
+ -8271596984134071193,
+ "_1Gí‰í…‘m䮔鰼6멲Nmꇩſt쓟íŠN许FDï¡€j+3^ﶜ⎸\u0019⤕橥!\"sî•—-뾞lz北׸êšëž¬)?l⻮고iä‘°\u001f䪬",
+ 4.459124464204517E-19,
+ -4.0967172848578447E18,
+ 5643211135841796287,
+ -9.482336221192844E-19,
+ "౪å†é‡¶9D?sèž­X榈枸j2ç§€vï ˜î ]泌鰚岒èµè½€ìŒ¶ïŠ›ií…½qMbL]R,",
+ null,
+ [
+ null,
+ {"M쪊ꯪ@;\u0011罙ꕅ<eáº|爑Yâµ<\/&ᩎ<腊ሑᮔ੃Fè±­": [
+ "^0࡟1ë³Pí‹áæˆF⨥Iê‚´\"z磣Vâ…¡=8í€2]䢹h1\u0017{jT<Iç…›5%Dì…Sâ‘™â…J*ìƒ å·™àº”ï€¢;᧡䙞",
+ [{
+ "'ã¶¡í¾é„§`è·Š\"gV[?u᭒Ʊ髷%葉굵aë¦Nì¼§Qﯳy%y䩟髒L䯜Säµ³r絅肾킂á'ꔦg긓a'@혔যWè°á¬F栩ŷ+7wéžš": 6.3544416675584832E17,
+ "苎脷v改hmìµ|㋊g_ᔠ뒨蹨峟ìŽã·¸|Ο刢?Gͨ옛-?î¨Gꦱî«î“©IEYUX4?%ꘋᆊ㱺": -2.8418378709165287E-19,
+ "誰?(H]N맘]kæ´³\"qï±è’§è˜ž!Rí«\\(Q$T5Nå â«£ìœ¿6|럦ì†ï¸…ï­—(": [
+ "峩_\u0003A瘘?✓[硫䎯á½uጭ\"@Y綅첞m榾=è´®9R벿῜Zï §",
+ null,
+ "䰉㗹㷾Iaáƒqcp쓘὾൫Q|ﵓ<\/ḙ>)- Q䲌mo펹L_îŽ¦ì¹æ¨–庫9ê©ìª¹á˜¹ä‘–ç€aK îž?*趤fë­“å»p=磕",
+ "î“å“‘z懅á¤-ê¹ux쀭",
+ [
+ true,
+ 3998739591332339511,
+ "ጻ㙙?᳸aK<\/囩U`B3袗ﱱ?\"/ké”ä§2ï…¤l@쿎VZ쨎/6ꃭ脥|B?31+on颼-ê®§,O嫚m à¡­`KH葦:粘i]aSUì“™$ì‚f+詛頖b",
+ [{"^<9<ç®&絡;%iï«¡2攑紴\\켉hì“™-柂äšven\u20f7浯-Ꮏ\r^í›ä“ší—¬\u000e?\\ã…¡ÖºJë–·VOt": [{
+ "-௄å¶k㘆í˜à®½y⎱㢬sS઄+^瞥h;á¾·jî­;抭\u0003ë°«f<\/5â°§ï§§ï¡™_朻ï—%*[-撵䷮彈-芈": {
+ "㩩p3篊G|宮hz䑊o곥j^Co0": [
+ 653239109285256503,
+ {"ê¶²?|\":N1Û¿æ°ƒNZ#깩:쇡o8킗ࡊ[\"ë¸Po핇1(6é°$膓}â½*)渽J'DN<ì™ê¸˜æ¯¦ë²Ysì¹–": {
+ "2Pr?Xjㆠ?æ®/?㓦柖馃5뚣Nᦼ|é“¢rè¡´ã©–\"ç”æ¹—Üæ†": "\"뾯ië‡ç­ç‰»$ç²/4ka $åŒíœ´ï‹è¯‘zbAá©ê‡¸ç‘…&뵲衯ꎀᆿ7@ꈋ'ᶨH@á ´l+",
+ "7뢽ëšv?4^ꊥ_⪛.>pởr渲<\/⢕疻c\"g䇘vU剺dஔ鮥꒚(dïŸv祴Xâ¼¹\\îºa8y5å†": true,
+ "o뼄Bìšžç¾hrï·”í˜ë’šâ¿›U5pꪴfg!6\\\"爑ì䢱W<ï¶•î\\í…£ç‡oI/BK뺡'谑♟[Ut븷亮g(\"t⡎有?ꬊ躺ç¿è‰©nl F⤿蠜": 1695826030502619742,
+ "ÛŠê¹–>ࡹ햹^ⵕ쌾BnN〳2C䌕tʬ]ì° ?ݾ2饺蹳ã¶êŒ­è¨\"â—¹á¬D鯎4e滨T輀ﵣ੃3\u20f3í‚™D瘮g\\擦+泙᧠鬹ﯨַ肋7놷郟lPå†{ß’hà§œr5,ê“‹": null,
+ "ΉN$y{}2\\N﹯ⱙK'8ɜͣwt,.钟廣䎘ꆚk媄_": null,
+ "䎥eᾆá¦î‘§ì‰,JÞªn岪ã¥sî­•æ–謽䚔5tã¯ï–µï£šã°³ã±ŠZhD䃭f絕s鋡篟îža`Q鬃┦鸳n_é‚(E4è¿ _è§…ë·_宪D(NLî²ç–¶hL追V熑%]vè‚«=惂!㇫5⬒\u001fï²å–º4랪옑": {
+ "2aè¼85먙R㮧㚪Sm}E2yîŠê†£ê«¨rRymã±è†¶á”¨\\tç¶¾A☰.ç„„ë™—9<쫷챻䒵셴᭛䮜.<\/慌꽒9å»Okä°ŠZ㥪幸k": [
+ null,
+ true,
+ {"쌞ì": {
+ "â–ŸGL K2ië›±iï¼±\"Ì .옛1X$}涺]éŽæ‡ Ú¦ëŠ·?tfçŸÝžã‚Ÿ{": 1.227740268699265E-19,
+ "ê’¶]퓚%ฬKâ…": [{
+ "(à·›@Ç®ã£ä§¼äµ¤[aテൖvEnAdUë –ë—ˆ@볓yꈪ,mÔ´|꟢ìº(而첸죕CX4Y믅": "2⯩㳿ꢚ훀~迯?᪑\\啚;4X\u20c2è¥B箹)ä¿£eá»»w䇄",
+ "75༂f詳䅫ê§é¿ }3\u20b5'∓ä±è™€fè¼î‘”Iq鈆﨤gí©)BFa왢d0뮪痮Mé‹¡nw∵謊;ê§f美箈ḋ*\u001cî±ïœŸ`퇚í‹ä³«$!V#N㹲抗ⱉçŽ(V嵟ï«_bã³…\u0019": null,
+ "e_m@(i㜀3ꦗ䕯䭰Oc+-ë ¨0뭦⢹苿蟰ê‚SVä°­å‹¢ë¥.ྈ爑Vd,á•¥=í€)vz뱊ꈊB_6듯\"?{ã’²&㵞뵫ç–ë¡ë¯ˆ%Qwé™,?\ræž®\"? N~癃ruà¡—dn&": null,
+ "㉹&'Pfs䑜공j<\/?|8oc᧨L7\\pX᭠9᪘": -2.423073789014103E18,
+ "ä„瑄䢸穊f盈᥸,Bî§§ë¾§í‘—íšµB1쟢f\u001f凄": "é­–âš2儉j꼂긾껢嗎0ࢇ纬xI4]ï„(à©“`蕞;픬\fC\"æ–’\")2æ«·I﹥迧",
+ "ퟯ詔xæ‚ë ¹+T?Bg⥄섅kOeQí¼ã»´*{Eé¼6æ°¿L缋\u001c둌๶-㥂2==-츫I즃ã ï–˜Lg踞ꙂEG貨鞠\"\u0014d'.ç¼—ï¡gI-lIb䋱ᎂDy缦?": null,
+ "î’¢ç´Mã¦çŠ¿w浴詟棓쵫G:äœ?V2íž½7N*n&ã–ŠNd-'ຊ?-樹DIv⊜)g䑜9뉂ㄹí‘阉~ê…쵃#R^\u000bïž®B䌎䦾]p.䀳": [{"ϒ爛\"ꄱ︗竒G䃓-î†ã¾å¸³ã‚.j)qguæ‰å¾£à¨Zé¼—A9A鸦甈!kè”å–™:3Tî†%&ã ˜+,ä·ž|ì±½v䚞문H<\/醯rì…“ã¶¾\\a볜åºzEä·_죤ဵ뿰᎟CB": [
+ 6233512720017661219,
+ null,
+ -1638543730522713294,
+ false,
+ -8901187771615024724,
+ [
+ 3891351109509829590,
+ true,
+ false,
+ -1.03836679125188032E18,
+ {
+ "<?起HCᷭ죎åŠîŒŽèއ逰/{gs\u0014⽛㰾愫tï¿–<솞ڢëŒç…²è†ºà¨»9x닳xà¡­Q訽,ᶭඦtt掾\"秧㺌d˪䙻꫗:á­ˆh4ç·žç—䤴c뫚떩త<?ᕢ謚6]í›Oé°é‹›é• è´©èµŸ\"<Gâ™·1'": true,
+ "቙ht4ßBqꦤ+\u0006멲趫ç”)椾": -1100102890585798710,
+ "ç·å…Žê³‡ë‡¸ç²ŸF醇;朠?厱楛㶆â¶7râ¾›o꯬᳡F\\머幖 㜦\f[æ¦á¥½ã®£0䕊?J㊳뀄e㔔+?<n↴å¤î§·": [
+ "4~ê‰ç¾\\å®(泤å•빜\u0014>j랎:g曞ѕᘼ}链N",
+ -1.1103819473845426E-19,
+ true,
+ [
+ true,
+ null,
+ -7.9091791735309888E17,
+ true,
+ {"}蔰鋈+ê¨å•µ0?g*사%`J?*": [{
+ "\"2wG?yn,癷BK\\龞䑞x?蠢": -3.7220345009853505E-19,
+ ";饹়â€)çš‹`噿焒j(3â¿w>å5X<np?<줯<Y]æ˜!J೸UⳂNे7v௸㛃ᄧ톿䨷鯻v焇=烻TQ!F⦰䣣눿Ké·šëˆ'â­²mæ (äš»": [
+ "蹕 淜੃b\"+몾ⴕ",
+ null,
+ 35892237756161615,
+ {
+ " 듹ã)5æ…ç®±&$~:é°ì®<\/å ‹?% \\勽唅zì†å¸‹ä˜ºH髀麡M퇖uz\u0012m諦d᳤콌æ¨\rX싹̡á²": -433791617729505482,
+ "-j溗ࢵcz!:î€}✽5à´‡,욨Ýs#ë«=å—æµº^}E\\Y\\T*뼈cdêºcÛ˜ïµëŽä¨¸ë±K䠴㉿æ¿é€³îŽœ@wî·¿fì¢<\/[L[": -9.3228549642908109E17,
+ "Ms킭uà®—%\\uâŽ/家欲ἅ答㓽/꯳齳|㭘Pr\"v<\/禇䔆$GA䊻˔-:틊[h?倬è¤á¾žà§³.Gw\u000b": [
+ "0宜塙I@ä´è‰\\Uyë’…=2<hæš’ï…£K._è´¡ç’Yi檻_⮵uá㘗è [f\u0015힢Hê”®}጑;ï´èªyf0\"\u20cc?(=qæ– âž½5ꎾ鞘kⲃ",
+ -2.9234211354411E-19,
+ false,
+ true,
+ {
+ "\u0011⟴GH_;#怵:\u001c\u0002nîž»1U\\p/ì™”(┫]hêšî·ƒ7\r0䵷첗岷O௷?î·°ãŽ[殇|J=?韷pᶟ儜犆?5კ1kê–iH竧뛈ପdmk游y(콪팱ê¾k慧 yè¾£": [
+ false,
+ "O\"ëp覈ykv磂㢠ãµ~뀬íŠlC&4솎䇃:Mj",
+ -7.009964654003924E-20,
+ false,
+ -49306078522414046,
+ null,
+ null,
+ 2160432477732354319,
+ true,
+ "4íš¡h+!踹ê¬P鮄{0&ë±¥M?ìƒéž…n㮞ᨹ?쒆毪l'ç®…^ꚥ頛`e㻨52柳⮙嫪࡟딯a.ï‘„~äµ®1få˜N&zÈ­L榓ۃ鳠5d㟆M@㣥ï Ó‹AÎq0縶$",
+ -3.848996532974368E16,
+ true,
+ null,
+ -3.5240055580952525E18,
+ {
+ " vï­·áµ#ce乃5僞?Z D`묨粇á”ç» vWLè­¢uë½€\\J|tâ“™tâ„–\"ꨋnT凮ᒩè‚ç¯b騩:䢭Hbvì»å³¨z㹚T趗햆귣학津Xiï¼¹@á–¥K": true,
+ "!F 醌yï䉸W2ꇬ\u0006/ä’7~%9擛햀徉9â›°+?㌘;ê “X䇻Dfië¼§ì’’\u0012F謞Õ絺+臕kà¤LSQìŒX쎬幦HZ98è’Šæž³": "澤令#\u001dæŠâ›³@Næ•퀂[5,✄ꘇ~䘷?\u0011Xꈺ[硸⠘⛯X醪è¡x\u0007쌇MiX/|ï¾ëšK8ä¡î¿¥W)銀q僞綂蔕E",
+ "6â²ä£–Rà§ž@ငg?<\/à³´xé™™Xꈺ崸⠅ᇾ\\0X,H쟴셭A稂ힿã‚F\\쑞\u0012懦(Aᯕç­~î½”\u0001ê»®X?逊": 5.7566819207732864E17,
+ "[c?椓": false,
+ "kä’‡": 2583824107104166717,
+ "꙯N훙ã…ﮒ燣㨊瞯咽jî™Mxby뻭뵫װ[\"1畈?à§±L": "ë£á”‚魠羓犴ꚃ+|rY",
+ "ë…ºZ?îˆä¬ï“©é‰‰îˆ­:?â³™ç˜Cኯ.Vs[釿䨉ì§\\\\*쵢猒$\\y溔^,㑳": {"藶꺟": [{
+ "\"d훣N2zq]?'檿죸忷篇ﮟ擤m'9!죶≓pë­»\\ᇷ\f퇶_ä°¸hà¹Q嵃訾㘑従ꯦ䞶jL틊ræ¾µOmᾫ!H䱤팼/;|á­ºI7슎YhuXiâš¼": -1.352716906472438E-19,
+ "M⽇倻5Jä‚«à¤”á”æ¥¸#î „î¾–J[Fﹱ쫮W誻bWz?}1\"9硪뻶fe": "盬:Ѹ砿íšë•£T凊(mç¦å‘œï»R㿎艴䂵h",
+ "Rë¾k힪CHé’™_i苮ⰵoᾨ紑퉎7h؉\"柀è½z0့\"<?嘭$èœ?礲7岇槀묡?Vé’¿T⣜v+솒çšÔ›2ç±³mH?>è–™å©è¿3aFÆÃ": "2,ê“´g?_섦_>Y쪥션钺;=趘F~?D㨫\bX?㹤+>/믟kᠪ멅쬂Uzỵ]$ç§`mé›ç‘Šî’ඖ鯬cꙉ梢f묛bB",
+ "♽n$YjKiXX*GOè´©éƒè±®ç¥´éžK醞眡}ê—¨v嵎꼷0à­¸+Mè‹eH徸Jîžê£†:â¼æ‚¥B켽迚㯃bè«‚\u000bjꠜ碱逮m8": [
+ "푷᣺ﻯd8ﱖ嬇ភHîªé¹Žâ¡±á±…0g:æžœ6$GQ췎{vá·§Yy-è„•xå¹ç ¡ï¨¬â®¸Cï§‚êš=軄H犠Gè°–ES詤Zè ‚3î§™lë´Ÿhï¿’7䦹1GPQG癸숟~[#é§¥8zQ뛣J소obg,",
+ null,
+ 1513751096373485652,
+ null,
+ -6.851466660824754E-19,
+ {"ä©‚-â´®2Ù°K솖풄꾚ႻP앳1Hî³é·›wmR䗂皎칄?醜<\/&à §ã¬X濬䵈K`vJ륒Q/IC묛!;$vÏ‘": {
+ "@-êš—xྐྵ@m瘬\u0010U絨ﮌé©\\켑寛넆T=tQã­¤Lì—°@脸삯e-ï–…î–‘:⩼u㎳VQ㋱襗ຓ<Ⅶ䌸cML3+\u001e_C)r\\9+Jn\\Pﺔ8蠱檾è…Pqé³è¯î¦§Tä„I": -1.80683891195530061E18,
+ "á·­á‹»U~ཷsgSJ`᪅'%ã–”n5픆桪砳峣3ç®æž¾äŒ·âа呀ïŒ": {
+ "Ş੉䓰邟自~X耤pl7间懑徛s첦5ਕXexh⬖鎥á€nNr(J컗|ૃF\"Q겮葲놔엞^겄+㈆è¯ã€¾í¬ç´G'E?飕1fâ¼í…¬æ‚šï•¦æ³¬ë¨Uç¬í›¶Qs": false,
+ "î³…(\u20dag8í½íŠ£>^Y{뤋.袊䂓î†;_ïg]S\u202a꽬L;^'#î—™ë•bႌ?Cç·¡<ä²ä²æ–­ê6\u001asD7IK5Wxo8\u0006på¼Šâ¼‚ê¯æ‰µ\u0003`뵂픋%ꄰ⫙ë¶lå›å°›ïˆ®+ä—…E쟇\\": [
+ true,
+ {
+ "\n鱿aKã¡â’ã¼™2ì´¹f;`ì¾qIà¡”G}ã·äç“°w늮*ç²…9뒪ㄊCj倡翑閳R渚MiUO~仨䜶RꙀA僈㉋⦋n{ã–¥0딿벑î§é€¦â¥»0î¾®h薓쯴ê»": [
+ 5188716534221998369,
+ 2579413015347802508,
+ 9.010794400256652E-21,
+ -6.5327297761238093E17,
+ 1.11635352494065523E18,
+ -6656281618760253655,
+ {
+ "": ")?",
+ "TWKLꑙ裑꺔UE俸塑炌Ũ᜕-ï’‚o\"徚#": {"M/癟6!oI51niíš=댡>xê¨\u0004 ?": {
+ "çš­": {"⢫䋖>u%wî²´ìž¼<ä•ê˜P䋵$é­‹æ‹U䮎緧皇Y훂&|羋ꋕ잿cJ䨈跓齳5\u001a삱籷I꿾뤔S8㌷繖_Yឯ䲱B턼Oæ­µF\\l醴o_欬6ç±=D": [
+ false,
+ true,
+ {"Mt|êžD|Fê¶£MQ뵕T,ëºk+?ãµi": [
+ 7828094884540988137,
+ false,
+ {
+ "!༦鯠,&aﳑ>[euJê½ç¶·æB.h": -7648546591767075632,
+ "-n켧嘰{7æŒæ¯„Y,>â螵煫乌pv醑Qå¶š!|âŒè²¬0왾ë¢ê…蛨S\\)ç«°'舓Q}A釡5#v": 3344849660672723988,
+ "8é–ªéºV=鈢1녈幬6棉⪮둌\u207d᚛驉ꛃ'r䆉æƒà¥ˆ|bἧﺢᒙ<=穊强s혧eꮿ慩⌡ \\æ§³W븧J檀C,ᘉì˜0俯퀉M;筷ࣴ瓿{늊埂鄧_4æ¸Nn阼Jੵ˥(社": true,
+ "oë¼€vwï…®)4A뢵(î¼±a䵢)p姃뛸\u000fK#KiQp\u0005ê…芅ì…îª": null,
+ "ç ¥$ꥸ┇耽uæ–®Gc{z빔깎밇\\숰\u001eê´·å„㶇쵿_á´„+hç©¢p촀Ნ䃬zäé…³Ó‚31xꔄ1_ç šWë ˜G#2葊P ": [
+ -3709692921720865059,
+ null,
+ [
+ 6669892810652602379,
+ -135535375466621127,
+ "뎴iO}Z? 馢녱稹ᄾä©rSt帤넆&7ié¨ë©—ç•–ï”9誧鄜'w{Ͻ^2窭외b㑎粖i矪ꦨ탪跣)KEㆹ\u0015V8[W?⽉>'kc$䨘ᮛ뉻٬M5",
+ 1.10439588726055846E18,
+ false,
+ -4349729830749729097,
+ null,
+ [
+ false,
+ "_è ¢ã ^䟪/D녒㡋ỎCä’ˆíŒïŒ¢\u0006àªq@O펢%;é¹ìŒo戥~A[ꡉ濽ỳ&虃᩾è£å”™ï¤£èŒ¨Ig楡꒻M窓冉?",
+ true,
+ 2.17220752996421728E17,
+ -5079714907315156164,
+ -9.960375974658589E-20,
+ "ᾎ戞༒",
+ true,
+ false,
+ [[
+ "ⶉᖌX⧕홇)g엃⹪xëšç™Ÿ\u0002",
+ -5185853871623955469,
+ {
+ "L㜤9ợㇶKé°â‹“V뽋˖!æ–«as|9"á¬ä†ª?î¾¶7胜&n薑~": -2.11545634977136992E17,
+ "O8뀩D}캖qè‚6༣ã—䈓煮å½à¨†á޼Dᣘí›;": false,
+ "YTá¡…^ï—Lã—ŽcbY$pᣞ縿#fh!ꘂb삵玊颟샞ဢ$ä—é¼’ëª~rkH^:닮먖츸륈⪺쒉砉?㙓扫㆕꣒`R䢱Bé…‚?C뇞<5Iޚ讳騕S瞦z": null,
+ "\\RB?`mG댵鉡å¹ç‰©äµŽæœ‰5*e骄T㌓ᛪç¾é§’Ku\u001a[柆jUq8⋈5鿋츿myï»—?é›ux঴?": 5828963951918205428,
+ "n0æ™…:黯 î¶·xu씪^퓞cB㎊á¬âº˜Ù¤Öƒ~B岚3㥕擄vᲂ~F?Cä¶–@$mï›~å¿”S왖㲚?챴⊟W#벌{'ã°Iä ç¸s樘\\X뢻9í•¡I6èㄛî‚î«8쯶]wॽ0L\"q": null,
+ "x增줖j⦦tä¢áŽ™ïŠ­ã›¿Yf鼘~ê«“æ„4惊\u209c": "oOhbᤃ᛽z&Bi犑\\3B㩬劇䄑oÅ쨅孥ë©àº–acA㖫借ãžvg싰샂ãœ#譞⢤@k]鋰嘘䜾L熶塥_<\/â¾å±ˆï®Š_mYè¹t뙺}Ox=wé®®4S1ê©ï¬¾'å·‘",
+ "㗓蟵ꂾe蠅匳(JPä—à·¸\u0089耀왲": [{
+ "ᤃ㵥韎뤽\r?挥O쯡⇔㞚3ä¼–\u0005Pî•⋪\"Dê¶£QLn(⚘罩䩢Ŏv䤘尗뼤ë›O淽鋋î¡é—šrå´©a{4ç®™{煷m6〈": {
+ "l곺1L": {
+ "T'ਤ?ç …|੬Km]ä„©\"(à¿¶<\/6U爢䫈倔郴l2ã´±^줣k'Læµ–Lé°„Rp今鎗⒗Cì–¨Mí›ã¡§Î˜X粜뫈N꤇輊㌻켑#㮮샶-ä—룲è ç™œã±V>=\\I尬癤t=": 7648082845323511446,
+ "鋞EP:<\/_`á§e混ㇹBd⯢㮂驋\\q碽饩跓྿ᴜ+j箿ë ã—‘yK毢宸p謹h䦹乕U媣\\炤": [[
+ "3",
+ [
+ true,
+ 3.4058271399411134E-20,
+ true,
+ "æ€+憱f逮@먻BpW曉\u001aã£âŽŠ$n劈D枤㡞좾\u001aá›ïŒƒè‹”౩é—1B䷒Ṋ݋âžê€žêƒç£$t੤_:蘺⮼(#N",
+ 697483894874368636,
+ [
+ "vᘯ锴)0訶}䳅⩚0O壱韈ߜ\u0018*Ué¾ä–=䧉뽑å•휻ID쿇嘗?ꌸῬ07",
+ -5.4858784319382006E18,
+ 7.5467775182251151E18,
+ -8911128589670029195,
+ -7531052386005780140,
+ null,
+ [
+ null,
+ true,
+ [[{
+ "1欯twG<uä®â½ê‡£_ჟﱴଶ-쪋\"?홺k:èŽêœª*⺵꽹댅釔좵}P?=9ë ¿46b\u001c\\S?(筈僦⇶爷谰1ྷa": true,
+ "TҫJYxÚª\\鰔℮혡)m_WVi眪1[71><\/ï†Q:0怯押殃탷è«ì‚¬<ỗꕧ蚨ä¡ï¨î³‰nDꌕ\u001cë…¬~è“©<N蹑\"{ä«¥lKcí˜ë«–앺:vⵑ": "gæ§µ?",
+ "aꨩ뻃싥렌1`ë¡—}Yg>鲃g儊>ê¡l㻿/â‘·*ì±³6㻜W毤緛ﹺᨪ4\u0013뺚J髬e3쳸䘦伧?æª&{L掾p+꬜MäŠd娘6": {
+ "2p첼양棜h䜢﮶aQ*c扦v︥뮓kC寵횂S銩&Ç{O*य़iH`Uí…à¡“rä©•5ꄸ?`\\á§«?ᮼ?t〟崾훈kè–ì/iy꤃뵰z1<\/AQ#ë¿©8jJ1z@u䕥": 1.82135747285215155E18,
+ "ZdN &=dë…„á…†'ì‘â…‰:烋5&áŸï”‹á„‚汎æ¥L㯄固{é’§u\\ãŠíŠšeæ‘‘&tå—„ê–„UbâŒ?m䴘熚9EW": [{
+ "ଛ{i*a(": -8.0314147546006822E17,
+ "⫾ꃆY\u000e+W`௸ \"Më’¶+\\ë·lKE}(NTí‚¶Yjé¸ç¯’î©¥ì¶'jNQ硾(똡\\\"逌â´y? IRꜘ὞鄬﨧:M\\fâ ‹Cꚜ쫊ᚴNV^Dä•—ã…–á¼”Iao꿬Câ8": [
+ 287156137829026547,
+ {
+ "H丞N逕<rO䎗:í…•<\/䶩샌Sd%^ᵯëˆ엑者g䖩똭蕮1U驣?Pâ°°\u001fp(W]67\u0015ï«£6굺OR羸#ì´Fè’ˆ;嘙i✵@_æ’¶yã¤â¤(:᧗뼢༌朆@â°ã¤¨ê­²?-n>⯲": {"": {
+ "7-;枮阕梒9ᑄZ": [[[[
+ null,
+ {
+ "": [[[[
+ -7.365909561486078E-19,
+ 2948694324944243408,
+ null,
+ [
+ true,
+ "荒\"并孷䂡쵼9o䀘F\u0002龬7⮹Wz%厖/*? a*R枈㌦ë¾g뒠䤈q딄㺿$쮸tᶎ릑弣^éŽ<\/Y鷇驜L鿽<\/ì¶‹9Mᲆឨ^<\/庲3'lë‚¢",
+ "c鮦\u001bë‘\\~?眾ಢu݆綑෪蘛轋◜gȃ<\/â´ƒcpkDt誩܅\"Y",
+ [[
+ null,
+ null,
+ [
+ 3113744396744005402,
+ true,
+ "v(y",
+ {
+ "AQ幆h쾜O+꺷铀ꛉ練A蚗⼺螔jãŒ3꽂楎䥯뎸먩?": null,
+ "蠗渗iz鱖w]擪E": 1.2927828494783804E-17,
+ "튷|䀭n*曎b✿~æ¤U]î­¡Gz鄭kW|ã´š#㟗ഠ8u擨": [[
+ true,
+ null,
+ null,
+ {"⾪壯톽g7?㥜ώQê‘㦀æƒã§½î“¡ä¼“\\î¦*᧰閖樧뢇赸N휶䎈pIæ°‡ï®é•Šmaᬠ탷#X?î³A+kÐM ༑᩟Ø?5꧎鰜ṚY즫궔 =ঈî³;ﳈ?*s|켦蜌wM笙莔": [
+ null,
+ -3808207793125626469,
+ [
+ -469910450345251234,
+ 7852761921290328872,
+ -2.7979740127017492E18,
+ 1.4458504352519893E-20,
+ true,
+ "㽙깹?ë¨ä†¢:ä´ŽÛ»gæ® JBTU⇞}ꄹꗣi#Iî’¡ëµ£é‰r혯~脀ìƒ#釯:场:ä”>ä°®o'ã¼½HZ擓௧nd",
+ [
+ 974441101787238751,
+ null,
+ -2.1647718292441327E-19,
+ 1.03602824249831488E18,
+ [
+ null,
+ 1.0311977941822604E-17,
+ false,
+ true,
+ {
+ "": -3.7019778830816707E18,
+ "Eå³¾æ†èŒ6xLIm縂0n2视֯J-ᤜz+ᨣè·mYDè±ç¹¹â¹ºäŠ“ëª“ï´€E(@è©®(!ï’Y膽#᎙2䟓섣A䈀㟎,囪QbKæ’wcG湎ꤧtGì—xâ¥ä¿Žj'A一ᯥ뛙6ㅑ鬀": 8999803005418087004,
+ "よ殳\\zDâ§…%Y泥簳Uꈩ*wîRL{3#3FYHା[d岀䉯T稉駅䞘礄P:é—ˆWæ€ElBã¤å–¬èµ”bGä ¼U଄Nw鰯闀楈ePsDꥷ꭬⊊": [
+ 6.77723657904486E-20,
+ null,
+ [
+ "ཚ_뷎꾑è¹q'㾱ꂓ钚蘞慵렜떆`ⴹ⎼櫯]J?[t9Ⓢ !컶躔I᮸uz>3aã •i,錃L$æ°°í…°@7ë…«W㸮?ç¾§W뇧ꃞ,î—‘N鋮숪2ɼì½â”ä²6",
+ "&y?뢶=킕올Za惻HZk>c\u20b58i?ꦶcfBv잉ETî…9jä¡¡",
+ "imçŠÕƒbì¹§<D-è«‚*u2ꡜ췛~䬢(텸ﵦ>æ ¡\\뼾쯀",
+ 9.555715121193197E-20,
+ true,
+ {
+ "<㫚v6腓㨭e1ã•”&&V∌ᗈT奄5Lጥ>탤?튣瑦㳆ꉰ!(ᙪ㿬擇_n쌯IMá¿‹î£ã•¨â°æ«ˆá±·5풔蟹&L.ì²½e鰷쯃劼﫭b#ï­¶í“€7ë·„Wr㢈๧Tʴશ㶑澕é%": -1810142373373748101,
+ "fg晌o?߲ꗄ;>C>?=鑰監侯Kt굅": true,
+ "䫡蓺ꑷ]C蒹㦘\"1à°ƒ@å‘«\u0014NLä¾egå‘®á³,r$裢k>/\\<z": [[
+ null,
+ "Cä¡>?ㄤᇰﻛ쉕1஥'ÄŠ\" \\_?쨔\"ʾr: 9Sä˜ç¦ºáª§ê„‚㲄",
+ [[{
+ "*ç¡™^+E쌺I1䀖ju?:⦈Ꞓl๴竣迃xKC/饉:\fl\"XTFᄄ蟭,芢<\/骡軺ëœhê˜\u001f銿<棔햳▨(궆*=ä¹¥b8\\媦ä·€ë«}닶ꇭ(Kej䤑M": [{
+ "1á¬?>옿Iâ•…C<ÞŽ?ꊌ冉SV5A㢊㶆z-๎玶绢2F뵨@㉌뀌oå¶”f9-庒茪ç“ë·³4": null,
+ ";lá°³": "CbB+è‚»aä„·è‹*/볳+/4fq=ã°h6瘉샴4é“¢Yéª.⌖@哼猎㦞+'gꋸ㒕ߤï—ãž‘(ä¶’è·²tiâ‘´aî¥ç¡‚#Noë³”",
+ "t?/jE幸YHT셵⩎Kî¹!Eq糦ꗣv刴w\"l$ο:=6:ç§»": {
+ "z]鑪醊嫗J-Xm銌ç¿çµ¨c里ëç‚™Ep㣋é£ë˜¼åšŒä€“GPï¹–cmf4é¹­T䅿꣭姧â¸wy6ꦶ;S&(}ᎧKxᾂQ|tï¹ë»³k\"d6\"|Mlì·†hwLtê¼¼4$&8Պ褵婶鯀9": {"嵃닢ᒯ'î–›dá§«ä³³#Nî‡Xe3-붋鸿î¢à¬¢ë–“î§ž%dK\u0013䲎ê–YV.裸Râ‰rR3蟛\\:ì ¯:å—ĺLʆ넕>|텩鴷矔ꋅⒹ{tå­¶ã“‘4_": [
+ true,
+ null,
+ [
+ false,
+ "l怨콈lá’",
+ {
+ "0wä²å¬§-:`䉅쉇漧\\Ü‚yㄨb%㽄j7ᦶ涶<": 3.7899452730383747E-19,
+ "ꯛTẀq纤qå¶Vâ¿£?\"g}ი艹(쥯B î­T騠I=仵ë°X": {"KX6颠+&á…ƒ^fç•’y[": {
+ "H?뱜^?꤂-⦲1a㋞&î‘®êƒç²¾Ii᤾챪咽쬘唂쫷<땡劈훫놡o㥂\\ Kâ´™Dç§¼Fæ°®[{'좴:례晰Iq+Iì­¥_T綺砸GOç…䟪ᚪ`î‘↹l羉qì¼Dê½áœ…훦: vUV": true,
+ "u^yï³0㱓#[y뜌앸ꊬLã·©?蕶蘾â»KӼ": -7931695755102841701,
+ "䤬轉車>\u001c鴵惋\"$쯃྆⇻në½€Gæ° Såª]à²²ê¨æ‡Qxኻ椕駔\\9ࣼ﫻ìœç£¡ï©ˆëºªá¶šë³l㕆t+sζ": [[[
+ true,
+ false,
+ [
+ null,
+ 3363739578828074923,
+ true,
+ {
+ "\"鸣詩 î›ë³°ã‘µgLã¯¦á¿…ì¶æ—«}ED辗ﮈI쀤-ꧤ|ã ¦Z\"娑ᕸ4çˆé¨ã£\"]ì³Af]茛⬻싦oèšk䢯ä©è½3廇喑ޅ": 4.5017999150704666E17,
+ "TYႇ7ʠ值4챳唤~Zo&ݛ": false,
+ "`å¡„J袛㭆ëºã³€N㺣`ê½å¶¥Kï¯SVᶔ∲퀠ç¾N딂X\"á¤hNﬨvI": {"\u20bbã­˜I䖵䰼?sw䂷쇪]î(泒f\"~;꼪FÔsá¦": {"p,'ꉂ軿=Aèš¶?bƉãµä…°è«¬'LYKL6B깯⋩겦뎙(ᜭ\u0006噣d꾆㗼Z;ä„äš”cd<情@äž‚3苼㸲U{)<6&ꩻ钛\u001au〷N숨囖愙j=BXWìš•^x芜å á¿™çˆ‚ë›·ê’»t✘Q\b": [[
+ "ç±›&ଃ䩹.ꃩ㦔\\C颫#暪&!勹ꇶ놽攺J堬镙~軌C'꾖䣹㮅ï¶å²ƒá™´éµ£",
+ 4.317829988264744E15,
+ 6.013585322002147E-20,
+ false,
+ true,
+ null,
+ null,
+ -3.084633632357326E-20,
+ false,
+ null,
+ {
+ "\"짫愔昻 Xï«\"è—£j\"\"ë¨à½…ѻ㘤㬯0晲DU꟒㸃dë²€î¢ìœ’l䦾cà©»*3": null,
+ "è°ˆWm陧阦咟ฯ歖擓Nå–´ã‹éŠ­rCCnVࢥ^♼Ⅾ젲씗刊Sà¼+_tèµ”\\bäšë‰¨ê¬«6펛cL䊘᜼<\/澤pF懽&H": [
+ null,
+ {
+ "W\"HDUuΌ퀟M'P4à¿°H똆ⰱﮯ<\/å‡è˜²\"C鴫ﭒж}ꭩ쥾t5yd诪ﮡí‰â´°@?æ°é†³rj4I6Qt": 6.9090159359219891E17,
+ "絛ﳛ⺂": {"è«°Pã—®î˜è¦`ZQ?ꫦh*à´±cbâ§±}埌茥h{棩렛툽o3é’›5é®l7Q榛6_g)ὄ\u0013kj뤬^爖eO4Ⱈ槞鉨ͺ订%qX0Tì—å«·$?\\\"봅늆'%": [
+ -2.348150870600346E-19,
+ [[
+ true,
+ -6619392047819511778,
+ false,
+ [[
+ -1.2929189982356161E-20,
+ 1.7417192219309838E-19,
+ {"?åµ²2à¿2\u0001啑㷳c縯": [
+ null,
+ [
+ false,
+ true,
+ 2578060295690793218,
+ {
+ "?\"殃呎ïˆ#ã‘‘F": true,
+ "}F炊_æ®›oU헢兔êˆ,èµ­9703.Bæ•°gTz3â¬": {
+ "5&t3,í–“Mݸᵣ㴵;꣫ä©â†³#ï¢@ë«·ä …ï¦+W-ࣇzᓃ鿕ಔ梭?T䮑ꥬ旴]u뫵막bBè®:왳둛lEh=숾鱠på’î›î­ˆ$ì§#?gâ¹·á—Švã·µ.æ–ˆu頻\u0018-G.": "ë½™m-ouࣤ஫牷\"`Ksꕞ筼3HlȨvCï¢î›¦å ˆ\"I]㖡玎r먞#'W賜鴇k'c룼髋䆿飉㗆xgå·¤9;芔cáŒ/ax䊨♢í“rå“㸫೼䢗da᩾\"]å±£`",
+ ":M딪<䢥喠\u0013ã–…x9è•ã‘‚XO]f*Q呰瞊å­VP@9,㨣 D\\穎vˤƩs㜂-曱唅L걬/롬j㈹EB8g<\/ì„©o渀\"u0y&룣": ">æ°ç·©L/ä•‘ë¯êŸ˜îŸ”蕞^aBë’£+0jK⪄瑨痜LXK^힦1qK{æ·št츔X:Vm{2rçB뾄H첚7æ°¥?쉟䨗ꠂv팳圎è¸é½€\\",
+ "D彤5㢷Gꪻ[lㄆ@὜⓰絳[ଃç½ì®¹â˜’[*0ꑚ㜳": 9022717159376231865,
+ "Ò–aV銣tW+$é­¿\u20c3ïœäºœ~ë«¡ᙰ禿쨽ã¡fá¹¼zE/h": "5è‡ï’Œã‹‡á²¯ì®º? 昨탰Wム밎#'\"崲钅U?幫뺀â¾@4kh>騧\\0Ò¾EV=çˆî©®ÍŒUæ€%ꉼ 㮋<{j]{R>:gÔ©L\u001c瀈锌ﯲﳡꚒ'â«¿E4æšãŒ—뵉X\"Háœ",
+ "ᱚגּ;s醒}çŠSἿ㦣&{T$jkB\\\tḮ앾䤹o<é¿(tW": "vb⯽䴪䮢@|)",
+ "⥒í껉%惀뗌+녣迺顀qæ¢g⚯i⤭ë£Mç¹j̈́⽜A": -8385214638503106917,
+ "逨ꊶZ<\/W⫟솪㎮ᘇb?ê ”i\"H㧺x෷韒Xꫨฟ|]窽\u001a熑}Agn?Má¶–a<rà°„4Ů䢤슲AxÄ£eê³–ã´¤x竾éƒB謉鸵kè–½M)\"芣眜`è‰ê‰›ä´º": "é¹^ె캫?3耲]|Ü1ä¡’ã®]8e?ä¶^",
+ "뿸樅#P㡊1M룮Uꪭ绢ꑮZ9꽸": {"\nJ^Ñ”|3袄ã…7⨆銦yîµ”çâ‹·ä»´ct?[,<\/ã…¬`?갔髞%æA೚C": {
+ " 䇞3갫䅪": [{
+ "0|â©ã‘‚砕ㅻ": null,
+ "D箳᠉`|=â¼­)\"*࣊ã¦LjO誋": "",
+ "ࠚDZmê—¥}ᷴ╈r7í—´È¥4Kp5a)o}鎘门Læ°ä†“'✎k俎c#T68Óâ©¶î¶6L鎴<r൦$黊BQYã¼³\\è·¿F慮⡨拵贀!ç”¶Vå–…/": null,
+ "âµ£q⳹ﻨLk]晩1*y\\$%}ä–¶P煑㇆䈦E嫿«•Y࣓嫨ä“OL낮梚㸇洛洚BYtgl∛S☕䉓宑⋢粚ꔯ꠼붠": ")ꬑ윤`\"â°£<\/婽*Y䔸ᓰ_ï³t슲å©éš¥&S糧䛮闵诌è±sh쯽邴*ì„´ØÍŽ=㯨\"RVíž³,^t\"ac?䤒ꉀxHa=Uꛕã™î·“TkF껾",
+ "å¼¾cUAF?暤cë½.欀nKì•­]r傊䀓ﯳ馽垃[䥛oI0N砊鈥헅Co쟋钄ㅷ㊌뷚7": [
+ null,
+ "à«“é¨?^ä†{\u0006`X䧵儱&롡尙砡\u0006ë»ì‘¬sjâ–»Xfᬶgcã„¢V >9韲4$3á»´^=ì煤áë·2䣃%ï…Žé· /eQ9頸쥎",
+ 2398360204813891033,
+ false,
+ 3.2658897259932633E-19,
+ null,
+ "?ꚃ8Nnãž·å¹µd䲳䱲뀙ꪛQ瑓鎴]î’¶ä©‹-é°¾æ¡ï¾ä³¡??掊",
+ false,
+ -1309779089385483661,
+ "ᦲxu_/yecR.6èŠ.áœ‡éŽ ~",
+ -5658779764160586501,
+ "ì’Œ:æ› =lìœä¢œwk#s蕚\"互㮉m䉤~0ë“䋙#Gîš¿;h숄옥顇෤勹(C7㢅雚ã¯Lâ …VVç°…<",
+ null,
+ -4.664877097240962E18,
+ -4.1931322262828017E18,
+ {
+ ",": {
+ "v㮟麑䄠뤵g{Më®.\u001bzt뢜뵡0Ǥ龍떟Ᾰ怷ϓRT@Lꀌ樂Uã â¾•e扉|bJg(뵒㠶唺~ꂿ(땉x⻫싉ìŠ;%0鎻V(o\f,NéŠ%nk郼螺": -1.73631993428376141E18,
+ "쟧摑繮Q@Rᕾ㭚㾣4隅待㓎3蒟": [
+ 4971487283312058201,
+ 8973067552274458613,
+ {
+ "`aæ™á£—î\u0015i<S幼訃锭B0&槩✨[Wpçš©[g≊k葾x2ᡆ橲䲢W": true,
+ "kH皈Sê±qå‚‘u?솹풑~o^F=ï¦N*reî••J沤wW苯7pã¼¹äŽa=ꮧLã·©냴nWꌑ㞱uuè°lVNç¿á¤»(eè±¶5#L쪉ᅄ઄\u0015숟봊P瀚X蓎": false,
+ "䫯דּ〖Scä›­ì Lëµ¾pî«“CꙞ\"엇즓_ﰛ톣ꫀ먩㺣㮠⭴!\\Wâ”tä–°è»…y\u0014~ᇰ렢E7*俜䥪W䀩ä·hë´†vjஉ묣à¼G39.뼳輼:㮿á¦A饕TUL}~": [
+ null,
+ 8.8648298810470003E17,
+ 5.735561205600924E-20,
+ null,
+ -102555823658171644,
+ 1.2674932032973067E-19,
+ {
+ "D胣O㯨\u0017Ku눓ã’í…nᨊ!Ꚇ廫_>Bo¸": 4.3236479112537999E18,
+ "HW&퉡ãåœ<W)6æ‚°ê ‘HEp14xy峑ft\u0005s亘V튉䢮ꦈXåµê¬?lI_ë춇-6Ss噺Nk-ﮥíƒÜ郪*ï“­PR(S6â•‹@ä»™V懸뺵ﯜVç²¹": "9䗌斀4ãˆ^Qséš„ç¡j\u0003",
+ "Vké¶…Cæ³¹ç­HX훉朗*r\\z顊誌儖4?n7á¾6몋䎡ﳈ],Hé ¢pèšã‘„P4满Eä©V䬕à¸L廂쒬î®ì‘¨ê†·hè¿¡ê°è­–墎 î‡]鹿ฌ7ﶽ冭༽<ꈓS\\lä‹®?_ユ檒?": -8598528325153980065,
+ "t=qí£ç–»Ñ‚Z\\錅J.镎|nfḷ鴒1厰Lç¯çºœîŒ•E]୦⥪]á®'ç¾p/å’©0닳ï³qﳖཽk ?X1Ft%ś뭢v鋋⺃爵⒗": [[
+ 5.0824756359232045E-19,
+ [
+ 7.268480839079619E-19,
+ {"탿^굞⧕iјëŠê€›w껩6ꟳXsé…š\\>Y?ç‘¡Qyí›q!帰ï©s舠㫸zêš—aSæ­²v`G株巷Jp6킼 (ê·¶é”â¾î‹¥â¡ˆ>Mæ±ãžá‰´ê™²dv@i㳓ᇆ?é»": [
+ null,
+ 4997607199327183467,
+ "E㻎蠫á¾é«˜ä™Ÿè˜¬æ´¼æ—¾ï« í…›ã‡›?'M$㣒蔸=A_亀绉앭rN帮",
+ null,
+ [{
+ "Eᑞ)8<Zî¿—ã¡¿W镀䛒Cìƒî¿«V?0ꯦ+tL)`é½³AjBå§€Xà³³D빠㻲ƙgn9â‘°à¾á¿œ&\"ãš¹>餧A5u&ã—¾q?": [
+ -1.969987519306507E-19,
+ null,
+ [
+ 3.42437673373841E-20,
+ true,
+ "eê±·Må¢\"割Pâ›í§åŽ€R䱜3ï»´Oí“«r﹉⹊",
+ [
+ -8164221302779285367,
+ [
+ true,
+ null,
+ "爘y^-î¬?蘞Ⲽꪓaâ…ê¨}I",
+ 1.4645984996724427E-19,
+ [{
+ "tY좗⧑mrzïºã¿¥â´–᥷jè«…\u0000q賋è­êž„â®±S\nà¡£B/íƒêµª3ZÉ‘å¤o<\/;ë¡‹": null,
+ "彟hæµ _|V4䦭Dᙣ♞uì¿»=ì‚®ã¦\u001e哀鬌": [{"6횣楠,qʎꗇ鎆빙]ã±­R굋鈌%æ ²j分僅ペ䇰wí¦î¼‹p蛃N溈ê¡ê€?@(GI뉬$ﮄ9èªê“š2e甸ڋ[äº,\u0011\u001cࢃ=\\+衪䷨ᯕ鬸K": [[
+ "ㅩ拏鈩勥\u000etgWVî–¨Xs陂è¦p狵w퓼{뮵_i\u0002ퟑႢâ¬d6é‹«F~챿æŸ\u0096äš¼1ۼ칥0꣯å„=鋷牋ⅈêžé¾",
+ -7283717290969427831,
+ true,
+ [
+ 4911644391234541055,
+ {
+ "Iî¹éˆ’ì²½P릜朸W徨觘-HᎄíŸâ“º>8kr1{ê²µäƒã€›á¬¡Ì¨Oê·‘oä•'쿡鉕p5": "fvç²–RNçž–è›a?q꤄\u001d⸥}'ꣴ犿ꦼ?뤋?鵆쥴ë‹ä¡«s矷̄?à¶£/;괱絢oWfV<\/\u202cC,ã–¦0䑾%nè³¹g&T;|lj_欂N4w",
+ "짨䠗;䌕u i+rà¹0": [{"9ä¥\\à°©8\"馇z䇔<\/á‚¡Y3e狚ì¡\"ุ6ï°†Zé–c\"Ll:ïŠê®¾ç–£<\/᭙O◌납୕湞9⡳Und㫜\u0018^4pj1;ä§å„‚ä—·à­—>@e톬": {
+ "aâ‘‚Fé‹»Qèž°'<퇽Qè´ç€§{ᘪ,cP&~䮃Z?gI彃": [
+ -1.69158726118025933E18,
+ [
+ "ê¶‚z簽㔛㮨瘥⤜䛖Gℤ逆Y⪾j08î±²Sn昞ꘔ캻禀鴚P謦b{ê“®mNéMᥙ5\"ç2냑I\u0011.L&=?6á„ ë»·X鸌t刑\"#z)o꫚n쳟줋",
+ null,
+ 7517598198523963704,
+ "ኑQp襟`uᩄr方]*F48ꔵn俺ሙ9뇒",
+ null,
+ null,
+ 6645782462773449868,
+ 1219168146640438184,
+ null,
+ {
+ ")ယ넌竀Sdä°¾zqâ«£âŒÊ¥\u0010á¿“' |磪&p牢蔑mï³V蘸૰짬꺵;K": [
+ -7.539062290108008E-20,
+ [
+ true,
+ false,
+ null,
+ true,
+ 6574577753576444630,
+ [[
+ 1.2760162530699766E-19,
+ [
+ null,
+ [
+ "顊\\憎zXB,",
+ [{
+ "㇆{CVC9ï¼MN㜋ઘR눽#{h@ퟨ!鼚׼XOvXS\u0017á£=cS+梽៲綆16së½íœy屬?ᇳG2á´­\u00054쫖y룇nKcW̭炦s/鰘ᬽ?J|퓀髣n勌\u0010í™ P>j": false,
+ "ç®´": [
+ false,
+ "éžj\"ꮾ*엇칬瘫xṬ⭽ì©äƒ³\"-⋵?ᦽ<cਔ↎⩧%鱩涎삧u9K⦈\"á¿á¬‘V绩킯愌ṱv@Gê¾è·¶êš†(?ä–ƒvIá§ŠxV\r哦jã ’?*=S굤紴ꊀ鹭쬈s<DrIu솹꧑?",
+ {
+ ".}S㸼L?t\u000fK⑤s~hU鱜꘦}ìªC滈4ꓗ蛌):ྦ\"é¡¥ì´â¢·ïš­á¿³YLn\"?fꘌ>댎Ĝ": true,
+ "Pg帯佃籛n㔠⭹࠳ë·â‰»à¿Ÿ3ãž±ï“!î—-ì’¾!}쭪䃕!籿næ¶»J5ਲ਼yî˜vy;Rኂ%ᔡጀ裃;M⣼)쵂쑈": 1.80447711803435366E18,
+ "ꈑC⡂ᑆ㤉壂뎃Xub<\/쀆༈憓قì¨×§\\": [
+ 7706977185172797197,
+ {"": {"K╥踮砆NWࡆFy韣7ä밥{|紒︧䃀榫rᩛꦡTSy잺iH8}ퟴ,M?Ʂ勺ᴹ@T@~꾂=I㙕뾰_涀쑜嫴曣8IY?ҿo줫fऒ}\\S\"ᦨ뵼#nDX": {
+ "♘k6?଱癫d68?㽚乳䬳-Vé¡·\u0005è•?\u0018䞊V{邾zã˜l]é›k臤~ൖHë’iꢥ]g?.G碄懺䔛p<q꜉Så²—î¥_.%": 7688630934772863849,
+ "溗摽嗙Oã§€,⡢⼰呠ꅧ㓲/葇䢛icc@-r\b渂ꌳ뻨饑è§á–œ\\é®­\u0014엙㥀᧺@æµ¹W2꛵{W률G溮킀轡䬆g㨑'Qè¨ï†áŸªç½‘Hd\"Q늴ᱢﶨ邮昕纚枑?â–°hr羌驀[ç—¹<\/": [
+ -1.0189902027934687E-19,
+ {"窶椸릎뚻shE\"ꪗႥꎳU矖佟{SJ": [{"-æ…œx櫹XYîƒ-æ¾Ü¨â£·àª¢ïŸé¯™%Fu\u0000è¿‹â–’}᥷L嗭臖oញc넨\u0016/迎1b꯸g뢱ã§è“¤ä’8C散삭|\"컪輩鹩\"\\g$zG䥽긷?狸꿭扵ã²:URON&oU8": [
+ null,
+ true,
+ null,
+ -2.8907335031148883E17,
+ -3864019407187144121,
+ {
+ "`빬d⵺4H뜳⧈쓑ohஸ*ã¶ï»‡â¸•ä µ!iä¬ï¹‘h夘▥ê—푹갇㵳TA鳠嚵\\B<X}3訒câ‹{*ï«¢w]ç’¨-gæ­\\j໵侠Ei层\u0011": 3.758356090089446E-19,
+ "䄘ï®)Y놞씃㾱陰í:{\u2059/Sâ“´": [[
+ null,
+ [[
+ -3.8256602120220546E-20,
+ null,
+ 7202317607724472882,
+ "CWQëš¿",
+ null,
+ false,
+ true,
+ null,
+ 2857038485417498625,
+ 6.191302233218633E-20,
+ null,
+ -6795250594296208046,
+ [
+ true,
+ {
+ "%á‹§é°Yᚯ⚀x莰愒Vᔈ턗BNæ´ê¤ŸA1âŒl콹풪H;OX๫륞ìªá°šÑ†@͎黾a邬<L厒Xb龃7f웨窂二;": [[
+ null,
+ "耲?䙧㘓F6Xsí‹­ë©¢.v뚌?鄟æ â–½'묺競?WvᆾCî»txo?dZ;䨸疎",
+ {
+ "@hWê‰&\"빜4礚UO~C;ã†î”殩_ꀥè˜å¥¢^챟k→ᡱKMⵉ<\/Jㅲ붉LÍŸQ": false,
+ "tU뢂8é¾°I먽7,.Yî°î»´æ½Z툼=&⨥覽K乫햶㠸%#@Zë–æ„“^âŠâ¾‚몒3E_噆J(廊ឭyd䞜鈬Ћ档'⣘I": {
+ "tK*ꔵ銂u艗ԃì¿âˆ³ê„‚霫X3♢9y?=â²­dЊb&xy}": [
+ -4.097346784534325E-20,
+ null,
+ 6016848468610144624,
+ -8194387253692332861,
+ null,
+ {
+ "(祬诀譕쯠娣cë´r?ç•„kT뼾⌘⎨?noVä˜ì¥ç¡Žn?": [
+ 1.82679422844617293E18,
+ [
+ false,
+ 2.6849944122427694E18,
+ true,
+ [
+ false,
+ {
+ ";0zâ­†;í™”$bਔ瀓\"衱^ï—´?잢ᢛ⣿~`ꕉ薸⌳໿湘腌'&:ryБꋥá¼ê’¥ç­™ê¬œê¸¨?X": -3536753685245791530,
+ "c;Y7釚Uꃣ割J༨Y戣w}c峰뢨㽑㫈0N>R$ä…’X觨lë´œA刊8R梒',}u邩퉕?;91Eî¦a䈈ë¯G⊶芔h袪&廣㺄j;ã¡ç¶½\u001bN頸쳘橆": -2272208444812560733,
+ "æ‹‘Wﵚî²j鵼駳Oࣿ)#ã¾…é¡‚N傓çºy僱栜'Bê-!KF*ꭇK¦?䈴^:啤wG逭w᧯": "xᣱmYe1Û@霄F$ě꧘푫O䤕í€Pq52憬ꀜ兴㑗ᡚ?ï—ƒLé·íŸî—¼ë­zJê‘™}╆ᅨJB]\"袌㺲u8䯆f",
+ "꿽á…㔂긱Ǧ?SI": -1669030251960539193,
+ "ì‡É¨`!葎>瞺瘡驷錶â¤ï»®é…œ=": -6961311505642101651,
+ "?f7♄꫄Jᡔ훮eì‡îª¼í¾á£ä­´KhखT;Qty}O\\|ë«Iá¿’Ne(5æƒê¥¶ã†·Y9ﮡ\\ oyâ­–-䆩å©m#xë´‰>Y鈕Eç–£s驇↙ᙰm<": {"퉻:dê‚&efᅫ쫢[ï„™\"ëˆëŠ–êº™|Ôå‰1Í–-K:Êšá­•/;ì–㷛]Iç—èŒ4g<Oꗢ뫺N쯂륬J╆.`ᇵP轆&fd$?è‹…oê¶“vO侃沲â©åš…æ²— E%â¿°ì–¦wi\\*è¶«": [
+ 3504362220185634767,
+ false,
+ "qzXæœqT3軞T垈ꮲQ览ᚻ⻑쎎b驌䵆ꬠ5Fà­—ä²ç¼¿ê蒇潇Ltᆄ钯蜀W欥ሺ",
+ "ë³°É霬)ì é¶¼kwocì—·èr \u001d쒷⎹8{%澡K늒?iﺩd=&皼倚J9s@3å›twὡgjä íª5⭉⨺役&놎cﺉ㺡N5",
+ false,
+ null,
+ "D0st[ni锹r*0k6ꀎë‡UX2⽼৞䃚粭#)Zæ¡·36P]<\/`",
+ 4281410120849816730,
+ null,
+ -3256922126984394461,
+ 1.16174580369801549E18,
+ {
+ " ᆼꤗ~î…‰*TN긂<㡴턱℃酰^蘒涯잰淭傛2rൡetì¾£ä‡m*ã¸y\"\\糮᧺qv쌜镜T@yg1譬ﭧﳭ\f": null,
+ "圾ᨿ0xᮛ禵ਗ਼D-㟻ẵ錚e\"赜.˶m)é´‘B(I$<\/轴퉯æ·â‹âº*)宓쓌?*橯Lx\\f쩂㞼⇸\"ﺧ軂é³V\\ë•’\"캘c:G": null,
+ "?ïµ_ê³¢î™ç¿¸íˆ8ã¿ hì—´Q2ã­›}RY㯕YT놂⽻e^B<\/맫ﻇ繱\u0017Gц⟊ᢑﵩS:jt櫣嗒⟰Wã´šæ¦á…‰e[w䋺?藂翙Ⲱ芮ä˜â•¢å›¥lpdu7r볺I è¿‘qFyᗊ": [
+ "$b脬aᅠ襬育Bگ嵺Pw+'M<\/ï­näššvèžbNâ’‚}褺%lቦ阤\"ꓺá—Mç‰,Ûžï– Ò¶!矬?ke9銊Xê´¦)䈽í‹è„½á¹«äˆžá´†^=Yá—¿é›4I귺⋥%",
+ false,
+ 2.9444482723232051E18,
+ 2072621064799640026,
+ "/_뇴뫢jã’=Nꡦâ†Ôºèµ’â¬î»¼í†¥ä¨žç¯su*媸瀳鷔抡oíº-៳è¾å‹·fç»”:äµ¢æ¢2",
+ false,
+ "ì’œ Eî½·äŒ/í\u0018懺_<\\隺&{wF⤊谼(<죽é ïŸ‡8?@*rá¶ŠGd뻻갇&Ⳇq᣿e࢔t_ꩄ梸O詬Cá§§Kê© í’¤9눙醅ëž}竸rw?滨ӽK⥿ཊGé­²']`๖5ã„°",
+ -2375253967958699084,
+ {"嗱⿲\"få„„á¬": {"v?䚑킡`â—¤k3,骥曘뒤Oᒱ㲹^圮᠀YTê»›&ì´®P:G/Tâ£#튣k3ç‚©è k@橈ä·Sä§•,ç†œïŒæ™¬ï£žk1鮥玸먚7䤡fç»å—šìƒ´á¥’~îš¼0q拮垑aë»±Lâ°–_": [{
+ ":på°¢": -6.688985172863383E17,
+ "A0\u0001疠ﻵ爻鼀湶I~W^å²€mZx#ãˆ7r拣$Ꜷ疕≛⦒痋盩Vꬷá­â„¦Qêªï§éˆ‘A(劽詗ꭅo-ç¶é‘º\"Ⓠ@$j탥;": [
+ 8565614620787930994,
+ [
+ "å¶—PC?à¶‹Q㪣$&j幾㾷hæ…‘ 즊慧⪉霄M窊ê·'鮕)äŠé“¨m趦䗲(g罣ЮKVﯦé®î¦®5囗ﰼ鿦",
+ -7168038789747526632,
+ null,
+ -7.8069738975270288E16,
+ 2.25819579241348352E17,
+ -6.5597416611655936E18,
+ {
+ "瘕멦핓+?フZê·¢zé›V": {
+ "ᕾ": 1.7363275204701887E-19,
+ "ã­Œs뎹㳉": {"\u00187Fï–‰I6Yféº+UC쬸éºâ²ä‚¿ê¸•R\\ᆮC?Φ耭\rOத际핅홦*ë² W㸫㯼᡹cㅜ|Gã®—\u0013[o`?jHVì•?蒪꩚!í«áœ¦ãŒ‡äš‡é¿˜:@": [
+ "}푛Г콲<äŸCè—呈#2ã“‹#ྕáŸå°¿9qç«“gI%ëž™mê¬oaç•è´¿Jå’¿D_ç†Zz皳験Iè±¼B扳ḢQ≖㻹㱣Dä¦ï©—2'á—㗣▌ç ²8罿%à°¹F姦;0î·æ‚‡<\/\"påš§",
+ -710184373154164247,
+ "Vo쫬⬾ê«â´·Å»\u0004éŽHBê…¸_aVBHbN>Z4âœkเꛘZ⥺\\Bʫᇩ鄨魢弞&幟ᓮ2̊盜",
+ -9006004849098116748,
+ -3118404930403695681,
+ {
+ "_彃Y艘-\"Xx㤩㳷瑃?%2ä¡éµ›o<A?\"顜ᘌΈ;â·…Cæ´ºL蚴蚀voq:,Oo4쪂)": 5719065258177391842,
+ "l륪맽耞塻論å€Eã—‘/㲕QM辬I\"qi酨玑㖪5q]尾魨鲡ƞY}⮯蠇%衟ï„Fsf윔äšì°¤iè…³": {"ꢪ'a䣊糈": {"ë°‘/♋S8sã¼´5瓹O{댞\"9Xï°‡lJ近8}q{긧ⓈI᱑꿋腸D瀬H\"ﺬ'3?}\u0014#?丙㑯ᥨ圦',gé‘ (樴턇?": [
+ 2.5879275511391145E18,
+ null,
+ [
+ "3㼮ꔌ1Gẃ2Wé¾™jîªÍŠ{1å›ã¦­9xå® ã‘oRä•犽",
+ 1268729930083267852,
+ "땕軚⿦7C",
+ [
+ -3.757935946502082E18,
+ "\"赌'糬_2ë­¾áb",
+ {
+ "(a䕎ጽjÒ°D4.á´¡ïž½66ԃ畮<\/l`k癸\\㇋ࣆ욯R㫜픉녬挛;ڴ맺`.;ç„“q淞뮕ٹ趴r蔞ꯔ䟩vç²u5<\/pZ埖Skrvj帛=\u0005aaï”›": null,
+ "璄≩ v몛ᘮ%?:1頌챀H㷪뉮k滘e": [
+ "ꤾ{`c샬왌펡[俊络vmz㪀悫⸹ᷥ5o'ã¾µ L蹦qjYIYណԠWëƒå‰«<\/W嗂0,}",
+ 2.4817616702666762E18,
+ false,
+ null,
+ null,
+ -8.6036958071260979E17,
+ null,
+ -1.2744078022652468E-19,
+ -4.4752020268429594E17,
+ 1.13672865156637872E17,
+ [
+ false,
+ false,
+ null,
+ -4.178004168554046E-20,
+ true,
+ 2927542512798605527,
+ {
+ ".ꔓ뉤1䵬cHyæ±¼äŠ†è³“á‡Æ©|樷â‡é†Žã¬…4\u0003èµµ}#yD5è†æ™¹ë±“9ê–è™›J㺕 t䊛膎ؤ": {
+ "rVtᓸ5^`েNâ¹»Yv᥋lꌫt拘?<é®°ë„¿ZC?ã’½^": {"âªî©k_:>귵옔夘v*탋èŒ&㳈챗|Oé’§": [
+ false,
+ "daꧺdᗹ羞쯧Hã¤é„³é ³<型孒ン냆㹀f4ã¹°\u000f|C*ሟ鰠(O<ꨭ峹ipຠ*yà³§4VQè””hVæ·¬{?ᵌEfrI_",
+ "j;ꗣ밷é‚副]á—“",
+ -4299029053086432759,
+ -5610837526958786727,
+ [
+ null,
+ [
+ -1.3958390678662759E-19,
+ {
+ "lh좈T_ë¯Y\"伨\u001cꔌG爔겕ꫳ晚è¸â¿»ìT䯎]~e#฽燇\"5hٔ嶰`泯r;ᗜ쮪Q):/tç­‘,榄&5ï¤ëŽ«ç‹(": [{
+ "2áâ“›]r3C攟וּ9è³µsâ›”6'ஂ|\"ⵈ鶆ä¹ç¦3\"痰ࢤéœäµ©ì˜†äŒ€?æ •r7Oç°‚Isd?K᫜`^è®¶}zî°’8?zì–°î§T:X倫⨎ꑹ": -6731128077618251511,
+ "|︦僰~m漿햭\\Y1'Vvخ굇á‰ì±¢cè¶–": [null]
+ }],
+ "虌魿閆5⛔煊뎰㞤ᗴꥰF䮥蘦䂪樳-Ká·-(^\u20dd_": 2.11318679791770592E17
+ }
+ ]
+ ]
+ ]},
+ "묗E䀳㧯᳀逞GMc\bï•¹å¢¹ã“„ë–Æ &U??íŽŒé‘ åª‹k))ᄊ": null,
+ "묥7콽벼諌J_DɯﮪMæ®´ä£,煚ྼ`Y:ì”§<\/â©«%yf䦀!1á²¶kì¶ŽQç±³W∠WC跉鬽*á›±i<?,l<崣炂骵*?8í‘៣ⰵ憉⎑.,Nwç½£q+ο컆弎": false
+ },
+ "e[|଀+î±³lꑸãˆTT?ë¿¿|ê«›9`㱯䊸楋-곳賨?ì³k棽擋wQ餈âŸNq[q霩䵀뷮锅ꚢ": 5753148631596678144,
+ "sá“鴻߸d렶ὕ蜗ဟ툑!诉౿": false,
+ "|4䕳鵻?䈔(]í‹/Ui#æ¹»{듲ーMá‹€t7潔泄Ch⸨}ì£`î¤èž§éŠšã‹¼å£¯kâ°¥Q戵峉갑xè¾™'ì²›": "jd䘯$䕌茷!auw眶ㅥä£ê†¢æ°‘i",
+ "剖駰Ɜî¶sM2]á¾´2ࡷ祅拌Av狔꩛'ê“—í‚§ê£0酜✘O'": false,
+ "澩뢣ê€eU~D\\ꮡ킠": "v^YC嚈ί\u0007죋h>ã´•L꘻ê€ì“ª\"_gé¿„'#tâ½™?,Wg㥖|D鑆eâ¥ìª¸åƒ¬h鯔咼ඡ;4TKèŽî¾‘졠嫞"
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ ]}}
+ }
+ ]}
+ },
+ "뿋뀾淣截䔲踀&XJ펖꙯^Xb訅ꫥgá¬>棟S\"혧騾밫ê²7-": "擹8C憎W\"ìµ®yR뢩浗絆䠣簿9äˆå¼•Wcy䤶孖ꯥïž;íŒ]輩ä3@{å 뽸0ï€á¡ˆìµ¡î›„Ⲇ\u001dLåŒê§2F~ݕ㪂@W^é½L襒ᦘî¢~沦zZ棸!꒲栬R"
+ }
+ ]
+ ],
+ "Z:ëƒàµ›5Iz찇䅄駠㭧蓡K1": "e8᧤좱U%?ⵇ䯿é¿\u0013縮R∱骒EO\u000fg?幤îš@֗퉙vU`",
+ "äƒìªˆï‘’埽້=Ij,쭗쓇చ": false
+ }]}}
+ ]
+ }
+ ]}
+ }
+ ]
+ ]
+ ],
+ "咰긖VM]á¼6䓑쇎çºetDÒŒ?ãžê©„퇫밉gj8è ƒ\"â©5䛹1ࣚ㵪": "ക蹊?⎲⧘⾚̀I#\"䈈⦞ë·`wo窭戕෱휾䃼)앷嵃꾞稧,Ⴆ윧9S?೗EMk3Მ3+e{â¹”Te驨7äµ’?타Ulg悳o43ï“¢"
+ }
+ ],
+ "zQᤚ纂땺6#ٽ﹧vï¿¿#ࠫ휊冟蹧텈ꃊʆ?&a䥯Deæ½|ì¿“pt瓞㭻啹^盚2êŠf醪,ì–T窧\\Di䕎谄nn父ꋊE": -2914269627845628872,
+ "䉩è·|㨻ᷢã‰B{蓧瞸`î°²I!℄욃힕#ೲᙾ竛ᔺCjk췒늕貭è¯\u0017署?W딚%(pê⤼ë³^=on뺲l䆼bzrﳨ[&j狸䠠=ᜑꦦ\u2061Õµnj=牲攑)Mî»\\é¾": false,
+ "뎕y絬᫡⥮Ϙᯑ㌔/NF*Ë“.ïž¿,QEzvK!Iwz?|쥾\"ê©»Lê¼—Bê”§è³´ç·œs뉣隤茛>ロ?(?^îµ­`>冺飒=噸泥⺭Ᲊ婓鎔븜z^å·è£®Ãªâ“…à»—jM7ﶕ找\\O": 1.376745434746303E-19
+ },
+ "ä›ræ»–wã¤<k;l8ꡔጵ⮂ny辶⋃í¼åƒ®z\"﮲X@t5෼暧퓞猋♅䦖QCé¹®|픨( ,>,|Nዜ": false
+ }
+ ]],
+ "@ê¿™?è–•å°¬ gd晆(ë„5躕ﻫS蔺4)떒錸ç“?~": 1665108992286702624,
+ "wë¯ná =`঺ᅥC>'從ë槷ä¤çœ·èž„ãŽ»æ°æ‰°XᅧCè´½uáƒë‚ŸjKD03T!lDV쀉Ӊy뢖,袛!终캨G?鉮Q)â‘—1쾅庅O4ê‰H7?d\u0010蠈줘월Þ粯Q!낇껉6í…|{": null,
+ "~˷jg쿤촖쉯y": -5.5527605669177098E18,
+ "펅Wᶺzê†ã¨í‘­e?4j仪열[D<鈑皶婆䵽ehS?袪;Hê¨Më—Žã°[(å—M3qíŸg4y╸鰧茀[Bi盤~ï«å”Žé‹†å½ºî½«â¦Šq?î–³B4쉓癚O洙킋툈䶯_?ퟲ": null
+ }
+ ]
+ ]]
+ ]],
+ "꟱Ԕã¤7æ›ï¦—ಃéŒVä·°?v㪃૦~K\"$%请|ꇹn\"kä«›ã¨é²¨\u2023ä„¢\u0004[<S8á¬ë­©è„¥7U.m࿹:Dè‘┆2蘸^U'w1ì …;䠆ꋪBê»®>︊Vï‹•J?䶟ាꮈ䗱=깘U빩": -4863152493797013264
+ }
+ ]}]}
+ ]
+ }}}
+ ],
+ "ì·ì²Û¹í‰ƒ~aEå”™a챑,9㮹gLHd'ä”|í‚—ãžäŽ¥&KZYTë§µ7䥺N<Hp4ê•­â¹ ê½c~çš½z": "课|á–¾ä¡å»‹è„äªW\u0016&Jnê´b~æ‘“M>â±³åŒèŽžé¿§w\\༌疣n/+ꎥU\"å°ëž¾â—‹íŸ™AJá­Œ?9ä›$?é©”9è®ì§˜é­¡TÖ¯cè—³`虉Cì‡ì¦T"
+ }
+ ],
+ "è°¶ê°œgTRï¿>áµÍšdtæ™‘ä‰‡é™æ»º}9㉸P漄": -3350307268584339381
+ }]
+ ]
+ ]
+ ]]
+ ]
+ ],
+ "0y꟭馋X뱔瑇:䌚ï¿å»¿jîžg-懲鸭䷭垤㒬茭u賚찶ಽ+\\mT땱\u20821殑ã„J쩩䭛ꬿNSæ½”*d\\X,壠뒦e殟%LxG9:摸": 3737064585881894882,
+ "í’µO^-â§§â…¶vѪ8廸鉵㈉רâ†Q㿴뺟EႳvNM:磇>wî·/៻唎뷭୥!냹D䯙iëµ±è²C#⼉NH6`柴ʗ#\\!2ä‚—â±§f?諳.Pëˆ-è¿”I꘶6?8î“ê˜": -8934657287877777844,
+ "溎-è˜å¯ƒi诖ര\"æ±µ\"\ftl,?d⼡쾪⺋h匱[,à·©I8MÒ§F{kç“¿PAî…§'橸ꩯ綷퉲翓": null
+ }
+ ]
+ ],
+ "ោ係Øî½<å…ƒ": 1.7926963090826924E-18
+ }}]
+ }
+ ]
+ ]]}]
+ }]
+ ]
+ ]
+ ]
+ ],
+ "ጩV<\"ڸsOᤘ": 2.0527167903723048E-19
+ }]
+ ]}
+ ]
+ ]],
+ "∳㙰3ì ´pá§—ä±™?`<U὇<\/æ„E[ᮚAî›j诂ᒽ阚uv徢ဎ떗尔ê½í›€ì©‘Jä´?âª=륪ᆩ푰ஓã•?럽VK\"X?檨လ齿I/耉A(AWA~â¯ç¨è¹«": false,
+ "å’å¦ë¾‡}䀼链i⇃%⋜&ç’ªIx渥5æ¶§qq棩á¥-â «AA낇yY颕A*ïˆè£¦O|n?䭬혗F": null,
+ "ç­CLì–­B혆Kॎ`鎃nrî€sZiÕªWç )?p~K~A眱ä²QO妣\u001b\u001b]ᵆᆯ&ã‹á¹è±‰ëº˜$ê­§#j=C)祤⫢歑1o㒙諩": 7028426989382601021,
+ "쳱冲&ဤäŒì•§h胺-é½±H忱8왪RDKᅒ䬋ᔶS*J}ስ漵'㼹뮠9ê±¢9p봋경ጕtởꚳT䶽瘙%ì¶´`@nಆ4<d??#僜ᙤ钴=薔ꭂbLXNam蹈": "樭る蹿= Uî ƒurwkn뙧⌲%\"쑃牪\"cq윕o@",
+ "溌[H]焎SLã…?뀼䫨ç½W": 1.1714289118497062E-19,
+ "ﬢp븇剌燇kĔ尘㶿㴞ç ê¾˜Ia;sâº^)$ç©®?sHᢥíªl": null
+ }
+ ]
+ }
+ ]
+ },
+ "TKnzj5o<\/K㊗ꗣ藠⦪駇î€>yZA8Ez0,^á™›4_0븢\u001ft:~䎼s.bb룦明yNP8弆Cå¯;⪾ì§'蕴뮛": -6976654157771105701,
+ "íµê¦€\\㇑:nî‹™v+뒤燻䀪ﴣï·9ᚈ኷K㚊誦撪䚛,ꮪxሲ쳊\u0005HSf?asg昱dqꬌVꙇ㼺'k*'㈈": -5.937042203633044E-20
+ }
+ ]
+ }],
+ "?}\u20e0],så¶³è‹@#2uì’´sQSä©—=ꥮ;烌,|ꘔ䘆": "á…©ì˜Nç’ kZ먕眻?2ቲ芋眑D륟渂⸑ﴃIRE]å•—`K'"
+ }},
+ "쨀jmV賂ﰊå§ä‚¦çŽžã¬™áªM᪟ïՎ씜~`uOn*ॠ8\u000ef6??\\@/?9見d筜ﳋB|Sä¬è‘«ã½o": true
+ },
+ "즛ꄤ酳艚â‚㺘봿㎨iGà§•à¡¿?1\"䘓您\u001fSáŠâº¿æºzៀ뻤B\u0019?ìœa䳵᭱䉺膷d:<\/": 3935553551038864272
+ }
+ ]
+ ]}
+ ]]
+ ]]
+ ]}
+ }
+ ]
+ }
+ ]]}},
+ "᥺3h↛!ê‹°y\"攜(ெl䪕oUkc1A㘞ᡲî촾ᣫ<\/ä’ŒEã›æ½¨i{ï  v?Wà±¾H\\RჅpzè¬R脾;v:碽✘↯삞鷱o㸧瑠jcmK7㶧뾥찲n": true,
+ "ⶸ?x䊺â¬-ä°…â‰!e쩆2ꎿ准G踌XXᩯ1ß}0?.í—€Z馟;稄\baDꟹ{-寪⚈ꉷ鮸_L7ƽᾚ<\u001bጨA䧆송뇵⨔\\ç¤ë—”d设룱㶉cq{Hyã±R㥽å¢ï¬…p": -7985372423148569301,
+ "ç·«#ì½®IB6<\/=5Eh礹\t8럭@饹韠r㰛斣$ç”LVì·a갵îŸ'请o0g:^": "䔨(.",
+ "ë³â„¡åœ¤pï¾à¯„Ä倧訜BìŸGä™”\"Sbâ“®;$$â–S1J뢙SF|赡gï„€*\"Vu䲌y": "䪈&í‹),\\kT鬜1í’¥;ë·´'Zေ䩹@Jéž½Nã¼M?å¥eWb6榀ƩZڮ淽⺞삳煳xჿ絯8eâ¶ç¾·V}ჿ쎱䄫R뱃9Z>'\u20f1â“•äœé½®"
+ }
+ ]
+ ]]]
+ }}
+ }
+ ]
+ ]},
+ "펮b.hç²”í¯2npXè©«g錰鷇㇒<ì™S値bBi@?镬矉`剔}c2壧ଭfhY깨R()痩⺃a\\â”?M&ﯟ<劜꺄ï‘멊ᄟA\"_=": null
+ },
+ "~æ½¹Rqn榢㆓aR鬨侅?䜑亡V_ç¿…ã­”(ä“·w劸á³Dp䀅<\/ï°Žé¶Šm䵱팱긽ꆘ<tD쇋>긓准D3掱;o:_Ñœ)껚콥8곤d矦8nP倥ꃸI": null,
+ "뾎/Q㣩㫸벯➡㠦◕挮aé¶§â‹“å¼\u00001뱓fm覞n?㛅\"": 2.8515592202045408E17
+ }],
+ ",": -5426918750465854828,
+ "2æ««@0柡g䢻/gꆑ6演&D稒肩Y?艘/놘p{f투`飷ᒉ챻ëŽîª–<늛ä˜ï´¡ì¤°ì«„": false,
+ "8î™–(鸑嵀⵹ퟡ<9㣎Tߗ┘d슒ل蘯&㠦뮮eà kç g ì—»": false,
+ "d-\u208b?0ﳮ嵙'(J`蔿d^踅⤔榥\\J⵲v7": 6.8002426206715341E17,
+ "ཎ耰í“ê•ï’ã±·\u0013y=詽I\"盈xm{0쾽倻䉚ષso#é°‘/8㸴짯%ꀄ떸b츟*\\鲷礬ZQå…©?np㋄椂榨kc᡹醅3": false,
+ "싊j20": false
+ }]]
+ ]],
+ "ä¿›\u0017nç·½Tu뫉èœé¼Ÿçƒ¬.ï‘ꭠIâ°“\"Ἀ᜾uC쎆J@å¤%ê›m뻨ᾀ画è›íœƒT:錖㑸ዚ9죡$": true
+ }
+ ]
+ ],
+ "ãµâ‡˜ê¦–辈s}㱮慀밒s`\"㞟j:`ií”»Z<C1衽$\"-饧?℃\u0010⼒{î°p飗%R\"ä²”\")ì¹€\\%": true,
+ "苧.8\u00120ݬ仓": 6912164821255417986,
+ "ë–Žé¡£ä¿X;.#Qí‹.笂'p쟨唒í랩냆¦aâ±{è°.b我$蜑SH\u000fç¾=äŸ¼â£¼ï©¿áœæ”•B&挰繗ã”ê…‚-Qv\\0ä¶äš¥ãºio[㑮-ᇼ䬰컪ṼiY){ë°\u0010q螰掻~\n輚x\u0014罺)è»´": 3.024364150712629E-20
+ }
+ ]
+ ]
+ ]
+ ]}
+ ]]
+ }
+ ]
+ ]]
+ ]
+ ]]]],
+ "\"凲o肉Iz絾豉J8?i~傠᫽䇂!Wï›—D溊J?á¡’vsè†åµ¹âž’ïŸæ·´î‡…>ì„«^諎0Ok{켿æ­à·£èƒ°a2﨤[탳뚬쎼嫭뉮m": 409440660915023105,
+ "w墄#*ᢄ峠밮jLa`ㆪ꺊漓Lã§ëŽ!Agkï¹ï¾'ê›ë¢ƒã¯å²¬D#ã’¦": false,
+ "ଦPGI䕺L몥罭ꃑ궩﮶#⮈ᢓӢ䚬p7웼臧%ï‘¥~Sè âŒíž€6îž’&t䳙y㪘ëƒ\\*;é‰ï¿Šé¿µ'å—•pa\"oL쇿꬈Cgî“": "ã¶½1ç¸D⟸䴅ᆤ뉎﷛渤csî¸x ä”цꬃ锚æ¬?ຽ+x~꘩uI࡞\u0007æ ²5呚ẓem?è¢\")=㥴䨃pac!/æŽY",
+ "á·±o\\||뎂몷r篙|#X䦜I#딌媸픕åžRDæ–³X4t⯩夬=[ï‹ë­²r=绥jhë·±ì¸âª˜%]⚋܈㖴スHí…¹m(WOæ›åЉ0~K3c柢Õã‰ïªªé€³~": false,
+ "ç…½_qb[첑\\륌wEâ½Ztï”´CNï­+餌ᕜOê›­": "{ﳾ쉌&s惧á­âµ†3䢫;䨞팑ï›ê’ªí˜è¤€à¢–Qä ¿V5뭀䎂澻%ë°›u5í…¸oA⮥U㎦;B䳌wzä•™$áž¿\\௅婺ëµâª¾í†\\`Kyौꋟ._\u0006L챯l뇠Hi䧈å’5",
+ "艊ä½à£ƒë¡‡ä± çˆ¬ï˜‚!*;⨣æŽïžæ…“qé“|儑ᨋL+è¿¥=6㒺딉6弄3è¾…J-㕎뛄듘SG㆛(\noAzQê±ä°©X*ã¢O퀌%펠낌moí‹®a^<\/F&_눊ᾉ㨦ы4\"8H": 2974648459619059400,
+ "鬙@뎣䫳á®ë¡?){y?5K;î§„TA*k溱䫜J汃ꂯ싔ì\u001dA}룖(<\/^,": false,
+ "ëª@QꋦFꊩá’뎶î‡lXl垨4î¤^郣|ꮇ;ä´á“}ìµ²zç–": null
+ }
+ ]]]],
+ ":_=ë‹§å¼—D䙋暨é›. 㱻붘ä‚Jå„’&ZK/녩䪜rå›â½¯D喠죥7ï“⹌䪥c\u001a\u2076￞妈朹oLkè®F౟覛ì§ã®7T;}è›™2{9\"å´“bB<\/⡷룀;즮鿹)丒툃୤뷠5W⊢嶜(fb뭳갣": "E{å“1WM"
+ }},
+ "䘨tjJ驳豨?y輊M*᳑梵瞻઻ofQG瑮e": 2.222802939724948E-19,
+ "ä®´=â‘âž¶Tà·‹wäžœ\"垦ꃼUt\u001dx;B$뵣䙶E↌艣ᡥ!á§Ÿ;ä±€[䔯k쬃`à©8饙른ç†î‹”'2_'袻tGfè’­J땟as꯳╖&å•’zWࡇᒫYSá¬\u0014ℑ첥鈤|cG~Pá“®\">\"": "ႆl\f7V儊㦬nHꄬꨧC{ì¢~C⮃⛓嶦vꄎ1w鰠嘩뿠魄&\"_qMâµ–é‡”ë…®îœ¡ê‡ ãš{ç³Jå“‹ cî°¸v?-jkﻯྌ鹑L舟r",
+ "龧葆yB✱H盋夔ﶉ?n*0(": "ꧣኆ㢓氥î³qZZ酒ຜ)鮢樛)X䣆gTSî»»Ò‘Gí…žï’˜k.J圬ç–ë¡«ïœì¯­z L:\\ྤ@w炋塜쿖ᾳy뢀䶃ë±N䥨㚔勇ê²#p",
+ "ë„畎Q娡\"@S/뼋:äµ!Pè¡…ì´šfVHQs✜á«i㻑殡B䜇%믚k*U#濨낄~": "êŸá‹•ì³¸êˆæ•‹&lå¦\u0005憡멗瘌uPgá…ªm<\/To쯬锩h뒓k"
+ }
+ ]
+ }],
+ "墥홞r绚<\/⸹ⰃB}<躅\\Y;๑@䔸>韫䜲뱀X뗩鿥쩗SI%ﴞ㳕䛇?<\/\u00018x\\&侂9é‹™a[LRã‹­W胕)â¡¿8ãž™0JF,}?í—ˆd1cDMáƒâ›é„ⱕ%X)!XQ": "â³ê—³=橇a;3t⦾꼑仈î¥á€°aᚯ⯋ꕃAsé´·Nâ•_䎃ꙎAz\u0016䯷\\<à¿«>8q{}ï½·?ᣰ}'0ᴕ펓B┦lF#趤厃T?㕊#撹圂䆲"
+ },
+ "Ü‹ë‹é¾«ï¥c웑": false,
+ "ㇿ/q\"6-co髨íœCí¦#\u001b4~?3ä¹E삇<<": 7.600917488140322E-20,
+ "äE6?㣖êƒé—´t祗*é‘ {ḣV(æµ¾h逇íž=W?ૉ?nꇽ8ꅉຉj으쮺@Ꚅ㰤u]Oyr": "vâ‰á«¸_*όAඤԆl)ۓᦇQ}í zà¼q滚",
+ "ソ᥊/넺I": true
+ }]]
+ ]
+ ]
+ ]
+ ]]
+ },
+ "䭑Ik攑\u0002QV烄:芩.麑㟴㘨≕": true,
+ "å„꿕C쇻풉~å´%碼\\8\"䬦꣙": null,
+ "欌L圬䅘Y8c(♺2?ON}o椳s宥2䉀eJ%é—¹rå†O^K諭%凞⺉⡻,掜?$ꥉ?略焕찳㯊艼誜4?\"﯎<ï±ã‚›XáˆINT:è©“ +": -1.0750456770694562E-19,
+ "ç’àc뜭싼ﺳ뎤K`ïŸ]p隨LtE": null,
+ "ç”™8䵊神EIꩤé¯á¢€,ïµ®Uä‘u疒ử驺䚿≚ഋ梶秓F`覤è­#짾蔀묊4<åªì¬¦éª_Yzgcà¡¶î²§4kç´¥`kc[Lï®—î°£ç°*I瀑[â¾°L殽鑥_mGÈ <\/|囹ç gæ¡°iri": true,
+ "챓ꖙꟻì¢è‡ou,å— 0\\jK핻뜠qwQ?ഩ㼕3Y彦b\u009bJ榶N棨f?ë¦é–綃6é³µM[OEë´¨uí–.Ꮁ癜蟳뽲ꩌ뻾rM豈Rï¨ç¾« uDꎚ%": null
+ },
+ "V傜2<": 7175127699521359521
+ }],
+ "é“«aG切<\/\"ী⊆e<^g࢛)Dé¡ï½Žï¬®é¥¼\u008c猪繩嵿ﱚCꡬ㻊g엺Aì—¦\u000fæš¿_f꿤ë³ã¦•桦`蒦䎔j甬%å²rj ç³": "䚢åŽëˆ´Au<4箞7礦Iï±”å eȧ䪸uï„€äµp|逹$嗫쨘ꖾï·!胠z寓팢^㨔|u8Nሇe텔ꅦ抷]،鹎ã³#༔繁 ",
+ "낂乕ꃻ볨ϱ-ꇋã–fsâ¿«)zꜦ/K?솞♞ꑌ宭hJ᤭瑥Fu": false,
+ "쟰ãœé­›G\u0003u?`㾕ℾ㣭5螠烶這趩ꖢ:@å’•ê¶xë’˜ëŠmä°¨bç—ƒë 0鳊喵熬딃$摉_~7*ⱦ녯1錾GKhJ惎秴6'H妈Tᧅ窹㺒疄矤铟wላ": null,
+ "쯆q4!3錕ã²âµ†ã‡›ê˜·Zç‘©ë­†\\â—ªNH\u001d\\ã½°U~㯶<\"쑣낞3ᵤ'峉eꢬ;鬹o꣒木X*é•·PXᘱu\"ä ¹n惞": null,
+ "ᅸ祊\"&ꥴCjࢼ﴿?䡉`U效5殼㮞V昽êª#ﺸ\\&t6x꠹盥꣰a[\u001aêªSpe鎿蠹": -1.1564713893659811E-19
+ }
+ ]]
+ ]
+ ]
+ ],
+ "羵䥳H,6ⱎ겾|@t\"#í–Šî¦1|稃 ì„­)ëœ=뻔ꡜ???櫎~*ῡ꫌/繣ﻠq": null
+ }
+ ]}
+ ]},
+ "츤": false
+ }},
+ "s": 3.7339341963399598E18
+ }
+ ],
+ "N,I?1+㢓|ࣱ嶃쩥V2\u0012(4EE虪朶$|w颇væ­¥": "~ì¢~_,Mzrã«YB溓Eæ·š\"â…¹äˆ”áºæŠ™ b,nt5Vã’J檶ê¨â»”?",
+ "Q껑ꡡ}$넎qHç…”æƒ/ez^!ẳF댙äŒé¦»å‰8": "梲;yté’°$i冄}Aî‘”L%a jëœå¥·ê±³ëš¾d꿽*ሬuDY3î…—?뮟鼯뮟wãªí‹±îŸ‚V",
+ "o{Q/K O胟ãzUdê€m&⨺J舕â¾é­¸è¨ŸãŒ¥[T籨櫉å”í‚ aṭ뱫촙莛>碶覆⧬짙쭰ׯdAiH໥벤í¥_æ¸[ 0î­¬e:죃TCå¼¼èŽëµDA:w唵ê£": null,
+ "á½æ¨Žäµ®è»§|?à±—aWH쩃1 ê…­su": null
+ }
+ ]
+ },
+ "勂\\&m鰈J釮=Ⲽ鳋+䂡郑": null,
+ "殣b綊倶5㥗惢⳷è¢á‘€ä¬„é•§M^ï±´3⣢翣næ«»1㨵}ኯ뗙顖Z.Q➷ꮨ뗇\u0004": "ê”™ä¼>n^[GीA䨟AMç¢á’ŠS쨲w?d㶣젊嘶çºéº“+æ„£a%気ྞScë“ᔘ:8bM7Xd8㶑臌]Ꙥ0ê­ì’™ä«£æŒµCè–½î€Dfⵃ떼᷸",
+ "?ç´¡.ì…ª_à·¨j\u0013Oxâ” $Xᶨ-á…‡oè–¹-}軫;yæ¯ãªœKã£?.EVì®±4둽⛻䤜'2盡\u001f60(|eì°ã¼Žá¦€ã’§-$l@ﻑå³\u0003ä­±å“å·—WFo5c㧆Tí„Y맸♤(": -2.50917882560589088E17
+ }}
+ ],
+ "侸\\릩.᳠뎠狣살cs项䭩畳H1s瀉븇19?.w骴崖㤊h痠볭㞳㞳ä®Ql怠㦵": "@䟴-=7f",
+ "鹟1x௢+d ;viä­´FSDS\u0004hꎹãš?â’â¦Ñž6u,扩@ë·Su)Pag휛Tá’—Vç—©!çžé‡€ê–žè˜¥&ೞè˜ê­°êž‡áŽ": "ah懱Ժ&\u20f7䵅♎඀䞧鿪굛ౕ湚粎蚵ᯋ幌YOE)५襦ãŠY*^\"R+ඈî¶å’·è¶9î—ꥂ榨艦멎헦é–ë¶v좛咊E)K㓷ྭr",
+ "æ†q쮦4綱켙ì….f4<\/g<籽늷?#蚴픘:fF\u00051㹉뀭.á°–í’ŽfÖ¦Hv蔎㧤.!ä­½=éž½]ìŒH:?\"-4": 8.740133984938656E-20
+ }]}
+ }
+ ],
+ "tVKn딩꘥⊾蹓᤹{\u0003lR꼽ᄲQFá…傅ﱋ猢⤊á”,E㓒秤nTà¶­v`â™›I\u0000]꫔ṞD\"麵cè¸î“²æ°X&æ¿¿ë˜ê£¹ê¹³à±¥è‘‚鿎\\aꡨ?": 3900062609292104525
+ }
+ ],
+ "ਉ샒⊩Lu@S䧰^g": -1.1487677090371648E18,
+ "⎢k⑊꬗yá«7^err糎Dt\u000bJç¤¯í™•ã†æ²‘サꋽeèµ”ã¢^J\u0004笲㿋idra剰-᪉C錇/Ĝ䂾ညSì§€?~ì½®gR敉⬹'ä§­": 1901472137232418266,
+ "ç—kä¶¥:?ì´½è´ì“‰ê“ˆã’¸gç˜[뵎\\胕?\u0014_榙p.j稶,$`糉妋0>Fá¡°ly㘽$?": "]ê™›O赎&#ã ƒë±å‰³î°·\"<â—†>0誉é½_|z|裵씪>áŒã¼\"Z[ç•}O?G뚇諦cs⠜撺5cuç—‘U圲\u001c?鴴計lì¶¥/╓哼䄗èŒîšªê®…뫈댽AëŒë¡–뤫V窗讬sHd&\nOi;_î´–u"
+ }
+ ],
+ "Uﺗ\\Y\\梷䄬~\u0002": null,
+ "k\"Y磓ᗔ휎@U冈<\/w컑)[": false,
+ "æ›Jè·âŒ»ë¦\u001f㙳s꥓âŸé‚«P늮쥄c∬ྡྷ舆렮칤Zè¶£5콡넛A쳨\\뀙骫(棻.*&è¼›LiIfi{@EA婳KᬰTXT": -4.3088230431977587E17
+ }]}
+ ]
+ ],
+ "곃㲧<\/dఓꂟs其ࡧ&N葶=?c㠤Ჴ'횠숄臼#\u001a~": false
+ }
+ ]
+ ]}]
+ }]
+ }}
+ ],
+ "2f`â½°E쵟>Jî•笂裭!〛觬囀ۺ쟰#桊l鹛ⲋ|RA_Vxá­gEë“h﵀mfá»|?juTUæ¡£[d⢼⺻p濚7E峿": 5613688852456817133
+ },
+ "濘ë¶gå¿®7ãµæ®¬W팕Qæ› ë«°)惃廊5%-î«è¹šzYZ樭ﴷQ锘쯤崫îŸgg": true,
+ "絥ᇑâ¦ì’“븣爚H.ã—Šß„o蘵貆ꂚ(쎔O᥉î¼ï®“]姨Wê“!RMA|o퉢THxè½®7Mê»U즨'i뾘舯o": "è·¥f꜃?"
+ }}
+ ],
+ "é·°é¹®K-9k;ï°°?_ݦѷ-ꅣ䩨Zꥱ\"mꠟ屎/콑Y╘2&鸞脇ã¢ê€‡à ºâ°¼æ‹¾å–­í‹®îL꽩bt俸墶 [l/웄\"꾦\u20d3iও-&+\u000fQ+໱뵞": -1.296494662286671E-19
+ },
+ "HX੹/⨇୕붷Uﮘ旧\\쾜͔3l鄈磣糂̖䟎Eá³wæ©–bá¿€_딕huè‘°î¤çª³é—¹Ð²U颵|染H죶.fPä—®:jä«¢\\b뎖i燕ꜚGâ® W-≚뉗lè¶•": "ଊ칭Oa᡺$IVã·§L\u0019脴셀붿餲햪$迳å‘ì¯ì¼‚PqfT\" ?î¹€I屉鴼쿕@ç¡™z^é•㊵M}ãš›T젣쓌-Wâ©-g%⺵<ë®±~빅╴瑿浂脬\u0005왦燲4áƒb|Då § <\/oEQh",
+ "䘶#㥘à©îººìº”ï” f巋ἡAJ䢚쭈ࣨ뫒*mᇊK,ࣺAꑱ\u000bR<\/A\"1a6鵌㯀bh곿w(\"$ê˜*rà²è¶£.dà¿©k/抶면䒎9W⊃9": "漩b挋Swè—Ž\u0000",
+ "畀e㨼mK꙼HglKb,\"'䤜": null
+ }]}]
+ ]
+ ]
+ }]
+ ]}
+ ]
+ ]}
+ ],
+ "æ­™>駿ꣂ숰Q`J΋方樛(d鱾뼣(ë«–í„­\u20f9lচ9æ­Œ8o]8윶lì–¶?é•–G摄탗6í‹íµ+g:䱫홊<멀뀿/س|ê­ºsê±è·¶ç¨šW々c㫣⎖": "㣮蔊깚Cꓔ舊|XRfé»ã†šï¸†'쾉ì·\\&言",
+ "æ®­\"cÞɨê™äž˜:嬮eæ½½Y펪㳅/\"O@à —ê²´]ì·–YÇž(t>R\"N?梳LDæ­=næ°¯Tè±°2R諸#N}*ç§ï¡§4}ã¶ŠGä£bì–š": null,
+ "襞<\/å•§ B|싞W瓇)6簭鼡艆lNì©`|펭佡\\é–“é‚[z릶&쭟愱ꅅ\\Tá°½1靝忠ˆ4̸s윜R7â’/똽?치X": "âŠèº–Cﱰ2Qẫè„&இ?%ëƒæ‚Š",
+ ",é°§åµì…£îˆ›ì‹¹xᎹ힨᯳EṬHïŽã¹–9": -4604276727380542356
+ }
+ }
+ ]]]],
+ "웺㚑xs}q䭵䪠馯8?LB犯zK'os䚛HZ\"L?셎s^㿧㴘Cv2": null
+ }]
+ ]
+ ]
+ ],
+ "Kdî©´2Kv+|z": 7367845130646124107,
+ "ᦂⶨ?ᢠ祂些ഷ牢㋇æ“\"腭䙾㖪\\(y4cE뽺ㆷ쫺ᔖ%zfÛ»$Ñž1柦,ã¶¢9r漢": -3.133230960444846E-20,
+ "ç˜Mç„€q%㢟f鸯Oâ£è“‘맕鯊$Oå™·|)z褫^㢦⠮ꚯ꫞`毕1qꢚ{ĭ䎀বώT\"뱘3G൴?ï¢ï¢^^oï…¯f": null
+ }
+ ],
+ "a8V᯺?:ﺃ/8ꉿBq|9啓댚;*i2": null,
+ "cpT瀇Hç°á»ªpೃi鎪Rrâ£ìˆ¬-鹸ҩ䠚z脚цGoN8å…¥y%è¶ŒI┽2ឪЀiJNcN)æ§£/â–Ÿ6S숆牟\"箑X僛G殱娇葱T%æ»:J諹昰qV쨰": 8331037591040855245
+ }],
+ "G5ᩜ䄗巢껳": true
+ }
+ },
+ "Ồ巢ゕ@_è­™A`碫é„㡥砄㠓(^K": "?܃B혢▦@犑ὺD~Tâ§|é†;o=J牌9냚⢽㨘{4è§èš”9#$∺\u0016p囅\\3Xk阖⪚\"UzA穕롬✎âžã­’춺C㣌ဉ\"2瓑员ᅽê¶ë«}꽚ꞇ鶂舟彺]ê½JCè§éЉ",
+ "â†Äšè†\"b-í‰ACR言J謈53~V튥x䜢?ꃽɄY뮩ꚜ": "K/↾eèƒ}]Bs⾿q룅鷦-膋?m+æ­»^魊镲6",
+ "粡霦cæž‹AHíŸo礼Ke?qWcA趸㡔ê‚?\u000eì¶‚8iতᦜ婪\u0015㢼nﵿê»!á´é–¢\u001d5j㨻gfá¿©UK5Juä¸tã‹TI'?ã“t>⼟o a>i}á°—;뤕Ü": false,
+ "ꄮ匴껢ꂰ涽+䜨B蛹H䛓-k蕞fu7kLè°–,'涃V~챳逋穞cT\"vQ쓕ObaCRQã“¡â²®?轭⫦輢墳?vA餽=h䮇킵ní²í‰…喙?\"'1ç–¬V嬗Qdç—'Lự": "6v!së¯ã­Ÿî€µî¦˜ã£¯çƒ!磸餠ቂh0C뿯봗Fé·­gê–¶~コkK<ᦈTtïŽ\\è·“w㭣횋钘ᆹ듡䑚W䟾X'ê…”4ï€FL勉Vܴ邨y)2'〚쭉⽵-鞣E,Q.?å—",
+ "?(˧쩯@å´Ÿå‹æ­„K": null
+ },
+ "Gc럃녧>?2DYIé´¿\\륨)æ¾”0ᔬlx'è§”7젘⤡縷螩%Sv׫묈/]↱&S ï…h\u0006æ­‹á‘›xi̘}ã²Y蔯_醨鯘煑橾8?䵎쨋z儬ê*@츾:": null
+ }
+ }
+ }
+ ]
+ ]
+ ]}
+ },
+ "HO츧G": 3.694949578823609E17,
+ "QC\u0012(翻曇Tfã·ŸbGBJ옉53\\嚇ᛎDï–/\u001b夾á‰4\"í•€@祎)쫆yD\"i먎Vnî¿ã¿¿V1Wá¨ä¶€": -6150931500380982286,
+ "Zã“®P翸é±é‰¼K䋞꘺튿â­Y": -7704503411315138850,
+ "]모开ꬖP븣c霤<[3aΠ\"é»ä––䰑뮋ꤦ秽∼㑷冹T+YUt\"싳F↭ä–&鋌": -2.7231911483181824E18,
+ "tꎖ": -4.9517948741799555E-19,
+ "䋘즊îŽ.⬅IꬃۣQ챢ꄑé»|f?C⾺|å…•ì¯sC鬸섾整腨솷V": "旆柩l<Ké«î–žM戶鯮t:wRî°2ꉱ`9'l픪*í芦㊢Pjjoå ¡^ ì‡ì–›å¶…있ষ0?F",
+ "下9T挞\\$yᮇk쌋⼇,ਉ": true,
+ "櫨:ㆣ,é‚lî ¬r崕祜ã®çƒœZ,XXD蕼㉴ kM꯽?P0﹉릗": null,
+ "îŠgv솠歽閘4镳䗄2æ¾¾>쪦sá–¸My㦅울ì‰ç˜—㎜檵9ï……ê‚駓ૉᚿ/u3ì”…å¾ï¤¥[Z䞸ࡗ1ꆱ&Q풘?Ç‚8\u0011BCDY2볨;é¸": null,
+ "幫 nç…¥sì‡íއ 왊-$C\"è¡:\u0014㣯舼.3ë™—Yl⋇\"K迎멎[ê½µs}9鉳UK8ì¥\"掄㹖h㙈!얄સ?Ꜳ봺R伕UTD媚I䜘Wé¨è”®": -4.150842714188901E-17,
+ "ﺯ^ã„„\b죵@fྉkf颡팋î¤êž¦{/Pm0V둳⻿/è½éŸ’ꊔᚬ@5螺G\\å’¸a谆⊪ቧ慷绖?è´¢(é·‡uéŒF=ráæ©¢áž³n:^iá´µtD볠覅Nèµ´": null
+ }]
+ }]
+ }
+ ]
+ ]}
+ ]},
+ "謯?w厓奰Tï§¡í——èážè²–o⪇弒L!캶$ᆅ": -4299324168507841322,
+ "뺊奉_åžæµ¸å»¶ëªå­„Z舰2i$q붿좾껇d▵é¤\"v暜Ҭì„mï¿´g>": -1.60911932510533427E18
+ }
+ ]
+ }
+ ]
+ ]],
+ "í‰êº”㠦楶Pê…±": 7517896876489142899,
+ "ï™°": false
+ }
+ ]},
+ "是u&I狻餼|è°–j\"7cë®sï­-踳鉷`䣷쉄_A艣鳞凃*m⯾☦椿q㎭Nîœæº”铉tlㆈ^": 1.93547720203604352E18,
+ "ï…µkⲨ\\%vr#\u000bâ’ºY\\t<\/3﬌R訤='﹠8è¤êž´ë ´æ›”r": false
+ }
+ ]},
+ "阨{c?C\u001d~K?鎌Ԭ8烫#뙣Pì´ˆé—tã­±E­ë’䆺}ç”—[R*1!\\~hã•…á°º@<9JêષIä³–æ ­6綘걹ᅩM\"▯是∔v鬽顭⋊譬": "ìš´ï¶Kæ•‚(欖C취پ℄爦賾"
+ }
+ }}
+ }],
+ "鷨赼鸙+\\ä­£t圙ڹx᜾ČN<\/踘\"S_ë§¶a鷺漇T彚⎲i㈥LT-xA캔$\u001cUH=a0츺l릦": "溣㣂0æ¿•=鉵氬駘>Pꌢpb솇쬤h힊줎çªãª¬CrQ矠a&è„꼬爼M茴/á¿®\u0017å¼è½¼y#êž c6ë‘´=?Rå´ë· éº–w?"
+ },
+ "閕ᘜ]CT)䵞l9z'xZF{:ØI/躅匽ì¡:䟇AGF૸\u001cퟗ9)駬慟ꡒꆒRS״툋A<>\u0010\"ꂔ炃7gëšEà§îˆbꅰ輤]oã±_뷕ܘ暂\"u": "芢+U^+㢩^鱆8*1鈶鮀\u0002뺰9⬳ꪮlL䃣괟,G8\u20a8DF㉪錖0ㄤ瓶8Nଷd?眡GLc陓\\_죌Vì°à¤²äºŒ?cë¦æ± \u0019JC\u0011b⤉zẒT볕\"绣蘨뚋cꡉkî« I\u001eé³´",
+ "ꃣI'{6u^㡃#཰Kq4逹y൒䧠䵮!㱙ï®/n??{Lí’“ZETã™ í¿X2᩟綳跠葿㚙w཮x캽扳B唕S|å°¾}ì´•%N?o䪨": null,
+ "ⰴFjà·Ÿì…ˆ[\u0018è¾·px?椯\\1<ﲻ栘á£ë´¢æ† ë‰´p": -5263694954586507640
+ }
+ ]
+ ]]
+ ]}
+ ]}]
+ ]
+ ],
+ "?#癘82禩鋆êŠty?&": -1.9419029518535086E-19
+ }
+ ]
+ ]
+ ]}
+ ]
+ ]
+ ],
+ "훊榲.|῕戄&.ãšZꛦ2\"䢥ሆ⤢fV_æ‘•å©”?â‰Fji冀탆꜕iã¬_ẑKᅢ꫄蔻XWc|饡Siẘ^㲦?羡2ã´1ç¸á™…?ì‰Ou": false
+ }]]
+ ]}}},
+ "æ…‚ë—„å“è“”á“åŒåš–/颹蘯/翻ㆼL?뇊,í…µ<\\ç·ã”Cボ": null
+ },
+ "p溉ᑟi짣z:䒤棇r^٫%G9缑r砌롧.물农g?0׼ሩ4ƸO㣥㯄쩞ጩ": null,
+ "껎繥YxK\"F젷쨹뤤1wq轫o?鱑뜀瘊?뎃hç‘\\ꛣ}Kå³^ኖâ¤ï§´ê‰“hy": null
+ }
+ ],
+ "á±€nè‚“ã„›\"å »2>mæ®®'1橌%êž´êµ°=Ӳ鯨9耛<\/n據0u彘8㬇៩fá¿è¯™]嚊": "䋯쪦S럶åŒã…›#î½)O`ሀX_éªæ¸²â›€ã¨»å®…闩➈ꢙஶDRâª"
+ },
+ "tAì“龇 â‹¥bj왎录r땽✒롰;羋^\\?툳*┎?ì€ma䵳넅U䳆૘〹䆀LQ0\bç–€U~u$M}(鵸gï­â³¾i抦뛹?䤈땚검.鹆?ê©¡tâ¶¥GÄ’;!ቹHïš©Så³»B츪ì¼f5≺": 2366175040075384032,
+ "ì „pJjleb]áž½": -7.5418493141528422E18,
+ "n.鎖ጲ\n?,$䪘": true
+ },
+ "欈Ar㉣螵᪚茩?O)": null
+ },
+ "쫸M#x}Dç§±æ¬K=侫们ä¸ï‡ª.KꕾxẠ\u001e㿯䣛FÜ캗ï¬qq8꟞ṢFD훎⵳簕꭛^鳜\u205cÙ«~⑟~冫ऊ2ì«°<\/戲윱o<\"": true
+ },
+ "ã·è¥/T뱂\u0010锕|内䞇xä¾â‰¦ã­–:M?iM᣿IJeç…œdG࣯尃⚩gPt*辂.{磼럾äª@a\\袛?}ᓺBç¼": true
+ }
+ }
+ ]]}]}},
+ "tn\"6î´ê«¤ìƒ¾ä„„;銞^%VBPwu묪`Y僑N.↺Ws?3C⤻9唩Sä ®á´m;sᇷ냞඘B/;툥B?lB∤)G+O9m裢0kC햪䪤": -4.5941249382502277E18,
+ "áš”t'\\æ„«?éµ€@\\ã³ê‚•Pí <<]ç…¹G-b!S?\nꖽ鼫,Ý›&é ºy踦?Eæ†î¬–릱H}햧캡b@手.p탻>췽㣬ꒅ`qeä½­P>á“‚&?u}毚ᜉ蟶頳졪áŽzl2wO": -2.53561440423275936E17
+ }]}
+ }
+ ]
+ ]],
+ "潈촒⿂å¡": 5495738871964062986
+ }
+ ]]
+ }
+ ]
+ ]}
+ ]]
+ ]]
+ ]}
+ ]
+ ]},
+ "á‚qí‚è“…R`謈èŸá¦î’³å„‚æ§åƒ»ï¹¶9å©Œî¬æ«žé‡ˆ~\"%匹躾ɢ뤥>࢟瀴愅?殕节/냔O✬H鲽엢?ᮈà©î“Žâ‹§dâ½ã«zCe*": 2.15062231586689536E17,
+ "ã¶µUi曚ç°é‹ªá¾¼è‡§P{ä䷪쨑̟A뼿T渠誈äšD1!ìž¶<\/ã¡7?)2l≣穷᛾ç¨{:;㡹nemיּ訊`Gî¹²": null,
+ "䀕\"飕辭påœf#뫆䶷뛮;â›´á©3çšëá°ìŽ“â¦·è©µ%᜖Մfs⇫(\u001e~P|ï­—CⲾផv湟W첋(텪બTî¾·<บSê‰à©—⋲X婵i ӵ⇮?L䬇|êˆ?졸": 1.548341247351782E-19
+ }
+ ]
+ },
+ "t;:N\u0015qé¦Rt缆{ê®C?஛㷱敪\\+鲊㉫㓪몗릙ç«(æ°µkYS": "Xá°‚T?൮ô",
+ "碕飦幑|+ 㚦é¶`é•¥ê© B<\/加륙": -4314053432419755959,
+ "秌孳(p!G?Vå‚«%8ሽ8w;5鲗㦙LI檸\u2098": "zG N볞䆭éŽí˜\\ONK3íš™<\/樚立圌Q튅k쩎Ffì‹aׂJK銆ઘì¦ç‹©6༥✙䩜篥CzP(è»é§‡HHퟲ讃%,ά{ë p而刲vy䦅ክ^톺M楒é¢ã¹³]Mdg2>䤉洞",
+ "踛M젧>忔芿㌜Zk": 2215369545966507819,
+ "ì”A`$æ§­é °í»^U覒\bG毲aᣴU;8!팲f꜇E⸃_åµ{å«ç¾ƒX쀳C7ë—®m(åš¼u NÜè°ŸD劯9]#": true,
+ "ﻩ!뵸-ç­šPá­›}á¼°å±¥lPh?౮ⶹꆛ穉뎃gè‘㑓溢CX뾇Gã–¬A錟]RKï’î´²aꄘ]Yo+@ä˜'s섎襠$^í™°}F": null
+ },
+ "粘ꪒ4HXᕘ蹵.$å€\r\u001dë¬77pPc^yî¶ç¬²Q<\/ê–¶ è¨äƒá¨•G?*": 1.73773035935040224E17
+ },
+ "婅拳?bkU;#D矠â´vVN쩆t㜷A풃갮娪a%é®çµª3dAv룒#tm쑬⌛qYwc4|L8KZ;xU⓭㳔밆拓EZ7襨eD|隰ऌ䧼u9Ô¢+]è´´Pè¿": 2.9628516456987075E18
+ }]}}]
+ ]}
+ }}
+ ]}]
+ ],
+ "|g翉F*湹̶\u0005â1脉̀eI쩓ᖂ㫱0碞l䴨ꑅ㵽7AtἈ턧yq䳥塑:z:é€ï¾¼X눔擉)`N3昛oQì…–y-ڨ⾶æ¢êˆµq^<\/": null,
+ "è¹\\ëž“G^璬x৴뭸ゆUSê²§ï®·Bꮤ ┉銜᯻0%N7}~fæ´‹å„Xꔼ<\/4妟Vꄟ9:౟곡t킅冩䧉笭裟炂4ë´‹â±³åºæ€Št+怯涗\"0ã–ˆHq": false,
+ "졬믟'ﺇফ圪쓬멤m邸QLà¦¬ä—æ„4jvsç¿™ à¾ê§€è‰³H-|": null,
+ "컮襱⣱뗠 R毪/鹙꾀%헳8&": -5770986448525107020
+ }
+ ],
+ "î½­B䔚bê»ë™å§“展槰T-똌鷺tcï§ç¿á«½^㓟ä€o3o$꘭趙è¬Ié¡©)뇭Ἑä“\f@{ᣨ`x3è”›": null
+ }
+ ]
+ ]
+ }],
+ "⦖扚vWꃱ꥙㾠壢輓{-⎳鹷è´ç’¿äœ‘bG倛â‹ç£Žc皇皩7a~ﳫUâ•£Q࠭ꎉS摅姽OW.홌ೞ.": null,
+ "蚪eVlH献r}á®ë¯ ï°©ê”„@ç‘„â²±": null,
+ "퀭$JWoê©¢gì—­ì䖔㑺h&à­¢tXX愰㱇?㾫I_6 OaB瑈q裿": null,
+ "꽦ﲼLyr纛ZduçB絟쬴糔?ã•‚ì§¹äµe": "ḱ\u2009cX9ë©€i䶛簆㳀k"
+ }
+ ]]]],
+ "(_ê®g່澮?ᩑyM<艷\u001aꪽ\\庼뙭Zë§·ã°©Vm\\lYç­º]3㋲2㌩㄀Eਟäµâ¨„ì¨á”ŸgङHné–⤇놋瓇Q탚單oY\"♆臾jHᶈå¾îž«á‰„??uㇰA?#1侓": null
+ },
+ "è§“^~ሢ&iIë†g륎ḱ캀.ᓡꀮ胙鈉": 1.0664523593012836E-19,
+ "yè©­GbᔶऽsëŒU:æœî „⤎ϲì—⮼D醄诿që™°I#즧v蔎xHᵿt᡽[**?崮耖p缫쿃Lè,ë´¬ï–ꤦC쯵#=X1çž»@OZc鱗CQTï‹„x": null
+ }
+ ]
+ }}],
+ "剘ç´\u0004\\Xn⊠6,á€×±;嵣崇}讃iႽ)d1\\䔓": null
+ },
+ "脨z\"{X,1u찜<'k&@?1}Yn$\u0015Rd輲ーa쮂굄+B$l": true,
+ "諳>*ì­®ê´äµŸÒ+<ç®}빀䅱⡔æªï€è‡’hIH脟ꩪCí•ଗP좕\"0i<\/C褻DÛžæ—+^5?'ꂱ䚫^7}ã¡ cq6\\쨪ꔞꥢ?纖䫀氮蒫侲빦敶q{Aç…²G": -6880961710038544266
+ }}]
+ },
+ "5s⨲JvಽῶꭂᄢI.a৊": null,
+ "?1qê½ì¿»ê›‹DR%Uå¨>DgNä¹­G": -1.2105047302732358E-19
+ }
+ ]
+ ]},
+ "qZz`撋뙹둣j碇ì\\ꆥ\u0018@ïœè—´ç–°Wz)O{Fä¶›l᷂绘訥$]ë®å¤»ä¢‹ä©‡è¿ç°æ¨§çŒµâ£­jè¶q)$꬚⵷0馢W:â°!Qoe": -1666634370862219540,
+ "t": "=î¹›wp|~碎Q鬳Ó\\l-<\/^ﳊhní–}ä”t碵ḛ혷?é»äŠ—",
+ "邙쇡㯇%#=,î‰E4勃驆V繚q[Y댻XV㡸[逹á°è‘¢B@u=JS5?bLRnì–®ã‰â…ï°³?a6[&íŸ!è—ˆ": 1.2722786745736667E-19
+ },
+ "X블땨4{ph鵋ꉯ웸 5p簂䦭s_E徔濧dç¨~No穔噕뽲)뉈c5M윅>âš‹[岦䲟懷æ?éŽê“†à¸¬çˆ‹ç äœ”s{\u001bméšå„¸ç…›%bﯿXT>ê—˜@8G": 1157841540507770724,
+ "媤娪Qæ¸ï‡\u0011SAyᡈ쿯": true,
+ "çš^ಸ%ê±<\/蛯<O\"-刷ã R(kO=䢊䅎l䰓팪A絫픧": "è­”\\ãš„ ?R7㔪G㋉⣰渆?\\#|gN⤴;Wì¹·A׫癮଼ೣã³ë’œ7dæ“ê¾²0扬S0ᆵi/贎ྡn䆋武",
+ "è‡ç ‡Gã“æœ¦ì¼‹Wq`㞲攊*å†î‘µî¨~霓L剢zI腧튴Tç¹™Cঅ뫬╈뮜ㄾ䦧촄椘B⊬츩r2f㶱厊8eϬ{挚â¯OM焄覤\\(KÓ¡>?\"祴å“\\\\'í": -3.4614808555942579E18,
+ "釴U:O湛㴑䀣렑縓\ta)<D8ï­³æ§é«­D.L|xsæ–‹æ• \"ë‹æ—©7wáŽ": true,
+ "쵈+쬎簨up䓬?q+~\u0019仇îŒëµˆá«¯3áµ£æ˜æž°åŠ«ãª¢uç˜-퀭:ì»™:u`⌿ï«A(9鄦!<çšnj3:Hà£¨å·‹ä€æ—¸ëŽˆë§»v\"\\(곘vO㤰aZe<\/W鹙鄜;l厮ë‘": null,
+ "î–·": -1.2019926774977002E-18,
+ "%者Oî–‹7.Nêªs梇接z蕜綛<\/䜭\"죊y<曋漵@Śâ¹sD⟓jݗᢜ?zî–†/9á²Ma쨮긗贎8ᔮ㦛;6p뾥໭䭊0B찛+)(Yã¿ é¸ä•’^옥": "鬃뫤&痽舎Jì½®è—󽸰ᨨMꈫ髿v<N\\î·.ì‚’ê»…Ñ1ê­¼5ä´·5쳬臨wjë¥"
+ }],
+ "é·Ž'ã³—@帚妇OAj' è°¬f94ǯ(횡ヒ%io쪖ì‚좛>(j:숾å´ä—ŒgCiB뽬Oyuqè¼¥åŽ/7)?今hY︺Q": null
+ }
+ ]
+ ]]]}]
+ ],
+ "I笔趠Ph!<ཛྷ㸞诘X$畉F\u0005笷èŸ.Esr릙!W☆ï›ä²–뗷莾뒭U\"䀸犜Uo3ï¯Gꯌx4r蔇᡹㧪쨢準<ä‚€%ࡡꟼç‘8ç‚Xs0ä€é”€?fi쥱ê†àª²BB": -8571484181158525797,
+ "Lâ¦o#J|\"⽩-ã±¢d㌛8d\\㶤傩儻E[Y熯)r噤὘勇 }": "e(濨쓌K䧚僒ã˜è ¤Vᛸ\"络QJL2,嬓ì™î¿‰ä¼¢ã‹’䴿考澰@(ã¾`kX$ë‘ÑE斡,èœ&~y",
+ "vj.|统圪ᵮPL?2oŶ`ë°§\"勃+0ue%⿥绬췈체$6:qaë Q;~晘3㙘鹑": true,
+ "à·Ø™4ç„â¶¿c︋iâš…:ã‚“é–Ⳙ苆籦kw{䙞셕pCì·ƒê¬âœêŸ¯êš“é…„bížhwkê­­M鬋8B耳쑘WQ\\å™ac'唀x᪌\u2048*hì§Ž#á‡é® ë¾áž¿ë€Œ": false,
+ "⎀jꄒ牺3Ⓝ컴~?親ꕽã¼Ü“å–瘘!@<튋ãŒê¿±â©¦{a?Yv%⪧笯Uܱ栅Eæši뚬:ꄃx7䙳ꦋ&䓹vq☶Iä˜á¾˜æ¶œ\\ì‰ëºŒLr%Bcãœ3?î¤ï…¨ê­ç ¿è£ž]": null,
+ "⭤뙓z(㡂%亳K䌽꫿AԾ岺㦦㼴輞낚Vꦴw냟鬓㹈뽈+o3譻K1잞": 2091209026076965894,
+ "ㇲ\t⋇轑ꠤ룫X긒\"zoYì‡í¬wjæ¢ì‘l侸`e%s": -9.9240075473576563E17,
+ "啸ꮑ㉰!áš“}éŠ": -4.0694813896301194E18,
+ "ï‰>]囋੽EK뇜>_ꀣ緳碖{ì裔[<ನ\"䇅\"5L?#îµ³xTwv#ç½\u0005래t应\\N?빗;": "v쮽瞭pë­ƒ"
+ }
+ ]],
+ "æ–´æ§¾?Zç¿\"~æ…弞ﻆ=꜡o5é‹ï’½dw\"?Kè ¡i샾ogDï²°_C*⬟iㇷ4nયèŸ[㟉U꽌娛苸 à§æ“贻洞펻)쿗૊許X⨪VY츚Zä¾ã¶­~튃ᵦ<\/E臭tve猑x嚢": null,
+ "锡⛩<\/칥ꈙᬙè€&êšç±¬â– 865?_>Lè©ì¿¨äˆŒæµ¿å¼¥ï©‰Ì«î¾½ï‘lj&zx<\/C쉾?覯n?": null,
+ "꾳鑤/꼩ï¨d=ᘈn挫ᑩ䰬ZC": "3錢爋6Ƹ䴗v⪿Wr益G韠[\u0010å±—9ì¡é’u?殢c䳀蓃樄욂NAq赟c튒ç˜ë ¶î‚³Aà«¡Éšæ"
+ }
+ ]
+ ]
+ ]}
+ ]
+ ]
+ }]]]}}
+ ]}],
+ "ï‚’Ejä—³U<\/Q=ç’샎䞦,å °é  @褙g_\u0003ꤾfâ¶½?퇋!łB〙ד3CC䌴鈌U:뭔咎(Qો臃䡬è‹BO7î¼§ã¢äŸ¸\"Yb": 2.36010731779814E-20,
+ "逸'0å²”j\u000e눘먷翌C츊秦=ꭣ棭ှ;鳸=麱$XP⩉駚橄A\\좱⛌jqvä°ž3Ь踌v㳆¹gT┌gvLBè³–ïžçƒ¡m?@E঳i": null
+ },
+ "曺vì°˜×?&绫OáŸ": 9107241066550187880
+ }
+ ]
+ ],
+ "(e屄\u0019昜훕ç–b蓘ᬄ0/۲묇Z蘮á€â¨è›˜èƒ¯ë¢ƒ@㘉8ሪWᨮ⦬ᅳ䅴HIá‡ì¨³z囕陻엣1赳o": true,
+ ",b刈Z,á æ™Tì†Å•B⩆ou'í¼â‰ƒç»—é›—dè­Š": null,
+ "a唥KB\"ï³è‚•$u\n^â…„P䟼냉䞸⩪u윗瀱ꔨ#yÅŸsî««ê’¬=ï‹•1ïš–|ﲤ爢`tà±íмî£ì³«_Az(Ṋ擬㦷좕耈6": 2099309172767331582,
+ "?ã´¸U<\/䢔ꯡ阽扆ã¤qé‹?f㔫wM嬙-;UV죫嚔픞G&\"Cá—äªí’ŠQ": "VM7ç–¹+陕枡툩窲}ç¿¡ä–¶8欞ÄsTë®}ç’¤:jﺋ鎴}HfAàµâ§»Zd#Qï¬u茅J髒皣Y-︴[?-~쉜vë”璮㹚䅊﩯<-#\u000eê±€h\u0004u抱﵊㼃U<㱷⊱IC進"
+ },
+ "숌dee節é½é‚ºp넱蹓+e罕U": true
+ }
+ ],
+ "b⧴ë£??á” 3ã±>%郿劃ç¿ê¬ê ›Wï¡°çž³á«ëˆ„躨狀ໄy੽\"ីuS=㨞馸k乆E": "トz݈^9R䬑<ﮛG<s~<\/?ⵆá¥è€ç†·uë“·"
+ }}
+ ]
+ }
+ ]}
+ }
+ }
+ }
+ }},
+ "宩j鬅쳜Qê–јyç”Zá­µï1væ“–}䨿F%cֲ᫺贴m塼딚NP亪\"ï¿‹sa뺯ꘓ2:9뛓ï à¼‚쌅䊈#>Rꨳ\u000fTT泠纷꽀MR<CBxPñ±’«X쇤": -2.22390568492330598E18,
+ "?䯣ᄽ@Z鸅->ᴱ纊:ã ­ë³®?%N56%鈕1ä—äœaä²—j陇=ë¿»å‚衋࿘ᓸ?ᕵZ+<\/}H耢bä€z^f$&ã’LkꢳI脚뙛u": 5.694374481577558E-20
+ }]
+ }
+ ]],
+ "obj": {"key": "wrong value"},
+ "퓲꽪m{ã¶©/뇿#â¼¢&᭙硞㪔E嚉c樱㬇1aç¶‘á–DḾä©": null
+ },
+ "key": "6.908319653520691E8",
+ "z": {
+ "6U閆崬밺뀫颒myj츥휘:$è–ˆmYí–š#rzé£+玭V㭢뾿愴Yî°‘ê–šX亥ᮉ푊\u0006åž¡ã­ë£\"厓ᔧḅ^Sqpv媫\"⤽걒\"˽Ἆ?ꇆ䬔未tv{DV鯀Tἆl凸g\\㈭ĭ즿UH㽤": null,
+ "b茤z\\î¨.N": [[
+ "ZL:ᅣዎ*Y|çŒ«åŠæ«•è¾Oj为1糕쪥æ³S룂w࡛á²â¸¥èš™)",
+ {
+ "\"䬰á»wDæ¾V`邀⠕VDãºsH6[칑.:醥葹*뻵倻aD\"": true,
+ "e浱uî¿£p蔽Crà· JK軵xCʨ<뜡癙Yç©ï½¹é½ˆX/螗唻?<蘡+뷄㩤쳖3å‘犾&\\첊xzå崦ݻé´\"åµ¥B3㰃詤豺嚼aqJ⑆∥韼@\u000b㢊\u0015L臯.샥": false,
+ "l?Ǩ喳e6㔡$M꼄I,(3á縢,䊀疅뉲B㴔傳䂴\u0088㮰钘ꜵ!ᅛ韽>": -5514085325291784739,
+ "o㮚?\"춛㵉<\/﬊ࠃ䃪ä£wp6ἀ䱄[s*S嬈貒pᛥ㰉'ë€": [{
+ "(QP윤懊FI<ꃣ『䕷[\"ç’å¶®?%Ḭå£à²»ä‡Ÿ0è¤!è—²ë¹bdæµ¶tl\u2049#쯀@僞": {"î—i妾8홫": {
+ ",Mï£ë§ƒäž›K5nAㆴVNã’Ší–¬$n꩑&êŽæ¤žî·é˜«?/á¹ì„¸ë‰ª1x쥼㻤㪙`\"$쟒薟B煌܀ì¨à­2掳7㙟鴙Xå©¢\u0002": "Vዉèˆï ’᧷⦌kîŒï®žà°ˆnz*<?੃'ahhCFX(\u0007⮊Eã­ä±¾Gxꥩrâ£.æ´Ž",
+ "ë»´5bDDí¯O傆盓왻U?êž…êŠNé­á§¢Ï„\"迳豲8\u001b䃥ꂻ䴺ྸHç­´,": {
+ "\"L鸔SE㬡XV&~ÍŽ'놅蔞눶l匛?'.Kæ°\\ƢẨ疇má¿›'ê½³&!é¹ m'|{Pç—Š ç§„ì’¿u\u00111ä‹§î´¼gÏ©x7t丗D䊨䠻z0.A0": -1.50139930144708198E18,
+ "8é‹‚ë›·ïž”?ì²’B☚>ï·œFM\"è­7ê€-VR<\/';ä™E9$䩉\f @s?íªo3^è¡´cî˜à¶Žä§ªaK鼟q䆨c{ä³ 5mᒲՙ蘹ᮩ": {
+ "Fã²·JGoâ¯Pëµxë’³p䘧☔\"+ꨲå¿JfR㔹)4nç´¬G练Qáž!C|": true,
+ "p^㫮솎ocî’£.೚A㤠??r\u000f)⾽⌲們M2.䴘䩳:⫭胃\\á¾@Fá­Œ\\K": false,
+ "蟌Tk愙潦伩": {
+ "aï‘<\/@ᾛ慂侇瘎": -7271305752851720826,
+ "艓藬/>á„ṯ,XW~㲆w": {"Eç—§î–郶)㜓ha朗!N赻瞉駠uC\u20adè¾ <Ve?í±!ImäŽî­Ÿæ„:*s 9諚Prᵾ뒰髶B̌qWA8梸vS⫊⢳{t㺲q㺈랊뮣RqK밢쳪": [
+ false,
+ {
+ "\u000b=>x퓮⣫P1à «LMMX'M刼唳ë¤": null,
+ "P쓫晥%k覛ዩIUᇸ滨:å™í˜²lMR5䋈V梗>%å¹½ué –\\)쟟": null,
+ "eg+昉~矠䧞难\b?gQì­·ç­\\eê® Nl{ಢ哭|]Mn銌╥zê–˜zⱷ⭤ᮜ^": [
+ -1.30142114406914976E17,
+ -1.7555215491128452E-19,
+ null,
+ "渾ã¨ß牄귛r?ëŒ?w[âšžÓ»~廩輫㼧/",
+ -4.5737191805302129E18,
+ null,
+ "xyà¿‘M[ocì…’ç«“â’ºx?뜓y䊦>-Dì¼(&&?XKkc꩖ﺸá‹ëµžK伕6à§€)딀PæœyWæ™îž¢?훻魢傎EG碸9類៌g踲C⟌aEX舲:z꒸许",
+ 3808159498143417627,
+ null,
+ {"m試\u20df1{G8&뚈h홯J<\/": {
+ "3ஸ厠zs#1K7:rᥞoꅔꯧ&ë‡éµ¼éž«6è·œ#赿5l'8{7㕳(b/j\"厢aqç±€êš\u0015厼稥": [
+ -2226135764510113982,
+ true,
+ null,
+ {
+ "h%'ë§žï–±Sì‹…Hs&dï”l슾W0jé¿M×D놯L~S-㇡Rì­¬%": null,
+ "⟓咔謡칲\u0000孺ꛭx旑檉㶆?": null,
+ "æ‡I転;￸B2Y`z\\ç“w,ë†æ¿æ’埵䂄)!ä¶¢D=à´­ã´ŸjyY": {
+ "$ࡘt厛毣ൢIèŠ<겿骫⫦6tr惺a": [
+ 6.385779736989334E-20,
+ false,
+ true,
+ true,
+ [
+ -6.891946211462334E-19,
+ null,
+ {
+ "]-\\êŸ1/è–“â§á½Š\\l牑\u0007A郃)阜ᇒᓌ-塯`W峬G}SDb㬨Q臉⮻빌O鞟톴첂B㺱<ƈmu챑J㴹㷳픷Oㆩs": {
+ "\"â—‰B\"pᶉt骔J꩸ᄇá›iâ•°æ ›K쉷㉯é©!ãˆnì¹äŸ…難>盥yé“¿eà­”è’M貹ヅ8å˜‹í€¯ä‰¶áŒ¥ã¢æ®Šë»³\"絧╿ꉑ䠥?∃蓊{}㣣Gk긔H1哵峱": false,
+ "6.瀫cN䇮F㧺?\\椯=ÚˆT䘆4â˜ïšŒ8qv": -3.5687501019676885E-19,
+ "Q?yऴr혴{஀䳘p惭f1ﹸ䅷䕋贲<ྃᄊ繲hq\\b|#QSTî“¶s1c-7(äµ¢\u2069åŒçµ˜ê¯‰:læ¯´ï›æ±žt戀oà·Ÿáµ¶ë®±á£-醇Jx䙬äí–¢0࣫á¡grã„›": "\u0011_xM/蘇Chv;dhA5.嗀绱V爤ﰦiëµ²M",
+ "â‘[\"ugoy^儣횎~U\\섯겜ï¥l2jw஌yD腅̂\u0019": true,
+ "ⵯɇä²á«¿à¢š!㯢l샅笶戮1꣖0Xe": null,
+ "劅fë„€ï‹ï§¼bå®ç„ŠE찓橵G!ʱç“뭔雩괛": [{"p⹣켙[q>燣äƒãž½î›œá©²x:쓤삘7玑퇼0<\/qç’‚á‘[ï ™Z\\3䅵䧳\u0011㤧|妱緒C['ì·“Yꞟ3Z鳱雼P錻BUì”§U`ᢶg蓱>.1Ó§è­«'L_5VäµÐ¦": [
+ false,
+ false,
+ {"22ä‚盥N霂얢<F8î±ê¼µ7Gà°¸yhë€g᦭ꄢx硴嬢\u001a?Eê´†T|;7犟\"Wt%ä©O⨵t&#ᬋK'èœá²«æ”⾠鲂Të©·éƒ\u0018䓞cE": {"f=ä츜瞾zw?å­¡é£\\铀᫞yẆg(\u0011M6(s2]`ਫ": [[[{
+ "'y몱纣4S@\\,i㷯럹Ua充Tᣢ9躘Zଞ쥿äŠs<\/刎\\\"뉦-8/": "蜑.X0꭛낢륹iì ¨êš<8?s볕è¡|Q✬᯦@\\G㑢屿Mn졾J굤⥟JW뤵苑rì•툄嵵?â¾¥O",
+ "^1挲~[n귆誈央碠멪gI洷": -8214236471236116548,
+ "sሣ%娌暡clr蟜㑓2\u000bSâŸ_X㨔⚴5~蔷ꀇ|Xu㬖,꤭å¹îµ¿r(g믇ì©ïЍ%췸앙|æ £U\\2]䤉+å• è¡ê¯ŽT鉹m\n/`SzDᅼ鞶": 1.1217523390167132E-19,
+ "u톇=黚\\ ꂮ췵L>躰îe9â‘©_뵜斌n@B}$ê´»Yá±@ä§‹î´½V\"☒-諯cVë¯Ê ": true,
+ "Ű螧ᔼæªéŽë•’딜qꄃH뜣<ç§à¥‚CYå“â¸>XQ㵡趌oë¬k픀빯a(ܵç”ë†à­¯/6Nᪧ}æšá†šì§ŒP牰泱鈷^d꣟#Lì‚€\"㕹襻;k㸊\\f+": true,
+ "쎣\",|⫝̸阊x庿k잣v庅$éˆê´Žç‚”k쬪O_": [
+ "ìž©AzZGz3v愠ꉈⵎ?㊱}Så°³à¯p\r2>ì·IP䘈M)w|\u000eE",
+ -9222726055990423201,
+ null,
+ [
+ false,
+ {"´킮'뮤쯽Wxè®V,6ᩪ1ç´²aႈ\u205czD": [
+ -930994432421097536,
+ 3157232031581030121,
+ "l貚PY䃛5@䭄<nW\u001e",
+ [
+ 3.801747732605161E18,
+ [
+ null,
+ false,
+ {
+ "": 4.0442013775147072E16,
+ "2J[sᡪ㞿|n'#廲꯬乞": true,
+ "B[ç¹°`\\ãa̼㨀å›ã½“<\/꥖ᵈO让\r43⡩徑ﬓ๨ﮕx:㣜oçŽê‰Ÿã¢Cçµï›‰á½†á“žì‡“Qs氯였9é§µq혃Ljê‚”<\/昺+tä‹à¼»çŒ™c沪~櫆bpJ9Uá:칣妙!çš—F4㑄탎䕀櫳振讓": 7.3924182188256287E18,
+ "H磵ai委曷n柋T<\/å‹¿F&:ꣴfU@㿗榻Lb+?í„sp\"᪟~>ê·»m㎮ç¸fî§¡": 1.0318894506812084E-19,
+ "࢜⩢Ш䧔1肽씮+༎ᣰ闺馺窃䕨8Mƶqè…½xc(៯å¤J5굄ä•Qj_훨/~価.䢵慯틠퇱豠㼇Qﵘ$DuSp(8Uà¸<\/ಟ룴𥳐ݩ$": 8350772684161555590,
+ "ㆎQ䄾\u001bpᩭ${[諟^^骴᤮b^ㅥI┧T㉇⾞\"绦<AYJ⒃-oF<\/蛎mm;obh婃ᦢ": false,
+ "䔤䣈?æ±.p襟&dã±…\\Jᚠ@?Oì²à¢½íœ”VR蔩|㒢柺": [[
+ "-ꕨ岓棻r@鿆^3~䪤Ѐ狼︌ﹲ\\á¸MlEìµ Q+",
+ null,
+ false,
+ 3346674396990536343,
+ null,
+ {
+ "": null,
+ "/ä¨S쨑,&繷㉥8C엮赸3馢|뇲{鄎ꗇqFﶉ雕UD躢?Ꟛအï–꽡[hᕱᗅ㦋쭞MユèŒ?L槽암V#성å”%㣕嘵\\Ú¹(å˜èº¿&q": [
+ -1364715155337673920,
+ false,
+ -8197733031775379251,
+ "E팗鮲JwH\\觡܈áœ\"+뉞娂N휗vå™™á‚ê¹¼\u001dD帒l%-æ–”N",
+ -3.844267973858711E-20,
+ [{"쬯(褈Q 蟚뿢 /ⱖ㻥\u0017/?v邘䃡0U.Z1î­­x?鯔Vå° 8Emï•<": [[[
+ null,
+ [
+ null,
+ -5841406347577698873,
+ "í‚·\"S⋄籞繗솸ᵣ浵w쑿ퟗ7náŽx3ì•™z㘌쿸I葥覯ã¬0á†b汆狺뷘ႀnꋋ",
+ -1227911573141158702,
+ {
+ "u㉮PᾺV鵸A\\g*à¡—9슟晭+ͧↀ쿅H\u001c꾣犓}癇æ›á—¬é»©äŸ˜X梑é†e>rä°‚f矩'-î½7ä¡­æ¡¥Dz兔V9è°¶å±…ãºá”Šä©¯ë².\u001eL0ὅㅷ釣": [{
+ "<쯬Jå·^숞u࠯䌗艞R9닪gã¾ë³Ža䂈歖æ„:%é”|ﵤ|y}î¡»>;2,覂⶚啵tb*ä»›8ä¹’ã“¶B࿠㯉戩oX 貘5V嗆렽ë‚߼4hä§›êºM空\\b꿋貼": 8478577078537189402,
+ "VD*|吝z~h譺aᯒ": {
+ "YIì·¢K<\/濳xNne玗rJo쾘3í•°é´Š\"↱AR:ࢷ\"9?\"è‡ï¦¡)?誚êŠe)_D翾W?&F6J@뺾ê°NZ醊Z쾈വHï±å¶¿?炫㷱鬰M겈<bïž²S}㎥l|刖k": {"H7鷮퇢_k": [
+ true,
+ "s㟑瀭좾쮀â‘î¬Yì°ºk맢戲쀸俻àº6å„®ë—æ‰–puߖꜻ馶rꈞ痘?3ྚ畊惘䎗\"vv)*臔웅鿈䧲^v,껛㰙J <áš¶5",
+ 7950276470944656796,
+ 4.9392301536234746E17,
+ -4796050478201554639,
+ "yꬴc<3㻚",
+ "oå¡\u20a4蒵鮬裢Cá´§nBã­±f.",
+ false,
+ [
+ false,
+ "ã¡å¼‘V?瀆䰺q!출㇞yᘪ꼼(IS~Ka 烿ꟿ샕桤\u0005HQҹ㯪罂qè¾âš‡æ‡‹â¦•ë‘¡v",
+ 1862560050083946970,
+ "\u20b6[|(ë­¹gê’펉O轄Dl묽]ﯨ髯QEbAã’¾m@롴礠㕓2ë•«n6ْ엘঵篳R잷꙲m색摪|@ã¿«5aK设f胭r8/NI4ì¶«æ µ\\꯬2]",
+ false,
+ {
+ "\u000b7*ã™›ç‡.~?䔊pæ•e_拺艿ë·f{ê”»1sé©™`$Ė戧?q⋬沭?å¡·á­šè¹€unoa5": {
+ "Sê·¯o紞㾕ᅶä¾î—¶éЇ12|ÊŸç•´ï–iNAo?|Sw$M拲գ㭄紧螆+,梔": null,
+ "ã­š0?xB疱敻ேBPwv뾃熉(Ó pJ]ê°¢\"Bj'\u0016GE椱<\/zgៅx黢礇h},M9ï´¦?LḨ": "Si ïŸB%~㬒E",
+ "핇㉊살ã¢ìˆ¨~ȪRo䦅D桺0z]﬽蠆c9ᣨyPP㿷U~ãž?쯟í¸å®’뉆U|}㉓郾ࣻ*櫎꼪ä—s?~7\u001e㘔h9{aáž‹}:ã¶’P8": [{"\\R囡ì¬nNæŸ‹çØ›7ì¹¾ :㶃衇徜V æ·±f1æ·â™ i?3Sè§’íž^ᆞ\u20e8á¹°D\u0007ç§¡+躒臔&-6": {
+ "䨑g.fhã”—=8!\"狿ൻLU^ë»±g䲚ã»'W}k欤?๒鲇S꧗䫾$ĥ피": -794055816303360636,
+ "外頮詋~텡竆î™ç¹ƒä©è‹¨ë¾ºæœê¼ƒç˜¹f*㉀枙NH/\u2027ê¢}j묎ïƒvペq︉ì‹ëœ¡Od5 N顯ି烅仟Qfㆤ嚢(i䬅c;ë§§?嶰㩼츱ç¡?-": {
+ "e݆ã¡â¬¬î›–'2ã»’?U篲鿄\"隻Ҭ5NꭰꤺBꀈ拾᩺îº[刯î…5곑Na램ﴦ዆]ã“qwé’„\u001b\"Yæ´Šä—¿î¼ç¥å¡¥è¿µ[⼞⠳P$ê ±5먃0ï¦`": [{"ç°Eè³ï«šb먭N긆Ⰹå²2逶ꜛ?H짉~?P}jj}ä¾·ç¿_T>á­¨b,â»éˆµP䕡䀠८ⱄ홎鄣": {
+ "@?k2é¶–ã‹®\"Oರ K㨇廪儲\u0017ä¾î¿‚J?);\b*묀㗠섳햭1MC V": null,
+ "UIICP!BUA`î€á¢ˆã‹¸~袩㗪⾒=fBï®´l1ꡛ죘R辂여ҳ7쮡<䩲`熕8é ": 4481809488267626463,
+ "Y?+8먙ᚔ鋳蜩ï–럶1㥔y璜౩`": [
+ null,
+ 1.2850335807501874E-19,
+ "~V2",
+ 2035406654801997866,
+ {
+ "<숻1>\"": -8062468865199390827,
+ "Mã¿£ï€E]}qwG莎Gná¶(ê”™\\D⬲iꇲs寢t駇S뀡ꢜ": false,
+ "pê¤ãŽ9W%>M;-Uç’fî£(^j1?&RBéš§ å¿“b똊îƒE": "#G?C8.躬ꥯ'?냪#< 渟&헿란zpo왓Kj}é·§XﻘMツbä•–;㪻",
+ "vE풤幉xz뱕쫥Ug㦲aH} ᣟp:鬼Yá°Ÿ<Fɋ잣緂頒âºä‰²ç‘‘ä…‚,C~Þ…G!f熢-B7~9Pqà¡¢[츑#3ꕎ,Öඳèâ©…ãµ§ì¶€ë¿xyäŒÍ‚tdj!箧᳆|9èš¡ë¬": -2.54467378964089632E17,
+ "䵈䅦5ë¹–,궆-:໿댾仫î»0ᙚyá¦hqáš„": null,
+ "侯Y\"湛졯劇Uì…ŽYXçâ…¸2ä¼´|ç­§\\ä’ã¶¶á·ì‘WaᦵᗱãœëŠ¾è† <Jc63<G\u20fe䇹66僣k0O\"_@U": null,
+ "姪y$#sæ¼´JH璌Ӊ脛Jã¾íŽ”ï¹´oꈶ㚸PD:薠ì–%說ážè¹‚1]⾕5튄": {
+ "á¾Huw3䮅如쿺äŸå«]<鰨ݷ?꯯䫓傩|á¶à·ƒåª½\\澒≡闢": "Mm\"ì‡á¯„졽\"楇<\/ꥆí­å±€néš´@é¿£wâ Š4Pï«å¾ŽW㊋;䤞'.팇è’ä¡´egpxå—Žwà®…ç—å ®á›nË︖䀤4å™™?໚éƒá±‹Þ˜à¥Žtæ‘姫籕殥ï­é™ƒ\"4[ê¬qL4Wê Žx",
+ "ℇjéŒïš›5Bë’š\" U": "ç¡„ê˜{憠êµ:&t䌨m Cઌ쿣鞛XFê Ÿsä­ï¶ƒ\"æ ¼a0x闊昵å²L\\æšèˆaê¸j싹ç…\"î ²çŸï±¡é¦†*êµ–ç³ <ê”躎",
+ "톌賠弳êŸb\"èž–X50sĶ晠3fç§‚å¯Iⓟ:è˜": 5.573183333596288E18,
+ "%䴺": [[[[
+ -6957233336860166165,
+ false,
+ null,
+ {
+ "\"ïŸ\\௮茒袀ᕥ23ୃ괶?䕎.嚲◉ãžL+ᵡ艱hL콇붆@": null,
+ "%螥9ꭌ<\/-t": true,
+ ",9|î«è€¢æ¤¸ä“Xk죱\u0015$Ώ鲞[ï’—?ì—¢á²í˜ªì¦ˆâ´‚â–‚â„´ã—¯\"gî´ëº˜\\êœ#\u0002ヮ}ሎ芲P[鹮轧@냲䃦=#(": 2.78562909315899616E17,
+ "R?H䧰ⵇ<,憰쮼Q總iR>H3镔ᴚ斦\\é‘r*2橱Gâ¼”F/.j": true,
+ "RK좬뎂aí™ f*f㱉á®â¦‹æ½™ã¨‹Gu곌SGI3Ië¿\\F',)t`è蘯囯ﮉ裲뇟쥼_ገ驪▵æ’ᕤV": 1.52738225997956557E18,
+ "^k굲䪿꠹B逤%F㱢漥O披M㽯镞竇霒i꼂焅륓\u00059=皫之눃\u2047娤é–銤唫á•b<\/w踲䔼u솆맚,ä’á³'/it": "B餹饴is権ꖪ怯ꦂẉဎt\"!凢谵⧿ï™0\\<=(uLä·åˆ¨ì‘ª>俆æ“Cy襸Q힆䆭涷<\/á±0î É§îŠ‹䗾䚹\\ኜ?ꄢᇘ`ä´¢{囇}᠈䴥X4퓪檄]ꥷ/3謒ሴn+gé¨X",
+ "GgG꽬[(å«“ëª6\u0004ê¶宩㙻/>\u0011^è¾dTè…ªhxÇ‘%ꊇk,8(Wâ§‚çµP鬜O": [{
+ "Mã´¾c>\\ᓲ\u0019V{>ꤩ혙넪㭪躂TS-痴໸闓âµ/徯O.Mã¥Ê·D囎⧔ì³íœ¤T??鉬뇙=#ꢫ숣BXä­¼<\/d똬졬g榿)eꨋﯪ좇첻<?2K)": null,
+ "Z17縬z]愀䖌 ᾋBCg5ë”’êµ­æ†ê¾“aâ²·í„·u:U촳驿?雺楶\u0001\u001c{q*á°—è‹‘B@kæ°z.*è“—7ረIm\"Oá±@7?_": true,
+ "㺃Z<": -4349275766673120695,
+ "휃䠂fa塆ffixKe'ë¬é—੄뺾w࠾鑎kë•¢m*á‚‘î§·í–žé®6攊&虜h黚,Yä±³Sﭼ둺pN6": [
+ false,
+ "IΎ䣲,\"ᬮ˪癘P~Qlnxå–Sᮔ༬˨IçŒm䜛酛\u0003iê¸ã¦§cQ帲晼D' \\(粋ï›wQcN\\ëµ°è·ˆ",
+ [
+ "D0\\L?M1ì¥KaêŒsd+盌귤憊tz䌣ëŒ×‘Oå‚wÏ¢%á½’gpî•—,Aiï™âŽ§á¶†Iî«˜é¤¾ê¦æ£©å˜…᳉怴%m]á¶is纖D凜镧o심b Uî»·",
+ {
+ "?଼\u0011Rv&^[+匚I趈T媫\u0010.䥤ᆯ1q僤HydⲰl㒽K'ᅾiౕ豲초딨@\u0013J'쪪VD౼P4Ezg#8*㋤W馓]c쿯8": false,
+ "c/擯X5~JmKäµ¶^ìŽà´š|B|u[ì†(X뚤6v}W㤘⠛aR弌臌쾭諦eⒷ僡-;㩩⭖ⷴ徆龄갬{䱓ᥩ!ï¯âŠšá‡¨<v燡露`:볉癮꨽り★Ax7Ꮀ譥~舑\\Vê‹\"$)v": "e&sFF쬘OBï–†d슊寮f蠛জ봞mn~锆竒Gè„\"è¶µG刕䕳&L唽붵<\/I,X팚Bâ¥î¼¶X,kԇҗ眄_æ…¡:U附ᓚAè•§>\u001a\u0011\";~쓆BH4勿”Š7힪",
+ "iT:L闞椕윚*æ»›gI≀Wਟඊ'ꢆ縺뱹鮚Nê©á§¬è•¼21줧\\䋯``â\\ã±é³¨": 1927052677739832894,
+ "ì®ç¼¦è…ƒg]礿Y㬙 fî¼ãƒºSɪ꾾N㞈": [
+ null,
+ null,
+ {
+ "!t,çY 1䗉罵?c饃호䉂Cá­ì’˜z(즽sZG㬣sഖE4ï‚뢜㓕äžä¸®Qpç°6EZឪ겛fx'ꩱQ0ç½£i{k锩*㤴㯞r迎jTⲤ渔m炅肳": [
+ -3.3325685522591933E18,
+ [{"ã“5]A䢕1룥Bï²C?Ꙍ`r룔Ⳛ䙡uä¼²+\u0001àµo": [
+ null,
+ 4975309147809803991,
+ null,
+ null,
+ {"T팘8Dﯲ稟MM☻㧚䥧/8ﻥ⥯aXLaH\"顾S☟耲ît7fSà·‰ë†ë®”/ꕼ䓈ìº4\\霶䠴ᩢ<\/t4?죵>uDï›5➶༆쉌럮⢀秙䘥\u20972ETR3æ¿¡æ†vB? ~鸆\u0005": {
+ "`é––mç’㥉b뜴?Wf;?DV콜\u2020í‰à±“æ“å®ZMj3mJ먡-å‚·ë±™yח㸷꥿ ໘u=Mì!5å­L4v\\?ÇŽ7C홫": null,
+ "|": false,
+ "~Ztᛋ䚘\\æ“­ã—傪Wé™–+ã—¶qᵿ蘥ᙄp%䫎)}=â ”6ᮢS湟-èž¾-mXH?cp": 448751162044282216,
+ "\u209fad놹j檋䇌ᶾ梕ã‰bוּ<dä—±:줰Mé…„\u0000X#_rç¢A饓ê—ÙKo_è·”?ᪧ嵜鼲<": null,
+ "ꆘ)ubI@h@洭Ai㜎ä±k\u0003?Tä‰3é—´%j6jæ£j=â\\U毮ᬹ*8䀔v6cpjâ­¬~Q꿾뺶ï‰íŽµæ‚¡!ì©­åŽl六㽫6퇓ޭ2>": {"?è‹´ê© D䋓帘5騱qï±–PF?☸ç—é¡’yU á¡«cb䫎 S@㥚gꮒ쎘泴멖\\:Ié®±TZ듒ᶨQ3+f7캙\"?\fí’¾\\oæžç´Ÿï»½M.âŽï˜¸é‘OP": [
+ -2.6990368911551596E18,
+ [{"ä’–@<á°¿<\/⽬tTrè…ž&G%᳊秩蜰擻f㎳?Sãµ§\r*k뎾-乢겹隷j軛겷0ë£é®ï µ": {")DO0è…¦:ì¶é€¿:1㥨่!è›æ¨‹2": [{
+ ",ꌣf侴笾m๫ꆽ?1?U?\u0011ꌈꂇ": {
+ "xæ—ç” nVqä…¦w`CD⦂惺嘴0I#vỵ} \\ê·‚Së´Dì–¾?Ô’j溯\"v餄a": {
+ "@ç¿™c⢃趚痋i\u0015OQâlqë†Y0pࢥ3쉨䜩^<8g懥0w)]䊑næ´ºo5ì­QL댊랖L镈Qnt⪟㒅십q헎鳒⮤眉ᔹ梠@O縠u泌ㄘb榚癸Xî©­Þ”Ftj;iC": false,
+ "I&뱋゘|ï£è“”䔕측瓯%6á—»HW\\N1貇#?åƒá—œghá­ªo'䗈꽹Rcìš/蔳迄à¼!0邔䨷푪8ç–©)[쭶緄㇈୧á": {
+ "B+:ꉰ`sì¾­)ë¹¼Cç¾A䫊pMgjdxäHf9᥸W0!C樃'ï¤f䫤סи\u0017Jve? è¦f둀⬣퓉Whk\"஼=չï³î•¤çš†ç¬BIW虨쫓F廰饞": -642906201042308791,
+ "sb,XcZ<\/m㉹ ;䑷@c䵀s奤⬷7`ꘖ蕘戚?Feb#輜}p4nH⬮eKL트}": [
+ "RK鳗z=袤Pf|[,u욺",
+ "Ẏá»ç½¯ë‰‹âº–锅젯㷻{H䰞쬙-ì©“D]~\u0013Oã³¢gb@æ¶è”‰|kᦂâ—!\u001ebMè¤sca쨜襒y⺉룓",
+ null,
+ null,
+ true,
+ -1.650777344339075E-19,
+ false,
+ "☑lꄆs힨꤇]'uTന⌳ë†].1â‹”ê´æ²°\"IWà´©\u0019æ°œ8쟇䔻;3衲æ‹,窌zíŽå–íš—?4?Cë„é—®?ᥙ橭{稻Ⴗ_ì”",
+ "n?]讇빽å—}1å­…9#ê­¨é¶v\u0014å–ˆ)vw祔}룼쮿I",
+ -2.7033457331882025E18,
+ {
+ ";⚃^㱋x:饬ኡj'ê§µT☽O㔬RO婎?향ᒭæ©$渣y4i;(Q>꿘e8q": "j~錘}0g;Lèº*;á•­ê„®0l潛烢5H▄쳂ê’ï­‹ê™¶T犘≫x閦웧v",
+ "~î¢æ¯\u2018c4è·ë E~ᑅቚꈂ?nq뎤.:æ…¹`F햘+%鉎Oç€œìŸæ•›è®âŒæµ¢<\/㮺紿P鳆ࠉ8I-o?#jﮨîŸ7v3Dt赻J9": null,
+ "à£W䌈0êŽqC逖,íš…î·Žcáƒswj;jJSæ«5æ§—OaB>D踾Y": {"ã’°äµF%î©®?59.î„„ãˆcᕨï†í•틎á¸ã‹©B=9IÛⓌ{:9.ywï½å‘°ã†®è‚’᎒tIã¾´62\"ዃ抡C﹬B<\/<EO꽓ᇕu&é‹«\\禞í¹uê’.7훯ಶ2䩦͉ᶱf깵ᷣ늎": [
+ 5.5099570884646902E18,
+ "uQNæ¿¿m臇<%?谣鮢s]]x0躩慌闋<;(î³¥ 鋤.0á µd1#벘a:Gs?í–·'.)ㅴ䞟ç¯å´ˆFS@O㌛ᓬ抢íŒáž¾ëƒ·ì¿Ÿíˆ¥IZn[惵ê§3ë™[&v憙J>ì´‹jo朣",
+ [
+ -7675533242647793366,
+ {"ᙧ呃ï£:[㒺쳀쌡ì‚H稈㢤\u001dá¶—GG-{GHྻຊꡃ哸䵬;$?&d\\⥬ã“Nåœ´ë¤æŒ¨-'ê•®$î“‹PU%?冕눖ié­q騎Q": [
+ false,
+ [[
+ 7929823049157504248,
+ [[
+ true,
+ "Zè™\u0017'eꕤ᱕l,0\\X\u001c[=雿8è ¬L<\/낲긯W99g톉4ퟋbãº\u0007åŠ'!麕Q궈oW:@XáŽïœ¬z蘻m絙璩귓죉+3柚怫tSæ‡è’£ä -æ“¶D[0=퉿8)q0ÙŸ",
+ "唉\nFA椭穒巯\\䥴䅺鿤S#bè¿…ç˜ ï¶—ê¬˜\\?q1qN犠pX꜅^䤊⛤㢌[⬛휖岺q唻ⳡí‹\"ã™™Eh@oA賑㗠yå¿…Nꊑᗘ",
+ -2154220236962890773,
+ -3.2442003245397908E18,
+ "Wᄿ筠:瘫퀩?o貸q⊻(᎞KWf宛尨h^残3[U(='橄",
+ -7857990034281549164,
+ 1.44283696979059942E18,
+ null,
+ {"ꫯAwè·­å–€ ?_ï““9\"Aty背F=9缉ྦྷ@;?^鞀w:uN㘢Rá»": [
+ 7.393662029337442E15,
+ 3564680942654233068,
+ [
+ false,
+ -5253931502642112194,
+ "ç…‰\\îš¶î¶è¾Žî›¢à³†ç½5â’­1äªäƒ‘s䎢:[e5}峳ﴱn騎3?è…³Hyêƒè†¼N潭錖,Yá‹ËœYAá“㬠bG렣䰣:",
+ true,
+ null,
+ {
+ "⒛'P&%죮|:⫶춞": -3818336746965687085,
+ "钖m<\/0ݎMtF2Pk=瓰୮洽겎.": [[
+ -8757574841556350607,
+ -3045234949333270161,
+ null,
+ {
+ "áœî…½rè¼³>⫇9hU#î¦#w@ê·ªA\\Cî’¢ é‹ºã˜“ê–æ¢’뒬묹㹻+郸å¬ìœ¤'+g<\/碴,}ꙫ>ì†;情d齆Jä¬àº©æ’›ì±íƒ¹/R澡7剌tꤼ?ặ!`â²ç¤\u00002똥଴âŸ": null,
+ "\u20f2ܹe\\tAê¥Æ°\\x当뿖ï»ë ‰ç¦›;G檳ﯪï…Sà«°3~㘠#[J<}{奲 5箉⨔{ë†<\/釿抋,åš /曳m&WaOvT赋皺璑ï“í…": [[
+ false,
+ null,
+ true,
+ -5.7131445659795661E18,
+ "è­m䓪D5|3å©à°ž>î‰è ‡æ™¼6nï´ºPp禽羱î¤DS<ç“닫屚ì‚å§¿",
+ true,
+ [
+ -8759747687917306831,
+ {
+ ">ⓛ\t,odKr{䘠?b퓸C嶈=DyEᙬï¿@ᴔ쨺芛髿UT퓻春<\/yê¸>豚W釺N뜨^?꽴﨟5殺ᗃç¿%>í‚ဿ䄸沂Ea;A_\u0005閹殀W+窊?Ꭼd\u0013Pæ±´G5ì“æ˜": 4.342729067882445E-18,
+ "Q^즾眆@AN\u0011Kb榰냎Y#ä€ê€’ᳺ'q暇çµs\"!3#I⊆畼寤@HxJ9": false,
+ "⿾D[)袨㇩i]웪䀤ᛰMvR<èŸã£¨": {"v퇓L㪱ꖣ豛톤î£\\ê³±#ï–©kDTN": [{
+ "(ì¾´ä¡£,寴ph(C\"ã³¶w\"憳2s馆E!n!&柄<\/0Pꈗſ?㿳Qdéµ”": {"娇堰孹L錮h嵅⛤èºé¡’?CglNæŸ+쨣ﺜ\\MrH": {"çžäŽ‡ë‘ƒá‰²å¼­íŒ­^ꄞ踦涟XK錆쳞ឌ`;੶S炥騞ଋ褂B៎{Ú’ä­·á¶¼éœpIè—è™¶K$": [{"â—–S~躘蒉꫿輜è­Qã½™é—@ᢗ¥Eæ¦iØ¡5┄^B[絮跉ᰥé™PWi3wㄾⵀDJ9!w㞣ᄎ{ë“’ê““b6\\篴??c⼰鶹⟧\\鮇ꮇ": [[
+ 654120831325413520,
+ -1.9562073916357608E-19,
+ {
+ "DC(æ˜è¡µá¼¡ê¸™ê°µå§­|Ö›[t": 7.6979110359897907E18,
+ "Jâ…))嫼â³9Xfd飉j7猬ᩉ+⤻î®çœ—벎Eé°‰Zï¾¶63zá69}Zá¶L崭ᦥ⡦éšâ‹›êŽ¨î´µ~i㨃咊ꧭo䰠阀3C(": -3.5844809362512589E17,
+ "p꣑팱쒬ꎑ뛡Ꙩ挴æèƒ”&7ᔈ묒4Hdç¡¶í›ãŽ–zꢼè±ã¿¢aሃ=<\/湉鵲Eî„¡Ó…%$F!í¶æ£Œå­¼{Oé§à¨ºgeu+": ")\u001bìž“kÅ€Xì©«Aë°Â®Ú£ç™¦ç‹¢)扔弒p}k縕ꩋ,䃉tࣼi",
+ "ã‚¡F肿輸<솄G-䢹䛸êŠl`Tqê•—îŠè’ža氷⸅ᴉ蠰]S/{J왲m5{9.uá½³~㕚㣹u>x8Uè®Bëºè¥ªç›ŽQhVS맅킃i识{벂磄Ià·„ä™…xZy/æŠà«­Zï–Šé²î¦š-霳Væ®æŒ¦â„’": null,
+ "㯛|Nî½™ê¸b7âµb?æ‹ O\u0014Þ†?-(EꞨ4ꕷᄤYᯕï‘OW瞺~螸\"욿ќ<u鵵઎⸊î˜å€¾ì‘·à·»rT⪄牤銱;W殆͢芄ਰåší›šìƒ¢î™‡âŠ¿+ã²½": null,
+ "å˜ïƒé€†àº»%_ë§›d)zJ%3ì¹§_릟#95䌨怡\u001ci턠ॣî’i冘4èµ–'à¨ä§_æ ”!": {
+ "*?2~4㲌᭳ì¯ftá‚·1#oJ\bäŠ‡é•‡ë” \u2079xä›ãŠá®‚N;穽跖s휇ᣄ홄傷z⸷(霸!3yëºMì’¿í–Û½v㳉tở心3黎vì­» Rp཮Vr~T?&Ë´k糒븥쩩r*D": null,
+ "8@~홟ꔘk1[": -5570970366240640754,
+ "BZté¦ê¡¬c餖 s(má›´\u0000◄dè…‘t84CâŸå¯VṊ뉙'å™±ê”ç½GCé¡€?허0êž¹&ë‡ä›­Cä·«](": 2.4303828213012387E-20,
+ "yæ’”Z외放+}ḑ骈á™&\u0016`G便2|-e]঳?QF㜹YF\"ã¿’ç·„í–·ï€ãˆŸïƒ¦ï¨ä·¦à­€áŒ¤lM蘸N㾆▛럪㞂tᕬ镈ì‡å– l amcxPnm\u001a᱋<\/]_]ﻹïª?H": false,
+ "áæ°ë¬¢뜚I[♺뽛x?0Hë´¬Wpn꨹Raä¿ïŒ›ìŒ‘{㴂ni祻윸A'y|⺴ᚘ庌9{$æ²{톽=m#@ï–—6ᨧfgs44陎J#<Ễ쨓瀵â©a୛㷉㙉ܸ◠냔嬯~å‘„ç±ç¾¥é•³": false,
+ "㘱{<é ¬22?IF@곊I겂嶻Lá›D{@rì’‚?IAᣧ洪惒誸b徂zì·ºê¾ã ­\\刊%禨ìŒâ¶£ä»µ\\P[:47;<ᇅ<\/": {
+ "^U釳-v㢈ê—â—„è˜rᜨi;èµ·kR犺䵫\u0000é”ì™m-Ô™!lḃ꛸뻾F(Wê·›y": "#á ºH㸢5v8_æ´‘C",
+ "䔵໳$á™ 6èž\u206e摎q圩P|æ…sV4:㜾(I溞I?": -6569206717947549676,
+ "é€êž‚ç·µí‡8 >e㺰\"'㌢ÆW\u0004çž•>0?V鷵엳": true,
+ "뤥G\\î¡‹è¿‹ä ¿[庩'꼡\u001aiá©®Vì¯á³ªä¦ªÃ”î²…;倱ନë›èªˆ": null,
+ "쥹䄆䚟Qæ¦äŽá¢­<\/2ã•£p}HW蟔|äƒî‚꿈ꚉ锳2Pb7㙑Tⅹᵅ": {
+ "Y?Ö­$>#cVBꩨ:>ï†eLè’å‹™": {
+ "86柡0po äš&-æ‘Ћ祌<\/휃-G*㶢הּì©s㶟餇c걺yu꽎還5*í„§ç°•Ogå©¥Sê": null,
+ "a+葞h٥ࠆ裈嗫ﵢ5輙퀟ᛜ,QDﹼ⟶Y騠锪E_|x죗j侵;m蜫轘趥?븅w5+mi콛L": {
+ ";⯭ﱢ!ä¹°Fâ½æŸ¤é¶‚näµ£V㫚墱2ë ¾ELEl⣆": [
+ true,
+ -3.6479311868339015E-18,
+ -7270785619461995400,
+ 3.334081886177621E18,
+ 2.581457786298155E18,
+ -6.605252412954115E-20,
+ -3.9232347037744167E-20,
+ {
+ "B6㊕.k1": null,
+ "ZAꄮJ鮷ᳱo갘硥鈠䠒츼": {
+ "á•…}럡}.@y陪é¶r業'æ´î‰°í€‰x䉴ﵴlí˜):씭脴ᥞhiꃰblﲂ䡲엕8߇Mã¶­0燋標æŒ-?PCwe⾕J碻Ᾱ䬈䈥뷰憵賣뵓痬+": {"aì·©v礗X⋈耓áŠfç½…é®!㔽YYᣓwæ¾33⎔芲F|\"äœT↮輦挑6ᓘL侘?ᅥ]ë†1R௯✎餘6ê½<\/௨\\?qå–·ê«j~@ulq": {"嗫欆뾔Xꆹ4H㌋Fåµ§]à Ž]ã –1ꞤT<$më«O i댳0ä²iï—Œ": {"?à·©?\u20cd슮|ꯆjs{?îž…d7?eNs⢚嫥氂䡮쎱:鑵롟2hJꎒﯭ鱢3춲亄:ë¼£v䊭諱Yj択cVmR䩃㘬T\"Ní™*ै%x^F\\_s9ë³´zz4æ·—?q": [
+ null,
+ "?",
+ 2941869570821073737,
+ "{5{殇0ä¾ïž¢g6ë°–í‹è‡©ç¶¹R$ä–­j紋釰7î‹‘sXI繳漪행y",
+ false,
+ "aH磂?뛡#惇då©…?Fe,ì˜+늵ä˜\"3r瘆唊å‹ï¢Šj⳧࠴ꇓ<\/唕윈x⬌讣䋵%拗ᛆⰿ妴á”M2ã³—å¿…ê§‚æ·²?ゥ젯檢<8ë’ï¶MidXä’3á³»Qî”â–®ä½UT|⤪봦éâŠ",
+ [[{
+ "颉(&뜸귙{yîš’^\"P퟉ì¶á²Ÿä®­î‹ºDé¡¡9=?}Y誱<$bë±£RvO8cH煉@tk~4ǂ⤧â©å±‹Sî›ïž¢S;J{vV#剤餓ᯅc?#a6D,s": [
+ -7.8781018564821536E16,
+ true,
+ [
+ -2.28770899315832371E18,
+ false,
+ -1.0863912140143876E-20,
+ -6282721572097446995,
+ 6767121921199223078,
+ -2545487755405567831,
+ false,
+ null,
+ -9065970397975641765,
+ [
+ -5.928721243413937E-20,
+ {"6ì´Š\u001a홯kB0w撨燠룉{绎6⳹!í„è´‘y▾鱧ժ[;7ᨷ∀*땒䪮1x霆Hᩭ☔\"rî¹›ä7毟á°r惃3ꉭE+>僒æ¾": [
+ "Ta쎩aÆt쵯ⰪVb",
+ [
+ -5222472249213580702,
+ null,
+ -2851641861541559595,
+ null,
+ 4808804630502809099,
+ 5657671602244269874,
+ "5犲﨣4mᥣ?yf젫꾯|䋬ìž$`Iⳉﴷ扳å…,'î±c",
+ false,
+ [
+ null,
+ {
+ "DyUIN쎾M仼惀⮥裎岶泭lh扠\u001e礼.tEC癯튻@_Qd4cï…«5S熯A<\/ï¼¼6U윲蹴Q=%푫汹\\\u20614b[௒Câ’¥Xe⊇囙b,ï®æœ3ss땊ë¢i~逇PA쇸1": -2.63273619193485312E17,
+ "Mq꺋貘k휕=nKç¡ë«žè¼©>㾆~á¼žà¡¹ê¸æ¦µlâ‹™Hw뮢帋M엳뢯î¹…vâ…ƒ^": 1877913476688465125,
+ "á¶´ë»—`~ç­—å…⚽টW˃â½b犳䓺Iz篤p;乨A\u20efì©?ç–Šmã€ì»©ë«¡b탔鄃ᾈV(é¢ç³=뎲ିeF仢䆡谨8t0醄7㭧瘵⻰컆r厡궥d)a阄á·Ed&c﯄伮1p": null,
+ "â¯w4曢\"(欷輡": "\"Má­«]䣒頳B\\燧ࠃN㡇j姈g⊸⺌忉ꡥF矉স%^",
+ "㣡Oᄦ昵⫮Y祎Sì級㭻撥>{I$": -378474210562741663,
+ "䛒掷留Q%ì“—1*1J*ë“헩ᦢ﫫哉쩧EↅIcê…¡\\?â´Šl귛顮4": false,
+ "寔愆샠5]ä—„IHï©¥=d﯊/å¶?ॊn%晥D視Nò—˜ˆ'᫂⚦|X쵩넽z질tsî¦kxDQ莮Aoﱻ뛓": true,
+ "钣xp?&\u001e侉/y䴼~?U篔蘚缣/I畚�Q绊": -3034854258736382234,
+ "꺲໣眀)â¿·J暘î©pИfAVì‚•ì³­Nꯗ4々'唄ⶑ伻㷯騑倭D*Okï¯ê§3bâ½_ï„¡<\/ì±£Xm톰á•䆄`*fl㭀暮滠毡?": [
+ "Dç”·p`V뙸擨å¿ë¸ª9c麺`淂⢦Yw⡢+kzÜ–\fY1䬡Hæ­)ë²¾Z♤溊-혰셢?1ï”<-\u0005;æ¢Tále\\ᛵߓﭩ榩<QF;t=?Qꀞ",
+ [
+ null,
+ [{"-ì·«æ²î«§á¬¨å¢Šè‡¸<à ’Hè·¥ 㔭쥃㫯W=z[wধ╌<~yW楄S!â‘»h즓lÄ–N￧篌W듷튗乵᪪템먵Pf悥ᘀk䷭焼\\讄ræ“é¬y6VF<\/6ëž¿p)麡ê ãª\"pà®´e": [
+ "#幎æ´é¢’嶈)ã„›J.嶤26_⋌东챯ꠉ⤋ؚ/âš%ç§¼Q룠QGztᄎ㎷អIç¿°Xpç”éœê¨",
+ {",T?": [
+ false,
+ [[
+ true,
+ 7974824014498027996,
+ false,
+ [
+ 4.3305464880956252E18,
+ {
+ "᱿W^A]'rᮢ)é¥zï­é¤;Hu\\Fk?ï´º?IGæµ…-ä™§>è¨-xJ;å·¡8깊è ï»“U$K": {
+ "Vê•¡è«…æ“W=斸s︪vﲜ츧$)iꡟ싉eî®å¯³?ጭムVથ嵬iæ¥Fg<\/Z|៪ꩆ-5'@ꃱ80!燱R쇤tç³³]罛逇dṌ֣XHiͦ{": true,
+ "Ya矲Cë©—Q9膲墅æºíœ»c\\ë”¶Gç””<\/.齵휴": -1.1456247877031811E-19,
+ "z#.OOï¿J": -8263224695871959017,
+ "å´_3夼ᮟ1Fë¸ë½¯á¦“é´­V豈Ь": [{
+ "Nè’¬74": null,
+ "yuB?厅vK笗!ᔸcXQ旦컶P-ë…«mᄉ麟_": "1R@ 톘xa_|﩯é˜î¥§sæ§žd!d껀筤⬫è–焵먑D{\\ïƒïŽ¿6k共倌☀G~AS_D\"딟쬚뮥馲렓쓠攥WTMÜ­8nX㩴䕅檹E\u0007ï­¨N 2 ℆æ¶ê¥ê µï“3▙玽|ë¨_\u2048",
+ "æA Cä§©G": {":Mí£5e들\\ê€æ¼á”„é¸|Iï¨$)n": {
+ "|U䬫㟯SKV6ꛤ㗮\bn봻䲄fXT:㾯쳤'笓0b/à³¢Cì³–?2浓uO.ä°´": "à½ê¼‹e?``,ᚇæ…^8ꜙNM䂱\u0001Iá–™ê§M'vKdꌊH牮r\\O@䊷ᓵ쀆(fî »yè»i툺\"?<\/峧ࣞ⓺ᤤ쵒߯ꎺ騬?)刦\u2072læ…ªy꺜ﲖTjî’•+u",
+ "뽫<G;稳UL⸙q2n쵿C396炿Jè“¡zâ£zဩSOU?<\/ë™oEí¸Oé¿…à·´êˆEm#\"[瑦⤫á†glâ¡—q8\"í˜ë¥ä¿‚@ᆤ=\u0001爖ç¾ì·€ã¸©b9\\jeqt㟿㮸龾m㳳긄": {
+ "9\"î²–V霟釜{/o0嫲Cå’€-饷äˆ[ë…©î)\r䤴tMW\\龟ϣ^ي㪙忩䞞N湆Y笕)è¨ê–¤èª¥ç…½:14â«»57U$æ“’ä²è–¡Qvↇ櫲현誧?nà®·6": {"l웾䌵.ä…‹ä¦ic碳g[糲Ƿ-ឈᚱ4ì‘§\u0004C࿼\u0018&쬑?멲<\/fD_檼픃pd쪼n㕊渪V䛉mæˆW儅톳뗳䓆7㭽諤Tç… ï–ŠNey?î¼…0᪵鈑&": [
+ false,
+ null,
+ {
+ "\rî´’;é¼¶já ‚ê¼RLz~â™”9gf?Ó¡æµ": -1.4843072575250897E-19,
+ "&ꊒ\"ꋟä­E诮ﯚO?SWë’훪mb旙⎕ᗕ⶙|á·¤5y4甥": "j5|庠t铱?v íš‹0\"'rxz䃢æºêž«!\u0002",
+ "Q á©ãŸ§": {"Hﬔ\u2058䪠틙izZㅛ탟H^ﶲA??R6å‘ Z솋R.à¿¶g8": [
+ -8762672252886298799,
+ -1.9486830507000208E17,
+ null,
+ -7157359405410123024,
+ null,
+ null,
+ -995856734219489233,
+ "呧㫹A4!",
+ null,
+ -1.9105609358624648E-19,
+ 5888184370445333848,
+ 2.25460605078245E-19,
+ 2.5302739297121987E18,
+ "뢹sbEfæµ2丯ï‡?뗾耸(Wdë™SବꭖrtU?ç­¤P똙Qpbbï‘¡KqaE$æ¥Vì›°3i/lK퉜,8︸e= gèž“t竦컼?.寋8éµ—",
+ 7377742975895263424,
+ 2.4218442017790503E-19,
+ {
+ "y꒚ཫ쨘醬킃糟}î‘yTSt䡀⇂뿽4ൢ戰U": [[
+ 3600537227234741875,
+ 4435474101760273035,
+ -1.42274517007951795E18,
+ -5567915915496026866,
+ null,
+ null,
+ [
+ -3204084299154861161,
+ {
+ "7梧慸æ†.a瘎\u00041Uéµ®CkÖ¨d惥è€â³¡Y,â­ì¨EåžFFI鱑ⳬ줢7â§µBﴠ耘줕햸qì»´~*ç‘W.떛ࡆ@'á€+è½³": -961121410259132975,
+ "⥅]l黭㣓绶;!!⎃=朼ã¿e&ἂ繤C﯀lä£ãŒ€6TMì‘®w懃ꡡ#ᤆ䰓,墼湼゙뽸㲿䧽쫨xᵖ듨<\/ T0峸iQ:溫è„\\\"쎪ὴ砇宖^Mæ³¼í¥âž…鈫@ᄟ༩\u2008⥼": true,
+ "â©\"籽汎P싯鲘蟼sRá¯ä…©\u0019R(kRá–&ಌ 0\"é³¶!馼YH": null,
+ "鮼ꚇ싋։刟\rRLd步Nⴗ5Eࡆ訛갚[I醵NC(郴ṉy5D뤺౳QY壯5苴y훨(W\\Cଇ姚C艄깹\u001c歷㋵ZC᥂": [
+ -6806235313106257498,
+ null,
+ "}N⸿讽sꚪ;ï‘¶\\p繇jè‹„î¡ä«¨\u20e7%5x?î•¥t#",
+ {
+ "O〗k<墻yV$à°rs-c1ఌ唪.C7_Yobᦜ褷'b帰mã„‘l⌅": {"qB뗗擄3éš‚5ëºæ«‚䱟eì´¸P/é©,3æŽê—©=冉棓㑉|ËžF襴뿴,:㞦<퓂⧙礞♗g뚎ᛩ<\/뉽ⶳ⸻A?_x2Iã½å‹’*Ií™±î¢é§ç²¿~曟㤙2绥Ly6+ìƒuu鿜בfí˜|æ­à£–É": [
+ ">hh䈵î”w>1â²ì­V[â…Ž\\헑벑F_ã–⠗㫇hæ½;á¿æ±°á±¼ç€–J옆9RRì…vsZ柺鶶툤r뢱橾/ꉇ囦FGm\"謗ꉦ⨶쒿⥡%]鵩#ᖣ_蹎 u5|祥?O",
+ null,
+ 2.0150326776036215E-19,
+ null,
+ true,
+ false,
+ true,
+ {"\faá­¶Pæ¤WWcá Ÿf뚉á¬í“—â³€Wç¹5:HXH=q7xì°™X$)모r뚥ᆟ!Jﳸf": [
+ -2995806398034583407,
+ [
+ 6441377066589744683,
+ "Mﶒ醹i)Gἦ廃s6몞 KJ౹礎VZ螺费힀\u0000冺업{è°¥'꡾뱻:.ꘘ굄奉攼Diá·‘Ké¶²y繈욊阓v㻘}枭캗e矮1c?íœ\"4\u0005厑莔뀾墓ë‚⽴洗ṹ䇃糞@b1\u0016즽Yè½¹",
+ {
+ "1⽕⌰鉟í”M㤭n⧴ỼD#%é˜âŠ¯ì¿¼ç¨ë¸£ëªç´§á…‡ã“•ᛖcw嬀~ഌ㖓(0r⧦Qä‘•é«à´°é“‚㓻Rå„®\"@ꇱmâˆà¯¿á¦¯é Œ8}㿹犴?xn잆꥽R": 2.07321075750427366E18,
+ "˳b18㗈䃟柵Z曆VTAu7+㛂cb0﯑Wp執<\/臋뭡뚋刼틮è‹ë²²î·´TLP预庰܈G\\O@VD'鱃#ä¹–ëº*鑪ꬳ?MÞždï­¹{â‡åœ¯ì‡œã¼ž顄︖Y홡g": [{
+ "0a,FZ": true,
+ "2z̬è£î’®ê§¦é©¸\u0006L↛Ḣ4๚뿀'?lcwá„§ã®!蓚䃦-|7.飑挴.樵*+1ﮊ\u0010ꛌ%貨啺/JdM:ë˜ïˆ!FBe?鰴㨗0Oè´¢I藻ʔWAá«“Gì³›u`<\/I": [{
+ "$Ï„5Vé´a뾆両環iZp頻යn븃v": -4869131188151215571,
+ "*즢[⦃b礞R◚nΰꕢH=귰燙[yc誘g䆌?ଜ臛": {
+ "洤湌鲒)⟻\\䥳va}PeAMnï¼®[": "ã³Éª/(軆lZR,Cpæ®È®Nå•·\"3Bå©´?i=r$펽á¤ì€¸",
+ "阄R4㒿㯔ڀ69ZᲦ2ç™í•Œå™—På´œîž#\\-ì­è¢›îˆµ&é‘/$4ç«¥Vê©‘_ZHAæ¾¢fZ3": {"x;P{긳:Gé–‰:9?æ´»H": [
+ "繺漮6?z犞焃슳\">á»[Ⳛ䌜ë…䂹>èµâ¼¶ç…œï’˜Yæ¡¥[泥뚩MvK$4ï‰jtï¾›",
+ "E#갶霠좭㦻ୗ먵F+䪀oè’ba쮎4X㣵 h",
+ -335836610224228782,
+ null,
+ null,
+ [
+ "r1᫩0>danjY짿bs{",
+ [
+ -9.594464059325631E-23,
+ 1.0456894622831624E-20,
+ null,
+ 5.803973284253454E-20,
+ -8141787905188892123,
+ true,
+ -4735305442504973382,
+ 9.513150514479281E-20,
+ "7넳$螔忷㶪}䪪lì§´\u0007é¹Pé°šHFéŠZJﳴ/âŽ1ᷓ忉ç‡áœ‹ì“ˆxëµ mä·çª¥á”^\u0019á¶Œå­#ヂt☆áƒpáŽè‡¶äŸ±5ï‰$ä°µ&๵分ìˆ]äˆë‰â™‚åŽ\u0011<>",
+ "C蒑貑è—lï°°}X喇몛;të°¿O7/᯹f\u0015îµ¼kI嘦<ዴ㟮ᗎZ`GWퟩ瑹࡮ᅴB꿊칈??Ræ ¡s脚",
+ {
+ "9çµæˆ¬+AU^洘拻ቒy柭床'ç²™XG鞕᠜繀伪%]hï ¾C,$è¼™?Utä¹–Qmë–šWï¶8઼}~qâ ªrU䤶CQ痗ig@#≲t샌f㈥酧l;yé—¥ZHæ–¦e⸬]j⸗?ঢ拻퀆滌": null,
+ "畯}ã§¢J罚å¸VX㨑>1ꢶkT⿄蘥ã‘o|<嗸層沈挄GEOM@-äžšä§°$만峬è¼ä ±V✩5宸-æ‚î¡§D'ã—ªyP掶7bâ ŸJã•»SfP?d}v㼂á…'猘": {
+ "陓y잀v>╪": null,
+ "鬿L+7:ë‘Y=ç„ U;킻䯌잫!韎ஔ\f": {
+ "駫WmGጶ": {
+ "\\~m6ç‹©K": -2586304199791962143,
+ "ႜࠀ%Í‘lâ¿…D.ç‘¢Dk%0ç´ªdḨTI픸%뗜☓s榗኉\"?V籄7w髄♲쟗翛歂E䤓皹t ?)ᄟ鬲éœ6Cî³´": {
+ "_ì·¤a圷1\u000eB-XOy缿請∎$`쳌eZ~æï€§íŠ»/蜞`塣৙\"⪰\"æ²’l}蕌\\ë¡ƒè«æ°Œ.望wZ|o!)Hnçqg}": null,
+ "kOSܧ䖨钨:಼é‰ê­O醧Sî…¨`ì‹­`ꓭì­ï¯¢N&Et㺪馻ã¢â…³ã¢ºå´¡àºŠèœšé”«\\%ahx켨|ż劻ꎄ㢄ìŸA躊᰹p譞綨Ir쿯\u0016ﵚOd럂*僨郀N*bã•·63z": {
+ ":L5r+T㡲": [{
+ "VK泓ë²á®™Ry㓤➙Ⱗ38oi}LJቨ7Ó㹡৘*q)1豢⛃e᫛뙪壥镇æž7Gè—¯g㨛oI䄽 孂L缊ꋕ'EN`": -2148138481412096818,
+ "`â›á˜‘$(खꊲ⤖á„ꤒ䦦3=)]Y㢌跨NĴ驳줟秠++då­³>8ᎊ떩Eê¡£Sv룃 쯫أ?#Eî·°|á­™ãŽ?zv:5ï©^â‹‘V": [
+ -1.4691944435285607E-19,
+ 3.4128661569395795E17,
+ "ãƒì´—^G9ä½­é¾¶n募8R厞eEw⺡_ㆱ%⼨D뉄퉠2ê©µá›…â³æ¿L팹Là·€n=\"æ…‰ë…á›®y>!`g!í’²î¦ï¨’[/;?[vï®ê²è»‡}⤳â¤í•∌Tã½²R홓é‰ã“¥",
+ "æ„°_⮹T䓒妒閤둥?0î°šaB@㈧gç„»-#~è·¬x<\/èˆPÝ„ê¡=\\׳P\u0015jᳪá¢qï‹¶;ã¯l%á­—;砢觨â–,è¬ê°Gy?躤O黩í‹Yã’a擯\n7覌똟_䔡]fJ晋IAS",
+ 4367930106786121250,
+ -4.9421193149720582E17,
+ null,
+ {
+ ";ᄌ똾柉곟ⰺKpá‡ä±»à¸ºä–{o~h!ï½…ê¿àª»ìš„Úš\u0002y?xUd\u207c悜ꌭ": [
+ 1.6010824122815255E-19,
+ [
+ "宨︩9앉檥pr쇷?WxLb",
+ "æ°‡9】J玚\u000f옛呲~ è¼ 1D嬛,î•*mW3?n휂糊γ虻*á´«ê¾ ?qîžå‡è¶—Ko↦GTé“®",
+ "ã¶¢ážmOã”k'诔栀Z蛟}GZé’¹D",
+ false,
+ -6.366995517736813E-20,
+ -4894479530745302899,
+ null,
+ "V%᫡IIç’…ï»ä…›ä“Ží’¹ï±¢/pU9seë˜ë›žx梔~C)䨧䩻蜺(g㘚R?/á»°[å¿“C뾠ࢤc왈邠买?嫥挤풜隊枕",
+ ",vç¢å–”㌲쟚蔚톬៓ꭶ",
+ 3.9625444752577524E-19,
+ null,
+ [
+ "kO8란뿒䱕馔b臻âŸéš¨\"㜮鲣Yq5mí”<u뷆cè­†\u001bN?<",
+ [{
+ ";涉c蒀ᴧN䘱䤳 ÿꭷ,핉dSTDB>K#ꢘug㼈á¦=P^6탲@ä§”%$CqSw铜랊0&m⟭<\/a逎ym\u0013îš¡vᯗ": true,
+ "æ´«`|XN뤮\u0018詞=ç´©é´˜_sX)㯅鿻á»ì‹¹": 7.168252736947373E-20,
+ "ꛊ饤ï´è¢(逊+~⽫얢鈮ï«è‰¬O힉7Dç­—S곯wæ“I斞᠈븘蓷x": [[[[
+ -7.3136069426336952E18,
+ -2.13572396712722688E18,
+ {
+ "ç¡¢3㇩R:o칢行E<=\u0018á¬YuH!\u00044U%å炼2>\u001eSi$â“·ê’ˆ'ï‘¿ë ¢gᙫ番ꯒ㛹럥嶀澈v;è‘·é„•x蓎\\惩+稘Uî“´Eᖸﳊ㊈壋Nå«¿â¾æŒŽ,袯苷ኢ\\x|3c": 7540762493381776411,
+ "?!*^á¢çª¯?\u0001ڔꙃw虜ë³îšFgJ?&⨫*uo籤:?}ꃹ=ٴ惨瓜Z媊@ત戹ã”똩Ԛ耦Wtè½\\æž’^\\ꩵ}}}ꀣD\\]6M_⌫)Hè±£:36섘㑜": {
+ ";í™—á°°U஋㙛`D왔ཿЃS회çˆ\u001b-㢈`ë´†?盂㛣듿ᦾ蒽_AD~EEຆ㊋(eNwk=RÉ å³­qï’«\"5Ἠ婾^>'ls\n8QAK<l_⭨穟": [
+ true,
+ true,
+ {"ﳷm箅6qⷈ?ﲈ憟b۷⫉἞V뚴少U呡瓴ꉆs~嘵得㌶4XR漊": [
+ "í†ä»‹fM暪$9K[ㄇìƒí³æ’¦gæ’Ÿæ¸jÒFã¹¹aj bHᘀ踉êŽï¼£ç²„ a?\u000fKì¦‰î¶¯éƒ å¹¨9D舢槷Xh뵎u훩Ꜿ턾ƅ埂P埆kë©€{䢹~?D<\/ê¼¢XR\u001b〱ä½ê¼¨i㘀ḟ㚺A-挸",
+ false,
+ null,
+ -1.1710758021294953E-20,
+ 3996737830256461142,
+ true,
+ null,
+ -8271596984134071193,
+ "_1Gí‰í…‘m䮔鰼6멲Nmꇩſt쓟íŠN许FDï¡€j+3^ﶜ⎸\u0019⤕橥!\"sî•—-뾞lz北׸êšëž¬)?l⻮고iä‘°\u001f䪬",
+ 4.459124464204517E-19,
+ -4.0967172848578447E18,
+ 5643211135841796287,
+ -9.482336221192844E-19,
+ "౪å†é‡¶9D?sèž­X榈枸j2ç§€vï ˜î ]泌鰚岒èµè½€ìŒ¶ïŠ›ií…½qMbL]R,",
+ null,
+ [
+ null,
+ {"M쪊ꯪ@;\u0011罙ꕅ<eáº|爑Yâµ<\/&ᩎ<腊ሑᮔ੃Fè±­": [
+ "^0࡟1ë³Pí‹áæˆF⨥Iê‚´\"z磣Vâ…¡=8í€2]䢹h1\u0017{jT<Iç…›5%Dì…Sâ‘™â…J*ìƒ å·™àº”ï€¢;᧡䙞",
+ [{
+ "'ã¶¡í¾é„§`è·Š\"gV[?u᭒Ʊ髷%葉굵aë¦Nì¼§Qﯳy%y䩟髒L䯜Säµ³r絅肾킂á'ꔦg긓a'@혔যWè°á¬F栩ŷ+7wéžš": 6.3544416675584832E17,
+ "苎脷v改hmìµ|㋊g_ᔠ뒨蹨峟ìŽã·¸|Ο刢?Gͨ옛-?î¨Gꦱî«î“©IEYUX4?%ꘋᆊ㱺": -2.8418378709165287E-19,
+ "誰?(H]N맘]kæ´³\"qï±è’§è˜ž!Rí«\\(Q$T5Nå â«£ìœ¿6|럦ì†ï¸…ï­—(": [
+ "峩_\u0003A瘘?✓[硫䎯á½uጭ\"@Y綅첞m榾=è´®9R벿῜Zï §",
+ null,
+ "䰉㗹㷾Iaáƒqcp쓘὾൫Q|ﵓ<\/ḙ>)- Q䲌mo펹L_îŽ¦ì¹æ¨–庫9ê©ìª¹á˜¹ä‘–ç€aK îž?*趤fë­“å»p=磕",
+ "î“å“‘z懅á¤-ê¹ux쀭",
+ [
+ true,
+ 3998739591332339511,
+ "ጻ㙙?᳸aK<\/囩U`B3袗ﱱ?\"/ké”ä§2ï…¤l@쿎VZ쨎/6ꃭ脥|B?31+on颼-ê®§,O嫚m à¡­`KH葦:粘i]aSUì“™$ì‚f+詛頖b",
+ [{"^<9<ç®&絡;%iï«¡2攑紴\\켉hì“™-柂äšven\u20f7浯-Ꮏ\r^í›ä“ší—¬\u000e?\\ã…¡ÖºJë–·VOt": [{
+ "-௄å¶k㘆í˜à®½y⎱㢬sS઄+^瞥h;á¾·jî­;抭\u0003ë°«f<\/5â°§ï§§ï¡™_朻ï—%*[-撵䷮彈-芈": {
+ "㩩p3篊G|宮hz䑊o곥j^Co0": [
+ 653239109285256503,
+ {"ê¶²?|\":N1Û¿æ°ƒNZ#깩:쇡o8킗ࡊ[\"ë¸Po핇1(6é°$膓}â½*)渽J'DN<ì™ê¸˜æ¯¦ë²Ysì¹–": {
+ "2Pr?Xjㆠ?æ®/?㓦柖馃5뚣Nᦼ|é“¢rè¡´ã©–\"ç”æ¹—Üæ†": "\"뾯ië‡ç­ç‰»$ç²/4ka $åŒíœ´ï‹è¯‘zbAá©ê‡¸ç‘…&뵲衯ꎀᆿ7@ꈋ'ᶨH@á ´l+",
+ "7뢽ëšv?4^ꊥ_⪛.>pởr渲<\/⢕疻c\"g䇘vU剺dஔ鮥꒚(dïŸv祴Xâ¼¹\\îºa8y5å†": true,
+ "o뼄Bìšžç¾hrï·”í˜ë’šâ¿›U5pꪴfg!6\\\"爑ì䢱W<ï¶•î\\í…£ç‡oI/BK뺡'谑♟[Ut븷亮g(\"t⡎有?ꬊ躺ç¿è‰©nl F⤿蠜": 1695826030502619742,
+ "ÛŠê¹–>ࡹ햹^ⵕ쌾BnN〳2C䌕tʬ]ì° ?ݾ2饺蹳ã¶êŒ­è¨\"â—¹á¬D鯎4e滨T輀ﵣ੃3\u20f3í‚™D瘮g\\擦+泙᧠鬹ﯨַ肋7놷郟lPå†{ß’hà§œr5,ê“‹": null,
+ "ΉN$y{}2\\N﹯ⱙK'8ɜͣwt,.钟廣䎘ꆚk媄_": null,
+ "䎥eᾆá¦î‘§ì‰,JÞªn岪ã¥sî­•æ–謽䚔5tã¯ï–µï£šã°³ã±ŠZhD䃭f絕s鋡篟îža`Q鬃┦鸳n_é‚(E4è¿ _è§…ë·_宪D(NLî²ç–¶hL追V熑%]vè‚«=惂!㇫5⬒\u001fï²å–º4랪옑": {
+ "2aè¼85먙R㮧㚪Sm}E2yîŠê†£ê«¨rRymã±è†¶á”¨\\tç¶¾A☰.ç„„ë™—9<쫷챻䒵셴᭛䮜.<\/慌꽒9å»Okä°ŠZ㥪幸k": [
+ null,
+ true,
+ {"쌞ì": {
+ "â–ŸGL K2ië›±iï¼±\"Ì .옛1X$}涺]éŽæ‡ Ú¦ëŠ·?tfçŸÝžã‚Ÿ{": 1.227740268699265E-19,
+ "ê’¶]퓚%ฬKâ…": [{
+ "(à·›@Ç®ã£ä§¼äµ¤[aテൖvEnAdUë –ë—ˆ@볓yꈪ,mÔ´|꟢ìº(而첸죕CX4Y믅": "2⯩㳿ꢚ훀~迯?᪑\\啚;4X\u20c2è¥B箹)ä¿£eá»»w䇄",
+ "75༂f詳䅫ê§é¿ }3\u20b5'∓ä±è™€fè¼î‘”Iq鈆﨤gí©)BFa왢d0뮪痮Mé‹¡nw∵謊;ê§f美箈ḋ*\u001cî±ïœŸ`퇚í‹ä³«$!V#N㹲抗ⱉçŽ(V嵟ï«_bã³…\u0019": null,
+ "e_m@(i㜀3ꦗ䕯䭰Oc+-ë ¨0뭦⢹苿蟰ê‚SVä°­å‹¢ë¥.ྈ爑Vd,á•¥=í€)vz뱊ꈊB_6듯\"?{ã’²&㵞뵫ç–ë¡ë¯ˆ%Qwé™,?\ræž®\"? N~癃ruà¡—dn&": null,
+ "㉹&'Pfs䑜공j<\/?|8oc᧨L7\\pX᭠9᪘": -2.423073789014103E18,
+ "ä„瑄䢸穊f盈᥸,Bî§§ë¾§í‘—íšµB1쟢f\u001f凄": "é­–âš2儉j꼂긾껢嗎0ࢇ纬xI4]ï„(à©“`蕞;픬\fC\"æ–’\")2æ«·I﹥迧",
+ "ퟯ詔xæ‚ë ¹+T?Bg⥄섅kOeQí¼ã»´*{Eé¼6æ°¿L缋\u001c둌๶-㥂2==-츫I즃ã ï–˜Lg踞ꙂEG貨鞠\"\u0014d'.ç¼—ï¡gI-lIb䋱ᎂDy缦?": null,
+ "î’¢ç´Mã¦çŠ¿w浴詟棓쵫G:äœ?V2íž½7N*n&ã–ŠNd-'ຊ?-樹DIv⊜)g䑜9뉂ㄹí‘阉~ê…쵃#R^\u000bïž®B䌎䦾]p.䀳": [{"ϒ爛\"ꄱ︗竒G䃓-î†ã¾å¸³ã‚.j)qguæ‰å¾£à¨Zé¼—A9A鸦甈!kè”å–™:3Tî†%&ã ˜+,ä·ž|ì±½v䚞문H<\/醯rì…“ã¶¾\\a볜åºzEä·_죤ဵ뿰᎟CB": [
+ 6233512720017661219,
+ null,
+ -1638543730522713294,
+ false,
+ -8901187771615024724,
+ [
+ 3891351109509829590,
+ true,
+ false,
+ -1.03836679125188032E18,
+ {
+ "<?起HCᷭ죎åŠîŒŽèއ逰/{gs\u0014⽛㰾愫tï¿–<솞ڢëŒç…²è†ºà¨»9x닳xà¡­Q訽,ᶭඦtt掾\"秧㺌d˪䙻꫗:á­ˆh4ç·žç—䤴c뫚떩త<?ᕢ謚6]í›Oé°é‹›é• è´©èµŸ\"<Gâ™·1'": true,
+ "቙ht4ßBqꦤ+\u0006멲趫ç”)椾": -1100102890585798710,
+ "ç·å…Žê³‡ë‡¸ç²ŸF醇;朠?厱楛㶆â¶7râ¾›o꯬᳡F\\머幖 㜦\f[æ¦á¥½ã®£0䕊?J㊳뀄e㔔+?<n↴å¤î§·": [
+ "4~ê‰ç¾\\å®(泤å•빜\u0014>j랎:g曞ѕᘼ}链N",
+ -1.1103819473845426E-19,
+ true,
+ [
+ true,
+ null,
+ -7.9091791735309888E17,
+ true,
+ {"}蔰鋈+ê¨å•µ0?g*사%`J?*": [{
+ "\"2wG?yn,癷BK\\龞䑞x?蠢": -3.7220345009853505E-19,
+ ";饹়â€)çš‹`噿焒j(3â¿w>å5X<np?<줯<Y]æ˜!J೸UⳂNे7v௸㛃ᄧ톿䨷鯻v焇=烻TQ!F⦰䣣눿Ké·šëˆ'â­²mæ (äš»": [
+ "蹕 淜੃b\"+몾ⴕ",
+ null,
+ 35892237756161615,
+ {
+ " 듹ã)5æ…ç®±&$~:é°ì®<\/å ‹?% \\勽唅zì†å¸‹ä˜ºH髀麡M퇖uz\u0012m諦d᳤콌æ¨\rX싹̡á²": -433791617729505482,
+ "-j溗ࢵcz!:î€}✽5à´‡,욨Ýs#ë«=å—æµº^}E\\Y\\T*뼈cdêºcÛ˜ïµëŽä¨¸ë±K䠴㉿æ¿é€³îŽœ@wî·¿fì¢<\/[L[": -9.3228549642908109E17,
+ "Ms킭uà®—%\\uâŽ/家欲ἅ答㓽/꯳齳|㭘Pr\"v<\/禇䔆$GA䊻˔-:틊[h?倬è¤á¾žà§³.Gw\u000b": [
+ "0宜塙I@ä´è‰\\Uyë’…=2<hæš’ï…£K._è´¡ç’Yi檻_⮵uá㘗è [f\u0015힢Hê”®}጑;ï´èªyf0\"\u20cc?(=qæ– âž½5ꎾ鞘kⲃ",
+ -2.9234211354411E-19,
+ false,
+ true,
+ {
+ "\u0011⟴GH_;#怵:\u001c\u0002nîž»1U\\p/ì™”(┫]hêšî·ƒ7\r0䵷첗岷O௷?î·°ãŽ[殇|J=?韷pᶟ儜犆?5კ1kê–iH竧뛈ପdmk游y(콪팱ê¾k慧 yè¾£": [
+ false,
+ "O\"ëp覈ykv磂㢠ãµ~뀬íŠlC&4솎䇃:Mj",
+ -7.009964654003924E-20,
+ false,
+ -49306078522414046,
+ null,
+ null,
+ 2160432477732354319,
+ true,
+ "4íš¡h+!踹ê¬P鮄{0&ë±¥M?ìƒéž…n㮞ᨹ?쒆毪l'ç®…^ꚥ頛`e㻨52柳⮙嫪࡟딯a.ï‘„~äµ®1få˜N&zÈ­L榓ۃ鳠5d㟆M@㣥ï Ó‹AÎq0縶$",
+ -3.848996532974368E16,
+ true,
+ null,
+ -3.5240055580952525E18,
+ {
+ " vï­·áµ#ce乃5僞?Z D`묨粇á”ç» vWLè­¢uë½€\\J|tâ“™tâ„–\"ꨋnT凮ᒩè‚ç¯b騩:䢭Hbvì»å³¨z㹚T趗햆귣학津Xiï¼¹@á–¥K": true,
+ "!F 醌yï䉸W2ꇬ\u0006/ä’7~%9擛햀徉9â›°+?㌘;ê “X䇻Dfië¼§ì’’\u0012F謞Õ絺+臕kà¤LSQìŒX쎬幦HZ98è’Šæž³": "澤令#\u001dæŠâ›³@Næ•퀂[5,✄ꘇ~䘷?\u0011Xꈺ[硸⠘⛯X醪è¡x\u0007쌇MiX/|ï¾ëšK8ä¡î¿¥W)銀q僞綂蔕E",
+ "6â²ä£–Rà§ž@ငg?<\/à³´xé™™Xꈺ崸⠅ᇾ\\0X,H쟴셭A稂ힿã‚F\\쑞\u0012懦(Aᯕç­~î½”\u0001ê»®X?逊": 5.7566819207732864E17,
+ "[c?椓": false,
+ "kä’‡": 2583824107104166717,
+ "꙯N훙ã…ﮒ燣㨊瞯咽jî™Mxby뻭뵫װ[\"1畈?à§±L": "ë£á”‚魠羓犴ꚃ+|rY",
+ "ë…ºZ?îˆä¬ï“©é‰‰îˆ­:?â³™ç˜Cኯ.Vs[釿䨉ì§\\\\*쵢猒$\\y溔^,㑳": {"藶꺟": [{
+ "\"d훣N2zq]?'檿죸忷篇ﮟ擤m'9!죶≓pë­»\\ᇷ\f퇶_ä°¸hà¹Q嵃訾㘑従ꯦ䞶jL틊ræ¾µOmᾫ!H䱤팼/;|á­ºI7슎YhuXiâš¼": -1.352716906472438E-19,
+ "M⽇倻5Jä‚«à¤”á”æ¥¸#î „î¾–J[Fﹱ쫮W誻bWz?}1\"9硪뻶fe": "盬:Ѹ砿íšë•£T凊(mç¦å‘œï»R㿎艴䂵h",
+ "Rë¾k힪CHé’™_i苮ⰵoᾨ紑퉎7h؉\"柀è½z0့\"<?嘭$èœ?礲7岇槀묡?Vé’¿T⣜v+솒çšÔ›2ç±³mH?>è–™å©è¿3aFÆÃ": "2,ê“´g?_섦_>Y쪥션钺;=趘F~?D㨫\bX?㹤+>/믟kᠪ멅쬂Uzỵ]$ç§`mé›ç‘Šî’ඖ鯬cꙉ梢f묛bB",
+ "♽n$YjKiXX*GOè´©éƒè±®ç¥´éžK醞眡}ê—¨v嵎꼷0à­¸+Mè‹eH徸Jîžê£†:â¼æ‚¥B켽迚㯃bè«‚\u000bjꠜ碱逮m8": [
+ "푷᣺ﻯd8ﱖ嬇ភHîªé¹Žâ¡±á±…0g:æžœ6$GQ췎{vá·§Yy-è„•xå¹ç ¡ï¨¬â®¸Cï§‚êš=軄H犠Gè°–ES詤Zè ‚3î§™lë´Ÿhï¿’7䦹1GPQG癸숟~[#é§¥8zQ뛣J소obg,",
+ null,
+ 1513751096373485652,
+ null,
+ -6.851466660824754E-19,
+ {"ä©‚-â´®2Ù°K솖풄꾚ႻP앳1Hî³é·›wmR䗂皎칄?醜<\/&à §ã¬X濬䵈K`vJ륒Q/IC묛!;$vÏ‘": {
+ "@-êš—xྐྵ@m瘬\u0010U絨ﮌé©\\켑寛넆T=tQã­¤Lì—°@脸삯e-ï–…î–‘:⩼u㎳VQ㋱襗ຓ<Ⅶ䌸cML3+\u001e_C)r\\9+Jn\\Pﺔ8蠱檾è…Pqé³è¯î¦§Tä„I": -1.80683891195530061E18,
+ "á·­á‹»U~ཷsgSJ`᪅'%ã–”n5픆桪砳峣3ç®æž¾äŒ·âа呀ïŒ": {
+ "Ş੉䓰邟自~X耤pl7间懑徛s첦5ਕXexh⬖鎥á€nNr(J컗|ૃF\"Q겮葲놔엞^겄+㈆è¯ã€¾í¬ç´G'E?飕1fâ¼í…¬æ‚šï•¦æ³¬ë¨Uç¬í›¶Qs": false,
+ "î³…(\u20dag8í½íŠ£>^Y{뤋.袊䂓î†;_ïg]S\u202a꽬L;^'#î—™ë•bႌ?Cç·¡<ä²ä²æ–­ê6\u001asD7IK5Wxo8\u0006på¼Šâ¼‚ê¯æ‰µ\u0003`뵂픋%ꄰ⫙ë¶lå›å°›ïˆ®+ä—…E쟇\\": [
+ true,
+ {
+ "\n鱿aKã¡â’ã¼™2ì´¹f;`ì¾qIà¡”G}ã·äç“°w늮*ç²…9뒪ㄊCj倡翑閳R渚MiUO~仨䜶RꙀA僈㉋⦋n{ã–¥0딿벑î§é€¦â¥»0î¾®h薓쯴ê»": [
+ 5188716534221998369,
+ 2579413015347802508,
+ 9.010794400256652E-21,
+ -6.5327297761238093E17,
+ 1.11635352494065523E18,
+ -6656281618760253655,
+ {
+ "": ")?",
+ "TWKLꑙ裑꺔UE俸塑炌Ũ᜕-ï’‚o\"徚#": {"M/癟6!oI51niíš=댡>xê¨\u0004 ?": {
+ "çš­": {"⢫䋖>u%wî²´ìž¼<ä•ê˜P䋵$é­‹æ‹U䮎緧皇Y훂&|羋ꋕ잿cJ䨈跓齳5\u001a삱籷I꿾뤔S8㌷繖_Yឯ䲱B턼Oæ­µF\\l醴o_欬6ç±=D": [
+ false,
+ true,
+ {"Mt|êžD|Fê¶£MQ뵕T,ëºk+?ãµi": [
+ 7828094884540988137,
+ false,
+ {
+ "!༦鯠,&aﳑ>[euJê½ç¶·æB.h": -7648546591767075632,
+ "-n켧嘰{7æŒæ¯„Y,>â螵煫乌pv醑Qå¶š!|âŒè²¬0왾ë¢ê…蛨S\\)ç«°'舓Q}A釡5#v": 3344849660672723988,
+ "8é–ªéºV=鈢1녈幬6棉⪮둌\u207d᚛驉ꛃ'r䆉æƒà¥ˆ|bἧﺢᒙ<=穊强s혧eꮿ慩⌡ \\æ§³W븧J檀C,ᘉì˜0俯퀉M;筷ࣴ瓿{늊埂鄧_4æ¸Nn阼Jੵ˥(社": true,
+ "oë¼€vwï…®)4A뢵(î¼±a䵢)p姃뛸\u000fK#KiQp\u0005ê…芅ì…îª": null,
+ "ç ¥$ꥸ┇耽uæ–®Gc{z빔깎밇\\숰\u001eê´·å„㶇쵿_á´„+hç©¢p촀Ნ䃬zäé…³Ó‚31xꔄ1_ç šWë ˜G#2葊P ": [
+ -3709692921720865059,
+ null,
+ [
+ 6669892810652602379,
+ -135535375466621127,
+ "뎴iO}Z? 馢녱稹ᄾä©rSt帤넆&7ié¨ë©—ç•–ï”9誧鄜'w{Ͻ^2窭외b㑎粖i矪ꦨ탪跣)KEㆹ\u0015V8[W?⽉>'kc$䨘ᮛ뉻٬M5",
+ 1.10439588726055846E18,
+ false,
+ -4349729830749729097,
+ null,
+ [
+ false,
+ "_è ¢ã ^䟪/D녒㡋ỎCä’ˆíŒïŒ¢\u0006àªq@O펢%;é¹ìŒo戥~A[ꡉ濽ỳ&虃᩾è£å”™ï¤£èŒ¨Ig楡꒻M窓冉?",
+ true,
+ 2.17220752996421728E17,
+ -5079714907315156164,
+ -9.960375974658589E-20,
+ "ᾎ戞༒",
+ true,
+ false,
+ [[
+ "ⶉᖌX⧕홇)g엃⹪xëšç™Ÿ\u0002",
+ -5185853871623955469,
+ {
+ "L㜤9ợㇶKé°â‹“V뽋˖!æ–«as|9"á¬ä†ª?î¾¶7胜&n薑~": -2.11545634977136992E17,
+ "O8뀩D}캖qè‚6༣ã—䈓煮å½à¨†á޼Dᣘí›;": false,
+ "YTá¡…^ï—Lã—ŽcbY$pᣞ縿#fh!ꘂb삵玊颟샞ဢ$ä—é¼’ëª~rkH^:닮먖츸륈⪺쒉砉?㙓扫㆕꣒`R䢱Bé…‚?C뇞<5Iޚ讳騕S瞦z": null,
+ "\\RB?`mG댵鉡å¹ç‰©äµŽæœ‰5*e骄T㌓ᛪç¾é§’Ku\u001a[柆jUq8⋈5鿋츿myï»—?é›ux঴?": 5828963951918205428,
+ "n0æ™…:黯 î¶·xu씪^퓞cB㎊á¬âº˜Ù¤Öƒ~B岚3㥕擄vᲂ~F?Cä¶–@$mï›~å¿”S왖㲚?챴⊟W#벌{'ã°Iä ç¸s樘\\X뢻9í•¡I6èㄛî‚î«8쯶]wॽ0L\"q": null,
+ "x增줖j⦦tä¢áŽ™ïŠ­ã›¿Yf鼘~ê«“æ„4惊\u209c": "oOhbᤃ᛽z&Bi犑\\3B㩬劇䄑oÅ쨅孥ë©àº–acA㖫借ãžvg싰샂ãœ#譞⢤@k]鋰嘘䜾L熶塥_<\/â¾å±ˆï®Š_mYè¹t뙺}Ox=wé®®4S1ê©ï¬¾'å·‘",
+ "㗓蟵ꂾe蠅匳(JPä—à·¸\u0089耀왲": [{
+ "ᤃ㵥韎뤽\r?挥O쯡⇔㞚3ä¼–\u0005Pî•⋪\"Dê¶£QLn(⚘罩䩢Ŏv䤘尗뼤ë›O淽鋋î¡é—šrå´©a{4ç®™{煷m6〈": {
+ "l곺1L": {
+ "T'ਤ?ç …|੬Km]ä„©\"(à¿¶<\/6U爢䫈倔郴l2ã´±^줣k'Læµ–Lé°„Rp今鎗⒗Cì–¨Mí›ã¡§Î˜X粜뫈N꤇輊㌻켑#㮮샶-ä—룲è ç™œã±V>=\\I尬癤t=": 7648082845323511446,
+ "鋞EP:<\/_`á§e混ㇹBd⯢㮂驋\\q碽饩跓྿ᴜ+j箿ë ã—‘yK毢宸p謹h䦹乕U媣\\炤": [[
+ "3",
+ [
+ true,
+ 3.4058271399411134E-20,
+ true,
+ "æ€+憱f逮@먻BpW曉\u001aã£âŽŠ$n劈D枤㡞좾\u001aá›ïŒƒè‹”౩é—1B䷒Ṋ݋âžê€žêƒç£$t੤_:蘺⮼(#N",
+ 697483894874368636,
+ [
+ "vᘯ锴)0訶}䳅⩚0O壱韈ߜ\u0018*Ué¾ä–=䧉뽑å•휻ID쿇嘗?ꌸῬ07",
+ -5.4858784319382006E18,
+ 7.5467775182251151E18,
+ -8911128589670029195,
+ -7531052386005780140,
+ null,
+ [
+ null,
+ true,
+ [[{
+ "1欯twG<uä®â½ê‡£_ჟﱴଶ-쪋\"?홺k:èŽêœª*⺵꽹댅釔좵}P?=9ë ¿46b\u001c\\S?(筈僦⇶爷谰1ྷa": true,
+ "TҫJYxÚª\\鰔℮혡)m_WVi眪1[71><\/ï†Q:0怯押殃탷è«ì‚¬<ỗꕧ蚨ä¡ï¨î³‰nDꌕ\u001cë…¬~è“©<N蹑\"{ä«¥lKcí˜ë«–앺:vⵑ": "gæ§µ?",
+ "aꨩ뻃싥렌1`ë¡—}Yg>鲃g儊>ê¡l㻿/â‘·*ì±³6㻜W毤緛ﹺᨪ4\u0013뺚J髬e3쳸䘦伧?æª&{L掾p+꬜MäŠd娘6": {
+ "2p첼양棜h䜢﮶aQ*c扦v︥뮓kC寵횂S銩&Ç{O*य़iH`Uí…à¡“rä©•5ꄸ?`\\á§«?ᮼ?t〟崾훈kè–ì/iy꤃뵰z1<\/AQ#ë¿©8jJ1z@u䕥": 1.82135747285215155E18,
+ "ZdN &=dë…„á…†'ì‘â…‰:烋5&áŸï”‹á„‚汎æ¥L㯄固{é’§u\\ãŠíŠšeæ‘‘&tå—„ê–„UbâŒ?m䴘熚9EW": [{
+ "ଛ{i*a(": -8.0314147546006822E17,
+ "⫾ꃆY\u000e+W`௸ \"Më’¶+\\ë·lKE}(NTí‚¶Yjé¸ç¯’î©¥ì¶'jNQ硾(똡\\\"逌â´y? IRꜘ὞鄬﨧:M\\fâ ‹Cꚜ쫊ᚴNV^Dä•—ã…–á¼”Iao꿬Câ8": [
+ 287156137829026547,
+ {
+ "H丞N逕<rO䎗:í…•<\/䶩샌Sd%^ᵯëˆ엑者g䖩똭蕮1U驣?Pâ°°\u001fp(W]67\u0015ï«£6굺OR羸#ì´Fè’ˆ;嘙i✵@_æ’¶yã¤â¤(:᧗뼢༌朆@â°ã¤¨ê­²?-n>⯲": {"": {
+ "7-;枮阕梒9ᑄZ": [[[[
+ null,
+ {
+ "": [[[[
+ -7.365909561486078E-19,
+ 2948694324944243408,
+ null,
+ [
+ true,
+ "荒\"并孷䂡쵼9o䀘F\u0002龬7⮹Wz%厖/*? a*R枈㌦ë¾g뒠䤈q딄㺿$쮸tᶎ릑弣^éŽ<\/Y鷇驜L鿽<\/ì¶‹9Mᲆឨ^<\/庲3'lë‚¢",
+ "c鮦\u001bë‘\\~?眾ಢu݆綑෪蘛轋◜gȃ<\/â´ƒcpkDt誩܅\"Y",
+ [[
+ null,
+ null,
+ [
+ 3113744396744005402,
+ true,
+ "v(y",
+ {
+ "AQ幆h쾜O+꺷铀ꛉ練A蚗⼺螔jãŒ3꽂楎䥯뎸먩?": null,
+ "蠗渗iz鱖w]擪E": 1.2927828494783804E-17,
+ "튷|䀭n*曎b✿~æ¤U]î­¡Gz鄭kW|ã´š#㟗ഠ8u擨": [[
+ true,
+ null,
+ null,
+ {"⾪壯톽g7?㥜ώQê‘㦀æƒã§½î“¡ä¼“\\î¦*᧰閖樧뢇赸N휶䎈pIæ°‡ï®é•Šmaᬠ탷#X?î³A+kÐM ༑᩟Ø?5꧎鰜ṚY즫궔 =ঈî³;ﳈ?*s|켦蜌wM笙莔": [
+ null,
+ -3808207793125626469,
+ [
+ -469910450345251234,
+ 7852761921290328872,
+ -2.7979740127017492E18,
+ 1.4458504352519893E-20,
+ true,
+ "㽙깹?ë¨ä†¢:ä´ŽÛ»gæ® JBTU⇞}ꄹꗣi#Iî’¡ëµ£é‰r혯~脀ìƒ#釯:场:ä”>ä°®o'ã¼½HZ擓௧nd",
+ [
+ 974441101787238751,
+ null,
+ -2.1647718292441327E-19,
+ 1.03602824249831488E18,
+ [
+ null,
+ 1.0311977941822604E-17,
+ false,
+ true,
+ {
+ "": -3.7019778830816707E18,
+ "Eå³¾æ†èŒ6xLIm縂0n2视֯J-ᤜz+ᨣè·mYDè±ç¹¹â¹ºäŠ“ëª“ï´€E(@è©®(!ï’Y膽#᎙2䟓섣A䈀㟎,囪QbKæ’wcG湎ꤧtGì—xâ¥ä¿Žj'A一ᯥ뛙6ㅑ鬀": 8999803005418087004,
+ "よ殳\\zDâ§…%Y泥簳Uꈩ*wîRL{3#3FYHା[d岀䉯T稉駅䞘礄P:é—ˆWæ€ElBã¤å–¬èµ”bGä ¼U଄Nw鰯闀楈ePsDꥷ꭬⊊": [
+ 6.77723657904486E-20,
+ null,
+ [
+ "ཚ_뷎꾑è¹q'㾱ꂓ钚蘞慵렜떆`ⴹ⎼櫯]J?[t9Ⓢ !컶躔I᮸uz>3aã •i,錃L$æ°°í…°@7ë…«W㸮?ç¾§W뇧ꃞ,î—‘N鋮숪2ɼì½â”ä²6",
+ "&y?뢶=킕올Za惻HZk>c\u20b58i?ꦶcfBv잉ETî…9jä¡¡",
+ "imçŠÕƒbì¹§<D-è«‚*u2ꡜ췛~䬢(텸ﵦ>æ ¡\\뼾쯀",
+ 9.555715121193197E-20,
+ true,
+ {
+ "<㫚v6腓㨭e1ã•”&&V∌ᗈT奄5Lጥ>탤?튣瑦㳆ꉰ!(ᙪ㿬擇_n쌯IMá¿‹î£ã•¨â°æ«ˆá±·5풔蟹&L.ì²½e鰷쯃劼﫭b#ï­¶í“€7ë·„Wr㢈๧Tʴશ㶑澕é%": -1810142373373748101,
+ "fg晌o?߲ꗄ;>C>?=鑰監侯Kt굅": true,
+ "䫡蓺ꑷ]C蒹㦘\"1à°ƒ@å‘«\u0014NLä¾egå‘®á³,r$裢k>/\\<z": [[
+ null,
+ "Cä¡>?ㄤᇰﻛ쉕1஥'ÄŠ\" \\_?쨔\"ʾr: 9Sä˜ç¦ºáª§ê„‚㲄",
+ [[{
+ "*ç¡™^+E쌺I1䀖ju?:⦈Ꞓl๴竣迃xKC/饉:\fl\"XTFᄄ蟭,芢<\/骡軺ëœhê˜\u001f銿<棔햳▨(궆*=ä¹¥b8\\媦ä·€ë«}닶ꇭ(Kej䤑M": [{
+ "1á¬?>옿Iâ•…C<ÞŽ?ꊌ冉SV5A㢊㶆z-๎玶绢2F뵨@㉌뀌oå¶”f9-庒茪ç“ë·³4": null,
+ ";lá°³": "CbB+è‚»aä„·è‹*/볳+/4fq=ã°h6瘉샴4é“¢Yéª.⌖@哼猎㦞+'gꋸ㒕ߤï—ãž‘(ä¶’è·²tiâ‘´aî¥ç¡‚#Noë³”",
+ "t?/jE幸YHT셵⩎Kî¹!Eq糦ꗣv刴w\"l$ο:=6:ç§»": {
+ "z]鑪醊嫗J-Xm銌ç¿çµ¨c里ëç‚™Ep㣋é£ë˜¼åšŒä€“GPï¹–cmf4é¹­T䅿꣭姧â¸wy6ꦶ;S&(}ᎧKxᾂQ|tï¹ë»³k\"d6\"|Mlì·†hwLtê¼¼4$&8Պ褵婶鯀9": {"嵃닢ᒯ'î–›dá§«ä³³#Nî‡Xe3-붋鸿î¢à¬¢ë–“î§ž%dK\u0013䲎ê–YV.裸Râ‰rR3蟛\\:ì ¯:å—ĺLʆ넕>|텩鴷矔ꋅⒹ{tå­¶ã“‘4_": [
+ true,
+ null,
+ [
+ false,
+ "l怨콈lá’",
+ {
+ "0wä²å¬§-:`䉅쉇漧\\Ü‚yㄨb%㽄j7ᦶ涶<": 3.7899452730383747E-19,
+ "ꯛTẀq纤qå¶Vâ¿£?\"g}ი艹(쥯B î­T騠I=仵ë°X": {"KX6颠+&á…ƒ^fç•’y[": {
+ "H?뱜^?꤂-⦲1a㋞&î‘®êƒç²¾Ii᤾챪咽쬘唂쫷<땡劈훫놡o㥂\\ Kâ´™Dç§¼Fæ°®[{'좴:례晰Iq+Iì­¥_T綺砸GOç…䟪ᚪ`î‘↹l羉qì¼Dê½áœ…훦: vUV": true,
+ "u^yï³0㱓#[y뜌앸ꊬLã·©?蕶蘾â»KӼ": -7931695755102841701,
+ "䤬轉車>\u001c鴵惋\"$쯃྆⇻në½€Gæ° Såª]à²²ê¨æ‡Qxኻ椕駔\\9ࣼ﫻ìœç£¡ï©ˆëºªá¶šë³l㕆t+sζ": [[[
+ true,
+ false,
+ [
+ null,
+ 3363739578828074923,
+ true,
+ {
+ "\"鸣詩 î›ë³°ã‘µgLã¯¦á¿…ì¶æ—«}ED辗ﮈI쀤-ꧤ|ã ¦Z\"娑ᕸ4çˆé¨ã£\"]ì³Af]茛⬻싦oèšk䢯ä©è½3廇喑ޅ": 4.5017999150704666E17,
+ "TYႇ7ʠ值4챳唤~Zo&ݛ": false,
+ "`å¡„J袛㭆ëºã³€N㺣`ê½å¶¥Kï¯SVᶔ∲퀠ç¾N딂X\"á¤hNﬨvI": {"\u20bbã­˜I䖵䰼?sw䂷쇪]î(泒f\"~;꼪FÔsá¦": {"p,'ꉂ軿=Aèš¶?bƉãµä…°è«¬'LYKL6B깯⋩겦뎙(ᜭ\u0006噣d꾆㗼Z;ä„äš”cd<情@äž‚3苼㸲U{)<6&ꩻ钛\u001au〷N숨囖愙j=BXWìš•^x芜å á¿™çˆ‚ë›·ê’»t✘Q\b": [[
+ "ç±›&ଃ䩹.ꃩ㦔\\C颫#暪&!勹ꇶ놽攺J堬镙~軌C'꾖䣹㮅ï¶å²ƒá™´éµ£",
+ 4.317829988264744E15,
+ 6.013585322002147E-20,
+ false,
+ true,
+ null,
+ null,
+ -3.084633632357326E-20,
+ false,
+ null,
+ {
+ "\"짫愔昻 Xï«\"è—£j\"\"ë¨à½…ѻ㘤㬯0晲DU꟒㸃dë²€î¢ìœ’l䦾cà©»*3": null,
+ "è°ˆWm陧阦咟ฯ歖擓Nå–´ã‹éŠ­rCCnVࢥ^♼Ⅾ젲씗刊Sà¼+_tèµ”\\bäšë‰¨ê¬«6펛cL䊘᜼<\/澤pF懽&H": [
+ null,
+ {
+ "W\"HDUuΌ퀟M'P4à¿°H똆ⰱﮯ<\/å‡è˜²\"C鴫ﭒж}ꭩ쥾t5yd诪ﮡí‰â´°@?æ°é†³rj4I6Qt": 6.9090159359219891E17,
+ "絛ﳛ⺂": {"è«°Pã—®î˜è¦`ZQ?ꫦh*à´±cbâ§±}埌茥h{棩렛툽o3é’›5é®l7Q榛6_g)ὄ\u0013kj뤬^爖eO4Ⱈ槞鉨ͺ订%qX0Tì—å«·$?\\\"봅늆'%": [
+ -2.348150870600346E-19,
+ [[
+ true,
+ -6619392047819511778,
+ false,
+ [[
+ -1.2929189982356161E-20,
+ 1.7417192219309838E-19,
+ {"?åµ²2à¿2\u0001啑㷳c縯": [
+ null,
+ [
+ false,
+ true,
+ 2578060295690793218,
+ {
+ "?\"殃呎ïˆ#ã‘‘F": true,
+ "}F炊_æ®›oU헢兔êˆ,èµ­9703.Bæ•°gTz3â¬": {
+ "5&t3,í–“Mݸᵣ㴵;꣫ä©â†³#ï¢@ë«·ä …ï¦+W-ࣇzᓃ鿕ಔ梭?T䮑ꥬ旴]u뫵막bBè®:왳둛lEh=숾鱠på’î›î­ˆ$ì§#?gâ¹·á—Švã·µ.æ–ˆu頻\u0018-G.": "ë½™m-ouࣤ஫牷\"`Ksꕞ筼3HlȨvCï¢î›¦å ˆ\"I]㖡玎r먞#'W賜鴇k'c룼髋䆿飉㗆xgå·¤9;芔cáŒ/ax䊨♢í“rå“㸫೼䢗da᩾\"]å±£`",
+ ":M딪<䢥喠\u0013ã–…x9è•ã‘‚XO]f*Q呰瞊å­VP@9,㨣 D\\穎vˤƩs㜂-曱唅L걬/롬j㈹EB8g<\/ì„©o渀\"u0y&룣": ">æ°ç·©L/ä•‘ë¯êŸ˜îŸ”蕞^aBë’£+0jK⪄瑨痜LXK^힦1qK{æ·št츔X:Vm{2rçB뾄H첚7æ°¥?쉟䨗ꠂv팳圎è¸é½€\\",
+ "D彤5㢷Gꪻ[lㄆ@὜⓰絳[ଃç½ì®¹â˜’[*0ꑚ㜳": 9022717159376231865,
+ "Ò–aV銣tW+$é­¿\u20c3ïœäºœ~ë«¡ᙰ禿쨽ã¡fá¹¼zE/h": "5è‡ï’Œã‹‡á²¯ì®º? 昨탰Wム밎#'\"崲钅U?幫뺀â¾@4kh>騧\\0Ò¾EV=çˆî©®ÍŒUæ€%ꉼ 㮋<{j]{R>:gÔ©L\u001c瀈锌ﯲﳡꚒ'â«¿E4æšãŒ—뵉X\"Háœ",
+ "ᱚגּ;s醒}çŠSἿ㦣&{T$jkB\\\tḮ앾䤹o<é¿(tW": "vb⯽䴪䮢@|)",
+ "⥒í껉%惀뗌+녣迺顀qæ¢g⚯i⤭ë£Mç¹j̈́⽜A": -8385214638503106917,
+ "逨ꊶZ<\/W⫟솪㎮ᘇb?ê ”i\"H㧺x෷韒Xꫨฟ|]窽\u001a熑}Agn?Má¶–a<rà°„4Ů䢤슲AxÄ£eê³–ã´¤x竾éƒB謉鸵kè–½M)\"芣眜`è‰ê‰›ä´º": "é¹^ె캫?3耲]|Ü1ä¡’ã®]8e?ä¶^",
+ "뿸樅#P㡊1M룮Uꪭ绢ꑮZ9꽸": {"\nJ^Ñ”|3袄ã…7⨆銦yîµ”çâ‹·ä»´ct?[,<\/ã…¬`?갔髞%æA೚C": {
+ " 䇞3갫䅪": [{
+ "0|â©ã‘‚砕ㅻ": null,
+ "D箳᠉`|=â¼­)\"*࣊ã¦LjO誋": "",
+ "ࠚDZmê—¥}ᷴ╈r7í—´È¥4Kp5a)o}鎘门Læ°ä†“'✎k俎c#T68Óâ©¶î¶6L鎴<r൦$黊BQYã¼³\\è·¿F慮⡨拵贀!ç”¶Vå–…/": null,
+ "âµ£q⳹ﻨLk]晩1*y\\$%}ä–¶P煑㇆䈦E嫿«•Y࣓嫨ä“OL낮梚㸇洛洚BYtgl∛S☕䉓宑⋢粚ꔯ꠼붠": ")ꬑ윤`\"â°£<\/婽*Y䔸ᓰ_ï³t슲å©éš¥&S糧䛮闵诌è±sh쯽邴*ì„´ØÍŽ=㯨\"RVíž³,^t\"ac?䤒ꉀxHa=Uꛕã™î·“TkF껾",
+ "å¼¾cUAF?暤cë½.欀nKì•­]r傊䀓ﯳ馽垃[䥛oI0N砊鈥헅Co쟋钄ㅷ㊌뷚7": [
+ null,
+ "à«“é¨?^ä†{\u0006`X䧵儱&롡尙砡\u0006ë»ì‘¬sjâ–»Xfᬶgcã„¢V >9韲4$3á»´^=ì煤áë·2䣃%ï…Žé· /eQ9頸쥎",
+ 2398360204813891033,
+ false,
+ 3.2658897259932633E-19,
+ null,
+ "?ꚃ8Nnãž·å¹µd䲳䱲뀙ꪛQ瑓鎴]î’¶ä©‹-é°¾æ¡ï¾ä³¡??掊",
+ false,
+ -1309779089385483661,
+ "ᦲxu_/yecR.6èŠ.áœ‡éŽ ~",
+ -5658779764160586501,
+ "ì’Œ:æ› =lìœä¢œwk#s蕚\"互㮉m䉤~0ë“䋙#Gîš¿;h숄옥顇෤勹(C7㢅雚ã¯Lâ …VVç°…<",
+ null,
+ -4.664877097240962E18,
+ -4.1931322262828017E18,
+ {
+ ",": {
+ "v㮟麑䄠뤵g{Më®.\u001bzt뢜뵡0Ǥ龍떟Ᾰ怷ϓRT@Lꀌ樂Uã â¾•e扉|bJg(뵒㠶唺~ꂿ(땉x⻫싉ìŠ;%0鎻V(o\f,NéŠ%nk郼螺": -1.73631993428376141E18,
+ "쟧摑繮Q@Rᕾ㭚㾣4隅待㓎3蒟": [
+ 4971487283312058201,
+ 8973067552274458613,
+ {
+ "`aæ™á£—î\u0015i<S幼訃锭B0&槩✨[Wpçš©[g≊k葾x2ᡆ橲䲢W": true,
+ "kH皈Sê±qå‚‘u?솹풑~o^F=ï¦N*reî••J沤wW苯7pã¼¹äŽa=ꮧLã·©냴nWꌑ㞱uuè°lVNç¿á¤»(eè±¶5#L쪉ᅄ઄\u0015숟봊P瀚X蓎": false,
+ "䫯דּ〖Scä›­ì Lëµ¾pî«“CꙞ\"엇즓_ﰛ톣ꫀ먩㺣㮠⭴!\\Wâ”tä–°è»…y\u0014~ᇰ렢E7*俜䥪W䀩ä·hë´†vjஉ묣à¼G39.뼳輼:㮿á¦A饕TUL}~": [
+ null,
+ 8.8648298810470003E17,
+ 5.735561205600924E-20,
+ null,
+ -102555823658171644,
+ 1.2674932032973067E-19,
+ {
+ "D胣O㯨\u0017Ku눓ã’í…nᨊ!Ꚇ廫_>Bo¸": 4.3236479112537999E18,
+ "HW&퉡ãåœ<W)6æ‚°ê ‘HEp14xy峑ft\u0005s亘V튉䢮ꦈXåµê¬?lI_ë춇-6Ss噺Nk-ﮥíƒÜ郪*ï“­PR(S6â•‹@ä»™V懸뺵ﯜVç²¹": "9䗌斀4ãˆ^Qséš„ç¡j\u0003",
+ "Vké¶…Cæ³¹ç­HX훉朗*r\\z顊誌儖4?n7á¾6몋䎡ﳈ],Hé ¢pèšã‘„P4满Eä©V䬕à¸L廂쒬î®ì‘¨ê†·hè¿¡ê°è­–墎 î‡]鹿ฌ7ﶽ冭༽<ꈓS\\lä‹®?_ユ檒?": -8598528325153980065,
+ "t=qí£ç–»Ñ‚Z\\錅J.镎|nfḷ鴒1厰Lç¯çºœîŒ•E]୦⥪]á®'ç¾p/å’©0닳ï³qﳖཽk ?X1Ft%ś뭢v鋋⺃爵⒗": [[
+ 5.0824756359232045E-19,
+ [
+ 7.268480839079619E-19,
+ {"탿^굞⧕iјëŠê€›w껩6ꟳXsé…š\\>Y?ç‘¡Qyí›q!帰ï©s舠㫸zêš—aSæ­²v`G株巷Jp6킼 (ê·¶é”â¾î‹¥â¡ˆ>Mæ±ãžá‰´ê™²dv@i㳓ᇆ?é»": [
+ null,
+ 4997607199327183467,
+ "E㻎蠫á¾é«˜ä™Ÿè˜¬æ´¼æ—¾ï« í…›ã‡›?'M$㣒蔸=A_亀绉앭rN帮",
+ null,
+ [{
+ "Eᑞ)8<Zî¿—ã¡¿W镀䛒Cìƒî¿«V?0ꯦ+tL)`é½³AjBå§€Xà³³D빠㻲ƙgn9â‘°à¾á¿œ&\"ãš¹>餧A5u&ã—¾q?": [
+ -1.969987519306507E-19,
+ null,
+ [
+ 3.42437673373841E-20,
+ true,
+ "eê±·Må¢\"割Pâ›í§åŽ€R䱜3ï»´Oí“«r﹉⹊",
+ [
+ -8164221302779285367,
+ [
+ true,
+ null,
+ "爘y^-î¬?蘞Ⲽꪓaâ…ê¨}I",
+ 1.4645984996724427E-19,
+ [{
+ "tY좗⧑mrzïºã¿¥â´–᥷jè«…\u0000q賋è­êž„â®±S\nà¡£B/íƒêµª3ZÉ‘å¤o<\/;ë¡‹": null,
+ "彟hæµ _|V4䦭Dᙣ♞uì¿»=ì‚®ã¦\u001e哀鬌": [{"6횣楠,qʎꗇ鎆빙]ã±­R굋鈌%æ ²j分僅ペ䇰wí¦î¼‹p蛃N溈ê¡ê€?@(GI뉬$ﮄ9èªê“š2e甸ڋ[äº,\u0011\u001cࢃ=\\+衪䷨ᯕ鬸K": [[
+ "ㅩ拏鈩勥\u000etgWVî–¨Xs陂è¦p狵w퓼{뮵_i\u0002ퟑႢâ¬d6é‹«F~챿æŸ\u0096äš¼1ۼ칥0꣯å„=鋷牋ⅈêžé¾",
+ -7283717290969427831,
+ true,
+ [
+ 4911644391234541055,
+ {
+ "Iî¹éˆ’ì²½P릜朸W徨觘-HᎄíŸâ“º>8kr1{ê²µäƒã€›á¬¡Ì¨Oê·‘oä•'쿡鉕p5": "fvç²–RNçž–è›a?q꤄\u001d⸥}'ꣴ犿ꦼ?뤋?鵆쥴ë‹ä¡«s矷̄?à¶£/;괱絢oWfV<\/\u202cC,ã–¦0䑾%nè³¹g&T;|lj_欂N4w",
+ "짨䠗;䌕u i+rà¹0": [{"9ä¥\\à°©8\"馇z䇔<\/á‚¡Y3e狚ì¡\"ุ6ï°†Zé–c\"Ll:ïŠê®¾ç–£<\/᭙O◌납୕湞9⡳Und㫜\u0018^4pj1;ä§å„‚ä—·à­—>@e톬": {
+ "aâ‘‚Fé‹»Qèž°'<퇽Qè´ç€§{ᘪ,cP&~䮃Z?gI彃": [
+ -1.69158726118025933E18,
+ [
+ "ê¶‚z簽㔛㮨瘥⤜䛖Gℤ逆Y⪾j08î±²Sn昞ꘔ캻禀鴚P謦b{ê“®mNéMᥙ5\"ç2냑I\u0011.L&=?6á„ ë»·X鸌t刑\"#z)o꫚n쳟줋",
+ null,
+ 7517598198523963704,
+ "ኑQp襟`uᩄr方]*F48ꔵn俺ሙ9뇒",
+ null,
+ null,
+ 6645782462773449868,
+ 1219168146640438184,
+ null,
+ {
+ ")ယ넌竀Sdä°¾zqâ«£âŒÊ¥\u0010á¿“' |磪&p牢蔑mï³V蘸૰짬꺵;K": [
+ -7.539062290108008E-20,
+ [
+ true,
+ false,
+ null,
+ true,
+ 6574577753576444630,
+ [[
+ 1.2760162530699766E-19,
+ [
+ null,
+ [
+ "顊\\憎zXB,",
+ [{
+ "㇆{CVC9ï¼MN㜋ઘR눽#{h@ퟨ!鼚׼XOvXS\u0017á£=cS+梽៲綆16së½íœy屬?ᇳG2á´­\u00054쫖y룇nKcW̭炦s/鰘ᬽ?J|퓀髣n勌\u0010í™ P>j": false,
+ "ç®´": [
+ false,
+ "éžj\"ꮾ*엇칬瘫xṬ⭽ì©äƒ³\"-⋵?ᦽ<cਔ↎⩧%鱩涎삧u9K⦈\"á¿á¬‘V绩킯愌ṱv@Gê¾è·¶êš†(?ä–ƒvIá§ŠxV\r哦jã ’?*=S굤紴ꊀ鹭쬈s<DrIu솹꧑?",
+ {
+ ".}S㸼L?t\u000fK⑤s~hU鱜꘦}ìªC滈4ꓗ蛌):ྦ\"é¡¥ì´â¢·ïš­á¿³YLn\"?fꘌ>댎Ĝ": true,
+ "Pg帯佃籛n㔠⭹࠳ë·â‰»à¿Ÿ3ãž±ï“!î—-ì’¾!}쭪䃕!籿næ¶»J5ਲ਼yî˜vy;Rኂ%ᔡጀ裃;M⣼)쵂쑈": 1.80447711803435366E18,
+ "ꈑC⡂ᑆ㤉壂뎃Xub<\/쀆༈憓قì¨×§\\": [
+ 7706977185172797197,
+ {"": {"K╥踮砆NWࡆFy韣7ä밥{|紒︧䃀榫rᩛꦡTSy잺iH8}ퟴ,M?Ʂ勺ᴹ@T@~꾂=I㙕뾰_涀쑜嫴曣8IY?ҿo줫fऒ}\\S\"ᦨ뵼#nDX": {
+ "♘k6?଱癫d68?㽚乳䬳-Vé¡·\u0005è•?\u0018䞊V{邾zã˜l]é›k臤~ൖHë’iꢥ]g?.G碄懺䔛p<q꜉Så²—î¥_.%": 7688630934772863849,
+ "溗摽嗙Oã§€,⡢⼰呠ꅧ㓲/葇䢛icc@-r\b渂ꌳ뻨饑è§á–œ\\é®­\u0014엙㥀᧺@æµ¹W2꛵{W률G溮킀轡䬆g㨑'Qè¨ï†áŸªç½‘Hd\"Q늴ᱢﶨ邮昕纚枑?â–°hr羌驀[ç—¹<\/": [
+ -1.0189902027934687E-19,
+ {"窶椸릎뚻shE\"ꪗႥꎳU矖佟{SJ": [{"-æ…œx櫹XYîƒ-æ¾Ü¨â£·àª¢ïŸé¯™%Fu\u0000è¿‹â–’}᥷L嗭臖oញc넨\u0016/迎1b꯸g뢱ã§è“¤ä’8C散삭|\"컪輩鹩\"\\g$zG䥽긷?狸꿭扵ã²:URON&oU8": [
+ null,
+ true,
+ null,
+ -2.8907335031148883E17,
+ -3864019407187144121,
+ {
+ "`빬d⵺4H뜳⧈쓑ohஸ*ã¶ï»‡â¸•ä µ!iä¬ï¹‘h夘▥ê—푹갇㵳TA鳠嚵\\B<X}3訒câ‹{*ï«¢w]ç’¨-gæ­\\j໵侠Ei层\u0011": 3.758356090089446E-19,
+ "䄘ï®)Y놞씃㾱陰í:{\u2059/Sâ“´": [[
+ null,
+ [[
+ -3.8256602120220546E-20,
+ null,
+ 7202317607724472882,
+ "CWQëš¿",
+ null,
+ false,
+ true,
+ null,
+ 2857038485417498625,
+ 6.191302233218633E-20,
+ null,
+ -6795250594296208046,
+ [
+ true,
+ {
+ "%á‹§é°Yᚯ⚀x莰愒Vᔈ턗BNæ´ê¤ŸA1âŒl콹풪H;OX๫륞ìªá°šÑ†@͎黾a邬<L厒Xb龃7f웨窂二;": [[
+ null,
+ "耲?䙧㘓F6Xsí‹­ë©¢.v뚌?鄟æ â–½'묺競?WvᆾCî»txo?dZ;䨸疎",
+ {
+ "@hWê‰&\"빜4礚UO~C;ã†î”殩_ꀥè˜å¥¢^챟k→ᡱKMⵉ<\/Jㅲ붉LÍŸQ": false,
+ "tU뢂8é¾°I먽7,.Yî°î»´æ½Z툼=&⨥覽K乫햶㠸%#@Zë–æ„“^âŠâ¾‚몒3E_噆J(廊ឭyd䞜鈬Ћ档'⣘I": {
+ "tK*ꔵ銂u艗ԃì¿âˆ³ê„‚霫X3♢9y?=â²­dЊb&xy}": [
+ -4.097346784534325E-20,
+ null,
+ 6016848468610144624,
+ -8194387253692332861,
+ null,
+ {
+ "(祬诀譕쯠娣cë´r?ç•„kT뼾⌘⎨?noVä˜ì¥ç¡Žn?": [
+ 1.82679422844617293E18,
+ [
+ false,
+ 2.6849944122427694E18,
+ true,
+ [
+ false,
+ {
+ ";0zâ­†;í™”$bਔ瀓\"衱^ï—´?잢ᢛ⣿~`ꕉ薸⌳໿湘腌'&:ryБꋥá¼ê’¥ç­™ê¬œê¸¨?X": -3536753685245791530,
+ "c;Y7釚Uꃣ割J༨Y戣w}c峰뢨㽑㫈0N>R$ä…’X觨lë´œA刊8R梒',}u邩퉕?;91Eî¦a䈈ë¯G⊶芔h袪&廣㺄j;ã¡ç¶½\u001bN頸쳘橆": -2272208444812560733,
+ "æ‹‘Wﵚî²j鵼駳Oࣿ)#ã¾…é¡‚N傓çºy僱栜'Bê-!KF*ꭇK¦?䈴^:啤wG逭w᧯": "xᣱmYe1Û@霄F$ě꧘푫O䤕í€Pq52憬ꀜ兴㑗ᡚ?ï—ƒLé·íŸî—¼ë­zJê‘™}╆ᅨJB]\"袌㺲u8䯆f",
+ "꿽á…㔂긱Ǧ?SI": -1669030251960539193,
+ "ì‡É¨`!葎>瞺瘡驷錶â¤ï»®é…œ=": -6961311505642101651,
+ "?f7♄꫄Jᡔ훮eì‡îª¼í¾á£ä­´KhखT;Qty}O\\|ë«Iá¿’Ne(5æƒê¥¶ã†·Y9ﮡ\\ oyâ­–-䆩å©m#xë´‰>Y鈕Eç–£s驇↙ᙰm<": {"퉻:dê‚&efᅫ쫢[ï„™\"ëˆëŠ–êº™|Ôå‰1Í–-K:Êšá­•/;ì–㷛]Iç—èŒ4g<Oꗢ뫺N쯂륬J╆.`ᇵP轆&fd$?è‹…oê¶“vO侃沲â©åš…æ²— E%â¿°ì–¦wi\\*è¶«": [
+ 3504362220185634767,
+ false,
+ "qzXæœqT3軞T垈ꮲQ览ᚻ⻑쎎b驌䵆ꬠ5Fà­—ä²ç¼¿ê蒇潇Ltᆄ钯蜀W欥ሺ",
+ "ë³°É霬)ì é¶¼kwocì—·èr \u001d쒷⎹8{%澡K늒?iﺩd=&皼倚J9s@3å›twὡgjä íª5⭉⨺役&놎cﺉ㺡N5",
+ false,
+ null,
+ "D0st[ni锹r*0k6ꀎë‡UX2⽼৞䃚粭#)Zæ¡·36P]<\/`",
+ 4281410120849816730,
+ null,
+ -3256922126984394461,
+ 1.16174580369801549E18,
+ {
+ " ᆼꤗ~î…‰*TN긂<㡴턱℃酰^蘒涯잰淭傛2rൡetì¾£ä‡m*ã¸y\"\\糮᧺qv쌜镜T@yg1譬ﭧﳭ\f": null,
+ "圾ᨿ0xᮛ禵ਗ਼D-㟻ẵ錚e\"赜.˶m)é´‘B(I$<\/轴퉯æ·â‹âº*)宓쓌?*橯Lx\\f쩂㞼⇸\"ﺧ軂é³V\\ë•’\"캘c:G": null,
+ "?ïµ_ê³¢î™ç¿¸íˆ8ã¿ hì—´Q2ã­›}RY㯕YT놂⽻e^B<\/맫ﻇ繱\u0017Gц⟊ᢑﵩS:jt櫣嗒⟰Wã´šæ¦á…‰e[w䋺?藂翙Ⲱ芮ä˜â•¢å›¥lpdu7r볺I è¿‘qFyᗊ": [
+ "$b脬aᅠ襬育Bگ嵺Pw+'M<\/ï­näššvèžbNâ’‚}褺%lቦ阤\"ꓺá—Mç‰,Ûžï– Ò¶!矬?ke9銊Xê´¦)䈽í‹è„½á¹«äˆžá´†^=Yá—¿é›4I귺⋥%",
+ false,
+ 2.9444482723232051E18,
+ 2072621064799640026,
+ "/_뇴뫢jã’=Nꡦâ†Ôºèµ’â¬î»¼í†¥ä¨žç¯su*媸瀳鷔抡oíº-៳è¾å‹·fç»”:äµ¢æ¢2",
+ false,
+ "ì’œ Eî½·äŒ/í\u0018懺_<\\隺&{wF⤊谼(<죽é ïŸ‡8?@*rá¶ŠGd뻻갇&Ⳇq᣿e࢔t_ꩄ梸O詬Cá§§Kê© í’¤9눙醅ëž}竸rw?滨ӽK⥿ཊGé­²']`๖5ã„°",
+ -2375253967958699084,
+ {"嗱⿲\"få„„á¬": {"v?䚑킡`â—¤k3,骥曘뒤Oᒱ㲹^圮᠀YTê»›&ì´®P:G/Tâ£#튣k3ç‚©è k@橈ä·Sä§•,ç†œïŒæ™¬ï£žk1鮥玸먚7䤡fç»å—šìƒ´á¥’~îš¼0q拮垑aë»±Lâ°–_": [{
+ ":på°¢": -6.688985172863383E17,
+ "A0\u0001疠ﻵ爻鼀湶I~W^å²€mZx#ãˆ7r拣$Ꜷ疕≛⦒痋盩Vꬷá­â„¦Qêªï§éˆ‘A(劽詗ꭅo-ç¶é‘º\"Ⓠ@$j탥;": [
+ 8565614620787930994,
+ [
+ "å¶—PC?à¶‹Q㪣$&j幾㾷hæ…‘ 즊慧⪉霄M窊ê·'鮕)äŠé“¨m趦䗲(g罣ЮKVﯦé®î¦®5囗ﰼ鿦",
+ -7168038789747526632,
+ null,
+ -7.8069738975270288E16,
+ 2.25819579241348352E17,
+ -6.5597416611655936E18,
+ {
+ "瘕멦핓+?フZê·¢zé›V": {
+ "ᕾ": 1.7363275204701887E-19,
+ "ã­Œs뎹㳉": {"\u00187Fï–‰I6Yféº+UC쬸éºâ²ä‚¿ê¸•R\\ᆮC?Φ耭\rOத际핅홦*ë² W㸫㯼᡹cㅜ|Gã®—\u0013[o`?jHVì•?蒪꩚!í«áœ¦ãŒ‡äš‡é¿˜:@": [
+ "}푛Г콲<äŸCè—呈#2ã“‹#ྕáŸå°¿9qç«“gI%ëž™mê¬oaç•è´¿Jå’¿D_ç†Zz皳験Iè±¼B扳ḢQ≖㻹㱣Dä¦ï©—2'á—㗣▌ç ²8罿%à°¹F姦;0î·æ‚‡<\/\"påš§",
+ -710184373154164247,
+ "Vo쫬⬾ê«â´·Å»\u0004éŽHBê…¸_aVBHbN>Z4âœkเꛘZ⥺\\Bʫᇩ鄨魢弞&幟ᓮ2̊盜",
+ -9006004849098116748,
+ -3118404930403695681,
+ {
+ "_彃Y艘-\"Xx㤩㳷瑃?%2ä¡éµ›o<A?\"顜ᘌΈ;â·…Cæ´ºL蚴蚀voq:,Oo4쪂)": 5719065258177391842,
+ "l륪맽耞塻論å€Eã—‘/㲕QM辬I\"qi酨玑㖪5q]尾魨鲡ƞY}⮯蠇%衟ï„Fsf윔äšì°¤iè…³": {"ꢪ'a䣊糈": {"ë°‘/♋S8sã¼´5瓹O{댞\"9Xï°‡lJ近8}q{긧ⓈI᱑꿋腸D瀬H\"ﺬ'3?}\u0014#?丙㑯ᥨ圦',gé‘ (樴턇?": [
+ 2.5879275511391145E18,
+ null,
+ [
+ "3㼮ꔌ1Gẃ2Wé¾™jîªÍŠ{1å›ã¦­9xå® ã‘oRä•犽",
+ 1268729930083267852,
+ "땕軚⿦7C",
+ [
+ -3.757935946502082E18,
+ "\"赌'糬_2ë­¾áb",
+ {
+ "(a䕎ጽjÒ°D4.á´¡ïž½66ԃ畮<\/l`k癸\\㇋ࣆ욯R㫜픉녬挛;ڴ맺`.;ç„“q淞뮕ٹ趴r蔞ꯔ䟩vç²u5<\/pZ埖Skrvj帛=\u0005aaï”›": null,
+ "璄≩ v몛ᘮ%?:1頌챀H㷪뉮k滘e": [
+ "ꤾ{`c샬왌펡[俊络vmz㪀悫⸹ᷥ5o'ã¾µ L蹦qjYIYណԠWëƒå‰«<\/W嗂0,}",
+ 2.4817616702666762E18,
+ false,
+ null,
+ null,
+ -8.6036958071260979E17,
+ null,
+ -1.2744078022652468E-19,
+ -4.4752020268429594E17,
+ 1.13672865156637872E17,
+ [
+ false,
+ false,
+ null,
+ -4.178004168554046E-20,
+ true,
+ 2927542512798605527,
+ {
+ ".ꔓ뉤1䵬cHyæ±¼äŠ†è³“á‡Æ©|樷â‡é†Žã¬…4\u0003èµµ}#yD5è†æ™¹ë±“9ê–è™›J㺕 t䊛膎ؤ": {
+ "rVtᓸ5^`েNâ¹»Yv᥋lꌫt拘?<é®°ë„¿ZC?ã’½^": {"âªî©k_:>귵옔夘v*탋èŒ&㳈챗|Oé’§": [
+ false,
+ "daꧺdᗹ羞쯧Hã¤é„³é ³<型孒ン냆㹀f4ã¹°\u000f|C*ሟ鰠(O<ꨭ峹ipຠ*yà³§4VQè””hVæ·¬{?ᵌEfrI_",
+ "j;ꗣ밷é‚副]á—“",
+ -4299029053086432759,
+ -5610837526958786727,
+ [
+ null,
+ [
+ -1.3958390678662759E-19,
+ {
+ "lh좈T_ë¯Y\"伨\u001cꔌG爔겕ꫳ晚è¸â¿»ìT䯎]~e#฽燇\"5hٔ嶰`泯r;ᗜ쮪Q):/tç­‘,榄&5ï¤ëŽ«ç‹(": [{
+ "2áâ“›]r3C攟וּ9è³µsâ›”6'ஂ|\"ⵈ鶆ä¹ç¦3\"痰ࢤéœäµ©ì˜†äŒ€?æ •r7Oç°‚Isd?K᫜`^è®¶}zî°’8?zì–°î§T:X倫⨎ꑹ": -6731128077618251511,
+ "|︦僰~m漿햭\\Y1'Vvخ굇á‰ì±¢cè¶–": [null]
+ }],
+ "虌魿閆5⛔煊뎰㞤ᗴꥰF䮥蘦䂪樳-Ká·-(^\u20dd_": 2.11318679791770592E17
+ }
+ ]
+ ]
+ ]},
+ "묗E䀳㧯᳀逞GMc\bï•¹å¢¹ã“„ë–Æ &U??íŽŒé‘ åª‹k))ᄊ": null,
+ "묥7콽벼諌J_DɯﮪMæ®´ä£,煚ྼ`Y:ì”§<\/â©«%yf䦀!1á²¶kì¶ŽQç±³W∠WC跉鬽*á›±i<?,l<崣炂骵*?8í‘៣ⰵ憉⎑.,Nwç½£q+ο컆弎": false
+ },
+ "e[|଀+î±³lꑸãˆTT?ë¿¿|ê«›9`㱯䊸楋-곳賨?ì³k棽擋wQ餈âŸNq[q霩䵀뷮锅ꚢ": 5753148631596678144,
+ "sá“鴻߸d렶ὕ蜗ဟ툑!诉౿": false,
+ "|4䕳鵻?䈔(]í‹/Ui#æ¹»{듲ーMá‹€t7潔泄Ch⸨}ì£`î¤èž§éŠšã‹¼å£¯kâ°¥Q戵峉갑xè¾™'ì²›": "jd䘯$䕌茷!auw眶ㅥä£ê†¢æ°‘i",
+ "剖駰Ɜî¶sM2]á¾´2ࡷ祅拌Av狔꩛'ê“—í‚§ê£0酜✘O'": false,
+ "澩뢣ê€eU~D\\ꮡ킠": "v^YC嚈ί\u0007죋h>ã´•L꘻ê€ì“ª\"_gé¿„'#tâ½™?,Wg㥖|D鑆eâ¥ìª¸åƒ¬h鯔咼ඡ;4TKèŽî¾‘졠嫞"
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ ]}}
+ }
+ ]}
+ },
+ "뿋뀾淣截䔲踀&XJ펖꙯^Xb訅ꫥgá¬>棟S\"혧騾밫ê²7-": "擹8C憎W\"ìµ®yR뢩浗絆䠣簿9äˆå¼•Wcy䤶孖ꯥïž;íŒ]輩ä3@{å 뽸0ï€á¡ˆìµ¡î›„Ⲇ\u001dLåŒê§2F~ݕ㪂@W^é½L襒ᦘî¢~沦zZ棸!꒲栬R"
+ }
+ ]
+ ],
+ "Z:ëƒàµ›5Iz찇䅄駠㭧蓡K1": "e8᧤좱U%?ⵇ䯿é¿\u0013縮R∱骒EO\u000fg?幤îš@֗퉙vU`",
+ "äƒìªˆï‘’埽້=Ij,쭗쓇చ": false
+ }]}}
+ ]
+ }
+ ]}
+ }
+ ]
+ ]
+ ],
+ "咰긖VM]á¼6䓑쇎çºetDÒŒ?ãžê©„퇫밉gj8è ƒ\"â©5䛹1ࣚ㵪": "ക蹊?⎲⧘⾚̀I#\"䈈⦞ë·`wo窭戕෱휾䃼)앷嵃꾞稧,Ⴆ윧9S?೗EMk3Მ3+e{â¹”Te驨7äµ’?타Ulg悳o43ï“¢"
+ }
+ ],
+ "zQᤚ纂땺6#ٽ﹧vï¿¿#ࠫ휊冟蹧텈ꃊʆ?&a䥯Deæ½|ì¿“pt瓞㭻啹^盚2êŠf醪,ì–T窧\\Di䕎谄nn父ꋊE": -2914269627845628872,
+ "䉩è·|㨻ᷢã‰B{蓧瞸`î°²I!℄욃힕#ೲᙾ竛ᔺCjk췒늕貭è¯\u0017署?W딚%(pê⤼ë³^=on뺲l䆼bzrﳨ[&j狸䠠=ᜑꦦ\u2061Õµnj=牲攑)Mî»\\é¾": false,
+ "뎕y絬᫡⥮Ϙᯑ㌔/NF*Ë“.ïž¿,QEzvK!Iwz?|쥾\"ê©»Lê¼—Bê”§è³´ç·œs뉣隤茛>ロ?(?^îµ­`>冺飒=噸泥⺭Ᲊ婓鎔븜z^å·è£®Ãªâ“…à»—jM7ﶕ找\\O": 1.376745434746303E-19
+ },
+ "ä›ræ»–wã¤<k;l8ꡔጵ⮂ny辶⋃í¼åƒ®z\"﮲X@t5෼暧퓞猋♅䦖QCé¹®|픨( ,>,|Nዜ": false
+ }
+ ]],
+ "@ê¿™?è–•å°¬ gd晆(ë„5躕ﻫS蔺4)떒錸ç“?~": 1665108992286702624,
+ "wë¯ná =`঺ᅥC>'從ë槷ä¤çœ·èž„ãŽ»æ°æ‰°XᅧCè´½uáƒë‚ŸjKD03T!lDV쀉Ӊy뢖,袛!终캨G?鉮Q)â‘—1쾅庅O4ê‰H7?d\u0010蠈줘월Þ粯Q!낇껉6í…|{": null,
+ "~˷jg쿤촖쉯y": -5.5527605669177098E18,
+ "펅Wᶺzê†ã¨í‘­e?4j仪열[D<鈑皶婆䵽ehS?袪;Hê¨Më—Žã°[(å—M3qíŸg4y╸鰧茀[Bi盤~ï«å”Žé‹†å½ºî½«â¦Šq?î–³B4쉓癚O洙킋툈䶯_?ퟲ": null
+ }
+ ]
+ ]]
+ ]],
+ "꟱Ԕã¤7æ›ï¦—ಃéŒVä·°?v㪃૦~K\"$%请|ꇹn\"kä«›ã¨é²¨\u2023ä„¢\u0004[<S8á¬ë­©è„¥7U.m࿹:Dè‘┆2蘸^U'w1ì …;䠆ꋪBê»®>︊Vï‹•J?䶟ាꮈ䗱=깘U빩": -4863152493797013264
+ }
+ ]}]}
+ ]
+ }}}
+ ],
+ "ì·ì²Û¹í‰ƒ~aEå”™a챑,9㮹gLHd'ä”|í‚—ãžäŽ¥&KZYTë§µ7䥺N<Hp4ê•­â¹ ê½c~çš½z": "课|á–¾ä¡å»‹è„äªW\u0016&Jnê´b~æ‘“M>â±³åŒèŽžé¿§w\\༌疣n/+ꎥU\"å°ëž¾â—‹íŸ™AJá­Œ?9ä›$?é©”9è®ì§˜é­¡TÖ¯cè—³`虉Cì‡ì¦T"
+ }
+ ],
+ "è°¶ê°œgTRï¿>áµÍšdtæ™‘ä‰‡é™æ»º}9㉸P漄": -3350307268584339381
+ }]
+ ]
+ ]
+ ]]
+ ]
+ ],
+ "0y꟭馋X뱔瑇:䌚ï¿å»¿jîžg-懲鸭䷭垤㒬茭u賚찶ಽ+\\mT땱\u20821殑ã„J쩩䭛ꬿNSæ½”*d\\X,壠뒦e殟%LxG9:摸": 3737064585881894882,
+ "í’µO^-â§§â…¶vѪ8廸鉵㈉רâ†Q㿴뺟EႳvNM:磇>wî·/៻唎뷭୥!냹D䯙iëµ±è²C#⼉NH6`柴ʗ#\\!2ä‚—â±§f?諳.Pëˆ-è¿”I꘶6?8î“ê˜": -8934657287877777844,
+ "溎-è˜å¯ƒi诖ര\"æ±µ\"\ftl,?d⼡쾪⺋h匱[,à·©I8MÒ§F{kç“¿PAî…§'橸ꩯ綷퉲翓": null
+ }
+ ]
+ ],
+ "ោ係Øî½<å…ƒ": 1.7926963090826924E-18
+ }}]
+ }
+ ]
+ ]]}]
+ }]
+ ]
+ ]
+ ]
+ ],
+ "ጩV<\"ڸsOᤘ": 2.0527167903723048E-19
+ }]
+ ]}
+ ]
+ ]],
+ "∳㙰3ì ´pá§—ä±™?`<U὇<\/æ„E[ᮚAî›j诂ᒽ阚uv徢ဎ떗尔ê½í›€ì©‘Jä´?âª=륪ᆩ푰ஓã•?럽VK\"X?檨လ齿I/耉A(AWA~â¯ç¨è¹«": false,
+ "å’å¦ë¾‡}䀼链i⇃%⋜&ç’ªIx渥5æ¶§qq棩á¥-â «AA낇yY颕A*ïˆè£¦O|n?䭬혗F": null,
+ "ç­CLì–­B혆Kॎ`鎃nrî€sZiÕªWç )?p~K~A眱ä²QO妣\u001b\u001b]ᵆᆯ&ã‹á¹è±‰ëº˜$ê­§#j=C)祤⫢歑1o㒙諩": 7028426989382601021,
+ "쳱冲&ဤäŒì•§h胺-é½±H忱8왪RDKᅒ䬋ᔶS*J}ስ漵'㼹뮠9ê±¢9p봋경ጕtởꚳT䶽瘙%ì¶´`@nಆ4<d??#僜ᙤ钴=薔ꭂbLXNam蹈": "樭る蹿= Uî ƒurwkn뙧⌲%\"쑃牪\"cq윕o@",
+ "溌[H]焎SLã…?뀼䫨ç½W": 1.1714289118497062E-19,
+ "ﬢp븇剌燇kĔ尘㶿㴞ç ê¾˜Ia;sâº^)$ç©®?sHᢥíªl": null
+ }
+ ]
+ }
+ ]
+ },
+ "TKnzj5o<\/K㊗ꗣ藠⦪駇î€>yZA8Ez0,^á™›4_0븢\u001ft:~䎼s.bb룦明yNP8弆Cå¯;⪾ì§'蕴뮛": -6976654157771105701,
+ "íµê¦€\\㇑:nî‹™v+뒤燻䀪ﴣï·9ᚈ኷K㚊誦撪䚛,ꮪxሲ쳊\u0005HSf?asg昱dqꬌVꙇ㼺'k*'㈈": -5.937042203633044E-20
+ }
+ ]
+ }],
+ "?}\u20e0],så¶³è‹@#2uì’´sQSä©—=ꥮ;烌,|ꘔ䘆": "á…©ì˜Nç’ kZ먕眻?2ቲ芋眑D륟渂⸑ﴃIRE]å•—`K'"
+ }},
+ "쨀jmV賂ﰊå§ä‚¦çŽžã¬™áªM᪟ïՎ씜~`uOn*ॠ8\u000ef6??\\@/?9見d筜ﳋB|Sä¬è‘«ã½o": true
+ },
+ "즛ꄤ酳艚â‚㺘봿㎨iGà§•à¡¿?1\"䘓您\u001fSáŠâº¿æºzៀ뻤B\u0019?ìœa䳵᭱䉺膷d:<\/": 3935553551038864272
+ }
+ ]
+ ]}
+ ]]
+ ]]
+ ]}
+ }
+ ]
+ }
+ ]]}},
+ "᥺3h↛!ê‹°y\"攜(ெl䪕oUkc1A㘞ᡲî촾ᣫ<\/ä’ŒEã›æ½¨i{ï  v?Wà±¾H\\RჅpzè¬R脾;v:碽✘↯삞鷱o㸧瑠jcmK7㶧뾥찲n": true,
+ "ⶸ?x䊺â¬-ä°…â‰!e쩆2ꎿ准G踌XXᩯ1ß}0?.í—€Z馟;稄\baDꟹ{-寪⚈ꉷ鮸_L7ƽᾚ<\u001bጨA䧆송뇵⨔\\ç¤ë—”d设룱㶉cq{Hyã±R㥽å¢ï¬…p": -7985372423148569301,
+ "ç·«#ì½®IB6<\/=5Eh礹\t8럭@饹韠r㰛斣$ç”LVì·a갵îŸ'请o0g:^": "䔨(.",
+ "ë³â„¡åœ¤pï¾à¯„Ä倧訜BìŸGä™”\"Sbâ“®;$$â–S1J뢙SF|赡gï„€*\"Vu䲌y": "䪈&í‹),\\kT鬜1í’¥;ë·´'Zေ䩹@Jéž½Nã¼M?å¥eWb6榀ƩZڮ淽⺞삳煳xჿ絯8eâ¶ç¾·V}ჿ쎱䄫R뱃9Z>'\u20f1â“•äœé½®"
+ }
+ ]
+ ]]]
+ }}
+ }
+ ]
+ ]},
+ "펮b.hç²”í¯2npXè©«g錰鷇㇒<ì™S値bBi@?镬矉`剔}c2壧ଭfhY깨R()痩⺃a\\â”?M&ﯟ<劜꺄ï‘멊ᄟA\"_=": null
+ },
+ "~æ½¹Rqn榢㆓aR鬨侅?䜑亡V_ç¿…ã­”(ä“·w劸á³Dp䀅<\/ï°Žé¶Šm䵱팱긽ꆘ<tD쇋>긓准D3掱;o:_Ñœ)껚콥8곤d矦8nP倥ꃸI": null,
+ "뾎/Q㣩㫸벯➡㠦◕挮aé¶§â‹“å¼\u00001뱓fm覞n?㛅\"": 2.8515592202045408E17
+ }],
+ ",": -5426918750465854828,
+ "2æ««@0柡g䢻/gꆑ6演&D稒肩Y?艘/놘p{f투`飷ᒉ챻ëŽîª–<늛ä˜ï´¡ì¤°ì«„": false,
+ "8î™–(鸑嵀⵹ퟡ<9㣎Tߗ┘d슒ل蘯&㠦뮮eà kç g ì—»": false,
+ "d-\u208b?0ﳮ嵙'(J`蔿d^踅⤔榥\\J⵲v7": 6.8002426206715341E17,
+ "ཎ耰í“ê•ï’ã±·\u0013y=詽I\"盈xm{0쾽倻䉚ષso#é°‘/8㸴짯%ꀄ떸b츟*\\鲷礬ZQå…©?np㋄椂榨kc᡹醅3": false,
+ "싊j20": false
+ }]]
+ ]],
+ "ä¿›\u0017nç·½Tu뫉èœé¼Ÿçƒ¬.ï‘ꭠIâ°“\"Ἀ᜾uC쎆J@å¤%ê›m뻨ᾀ画è›íœƒT:錖㑸ዚ9죡$": true
+ }
+ ]
+ ],
+ "ãµâ‡˜ê¦–辈s}㱮慀밒s`\"㞟j:`ií”»Z<C1衽$\"-饧?℃\u0010⼒{î°p飗%R\"ä²”\")ì¹€\\%": true,
+ "苧.8\u00120ݬ仓": 6912164821255417986,
+ "ë–Žé¡£ä¿X;.#Qí‹.笂'p쟨唒í랩냆¦aâ±{è°.b我$蜑SH\u000fç¾=äŸ¼â£¼ï©¿áœæ”•B&挰繗ã”ê…‚-Qv\\0ä¶äš¥ãºio[㑮-ᇼ䬰컪ṼiY){ë°\u0010q螰掻~\n輚x\u0014罺)è»´": 3.024364150712629E-20
+ }
+ ]
+ ]
+ ]
+ ]}
+ ]]
+ }
+ ]
+ ]]
+ ]
+ ]]]],
+ "\"凲o肉Iz絾豉J8?i~傠᫽䇂!Wï›—D溊J?á¡’vsè†åµ¹âž’ïŸæ·´î‡…>ì„«^諎0Ok{켿æ­à·£èƒ°a2﨤[탳뚬쎼嫭뉮m": 409440660915023105,
+ "w墄#*ᢄ峠밮jLa`ㆪ꺊漓Lã§ëŽ!Agkï¹ï¾'ê›ë¢ƒã¯å²¬D#ã’¦": false,
+ "ଦPGI䕺L몥罭ꃑ궩﮶#⮈ᢓӢ䚬p7웼臧%ï‘¥~Sè âŒíž€6îž’&t䳙y㪘ëƒ\\*;é‰ï¿Šé¿µ'å—•pa\"oL쇿꬈Cgî“": "ã¶½1ç¸D⟸䴅ᆤ뉎﷛渤csî¸x ä”цꬃ锚æ¬?ຽ+x~꘩uI࡞\u0007æ ²5呚ẓem?è¢\")=㥴䨃pac!/æŽY",
+ "á·±o\\||뎂몷r篙|#X䦜I#딌媸픕åžRDæ–³X4t⯩夬=[ï‹ë­²r=绥jhë·±ì¸âª˜%]⚋܈㖴スHí…¹m(WOæ›åЉ0~K3c柢Õã‰ïªªé€³~": false,
+ "ç…½_qb[첑\\륌wEâ½Ztï”´CNï­+餌ᕜOê›­": "{ﳾ쉌&s惧á­âµ†3䢫;䨞팑ï›ê’ªí˜è¤€à¢–Qä ¿V5뭀䎂澻%ë°›u5í…¸oA⮥U㎦;B䳌wzä•™$áž¿\\௅婺ëµâª¾í†\\`Kyौꋟ._\u0006L챯l뇠Hi䧈å’5",
+ "艊ä½à£ƒë¡‡ä± çˆ¬ï˜‚!*;⨣æŽïžæ…“qé“|儑ᨋL+è¿¥=6㒺딉6弄3è¾…J-㕎뛄듘SG㆛(\noAzQê±ä°©X*ã¢O퀌%펠낌moí‹®a^<\/F&_눊ᾉ㨦ы4\"8H": 2974648459619059400,
+ "鬙@뎣䫳á®ë¡?){y?5K;î§„TA*k溱䫜J汃ꂯ싔ì\u001dA}룖(<\/^,": false,
+ "ëª@QꋦFꊩá’뎶î‡lXl垨4î¤^郣|ꮇ;ä´á“}ìµ²zç–": null
+ }
+ ]]]],
+ ":_=ë‹§å¼—D䙋暨é›. 㱻붘ä‚Jå„’&ZK/녩䪜rå›â½¯D喠죥7ï“⹌䪥c\u001a\u2076￞妈朹oLkè®F౟覛ì§ã®7T;}è›™2{9\"å´“bB<\/⡷룀;즮鿹)丒툃୤뷠5W⊢嶜(fb뭳갣": "E{å“1WM"
+ }},
+ "䘨tjJ驳豨?y輊M*᳑梵瞻઻ofQG瑮e": 2.222802939724948E-19,
+ "ä®´=â‘âž¶Tà·‹wäžœ\"垦ꃼUt\u001dx;B$뵣䙶E↌艣ᡥ!á§Ÿ;ä±€[䔯k쬃`à©8饙른ç†î‹”'2_'袻tGfè’­J땟as꯳╖&å•’zWࡇᒫYSá¬\u0014ℑ첥鈤|cG~Pá“®\">\"": "ႆl\f7V儊㦬nHꄬꨧC{ì¢~C⮃⛓嶦vꄎ1w鰠嘩뿠魄&\"_qMâµ–é‡”ë…®îœ¡ê‡ ãš{ç³Jå“‹ cî°¸v?-jkﻯྌ鹑L舟r",
+ "龧葆yB✱H盋夔ﶉ?n*0(": "ꧣኆ㢓氥î³qZZ酒ຜ)鮢樛)X䣆gTSî»»Ò‘Gí…žï’˜k.J圬ç–ë¡«ïœì¯­z L:\\ྤ@w炋塜쿖ᾳy뢀䶃ë±N䥨㚔勇ê²#p",
+ "ë„畎Q娡\"@S/뼋:äµ!Pè¡…ì´šfVHQs✜á«i㻑殡B䜇%믚k*U#濨낄~": "êŸá‹•ì³¸êˆæ•‹&lå¦\u0005憡멗瘌uPgá…ªm<\/To쯬锩h뒓k"
+ }
+ ]
+ }],
+ "墥홞r绚<\/⸹ⰃB}<躅\\Y;๑@䔸>韫䜲뱀X뗩鿥쩗SI%ﴞ㳕䛇?<\/\u00018x\\&侂9é‹™a[LRã‹­W胕)â¡¿8ãž™0JF,}?í—ˆd1cDMáƒâ›é„ⱕ%X)!XQ": "â³ê—³=橇a;3t⦾꼑仈î¥á€°aᚯ⯋ꕃAsé´·Nâ•_䎃ꙎAz\u0016䯷\\<à¿«>8q{}ï½·?ᣰ}'0ᴕ펓B┦lF#趤厃T?㕊#撹圂䆲"
+ },
+ "Ü‹ë‹é¾«ï¥c웑": false,
+ "ㇿ/q\"6-co髨íœCí¦#\u001b4~?3ä¹E삇<<": 7.600917488140322E-20,
+ "äE6?㣖êƒé—´t祗*é‘ {ḣV(æµ¾h逇íž=W?ૉ?nꇽ8ꅉຉj으쮺@Ꚅ㰤u]Oyr": "vâ‰á«¸_*όAඤԆl)ۓᦇQ}í zà¼q滚",
+ "ソ᥊/넺I": true
+ }]]
+ ]
+ ]
+ ]
+ ]]
+ },
+ "䭑Ik攑\u0002QV烄:芩.麑㟴㘨≕": true,
+ "å„꿕C쇻풉~å´%碼\\8\"䬦꣙": null,
+ "欌L圬䅘Y8c(♺2?ON}o椳s宥2䉀eJ%é—¹rå†O^K諭%凞⺉⡻,掜?$ꥉ?略焕찳㯊艼誜4?\"﯎<ï±ã‚›XáˆINT:è©“ +": -1.0750456770694562E-19,
+ "ç’àc뜭싼ﺳ뎤K`ïŸ]p隨LtE": null,
+ "ç”™8䵊神EIꩤé¯á¢€,ïµ®Uä‘u疒ử驺䚿≚ഋ梶秓F`覤è­#짾蔀묊4<åªì¬¦éª_Yzgcà¡¶î²§4kç´¥`kc[Lï®—î°£ç°*I瀑[â¾°L殽鑥_mGÈ <\/|囹ç gæ¡°iri": true,
+ "챓ꖙꟻì¢è‡ou,å— 0\\jK핻뜠qwQ?ഩ㼕3Y彦b\u009bJ榶N棨f?ë¦é–綃6é³µM[OEë´¨uí–.Ꮁ癜蟳뽲ꩌ뻾rM豈Rï¨ç¾« uDꎚ%": null
+ },
+ "V傜2<": 7175127699521359521
+ }],
+ "é“«aG切<\/\"ী⊆e<^g࢛)Dé¡ï½Žï¬®é¥¼\u008c猪繩嵿ﱚCꡬ㻊g엺Aì—¦\u000fæš¿_f꿤ë³ã¦•桦`蒦䎔j甬%å²rj ç³": "䚢åŽëˆ´Au<4箞7礦Iï±”å eȧ䪸uï„€äµp|逹$嗫쨘ꖾï·!胠z寓팢^㨔|u8Nሇe텔ꅦ抷]،鹎ã³#༔繁 ",
+ "낂乕ꃻ볨ϱ-ꇋã–fsâ¿«)zꜦ/K?솞♞ꑌ宭hJ᤭瑥Fu": false,
+ "쟰ãœé­›G\u0003u?`㾕ℾ㣭5螠烶這趩ꖢ:@å’•ê¶xë’˜ëŠmä°¨bç—ƒë 0鳊喵熬딃$摉_~7*ⱦ녯1錾GKhJ惎秴6'H妈Tᧅ窹㺒疄矤铟wላ": null,
+ "쯆q4!3錕ã²âµ†ã‡›ê˜·Zç‘©ë­†\\â—ªNH\u001d\\ã½°U~㯶<\"쑣낞3ᵤ'峉eꢬ;鬹o꣒木X*é•·PXᘱu\"ä ¹n惞": null,
+ "ᅸ祊\"&ꥴCjࢼ﴿?䡉`U效5殼㮞V昽êª#ﺸ\\&t6x꠹盥꣰a[\u001aêªSpe鎿蠹": -1.1564713893659811E-19
+ }
+ ]]
+ ]
+ ]
+ ],
+ "羵䥳H,6ⱎ겾|@t\"#í–Šî¦1|稃 ì„­)ëœ=뻔ꡜ???櫎~*ῡ꫌/繣ﻠq": null
+ }
+ ]}
+ ]},
+ "츤": false
+ }},
+ "s": 3.7339341963399598E18
+ }
+ ],
+ "N,I?1+㢓|ࣱ嶃쩥V2\u0012(4EE虪朶$|w颇væ­¥": "~ì¢~_,Mzrã«YB溓Eæ·š\"â…¹äˆ”áºæŠ™ b,nt5Vã’J檶ê¨â»”?",
+ "Q껑ꡡ}$넎qHç…”æƒ/ez^!ẳF댙äŒé¦»å‰8": "梲;yté’°$i冄}Aî‘”L%a jëœå¥·ê±³ëš¾d꿽*ሬuDY3î…—?뮟鼯뮟wãªí‹±îŸ‚V",
+ "o{Q/K O胟ãzUdê€m&⨺J舕â¾é­¸è¨ŸãŒ¥[T籨櫉å”í‚ aṭ뱫촙莛>碶覆⧬짙쭰ׯdAiH໥벤í¥_æ¸[ 0î­¬e:죃TCå¼¼èŽëµDA:w唵ê£": null,
+ "á½æ¨Žäµ®è»§|?à±—aWH쩃1 ê…­su": null
+ }
+ ]
+ },
+ "勂\\&m鰈J釮=Ⲽ鳋+䂡郑": null,
+ "殣b綊倶5㥗惢⳷è¢á‘€ä¬„é•§M^ï±´3⣢翣næ«»1㨵}ኯ뗙顖Z.Q➷ꮨ뗇\u0004": "ê”™ä¼>n^[GीA䨟AMç¢á’ŠS쨲w?d㶣젊嘶çºéº“+æ„£a%気ྞScë“ᔘ:8bM7Xd8㶑臌]Ꙥ0ê­ì’™ä«£æŒµCè–½î€Dfⵃ떼᷸",
+ "?ç´¡.ì…ª_à·¨j\u0013Oxâ” $Xᶨ-á…‡oè–¹-}軫;yæ¯ãªœKã£?.EVì®±4둽⛻䤜'2盡\u001f60(|eì°ã¼Žá¦€ã’§-$l@ﻑå³\u0003ä­±å“å·—WFo5c㧆Tí„Y맸♤(": -2.50917882560589088E17
+ }}
+ ],
+ "侸\\릩.᳠뎠狣살cs项䭩畳H1s瀉븇19?.w骴崖㤊h痠볭㞳㞳ä®Ql怠㦵": "@䟴-=7f",
+ "鹟1x௢+d ;viä­´FSDS\u0004hꎹãš?â’â¦Ñž6u,扩@ë·Su)Pag휛Tá’—Vç—©!çžé‡€ê–žè˜¥&ೞè˜ê­°êž‡áŽ": "ah懱Ժ&\u20f7䵅♎඀䞧鿪굛ౕ湚粎蚵ᯋ幌YOE)५襦ãŠY*^\"R+ඈî¶å’·è¶9î—ꥂ榨艦멎헦é–ë¶v좛咊E)K㓷ྭr",
+ "æ†q쮦4綱켙ì….f4<\/g<籽늷?#蚴픘:fF\u00051㹉뀭.á°–í’ŽfÖ¦Hv蔎㧤.!ä­½=éž½]ìŒH:?\"-4": 8.740133984938656E-20
+ }]}
+ }
+ ],
+ "tVKn딩꘥⊾蹓᤹{\u0003lR꼽ᄲQFá…傅ﱋ猢⤊á”,E㓒秤nTà¶­v`â™›I\u0000]꫔ṞD\"麵cè¸î“²æ°X&æ¿¿ë˜ê£¹ê¹³à±¥è‘‚鿎\\aꡨ?": 3900062609292104525
+ }
+ ],
+ "ਉ샒⊩Lu@S䧰^g": -1.1487677090371648E18,
+ "⎢k⑊꬗yá«7^err糎Dt\u000bJç¤¯í™•ã†æ²‘サꋽeèµ”ã¢^J\u0004笲㿋idra剰-᪉C錇/Ĝ䂾ညSì§€?~ì½®gR敉⬹'ä§­": 1901472137232418266,
+ "ç—kä¶¥:?ì´½è´ì“‰ê“ˆã’¸gç˜[뵎\\胕?\u0014_榙p.j稶,$`糉妋0>Fá¡°ly㘽$?": "]ê™›O赎&#ã ƒë±å‰³î°·\"<â—†>0誉é½_|z|裵씪>áŒã¼\"Z[ç•}O?G뚇諦cs⠜撺5cuç—‘U圲\u001c?鴴計lì¶¥/╓哼䄗èŒîšªê®…뫈댽AëŒë¡–뤫V窗讬sHd&\nOi;_î´–u"
+ }
+ ],
+ "Uﺗ\\Y\\梷䄬~\u0002": null,
+ "k\"Y磓ᗔ휎@U冈<\/w컑)[": false,
+ "æ›Jè·âŒ»ë¦\u001f㙳s꥓âŸé‚«P늮쥄c∬ྡྷ舆렮칤Zè¶£5콡넛A쳨\\뀙骫(棻.*&è¼›LiIfi{@EA婳KᬰTXT": -4.3088230431977587E17
+ }]}
+ ]
+ ],
+ "곃㲧<\/dఓꂟs其ࡧ&N葶=?c㠤Ჴ'횠숄臼#\u001a~": false
+ }
+ ]
+ ]}]
+ }]
+ }}
+ ],
+ "2f`â½°E쵟>Jî•笂裭!〛觬囀ۺ쟰#桊l鹛ⲋ|RA_Vxá­gEë“h﵀mfá»|?juTUæ¡£[d⢼⺻p濚7E峿": 5613688852456817133
+ },
+ "濘ë¶gå¿®7ãµæ®¬W팕Qæ› ë«°)惃廊5%-î«è¹šzYZ樭ﴷQ锘쯤崫îŸgg": true,
+ "絥ᇑâ¦ì’“븣爚H.ã—Šß„o蘵貆ꂚ(쎔O᥉î¼ï®“]姨Wê“!RMA|o퉢THxè½®7Mê»U즨'i뾘舯o": "è·¥f꜃?"
+ }}
+ ],
+ "é·°é¹®K-9k;ï°°?_ݦѷ-ꅣ䩨Zꥱ\"mꠟ屎/콑Y╘2&鸞脇ã¢ê€‡à ºâ°¼æ‹¾å–­í‹®îL꽩bt俸墶 [l/웄\"꾦\u20d3iও-&+\u000fQ+໱뵞": -1.296494662286671E-19
+ },
+ "HX੹/⨇୕붷Uﮘ旧\\쾜͔3l鄈磣糂̖䟎Eá³wæ©–bá¿€_딕huè‘°î¤çª³é—¹Ð²U颵|染H죶.fPä—®:jä«¢\\b뎖i燕ꜚGâ® W-≚뉗lè¶•": "ଊ칭Oa᡺$IVã·§L\u0019脴셀붿餲햪$迳å‘ì¯ì¼‚PqfT\" ?î¹€I屉鴼쿕@ç¡™z^é•㊵M}ãš›T젣쓌-Wâ©-g%⺵<ë®±~빅╴瑿浂脬\u0005왦燲4áƒb|Då § <\/oEQh",
+ "䘶#㥘à©îººìº”ï” f巋ἡAJ䢚쭈ࣨ뫒*mᇊK,ࣺAꑱ\u000bR<\/A\"1a6鵌㯀bh곿w(\"$ê˜*rà²è¶£.dà¿©k/抶면䒎9W⊃9": "漩b挋Swè—Ž\u0000",
+ "畀e㨼mK꙼HglKb,\"'䤜": null
+ }]}]
+ ]
+ ]
+ }]
+ ]}
+ ]
+ ]}
+ ],
+ "æ­™>駿ꣂ숰Q`J΋方樛(d鱾뼣(ë«–í„­\u20f9lচ9æ­Œ8o]8윶lì–¶?é•–G摄탗6í‹íµ+g:䱫홊<멀뀿/س|ê­ºsê±è·¶ç¨šW々c㫣⎖": "㣮蔊깚Cꓔ舊|XRfé»ã†šï¸†'쾉ì·\\&言",
+ "æ®­\"cÞɨê™äž˜:嬮eæ½½Y펪㳅/\"O@à —ê²´]ì·–YÇž(t>R\"N?梳LDæ­=næ°¯Tè±°2R諸#N}*ç§ï¡§4}ã¶ŠGä£bì–š": null,
+ "襞<\/å•§ B|싞W瓇)6簭鼡艆lNì©`|펭佡\\é–“é‚[z릶&쭟愱ꅅ\\Tá°½1靝忠ˆ4̸s윜R7â’/똽?치X": "âŠèº–Cﱰ2Qẫè„&இ?%ëƒæ‚Š",
+ ",é°§åµì…£îˆ›ì‹¹xᎹ힨᯳EṬHïŽã¹–9": -4604276727380542356
+ }
+ }
+ ]]]],
+ "웺㚑xs}q䭵䪠馯8?LB犯zK'os䚛HZ\"L?셎s^㿧㴘Cv2": null
+ }]
+ ]
+ ]
+ ],
+ "Kdî©´2Kv+|z": 7367845130646124107,
+ "ᦂⶨ?ᢠ祂些ഷ牢㋇æ“\"腭䙾㖪\\(y4cE뽺ㆷ쫺ᔖ%zfÛ»$Ñž1柦,ã¶¢9r漢": -3.133230960444846E-20,
+ "ç˜Mç„€q%㢟f鸯Oâ£è“‘맕鯊$Oå™·|)z褫^㢦⠮ꚯ꫞`毕1qꢚ{ĭ䎀বώT\"뱘3G൴?ï¢ï¢^^oï…¯f": null
+ }
+ ],
+ "a8V᯺?:ﺃ/8ꉿBq|9啓댚;*i2": null,
+ "cpT瀇Hç°á»ªpೃi鎪Rrâ£ìˆ¬-鹸ҩ䠚z脚цGoN8å…¥y%è¶ŒI┽2ឪЀiJNcN)æ§£/â–Ÿ6S숆牟\"箑X僛G殱娇葱T%æ»:J諹昰qV쨰": 8331037591040855245
+ }],
+ "G5ᩜ䄗巢껳": true
+ }
+ },
+ "Ồ巢ゕ@_è­™A`碫é„㡥砄㠓(^K": "?܃B혢▦@犑ὺD~Tâ§|é†;o=J牌9냚⢽㨘{4è§èš”9#$∺\u0016p囅\\3Xk阖⪚\"UzA穕롬✎âžã­’춺C㣌ဉ\"2瓑员ᅽê¶ë«}꽚ꞇ鶂舟彺]ê½JCè§éЉ",
+ "â†Äšè†\"b-í‰ACR言J謈53~V튥x䜢?ꃽɄY뮩ꚜ": "K/↾eèƒ}]Bs⾿q룅鷦-膋?m+æ­»^魊镲6",
+ "粡霦cæž‹AHíŸo礼Ke?qWcA趸㡔ê‚?\u000eì¶‚8iতᦜ婪\u0015㢼nﵿê»!á´é–¢\u001d5j㨻gfá¿©UK5Juä¸tã‹TI'?ã“t>⼟o a>i}á°—;뤕Ü": false,
+ "ꄮ匴껢ꂰ涽+䜨B蛹H䛓-k蕞fu7kLè°–,'涃V~챳逋穞cT\"vQ쓕ObaCRQã“¡â²®?轭⫦輢墳?vA餽=h䮇킵ní²í‰…喙?\"'1ç–¬V嬗Qdç—'Lự": "6v!së¯ã­Ÿî€µî¦˜ã£¯çƒ!磸餠ቂh0C뿯봗Fé·­gê–¶~コkK<ᦈTtïŽ\\è·“w㭣횋钘ᆹ듡䑚W䟾X'ê…”4ï€FL勉Vܴ邨y)2'〚쭉⽵-鞣E,Q.?å—",
+ "?(˧쩯@å´Ÿå‹æ­„K": null
+ },
+ "Gc럃녧>?2DYIé´¿\\륨)æ¾”0ᔬlx'è§”7젘⤡縷螩%Sv׫묈/]↱&S ï…h\u0006æ­‹á‘›xi̘}ã²Y蔯_醨鯘煑橾8?䵎쨋z儬ê*@츾:": null
+ }
+ }
+ }
+ ]
+ ]
+ ]}
+ },
+ "HO츧G": 3.694949578823609E17,
+ "QC\u0012(翻曇Tfã·ŸbGBJ옉53\\嚇ᛎDï–/\u001b夾á‰4\"í•€@祎)쫆yD\"i먎Vnî¿ã¿¿V1Wá¨ä¶€": -6150931500380982286,
+ "Zã“®P翸é±é‰¼K䋞꘺튿â­Y": -7704503411315138850,
+ "]모开ꬖP븣c霤<[3aΠ\"é»ä––䰑뮋ꤦ秽∼㑷冹T+YUt\"싳F↭ä–&鋌": -2.7231911483181824E18,
+ "tꎖ": -4.9517948741799555E-19,
+ "䋘즊îŽ.⬅IꬃۣQ챢ꄑé»|f?C⾺|å…•ì¯sC鬸섾整腨솷V": "旆柩l<Ké«î–žM戶鯮t:wRî°2ꉱ`9'l픪*í芦㊢Pjjoå ¡^ ì‡ì–›å¶…있ষ0?F",
+ "下9T挞\\$yᮇk쌋⼇,ਉ": true,
+ "櫨:ㆣ,é‚lî ¬r崕祜ã®çƒœZ,XXD蕼㉴ kM꯽?P0﹉릗": null,
+ "îŠgv솠歽閘4镳䗄2æ¾¾>쪦sá–¸My㦅울ì‰ç˜—㎜檵9ï……ê‚駓ૉᚿ/u3ì”…å¾ï¤¥[Z䞸ࡗ1ꆱ&Q풘?Ç‚8\u0011BCDY2볨;é¸": null,
+ "幫 nç…¥sì‡íއ 왊-$C\"è¡:\u0014㣯舼.3ë™—Yl⋇\"K迎멎[ê½µs}9鉳UK8ì¥\"掄㹖h㙈!얄સ?Ꜳ봺R伕UTD媚I䜘Wé¨è”®": -4.150842714188901E-17,
+ "ﺯ^ã„„\b죵@fྉkf颡팋î¤êž¦{/Pm0V둳⻿/è½éŸ’ꊔᚬ@5螺G\\å’¸a谆⊪ቧ慷绖?è´¢(é·‡uéŒF=ráæ©¢áž³n:^iá´µtD볠覅Nèµ´": null
+ }]
+ }]
+ }
+ ]
+ ]}
+ ]},
+ "謯?w厓奰Tï§¡í——èážè²–o⪇弒L!캶$ᆅ": -4299324168507841322,
+ "뺊奉_åžæµ¸å»¶ëªå­„Z舰2i$q붿좾껇d▵é¤\"v暜Ҭì„mï¿´g>": -1.60911932510533427E18
+ }
+ ]
+ }
+ ]
+ ]],
+ "í‰êº”㠦楶Pê…±": 7517896876489142899,
+ "ï™°": false
+ }
+ ]},
+ "是u&I狻餼|è°–j\"7cë®sï­-踳鉷`䣷쉄_A艣鳞凃*m⯾☦椿q㎭Nîœæº”铉tlㆈ^": 1.93547720203604352E18,
+ "ï…µkⲨ\\%vr#\u000bâ’ºY\\t<\/3﬌R訤='﹠8è¤êž´ë ´æ›”r": false
+ }
+ ]},
+ "阨{c?C\u001d~K?鎌Ԭ8烫#뙣Pì´ˆé—tã­±E­ë’䆺}ç”—[R*1!\\~hã•…á°º@<9JêષIä³–æ ­6綘걹ᅩM\"▯是∔v鬽顭⋊譬": "ìš´ï¶Kæ•‚(欖C취پ℄爦賾"
+ }
+ }}
+ }],
+ "鷨赼鸙+\\ä­£t圙ڹx᜾ČN<\/踘\"S_ë§¶a鷺漇T彚⎲i㈥LT-xA캔$\u001cUH=a0츺l릦": "溣㣂0æ¿•=鉵氬駘>Pꌢpb솇쬤h힊줎çªãª¬CrQ矠a&è„꼬爼M茴/á¿®\u0017å¼è½¼y#êž c6ë‘´=?Rå´ë· éº–w?"
+ },
+ "閕ᘜ]CT)䵞l9z'xZF{:ØI/躅匽ì¡:䟇AGF૸\u001cퟗ9)駬慟ꡒꆒRS״툋A<>\u0010\"ꂔ炃7gëšEà§îˆbꅰ輤]oã±_뷕ܘ暂\"u": "芢+U^+㢩^鱆8*1鈶鮀\u0002뺰9⬳ꪮlL䃣괟,G8\u20a8DF㉪錖0ㄤ瓶8Nଷd?眡GLc陓\\_죌Vì°à¤²äºŒ?cë¦æ± \u0019JC\u0011b⤉zẒT볕\"绣蘨뚋cꡉkî« I\u001eé³´",
+ "ꃣI'{6u^㡃#཰Kq4逹y൒䧠䵮!㱙ï®/n??{Lí’“ZETã™ í¿X2᩟綳跠葿㚙w཮x캽扳B唕S|å°¾}ì´•%N?o䪨": null,
+ "ⰴFjà·Ÿì…ˆ[\u0018è¾·px?椯\\1<ﲻ栘á£ë´¢æ† ë‰´p": -5263694954586507640
+ }
+ ]
+ ]]
+ ]}
+ ]}]
+ ]
+ ],
+ "?#癘82禩鋆êŠty?&": -1.9419029518535086E-19
+ }
+ ]
+ ]
+ ]}
+ ]
+ ]
+ ],
+ "훊榲.|῕戄&.ãšZꛦ2\"䢥ሆ⤢fV_æ‘•å©”?â‰Fji冀탆꜕iã¬_ẑKᅢ꫄蔻XWc|饡Siẘ^㲦?羡2ã´1ç¸á™…?ì‰Ou": false
+ }]]
+ ]}}},
+ "æ…‚ë—„å“è“”á“åŒåš–/颹蘯/翻ㆼL?뇊,í…µ<\\ç·ã”Cボ": null
+ },
+ "p溉ᑟi짣z:䒤棇r^٫%G9缑r砌롧.물农g?0׼ሩ4ƸO㣥㯄쩞ጩ": null,
+ "껎繥YxK\"F젷쨹뤤1wq轫o?鱑뜀瘊?뎃hç‘\\ꛣ}Kå³^ኖâ¤ï§´ê‰“hy": null
+ }
+ ],
+ "á±€nè‚“ã„›\"å »2>mæ®®'1橌%êž´êµ°=Ӳ鯨9耛<\/n據0u彘8㬇៩fá¿è¯™]嚊": "䋯쪦S럶åŒã…›#î½)O`ሀX_éªæ¸²â›€ã¨»å®…闩➈ꢙஶDRâª"
+ },
+ "tAì“龇 â‹¥bj왎录r땽✒롰;羋^\\?툳*┎?ì€ma䵳넅U䳆૘〹䆀LQ0\bç–€U~u$M}(鵸gï­â³¾i抦뛹?䤈땚검.鹆?ê©¡tâ¶¥GÄ’;!ቹHïš©Så³»B츪ì¼f5≺": 2366175040075384032,
+ "ì „pJjleb]áž½": -7.5418493141528422E18,
+ "n.鎖ጲ\n?,$䪘": true
+ },
+ "欈Ar㉣螵᪚茩?O)": null
+ },
+ "쫸M#x}Dç§±æ¬K=侫们ä¸ï‡ª.KꕾxẠ\u001e㿯䣛FÜ캗ï¬qq8꟞ṢFD훎⵳簕꭛^鳜\u205cÙ«~⑟~冫ऊ2ì«°<\/戲윱o<\"": true
+ },
+ "ã·è¥/T뱂\u0010锕|内䞇xä¾â‰¦ã­–:M?iM᣿IJeç…œdG࣯尃⚩gPt*辂.{磼럾äª@a\\袛?}ᓺBç¼": true
+ }
+ }
+ ]]}]}},
+ "tn\"6î´ê«¤ìƒ¾ä„„;銞^%VBPwu묪`Y僑N.↺Ws?3C⤻9唩Sä ®á´m;sᇷ냞඘B/;툥B?lB∤)G+O9m裢0kC햪䪤": -4.5941249382502277E18,
+ "áš”t'\\æ„«?éµ€@\\ã³ê‚•Pí <<]ç…¹G-b!S?\nꖽ鼫,Ý›&é ºy踦?Eæ†î¬–릱H}햧캡b@手.p탻>췽㣬ꒅ`qeä½­P>á“‚&?u}毚ᜉ蟶頳졪áŽzl2wO": -2.53561440423275936E17
+ }]}
+ }
+ ]
+ ]],
+ "潈촒⿂å¡": 5495738871964062986
+ }
+ ]]
+ }
+ ]
+ ]}
+ ]]
+ ]]
+ ]}
+ ]
+ ]},
+ "á‚qí‚è“…R`謈èŸá¦î’³å„‚æ§åƒ»ï¹¶9å©Œî¬æ«žé‡ˆ~\"%匹躾ɢ뤥>࢟瀴愅?殕节/냔O✬H鲽엢?ᮈà©î“Žâ‹§dâ½ã«zCe*": 2.15062231586689536E17,
+ "ã¶µUi曚ç°é‹ªá¾¼è‡§P{ä䷪쨑̟A뼿T渠誈äšD1!ìž¶<\/ã¡7?)2l≣穷᛾ç¨{:;㡹nemיּ訊`Gî¹²": null,
+ "䀕\"飕辭påœf#뫆䶷뛮;â›´á©3çšëá°ìŽ“â¦·è©µ%᜖Մfs⇫(\u001e~P|ï­—CⲾផv湟W첋(텪બTî¾·<บSê‰à©—⋲X婵i ӵ⇮?L䬇|êˆ?졸": 1.548341247351782E-19
+ }
+ ]
+ },
+ "t;:N\u0015qé¦Rt缆{ê®C?஛㷱敪\\+鲊㉫㓪몗릙ç«(æ°µkYS": "Xá°‚T?൮ô",
+ "碕飦幑|+ 㚦é¶`é•¥ê© B<\/加륙": -4314053432419755959,
+ "秌孳(p!G?Vå‚«%8ሽ8w;5鲗㦙LI檸\u2098": "zG N볞䆭éŽí˜\\ONK3íš™<\/樚立圌Q튅k쩎Ffì‹aׂJK銆ઘì¦ç‹©6༥✙䩜篥CzP(è»é§‡HHퟲ讃%,ά{ë p而刲vy䦅ክ^톺M楒é¢ã¹³]Mdg2>䤉洞",
+ "踛M젧>忔芿㌜Zk": 2215369545966507819,
+ "ì”A`$æ§­é °í»^U覒\bG毲aᣴU;8!팲f꜇E⸃_åµ{å«ç¾ƒX쀳C7ë—®m(åš¼u NÜè°ŸD劯9]#": true,
+ "ﻩ!뵸-ç­šPá­›}á¼°å±¥lPh?౮ⶹꆛ穉뎃gè‘㑓溢CX뾇Gã–¬A錟]RKï’î´²aꄘ]Yo+@ä˜'s섎襠$^í™°}F": null
+ },
+ "粘ꪒ4HXᕘ蹵.$å€\r\u001dë¬77pPc^yî¶ç¬²Q<\/ê–¶ è¨äƒá¨•G?*": 1.73773035935040224E17
+ },
+ "婅拳?bkU;#D矠â´vVN쩆t㜷A풃갮娪a%é®çµª3dAv룒#tm쑬⌛qYwc4|L8KZ;xU⓭㳔밆拓EZ7襨eD|隰ऌ䧼u9Ô¢+]è´´Pè¿": 2.9628516456987075E18
+ }]}}]
+ ]}
+ }}
+ ]}]
+ ],
+ "|g翉F*湹̶\u0005â1脉̀eI쩓ᖂ㫱0碞l䴨ꑅ㵽7AtἈ턧yq䳥塑:z:é€ï¾¼X눔擉)`N3昛oQì…–y-ڨ⾶æ¢êˆµq^<\/": null,
+ "è¹\\ëž“G^璬x৴뭸ゆUSê²§ï®·Bꮤ ┉銜᯻0%N7}~fæ´‹å„Xꔼ<\/4妟Vꄟ9:౟곡t킅冩䧉笭裟炂4ë´‹â±³åºæ€Št+怯涗\"0ã–ˆHq": false,
+ "졬믟'ﺇফ圪쓬멤m邸QLà¦¬ä—æ„4jvsç¿™ à¾ê§€è‰³H-|": null,
+ "컮襱⣱뗠 R毪/鹙꾀%헳8&": -5770986448525107020
+ }
+ ],
+ "î½­B䔚bê»ë™å§“展槰T-똌鷺tcï§ç¿á«½^㓟ä€o3o$꘭趙è¬Ié¡©)뇭Ἑä“\f@{ᣨ`x3è”›": null
+ }
+ ]
+ ]
+ }],
+ "⦖扚vWꃱ꥙㾠壢輓{-⎳鹷è´ç’¿äœ‘bG倛â‹ç£Žc皇皩7a~ﳫUâ•£Q࠭ꎉS摅姽OW.홌ೞ.": null,
+ "蚪eVlH献r}á®ë¯ ï°©ê”„@ç‘„â²±": null,
+ "퀭$JWoê©¢gì—­ì䖔㑺h&à­¢tXX愰㱇?㾫I_6 OaB瑈q裿": null,
+ "꽦ﲼLyr纛ZduçB絟쬴糔?ã•‚ì§¹äµe": "ḱ\u2009cX9ë©€i䶛簆㳀k"
+ }
+ ]]]],
+ "(_ê®g່澮?ᩑyM<艷\u001aꪽ\\庼뙭Zë§·ã°©Vm\\lYç­º]3㋲2㌩㄀Eਟäµâ¨„ì¨á”ŸgङHné–⤇놋瓇Q탚單oY\"♆臾jHᶈå¾îž«á‰„??uㇰA?#1侓": null
+ },
+ "è§“^~ሢ&iIë†g륎ḱ캀.ᓡꀮ胙鈉": 1.0664523593012836E-19,
+ "yè©­GbᔶऽsëŒU:æœî „⤎ϲì—⮼D醄诿që™°I#즧v蔎xHᵿt᡽[**?崮耖p缫쿃Lè,ë´¬ï–ꤦC쯵#=X1çž»@OZc鱗CQTï‹„x": null
+ }
+ ]
+ }}],
+ "剘ç´\u0004\\Xn⊠6,á€×±;嵣崇}讃iႽ)d1\\䔓": null
+ },
+ "脨z\"{X,1u찜<'k&@?1}Yn$\u0015Rd輲ーa쮂굄+B$l": true,
+ "諳>*ì­®ê´äµŸÒ+<ç®}빀䅱⡔æªï€è‡’hIH脟ꩪCí•ଗP좕\"0i<\/C褻DÛžæ—+^5?'ꂱ䚫^7}ã¡ cq6\\쨪ꔞꥢ?纖䫀氮蒫侲빦敶q{Aç…²G": -6880961710038544266
+ }}]
+ },
+ "5s⨲JvಽῶꭂᄢI.a৊": null,
+ "?1qê½ì¿»ê›‹DR%Uå¨>DgNä¹­G": -1.2105047302732358E-19
+ }
+ ]
+ ]},
+ "qZz`撋뙹둣j碇ì\\ꆥ\u0018@ïœè—´ç–°Wz)O{Fä¶›l᷂绘訥$]ë®å¤»ä¢‹ä©‡è¿ç°æ¨§çŒµâ£­jè¶q)$꬚⵷0馢W:â°!Qoe": -1666634370862219540,
+ "t": "=î¹›wp|~碎Q鬳Ó\\l-<\/^ﳊhní–}ä”t碵ḛ혷?é»äŠ—",
+ "邙쇡㯇%#=,î‰E4勃驆V繚q[Y댻XV㡸[逹á°è‘¢B@u=JS5?bLRnì–®ã‰â…ï°³?a6[&íŸ!è—ˆ": 1.2722786745736667E-19
+ },
+ "X블땨4{ph鵋ꉯ웸 5p簂䦭s_E徔濧dç¨~No穔噕뽲)뉈c5M윅>âš‹[岦䲟懷æ?éŽê“†à¸¬çˆ‹ç äœ”s{\u001bméšå„¸ç…›%bﯿXT>ê—˜@8G": 1157841540507770724,
+ "媤娪Qæ¸ï‡\u0011SAyᡈ쿯": true,
+ "çš^ಸ%ê±<\/蛯<O\"-刷ã R(kO=䢊䅎l䰓팪A絫픧": "è­”\\ãš„ ?R7㔪G㋉⣰渆?\\#|gN⤴;Wì¹·A׫癮଼ೣã³ë’œ7dæ“ê¾²0扬S0ᆵi/贎ྡn䆋武",
+ "è‡ç ‡Gã“æœ¦ì¼‹Wq`㞲攊*å†î‘µî¨~霓L剢zI腧튴Tç¹™Cঅ뫬╈뮜ㄾ䦧촄椘B⊬츩r2f㶱厊8eϬ{挚â¯OM焄覤\\(KÓ¡>?\"祴å“\\\\'í": -3.4614808555942579E18,
+ "釴U:O湛㴑䀣렑縓\ta)<D8ï­³æ§é«­D.L|xsæ–‹æ• \"ë‹æ—©7wáŽ": true,
+ "쵈+쬎簨up䓬?q+~\u0019仇îŒëµˆá«¯3áµ£æ˜æž°åŠ«ãª¢uç˜-퀭:ì»™:u`⌿ï«A(9鄦!<çšnj3:Hà£¨å·‹ä€æ—¸ëŽˆë§»v\"\\(곘vO㤰aZe<\/W鹙鄜;l厮ë‘": null,
+ "î–·": -1.2019926774977002E-18,
+ "%者Oî–‹7.Nêªs梇接z蕜綛<\/䜭\"죊y<曋漵@Śâ¹sD⟓jݗᢜ?zî–†/9á²Ma쨮긗贎8ᔮ㦛;6p뾥໭䭊0B찛+)(Yã¿ é¸ä•’^옥": "鬃뫤&痽舎Jì½®è—󽸰ᨨMꈫ髿v<N\\î·.ì‚’ê»…Ñ1ê­¼5ä´·5쳬臨wjë¥"
+ }],
+ "é·Ž'ã³—@帚妇OAj' è°¬f94ǯ(횡ヒ%io쪖ì‚좛>(j:숾å´ä—ŒgCiB뽬Oyuqè¼¥åŽ/7)?今hY︺Q": null
+ }
+ ]
+ ]]]}]
+ ],
+ "I笔趠Ph!<ཛྷ㸞诘X$畉F\u0005笷èŸ.Esr릙!W☆ï›ä²–뗷莾뒭U\"䀸犜Uo3ï¯Gꯌx4r蔇᡹㧪쨢準<ä‚€%ࡡꟼç‘8ç‚Xs0ä€é”€?fi쥱ê†àª²BB": -8571484181158525797,
+ "Lâ¦o#J|\"⽩-ã±¢d㌛8d\\㶤傩儻E[Y熯)r噤὘勇 }": "e(濨쓌K䧚僒ã˜è ¤Vᛸ\"络QJL2,嬓ì™î¿‰ä¼¢ã‹’䴿考澰@(ã¾`kX$ë‘ÑE斡,èœ&~y",
+ "vj.|统圪ᵮPL?2oŶ`ë°§\"勃+0ue%⿥绬췈체$6:qaë Q;~晘3㙘鹑": true,
+ "à·Ø™4ç„â¶¿c︋iâš…:ã‚“é–Ⳙ苆籦kw{䙞셕pCì·ƒê¬âœêŸ¯êš“é…„bížhwkê­­M鬋8B耳쑘WQ\\å™ac'唀x᪌\u2048*hì§Ž#á‡é® ë¾áž¿ë€Œ": false,
+ "⎀jꄒ牺3Ⓝ컴~?親ꕽã¼Ü“å–瘘!@<튋ãŒê¿±â©¦{a?Yv%⪧笯Uܱ栅Eæši뚬:ꄃx7䙳ꦋ&䓹vq☶Iä˜á¾˜æ¶œ\\ì‰ëºŒLr%Bcãœ3?î¤ï…¨ê­ç ¿è£ž]": null,
+ "⭤뙓z(㡂%亳K䌽꫿AԾ岺㦦㼴輞낚Vꦴw냟鬓㹈뽈+o3譻K1잞": 2091209026076965894,
+ "ㇲ\t⋇轑ꠤ룫X긒\"zoYì‡í¬wjæ¢ì‘l侸`e%s": -9.9240075473576563E17,
+ "啸ꮑ㉰!áš“}éŠ": -4.0694813896301194E18,
+ "ï‰>]囋੽EK뇜>_ꀣ緳碖{ì裔[<ನ\"䇅\"5L?#îµ³xTwv#ç½\u0005래t应\\N?빗;": "v쮽瞭pë­ƒ"
+ }
+ ]],
+ "æ–´æ§¾?Zç¿\"~æ…弞ﻆ=꜡o5é‹ï’½dw\"?Kè ¡i샾ogDï²°_C*⬟iㇷ4nયèŸ[㟉U꽌娛苸 à§æ“贻洞펻)쿗૊許X⨪VY츚Zä¾ã¶­~튃ᵦ<\/E臭tve猑x嚢": null,
+ "锡⛩<\/칥ꈙᬙè€&êšç±¬â– 865?_>Lè©ì¿¨äˆŒæµ¿å¼¥ï©‰Ì«î¾½ï‘lj&zx<\/C쉾?覯n?": null,
+ "꾳鑤/꼩ï¨d=ᘈn挫ᑩ䰬ZC": "3錢爋6Ƹ䴗v⪿Wr益G韠[\u0010å±—9ì¡é’u?殢c䳀蓃樄욂NAq赟c튒ç˜ë ¶î‚³Aà«¡Éšæ"
+ }
+ ]
+ ]
+ ]}
+ ]
+ ]
+ }]]]}}
+ ]}],
+ "ï‚’Ejä—³U<\/Q=ç’샎䞦,å °é  @褙g_\u0003ꤾfâ¶½?퇋!łB〙ד3CC䌴鈌U:뭔咎(Qો臃䡬è‹BO7î¼§ã¢äŸ¸\"Yb": 2.36010731779814E-20,
+ "逸'0å²”j\u000e눘먷翌C츊秦=ꭣ棭ှ;鳸=麱$XP⩉駚橄A\\좱⛌jqvä°ž3Ь踌v㳆¹gT┌gvLBè³–ïžçƒ¡m?@E঳i": null
+ },
+ "曺vì°˜×?&绫OáŸ": 9107241066550187880
+ }
+ ]
+ ],
+ "(e屄\u0019昜훕ç–b蓘ᬄ0/۲묇Z蘮á€â¨è›˜èƒ¯ë¢ƒ@㘉8ሪWᨮ⦬ᅳ䅴HIá‡ì¨³z囕陻엣1赳o": true,
+ ",b刈Z,á æ™Tì†Å•B⩆ou'í¼â‰ƒç»—é›—dè­Š": null,
+ "a唥KB\"ï³è‚•$u\n^â…„P䟼냉䞸⩪u윗瀱ꔨ#yÅŸsî««ê’¬=ï‹•1ïš–|ﲤ爢`tà±íмî£ì³«_Az(Ṋ擬㦷좕耈6": 2099309172767331582,
+ "?ã´¸U<\/䢔ꯡ阽扆ã¤qé‹?f㔫wM嬙-;UV죫嚔픞G&\"Cá—äªí’ŠQ": "VM7ç–¹+陕枡툩窲}ç¿¡ä–¶8欞ÄsTë®}ç’¤:jﺋ鎴}HfAàµâ§»Zd#Qï¬u茅J髒皣Y-︴[?-~쉜vë”璮㹚䅊﩯<-#\u000eê±€h\u0004u抱﵊㼃U<㱷⊱IC進"
+ },
+ "숌dee節é½é‚ºp넱蹓+e罕U": true
+ }
+ ],
+ "b⧴ë£??á” 3ã±>%郿劃ç¿ê¬ê ›Wï¡°çž³á«ëˆ„躨狀ໄy੽\"ីuS=㨞馸k乆E": "トz݈^9R䬑<ﮛG<s~<\/?ⵆá¥è€ç†·uë“·"
+ }}
+ ]
+ }
+ ]}
+ }
+ }
+ }
+ }},
+ "宩j鬅쳜Qê–јyç”Zá­µï1væ“–}䨿F%cֲ᫺贴m塼딚NP亪\"ï¿‹sa뺯ꘓ2:9뛓ï à¼‚쌅䊈#>Rꨳ\u000fTT泠纷꽀MR<CBxPñ±’«X쇤": -2.22390568492330598E18,
+ "?䯣ᄽ@Z鸅->ᴱ纊:ã ­ë³®?%N56%鈕1ä—äœaä²—j陇=ë¿»å‚衋࿘ᓸ?ᕵZ+<\/}H耢bä€z^f$&ã’LkꢳI脚뙛u": 5.694374481577558E-20
+ }]
+ }
+ ]],
+ "obj": {"key": "wrong value"},
+ "퓲꽪m{ã¶©/뇿#â¼¢&᭙硞㪔E嚉c樱㬇1aç¶‘á–DḾä©": null
+ }
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/data/webapp.json b/3rdparty/rapidjson/bin/data/webapp.json
new file mode 100644
index 00000000000..d540b57f0df
--- /dev/null
+++ b/3rdparty/rapidjson/bin/data/webapp.json
@@ -0,0 +1,88 @@
+{"web-app": {
+ "servlet": [
+ {
+ "servlet-name": "cofaxCDS",
+ "servlet-class": "org.cofax.cds.CDSServlet",
+ "init-param": {
+ "configGlossary:installationAt": "Philadelphia, PA",
+ "configGlossary:adminEmail": "ksm@pobox.com",
+ "configGlossary:poweredBy": "Cofax",
+ "configGlossary:poweredByIcon": "/images/cofax.gif",
+ "configGlossary:staticPath": "/content/static",
+ "templateProcessorClass": "org.cofax.WysiwygTemplate",
+ "templateLoaderClass": "org.cofax.FilesTemplateLoader",
+ "templatePath": "templates",
+ "templateOverridePath": "",
+ "defaultListTemplate": "listTemplate.htm",
+ "defaultFileTemplate": "articleTemplate.htm",
+ "useJSP": false,
+ "jspListTemplate": "listTemplate.jsp",
+ "jspFileTemplate": "articleTemplate.jsp",
+ "cachePackageTagsTrack": 200,
+ "cachePackageTagsStore": 200,
+ "cachePackageTagsRefresh": 60,
+ "cacheTemplatesTrack": 100,
+ "cacheTemplatesStore": 50,
+ "cacheTemplatesRefresh": 15,
+ "cachePagesTrack": 200,
+ "cachePagesStore": 100,
+ "cachePagesRefresh": 10,
+ "cachePagesDirtyRead": 10,
+ "searchEngineListTemplate": "forSearchEnginesList.htm",
+ "searchEngineFileTemplate": "forSearchEngines.htm",
+ "searchEngineRobotsDb": "WEB-INF/robots.db",
+ "useDataStore": true,
+ "dataStoreClass": "org.cofax.SqlDataStore",
+ "redirectionClass": "org.cofax.SqlRedirection",
+ "dataStoreName": "cofax",
+ "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
+ "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
+ "dataStoreUser": "sa",
+ "dataStorePassword": "dataStoreTestQuery",
+ "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
+ "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
+ "dataStoreInitConns": 10,
+ "dataStoreMaxConns": 100,
+ "dataStoreConnUsageLimit": 100,
+ "dataStoreLogLevel": "debug",
+ "maxUrlLength": 500}},
+ {
+ "servlet-name": "cofaxEmail",
+ "servlet-class": "org.cofax.cds.EmailServlet",
+ "init-param": {
+ "mailHost": "mail1",
+ "mailHostOverride": "mail2"}},
+ {
+ "servlet-name": "cofaxAdmin",
+ "servlet-class": "org.cofax.cds.AdminServlet"},
+
+ {
+ "servlet-name": "fileServlet",
+ "servlet-class": "org.cofax.cds.FileServlet"},
+ {
+ "servlet-name": "cofaxTools",
+ "servlet-class": "org.cofax.cms.CofaxToolsServlet",
+ "init-param": {
+ "templatePath": "toolstemplates/",
+ "log": 1,
+ "logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
+ "logMaxSize": "",
+ "dataLog": 1,
+ "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
+ "dataLogMaxSize": "",
+ "removePageCache": "/content/admin/remove?cache=pages&id=",
+ "removeTemplateCache": "/content/admin/remove?cache=templates&id=",
+ "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
+ "lookInContext": 1,
+ "adminGroupID": 4,
+ "betaServer": true}}],
+ "servlet-mapping": {
+ "cofaxCDS": "/",
+ "cofaxEmail": "/cofaxutil/aemail/*",
+ "cofaxAdmin": "/admin/*",
+ "fileServlet": "/static/*",
+ "cofaxTools": "/tools/*"},
+
+ "taglib": {
+ "taglib-uri": "cofax.tld",
+ "taglib-location": "/WEB-INF/tlds/cofax.tld"}}} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/data/widget.json b/3rdparty/rapidjson/bin/data/widget.json
new file mode 100644
index 00000000000..0449493a644
--- /dev/null
+++ b/3rdparty/rapidjson/bin/data/widget.json
@@ -0,0 +1,26 @@
+{"widget": {
+ "debug": "on",
+ "window": {
+ "title": "Sample Konfabulator Widget",
+ "name": "main_window",
+ "width": 500,
+ "height": 500
+ },
+ "image": {
+ "src": "Images/Sun.png",
+ "name": "sun1",
+ "hOffset": 250,
+ "vOffset": 250,
+ "alignment": "center"
+ },
+ "text": {
+ "data": "Click Here",
+ "size": 36,
+ "style": "bold",
+ "name": "text1",
+ "hOffset": 250,
+ "vOffset": 100,
+ "alignment": "center",
+ "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
+ }
+}} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/draft-04/schema b/3rdparty/rapidjson/bin/draft-04/schema
new file mode 100644
index 00000000000..85eb502a680
--- /dev/null
+++ b/3rdparty/rapidjson/bin/draft-04/schema
@@ -0,0 +1,150 @@
+{
+ "id": "http://json-schema.org/draft-04/schema#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Core schema meta-schema",
+ "definitions": {
+ "schemaArray": {
+ "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "#" }
+ },
+ "positiveInteger": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "positiveIntegerDefault0": {
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
+ },
+ "simpleTypes": {
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
+ },
+ "stringArray": {
+ "type": "array",
+ "items": { "type": "string" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ },
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "format": "uri"
+ },
+ "$schema": {
+ "type": "string",
+ "format": "uri"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "default": {},
+ "multipleOf": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
+ },
+ "maximum": {
+ "type": "number"
+ },
+ "exclusiveMaximum": {
+ "type": "boolean",
+ "default": false
+ },
+ "minimum": {
+ "type": "number"
+ },
+ "exclusiveMinimum": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "pattern": {
+ "type": "string",
+ "format": "regex"
+ },
+ "additionalItems": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
+ },
+ "items": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/schemaArray" }
+ ],
+ "default": {}
+ },
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "uniqueItems": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "required": { "$ref": "#/definitions/stringArray" },
+ "additionalProperties": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
+ },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "patternProperties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "dependencies": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/stringArray" }
+ ]
+ }
+ },
+ "enum": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true
+ },
+ "type": {
+ "anyOf": [
+ { "$ref": "#/definitions/simpleTypes" },
+ {
+ "type": "array",
+ "items": { "$ref": "#/definitions/simpleTypes" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ ]
+ },
+ "allOf": { "$ref": "#/definitions/schemaArray" },
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
+ "not": { "$ref": "#" }
+ },
+ "dependencies": {
+ "exclusiveMaximum": [ "maximum" ],
+ "exclusiveMinimum": [ "minimum" ]
+ },
+ "default": {}
+}
diff --git a/3rdparty/rapidjson/bin/encodings/utf16be.json b/3rdparty/rapidjson/bin/encodings/utf16be.json
new file mode 100644
index 00000000000..e46dbfb9ddc
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf16be.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf16bebom.json b/3rdparty/rapidjson/bin/encodings/utf16bebom.json
new file mode 100644
index 00000000000..0a23ae205cb
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf16bebom.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf16le.json b/3rdparty/rapidjson/bin/encodings/utf16le.json
new file mode 100644
index 00000000000..92d504530cd
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf16le.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf16lebom.json b/3rdparty/rapidjson/bin/encodings/utf16lebom.json
new file mode 100644
index 00000000000..eaba00132cd
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf16lebom.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf32be.json b/3rdparty/rapidjson/bin/encodings/utf32be.json
new file mode 100644
index 00000000000..9cbb522279d
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf32be.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf32bebom.json b/3rdparty/rapidjson/bin/encodings/utf32bebom.json
new file mode 100644
index 00000000000..bde6a99ab43
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf32bebom.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf32le.json b/3rdparty/rapidjson/bin/encodings/utf32le.json
new file mode 100644
index 00000000000..b00f290a64f
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf32le.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf32lebom.json b/3rdparty/rapidjson/bin/encodings/utf32lebom.json
new file mode 100644
index 00000000000..d3db39bf732
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf32lebom.json
Binary files differ
diff --git a/3rdparty/rapidjson/bin/encodings/utf8.json b/3rdparty/rapidjson/bin/encodings/utf8.json
new file mode 100644
index 00000000000..1e27ece50e4
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf8.json
@@ -0,0 +1,7 @@
+{
+ "en":"I can eat glass and it doesn't hurt me.",
+ "zh-Hant":"我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。",
+ "zh-Hans":"我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。",
+ "ja":"ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãれã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。",
+ "ko":"나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ 않아요"
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/encodings/utf8bom.json b/3rdparty/rapidjson/bin/encodings/utf8bom.json
new file mode 100644
index 00000000000..07e81e10528
--- /dev/null
+++ b/3rdparty/rapidjson/bin/encodings/utf8bom.json
@@ -0,0 +1,7 @@
+{
+ "en":"I can eat glass and it doesn't hurt me.",
+ "zh-Hant":"我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。",
+ "zh-Hans":"我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。",
+ "ja":"ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãれã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。",
+ "ko":"나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ 않아요"
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail1.json b/3rdparty/rapidjson/bin/jsonchecker/fail1.json
new file mode 100644
index 00000000000..6216b865f10
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail1.json
@@ -0,0 +1 @@
+"A JSON payload should be an object or array, not a string." \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail10.json b/3rdparty/rapidjson/bin/jsonchecker/fail10.json
new file mode 100644
index 00000000000..5d8c0047bd5
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail10.json
@@ -0,0 +1 @@
+{"Extra value after close": true} "misplaced quoted value" \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail11.json b/3rdparty/rapidjson/bin/jsonchecker/fail11.json
new file mode 100644
index 00000000000..76eb95b4583
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail11.json
@@ -0,0 +1 @@
+{"Illegal expression": 1 + 2} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail12.json b/3rdparty/rapidjson/bin/jsonchecker/fail12.json
new file mode 100644
index 00000000000..77580a4522d
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail12.json
@@ -0,0 +1 @@
+{"Illegal invocation": alert()} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail13.json b/3rdparty/rapidjson/bin/jsonchecker/fail13.json
new file mode 100644
index 00000000000..379406b59bd
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail13.json
@@ -0,0 +1 @@
+{"Numbers cannot have leading zeroes": 013} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail14.json b/3rdparty/rapidjson/bin/jsonchecker/fail14.json
new file mode 100644
index 00000000000..0ed366b38a3
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail14.json
@@ -0,0 +1 @@
+{"Numbers cannot be hex": 0x14} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail15.json b/3rdparty/rapidjson/bin/jsonchecker/fail15.json
new file mode 100644
index 00000000000..fc8376b605d
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail15.json
@@ -0,0 +1 @@
+["Illegal backslash escape: \x15"] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail16.json b/3rdparty/rapidjson/bin/jsonchecker/fail16.json
new file mode 100644
index 00000000000..3fe21d4b532
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail16.json
@@ -0,0 +1 @@
+[\naked] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail17.json b/3rdparty/rapidjson/bin/jsonchecker/fail17.json
new file mode 100644
index 00000000000..62b9214aeda
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail17.json
@@ -0,0 +1 @@
+["Illegal backslash escape: \017"] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail18.json b/3rdparty/rapidjson/bin/jsonchecker/fail18.json
new file mode 100644
index 00000000000..edac92716f1
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail18.json
@@ -0,0 +1 @@
+[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail19.json b/3rdparty/rapidjson/bin/jsonchecker/fail19.json
new file mode 100644
index 00000000000..3b9c46fa9a2
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail19.json
@@ -0,0 +1 @@
+{"Missing colon" null} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail2.json b/3rdparty/rapidjson/bin/jsonchecker/fail2.json
new file mode 100644
index 00000000000..6b7c11e5a56
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail2.json
@@ -0,0 +1 @@
+["Unclosed array" \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail20.json b/3rdparty/rapidjson/bin/jsonchecker/fail20.json
new file mode 100644
index 00000000000..27c1af3e72e
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail20.json
@@ -0,0 +1 @@
+{"Double colon":: null} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail21.json b/3rdparty/rapidjson/bin/jsonchecker/fail21.json
new file mode 100644
index 00000000000..62474573b21
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail21.json
@@ -0,0 +1 @@
+{"Comma instead of colon", null} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail22.json b/3rdparty/rapidjson/bin/jsonchecker/fail22.json
new file mode 100644
index 00000000000..a7752581bcf
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail22.json
@@ -0,0 +1 @@
+["Colon instead of comma": false] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail23.json b/3rdparty/rapidjson/bin/jsonchecker/fail23.json
new file mode 100644
index 00000000000..494add1ca19
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail23.json
@@ -0,0 +1 @@
+["Bad value", truth] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail24.json b/3rdparty/rapidjson/bin/jsonchecker/fail24.json
new file mode 100644
index 00000000000..caff239bfc3
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail24.json
@@ -0,0 +1 @@
+['single quote'] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail25.json b/3rdparty/rapidjson/bin/jsonchecker/fail25.json
new file mode 100644
index 00000000000..8b7ad23e010
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail25.json
@@ -0,0 +1 @@
+[" tab character in string "] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail26.json b/3rdparty/rapidjson/bin/jsonchecker/fail26.json
new file mode 100644
index 00000000000..845d26a6a54
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail26.json
@@ -0,0 +1 @@
+["tab\ character\ in\ string\ "] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail27.json b/3rdparty/rapidjson/bin/jsonchecker/fail27.json
new file mode 100644
index 00000000000..6b01a2ca4a9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail27.json
@@ -0,0 +1,2 @@
+["line
+break"] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail28.json b/3rdparty/rapidjson/bin/jsonchecker/fail28.json
new file mode 100644
index 00000000000..621a0101c66
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail28.json
@@ -0,0 +1,2 @@
+["line\
+break"] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail29.json b/3rdparty/rapidjson/bin/jsonchecker/fail29.json
new file mode 100644
index 00000000000..47ec421bb62
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail29.json
@@ -0,0 +1 @@
+[0e] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail3.json b/3rdparty/rapidjson/bin/jsonchecker/fail3.json
new file mode 100644
index 00000000000..168c81eb785
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail3.json
@@ -0,0 +1 @@
+{unquoted_key: "keys must be quoted"} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail30.json b/3rdparty/rapidjson/bin/jsonchecker/fail30.json
new file mode 100644
index 00000000000..8ab0bc4b8b2
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail30.json
@@ -0,0 +1 @@
+[0e+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail31.json b/3rdparty/rapidjson/bin/jsonchecker/fail31.json
new file mode 100644
index 00000000000..1cce602b518
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail31.json
@@ -0,0 +1 @@
+[0e+-1] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail32.json b/3rdparty/rapidjson/bin/jsonchecker/fail32.json
new file mode 100644
index 00000000000..45cba7396ff
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail32.json
@@ -0,0 +1 @@
+{"Comma instead if closing brace": true, \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail33.json b/3rdparty/rapidjson/bin/jsonchecker/fail33.json
new file mode 100644
index 00000000000..ca5eb19dc97
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail33.json
@@ -0,0 +1 @@
+["mismatch"} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail4.json b/3rdparty/rapidjson/bin/jsonchecker/fail4.json
new file mode 100644
index 00000000000..9de168bf34e
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail4.json
@@ -0,0 +1 @@
+["extra comma",] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail5.json b/3rdparty/rapidjson/bin/jsonchecker/fail5.json
new file mode 100644
index 00000000000..ddf3ce3d240
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail5.json
@@ -0,0 +1 @@
+["double extra comma",,] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail6.json b/3rdparty/rapidjson/bin/jsonchecker/fail6.json
new file mode 100644
index 00000000000..ed91580e1b1
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail6.json
@@ -0,0 +1 @@
+[ , "<-- missing value"] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail7.json b/3rdparty/rapidjson/bin/jsonchecker/fail7.json
new file mode 100644
index 00000000000..8a96af3e4ee
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail7.json
@@ -0,0 +1 @@
+["Comma after the close"], \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail8.json b/3rdparty/rapidjson/bin/jsonchecker/fail8.json
new file mode 100644
index 00000000000..b28479c6ecb
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail8.json
@@ -0,0 +1 @@
+["Extra close"]] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/fail9.json b/3rdparty/rapidjson/bin/jsonchecker/fail9.json
new file mode 100644
index 00000000000..5815574f363
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/fail9.json
@@ -0,0 +1 @@
+{"Extra comma": true,} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/pass1.json b/3rdparty/rapidjson/bin/jsonchecker/pass1.json
new file mode 100644
index 00000000000..70e26854369
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/pass1.json
@@ -0,0 +1,58 @@
+[
+ "JSON Test Pattern pass1",
+ {"object with 1 member":["array with 1 element"]},
+ {},
+ [],
+ -42,
+ true,
+ false,
+ null,
+ {
+ "integer": 1234567890,
+ "real": -9876.543210,
+ "e": 0.123456789e-12,
+ "E": 1.234567890E+34,
+ "": 23456789012E66,
+ "zero": 0,
+ "one": 1,
+ "space": " ",
+ "quote": "\"",
+ "backslash": "\\",
+ "controls": "\b\f\n\r\t",
+ "slash": "/ & \/",
+ "alpha": "abcdefghijklmnopqrstuvwyz",
+ "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
+ "digit": "0123456789",
+ "0123456789": "digit",
+ "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
+ "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
+ "true": true,
+ "false": false,
+ "null": null,
+ "array":[ ],
+ "object":{ },
+ "address": "50 St. James Street",
+ "url": "http://www.JSON.org/",
+ "comment": "// /* <!-- --",
+ "# -- --> */": " ",
+ " s p a c e d " :[1,2 , 3
+
+,
+
+4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
+ "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
+ "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
+ "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
+: "A key can be any string"
+ },
+ 0.5 ,98.6
+,
+99.44
+,
+
+1066,
+1e1,
+0.1e1,
+1e-1,
+1e00,2e+00,2e-00
+,"rosebud"] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/pass2.json b/3rdparty/rapidjson/bin/jsonchecker/pass2.json
new file mode 100644
index 00000000000..d3c63c7ad84
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/pass2.json
@@ -0,0 +1 @@
+[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonchecker/pass3.json b/3rdparty/rapidjson/bin/jsonchecker/pass3.json
new file mode 100644
index 00000000000..4528d51f1ac
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/pass3.json
@@ -0,0 +1,6 @@
+{
+ "JSON Test Pattern pass3": {
+ "The outermost value": "must be an object or array.",
+ "In this test": "It is an object."
+ }
+}
diff --git a/3rdparty/rapidjson/bin/jsonchecker/readme.txt b/3rdparty/rapidjson/bin/jsonchecker/readme.txt
new file mode 100644
index 00000000000..321d89d998e
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonchecker/readme.txt
@@ -0,0 +1,3 @@
+Test suite from http://json.org/JSON_checker/.
+
+If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files.
diff --git a/3rdparty/rapidjson/bin/jsonschema/.gitignore b/3rdparty/rapidjson/bin/jsonschema/.gitignore
new file mode 100644
index 00000000000..1333ed77b7e
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/.gitignore
@@ -0,0 +1 @@
+TODO
diff --git a/3rdparty/rapidjson/bin/jsonschema/.travis.yml b/3rdparty/rapidjson/bin/jsonschema/.travis.yml
new file mode 100644
index 00000000000..deecd61100e
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/.travis.yml
@@ -0,0 +1,4 @@
+language: python
+python: "2.7"
+install: pip install jsonschema
+script: bin/jsonschema_suite check
diff --git a/3rdparty/rapidjson/bin/jsonschema/LICENSE b/3rdparty/rapidjson/bin/jsonschema/LICENSE
new file mode 100644
index 00000000000..c28adbadd91
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Julian Berman
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/3rdparty/rapidjson/bin/jsonschema/README.md b/3rdparty/rapidjson/bin/jsonschema/README.md
new file mode 100644
index 00000000000..6d9da949323
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/README.md
@@ -0,0 +1,148 @@
+JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite.png?branch=develop)](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite)
+======================
+
+This repository contains a set of JSON objects that implementors of JSON Schema
+validation libraries can use to test their validators.
+
+It is meant to be language agnostic and should require only a JSON parser.
+
+The conversion of the JSON objects into tests within your test framework of
+choice is still the job of the validator implementor.
+
+Structure of a Test
+-------------------
+
+If you're going to use this suite, you need to know how tests are laid out. The
+tests are contained in the `tests` directory at the root of this repository.
+
+Inside that directory is a subdirectory for each draft or version of the
+schema. We'll use `draft3` as an example.
+
+If you look inside the draft directory, there are a number of `.json` files,
+which logically group a set of test cases together. Often the grouping is by
+property under test, but not always, especially within optional test files
+(discussed below).
+
+Inside each `.json` file is a single array containing objects. It's easiest to
+illustrate the structure of these with an example:
+
+```json
+ {
+ "description": "the description of the test case",
+ "schema": {"the schema that should" : "be validated against"},
+ "tests": [
+ {
+ "description": "a specific test of a valid instance",
+ "data": "the instance",
+ "valid": true
+ },
+ {
+ "description": "another specific test this time, invalid",
+ "data": 15,
+ "valid": false
+ }
+ ]
+ }
+```
+
+So a description, a schema, and some tests, where tests is an array containing
+one or more objects with descriptions, data, and a boolean indicating whether
+they should be valid or invalid.
+
+Coverage
+--------
+
+Draft 3 and 4 should have full coverage. If you see anything missing or think
+there is a useful test missing, please send a pull request or open an issue.
+
+Who Uses the Test Suite
+-----------------------
+
+This suite is being used by:
+
+### Coffeescript ###
+
+* [jsck](https://github.com/pandastrike/jsck)
+
+### Dart ###
+
+* [json_schema](https://github.com/patefacio/json_schema)
+
+### Erlang ###
+
+* [jesse](https://github.com/klarna/jesse)
+
+### Go ###
+
+* [gojsonschema](https://github.com/sigu-399/gojsonschema)
+* [validate-json](https://github.com/cesanta/validate-json)
+
+### Haskell ###
+
+* [aeson-schema](https://github.com/timjb/aeson-schema)
+* [hjsonschema](https://github.com/seagreen/hjsonschema)
+
+### Java ###
+
+* [json-schema-validator](https://github.com/fge/json-schema-validator)
+
+### JavaScript ###
+
+* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)
+* [direct-schema](https://github.com/IreneKnapp/direct-schema)
+* [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid)
+* [jassi](https://github.com/iclanzan/jassi)
+* [JaySchema](https://github.com/natesilva/jayschema)
+* [json-schema-valid](https://github.com/ericgj/json-schema-valid)
+* [Jsonary](https://github.com/jsonary-js/jsonary)
+* [jsonschema](https://github.com/tdegrunt/jsonschema)
+* [request-validator](https://github.com/bugventure/request-validator)
+* [skeemas](https://github.com/Prestaul/skeemas)
+* [tv4](https://github.com/geraintluff/tv4)
+* [z-schema](https://github.com/zaggino/z-schema)
+* [jsen](https://github.com/bugventure/jsen)
+* [ajv](https://github.com/epoberezkin/ajv)
+
+### Node.js ###
+
+The JSON Schema Test Suite is also available as an
+[npm](https://www.npmjs.com/package/json-schema-test-suite) package.
+Node-specific support is maintained on the [node branch](https://github.com/json-schema/JSON-Schema-Test-Suite/tree/node).
+See [NODE-README.md](https://github.com/json-schema/JSON-Schema-Test-Suite/blob/node/NODE-README.md)
+for more information.
+
+### .NET ###
+
+* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema)
+
+### PHP ###
+
+* [json-schema](https://github.com/justinrainbow/json-schema)
+
+### Python ###
+
+* [jsonschema](https://github.com/Julian/jsonschema)
+
+### Ruby ###
+
+* [json-schema](https://github.com/hoxworth/json-schema)
+
+### Rust ###
+
+* [valico](https://github.com/rustless/valico)
+
+### Swift ###
+
+* [JSONSchema](https://github.com/kylef/JSONSchema.swift)
+
+If you use it as well, please fork and send a pull request adding yourself to
+the list :).
+
+Contributing
+------------
+
+If you see something missing or incorrect, a pull request is most welcome!
+
+There are some sanity checks in place for testing the test suite. You can run
+them with `bin/jsonschema_suite check` or `tox`. They will be run automatically by
+[Travis CI](https://travis-ci.org/) as well.
diff --git a/3rdparty/rapidjson/bin/jsonschema/bin/jsonschema_suite b/3rdparty/rapidjson/bin/jsonschema/bin/jsonschema_suite
new file mode 100644
index 00000000000..96108c86ba2
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/bin/jsonschema_suite
@@ -0,0 +1,283 @@
+#! /usr/bin/env python
+from __future__ import print_function
+import sys
+import textwrap
+
+try:
+ import argparse
+except ImportError:
+ print(textwrap.dedent("""
+ The argparse library could not be imported. jsonschema_suite requires
+ either Python 2.7 or for you to install argparse. You can do so by
+ running `pip install argparse`, `easy_install argparse` or by
+ downloading argparse and running `python2.6 setup.py install`.
+
+ See https://pypi.python.org/pypi/argparse for details.
+ """.strip("\n")))
+ sys.exit(1)
+
+import errno
+import fnmatch
+import json
+import os
+import random
+import shutil
+import unittest
+import warnings
+
+if getattr(unittest, "skipIf", None) is None:
+ unittest.skipIf = lambda cond, msg : lambda fn : fn
+
+try:
+ import jsonschema
+except ImportError:
+ jsonschema = None
+else:
+ validators = getattr(
+ jsonschema.validators, "validators", jsonschema.validators
+ )
+
+
+ROOT_DIR = os.path.join(
+ os.path.dirname(__file__), os.pardir).rstrip("__pycache__")
+SUITE_ROOT_DIR = os.path.join(ROOT_DIR, "tests")
+
+REMOTES = {
+ "integer.json": {"type": "integer"},
+ "subSchemas.json": {
+ "integer": {"type": "integer"},
+ "refToInteger": {"$ref": "#/integer"},
+ },
+ "folder/folderInteger.json": {"type": "integer"}
+}
+REMOTES_DIR = os.path.join(ROOT_DIR, "remotes")
+
+TESTSUITE_SCHEMA = {
+ "$schema": "http://json-schema.org/draft-03/schema#",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "description": {"type": "string", "required": True},
+ "schema": {"required": True},
+ "tests": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "description": {"type": "string", "required": True},
+ "data": {"required": True},
+ "valid": {"type": "boolean", "required": True}
+ },
+ "additionalProperties": False
+ },
+ "minItems": 1
+ }
+ },
+ "additionalProperties": False,
+ "minItems": 1
+ }
+}
+
+
+def files(paths):
+ for path in paths:
+ with open(path) as test_file:
+ yield json.load(test_file)
+
+
+def groups(paths):
+ for test_file in files(paths):
+ for group in test_file:
+ yield group
+
+
+def cases(paths):
+ for test_group in groups(paths):
+ for test in test_group["tests"]:
+ test["schema"] = test_group["schema"]
+ yield test
+
+
+def collect(root_dir):
+ for root, dirs, files in os.walk(root_dir):
+ for filename in fnmatch.filter(files, "*.json"):
+ yield os.path.join(root, filename)
+
+
+class SanityTests(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ print("Looking for tests in %s" % SUITE_ROOT_DIR)
+ cls.test_files = list(collect(SUITE_ROOT_DIR))
+ print("Found %s test files" % len(cls.test_files))
+ assert cls.test_files, "Didn't find the test files!"
+
+ def test_all_files_are_valid_json(self):
+ for path in self.test_files:
+ with open(path) as test_file:
+ try:
+ json.load(test_file)
+ except ValueError as error:
+ self.fail("%s contains invalid JSON (%s)" % (path, error))
+
+ def test_all_descriptions_have_reasonable_length(self):
+ for case in cases(self.test_files):
+ descript = case["description"]
+ self.assertLess(
+ len(descript),
+ 60,
+ "%r is too long! (keep it to less than 60 chars)" % (descript,)
+ )
+
+ def test_all_descriptions_are_unique(self):
+ for group in groups(self.test_files):
+ descriptions = set(test["description"] for test in group["tests"])
+ self.assertEqual(
+ len(descriptions),
+ len(group["tests"]),
+ "%r contains a duplicate description" % (group,)
+ )
+
+ @unittest.skipIf(jsonschema is None, "Validation library not present!")
+ def test_all_schemas_are_valid(self):
+ for schema in os.listdir(SUITE_ROOT_DIR):
+ schema_validator = validators.get(schema)
+ if schema_validator is not None:
+ test_files = collect(os.path.join(SUITE_ROOT_DIR, schema))
+ for case in cases(test_files):
+ try:
+ schema_validator.check_schema(case["schema"])
+ except jsonschema.SchemaError as error:
+ self.fail("%s contains an invalid schema (%s)" %
+ (case, error))
+ else:
+ warnings.warn("No schema validator for %s" % schema)
+
+ @unittest.skipIf(jsonschema is None, "Validation library not present!")
+ def test_suites_are_valid(self):
+ validator = jsonschema.Draft3Validator(TESTSUITE_SCHEMA)
+ for tests in files(self.test_files):
+ try:
+ validator.validate(tests)
+ except jsonschema.ValidationError as error:
+ self.fail(str(error))
+
+ def test_remote_schemas_are_updated(self):
+ for url, schema in REMOTES.items():
+ filepath = os.path.join(REMOTES_DIR, url)
+ with open(filepath) as schema_file:
+ self.assertEqual(json.load(schema_file), schema)
+
+
+def main(arguments):
+ if arguments.command == "check":
+ suite = unittest.TestLoader().loadTestsFromTestCase(SanityTests)
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
+ elif arguments.command == "flatten":
+ selected_cases = [case for case in cases(collect(arguments.version))]
+
+ if arguments.randomize:
+ random.shuffle(selected_cases)
+
+ json.dump(selected_cases, sys.stdout, indent=4, sort_keys=True)
+ elif arguments.command == "remotes":
+ json.dump(REMOTES, sys.stdout, indent=4, sort_keys=True)
+ elif arguments.command == "dump_remotes":
+ if arguments.update:
+ shutil.rmtree(arguments.out_dir, ignore_errors=True)
+
+ try:
+ os.makedirs(arguments.out_dir)
+ except OSError as e:
+ if e.errno == errno.EEXIST:
+ print("%s already exists. Aborting." % arguments.out_dir)
+ sys.exit(1)
+ raise
+
+ for url, schema in REMOTES.items():
+ filepath = os.path.join(arguments.out_dir, url)
+
+ try:
+ os.makedirs(os.path.dirname(filepath))
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise
+
+ with open(filepath, "wb") as out_file:
+ json.dump(schema, out_file, indent=4, sort_keys=True)
+ elif arguments.command == "serve":
+ try:
+ from flask import Flask, jsonify
+ except ImportError:
+ print(textwrap.dedent("""
+ The Flask library is required to serve the remote schemas.
+
+ You can install it by running `pip install Flask`.
+
+ Alternatively, see the `jsonschema_suite remotes` or
+ `jsonschema_suite dump_remotes` commands to create static files
+ that can be served with your own web server.
+ """.strip("\n")))
+ sys.exit(1)
+
+ app = Flask(__name__)
+
+ @app.route("/<path:path>")
+ def serve_path(path):
+ if path in REMOTES:
+ return jsonify(REMOTES[path])
+ return "Document does not exist.", 404
+
+ app.run(port=1234)
+
+
+parser = argparse.ArgumentParser(
+ description="JSON Schema Test Suite utilities",
+)
+subparsers = parser.add_subparsers(help="utility commands", dest="command")
+
+check = subparsers.add_parser("check", help="Sanity check the test suite.")
+
+flatten = subparsers.add_parser(
+ "flatten",
+ help="Output a flattened file containing a selected version's test cases."
+)
+flatten.add_argument(
+ "--randomize",
+ action="store_true",
+ help="Randomize the order of the outputted cases.",
+)
+flatten.add_argument(
+ "version", help="The directory containing the version to output",
+)
+
+remotes = subparsers.add_parser(
+ "remotes",
+ help="Output the expected URLs and their associated schemas for remote "
+ "ref tests as a JSON object."
+)
+
+dump_remotes = subparsers.add_parser(
+ "dump_remotes", help="Dump the remote ref schemas into a file tree",
+)
+dump_remotes.add_argument(
+ "--update",
+ action="store_true",
+ help="Update the remotes in an existing directory.",
+)
+dump_remotes.add_argument(
+ "--out-dir",
+ default=REMOTES_DIR,
+ type=os.path.abspath,
+ help="The output directory to create as the root of the file tree",
+)
+
+serve = subparsers.add_parser(
+ "serve",
+ help="Start a webserver to serve schemas used by remote ref tests."
+)
+
+if __name__ == "__main__":
+ main(parser.parse_args())
diff --git a/3rdparty/rapidjson/bin/jsonschema/remotes/.DS_Store b/3rdparty/rapidjson/bin/jsonschema/remotes/.DS_Store
new file mode 100644
index 00000000000..1d098a4103d
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/remotes/.DS_Store
Binary files differ
diff --git a/3rdparty/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json b/3rdparty/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json
new file mode 100644
index 00000000000..dbe5c758ee3
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json
@@ -0,0 +1,3 @@
+{
+ "type": "integer"
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonschema/remotes/integer.json b/3rdparty/rapidjson/bin/jsonschema/remotes/integer.json
new file mode 100644
index 00000000000..dbe5c758ee3
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/remotes/integer.json
@@ -0,0 +1,3 @@
+{
+ "type": "integer"
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonschema/remotes/subSchemas.json b/3rdparty/rapidjson/bin/jsonschema/remotes/subSchemas.json
new file mode 100644
index 00000000000..8b6d8f842fc
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/remotes/subSchemas.json
@@ -0,0 +1,8 @@
+{
+ "integer": {
+ "type": "integer"
+ },
+ "refToInteger": {
+ "$ref": "#/integer"
+ }
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/.DS_Store b/3rdparty/rapidjson/bin/jsonschema/tests/.DS_Store
new file mode 100644
index 00000000000..dae9b18efac
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/.DS_Store
Binary files differ
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json
new file mode 100644
index 00000000000..6d4bff51cf3
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json
@@ -0,0 +1,82 @@
+[
+ {
+ "description": "additionalItems as schema",
+ "schema": {
+ "items": [],
+ "additionalItems": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "additional items match schema",
+ "data": [ 1, 2, 3, 4 ],
+ "valid": true
+ },
+ {
+ "description": "additional items do not match schema",
+ "data": [ 1, 2, 3, "foo" ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "items is schema, no additionalItems",
+ "schema": {
+ "items": {},
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "all items match schema",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "array of items with no additionalItems",
+ "schema": {
+ "items": [{}, {}, {}],
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "no additional items present",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "additional items are not permitted",
+ "data": [ 1, 2, 3, 4 ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalItems as false without items",
+ "schema": {"additionalItems": false},
+ "tests": [
+ {
+ "description":
+ "items defaults to empty schema so everything is valid",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems are allowed by default",
+ "schema": {"items": []},
+ "tests": [
+ {
+ "description": "only the first items are validated",
+ "data": [1, "foo", false],
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json
new file mode 100644
index 00000000000..40831f9e9aa
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json
@@ -0,0 +1,88 @@
+[
+ {
+ "description":
+ "additionalProperties being false does not allow other properties",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "patternProperties": { "^v": {} },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [1, 2, 3],
+ "valid": true
+ },
+ {
+ "description": "patternProperties are not additional properties",
+ "data": {"foo":1, "vroom": 2},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties allows a schema which should validate",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties can exist by itself",
+ "schema": {
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalProperties are allowed by default",
+ "schema": {"properties": {"foo": {}, "bar": {}}},
+ "tests": [
+ {
+ "description": "additional properties are allowed",
+ "data": {"foo": 1, "bar": 2, "quux": true},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/default.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/default.json
new file mode 100644
index 00000000000..17629779fbe
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/default.json
@@ -0,0 +1,49 @@
+[
+ {
+ "description": "invalid type for default",
+ "schema": {
+ "properties": {
+ "foo": {
+ "type": "integer",
+ "default": []
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"foo": 13},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid string value for default",
+ "schema": {
+ "properties": {
+ "bar": {
+ "type": "string",
+ "minLength": 4,
+ "default": "bad"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"bar": "good"},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/dependencies.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/dependencies.json
new file mode 100644
index 00000000000..2f6ae489aed
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/dependencies.json
@@ -0,0 +1,108 @@
+[
+ {
+ "description": "dependencies",
+ "schema": {
+ "dependencies": {"bar": "foo"}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependant",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "with dependency",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies",
+ "schema": {
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependants",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "with dependencies",
+ "data": {"foo": 1, "bar": 2, "quux": 3},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"foo": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing other dependency",
+ "data": {"bar": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing both dependencies",
+ "data": {"quux": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies subschema",
+ "schema": {
+ "dependencies": {
+ "bar": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "integer"}
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type other",
+ "data": {"foo": 2, "bar": "quux"},
+ "valid": false
+ },
+ {
+ "description": "wrong type both",
+ "data": {"foo": "quux", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/disallow.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/disallow.json
new file mode 100644
index 00000000000..a5c9d90ccee
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/disallow.json
@@ -0,0 +1,80 @@
+[
+ {
+ "description": "disallow",
+ "schema": {
+ "disallow": "integer"
+ },
+ "tests": [
+ {
+ "description": "allowed",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "disallowed",
+ "data": 1,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple disallow",
+ "schema": {
+ "disallow": ["integer", "boolean"]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "other mismatch",
+ "data": true,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple disallow subschema",
+ "schema": {
+ "disallow":
+ ["string",
+ {
+ "type": "object",
+ "properties": {
+ "foo": {
+ "type": "string"
+ }
+ }
+ }]
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "other match",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "other mismatch",
+ "data": {"foo": "bar"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json
new file mode 100644
index 00000000000..ef7cc148902
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json
@@ -0,0 +1,60 @@
+[
+ {
+ "description": "by int",
+ "schema": {"divisibleBy": 2},
+ "tests": [
+ {
+ "description": "int by int",
+ "data": 10,
+ "valid": true
+ },
+ {
+ "description": "int by int fail",
+ "data": 7,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "by number",
+ "schema": {"divisibleBy": 1.5},
+ "tests": [
+ {
+ "description": "zero is divisible by anything (except 0)",
+ "data": 0,
+ "valid": true
+ },
+ {
+ "description": "4.5 is divisible by 1.5",
+ "data": 4.5,
+ "valid": true
+ },
+ {
+ "description": "35 is not divisible by 1.5",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "by small number",
+ "schema": {"divisibleBy": 0.0001},
+ "tests": [
+ {
+ "description": "0.0075 is divisible by 0.0001",
+ "data": 0.0075,
+ "valid": true
+ },
+ {
+ "description": "0.00751 is not divisible by 0.0001",
+ "data": 0.00751,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/enum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/enum.json
new file mode 100644
index 00000000000..0c83f0804d0
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/enum.json
@@ -0,0 +1,71 @@
+[
+ {
+ "description": "simple enum validation",
+ "schema": {"enum": [1, 2, 3]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": 4,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "heterogeneous enum validation",
+ "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": null,
+ "valid": false
+ },
+ {
+ "description": "objects are deep compared",
+ "data": {"foo": false},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "enums in properties",
+ "schema": {
+ "type":"object",
+ "properties": {
+ "foo": {"enum":["foo"]},
+ "bar": {"enum":["bar"], "required":true}
+ }
+ },
+ "tests": [
+ {
+ "description": "both properties are valid",
+ "data": {"foo":"foo", "bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing optional property is valid",
+ "data": {"bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing required property is invalid",
+ "data": {"foo":"foo"},
+ "valid": false
+ },
+ {
+ "description": "missing all properties is invalid",
+ "data": {},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/extends.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/extends.json
new file mode 100644
index 00000000000..909bce575ae
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/extends.json
@@ -0,0 +1,94 @@
+[
+ {
+ "description": "extends",
+ "schema": {
+ "properties": {"bar": {"type": "integer", "required": true}},
+ "extends": {
+ "properties": {
+ "foo": {"type": "string", "required": true}
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "extends",
+ "data": {"foo": "baz", "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "mismatch extends",
+ "data": {"foo": "baz"},
+ "valid": false
+ },
+ {
+ "description": "mismatch extended",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "baz", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple extends",
+ "schema": {
+ "properties": {"bar": {"type": "integer", "required": true}},
+ "extends" : [
+ {
+ "properties": {
+ "foo": {"type": "string", "required": true}
+ }
+ },
+ {
+ "properties": {
+ "baz": {"type": "null", "required": true}
+ }
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": "quux", "bar": 2, "baz": null},
+ "valid": true
+ },
+ {
+ "description": "mismatch first extends",
+ "data": {"bar": 2, "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch second extends",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "mismatch both",
+ "data": {"bar": 2},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "extends simple types",
+ "schema": {
+ "minimum": 20,
+ "extends": {"maximum": 30}
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": 25,
+ "valid": true
+ },
+ {
+ "description": "mismatch extends",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/items.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/items.json
new file mode 100644
index 00000000000..f5e18a13848
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/items.json
@@ -0,0 +1,46 @@
+[
+ {
+ "description": "a schema given for items",
+ "schema": {
+ "items": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "valid items",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "wrong type of items",
+ "data": [1, "x"],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "an array of schemas for items",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"type": "string"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "correct types",
+ "data": [ 1, "foo" ],
+ "valid": true
+ },
+ {
+ "description": "wrong types",
+ "data": [ "foo", 1 ],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxItems.json
new file mode 100644
index 00000000000..3b53a6b371a
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxItems validation",
+ "schema": {"maxItems": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": [1, 2, 3],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxLength.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxLength.json
new file mode 100644
index 00000000000..4de42bcaba0
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maxLength.json
@@ -0,0 +1,33 @@
+[
+ {
+ "description": "maxLength validation",
+ "schema": {"maxLength": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": "f",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 10,
+ "valid": true
+ },
+ {
+ "description": "two supplementary Unicode code points is long enough",
+ "data": "\uD83D\uDCA9\uD83D\uDCA9",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maximum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maximum.json
new file mode 100644
index 00000000000..86c7b89c9a9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/maximum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "maximum validation",
+ "schema": {"maximum": 3.0},
+ "tests": [
+ {
+ "description": "below the maximum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "above the maximum is invalid",
+ "data": 3.5,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMaximum validation",
+ "schema": {
+ "maximum": 3.0,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "below the maximum is still valid",
+ "data": 2.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 3.0,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minItems.json
new file mode 100644
index 00000000000..ed5118815ee
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minItems validation",
+ "schema": {"minItems": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minLength.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minLength.json
new file mode 100644
index 00000000000..3f09158deef
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minLength.json
@@ -0,0 +1,33 @@
+[
+ {
+ "description": "minLength validation",
+ "schema": {"minLength": 2},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": "f",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "one supplementary Unicode code point is not long enough",
+ "data": "\uD83D\uDCA9",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minimum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minimum.json
new file mode 100644
index 00000000000..d5bf000bcc6
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/minimum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "minimum validation",
+ "schema": {"minimum": 1.1},
+ "tests": [
+ {
+ "description": "above the minimum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "below the minimum is invalid",
+ "data": 0.6,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMinimum validation",
+ "schema": {
+ "minimum": 1.1,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "above the minimum is still valid",
+ "data": 1.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 1.1,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json
new file mode 100644
index 00000000000..ccc7c17fe8d
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json
@@ -0,0 +1,107 @@
+[
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a bignum is an integer",
+ "data": 12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a bignum is a number",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a negative bignum is an integer",
+ "data": -12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a negative bignum is a number",
+ "data": -98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "string",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "a bignum is not a string",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"maximum": 18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision",
+ "schema": {
+ "maximum": 972783798187987123879878123.18878137,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"minimum": -18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision on negative numbers",
+ "schema": {
+ "minimum": -972783798187987123879878123.18878137,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/format.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/format.json
new file mode 100644
index 00000000000..3ca7319dda0
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/format.json
@@ -0,0 +1,222 @@
+[
+ {
+ "description": "validation of regular expressions",
+ "schema": {"format": "regex"},
+ "tests": [
+ {
+ "description": "a valid regular expression",
+ "data": "([abc])+\\s+$",
+ "valid": true
+ },
+ {
+ "description": "a regular expression with unclosed parens is invalid",
+ "data": "^(abc]",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of date-time strings",
+ "schema": {"format": "date-time"},
+ "tests": [
+ {
+ "description": "a valid date-time string",
+ "data": "1963-06-19T08:30:06.283185Z",
+ "valid": true
+ },
+ {
+ "description": "an invalid date-time string",
+ "data": "06/19/1963 08:30:06 PST",
+ "valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of date strings",
+ "schema": {"format": "date"},
+ "tests": [
+ {
+ "description": "a valid date string",
+ "data": "1963-06-19",
+ "valid": true
+ },
+ {
+ "description": "an invalid date string",
+ "data": "06/19/1963",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of time strings",
+ "schema": {"format": "time"},
+ "tests": [
+ {
+ "description": "a valid time string",
+ "data": "08:30:06",
+ "valid": true
+ },
+ {
+ "description": "an invalid time string",
+ "data": "8:30 AM",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of URIs",
+ "schema": {"format": "uri"},
+ "tests": [
+ {
+ "description": "a valid URI",
+ "data": "http://foo.bar/?baz=qux#quux",
+ "valid": true
+ },
+ {
+ "description": "a valid protocol-relative URI",
+ "data": "//foo.bar/?baz=qux#quux",
+ "valid": true
+ },
+ {
+ "description": "an invalid URI",
+ "data": "\\\\WINDOWS\\fileshare",
+ "valid": false
+ },
+ {
+ "description": "an invalid URI though valid URI reference",
+ "data": "abc",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of e-mail addresses",
+ "schema": {"format": "email"},
+ "tests": [
+ {
+ "description": "a valid e-mail address",
+ "data": "joe.bloggs@example.com",
+ "valid": true
+ },
+ {
+ "description": "an invalid e-mail address",
+ "data": "2962",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IP addresses",
+ "schema": {"format": "ip-address"},
+ "tests": [
+ {
+ "description": "a valid IP address",
+ "data": "192.168.0.1",
+ "valid": true
+ },
+ {
+ "description": "an IP address with too many components",
+ "data": "127.0.0.0.1",
+ "valid": false
+ },
+ {
+ "description": "an IP address with out-of-range values",
+ "data": "256.256.256.256",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IPv6 addresses",
+ "schema": {"format": "ipv6"},
+ "tests": [
+ {
+ "description": "a valid IPv6 address",
+ "data": "::1",
+ "valid": true
+ },
+ {
+ "description": "an IPv6 address with out-of-range values",
+ "data": "12345::",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address with too many components",
+ "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address containing illegal characters",
+ "data": "::laptop",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of host names",
+ "schema": {"format": "host-name"},
+ "tests": [
+ {
+ "description": "a valid host name",
+ "data": "www.example.com",
+ "valid": true
+ },
+ {
+ "description": "a host name starting with an illegal character",
+ "data": "-a-host-name-that-starts-with--",
+ "valid": false
+ },
+ {
+ "description": "a host name containing illegal characters",
+ "data": "not_a_valid_host_name",
+ "valid": false
+ },
+ {
+ "description": "a host name with a component too long",
+ "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of CSS colors",
+ "schema": {"format": "color"},
+ "tests": [
+ {
+ "description": "a valid CSS color name",
+ "data": "fuchsia",
+ "valid": true
+ },
+ {
+ "description": "a valid six-digit CSS color code",
+ "data": "#CC8899",
+ "valid": true
+ },
+ {
+ "description": "a valid three-digit CSS color code",
+ "data": "#C89",
+ "valid": true
+ },
+ {
+ "description": "an invalid CSS color code",
+ "data": "#00332520",
+ "valid": false
+ },
+ {
+ "description": "an invalid CSS color name",
+ "data": "puce",
+ "valid": false
+ },
+ {
+ "description": "a CSS color name containing invalid characters",
+ "data": "light_grayish_red-violet",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json
new file mode 100644
index 00000000000..03fe97724c0
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json
@@ -0,0 +1,18 @@
+[
+ {
+ "description": "ECMA 262 regex dialect recognition",
+ "schema": { "format": "regex" },
+ "tests": [
+ {
+ "description": "[^] is a valid regex",
+ "data": "[^]",
+ "valid": true
+ },
+ {
+ "description": "ECMA 262 has no support for lookbehind",
+ "data": "(?<=foo)bar",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json
new file mode 100644
index 00000000000..9b50ea27769
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json
@@ -0,0 +1,15 @@
+[
+ {
+ "description": "some languages do not distinguish between different types of numeric value",
+ "schema": {
+ "type": "integer"
+ },
+ "tests": [
+ {
+ "description": "a float is not an integer even without fractional part",
+ "data": 1.0,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/pattern.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/pattern.json
new file mode 100644
index 00000000000..25e72997314
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/pattern.json
@@ -0,0 +1,34 @@
+[
+ {
+ "description": "pattern validation",
+ "schema": {"pattern": "^a*$"},
+ "tests": [
+ {
+ "description": "a matching pattern is valid",
+ "data": "aaa",
+ "valid": true
+ },
+ {
+ "description": "a non-matching pattern is invalid",
+ "data": "abc",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": true,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "pattern is not anchored",
+ "schema": {"pattern": "a+"},
+ "tests": [
+ {
+ "description": "matches a substring",
+ "data": "xxaayy",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json
new file mode 100644
index 00000000000..18586e5daba
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json
@@ -0,0 +1,110 @@
+[
+ {
+ "description":
+ "patternProperties validates properties matching a regex",
+ "schema": {
+ "patternProperties": {
+ "f.*o": {"type": "integer"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "multiple valid matches is valid",
+ "data": {"foo": 1, "foooooo" : 2},
+ "valid": true
+ },
+ {
+ "description": "a single invalid match is invalid",
+ "data": {"foo": "bar", "fooooo": 2},
+ "valid": false
+ },
+ {
+ "description": "multiple invalid matches is invalid",
+ "data": {"foo": "bar", "foooooo" : "baz"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple simultaneous patternProperties are validated",
+ "schema": {
+ "patternProperties": {
+ "a*": {"type": "integer"},
+ "aaa*": {"maximum": 20}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"a": 21},
+ "valid": true
+ },
+ {
+ "description": "a simultaneous match is valid",
+ "data": {"aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "multiple matches is valid",
+ "data": {"a": 21, "aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "an invalid due to one is invalid",
+ "data": {"a": "bar"},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to the other is invalid",
+ "data": {"aaaa": 31},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to both is invalid",
+ "data": {"aaa": "foo", "aaaa": 31},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "regexes are not anchored by default and are case sensitive",
+ "schema": {
+ "patternProperties": {
+ "[0-9]{2,}": { "type": "boolean" },
+ "X_": { "type": "string" }
+ }
+ },
+ "tests": [
+ {
+ "description": "non recognized members are ignored",
+ "data": { "answer 1": "42" },
+ "valid": true
+ },
+ {
+ "description": "recognized members are accounted for",
+ "data": { "a31b": null },
+ "valid": false
+ },
+ {
+ "description": "regexes are case sensitive",
+ "data": { "a_x_3": 3 },
+ "valid": true
+ },
+ {
+ "description": "regexes are case sensitive, 2",
+ "data": { "a_X_3": 3 },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/properties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/properties.json
new file mode 100644
index 00000000000..cd1644dcd91
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/properties.json
@@ -0,0 +1,92 @@
+[
+ {
+ "description": "object properties validation",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "both properties present and valid is valid",
+ "data": {"foo": 1, "bar": "baz"},
+ "valid": true
+ },
+ {
+ "description": "one property invalid is invalid",
+ "data": {"foo": 1, "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "both properties invalid is invalid",
+ "data": {"foo": [], "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "doesn't invalidate other properties",
+ "data": {"quux": []},
+ "valid": true
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "properties, patternProperties, additionalProperties interaction",
+ "schema": {
+ "properties": {
+ "foo": {"type": "array", "maxItems": 3},
+ "bar": {"type": "array"}
+ },
+ "patternProperties": {"f.o": {"minItems": 2}},
+ "additionalProperties": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "property validates property",
+ "data": {"foo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "property invalidates property",
+ "data": {"foo": [1, 2, 3, 4]},
+ "valid": false
+ },
+ {
+ "description": "patternProperty invalidates property",
+ "data": {"foo": []},
+ "valid": false
+ },
+ {
+ "description": "patternProperty validates nonproperty",
+ "data": {"fxo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "patternProperty invalidates nonproperty",
+ "data": {"fxo": []},
+ "valid": false
+ },
+ {
+ "description": "additionalProperty ignores property",
+ "data": {"bar": []},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty validates others",
+ "data": {"quux": 3},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty invalidates others",
+ "data": {"quux": "foo"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/ref.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/ref.json
new file mode 100644
index 00000000000..903ecb6bce1
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/ref.json
@@ -0,0 +1,159 @@
+[
+ {
+ "description": "root pointer ref",
+ "schema": {
+ "properties": {
+ "foo": {"$ref": "#"}
+ },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"foo": false},
+ "valid": true
+ },
+ {
+ "description": "recursive match",
+ "data": {"foo": {"foo": false}},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": false},
+ "valid": false
+ },
+ {
+ "description": "recursive mismatch",
+ "data": {"foo": {"bar": false}},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to object",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"$ref": "#/properties/foo"}
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"bar": 3},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": true},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to array",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"$ref": "#/items/0"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "match array",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "mismatch array",
+ "data": [1, "foo"],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "escaped pointer ref",
+ "schema": {
+ "tilda~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"},
+ "properties": {
+ "tilda": {"$ref": "#/tilda~0field"},
+ "slash": {"$ref": "#/slash~1field"},
+ "percent": {"$ref": "#/percent%25field"}
+ }
+ },
+ "tests": [
+ {
+ "description": "slash invalid",
+ "data": {"slash": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "tilda invalid",
+ "data": {"tilda": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "percent invalid",
+ "data": {"percent": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "slash valid",
+ "data": {"slash": 123},
+ "valid": true
+ },
+ {
+ "description": "tilda valid",
+ "data": {"tilda": 123},
+ "valid": true
+ },
+ {
+ "description": "percent valid",
+ "data": {"percent": 123},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "nested refs",
+ "schema": {
+ "definitions": {
+ "a": {"type": "integer"},
+ "b": {"$ref": "#/definitions/a"},
+ "c": {"$ref": "#/definitions/b"}
+ },
+ "$ref": "#/definitions/c"
+ },
+ "tests": [
+ {
+ "description": "nested ref valid",
+ "data": 5,
+ "valid": true
+ },
+ {
+ "description": "nested ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "remote ref, containing refs itself",
+ "schema": {"$ref": "http://json-schema.org/draft-03/schema#"},
+ "tests": [
+ {
+ "description": "remote ref valid",
+ "data": {"items": {"type": "integer"}},
+ "valid": true
+ },
+ {
+ "description": "remote ref invalid",
+ "data": {"items": {"type": 1}},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/refRemote.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/refRemote.json
new file mode 100644
index 00000000000..4ca804732c9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/refRemote.json
@@ -0,0 +1,74 @@
+[
+ {
+ "description": "remote ref",
+ "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "tests": [
+ {
+ "description": "remote ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "fragment within remote ref",
+ "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
+ "tests": [
+ {
+ "description": "remote fragment valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote fragment invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "ref within remote ref",
+ "schema": {
+ "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
+ },
+ "tests": [
+ {
+ "description": "ref within ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "ref within ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "change resolution scope",
+ "schema": {
+ "id": "http://localhost:1234/",
+ "items": {
+ "id": "folder/",
+ "items": {"$ref": "folderInteger.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "changed scope ref valid",
+ "data": [[1]],
+ "valid": true
+ },
+ {
+ "description": "changed scope ref invalid",
+ "data": [["a"]],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/required.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/required.json
new file mode 100644
index 00000000000..aaaf0242737
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/required.json
@@ -0,0 +1,53 @@
+[
+ {
+ "description": "required validation",
+ "schema": {
+ "properties": {
+ "foo": {"required" : true},
+ "bar": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "present required property is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "non-present required property is invalid",
+ "data": {"bar": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "required default validation",
+ "schema": {
+ "properties": {
+ "foo": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required by default",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "required explicitly false validation",
+ "schema": {
+ "properties": {
+ "foo": {"required": false}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required if required is false",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/type.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/type.json
new file mode 100644
index 00000000000..337da1206da
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/type.json
@@ -0,0 +1,474 @@
+[
+ {
+ "description": "integer type matches integers",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "an integer is an integer",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is not an integer",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an integer",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an integer",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not an integer",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an integer",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an integer",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "number type matches numbers",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "an integer is a number",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is a number",
+ "data": 1.1,
+ "valid": true
+ },
+ {
+ "description": "a string is not a number",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a number",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a number",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a number",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a number",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "string type matches strings",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "1 is not a string",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a string",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is a string",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "an object is not a string",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a string",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a string",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a string",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "object type matches objects",
+ "schema": {"type": "object"},
+ "tests": [
+ {
+ "description": "an integer is not an object",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an object",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an object",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is an object",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "an array is not an object",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an object",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an object",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "array type matches arrays",
+ "schema": {"type": "array"},
+ "tests": [
+ {
+ "description": "an integer is not an array",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an array",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an array",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an array",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is an array",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "a boolean is not an array",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an array",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "boolean type matches booleans",
+ "schema": {"type": "boolean"},
+ "tests": [
+ {
+ "description": "an integer is not a boolean",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a boolean",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not a boolean",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a boolean",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a boolean",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is a boolean",
+ "data": true,
+ "valid": true
+ },
+ {
+ "description": "null is not a boolean",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "null type matches only the null object",
+ "schema": {"type": "null"},
+ "tests": [
+ {
+ "description": "an integer is not null",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not null",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not null",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not null",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not null",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not null",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "any type matches any type",
+ "schema": {"type": "any"},
+ "tests": [
+ {
+ "description": "any type includes integers",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "any type includes float",
+ "data": 1.1,
+ "valid": true
+ },
+ {
+ "description": "any type includes string",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "any type includes object",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "any type includes array",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "any type includes boolean",
+ "data": true,
+ "valid": true
+ },
+ {
+ "description": "any type includes null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple types can be specified in an array",
+ "schema": {"type": ["integer", "string"]},
+ "tests": [
+ {
+ "description": "an integer is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "a float is invalid",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "an object is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is invalid",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is invalid",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "types can include schemas",
+ "schema": {
+ "type": [
+ "array",
+ {"type": "object"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "an integer is invalid",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a string is invalid",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "a float is invalid",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "an object is valid",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "an array is valid",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "a boolean is invalid",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is invalid",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description":
+ "when types includes a schema it should fully validate the schema",
+ "schema": {
+ "type": [
+ "integer",
+ {
+ "properties": {
+ "foo": {"type": "null"}
+ }
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "an integer is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "an object is valid only if it is fully valid",
+ "data": {"foo": null},
+ "valid": true
+ },
+ {
+ "description": "an object is invalid otherwise",
+ "data": {"foo": "bar"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "types from separate schemas are merged",
+ "schema": {
+ "type": [
+ {"type": ["string"]},
+ {"type": ["array", "null"]}
+ ]
+ },
+ "tests": [
+ {
+ "description": "an integer is invalid",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "an array is valid",
+ "data": [1, 2, 3],
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json
new file mode 100644
index 00000000000..c1f4ab99c9a
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json
@@ -0,0 +1,79 @@
+[
+ {
+ "description": "uniqueItems validation",
+ "schema": {"uniqueItems": true},
+ "tests": [
+ {
+ "description": "unique array of integers is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of integers is invalid",
+ "data": [1, 1],
+ "valid": false
+ },
+ {
+ "description": "numbers are unique if mathematically unequal",
+ "data": [1.0, 1.00, 1],
+ "valid": false
+ },
+ {
+ "description": "unique array of objects is valid",
+ "data": [{"foo": "bar"}, {"foo": "baz"}],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of objects is invalid",
+ "data": [{"foo": "bar"}, {"foo": "bar"}],
+ "valid": false
+ },
+ {
+ "description": "unique array of nested objects is valid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : false}}}
+ ],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of nested objects is invalid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : true}}}
+ ],
+ "valid": false
+ },
+ {
+ "description": "unique array of arrays is valid",
+ "data": [["foo"], ["bar"]],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of arrays is invalid",
+ "data": [["foo"], ["foo"]],
+ "valid": false
+ },
+ {
+ "description": "1 and true are unique",
+ "data": [1, true],
+ "valid": true
+ },
+ {
+ "description": "0 and false are unique",
+ "data": [0, false],
+ "valid": true
+ },
+ {
+ "description": "unique heterogeneous types are valid",
+ "data": [{}, [1], true, null, 1],
+ "valid": true
+ },
+ {
+ "description": "non-unique heterogeneous types are invalid",
+ "data": [{}, [1], true, null, {}, 1],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/.DS_Store b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/.DS_Store
new file mode 100644
index 00000000000..ef142295ea0
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/.DS_Store
Binary files differ
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json
new file mode 100644
index 00000000000..521745c8d6e
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json
@@ -0,0 +1,82 @@
+[
+ {
+ "description": "additionalItems as schema",
+ "schema": {
+ "items": [{}],
+ "additionalItems": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "additional items match schema",
+ "data": [ null, 2, 3, 4 ],
+ "valid": true
+ },
+ {
+ "description": "additional items do not match schema",
+ "data": [ null, 2, 3, "foo" ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "items is schema, no additionalItems",
+ "schema": {
+ "items": {},
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "all items match schema",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "array of items with no additionalItems",
+ "schema": {
+ "items": [{}, {}, {}],
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "no additional items present",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "additional items are not permitted",
+ "data": [ 1, 2, 3, 4 ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalItems as false without items",
+ "schema": {"additionalItems": false},
+ "tests": [
+ {
+ "description":
+ "items defaults to empty schema so everything is valid",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems are allowed by default",
+ "schema": {"items": [{"type": "integer"}]},
+ "tests": [
+ {
+ "description": "only the first item is validated",
+ "data": [1, "foo", false],
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json
new file mode 100644
index 00000000000..40831f9e9aa
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json
@@ -0,0 +1,88 @@
+[
+ {
+ "description":
+ "additionalProperties being false does not allow other properties",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "patternProperties": { "^v": {} },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [1, 2, 3],
+ "valid": true
+ },
+ {
+ "description": "patternProperties are not additional properties",
+ "data": {"foo":1, "vroom": 2},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties allows a schema which should validate",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties can exist by itself",
+ "schema": {
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalProperties are allowed by default",
+ "schema": {"properties": {"foo": {}, "bar": {}}},
+ "tests": [
+ {
+ "description": "additional properties are allowed",
+ "data": {"foo": 1, "bar": 2, "quux": true},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/allOf.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/allOf.json
new file mode 100644
index 00000000000..bbb5f89e4bc
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/allOf.json
@@ -0,0 +1,112 @@
+[
+ {
+ "description": "allOf",
+ "schema": {
+ "allOf": [
+ {
+ "properties": {
+ "bar": {"type": "integer"}
+ },
+ "required": ["bar"]
+ },
+ {
+ "properties": {
+ "foo": {"type": "string"}
+ },
+ "required": ["foo"]
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "allOf",
+ "data": {"foo": "baz", "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "mismatch second",
+ "data": {"foo": "baz"},
+ "valid": false
+ },
+ {
+ "description": "mismatch first",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "baz", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "allOf with base schema",
+ "schema": {
+ "properties": {"bar": {"type": "integer"}},
+ "required": ["bar"],
+ "allOf" : [
+ {
+ "properties": {
+ "foo": {"type": "string"}
+ },
+ "required": ["foo"]
+ },
+ {
+ "properties": {
+ "baz": {"type": "null"}
+ },
+ "required": ["baz"]
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": "quux", "bar": 2, "baz": null},
+ "valid": true
+ },
+ {
+ "description": "mismatch base schema",
+ "data": {"foo": "quux", "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch first allOf",
+ "data": {"bar": 2, "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch second allOf",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "mismatch both",
+ "data": {"bar": 2},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "allOf simple types",
+ "schema": {
+ "allOf": [
+ {"maximum": 30},
+ {"minimum": 20}
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": 25,
+ "valid": true
+ },
+ {
+ "description": "mismatch one",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/anyOf.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/anyOf.json
new file mode 100644
index 00000000000..a58714afd89
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/anyOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "description": "anyOf",
+ "schema": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "minimum": 2
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "first anyOf valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "second anyOf valid",
+ "data": 2.5,
+ "valid": true
+ },
+ {
+ "description": "both anyOf valid",
+ "data": 3,
+ "valid": true
+ },
+ {
+ "description": "neither anyOf valid",
+ "data": 1.5,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "anyOf with base schema",
+ "schema": {
+ "type": "string",
+ "anyOf" : [
+ {
+ "maxLength": 2
+ },
+ {
+ "minLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one anyOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both anyOf invalid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/default.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/default.json
new file mode 100644
index 00000000000..17629779fbe
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/default.json
@@ -0,0 +1,49 @@
+[
+ {
+ "description": "invalid type for default",
+ "schema": {
+ "properties": {
+ "foo": {
+ "type": "integer",
+ "default": []
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"foo": 13},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid string value for default",
+ "schema": {
+ "properties": {
+ "bar": {
+ "type": "string",
+ "minLength": 4,
+ "default": "bad"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"bar": "good"},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/definitions.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/definitions.json
new file mode 100644
index 00000000000..cf935a32153
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/definitions.json
@@ -0,0 +1,32 @@
+[
+ {
+ "description": "valid definition",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "valid definition schema",
+ "data": {
+ "definitions": {
+ "foo": {"type": "integer"}
+ }
+ },
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid definition",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "invalid definition schema",
+ "data": {
+ "definitions": {
+ "foo": {"type": 1}
+ }
+ },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/dependencies.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/dependencies.json
new file mode 100644
index 00000000000..7b9b16a7e12
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/dependencies.json
@@ -0,0 +1,113 @@
+[
+ {
+ "description": "dependencies",
+ "schema": {
+ "dependencies": {"bar": ["foo"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependant",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "with dependency",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies",
+ "schema": {
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependants",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "with dependencies",
+ "data": {"foo": 1, "bar": 2, "quux": 3},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"foo": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing other dependency",
+ "data": {"bar": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing both dependencies",
+ "data": {"quux": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies subschema",
+ "schema": {
+ "dependencies": {
+ "bar": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "integer"}
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "no dependency",
+ "data": {"foo": "quux"},
+ "valid": true
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type other",
+ "data": {"foo": 2, "bar": "quux"},
+ "valid": false
+ },
+ {
+ "description": "wrong type both",
+ "data": {"foo": "quux", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/enum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/enum.json
new file mode 100644
index 00000000000..f124436a7d9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/enum.json
@@ -0,0 +1,72 @@
+[
+ {
+ "description": "simple enum validation",
+ "schema": {"enum": [1, 2, 3]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": 4,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "heterogeneous enum validation",
+ "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": null,
+ "valid": false
+ },
+ {
+ "description": "objects are deep compared",
+ "data": {"foo": false},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "enums in properties",
+ "schema": {
+ "type":"object",
+ "properties": {
+ "foo": {"enum":["foo"]},
+ "bar": {"enum":["bar"]}
+ },
+ "required": ["bar"]
+ },
+ "tests": [
+ {
+ "description": "both properties are valid",
+ "data": {"foo":"foo", "bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing optional property is valid",
+ "data": {"bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing required property is invalid",
+ "data": {"foo":"foo"},
+ "valid": false
+ },
+ {
+ "description": "missing all properties is invalid",
+ "data": {},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/items.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/items.json
new file mode 100644
index 00000000000..f5e18a13848
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/items.json
@@ -0,0 +1,46 @@
+[
+ {
+ "description": "a schema given for items",
+ "schema": {
+ "items": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "valid items",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "wrong type of items",
+ "data": [1, "x"],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "an array of schemas for items",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"type": "string"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "correct types",
+ "data": [ 1, "foo" ],
+ "valid": true
+ },
+ {
+ "description": "wrong types",
+ "data": [ "foo", 1 ],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxItems.json
new file mode 100644
index 00000000000..3b53a6b371a
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxItems validation",
+ "schema": {"maxItems": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": [1, 2, 3],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxLength.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxLength.json
new file mode 100644
index 00000000000..811d35b253c
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxLength.json
@@ -0,0 +1,33 @@
+[
+ {
+ "description": "maxLength validation",
+ "schema": {"maxLength": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": "f",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 100,
+ "valid": true
+ },
+ {
+ "description": "two supplementary Unicode code points is long enough",
+ "data": "\uD83D\uDCA9\uD83D\uDCA9",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json
new file mode 100644
index 00000000000..d282446ad69
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxProperties validation",
+ "schema": {"maxProperties": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": {"foo": 1, "bar": 2, "baz": 3},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maximum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maximum.json
new file mode 100644
index 00000000000..86c7b89c9a9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/maximum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "maximum validation",
+ "schema": {"maximum": 3.0},
+ "tests": [
+ {
+ "description": "below the maximum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "above the maximum is invalid",
+ "data": 3.5,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMaximum validation",
+ "schema": {
+ "maximum": 3.0,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "below the maximum is still valid",
+ "data": 2.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 3.0,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minItems.json
new file mode 100644
index 00000000000..ed5118815ee
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minItems validation",
+ "schema": {"minItems": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minLength.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minLength.json
new file mode 100644
index 00000000000..3f09158deef
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minLength.json
@@ -0,0 +1,33 @@
+[
+ {
+ "description": "minLength validation",
+ "schema": {"minLength": 2},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": "f",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "one supplementary Unicode code point is not long enough",
+ "data": "\uD83D\uDCA9",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minProperties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minProperties.json
new file mode 100644
index 00000000000..a72c7d293e6
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minProperties.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minProperties validation",
+ "schema": {"minProperties": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minimum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minimum.json
new file mode 100644
index 00000000000..d5bf000bcc6
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/minimum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "minimum validation",
+ "schema": {"minimum": 1.1},
+ "tests": [
+ {
+ "description": "above the minimum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "below the minimum is invalid",
+ "data": 0.6,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMinimum validation",
+ "schema": {
+ "minimum": 1.1,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "above the minimum is still valid",
+ "data": 1.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 1.1,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json
new file mode 100644
index 00000000000..ca3b7618053
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json
@@ -0,0 +1,60 @@
+[
+ {
+ "description": "by int",
+ "schema": {"multipleOf": 2},
+ "tests": [
+ {
+ "description": "int by int",
+ "data": 10,
+ "valid": true
+ },
+ {
+ "description": "int by int fail",
+ "data": 7,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "by number",
+ "schema": {"multipleOf": 1.5},
+ "tests": [
+ {
+ "description": "zero is multiple of anything",
+ "data": 0,
+ "valid": true
+ },
+ {
+ "description": "4.5 is multiple of 1.5",
+ "data": 4.5,
+ "valid": true
+ },
+ {
+ "description": "35 is not multiple of 1.5",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "by small number",
+ "schema": {"multipleOf": 0.0001},
+ "tests": [
+ {
+ "description": "0.0075 is multiple of 0.0001",
+ "data": 0.0075,
+ "valid": true
+ },
+ {
+ "description": "0.00751 is not multiple of 0.0001",
+ "data": 0.00751,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/not.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/not.json
new file mode 100644
index 00000000000..cbb7f46bf8b
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/not.json
@@ -0,0 +1,96 @@
+[
+ {
+ "description": "not",
+ "schema": {
+ "not": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "allowed",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "disallowed",
+ "data": 1,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "not multiple types",
+ "schema": {
+ "not": {"type": ["integer", "boolean"]}
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "other mismatch",
+ "data": true,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "not more complex schema",
+ "schema": {
+ "not": {
+ "type": "object",
+ "properties": {
+ "foo": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "other match",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"foo": "bar"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "forbidden property",
+ "schema": {
+ "properties": {
+ "foo": {
+ "not": {}
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "property present",
+ "data": {"foo": 1, "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "property absent",
+ "data": {"bar": 1, "baz": 2},
+ "valid": true
+ }
+ ]
+ }
+
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
new file mode 100644
index 00000000000..1eaa4e47949
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "description": "oneOf",
+ "schema": {
+ "oneOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "minimum": 2
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "first oneOf valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "second oneOf valid",
+ "data": 2.5,
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "neither oneOf valid",
+ "data": 1.5,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "oneOf with base schema",
+ "schema": {
+ "type": "string",
+ "oneOf" : [
+ {
+ "minLength": 2
+ },
+ {
+ "maxLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one oneOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json
new file mode 100644
index 00000000000..ccc7c17fe8d
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json
@@ -0,0 +1,107 @@
+[
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a bignum is an integer",
+ "data": 12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a bignum is a number",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a negative bignum is an integer",
+ "data": -12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a negative bignum is a number",
+ "data": -98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "string",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "a bignum is not a string",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"maximum": 18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision",
+ "schema": {
+ "maximum": 972783798187987123879878123.18878137,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"minimum": -18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision on negative numbers",
+ "schema": {
+ "minimum": -972783798187987123879878123.18878137,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/format.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/format.json
new file mode 100644
index 00000000000..aacfd119843
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/format.json
@@ -0,0 +1,148 @@
+[
+ {
+ "description": "validation of date-time strings",
+ "schema": {"format": "date-time"},
+ "tests": [
+ {
+ "description": "a valid date-time string",
+ "data": "1963-06-19T08:30:06.283185Z",
+ "valid": true
+ },
+ {
+ "description": "an invalid date-time string",
+ "data": "06/19/1963 08:30:06 PST",
+ "valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of URIs",
+ "schema": {"format": "uri"},
+ "tests": [
+ {
+ "description": "a valid URI",
+ "data": "http://foo.bar/?baz=qux#quux",
+ "valid": true
+ },
+ {
+ "description": "a valid protocol-relative URI",
+ "data": "//foo.bar/?baz=qux#quux",
+ "valid": true
+ },
+ {
+ "description": "an invalid URI",
+ "data": "\\\\WINDOWS\\fileshare",
+ "valid": false
+ },
+ {
+ "description": "an invalid URI though valid URI reference",
+ "data": "abc",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of e-mail addresses",
+ "schema": {"format": "email"},
+ "tests": [
+ {
+ "description": "a valid e-mail address",
+ "data": "joe.bloggs@example.com",
+ "valid": true
+ },
+ {
+ "description": "an invalid e-mail address",
+ "data": "2962",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IP addresses",
+ "schema": {"format": "ipv4"},
+ "tests": [
+ {
+ "description": "a valid IP address",
+ "data": "192.168.0.1",
+ "valid": true
+ },
+ {
+ "description": "an IP address with too many components",
+ "data": "127.0.0.0.1",
+ "valid": false
+ },
+ {
+ "description": "an IP address with out-of-range values",
+ "data": "256.256.256.256",
+ "valid": false
+ },
+ {
+ "description": "an IP address without 4 components",
+ "data": "127.0",
+ "valid": false
+ },
+ {
+ "description": "an IP address as an integer",
+ "data": "0x7f000001",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IPv6 addresses",
+ "schema": {"format": "ipv6"},
+ "tests": [
+ {
+ "description": "a valid IPv6 address",
+ "data": "::1",
+ "valid": true
+ },
+ {
+ "description": "an IPv6 address with out-of-range values",
+ "data": "12345::",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address with too many components",
+ "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address containing illegal characters",
+ "data": "::laptop",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of host names",
+ "schema": {"format": "hostname"},
+ "tests": [
+ {
+ "description": "a valid host name",
+ "data": "www.example.com",
+ "valid": true
+ },
+ {
+ "description": "a host name starting with an illegal character",
+ "data": "-a-host-name-that-starts-with--",
+ "valid": false
+ },
+ {
+ "description": "a host name containing illegal characters",
+ "data": "not_a_valid_host_name",
+ "valid": false
+ },
+ {
+ "description": "a host name with a component too long",
+ "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json
new file mode 100644
index 00000000000..9b50ea27769
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json
@@ -0,0 +1,15 @@
+[
+ {
+ "description": "some languages do not distinguish between different types of numeric value",
+ "schema": {
+ "type": "integer"
+ },
+ "tests": [
+ {
+ "description": "a float is not an integer even without fractional part",
+ "data": 1.0,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/pattern.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/pattern.json
new file mode 100644
index 00000000000..25e72997314
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/pattern.json
@@ -0,0 +1,34 @@
+[
+ {
+ "description": "pattern validation",
+ "schema": {"pattern": "^a*$"},
+ "tests": [
+ {
+ "description": "a matching pattern is valid",
+ "data": "aaa",
+ "valid": true
+ },
+ {
+ "description": "a non-matching pattern is invalid",
+ "data": "abc",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": true,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "pattern is not anchored",
+ "schema": {"pattern": "a+"},
+ "tests": [
+ {
+ "description": "matches a substring",
+ "data": "xxaayy",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json
new file mode 100644
index 00000000000..18586e5daba
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json
@@ -0,0 +1,110 @@
+[
+ {
+ "description":
+ "patternProperties validates properties matching a regex",
+ "schema": {
+ "patternProperties": {
+ "f.*o": {"type": "integer"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "multiple valid matches is valid",
+ "data": {"foo": 1, "foooooo" : 2},
+ "valid": true
+ },
+ {
+ "description": "a single invalid match is invalid",
+ "data": {"foo": "bar", "fooooo": 2},
+ "valid": false
+ },
+ {
+ "description": "multiple invalid matches is invalid",
+ "data": {"foo": "bar", "foooooo" : "baz"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple simultaneous patternProperties are validated",
+ "schema": {
+ "patternProperties": {
+ "a*": {"type": "integer"},
+ "aaa*": {"maximum": 20}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"a": 21},
+ "valid": true
+ },
+ {
+ "description": "a simultaneous match is valid",
+ "data": {"aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "multiple matches is valid",
+ "data": {"a": 21, "aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "an invalid due to one is invalid",
+ "data": {"a": "bar"},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to the other is invalid",
+ "data": {"aaaa": 31},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to both is invalid",
+ "data": {"aaa": "foo", "aaaa": 31},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "regexes are not anchored by default and are case sensitive",
+ "schema": {
+ "patternProperties": {
+ "[0-9]{2,}": { "type": "boolean" },
+ "X_": { "type": "string" }
+ }
+ },
+ "tests": [
+ {
+ "description": "non recognized members are ignored",
+ "data": { "answer 1": "42" },
+ "valid": true
+ },
+ {
+ "description": "recognized members are accounted for",
+ "data": { "a31b": null },
+ "valid": false
+ },
+ {
+ "description": "regexes are case sensitive",
+ "data": { "a_x_3": 3 },
+ "valid": true
+ },
+ {
+ "description": "regexes are case sensitive, 2",
+ "data": { "a_X_3": 3 },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/properties.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/properties.json
new file mode 100644
index 00000000000..cd1644dcd91
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/properties.json
@@ -0,0 +1,92 @@
+[
+ {
+ "description": "object properties validation",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "both properties present and valid is valid",
+ "data": {"foo": 1, "bar": "baz"},
+ "valid": true
+ },
+ {
+ "description": "one property invalid is invalid",
+ "data": {"foo": 1, "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "both properties invalid is invalid",
+ "data": {"foo": [], "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "doesn't invalidate other properties",
+ "data": {"quux": []},
+ "valid": true
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "properties, patternProperties, additionalProperties interaction",
+ "schema": {
+ "properties": {
+ "foo": {"type": "array", "maxItems": 3},
+ "bar": {"type": "array"}
+ },
+ "patternProperties": {"f.o": {"minItems": 2}},
+ "additionalProperties": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "property validates property",
+ "data": {"foo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "property invalidates property",
+ "data": {"foo": [1, 2, 3, 4]},
+ "valid": false
+ },
+ {
+ "description": "patternProperty invalidates property",
+ "data": {"foo": []},
+ "valid": false
+ },
+ {
+ "description": "patternProperty validates nonproperty",
+ "data": {"fxo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "patternProperty invalidates nonproperty",
+ "data": {"fxo": []},
+ "valid": false
+ },
+ {
+ "description": "additionalProperty ignores property",
+ "data": {"bar": []},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty validates others",
+ "data": {"quux": 3},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty invalidates others",
+ "data": {"quux": "foo"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/ref.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/ref.json
new file mode 100644
index 00000000000..7e805522492
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/ref.json
@@ -0,0 +1,159 @@
+[
+ {
+ "description": "root pointer ref",
+ "schema": {
+ "properties": {
+ "foo": {"$ref": "#"}
+ },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"foo": false},
+ "valid": true
+ },
+ {
+ "description": "recursive match",
+ "data": {"foo": {"foo": false}},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": false},
+ "valid": false
+ },
+ {
+ "description": "recursive mismatch",
+ "data": {"foo": {"bar": false}},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to object",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"$ref": "#/properties/foo"}
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"bar": 3},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": true},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to array",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"$ref": "#/items/0"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "match array",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "mismatch array",
+ "data": [1, "foo"],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "escaped pointer ref",
+ "schema": {
+ "tilda~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"},
+ "properties": {
+ "tilda": {"$ref": "#/tilda~0field"},
+ "slash": {"$ref": "#/slash~1field"},
+ "percent": {"$ref": "#/percent%25field"}
+ }
+ },
+ "tests": [
+ {
+ "description": "slash invalid",
+ "data": {"slash": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "tilda invalid",
+ "data": {"tilda": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "percent invalid",
+ "data": {"percent": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "slash valid",
+ "data": {"slash": 123},
+ "valid": true
+ },
+ {
+ "description": "tilda valid",
+ "data": {"tilda": 123},
+ "valid": true
+ },
+ {
+ "description": "percent valid",
+ "data": {"percent": 123},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "nested refs",
+ "schema": {
+ "definitions": {
+ "a": {"type": "integer"},
+ "b": {"$ref": "#/definitions/a"},
+ "c": {"$ref": "#/definitions/b"}
+ },
+ "$ref": "#/definitions/c"
+ },
+ "tests": [
+ {
+ "description": "nested ref valid",
+ "data": 5,
+ "valid": true
+ },
+ {
+ "description": "nested ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "remote ref, containing refs itself",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "remote ref valid",
+ "data": {"minLength": 1},
+ "valid": true
+ },
+ {
+ "description": "remote ref invalid",
+ "data": {"minLength": -1},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/refRemote.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/refRemote.json
new file mode 100644
index 00000000000..4ca804732c9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/refRemote.json
@@ -0,0 +1,74 @@
+[
+ {
+ "description": "remote ref",
+ "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "tests": [
+ {
+ "description": "remote ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "fragment within remote ref",
+ "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
+ "tests": [
+ {
+ "description": "remote fragment valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote fragment invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "ref within remote ref",
+ "schema": {
+ "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
+ },
+ "tests": [
+ {
+ "description": "ref within ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "ref within ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "change resolution scope",
+ "schema": {
+ "id": "http://localhost:1234/",
+ "items": {
+ "id": "folder/",
+ "items": {"$ref": "folderInteger.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "changed scope ref valid",
+ "data": [[1]],
+ "valid": true
+ },
+ {
+ "description": "changed scope ref invalid",
+ "data": [["a"]],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/required.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/required.json
new file mode 100644
index 00000000000..612f73f3472
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/required.json
@@ -0,0 +1,39 @@
+[
+ {
+ "description": "required validation",
+ "schema": {
+ "properties": {
+ "foo": {},
+ "bar": {}
+ },
+ "required": ["foo"]
+ },
+ "tests": [
+ {
+ "description": "present required property is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "non-present required property is invalid",
+ "data": {"bar": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "required default validation",
+ "schema": {
+ "properties": {
+ "foo": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required by default",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/type.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/type.json
new file mode 100644
index 00000000000..db42a44d3fa
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/type.json
@@ -0,0 +1,330 @@
+[
+ {
+ "description": "integer type matches integers",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "an integer is an integer",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is not an integer",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an integer",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an integer",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not an integer",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an integer",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an integer",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "number type matches numbers",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "an integer is a number",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is a number",
+ "data": 1.1,
+ "valid": true
+ },
+ {
+ "description": "a string is not a number",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a number",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a number",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a number",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a number",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "string type matches strings",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "1 is not a string",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a string",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is a string",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "an object is not a string",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a string",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a string",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a string",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "object type matches objects",
+ "schema": {"type": "object"},
+ "tests": [
+ {
+ "description": "an integer is not an object",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an object",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an object",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is an object",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "an array is not an object",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an object",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an object",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "array type matches arrays",
+ "schema": {"type": "array"},
+ "tests": [
+ {
+ "description": "an integer is not an array",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an array",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an array",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an array",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is an array",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "a boolean is not an array",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an array",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "boolean type matches booleans",
+ "schema": {"type": "boolean"},
+ "tests": [
+ {
+ "description": "an integer is not a boolean",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a boolean",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not a boolean",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a boolean",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a boolean",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is a boolean",
+ "data": true,
+ "valid": true
+ },
+ {
+ "description": "null is not a boolean",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "null type matches only the null object",
+ "schema": {"type": "null"},
+ "tests": [
+ {
+ "description": "an integer is not null",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not null",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not null",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not null",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not null",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not null",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple types can be specified in an array",
+ "schema": {"type": ["integer", "string"]},
+ "tests": [
+ {
+ "description": "an integer is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "a float is invalid",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "an object is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is invalid",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is invalid",
+ "data": null,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json
new file mode 100644
index 00000000000..c1f4ab99c9a
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json
@@ -0,0 +1,79 @@
+[
+ {
+ "description": "uniqueItems validation",
+ "schema": {"uniqueItems": true},
+ "tests": [
+ {
+ "description": "unique array of integers is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of integers is invalid",
+ "data": [1, 1],
+ "valid": false
+ },
+ {
+ "description": "numbers are unique if mathematically unequal",
+ "data": [1.0, 1.00, 1],
+ "valid": false
+ },
+ {
+ "description": "unique array of objects is valid",
+ "data": [{"foo": "bar"}, {"foo": "baz"}],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of objects is invalid",
+ "data": [{"foo": "bar"}, {"foo": "bar"}],
+ "valid": false
+ },
+ {
+ "description": "unique array of nested objects is valid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : false}}}
+ ],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of nested objects is invalid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : true}}}
+ ],
+ "valid": false
+ },
+ {
+ "description": "unique array of arrays is valid",
+ "data": [["foo"], ["bar"]],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of arrays is invalid",
+ "data": [["foo"], ["foo"]],
+ "valid": false
+ },
+ {
+ "description": "1 and true are unique",
+ "data": [1, true],
+ "valid": true
+ },
+ {
+ "description": "0 and false are unique",
+ "data": [0, false],
+ "valid": true
+ },
+ {
+ "description": "unique heterogeneous types are valid",
+ "data": [{}, [1], true, null, 1],
+ "valid": true
+ },
+ {
+ "description": "non-unique heterogeneous types are invalid",
+ "data": [{}, [1], true, null, {}, 1],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/3rdparty/rapidjson/bin/jsonschema/tox.ini b/3rdparty/rapidjson/bin/jsonschema/tox.ini
new file mode 100644
index 00000000000..5301222a840
--- /dev/null
+++ b/3rdparty/rapidjson/bin/jsonschema/tox.ini
@@ -0,0 +1,8 @@
+[tox]
+minversion = 1.6
+envlist = py27
+skipsdist = True
+
+[testenv]
+deps = jsonschema
+commands = {envpython} bin/jsonschema_suite check
diff --git a/3rdparty/rapidjson/bin/types/booleans.json b/3rdparty/rapidjson/bin/types/booleans.json
new file mode 100644
index 00000000000..2dcbb5fe876
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/booleans.json
@@ -0,0 +1,102 @@
+[
+ true,
+ true,
+ false,
+ false,
+ true,
+ true,
+ true,
+ false,
+ false,
+ true,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ true,
+ true,
+ false,
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ false,
+ true,
+ false,
+ false,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ true,
+ true,
+ false,
+ true,
+ false,
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ true,
+ false,
+ false,
+ true,
+ false
+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/types/floats.json b/3rdparty/rapidjson/bin/types/floats.json
new file mode 100644
index 00000000000..12b94a11dc4
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/floats.json
@@ -0,0 +1,102 @@
+[
+ 135.747111636,
+ 123.377054008,
+ 140.527504552,
+ -72.299143906,
+ -23.851678949,
+ 73.586193519,
+ -158.299382442,
+ 177.477876032,
+ 32.268518982,
+ -139.560009969,
+ 115.203105183,
+ -106.025823607,
+ 167.224138231,
+ 103.378383732,
+ -97.498486285,
+ 18.184723416,
+ 69.137075711,
+ 33.849002681,
+ -120.185228215,
+ -20.841408615,
+ -172.659492727,
+ -2.691464061,
+ 22.426164066,
+ -98.416909437,
+ -31.603082708,
+ -85.072296561,
+ 108.620987395,
+ -43.127078238,
+ -126.473562057,
+ -158.595489097,
+ -57.890678254,
+ -13.254016573,
+ -85.024504709,
+ 171.663552644,
+ -146.495558248,
+ -10.606748276,
+ -118.786969354,
+ 153.352057804,
+ -45.215545083,
+ 37.038725288,
+ 106.344071897,
+ -64.607402031,
+ 85.148030911,
+ 28.897784566,
+ 39.51082061,
+ 20.450382102,
+ -113.174943618,
+ 71.60785784,
+ -168.202648062,
+ -157.338200017,
+ 10.879588527,
+ -114.261694831,
+ -5.622927072,
+ -173.330830616,
+ -29.47002003,
+ -39.829034201,
+ 50.031545162,
+ 82.815735508,
+ -119.188760828,
+ -48.455928081,
+ 163.964263034,
+ 46.30378861,
+ -26.248889762,
+ -47.354615322,
+ 155.388677633,
+ -166.710356904,
+ 42.987233558,
+ 144.275297374,
+ 37.394383186,
+ -122.550388725,
+ 177.469945914,
+ 101.104677413,
+ 109.429869885,
+ -104.919625624,
+ 147.522756541,
+ -81.294703727,
+ 122.744731363,
+ 81.803603684,
+ 26.321556167,
+ 147.045441354,
+ 147.256895816,
+ -174.211095908,
+ 52.518769316,
+ -78.58250334,
+ -173.356685435,
+ -107.728209264,
+ -69.982325771,
+ -113.776095893,
+ -35.785267074,
+ -105.748545976,
+ -30.206523864,
+ -76.185311723,
+ -126.400112781,
+ -26.864958639,
+ 56.840053629,
+ 93.781553535,
+ -116.002949803,
+ -46.617140948,
+ 176.846840093,
+ -144.24821335
+]
diff --git a/3rdparty/rapidjson/bin/types/guids.json b/3rdparty/rapidjson/bin/types/guids.json
new file mode 100644
index 00000000000..9d7f5dbc8f9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/guids.json
@@ -0,0 +1,102 @@
+[
+ "d35bf0d4-8d8f-4e17-a5c3-ad9bfd675266",
+ "db402774-eeb6-463b-9986-c458c44d8b5a",
+ "2a2e4101-b5f2-40b8-8750-e03f01661e60",
+ "76787cfa-f4eb-4d62-aaad-e1d588d00ad5",
+ "fd73894b-b500-4a7c-888c-06b5bd9cec65",
+ "cce1862a-cf31-4ef2-9e23-f1d23b4e6163",
+ "00a98bb0-2b6e-4368-8512-71c21aa87db7",
+ "ab9a8d69-cec7-4550-bd35-3ed678e22782",
+ "f18b48e1-5114-4fbe-9652-579e8d66950e",
+ "4efe3baa-7ac5-4d6a-a839-6b9cfe825764",
+ "b4aec119-5b0a-434c-b388-109816c482a5",
+ "e0ef0cbb-127a-4a28-9831-5741b4295275",
+ "d50286a5-cb7b-4c9e-be99-f214439bae8c",
+ "a981094c-f1ac-42ed-a9fa-86404c7210ff",
+ "2a34ee57-5815-4829-b77b-eeebaa8fe340",
+ "a0530d44-48f8-4eff-b9ea-8810c4308351",
+ "c6f91509-83e1-4ea1-9680-e667fbfd56ee",
+ "cab11402-dcdd-4454-b190-6da124947395",
+ "283d159c-2b18-4856-b4c7-5059252eaa15",
+ "146157c6-72a8-4051-9991-cb6ea6743d81",
+ "aef6f269-7306-4bd2-83f7-6d5605b5dc9a",
+ "37fe6027-d638-4017-80a9-e7b0567b278e",
+ "5003d731-33fb-4159-af61-d76348a44079",
+ "e0e06979-5f80-4713-9fe0-8a4d60dc89f8",
+ "7e85bdc3-0345-4cb6-9398-ccab06e79976",
+ "f2ebf5af-6568-4ffe-a46d-403863fd4b66",
+ "e0b5bb1c-b4dd-4535-9a9e-3c73f1167d46",
+ "c852d20b-6bcb-4b12-bd57-308296c64c5a",
+ "7ac3ae82-1818-49cd-a8a4-5ac77dfafd46",
+ "138004a9-76e2-4ad7-bd42-e74dabdbb803",
+ "ab25b5be-96be-45b0-b765-947b40ec36a6",
+ "08404734-fd57-499e-a4cf-71e9ec782ede",
+ "8dfdeb16-248b-4a21-bf89-2e22b11a4101",
+ "a0e44ef0-3b09-41e8-ad5d-ed8e6a1a2a67",
+ "a7981e49-188d-414a-9779-b1ad91e599d1",
+ "329186c0-bf27-4208-baf7-c0a0a5a2d5b7",
+ "cb5f3381-d33e-4b30-b1a9-f482623cad33",
+ "15031262-ca73-4e3c-bd0a-fcf89bdf0caf",
+ "6d7333d1-2e8c-4d78-bfde-5be47e70eb13",
+ "acaa160c-670a-4e8f-ac45-49416e77d5f9",
+ "228f87eb-cde4-4106-808b-2dbf3c7b6d2e",
+ "2ff830a3-5445-4d8e-b161-bddd30666697",
+ "f488bedd-ff6e-4108-b9a7-07f6da62f476",
+ "2e12b846-0a34-478e-adf7-a438493803e6",
+ "6686b8ef-7446-4d86-bd8c-df24119e3bfe",
+ "e474a5c5-5793-4d41-b4ab-5423acc56ef1",
+ "ac046573-e718-44dc-a0dc-9037eeaba6a9",
+ "6b0e9099-cf53-4d5a-8a71-977528628fcf",
+ "d51a3f22-0ff9-4087-ba9b-fcee2a2d8ade",
+ "bdc01286-3511-4d22-bfb8-76d01203d366",
+ "ca44eb84-17ff-4f27-8f1e-1bd25f4e8725",
+ "4e9a8c2f-be0b-4913-92d2-c801b9a50d04",
+ "7685d231-dadd-4041-9165-898397438ab7",
+ "86f0bf26-d66a-44d8-99f5-d6768addae3b",
+ "2ca1167c-72ba-45a0-aa42-faf033db0d0b",
+ "199a1182-ea55-49ff-ba51-71c29cdd0aac",
+ "be6a4dd2-c821-4aa0-8b83-d64d6644b5b2",
+ "4c5f4781-7f80-4daa-9c20-76b183000514",
+ "513b31bd-54fb-4d12-a427-42a7c13ff8e1",
+ "8e211bcb-d76c-4012-83ad-74dd7d23b687",
+ "44d5807e-0501-4f66-8779-e244d4fdca0a",
+ "db8cd555-0563-4b7b-b00c-eada300a7065",
+ "cb14d0c9-46cc-4797-bd3a-752b05629f07",
+ "4f68b3ef-ac9b-47a0-b6d7-57f398a5c6a5",
+ "77221aae-1bcf-471c-be45-7f31f733f9d6",
+ "42a7cac8-9e80-4c45-8c71-511d863c98ea",
+ "f9018d22-b82c-468c-bdb5-8864d5964801",
+ "75f4e9b8-62a2-4f21-ad8a-e19eff0419bc",
+ "9b7385c8-8653-4184-951c-b0ac1b36b42e",
+ "571018aa-ffbf-4b42-a16d-07b57a7f5f0e",
+ "35de4a2f-6bf1-45aa-b820-2a27ea833e44",
+ "0b8edb20-3bb4-4cb4-b089-31957466dbab",
+ "97da4778-9a7b-4140-a545-968148c81fb7",
+ "969f326c-8f2a-47c5-b41c-d9c2f06c9b9d",
+ "ae211037-8b53-4b17-bfc8-c06fc7774409",
+ "12c5c3c4-0bd5-45d3-bc1d-d04a3c65d3e6",
+ "ec02024f-ce43-4dd3-8169-a59f7baee043",
+ "5b6afe77-ce48-47ca-90a0-25cd10ca5ffd",
+ "2e3a61d4-6b8f-4d2f-ba86-878b4012efd8",
+ "19a88a67-a5d3-4647-898f-1cde07bce040",
+ "6db6f420-b5c8-48b9-bbb2-8864fe6fed65",
+ "5a45dbde-7b53-4f6b-b864-e3b63be3708a",
+ "c878321b-8a02-4239-9981-15760c2e7d15",
+ "4e36687f-8bf6-4b12-b496-3a8e382d067e",
+ "a59a63cd-43c0-4c6e-b208-6dbca86f8176",
+ "303308c4-2e4a-45b5-8bf3-3e66e9ad05a1",
+ "8b58fdf1-43a6-4c98-9547-6361b50791af",
+ "a3563591-72ed-42b5-8e41-bac1d76d70cf",
+ "38db8c78-3739-4f6e-8313-de4138082114",
+ "86615bea-7e73-4daf-95da-ae6b9eee1bbb",
+ "35d38e3e-076e-40dd-9aa8-05be2603bd59",
+ "9f84c62d-b454-4ba3-8c19-a01878985cdc",
+ "6721bbae-d765-4a06-8289-6fe46a1bf943",
+ "0837796f-d0dd-4e50-9b7c-1983e6cc7c48",
+ "021eb7d7-e869-49b9-80c3-9dd16ce2d981",
+ "819c56f8-e040-475d-aad5-c6d5e98b20aa",
+ "3a61ef02-735e-4229-937d-b3777a3f4e1f",
+ "79dfab84-12e6-4ec8-bfc8-460ae71e4eca",
+ "a106fabf-e149-476c-8053-b62388b6eb57",
+ "9a3900a5-bfb4-4de0-baa5-253a8bd0b634"
+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/types/integers.json b/3rdparty/rapidjson/bin/types/integers.json
new file mode 100644
index 00000000000..5dd05e097a4
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/integers.json
@@ -0,0 +1,102 @@
+[
+ 8125686,
+ 8958709,
+ 5976222,
+ 1889524,
+ 7968493,
+ 1357486,
+ 118415,
+ 7081097,
+ 4635968,
+ 7555332,
+ 2270233,
+ 3428352,
+ 8699968,
+ 2087333,
+ 7861337,
+ 7554440,
+ 2017031,
+ 7981692,
+ 6060687,
+ 1877715,
+ 3297474,
+ 8373177,
+ 6158629,
+ 7853641,
+ 3004441,
+ 9650406,
+ 2695251,
+ 1180761,
+ 4988426,
+ 6043805,
+ 8063373,
+ 6103218,
+ 2848339,
+ 8188690,
+ 9235573,
+ 5949816,
+ 6116081,
+ 6471138,
+ 3354531,
+ 4787414,
+ 9660600,
+ 942529,
+ 7278535,
+ 7967399,
+ 554292,
+ 1436493,
+ 267319,
+ 2606657,
+ 7900601,
+ 4276634,
+ 7996757,
+ 8544466,
+ 7266469,
+ 3301373,
+ 4005350,
+ 6437652,
+ 7717672,
+ 7126292,
+ 8588394,
+ 2127902,
+ 7410190,
+ 1517806,
+ 4583602,
+ 3123440,
+ 7747613,
+ 5029464,
+ 9834390,
+ 3087227,
+ 4913822,
+ 7550487,
+ 4518144,
+ 5862588,
+ 1778599,
+ 9493290,
+ 5588455,
+ 3638706,
+ 7394293,
+ 4294719,
+ 3837830,
+ 6381878,
+ 7175866,
+ 8575492,
+ 1415229,
+ 1453733,
+ 6972404,
+ 9782571,
+ 4234063,
+ 7117418,
+ 7293130,
+ 8057071,
+ 9345285,
+ 7626648,
+ 3358911,
+ 4574537,
+ 9371826,
+ 7627107,
+ 6154093,
+ 5392367,
+ 5398105,
+ 6956377
+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/types/mixed.json b/3rdparty/rapidjson/bin/types/mixed.json
new file mode 100644
index 00000000000..43e9a1d7be0
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/mixed.json
@@ -0,0 +1,592 @@
+[
+ {
+ "favoriteFruit": "banana",
+ "greeting": "Hello, Kim! You have 10 unread messages.",
+ "friends": [
+ {
+ "name": "Higgins Rodriquez",
+ "id": 0
+ },
+ {
+ "name": "James Floyd",
+ "id": 1
+ },
+ {
+ "name": "Gay Stewart",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "pariatur",
+ "ad",
+ "eiusmod",
+ "sit",
+ "et",
+ "velit",
+ "culpa"
+ ],
+ "longitude": -57.919246,
+ "latitude": -36.022812,
+ "registered": "Friday, March 21, 2014 9:13 PM",
+ "about": "Laborum nulla aliquip ullamco proident excepteur est officia ipsum. Eiusmod exercitation minim ex do labore reprehenderit aliqua minim qui excepteur reprehenderit cupidatat. Sint enim exercitation duis id consequat nisi enim magna. Commodo aliqua id ipsum sit magna enim. Veniam officia in labore fugiat veniam ea laboris ex veniam duis.\r\n",
+ "address": "323 Pulaski Street, Ronco, North Carolina, 7701",
+ "phone": "+1 (919) 438-2678",
+ "email": "kim.griffith@cipromox.biz",
+ "company": "CIPROMOX",
+ "name": {
+ "last": "Griffith",
+ "first": "Kim"
+ },
+ "eyeColor": "green",
+ "age": 26,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$1,283.55",
+ "isActive": false,
+ "guid": "10ab0392-c5e2-48a3-9473-aa725bad892d",
+ "index": 0,
+ "_id": "551b91198238a0bcf9a41133"
+ },
+ {
+ "favoriteFruit": "banana",
+ "greeting": "Hello, Skinner! You have 9 unread messages.",
+ "friends": [
+ {
+ "name": "Rhonda Justice",
+ "id": 0
+ },
+ {
+ "name": "Audra Castaneda",
+ "id": 1
+ },
+ {
+ "name": "Vicky Chavez",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "dolore",
+ "enim",
+ "sit",
+ "non",
+ "exercitation",
+ "fugiat",
+ "adipisicing"
+ ],
+ "longitude": -60.291407,
+ "latitude": -84.619318,
+ "registered": "Friday, February 7, 2014 3:17 AM",
+ "about": "Consectetur eiusmod laboris dolore est ullamco nulla in velit quis esse Lorem. Amet aliqua sunt aute occaecat veniam officia in duis proident aliqua cupidatat mollit. Sint eu qui anim duis ut anim duis eu cillum. Cillum nostrud adipisicing tempor Lorem commodo sit in ad qui non et irure qui. Labore eu aliquip id duis eiusmod veniam.\r\n",
+ "address": "347 Autumn Avenue, Fidelis, Puerto Rico, 543",
+ "phone": "+1 (889) 457-2319",
+ "email": "skinner.maddox@moltonic.co.uk",
+ "company": "MOLTONIC",
+ "name": {
+ "last": "Maddox",
+ "first": "Skinner"
+ },
+ "eyeColor": "green",
+ "age": 22,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$3,553.10",
+ "isActive": false,
+ "guid": "cfbc2fb6-2641-4388-b06d-ec0212cfac1e",
+ "index": 1,
+ "_id": "551b91197e0abe92d6642700"
+ },
+ {
+ "favoriteFruit": "strawberry",
+ "greeting": "Hello, Reynolds! You have 5 unread messages.",
+ "friends": [
+ {
+ "name": "Brady Valdez",
+ "id": 0
+ },
+ {
+ "name": "Boyer Golden",
+ "id": 1
+ },
+ {
+ "name": "Gladys Knapp",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "commodo",
+ "eiusmod",
+ "cupidatat",
+ "et",
+ "occaecat",
+ "proident",
+ "Lorem"
+ ],
+ "longitude": 140.866287,
+ "latitude": 1.401032,
+ "registered": "Monday, October 20, 2014 8:01 AM",
+ "about": "Deserunt elit consequat ea dolor pariatur aute consectetur et nulla ipsum ad. Laboris occaecat ipsum ad duis et esse ea ut voluptate. Ex magna consequat pariatur amet. Quis excepteur non mollit dolore cillum dolor ex esse veniam esse deserunt non occaecat veniam. Sit amet proident proident amet. Nisi est id ut ut adipisicing esse fugiat non dolor aute.\r\n",
+ "address": "872 Montague Terrace, Haena, Montana, 3106",
+ "phone": "+1 (974) 410-2655",
+ "email": "reynolds.sanford@combot.biz",
+ "company": "COMBOT",
+ "name": {
+ "last": "Sanford",
+ "first": "Reynolds"
+ },
+ "eyeColor": "green",
+ "age": 21,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$3,664.47",
+ "isActive": true,
+ "guid": "f9933a9c-c41a-412f-a18d-e727c569870b",
+ "index": 2,
+ "_id": "551b91197f170b65413a06e3"
+ },
+ {
+ "favoriteFruit": "banana",
+ "greeting": "Hello, Neva! You have 7 unread messages.",
+ "friends": [
+ {
+ "name": "Clara Cotton",
+ "id": 0
+ },
+ {
+ "name": "Ray Gates",
+ "id": 1
+ },
+ {
+ "name": "Jacobs Reese",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "magna",
+ "labore",
+ "incididunt",
+ "velit",
+ "ea",
+ "et",
+ "eiusmod"
+ ],
+ "longitude": -133.058479,
+ "latitude": 87.803677,
+ "registered": "Friday, May 9, 2014 5:41 PM",
+ "about": "Do duis occaecat ut officia occaecat officia nostrud reprehenderit ex excepteur aute anim in reprehenderit. Cupidatat nulla eiusmod nulla non minim veniam aute nulla deserunt adipisicing consectetur veniam. Sit consequat ex laboris aliqua labore consectetur tempor proident consequat est. Fugiat quis esse culpa aliquip. Excepteur laborum aliquip sunt eu cupidatat magna eiusmod amet nisi labore aliquip. Ut consectetur esse aliquip exercitation nulla ex occaecat elit do ex eiusmod deserunt. Ex eu voluptate minim deserunt fugiat minim est occaecat ad Lorem nisi.\r\n",
+ "address": "480 Eagle Street, Fostoria, Oklahoma, 2614",
+ "phone": "+1 (983) 439-3000",
+ "email": "neva.barker@pushcart.us",
+ "company": "PUSHCART",
+ "name": {
+ "last": "Barker",
+ "first": "Neva"
+ },
+ "eyeColor": "brown",
+ "age": 36,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$3,182.24",
+ "isActive": true,
+ "guid": "52489849-78e1-4b27-8b86-e3e5ab2b7dc8",
+ "index": 3,
+ "_id": "551b9119a13061c083c878d5"
+ },
+ {
+ "favoriteFruit": "banana",
+ "greeting": "Hello, Rodgers! You have 6 unread messages.",
+ "friends": [
+ {
+ "name": "Marguerite Conway",
+ "id": 0
+ },
+ {
+ "name": "Margarita Cunningham",
+ "id": 1
+ },
+ {
+ "name": "Carmela Gallagher",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "ipsum",
+ "magna",
+ "amet",
+ "elit",
+ "sit",
+ "occaecat",
+ "elit"
+ ],
+ "longitude": -125.436981,
+ "latitude": 19.868524,
+ "registered": "Tuesday, July 8, 2014 8:09 PM",
+ "about": "In cillum esse tempor do magna id ad excepteur ex nostrud mollit deserunt aliqua. Minim aliqua commodo commodo consectetur exercitation nulla nisi dolore aliqua in. Incididunt deserunt mollit nostrud excepteur. Ipsum fugiat anim deserunt Lorem aliquip nisi consequat eu minim in ex duis.\r\n",
+ "address": "989 Varanda Place, Duryea, Palau, 3972",
+ "phone": "+1 (968) 578-2974",
+ "email": "rodgers.conner@frenex.net",
+ "company": "FRENEX",
+ "name": {
+ "last": "Conner",
+ "first": "Rodgers"
+ },
+ "eyeColor": "blue",
+ "age": 23,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$1,665.17",
+ "isActive": true,
+ "guid": "ed3b2374-5afe-4fca-9325-8a7bbc9f81a0",
+ "index": 4,
+ "_id": "551b91197bcedb1b56a241ce"
+ },
+ {
+ "favoriteFruit": "strawberry",
+ "greeting": "Hello, Mari! You have 10 unread messages.",
+ "friends": [
+ {
+ "name": "Irwin Boyd",
+ "id": 0
+ },
+ {
+ "name": "Dejesus Flores",
+ "id": 1
+ },
+ {
+ "name": "Lane Mcmahon",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "esse",
+ "aliquip",
+ "excepteur",
+ "dolor",
+ "ex",
+ "commodo",
+ "anim"
+ ],
+ "longitude": -17.038176,
+ "latitude": 17.154663,
+ "registered": "Sunday, April 6, 2014 4:46 AM",
+ "about": "Excepteur veniam occaecat sint nulla magna in in officia elit. Eiusmod qui dolor fugiat tempor in minim esse officia minim consequat. Lorem ullamco labore proident ipsum id pariatur fugiat consectetur anim cupidatat qui proident non ipsum.\r\n",
+ "address": "563 Hendrickson Street, Westwood, South Dakota, 4959",
+ "phone": "+1 (980) 434-3976",
+ "email": "mari.fleming@beadzza.org",
+ "company": "BEADZZA",
+ "name": {
+ "last": "Fleming",
+ "first": "Mari"
+ },
+ "eyeColor": "blue",
+ "age": 21,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$1,948.04",
+ "isActive": true,
+ "guid": "6bd02166-3b1f-4ed8-84c9-ed96cbf12abc",
+ "index": 5,
+ "_id": "551b9119b359ff6d24846f77"
+ },
+ {
+ "favoriteFruit": "strawberry",
+ "greeting": "Hello, Maxine! You have 7 unread messages.",
+ "friends": [
+ {
+ "name": "Sullivan Stark",
+ "id": 0
+ },
+ {
+ "name": "Underwood Mclaughlin",
+ "id": 1
+ },
+ {
+ "name": "Kristy Carlson",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "commodo",
+ "ipsum",
+ "quis",
+ "non",
+ "est",
+ "mollit",
+ "exercitation"
+ ],
+ "longitude": -105.40635,
+ "latitude": 37.197993,
+ "registered": "Tuesday, January 20, 2015 12:30 AM",
+ "about": "Proident ullamco Lorem est consequat consectetur non eiusmod esse nostrud pariatur eiusmod enim exercitation eiusmod. Consequat duis elit elit minim ullamco et dolor eu minim do tempor esse consequat excepteur. Mollit dolor do voluptate nostrud quis anim cillum velit tempor eiusmod adipisicing tempor do culpa. Eu magna dolor sit amet nisi do laborum dolore nisi. Deserunt ipsum et deserunt non nisi.\r\n",
+ "address": "252 Boulevard Court, Brenton, Tennessee, 9444",
+ "phone": "+1 (950) 466-3377",
+ "email": "maxine.moreno@zentia.tv",
+ "company": "ZENTIA",
+ "name": {
+ "last": "Moreno",
+ "first": "Maxine"
+ },
+ "eyeColor": "brown",
+ "age": 24,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$1,200.24",
+ "isActive": false,
+ "guid": "ce307a37-ca1f-43f5-b637-dca2605712be",
+ "index": 6,
+ "_id": "551b91195a6164b2e35f6dc8"
+ },
+ {
+ "favoriteFruit": "strawberry",
+ "greeting": "Hello, Helga! You have 5 unread messages.",
+ "friends": [
+ {
+ "name": "Alicia Vance",
+ "id": 0
+ },
+ {
+ "name": "Vinson Phelps",
+ "id": 1
+ },
+ {
+ "name": "Francisca Kelley",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "nostrud",
+ "eiusmod",
+ "dolore",
+ "officia",
+ "sint",
+ "non",
+ "qui"
+ ],
+ "longitude": -7.275151,
+ "latitude": 75.54202,
+ "registered": "Wednesday, October 1, 2014 6:35 PM",
+ "about": "Quis duis ullamco velit qui. Consectetur non adipisicing id magna anim. Deserunt est officia qui esse. Et do pariatur incididunt anim ad mollit non. Et eiusmod sunt fugiat elit mollit ad excepteur anim nisi laboris eiusmod aliquip aliquip.\r\n",
+ "address": "981 Bush Street, Beaulieu, Vermont, 3775",
+ "phone": "+1 (956) 506-3807",
+ "email": "helga.burch@synkgen.name",
+ "company": "SYNKGEN",
+ "name": {
+ "last": "Burch",
+ "first": "Helga"
+ },
+ "eyeColor": "blue",
+ "age": 22,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$3,827.89",
+ "isActive": false,
+ "guid": "ff5dfea0-1052-4ef2-8b66-4dc1aad0a4fb",
+ "index": 7,
+ "_id": "551b911946be8358ae40e90e"
+ },
+ {
+ "favoriteFruit": "banana",
+ "greeting": "Hello, Shaw! You have 5 unread messages.",
+ "friends": [
+ {
+ "name": "Christian Cardenas",
+ "id": 0
+ },
+ {
+ "name": "Cohen Pennington",
+ "id": 1
+ },
+ {
+ "name": "Mary Lindsay",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "occaecat",
+ "ut",
+ "occaecat",
+ "magna",
+ "exercitation",
+ "incididunt",
+ "irure"
+ ],
+ "longitude": -89.102972,
+ "latitude": 89.489596,
+ "registered": "Thursday, August 21, 2014 5:00 PM",
+ "about": "Amet cupidatat quis velit aute Lorem consequat pariatur mollit deserunt et sint culpa excepteur duis. Enim proident duis qui ex tempor sunt nostrud occaecat. Officia sit veniam mollit eiusmod minim do aute eiusmod fugiat qui anim adipisicing in laboris. Do tempor reprehenderit sunt laborum esse irure dolor ad consectetur aute sit id ipsum. Commodo et voluptate anim consequat do. Minim laborum ad veniam ad minim incididunt excepteur excepteur aliqua.\r\n",
+ "address": "237 Pierrepont Street, Herbster, New York, 3490",
+ "phone": "+1 (976) 455-2880",
+ "email": "shaw.zamora@shadease.me",
+ "company": "SHADEASE",
+ "name": {
+ "last": "Zamora",
+ "first": "Shaw"
+ },
+ "eyeColor": "blue",
+ "age": 38,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$3,440.82",
+ "isActive": false,
+ "guid": "ac5fdb0e-e1fb-427e-881d-da461be0d1ca",
+ "index": 8,
+ "_id": "551b9119af0077bc28a2de25"
+ },
+ {
+ "favoriteFruit": "apple",
+ "greeting": "Hello, Melissa! You have 5 unread messages.",
+ "friends": [
+ {
+ "name": "Marion Villarreal",
+ "id": 0
+ },
+ {
+ "name": "Kate Rose",
+ "id": 1
+ },
+ {
+ "name": "Hines Simon",
+ "id": 2
+ }
+ ],
+ "range": [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9
+ ],
+ "tags": [
+ "amet",
+ "veniam",
+ "mollit",
+ "ad",
+ "cupidatat",
+ "deserunt",
+ "Lorem"
+ ],
+ "longitude": -52.735052,
+ "latitude": 16.258838,
+ "registered": "Wednesday, April 16, 2014 7:56 PM",
+ "about": "Aute ut culpa eiusmod tempor duis dolor tempor incididunt. Nisi non proident excepteur eiusmod incididunt nisi minim irure sit. In veniam commodo deserunt proident reprehenderit et consectetur ullamco quis nulla cupidatat.\r\n",
+ "address": "642 Halsey Street, Blandburg, Kansas, 6761",
+ "phone": "+1 (941) 539-3851",
+ "email": "melissa.vaughn@memora.io",
+ "company": "MEMORA",
+ "name": {
+ "last": "Vaughn",
+ "first": "Melissa"
+ },
+ "eyeColor": "brown",
+ "age": 24,
+ "picture": "http://placehold.it/32x32",
+ "balance": "$2,399.44",
+ "isActive": true,
+ "guid": "1769f022-a7f1-4a69-bf4c-f5a5ebeab2d1",
+ "index": 9,
+ "_id": "551b9119b607c09c7ffc3b8a"
+ }
+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/types/nulls.json b/3rdparty/rapidjson/bin/types/nulls.json
new file mode 100644
index 00000000000..7a636ec87cd
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/nulls.json
@@ -0,0 +1,102 @@
+[
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/types/paragraphs.json b/3rdparty/rapidjson/bin/types/paragraphs.json
new file mode 100644
index 00000000000..8ab3e1c561c
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/paragraphs.json
@@ -0,0 +1,102 @@
+[
+ "Commodo ullamco cupidatat nisi sit proident ex. Cillum pariatur occaecat in officia do commodo nisi cillum tempor minim. Ad dolor ut et aliquip fugiat eu officia cupidatat occaecat consectetur eiusmod veniam enim officia.\r\n",
+ "Adipisicing cillum laborum nisi irure. Cillum dolor proident duis nulla qui mollit dolore reprehenderit mollit. Irure nulla dolor ipsum irure nulla quis laboris do.\r\n",
+ "Est adipisicing consectetur incididunt in. Occaecat ea magna ex consequat irure sit laborum cillum officia magna sunt do exercitation aliquip. Laboris id aute in dolore reprehenderit voluptate non deserunt laborum.\r\n",
+ "Consectetur eu aute est est occaecat adipisicing sint enim dolor eu. Tempor amet id non mollit eu consectetur cillum duis. Eu labore velit nulla ipsum commodo consequat aliquip. Cupidatat commodo dolore mollit enim sit excepteur nisi duis laboris deserunt esse.\r\n",
+ "Incididunt ullamco est fugiat enim fugiat. Do sit mollit anim ad excepteur eu laboris exercitation officia labore nulla ut. Voluptate non voluptate cillum sit et voluptate anim duis velit consequat aliquip dolor. Elit et et esse laboris consectetur officia eiusmod aliquip nisi est. Qui labore dolore ad dolor.\r\n",
+ "Anim adipisicing est irure proident sit officia ullamco voluptate sunt consectetur duis mollit excepteur veniam. Nostrud ut duis aute exercitation officia et quis elit commodo elit tempor aute aliquip enim. Est officia non cillum consequat voluptate ipsum sit voluptate nulla id.\r\n",
+ "Ipsum enim consectetur aliquip nulla commodo ut ex aliqua elit duis do. Officia et sunt aliqua dolor minim voluptate veniam esse elit enim. Adipisicing reprehenderit duis ex magna non in fugiat sunt ipsum nostrud fugiat aliquip. Labore voluptate id officia voluptate eu. Magna do nostrud excepteur sunt aliqua adipisicing qui.\r\n",
+ "Est occaecat non non cupidatat laborum qui. Veniam sit est voluptate labore sit irure consectetur fugiat. Anim enim enim fugiat exercitation anim ad proident esse in aliqua. Laboris ut aute culpa ullamco.\r\n",
+ "Sit et aliquip cupidatat deserunt eiusmod sint aliquip occaecat nostrud aliqua elit commodo ut magna. Amet sit est deserunt id duis in officia pariatur cupidatat ex. Mollit duis est consequat nulla aute velit ipsum sit consectetur pariatur ut non ex ipsum. Tempor esse velit pariatur reprehenderit et nostrud commodo laborum mollit labore.\r\n",
+ "Aliquip irure quis esse aliquip. Ex non deserunt culpa aliqua ad anim occaecat ad. Lorem consectetur mollit eu consectetur est non nisi non ipsum. Qui veniam ullamco officia est ut excepteur. Nulla elit dolore cupidatat aliqua enim Lorem elit consequat eiusmod non aliqua eu in. Pariatur in culpa labore sint ipsum consectetur occaecat ad ex ipsum laboris aliquip officia. Non officia eiusmod nisi officia id id laboris deserunt sunt enim magna mollit sit.\r\n",
+ "Mollit velit laboris laborum nulla aliquip consequat Lorem non incididunt irure. Eu voluptate sint do consectetur tempor sit Lorem in. Laborum eiusmod nisi Lorem ipsum dolore do aute laborum occaecat aute sunt. Sit laborum in ea do ipsum officia irure cillum irure nisi laboris. Ad anim deserunt excepteur ea veniam eiusmod culpa velit veniam. Commodo incididunt ea Lorem eu enim esse nisi incididunt mollit.\r\n",
+ "Velit proident sunt aute dolore reprehenderit culpa. Pariatur reprehenderit commodo ad ea voluptate anim nulla ipsum eu irure fugiat aliqua et. Adipisicing incididunt anim excepteur voluptate minim qui culpa. Sunt veniam enim reprehenderit magna magna. Sit ad amet deserunt ut aute dolore ad minim.\r\n",
+ "Esse ullamco sunt mollit mollit. Eu enim dolore laboris cupidatat. Cupidatat adipisicing non aute exercitation fugiat. Non ut cillum labore fugiat aliquip ex duis quis consectetur ut nisi Lorem amet qui. Proident veniam amet qui reprehenderit duis qui. Nisi culpa sit occaecat ullamco occaecat laborum fugiat ut. Non duis deserunt culpa duis.\r\n",
+ "Id ipsum eiusmod laboris non est ipsum deserunt labore duis reprehenderit deserunt. Sint tempor fugiat eiusmod nostrud in ut laborum esse in nostrud sit deserunt nostrud reprehenderit. Cupidatat aliqua qui anim consequat eu quis consequat consequat elit ipsum pariatur. Cupidatat in dolore velit quis. Exercitation cillum ullamco ex consectetur commodo tempor incididunt exercitation labore ad dolore. Minim incididunt consequat adipisicing esse eu eu voluptate.\r\n",
+ "Anim sint eiusmod nisi anim do deserunt voluptate ut cillum eiusmod esse ex reprehenderit laborum. Dolore nulla excepteur duis excepteur. Magna nisi nostrud duis non commodo velit esse ipsum Lorem incididunt. Nulla enim consequat ad aliqua. Incididunt irure culpa nostrud ea aute ex sit non ad esse.\r\n",
+ "Ullamco nostrud cupidatat adipisicing anim fugiat mollit eu. Et ut eu in nulla consequat. Sunt do pariatur culpa non est.\r\n",
+ "Pariatur incididunt reprehenderit non qui excepteur cillum exercitation nisi occaecat ad. Lorem aliquip laborum commodo reprehenderit sint. Laboris qui ut veniam magna quis et et ullamco voluptate. Tempor reprehenderit deserunt consequat nisi. Esse duis sint in tempor. Amet aute cupidatat in sint et.\r\n",
+ "Est officia nisi dolore consequat irure et excepteur. Sit qui elit tempor magna qui cillum anim amet proident exercitation proident. Eu cupidatat laborum consectetur duis ullamco irure nulla. Adipisicing culpa non reprehenderit anim aute.\r\n",
+ "Eu est laborum culpa velit dolore non sunt. Tempor magna veniam ea sit non qui Lorem qui exercitation aliqua aliqua et excepteur eiusmod. Culpa aute anim proident culpa adipisicing duis tempor elit aliquip elit nulla laboris esse dolore. Sit adipisicing non dolor eiusmod occaecat cupidatat.\r\n",
+ "Culpa velit eu esse sunt. Laborum irure aliqua reprehenderit velit ipsum fugiat officia dolor ut aute officia deserunt. Ipsum sit quis fugiat nostrud aliqua cupidatat ex pariatur et. Cillum proident est irure nisi dolor aliqua deserunt esse occaecat velit dolor.\r\n",
+ "Exercitation nulla officia sit eiusmod cillum eu incididunt officia exercitation qui Lorem deserunt. Voluptate Lorem minim commodo laborum esse in duis excepteur do duis aliquip nisi voluptate consectetur. Amet tempor officia enim ex esse minim reprehenderit.\r\n",
+ "Laboris sint deserunt ad aute incididunt. Anim officia sunt elit qui laborum labore commodo irure non. Mollit adipisicing ullamco do aute nulla eu laborum et quis sint aute adipisicing amet. Aliqua officia irure nostrud duis ex.\r\n",
+ "Eiusmod ipsum aliqua reprehenderit esse est non aute id veniam eiusmod. Elit consequat ad sit tempor elit eu incididunt quis irure ad. Eu incididunt veniam consequat Lorem nostrud cillum officia ea consequat ad cillum. Non nisi irure cupidatat incididunt pariatur incididunt. Duis velit officia ad cillum qui. Aliquip consequat sint aute nisi cillum. Officia commodo nisi incididunt laborum nisi voluptate aliquip Lorem cupidatat anim consequat sit laboris.\r\n",
+ "Veniam cupidatat et incididunt mollit do ex voluptate veniam nostrud labore esse. Eiusmod irure sint fugiat esse. Aute irure consectetur ut mollit nulla sint esse. Lorem ut quis ex proident nostrud mollit nostrud ea duis duis in magna anim consectetur.\r\n",
+ "Irure culpa esse qui do dolor fugiat veniam ad. Elit commodo aute elit magna incididunt tempor pariatur velit irure pariatur cillum et ea ad. Ad consequat ea et ad minim ut sunt qui commodo voluptate. Laboris est aliquip anim reprehenderit eu officia et exercitation. Occaecat laboris cupidatat Lorem ullamco in nostrud commodo ipsum in quis esse ex.\r\n",
+ "Incididunt officia quis voluptate eiusmod esse nisi ipsum quis commodo. Eiusmod dolore tempor occaecat sit exercitation aliqua minim consequat minim mollit qui ad nisi. Aute quis irure adipisicing veniam nisi nisi velit deserunt incididunt anim nostrud.\r\n",
+ "Voluptate exercitation exercitation id minim excepteur excepteur mollit. Fugiat aute proident nulla ullamco ea. Nisi ea culpa duis dolore veniam anim tempor officia in dolore exercitation exercitation. Dolore quis cillum adipisicing sunt do nulla esse proident ad sint.\r\n",
+ "Laborum ut mollit sint commodo nulla laborum deserunt Lorem magna commodo mollit tempor deserunt ut. Qui aliquip commodo ea id. Consectetur dolor fugiat dolor excepteur eiusmod. Eu excepteur ex aute ex ex elit ex esse officia cillum exercitation. Duis ut labore ea nostrud excepteur. Reprehenderit labore aute sunt nisi quis Lorem officia. Ad aliquip cupidatat voluptate exercitation voluptate ad irure magna quis.\r\n",
+ "Tempor velit veniam sit labore elit minim do elit cillum eiusmod sunt excepteur nisi. Aliquip est deserunt excepteur duis fugiat incididunt veniam fugiat. Pariatur sit irure labore et minim non. Cillum quis aute anim sint laboris laboris ullamco exercitation nostrud. Nulla pariatur id laborum minim nisi est adipisicing irure.\r\n",
+ "Irure exercitation laboris nostrud in do consectetur ad. Magna aliqua Lorem culpa exercitation sint do culpa incididunt mollit eu exercitation. Elit tempor Lorem dolore enim deserunt. Anim et ullamco sint ullamco mollit cillum officia et. Proident incididunt laboris aliquip laborum sint veniam deserunt eu consequat deserunt voluptate laboris. Anim Lorem non laborum exercitation voluptate. Cupidatat reprehenderit culpa Lorem fugiat enim minim consectetur tempor quis ad reprehenderit laboris irure.\r\n",
+ "Deserunt elit mollit nostrud occaecat labore reprehenderit laboris ex. Esse reprehenderit adipisicing cillum minim in esse aliquip excepteur ex et nisi cillum quis. Cillum labore ut ex sunt. Occaecat proident et mollit magna consequat irure esse. Dolor do enim esse nisi ad.\r\n",
+ "Pariatur est anim cillum minim elit magna adipisicing quis tempor proident nisi laboris incididunt cupidatat. Nulla est adipisicing sit adipisicing id nostrud amet qui consequat eiusmod tempor voluptate ad. Adipisicing non magna sit occaecat magna mollit ad ex nulla velit ea pariatur. Irure labore ad ea exercitation ex cillum.\r\n",
+ "Lorem fugiat eu eu cillum nulla tempor sint. Lorem id officia nulla velit labore ut duis ad tempor non. Excepteur quis aute adipisicing nisi nisi consectetur aliquip enim Lorem id ullamco cillum sint voluptate. Qui aliquip incididunt tempor aliqua voluptate labore reprehenderit. Veniam eiusmod elit occaecat voluptate tempor culpa consectetur ea ut exercitation eiusmod exercitation qui.\r\n",
+ "Aliqua esse pariatur nulla veniam velit ea. Aliquip consectetur tempor ex magna sit aliquip exercitation veniam. Dolor ullamco minim commodo pariatur. Et amet reprehenderit dolore proident elit tempor eiusmod eu incididunt enim ullamco. Adipisicing id officia incididunt esse dolor sunt cupidatat do deserunt mollit do non. Magna ut officia fugiat adipisicing quis ea cillum laborum dolore ad nostrud magna minim est. Dolor voluptate officia proident enim ea deserunt eu voluptate dolore proident laborum officia ea.\r\n",
+ "Culpa aute consequat esse fugiat cupidatat minim voluptate voluptate eiusmod irure anim elit. Do eiusmod culpa laboris consequat incididunt minim nostrud eiusmod commodo velit ea ullamco proident. Culpa pariatur magna ut mollit nisi. Ea officia do magna deserunt minim nisi tempor ea deserunt veniam cillum exercitation esse.\r\n",
+ "Anim ullamco nostrud commodo Lorem. Do sunt laborum exercitation proident proident magna. Lorem officia laborum laborum dolor sunt duis commodo Lorem. Officia aute adipisicing ea cupidatat ea dolore. Aliquip adipisicing pariatur consectetur aliqua sit amet officia reprehenderit laborum culpa. Occaecat Lorem eu nisi do Lorem occaecat enim eiusmod laboris id quis. Ad mollit adipisicing sunt adipisicing esse.\r\n",
+ "Laborum quis sit adipisicing cupidatat. Veniam Lorem eiusmod esse esse sint nisi labore elit et. Deserunt aliqua mollit ut commodo aliqua non incididunt ipsum reprehenderit consectetur. Eiusmod nulla minim laboris Lorem ea Lorem aute tempor pariatur in sit. Incididunt culpa ut do irure amet irure cupidatat est anim anim culpa occaecat. Est velit consectetur eiusmod veniam reprehenderit officia sunt occaecat eiusmod ut sunt occaecat amet.\r\n",
+ "Elit minim aute fugiat nulla ex quis. Labore fugiat sint nostrud amet quis culpa excepteur in. Consectetur exercitation cupidatat laborum sit. Aute nisi eu aliqua est deserunt eiusmod commodo dolor id. Mollit laborum esse sint ipsum voluptate reprehenderit velit et. Veniam aliquip enim in veniam Lorem voluptate quis deserunt consequat qui commodo ut excepteur aute.\r\n",
+ "Dolore deserunt veniam aute nisi labore sunt et voluptate irure nisi anim ea. Magna nisi quis anim mollit nisi est dolor do ex aliquip elit aliquip ipsum minim. Dolore est officia nostrud eiusmod ex laborum ea amet est. Officia culpa non est et tempor consectetur exercitation tempor eiusmod enim. Ea tempor laboris qui amet ex nisi culpa dolore consectetur incididunt sunt sunt. Lorem aliquip incididunt magna do et ullamco ex elit aliqua eiusmod qui. Commodo amet dolor sint incididunt ex veniam non Lorem fugiat.\r\n",
+ "Officia culpa enim voluptate dolore commodo. Minim commodo aliqua minim ex sint excepteur cupidatat adipisicing eu irure. Anim magna deserunt anim Lorem non.\r\n",
+ "Cupidatat aliquip nulla excepteur sunt cupidatat cupidatat laborum cupidatat exercitation. Laboris minim ex cupidatat culpa elit. Amet enim reprehenderit aliqua laborum est tempor exercitation cupidatat ex dolore do. Do incididunt labore fugiat commodo consectetur nisi incididunt irure sit culpa sit. Elit aute occaecat qui excepteur velit proident cillum qui aliqua ex do ex. Dolore irure ex excepteur veniam id proident mollit Lorem.\r\n",
+ "Ad commodo cillum duis deserunt elit officia consectetur veniam eiusmod. Reprehenderit et veniam ad commodo reprehenderit magna elit laboris sunt non quis. Adipisicing dolor aute proident ea magna sunt et proident in consectetur.\r\n",
+ "Veniam exercitation esse esse veniam est nisi. Minim velit incididunt sint aute dolor anim. Fugiat cupidatat id ad nisi in voluptate dolor culpa eiusmod magna eiusmod amet id. Duis aliquip labore et ex amet amet aliquip laborum eiusmod ipsum. Quis qui ut duis duis. Minim in voluptate reprehenderit aliqua.\r\n",
+ "Elit ut pariatur dolor veniam ipsum consequat. Voluptate Lorem mollit et esse dolore mollit Lorem ad. Elit nostrud eu Lorem labore mollit minim cupidatat officia quis minim dolore incididunt. In cillum aute cillum ut.\r\n",
+ "Commodo laborum deserunt ut cupidatat pariatur ullamco in esse anim exercitation cillum duis. Consectetur incididunt sit esse Lorem in aute. Eiusmod mollit Lorem consequat minim reprehenderit laborum enim excepteur irure nisi elit. Laborum esse proident aute aute proident adipisicing laborum. Pariatur tempor duis incididunt qui velit pariatur ut officia ea mollit labore dolore. Cillum pariatur minim ullamco sunt incididunt culpa id ullamco exercitation consectetur. Ea exercitation consequat reprehenderit ut ullamco velit eu ad velit magna excepteur eiusmod.\r\n",
+ "Eu deserunt magna laboris laborum laborum in consequat dolore. Officia proident consectetur proident do occaecat minim pariatur officia ipsum sit non velit officia cillum. Laborum excepteur labore eu minim eiusmod. Sit anim dolore cillum ad do minim culpa sit est ad.\r\n",
+ "Cupidatat dolor nostrud Lorem sint consequat quis. Quis labore sint incididunt officia tempor. Fugiat nostrud in elit reprehenderit dolor. Nisi sit enim officia minim est adipisicing nulla aute labore nulla nostrud cupidatat est. Deserunt dolore qui irure Lorem esse voluptate velit qui nostrud.\r\n",
+ "Fugiat Lorem amet nulla nisi qui amet laboris enim cillum. Dolore occaecat exercitation id labore velit do commodo ut cupidatat laborum velit fugiat mollit. Ut et aliqua pariatur occaecat. Lorem occaecat dolore quis esse enim cupidatat exercitation ut tempor sit laboris fugiat adipisicing. Est tempor ex irure consectetur ipsum magna labore. Lorem non quis qui minim nisi magna amet aliquip ex cillum fugiat tempor.\r\n",
+ "Aliquip eiusmod laborum ipsum deserunt velit esse do magna excepteur consectetur exercitation sit. Minim ullamco reprehenderit commodo nostrud exercitation id irure ex qui ullamco sit esse laboris. Nulla cillum non minim qui cillum nisi aute proident. Dolor anim culpa elit quis excepteur aliqua eiusmod. Elit ea est excepteur consectetur sunt eiusmod enim id commodo irure amet et pariatur laboris. Voluptate magna ad magna dolore cillum cillum irure laboris ipsum officia id Lorem veniam.\r\n",
+ "Esse sunt elit est aliquip cupidatat commodo deserunt. Deserunt pariatur ipsum qui ad esse esse magna qui cillum laborum. Exercitation veniam pariatur elit amet enim.\r\n",
+ "Esse quis in id elit nulla occaecat incididunt. Et amet Lorem mollit in veniam do. Velit mollit Lorem consequat commodo Lorem aliquip cupidatat. Minim consequat nostrud nulla in nostrud.\r\n",
+ "Cillum nulla et eu est nostrud quis elit cupidatat dolor enim excepteur exercitation nisi voluptate. Nulla dolore non ex velit et qui tempor proident id deserunt nisi eu. Tempor ad Lorem ipsum reprehenderit in anim. Anim dolore ullamco enim deserunt quis ex id exercitation velit. Magna exercitation fugiat mollit pariatur ipsum ex consectetur nostrud. Id dolore officia nostrud excepteur laborum. Magna incididunt elit ipsum pariatur adipisicing enim duis est qui commodo velit aute.\r\n",
+ "Quis esse ex qui nisi dolor. Ullamco laborum dolor esse laboris eiusmod ea magna laboris ea esse ut. Dolore ipsum pariatur veniam sint mollit. Lorem ea proident fugiat ullamco ut nisi culpa eu exercitation exercitation aliquip veniam laborum consectetur.\r\n",
+ "Pariatur veniam laboris sit aliquip pariatur tempor aute sunt id et ut. Laboris excepteur eiusmod nisi qui quis elit enim ut cupidatat. Et et laborum in fugiat veniam consectetur ipsum laboris duis excepteur ullamco aliqua dolor Lorem. Aliqua ex amet sint anim cupidatat nisi ipsum anim et sunt deserunt. Occaecat culpa ut tempor cillum pariatur ex tempor.\r\n",
+ "Dolor deserunt eiusmod magna do officia voluptate excepteur est cupidatat. Veniam qui cupidatat amet anim est qui consectetur sit commodo commodo ea ad. Enim ad adipisicing qui nostrud. Non nulla esse ullamco nulla et ex.\r\n",
+ "Id ullamco ea consectetur est incididunt deserunt et esse. Elit nostrud voluptate eiusmod ut. Excepteur adipisicing qui cupidatat consequat labore id. Qui dolor aliqua do dolore do cupidatat labore ex consectetur ea sit cillum. Sint veniam eiusmod in consectetur consequat fugiat et mollit ut fugiat esse dolor adipisicing.\r\n",
+ "Ea magna proident labore duis pariatur. Esse cillum aliquip dolor duis fugiat ea ex officia ea irure. Sint elit nisi pariatur sunt nostrud exercitation ullamco culpa magna do.\r\n",
+ "Minim aliqua voluptate dolor consequat sint tempor deserunt amet magna excepteur. Irure do voluptate magna velit. Nostrud in reprehenderit magna officia nostrud. Cupidatat nulla irure laboris non fugiat ex ex est cupidatat excepteur officia aute velit duis. Sit voluptate id ea exercitation deserunt culpa voluptate nostrud est adipisicing incididunt. Amet proident laborum commodo magna ipsum quis.\r\n",
+ "Ipsum consectetur consectetur excepteur tempor eiusmod ea fugiat aute velit magna in officia sunt. Sit ut sunt dolore cupidatat dolor adipisicing. Veniam nisi adipisicing esse reprehenderit amet aliqua voluptate ex commodo occaecat est voluptate mollit sunt. Pariatur aliqua qui qui in dolor. Fugiat reprehenderit sit nostrud do sint esse. Tempor sit irure adipisicing ea pariatur duis est sit est incididunt laboris quis do. Et voluptate anim minim aliquip excepteur consequat nisi anim pariatur aliquip ut ipsum dolor magna.\r\n",
+ "Cillum sit labore excepteur magna id aliqua exercitation consequat laborum Lorem id pariatur nostrud. Lorem qui est labore sint cupidatat sint excepteur nulla in eu aliqua et. Adipisicing velit do enim occaecat laboris quis excepteur ipsum dolor occaecat Lorem dolore id exercitation.\r\n",
+ "Incididunt in laborum reprehenderit eiusmod irure ex. Elit duis consequat minim magna. Esse consectetur aliquip cillum excepteur excepteur fugiat. Sint tempor consequat minim reprehenderit consectetur adipisicing dolor id Lorem elit non. Occaecat esse quis mollit ea et sint aute fugiat qui tempor. Adipisicing tempor duis non dolore irure elit deserunt qui do.\r\n",
+ "Labore fugiat eiusmod sint laborum sit duis occaecat. Magna in laborum non cillum excepteur nostrud sit proident pariatur voluptate voluptate adipisicing exercitation occaecat. Ad non dolor aute ex sint do do minim exercitation veniam laborum irure magna ea. Magna do non quis sit consequat Lorem aliquip.\r\n",
+ "Velit anim do laborum laboris laborum Lorem. Sunt do Lorem amet ipsum est sint velit sit do voluptate mollit veniam enim. Commodo do deserunt in pariatur ut elit sint elit deserunt ea. Ad dolor anim consequat aliquip ut mollit nostrud tempor sunt mollit elit. Reprehenderit laboris labore excepteur occaecat veniam adipisicing cupidatat esse. Ad enim aliquip ea minim excepteur magna. Sint velit veniam pariatur qui dolor est adipisicing ex laboris.\r\n",
+ "Ea cupidatat ex nulla in sunt est sit dolor enim ad. Eu tempor consequat cupidatat consequat ex incididunt sint culpa. Est Lorem Lorem non cupidatat sunt ut aliqua non nostrud do ullamco. Reprehenderit ad ad nulla nostrud do nulla in. Ipsum adipisicing commodo mollit ipsum exercitation. Aliqua ea anim anim est elit. Ea incididunt consequat minim ad sunt eu cillum.\r\n",
+ "Tempor quis excepteur eiusmod cupidatat ipsum occaecat id et occaecat. Eiusmod magna aliquip excepteur id amet elit. Ullamco dolore amet anim dolor enim ea magna magna elit. Occaecat magna pariatur in deserunt consectetur officia aliquip ullamco ex aute anim. Minim laborum eu sit elit officia esse do irure pariatur tempor et reprehenderit ullamco labore.\r\n",
+ "Sit tempor eu minim dolore velit pariatur magna duis reprehenderit ea nulla in. Amet est do consectetur commodo do adipisicing adipisicing in amet. Cillum id ut commodo do pariatur duis aliqua nisi sint ad irure officia reprehenderit. Mollit labore id enim fugiat ullamco irure mollit cupidatat. Quis nisi amet labore eu dolor occaecat commodo aliqua laboris deserunt excepteur deserunt officia. Aliqua non ut sit ad. Laborum veniam ad velit minim dolore ea id magna dolor qui in.\r\n",
+ "Dolore nostrud ipsum aliqua pariatur id reprehenderit enim ad eiusmod qui. Deserunt anim commodo pariatur excepteur velit eu irure nulla ex labore ipsum aliqua minim aute. Id consequat amet tempor aliquip ex elit adipisicing est do. Eu enim Lorem consectetur minim id irure nulla culpa. Consectetur do consequat aute tempor anim. Qui ad non elit dolor est adipisicing nisi amet cillum sunt quis anim laboris incididunt. Incididunt proident adipisicing labore Lorem.\r\n",
+ "Et reprehenderit ea officia veniam. Aliquip ullamco consequat elit nisi magna mollit id elit. Amet amet sint velit labore ad nisi. Consectetur tempor id dolor aliqua esse deserunt amet. Qui laborum enim proident voluptate aute eu aute aute sit sit incididunt eu. Sunt ullamco nisi nostrud labore commodo non consectetur quis do duis minim irure. Tempor sint dolor sint aliquip dolore nostrud fugiat.\r\n",
+ "Aute ullamco quis nisi ut excepteur nostrud duis elit. Veniam ex ad incididunt veniam voluptate. Commodo dolore ullamco sit sint adipisicing proident amet aute duis deserunt.\r\n",
+ "Labore velit eu cillum nisi. Laboris do cupidatat et non duis cillum. Ullamco dolor tempor cupidatat voluptate laborum ullamco ea duis.\r\n",
+ "Deserunt consequat aliqua duis aliquip nostrud nostrud dolore nisi. Culpa do sint laborum consectetur ipsum quis laborum laborum pariatur eiusmod. Consectetur laboris ad ad ut quis. Ullamco laboris qui velit id laborum voluptate qui aute nostrud aliquip ea.\r\n",
+ "Ad cillum anim ex est consectetur mollit id in. Non enim aliquip consequat qui deserunt commodo cillum ad laborum fugiat. Dolor deserunt amet laborum tempor adipisicing voluptate dolor pariatur dolor cillum. Eu mollit ex sunt officia veniam qui est sunt proident. Non aliqua qui elit eu cupidatat ex enim ex proident. Lorem sit minim ullamco officia cupidatat duis minim. Exercitation laborum deserunt voluptate culpa tempor quis nulla id pariatur.\r\n",
+ "Nostrud quis consectetur ut aliqua excepteur elit consectetur occaecat. Occaecat voluptate Lorem pariatur consequat ullamco fugiat minim. Anim voluptate eu eu cillum tempor dolore aliquip aliqua. Fugiat incididunt ut tempor amet minim. Voluptate nostrud minim pariatur non excepteur ullamco.\r\n",
+ "Dolore nulla velit officia exercitation irure laboris incididunt anim in laborum in fugiat ut proident. Fugiat aute id consequat fugiat officia ut. Labore sint amet proident amet sint nisi laboris amet id ullamco culpa quis consequat proident. Magna do fugiat veniam dolore elit irure minim. Esse ullamco excepteur labore tempor labore fugiat dolore nisi cupidatat irure dolor pariatur. Magna excepteur laboris nisi eiusmod sit pariatur mollit.\r\n",
+ "In enim aliquip officia ea ad exercitation cillum culpa occaecat dolore Lorem. Irure cillum commodo adipisicing sunt pariatur ea duis fugiat exercitation laboris culpa ullamco aute. Ut voluptate exercitation qui dolor. Irure et duis elit consequat deserunt proident.\r\n",
+ "Officia ea Lorem sunt culpa id et tempor excepteur enim deserunt proident. Dolore aliquip dolor laboris cillum proident velit. Et culpa occaecat exercitation cupidatat irure sint adipisicing excepteur pariatur incididunt ad occaecat. Qui proident ipsum cillum minim. Quis ut culpa irure aliqua minim fugiat. In voluptate cupidatat fugiat est laborum dolor esse in pariatur voluptate.\r\n",
+ "Voluptate enim ipsum officia aute ea adipisicing nisi ut ex do aliquip amet. Reprehenderit enim voluptate tempor ex adipisicing culpa. Culpa occaecat voluptate dolor mollit ipsum exercitation labore et tempor sit ea consectetur aliqua. Elit elit sit minim ea ea commodo do tempor cupidatat irure dolore. Occaecat esse adipisicing anim eiusmod commodo fugiat mollit amet. Incididunt tempor tempor qui occaecat cupidatat in.\r\n",
+ "Ut qui anim velit enim aliquip do ut nulla labore. Mollit ut commodo ut eiusmod consectetur laboris aliqua qui voluptate culpa fugiat incididunt elit. Lorem ullamco esse elit elit. Labore amet incididunt ea nulla aliquip eiusmod. Sit nulla est voluptate officia ipsum aute aute cillum tempor deserunt. Laboris commodo eiusmod labore sunt aute excepteur ea consectetur reprehenderit veniam nisi. Culpa nisi sint sunt sint tempor laboris dolore cupidatat.\r\n",
+ "Duis cillum qui nisi duis amet velit ad cillum ut elit aute sint ad. Amet laboris pariatur excepteur ipsum Lorem aliqua veniam Lorem quis mollit cupidatat aliqua exercitation. Pariatur ex ullamco sit commodo cillum eiusmod ut proident elit cillum. Commodo ut ipsum excepteur occaecat sint elit consequat ex dolor adipisicing consectetur id ut ad. Velit sit eiusmod est esse tempor incididunt consectetur eiusmod duis commodo veniam.\r\n",
+ "Ut sunt qui officia anim laboris exercitation Lorem quis laborum do eiusmod officia. Enim consectetur occaecat fugiat cillum cillum. Dolore dolore nostrud in commodo fugiat mollit consequat occaecat non et et elit ullamco. Sit voluptate minim ut est culpa velit nulla fugiat reprehenderit eu aliquip adipisicing labore. Sit minim minim do dolor dolor. Lorem Lorem labore exercitation magna veniam eiusmod do.\r\n",
+ "Fugiat dolor adipisicing quis aliquip aute dolore. Qui proident anim elit veniam ex aliquip eiusmod ipsum sunt pariatur est. Non fugiat duis do est officia adipisicing.\r\n",
+ "Nulla deserunt do laboris cupidatat veniam do consectetur ipsum elit veniam in mollit eu. Ea in consequat cupidatat laboris sint fugiat irure. In commodo esse reprehenderit deserunt minim velit ullamco enim eu cupidatat tempor ex. Ullamco in non id culpa amet occaecat culpa nostrud id. Non occaecat culpa magna incididunt.\r\n",
+ "Enim laboris ex mollit reprehenderit eiusmod exercitation magna. Exercitation Lorem ex mollit non non culpa labore enim. Adipisicing labore dolore incididunt do amet aliquip excepteur ad et nostrud officia aute veniam voluptate. Fugiat enim eiusmod Lorem esse. Minim ullamco commodo consequat ex commodo aliqua eu nulla eu. Veniam non enim nulla ut Lorem nostrud minim sint duis.\r\n",
+ "Enim duis consectetur in ullamco cillum veniam nulla amet. Exercitation nisi sunt sunt duis in culpa nisi magna ex id ipsum laboris reprehenderit qui. Officia pariatur qui ex fugiat veniam et sunt sit nostrud. Veniam ullamco tempor fugiat minim Lorem proident velit in eiusmod elit. Enim minim excepteur aute aliquip ex magna commodo dolore qui et labore. Proident eu aliquip cillum dolor. Nostrud ipsum ut irure consequat fugiat nulla proident occaecat laborum.\r\n",
+ "Amet duis eiusmod sunt adipisicing esse ex nostrud consectetur voluptate cillum. Ipsum occaecat sit et anim velit irure ea incididunt cupidatat ullamco in nisi quis. Esse officia ipsum commodo qui quis qui do. Commodo aliquip amet aute sit sit ut cupidatat elit nostrud.\r\n",
+ "Laboris laboris sit mollit cillum nulla deserunt commodo culpa est commodo anim id anim sit. Officia id consectetur velit incididunt est dolor sunt ipsum magna aliqua consectetur. Eiusmod pariatur minim deserunt cupidatat veniam Lorem aliquip sunt proident eu Lorem sit dolor fugiat. Proident qui ut ex in incididunt nulla nulla dolor ex laboris ea ad.\r\n",
+ "Ex incididunt enim labore nulla cupidatat elit. Quis ut incididunt incididunt non irure commodo do mollit cillum anim excepteur. Qui consequat laborum dolore elit tempor aute ut nulla pariatur eu ullamco veniam. Nisi non velit labore in commodo excepteur culpa nulla tempor cillum. Ipsum qui sit sint reprehenderit ut labore incididunt dolor aliquip sunt. Reprehenderit occaecat tempor nisi laborum.\r\n",
+ "Lorem officia ullamco eu occaecat in magna eiusmod consectetur nisi aliqua mollit esse. Ullamco ex aute nostrud pariatur do enim cillum sint do fugiat nostrud culpa tempor. Do aliquip excepteur nostrud culpa eu pariatur eiusmod cillum excepteur do. Est sunt non quis cillum voluptate ex.\r\n",
+ "Deserunt consectetur tempor irure mollit qui tempor et. Labore enim eu irure laboris in. Nisi in tempor ex occaecat amet cupidatat laboris occaecat amet minim ut magna incididunt id. Consequat cillum laborum commodo mollit. Et magna culpa sunt dolore consequat laboris et sit. Deserunt qui voluptate excepteur dolor. Eu qui amet est proident.\r\n",
+ "Eu elit minim eiusmod occaecat eu nostrud dolor qui ut elit. Sunt dolore proident ea eu do eiusmod fugiat incididunt pariatur duis amet Lorem nisi ut. Adipisicing quis veniam cupidatat Lorem sint culpa sunt veniam sint. Excepteur eu exercitation est magna pariatur veniam dolore qui fugiat labore proident eiusmod cillum. Commodo reprehenderit elit proident duis sint magna.\r\n",
+ "Ut aliquip pariatur deserunt nostrud commodo ad proident est exercitation. Sit minim do ea enim sint officia nisi incididunt laborum. Ex amet duis commodo fugiat. Ut aute tempor deserunt irure occaecat aliquip voluptate cillum aute elit qui nostrud.\r\n",
+ "Irure et quis consectetur sit est do sunt aliquip eu. Cupidatat pariatur consequat dolore consectetur. Adipisicing magna velit mollit occaecat do id. Nisi pariatur cupidatat cillum incididunt excepteur consectetur excepteur do laborum deserunt irure pariatur cillum.\r\n",
+ "Adipisicing esse incididunt cillum est irure consequat irure ad aute voluptate. Incididunt do occaecat nostrud do ipsum pariatur Lorem qui laboris et pariatur. Est exercitation dolor culpa ad velit ut et.\r\n",
+ "Sit eiusmod id enim ad ex dolor pariatur do. Ullamco occaecat quis dolor minim non elit labore amet est. Commodo velit eu nulla eiusmod ullamco. Incididunt anim pariatur aute eiusmod veniam tempor enim officia elit id. Elit Lorem est commodo dolore nostrud. Labore et consectetur do exercitation veniam laboris incididunt aliqua proident dolore ea officia cupidatat. Velit laboris aliquip deserunt labore commodo.\r\n",
+ "Proident nostrud labore eu nostrud. Excepteur ut in velit labore ea proident labore ea sint cillum. Incididunt ipsum consectetur officia irure sit pariatur veniam id velit officia mollit. Adipisicing magna voluptate velit excepteur enim consectetur incididunt voluptate tempor occaecat fugiat velit excepteur labore. Do do incididunt qui nisi voluptate enim. Laboris aute sit voluptate cillum pariatur minim excepteur ullamco mollit deserunt.\r\n",
+ "Excepteur laborum adipisicing nisi elit fugiat tempor. Elit laboris qui enim labore duis. Proident tempor in consectetur proident excepteur do ex laboris sit.\r\n",
+ "Dolore do ea incididunt do duis dolore eu labore nisi cupidatat voluptate amet incididunt minim. Nulla pariatur mollit cupidatat adipisicing nulla et. Dolor aliquip in ex magna excepteur. Nulla consequat minim consequat ullamco dolor laboris ullamco eu reprehenderit duis nostrud pariatur.\r\n",
+ "Id nisi labore duis qui. Incididunt laboris tempor aute do sit. Occaecat excepteur est mollit ea in mollit ullamco est amet reprehenderit.\r\n",
+ "Aute labore ipsum velit non voluptate eiusmod et reprehenderit cupidatat occaecat. Lorem tempor tempor consectetur exercitation qui nostrud sunt cillum quis ut non dolore. Reprehenderit consequat reprehenderit laborum qui pariatur anim et officia est cupidatat enim velit velit.\r\n",
+ "Commodo ex et fugiat cupidatat non adipisicing commodo. Minim ad dolore fugiat mollit cupidatat aliqua sunt dolor sit. Labore esse labore velit aute enim. Nulla duis incididunt est aliquip consectetur elit qui incididunt minim minim labore amet sit cillum.\r\n"
+] \ No newline at end of file
diff --git a/3rdparty/rapidjson/bin/types/readme.txt b/3rdparty/rapidjson/bin/types/readme.txt
new file mode 100644
index 00000000000..da1dae675e9
--- /dev/null
+++ b/3rdparty/rapidjson/bin/types/readme.txt
@@ -0,0 +1 @@
+Test data obtained from https://github.com/xpol/lua-rapidjson/tree/master/performance
diff --git a/3rdparty/rapidjson/doc/CMakeLists.txt b/3rdparty/rapidjson/doc/CMakeLists.txt
new file mode 100644
index 00000000000..c1f165a37ad
--- /dev/null
+++ b/3rdparty/rapidjson/doc/CMakeLists.txt
@@ -0,0 +1,25 @@
+find_package(Doxygen)
+
+IF(NOT DOXYGEN_FOUND)
+ MESSAGE(STATUS "No Doxygen found. Documentation won't be built")
+ELSE()
+ file(GLOB SOURCES ${CMAKE_CURRENT_LIST_DIR}/../include/*)
+ file(GLOB MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../doc/*.md)
+ list(APPEND MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../readme.md)
+
+ CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
+ CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY)
+
+ add_custom_command(OUTPUT html
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn
+ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html
+ DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../
+ )
+
+ add_custom_target(doc ALL DEPENDS html)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
+ DESTINATION ${DOC_INSTALL_DIR}
+ COMPONENT doc)
+ENDIF()
diff --git a/3rdparty/rapidjson/doc/Doxyfile.in b/3rdparty/rapidjson/doc/Doxyfile.in
new file mode 100644
index 00000000000..fcb09266097
--- /dev/null
+++ b/3rdparty/rapidjson/doc/Doxyfile.in
@@ -0,0 +1,2368 @@
+# Doxyfile 1.8.7
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = RapidJSON
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF = "A fast JSON parser/generator for C++ with both SAX/DOM style API"
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = YES
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS = $(RAPIDJSON_SECTIONS)
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. Do not use file names with spaces, bibtex cannot handle them. See
+# also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = readme.md \
+ include/rapidjson/rapidjson.h \
+ include/ \
+ doc/features.md \
+ doc/tutorial.md \
+ doc/pointer.md \
+ doc/stream.md \
+ doc/encoding.md \
+ doc/dom.md \
+ doc/sax.md \
+ doc/schema.md \
+ doc/performance.md \
+ doc/internals.md \
+ doc/faq.md
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.inc \
+ *.md
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE = ./include/rapidjson/msinttypes/
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS = internal
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH = ./doc
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = readme.md
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# compiled with the --with-libclang option.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = NO
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER = ./doc/misc/header.html
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER = ./doc/misc/footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
+# defined cascading style sheet that is included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet file to the output directory. For an example
+# see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = YES
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
+# replace them by respectively the title of the page, the current date and time,
+# only the current date, the version number of doxygen, the project name (see
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED = \
+ RAPIDJSON_DOXYGEN_RUNNING \
+ RAPIDJSON_NAMESPACE_BEGIN="namespace rapidjson {" \
+ RAPIDJSON_NAMESPACE_END="}" \
+ RAPIDJSON_REMOVEFPTR_(x)=x \
+ RAPIDJSON_ENABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype" \
+ RAPIDJSON_DISABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype"
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED = \
+ RAPIDJSON_NOEXCEPT
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font n the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/3rdparty/rapidjson/doc/Doxyfile.zh-cn.in b/3rdparty/rapidjson/doc/Doxyfile.zh-cn.in
new file mode 100644
index 00000000000..76d828b5e69
--- /dev/null
+++ b/3rdparty/rapidjson/doc/Doxyfile.zh-cn.in
@@ -0,0 +1,2368 @@
+# Doxyfile 1.8.7
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = RapidJSON
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF = "一个C++快速JSONè§£æžå™¨åŠç”Ÿæˆå™¨ï¼ŒåŒ…å«SAX/DOM风格API"
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = Chinese
+
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = YES
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS = $(RAPIDJSON_SECTIONS)
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. Do not use file names with spaces, bibtex cannot handle them. See
+# also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = readme.zh-cn.md \
+ include/rapidjson/rapidjson.h \
+ include/ \
+ doc/features.zh-cn.md \
+ doc/tutorial.zh-cn.md \
+ doc/pointer.zh-cn.md \
+ doc/stream.zh-cn.md \
+ doc/encoding.zh-cn.md \
+ doc/dom.zh-cn.md \
+ doc/sax.zh-cn.md \
+ doc/schema.zh-cn.md \
+ doc/performance.zh-cn.md \
+ doc/internals.md \
+ doc/faq.zh-cn.md
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.inc \
+ *.md
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE = ./include/rapidjson/msinttypes/
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS = internal
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH = ./doc
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = readme.zh-cn.md
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# compiled with the --with-libclang option.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = NO
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html/zh-cn
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER = ./doc/misc/header.html
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER = ./doc/misc/footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
+# defined cascading style sheet that is included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet file to the output directory. For an example
+# see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = YES
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
+# replace them by respectively the title of the page, the current date and time,
+# only the current date, the version number of doxygen, the project name (see
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = YES
+
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED = \
+ RAPIDJSON_DOXYGEN_RUNNING \
+ RAPIDJSON_NAMESPACE_BEGIN="namespace rapidjson {" \
+ RAPIDJSON_NAMESPACE_END="}" \
+ RAPIDJSON_REMOVEFPTR_(x)=x \
+ RAPIDJSON_ENABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype" \
+ RAPIDJSON_DISABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype"
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED = \
+ RAPIDJSON_NOEXCEPT
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font n the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/3rdparty/rapidjson/doc/diagram/architecture.dot b/3rdparty/rapidjson/doc/diagram/architecture.dot
new file mode 100644
index 00000000000..c816c871834
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/architecture.dot
@@ -0,0 +1,50 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ nodesep=0.5
+ penwidth=0.5
+ colorscheme=spectral7
+
+ node [shape=box, fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, style=filled, fillcolor=white]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "SAX"
+ style=filled
+ fillcolor=6
+
+ Reader -> Writer [style=invis]
+ }
+
+ subgraph cluster2 {
+ margin="10,10"
+ labeljust="left"
+ label = "DOM"
+ style=filled
+ fillcolor=7
+
+ Value
+ Document
+ }
+
+ Handler [label="<<concept>>\nHandler"]
+
+ {
+ edge [arrowtail=onormal, dir=back]
+ Value -> Document
+ Handler -> Document
+ Handler -> Writer
+ }
+
+ {
+ edge [arrowhead=vee, style=dashed, constraint=false]
+ Reader -> Handler [label="calls"]
+ Value -> Handler [label="calls"]
+ Document -> Reader [label="uses"]
+ }
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/architecture.png b/3rdparty/rapidjson/doc/diagram/architecture.png
new file mode 100644
index 00000000000..556c7e72914
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/architecture.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/insituparsing.dot b/3rdparty/rapidjson/doc/diagram/insituparsing.dot
new file mode 100644
index 00000000000..eca0e3854f4
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/insituparsing.dot
@@ -0,0 +1,65 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
+
+ {
+ node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray]
+ oldjson [label="\{|\"|m|s|g|\"|:|\"|H|e|l|l|o|\\|n|W|o|r|l|d|!|\"|,|\"|\\|u|0|0|7|3|t|a|r|s|\"|:|1|0|\}", xlabel="Before Parsing"]
+ //newjson [label="\{|\"|<a>m|s|g|\\0|:|\"|<b>H|e|l|l|o|\\n|W|o|r|l|d|!|\\0|\"|,|\"|<c>s|t|a|r|s|\\0|t|a|r|s|:|1|0|\}", xlabel="After Parsing"]
+ newjson [shape=plaintext, label=<
+<table BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="2"><tr>
+<td>{</td>
+<td>"</td><td port="a">m</td><td>s</td><td>g</td><td bgcolor="yellow">\\0</td>
+<td>:</td>
+<td>"</td><td port="b">H</td><td>e</td><td>l</td><td>l</td><td>o</td><td bgcolor="yellow">\\n</td><td bgcolor="yellow">W</td><td bgcolor="yellow">o</td><td bgcolor="yellow">r</td><td bgcolor="yellow">l</td><td bgcolor="yellow">d</td><td bgcolor="yellow">!</td><td bgcolor="yellow">\\0</td><td>"</td>
+<td>,</td>
+<td>"</td><td port="c" bgcolor="yellow">s</td><td bgcolor="yellow">t</td><td bgcolor="yellow">a</td><td bgcolor="yellow">r</td><td bgcolor="yellow">s</td><td bgcolor="yellow">\\0</td><td>t</td><td>a</td><td>r</td><td>s</td>
+<td>:</td>
+<td>1</td><td>0</td>
+<td>}</td>
+</tr></table>
+>, xlabel="After Parsing"]
+ }
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Document by In situ Parsing"
+ style=filled
+ fillcolor=gray95
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ root [label="{object|}", fillcolor=3]
+
+ {
+ msg [label="{string|<a>}", fillcolor=5]
+ helloworld [label="{string|<a>}", fillcolor=5]
+ stars [label="{string|<a>}", fillcolor=5]
+ ten [label="{number|10}", fillcolor=6]
+ }
+ }
+
+ oldjson -> root [label=" ParseInsitu()" lhead="cluster1"]
+ edge [arrowhead=vee]
+ root -> { msg; stars }
+
+ edge [arrowhead="none"]
+ msg -> helloworld
+ stars -> ten
+
+ {
+ edge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false]
+ msg:a:c -> newjson:a
+ helloworld:a:c -> newjson:b
+ stars:a:c -> newjson:c
+ }
+
+ //oldjson -> newjson [style=invis]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/insituparsing.png b/3rdparty/rapidjson/doc/diagram/insituparsing.png
new file mode 100644
index 00000000000..4400c88466a
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/insituparsing.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.dot b/3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.dot
new file mode 100644
index 00000000000..82ebfe1f095
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.dot
@@ -0,0 +1,62 @@
+digraph {
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ penwidth=0.0
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+
+ node [shape = doublecircle]; Start; Finish;
+ node [shape = box; style = "rounded, filled"; fillcolor=white ];
+
+ Start -> ArrayInitial [label=" ["];
+ Start -> ObjectInitial [label=" {"];
+
+ subgraph clusterArray {
+ margin="10,10"
+ style=filled
+ fillcolor=gray95
+ label = "Array"
+
+ ArrayInitial; Element; ElementDelimiter; ArrayFinish;
+ }
+
+ subgraph clusterObject {
+ margin="10,10"
+ style=filled
+ fillcolor=gray95
+ label = "Object"
+
+ ObjectInitial; MemberKey; KeyValueDelimiter; MemberValue; MemberDelimiter; ObjectFinish;
+ }
+
+ ArrayInitial -> ArrayInitial [label="["];
+ ArrayInitial -> ArrayFinish [label=" ]"];
+ ArrayInitial -> ObjectInitial [label="{", constraint=false];
+ ArrayInitial -> Element [label="string\nfalse\ntrue\nnull\nnumber"];
+
+ Element -> ArrayFinish [label="]"];
+ Element -> ElementDelimiter [label=","];
+
+ ElementDelimiter -> ArrayInitial [label=" ["];
+ ElementDelimiter -> ObjectInitial [label="{"];
+ ElementDelimiter -> Element [label="string\nfalse\ntrue\nnull\nnumber"];
+
+ ObjectInitial -> ObjectFinish [label=" }"];
+ ObjectInitial -> MemberKey [label=" string "];
+
+ MemberKey -> KeyValueDelimiter [label=":"];
+
+ KeyValueDelimiter -> ArrayInitial [label="["];
+ KeyValueDelimiter -> ObjectInitial [label=" {"];
+ KeyValueDelimiter -> MemberValue [label=" string\n false\n true\n null\n number"];
+
+ MemberValue -> ObjectFinish [label="}"];
+ MemberValue -> MemberDelimiter [label=","];
+
+ MemberDelimiter -> MemberKey [label=" string "];
+
+ ArrayFinish -> Finish;
+ ObjectFinish -> Finish;
+}
diff --git a/3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.png b/3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.png
new file mode 100644
index 00000000000..f315494db1d
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/iterative-parser-states-diagram.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/makefile b/3rdparty/rapidjson/doc/diagram/makefile
new file mode 100644
index 00000000000..3483977655d
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/makefile
@@ -0,0 +1,8 @@
+%.pdf: %.dot
+ dot $< -Tpdf -o $@
+
+%.png: %.dot
+ dot $< -Tpng -o $@
+
+DOTFILES = $(basename $(wildcard *.dot))
+all: $(addsuffix .png, $(DOTFILES)) $(addsuffix .pdf, $(DOTFILES))
diff --git a/3rdparty/rapidjson/doc/diagram/move1.dot b/3rdparty/rapidjson/doc/diagram/move1.dot
new file mode 100644
index 00000000000..a7c1464ad06
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/move1.dot
@@ -0,0 +1,47 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Before"
+ style=filled
+ fillcolor=gray95
+
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ {
+ rank = same
+ b1 [label="{b:number|456}", fillcolor=6]
+ a1 [label="{a:number|123}", fillcolor=6]
+ }
+
+ a1 -> b1 [style="dashed", label="Move", dir=back]
+ }
+
+ subgraph cluster2 {
+ margin="10,10"
+ labeljust="left"
+ label = "After"
+ style=filled
+ fillcolor=gray95
+
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ {
+ rank = same
+ b2 [label="{b:null|}", fillcolor=1]
+ a2 [label="{a:number|456}", fillcolor=6]
+ }
+ a2 -> b2 [style=invis, dir=back]
+ }
+ b1 -> b2 [style=invis]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/move1.png b/3rdparty/rapidjson/doc/diagram/move1.png
new file mode 100644
index 00000000000..ab322d084bd
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/move1.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/move2.dot b/3rdparty/rapidjson/doc/diagram/move2.dot
new file mode 100644
index 00000000000..7037ea6cbb2
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/move2.dot
@@ -0,0 +1,62 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Before Copying (Hypothetic)"
+ style=filled
+ fillcolor=gray95
+
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ c1 [label="{contact:array|}", fillcolor=4]
+ c11 [label="{|}"]
+ c12 [label="{|}"]
+ c13 [shape="none", label="...", style="solid"]
+ o1 [label="{o:object|}", fillcolor=3]
+ ghost [label="{o:object|}", style=invis]
+
+ c1 -> o1 [style="dashed", label="AddMember", constraint=false]
+
+ edge [arrowhead=vee]
+ c1 -> { c11; c12; c13 }
+ o1 -> ghost [style=invis]
+ }
+
+ subgraph cluster2 {
+ margin="10,10"
+ labeljust="left"
+ label = "After Copying (Hypothetic)"
+ style=filled
+ fillcolor=gray95
+
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ c2 [label="{contact:array|}", fillcolor=4]
+ c3 [label="{array|}", fillcolor=4]
+ c21 [label="{|}"]
+ c22 [label="{|}"]
+ c23 [shape=none, label="...", style="solid"]
+ o2 [label="{o:object|}", fillcolor=3]
+ cs [label="{string|\"contact\"}", fillcolor=5]
+ c31 [label="{|}"]
+ c32 [label="{|}"]
+ c33 [shape="none", label="...", style="solid"]
+
+ edge [arrowhead=vee]
+ c2 -> { c21; c22; c23 }
+ o2 -> cs
+ cs -> c3 [arrowhead=none]
+ c3 -> { c31; c32; c33 }
+ }
+ ghost -> o2 [style=invis]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/move2.png b/3rdparty/rapidjson/doc/diagram/move2.png
new file mode 100644
index 00000000000..8d4fc5bcc22
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/move2.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/move3.dot b/3rdparty/rapidjson/doc/diagram/move3.dot
new file mode 100644
index 00000000000..c197b99df59
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/move3.dot
@@ -0,0 +1,60 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+ forcelabels=true
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Before Moving"
+ style=filled
+ fillcolor=gray95
+
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ c1 [label="{contact:array|}", fillcolor=4]
+ c11 [label="{|}"]
+ c12 [label="{|}"]
+ c13 [shape=none, label="...", style="solid"]
+ o1 [label="{o:object|}", fillcolor=3]
+ ghost [label="{o:object|}", style=invis]
+
+ c1 -> o1 [style="dashed", constraint=false, label="AddMember"]
+
+ edge [arrowhead=vee]
+ c1 -> { c11; c12; c13 }
+ o1 -> ghost [style=invis]
+ }
+
+ subgraph cluster2 {
+ margin="10,10"
+ labeljust="left"
+ label = "After Moving"
+ style=filled
+ fillcolor=gray95
+
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ c2 [label="{contact:null|}", fillcolor=1]
+ c3 [label="{array|}", fillcolor=4]
+ c21 [label="{|}"]
+ c22 [label="{|}"]
+ c23 [shape="none", label="...", style="solid"]
+ o2 [label="{o:object|}", fillcolor=3]
+ cs [label="{string|\"contact\"}", fillcolor=5]
+ c2 -> o2 [style="dashed", constraint=false, label="AddMember", style=invis]
+
+ edge [arrowhead=vee]
+ c3 -> { c21; c22; c23 }
+ o2 -> cs
+ cs -> c3 [arrowhead=none]
+ }
+ ghost -> o2 [style=invis]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/move3.png b/3rdparty/rapidjson/doc/diagram/move3.png
new file mode 100644
index 00000000000..558470f1fab
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/move3.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/normalparsing.dot b/3rdparty/rapidjson/doc/diagram/normalparsing.dot
new file mode 100644
index 00000000000..b15941ba0fc
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/normalparsing.dot
@@ -0,0 +1,56 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
+
+ {
+ node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray]
+ normaljson [label="\{|\"|m|s|g|\"|:|\"|H|e|l|l|o|\\|n|W|o|r|l|d|!|\"|,|\"|\\|u|0|0|7|3|t|a|r|s\"|:|1|0|\}"]
+
+ {
+ rank = same
+ msgstring [label="m|s|g|\\0"]
+ helloworldstring [label="H|e|l|l|o|\\n|W|o|r|l|d|!|\\0"]
+ starsstring [label="s|t|a|r|s\\0"]
+ }
+ }
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Document by Normal Parsing"
+ style=filled
+ fillcolor=gray95
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ root [label="{object|}", fillcolor=3]
+
+ {
+ msg [label="{string|<a>}", fillcolor=5]
+ helloworld [label="{string|<a>}", fillcolor=5]
+ stars [label="{string|<a>}", fillcolor=5]
+ ten [label="{number|10}", fillcolor=6]
+ }
+ }
+
+ normaljson -> root [label=" Parse()" lhead="cluster1"]
+ edge [arrowhead=vee]
+ root -> { msg; stars }
+
+ edge [arrowhead="none"]
+ msg -> helloworld
+ stars -> ten
+
+ edge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false]
+ msg:a:c -> msgstring:w
+ helloworld:a:c -> helloworldstring:w
+ stars:a:c -> starsstring:w
+
+ msgstring -> helloworldstring -> starsstring [style=invis]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/normalparsing.png b/3rdparty/rapidjson/doc/diagram/normalparsing.png
new file mode 100644
index 00000000000..702512ca367
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/normalparsing.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/simpledom.dot b/3rdparty/rapidjson/doc/diagram/simpledom.dot
new file mode 100644
index 00000000000..959cdbb417a
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/simpledom.dot
@@ -0,0 +1,54 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
+
+ {
+ node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray]
+ srcjson [label="\{|\"|p|r|o|j|e|c|t|\"|:|\"|r|a|p|i|d|j|s|o|n|\"|,|\"|s|t|a|r|s|\"|:|1|0|\}"]
+ dstjson [label="\{|\"|p|r|o|j|e|c|t|\"|:|\"|r|a|p|i|d|j|s|o|n|\"|,|\"|s|t|a|r|s|\"|:|1|1|\}"]
+ }
+
+ {
+ node [shape="box", style="filled", fillcolor="gray95"]
+ Document2 [label="(Modified) Document"]
+ Writer
+ }
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Document"
+ style=filled
+ fillcolor=gray95
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ root [label="{object|}", fillcolor=3]
+
+ {
+ project [label="{string|\"project\"}", fillcolor=5]
+ rapidjson [label="{string|\"rapidjson\"}", fillcolor=5]
+ stars [label="{string|\"stars\"}", fillcolor=5]
+ ten [label="{number|10}", fillcolor=6]
+ }
+
+ edge [arrowhead=vee]
+ root -> { project; stars }
+
+ edge [arrowhead="none"]
+ project -> rapidjson
+ stars -> ten
+ }
+
+ srcjson -> root [label=" Parse()", lhead="cluster1"]
+
+ ten -> Document2 [label=" Increase \"stars\"", ltail="cluster1" ]
+ Document2 -> Writer [label=" Traverse DOM by Accept()"]
+ Writer -> dstjson [label=" Output to StringBuffer"]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/simpledom.png b/3rdparty/rapidjson/doc/diagram/simpledom.png
new file mode 100644
index 00000000000..38d9c5dc126
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/simpledom.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/tutorial.dot b/3rdparty/rapidjson/doc/diagram/tutorial.dot
new file mode 100644
index 00000000000..138ddc381d4
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/tutorial.dot
@@ -0,0 +1,58 @@
+digraph {
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.2
+ penwidth=0.5
+
+ node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+ edge [fontname="Inconsolata, Consolas", fontsize=10]
+
+ subgraph cluster1 {
+ margin="10,10"
+ labeljust="left"
+ label = "Document"
+ style=filled
+ fillcolor=gray95
+ node [shape=Mrecord, style=filled, colorscheme=spectral7]
+
+ root [label="{object|}", fillcolor=3]
+
+ {
+ hello [label="{string|\"hello\"}", fillcolor=5]
+ t [label="{string|\"t\"}", fillcolor=5]
+ f [label="{string|\"f\"}", fillcolor=5]
+ n [label="{string|\"n\"}", fillcolor=5]
+ i [label="{string|\"i\"}", fillcolor=5]
+ pi [label="{string|\"pi\"}", fillcolor=5]
+ a [label="{string|\"a\"}", fillcolor=5]
+
+ world [label="{string|\"world\"}", fillcolor=5]
+ true [label="{true|}", fillcolor=7]
+ false [label="{false|}", fillcolor=2]
+ null [label="{null|}", fillcolor=1]
+ i1 [label="{number|123}", fillcolor=6]
+ pi1 [label="{number|3.1416}", fillcolor=6]
+ array [label="{array|size=4}", fillcolor=4]
+
+ a1 [label="{number|1}", fillcolor=6]
+ a2 [label="{number|2}", fillcolor=6]
+ a3 [label="{number|3}", fillcolor=6]
+ a4 [label="{number|4}", fillcolor=6]
+ }
+
+ edge [arrowhead=vee]
+ root -> { hello; t; f; n; i; pi; a }
+ array -> { a1; a2; a3; a4 }
+
+ edge [arrowhead=none]
+ hello -> world
+ t -> true
+ f -> false
+ n -> null
+ i -> i1
+ pi -> pi1
+ a -> array
+ }
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/tutorial.png b/3rdparty/rapidjson/doc/diagram/tutorial.png
new file mode 100644
index 00000000000..8a12924acdd
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/tutorial.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/diagram/utilityclass.dot b/3rdparty/rapidjson/doc/diagram/utilityclass.dot
new file mode 100644
index 00000000000..1492a8a7af6
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/utilityclass.dot
@@ -0,0 +1,73 @@
+digraph {
+ rankdir=LR
+ compound=true
+ fontname="Inconsolata, Consolas"
+ fontsize=10
+ margin="0,0"
+ ranksep=0.3
+ nodesep=0.15
+ penwidth=0.5
+ colorscheme=spectral7
+
+ node [shape=box, fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, style=filled, fillcolor=white]
+ edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
+
+ subgraph cluster0 {
+ style=filled
+ fillcolor=4
+
+ Encoding [label="<<concept>>\nEncoding"]
+
+ edge [arrowtail=onormal, dir=back]
+ Encoding -> { UTF8; UTF16; UTF32; ASCII; AutoUTF }
+ UTF16 -> { UTF16LE; UTF16BE }
+ UTF32 -> { UTF32LE; UTF32BE }
+ }
+
+ subgraph cluster1 {
+ style=filled
+ fillcolor=5
+
+ Stream [label="<<concept>>\nStream"]
+ InputByteStream [label="<<concept>>\nInputByteStream"]
+ OutputByteStream [label="<<concept>>\nOutputByteStream"]
+
+ edge [arrowtail=onormal, dir=back]
+ Stream -> {
+ StringStream; InsituStringStream; StringBuffer;
+ EncodedInputStream; EncodedOutputStream;
+ AutoUTFInputStream; AutoUTFOutputStream
+ InputByteStream; OutputByteStream
+ }
+
+ InputByteStream -> { MemoryStream; FlieReadStream }
+ OutputByteStream -> { MemoryBuffer; FileWriteStream }
+ }
+
+ subgraph cluster2 {
+ style=filled
+ fillcolor=3
+
+ Allocator [label="<<concept>>\nAllocator"]
+
+ edge [arrowtail=onormal, dir=back]
+ Allocator -> { CrtAllocator; MemoryPoolAllocator }
+ }
+
+ {
+ edge [arrowtail=odiamond, arrowhead=vee, dir=both]
+ EncodedInputStream -> InputByteStream
+ EncodedOutputStream -> OutputByteStream
+ AutoUTFInputStream -> InputByteStream
+ AutoUTFOutputStream -> OutputByteStream
+ MemoryPoolAllocator -> Allocator [label="base", tailport=s]
+ }
+
+ {
+ edge [arrowhead=vee, style=dashed]
+ AutoUTFInputStream -> AutoUTF
+ AutoUTFOutputStream -> AutoUTF
+ }
+
+ //UTF32LE -> Stream [style=invis]
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/diagram/utilityclass.png b/3rdparty/rapidjson/doc/diagram/utilityclass.png
new file mode 100644
index 00000000000..ce029a4d067
--- /dev/null
+++ b/3rdparty/rapidjson/doc/diagram/utilityclass.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/dom.md b/3rdparty/rapidjson/doc/dom.md
new file mode 100644
index 00000000000..cb25fc4f3af
--- /dev/null
+++ b/3rdparty/rapidjson/doc/dom.md
@@ -0,0 +1,277 @@
+# DOM
+
+Document Object Model(DOM) is an in-memory representation of JSON for query and manipulation. The basic usage of DOM is described in [Tutorial](doc/tutorial.md). This section will describe some details and more advanced usages.
+
+[TOC]
+
+# Template {#Template}
+
+In the tutorial, `Value` and `Document` was used. Similarly to `std::string`, these are actually `typedef` of template classes:
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericValue {
+ // ...
+};
+
+template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericDocument : public GenericValue<Encoding, Allocator> {
+ // ...
+};
+
+typedef GenericValue<UTF8<> > Value;
+typedef GenericDocument<UTF8<> > Document;
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+User can customize these template parameters.
+
+## Encoding {#Encoding}
+
+The `Encoding` parameter specifies the encoding of JSON String value in memory. Possible options are `UTF8`, `UTF16`, `UTF32`. Note that, these 3 types are also template class. `UTF8<>` is `UTF8<char>`, which means using char to store the characters. You may refer to [Encoding](doc/encoding.md) for details.
+
+Suppose a Windows application would query localization strings stored in JSON files. Unicode-enabled functions in Windows use UTF-16 (wide character) encoding. No matter what encoding was used in JSON files, we can store the strings in UTF-16 in memory.
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+
+typedef GenericDocument<UTF16<> > WDocument;
+typedef GenericValue<UTF16<> > WValue;
+
+FILE* fp = fopen("localization.json", "rb"); // non-Windows use "r"
+
+char readBuffer[256];
+FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
+
+AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // wraps bis into eis
+
+WDocument d;
+d.ParseStream<0, AutoUTF<unsigned> >(eis);
+
+const WValue locale(L"ja"); // Japanese
+
+MessageBoxW(hWnd, d[locale].GetString(), L"Test", MB_OK);
+~~~~~~~~~~
+
+## Allocator {#Allocator}
+
+The `Allocator` defines which allocator class is used when allocating/deallocating memory for `Document`/`Value`. `Document` owns, or references to an `Allocator` instance. On the other hand, `Value` does not do so, in order to reduce memory consumption.
+
+The default allocator used in `GenericDocument` is `MemoryPoolAllocator`. This allocator actually allocate memory sequentially, and cannot deallocate one by one. This is very suitable when parsing a JSON into a DOM tree.
+
+Another allocator is `CrtAllocator`, of which CRT is short for C RunTime library. This allocator simply calls the standard `malloc()`/`realloc()`/`free()`. When there is a lot of add and remove operations, this allocator may be preferred. But this allocator is far less efficient than `MemoryPoolAllocator`.
+
+# Parsing {#Parsing}
+
+`Document` provides several functions for parsing. In below, (1) is the fundamental function, while the others are helpers which call (1).
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+
+// (1) Fundamental
+template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
+GenericDocument& GenericDocument::ParseStream(InputStream& is);
+
+// (2) Using the same Encoding for stream
+template <unsigned parseFlags, typename InputStream>
+GenericDocument& GenericDocument::ParseStream(InputStream& is);
+
+// (3) Using default parse flags
+template <typename InputStream>
+GenericDocument& GenericDocument::ParseStream(InputStream& is);
+
+// (4) In situ parsing
+template <unsigned parseFlags>
+GenericDocument& GenericDocument::ParseInsitu(Ch* str);
+
+// (5) In situ parsing, using default parse flags
+GenericDocument& GenericDocument::ParseInsitu(Ch* str);
+
+// (6) Normal parsing of a string
+template <unsigned parseFlags, typename SourceEncoding>
+GenericDocument& GenericDocument::Parse(const Ch* str);
+
+// (7) Normal parsing of a string, using same Encoding of Document
+template <unsigned parseFlags>
+GenericDocument& GenericDocument::Parse(const Ch* str);
+
+// (8) Normal parsing of a string, using default parse flags
+GenericDocument& GenericDocument::Parse(const Ch* str);
+~~~~~~~~~~
+
+The examples of [tutorial](doc/tutorial.md) uses (8) for normal parsing of string. The examples of [stream](doc/stream.md) uses the first three. *In situ* parsing will be described soon.
+
+The `parseFlags` are combination of the following bit-flags:
+
+Parse flags | Meaning
+------------------------------|-----------------------------------
+`kParseNoFlags` | No flag is set.
+`kParseDefaultFlags` | Default parse flags. It is equal to macro `RAPIDJSON_PARSE_DEFAULT_FLAGS`, which is defined as `kParseNoFlags`.
+`kParseInsituFlag` | In-situ(destructive) parsing.
+`kParseValidateEncodingFlag` | Validate encoding of JSON strings.
+`kParseIterativeFlag` | Iterative(constant complexity in terms of function call stack size) parsing.
+`kParseStopWhenDoneFlag` | After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate `kParseErrorDocumentRootNotSingular` error. Using this flag for parsing multiple JSONs in the same stream.
+`kParseFullPrecisionFlag` | Parse number in full precision (slower). If this flag is not set, the normal precision (faster) is used. Normal precision has maximum 3 [ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) error.
+`kParseCommentsFlag` | Allow one-line `// ...` and multi-line `/* ... */` comments (relaxed JSON syntax).
+
+By using a non-type template parameter, instead of a function parameter, C++ compiler can generate code which is optimized for specified combinations, improving speed, and reducing code size (if only using a single specialization). The downside is the flags needed to be determined in compile-time.
+
+The `SourceEncoding` parameter defines what encoding is in the stream. This can be differed to the `Encoding` of the `Document`. See [Transcoding and Validation](#TranscodingAndValidation) section for details.
+
+And the `InputStream` is type of input stream.
+
+## Parse Error {#ParseError}
+
+When the parse processing succeeded, the `Document` contains the parse results. When there is an error, the original DOM is *unchanged*. And the error state of parsing can be obtained by `bool HasParseError()`, `ParseErrorCode GetParseError()` and `size_t GetParseOffset()`.
+
+Parse Error Code | Description
+--------------------------------------------|---------------------------------------------------
+`kParseErrorNone` | No error.
+`kParseErrorDocumentEmpty` | The document is empty.
+`kParseErrorDocumentRootNotSingular` | The document root must not follow by other values.
+`kParseErrorValueInvalid` | Invalid value.
+`kParseErrorObjectMissName` | Missing a name for object member.
+`kParseErrorObjectMissColon` | Missing a colon after a name of object member.
+`kParseErrorObjectMissCommaOrCurlyBracket` | Missing a comma or `}` after an object member.
+`kParseErrorArrayMissCommaOrSquareBracket` | Missing a comma or `]` after an array element.
+`kParseErrorStringUnicodeEscapeInvalidHex` | Incorrect hex digit after `\\u` escape in string.
+`kParseErrorStringUnicodeSurrogateInvalid` | The surrogate pair in string is invalid.
+`kParseErrorStringEscapeInvalid` | Invalid escape character in string.
+`kParseErrorStringMissQuotationMark` | Missing a closing quotation mark in string.
+`kParseErrorStringInvalidEncoding` | Invalid encoding in string.
+`kParseErrorNumberTooBig` | Number too big to be stored in `double`.
+`kParseErrorNumberMissFraction` | Miss fraction part in number.
+`kParseErrorNumberMissExponent` | Miss exponent in number.
+
+The offset of error is defined as the character number from beginning of stream. Currently RapidJSON does not keep track of line number.
+
+To get an error message, RapidJSON provided a English messages in `rapidjson/error/en.h`. User can customize it for other locales, or use a custom localization system.
+
+Here shows an example of parse error handling.
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+#include "rapidjson/error/en.h"
+
+// ...
+Document d;
+if (d.Parse(json).HasParseError()) {
+ fprintf(stderr, "\nError(offset %u): %s\n",
+ (unsigned)d.GetErrorOffset(),
+ GetParseError_En(d.GetParseErrorCode()));
+ // ...
+}
+~~~~~~~~~~
+
+## In Situ Parsing {#InSituParsing}
+
+From [Wikipedia](http://en.wikipedia.org/wiki/In_situ):
+
+> *In situ* ... is a Latin phrase that translates literally to "on site" or "in position". It means "locally", "on site", "on the premises" or "in place" to describe an event where it takes place, and is used in many different contexts.
+> ...
+> (In computer science) An algorithm is said to be an in situ algorithm, or in-place algorithm, if the extra amount of memory required to execute the algorithm is O(1), that is, does not exceed a constant no matter how large the input. For example, heapsort is an in situ sorting algorithm.
+
+In normal parsing process, a large overhead is to decode JSON strings and copy them to other buffers. *In situ* parsing decodes those JSON string at the place where it is stored. It is possible in JSON because the length of decoded string is always shorter than or equal to the one in JSON. In this context, decoding a JSON string means to process the escapes, such as `"\n"`, `"\u1234"`, etc., and add a null terminator (`'\0'`)at the end of string.
+
+The following diagrams compare normal and *in situ* parsing. The JSON string values contain pointers to the decoded string.
+
+![normal parsing](diagram/normalparsing.png)
+
+In normal parsing, the decoded string are copied to freshly allocated buffers. `"\\n"` (2 characters) is decoded as `"\n"` (1 character). `"\\u0073"` (6 characters) is decoded as `"s"` (1 character).
+
+![instiu parsing](diagram/insituparsing.png)
+
+*In situ* parsing just modified the original JSON. Updated characters are highlighted in the diagram. If the JSON string does not contain escape character, such as `"msg"`, the parsing process merely replace the closing double quotation mark with a null character.
+
+Since *in situ* parsing modify the input, the parsing API needs `char*` instead of `const char*`.
+
+~~~~~~~~~~cpp
+// Read whole file into a buffer
+FILE* fp = fopen("test.json", "r");
+fseek(fp, 0, SEEK_END);
+size_t filesize = (size_t)ftell(fp);
+fseek(fp, 0, SEEK_SET);
+char* buffer = (char*)malloc(filesize + 1);
+size_t readLength = fread(buffer, 1, filesize, fp);
+buffer[readLength] = '\0';
+fclose(fp);
+
+// In situ parsing the buffer into d, buffer will also be modified
+Document d;
+d.ParseInsitu(buffer);
+
+// Query/manipulate the DOM here...
+
+free(buffer);
+// Note: At this point, d may have dangling pointers pointed to the deallocated buffer.
+~~~~~~~~~~
+
+The JSON strings are marked as const-string. But they may not be really "constant". The life cycle of it depends on the JSON buffer.
+
+In situ parsing minimizes allocation overheads and memory copying. Generally this improves cache coherence, which is an important factor of performance in modern computer.
+
+There are some limitations of *in situ* parsing:
+
+1. The whole JSON is in memory.
+2. The source encoding in stream and target encoding in document must be the same.
+3. The buffer need to be retained until the document is no longer used.
+4. If the DOM need to be used for long period after parsing, and there are few JSON strings in the DOM, retaining the buffer may be a memory waste.
+
+*In situ* parsing is mostly suitable for short-term JSON that only need to be processed once, and then be released from memory. In practice, these situation is very common, for example, deserializing JSON to C++ objects, processing web requests represented in JSON, etc.
+
+## Transcoding and Validation {#TranscodingAndValidation}
+
+RapidJSON supports conversion between Unicode formats (officially termed UCS Transformation Format) internally. During DOM parsing, the source encoding of the stream can be different from the encoding of the DOM. For example, the source stream contains a UTF-8 JSON, while the DOM is using UTF-16 encoding. There is an example code in [EncodedInputStream](doc/stream.md).
+
+When writing a JSON from DOM to output stream, transcoding can also be used. An example is in [EncodedOutputStream](doc/stream.md).
+
+During transcoding, the source string is decoded to into Unicode code points, and then the code points are encoded in the target format. During decoding, it will validate the byte sequence in the source string. If it is not a valid sequence, the parser will be stopped with `kParseErrorStringInvalidEncoding` error.
+
+When the source encoding of stream is the same as encoding of DOM, by default, the parser will *not* validate the sequence. User may use `kParseValidateEncodingFlag` to force validation.
+
+# Techniques {#Techniques}
+
+Some techniques about using DOM API is discussed here.
+
+## DOM as SAX Event Publisher
+
+In RapidJSON, stringifying a DOM with `Writer` may be look a little bit weired.
+
+~~~~~~~~~~cpp
+// ...
+Writer<StringBuffer> writer(buffer);
+d.Accept(writer);
+~~~~~~~~~~
+
+Actually, `Value::Accept()` is responsible for publishing SAX events about the value to the handler. With this design, `Value` and `Writer` are decoupled. `Value` can generate SAX events, and `Writer` can handle those events.
+
+User may create custom handlers for transforming the DOM into other formats. For example, a handler which converts the DOM into XML.
+
+For more about SAX events and handler, please refer to [SAX](doc/sax.md).
+
+## User Buffer {#UserBuffer}
+
+Some applications may try to avoid memory allocations whenever possible.
+
+`MemoryPoolAllocator` can support this by letting user to provide a buffer. The buffer can be on the program stack, or a "scratch buffer" which is statically allocated (a static/global array) for storing temporary data.
+
+`MemoryPoolAllocator` will use the user buffer to satisfy allocations. When the user buffer is used up, it will allocate a chunk of memory from the base allocator (by default the `CrtAllocator`).
+
+Here is an example of using stack memory. The first allocator is for storing values, while the second allocator is for storing temporary data during parsing.
+
+~~~~~~~~~~cpp
+typedef GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<>> DocumentType;
+char valueBuffer[4096];
+char parseBuffer[1024];
+MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer));
+MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer));
+DocumentType d(&valueAllocator, sizeof(parseBuffer), &parseAllocator);
+d.Parse(json);
+~~~~~~~~~~
+
+If the total size of allocation is less than 4096+1024 bytes during parsing, this code does not invoke any heap allocation (via `new` or `malloc()`) at all.
+
+User can query the current memory consumption in bytes via `MemoryPoolAllocator::Size()`. And then user can determine a suitable size of user buffer.
diff --git a/3rdparty/rapidjson/doc/dom.zh-cn.md b/3rdparty/rapidjson/doc/dom.zh-cn.md
new file mode 100644
index 00000000000..2adf34354b5
--- /dev/null
+++ b/3rdparty/rapidjson/doc/dom.zh-cn.md
@@ -0,0 +1,281 @@
+# DOM
+
+文档对象模型(Document Object Model, DOM)是一ç§ç½äºŽå†…存中的JSON表示方å¼ï¼Œä»¥ä¾›æŸ¥è¯¢åŠæ“作。我们己于[教程](doc/tutorial.md)中介ç»äº†DOM的基本用法,本节将讲述一些细节åŠé«˜çº§ç”¨æ³•。
+
+[TOC]
+
+# æ¨¡æ¿ {#Template}
+
+教程中使用了`Value`å’Œ`Document`类型。与`std::string`相似,这些类型其实是两个模æ¿ç±»çš„`typedef`:
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericValue {
+ // ...
+};
+
+template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericDocument : public GenericValue<Encoding, Allocator> {
+ // ...
+};
+
+typedef GenericValue<UTF8<> > Value;
+typedef GenericDocument<UTF8<> > Document;
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+使用者å¯ä»¥è‡ªå®šä¹‰è¿™äº›æ¨¡æ¿å‚数。
+
+## ç¼–ç  {#Encoding}
+
+`Encoding`傿•°æŒ‡æ˜Žåœ¨å†…存中的JSON String使用哪ç§ç¼–ç ã€‚å¯è¡Œçš„选项有`UTF8`ã€`UTF16`ã€`UTF32`ã€‚è¦æ³¨æ„è¿™3个类型其实也是模æ¿ç±»ã€‚`UTF8<>`ç­‰åŒ`UTF8<char>`,这代表它使用`char`æ¥å­˜å‚¨å­—符串。更多细节å¯ä»¥å‚考[ç¼–ç ](encoding.md)。
+
+这里是一个例å­ã€‚å‡è®¾ä¸€ä¸ªWindows应用软件希望查询存储于JSON中的本地化字符串。Windows中å«Unicode的函数使用UTF-16(宽字符)编ç ã€‚无论JSON文件使用哪ç§ç¼–ç ï¼Œæˆ‘们都å¯ä»¥æŠŠå­—符串以UTF-16å½¢å¼å­˜å‚¨åœ¨å†…存。
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+
+typedef GenericDocument<UTF16<> > WDocument;
+typedef GenericValue<UTF16<> > WValue;
+
+FILE* fp = fopen("localization.json", "rb"); // éžWindowså¹³å°ä½¿ç”¨"r"
+
+char readBuffer[256];
+FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
+
+AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // 包装bisæˆeis
+
+WDocument d;
+d.ParseStream<0, AutoUTF<unsigned> >(eis);
+
+const WValue locale(L"ja"); // Japanese
+
+MessageBoxW(hWnd, d[locale].GetString(), L"Test", MB_OK);
+~~~~~~~~~~
+
+## 分é…器 {#Allocator}
+
+`Allocator`定义当`Document`/`Value`åˆ†é…æˆ–释放内存时使用那个分é…类。`Document`拥有或引用到一个`Allocator`实例。而为了节çœå†…存,`Value`没有这么åšã€‚
+
+`GenericDocument`的缺çœåˆ†é…器是`MemoryPoolAllocator`。此分é…器实际上会顺åºåœ°åˆ†é…内存,并且ä¸èƒ½é€ä¸€é‡Šæ”¾ã€‚当è¦è§£æžä¸€ä¸ªJSON并生æˆDOM,这ç§åˆ†é…器是éžå¸¸åˆé€‚的。
+
+RapidJSON还æä¾›å¦ä¸€ä¸ªåˆ†é…器`CrtAllocator`,当中CRT是Cè¿è¡Œåº“(C RunTime library)的缩写。此分é…器简å•地读用标准的`malloc()`/`realloc()`/`free()`。当我们需è¦è®¸å¤šå¢žå‡æ“作,这ç§åˆ†é…器会更为适åˆã€‚然而这ç§åˆ†é…器远远比`MemoryPoolAllocator`低效。
+
+# è§£æž {#Parsing}
+
+`Document`æä¾›å‡ ä¸ªè§£æžå‡½æ•°ã€‚以下的(1)是根本的函数,其他都是调用(1)çš„å助函数。
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+
+// (1) 根本
+template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
+GenericDocument& GenericDocument::ParseStream(InputStream& is);
+
+// (2) 使用æµçš„ç¼–ç 
+template <unsigned parseFlags, typename InputStream>
+GenericDocument& GenericDocument::ParseStream(InputStream& is);
+
+// (3) ä½¿ç”¨ç¼ºçœæ ‡å¿—
+template <typename InputStream>
+GenericDocument& GenericDocument::ParseStream(InputStream& is);
+
+// (4) 原ä½è§£æž
+template <unsigned parseFlags>
+GenericDocument& GenericDocument::ParseInsitu(Ch* str);
+
+// (5) 原ä½è§£æžï¼Œä½¿ç”¨ç¼ºçœæ ‡å¿—
+GenericDocument& GenericDocument::ParseInsitu(Ch* str);
+
+// (6) 正常解æžä¸€ä¸ªå­—符串
+template <unsigned parseFlags, typename SourceEncoding>
+GenericDocument& GenericDocument::Parse(const Ch* str);
+
+// (7) 正常解æžä¸€ä¸ªå­—符串,使用Document的编ç 
+template <unsigned parseFlags>
+GenericDocument& GenericDocument::Parse(const Ch* str);
+
+// (8) 正常解æžä¸€ä¸ªå­—ç¬¦ä¸²ï¼Œä½¿ç”¨ç¼ºçœæ ‡å¿—
+GenericDocument& GenericDocument::Parse(const Ch* str);
+~~~~~~~~~~
+
+[教程](tutorial.md)中的例使用(8)去正常解æžå­—符串。而[æµ](stream.md)的例å­ä½¿ç”¨å‰3个函数。我们将ç¨åŽä»‹ç»åŽŸä½ï¼ˆ*In situ*) è§£æžã€‚
+
+`parseFlags`æ˜¯ä»¥ä¸‹ä½æ ‡ç½®çš„组åˆï¼š
+
+è§£æžä½æ ‡å¿— | æ„义
+------------------------------|-----------------------------------
+`kParseNoFlags` | 没有任何标志。
+`kParseDefaultFlags` | 缺çœçš„è§£æžé€‰é¡¹ã€‚它等于`RAPIDJSON_PARSE_DEFAULT_FLAGS`å®ï¼Œæ­¤å®å®šä¹‰ä¸º`kParseNoFlags`。
+`kParseInsituFlag` | 原ä½ï¼ˆç ´å性)解æžã€‚
+`kParseValidateEncodingFlag` | 校验JSON字符串的编ç ã€‚
+`kParseIterativeFlag` | 迭代å¼ï¼ˆè°ƒç”¨å †æ ˆå¤§å°ä¸ºå¸¸æ•°å¤æ‚度)解æžã€‚
+`kParseStopWhenDoneFlag` | 当从æµè§£æžäº†ä¸€ä¸ªå®Œæ•´çš„JSON根节点之åŽï¼Œåœæ­¢ç»§ç»­å¤„ç†ä½™ä¸‹çš„æµã€‚å½“ä½¿ç”¨äº†æ­¤æ ‡å¿—ï¼Œè§£æžå™¨ä¾¿ä¸ä¼šäº§ç”Ÿ`kParseErrorDocumentRootNotSingular`错误。å¯ä½¿ç”¨æœ¬æ ‡å¿—去解æžåŒä¸€ä¸ªæµé‡Œçš„多个JSON。
+`kParseFullPrecisionFlag` | ä½¿ç”¨å®Œæ•´çš„ç²¾ç¡®åº¦åŽ»è§£æžæ•°å­—(较慢)。如ä¸è®¾ç½®æ­¤æ ‡èŠ‚ï¼Œåˆ™ä¼šä½¿ç”¨æ­£å¸¸çš„ç²¾ç¡®åº¦ï¼ˆè¾ƒå¿«ï¼‰ã€‚æ­£å¸¸ç²¾ç¡®åº¦ä¼šæœ‰æœ€å¤š3个[ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place)的误差。
+`kParseCommentsFlag` | 容许å•行 `// ...` åŠå¤šè¡Œ `/* ... */` 注释(放宽的JSON语法)。
+
+由于使用了éžç±»åž‹æ¨¡æ¿å‚æ•°ï¼Œè€Œä¸æ˜¯å‡½æ•°å‚数,C++编译器能为个别组åˆç”Ÿæˆä»£ç ï¼Œä»¥æ”¹å–„性能åŠå‡å°‘代ç å°ºå¯¸ï¼ˆå½“åªç”¨å•ç§ç‰¹åŒ–)。缺点是需è¦åœ¨ç¼–译期决定标志。
+
+`SourceEncoding`傿•°å®šä¹‰æµä½¿ç”¨äº†ä»€ä¹ˆç¼–ç ã€‚这与`Document`çš„`Encoding`ä¸ç›¸åŒã€‚细节å¯å‚考[转ç å’Œæ ¡éªŒ](#TranscodingAndValidation)一节。
+
+此外`InputStream`是输入æµçš„类型。
+
+## è§£æžé”™è¯¯ {#ParseError}
+
+当解æžè¿‡ç¨‹é¡ºåˆ©å®Œæˆï¼Œ`Document`ä¾¿ä¼šå«æœ‰è§£æžç»“果。当过程出现错误,原æ¥çš„DOM会*ç»´æŒä¸ä¾¿*。å¯ä½¿ç”¨`bool HasParseError()`ã€`ParseErrorCode GetParseError()`åŠ`size_t GetParseOffset()`获å–è§£æžçš„错误状æ€ã€‚
+
+è§£æžé”™è¯¯ä»£å· | æè¿°
+--------------------------------------------|---------------------------------------------------
+`kParseErrorNone` | 无错误。
+`kParseErrorDocumentEmpty` | 文档是空的。
+`kParseErrorDocumentRootNotSingular` | 文档的根åŽé¢ä¸èƒ½æœ‰å…¶å®ƒå€¼ã€‚
+`kParseErrorValueInvalid` | ä¸åˆæ³•的值。
+`kParseErrorObjectMissName` | Objectæˆå‘˜ç¼ºå°‘å字。
+`kParseErrorObjectMissColon` | Objectæˆå‘˜åå­—åŽç¼ºå°‘冒å·ã€‚
+`kParseErrorObjectMissCommaOrCurlyBracket` | Objectæˆå‘˜åŽç¼ºå°‘逗巿ˆ–`}`。
+`kParseErrorArrayMissCommaOrSquareBracket` | Array元素åŽç¼ºå°‘逗巿ˆ–`]` 。
+`kParseErrorStringUnicodeEscapeInvalidHex` | String中的`\\u`转义符åŽå«éžåå…­è¿›ä½æ•°å­—。
+`kParseErrorStringUnicodeSurrogateInvalid` | String中的代ç†å¯¹ï¼ˆsurrogate pair)ä¸åˆæ³•。
+`kParseErrorStringEscapeInvalid` | Stringå«éžæ³•转义字符。
+`kParseErrorStringMissQuotationMark` | String缺少关闭引å·ã€‚
+`kParseErrorStringInvalidEncoding` | Stringå«éžæ³•ç¼–ç ã€‚
+`kParseErrorNumberTooBig` | Number的值太大,ä¸èƒ½å­˜å‚¨äºŽ`double`。
+`kParseErrorNumberMissFraction` | Numberç¼ºå°‘äº†å°æ•°éƒ¨åˆ†ã€‚
+`kParseErrorNumberMissExponent` | Number缺少了指数。
+
+错误的åç§»é‡å®šä¹‰ä¸ºä»Žæµå¼€å§‹è‡³é”™è¯¯å¤„的字符数é‡ã€‚ç›®å‰RapidJSONä¸è®°å½•错误行å·ã€‚
+
+è¦å–得错误讯æ¯ï¼ŒRapidJSON在`rapidjson/error/en.h`中æä¾›äº†è‹±æ–‡é”™è¯¯è®¯æ¯ã€‚使用者å¯ä»¥ä¿®æ”¹å®ƒç”¨äºŽå…¶ä»–语言环境,或使用一个自定义的本地化系统。
+
+以下是一个处ç†é”™è¯¯çš„例å­ã€‚
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+#include "rapidjson/error/en.h"
+
+// ...
+Document d;
+if (d.Parse(json).HasParseError()) {
+ fprintf(stderr, "\nError(offset %u): %s\n",
+ (unsigned)d.GetErrorOffset(),
+ GetParseError_En(d.GetParseErrorCode()));
+ // ...
+}
+~~~~~~~~~~
+
+## 原ä½è§£æž {#InSituParsing}
+
+æ ¹æ®[维基百科](http://en.wikipedia.org/wiki/In_situ):
+
+> *In situ* ... is a Latin phrase that translates literally to "on site" or "in position". It means "locally", "on site", "on the premises" or "in place" to describe an event where it takes place, and is used in many different contexts.
+> ...
+> (In computer science) An algorithm is said to be an in situ algorithm, or in-place algorithm, if the extra amount of memory required to execute the algorithm is O(1), that is, does not exceed a constant no matter how large the input. For example, heapsort is an in situ sorting algorithm.
+
+> 翻译:*In situ*â€¦â€¦æ˜¯ä¸€ä¸ªæ‹‰ä¸æ–‡ç‰‡è¯­ï¼Œå­—é¢ä¸Šçš„æ„æ€æ˜¯æŒ‡ã€ŒçŽ°åœºã€ã€ã€Œåœ¨ä½ç½®ã€ã€‚在许多ä¸åŒè¯­å¢ƒä¸­ï¼Œå®ƒæè¿°ä¸€ä¸ªäº‹ä»¶å‘生的ä½ç½®ï¼Œæ„指「本地ã€ã€ã€ŒçŽ°åœºã€ã€ã€Œåœ¨å¤„所ã€ã€ã€Œå°±ä½ã€ã€‚
+> ……
+> (在计算机科学中)一个算法若称为原ä½ç®—法,或在ä½ç®—法,是指执行该算法所需的é¢å¤–内存空间是O(1)的,æ¢å¥è¯è¯´ï¼Œæ— è®ºè¾“入大å°éƒ½åªéœ€è¦å¸¸æ•°ç©ºé—´ã€‚ä¾‹å¦‚ï¼Œå †æŽ’åºæ˜¯ä¸€ä¸ªåŽŸä½æŽ’åºç®—法。
+
+在正常的解æžè¿‡ç¨‹ä¸­ï¼Œå¯¹JSON stringè§£ç å¹¶å¤åˆ¶è‡³å…¶ä»–缓冲区是一个很大的开销。原ä½è§£æžï¼ˆ*in situ* parsing)把这些JSON string直接解ç äºŽå®ƒåŽŸæ¥å­˜å‚¨çš„地方。由于解ç åŽçš„string长度总是短于或等于原æ¥å‚¨å­˜äºŽJSONçš„string,所以这是å¯è¡Œçš„。在这个语境下,对JSON stringè¿›è¡Œè§£ç æ˜¯æŒ‡å¤„ç†è½¬ä¹‰ç¬¦ï¼Œå¦‚`"\n"`ã€`"\u1234"`等,以åŠåœ¨string末端加入空终止符å·(`'\0'`)。
+
+以下的图比较正常åŠåŽŸä½è§£æžã€‚JSON stringå€¼åŒ…å«æŒ‡å‘è§£ç åŽçš„字符串。
+
+![正常解æž](diagram/normalparsing.png)
+
+在正常解æžä¸­ï¼Œè§£ç åŽçš„字符串被å¤åˆ¶è‡³å…¨æ–°åˆ†é…的缓冲区中。`"\\n"`(2ä¸ªå­—ç¬¦ï¼‰è¢«è§£ç æˆ`"\n"`(1个字符)。`"\\u0073"`(6ä¸ªå­—ç¬¦ï¼‰è¢«è§£ç æˆ`"s"`(1个字符)。
+
+![原ä½è§£æž](diagram/insituparsing.png)
+
+原ä½è§£æžç›´æŽ¥ä¿®æ”¹äº†åŽŸæ¥çš„JSON。图中高亮了被更新的字符。若JSON stringä¸å«è½¬ä¹‰ç¬¦ï¼Œä¾‹å¦‚`"msg"`,那么解æžè¿‡ç¨‹ä»…仅是以空字符代替结æŸåŒå¼•å·ã€‚
+
+由于原ä½è§£æžä¿®æ”¹äº†è¾“入,其解æžAPI需è¦`char*`而éž`const char*`。
+
+~~~~~~~~~~cpp
+// 把整个文件读入buffer
+FILE* fp = fopen("test.json", "r");
+fseek(fp, 0, SEEK_END);
+size_t filesize = (size_t)ftell(fp);
+fseek(fp, 0, SEEK_SET);
+char* buffer = (char*)malloc(filesize + 1);
+size_t readLength = fread(buffer, 1, filesize, fp);
+buffer[readLength] = '\0';
+fclose(fp);
+
+// 原ä½è§£æžbuffer至d,buffer内容会被修改。
+Document d;
+d.ParseInsitu(buffer);
+
+// 在此查询ã€ä¿®æ”¹DOM……
+
+free(buffer);
+// 注æ„:在这个ä½ç½®ï¼Œdå¯èƒ½å«æœ‰æŒ‡å‘已被释放的buffer的悬空指针
+~~~~~~~~~~
+
+JSON string会被打上const-string的标志。但它们å¯èƒ½å¹¶éžçœŸæ­£çš„「常数ã€ã€‚它的生命周期å–决于存储JSON的缓冲区。
+
+原ä½è§£æžæŠŠåˆ†é…开销åŠå†…å­˜å¤åˆ¶å‡è‡³æœ€å°ã€‚通常这样åšèƒ½æ”¹å–„缓存一致性,而这对现代计算机æ¥è¯´æ˜¯ä¸€ä¸ªé‡è¦çš„æ€§èƒ½å› ç´ ã€‚
+
+原ä½è§£æžæœ‰ä»¥ä¸‹é™åˆ¶ï¼š
+
+1. 整个JSON须存储在内存之中。
+2. æµçš„æ¥æºç¼“ç ä¸Žæ–‡æ¡£çš„目标编ç å¿…须相åŒã€‚
+3. 需è¦ä¿ç•™ç¼“冲区,直至文档ä¸å†è¢«ä½¿ç”¨ã€‚
+4. è‹¥DOM需è¦åœ¨è§£æžåŽè¢«é•¿æœŸä½¿ç”¨ï¼Œè€ŒDOMå†…åªæœ‰å¾ˆå°‘JSON string,ä¿ç•™ç¼“冲区å¯èƒ½é€ æˆå†…存浪费。
+
+原ä½è§£æžæœ€é€‚åˆç”¨äºŽçŸ­æœŸçš„ã€ç”¨å®Œå³å¼ƒçš„JSONã€‚å®žé™…åº”ç”¨ä¸­ï¼Œè¿™äº›åœºåˆæ˜¯éžå¸¸æ™®é的,例如ååºåˆ—化JSON至C++对象ã€å¤„ç†ä»¥JSON表示的web请求等。
+
+## 转ç ä¸Žæ ¡éªŒ {#TranscodingAndValidation}
+
+RapidJSON内部支æŒä¸åŒUnicodeæ ¼å¼ï¼ˆæ­£å¼çš„æœ¯è¯­æ˜¯UCSå˜æ¢æ ¼å¼ï¼‰é—´çš„转æ¢ã€‚在DOMè§£æžæ—¶ï¼Œæµçš„æ¥æºç¼–ç ä¸ŽDOM的编ç å¯ä»¥ä¸åŒã€‚ä¾‹å¦‚ï¼Œæ¥æºæµå¯èƒ½å«æœ‰UTF-8çš„JSON,而DOM则使用UTF-16ç¼–ç ã€‚在[EncodedInputStream](doc/stream.md)一节里有一个例å­ã€‚
+
+当从DOM输出一个JSON至输出æµä¹‹æ—¶ï¼Œä¹Ÿå¯ä»¥ä½¿ç”¨è½¬ç åŠŸèƒ½ã€‚åœ¨[EncodedOutputStream](doc/stream.md)一节里有一个例å­ã€‚
+
+在转ç è¿‡ç¨‹ä¸­ï¼Œä¼šæŠŠæ¥æºstringè§£ç æˆUnicodeç ç‚¹ï¼Œç„¶åŽæŠŠç ç‚¹ç¼–ç æˆç›®æ ‡æ ¼å¼ã€‚åœ¨è§£ç æ—¶ï¼Œå®ƒä¼šæ ¡éªŒæ¥æºstring的字节åºåˆ—是å¦åˆæ³•。若é‡ä¸Šéžåˆæ³•åºåˆ—,解æžå™¨ä¼šåœæ­¢å¹¶è¿”回`kParseErrorStringInvalidEncoding`错误。
+
+å½“æ¥æºç¼–ç ä¸ŽDOM的编ç ç›¸åŒï¼Œè§£æžå™¨ç¼ºçœåœ°*ä¸ä¼š*校验åºåˆ—。使用者å¯å¼€å¯`kParseValidateEncodingFlag`去强制校验。
+
+# 技巧 {#Techniques}
+
+这里讨论一些DOM API的使用技巧。
+
+## 把DOM作为SAX事件å‘表者
+
+在RapidJSON中,利用`Writer`把DOM生æˆJSONçš„åšæ³•ï¼Œçœ‹æ¥æœ‰ç‚¹å¥‡æ€ªã€‚
+
+~~~~~~~~~~cpp
+// ...
+Writer<StringBuffer> writer(buffer);
+d.Accept(writer);
+~~~~~~~~~~
+
+实际上,`Value::Accept()`是负责å‘布该值相关的SAX事件至处ç†å™¨çš„。通过这个设计,`Value`åŠ`Writer`解除了å¶åˆã€‚`Value`å¯ç”ŸæˆSAX事件,而`Writer`则å¯ä»¥å¤„ç†è¿™äº›äº‹ä»¶ã€‚
+
+使用者å¯ä»¥åˆ›å»ºè‡ªå®šä¹‰çš„处ç†å™¨ï¼ŒåŽ»æŠŠDOMè½¬æ¢æˆå…¶å®ƒæ ¼å¼ã€‚例如,一个把DOMè½¬æ¢æˆXML的处ç†å™¨ã€‚
+
+è¦çŸ¥é“更多关于SAX事件与处ç†å™¨ï¼Œå¯å‚阅[SAX](doc/sax.md)。
+
+## 使用者缓冲区{ #UserBuffer}
+
+许多应用软件å¯èƒ½éœ€è¦å°½é‡å‡å°‘内存分é…。
+
+`MemoryPoolAllocator`å¯ä»¥å¸®åŠ©è¿™æ–¹é¢ï¼Œå®ƒå®¹è®¸ä½¿ç”¨è€…æä¾›ä¸€ä¸ªç¼“冲区。该缓冲区å¯èƒ½ç½®äºŽç¨‹åºå †æ ˆï¼Œæˆ–æ˜¯ä¸€ä¸ªé™æ€åˆ†é…的「è‰ç¨¿ç¼“冲区(scratch buffer)ã€ï¼ˆä¸€ä¸ªé™æ€ï¼å…¨å±€çš„æ•°ç»„),用于储存临时数æ®ã€‚
+
+`MemoryPoolAllocator`会先用使用者缓冲区去解决分é…请求。当使用者缓冲区用完,就会从基础分é…器(缺çœä¸º`CrtAllocator`)分é…一å—内存。
+
+以下是使用堆栈内存的例å­ï¼Œç¬¬ä¸€ä¸ªåˆ†é…å™¨ç”¨äºŽå­˜å‚¨å€¼ï¼Œç¬¬äºŒä¸ªç”¨äºŽè§£æžæ—¶çš„临时缓冲。
+
+~~~~~~~~~~cpp
+typedef GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<>> DocumentType;
+char valueBuffer[4096];
+char parseBuffer[1024];
+MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer));
+MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer));
+DocumentType d(&valueAllocator, sizeof(parseBuffer), &parseAllocator);
+d.Parse(json);
+~~~~~~~~~~
+
+è‹¥è§£æžæ—¶åˆ†é…总é‡å°‘于4096+1024字节时,这段代ç ä¸ä¼šé€ æˆä»»ä½•堆内存分é…(ç»`new`或`malloc()`)。
+
+使用者å¯ä»¥é€šè¿‡`MemoryPoolAllocator::Size()`查询当å‰å·²åˆ†çš„内存大å°ã€‚那么使用者å¯ä»¥æ‹Ÿå®šä½¿ç”¨è€…缓冲区的åˆé€‚大å°ã€‚
diff --git a/3rdparty/rapidjson/doc/encoding.md b/3rdparty/rapidjson/doc/encoding.md
new file mode 100644
index 00000000000..e9ebe8f2149
--- /dev/null
+++ b/3rdparty/rapidjson/doc/encoding.md
@@ -0,0 +1,146 @@
+# Encoding
+
+According to [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf),
+
+> (in Introduction) JSON text is a sequence of Unicode code points.
+
+The earlier [RFC4627](http://www.ietf.org/rfc/rfc4627.txt) stated that,
+
+> (in §3) JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.
+
+> (in §6) JSON may be represented using UTF-8, UTF-16, or UTF-32. When JSON is written in UTF-8, JSON is 8bit compatible. When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used.
+
+RapidJSON supports various encodings. It can also validate the encodings of JSON, and transconding JSON among encodings. All these features are implemented internally, without the need for external libraries (e.g. [ICU](http://site.icu-project.org/)).
+
+[TOC]
+
+# Unicode {#Unicode}
+From [Unicode's official website](http://www.unicode.org/standard/WhatIsUnicode.html):
+> Unicode provides a unique number for every character,
+> no matter what the platform,
+> no matter what the program,
+> no matter what the language.
+
+Those unique numbers are called code points, which is in the range `0x0` to `0x10FFFF`.
+
+## Unicode Transformation Format {#UTF}
+
+There are various encodings for storing Unicode code points. These are called Unicode Transformation Format (UTF). RapidJSON supports the most commonly used UTFs, including
+
+* UTF-8: 8-bit variable-width encoding. It maps a code point to 1–4 bytes.
+* UTF-16: 16-bit variable-width encoding. It maps a code point to 1–2 16-bit code units (i.e., 2–4 bytes).
+* UTF-32: 32-bit fixed-width encoding. It directly maps a code point to a single 32-bit code unit (i.e. 4 bytes).
+
+For UTF-16 and UTF-32, the byte order (endianness) does matter. Within computer memory, they are often stored in the computer's endianness. However, when it is stored in file or transferred over network, we need to state the byte order of the byte sequence, either little-endian (LE) or big-endian (BE).
+
+RapidJSON provide these encodings via the structs in `rapidjson/encodings.h`:
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template<typename CharType = char>
+struct UTF8;
+
+template<typename CharType = wchar_t>
+struct UTF16;
+
+template<typename CharType = wchar_t>
+struct UTF16LE;
+
+template<typename CharType = wchar_t>
+struct UTF16BE;
+
+template<typename CharType = unsigned>
+struct UTF32;
+
+template<typename CharType = unsigned>
+struct UTF32LE;
+
+template<typename CharType = unsigned>
+struct UTF32BE;
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+For processing text in memory, we normally use `UTF8`, `UTF16` or `UTF32`. For processing text via I/O, we may use `UTF8`, `UTF16LE`, `UTF16BE`, `UTF32LE` or `UTF32BE`.
+
+When using the DOM-style API, the `Encoding` template parameter in `GenericValue<Encoding>` and `GenericDocument<Encoding>` indicates the encoding to be used to represent JSON string in memory. So normally we will use `UTF8`, `UTF16` or `UTF32` for this template parameter. The choice depends on operating systems and other libraries that the application is using. For example, Windows API represents Unicode characters in UTF-16, while most Linux distributions and applications prefer UTF-8.
+
+Example of UTF-16 DOM declaration:
+
+~~~~~~~~~~cpp
+typedef GenericDocument<UTF16<> > WDocument;
+typedef GenericValue<UTF16<> > WValue;
+~~~~~~~~~~
+
+For a detail example, please check the example in [DOM's Encoding](doc/stream.md) section.
+
+## Character Type {#CharacterType}
+
+As shown in the declaration, each encoding has a `CharType` template parameter. Actually, it may be a little bit confusing, but each `CharType` stores a code unit, not a character (code point). As mentioned in previous section, a code point may be encoded to 1–4 code units for UTF-8.
+
+For `UTF16(LE|BE)`, `UTF32(LE|BE)`, the `CharType` must be integer type of at least 2 and 4 bytes respectively.
+
+Note that C++11 introduces `char16_t` and `char32_t`, which can be used for `UTF16` and `UTF32` respectively.
+
+## AutoUTF {#AutoUTF}
+
+Previous encodings are statically bound in compile-time. In other words, user must know exactly which encodings will be used in the memory or streams. However, sometimes we may need to read/write files of different encodings. The encoding needed to be decided in runtime.
+
+`AutoUTF` is an encoding designed for this purpose. It chooses which encoding to be used according to the input or output stream. Currently, it should be used with `EncodedInputStream` and `EncodedOutputStream`.
+
+## ASCII {#ASCII}
+
+Although the JSON standards did not mention about [ASCII](http://en.wikipedia.org/wiki/ASCII), sometimes we would like to write 7-bit ASCII JSON for applications that cannot handle UTF-8. Since any JSON can represent unicode characters in escaped sequence `\uXXXX`, JSON can always be encoded in ASCII.
+
+Here is an example for writing a UTF-8 DOM into ASCII:
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+Document d; // UTF8<>
+// ...
+StringBuffer buffer;
+Writer<StringBuffer, Document::EncodingType, ASCII<> > writer(buffer);
+d.Accept(writer);
+std::cout << buffer.GetString();
+~~~~~~~~~~
+
+ASCII can be used in input stream. If the input stream contains bytes with values above 127, it will cause `kParseErrorStringInvalidEncoding` error.
+
+ASCII *cannot* be used in memory (encoding of `Document` or target encoding of `Reader`), as it cannot represent Unicode code points.
+
+# Validation & Transcoding {#ValidationTranscoding}
+
+When RapidJSON parses a JSON, it can validate the input JSON, whether it is a valid sequence of a specified encoding. This option can be turned on by adding `kParseValidateEncodingFlag` in `parseFlags` template parameter.
+
+If the input encoding and output encoding is different, `Reader` and `Writer` will automatically transcode (convert) the text. In this case, `kParseValidateEncodingFlag` is not necessary, as it must decode the input sequence. And if the sequence was unable to be decoded, it must be invalid.
+
+## Transcoder {#Transcoder}
+
+Although the encoding functions in RapidJSON are designed for JSON parsing/generation, user may abuse them for transcoding of non-JSON strings.
+
+Here is an example for transcoding a string from UTF-8 to UTF-16:
+
+~~~~~~~~~~cpp
+#include "rapidjson/encodings.h"
+
+using namespace rapidjson;
+
+const char* s = "..."; // UTF-8 string
+StringStream source(s);
+GenericStringBuffer<UTF16<> > target;
+
+bool hasError = false;
+while (source.Peak() != '\0')
+ if (!Transcoder::Transcode<UTF8<>, UTF16<> >(source, target)) {
+ hasError = true;
+ break;
+ }
+
+if (!hasError) {
+ const wchar_t* t = target.GetString();
+ // ...
+}
+~~~~~~~~~~
+
+You may also use `AutoUTF` and the associated streams for setting source/target encoding in runtime.
diff --git a/3rdparty/rapidjson/doc/encoding.zh-cn.md b/3rdparty/rapidjson/doc/encoding.zh-cn.md
new file mode 100644
index 00000000000..3435c3ab942
--- /dev/null
+++ b/3rdparty/rapidjson/doc/encoding.zh-cn.md
@@ -0,0 +1,152 @@
+# ç¼–ç 
+
+æ ¹æ®[ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf):
+
+> (in Introduction) JSON text is a sequence of Unicode code points.
+>
+> 翻译:JSON文本是Unicodeç ç‚¹çš„åºåˆ—。
+
+较早的[RFC4627](http://www.ietf.org/rfc/rfc4627.txt)申明:
+
+> (in §3) JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.
+>
+> 翻译:JSON文本应该以Unicodeç¼–ç ã€‚缺çœçš„ç¼–ç ä¸ºUTF-8。
+
+> (in §6) JSON may be represented using UTF-8, UTF-16, or UTF-32. When JSON is written in UTF-8, JSON is 8bit compatible. When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used.
+>
+> 翻译:JSONå¯ä½¿ç”¨UTF-8ã€UTF-16或UTF-18表示。当JSON以UTF-8写入,该JSON是8ä½å…¼å®¹çš„。当JSON以UTF-16或UTF-32写入,就必须使用二进制的内容传é€ç¼–ç ã€‚
+
+RapidJSON支æŒå¤šç§ç¼–ç ã€‚它也能检查JSON的编ç ï¼Œä»¥åŠåœ¨ä¸åŒç¼–ç ä¸­è¿›è¡Œè½¬ç ã€‚所有这些功能都是在内部实现,无需使用外部的程åºåº“(如[ICU](http://site.icu-project.org/))。
+
+[TOC]
+
+# Unicode {#Unicode}
+æ ¹æ® [Unicode的官方网站](http://www.unicode.org/standard/translations/t-chinese.html):
+>Unicodeç»™æ¯ä¸ªå­—符æä¾›äº†ä¸€ä¸ªå”¯ä¸€çš„æ•°å­—,
+ä¸è®ºæ˜¯ä»€ä¹ˆå¹³å°ã€
+ä¸è®ºæ˜¯ä»€ä¹ˆç¨‹åºã€
+ä¸è®ºæ˜¯ä»€ä¹ˆè¯­è¨€ã€‚
+
+这些唯一数字称为ç ç‚¹ï¼ˆcode point),其范围介乎`0x0`至`0x10FFFF`之间。
+
+## Unicodeè½¬æ¢æ ¼å¼ {#UTF}
+
+存储Unicodeç ç‚¹æœ‰å¤šç§ç¼–ç æ–¹å¼ã€‚这些称为Unicodeè½¬æ¢æ ¼å¼ï¼ˆUnicode Transformation Format, UTF)。RapidJSONæ”¯æŒæœ€å¸¸ç”¨çš„UTF,包括:
+
+* UTF-8:8ä½å¯å˜é•¿åº¦ç¼–ç ã€‚它把一个ç ç‚¹æ˜ å°„至1至4个字节。
+* UTF-16:16ä½å¯å˜é•¿åº¦ç¼–ç ã€‚它把一个ç ç‚¹æ˜ å°„至1至2个16ä½ç¼–ç å•元(å³2至4个字节)。
+* UTF-32:32ä½å›ºå®šé•¿åº¦ç¼–ç ã€‚它直接把ç ç‚¹æ˜ å°„至å•个32ä½ç¼–ç å•元(å³4字节)。
+
+对于UTF-16åŠUTF-32æ¥è¯´ï¼Œå­—节åºï¼ˆendianness)是有影å“çš„ã€‚åœ¨å†…å­˜ä¸­ï¼Œå®ƒä»¬é€šå¸¸éƒ½æ˜¯ä»¥è¯¥è®¡ç®—æœºçš„å­—èŠ‚åºæ¥å­˜å‚¨ã€‚然而,当è¦å‚¨å­˜åœ¨æ–‡ä»¶ä¸­æˆ–åœ¨ç½‘ä¸Šä¼ è¾“ï¼Œæˆ‘ä»¬éœ€è¦æŒ‡æ˜Žå­—节åºåˆ—的字节åºï¼Œæ˜¯å°ç«¯ï¼ˆlittle endian, LE)还是大端(big-endian, BE)。
+
+RapidJSON通过`rapidjson/encodings.h`中的struct去æä¾›å„ç§ç¼–ç ï¼š
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template<typename CharType = char>
+struct UTF8;
+
+template<typename CharType = wchar_t>
+struct UTF16;
+
+template<typename CharType = wchar_t>
+struct UTF16LE;
+
+template<typename CharType = wchar_t>
+struct UTF16BE;
+
+template<typename CharType = unsigned>
+struct UTF32;
+
+template<typename CharType = unsigned>
+struct UTF32LE;
+
+template<typename CharType = unsigned>
+struct UTF32BE;
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+对于在内存中的文本,我们正常会使用`UTF8`ã€`UTF16`或`UTF32`。对于处ç†ç»è¿‡I/O的文本,我们å¯ä½¿ç”¨`UTF8`ã€`UTF16LE`ã€`UTF16BE`ã€`UTF32LE`或`UTF32BE`。
+
+当使用DOM风格的API,`GenericValue<Encoding>`åŠ`GenericDocument<Encoding>`里的`Encoding`模æ¿å‚数是用于指明内存中存储的JSON字符串使用哪ç§ç¼–ç ã€‚å› æ­¤é€šå¸¸æˆ‘ä»¬ä¼šåœ¨æ­¤å‚æ•°ä¸­ä½¿ç”¨`UTF8`ã€`UTF16`或`UTF32`。如何选择,视乎应用软件所使用的æ“作系统åŠå…¶ä»–程åºåº“。例如,Windows API使用UTF-16表示Unicode字符,而多数的Linuxå‘行版本åŠåº”用软件则更喜欢UTF-8。
+
+使用UTF-16çš„DOM声明例å­ï¼š
+
+~~~~~~~~~~cpp
+typedef GenericDocument<UTF16<> > WDocument;
+typedef GenericValue<UTF16<> > WValue;
+~~~~~~~~~~
+
+å¯ä»¥åœ¨[DOM's Encoding](doc/stream.md)一节看到更详细的使用例å­ã€‚
+
+## 字符类型 {#CharacterType}
+
+从之å‰çš„声明中å¯ä»¥çœ‹åˆ°ï¼Œæ¯ä¸ªç¼–ç éƒ½æœ‰ä¸€ä¸ª`CharType`模æ¿å‚数。这å¯èƒ½æ¯”较容易混淆,实际上,æ¯ä¸ª`CharType`存储一个编ç å•å…ƒï¼Œè€Œä¸æ˜¯ä¸€ä¸ªå­—符(ç ç‚¹ï¼‰ã€‚如之剿‰€è°ˆåŠï¼Œåœ¨UTF-8中一个ç ç‚¹å¯èƒ½ä¼šç¼–ç æˆ1至4个编ç å•元。
+
+对于`UTF16(LE|BE)`åŠ`UTF32(LE|BE)`æ¥è¯´ï¼Œ`CharType`必须分别是一个至少2åŠ4字节的整数类型。
+
+注æ„C++11新添了`char16_t`åŠ`char32_t`类型,也å¯åˆ†åˆ«ç”¨äºŽ`UTF16`åŠ`UTF32`。
+
+## AutoUTF {#AutoUTF}
+
+上述所介ç»çš„ç¼–ç éƒ½æ˜¯åœ¨ç¼–è¯‘æœŸé™æ€æŒ·å®šçš„。æ¢å¥è¯è¯´ï¼Œä½¿ç”¨è€…必须知é“内存或æµä¹‹ä¸­ä½¿ç”¨äº†å“ªç§ç¼–ç ã€‚然而,有时候我们å¯èƒ½éœ€è¦è¯»å†™ä¸åŒç¼–ç çš„æ–‡ä»¶ï¼Œè€Œä¸”这些编ç éœ€è¦åœ¨è¿è¡Œæ—¶æ‰èƒ½å†³å®šã€‚
+
+`AutoUTF`是为此而设计的编ç ã€‚它根æ®è¾“å…¥æˆ–è¾“å‡ºæµæ¥é€‰æ‹©ä½¿ç”¨å“ªç§ç¼–ç ã€‚ç›®å‰å®ƒåº”该与`EncodedInputStream`åŠ`EncodedOutputStream`结åˆä½¿ç”¨ã€‚
+
+## ASCII {#ASCII}
+
+虽然JSON标准并未æåŠ[ASCII](http://en.wikipedia.org/wiki/ASCII),有时候我们希望写入7ä½çš„ASCII JSON,以供未能处ç†UTF-8的应用程åºä½¿ç”¨ã€‚由于任JSON都å¯ä»¥æŠŠUnicode字符表示为`\uXXXX`转义åºåˆ—,JSON总是å¯ç”¨ASCIIæ¥ç¼–ç ã€‚
+
+ä»¥ä¸‹çš„ä¾‹å­æŠŠUTF-8çš„DOM写æˆASCIIçš„JSON:
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+Document d; // UTF8<>
+// ...
+StringBuffer buffer;
+Writer<StringBuffer, Document::EncodingType, ASCII<> > writer(buffer);
+d.Accept(writer);
+std::cout << buffer.GetString();
+~~~~~~~~~~
+
+ASCIIå¯ç”¨äºŽè¾“å…¥æµã€‚当输入æµåŒ…å«å¤§äºŽ127的字节,就会导致`kParseErrorStringInvalidEncoding`错误。
+
+ASCII *ä¸èƒ½* 用于内存(`Document`的编ç ï¼Œæˆ–`Reader`的目标编ç ),因为它ä¸èƒ½è¡¨ç¤ºUnicodeç ç‚¹ã€‚
+
+# 校验åŠè½¬ç  {#ValidationTranscoding}
+
+当RapidJSONè§£æžä¸€ä¸ªJSON时,它能校验输入JSONï¼Œåˆ¤æ–­å®ƒæ˜¯å¦æ‰€æ ‡æ˜Žç¼–ç çš„åˆæ³•åºåˆ—。è¦å¼€å¯æ­¤é€‰é¡¹ï¼Œè¯·æŠŠ`kParseValidateEncodingFlag`加入`parseFlags`模æ¿å‚数。
+
+若输入编ç å’Œè¾“出编ç å¹¶ä¸ç›¸åŒï¼Œ`Reader`åŠ`Writer`会算把文本转ç ã€‚åœ¨è¿™ç§æƒ…况下,并ä¸éœ€è¦`kParseValidateEncodingFlag`,因为它必须解ç è¾“å…¥åºåˆ—。若åºåˆ—ä¸èƒ½è¢«è§£ç ï¼Œå®ƒå¿…然是ä¸åˆæ³•的。
+
+## 转ç å™¨ {#Transcoder}
+
+虽然RapidJSON的编ç åŠŸèƒ½æ˜¯ä¸ºJSONè§£æžï¼ç”Ÿæˆè€Œè®¾è®¡ï¼Œä½¿ç”¨è€…也å¯ä»¥â€œæ»¥ç”¨â€å®ƒä»¬æ¥ä¸ºéžJSON字符串转ç ã€‚
+
+ä»¥ä¸‹çš„ä¾‹å­æŠŠUTF-8å­—ç¬¦ä¸²è½¬ç æˆUTF-16:
+
+~~~~~~~~~~cpp
+#include "rapidjson/encodings.h"
+
+using namespace rapidjson;
+
+const char* s = "..."; // UTF-8 string
+StringStream source(s);
+GenericStringBuffer<UTF16<> > target;
+
+bool hasError = false;
+while (source.Peak() != '\0')
+ if (!Transcoder::Transcode<UTF8<>, UTF16<> >(source, target)) {
+ hasError = true;
+ break;
+ }
+
+if (!hasError) {
+ const wchar_t* t = target.GetString();
+ // ...
+}
+~~~~~~~~~~
+
+你也å¯ä»¥ç”¨`AutoUTF`åŠå¯¹åº”çš„æµæ¥åœ¨è¿è¡Œæ—¶è®¾ç½®å†…æºï¼ç›®çš„之编ç ã€‚
diff --git a/3rdparty/rapidjson/doc/faq.md b/3rdparty/rapidjson/doc/faq.md
new file mode 100644
index 00000000000..1b0541c27a9
--- /dev/null
+++ b/3rdparty/rapidjson/doc/faq.md
@@ -0,0 +1,289 @@
+# FAQ
+
+[TOC]
+
+## General
+
+1. What is RapidJSON?
+
+ RapidJSON is a C++ library for parsing and generating JSON. You may check all [features](doc/features.md) of it.
+
+2. Why is RapidJSON named so?
+
+ It is inspired by [RapidXML](http://rapidxml.sourceforge.net/), which is a fast XML DOM parser.
+
+3. Is RapidJSON similar to RapidXML?
+
+ RapidJSON borrowed some designs of RapidXML, including *in situ* parsing, header-only library. But the two APIs are completely different. Also RapidJSON provide many features that are not in RapidXML.
+
+4. Is RapidJSON free?
+
+ Yes, it is free under MIT license. It can be used in commercial applications. Please check the details in [license.txt](https://github.com/miloyip/rapidjson/blob/master/license.txt).
+
+5. Is RapidJSON small? What are its dependencies?
+
+ Yes. A simple executable which parses a JSON and prints its statistics is less than 30KB on Windows.
+
+ RapidJSON depends on C++ standard library only.
+
+6. How to install RapidJSON?
+
+ Check [Installation section](https://miloyip.github.io/rapidjson/).
+
+7. Can RapidJSON run on my platform?
+
+ RapidJSON has been tested in many combinations of operating systems, compilers and CPU architecture by the community. But we cannot ensure that it can be run on your particular platform. Building and running the unit test suite will give you the answer.
+
+8. Does RapidJSON support C++03? C++11?
+
+ RapidJSON was firstly implemented for C++03. Later it added optional support of some C++11 features (e.g., move constructor, `noexcept`). RapidJSON shall be compatible with C++03 or C++11 compliant compilers.
+
+9. Does RapidJSON really work in real applications?
+
+ Yes. It is deployed in both client and server real applications. A community member reported that RapidJSON in their system parses 50 million JSONs daily.
+
+10. How RapidJSON is tested?
+
+ RapidJSON contains a unit test suite for automatic testing. [Travis](https://travis-ci.org/miloyip/rapidjson/)(for Linux) and [AppVeyor](https://ci.appveyor.com/project/miloyip/rapidjson/)(for Windows) will compile and run the unit test suite for all modifications. The test process also uses Valgrind (in Linux) to detect memory leaks.
+
+11. Is RapidJSON well documented?
+
+ RapidJSON provides user guide and API documentationn.
+
+12. Are there alternatives?
+
+ Yes, there are a lot alternatives. For example, [nativejson-benchmark](https://github.com/miloyip/nativejson-benchmark) has a listing of open-source C/C++ JSON libraries. [json.org](http://www.json.org/) also has a list.
+
+## JSON
+
+1. What is JSON?
+
+ JSON (JavaScript Object Notation) is a lightweight data-interchange format. It uses human readable text format. More details of JSON can be referred to [RFC7159](http://www.ietf.org/rfc/rfc7159.txt) and [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm).
+
+2. What are applications of JSON?
+
+ JSON are commonly used in web applications for transferring structured data. It is also used as a file format for data persistence.
+
+2. Does RapidJSON conform to the JSON standard?
+
+ Yes. RapidJSON is fully compliance with [RFC7159](http://www.ietf.org/rfc/rfc7159.txt) and [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm). It can handle corner cases, such as supporting null character and surrogate pairs in JSON strings.
+
+3. Does RapidJSON support relaxed syntax?
+
+ Currently no. RapidJSON only support the strict standardized format. Support on related syntax is under discussion in this [issue](https://github.com/miloyip/rapidjson/issues/36).
+
+## DOM and SAX
+
+1. What is DOM style API?
+
+ Document Object Model (DOM) is an in-memory representation of JSON for query and manipulation.
+
+2. What is SAX style API?
+
+ SAX is an event-driven API for parsing and generation.
+
+3. Should I choose DOM or SAX?
+
+ DOM is easy for query and manipulation. SAX is very fast and memory-saving but often more difficult to be applied.
+
+4. What is *in situ* parsing?
+
+ *in situ* parsing decodes the JSON strings directly into the input JSON. This is an optimization which can reduce memory consumption and improve performance, but the input JSON will be modified. Check [in-situ parsing](doc/dom.md) for details.
+
+5. When does parsing generate an error?
+
+ The parser generates an error when the input JSON contains invalid syntax, or a value can not be represented (a number is too big), or the handler of parsers terminate the parsing. Check [parse error](doc/dom.md) for details.
+
+6. What error information is provided?
+
+ The error is stored in `ParseResult`, which includes the error code and offset (number of characters from the beginning of JSON). The error code can be translated into human-readable error message.
+
+7. Why not just using `double` to represent JSON number?
+
+ Some applications use 64-bit unsigned/signed integers. And these integers cannot be converted into `double` without loss of precision. So the parsers detects whether a JSON number is convertible to different types of integers and/or `double`.
+
+8. How to clear-and-minimize a document or value?
+
+ Call one of the `SetXXX()` methods - they call destructor which deallocates DOM data:
+
+ ~~~~~~~~~~cpp
+ Document d;
+ ...
+ d.SetObject(); // clear and minimize
+ ~~~~~~~~~~
+
+ Alternatively, use equivalent of the [C++ swap with temporary idiom](https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Clear-and-minimize):
+ ~~~~~~~~~~cpp
+ Value(kObjectType).Swap(d);
+ ~~~~~~~~~~
+ or equivalent, but sightly longer to type:
+ ~~~~~~~~~~cpp
+ d.Swap(Value(kObjectType).Move());
+ ~~~~~~~~~~
+
+9. How to insert a document node into another document?
+
+ Let's take the following two DOM trees represented as JSON documents:
+ ~~~~~~~~~~cpp
+ Document person;
+ person.Parse("{\"person\":{\"name\":{\"first\":\"Adam\",\"last\":\"Thomas\"}}}");
+
+ Document address;
+ address.Parse("{\"address\":{\"city\":\"Moscow\",\"street\":\"Quiet\"}}");
+ ~~~~~~~~~~
+ Let's assume we want to merge them in such way that the whole `address` document becomes a node of the `person`:
+ ~~~~~~~~~~js
+ { "person": {
+ "name": { "first": "Adam", "last": "Thomas" },
+ "address": { "city": "Moscow", "street": "Quiet" }
+ }
+ }
+ ~~~~~~~~~~
+
+ The most important requirement to take care of document and value life-cycle as well as consistent memory managent using the right allocator during the value transfer.
+
+ Simple yet most efficient way to achieve that is to modify the `address` definition above to initialize it with allocator of the `person` document, then we just add the root member of the value:
+ ~~~~~~~~~~cpp
+ Documnet address(person.GetAllocator());
+ ...
+ person["person"].AddMember("address", address["address"], person.GetAllocator());
+ ~~~~~~~~~~
+Alternatively, if we don't want to explicitly refer to the root value of `address` by name, we can refer to it via iterator:
+ ~~~~~~~~~~cpp
+ auto addressRoot = address.MemberBegin();
+ person["person"].AddMember(addressRoot->name, addressRoot->value, person.GetAllocator());
+ ~~~~~~~~~~
+
+ Second way is to deep-clone the value from the address document:
+ ~~~~~~~~~~cpp
+ Value addressValue = Value(address["address"], person.GetAllocator());
+ person["person"].AddMember("address", addressValue, person.GetAllocator());
+ ~~~~~~~~~~
+
+## Document/Value (DOM)
+
+1. What is move semantics? Why?
+
+ Instead of copy semantics, move semantics is used in `Value`. That means, when assigning a source value to a target value, the ownership of source value is moved to the target value.
+
+ Since moving is faster than copying, this design decision forces user to aware of the copying overhead.
+
+2. How to copy a value?
+
+ There are two APIs: constructor with allocator, and `CopyFrom()`. See [Deep Copy Value](doc/tutorial.md) for an example.
+
+3. Why do I need to provide the length of string?
+
+ Since C string is null-terminated, the length of string needs to be computed via `strlen()`, with linear runtime complexity. This incurs an unncessary overhead of many operations, if the user already knows the length of string.
+
+ Also, RapidJSON can handle `\u0000` (null character) within a string. If a string contains null characters, `strlen()` cannot return the true length of it. In such case user must provide the length of string explicitly.
+
+4. Why do I need to provide allocator parameter in many DOM manipulation API?
+
+ Since the APIs are member functions of `Value`, we do not want to save an allocator pointer in every `Value`.
+
+5. Does it convert between numerical types?
+
+ When using `GetInt()`, `GetUint()`, ... conversion may occur. For integer-to-integer conversion, it only convert when it is safe (otherwise it will assert). However, when converting a 64-bit signed/unsigned integer to double, it will convert but be aware that it may lose precision. A number with fraction, or an integer larger than 64-bit, can only be obtained by `GetDouble()`.
+
+## Reader/Writer (SAX)
+
+1. Why don't we just `printf` a JSON? Why do we need a `Writer`?
+
+ Most importantly, `Writer` will ensure the output JSON is well-formed. Calling SAX events incorrectly (e.g. `StartObject()` pairing with `EndArray()`) will assert. Besides, `Writer` will escapes strings (e.g., `\n`). Finally, the numeric output of `printf()` may not be a valid JSON number, especially in some locale with digit delimiters. And the number-to-string conversion in `Writer` is implemented with very fast algorithms, which outperforms than `printf()` or `iostream`.
+
+2. Can I pause the parsing process and resume it later?
+
+ This is not directly supported in the current version due to performance consideration. However, if the execution environment supports multi-threading, user can parse a JSON in a separate thread, and pause it by blocking in the input stream.
+
+## Unicode
+
+1. Does it support UTF-8, UTF-16 and other format?
+
+ Yes. It fully support UTF-8, UTF-16 (LE/BE), UTF-32 (LE/BE) and ASCII.
+
+2. Can it validate the encoding?
+
+ Yes, just pass `kParseValidateEncodingFlag` to `Parse()`. If there is invalid encoding in the stream, it wil generate `kParseErrorStringInvalidEncoding` error.
+
+3. What is surrogate pair? Does RapidJSON support it?
+
+ JSON uses UTF-16 encoding when escaping unicode character, e.g. `\u5927` representing Chinese character "big". To handle characters other than those in basic multilingual plane (BMP), UTF-16 encodes those characters with two 16-bit values, which is called UTF-16 surrogate pair. For example, the Emoji character U+1F602 can be encoded as `\uD83D\uDE02` in JSON.
+
+ RapidJSON fully support parsing/generating UTF-16 surrogates.
+
+4. Can it handle `\u0000` (null character) in JSON string?
+
+ Yes. RapidJSON fully support null character in JSON string. However, user need to be aware of it and using `GetStringLength()` and related APIs to obtain the true length of string.
+
+5. Can I output `\uxxxx` for all non-ASCII character?
+
+ Yes, use `ASCII<>` as output encoding template parameter in `Writer` can enforce escaping those characters.
+
+## Stream
+
+1. I have a big JSON file. Should I load the whole file to memory?
+
+ User can use `FileReadStream` to read the file chunk-by-chunk. But for *in situ* parsing, the whole file must be loaded.
+
+2. Can I parse JSON while it is streamed from network?
+
+ Yes. User can implement a custom stream for this. Please refer to the implementation of `FileReadStream`.
+
+3. I don't know what encoding will the JSON be. How to handle them?
+
+ You may use `AutoUTFInputStream` which detects the encoding of input stream automatically. However, it will incur some performance overhead.
+
+4. What is BOM? How RapidJSON handle it?
+
+ [Byte order mark (BOM)](http://en.wikipedia.org/wiki/Byte_order_mark) sometimes reside at the beginning of file/stream to indiciate the UTF encoding type of it.
+
+ RapidJSON's `EncodedInputStream` can detect/consume BOM. `EncodedOutputStream` can optionally write a BOM. See [Encoded Streams](doc/stream.md) for example.
+
+5. Why little/big endian is related?
+
+ little/big endian of stream is an issue for UTF-16 and UTF-32 streams, but not UTF-8 stream.
+
+## Performance
+
+1. Is RapidJSON really fast?
+
+ Yes. It may be the fastest open source JSON library. There is a [benchmark](https://github.com/miloyip/nativejson-benchmark) for evaluating performance of C/C++ JSON libaries.
+
+2. Why is it fast?
+
+ Many design decisions of RapidJSON is aimed at time/space performance. These may reduce user-friendliness of APIs. Besides, it also employs low-level optimizations (intrinsics, SIMD) and special algorithms (custom double-to-string, string-to-double conversions).
+
+3. What is SIMD? How it is applied in RapidJSON?
+
+ [SIMD](http://en.wikipedia.org/wiki/SIMD) instructions can perform parallel computation in modern CPUs. RapidJSON support Intel's SSE2/SSE4.2 to accelerate whitespace skipping. This improves performance of parsing indent formatted JSON. Define `RAPIDJSON_SSE2` or `RAPIDJSON_SSE42` macro to enable this feature. However, running the executable on a machine without such instruction set support will make it crash.
+
+4. Does it consume a lot of memory?
+
+ The design of RapidJSON aims at reducing memory footprint.
+
+ In the SAX API, `Reader` consumes memory portional to maximum depth of JSON tree, plus maximum length of JSON string.
+
+ In the DOM API, each `Value` consumes exactly 16/24 bytes for 32/64-bit architecture respectively. RapidJSON also uses a special memory allocator to minimize overhead of allocations.
+
+5. What is the purpose of being high performance?
+
+ Some applications need to process very large JSON files. Some server-side applications need to process huge amount of JSONs. Being high performance can improve both latency and throuput. In a broad sense, it will also save energy.
+
+## Gossip
+
+1. Who are the developers of RapidJSON?
+
+ Milo Yip ([miloyip](https://github.com/miloyip)) is the original author of RapidJSON. Many contributors from the world have improved RapidJSON. Philipp A. Hartmann ([pah](https://github.com/pah)) has implemented a lot of improvements, setting up automatic testing and also involves in a lot of discussions for the community. Don Ding ([thebusytypist](https://github.com/thebusytypist)) implemented the iterative parser. Andrii Senkovych ([jollyroger](https://github.com/jollyroger)) completed the CMake migration. Kosta ([Kosta-Github](https://github.com/Kosta-Github)) provided a very neat short-string optimization. Thank you for all other contributors and community members as well.
+
+2. Why do you develop RapidJSON?
+
+ It was just a hobby project initially in 2011. Milo Yip is a game programmer and he just knew about JSON at that time and would like to apply JSON in future projects. As JSON seems very simple he would like to write a header-only and fast library.
+
+3. Why there is a long empty period of development?
+
+ It is basically due to personal issues, such as getting new family members. Also, Milo Yip has spent a lot of spare time on translating "Game Engine Architecture" by Jason Gregory into Chinese.
+
+4. Why did the repository move from Google Code to GitHub?
+
+ This is the trend. And GitHub is much more powerful and convenient.
diff --git a/3rdparty/rapidjson/doc/faq.zh-cn.md b/3rdparty/rapidjson/doc/faq.zh-cn.md
new file mode 100644
index 00000000000..7127283b243
--- /dev/null
+++ b/3rdparty/rapidjson/doc/faq.zh-cn.md
@@ -0,0 +1,290 @@
+# 常è§é—®é¢˜
+
+[TOC]
+
+## 一般问题
+
+1. RapidJSON是什么?
+
+ RapidJSON是一个C++库,用于解æžåŠç”ŸæˆJSON。读者å¯å‚考它的所有[特点](doc/features.zh-cn.md)。
+
+2. 为什么称作RapidJSON?
+
+ å®ƒçš„çµæ„Ÿæ¥è‡ªäºŽ[RapidXML](http://rapidxml.sourceforge.net/),RapidXML是一个高速的XML DOMè§£æžå™¨ã€‚
+
+3. RapidJSON与RapidXML相似么?
+
+ RapidJSON借镜了RapidXML的一些设计, 包括原ä½ï¼ˆ*in situ*)解æžã€åªæœ‰å¤´æ–‡ä»¶çš„库。但两者的API是完全ä¸åŒçš„。此外RapidJSON也æä¾›è®¸å¤šRapidXML没有的特点。
+
+4. RapidJSON是å…费的么?
+
+ 是的,它在MITç‰¹è¨±æ¢æ¬¾ä¸‹å…费。它å¯ç”¨äºŽå•†ä¸šè½¯ä»¶ã€‚详情请å‚看[license.txt](https://github.com/miloyip/rapidjson/blob/master/license.txt)。
+
+5. RapidJSON很å°ä¹ˆï¼Ÿå®ƒæœ‰ä½•ä¾èµ–?
+
+ 是的。在Windows上,一个解æžJSON并打å°å‡ºç»Ÿè®¡çš„坿‰§è¡Œæ–‡ä»¶å°‘于30KB。
+
+ RapidJSONä»…ä¾èµ–于C++标准库。
+
+6. 怎样安装RapidJSON?
+
+ è§[安装一节](../readme.zh-cn.md#安装)。
+
+7. RapidJSON能å¦è¿è¡ŒäºŽæˆ‘的平å°ï¼Ÿ
+
+ 社区已在多个æ“作系统ï¼ç¼–译器ï¼CPU架构的组åˆä¸Šæµ‹è¯•RapidJSON。但我们无法确ä¿å®ƒèƒ½è¿è¡ŒäºŽä½ ç‰¹å®šçš„å¹³å°ä¸Šã€‚åªéœ€è¦ç”ŸæˆåŠæ‰§è¡Œå•元测试便能获å–答案。
+
+8. RapidJSON支æŒC++03么?C++11呢?
+
+ RapidJSON开始时在C++03ä¸Šå®žçŽ°ã€‚åŽæ¥åŠ å…¥äº†å¯é€‰çš„C++11特性支æŒï¼ˆå¦‚转移构造函数ã€`noexcept`)。RapidJSON应该兼容所有éµä»ŽC++03或C++11的编译器。
+
+9. RapidJSON是å¦çœŸçš„用于实际应用?
+
+ 是的。它被é…置于å‰å°åŠåŽå°çš„真实应用中。一个社区æˆå‘˜è¯´RapidJSONåœ¨ä»–ä»¬çš„ç³»ç»Ÿä¸­æ¯æ—¥è§£æž5åƒä¸‡ä¸ªJSON。
+
+10. RapidJSON是如何被测试的?
+
+ RapidJSON包å«ä¸€ç»„å•元测试去执行自动测试。[Travis](https://travis-ci.org/miloyip/rapidjson/)(供Linuxå¹³å°ï¼‰åŠ[AppVeyor](https://ci.appveyor.com/project/miloyip/rapidjson/)(供Windowså¹³å°ï¼‰ä¼šå¯¹æ‰€æœ‰ä¿®æ”¹è¿›è¡Œç¼–è¯‘åŠæ‰§è¡Œå•元测试。在Linux下还会使用Valgrind去检测内存泄æ¼ã€‚
+
+11. RapidJSONæ˜¯å¦æœ‰å®Œæ•´çš„æ–‡æ¡£ï¼Ÿ
+
+ RapidJSONæä¾›äº†ä½¿ç”¨æ‰‹å†ŒåŠAPI说明文档。
+
+12. 有没有其他替代å“?
+
+ 有许多替代å“。例如[nativejson-benchmark](https://github.com/miloyip/nativejson-benchmark)列出了一些开æºçš„C/C++ JSON库。[json.org](http://www.json.org/)也有一个列表。
+
+## JSON
+
+1. 什么是JSON?
+
+ JSON (JavaScript Object Notation)是一个轻é‡çš„æ•°æ®äº¤æ¢æ ¼å¼ã€‚它使用人类å¯è¯»çš„æ–‡æœ¬æ ¼å¼ã€‚更多关于JSON的细节å¯è€ƒ[RFC7159](http://www.ietf.org/rfc/rfc7159.txt)åŠ[ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm)。
+
+2. JSON有什么应用场åˆï¼Ÿ
+
+ JSON常用于网页应用程åºï¼Œä»¥ä¼ é€ç»“构化数æ®ã€‚它也å¯ä½œä¸ºæ–‡ä»¶æ ¼å¼ç”¨äºŽæ•°æ®æŒä¹…化。
+
+2. RapidJSON是å¦ç¬¦åˆJSON标准?
+
+ 是。RapidJSON完全符åˆ[RFC7159](http://www.ietf.org/rfc/rfc7159.txt)åŠ[ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm)。它能处ç†ä¸€äº›ç‰¹æ®Šæƒ…况,例如支æŒJSONå­—ç¬¦ä¸²ä¸­å«æœ‰ç©ºå­—符åŠä»£ç†å¯¹ï¼ˆsurrogate pair)。
+
+3. RapidJSONæ˜¯å¦æ”¯æŒå®½æ¾çš„语法?
+
+ çŽ°æ—¶ä¸æ”¯æŒã€‚RapidJSONåªæ”¯æŒä¸¥æ ¼çš„æ ‡å‡†æ ¼å¼ã€‚宽æ¾è¯­æ³•现时在这[issue](https://github.com/miloyip/rapidjson/issues/36)中进行讨论。
+
+## DOM与SAX
+
+1. 什么是DOM风格API?
+
+ Document Object Model(DOM)是一个储存于内存的JSON表示方å¼ï¼Œç”¨äºŽæŸ¥è¯¢åŠä¿®æ”¹JSON。
+
+2. 什么是SAX风格API?
+
+ SAX是一个事件驱动的API,用于解æžåŠç”ŸæˆJSON。
+
+3. 我应用DOM还是SAX?
+
+ DOM易于查询åŠä¿®æ”¹ã€‚SAX则是éžå¸¸å¿«åŠçœå†…存的,但通常较难使用。
+
+4. 什么是原ä½ï¼ˆ*in situ*)解æžï¼Ÿ
+
+ 原ä½è§£æžä¼šæŠŠJSON字符串直接解ç è‡³è¾“入的JSON中。这是一个优化,å¯å‡å°‘å†…å­˜æ¶ˆè€—åŠæå‡æ€§èƒ½ï¼Œä½†è¾“入的JSON会被更改。进一步细节请å‚考[原ä½è§£æž](doc/dom.md) 。
+
+5. 什么时候会产生解æžé”™è¯¯ï¼Ÿ
+
+ 当输入的JSON包å«éžæ³•语法,或ä¸èƒ½è¡¨ç¤ºä¸€ä¸ªå€¼ï¼ˆå¦‚Number太大),或解æžå™¨çš„处ç†å™¨ä¸­æ–­è§£æžè¿‡ç¨‹ï¼Œè§£æžå™¨éƒ½ä¼šäº§ç”Ÿä¸€ä¸ªé”™è¯¯ã€‚详情请å‚考[è§£æžé”™è¯¯](doc/dom.md)。
+
+6. 有什么错误信æ¯ï¼Ÿ
+
+ 错误信æ¯å­˜å‚¨åœ¨`ParseResult`,它包å«é”™è¯¯ä»£å·åŠå移值(从JSON开始至错误处的字符数目)。å¯ä»¥æŠŠé”™è¯¯ä»£å·ç¿»è¯‘为人类å¯è¯»çš„错误讯æ¯ã€‚
+
+7. 为何ä¸åªä½¿ç”¨`double`去表示JSON number?
+
+ 一些应用需è¦ä½¿ç”¨64使— å·ï¼æœ‰å·æ•´æ•°ã€‚这些整数ä¸èƒ½æ— æŸåœ°è½¬æ¢æˆ`double`。因此解æžå™¨ä¼šæ£€æµ‹ä¸€ä¸ªJSON number是å¦èƒ½è½¬æ¢è‡³å„ç§æ•´æ•°ç±»åž‹åŠ`double`。
+
+8. 如何清空并最å°åŒ–`document`或`value`的容é‡ï¼Ÿ
+
+ 调用 `SetXXX()` 方法 - è¿™äº›æ–¹æ³•ä¼šè°ƒç”¨æžæž„函数,并é‡å»ºç©ºçš„Object或Array:
+
+ ~~~~~~~~~~cpp
+ Document d;
+ ...
+ d.SetObject(); // clear and minimize
+ ~~~~~~~~~~
+
+ å¦å¤–,也å¯ä»¥å‚考在 [C++ swap with temporary idiom](https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Clear-and-minimize)中的一ç§ç­‰ä»·çš„æ–¹æ³•:
+ ~~~~~~~~~~cpp
+ Value(kObjectType).Swap(d);
+ ~~~~~~~~~~
+ 或者,使用这个ç¨å¾®é•¿ä¸€ç‚¹çš„代ç ä¹Ÿèƒ½å®ŒæˆåŒæ ·çš„事情:
+ ~~~~~~~~~~cpp
+ d.Swap(Value(kObjectType).Move());
+ ~~~~~~~~~~
+
+9. 如何将一个`document`节点æ’入到å¦ä¸€ä¸ª`document`中?
+
+ 比如有以下两个document(DOM):
+ ~~~~~~~~~~cpp
+ Document person;
+ person.Parse("{\"person\":{\"name\":{\"first\":\"Adam\",\"last\":\"Thomas\"}}}");
+
+ Document address;
+ address.Parse("{\"address\":{\"city\":\"Moscow\",\"street\":\"Quiet\"}}");
+ ~~~~~~~~~~
+ å‡è®¾æˆ‘们希望将整个 `address` æ’入到`person`中,作为其的一个å­èŠ‚ç‚¹:
+ ~~~~~~~~~~js
+ { "person": {
+ "name": { "first": "Adam", "last": "Thomas" },
+ "address": { "city": "Moscow", "street": "Quiet" }
+ }
+ }
+ ~~~~~~~~~~
+
+ 在æ’å…¥èŠ‚ç‚¹çš„è¿‡ç¨‹ä¸­éœ€è¦æ³¨æ„`document`å’Œ`value`的生命周期并且正确地使用allocator进行内存分é…和管ç†ã€‚
+
+ ä¸€ä¸ªç®€å•æœ‰æ•ˆçš„æ–¹æ³•就是修改上述`address`å˜é‡çš„定义,让其使用`person`çš„allocatoråˆå§‹åŒ–,然åŽå°†å…¶æ·»åŠ åˆ°æ ¹èŠ‚ç‚¹ã€‚
+
+ ~~~~~~~~~~cpp
+ Documnet address(person.GetAllocator());
+ ...
+ person["person"].AddMember("address", address["address"], person.GetAllocator());
+ ~~~~~~~~~~
+ å½“ç„¶ï¼Œå¦‚æžœä½ ä¸æƒ³é€šè¿‡æ˜¾å¼åœ°å†™å‡º`address`çš„keyæ¥å¾—到其值,å¯ä»¥ä½¿ç”¨è¿­ä»£å™¨æ¥å®žçް:
+ ~~~~~~~~~~cpp
+ auto addressRoot = address.MemberBegin();
+ person["person"].AddMember(addressRoot->name, addressRoot->value, person.GetAllocator());
+ ~~~~~~~~~~
+
+ 此外,还å¯ä»¥é€šè¿‡æ·±æ‹·è´address documentæ¥å®žçް:
+ ~~~~~~~~~~cpp
+ Value addressValue = Value(address["address"], person.GetAllocator());
+ person["person"].AddMember("address", addressValue, person.GetAllocator());
+ ~~~~~~~~~~
+
+## Document/Value (DOM)
+
+1. 什么是转移语æ„?为什么?
+
+ `Value`ä¸ç”¨å¤åˆ¶è¯­æ„,而使用了转移语æ„ã€‚è¿™æ˜¯æŒ‡ï¼Œå½“æŠŠæ¥æºå€¼èµ‹å€¼äºŽç›®æ ‡å€¼æ—¶ï¼Œæ¥æºå€¼çš„æ‰€æœ‰æƒä¼šè½¬ç§»è‡³ç›®æ ‡å€¼ã€‚
+
+ 由于转移快于å¤åˆ¶ï¼Œæ­¤è®¾è®¡å†³å®šå¼ºè¿«ä½¿ç”¨è€…注æ„到å¤åˆ¶çš„æ¶ˆè€—。
+
+2. 怎样去å¤åˆ¶ä¸€ä¸ªå€¼ï¼Ÿ
+
+ 有两个APIå¯ç”¨ï¼šå«allocator的构造函数,以åŠ`CopyFrom()`。å¯å‚考[æ·±å¤åˆ¶Value](doc/tutorial.md)里的用例。
+
+3. ä¸ºä»€ä¹ˆæˆ‘éœ€è¦æä¾›å­—ç¬¦ä¸²çš„é•¿åº¦ï¼Ÿ
+
+ 由于C字符串是空字符结尾的,需è¦ä½¿ç”¨`strlen()`åŽ»è®¡ç®—å…¶é•¿åº¦ï¼Œè¿™æ˜¯çº¿æ€§å¤æ‚度的æ“作。若使用者已知字符串的长度,对很多æ“作æ¥è¯´ä¼šé€ æˆä¸å¿…è¦çš„æ¶ˆè€—。
+
+ 此外,RapidJSONå¯å¤„ç†å«æœ‰`\u0000`ï¼ˆç©ºå­—ç¬¦ï¼‰çš„å­—ç¬¦ä¸²ã€‚è‹¥ä¸€ä¸ªå­—ç¬¦ä¸²å«æœ‰ç©ºå­—符,`strlen()`便ä¸èƒ½è¿”å›žçœŸæ­£çš„å­—ç¬¦ä¸²é•¿åº¦ã€‚åœ¨è¿™ç§æƒ…况下使用者必须明确地æä¾›å­—符串长度。
+
+4. 为什么在许多DOMæ“作APIä¸­è¦æä¾›åˆ†é…å™¨ä½œä¸ºå‚æ•°ï¼Ÿ
+
+ 由于这些API是`Value`çš„æˆå‘˜å‡½æ•°ï¼Œæˆ‘们ä¸å¸Œæœ›ä¸ºæ¯ä¸ª`Value`储存一个分é…器指针。
+
+5. 它会转æ¢å„ç§æ•°å€¼ç±»åž‹ä¹ˆï¼Ÿ
+
+ 当使用`GetInt()`ã€`GetUint()`ç­‰API时,å¯èƒ½ä¼šå‘生转æ¢ã€‚对于整数至整数转æ¢ï¼Œä»…当ä¿è¯è½¬æ¢å®‰å…¨æ‰ä¼šè½¬æ¢ï¼ˆå¦åˆ™ä¼šæ–­è¨€å¤±è´¥ï¼‰ã€‚然而,当把一个64使œ‰å·ï¼æ— å·æ•´æ•°è½¬æ¢è‡³double时,它会转æ¢ï¼Œä½†æœ‰å¯èƒ½ä¼šæŸå¤±ç²¾åº¦ã€‚嫿œ‰å°æ•°çš„æ•°å­—ã€æˆ–大于64ä½çš„æ•´æ•°ï¼Œéƒ½åªèƒ½ä½¿ç”¨`GetDouble()`获å–其值。
+
+## Reader/Writer (SAX)
+
+1. 为什么ä¸ä»…仅用`printf`输出一个JSON?为什么需è¦`Writer`?
+
+ 最é‡è¦çš„æ˜¯ï¼Œ`Writer`能确ä¿è¾“出的JSONæ˜¯æ ¼å¼æ­£ç¡®çš„。错误地调用SAX事件(如`StartObject()`é”™é…`EndArray()`ï¼‰ä¼šé€ æˆæ–­è¨€å¤±è´¥ã€‚此外,`Writer`会把字符串进行转义(如`\n`)。最åŽï¼Œ`printf()`的数值输出å¯èƒ½å¹¶ä¸æ˜¯ä¸€ä¸ªåˆæ³•çš„JSON number,特别是æŸäº›locale会有数字分隔符。而且`Writer`çš„æ•°å€¼å­—ç¬¦ä¸²è½¬æ¢æ˜¯ä½¿ç”¨éžå¸¸å¿«çš„算法æ¥å®žçŽ°çš„ï¼Œèƒœè¿‡`printf()`åŠ`iostream`。
+
+2. æˆ‘èƒ½å¦æš‚åœè§£æžè¿‡ç¨‹ï¼Œå¹¶åœ¨ç¨åŽç»§ç»­ï¼Ÿ
+
+ 基于性能考虑,目å‰ç‰ˆæœ¬å¹¶ä¸ç›´æŽ¥æ”¯æŒæ­¤åŠŸèƒ½ã€‚ç„¶è€Œï¼Œè‹¥æ‰§è¡ŒçŽ¯å¢ƒæ”¯æŒå¤šçº¿ç¨‹ï¼Œä½¿ç”¨è€…å¯ä»¥åœ¨å¦ä¸€çº¿ç¨‹è§£æžJSON,并通过阻塞输入æµåŽ»æš‚åœã€‚
+
+## Unicode
+
+1. å®ƒæ˜¯å¦æ”¯æŒUTF-8ã€UTF-16åŠå…¶ä»–æ ¼å¼ï¼Ÿ
+
+ 是。它完全支æŒUTF-8ã€UTF-16(大端ï¼å°ç«¯ï¼‰ã€UTF-32(大端ï¼å°ç«¯ï¼‰åŠASCII。
+
+2. å®ƒèƒ½å¦æ£€æµ‹ç¼–ç çš„åˆæ³•性?
+
+ 能。åªéœ€æŠŠ`kParseValidateEncodingFlag`å‚考传给`Parse()`。若å‘现在输入æµä¸­æœ‰éžæ³•的编ç ï¼Œå®ƒå°±ä¼šäº§ç”Ÿ`kParseErrorStringInvalidEncoding`错误。
+
+3. 什么是代ç†å¯¹ï¼ˆsurrogate pair)?RapidJSONæ˜¯å¦æ”¯æŒï¼Ÿ
+
+ JSON使用UTF-16ç¼–ç åŽ»è½¬ä¹‰Unicode字符,例如`\u5927`表示中文字“大â€ã€‚è¦å¤„ç†åŸºæœ¬å¤šæ–‡ç§å¹³é¢ï¼ˆbasic multilingual plane,BMP)以外的字符时,UTF-16ä¼šæŠŠé‚£äº›å­—ç¬¦ç¼–ç æˆä¸¤ä¸ª16ä½å€¼ï¼Œè¿™ç§°ä¸ºUTF-16代ç†å¯¹ã€‚例如,绘文字字符U+1F602在JSON中å¯è¢«ç¼–ç æˆ`\uD83D\uDE02`。
+
+ RapidJSON完全支æŒè§£æžåŠç”ŸæˆUTF-16代ç†å¯¹ã€‚
+
+4. 它能å¦å¤„ç†JSON字符串中的`\u0000`(空字符)?
+
+ 能。RapidJSON完全支æŒJSONå­—ç¬¦ä¸²ä¸­çš„ç©ºå­—ç¬¦ã€‚ç„¶è€Œï¼Œä½¿ç”¨è€…éœ€è¦æ³¨æ„到这件事,并使用`GetStringLength()`åŠç›¸å…³API去å–得字符串真正长度。
+
+5. 能å¦å¯¹æ‰€æœ‰éžASCII字符输出æˆ`\uxxxx`å½¢å¼ï¼Ÿ
+
+ å¯ä»¥ã€‚åªè¦åœ¨`Writer`中使用`ASCII<>`作为输出编ç å‚数,就å¯ä»¥å¼ºé€¼è½¬ä¹‰é‚£äº›å­—符。
+
+## æµ
+
+1. 我有一个很大的JSONæ–‡ä»¶ã€‚æˆ‘åº”å¦æŠŠå®ƒæ•´ä¸ªè½½å…¥å†…å­˜ä¸­ï¼Ÿ
+
+ 使用者å¯ä½¿ç”¨`FileReadStream`去é€å—读入文件。但若使用于原ä½è§£æžï¼Œå¿…须载入整个文件。
+
+2. 我能å¦è§£æžä¸€ä¸ªä»Žç½‘络上串æµè¿›æ¥çš„JSON?
+
+ å¯ä»¥ã€‚ä½¿ç”¨è€…å¯æ ¹æ®`FileReadStream`的实现,去实现一个自定义的æµã€‚
+
+3. 我ä¸çŸ¥é“一些JSON将会使用哪ç§ç¼–ç ã€‚怎样处ç†å®ƒä»¬ï¼Ÿ
+
+ ä½ å¯ä»¥ä½¿ç”¨`AutoUTFInputStream`,它能自动检测输入æµçš„ç¼–ç ã€‚然而,它会带æ¥ä¸€äº›æ€§èƒ½å¼€é”€ã€‚
+
+4. 什么是BOM?RapidJSON怎样处ç†å®ƒï¼Ÿ
+
+ [å­—èŠ‚é¡ºåºæ ‡è®°ï¼ˆbyte order mark, BOM)](http://en.wikipedia.org/wiki/Byte_order_mark)æœ‰æ—¶ä¼šå‡ºçŽ°äºŽæ–‡ä»¶ï¼æµçš„开始,以表示其UTFç¼–ç ç±»åž‹ã€‚
+
+ RapidJSONçš„`EncodedInputStream`坿£€æµ‹ï¼è·³è¿‡BOM。`EncodedOutputStream`å¯é€‰æ‹©æ˜¯å¦å†™å…¥BOM。å¯å‚考[ç¼–ç æµ](doc/stream.md)中的例å­ã€‚
+
+5. 为什么会涉åŠå¤§ç«¯ï¼å°ç«¯ï¼Ÿ
+
+ æµçš„大端ï¼å°ç«¯æ˜¯UTF-16åŠUTF-32æµè¦å¤„ç†çš„问题,而UTF-8ä¸éœ€è¦å¤„ç†ã€‚
+
+## 性能
+
+1. RapidJSON是å¦çœŸçš„快?
+
+ 是。它å¯èƒ½æ˜¯æœ€å¿«çš„å¼€æºJSON库。有一个[评测](https://github.com/miloyip/nativejson-benchmark)评估C/C++ JSON库的性能。
+
+2. 为什么它会快?
+
+ RapidJSON的许多设计是针对时间ï¼ç©ºé—´æ€§èƒ½æ¥è®¾è®¡çš„,这些决定å¯èƒ½ä¼šå½±å“API的易用性。此外,它也使用了许多底层优化(内部函数ï¼intrinsicã€SIMD)åŠç‰¹åˆ«çš„算法(自定义的double至字符串转æ¢ã€å­—符串至double的转æ¢ï¼‰ã€‚
+
+3. 什是是SIMD?它如何用于RapidJSON?
+
+ [SIMD](http://en.wikipedia.org/wiki/SIMD)指令å¯ä»¥åœ¨çް代CPU中执行并行è¿ç®—。RapidJSON支æŒäº†Intelçš„SSE2/SSE4.2去加速跳过空白字符。在解æžå«ç¼©è¿›çš„JSON时,这能æå‡æ€§èƒ½ã€‚åªè¦å®šä¹‰å为`RAPIDJSON_SSE2`或`RAPIDJSON_SSE42`çš„å®ï¼Œå°±èƒ½å¯åŠ¨è¿™ä¸ªåŠŸèƒ½ã€‚ç„¶è€Œï¼Œè‹¥åœ¨ä¸æ”¯æŒè¿™äº›æŒ‡ä»¤é›†çš„æœºå™¨ä¸Šæ‰§è¡Œè¿™äº›å¯æ‰§è¡Œæ–‡ä»¶ï¼Œä¼šå¯¼è‡´å´©æºƒã€‚
+
+4. 它会消耗许多内存么?
+
+ RapidJSON的设计目标是å‡ä½Žå†…å­˜å ç”¨ã€‚
+
+ 在SAX API中,`Reader`消耗的内存与JSON树深度加上最长JSONå­—ç¬¦æˆæ­£æ¯”。
+
+ 在DOM API中,æ¯ä¸ª`Value`在32/64使ž¶æž„下分别消耗16/24字节。RapidJSON也使用一个特殊的内存分é…器去å‡å°‘分é…çš„é¢å¤–开销。
+
+5. 高性能的æ„义何在?
+
+ 有些应用程åºéœ€è¦å¤„ç†éžå¸¸å¤§çš„JSON文件。而有些åŽå°åº”用程åºéœ€è¦å¤„ç†å¤§é‡çš„JSONã€‚è¾¾åˆ°é«˜æ€§èƒ½åŒæ—¶æ”¹å–„å»¶æ—¶åŠåžåé‡ã€‚更广义æ¥è¯´ï¼Œè¿™ä¹Ÿå¯ä»¥èŠ‚çœèƒ½æºã€‚
+
+## 八挂
+
+1. è°æ˜¯RapidJSON的开å‘者?
+
+ å¶åŠ²å³°ï¼ˆMilo Yip,[miloyip](https://github.com/miloyip))是RapidJSON的原作者。全世界许多贡献者一直在改善RapidJSON。Philipp A. Hartmann([pah](https://github.com/pah))实现了许多改进,也设置了自动化测试,而且还å‚ä¸Žè®¸å¤šç¤¾åŒºè®¨è®ºã€‚ä¸æ¬§å—(Don Ding,[thebusytypist](https://github.com/thebusytypist))实现了迭代å¼è§£æžå™¨ã€‚Andrii Senkovych([jollyroger](https://github.com/jollyroger))完æˆäº†å‘CMakeçš„è¿ç§»ã€‚Kosta([Kosta-Github](https://github.com/Kosta-Github))æä¾›äº†ä¸€ä¸ªéžå¸¸çµå·§çš„çŸ­å­—ç¬¦ä¸²ä¼˜åŒ–ã€‚ä¹Ÿéœ€è¦æ„Ÿè°¢å…¶ä»–献者åŠç¤¾åŒºæˆå‘˜ã€‚
+
+2. 为何你è¦å¼€å‘RapidJSON?
+
+ 在2011年开始这项目是,它仅一个兴趣项目。Milo Yip是一个游æˆç¨‹åºå‘˜ï¼Œä»–在那时候认识到JSON并希望在未æ¥çš„项目中使用。由于JSON好åƒå¾ˆç®€å•,他希望写一个仅有头文件并且快速的程åºåº“。
+
+3. 为什么开å‘中段有一段长期空档?
+
+ ä¸»è¦æ˜¯ä¸ªäººå› ç´ ï¼Œä¾‹å¦‚加入新家庭æˆå‘˜ã€‚å¦å¤–,Milo Yip也花了许多业馀时间去翻译Jason Gregory的《Game Engine Architecture》至中文版《游æˆå¼•擎架构》。
+
+4. 为什么这个项目从Google Codeæ¬åˆ°GitHub?
+
+ 这是大势所趋,而且GitHubæ›´ä¸ºå¼ºå¤§åŠæ–¹ä¾¿ã€‚
diff --git a/3rdparty/rapidjson/doc/features.md b/3rdparty/rapidjson/doc/features.md
new file mode 100644
index 00000000000..6b529a77646
--- /dev/null
+++ b/3rdparty/rapidjson/doc/features.md
@@ -0,0 +1,98 @@
+# Features
+
+## General
+
+* Cross-platform
+ * Compilers: Visual Studio, gcc, clang, etc.
+ * Architectures: x86, x64, ARM, etc.
+ * Operating systems: Windows, Mac OS X, Linux, iOS, Android, etc.
+* Easy installation
+ * Header files only library. Just copy the headers to your project.
+* Self-contained, minimal dependences
+ * No STL, BOOST, etc.
+ * Only included `<cstdio>`, `<cstdlib>`, `<cstring>`, `<inttypes.h>`, `<new>`, `<stdint.h>`.
+* Without C++ exception, RTTI
+* High performance
+ * Use template and inline functions to reduce function call overheads.
+ * Internal optimized Grisu2 and floating point parsing implementations.
+ * Optional SSE2/SSE4.2 support.
+
+## Standard compliance
+
+* RapidJSON should be fully RFC4627/ECMA-404 compliance.
+* Support Unicode surrogate.
+* Support null character (`"\u0000"`)
+ * For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string.
+* Support optional relaxed syntax.
+ * Single line (`// ...`) and multiple line (`/* ... */`) comments.
+
+## Unicode
+
+* Support UTF-8, UTF-16, UTF-32 encodings, including little endian and big endian.
+ * These encodings are used in input/output streams and in-memory representation.
+* Support automatic detection of encodings in input stream.
+* Support transcoding between encodings internally.
+ * For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM.
+* Support encoding validation internally.
+ * For example, you can read a UTF-8 file, and let RapidJSON check whether all JSON strings are valid UTF-8 byte sequence.
+* Support custom character types.
+ * By default the character types are `char` for UTF8, `wchar_t` for UTF16, `uint32_t` for UTF32.
+* Support custom encodings.
+
+## API styles
+
+* SAX (Simple API for XML) style API
+ * Similar to [SAX](http://en.wikipedia.org/wiki/Simple_API_for_XML), RapidJSON provides a event sequential access parser API (`rapidjson::GenericReader`). It also provides a generator API (`rapidjson::Writer`) which consumes the same set of events.
+* DOM (Document Object Model) style API
+ * Similar to [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) for HTML/XML, RapidJSON can parse JSON into a DOM representation (`rapidjson::GenericDocument`), for easy manipulation, and finally stringify back to JSON if needed.
+ * The DOM style API (`rapidjson::GenericDocument`) is actually implemented with SAX style API (`rapidjson::GenericReader`). SAX is faster but sometimes DOM is easier. Users can pick their choices according to scenarios.
+
+## Parsing
+
+* Recursive (default) and iterative parser
+ * Recursive parser is faster but prone to stack overflow in extreme cases.
+ * Iterative parser use custom stack to keep parsing state.
+* Support *in situ* parsing.
+ * Parse JSON string values in-place at the source JSON, and then the DOM points to addresses of those strings.
+ * Faster than convention parsing: no allocation for strings, no copy (if string does not contain escapes), cache-friendly.
+* Support 32-bit/64-bit signed/unsigned integer and `double` for JSON number type.
+* Support parsing multiple JSONs in input stream (`kParseStopWhenDoneFlag`).
+* Error Handling
+ * Support comprehensive error code if parsing failed.
+ * Support error message localization.
+
+## DOM (Document)
+
+* RapidJSON checks range of numerical values for conversions.
+* Optimization for string literal
+ * Only store pointer instead of copying
+* Optimization for "short" strings
+ * Store short string in `Value` internally without additional allocation.
+ * For UTF-8 string: maximum 11 characters in 32-bit, 15 characters in 64-bit.
+* Optionally support `std::string` (define `RAPIDJSON_HAS_STDSTRING=1`)
+
+## Generation
+
+* Support `rapidjson::PrettyWriter` for adding newlines and indentations.
+
+## Stream
+
+* Support `rapidjson::GenericStringBuffer` for storing the output JSON as string.
+* Support `rapidjson::FileReadStream` and `rapidjson::FileWriteStream` for input/output `FILE` object.
+* Support custom streams.
+
+## Memory
+
+* Minimize memory overheads for DOM.
+ * Each JSON value occupies exactly 16/20 bytes for most 32/64-bit machines (excluding text string).
+* Support fast default allocator.
+ * A stack-based allocator (allocate sequentially, prohibit to free individual allocations, suitable for parsing).
+ * User can provide a pre-allocated buffer. (Possible to parse a number of JSONs without any CRT allocation)
+* Support standard CRT(C-runtime) allocator.
+* Support custom allocators.
+
+## Miscellaneous
+
+* Some C++11 support (optional)
+ * Rvalue reference
+ * `noexcept` specifier
diff --git a/3rdparty/rapidjson/doc/features.zh-cn.md b/3rdparty/rapidjson/doc/features.zh-cn.md
new file mode 100644
index 00000000000..85a7db16274
--- /dev/null
+++ b/3rdparty/rapidjson/doc/features.zh-cn.md
@@ -0,0 +1,97 @@
+# 特点
+
+## 总体
+
+* 跨平å°
+ * 编译器:Visual Studioã€gccã€clangç­‰
+ * 架构:x86ã€x64ã€ARMç­‰
+ * æ“作系统:Windowsã€Mac OS Xã€Linuxã€iOSã€Androidç­‰
+* 容易安装
+ * åªæœ‰å¤´æ–‡ä»¶çš„库。åªéœ€æŠŠå¤´æ–‡ä»¶å¤åˆ¶è‡³ä½ çš„项目中。
+* ç‹¬ç«‹ã€æœ€å°ä¾èµ–
+ * ä¸éœ€ä¾èµ–STLã€BOOST等。
+ * åªåŒ…å«`<cstdio>`, `<cstdlib>`, `<cstring>`, `<inttypes.h>`, `<new>`, `<stdint.h>`。
+* 没使用C++异常ã€RTTI
+* 高性能
+ * 使用模版åŠå†…è”函数去é™ä½Žå‡½æ•°è°ƒç”¨å¼€é”€ã€‚
+ * 内部ç»ä¼˜åŒ–çš„Grisu2åŠæµ®ç‚¹æ•°è§£æžå®žçŽ°ã€‚
+ * å¯é€‰çš„SSE2/SSE4.2支æŒã€‚
+
+## ç¬¦åˆæ ‡å‡†
+
+* RapidJSON应完全符åˆRFC4627/ECMA-404标准。
+* 支æŒUnicod代ç†å¯¹ï¼ˆsurrogate pair)。
+* 支æŒç©ºå­—符(`"\u0000"`)。
+ * 例如,å¯ä»¥ä¼˜é›…地解æžåŠå¤„ç†`["Hello\u0000World"]`。å«è¯»å†™å­—符串长度的API。
+* æ”¯æŒæ”¾å®½çš„å¯é€‰è¯­æ³•
+ * å•行(`// ...`)åŠå¤šè¡Œï¼ˆ`/* ... */`) 注释。
+
+## Unicode
+
+* 支æŒUTF-8ã€UTF-16ã€UTF-32ç¼–ç ï¼ŒåŒ…括å°ç«¯åºå’Œå¤§ç«¯åºã€‚
+ * 这些编ç ç”¨äºŽè¾“入输出æµï¼Œä»¥åŠå†…存中的表示。
+* 支æŒä»Žè¾“å…¥æµè‡ªåŠ¨æ£€æµ‹ç¼–ç ã€‚
+* 内部支æŒç¼–ç çš„转æ¢ã€‚
+ * 例如,你å¯ä»¥è¯»å–一个UTF-8文件,让RapidJSON把JSON字符串转æ¢è‡³UTF-16çš„DOM。
+* 内部支æŒç¼–ç æ ¡éªŒã€‚
+ * 例如,你å¯ä»¥è¯»å–一个UTF-8文件,让RapidJSONæ£€æŸ¥æ˜¯å¦æ‰€æœ‰JSONå­—ç¬¦ä¸²æ˜¯åˆæ³•çš„UTF-8字节åºåˆ—。
+* 支æŒè‡ªå®šä¹‰çš„字符类型。
+ * 预设的字符类型是:UTF-8为`char`,UTF-16为`wchar_t`,UTF32为`uint32_t`。
+* 支æŒè‡ªå®šä¹‰çš„ç¼–ç ã€‚
+
+## API风格
+
+* SAX(Simple API for XML)风格API
+ * 类似于[SAX](http://en.wikipedia.org/wiki/Simple_API_for_XML), RapidJSONæä¾›ä¸€ä¸ªäº‹ä»¶å¾ªåºè®¿é—®çš„è§£æžå™¨API(`rapidjson::GenericReader`)。RapidJSON也æä¾›ä¸€ä¸ªç”Ÿæˆå™¨API(`rapidjson::Writer`),å¯ä»¥å¤„ç†ç›¸åŒçš„事件集åˆã€‚
+* DOM(Document Object Model)风格API
+ * 类似于HTMLï¼XMLçš„[DOM](http://en.wikipedia.org/wiki/Document_Object_Model),RapidJSONå¯æŠŠJSONè§£æžè‡³ä¸€ä¸ªDOM表示方å¼ï¼ˆ`rapidjson::GenericDocument`),以方便æ“作。如有需è¦ï¼Œå¯æŠŠDOM转æ¢ï¼ˆstringify)回JSON。
+ * DOM风格API(`rapidjson::GenericDocument`)实际上是由SAX风格API(`rapidjson::GenericReader`)实现的。SAX更快,但有时DOMæ›´æ˜“ç”¨ã€‚ç”¨æˆ·å¯æ ¹æ®æƒ…况作出选择。
+
+## è§£æž
+
+* 递归å¼ï¼ˆé¢„设)åŠè¿­ä»£å¼è§£æžå™¨
+ * 递归å¼è§£æžå™¨è¾ƒå¿«ï¼Œä½†åœ¨æžç«¯æƒ…况下å¯å‡ºçŽ°å †æ ˆæº¢å‡ºã€‚
+ * 迭代å¼è§£æžå™¨ä½¿ç”¨è‡ªå®šä¹‰çš„堆栈去维æŒè§£æžçжæ€ã€‚
+* 支æŒåŽŸä½ï¼ˆ*in situ*)解æžã€‚
+ * 把JSON字符串的值解æžè‡³åŽŸJSON之中,然åŽè®©DOM指å‘那些字符串。
+ * æ¯”å¸¸è§„åˆ†æžæ›´å¿«ï¼šä¸éœ€å­—符串的内存分é…ã€ä¸éœ€å¤åˆ¶ï¼ˆå¦‚字符串ä¸å«è½¬ä¹‰ç¬¦ï¼‰ã€ç¼“å­˜å‹å¥½ã€‚
+* 对于JSON数字类型,支æŒ32-bit/64-bit的有å·ï¼æ— å·æ•´æ•°ï¼Œä»¥åŠ`double`。
+* 错误处ç†
+ * 支æŒè¯¦å°½çš„è§£æžé”™è¯¯ä»£å·ã€‚
+ * æ”¯æŒæœ¬åœ°åŒ–错误信æ¯ã€‚
+
+## DOM (Document)
+
+* RapidJSONåœ¨ç±»åž‹è½¬æ¢æ—¶ä¼šæ£€æŸ¥æ•°å€¼çš„范围。
+* 字符串字é¢é‡çš„优化
+ * åªå‚¨å­˜æŒ‡é’ˆï¼Œä¸ä½œå¤åˆ¶
+* 优化“短â€å­—符串
+ * 在`Value`内储存短字符串,无需é¢å¤–分é…。
+ * 对UTF-8字符串æ¥è¯´ï¼Œ32使ž¶æž„下å¯å­˜å‚¨æœ€å¤š11字符,64ä½ä¸‹15字符。
+* å¯é€‰åœ°æ”¯æŒ`std::string`(定义`RAPIDJSON_HAS_STDSTRING=1`)
+
+## 生æˆ
+
+* 支æŒ`rapidjson::PrettyWriter`去加入æ¢è¡ŒåŠç¼©è¿›ã€‚
+
+## 输入输出æµ
+
+* 支æŒ`rapidjson::GenericStringBuffer`,把输出的JSON储存于字符串内。
+* 支æŒ`rapidjson::FileReadStream`åŠ`rapidjson::FileWriteStream`,使用`FILE`对象作输入输出。
+* 支æŒè‡ªå®šä¹‰è¾“入输出æµã€‚
+
+## 内存
+
+* 最å°åŒ–DOM的内存开销。
+ * 对大部分32ï¼64使œºå™¨è€Œè¨€ï¼Œæ¯ä¸ªJSON值åªå 16或20字节(ä¸åŒ…å«å­—符串)。
+* 支æŒå¿«é€Ÿçš„预设分é…器。
+ * 它是一个堆栈形å¼çš„分é…器(顺åºåˆ†é…,ä¸å®¹è®¸å•独释放,适åˆè§£æžè¿‡ç¨‹ä¹‹ç”¨ï¼‰ã€‚
+ * ä½¿ç”¨è€…ä¹Ÿå¯æä¾›ä¸€ä¸ªé¢„åˆ†é…的缓冲区。(有å¯èƒ½è¾¾è‡³æ— éœ€CRT分é…就能解æžå¤šä¸ªJSON)
+* æ”¯æŒæ ‡å‡†CRT(C-runtime)分é…器。
+* 支æŒè‡ªå®šä¹‰åˆ†é…器。
+
+## å…¶ä»–
+
+* 一些C++11的支æŒï¼ˆå¯é€‰ï¼‰
+ * å³å€¼å¼•用(rvalue reference)
+ * `noexcept`修饰符
diff --git a/3rdparty/rapidjson/doc/internals.md b/3rdparty/rapidjson/doc/internals.md
new file mode 100644
index 00000000000..174a03a2477
--- /dev/null
+++ b/3rdparty/rapidjson/doc/internals.md
@@ -0,0 +1,365 @@
+# Internals
+
+This section records some design and implementation details.
+
+[TOC]
+
+# Architecture {#Architecture}
+
+## SAX and DOM
+
+The basic relationships of SAX and DOM is shown in the following UML diagram.
+
+![Architecture UML class diagram](diagram/architecture.png)
+
+The core of the relationship is the `Handler` concept. From the SAX side, `Reader` parses a JSON from a stream and publish events to a `Handler`. `Writer` implements the `Handler` concept to handle the same set of events. From the DOM side, `Document` implements the `Handler` concept to build a DOM according to the events. `Value` supports a `Value::Accept(Handler&)` function, which traverses the DOM to publish events.
+
+With this design, SAX is not dependent on DOM. Even `Reader` and `Writer` have no dependencies between them. This provides flexibility to chain event publisher and handlers. Besides, `Value` does not depends on SAX as well. So, in addition to stringify a DOM to JSON, user may also stringify it to a XML writer, or do anything else.
+
+## Utility Classes
+
+Both SAX and DOM APIs depends on 3 additional concepts: `Allocator`, `Encoding` and `Stream`. Their inheritance hierarchy is shown as below.
+
+![Utility classes UML class diagram](diagram/utilityclass.png)
+
+# Value {#Value}
+
+`Value` (actually a typedef of `GenericValue<UTF8<>>`) is the core of DOM API. This section describes the design of it.
+
+## Data Layout {#DataLayout}
+
+`Value` is a [variant type](http://en.wikipedia.org/wiki/Variant_type). In RapidJSON's context, an instance of `Value` can contain 1 of 6 JSON value types. This is possible by using `union`. Each `Value` contains two members: `union Data data_` and a`unsigned flags_`. The `flags_` indiciates the JSON type, and also additional information.
+
+The following tables show the data layout of each type. The 32-bit/64-bit columns indicates the size of the field in bytes.
+
+| Null | |32-bit|64-bit|
+|-------------------|----------------------------------|:----:|:----:|
+| (unused) | |4 |8 |
+| (unused) | |4 |4 |
+| (unused) | |4 |4 |
+| `unsigned flags_` | `kNullType kNullFlag` |4 |4 |
+
+| Bool | |32-bit|64-bit|
+|-------------------|----------------------------------------------------|:----:|:----:|
+| (unused) | |4 |8 |
+| (unused) | |4 |4 |
+| (unused) | |4 |4 |
+| `unsigned flags_` | `kBoolType` (either `kTrueFlag` or `kFalseFlag`) |4 |4 |
+
+| String | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `Ch* str` | Pointer to the string (may own) |4 |8 |
+| `SizeType length` | Length of string |4 |4 |
+| (unused) | |4 |4 |
+| `unsigned flags_` | `kStringType kStringFlag ...` |4 |4 |
+
+| Object | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `Member* members` | Pointer to array of members (owned) |4 |8 |
+| `SizeType size` | Number of members |4 |4 |
+| `SizeType capacity` | Capacity of members |4 |4 |
+| `unsigned flags_` | `kObjectType kObjectFlag` |4 |4 |
+
+| Array | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `Value* values` | Pointer to array of values (owned) |4 |8 |
+| `SizeType size` | Number of values |4 |4 |
+| `SizeType capacity` | Capacity of values |4 |4 |
+| `unsigned flags_` | `kArrayType kArrayFlag` |4 |4 |
+
+| Number (Int) | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `int i` | 32-bit signed integer |4 |4 |
+| (zero padding) | 0 |4 |4 |
+| (unused) | |4 |8 |
+| `unsigned flags_` | `kNumberType kNumberFlag kIntFlag kInt64Flag ...` |4 |4 |
+
+| Number (UInt) | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `unsigned u` | 32-bit unsigned integer |4 |4 |
+| (zero padding) | 0 |4 |4 |
+| (unused) | |4 |8 |
+| `unsigned flags_` | `kNumberType kNumberFlag kUIntFlag kUInt64Flag ...` |4 |4 |
+
+| Number (Int64) | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `int64_t i64` | 64-bit signed integer |8 |8 |
+| (unused) | |4 |8 |
+| `unsigned flags_` | `kNumberType kNumberFlag kInt64Flag ...` |4 |4 |
+
+| Number (Uint64) | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `uint64_t i64` | 64-bit unsigned integer |8 |8 |
+| (unused) | |4 |8 |
+| `unsigned flags_` | `kNumberType kNumberFlag kInt64Flag ...` |4 |4 |
+
+| Number (Double) | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `uint64_t i64` | Double precision floating-point |8 |8 |
+| (unused) | |4 |8 |
+| `unsigned flags_` | `kNumberType kNumberFlag kDoubleFlag` |4 |4 |
+
+Here are some notes:
+* To reduce memory consumption for 64-bit architecture, `SizeType` is typedef as `unsigned` instead of `size_t`.
+* Zero padding for 32-bit number may be placed after or before the actual type, according to the endianess. This makes possible for interpreting a 32-bit integer as a 64-bit integer, without any conversion.
+* An `Int` is always an `Int64`, but the converse is not always true.
+
+## Flags {#Flags}
+
+The 32-bit `flags_` contains both JSON type and other additional information. As shown in the above tables, each JSON type contains redundant `kXXXType` and `kXXXFlag`. This design is for optimizing the operation of testing bit-flags (`IsNumber()`) and obtaining a sequential number for each type (`GetType()`).
+
+String has two optional flags. `kCopyFlag` means that the string owns a copy of the string. `kInlineStrFlag` means using [Short-String Optimization](#ShortString).
+
+Number is a bit more complicated. For normal integer values, it can contains `kIntFlag`, `kUintFlag`, `kInt64Flag` and/or `kUint64Flag`, according to the range of the integer. For numbers with fraction, and integers larger than 64-bit range, they will be stored as `double` with `kDoubleFlag`.
+
+## Short-String Optimization {#ShortString}
+
+ Kosta (@Kosta-Github) provided a very neat short-string optimization. The optimization idea is given as follow. Excluding the `flags_`, a `Value` has 12 or 16 bytes (32-bit or 64-bit) for storing actual data. Instead of storing a pointer to a string, it is possible to store short strings in these space internally. For encoding with 1-byte character type (e.g. `char`), it can store maximum 11 or 15 characters string inside the `Value` type.
+
+| ShortString (Ch=char) | |32-bit|64-bit|
+|---------------------|-------------------------------------|:----:|:----:|
+| `Ch str[MaxChars]` | String buffer |11 |15 |
+| `Ch invLength` | MaxChars - Length |1 |1 |
+| `unsigned flags_` | `kStringType kStringFlag ...` |4 |4 |
+
+A special technique is applied. Instead of storing the length of string directly, it stores (MaxChars - length). This make it possible to store 11 characters with trailing `\0`.
+
+This optimization can reduce memory usage for copy-string. It can also improve cache-coherence thus improve runtime performance.
+
+# Allocator {#Allocator}
+
+`Allocator` is a concept in RapidJSON:
+~~~cpp
+concept Allocator {
+ static const bool kNeedFree; //!< Whether this allocator needs to call Free().
+
+ // Allocate a memory block.
+ // \param size of the memory block in bytes.
+ // \returns pointer to the memory block.
+ void* Malloc(size_t size);
+
+ // Resize a memory block.
+ // \param originalPtr The pointer to current memory block. Null pointer is permitted.
+ // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)
+ // \param newSize the new size in bytes.
+ void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);
+
+ // Free a memory block.
+ // \param pointer to the memory block. Null pointer is permitted.
+ static void Free(void *ptr);
+};
+~~~
+
+Note that `Malloc()` and `Realloc()` are member functions but `Free()` is static member function.
+
+## MemoryPoolAllocator {#MemoryPoolAllocator}
+
+`MemoryPoolAllocator` is the default allocator for DOM. It allocate but do not free memory. This is suitable for building a DOM tree.
+
+Internally, it allocates chunks of memory from the base allocator (by default `CrtAllocator`) and stores the chunks as a singly linked list. When user requests an allocation, it allocates memory from the following order:
+
+1. User supplied buffer if it is available. (See [User Buffer section in DOM](dom.md))
+2. If user supplied buffer is full, use the current memory chunk.
+3. If the current block is full, allocate a new block of memory.
+
+# Parsing Optimization {#ParsingOptimization}
+
+## Skip Whitespaces with SIMD {#SkipwhitespaceWithSIMD}
+
+When parsing JSON from a stream, the parser need to skip 4 whitespace characters:
+
+1. Space (`U+0020`)
+2. Character Tabulation (`U+000B`)
+3. Line Feed (`U+000A`)
+4. Carriage Return (`U+000D`)
+
+A simple implementation will be simply:
+~~~cpp
+void SkipWhitespace(InputStream& s) {
+ while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
+ s.Take();
+}
+~~~
+
+However, this requires 4 comparisons and a few branching for each character. This was found to be a hot spot.
+
+To accelerate this process, SIMD was applied to compare 16 characters with 4 white spaces for each iteration. Currently RapidJSON only supports SSE2 and SSE4.2 instructions for this. And it is only activated for UTF-8 memory streams, including string stream or *in situ* parsing.
+
+To enable this optimization, need to define `RAPIDJSON_SSE2` or `RAPIDJSON_SSE42` before including `rapidjson.h`. Some compilers can detect the setting, as in `perftest.h`:
+
+~~~cpp
+// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler.
+// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported.
+#if defined(__SSE4_2__)
+# define RAPIDJSON_SSE42
+#elif defined(__SSE2__)
+# define RAPIDJSON_SSE2
+#endif
+~~~
+
+Note that, these are compile-time settings. Running the executable on a machine without such instruction set support will make it crash.
+
+### Page boundary issue
+
+In an early version of RapidJSON, [an issue](https://code.google.com/archive/p/rapidjson/issues/104) reported that the `SkipWhitespace_SIMD()` causes crash very rarely (around 1 in 500,000). After investigation, it is suspected that `_mm_loadu_si128()` accessed bytes after `'\0'`, and across a protected page boundary.
+
+In [Intel® 64 and IA-32 Architectures Optimization Reference Manual
+](http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html), section 10.2.1:
+
+> To support algorithms requiring unaligned 128-bit SIMD memory accesses, memory buffer allocation by a caller function should consider adding some pad space so that a callee function can safely use the address pointer safely with unaligned 128-bit SIMD memory operations.
+> The minimal padding size should be the width of the SIMD register that might be used in conjunction with unaligned SIMD memory access.
+
+This is not feasible as RapidJSON should not enforce such requirement.
+
+To fix this issue, currently the routine process bytes up to the next aligned address. After tha, use aligned read to perform SIMD processing. Also see [#85](https://github.com/miloyip/rapidjson/issues/85).
+
+## Local Stream Copy {#LocalStreamCopy}
+
+During optimization, it is found that some compilers cannot localize some member data access of streams into local variables or registers. Experimental results show that for some stream types, making a copy of the stream and used it in inner-loop can improve performance. For example, the actual (non-SIMD) implementation of `SkipWhitespace()` is implemented as:
+
+~~~cpp
+template<typename InputStream>
+void SkipWhitespace(InputStream& is) {
+ internal::StreamLocalCopy<InputStream> copy(is);
+ InputStream& s(copy.s);
+
+ while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
+ s.Take();
+}
+~~~
+
+Depending on the traits of stream, `StreamLocalCopy` will make (or not make) a copy of the stream object, use it locally and copy the states of stream back to the original stream.
+
+## Parsing to Double {#ParsingDouble}
+
+Parsing string into `double` is difficult. The standard library function `strtod()` can do the job but it is slow. By default, the parsers use normal precision setting. This has has maximum 3 [ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) error and implemented in `internal::StrtodNormalPrecision()`.
+
+When using `kParseFullPrecisionFlag`, the parsers calls `internal::StrtodFullPrecision()` instead, and this function actually implemented 3 versions of conversion methods.
+1. [Fast-Path](http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/).
+2. Custom DIY-FP implementation as in [double-conversion](https://github.com/floitsch/double-conversion).
+3. Big Integer Method as in (Clinger, William D. How to read floating point numbers accurately. Vol. 25. No. 6. ACM, 1990).
+
+If the first conversion methods fail, it will try the second, and so on.
+
+# Generation Optimization {#GenerationOptimization}
+
+## Integer-to-String conversion {#itoa}
+
+The naive algorithm for integer-to-string conversion involves division per each decimal digit. We have implemented various implementations and evaluated them in [itoa-benchmark](https://github.com/miloyip/itoa-benchmark).
+
+Although SSE2 version is the fastest but the difference is minor by comparing to the first running-up `branchlut`. And `branchlut` is pure C++ implementation so we adopt `branchlut` in RapidJSON.
+
+## Double-to-String conversion {#dtoa}
+
+Originally RapidJSON uses `snprintf(..., ..., "%g")` to achieve double-to-string conversion. This is not accurate as the default precision is 6. Later we also find that this is slow and there is an alternative.
+
+Google's V8 [double-conversion](https://github.com/floitsch/double-conversion
+) implemented a newer, fast algorithm called Grisu3 (Loitsch, Florian. "Printing floating-point numbers quickly and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243.).
+
+However, since it is not header-only so that we implemented a header-only version of Grisu2. This algorithm guarantees that the result is always accurate. And in most of cases it produces the shortest (optimal) string representation.
+
+The header-only conversion function has been evaluated in [dtoa-benchmark](https://github.com/miloyip/dtoa-benchmark).
+
+# Parser {#Parser}
+
+## Iterative Parser {#IterativeParser}
+
+The iterative parser is a recursive descent LL(1) parser
+implemented in a non-recursive manner.
+
+### Grammar {#IterativeParserGrammar}
+
+The grammar used for this parser is based on strict JSON syntax:
+~~~~~~~~~~
+S -> array | object
+array -> [ values ]
+object -> { members }
+values -> non-empty-values | ε
+non-empty-values -> value addition-values
+addition-values -> ε | , non-empty-values
+members -> non-empty-members | ε
+non-empty-members -> member addition-members
+addition-members -> ε | , non-empty-members
+member -> STRING : value
+value -> STRING | NUMBER | NULL | BOOLEAN | object | array
+~~~~~~~~~~
+
+Note that left factoring is applied to non-terminals `values` and `members`
+to make the grammar be LL(1).
+
+### Parsing Table {#IterativeParserParsingTable}
+
+Based on the grammar, we can construct the FIRST and FOLLOW set.
+
+The FIRST set of non-terminals is listed below:
+
+| NON-TERMINAL | FIRST |
+|:-----------------:|:--------------------------------:|
+| array | [ |
+| object | { |
+| values | ε STRING NUMBER NULL BOOLEAN { [ |
+| addition-values | ε COMMA |
+| members | ε STRING |
+| addition-members | ε COMMA |
+| member | STRING |
+| value | STRING NUMBER NULL BOOLEAN { [ |
+| S | [ { |
+| non-empty-members | STRING |
+| non-empty-values | STRING NUMBER NULL BOOLEAN { [ |
+
+The FOLLOW set is listed below:
+
+| NON-TERMINAL | FOLLOW |
+|:-----------------:|:-------:|
+| S | $ |
+| array | , $ } ] |
+| object | , $ } ] |
+| values | ] |
+| non-empty-values | ] |
+| addition-values | ] |
+| members | } |
+| non-empty-members | } |
+| addition-members | } |
+| member | , } |
+| value | , } ] |
+
+Finally the parsing table can be constructed from FIRST and FOLLOW set:
+
+| NON-TERMINAL | [ | { | , | : | ] | } | STRING | NUMBER | NULL | BOOLEAN |
+|:-----------------:|:---------------------:|:---------------------:|:-------------------:|:-:|:-:|:-:|:-----------------------:|:---------------------:|:---------------------:|:---------------------:|
+| S | array | object | | | | | | | | |
+| array | [ values ] | | | | | | | | | |
+| object | | { members } | | | | | | | | |
+| values | non-empty-values | non-empty-values | | | ε | | non-empty-values | non-empty-values | non-empty-values | non-empty-values |
+| non-empty-values | value addition-values | value addition-values | | | | | value addition-values | value addition-values | value addition-values | value addition-values |
+| addition-values | | | , non-empty-values | | ε | | | | | |
+| members | | | | | | ε | non-empty-members | | | |
+| non-empty-members | | | | | | | member addition-members | | | |
+| addition-members | | | , non-empty-members | | | ε | | | | |
+| member | | | | | | | STRING : value | | | |
+| value | array | object | | | | | STRING | NUMBER | NULL | BOOLEAN |
+
+There is a great [tool](http://hackingoff.com/compilers/predict-first-follow-set) for above grammar analysis.
+
+### Implementation {#IterativeParserImplementation}
+
+Based on the parsing table, a direct(or conventional) implementation
+that pushes the production body in reverse order
+while generating a production could work.
+
+In RapidJSON, several modifications(or adaptations to current design) are made to a direct implementation.
+
+First, the parsing table is encoded in a state machine in RapidJSON.
+States are constructed by the head and body of production.
+State transitions are constructed by production rules.
+Besides, extra states are added for productions involved with `array` and `object`.
+In this way the generation of array values or object members would be a single state transition,
+rather than several pop/push operations in the direct implementation.
+This also makes the estimation of stack size more easier.
+
+The state diagram is shown as follows:
+
+![State Diagram](diagram/iterative-parser-states-diagram.png)
+
+Second, the iterative parser also keeps track of array's value count and object's member count
+in its internal stack, which may be different from a conventional implementation.
diff --git a/3rdparty/rapidjson/doc/logo/rapidjson.png b/3rdparty/rapidjson/doc/logo/rapidjson.png
new file mode 100644
index 00000000000..b3b2f80ccb9
--- /dev/null
+++ b/3rdparty/rapidjson/doc/logo/rapidjson.png
Binary files differ
diff --git a/3rdparty/rapidjson/doc/logo/rapidjson.svg b/3rdparty/rapidjson/doc/logo/rapidjson.svg
new file mode 100644
index 00000000000..9708d5a06f3
--- /dev/null
+++ b/3rdparty/rapidjson/doc/logo/rapidjson.svg
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="217.15039"
+ height="60.831055"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="rapidjson.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient3801">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop3803" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop3805" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3801"
+ id="linearGradient3807"
+ x1="81.25"
+ y1="52.737183"
+ x2="122.25"
+ y2="52.737183"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.2378503,0,0,1.1662045,-226.99279,64.427324)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3801"
+ id="linearGradient3935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.4768835,0,0,2.2904698,246.48785,81.630301)"
+ x1="81.25"
+ y1="52.737183"
+ x2="115.96579"
+ y2="48.439766" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3801"
+ id="linearGradient3947"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.2378503,0,0,1.1662045,-226.99279,-10.072676)"
+ x1="81.25"
+ y1="52.737183"
+ x2="122.25"
+ y2="52.737183" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2"
+ inkscape:cx="207.8959"
+ inkscape:cy="-3.2283687"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1137"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ fit-margin-top="10"
+ fit-margin-left="10"
+ fit-margin-right="10"
+ fit-margin-bottom="10" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-39.132812,-38.772339)">
+ <text
+ sodipodi:linespacing="125%"
+ id="text3939"
+ y="79.862183"
+ x="147.5"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Microsoft JhengHei;-inkscape-font-specification:Microsoft JhengHei"
+ xml:space="preserve"><tspan
+ style="font-size:48px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Inconsolata;-inkscape-font-specification:Inconsolata"
+ y="79.862183"
+ x="147.5"
+ id="tspan3941"
+ sodipodi:role="line"><tspan
+ id="tspan3943"
+ style="font-size:42px;font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Segoe UI;-inkscape-font-specification:Segoe UI Oblique">Rapid</tspan><tspan
+ id="tspan3945"
+ style="font-weight:bold;-inkscape-font-specification:Inconsolata Bold">JSON</tspan></tspan></text>
+ </g>
+</svg>
diff --git a/3rdparty/rapidjson/doc/misc/DoxygenLayout.xml b/3rdparty/rapidjson/doc/misc/DoxygenLayout.xml
new file mode 100644
index 00000000000..b7c958665b4
--- /dev/null
+++ b/3rdparty/rapidjson/doc/misc/DoxygenLayout.xml
@@ -0,0 +1,194 @@
+<doxygenlayout version="1.0">
+ <!-- Generated by doxygen 1.8.7 -->
+ <!-- Navigation index tabs for HTML output -->
+ <navindex>
+ <tab type="mainpage" visible="yes" title=""/>
+ <tab type="pages" visible="yes" title="" intro=""/>
+ <tab type="modules" visible="yes" title="" intro=""/>
+ <tab type="namespaces" visible="yes" title="">
+ <tab type="namespacelist" visible="yes" title="" intro=""/>
+ <tab type="namespacemembers" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="classes" visible="yes" title="">
+ <tab type="classlist" visible="yes" title="" intro=""/>
+ <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
+ <tab type="hierarchy" visible="yes" title="" intro=""/>
+ <tab type="classmembers" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="files" visible="yes" title="">
+ <tab type="filelist" visible="yes" title="" intro=""/>
+ <tab type="globals" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="examples" visible="yes" title="" intro=""/>
+ </navindex>
+
+ <!-- Layout definition for a class page -->
+ <class>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <inheritancegraph visible="$CLASS_GRAPH"/>
+ <collaborationgraph visible="$COLLABORATION_GRAPH"/>
+ <memberdecl>
+ <nestedclasses visible="yes" title=""/>
+ <publictypes title=""/>
+ <services title=""/>
+ <interfaces title=""/>
+ <publicslots title=""/>
+ <signals title=""/>
+ <publicmethods title=""/>
+ <publicstaticmethods title=""/>
+ <publicattributes title=""/>
+ <publicstaticattributes title=""/>
+ <protectedtypes title=""/>
+ <protectedslots title=""/>
+ <protectedmethods title=""/>
+ <protectedstaticmethods title=""/>
+ <protectedattributes title=""/>
+ <protectedstaticattributes title=""/>
+ <packagetypes title=""/>
+ <packagemethods title=""/>
+ <packagestaticmethods title=""/>
+ <packageattributes title=""/>
+ <packagestaticattributes title=""/>
+ <properties title=""/>
+ <events title=""/>
+ <privatetypes title=""/>
+ <privateslots title=""/>
+ <privatemethods title=""/>
+ <privatestaticmethods title=""/>
+ <privateattributes title=""/>
+ <privatestaticattributes title=""/>
+ <friends title=""/>
+ <related title="" subtitle=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <services title=""/>
+ <interfaces title=""/>
+ <constructors title=""/>
+ <functions title=""/>
+ <related title=""/>
+ <variables title=""/>
+ <properties title=""/>
+ <events title=""/>
+ </memberdef>
+ <allmemberslink visible="yes"/>
+ <usedfiles visible="$SHOW_USED_FILES"/>
+ <authorsection visible="yes"/>
+ </class>
+
+ <!-- Layout definition for a namespace page -->
+ <namespace>
+ <briefdescription visible="yes"/>
+ <memberdecl>
+ <nestednamespaces visible="yes" title=""/>
+ <constantgroups visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </namespace>
+
+ <!-- Layout definition for a file page -->
+ <file>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <includegraph visible="$INCLUDE_GRAPH"/>
+ <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
+ <sourcelink visible="yes"/>
+ <memberdecl>
+ <classes visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <constantgroups visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection/>
+ </file>
+
+ <!-- Layout definition for a group page -->
+ <group>
+ <briefdescription visible="yes"/>
+ <groupgraph visible="$GROUP_GRAPHS"/>
+ <memberdecl>
+ <nestedgroups visible="yes" title=""/>
+ <dirs visible="yes" title=""/>
+ <files visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <pagedocs/>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </group>
+
+ <!-- Layout definition for a directory page -->
+ <directory>
+ <briefdescription visible="yes"/>
+ <directorygraph visible="yes"/>
+ <memberdecl>
+ <dirs visible="yes"/>
+ <files visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ </directory>
+</doxygenlayout>
diff --git a/3rdparty/rapidjson/doc/misc/doxygenextra.css b/3rdparty/rapidjson/doc/misc/doxygenextra.css
new file mode 100644
index 00000000000..bd6737585b6
--- /dev/null
+++ b/3rdparty/rapidjson/doc/misc/doxygenextra.css
@@ -0,0 +1,274 @@
+body code {
+ margin: 0;
+ border: 1px solid #ddd;
+ background-color: #f8f8f8;
+ border-radius: 3px;
+ padding: 0;
+}
+
+a {
+ color: #4183c4;
+}
+
+a.el {
+ font-weight: normal;
+}
+
+body, table, div, p, dl {
+ color: #333333;
+ font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
+ font-size: 15px;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+ line-height: 25.5px;
+}
+
+body {
+ background-color: #eee;
+}
+
+div.header {
+ background-image: none;
+ background-color: white;
+ margin: 0px;
+ border: 0px;
+}
+
+div.headertitle {
+ width: 858px;
+ margin: 30px;
+ padding: 0px;
+}
+
+div.toc {
+ background-color: #f8f8f8;
+ border-color: #ddd;
+ margin-right: 10px;
+ margin-left: 20px;
+}
+div.toc h3 {
+ color: #333333;
+ font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
+ font-size: 18px;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+}
+div.toc li {
+ color: #333333;
+ font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
+ font-size: 12px;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+}
+
+.title {
+ font-size: 2.5em;
+ line-height: 63.75px;
+ border-bottom: 1px solid #ddd;
+ margin-bottom: 15px;
+ margin-left: 0px;
+ margin-right: 0px;
+ margin-top: 0px;
+}
+
+.summary {
+ float: none !important;
+ width: auto !important;
+ padding-top: 10px;
+ padding-right: 10px !important;
+}
+
+.summary + .headertitle .title {
+ font-size: 1.5em;
+ line-height: 2.0em;
+}
+
+body h1 {
+ font-size: 2em;
+ line-height: 1.7;
+ border-bottom: 1px solid #eee;
+ margin: 1em 0 15px;
+ padding: 0;
+ overflow: hidden;
+}
+
+body h2 {
+ font-size: 1.5em;
+ line-height: 1.7;
+ margin: 1em 0 15px;
+ padding: 0;
+}
+
+pre.fragment {
+ font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
+ font-size: 13px;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+ line-height: 19px;
+}
+
+table.doxtable th {
+ background-color: #f8f8f8;
+ color: #333333;
+ font-size: 15px;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #ddd;
+}
+
+#doc-content {
+ background-color: #fff;
+ width: 918px;
+ height: auto !important;
+ margin-left: 270px !important;
+}
+
+div.contents {
+ width: 858px;
+ margin: 30px;
+}
+
+div.line {
+ font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
+ font-size: 13px;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+ line-height: 19px;
+}
+
+tt, code, pre {
+ font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
+ font-size: 12px;
+}
+
+div.fragment {
+ background-color: #f8f8f8;
+ border: 1px solid #ddd;
+ font-size: 13px;
+ line-height: 19px;
+ overflow: auto;
+ padding: 6px 10px;
+ border-radius: 3px;
+}
+
+#topbanner {
+ position: fixed;
+ margin: 15px;
+ z-index: 101;
+}
+
+#projectname
+{
+ font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
+ font-size: 38px;
+ font-weight: bold;
+ line-height: 63.75px;
+ margin: 0px;
+ padding: 2px 0px;
+}
+
+#projectbrief
+{
+ font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
+ font-size: 16px;
+ line-height: 22.4px;
+ margin: 0px 0px 13px 0px;
+ padding: 2px;
+}
+
+/* side bar and search */
+
+#side-nav
+{
+ padding: 10px 0px 20px 20px;
+ border-top: 60px solid #2980b9;
+ background-color: #343131;
+ width: 250px !important;
+ height: 100% !important;
+ position: fixed;
+}
+
+#nav-tree
+{
+ background-color: transparent;
+ background-image: none;
+ height: 100% !important;
+}
+
+#nav-tree .label
+{
+ font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
+ line-height: 25.5px;
+ font-size: 15px;
+}
+
+#nav-tree
+{
+ color: #b3b3b3;
+}
+
+#nav-tree .selected {
+ background-image: none;
+}
+
+#nav-tree a
+{
+ color: #b3b3b3;
+}
+
+#github
+{
+ position: fixed;
+ left: auto;
+ right: auto;
+ width: 250px;
+}
+
+#MSearchBox
+{
+ margin: 20px;
+ left: 40px;
+ right: auto;
+ position: fixed;
+ width: 180px;
+}
+
+#MSearchField
+{
+ width: 121px;
+}
+
+#MSearchResultsWindow
+{
+ left: 45px !important;
+}
+
+#nav-sync
+{
+ display: none;
+}
+
+.ui-resizable .ui-resizable-handle
+{
+ width: 0px;
+}
+
+#nav-path
+{
+ display: none;
+}
+
+/* external link icon */
+div.contents a[href ^= "http"]:after {
+ content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);
+}
+
+.githublogo {
+ content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RERCMUIwOUY4NkNFMTFFM0FBNTJFRTMzNTJEMUJDNDYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RERCMUIwOUU4NkNFMTFFM0FBNTJFRTMzNTJEMUJDNDYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU1MTc4QTJBOTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU1MTc4QTJCOTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+jUqS1wAAApVJREFUeNq0l89rE1EQx3e3gVJoSPzZeNEWPKgHoa0HBak0iHiy/4C3WvDmoZ56qJ7txVsPQu8qlqqHIhRKJZceesmhioQEfxTEtsoSpdJg1u/ABJ7Pmc1m8zLwgWTmzcw3L+/te+tHUeQltONgCkyCi2AEDHLsJ6iBMlgHL8FeoqokoA2j4CloRMmtwTmj7erHBXPgCWhG6a3JNXKdCiDl1cidVbXZkJoXQRi5t5BrxwoY71FzU8S4JuAIqFkJ2+BFSlEh525b/hr3+k/AklDkNsf6wTT4yv46KIMNpsy+iMdMc47HNWxbsgVcUn7FmLAzzoFAWDsBx+wVP6bUpp5ewI+DOeUx0Wd9D8F70BTGNjkWtqnhmT1JQAHcUgZd8Lo3rQb1LAT8eJVUfgGvHQigGp+V2Z0iAUUl8QH47kAA1XioxIo+bRN8OG8F/oBjwv+Z1nJgX5jpdzQDw0LCjsPmrcW7I/iHScCAEDj03FtD8A0EyuChHgg4KTlJQF3wZ7WELppnBX+dBFSVpJsOBWi1qiRgSwnOgoyD5hmuJdkWCVhTgnTvW3AgYIFrSbZGh0UW/Io5Vp+DQoK7o80pztWMemZbgxeNwCNwDbw1fIfgGZjhU6xPaJgBV8BdsMw5cbZoHsenwYFxkZzl83xTSKTiviCAfCsJLysH3POfC8m8NegyGAGfLP/VmGmfSChgXroR0RSWjEFv2J/nG84cuKFMf4sTCZqXuJd4KaXFVjEG3+tw4eXbNK/YC9oXXs3O8NY8y99L4BXY5cvLY/Bb2VZ58EOJVcB18DHJq9lRsKr8inyKGVjlmh29mtHs3AHfuhCwy1vXT/Nu2GKQt+UHsGdctyX6eQyNvc+5sfX9Dl7Pe2J/BRgAl2CpwmrsHR0AAAAASUVORK5CYII=);
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/doc/misc/footer.html b/3rdparty/rapidjson/doc/misc/footer.html
new file mode 100644
index 00000000000..843aa110448
--- /dev/null
+++ b/3rdparty/rapidjson/doc/misc/footer.html
@@ -0,0 +1,27 @@
+<!-- HTML footer for doxygen 1.8.7-->
+<!-- start footer part -->
+<!--BEGIN GENERATE_TREEVIEW-->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ $navpath
+ </ul>
+</div>
+<!--END GENERATE_TREEVIEW-->
+<script type="text/javascript">
+ /* * * CONFIGURATION VARIABLES * * */
+ var disqus_shortname = 'rapidjson-doc';
+
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function() {
+ var dt = document.createElement('div');
+ dt.id = "disqus_thread";
+ (document.getElementsByClassName('contents')[0]).appendChild(dt);
+
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+
+</body>
+</html>
diff --git a/3rdparty/rapidjson/doc/misc/header.html b/3rdparty/rapidjson/doc/misc/header.html
new file mode 100644
index 00000000000..d43f2aaff9a
--- /dev/null
+++ b/3rdparty/rapidjson/doc/misc/header.html
@@ -0,0 +1,33 @@
+<!-- HTML header for doxygen 1.8.7-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen $doxygenversion"/>
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
+<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
+$treeview
+$search
+$mathjax
+<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
+$extrastylesheet
+</head>
+<script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-63929386-1', 'auto');
+ ga('send', 'pageview');
+</script>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="topbanner"><a href="https://github.com/miloyip/rapidjson" title="RapidJSON GitHub"><i class="githublogo"></i></a></div>
+$searchbox
+<!--END TITLEAREA-->
+<!-- end header part -->
diff --git a/3rdparty/rapidjson/doc/performance.md b/3rdparty/rapidjson/doc/performance.md
new file mode 100644
index 00000000000..702ca7230b5
--- /dev/null
+++ b/3rdparty/rapidjson/doc/performance.md
@@ -0,0 +1,26 @@
+# Performance
+
+There is a [native JSON benchmark collection] [1] which evaluates speed, memory usage and code size of various operations among 20 JSON libaries.
+
+[1]: https://github.com/miloyip/nativejson-benchmark
+
+The old performance article for RapidJSON 0.1 is provided [here](https://code.google.com/p/rapidjson/wiki/Performance).
+
+Additionally, you may refer to the following third-party benchmarks.
+
+## Third-party benchmarks
+
+* [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013)
+ * [casablanca](https://casablanca.codeplex.com/)
+ * [json_spirit](https://github.com/cierelabs/json_spirit)
+ * [jsoncpp](http://jsoncpp.sourceforge.net/)
+ * [libjson](http://sourceforge.net/projects/libjson/)
+ * [rapidjson](https://github.com/miloyip/rapidjson/)
+ * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html)
+
+* [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013)
+ * [sajson](https://github.com/chadaustin/sajson)
+ * [rapidjson](https://github.com/miloyip/rapidjson/)
+ * [vjson](https://code.google.com/p/vjson/)
+ * [YAJL](http://lloyd.github.com/yajl/)
+ * [Jansson](http://www.digip.org/jansson/)
diff --git a/3rdparty/rapidjson/doc/performance.zh-cn.md b/3rdparty/rapidjson/doc/performance.zh-cn.md
new file mode 100644
index 00000000000..b590fe0c617
--- /dev/null
+++ b/3rdparty/rapidjson/doc/performance.zh-cn.md
@@ -0,0 +1,26 @@
+# 性能
+
+有一个[native JSON benchmark collection][1]项目,能评估20个JSON库在ä¸åŒæ“作下的速度ã€å…§å­˜ç”¨é‡åŠä»£ç å¤§å°ã€‚
+
+[1]: https://github.com/miloyip/nativejson-benchmark
+
+RapidJSON 0.1版本的性能测试文章ä½äºŽ[这里](https://code.google.com/p/rapidjson/wiki/Performance).
+
+此外,你也å¯ä»¥å‚考以下这些第三方的评测。
+
+## 第三方评测
+
+* [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013)
+ * [casablanca](https://casablanca.codeplex.com/)
+ * [json_spirit](https://github.com/cierelabs/json_spirit)
+ * [jsoncpp](http://jsoncpp.sourceforge.net/)
+ * [libjson](http://sourceforge.net/projects/libjson/)
+ * [rapidjson](https://github.com/miloyip/rapidjson/)
+ * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html)
+
+* [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013)
+ * [sajson](https://github.com/chadaustin/sajson)
+ * [rapidjson](https://github.com/miloyip/rapidjson/)
+ * [vjson](https://code.google.com/p/vjson/)
+ * [YAJL](http://lloyd.github.com/yajl/)
+ * [Jansson](http://www.digip.org/jansson/)
diff --git a/3rdparty/rapidjson/doc/pointer.md b/3rdparty/rapidjson/doc/pointer.md
new file mode 100644
index 00000000000..3927a12ec6e
--- /dev/null
+++ b/3rdparty/rapidjson/doc/pointer.md
@@ -0,0 +1,234 @@
+# Pointer
+
+## Status: experimental, shall be included in v1.1
+
+JSON Pointer is a standardized ([RFC6901]) way to select a value inside a JSON Document (DOM). This can be analogous to XPath for XML document. However, JSON Pointer is much simpler, and a single JSON Pointer only pointed to a single value.
+
+Using RapidJSON's implementation of JSON Pointer can simplify some manipulations of the DOM.
+
+[TOC]
+
+# JSON Pointer {#JsonPointer}
+
+A JSON Pointer is a list of zero-to-many tokens, each prefixed by `/`. Each token can be a string or a number. For example, given a JSON:
+~~~javascript
+{
+ "foo" : ["bar", "baz"],
+ "pi" : 3.1416
+}
+~~~
+
+The following JSON Pointers resolve this JSON as:
+
+1. `"/foo"` → `[ "bar", "baz" ]`
+2. `"/foo/0"` → `"bar"`
+3. `"/foo/1"` → `"baz"`
+4. `"/pi"` → `3.1416`
+
+Note that, an empty JSON Pointer `""` (zero token) resolves to the whole JSON.
+
+# Basic Usage {#BasicUsage}
+
+The following example code is self-explanatory.
+
+~~~cpp
+#include "rapidjson/pointer.h"
+
+// ...
+Document d;
+
+// Create DOM by Set()
+Pointer("/project").Set(d, "RapidJSON");
+Pointer("/stars").Set(d, 10);
+
+// { "project" : "RapidJSON", "stars" : 10 }
+
+// Access DOM by Get(). It return nullptr if the value does not exist.
+if (Value* stars = Pointer("/stars").Get(d))
+ stars->SetInt(stars->GetInt() + 1);
+
+// { "project" : "RapidJSON", "stars" : 11 }
+
+// Set() and Create() automatically generate parents if not exist.
+Pointer("/a/b/0").Create(d);
+
+// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] } }
+
+// GetWithDefault() returns reference. And it deep clones the default value.
+Value& hello = Pointer("/hello").GetWithDefault(d, "world");
+
+// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "world" }
+
+// Swap() is similar to Set()
+Value x("C++");
+Pointer("/hello").Swap(d, x);
+
+// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "C++" }
+// x becomes "world"
+
+// Erase a member or element, return true if the value exists
+bool success = Pointer("/a").Erase(d);
+assert(success);
+
+// { "project" : "RapidJSON", "stars" : 10 }
+~~~
+
+# Helper Functions {#HelperFunctions}
+
+Since object-oriented calling convention may be non-intuitive, RapidJSON also provides helper functions, which just wrap the member functions with free-functions.
+
+The following example does exactly the same as the above one.
+
+~~~cpp
+Document d;
+
+SetValueByPointer(d, "/project", "RapidJSON");
+SetValueByPointer(d, "/stars", 10);
+
+if (Value* stars = GetValueByPointer(d, "/stars"))
+ stars->SetInt(stars->GetInt() + 1);
+
+CreateValueByPointer(d, "/a/b/0");
+
+Value& hello = GetValueByPointerWithDefault(d, "/hello", "world");
+
+Value x("C++");
+SwapValueByPointer(d, "/hello", x);
+
+bool success = EraseValueByPointer(d, "/a");
+assert(success);
+~~~
+
+The conventions are shown here for comparison:
+
+1. `Pointer(source).<Method>(root, ...)`
+2. `<Method>ValueByPointer(root, Pointer(source), ...)`
+3. `<Method>ValueByPointer(root, source, ...)`
+
+# Resolving Pointer {#ResolvingPointer}
+
+`Pointer::Get()` or `GetValueByPointer()` function does not modify the DOM. If the tokens cannot match a value in the DOM, it returns `nullptr`. User can use this to check whether a value exists.
+
+Note that, numerical tokens can represent an array index or member name. The resolving process will match the values according to the types of value.
+
+~~~javascript
+{
+ "0" : 123,
+ "1" : [456]
+}
+~~~
+
+1. `"/0"` → `123`
+2. `"/1/0"` → `456`
+
+The token `"0"` is treated as member name in the first pointer. It is treated as an array index in the second pointer.
+
+The other functions, including `Create()`, `GetWithDefault()`, `Set()` and `Swap()`, will change the DOM. These functions will always succeed. They will create the parent values if they do not exist. If the parent values do not match the tokens, they will also be forced to change their type. Changing the type also mean fully removal of that DOM subtree.
+
+Parsing the above JSON into `d`,
+
+~~~cpp
+SetValueByPointer(d, "1/a", 789); // { "0" : 123, "1" : { "a" : 789 } }
+~~~
+
+## Resolving Minus Sign Token
+
+Besides, [RFC6901] defines a special token `-` (single minus sign), which represents the pass-the-end element of an array. `Get()` only treats this token as a member name '"-"'. Yet the other functions can resolve this for array, equivalent to calling `Value::PushBack()` to the array.
+
+~~~cpp
+Document d;
+d.Parse("{\"foo\":[123]}");
+SetValueByPointer(d, "/foo/-", 456); // { "foo" : [123, 456] }
+SetValueByPointer(d, "/-", 789); // { "foo" : [123, 456], "-" : 789 }
+~~~
+
+## Resolving Document and Value
+
+When using `p.Get(root)` or `GetValueByPointer(root, p)`, `root` is a (const) `Value&`. That means, it can be a subtree of the DOM.
+
+The other functions have two groups of signature. One group uses `Document& document` as parameter, another one uses `Value& root`. The first group uses `document.GetAllocator()` for creating values. And the second group needs user to supply an allocator, like the functions in DOM.
+
+All examples above do not require an allocator parameter, because the first parameter is a `Document&`. But if you want to resolve a pointer to a subtree, you need to supply the allocator as in the following example:
+
+~~~cpp
+class Person {
+public:
+ Person() {
+ document_ = new Document();
+ // CreateValueByPointer() here no need allocator
+ SetLocation(CreateValueByPointer(*document_, "/residence"), ...);
+ SetLocation(CreateValueByPointer(*document_, "/office"), ...);
+ };
+
+private:
+ void SetLocation(Value& location, const char* country, const char* addresses[2]) {
+ Value::Allocator& a = document_->GetAllocator();
+ // SetValueByPointer() here need allocator
+ SetValueByPointer(location, "/country", country, a);
+ SetValueByPointer(location, "/address/0", address[0], a);
+ SetValueByPointer(location, "/address/1", address[1], a);
+ }
+
+ // ...
+
+ Document* document_;
+};
+~~~
+
+`Erase()` or `EraseValueByPointer()` does not need allocator. And they return `true` if the value is erased successfully.
+
+# Error Handling {#ErrorHandling}
+
+A `Pointer` parses a source string in its constructor. If there is parsing error, `Pointer::IsValid()` returns `false`. And you can use `Pointer::GetParseErrorCode()` and `GetParseErrorOffset()` to retrieve the error information.
+
+Note that, all resolving functions assumes valid pointer. Resolving with an invalid pointer causes assertion failure.
+
+# URI Fragment Representation {#URIFragment}
+
+In addition to the string representation of JSON pointer that we are using till now, [RFC6901] also defines the URI fragment representation of JSON pointer. URI fragment is specified in [RFC3986] "Uniform Resource Identifier (URI): Generic Syntax".
+
+The main differences are that a the URI fragment always has a `#` (pound sign) in the beginning, and some characters are encoded by percent-encoding in UTF-8 sequence. For example, the following table shows different C/C++ string literals of different representations.
+
+String Representation | URI Fragment Representation | Pointer Tokens (UTF-8)
+----------------------|-----------------------------|------------------------
+`"/foo/0"` | `"#/foo/0"` | `{"foo", 0}`
+`"/a~1b"` | `"#/a~1b"` | `{"a/b"}`
+`"/m~0n"` | `"#/m~0n"` | `{"m~n"}`
+`"/ "` | `"#/%20"` | `{" "}`
+`"/\0"` | `"#/%00"` | `{"\0"}`
+`"/€"` | `"#/%E2%82%AC"` | `{"€"}`
+
+RapidJSON fully support URI fragment representation. It automatically detects the pound sign during parsing.
+
+# Stringify
+
+You may also stringify a `Pointer` to a string or other output streams. This can be done by:
+
+~~~
+Pointer p(...);
+StringBuffer sb;
+p.Stringify(sb);
+std::cout << sb.GetString() << std::endl;
+~~~
+
+It can also stringify to URI fragment reprsentation by `StringifyUriFragment()`.
+
+# User-Supplied Tokens {#UserSuppliedTokens}
+
+If a pointer will be resolved multiple times, it should be constructed once, and then apply it to different DOMs or in different times. This reduce time and memory allocation for constructing `Pointer` multiple times.
+
+We can go one step further, to completely eliminate the parsing process and dynamic memory allocation, we can establish the token array directly:
+
+~~~cpp
+#define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
+#define INDEX(i) { #i, sizeof(#i) - 1, i }
+
+static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
+static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
+// Equivalent to static const Pointer p("/foo/123");
+~~~
+
+This may be useful for memory constrained systems.
+
+[RFC3986]: https://tools.ietf.org/html/rfc3986
+[RFC6901]: https://tools.ietf.org/html/rfc6901
diff --git a/3rdparty/rapidjson/doc/pointer.zh-cn.md b/3rdparty/rapidjson/doc/pointer.zh-cn.md
new file mode 100644
index 00000000000..b340debf033
--- /dev/null
+++ b/3rdparty/rapidjson/doc/pointer.zh-cn.md
@@ -0,0 +1,234 @@
+# Pointer
+
+## 状æ€: 实验性,应该会åˆè¿› v1.1
+
+JSON Pointer 是一个标准化([RFC6901])的方å¼å޻选å–一个 JSON Document(DOM)中的值。这类似于 XML çš„ XPath。然而,JSON Pointer 简å•得多,而且æ¯ä¸ª JSON Pointer 仅指å‘å•个值。
+
+使用 RapidJSON çš„ JSON Pointer 实现能简化一些 DOM çš„æ“作。
+
+[TOC]
+
+# JSON Pointer {#JsonPointer}
+
+一个 JSON Pointer 由一串(零至多个)token 所组æˆï¼Œæ¯ä¸ª token 都有 `/` å‰ç¼€ã€‚æ¯ä¸ª token å¯ä»¥æ˜¯ä¸€ä¸ªå­—符串或数字。例如,给定一个 JSON:
+~~~javascript
+{
+ "foo" : ["bar", "baz"],
+ "pi" : 3.1416
+}
+~~~
+
+以下的 JSON Pointer è§£æžä¸ºï¼š
+
+1. `"/foo"` → `[ "bar", "baz" ]`
+2. `"/foo/0"` → `"bar"`
+3. `"/foo/1"` → `"baz"`
+4. `"/pi"` → `3.1416`
+
+è¦æ³¨æ„,一个空 JSON Pointer `""` (零个token)解æžä¸ºæ•´ä¸ª JSON。
+
+# 基本使用方法 {#BasicUsage}
+
+以下的代ç èŒƒä¾‹ä¸è§£è‡ªæ˜Žã€‚
+
+~~~cpp
+#include "rapidjson/pointer.h"
+
+// ...
+Document d;
+
+// 使用 Set() 创建 DOM
+Pointer("/project").Set(d, "RapidJSON");
+Pointer("/stars").Set(d, 10);
+
+// { "project" : "RapidJSON", "stars" : 10 }
+
+// 使用 Get() 访问 DOM。若该值ä¸å­˜åœ¨åˆ™è¿”回 nullptr。
+if (Value* stars = Pointer("/stars").Get(d))
+ stars->SetInt(stars->GetInt() + 1);
+
+// { "project" : "RapidJSON", "stars" : 11 }
+
+// Set() å’Œ Create() 自动生æˆçˆ¶å€¼ï¼ˆå¦‚果它们ä¸å­˜åœ¨ï¼‰ã€‚
+Pointer("/a/b/0").Create(d);
+
+// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] } }
+
+// GetWithDefault() 返回引用。若该值ä¸å­˜åœ¨åˆ™ä¼šæ·±æ‹·è´ç¼ºçœå€¼ã€‚
+Value& hello = Pointer("/hello").GetWithDefault(d, "world");
+
+// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "world" }
+
+// Swap() 和 Set() 相似
+Value x("C++");
+Pointer("/hello").Swap(d, x);
+
+// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "C++" }
+// x å˜æˆ "world"
+
+// 删去一个æˆå‘˜æˆ–元素,若值存在返回 true
+bool success = Pointer("/a").Erase(d);
+assert(success);
+
+// { "project" : "RapidJSON", "stars" : 10 }
+~~~
+
+# 辅助函数 {#HelperFunctions}
+
+由于é¢å‘对象的调用习惯å¯èƒ½ä¸ç¬¦ç›´è§‰ï¼ŒRapidJSON 也æä¾›äº†ä¸€äº›è¾…助函数,它们把æˆå‘˜å‡½æ•°åŒ…装æˆè‡ªç”±å‡½æ•°ã€‚
+
+以下的例å­ä¸Žä¸Šé¢ä¾‹å­æ‰€åšçš„事情完全相åŒã€‚
+
+~~~cpp
+Document d;
+
+SetValueByPointer(d, "/project", "RapidJSON");
+SetValueByPointer(d, "/stars", 10);
+
+if (Value* stars = GetValueByPointer(d, "/stars"))
+ stars->SetInt(stars->GetInt() + 1);
+
+CreateValueByPointer(d, "/a/b/0");
+
+Value& hello = GetValueByPointerWithDefault(d, "/hello", "world");
+
+Value x("C++");
+SwapValueByPointer(d, "/hello", x);
+
+bool success = EraseValueByPointer(d, "/a");
+assert(success);
+~~~
+
+以下对比 3 ç§è°ƒç”¨æ–¹å¼ï¼š
+
+1. `Pointer(source).<Method>(root, ...)`
+2. `<Method>ValueByPointer(root, Pointer(source), ...)`
+3. `<Method>ValueByPointer(root, source, ...)`
+
+# è§£æž Pointer {#ResolvingPointer}
+
+`Pointer::Get()` 或 `GetValueByPointer()` 函数并ä¸ä¿®æ”¹ DOM。若那些 token ä¸èƒ½åŒ¹é… DOM 里的值,这些函数便返回 `nullptr`。使用者å¯åˆ©ç”¨è¿™ä¸ªæ–¹æ³•æ¥æ£€æŸ¥ä¸€ä¸ªå€¼æ˜¯å¦å­˜åœ¨ã€‚
+
+注æ„,数值 token å¯è¡¨ç¤ºæ•°ç»„索引或æˆå‘˜å字。解æžè¿‡ç¨‹ä¸­ä¼šæŒ‰å€¼çš„类型æ¥åŒ¹é…。
+
+~~~javascript
+{
+ "0" : 123,
+ "1" : [456]
+}
+~~~
+
+1. `"/0"` → `123`
+2. `"/1/0"` → `456`
+
+Token `"0"` 在第一个 pointer 中被当作æˆå‘˜å字。它在第二个 pointer ä¸­è¢«å½“ä½œæˆæ•°ç»„索引。
+
+å…¶ä»–å‡½æ•°ä¼šæ”¹å˜ DOM,包括`Create()`ã€`GetWithDefault()`ã€`Set()`ã€`Swap()`。这些函数总是æˆåŠŸçš„ã€‚è‹¥ä¸€äº›çˆ¶å€¼ä¸å­˜åœ¨ï¼Œå°±ä¼šåˆ›å»ºå®ƒä»¬ã€‚若父值类型ä¸åŒ¹é… token,也会强行改å˜å…¶ç±»åž‹ã€‚改å˜ç±»åž‹ä¹Ÿæ„味ç€å®Œå…¨ç§»é™¤å…¶ DOM å­æ ‘的内容。
+
+例如,把上é¢çš„ JSON 解译至 `d` 之åŽï¼Œ
+
+~~~cpp
+SetValueByPointer(d, "1/a", 789); // { "0" : 123, "1" : { "a" : 789 } }
+~~~
+
+## è§£æžè´Ÿå· token
+
+å¦å¤–,[RFC6901] 定义了一个特殊 token `-` (å•个负å·ï¼‰ï¼Œç”¨äºŽè¡¨ç¤ºæ•°ç»„最åŽå…ƒç´ çš„下一个元素。 `Get()` åªä¼šæŠŠæ­¤ token 当作æˆå‘˜åå­— '"-"'ã€‚è€Œå…¶ä»–å‡½æ•°åˆ™ä¼šä»¥æ­¤è§£æžæ•°ç»„,等åŒäºŽå¯¹æ•°ç»„调用 `Value::PushBack()` 。
+
+~~~cpp
+Document d;
+d.Parse("{\"foo\":[123]}");
+SetValueByPointer(d, "/foo/-", 456); // { "foo" : [123, 456] }
+SetValueByPointer(d, "/-", 789); // { "foo" : [123, 456], "-" : 789 }
+~~~
+
+## è§£æž Document åŠ Value
+
+当使用 `p.Get(root)` 或 `GetValueByPointer(root, p)`,`root` 是一个(常数) `Value&`。这æ„味ç€ï¼Œå®ƒä¹Ÿå¯ä»¥æ˜¯ DOM é‡Œçš„ä¸€ä¸ªå­æ ‘。
+
+其他函数有两组签å。一组使用 `Document& document` ä½œä¸ºå‚æ•°ï¼Œå¦ä¸€ç»„使用 `Value& root`。第一组使用 `document.GetAllocator()` 去创建值,而第二组则需è¦ä½¿ç”¨è€…æä¾›ä¸€ä¸ª allocatorï¼Œå¦‚åŒ DOM 里的函数。
+
+以上例å­éƒ½ä¸éœ€è¦ allocator 傿•°ï¼Œå› ä¸ºå®ƒçš„ç¬¬ä¸€ä¸ªå‚æ•°æ˜¯ `Document&`。但如果你需è¦å¯¹ä¸€ä¸ªå­æ ‘进行解æžï¼Œå°±éœ€è¦å¦‚下é¢çš„例å­èˆ¬æä¾› allocator:
+
+~~~cpp
+class Person {
+public:
+ Person() {
+ document_ = new Document();
+ // CreateValueByPointer() here no need allocator
+ SetLocation(CreateValueByPointer(*document_, "/residence"), ...);
+ SetLocation(CreateValueByPointer(*document_, "/office"), ...);
+ };
+
+private:
+ void SetLocation(Value& location, const char* country, const char* addresses[2]) {
+ Value::Allocator& a = document_->GetAllocator();
+ // SetValueByPointer() here need allocator
+ SetValueByPointer(location, "/country", country, a);
+ SetValueByPointer(location, "/address/0", address[0], a);
+ SetValueByPointer(location, "/address/1", address[1], a);
+ }
+
+ // ...
+
+ Document* document_;
+};
+~~~
+
+`Erase()` 或 `EraseValueByPointer()` ä¸éœ€è¦ allocator。而且它们æˆåŠŸåˆ é™¤å€¼ä¹‹åŽä¼šè¿”回 `true`。
+
+# é”™è¯¯å¤„ç† {#ErrorHandling}
+
+`Pointer` 在其建构函数里会解译æºå­—符串。若有解æžé”™è¯¯ï¼Œ`Pointer::IsValid()` 返回 `false`。你å¯ä½¿ç”¨ `Pointer::GetParseErrorCode()` å’Œ `GetParseErrorOffset()` 去获å–错信æ¯ã€‚
+
+è¦æ³¨æ„的是,所有解æžå‡½æ•°éƒ½å‡è®¾ pointer æ˜¯åˆæ³•çš„ã€‚å¯¹ä¸€ä¸ªéžæ³• pointer è§£æžä¼šåšæˆæ–­è¨€å¤±è´¥ã€‚
+
+# URI ç‰‡æ®µè¡¨ç¤ºæ–¹å¼ {#URIFragment}
+
+除了我们一直在使用的字符串方å¼è¡¨ç¤º JSON pointer,[RFC6901]也定义了一个 JSON Pointer çš„ URI 片段(fragment)表示方å¼ã€‚URI 片段是定义于 [RFC3986] "Uniform Resource Identifier (URI): Generic Syntax"。
+
+URI 片段的主è¦åˆ†åˆ«æ˜¯å¿…然以 `#` (pound signï¼‰å¼€å¤´ï¼Œè€Œä¸€äº›å­—ç¬¦ä¹Ÿä¼šä»¥ç™¾åˆ†æ¯”ç¼–ç æˆ UTF-8 åºåˆ—。例如,以下的表展示了ä¸åŒè¡¨ç¤ºæ³•下的 C/C++ 字符串常数。
+
+å­—ç¬¦ä¸²è¡¨ç¤ºæ–¹å¼ | URI ç‰‡æ®µè¡¨ç¤ºæ–¹å¼ | Pointer Tokens (UTF-8)
+----------------------|-----------------------------|------------------------
+`"/foo/0"` | `"#/foo/0"` | `{"foo", 0}`
+`"/a~1b"` | `"#/a~1b"` | `{"a/b"}`
+`"/m~0n"` | `"#/m~0n"` | `{"m~n"}`
+`"/ "` | `"#/%20"` | `{" "}`
+`"/\0"` | `"#/%00"` | `{"\0"}`
+`"/€"` | `"#/%E2%82%AC"` | `{"€"}`
+
+RapidJSON å®Œå…¨æ”¯æŒ URI 片段表示方å¼ã€‚它在解译时会自动检测 `#` å·ã€‚
+
+# 字符串化
+
+你也å¯ä»¥æŠŠä¸€ä¸ª `Pointer` 字符串化,储存于字符串或其他输出æµã€‚例如:
+
+~~~
+Pointer p(...);
+StringBuffer sb;
+p.Stringify(sb);
+std::cout << sb.GetString() << std::endl;
+~~~
+
+使用 `StringifyUriFragment()` å¯ä»¥æŠŠ pointer 字符串化为 URI 片段表示法。
+
+# 使用者æä¾›çš„ tokens {#UserSuppliedTokens}
+
+若一个 pointer 会用于多次解æžï¼Œå®ƒåº”该åªè¢«åˆ›å»ºä¸€æ¬¡ï¼Œç„¶åŽå†æ–½äºŽä¸åŒçš„ DOM ,或在ä¸åŒæ—¶é—´åšè§£æžã€‚这样å¯ä»¥é¿å…多次创键 `Pointer`ï¼ŒèŠ‚çœæ—¶é—´å’Œå†…存分é…。
+
+我们甚至å¯ä»¥å†æ›´è¿›ä¸€æ­¥ï¼Œå®Œå…¨æ¶ˆåŽ»è§£æžè¿‡ç¨‹åŠåЍæ€å†…存分é…。我们å¯ä»¥ç›´æŽ¥ç”Ÿæˆ token 数组:
+
+~~~cpp
+#define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
+#define INDEX(i) { #i, sizeof(#i) - 1, i }
+
+static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
+static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
+// Equivalent to static const Pointer p("/foo/123");
+~~~
+
+è¿™ç§å𿳕å¯èƒ½é€‚åˆå†…å­˜å—é™çš„系统。
+
+[RFC3986]: https://tools.ietf.org/html/rfc3986
+[RFC6901]: https://tools.ietf.org/html/rfc6901
diff --git a/3rdparty/rapidjson/doc/sax.md b/3rdparty/rapidjson/doc/sax.md
new file mode 100644
index 00000000000..9a6d8148031
--- /dev/null
+++ b/3rdparty/rapidjson/doc/sax.md
@@ -0,0 +1,475 @@
+# SAX
+
+The term "SAX" originated from [Simple API for XML](http://en.wikipedia.org/wiki/Simple_API_for_XML). We borrowed this term for JSON parsing and generation.
+
+In RapidJSON, `Reader` (typedef of `GenericReader<...>`) is the SAX-style parser for JSON, and `Writer` (typedef of `GenericWriter<...>`) is the SAX-style generator for JSON.
+
+[TOC]
+
+# Reader {#Reader}
+
+`Reader` parses a JSON from a stream. While it reads characters from the stream, it analyze the characters according to the syntax of JSON, and publish events to a handler.
+
+For example, here is a JSON.
+
+~~~~~~~~~~js
+{
+ "hello": "world",
+ "t": true ,
+ "f": false,
+ "n": null,
+ "i": 123,
+ "pi": 3.1416,
+ "a": [1, 2, 3, 4]
+}
+~~~~~~~~~~
+
+While a `Reader` parses this JSON, it publishes the following events to the handler sequentially:
+
+~~~~~~~~~~
+StartObject()
+Key("hello", 5, true)
+String("world", 5, true)
+Key("t", 1, true)
+Bool(true)
+Key("f", 1, true)
+Bool(false)
+Key("n", 1, true)
+Null()
+Key("i")
+UInt(123)
+Key("pi")
+Double(3.1416)
+Key("a")
+StartArray()
+Uint(1)
+Uint(2)
+Uint(3)
+Uint(4)
+EndArray(4)
+EndObject(7)
+~~~~~~~~~~
+
+These events can be easily matched with the JSON, except some event parameters need further explanation. Let's see the `simplereader` example which produces exactly the same output as above:
+
+~~~~~~~~~~cpp
+#include "rapidjson/reader.h"
+#include <iostream>
+
+using namespace rapidjson;
+using namespace std;
+
+struct MyHandler {
+ bool Null() { cout << "Null()" << endl; return true; }
+ bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
+ bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
+ bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; }
+ bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; }
+ bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; }
+ bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; }
+ bool String(const char* str, SizeType length, bool copy) {
+ cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
+ return true;
+ }
+ bool StartObject() { cout << "StartObject()" << endl; return true; }
+ bool Key(const char* str, SizeType length, bool copy) {
+ cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
+ return true;
+ }
+ bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
+ bool StartArray() { cout << "StartArray()" << endl; return true; }
+ bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
+};
+
+void main() {
+ const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
+
+ MyHandler handler;
+ Reader reader;
+ StringStream ss(json);
+ reader.Parse(ss, handler);
+}
+~~~~~~~~~~
+
+Note that, RapidJSON uses template to statically bind the `Reader` type and the handler type, instead of using class with virtual functions. This paradigm can improve the performance by inlining functions.
+
+## Handler {#Handler}
+
+As the previous example showed, user needs to implement a handler, which consumes the events (function calls) from `Reader`. The handler must contain the following member functions.
+
+~~~~~~~~~~cpp
+class Handler {
+ bool Null();
+ bool Bool(bool b);
+ bool Int(int i);
+ bool Uint(unsigned i);
+ bool Int64(int64_t i);
+ bool Uint64(uint64_t i);
+ bool Double(double d);
+ bool String(const Ch* str, SizeType length, bool copy);
+ bool StartObject();
+ bool Key(const Ch* str, SizeType length, bool copy);
+ bool EndObject(SizeType memberCount);
+ bool StartArray();
+ bool EndArray(SizeType elementCount);
+};
+~~~~~~~~~~
+
+`Null()` is called when the `Reader` encounters a JSON null value.
+
+`Bool(bool)` is called when the `Reader` encounters a JSON true or false value.
+
+When the `Reader` encounters a JSON number, it chooses a suitable C++ type mapping. And then it calls *one* function out of `Int(int)`, `Uint(unsigned)`, `Int64(int64_t)`, `Uint64(uint64_t)` and `Double(double)`.
+
+`String(const char* str, SizeType length, bool copy)` is called when the `Reader` encounters a string. The first parameter is pointer to the string. The second parameter is the length of the string (excluding the null terminator). Note that RapidJSON supports null character `'\0'` inside a string. If such situation happens, `strlen(str) < length`. The last `copy` indicates whether the handler needs to make a copy of the string. For normal parsing, `copy = true`. Only when *insitu* parsing is used, `copy = false`. And beware that, the character type depends on the target encoding, which will be explained later.
+
+When the `Reader` encounters the beginning of an object, it calls `StartObject()`. An object in JSON is a set of name-value pairs. If the object contains members it first calls `Key()` for the name of member, and then calls functions depending on the type of the value. These calls of name-value pairs repeats until calling `EndObject(SizeType memberCount)`. Note that the `memberCount` parameter is just an aid for the handler, user may not need this parameter.
+
+Array is similar to object but simpler. At the beginning of an array, the `Reader` calls `BeginArary()`. If there is elements, it calls functions according to the types of element. Similarly, in the last call `EndArray(SizeType elementCount)`, the parameter `elementCount` is just an aid for the handler.
+
+Every handler functions returns a `bool`. Normally it should returns `true`. If the handler encounters an error, it can return `false` to notify event publisher to stop further processing.
+
+For example, when we parse a JSON with `Reader` and the handler detected that the JSON does not conform to the required schema, then the handler can return `false` and let the `Reader` stop further parsing. And the `Reader` will be in error state with error code `kParseErrorTermination`.
+
+## GenericReader {#GenericReader}
+
+As mentioned before, `Reader` is a typedef of a template class `GenericReader`:
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericReader {
+ // ...
+};
+
+typedef GenericReader<UTF8<>, UTF8<> > Reader;
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+The `Reader` uses UTF-8 as both source and target encoding. The source encoding means the encoding in the JSON stream. The target encoding means the encoding of the `str` parameter in `String()` calls. For example, to parse a UTF-8 stream and outputs UTF-16 string events, you can define a reader by:
+
+~~~~~~~~~~cpp
+GenericReader<UTF8<>, UTF16<> > reader;
+~~~~~~~~~~
+
+Note that, the default character type of `UTF16` is `wchar_t`. So this `reader`needs to call `String(const wchar_t*, SizeType, bool)` of the handler.
+
+The third template parameter `Allocator` is the allocator type for internal data structure (actually a stack).
+
+## Parsing {#Parsing}
+
+The one and only one function of `Reader` is to parse JSON.
+
+~~~~~~~~~~cpp
+template <unsigned parseFlags, typename InputStream, typename Handler>
+bool Parse(InputStream& is, Handler& handler);
+
+// with parseFlags = kDefaultParseFlags
+template <typename InputStream, typename Handler>
+bool Parse(InputStream& is, Handler& handler);
+~~~~~~~~~~
+
+If an error occurs during parsing, it will return `false`. User can also calls `bool HasParseEror()`, `ParseErrorCode GetParseErrorCode()` and `size_t GetErrorOffset()` to obtain the error states. Actually `Document` uses these `Reader` functions to obtain parse errors. Please refer to [DOM](doc/dom.md) for details about parse error.
+
+# Writer {#Writer}
+
+`Reader` converts (parses) JSON into events. `Writer` does exactly the opposite. It converts events into JSON.
+
+`Writer` is very easy to use. If your application only need to converts some data into JSON, it may be a good choice to use `Writer` directly, instead of building a `Document` and then stringifying it with a `Writer`.
+
+In `simplewriter` example, we do exactly the reverse of `simplereader`.
+
+~~~~~~~~~~cpp
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+using namespace std;
+
+void main() {
+ StringBuffer s;
+ Writer<StringBuffer> writer(s);
+
+ writer.StartObject();
+ writer.Key("hello");
+ writer.String("world");
+ writer.Key("t");
+ writer.Bool(true);
+ writer.Key("f");
+ writer.Bool(false);
+ writer.Key("n");
+ writer.Null();
+ writer.Key("i");
+ writer.Uint(123);
+ writer.Key("pi");
+ writer.Double(3.1416);
+ writer.Key("a");
+ writer.StartArray();
+ for (unsigned i = 0; i < 4; i++)
+ writer.Uint(i);
+ writer.EndArray();
+ writer.EndObject();
+
+ cout << s.GetString() << endl;
+}
+~~~~~~~~~~
+
+~~~~~~~~~~
+{"hello":"world","t":true,"f":false,"n":null,"i":123,"pi":3.1416,"a":[0,1,2,3]}
+~~~~~~~~~~
+
+There are two `String()` and `Key()` overloads. One is the same as defined in handler concept with 3 parameters. It can handle string with null characters. Another one is the simpler version used in the above example.
+
+Note that, the example code does not pass any parameters in `EndArray()` and `EndObject()`. An `SizeType` can be passed but it will be simply ignored by `Writer`.
+
+You may doubt that, why not just using `sprintf()` or `std::stringstream` to build a JSON?
+
+There are various reasons:
+1. `Writer` must output a well-formed JSON. If there is incorrect event sequence (e.g. `Int()` just after `StartObject()`), it generates assertion fail in debug mode.
+2. `Writer::String()` can handle string escaping (e.g. converting code point `U+000A` to `\n`) and Unicode transcoding.
+3. `Writer` handles number output consistently.
+4. `Writer` implements the event handler concept. It can be used to handle events from `Reader`, `Document` or other event publisher.
+5. `Writer` can be optimized for different platforms.
+
+Anyway, using `Writer` API is even simpler than generating a JSON by ad hoc methods.
+
+## Template {#WriterTemplate}
+
+`Writer` has a minor design difference to `Reader`. `Writer` is a template class, not a typedef. There is no `GenericWriter`. The following is the declaration.
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename Allocator = CrtAllocator<> >
+class Writer {
+public:
+ Writer(OutputStream& os, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth)
+// ...
+};
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+The `OutputStream` template parameter is the type of output stream. It cannot be deduced and must be specified by user.
+
+The `SourceEncoding` template parameter specifies the encoding to be used in `String(const Ch*, ...)`.
+
+The `TargetEncoding` template parameter specifies the encoding in the output stream.
+
+The last one, `Allocator` is the type of allocator, which is used for allocating internal data structure (a stack).
+
+Besides, the constructor of `Writer` has a `levelDepth` parameter. This parameter affects the initial memory allocated for storing information per hierarchy level.
+
+## PrettyWriter {#PrettyWriter}
+
+While the output of `Writer` is the most condensed JSON without white-spaces, suitable for network transfer or storage, it is not easily readable by human.
+
+Therefore, RapidJSON provides a `PrettyWriter`, which adds indentation and line feeds in the output.
+
+The usage of `PrettyWriter` is exactly the same as `Writer`, expect that `PrettyWriter` provides a `SetIndent(Ch indentChar, unsigned indentCharCount)` function. The default is 4 spaces.
+
+## Completeness and Reset {#CompletenessReset}
+
+A `Writer` can only output a single JSON, which can be any JSON type at the root. Once the singular event for root (e.g. `String()`), or the last matching `EndObject()` or `EndArray()` event, is handled, the output JSON is well-formed and complete. User can detect this state by calling `Writer::IsComplete()`.
+
+When a JSON is complete, the `Writer` cannot accept any new events. Otherwise the output will be invalid (i.e. having more than one root). To reuse the `Writer` object, user can call `Writer::Reset(OutputStream& os)` to reset all internal states of the `Writer` with a new output stream.
+
+# Techniques {#Techniques}
+
+## Parsing JSON to Custom Data Structure {#CustomDataStructure}
+
+`Document`'s parsing capability is completely based on `Reader`. Actually `Document` is a handler which receives events from a reader to build a DOM during parsing.
+
+User may uses `Reader` to build other data structures directly. This eliminates building of DOM, thus reducing memory and improving performance.
+
+In the following `messagereader` example, `ParseMessages()` parses a JSON which should be an object with key-string pairs.
+
+~~~~~~~~~~cpp
+#include "rapidjson/reader.h"
+#include "rapidjson/error/en.h"
+#include <iostream>
+#include <string>
+#include <map>
+
+using namespace std;
+using namespace rapidjson;
+
+typedef map<string, string> MessageMap;
+
+struct MessageHandler
+ : public BaseReaderHandler<UTF8<>, MessageHandler> {
+ MessageHandler() : state_(kExpectObjectStart) {
+ }
+
+ bool StartObject() {
+ switch (state_) {
+ case kExpectObjectStart:
+ state_ = kExpectNameOrObjectEnd;
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool String(const char* str, SizeType length, bool) {
+ switch (state_) {
+ case kExpectNameOrObjectEnd:
+ name_ = string(str, length);
+ state_ = kExpectValue;
+ return true;
+ case kExpectValue:
+ messages_.insert(MessageMap::value_type(name_, string(str, length)));
+ state_ = kExpectNameOrObjectEnd;
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }
+
+ bool Default() { return false; } // All other events are invalid.
+
+ MessageMap messages_;
+ enum State {
+ kExpectObjectStart,
+ kExpectNameOrObjectEnd,
+ kExpectValue,
+ }state_;
+ std::string name_;
+};
+
+void ParseMessages(const char* json, MessageMap& messages) {
+ Reader reader;
+ MessageHandler handler;
+ StringStream ss(json);
+ if (reader.Parse(ss, handler))
+ messages.swap(handler.messages_); // Only change it if success.
+ else {
+ ParseErrorCode e = reader.GetParseErrorCode();
+ size_t o = reader.GetErrorOffset();
+ cout << "Error: " << GetParseError_En(e) << endl;;
+ cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;
+ }
+}
+
+int main() {
+ MessageMap messages;
+
+ const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
+ cout << json1 << endl;
+ ParseMessages(json1, messages);
+
+ for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
+ cout << itr->first << ": " << itr->second << endl;
+
+ cout << endl << "Parse a JSON with invalid schema." << endl;
+ const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
+ cout << json2 << endl;
+ ParseMessages(json2, messages);
+
+ return 0;
+}
+~~~~~~~~~~
+
+~~~~~~~~~~
+{ "greeting" : "Hello!", "farewell" : "bye-bye!" }
+farewell: bye-bye!
+greeting: Hello!
+
+Parse a JSON with invalid schema.
+{ "greeting" : "Hello!", "farewell" : "bye-bye!", "foo" : {} }
+Error: Terminate parsing due to Handler error.
+ at offset 59 near '} }...'
+~~~~~~~~~~
+
+The first JSON (`json1`) was successfully parsed into `MessageMap`. Since `MessageMap` is a `std::map`, the printing order are sorted by the key. This order is different from the JSON's order.
+
+In the second JSON (`json2`), `foo`'s value is an empty object. As it is an object, `MessageHandler::StartObject()` will be called. However, at that moment `state_ = kExpectValue`, so that function returns `false` and cause the parsing process be terminated. The error code is `kParseErrorTermination`.
+
+## Filtering of JSON {#Filtering}
+
+As mentioned earlier, `Writer` can handle the events published by `Reader`. `condense` example simply set a `Writer` as handler of a `Reader`, so it can remove all white-spaces in JSON. `pretty` example uses the same relationship, but replacing `Writer` by `PrettyWriter`. So `pretty` can be used to reformat a JSON with indentation and line feed.
+
+Actually, we can add intermediate layer(s) to filter the contents of JSON via these SAX-style API. For example, `capitalize` example capitalize all strings in a JSON.
+
+~~~~~~~~~~cpp
+#include "rapidjson/reader.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/error/en.h"
+#include <vector>
+#include <cctype>
+
+using namespace rapidjson;
+
+template<typename OutputHandler>
+struct CapitalizeFilter {
+ CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {
+ }
+
+ bool Null() { return out_.Null(); }
+ bool Bool(bool b) { return out_.Bool(b); }
+ bool Int(int i) { return out_.Int(i); }
+ bool Uint(unsigned u) { return out_.Uint(u); }
+ bool Int64(int64_t i) { return out_.Int64(i); }
+ bool Uint64(uint64_t u) { return out_.Uint64(u); }
+ bool Double(double d) { return out_.Double(d); }
+ bool String(const char* str, SizeType length, bool) {
+ buffer_.clear();
+ for (SizeType i = 0; i < length; i++)
+ buffer_.push_back(std::toupper(str[i]));
+ return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string
+ }
+ bool StartObject() { return out_.StartObject(); }
+ bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
+ bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }
+ bool StartArray() { return out_.StartArray(); }
+ bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }
+
+ OutputHandler& out_;
+ std::vector<char> buffer_;
+};
+
+int main(int, char*[]) {
+ // Prepare JSON reader and input stream.
+ Reader reader;
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+
+ // Prepare JSON writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+ Writer<FileWriteStream> writer(os);
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
+ if (!reader.Parse(is, filter)) {
+ fprintf(stderr, "\nError(%u): %s\n", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
+~~~~~~~~~~
+
+Note that, it is incorrect to simply capitalize the JSON as a string. For example:
+~~~~~~~~~~
+["Hello\nWorld"]
+~~~~~~~~~~
+
+Simply capitalizing the whole JSON would contain incorrect escape character:
+~~~~~~~~~~
+["HELLO\NWORLD"]
+~~~~~~~~~~
+
+The correct result by `capitalize`:
+~~~~~~~~~~
+["HELLO\nWORLD"]
+~~~~~~~~~~
+
+More complicated filters can be developed. However, since SAX-style API can only provide information about a single event at a time, user may need to book-keeping the contextual information (e.g. the path from root value, storage of other related values). Some processing may be easier to be implemented in DOM than SAX.
diff --git a/3rdparty/rapidjson/doc/sax.zh-cn.md b/3rdparty/rapidjson/doc/sax.zh-cn.md
new file mode 100644
index 00000000000..f8dc7b9aea7
--- /dev/null
+++ b/3rdparty/rapidjson/doc/sax.zh-cn.md
@@ -0,0 +1,476 @@
+# SAX
+
+"SAX"此术语æºäºŽ[Simple API for XML](http://en.wikipedia.org/wiki/Simple_API_for_XML)。我们借了此术语去套用在JSON的解æžåŠç”Ÿæˆã€‚
+
+在RapidJSON中,`Reader`(`GenericReader<...>`çš„typedef)是JSONçš„SAX风格解æžå™¨ï¼Œè€Œ`Writer`(`GenericWriter<...>`çš„typedef)则是JSONçš„SAX风格生æˆå™¨ã€‚
+
+[TOC]
+
+# Reader {#Reader}
+
+`Reader`从输入æµè§£æžä¸€ä¸ªJSON。当它从æµä¸­è¯»å–字符时,它会基于JSON的语法去分æžå­—符,并å‘处ç†å™¨å‘é€äº‹ä»¶ã€‚
+
+例如,以下是一个JSON。
+
+~~~~~~~~~~js
+{
+ "hello": "world",
+ "t": true ,
+ "f": false,
+ "n": null,
+ "i": 123,
+ "pi": 3.1416,
+ "a": [1, 2, 3, 4]
+}
+~~~~~~~~~~
+
+当一个`Reader`è§£æžæ­¤JSON时,它会顺åºåœ°å‘处ç†å™¨å‘é€ä»¥ä¸‹çš„事件:
+
+~~~~~~~~~~
+StartObject()
+Key("hello", 5, true)
+String("world", 5, true)
+Key("t", 1, true)
+Bool(true)
+Key("f", 1, true)
+Bool(false)
+Key("n", 1, true)
+Null()
+Key("i")
+UInt(123)
+Key("pi")
+Double(3.1416)
+Key("a")
+StartArray()
+Uint(1)
+Uint(2)
+Uint(3)
+Uint(4)
+EndArray(4)
+EndObject(7)
+~~~~~~~~~~
+
+é™¤äº†ä¸€äº›äº‹ä»¶å‚æ•°éœ€è¦å†ä½œè§£é‡Šï¼Œè¿™äº›äº‹ä»¶å¯ä»¥è½»æ¾åœ°ä¸ŽJSON对上。我们å¯ä»¥çœ‹çœ‹`simplereader`例孿€Žæ ·äº§ç”Ÿå’Œä»¥ä¸Šå®Œå…¨ç›¸åŒçš„结果:
+
+~~~~~~~~~~cpp
+#include "rapidjson/reader.h"
+#include <iostream>
+
+using namespace rapidjson;
+using namespace std;
+
+struct MyHandler {
+ bool Null() { cout << "Null()" << endl; return true; }
+ bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
+ bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
+ bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; }
+ bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; }
+ bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; }
+ bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; }
+ bool String(const char* str, SizeType length, bool copy) {
+ cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
+ return true;
+ }
+ bool StartObject() { cout << "StartObject()" << endl; return true; }
+ bool Key(const char* str, SizeType length, bool copy) {
+ cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
+ return true;
+ }
+ bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
+ bool StartArray() { cout << "StartArray()" << endl; return true; }
+ bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
+};
+
+void main() {
+ const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
+
+ MyHandler handler;
+ Reader reader;
+ StringStream ss(json);
+ reader.Parse(ss, handler);
+}
+~~~~~~~~~~
+
+注æ„RapidJSON使用模æ¿å޻陿€æŒ·å®š`Reader`类型åŠå¤„ç†å™¨çš„ç±»å½¢ï¼Œè€Œä¸æ˜¯ä½¿ç”¨å«è™šå‡½æ•°çš„类。这个范å¼å¯ä»¥é€šè¿‡æŠŠå‡½æ•°å†…è”而改善性能。
+
+## 处ç†å™¨ {#Handler}
+
+如å‰ä¾‹æ‰€ç¤ºï¼Œä½¿ç”¨è€…需è¦å®žçŽ°ä¸€ä¸ªå¤„ç†å™¨ï¼ˆhandlerï¼‰ï¼Œç”¨äºŽå¤„ç†æ¥è‡ª`Reader`的事件(函数调用)。处ç†å™¨å¿…须包å«ä»¥ä¸‹çš„æˆå‘˜å‡½æ•°ã€‚
+
+~~~~~~~~~~cpp
+class Handler {
+ bool Null();
+ bool Bool(bool b);
+ bool Int(int i);
+ bool Uint(unsigned i);
+ bool Int64(int64_t i);
+ bool Uint64(uint64_t i);
+ bool Double(double d);
+ bool String(const Ch* str, SizeType length, bool copy);
+ bool StartObject();
+ bool Key(const Ch* str, SizeType length, bool copy);
+ bool EndObject(SizeType memberCount);
+ bool StartArray();
+ bool EndArray(SizeType elementCount);
+};
+~~~~~~~~~~
+
+当`Reader`é‡åˆ°JSON null值时会调用`Null()`。
+
+当`Reader`é‡åˆ°JSON true或false值时会调用`Bool(bool)`。
+
+当`Reader`é‡åˆ°JSON number,它会选择一个åˆé€‚çš„C++类型映射,然åŽè°ƒç”¨`Int(int)`ã€`Uint(unsigned)`ã€`Int64(int64_t)`ã€`Uint64(uint64_t)`åŠ`Double(double)`çš„*其中之一个*。
+
+当`Reader`é‡åˆ°JSON string,它会调用`String(const char* str, SizeType length, bool copy)`ã€‚ç¬¬ä¸€ä¸ªå‚æ•°æ˜¯å­—ç¬¦ä¸²çš„æŒ‡é’ˆã€‚ç¬¬äºŒä¸ªå‚æ•°æ˜¯å­—符串的长度(ä¸åŒ…å«ç©ºç»ˆæ­¢ç¬¦å·ï¼‰ã€‚注æ„RapidJSON支æŒå­—䏲䏭嫿œ‰ç©ºå­—符`'\0'`ã€‚è‹¥å‡ºçŽ°è¿™ç§æƒ…况,便会有`strlen(str) < length`。最åŽçš„`copy`傿•°è¡¨ç¤ºå¤„ç†å™¨æ˜¯å¦éœ€è¦å¤åˆ¶è¯¥å­—ç¬¦ä¸²ã€‚åœ¨æ­£å¸¸è§£æžæ—¶ï¼Œ`copy = true`。仅当使用原ä½è§£æžæ—¶ï¼Œ`copy = false`ã€‚æ­¤å¤–ï¼Œè¿˜è¦æ³¨æ„字符的类型与目标编ç ç›¸å…³ï¼Œæˆ‘们ç¨åŽä¼šå†è°ˆè¿™ä¸€ç‚¹ã€‚
+
+当`Reader`é‡åˆ°JSON object的开始之时,它会调用`StartObject()`。JSONçš„object是一个键值对(æˆå‘˜ï¼‰çš„集åˆã€‚è‹¥objectåŒ…å«æˆå‘˜ï¼Œå®ƒä¼šå…ˆä¸ºæˆå‘˜çš„å字调用`Key()`,然åŽå†æŒ‰å€¼çš„ç±»åž‹è°ƒç”¨å‡½æ•°ã€‚å®ƒä¸æ–­è°ƒç”¨è¿™äº›é”®å€¼å¯¹ï¼Œç›´è‡³æœ€ç»ˆè°ƒç”¨`EndObject(SizeType memberCount)`。注æ„`memberCount`傿•°å¯¹å¤„ç†å™¨æ¥è¯´åªæ˜¯å助性质,使用者å¯èƒ½ä¸éœ€è¦æ­¤å‚数。
+
+JSON array与object相似,但更简å•。在array开始时,`Reader`会调用`BeginArary()`。若array嫿œ‰å…ƒç´ ï¼Œå®ƒä¼šæŒ‰å…ƒç´ çš„类型æ¥è¯»ç”¨å‡½æ•°ã€‚相似地,最åŽå®ƒä¼šè°ƒç”¨`EndArray(SizeType elementCount)`,其中`elementCount`傿•°å¯¹å¤„ç†å™¨æ¥è¯´åªæ˜¯å助性质。
+
+æ¯ä¸ªå¤„ç†å™¨å‡½æ•°éƒ½è¿”回一个`bool`。正常它们应返回`true`。若处ç†å™¨é‡åˆ°é”™è¯¯ï¼Œå®ƒå¯ä»¥è¿”回`false`去通知事件å‘逿–¹åœæ­¢ç»§ç»­å¤„ç†ã€‚
+
+例如,当我们用`Reader`è§£æžä¸€ä¸ªJSON时,处ç†å™¨æ£€æµ‹åˆ°è¯¥JSONå¹¶ä¸ç¬¦åˆæ‰€éœ€çš„schema,那么处ç†å™¨å¯ä»¥è¿”回`false`,令`Reader`åœæ­¢ä¹‹åŽçš„è§£æžå·¥ä½œã€‚而`Reader`会进入一个错误状æ€ï¼Œå¹¶ä»¥`kParseErrorTermination`é”™è¯¯ç æ ‡è¯†ã€‚
+
+## GenericReader {#GenericReader}
+
+å‰é¢æåŠï¼Œ`Reader`是`GenericReader`模æ¿ç±»çš„typedef:
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericReader {
+ // ...
+};
+
+typedef GenericReader<UTF8<>, UTF8<> > Reader;
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+`Reader`使用UTF-8ä½œä¸ºæ¥æºåŠç›®æ ‡ç¼–ç ã€‚æ¥æºç¼–ç æ˜¯æŒ‡JSONæµçš„ç¼–ç ã€‚ç›®æ ‡ç¼–ç æ˜¯æŒ‡`String()`çš„`str`傿•°æ‰€ç”¨çš„ç¼–ç ã€‚例如,è¦è§£æžä¸€ä¸ªUTF-8æµå¹¶è¾“出至UTF-16 string事件,你需è¦è¿™ä¹ˆå®šä¹‰ä¸€ä¸ªreader:
+
+~~~~~~~~~~cpp
+GenericReader<UTF8<>, UTF16<> > reader;
+~~~~~~~~~~
+
+注æ„到`UTF16`的缺çœç±»åž‹æ˜¯`wchar_t`。因此这个`reader`需è¦è°ƒç”¨å¤„ç†å™¨çš„`String(const wchar_t*, SizeType, bool)`。
+
+第三个模æ¿å‚æ•°`Allocator`是内部数æ®ç»“构(实际上是一个堆栈)的分é…器类型。
+
+## è§£æž {#Parsing}
+
+`Reader`的唯一功能就是解æžJSON。
+
+~~~~~~~~~~cpp
+template <unsigned parseFlags, typename InputStream, typename Handler>
+bool Parse(InputStream& is, Handler& handler);
+
+// 使用 parseFlags = kDefaultParseFlags
+template <typename InputStream, typename Handler>
+bool Parse(InputStream& is, Handler& handler);
+~~~~~~~~~~
+
+若在解æžä¸­å‡ºçŽ°é”™è¯¯ï¼Œå®ƒä¼šè¿”å›ž`false`。使用者å¯è°ƒç”¨`bool HasParseEror()`, `ParseErrorCode GetParseErrorCode()`åŠ`size_t GetErrorOffset()`获å–错误状æ€ã€‚实际上`Document`使用这些`Reader`函数去获å–è§£æžé”™è¯¯ã€‚请å‚考[DOM](doc/dom.md)去了解有关解æžé”™è¯¯çš„细节。
+
+# Writer {#Writer}
+
+`Reader`把JSON转æ¢ï¼ˆè§£æžï¼‰æˆä¸ºäº‹ä»¶ã€‚`Writer`åšå®Œå…¨ç›¸åçš„äº‹æƒ…ã€‚å®ƒæŠŠäº‹ä»¶è½¬æ¢æˆJSON。
+
+`Writer`是éžå¸¸å®¹æ˜“使用的。若你的应用程åºåªéœ€æŠŠä¸€äº›æ•°æ®è½¬æ¢æˆJSON,å¯èƒ½ç›´æŽ¥ä½¿ç”¨`Writer`,会比建立一个`Document`ç„¶åŽç”¨`Writer`æŠŠå®ƒè½¬æ¢æˆJSON更加方便。
+
+在`simplewriter`例å­é‡Œï¼Œæˆ‘们åš`simplereader`完全相å的事情。
+
+~~~~~~~~~~cpp
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+using namespace std;
+
+void main() {
+ StringBuffer s;
+ Writer<StringBuffer> writer(s);
+
+ writer.StartObject();
+ writer.Key("hello");
+ writer.String("world");
+ writer.Key("t");
+ writer.Bool(true);
+ writer.Key("f");
+ writer.Bool(false);
+ writer.Key("n");
+ writer.Null();
+ writer.Key("i");
+ writer.Uint(123);
+ writer.Key("pi");
+ writer.Double(3.1416);
+ writer.Key("a");
+ writer.StartArray();
+ for (unsigned i = 0; i < 4; i++)
+ writer.Uint(i);
+ writer.EndArray();
+ writer.EndObject();
+
+ cout << s.GetString() << endl;
+}
+~~~~~~~~~~
+
+~~~~~~~~~~
+{"hello":"world","t":true,"f":false,"n":null,"i":123,"pi":3.1416,"a":[0,1,2,3]}
+~~~~~~~~~~
+
+`String()`åŠ`Key()`儿œ‰ä¸¤ä¸ªé‡è½½ã€‚一个是如处ç†å™¨concept般,有3ä¸ªå‚æ•°ã€‚它能处ç†å«ç©ºå­—符的字符串。å¦ä¸€ä¸ªæ˜¯å¦‚上中使用的较简å•版本。
+
+注æ„到,例å­ä»£ç ä¸­çš„`EndArray()`åŠ`EndObject()`å¹¶æ²¡æœ‰å‚æ•°ã€‚å¯ä»¥ä¼ é€’一个`SizeType`çš„å‚æ•°ï¼Œä½†å®ƒä¼šè¢«`Writer`忽略。
+
+ä½ å¯èƒ½ä¼šæ€€ç–‘,为什么ä¸ä½¿ç”¨`sprintf()`或`std::stringstream`去建立一个JSON?
+
+这有几个原因:
+1. `Writer`必然会输出一个结构良好(well-formed)的JSON。若然有错误的事件次åºï¼ˆå¦‚`Int()`ç´§éš`StartObject()`出现),它会在调试模å¼ä¸­äº§ç”Ÿæ–­è¨€å¤±è´¥ã€‚
+2. `Writer::String()`å¯å¤„ç†å­—符串转义(如把ç ç‚¹`U+000A`è½¬æ¢æˆ`\n`)åŠè¿›è¡ŒUnicode转ç ã€‚
+3. `Writer`一致地处ç†number的输出。
+4. `Writer`实现了事件处ç†å™¨concept。å¯ç”¨äºŽå¤„ç†æ¥è‡ª`Reader`ã€`Document`或其他事件å‘生器。
+5. `Writer`å¯å¯¹ä¸åŒå¹³å°è¿›è¡Œä¼˜åŒ–。
+
+无论如何,使用`Writer` API去生æˆJSON甚至乎比这些临时方法更简å•。
+
+## æ¨¡æ¿ {#WriterTemplate}
+
+`Writer`与`Reader`有少许设计区别。`Writer`是一个模æ¿ç±»ï¼Œè€Œä¸æ˜¯ä¸€ä¸ªtypedef。 并没有`GenericWriter`。以下是`Writer`的声明。
+
+~~~~~~~~~~cpp
+namespace rapidjson {
+
+template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename Allocator = CrtAllocator<> >
+class Writer {
+public:
+ Writer(OutputStream& os, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth)
+// ...
+};
+
+} // namespace rapidjson
+~~~~~~~~~~
+
+`OutputStream`模æ¿å‚数是输出æµçš„类型。它的类型ä¸å¯ä»¥è¢«è‡ªåŠ¨æŽ¨æ–­ï¼Œå¿…é¡»ç”±ä½¿ç”¨è€…æä¾›ã€‚
+
+`SourceEncoding`模æ¿å‚数指定了`String(const Ch*, ...)`的编ç ã€‚
+
+`TargetEncoding`模æ¿å‚数指定输出æµçš„ç¼–ç ã€‚
+
+最åŽä¸€ä¸ª`Allocator`是分é…器的类型,用于分é…内部数æ®ç»“构(一个堆栈)。
+
+此外,`Writer`的构造函数有一`levelDepth`傿•°ã€‚存储æ¯å±‚阶信æ¯çš„åˆå§‹å†…存分é…é‡å—æ­¤å‚æ•°å½±å“。
+
+## PrettyWriter {#PrettyWriter}
+
+`Writer`所输出的是没有空格字符的最紧凑JSON,适åˆç½‘络传输或储存,但ä¸é€‚åˆäººç±»é˜…读。
+
+因此,RapidJSONæä¾›äº†ä¸€ä¸ª`PrettyWriter`ï¼Œå®ƒåœ¨è¾“å‡ºä¸­åŠ å…¥ç¼©è¿›åŠæ¢è¡Œã€‚
+
+`PrettyWriter`的用法与`Writer`几乎一样,ä¸åŒä¹‹å¤„是`PrettyWriter`æä¾›äº†ä¸€ä¸ª`SetIndent(Ch indentChar, unsigned indentCharCount)`函数。缺çœçš„缩进是4个空格。
+
+## 完整性åŠé‡ç½® {#CompletenessReset}
+
+一个`Writer`åªå¯è¾“出å•个JSON,其根节点å¯ä»¥æ˜¯ä»»ä½•JSON类型。当处ç†å®Œå•个根节点事件(如`String()`),或匹é…的最åŽ`EndObject()`或`EndArray()`事件,输出的JSON是结构完整(well-formed)åŠå®Œæ•´çš„。使用者å¯è°ƒç”¨`Writer::IsComplete()`去检测完整性。
+
+当JSON完整时,`Writer`ä¸èƒ½å†æŽ¥å—新的事件。ä¸ç„¶å…¶è¾“出便会是ä¸åˆæ³•çš„ï¼ˆä¾‹å¦‚æœ‰è¶…è¿‡ä¸€ä¸ªæ ¹èŠ‚ç‚¹ï¼‰ã€‚ä¸ºäº†é‡æ–°åˆ©ç”¨`Writer`对象,使用者å¯è°ƒç”¨`Writer::Reset(OutputStream& os)`去é‡ç½®å…¶æ‰€æœ‰å†…部状æ€åŠè®¾ç½®æ–°çš„输出æµã€‚
+
+# 技巧 {#Techniques}
+
+## è§£æžJSON至自定义结构 {#CustomDataStructure}
+
+`Document`的解æžåŠŸèƒ½å®Œå…¨ä¾é `Reader`。实际上`Document`是一个处ç†å™¨ï¼Œåœ¨è§£æžJSON时接收事件去建立一个DOM。
+
+使用者å¯ä»¥ç›´æŽ¥ä½¿ç”¨`Reader`去建立其他数æ®ç»“构。这消除了建立DOM的步骤,从而å‡å°‘了内存开销并改善性能。
+
+在以下的`messagereader`例å­ä¸­ï¼Œ`ParseMessages()`è§£æžä¸€ä¸ªJSON,该JSON应该是一个å«é”®å€¼å¯¹çš„object。
+
+~~~~~~~~~~cpp
+#include "rapidjson/reader.h"
+#include "rapidjson/error/en.h"
+#include <iostream>
+#include <string>
+#include <map>
+
+using namespace std;
+using namespace rapidjson;
+
+typedef map<string, string> MessageMap;
+
+struct MessageHandler
+ : public BaseReaderHandler<UTF8<>, MessageHandler> {
+ MessageHandler() : state_(kExpectObjectStart) {
+ }
+
+ bool StartObject() {
+ switch (state_) {
+ case kExpectObjectStart:
+ state_ = kExpectNameOrObjectEnd;
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool String(const char* str, SizeType length, bool) {
+ switch (state_) {
+ case kExpectNameOrObjectEnd:
+ name_ = string(str, length);
+ state_ = kExpectValue;
+ return true;
+ case kExpectValue:
+ messages_.insert(MessageMap::value_type(name_, string(str, length)));
+ state_ = kExpectNameOrObjectEnd;
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }
+
+ bool Default() { return false; } // All other events are invalid.
+
+ MessageMap messages_;
+ enum State {
+ kExpectObjectStart,
+ kExpectNameOrObjectEnd,
+ kExpectValue,
+ }state_;
+ std::string name_;
+};
+
+void ParseMessages(const char* json, MessageMap& messages) {
+ Reader reader;
+ MessageHandler handler;
+ StringStream ss(json);
+ if (reader.Parse(ss, handler))
+ messages.swap(handler.messages_); // Only change it if success.
+ else {
+ ParseErrorCode e = reader.GetParseErrorCode();
+ size_t o = reader.GetErrorOffset();
+ cout << "Error: " << GetParseError_En(e) << endl;;
+ cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;
+ }
+}
+
+int main() {
+ MessageMap messages;
+
+ const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
+ cout << json1 << endl;
+ ParseMessages(json1, messages);
+
+ for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
+ cout << itr->first << ": " << itr->second << endl;
+
+ cout << endl << "Parse a JSON with invalid schema." << endl;
+ const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
+ cout << json2 << endl;
+ ParseMessages(json2, messages);
+
+ return 0;
+}
+~~~~~~~~~~
+
+~~~~~~~~~~
+{ "greeting" : "Hello!", "farewell" : "bye-bye!" }
+farewell: bye-bye!
+greeting: Hello!
+
+Parse a JSON with invalid schema.
+{ "greeting" : "Hello!", "farewell" : "bye-bye!", "foo" : {} }
+Error: Terminate parsing due to Handler error.
+ at offset 59 near '} }...'
+~~~~~~~~~~
+
+第一个JSON(`json1`)被æˆåŠŸåœ°è§£æžè‡³`MessageMap`。由于`MessageMap`是一个`std::map`ï¼Œæ‰“å°æ¬¡åºæŒ‰é”®å€¼æŽ’åºã€‚此次åºä¸ŽJSON中的次åºä¸åŒã€‚
+
+在第二个JSON(`json2`)中,`foo`的值是一个空object。由于它是一个object,`MessageHandler::StartObject()`会被调用。然而,在`state_ = kExpectValue`的情况下,该函数会返回`false`,并导致解æžè¿‡ç¨‹ç»ˆæ­¢ã€‚é”™è¯¯ä»£ç æ˜¯`kParseErrorTermination`。
+
+## 过滤JSON {#Filtering}
+
+如å‰é¢æåŠè¿‡ï¼Œ`Writer`å¯å¤„ç†`Reader`å‘出的事件。`example/condense/condense.cpp`例å­ç®€å•地设置`Writer`作为一个`Reader`的处ç†å™¨ï¼Œå› æ­¤å®ƒèƒ½ç§»é™¤JSON中的所有空白字符。`example/pretty/pretty.cpp`例å­ä½¿ç”¨åŒæ ·çš„å…³ç³»ï¼Œåªæ˜¯ä»¥`PrettyWriter`å–代`Writer`。因此`pretty`èƒ½å¤Ÿé‡æ–°æ ¼å¼åŒ–JSONï¼ŒåŠ å…¥ç¼©è¿›åŠæ¢è¡Œã€‚
+
+实际上,我们å¯ä»¥ä½¿ç”¨SAX风格API去加入(多个)中间层去过滤JSON的内容。例如`capitalize`例å­å¯ä»¥æŠŠæ‰€æœ‰JSON string改为大写。
+
+~~~~~~~~~~cpp
+#include "rapidjson/reader.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/error/en.h"
+#include <vector>
+#include <cctype>
+
+using namespace rapidjson;
+
+template<typename OutputHandler>
+struct CapitalizeFilter {
+ CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {
+ }
+
+ bool Null() { return out_.Null(); }
+ bool Bool(bool b) { return out_.Bool(b); }
+ bool Int(int i) { return out_.Int(i); }
+ bool Uint(unsigned u) { return out_.Uint(u); }
+ bool Int64(int64_t i) { return out_.Int64(i); }
+ bool Uint64(uint64_t u) { return out_.Uint64(u); }
+ bool Double(double d) { return out_.Double(d); }
+ bool String(const char* str, SizeType length, bool) {
+ buffer_.clear();
+ for (SizeType i = 0; i < length; i++)
+ buffer_.push_back(std::toupper(str[i]));
+ return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string
+ }
+ bool StartObject() { return out_.StartObject(); }
+ bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
+ bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }
+ bool StartArray() { return out_.StartArray(); }
+ bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }
+
+ OutputHandler& out_;
+ std::vector<char> buffer_;
+};
+
+int main(int, char*[]) {
+ // Prepare JSON reader and input stream.
+ Reader reader;
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+
+ // Prepare JSON writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+ Writer<FileWriteStream> writer(os);
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
+ if (!reader.Parse(is, filter)) {
+ fprintf(stderr, "\nError(%u): %s\n", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
+~~~~~~~~~~
+
+注æ„到,ä¸å¯ç®€å•地把JSON当作字符串去改为大写。例如:
+~~~~~~~~~~
+["Hello\nWorld"]
+~~~~~~~~~~
+
+简å•地把整个JSON转为大写的è¯ä¼šäº§ç”Ÿé”™è¯¯çš„转义符:
+~~~~~~~~~~
+["HELLO\NWORLD"]
+~~~~~~~~~~
+
+而`capitalize`就会产生正确的结果:
+~~~~~~~~~~
+["HELLO\nWORLD"]
+~~~~~~~~~~
+
+我们还å¯ä»¥å¼€å‘æ›´å¤æ‚的过滤器。然而,由于SAX风格API在æŸä¸€æ—¶é—´ç‚¹åªèƒ½æä¾›å•一事件的信æ¯ï¼Œä½¿ç”¨è€…需è¦è‡ªè¡Œè®°å½•一些上下文信æ¯ï¼ˆä¾‹å¦‚从根节点起的路径ã€å‚¨å­˜å…¶ä»–ç›¸å…³å€¼ï¼‰ã€‚å¯¹äºŽå¤„ç†æŸäº›æƒ…况,用DOM会比SAX更容易实现。
+
diff --git a/3rdparty/rapidjson/doc/schema.md b/3rdparty/rapidjson/doc/schema.md
new file mode 100644
index 00000000000..4e07e9f0eee
--- /dev/null
+++ b/3rdparty/rapidjson/doc/schema.md
@@ -0,0 +1,237 @@
+# Schema
+
+## Status: experimental, shall be included in v1.1
+
+JSON Schema is a draft standard for describing format of JSON. The schema itself is also a JSON. By validating a JSON with JSON Schema, your code can safely access the DOM without manually checking types, or whether a key exists, etc. It can also ensure that the serialized JSON conform to a specified schema.
+
+RapidJSON implemented a JSON Schema validator for [JSON Schema Draft v4](http://json-schema.org/documentation.html). If you do not familiar with JSON Schema, you may refer to [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/).
+
+[TOC]
+
+## Basic Usage
+
+First of all, you need to parse a JSON Schema into `Document`, and then compile the `Document` into `SchemaDocument`.
+
+Secondly, construct a `SchemaValidator` with the `SchedmaDocument`. It is similar to a `Writer` in the sense of handling SAX events. So, you can use `document.Accept(validator)` to validate a document, and then check the validity.
+
+~~~cpp
+#include "rapidjson/schema.h"
+
+// ...
+
+Document sd;
+if (!sd.Parse(schemaJson)) {
+ // the schema is not a valid JSON.
+ // ...
+}
+SchemaDocument schema(sd); // Compile a Document to SchemaDocument
+// sd is no longer needed here.
+
+Document d;
+if (!d.Parse(inputJson)) {
+ // the input is not a valid JSON.
+ // ...
+}
+
+SchemaValidator validator(schema);
+if (!d.Accept(validator)) {
+ // Input JSON is invalid according to the schema
+ // Output diagnostic information
+ StringBuffer sb;
+ validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ printf("Invalid schema: %s\n", sb.GetString());
+ printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
+ sb.Clear();
+ validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ printf("Invalid document: %s\n", sb.GetString());
+}
+~~~
+
+Some notes:
+
+* One `SchemaDocment` can be referenced by multiple `SchemaValidator`s. It will not be modified by `SchemaValidator`s.
+* A `SchemaValidator` may be reused to validate multiple documents. To run it for other documents, call `validator.Reset()` first.
+
+## Validation during parsing/serialization
+
+Differ to most JSON Schema validator implementations, RapidJSON provides a SAX-based schema validator. Therefore, you can parse a JSON from a stream while validating it on the fly. If the validator encounters a JSON value that invalidates the supplied schema, the parsing will be terminated immediately. This design is especially useful for parsing large JSON files.
+
+### DOM parsing
+
+For using DOM in parsing, `Document` needs some preparation and finalizing tasks, in addition to receiving SAX events, thus it needs some work to route the reader, validator and the document. `SchemaValidatingReader` is a helper class that doing such work.
+
+~~~cpp
+#include "rapidjson/filereadstream.h"
+
+// ...
+SchemaDocument schema(sd); // Compile a Document to SchemaDocument
+
+// Use reader to parse the JSON
+FILE* fp = fopen("big.json", "r");
+FileReadStream is(fp, buffer, sizeof(buffer));
+
+// Parse JSON from reader, validate the SAX events, and store in d.
+Document d;
+SchemaValidatingReader<kParseDefaultFlags, FileReadStream, UTF8<> > reader(is, schema);
+d.Populate(reader);
+
+if (!reader.GetParseResult()) {
+ // Not a valid JSON
+ // When reader.GetParseResult().Code() == kParseErrorTermination,
+ // it may be terminated by:
+ // (1) the validator found that the JSON is invalid according to schema; or
+ // (2) the input stream has I/O error.
+
+ // Check the validation result
+ if (!reader.IsValid()) {
+ // Input JSON is invalid according to the schema
+ // Output diagnostic information
+ StringBuffer sb;
+ reader.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ printf("Invalid schema: %s\n", sb.GetString());
+ printf("Invalid keyword: %s\n", reader.GetInvalidSchemaKeyword());
+ sb.Clear();
+ reader.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ printf("Invalid document: %s\n", sb.GetString());
+ }
+}
+~~~
+
+### SAX parsing
+
+For using SAX in parsing, it is much simpler. If it only need to validate the JSON without further processing, it is simply:
+
+~~~
+SchemaValidator validator(schema);
+Reader reader;
+if (!reader.Parse(stream, validator)) {
+ if (!validator.IsValid()) {
+ // ...
+ }
+}
+~~~
+
+This is exactly the method used in [schemavalidator](example/schemavalidator/schemavalidator.cpp) example. The distinct advantage is low memory usage, no matter how big the JSON was (the memory usage depends on the complexity of the schema).
+
+If you need to handle the SAX events further, then you need to use the template class `GenericSchemaValidator` to set the output handler of the validator:
+
+~~~
+MyHandler handler;
+GenericSchemaValidator<SchemaDocument, MyHandler> validator(schema, handler);
+Reader reader;
+if (!reader.Parse(ss, validator)) {
+ if (!validator.IsValid()) {
+ // ...
+ }
+}
+~~~
+
+### Serialization
+
+It is also possible to do validation during serializing. This can ensure the result JSON is valid according to the JSON schema.
+
+~~~
+StringBuffer sb;
+Writer<StringBuffer> writer(sb);
+GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
+if (!d.Accept(validator)) {
+ // Some problem during Accept(), it may be validation or encoding issues.
+ if (!validator.IsValid()) {
+ // ...
+ }
+}
+~~~
+
+Of course, if your application only needs SAX-style serialization, it can simply send SAX events to `SchemaValidator` instead of `Writer`.
+
+## Remote Schema
+
+JSON Schema supports [`$ref` keyword](http://spacetelescope.github.io/understanding-json-schema/structuring.html), which is a [JSON pointer](pointer.md) referencing to a local or remote schema. Local pointer is prefixed with `#`, while remote pointer is an relative or absolute URI. For example:
+
+~~~js
+{ "$ref": "definitions.json#/address" }
+~~~
+
+As `SchemaValidator` does not know how to resolve such URI, it needs a user-provided `IRemoteSchemaDocumentProvider` instance to do so.
+
+~~~
+class MyRemoteSchemaDocumentProvider : public IRemoteSchemaDocumentProvider {
+public:
+ virtual const SchemaDocument* GetRemoteDocument(const char* uri, SizeTyp length) {
+ // Resolve the uri and returns a pointer to that schema.
+ }
+};
+
+// ...
+
+MyRemoteSchemaDocumentProvider provider;
+SchemaValidator validator(schema, &provider);
+~~~
+
+## Conformance
+
+RapidJSON passed 262 out of 263 tests in [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (Json Schema draft 4).
+
+The failed test is "changed scope ref invalid" of "change resolution scope" in `refRemote.json`. It is due to that `id` schema keyword and URI combining function are not implemented.
+
+Besides, the `format` schema keyword for string values is ignored, since it is not required by the specification.
+
+### Regular Expression
+
+The schema keyword `pattern` and `patternProperties` uses regular expression to match the required pattern.
+
+RapidJSON implemented a simple NFA regular expression engine, which is used by default. It supports the following syntax.
+
+|Syntax|Description|
+|------|-----------|
+|`ab` | Concatenation
+|`a|b` | Alternation
+|`a?` | Zero or one
+|`a*` | Zero or more
+|`a+` | One or more
+|`a{3}` | Exactly 3 times
+|`a{3,}` | At least 3 times
+|`a{3,5}`| 3 to 5 times
+|`(ab)` | Grouping
+|`^a` | At the beginning
+|`a$` | At the end
+|`.` | Any character
+|`[abc]` | Character classes
+|`[a-c]` | Character class range
+|`[a-z0-9_]` | Character class combination
+|`[^abc]` | Negated character classes
+|`[^a-c]` | Negated character class range
+|`[\b]` | Backspace (U+0008)
+|`\|`, `\\`, ... | Escape characters
+|`\f` | Form feed (U+000C)
+|`\n` | Line feed (U+000A)
+|`\r` | Carriage return (U+000D)
+|`\t` | Tab (U+0009)
+|`\v` | Vertical tab (U+000B)
+
+For C++11 compiler, it is also possible to use the `std::regex` by defining `RAPIDJSON_SCHEMA_USE_INTERNALREGEX=0` and `RAPIDJSON_SCHEMA_USE_STDREGEX=1`. If your schemas do not need `pattern` and `patternProperties`, you can set both macros to zero to disable this feature, which will reduce some code size.
+
+## Performance
+
+Most C++ JSON libraries have not yet supporting JSON Schema. So we tried to evaluate the performance of RapidJSON's JSON Schema validator according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), which tests 11 JavaScript libraries running on Node.js.
+
+That benchmark runs validations on [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite), in which some test suites and tests are excluded. We made the same benchmarking procedure in [`schematest.cpp`](test/perftest/schematest.cpp).
+
+On a Mac Book Pro (2.8 GHz Intel Core i7), the following results are collected.
+
+|Validator|Relative speed|Number of test runs per second|
+|---------|:------------:|:----------------------------:|
+|RapidJSON|155%|30682|
+|[`ajv`](https://github.com/epoberezkin/ajv)|100%|19770 (± 1.31%)|
+|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|70%|13835 (± 2.84%)|
+|[`jsen`](https://github.com/bugventure/jsen)|57.7%|11411 (± 1.27%)|
+|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|26%|5145 (± 1.62%)|
+|[`themis`](https://github.com/playlyfe/themis)|19.9%|3935 (± 2.69%)|
+|[`z-schema`](https://github.com/zaggino/z-schema)|7%|1388 (± 0.84%)|
+|[`jsck`](https://github.com/pandastrike/jsck#readme)|3.1%|606 (± 2.84%)|
+|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|0.9%|185 (± 1.01%)|
+|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|0.8%|154 (± 0.79%)|
+|tv4|0.5%|93 (± 0.94%)|
+|[`jayschema`](https://github.com/natesilva/jayschema)|0.1%|21 (± 1.14%)|
+
+That is, RapidJSON is about 1.5x faster than the fastest JavaScript library (ajv). And 1400x faster than the slowest one.
diff --git a/3rdparty/rapidjson/doc/schema.zh-cn.md b/3rdparty/rapidjson/doc/schema.zh-cn.md
new file mode 100644
index 00000000000..dd0ec73b85e
--- /dev/null
+++ b/3rdparty/rapidjson/doc/schema.zh-cn.md
@@ -0,0 +1,237 @@
+# Schema
+
+## 状æ€: 实验性,应该会åˆè¿› v1.1
+
+JSON Schema 是æè¿° JSON æ ¼å¼çš„ä¸€ä¸ªæ ‡å‡†è‰æ¡ˆã€‚一个 schema 本身也是一个 JSON。使用 JSON Schema 去校验 JSON,å¯ä»¥è®©ä½ çš„代ç å®‰å…¨åœ°è®¿é—® DOM,而无须检查类型或键值是å¦å­˜åœ¨ç­‰ã€‚这也能确ä¿è¾“出的 JSON æ˜¯ç¬¦åˆæŒ‡å®šçš„ schema。
+
+RapidJSON 实现了一个 [JSON Schema Draft v4](http://json-schema.org/documentation.html) 的校验器。若你ä¸ç†Ÿæ‚‰ JSON Schema,å¯ä»¥å‚考 [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/)。
+
+[TOC]
+
+## 基本用法
+
+é¦–å…ˆï¼Œä½ è¦æŠŠ JSON Schema è§£æžæˆ `Document`ï¼Œå†æŠŠå®ƒç¼–è¯‘æˆä¸€ä¸ª `SchemaDocument`。
+
+ç„¶åŽï¼Œåˆ©ç”¨è¯¥ `SchemaDocument` 创建一个 `SchemaValidator`。它与 `Writer` ç›¸ä¼¼ï¼Œéƒ½æ˜¯èƒ½å¤Ÿå¤„ç† SAX 事件的。因此,你å¯ä»¥ç”¨ `document.Accept(validator)` 去校验一个 JSON,然åŽå†èŽ·å–æ ¡éªŒç»“果。
+
+~~~cpp
+#include "rapidjson/schema.h"
+
+// ...
+
+Document sd;
+if (!sd.Parse(schemaJson)) {
+ // the schema is not a valid JSON.
+ // ...
+}
+SchemaDocument schema(sd); // Compile a Document to SchemaDocument
+// sd is no longer needed here.
+
+Document d;
+if (!d.Parse(inputJson)) {
+ // the input is not a valid JSON.
+ // ...
+}
+
+SchemaValidator validator(schema);
+if (!d.Accept(validator)) {
+ // Input JSON is invalid according to the schema
+ // Output diagnostic information
+ StringBuffer sb;
+ validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ printf("Invalid schema: %s\n", sb.GetString());
+ printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
+ sb.Clear();
+ validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ printf("Invalid document: %s\n", sb.GetString());
+}
+~~~
+
+一些注æ„点:
+
+* 一个 `SchemaDocment` 能被多个 `SchemaValidator` åŠç”¨ã€‚它ä¸ä¼šè¢« `SchemaValidator` 修改。
+* 一个 `SchemaValidator` å¯ä»¥é‡å¤ä½¿ç”¨æ¥æ ¡éªŒå¤šä¸ªæ–‡ä»¶ã€‚在校验其他文件å‰ï¼Œå…ˆè°ƒç”¨ `validator.Reset()`。
+
+## 在解æžï¼ç”Ÿæˆæ—¶è¿›è¡Œæ ¡éªŒ
+
+与大部分 JSON Schema 校验器有所ä¸åŒï¼ŒRapidJSON æä¾›äº†ä¸€ä¸ªåŸºäºŽ SAX çš„ schema 校验器实现。因此,你å¯ä»¥åœ¨è¾“å…¥æµè§£æž JSON çš„åŒæ—¶è¿›è¡Œæ ¡éªŒã€‚若校验器é‡åˆ°ä¸€ä¸ªä¸Ž schema ä¸ç¬¦çš„值,就会立å³ç»ˆæ­¢è§£æžã€‚这设计对于解æžå¤§åž‹ JSON 文件时特别有用。
+
+### DOM è§£æž
+
+在使用 DOM è¿›è¡Œè§£æžæ—¶ï¼Œ`Document` 除了接收 SAX 事件外,还需åšä¸€äº›å‡†å¤‡åŠç»“æŸå·¥ä½œï¼Œå› æ­¤ï¼Œä¸ºäº†è¿žæŽ¥ `Reader`ã€`SchemaValidator` å’Œ `Document` è¦åšå¤šä¸€ç‚¹äº‹æƒ…。`SchemaValidatingReader` 是一个辅助类去åšé‚£äº›å·¥ä½œã€‚
+
+~~~cpp
+#include "rapidjson/filereadstream.h"
+
+// ...
+SchemaDocument schema(sd); // Compile a Document to SchemaDocument
+
+// Use reader to parse the JSON
+FILE* fp = fopen("big.json", "r");
+FileReadStream is(fp, buffer, sizeof(buffer));
+
+// Parse JSON from reader, validate the SAX events, and store in d.
+Document d;
+SchemaValidatingReader<kParseDefaultFlags, FileReadStream, UTF8<> > reader(is, schema);
+d.Populate(reader);
+
+if (!reader.GetParseResult()) {
+ // Not a valid JSON
+ // When reader.GetParseResult().Code() == kParseErrorTermination,
+ // it may be terminated by:
+ // (1) the validator found that the JSON is invalid according to schema; or
+ // (2) the input stream has I/O error.
+
+ // Check the validation result
+ if (!reader.IsValid()) {
+ // Input JSON is invalid according to the schema
+ // Output diagnostic information
+ StringBuffer sb;
+ reader.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ printf("Invalid schema: %s\n", sb.GetString());
+ printf("Invalid keyword: %s\n", reader.GetInvalidSchemaKeyword());
+ sb.Clear();
+ reader.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ printf("Invalid document: %s\n", sb.GetString());
+ }
+}
+~~~
+
+### SAX è§£æž
+
+使用 SAX è§£æžæ—¶ï¼Œæƒ…况就简å•得多。若åªéœ€è¦æ ¡éªŒ JSON 而无需进一步处ç†ï¼Œé‚£ä¹ˆä»…需è¦ï¼š
+
+~~~
+SchemaValidator validator(schema);
+Reader reader;
+if (!reader.Parse(stream, validator)) {
+ if (!validator.IsValid()) {
+ // ...
+ }
+}
+~~~
+
+è¿™ç§æ–¹å¼å’Œ [schemavalidator](example/schemavalidator/schemavalidator.cpp) 例å­å®Œå…¨ç›¸åŒã€‚这带æ¥çš„独特优势是,无论 JSON 多巨大,永远维æŒä½Žå†…存用é‡ï¼ˆå†…存用é‡åªä¸Ž Schema çš„å¤æ‚度相关)。
+
+若你需è¦è¿›ä¸€æ­¥å¤„ç† SAX 事件,便å¯ä½¿ç”¨æ¨¡æ¿ç±» `GenericSchemaValidator` 去设置校验器的输出 `Handler`:
+
+~~~
+MyHandler handler;
+GenericSchemaValidator<SchemaDocument, MyHandler> validator(schema, handler);
+Reader reader;
+if (!reader.Parse(ss, validator)) {
+ if (!validator.IsValid()) {
+ // ...
+ }
+}
+~~~
+
+### 生æˆ
+
+我们也å¯ä»¥åœ¨ç”Ÿæˆï¼ˆserialization)的时候进行校验。这能确ä¿è¾“出的 JSON 符åˆä¸€ä¸ª JSON Schema。
+
+~~~
+StringBuffer sb;
+Writer<StringBuffer> writer(sb);
+GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
+if (!d.Accept(validator)) {
+ // Some problem during Accept(), it may be validation or encoding issues.
+ if (!validator.IsValid()) {
+ // ...
+ }
+}
+~~~
+
+å½“ç„¶ï¼Œå¦‚æžœä½ çš„åº”ç”¨ä»…éœ€è¦ SAX 风格的生æˆï¼Œé‚£ä¹ˆåªéœ€è¦æŠŠ SAX 事件由原æ¥å‘é€åˆ° `Writer`,改为å‘é€åˆ° `SchemaValidator`。
+
+## 远程 Schema
+
+JSON Schema æ”¯æŒ [`$ref` 关键字](http://spacetelescope.github.io/understanding-json-schema/structuring.html),它是一个[JSON pointer](pointer.md) 引用至一个本地(local)或远程(remote) schema。本地指针的首字符是 `#`,而远程指针是一个相对或ç»å¯¹ URI。例如:
+
+~~~js
+{ "$ref": "definitions.json#/address" }
+~~~
+
+由于 `SchemaValidator` å¹¶ä¸çŸ¥é“如何处ç†é‚£äº› URI,它需è¦ä½¿ç”¨è€…æä¾›ä¸€ä¸ª `IRemoteSchemaDocumentProvider` 的实例去处ç†ã€‚
+
+~~~
+class MyRemoteSchemaDocumentProvider : public IRemoteSchemaDocumentProvider {
+public:
+ virtual const SchemaDocument* GetRemoteDocument(const char* uri, SizeTyp length) {
+ // Resolve the uri and returns a pointer to that schema.
+ }
+};
+
+// ...
+
+MyRemoteSchemaDocumentProvider provider;
+SchemaValidator validator(schema, &provider);
+~~~
+
+## 标准的符åˆç¨‹åº¦
+
+RapidJSON 通过了 [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (Json Schema draft 4) 中 263 个测试的 262 个。
+
+没通过的测试是 `refRemote.json` 中的 "change resolution scope" - "changed scope ref invalid"。这是由于未实现 `id` schema å…³é”®å­—åŠ URI åˆå¹¶åŠŸèƒ½ã€‚
+
+除此以外,关于字符串类型的 `format` schema 关键字也会被忽略,因为标准中并没需求必须实现。
+
+### 正则表达å¼
+
+`pattern` åŠ `patternProperties` 这两个 schema 关键字使用了正则表达å¼åŽ»åŒ¹é…æ‰€éœ€çš„æ¨¡å¼ã€‚
+
+RapidJSON 实现了一个简å•çš„ NFA 正则表达å¼å¼•擎,并预设使用。它支æŒä»¥ä¸‹è¯­æ³•。
+
+|语法|æè¿°|
+|------|-----------|
+|`ab` | 串è”
+|`a|b` | 交替
+|`a?` | 零或一次
+|`a*` | 零或多次
+|`a+` | 一或多次
+|`a{3}` | 刚好 3 次
+|`a{3,}` | 至少 3 次
+|`a{3,5}`| 3 至 5 次
+|`(ab)` | 分组
+|`^a` | 在开始处
+|`a$` | 在结æŸå¤„
+|`.` | 任何字符
+|`[abc]` | 字符组
+|`[a-c]` | 字符组范围
+|`[a-z0-9_]` | 字符组组åˆ
+|`[^abc]` | 字符组å–å
+|`[^a-c]` | 字符组范围å–å
+|`[\b]` | 退格符 (U+0008)
+|`\|`, `\\`, ... | 转义字符
+|`\f` | 馈页 (U+000C)
+|`\n` | 馈行 (U+000A)
+|`\r` | 回车 (U+000D)
+|`\t` | 制表 (U+0009)
+|`\v` | 垂直制表 (U+000B)
+
+对于使用 C++11 编译器的使用者,也å¯ä½¿ç”¨ `std::regex`,åªéœ€å®šä¹‰ `RAPIDJSON_SCHEMA_USE_INTERNALREGEX=0` åŠ `RAPIDJSON_SCHEMA_USE_STDREGEX=1`。若你的 schema 无需使用 `pattern` 或 `patternProperties`,å¯ä»¥æŠŠä¸¤ä¸ªå®éƒ½è®¾ä¸ºé›¶ï¼Œä»¥ç¦ç”¨æ­¤åŠŸèƒ½ï¼Œè¿™æ ·åšå¯èŠ‚çœä¸€äº›ä»£ç ä½“积。
+
+## 性能
+
+大部分 C++ JSON åº“éƒ½æœªæ”¯æŒ JSON Schema。因此我们å°è¯•按照 [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) 去评估 RapidJSON çš„ JSON Schema 校验器。该评测测试了 11 个è¿è¡Œåœ¨ node.js 上的 JavaScript 库。
+
+该评测校验 [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) 中的测试,当中排除了一些测试套件åŠä¸ªåˆ«æµ‹è¯•。我们在 [`schematest.cpp`](test/perftest/schematest.cpp) 实现了相åŒçš„评测。
+
+在 MacBook Pro (2.8 GHz Intel Core i7) 上收集到以下结果。
+
+|校验器|相对速度|æ¯ç§’执行的测试数目|
+|---------|:------------:|:----------------------------:|
+|RapidJSON|155%|30682|
+|[`ajv`](https://github.com/epoberezkin/ajv)|100%|19770 (± 1.31%)|
+|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|70%|13835 (± 2.84%)|
+|[`jsen`](https://github.com/bugventure/jsen)|57.7%|11411 (± 1.27%)|
+|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|26%|5145 (± 1.62%)|
+|[`themis`](https://github.com/playlyfe/themis)|19.9%|3935 (± 2.69%)|
+|[`z-schema`](https://github.com/zaggino/z-schema)|7%|1388 (± 0.84%)|
+|[`jsck`](https://github.com/pandastrike/jsck#readme)|3.1%|606 (± 2.84%)|
+|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|0.9%|185 (± 1.01%)|
+|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|0.8%|154 (± 0.79%)|
+|tv4|0.5%|93 (± 0.94%)|
+|[`jayschema`](https://github.com/natesilva/jayschema)|0.1%|21 (± 1.14%)|
+
+æ¢è¨€ä¹‹ï¼ŒRapidJSON 比最快的 JavaScript 库(ajv)快约 1.5x。比最慢的快 1400x。
diff --git a/3rdparty/rapidjson/doc/stream.md b/3rdparty/rapidjson/doc/stream.md
new file mode 100644
index 00000000000..b79ce537acd
--- /dev/null
+++ b/3rdparty/rapidjson/doc/stream.md
@@ -0,0 +1,426 @@
+# Stream
+
+In RapidJSON, `rapidjson::Stream` is a concept for reading/writing JSON. Here we first show how to use streams provided. And then see how to create a custom stream.
+
+[TOC]
+
+# Memory Streams {#MemoryStreams}
+
+Memory streams store JSON in memory.
+
+## StringStream (Input) {#StringStream}
+
+`StringStream` is the most basic input stream. It represents a complete, read-only JSON stored in memory. It is defined in `rapidjson/rapidjson.h`.
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h" // will include "rapidjson/rapidjson.h"
+
+using namespace rapidjson;
+
+// ...
+const char json[] = "[1, 2, 3, 4]";
+StringStream s(json);
+
+Document d;
+d.ParseStream(s);
+~~~~~~~~~~
+
+Since this is very common usage, `Document::Parse(const char*)` is provided to do exactly the same as above:
+
+~~~~~~~~~~cpp
+// ...
+const char json[] = "[1, 2, 3, 4]";
+Document d;
+d.Parse(json);
+~~~~~~~~~~
+
+Note that, `StringStream` is a typedef of `GenericStringStream<UTF8<> >`, user may use another encodings to represent the character set of the stream.
+
+## StringBuffer (Output) {#StringBuffer}
+
+`StringBuffer` is a simple output stream. It allocates a memory buffer for writing the whole JSON. Use `GetString()` to obtain the buffer.
+
+~~~~~~~~~~cpp
+#include "rapidjson/stringbuffer.h"
+
+StringBuffer buffer;
+Writer<StringBuffer> writer(buffer);
+d.Accept(writer);
+
+const char* output = buffer.GetString();
+~~~~~~~~~~
+
+When the buffer is full, it will increases the capacity automatically. The default capacity is 256 characters (256 bytes for UTF8, 512 bytes for UTF16, etc.). User can provide an allocator and a initial capacity.
+
+~~~~~~~~~~cpp
+StringBuffer buffer1(0, 1024); // Use its allocator, initial size = 1024
+StringBuffer buffer2(allocator, 1024);
+~~~~~~~~~~
+
+By default, `StringBuffer` will instantiate an internal allocator.
+
+Similarly, `StringBuffer` is a typedef of `GenericStringBuffer<UTF8<> >`.
+
+# File Streams {#FileStreams}
+
+When parsing a JSON from file, you may read the whole JSON into memory and use ``StringStream`` above.
+
+However, if the JSON is big, or memory is limited, you can use `FileReadStream`. It only read a part of JSON from file into buffer, and then let the part be parsed. If it runs out of characters in the buffer, it will read the next part from file.
+
+## FileReadStream (Input) {#FileReadStream}
+
+`FileReadStream` reads the file via a `FILE` pointer. And user need to provide a buffer.
+
+~~~~~~~~~~cpp
+#include "rapidjson/filereadstream.h"
+#include <cstdio>
+
+using namespace rapidjson;
+
+FILE* fp = fopen("big.json", "rb"); // non-Windows use "r"
+
+char readBuffer[65536];
+FileReadStream is(fp, readBuffer, sizeof(readBuffer));
+
+Document d;
+d.ParseStream(is);
+
+fclose(fp);
+~~~~~~~~~~
+
+Different from string streams, `FileReadStream` is byte stream. It does not handle encodings. If the file is not UTF-8, the byte stream can be wrapped in a `EncodedInputStream`. It will be discussed very soon.
+
+Apart from reading file, user can also use `FileReadStream` to read `stdin`.
+
+## FileWriteStream (Output) {#FileWriteStream}
+
+`FileWriteStream` is buffered output stream. Its usage is very similar to `FileReadStream`.
+
+~~~~~~~~~~cpp
+#include "rapidjson/filewritestream.h"
+#include <cstdio>
+
+using namespace rapidjson;
+
+Document d;
+d.Parse(json);
+// ...
+
+FILE* fp = fopen("output.json", "wb"); // non-Windows use "w"
+
+char writeBuffer[65536];
+FileWriteStream os(fp, writeBuffer, sizeof(writeBuffer));
+
+Writer<FileWriteStream> writer(os);
+d.Accept(writer);
+
+fclose(fp);
+~~~~~~~~~~
+
+It can also directs the output to `stdout`.
+
+# iostream Wrapper {#iostreamWrapper}
+
+Due to users' requests, RapidJSON provided official wrappers for `std::basic_istream` and `std::basic_ostream`. However, please note that the performance will be much lower than the other streams above.
+
+## IStreamWrapper {#IStreamWrapper}
+
+`IStreamWrapper` wraps any class drived from `std::istream`, such as `std::istringstream`, `std::stringstream`, `std::ifstream`, `std::fstream`, into RapidJSON's input stream.
+
+~~~cpp
+#include <rapidjson/document.h>
+#include <rapidjson/istreamwrapper.h>
+#include <fstream>
+
+using namespace rapidjson;
+using namespace std;
+
+ifstream ifs("test.json");
+IStreamWrapper isw(ifs);
+
+Document d;
+d.ParseStream(isw);
+~~~
+
+For classes derived from `std::wistream`, use `WIStreamWrapper`.
+
+## OStreamWrapper {#OStreamWrapper}
+
+Similarly, `OStreamWrapper` wraps any class derived from `std::ostream`, such as `std::ostringstream`, `std::stringstream`, `std::ofstream`, `std::fstream`, into RapidJSON's input stream.
+
+~~~cpp
+#include <rapidjson/document.h>
+#include <rapidjson/ostreamwrapper.h>
+#include <rapidjson/writer.h>
+#include <fstream>
+
+using namespace rapidjson;
+using namespace std;
+
+Document d;
+d.Parse(json);
+
+// ...
+
+ofstream ofs("output.json");
+OStreamWrapper osw(ofs);
+
+Writer<OStreamWrapper> writer(osw);
+d.Accept(writer);
+~~~
+
+For classes derived from `std::wostream`, use `WOStreamWrapper`.
+
+# Encoded Streams {#EncodedStreams}
+
+Encoded streams do not contain JSON itself, but they wrap byte streams to provide basic encoding/decoding function.
+
+As mentioned above, UTF-8 byte streams can be read directly. However, UTF-16 and UTF-32 have endian issue. To handle endian correctly, it needs to convert bytes into characters (e.g. `wchar_t` for UTF-16) while reading, and characters into bytes while writing.
+
+Besides, it also need to handle [byte order mark (BOM)](http://en.wikipedia.org/wiki/Byte_order_mark). When reading from a byte stream, it is needed to detect or just consume the BOM if exists. When writing to a byte stream, it can optionally write BOM.
+
+If the encoding of stream is known in compile-time, you may use `EncodedInputStream` and `EncodedOutputStream`. If the stream can be UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE JSON, and it is only known in runtime, you may use `AutoUTFInputStream` and `AutoUTFOutputStream`. These streams are defined in `rapidjson/encodedstream.h`.
+
+Note that, these encoded streams can be applied to streams other than file. For example, you may have a file in memory, or a custom byte stream, be wrapped in encoded streams.
+
+## EncodedInputStream {#EncodedInputStream}
+
+`EncodedInputStream` has two template parameters. The first one is a `Encoding` class, such as `UTF8`, `UTF16LE`, defined in `rapidjson/encodings.h`. The second one is the class of stream to be wrapped.
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+#include "rapidjson/filereadstream.h" // FileReadStream
+#include "rapidjson/encodedstream.h" // EncodedInputStream
+#include <cstdio>
+
+using namespace rapidjson;
+
+FILE* fp = fopen("utf16le.json", "rb"); // non-Windows use "r"
+
+char readBuffer[256];
+FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
+
+EncodedInputStream<UTF16LE<>, FileReadStream> eis(bis); // wraps bis into eis
+
+Document d; // Document is GenericDocument<UTF8<> >
+d.ParseStream<0, UTF16LE<> >(eis); // Parses UTF-16LE file into UTF-8 in memory
+
+fclose(fp);
+~~~~~~~~~~
+
+## EncodedOutputStream {#EncodedOutputStream}
+
+`EncodedOutputStream` is similar but it has a `bool putBOM` parameter in the constructor, controlling whether to write BOM into output byte stream.
+
+~~~~~~~~~~cpp
+#include "rapidjson/filewritestream.h" // FileWriteStream
+#include "rapidjson/encodedstream.h" // EncodedOutputStream
+#include <cstdio>
+
+Document d; // Document is GenericDocument<UTF8<> >
+// ...
+
+FILE* fp = fopen("output_utf32le.json", "wb"); // non-Windows use "w"
+
+char writeBuffer[256];
+FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
+
+typedef EncodedOutputStream<UTF32LE<>, FileWriteStream> OutputStream;
+OutputStream eos(bos, true); // Write BOM
+
+Writer<OutputStream, UTF32LE<>, UTF8<>> writer(eos);
+d.Accept(writer); // This generates UTF32-LE file from UTF-8 in memory
+
+fclose(fp);
+~~~~~~~~~~
+
+## AutoUTFInputStream {#AutoUTFInputStream}
+
+Sometimes an application may want to handle all supported JSON encoding. `AutoUTFInputStream` will detection encoding by BOM first. If BOM is unavailable, it will use characteristics of valid JSON to make detection. If neither method success, it falls back to the UTF type provided in constructor.
+
+Since the characters (code units) may be 8-bit, 16-bit or 32-bit. `AutoUTFInputStream` requires a character type which can hold at least 32-bit. We may use `unsigned`, as in the template parameter:
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+#include "rapidjson/filereadstream.h" // FileReadStream
+#include "rapidjson/encodedstream.h" // AutoUTFInputStream
+#include <cstdio>
+
+using namespace rapidjson;
+
+FILE* fp = fopen("any.json", "rb"); // non-Windows use "r"
+
+char readBuffer[256];
+FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
+
+AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // wraps bis into eis
+
+Document d; // Document is GenericDocument<UTF8<> >
+d.ParseStream<0, AutoUTF<unsigned> >(eis); // This parses any UTF file into UTF-8 in memory
+
+fclose(fp);
+~~~~~~~~~~
+
+When specifying the encoding of stream, uses `AutoUTF<CharType>` as in `ParseStream()` above.
+
+You can obtain the type of UTF via `UTFType GetType()`. And check whether a BOM is found by `HasBOM()`
+
+## AutoUTFOutputStream {#AutoUTFOutputStream}
+
+Similarly, to choose encoding for output during runtime, we can use `AutoUTFOutputStream`. This class is not automatic *per se*. You need to specify the UTF type and whether to write BOM in runtime.
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+
+void WriteJSONFile(FILE* fp, UTFType type, bool putBOM, const Document& d) {
+ char writeBuffer[256];
+ FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
+
+ typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream;
+ OutputStream eos(bos, type, putBOM);
+
+ Writer<OutputStream, UTF8<>, AutoUTF<> > writer;
+ d.Accept(writer);
+}
+~~~~~~~~~~
+
+`AutoUTFInputStream` and `AutoUTFOutputStream` is more convenient than `EncodedInputStream` and `EncodedOutputStream`. They just incur a little bit runtime overheads.
+
+# Custom Stream {#CustomStream}
+
+In addition to memory/file streams, user can create their own stream classes which fits RapidJSON's API. For example, you may create network stream, stream from compressed file, etc.
+
+RapidJSON combines different types using templates. A class containing all required interface can be a stream. The Stream interface is defined in comments of `rapidjson/rapidjson.h`:
+
+~~~~~~~~~~cpp
+concept Stream {
+ typename Ch; //!< Character type of the stream.
+
+ //! Read the current character from stream without moving the read cursor.
+ Ch Peek() const;
+
+ //! Read the current character from stream and moving the read cursor to next character.
+ Ch Take();
+
+ //! Get the current read cursor.
+ //! \return Number of characters read from start.
+ size_t Tell();
+
+ //! Begin writing operation at the current read pointer.
+ //! \return The begin writer pointer.
+ Ch* PutBegin();
+
+ //! Write a character.
+ void Put(Ch c);
+
+ //! Flush the buffer.
+ void Flush();
+
+ //! End the writing operation.
+ //! \param begin The begin write pointer returned by PutBegin().
+ //! \return Number of characters written.
+ size_t PutEnd(Ch* begin);
+}
+~~~~~~~~~~
+
+For input stream, they must implement `Peek()`, `Take()` and `Tell()`.
+For output stream, they must implement `Put()` and `Flush()`.
+There are two special interface, `PutBegin()` and `PutEnd()`, which are only for *in situ* parsing. Normal streams do not implement them. However, if the interface is not needed for a particular stream, it is still need to a dummy implementation, otherwise will generate compilation error.
+
+## Example: istream wrapper {#ExampleIStreamWrapper}
+
+The following example is a simple wrapper of `std::istream`, which only implements 3 functions.
+
+~~~~~~~~~~cpp
+class MyIStreamWrapper {
+public:
+ typedef char Ch;
+
+ MyIStreamWrapper(std::istream& is) : is_(is) {
+ }
+
+ Ch Peek() const { // 1
+ int c = is_.peek();
+ return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
+ }
+
+ Ch Take() { // 2
+ int c = is_.get();
+ return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
+ }
+
+ size_t Tell() const { return (size_t)is_.tellg(); } // 3
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch) { assert(false); }
+ void Flush() { assert(false); }
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ MyIStreamWrapper(const MyIStreamWrapper&);
+ MyIStreamWrapper& operator=(const MyIStreamWrapper&);
+
+ std::istream& is_;
+};
+~~~~~~~~~~
+
+User can use it to wrap instances of `std::stringstream`, `std::ifstream`.
+
+~~~~~~~~~~cpp
+const char* json = "[1,2,3,4]";
+std::stringstream ss(json);
+MyIStreamWrapper is(ss);
+
+Document d;
+d.ParseStream(is);
+~~~~~~~~~~
+
+Note that, this implementation may not be as efficient as RapidJSON's memory or file streams, due to internal overheads of the standard library.
+
+## Example: ostream wrapper {#ExampleOStreamWrapper}
+
+The following example is a simple wrapper of `std::istream`, which only implements 2 functions.
+
+~~~~~~~~~~cpp
+class MyOStreamWrapper {
+public:
+ typedef char Ch;
+
+ MyOStreamWrapper(std::ostream& os) : os_(os) {
+ }
+
+ Ch Peek() const { assert(false); return '\0'; }
+ Ch Take() { assert(false); return '\0'; }
+ size_t Tell() const { }
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch c) { os_.put(c); } // 1
+ void Flush() { os_.flush(); } // 2
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ MyOStreamWrapper(const MyOStreamWrapper&);
+ MyOStreamWrapper& operator=(const MyOStreamWrapper&);
+
+ std::ostream& os_;
+};
+~~~~~~~~~~
+
+User can use it to wrap instances of `std::stringstream`, `std::ofstream`.
+
+~~~~~~~~~~cpp
+Document d;
+// ...
+
+std::stringstream ss;
+MyOStreamWrapper os(ss);
+
+Writer<MyOStreamWrapper> writer(os);
+d.Accept(writer);
+~~~~~~~~~~
+
+Note that, this implementation may not be as efficient as RapidJSON's memory or file streams, due to internal overheads of the standard library.
+
+# Summary {#Summary}
+
+This section describes stream classes available in RapidJSON. Memory streams are simple. File stream can reduce the memory required during JSON parsing and generation, if the JSON is stored in file system. Encoded streams converts between byte streams and character streams. Finally, user may create custom streams using a simple interface.
diff --git a/3rdparty/rapidjson/doc/stream.zh-cn.md b/3rdparty/rapidjson/doc/stream.zh-cn.md
new file mode 100644
index 00000000000..5cc9c0d939b
--- /dev/null
+++ b/3rdparty/rapidjson/doc/stream.zh-cn.md
@@ -0,0 +1,426 @@
+# æµ
+
+在RapidJSON中,`rapidjson::Stream`是用於读写JSON的概念(概念是指C++çš„concept)。在这里我们先介ç»å¦‚何使用RapidJSONæä¾›çš„å„ç§æµã€‚ç„¶åŽå†çœ‹çœ‹å¦‚何自行定义æµã€‚
+
+[TOC]
+
+# å†…å­˜æµ {#MemoryStreams}
+
+å†…å­˜æµæŠŠJSON存储在内存之中。
+
+## StringStream(输入){#StringStream}
+
+`StringStream`是最基本的输入æµï¼Œå®ƒè¡¨ç¤ºä¸€ä¸ªå®Œæ•´çš„ã€åªè¯»çš„ã€å­˜å‚¨äºŽå†…存的JSON。它在`rapidjson/rapidjson.h`中定义。
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h" // ä¼šåŒ…å« "rapidjson/rapidjson.h"
+
+using namespace rapidjson;
+
+// ...
+const char json[] = "[1, 2, 3, 4]";
+StringStream s(json);
+
+Document d;
+d.ParseStream(s);
+~~~~~~~~~~
+
+由于这是éžå¸¸å¸¸ç”¨çš„用法,RapidJSONæä¾›`Document::Parse(const char*)`去åšå®Œå…¨ç›¸åŒçš„事情:
+
+~~~~~~~~~~cpp
+// ...
+const char json[] = "[1, 2, 3, 4]";
+Document d;
+d.Parse(json);
+~~~~~~~~~~
+
+éœ€è¦æ³¨æ„,`StringStream`是`GenericStringStream<UTF8<> >`çš„typedef,使用者å¯ç”¨å…¶ä»–ç¼–ç ç±»åŽ»ä»£è¡¨æµæ‰€ä½¿ç”¨çš„字符集。
+
+## StringBuffer(输出){#StringBuffer}
+
+`StringBuffer`是一个简å•的输出æµã€‚它分é…一个内存缓冲区,供写入整个JSON。å¯ä½¿ç”¨`GetString()`æ¥èŽ·å–该缓冲区。
+
+~~~~~~~~~~cpp
+#include "rapidjson/stringbuffer.h"
+
+StringBuffer buffer;
+Writer<StringBuffer> writer(buffer);
+d.Accept(writer);
+
+const char* output = buffer.GetString();
+~~~~~~~~~~
+
+当缓冲区满溢,它将自动增加容é‡ã€‚缺çœå®¹é‡æ˜¯256个字符(UTF8是256字节,UTF16是512字节等)。使用者能自行æä¾›åˆ†é…器åŠåˆå§‹å®¹é‡ã€‚
+
+~~~~~~~~~~cpp
+StringBuffer buffer1(0, 1024); // 使用它的分é…器,åˆå§‹å¤§å° = 1024
+StringBuffer buffer2(allocator, 1024);
+~~~~~~~~~~
+
+如无设置分é…器,`StringBuffer`会自行实例化一个内部分é…器。
+
+相似地,`StringBuffer`是`GenericStringBuffer<UTF8<> >`的typedef。
+
+# æ–‡ä»¶æµ {#FileStreams}
+
+当è¦ä»Žæ–‡ä»¶è§£æžä¸€ä¸ªJSON,你å¯ä»¥æŠŠæ•´ä¸ªJSON读入内存并使用上述的`StringStream`。
+
+然而,若JSON很大,或是内存有é™ï¼Œä½ å¯ä»¥æ”¹ç”¨`FileReadStream`。它åªä¼šä»Žæ–‡ä»¶è¯»å–一部分至缓冲区,然åŽè®©é‚£éƒ¨åˆ†è¢«è§£æžã€‚若缓冲区的字符都被读完,它会å†ä»Žæ–‡ä»¶è¯»å–下一部分。
+
+## FileReadStream(输入) {#FileReadStream}
+
+`FileReadStream`通过`FILE`æŒ‡é’ˆè¯»å–æ–‡ä»¶ã€‚ä½¿ç”¨è€…éœ€è¦æä¾›ä¸€ä¸ªç¼“å†²åŒºã€‚
+
+~~~~~~~~~~cpp
+#include "rapidjson/filereadstream.h"
+#include <cstdio>
+
+using namespace rapidjson;
+
+FILE* fp = fopen("big.json", "rb"); // éžWindowså¹³å°ä½¿ç”¨"r"
+
+char readBuffer[65536];
+FileReadStream is(fp, readBuffer, sizeof(readBuffer));
+
+Document d;
+d.ParseStream(is);
+
+fclose(fp);
+~~~~~~~~~~
+
+与`StringStreams`ä¸ä¸€æ ·ï¼Œ`FileReadStream`是一个字节æµã€‚它ä¸å¤„ç†ç¼–ç ã€‚若文件并éžUTF-8ç¼–ç ï¼Œå¯ä»¥æŠŠå­—节æµç”¨`EncodedInputStream`包装。我们很快会讨论这个问题。
+
+é™¤äº†è¯»å–æ–‡ä»¶ï¼Œä½¿ç”¨è€…也å¯ä»¥ä½¿ç”¨`FileReadStream`æ¥è¯»å–`stdin`。
+
+## FileWriteStream(输出){#FileWriteStream}
+
+`FileWriteStream`是一个å«ç¼“冲功能的输出æµã€‚它的用法与`FileReadStream`éžå¸¸ç›¸ä¼¼ã€‚
+
+~~~~~~~~~~cpp
+#include "rapidjson/filewritestream.h"
+#include <cstdio>
+
+using namespace rapidjson;
+
+Document d;
+d.Parse(json);
+// ...
+
+FILE* fp = fopen("output.json", "wb"); // éžWindowså¹³å°ä½¿ç”¨"w"
+
+char writeBuffer[65536];
+FileWriteStream os(fp, writeBuffer, sizeof(writeBuffer));
+
+Writer<FileWriteStream> writer(os);
+d.Accept(writer);
+
+fclose(fp);
+~~~~~~~~~~
+
+它也å¯ä»¥æŠŠè¾“出导å‘`stdout`。
+
+# iostream 包装类 {#iostreamWrapper}
+
+åŸºäºŽç”¨æˆ·çš„è¦æ±‚,RapidJSONæä¾›äº†æ­£å¼çš„ `std::basic_istream` å’Œ `std::basic_ostream` 包装类。然而,请注æ„其性能会大大低于以上的其他æµã€‚
+
+## IStreamWrapper {#IStreamWrapper}
+
+`IStreamWrapper` 把任何继承自 `std::istream` 的类(如 `std::istringstream`ã€`std::stringstream`ã€`std::ifstream`ã€`std::fstream`ï¼‰åŒ…è£…æˆ RapidJSON 的输入æµã€‚
+
+~~~cpp
+#include <rapidjson/document.h>
+#include <rapidjson/istreamwrapper.h>
+#include <fstream>
+
+using namespace rapidjson;
+using namespace std;
+
+ifstream ifs("test.json");
+IStreamWrapper isw(ifs);
+
+Document d;
+d.ParseStream(isw);
+~~~
+
+对于继承自 `std::wistream` 的类,则使用 `WIStreamWrapper`。
+
+## OStreamWrapper {#OStreamWrapper}
+
+相似地,`OStreamWrapper` 把任何继承自 `std::ostream` 的类(如 `std::ostringstream`ã€`std::stringstream`ã€`std::ofstream`ã€`std::fstream`ï¼‰åŒ…è£…æˆ RapidJSON 的输出æµã€‚
+
+~~~cpp
+#include <rapidjson/document.h>
+#include <rapidjson/ostreamwrapper.h>
+#include <rapidjson/writer.h>
+#include <fstream>
+
+using namespace rapidjson;
+using namespace std;
+
+Document d;
+d.Parse(json);
+
+// ...
+
+ofstream ofs("output.json");
+OStreamWrapper osw(ofs);
+
+Writer<OStreamWrapper> writer(osw);
+d.Accept(writer);
+~~~
+
+对于继承自 `std::wistream` 的类,则使用 `WIStreamWrapper`。
+
+# ç¼–ç æµ {#EncodedStreams}
+
+ç¼–ç æµï¼ˆencoded streams)本身ä¸å­˜å‚¨JSONï¼Œå®ƒä»¬æ˜¯é€šè¿‡åŒ…è£…å­—èŠ‚æµæ¥æä¾›åŸºæœ¬çš„ç¼–ç ï¼è§£ç åŠŸèƒ½ã€‚
+
+如上所述,我们å¯ä»¥ç›´æŽ¥è¯»å…¥UTF-8字节æµã€‚然而,UTF-16åŠUTF-32有字节åºï¼ˆendianï¼‰é—®é¢˜ã€‚è¦æ­£ç¡®åœ°å¤„ç†å­—节åºï¼Œéœ€è¦åœ¨è¯»å–æ—¶æŠŠå­—èŠ‚è½¬æ¢æˆå­—符(如对UTF-16使用`wchar_t`),以åŠåœ¨å†™å…¥æ—¶æŠŠå­—符转æ¢ä¸ºå­—节。
+
+除此以外,我们也需è¦å¤„ç†[å­—èŠ‚é¡ºåºæ ‡è®°ï¼ˆbyte order mark, BOM)](http://en.wikipedia.org/wiki/Byte_order_mark)。当从一个字节æµè¯»å–æ—¶ï¼Œéœ€è¦æ£€æµ‹BOM,或者仅仅是把存在的BOM消去。当把JSONå†™å…¥å­—èŠ‚æµæ—¶ï¼Œä¹Ÿå¯é€‰æ‹©å†™å…¥BOM。
+
+若一个æµçš„ç¼–ç åœ¨ç¼–译期已知,你å¯ä½¿ç”¨`EncodedInputStream`åŠ`EncodedOutputStream`。若一个æµå¯èƒ½å­˜å‚¨UTF-8ã€UTF-16LEã€UTF-16BEã€UTF-32LEã€UTF-32BEçš„JSON,并且编ç åªèƒ½åœ¨è¿è¡Œæ—¶å¾—知,你便å¯ä»¥ä½¿ç”¨`AutoUTFInputStream`åŠ`AutoUTFOutputStream`。这些æµå®šä¹‰åœ¨`rapidjson/encodedstream.h`。
+
+注æ„åˆ°ï¼Œè¿™äº›ç¼–ç æµå¯ä»¥æ–½äºŽæ–‡ä»¶ä»¥å¤–çš„æµã€‚例如,你å¯ä»¥ç”¨ç¼–ç æµåŒ…装内存中的文件或自定义的字节æµã€‚
+
+## EncodedInputStream {#EncodedInputStream}
+
+`EncodedInputStream`å«ä¸¤ä¸ªæ¨¡æ¿å‚数。第一个是`Encoding`类型,例如定义于`rapidjson/encodings.h`çš„`UTF8`ã€`UTF16LE`ã€‚ç¬¬äºŒä¸ªå‚æ•°æ˜¯è¢«åŒ…装的æµçš„类型。
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+#include "rapidjson/filereadstream.h" // FileReadStream
+#include "rapidjson/encodedstream.h" // EncodedInputStream
+#include <cstdio>
+
+using namespace rapidjson;
+
+FILE* fp = fopen("utf16le.json", "rb"); // éžWindowså¹³å°ä½¿ç”¨"r"
+
+char readBuffer[256];
+FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
+
+EncodedInputStream<UTF16LE<>, FileReadStream> eis(bis); // 用eis包装bis
+
+Document d; // Document为GenericDocument<UTF8<> >
+d.ParseStream<0, UTF16LE<> >(eis); // 把UTF-16LE文件解æžè‡³å†…存中的UTF-8
+
+fclose(fp);
+~~~~~~~~~~
+
+## EncodedOutputStream {#EncodedOutputStream}
+
+`EncodedOutputStream`也是相似的,但它的构造函数有一个`bool putBOM`傿•°ï¼Œç”¨äºŽæŽ§åˆ¶æ˜¯å¦åœ¨è¾“出字节æµå†™å…¥BOM。
+
+~~~~~~~~~~cpp
+#include "rapidjson/filewritestream.h" // FileWriteStream
+#include "rapidjson/encodedstream.h" // EncodedOutputStream
+#include <cstdio>
+
+Document d; // Document为GenericDocument<UTF8<> >
+// ...
+
+FILE* fp = fopen("output_utf32le.json", "wb"); // éžWindowså¹³å°ä½¿ç”¨"w"
+
+char writeBuffer[256];
+FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
+
+typedef EncodedOutputStream<UTF32LE<>, FileWriteStream> OutputStream;
+OutputStream eos(bos, true); // 写入BOM
+
+Writer<OutputStream, UTF32LE<>, UTF8<>> writer(eos);
+d.Accept(writer); // 这里从内存的UTF-8生æˆUTF32-LE文件
+
+fclose(fp);
+~~~~~~~~~~
+
+## AutoUTFInputStream {#AutoUTFInputStream}
+
+有时候,应用软件å¯èƒ½éœ€è¦ã²ƒç†æ‰€æœ‰å¯æ”¯æŒçš„JSONç¼–ç ã€‚`AutoUTFInputStream`会先使用BOMæ¥æ£€æµ‹ç¼–ç ã€‚è‹¥BOMä¸å­˜åœ¨ï¼Œå®ƒä¾¿ä¼šä½¿ç”¨åˆæ³•JSONçš„ç‰¹æ€§æ¥æ£€æµ‹ã€‚è‹¥ä¸¤ç§æ–¹æ³•都失败,它就会倒退至构造函数æä¾›çš„UTF类型。
+
+由于字符(编ç å•å…ƒï¼code unit)å¯èƒ½æ˜¯8ä½ã€16使ˆ–32ä½ï¼Œ`AutoUTFInputStream` 需è¦ä¸€ä¸ªèƒ½è‡³å°‘储存32ä½çš„字符类型。我们å¯ä»¥ä½¿ç”¨`unsigned`作为模æ¿å‚数:
+
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+#include "rapidjson/filereadstream.h" // FileReadStream
+#include "rapidjson/encodedstream.h" // AutoUTFInputStream
+#include <cstdio>
+
+using namespace rapidjson;
+
+FILE* fp = fopen("any.json", "rb"); // éžWindowså¹³å°ä½¿ç”¨"r"
+
+char readBuffer[256];
+FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
+
+AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // 用eis包装bis
+
+Document d; // Document为GenericDocument<UTF8<> >
+d.ParseStream<0, AutoUTF<unsigned> >(eis); // 把任何UTFç¼–ç çš„æ–‡ä»¶è§£æžè‡³å†…存中的UTF-8
+
+fclose(fp);
+~~~~~~~~~~
+
+å½“è¦æŒ‡å®šæµçš„ç¼–ç ï¼Œå¯ä½¿ç”¨ä¸Šé¢ä¾‹å­ä¸­`ParseStream()`çš„å‚æ•°`AutoUTF<CharType>`。
+
+ä½ å¯ä»¥ä½¿ç”¨`UTFType GetType()`去获å–UTF类型,并且用`HasBOM()`æ£€æµ‹è¾“å…¥æµæ˜¯å¦å«æœ‰BOM。
+
+## AutoUTFOutputStream {#AutoUTFOutputStream}
+
+相似地,è¦åœ¨è¿è¡Œæ—¶é€‰æ‹©è¾“出的编ç ï¼Œæˆ‘们å¯ä½¿ç”¨`AutoUTFOutputStream`。这个类本身并éžã€Œè‡ªåЍã€ã€‚你需è¦åœ¨è¿è¡Œæ—¶æŒ‡å®šUTFç±»åž‹ï¼Œä»¥åŠæ˜¯å¦å†™å…¥BOM。
+
+~~~~~~~~~~cpp
+using namespace rapidjson;
+
+void WriteJSONFile(FILE* fp, UTFType type, bool putBOM, const Document& d) {
+ char writeBuffer[256];
+ FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
+
+ typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream;
+ OutputStream eos(bos, type, putBOM);
+
+ Writer<OutputStream, UTF8<>, AutoUTF<> > writer;
+ d.Accept(writer);
+}
+~~~~~~~~~~
+
+`AutoUTFInputStream`ï¼`AutoUTFOutputStream`是比`EncodedInputStream`ï¼`EncodedOutputStream`方便。但å‰è€…会产生一点è¿è¡ŒæœŸé¢å¤–开销。
+
+# è‡ªå®šä¹‰æµ {#CustomStream}
+
+é™¤äº†å†…å­˜ï¼æ–‡ä»¶æµï¼Œä½¿ç”¨è€…å¯åˆ›å»ºè‡ªè¡Œå®šä¹‰é€‚é…RapidJSON APIçš„æµç±»ã€‚例如,你å¯ä»¥åˆ›å»ºç½‘络æµã€ä»ŽåŽ‹ç¼©æ–‡ä»¶è¯»å–çš„æµç­‰ç­‰ã€‚
+
+RapidJSON利用模æ¿ç»“åˆä¸åŒçš„类型。åªè¦ä¸€ä¸ªç±»åŒ…嫿‰€æœ‰æ‰€éœ€çš„æŽ¥å£ï¼Œå°±å¯ä»¥ä½œä¸ºä¸€ä¸ªæµã€‚æµçš„æŽ¥åˆå®šä¹‰åœ¨`rapidjson/rapidjson.h`的注释里:
+
+~~~~~~~~~~cpp
+concept Stream {
+ typename Ch; //!< æµçš„字符类型
+
+ //! 从æµè¯»å–当å‰å­—符,ä¸ç§»åŠ¨è¯»å–æŒ‡é’ˆï¼ˆread cursor)
+ Ch Peek() const;
+
+ //! 从æµè¯»å–当å‰å­—ç¬¦ï¼Œç§»åŠ¨è¯»å–æŒ‡é’ˆè‡³ä¸‹ä¸€å­—符。
+ Ch Take();
+
+ //! 获å–è¯»å–æŒ‡é’ˆã€‚
+ //! \return ä»Žå¼€å§‹ä»¥æ¥æ‰€è¯»è¿‡çš„字符数é‡ã€‚
+ size_t Tell();
+
+ //! 从当å‰è¯»å–指针开始写入æ“作。
+ //! \return 返回开始写入的指针。
+ Ch* PutBegin();
+
+ //! 写入一个字符。
+ void Put(Ch c);
+
+ //! 清空缓冲区。
+ void Flush();
+
+ //! 完æˆå†™ä½œæ“作。
+ //! \param begin PutBegin()返回的开始写入指针。
+ //! \return 已写入的字符数é‡ã€‚
+ size_t PutEnd(Ch* begin);
+}
+~~~~~~~~~~
+
+输入æµå¿…须实现`Peek()`ã€`Take()`åŠ`Tell()`。
+输出æµå¿…须实现`Put()`åŠ`Flush()`。
+`PutBegin()`åŠ`PutEnd()`是特殊的接å£ï¼Œä»…用于原ä½ï¼ˆ*in situ*)解æžã€‚一般的æµä¸éœ€å®žçŽ°å®ƒä»¬ã€‚ç„¶è€Œï¼Œå³ä½¿æŽ¥å£ä¸éœ€ç”¨äºŽæŸäº›æµï¼Œä»ç„¶éœ€è¦æä¾›ç©ºå®žçŽ°ï¼Œå¦åˆ™ä¼šäº§ç”Ÿç¼–译错误。
+
+## 例å­ï¼šistream的包装类 {#ExampleIStreamWrapper}
+
+以下的简å•例孿˜¯`std::istream`的包装类,它åªéœ€çް3个函数。
+
+~~~~~~~~~~cpp
+class MyIStreamWrapper {
+public:
+ typedef char Ch;
+
+ MyIStreamWrapper(std::istream& is) : is_(is) {
+ }
+
+ Ch Peek() const { // 1
+ int c = is_.peek();
+ return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
+ }
+
+ Ch Take() { // 2
+ int c = is_.get();
+ return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
+ }
+
+ size_t Tell() const { return (size_t)is_.tellg(); } // 3
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch) { assert(false); }
+ void Flush() { assert(false); }
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ MyIStreamWrapper(const MyIStreamWrapper&);
+ MyIStreamWrapper& operator=(const MyIStreamWrapper&);
+
+ std::istream& is_;
+};
+~~~~~~~~~~
+
+使用者能用它æ¥åŒ…装`std::stringstream`ã€`std::ifstream`的实例。
+
+~~~~~~~~~~cpp
+const char* json = "[1,2,3,4]";
+std::stringstream ss(json);
+MyIStreamWrapper is(ss);
+
+Document d;
+d.ParseStream(is);
+~~~~~~~~~~
+
+ä½†è¦æ³¨æ„,由于标准库的内部开销问,此实现的性能å¯èƒ½ä¸å¦‚RapidJSONçš„å†…å­˜ï¼æ–‡ä»¶æµã€‚
+
+## 例å­ï¼šostream的包装类 {#ExampleOStreamWrapper}
+
+ä»¥ä¸‹çš„ä¾‹å­æ˜¯`std::istream`的包装类,它åªéœ€å®žçް2个函数。
+
+~~~~~~~~~~cpp
+class MyOStreamWrapper {
+public:
+ typedef char Ch;
+
+ OStreamWrapper(std::ostream& os) : os_(os) {
+ }
+
+ Ch Peek() const { assert(false); return '\0'; }
+ Ch Take() { assert(false); return '\0'; }
+ size_t Tell() const { }
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch c) { os_.put(c); } // 1
+ void Flush() { os_.flush(); } // 2
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ MyOStreamWrapper(const MyOStreamWrapper&);
+ MyOStreamWrapper& operator=(const MyOStreamWrapper&);
+
+ std::ostream& os_;
+};
+~~~~~~~~~~
+
+使用者能用它æ¥åŒ…装`std::stringstream`ã€`std::ofstream`的实例。
+
+~~~~~~~~~~cpp
+Document d;
+// ...
+
+std::stringstream ss;
+MyOStreamWrapper os(ss);
+
+Writer<MyOStreamWrapper> writer(os);
+d.Accept(writer);
+~~~~~~~~~~
+
+ä½†è¦æ³¨æ„,由于标准库的内部开销问,此实现的性能å¯èƒ½ä¸å¦‚RapidJSONçš„å†…å­˜ï¼æ–‡ä»¶æµã€‚
+
+# 总结 {#Summary}
+
+本节æè¿°äº†RapidJSONæä¾›çš„å„ç§æµçš„类。内存æµå¾ˆç®€å•。若JSON存储在文件中,文件æµå¯å‡å°‘JSONè§£æžåŠç”Ÿæˆæ‰€éœ€çš„内存é‡ã€‚ç¼–ç æµåœ¨å­—节æµå’Œå­—符æµä¹‹é—´ä½œè½¬æ¢ã€‚最åŽï¼Œä½¿ç”¨è€…å¯ä½¿ç”¨ä¸€ä¸ªç®€å•接å£åˆ›å»ºè‡ªå®šä¹‰çš„æµã€‚
diff --git a/3rdparty/rapidjson/doc/tutorial.md b/3rdparty/rapidjson/doc/tutorial.md
new file mode 100644
index 00000000000..121102345b4
--- /dev/null
+++ b/3rdparty/rapidjson/doc/tutorial.md
@@ -0,0 +1,517 @@
+# Tutorial
+
+This tutorial introduces the basics of the Document Object Model(DOM) API.
+
+As shown in [Usage at a glance](@ref index), a JSON can be parsed into DOM, and then the DOM can be queried and modified easily, and finally be converted back to JSON.
+
+[TOC]
+
+# Value & Document {#ValueDocument}
+
+Each JSON value is stored in a type called `Value`. A `Document`, representing the DOM, contains the root `Value` of the DOM tree. All public types and functions of RapidJSON are defined in the `rapidjson` namespace.
+
+# Query Value {#QueryValue}
+
+In this section, we will use excerpt of `example/tutorial/tutorial.cpp`.
+
+Assumes we have a JSON stored in a C string (`const char* json`):
+~~~~~~~~~~js
+{
+ "hello": "world",
+ "t": true ,
+ "f": false,
+ "n": null,
+ "i": 123,
+ "pi": 3.1416,
+ "a": [1, 2, 3, 4]
+}
+~~~~~~~~~~
+
+Parse it into a `Document`:
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+
+using namespace rapidjson;
+
+// ...
+Document document;
+document.Parse(json);
+~~~~~~~~~~
+
+The JSON is now parsed into `document` as a *DOM tree*:
+
+![DOM in the tutorial](diagram/tutorial.png)
+
+Since the update to RFC 7159, the root of a conforming JSON document can be any JSON value. In earlier RFC 4627, only objects or arrays were allowed as root values. In this case, the root is an object.
+~~~~~~~~~~cpp
+assert(document.IsObject());
+~~~~~~~~~~
+
+Let's query whether a `"hello"` member exists in the root object. Since a `Value` can contain different types of value, we may need to verify its type and use suitable API to obtain the value. In this example, `"hello"` member associates with a JSON string.
+~~~~~~~~~~cpp
+assert(document.HasMember("hello"));
+assert(document["hello"].IsString());
+printf("hello = %s\n", document["hello"].GetString());
+~~~~~~~~~~
+
+~~~~~~~~~~
+world
+~~~~~~~~~~
+
+JSON true/false values are represented as `bool`.
+~~~~~~~~~~cpp
+assert(document["t"].IsBool());
+printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
+~~~~~~~~~~
+
+~~~~~~~~~~
+true
+~~~~~~~~~~
+
+JSON null can be queryed by `IsNull()`.
+~~~~~~~~~~cpp
+printf("n = %s\n", document["n"].IsNull() ? "null" : "?");
+~~~~~~~~~~
+
+~~~~~~~~~~
+null
+~~~~~~~~~~
+
+JSON number type represents all numeric values. However, C++ needs more specific type for manipulation.
+
+~~~~~~~~~~cpp
+assert(document["i"].IsNumber());
+
+// In this case, IsUint()/IsInt64()/IsUInt64() also return true.
+assert(document["i"].IsInt());
+printf("i = %d\n", document["i"].GetInt());
+// Alternative (int)document["i"]
+
+assert(document["pi"].IsNumber());
+assert(document["pi"].IsDouble());
+printf("pi = %g\n", document["pi"].GetDouble());
+~~~~~~~~~~
+
+~~~~~~~~~~
+i = 123
+pi = 3.1416
+~~~~~~~~~~
+
+JSON array contains a number of elements.
+~~~~~~~~~~cpp
+// Using a reference for consecutive access is handy and faster.
+const Value& a = document["a"];
+assert(a.IsArray());
+for (SizeType i = 0; i < a.Size(); i++) // Uses SizeType instead of size_t
+ printf("a[%d] = %d\n", i, a[i].GetInt());
+~~~~~~~~~~
+
+~~~~~~~~~~
+a[0] = 1
+a[1] = 2
+a[2] = 3
+a[3] = 4
+~~~~~~~~~~
+
+Note that, RapidJSON does not automatically convert values between JSON types. If a value is a string, it is invalid to call `GetInt()`, for example. In debug mode it will fail an assertion. In release mode, the behavior is undefined.
+
+In the following, details about querying individual types are discussed.
+
+## Query Array {#QueryArray}
+
+By default, `SizeType` is typedef of `unsigned`. In most systems, array is limited to store up to 2^32-1 elements.
+
+You may access the elements in array by integer literal, for example, `a[0]`, `a[1]`, `a[2]`.
+
+Array is similar to `std::vector`, instead of using indices, you may also use iterator to access all the elements.
+~~~~~~~~~~cpp
+for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
+ printf("%d ", itr->GetInt());
+~~~~~~~~~~
+
+And other familiar query functions:
+* `SizeType Capacity() const`
+* `bool Empty() const`
+
+## Query Object {#QueryObject}
+
+Similar to array, we can access all object members by iterator:
+
+~~~~~~~~~~cpp
+static const char* kTypeNames[] =
+ { "Null", "False", "True", "Object", "Array", "String", "Number" };
+
+for (Value::ConstMemberIterator itr = document.MemberBegin();
+ itr != document.MemberEnd(); ++itr)
+{
+ printf("Type of member %s is %s\n",
+ itr->name.GetString(), kTypeNames[itr->value.GetType()]);
+}
+~~~~~~~~~~
+
+~~~~~~~~~~
+Type of member hello is String
+Type of member t is True
+Type of member f is False
+Type of member n is Null
+Type of member i is Number
+Type of member pi is Number
+Type of member a is Array
+~~~~~~~~~~
+
+Note that, when `operator[](const char*)` cannot find the member, it will fail an assertion.
+
+If we are unsure whether a member exists, we need to call `HasMember()` before calling `operator[](const char*)`. However, this incurs two lookup. A better way is to call `FindMember()`, which can check the existence of member and obtain its value at once:
+
+~~~~~~~~~~cpp
+Value::ConstMemberIterator itr = document.FindMember("hello");
+if (itr != document.MemberEnd())
+ printf("%s %s\n", itr->value.GetString());
+~~~~~~~~~~
+
+## Querying Number {#QueryNumber}
+
+JSON provide a single numerical type called Number. Number can be integer or real numbers. RFC 4627 says the range of Number is specified by parser.
+
+As C++ provides several integer and floating point number types, the DOM tries to handle these with widest possible range and good performance.
+
+When a Number is parsed, it is stored in the DOM as either one of the following type:
+
+Type | Description
+-----------|---------------------------------------
+`unsigned` | 32-bit unsigned integer
+`int` | 32-bit signed integer
+`uint64_t` | 64-bit unsigned integer
+`int64_t` | 64-bit signed integer
+`double` | 64-bit double precision floating point
+
+When querying a number, you can check whether the number can be obtained as target type:
+
+Checking | Obtaining
+------------------|---------------------
+`bool IsNumber()` | N/A
+`bool IsUint()` | `unsigned GetUint()`
+`bool IsInt()` | `int GetInt()`
+`bool IsUint64()` | `uint64_t GetUint64()`
+`bool IsInt64()` | `int64_t GetInt64()`
+`bool IsDouble()` | `double GetDouble()`
+
+Note that, an integer value may be obtained in various ways without conversion. For example, A value `x` containing 123 will make `x.IsInt() == x.IsUint() == x.IsInt64() == x.IsUint64() == true`. But a value `y` containing -3000000000 will only makes `x.IsInt64() == true`.
+
+When obtaining the numeric values, `GetDouble()` will convert internal integer representation to a `double`. Note that, `int` and `unsigned` can be safely convert to `double`, but `int64_t` and `uint64_t` may lose precision (since mantissa of `double` is only 52-bits).
+
+## Query String {#QueryString}
+
+In addition to `GetString()`, the `Value` class also contains `GetStringLength()`. Here explains why.
+
+According to RFC 4627, JSON strings can contain Unicode character `U+0000`, which must be escaped as `"\u0000"`. The problem is that, C/C++ often uses null-terminated string, which treats ``\0'` as the terminator symbol.
+
+To conform RFC 4627, RapidJSON supports string containing `U+0000`. If you need to handle this, you can use `GetStringLength()` API to obtain the correct length of string.
+
+For example, after parsing a the following JSON to `Document d`:
+
+~~~~~~~~~~js
+{ "s" : "a\u0000b" }
+~~~~~~~~~~
+The correct length of the value `"a\u0000b"` is 3. But `strlen()` returns 1.
+
+`GetStringLength()` can also improve performance, as user may often need to call `strlen()` for allocating buffer.
+
+Besides, `std::string` also support a constructor:
+
+~~~~~~~~~~cpp
+string(const char* s, size_t count);
+~~~~~~~~~~
+
+which accepts the length of string as parameter. This constructor supports storing null character within the string, and should also provide better performance.
+
+## Comparing values
+
+You can use `==` and `!=` to compare values. Two values are equal if and only if they are have same type and contents. You can also compare values with primitive types. Here is an example.
+
+~~~~~~~~~~cpp
+if (document["hello"] == document["n"]) /*...*/; // Compare values
+if (document["hello"] == "world") /*...*/; // Compare value with literal string
+if (document["i"] != 123) /*...*/; // Compare with integers
+if (document["pi"] != 3.14) /*...*/; // Compare with double.
+~~~~~~~~~~
+
+Array/object compares their elements/members in order. They are equal if and only if their whole subtrees are equal.
+
+Note that, currently if an object contains duplicated named member, comparing equality with any object is always `false`.
+
+# Create/Modify Values {#CreateModifyValues}
+
+There are several ways to create values. After a DOM tree is created and/or modified, it can be saved as JSON again using `Writer`.
+
+## Change Value Type {#ChangeValueType}
+When creating a Value or Document by default constructor, its type is Null. To change its type, call `SetXXX()` or assignment operator, for example:
+
+~~~~~~~~~~cpp
+Document d; // Null
+d.SetObject();
+
+Value v; // Null
+v.SetInt(10);
+v = 10; // Shortcut, same as above
+~~~~~~~~~~
+
+### Overloaded Constructors
+There are also overloaded constructors for several types:
+
+~~~~~~~~~~cpp
+Value b(true); // calls Value(bool)
+Value i(-123); // calls Value(int)
+Value u(123u); // calls Value(unsigned)
+Value d(1.5); // calls Value(double)
+~~~~~~~~~~
+
+To create empty object or array, you may use `SetObject()`/`SetArray()` after default constructor, or using the `Value(Type)` in one shot:
+
+~~~~~~~~~~cpp
+Value o(kObjectType);
+Value a(kArrayType);
+~~~~~~~~~~
+
+## Move Semantics {#MoveSemantics}
+
+A very special decision during design of RapidJSON is that, assignment of value does not copy the source value to destination value. Instead, the value from source is moved to the destination. For example,
+
+~~~~~~~~~~cpp
+Value a(123);
+Value b(456);
+b = a; // a becomes a Null value, b becomes number 123.
+~~~~~~~~~~
+
+![Assignment with move semantics.](diagram/move1.png)
+
+Why? What is the advantage of this semantics?
+
+The simple answer is performance. For fixed size JSON types (Number, True, False, Null), copying them is fast and easy. However, For variable size JSON types (String, Array, Object), copying them will incur a lot of overheads. And these overheads are often unnoticed. Especially when we need to create temporary object, copy it to another variable, and then destruct it.
+
+For example, if normal *copy* semantics was used:
+
+~~~~~~~~~~cpp
+Document d;
+Value o(kObjectType);
+{
+ Value contacts(kArrayType);
+ // adding elements to contacts array.
+ // ...
+ o.AddMember("contacts", contacts, d.GetAllocator()); // deep clone contacts (may be with lots of allocations)
+ // destruct contacts.
+}
+~~~~~~~~~~
+
+![Copy semantics makes a lots of copy operations.](diagram/move2.png)
+
+The object `o` needs to allocate a buffer of same size as contacts, makes a deep clone of it, and then finally contacts is destructed. This will incur a lot of unnecessary allocations/deallocations and memory copying.
+
+There are solutions to prevent actual copying these data, such as reference counting and garbage collection(GC).
+
+To make RapidJSON simple and fast, we chose to use *move* semantics for assignment. It is similar to `std::auto_ptr` which transfer ownership during assignment. Move is much faster and simpler, it just destructs the original value, `memcpy()` the source to destination, and finally sets the source as Null type.
+
+So, with move semantics, the above example becomes:
+
+~~~~~~~~~~cpp
+Document d;
+Value o(kObjectType);
+{
+ Value contacts(kArrayType);
+ // adding elements to contacts array.
+ o.AddMember("contacts", contacts, d.GetAllocator()); // just memcpy() of contacts itself to the value of new member (16 bytes)
+ // contacts became Null here. Its destruction is trivial.
+}
+~~~~~~~~~~
+
+![Move semantics makes no copying.](diagram/move3.png)
+
+This is called move assignment operator in C++11. As RapidJSON supports C++03, it adopts move semantics using assignment operator, and all other modifying function like `AddMember()`, `PushBack()`.
+
+### Move semantics and temporary values {#TemporaryValues}
+
+Sometimes, it is convenient to construct a Value in place, before passing it to one of the "moving" functions, like `PushBack()` or `AddMember()`. As temporary objects can't be converted to proper Value references, the convenience function `Move()` is available:
+
+~~~~~~~~~~cpp
+Value a(kArrayType);
+Document::AllocatorType& allocator = document.GetAllocator();
+// a.PushBack(Value(42), allocator); // will not compile
+a.PushBack(Value().SetInt(42), allocator); // fluent API
+a.PushBack(Value(42).Move(), allocator); // same as above
+~~~~~~~~~~
+
+## Create String {#CreateString}
+RapidJSON provide two strategies for storing string.
+
+1. copy-string: allocates a buffer, and then copy the source data into it.
+2. const-string: simply store a pointer of string.
+
+Copy-string is always safe because it owns a copy of the data. Const-string can be used for storing string literal, and in-situ parsing which we will mentioned in Document section.
+
+To make memory allocation customizable, RapidJSON requires user to pass an instance of allocator, whenever an operation may require allocation. This design is needed to prevent storing a allocator (or Document) pointer per Value.
+
+Therefore, when we assign a copy-string, we call this overloaded `SetString()` with allocator:
+
+~~~~~~~~~~cpp
+Document document;
+Value author;
+char buffer[10];
+int len = sprintf(buffer, "%s %s", "Milo", "Yip"); // dynamically created string.
+author.SetString(buffer, len, document.GetAllocator());
+memset(buffer, 0, sizeof(buffer));
+// author.GetString() still contains "Milo Yip" after buffer is destroyed
+~~~~~~~~~~
+
+In this example, we get the allocator from a `Document` instance. This is a common idiom when using RapidJSON. But you may use other instances of allocator.
+
+Besides, the above `SetString()` requires length. This can handle null characters within a string. There is another `SetString()` overloaded function without the length parameter. And it assumes the input is null-terminated and calls a `strlen()`-like function to obtain the length.
+
+Finally, for string literal or string with safe life-cycle can use const-string version of `SetString()`, which lacks allocator parameter. For string literals (or constant character arrays), simply passing the literal as parameter is safe and efficient:
+
+~~~~~~~~~~cpp
+Value s;
+s.SetString("rapidjson"); // can contain null character, length derived at compile time
+s = "rapidjson"; // shortcut, same as above
+~~~~~~~~~~
+
+For character pointer, the RapidJSON requires to mark it as safe before using it without copying. This can be achieved by using the `StringRef` function:
+
+~~~~~~~~~cpp
+const char * cstr = getenv("USER");
+size_t cstr_len = ...; // in case length is available
+Value s;
+// s.SetString(cstr); // will not compile
+s.SetString(StringRef(cstr)); // ok, assume safe lifetime, null-terminated
+s = StringRef(cstr); // shortcut, same as above
+s.SetString(StringRef(cstr,cstr_len)); // faster, can contain null character
+s = StringRef(cstr,cstr_len); // shortcut, same as above
+
+~~~~~~~~~
+
+## Modify Array {#ModifyArray}
+Value with array type provides similar APIs as `std::vector`.
+
+* `Clear()`
+* `Reserve(SizeType, Allocator&)`
+* `Value& PushBack(Value&, Allocator&)`
+* `template <typename T> GenericValue& PushBack(T, Allocator&)`
+* `Value& PopBack()`
+* `ValueIterator Erase(ConstValueIterator pos)`
+* `ValueIterator Erase(ConstValueIterator first, ConstValueIterator last)`
+
+Note that, `Reserve(...)` and `PushBack(...)` may allocate memory for the array elements, therefore require an allocator.
+
+Here is an example of `PushBack()`:
+
+~~~~~~~~~~cpp
+Value a(kArrayType);
+Document::AllocatorType& allocator = document.GetAllocator();
+
+for (int i = 5; i <= 10; i++)
+ a.PushBack(i, allocator); // allocator is needed for potential realloc().
+
+// Fluent interface
+a.PushBack("Lua", allocator).PushBack("Mio", allocator);
+~~~~~~~~~~
+
+Differs from STL, `PushBack()`/`PopBack()` returns the array reference itself. This is called _fluent interface_.
+
+If you want to add a non-constant string or a string without sufficient lifetime (see [Create String](#CreateString)) to the array, you need to create a string Value by using the copy-string API. To avoid the need for an intermediate variable, you can use a [temporary value](#TemporaryValues) in place:
+
+~~~~~~~~~~cpp
+// in-place Value parameter
+contact.PushBack(Value("copy", document.GetAllocator()).Move(), // copy string
+ document.GetAllocator());
+
+// explicit parameters
+Value val("key", document.GetAllocator()); // copy string
+contact.PushBack(val, document.GetAllocator());
+~~~~~~~~~~
+
+## Modify Object {#ModifyObject}
+Object is a collection of key-value pairs (members). Each key must be a string value. To modify an object, either add or remove members. THe following APIs are for adding members:
+
+* `Value& AddMember(Value&, Value&, Allocator& allocator)`
+* `Value& AddMember(StringRefType, Value&, Allocator&)`
+* `template <typename T> Value& AddMember(StringRefType, T value, Allocator&)`
+
+Here is an example.
+
+~~~~~~~~~~cpp
+Value contact(kObject);
+contact.AddMember("name", "Milo", document.GetAllocator());
+contact.AddMember("married", true, document.GetAllocator());
+~~~~~~~~~~
+
+The name parameter with `StringRefType` is similar to the interface of `SetString` function for string values. These overloads are used to avoid the need for copying the `name` string, as constant key names are very common in JSON objects.
+
+If you need to create a name from a non-constant string or a string without sufficient lifetime (see [Create String](#CreateString)), you need to create a string Value by using the copy-string API. To avoid the need for an intermediate variable, you can use a [temporary value](#TemporaryValues) in place:
+
+~~~~~~~~~~cpp
+// in-place Value parameter
+contact.AddMember(Value("copy", document.GetAllocator()).Move(), // copy string
+ Value().Move(), // null value
+ document.GetAllocator());
+
+// explicit parameters
+Value key("key", document.GetAllocator()); // copy string name
+Value val(42); // some value
+contact.AddMember(key, val, document.GetAllocator());
+~~~~~~~~~~
+
+For removing members, there are several choices:
+
+* `bool RemoveMember(const Ch* name)`: Remove a member by search its name (linear time complexity).
+* `bool RemoveMember(const Value& name)`: same as above but `name` is a Value.
+* `MemberIterator RemoveMember(MemberIterator)`: Remove a member by iterator (_constant_ time complexity).
+* `MemberIterator EraseMember(MemberIterator)`: similar to the above but it preserves order of members (linear time complexity).
+* `MemberIterator EraseMember(MemberIterator first, MemberIterator last)`: remove a range of members, preserves order (linear time complexity).
+
+`MemberIterator RemoveMember(MemberIterator)` uses a "move-last" trick to achieve constant time complexity. Basically the member at iterator is destructed, and then the last element is moved to that position. So the order of the remaining members are changed.
+
+## Deep Copy Value {#DeepCopyValue}
+If we really need to copy a DOM tree, we can use two APIs for deep copy: constructor with allocator, and `CopyFrom()`.
+
+~~~~~~~~~~cpp
+Document d;
+Document::AllocatorType& a = d.GetAllocator();
+Value v1("foo");
+// Value v2(v1); // not allowed
+
+Value v2(v1, a); // make a copy
+assert(v1.IsString()); // v1 untouched
+d.SetArray().PushBack(v1, a).PushBack(v2, a);
+assert(v1.IsNull() && v2.IsNull()); // both moved to d
+
+v2.CopyFrom(d, a); // copy whole document to v2
+assert(d.IsArray() && d.Size() == 2); // d untouched
+v1.SetObject().AddMember("array", v2, a);
+d.PushBack(v1, a);
+~~~~~~~~~~
+
+## Swap Values {#SwapValues}
+
+`Swap()` is also provided.
+
+~~~~~~~~~~cpp
+Value a(123);
+Value b("Hello");
+a.Swap(b);
+assert(a.IsString());
+assert(b.IsInt());
+~~~~~~~~~~
+
+Swapping two DOM trees is fast (constant time), despite the complexity of the trees.
+
+# What's next {#WhatsNext}
+
+This tutorial shows the basics of DOM tree query and manipulation. There are several important concepts in RapidJSON:
+
+1. [Streams](doc/stream.md) are channels for reading/writing JSON, which can be a in-memory string, or file stream, etc. User can also create their streams.
+2. [Encoding](doc/encoding.md) defines which character encoding is used in streams and memory. RapidJSON also provide Unicode conversion/validation internally.
+3. [DOM](doc/dom.md)'s basics are already covered in this tutorial. Uncover more advanced features such as *in situ* parsing, other parsing options and advanced usages.
+4. [SAX](doc/sax.md) is the foundation of parsing/generating facility in RapidJSON. Learn how to use `Reader`/`Writer` to implement even faster applications. Also try `PrettyWriter` to format the JSON.
+5. [Performance](doc/performance.md) shows some in-house and third-party benchmarks.
+6. [Internals](doc/internals.md) describes some internal designs and techniques of RapidJSON.
+
+You may also refer to the [FAQ](doc/faq.md), API documentation, examples and unit tests.
diff --git a/3rdparty/rapidjson/doc/tutorial.zh-cn.md b/3rdparty/rapidjson/doc/tutorial.zh-cn.md
new file mode 100644
index 00000000000..37808b08669
--- /dev/null
+++ b/3rdparty/rapidjson/doc/tutorial.zh-cn.md
@@ -0,0 +1,515 @@
+# 教程
+
+本教程简介文件对象模型(Document Object Model, DOM)API。
+
+如[用法一览](../readme.zh-cn.md#用法一览)中所示,å¯ä»¥è§£æžä¸€ä¸ªJSON至DOM,然åŽå°±å¯ä»¥è½»æ¾æŸ¥è¯¢åŠä¿®æ”¹DOM,并最终转æ¢å›žJSON。
+
+[TOC]
+
+# Value åŠ Document {#ValueDocument}
+
+æ¯ä¸ªJSON值都储存为`Value`类,而`Document`类则表示整个DOM,它存储了一个DOM树的根`Value`。RapidJSON的所有公开类型åŠå‡½æ•°éƒ½åœ¨`rapidjson`命å空间中。
+
+# 查询Value {#QueryValue}
+
+在本节中,我们会使用到`example/tutorial/tutorial.cpp`中的代ç ç‰‡æ®µã€‚
+
+å‡è®¾æˆ‘们用C语言的字符串储存一个JSON(`const char* json`):
+~~~~~~~~~~js
+{
+ "hello": "world",
+ "t": true ,
+ "f": false,
+ "n": null,
+ "i": 123,
+ "pi": 3.1416,
+ "a": [1, 2, 3, 4]
+}
+~~~~~~~~~~
+
+把它解æžè‡³ä¸€ä¸ª`Document`:
+~~~~~~~~~~cpp
+#include "rapidjson/document.h"
+
+using namespace rapidjson;
+
+// ...
+Document document;
+document.Parse(json);
+~~~~~~~~~~
+
+那么现在该JSON就会被解æžè‡³`document`中,æˆä¸ºä¸€æ£µ*DOMæ ‘*:
+
+![教程中的DOM](diagram/tutorial.png)
+
+自从RFC 7159ä½œå‡ºæ›´æ–°ï¼Œåˆæ³•JSON文件的根å¯ä»¥æ˜¯ä»»ä½•类型的JSON值。而在较早的RFC 4627中,根值åªå…许是Object或Array。而在上述例å­ä¸­ï¼Œæ ¹æ˜¯ä¸€ä¸ªObject。
+~~~~~~~~~~cpp
+assert(document.IsObject());
+~~~~~~~~~~
+
+让我们查询一下根Object中有没有`"hello"`æˆå‘˜ã€‚由于一个`Value`å¯åŒ…å«ä¸åŒç±»åž‹çš„值,我们å¯èƒ½éœ€è¦éªŒè¯å®ƒçš„类型,并使用åˆé€‚çš„API去获å–其值。在此例中,`"hello"`æˆå‘˜å…³è”到一个JSON String。
+~~~~~~~~~~cpp
+assert(document.HasMember("hello"));
+assert(document["hello"].IsString());
+printf("hello = %s\n", document["hello"].GetString());
+~~~~~~~~~~
+
+~~~~~~~~~~
+world
+~~~~~~~~~~
+
+JSON True/False值是以`bool`表示的。
+~~~~~~~~~~cpp
+assert(document["t"].IsBool());
+printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
+~~~~~~~~~~
+
+~~~~~~~~~~
+true
+~~~~~~~~~~
+
+JSON Null值å¯ç”¨`IsNull()`查询。
+~~~~~~~~~~cpp
+printf("n = %s\n", document["n"].IsNull() ? "null" : "?");
+~~~~~~~~~~
+
+~~~~~~~~~~
+null
+~~~~~~~~~~
+
+JSON Number类型表示所有数值。然而,C++需è¦ä½¿ç”¨æ›´ä¸“门的类型。
+
+~~~~~~~~~~cpp
+assert(document["i"].IsNumber());
+
+// 在此情况下,IsUint()/IsInt64()/IsUInt64()也会返回 true
+assert(document["i"].IsInt());
+printf("i = %d\n", document["i"].GetInt());
+// å¦ä¸€ç§ç”¨æ³•: (int)document["i"]
+
+assert(document["pi"].IsNumber());
+assert(document["pi"].IsDouble());
+printf("pi = %g\n", document["pi"].GetDouble());
+~~~~~~~~~~
+
+~~~~~~~~~~
+i = 123
+pi = 3.1416
+~~~~~~~~~~
+
+JSON Array包å«ä¸€äº›å…ƒç´ ã€‚
+~~~~~~~~~~cpp
+// 使用引用æ¥è¿žç»­è®¿é—®ï¼Œæ–¹ä¾¿ä¹‹ä½™è¿˜æ›´é«˜æ•ˆã€‚
+const Value& a = document["a"];
+assert(a.IsArray());
+for (SizeType i = 0; i < a.Size(); i++) // 使用 SizeType è€Œä¸æ˜¯ size_t
+ printf("a[%d] = %d\n", i, a[i].GetInt());
+~~~~~~~~~~
+
+~~~~~~~~~~
+a[0] = 1
+a[1] = 2
+a[2] = 3
+a[3] = 4
+~~~~~~~~~~
+
+注æ„,RapidJSONå¹¶ä¸è‡ªåŠ¨è½¬æ¢å„ç§JSON类型。例如,对一个Stringçš„Value调用`GetInt()`æ˜¯éžæ³•的。在调试模å¼ä¸‹ï¼Œå®ƒä¼šè¢«æ–­è¨€å¤±è´¥ã€‚在å‘布模å¼ä¸‹ï¼Œå…¶è¡Œä¸ºæ˜¯æœªå®šä¹‰çš„。
+
+以下将会讨论有关查询å„类型的细节。
+
+## 查询Array {#QueryArray}
+
+ç¼ºçœæƒ…况下,`SizeType`是`unsigned`çš„typedef。在多数系统中,Array最多能存储2^32-1个元素。
+
+ä½ å¯ä»¥ç”¨æ•´æ•°å­—é¢é‡è®¿é—®å…ƒç´ ï¼Œå¦‚`a[0]`ã€`a[1]`ã€`a[2]`。
+
+Array与`std::vector`相似,除了使用索引,也å¯ä½¿ç”¨è¿­ä»£å™¨æ¥è®¿é—®æ‰€æœ‰å…ƒç´ ã€‚
+~~~~~~~~~~cpp
+for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
+ printf("%d ", itr->GetInt());
+~~~~~~~~~~
+
+还有一些熟悉的查询函数:
+* `SizeType Capacity() const`
+* `bool Empty() const`
+
+## 查询Object {#QueryObject}
+
+å’ŒArray相似,我们å¯ä»¥ç”¨è¿­ä»£å™¨åŽ»è®¿é—®æ‰€æœ‰Objectæˆå‘˜ï¼š
+
+~~~~~~~~~~cpp
+static const char* kTypeNames[] =
+ { "Null", "False", "True", "Object", "Array", "String", "Number" };
+
+for (Value::ConstMemberIterator itr = document.MemberBegin();
+ itr != document.MemberEnd(); ++itr)
+{
+ printf("Type of member %s is %s\n",
+ itr->name.GetString(), kTypeNames[itr->value.GetType()]);
+}
+~~~~~~~~~~
+
+~~~~~~~~~~
+Type of member hello is String
+Type of member t is True
+Type of member f is False
+Type of member n is Null
+Type of member i is Number
+Type of member pi is Number
+Type of member a is Array
+~~~~~~~~~~
+
+注æ„,当`operator[](const char*)`找ä¸åˆ°æˆå‘˜ï¼Œå®ƒä¼šæ–­è¨€å¤±è´¥ã€‚
+
+若我们ä¸ç¡®å®šä¸€ä¸ªæˆå‘˜æ˜¯å¦å­˜åœ¨ï¼Œä¾¿éœ€è¦åœ¨è°ƒç”¨`operator[](const char*)`å‰å…ˆè°ƒç”¨`HasMember()`ã€‚ç„¶è€Œï¼Œè¿™ä¼šå¯¼è‡´ä¸¤æ¬¡æŸ¥æ‰¾ã€‚æ›´å¥½çš„åšæ³•是调用`FindMember()`ï¼Œå®ƒèƒ½åŒæ—¶æ£€æŸ¥æˆå‘˜æ˜¯å¦å­˜åœ¨å¹¶è¿”回它的Value:
+
+~~~~~~~~~~cpp
+Value::ConstMemberIterator itr = document.FindMember("hello");
+if (itr != document.MemberEnd())
+ printf("%s %s\n", itr->value.GetString());
+~~~~~~~~~~
+
+## 查询Number {#QueryNumber}
+
+JSONåªæä¾›ä¸€ç§æ•°å€¼ç±»åž‹â”€â”€Number。数字å¯ä»¥æ˜¯æ•´æ•°æˆ–实数。RFC 4627规定数字的范围由解æžå™¨æŒ‡å®šã€‚
+
+由于C++æä¾›å¤šç§æ•´æ•°åŠæµ®ç‚¹æ•°ç±»åž‹ï¼ŒDOMå°è¯•å°½é‡æä¾›æœ€å¹¿çš„èŒƒå›´åŠè‰¯å¥½æ€§èƒ½ã€‚
+
+当解æžä¸€ä¸ªNumberæ—¶, 它会被存储在DOM之中,æˆä¸ºä¸‹åˆ—其中一个类型:
+
+类型 | æè¿°
+-----------|---------------------------------------
+`unsigned` | 32使— å·æ•´æ•°
+`int` | 32使œ‰å·æ•´æ•°
+`uint64_t` | 64使— å·æ•´æ•°
+`int64_t` | 64使œ‰å·æ•´æ•°
+`double` | 64ä½åŒç²¾åº¦æµ®ç‚¹æ•°
+
+当查询一个Numberæ—¶, ä½ å¯ä»¥æ£€æŸ¥è¯¥æ•°å­—是å¦èƒ½ä»¥ç›®æ ‡ç±»åž‹æ¥æå–:
+
+查检 | æå–
+------------------|---------------------
+`bool IsNumber()` | ä¸é€‚用
+`bool IsUint()` | `unsigned GetUint()`
+`bool IsInt()` | `int GetInt()`
+`bool IsUint64()` | `uint64_t GetUint64()`
+`bool IsInt64()` | `int64_t GetInt64()`
+`bool IsDouble()` | `double GetDouble()`
+
+注æ„,一个整数å¯èƒ½ç”¨å‡ ç§ç±»åž‹æ¥æå–,而无需转æ¢ã€‚例如,一个å为`x`çš„Value包å«123,那么`x.IsInt() == x.IsUint() == x.IsInt64() == x.IsUint64() == true`。但如果一个å为`y`çš„Value包å«-3000000000,那么仅会令`x.IsInt64() == true`。
+
+å½“è¦æå–Number类型,`GetDouble()`æ˜¯ä¼šæŠŠå†…éƒ¨æ•´æ•°çš„è¡¨ç¤ºè½¬æ¢æˆ`double`。注æ„`int` å’Œ`unsigned`å¯ä»¥å®‰å…¨åœ°è½¬æ¢è‡³`double`,但`int64_t`åŠ`uint64_t`å¯èƒ½ä¼šä¸§å¤±ç²¾åº¦ï¼ˆå› ä¸º`double`çš„å°¾æ•°åªæœ‰52ä½ï¼‰ã€‚
+
+## 查询String {#QueryString}
+
+除了`GetString()`,`Value`类也有一个`GetStringLength()`。这里会解释个中原因。
+
+æ ¹æ®RFC 4627,JSON Stringå¯åŒ…å«Unicode字符`U+0000`,在JSON中会表示为`"\u0000"`。问题是,C/C++通常使用空字符结尾字符串(null-terminated string),这ç§å­—符串把``\0'`作为结æŸç¬¦å·ã€‚
+
+为了符åˆRFC 4627,RapidJSON支æŒåŒ…å«`U+0000`çš„String。若你需è¦å¤„ç†è¿™äº›String,便å¯ä½¿ç”¨`GetStringLength()`去获得正确的字符串长度。
+
+例如,当解æžä»¥ä¸‹çš„JSON至`Document d`之åŽï¼š
+
+~~~~~~~~~~js
+{ "s" : "a\u0000b" }
+~~~~~~~~~~
+`"a\u0000b"`值的正确长度应该是3。但`strlen()`会返回1。
+
+`GetStringLength()`也å¯ä»¥æé«˜æ€§èƒ½ï¼Œå› ä¸ºç”¨æˆ·å¯èƒ½éœ€è¦è°ƒç”¨`strlen()`去分é…缓冲。
+
+此外,`std::string`也支æŒè¿™ä¸ªæž„造函数:
+
+~~~~~~~~~~cpp
+string(const char* s, size_t count);
+~~~~~~~~~~
+
+此构造函数接å—å­—ç¬¦ä¸²é•¿åº¦ä½œä¸ºå‚æ•°ã€‚它支æŒåœ¨å­—符串中存储空字符,也应该会有更好的性能。
+
+## 比较两个Value
+
+ä½ å¯ä½¿ç”¨`==`åŠ`!=`去比较两个Value。当且仅当两个Value的类型åŠå†…容相åŒï¼Œå®ƒä»¬æ‰å½“作相等。你也å¯ä»¥æ¯”较Value和它的原生类型值。以下是一个例å­ã€‚
+
+~~~~~~~~~~cpp
+if (document["hello"] == document["n"]) /*...*/; // 比较两个值
+if (document["hello"] == "world") /*...*/; // 与字符串家é¢é‡ä½œæ¯”较
+if (document["i"] != 123) /*...*/; // 与整数作比较
+if (document["pi"] != 3.14) /*...*/; // 与double作比较
+~~~~~~~~~~
+
+Arrayï¼Object顺åºä»¥å®ƒä»¬çš„å…ƒç´ ï¼æˆå‘˜ä½œæ¯”è¾ƒã€‚å½“ä¸”ä»…å½“å®ƒä»¬çš„æ•´ä¸ªå­æ ‘相等,它们æ‰å½“作相等。
+
+注æ„,现时若一个Object嫿œ‰é‡å¤å‘½åçš„æˆå‘˜ï¼Œå®ƒä¸Žä»»ä½•Object作比较都总会返回`false`。
+
+# 创建ï¼ä¿®æ”¹å€¼ {#CreateModifyValues}
+
+æœ‰å¤šç§æ–¹æ³•去创建值。 当一个DOM树被创建或修改åŽï¼Œå¯ä½¿ç”¨`Writer`冿¬¡å­˜å‚¨ä¸ºJSON。
+
+## 改å˜Value类型 {#ChangeValueType}
+当使用默认构造函数创建一个Value或Document,它的类型便会是Nullã€‚è¦æ”¹å˜å…¶ç±»åž‹ï¼Œéœ€è°ƒç”¨`SetXXX()`或赋值æ“作,例如:
+
+~~~~~~~~~~cpp
+Document d; // Null
+d.SetObject();
+
+Value v; // Null
+v.SetInt(10);
+v = 10; // 简写,和上é¢çš„相åŒ
+~~~~~~~~~~
+
+### 构造函数的å„个é‡è½½
+几个类型也有é‡è½½æž„造函数:
+
+~~~~~~~~~~cpp
+Value b(true); // 调用Value(bool)
+Value i(-123); // 调用 Value(int)
+Value u(123u); // 调用Value(unsigned)
+Value d(1.5); // 调用Value(double)
+~~~~~~~~~~
+
+è¦é‡å»ºç©ºObject或Array,å¯åœ¨é»˜è®¤æž„造函数åŽä½¿ç”¨ `SetObject()`/`SetArray()`,或一次性使用`Value(Type)`:
+
+~~~~~~~~~~cpp
+Value o(kObjectType);
+Value a(kArrayType);
+~~~~~~~~~~
+
+## 转移语æ„(Move Semantics) {#MoveSemantics}
+
+在设计RapidJSON时有一个éžå¸¸ç‰¹åˆ«çš„决定,就是Valueèµ‹å€¼å¹¶ä¸æ˜¯æŠŠæ¥æºValueå¤åˆ¶è‡³ç›®çš„Valueï¼Œè€Œæ˜¯æŠŠæŠŠæ¥æºValue转移(move)至目的Value。例如:
+
+~~~~~~~~~~cpp
+Value a(123);
+Value b(456);
+b = a; // aå˜æˆNull,bå˜æˆæ•°å­—123。
+~~~~~~~~~~
+
+![使用移动语æ„赋值。](diagram/move1.png)
+
+ä¸ºä»€ä¹ˆï¼Ÿæ­¤è¯­æ„æœ‰ä½•优点?
+
+最简å•的答案就是性能。对于固定大å°çš„JSON类型(Numberã€Trueã€Falseã€Null),å¤åˆ¶å®ƒä»¬æ˜¯ç®€å•å¿«æ·ã€‚然而,对于å¯å˜å¤§å°çš„JSON类型(Stringã€Arrayã€Object),å¤åˆ¶å®ƒä»¬ä¼šäº§ç”Ÿå¤§é‡å¼€é”€ï¼Œè€Œä¸”这些开销常常ä¸è¢«å¯Ÿè§‰ã€‚尤其是当我们需è¦åˆ›å»ºä¸´æ—¶Object,把它å¤åˆ¶è‡³å¦ä¸€å˜é‡ï¼Œç„¶åŽå†æžæž„它。
+
+例如,若使用正常*å¤åˆ¶*语æ„:
+
+~~~~~~~~~~cpp
+Value o(kObjectType);
+{
+ Value contacts(kArrayType);
+ // 把元素加进contacts数组。
+ // ...
+ o.AddMember("contacts", contacts, d.GetAllocator()); // 深度å¤åˆ¶contacts (å¯èƒ½æœ‰å¤§é‡å†…存分é…)
+ // æžæž„contacts。
+}
+~~~~~~~~~~
+
+![å¤åˆ¶è¯­æ„产生大é‡çš„å¤åˆ¶æ“作。](diagram/move2.png)
+
+那个`o` Object需è¦åˆ†é…一个和contacts相åŒå¤§å°çš„缓冲区,对conactsåšæ·±åº¦å¤åˆ¶ï¼Œå¹¶æœ€ç»ˆè¦æžæž„contactsã€‚è¿™æ ·ä¼šäº§ç”Ÿå¤§é‡æ— å¿…è¦çš„内存分é…ï¼é‡Šæ”¾ï¼Œä»¥åŠå†…å­˜å¤åˆ¶ã€‚
+
+有一些方案å¯é¿å…实质地å¤åˆ¶è¿™äº›æ•°æ®ï¼Œä¾‹å¦‚引用计数(reference counting)ã€åžƒåœ¾å›žæ”¶ï¼ˆgarbage collection, GC)。
+
+为了使RapidJSON简å•åŠå¿«é€Ÿï¼Œæˆ‘们选择了对赋值采用*转移*语æ„。这方法与`std::auto_ptr`相似,都是在赋值时转移拥有æƒã€‚转移快得多简å•得多,åªéœ€è¦æžæž„原æ¥çš„Valueï¼ŒæŠŠæ¥æº`memcpy()`è‡³ç›®æ ‡ï¼Œæœ€åŽæŠŠæ¥æºè®¾ç½®ä¸ºNull类型。
+
+因此,使用转移语æ„åŽï¼Œä¸Šé¢çš„例å­å˜æˆï¼š
+
+~~~~~~~~~~cpp
+Value o(kObjectType);
+{
+ Value contacts(kArrayType);
+ // adding elements to contacts array.
+ o.AddMember("contacts", contacts, d.GetAllocator()); // åªéœ€ memcpy() contacts本身至新æˆå‘˜çš„Value(16字节)
+ // contactsåœ¨è¿™é‡Œå˜æˆNullã€‚å®ƒçš„æžæž„是平凡的。
+}
+~~~~~~~~~~
+
+![转移语æ„ä¸éœ€å¤åˆ¶ã€‚](diagram/move3.png)
+
+在C++11中这称为转移赋值æ“作(move assignment operator)。由于RapidJSON 支æŒC++03,它在赋值æ“作采用转移语æ„,其它修改形函数如`AddMember()`, `PushBack()`也采用转移语æ„。
+
+### 转移语æ„åŠä¸´æ—¶å€¼ {#TemporaryValues}
+
+有时候,我们想直接构造一个Value并传递给一个“转移â€å‡½æ•°ï¼ˆå¦‚`PushBack()`ã€`AddMember()`)。由于临时对象是ä¸èƒ½è½¬æ¢ä¸ºæ­£å¸¸çš„Value引用,我们加入了一个方便的`Move()`函数:
+
+~~~~~~~~~~cpp
+Value a(kArrayType);
+Document::AllocatorType& allocator = document.GetAllocator();
+// a.PushBack(Value(42), allocator); // ä¸èƒ½é€šè¿‡ç¼–译
+a.PushBack(Value().SetInt(42), allocator); // fluent API
+a.PushBack(Value(42).Move(), allocator); // 和上一行相åŒ
+~~~~~~~~~~
+
+## 创建String {#CreateString}
+RapidJSONæä¾›ä¸¤ä¸ªString的存储策略。
+
+1. copy-string: 分é…ç¼“å†²åŒºï¼Œç„¶åŽæŠŠæ¥æºæ•°æ®å¤åˆ¶è‡³å®ƒã€‚
+2. const-string: 简å•地储存字符串的指针。
+
+Copy-string总是安全的,因为它拥有数æ®çš„克隆。Const-stringå¯ç”¨äºŽå­˜å‚¨å­—符串字é¢é‡ï¼Œä»¥åŠç”¨äºŽåœ¨DOM一节中将会æåˆ°çš„in-situè§£æžä¸­ã€‚
+
+ä¸ºäº†è®©ç”¨æˆ·è‡ªå®šä¹‰å†…å­˜åˆ†é…æ–¹å¼ï¼Œå½“一个æ“作å¯èƒ½éœ€è¦å†…å­˜åˆ†é…æ—¶ï¼ŒRapidJSONè¦æ±‚用户传递一个allocator实例作为API傿•°ã€‚此设计é¿å…了在æ¯ä¸ªValue存储allocator(或document)的指针。
+
+因此,当我们把一个copy-string赋值时, è°ƒç”¨å«æœ‰allocatorçš„`SetString()`é‡è½½å‡½æ•°ï¼š
+
+~~~~~~~~~~cpp
+Document document;
+Value author;
+char buffer[10];
+int len = sprintf(buffer, "%s %s", "Milo", "Yip"); // 动æ€åˆ›å»ºçš„字符串。
+author.SetString(buffer, len, document.GetAllocator());
+memset(buffer, 0, sizeof(buffer));
+// 清空bufferåŽauthor.GetString() ä»ç„¶åŒ…å« "Milo Yip"
+~~~~~~~~~~
+
+在此例å­ä¸­ï¼Œæˆ‘们使用`Document`实例的allocator。这是使用RapidJSON时常用的惯用法。但你也å¯ä»¥ç”¨å…¶ä»–allocator实例。
+
+å¦å¤–,上é¢çš„`SetString()`需è¦é•¿åº¦å‚数。这个API能处ç†å«æœ‰ç©ºå­—符的字符串。å¦ä¸€ä¸ª`SetString()`é‡è½½å‡½æ•°æ²¡æœ‰é•¿åº¦å‚数,它å‡è®¾è¾“入是空字符结尾的,并会调用类似`strlen()`的函数去获å–长度。
+
+最åŽï¼Œå¯¹äºŽå­—符串字é¢é‡æˆ–有安全生命周期的字符串,å¯ä»¥ä½¿ç”¨const-string版本的`SetString()`,它没有allocator傿•°ã€‚对于字符串家é¢é‡ï¼ˆæˆ–字符数组常é‡ï¼‰ï¼Œåªéœ€ç®€å•地传递字é¢é‡ï¼Œåˆå®‰å…¨åˆé«˜æ•ˆï¼š
+
+~~~~~~~~~~cpp
+Value s;
+s.SetString("rapidjson"); // å¯åŒ…å«ç©ºå­—ç¬¦ï¼Œé•¿åº¦åœ¨ç¼–è¯‘èæŽ¨å¯¼
+s = "rapidjson"; // 上行的缩写
+~~~~~~~~~~
+
+对于字符指针,RapidJSON需è¦ä½œä¸€ä¸ªæ ‡è®°ï¼Œä»£è¡¨å®ƒä¸å¤åˆ¶ä¹Ÿæ˜¯å®‰å…¨çš„。å¯ä»¥ä½¿ç”¨`StringRef`函数:
+
+~~~~~~~~~cpp
+const char * cstr = getenv("USER");
+size_t cstr_len = ...; // 如果有长度
+Value s;
+// s.SetString(cstr); // è¿™ä¸èƒ½é€šè¿‡ç¼–译
+s.SetString(StringRef(cstr)); // å¯ä»¥ï¼Œå‡è®¾å®ƒçš„生命周期案全,并且是以空字符结尾的
+s = StringRef(cstr); // 上行的缩写
+s.SetString(StringRef(cstr, cstr_len));// 更快,å¯å¤„ç†ç©ºå­—符
+s = StringRef(cstr, cstr_len); // 上行的缩写
+
+~~~~~~~~~
+
+## 修改Array {#ModifyArray}
+Array类型的Valueæä¾›ä¸Ž`std::vector`相似的API。
+
+* `Clear()`
+* `Reserve(SizeType, Allocator&)`
+* `Value& PushBack(Value&, Allocator&)`
+* `template <typename T> GenericValue& PushBack(T, Allocator&)`
+* `Value& PopBack()`
+* `ValueIterator Erase(ConstValueIterator pos)`
+* `ValueIterator Erase(ConstValueIterator first, ConstValueIterator last)`
+
+注æ„,`Reserve(...)`åŠ`PushBack(...)`å¯èƒ½ä¼šä¸ºæ•°ç»„元素分é…内存,所以需è¦ä¸€ä¸ªallocator。
+
+以下是`PushBack()`的例å­ï¼š
+
+~~~~~~~~~~cpp
+Value a(kArrayType);
+Document::AllocatorType& allocator = document.GetAllocator();
+
+for (int i = 5; i <= 10; i++)
+ a.PushBack(i, allocator); // å¯èƒ½éœ€è¦è°ƒç”¨realloc()所以需è¦allocator
+
+// æµç•…接å£ï¼ˆFluent interface)
+a.PushBack("Lua", allocator).PushBack("Mio", allocator);
+~~~~~~~~~~
+
+与STLä¸ä¸€æ ·çš„æ˜¯ï¼Œ`PushBack()`/`PopBack()`返回Array本身的引用。这称为æµç•…接å£ï¼ˆ_fluent interface_)。
+
+如果你想在Array中加入一个éžå¸¸é‡å­—符串,或是一个没有足够生命周期的字符串(è§[Create String](#CreateString)),你需è¦ä½¿ç”¨copy-string API去创建一个String。为了é¿å…加入中间å˜é‡ï¼Œå¯ä»¥å°±åœ°ä½¿ç”¨ä¸€ä¸ª[临时值](#TemporaryValues):
+
+~~~~~~~~~~cpp
+// 就地Value傿•°
+contact.PushBack(Value("copy", document.GetAllocator()).Move(), // copy string
+ document.GetAllocator());
+
+// 显å¼Value傿•°
+Value val("key", document.GetAllocator()); // copy string
+contact.PushBack(val, document.GetAllocator());
+~~~~~~~~~~
+
+## 修改Object {#ModifyObject}
+Object是键值对的集åˆã€‚æ¯ä¸ªé”®å¿…须为String。è¦ä¿®æ”¹Object,方法是增加或移除æˆå‘˜ã€‚以下的API用æ¥å¢žåŠ åŸŽå‘˜ï¼š
+
+* `Value& AddMember(Value&, Value&, Allocator& allocator)`
+* `Value& AddMember(StringRefType, Value&, Allocator&)`
+* `template <typename T> Value& AddMember(StringRefType, T value, Allocator&)`
+
+以下是一个例å­ã€‚
+
+~~~~~~~~~~cpp
+Value contact(kObject);
+contact.AddMember("name", "Milo", document.GetAllocator());
+contact.AddMember("married", true, document.GetAllocator());
+~~~~~~~~~~
+
+使用`StringRefType`作为name傿•°çš„é‡è½½ç‰ˆæœ¬ä¸Žå­—符串的`SetString`的接å£ç›¸ä¼¼ã€‚ 这些é‡è½½æ˜¯ä¸ºäº†é¿å…å¤åˆ¶`name`字符串,因为JSON object中ç»å¸¸ä¼šä½¿ç”¨å¸¸æ•°é”®å。
+
+如果你需è¦ä»Žéžå¸¸æ•°å­—符串或生命周期ä¸è¶³çš„字符串创建键å(è§[创建String](#CreateString)),你需è¦ä½¿ç”¨copy-string API。为了é¿å…中间å˜é‡ï¼Œå¯ä»¥å°±åœ°ä½¿ç”¨[临时值](#TemporaryValues):
+
+~~~~~~~~~~cpp
+// 就地Value傿•°
+contact.AddMember(Value("copy", document.GetAllocator()).Move(), // copy string
+ Value().Move(), // null value
+ document.GetAllocator());
+
+// 显å¼å‚æ•°
+Value key("key", document.GetAllocator()); // copy string name
+Value val(42); // æŸValue
+contact.AddMember(key, val, document.GetAllocator());
+~~~~~~~~~~
+
+移除æˆå‘˜æœ‰å‡ ä¸ªé€‰æ‹©ï¼š
+
+* `bool RemoveMember(const Ch* name)`ï¼šä½¿ç”¨é”®åæ¥ç§»é™¤æˆå‘˜ï¼ˆçº¿æ€§æ—¶é—´å¤æ‚度)。
+* `bool RemoveMember(const Value& name)`:除了`name`是一个Value,和上一行相åŒã€‚
+* `MemberIterator RemoveMember(MemberIterator)`:使用迭代器移除æˆå‘˜ï¼ˆ_常数_æ—¶é—´å¤æ‚度)。
+* `MemberIterator EraseMember(MemberIterator)`ï¼šå’Œä¸Šè¡Œç›¸ä¼¼ä½†ç»´æŒæˆå‘˜æ¬¡åºï¼ˆçº¿æ€§æ—¶é—´å¤æ‚度)。
+* `MemberIterator EraseMember(MemberIterator first, MemberIterator last)`:移除一个范围内的æˆå‘˜ï¼Œç»´æŒæ¬¡åºï¼ˆçº¿æ€§æ—¶é—´å¤æ‚度)。
+
+`MemberIterator RemoveMember(MemberIterator)`使用了“转移最åŽâ€æ‰‹æ³•æ¥è¾¾æˆå¸¸æ•°æ—¶é—´å¤æ‚åº¦ã€‚åŸºæœ¬ä¸Šå°±æ˜¯æžæž„迭代器ä½ç½®çš„æˆå‘˜ï¼Œç„¶åŽæŠŠæœ€åŽçš„æˆå‘˜è½¬ç§»è‡³è¿­ä»£å™¨ä½ç½®ã€‚因此,æˆå‘˜çš„æ¬¡åºä¼šè¢«æ”¹å˜ã€‚
+
+## æ·±å¤åˆ¶Value {#DeepCopyValue}
+若我们真的è¦å¤åˆ¶ä¸€ä¸ªDOM树,我们å¯ä½¿ç”¨ä¸¤ä¸ªAPIs作深å¤åˆ¶ï¼šå«allocator的构造函数åŠ`CopyFrom()`。
+
+~~~~~~~~~~cpp
+Document d;
+Document::AllocatorType& a = d.GetAllocator();
+Value v1("foo");
+// Value v2(v1); // ä¸å®¹è®¸
+
+Value v2(v1, a); // 制造一个克隆
+assert(v1.IsString()); // v1ä¸å˜
+d.SetArray().PushBack(v1, a).PushBack(v2, a);
+assert(v1.IsNull() && v2.IsNull()); // 两个都转移动d
+
+v2.CopyFrom(d, a); // 把整个documentå¤åˆ¶è‡³v2
+assert(d.IsArray() && d.Size() == 2); // dä¸å˜
+v1.SetObject().AddMember("array", v2, a);
+d.PushBack(v1, a);
+~~~~~~~~~~
+
+## 交æ¢Value {#SwapValues}
+
+RapidJSON也æä¾›`Swap()`。
+
+~~~~~~~~~~cpp
+Value a(123);
+Value b("Hello");
+a.Swap(b);
+assert(a.IsString());
+assert(b.IsInt());
+~~~~~~~~~~
+
+无论两棵DOMæ ‘æœ‰å¤šå¤æ‚ï¼Œäº¤æ¢æ˜¯å¾ˆå¿«çš„(常数时间)。
+
+# 下一部分 {#WhatsNext}
+
+本教程展示了如何询查åŠä¿®æ”¹DOM树。RapidJSON还有一个é‡è¦æ¦‚念:
+
+1. [æµ](doc/stream.zh-cn.md) 是读写JSON的通é“。æµå¯ä»¥æ˜¯å†…å­˜å­—ç¬¦ä¸²ã€æ–‡ä»¶æµç­‰ã€‚用户也å¯ä»¥è‡ªå®šä¹‰æµã€‚
+2. [ç¼–ç ](doc/encoding.zh-cn.md)å®šä¹‰åœ¨æµæˆ–内存中使用的字符编ç ã€‚RapidJSON也在内部æä¾›Unicode转æ¢åŠæ ¡éªŒåŠŸèƒ½ã€‚
+3. [DOM](doc/dom.zh-cn.md)的基本功能已在本教程里介ç»ã€‚还有更高级的功能,如原ä½ï¼ˆ*in situ*)解æžã€å…¶ä»–è§£æžé€‰é¡¹åŠé«˜çº§ç”¨æ³•。
+4. [SAX](doc/sax.zh-cn.md) 是RapidJSONè§£æžï¼ç”ŸæˆåŠŸèƒ½çš„åŸºç¡€ã€‚å­¦ä¹ ä½¿ç”¨`Reader`/`Writer`去实现更高性能的应用程åºã€‚也å¯ä»¥ä½¿ç”¨`PrettyWriter`去格å¼åŒ–JSON。
+5. [性能](doc/performance.zh-cn.md)展示一些我们åšçš„åŠç¬¬ä¸‰æ–¹çš„æ€§èƒ½æµ‹è¯•。
+6. [技术内幕](doc/internals.zh-cn.md)讲述一些RapidJSONå†…éƒ¨çš„è®¾è®¡åŠæŠ€æœ¯ã€‚
+
+你也å¯ä»¥å‚考[常è§é—®é¢˜](faq.zh-cn.md)ã€API文档ã€ä¾‹å­åŠå•元测试。
diff --git a/3rdparty/rapidjson/example/CMakeLists.txt b/3rdparty/rapidjson/example/CMakeLists.txt
new file mode 100644
index 00000000000..c6b8449ffb1
--- /dev/null
+++ b/3rdparty/rapidjson/example/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Copyright (c) 2011 Milo Yip (miloyip@gmail.com)
+# Copyright (c) 2013 Rafal Jeczalik (rjeczalik@gmail.com)
+# Distributed under the MIT License (see license.txt file)
+cmake_minimum_required(VERSION 2.8)
+
+set(EXAMPLES
+ capitalize
+ condense
+ jsonx
+ messagereader
+ pretty
+ prettyauto
+ schemavalidator
+ serialize
+ simpledom
+ simplereader
+ simplewriter
+ tutorial)
+
+include_directories("../include/")
+
+add_definitions(-D__STDC_FORMAT_MACROS)
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default")
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything")
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
+endif()
+
+foreach (example ${EXAMPLES})
+ add_executable(${example} ${example}/${example}.cpp)
+endforeach()
+
+add_custom_target(examples ALL DEPENDS ${EXAMPLES})
diff --git a/3rdparty/rapidjson/example/capitalize/capitalize.cpp b/3rdparty/rapidjson/example/capitalize/capitalize.cpp
new file mode 100644
index 00000000000..adc32b52da1
--- /dev/null
+++ b/3rdparty/rapidjson/example/capitalize/capitalize.cpp
@@ -0,0 +1,66 @@
+// JSON condenser example
+
+// This example parses JSON from stdin with validation,
+// and re-output the JSON content to stdout with all string capitalized, and without whitespace.
+
+#include "rapidjson/reader.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/error/en.h"
+#include <vector>
+#include <cctype>
+
+using namespace rapidjson;
+
+template<typename OutputHandler>
+struct CapitalizeFilter {
+ CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {}
+
+ bool Null() { return out_.Null(); }
+ bool Bool(bool b) { return out_.Bool(b); }
+ bool Int(int i) { return out_.Int(i); }
+ bool Uint(unsigned u) { return out_.Uint(u); }
+ bool Int64(int64_t i) { return out_.Int64(i); }
+ bool Uint64(uint64_t u) { return out_.Uint64(u); }
+ bool Double(double d) { return out_.Double(d); }
+ bool String(const char* str, SizeType length, bool) {
+ buffer_.clear();
+ for (SizeType i = 0; i < length; i++)
+ buffer_.push_back(static_cast<char>(std::toupper(str[i])));
+ return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string
+ }
+ bool StartObject() { return out_.StartObject(); }
+ bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
+ bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }
+ bool StartArray() { return out_.StartArray(); }
+ bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }
+
+ OutputHandler& out_;
+ std::vector<char> buffer_;
+
+private:
+ CapitalizeFilter(const CapitalizeFilter&);
+ CapitalizeFilter& operator=(const CapitalizeFilter&);
+};
+
+int main(int, char*[]) {
+ // Prepare JSON reader and input stream.
+ Reader reader;
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+
+ // Prepare JSON writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+ Writer<FileWriteStream> writer(os);
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
+ if (!reader.Parse(is, filter)) {
+ fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/condense/condense.cpp b/3rdparty/rapidjson/example/condense/condense.cpp
new file mode 100644
index 00000000000..46dc3504397
--- /dev/null
+++ b/3rdparty/rapidjson/example/condense/condense.cpp
@@ -0,0 +1,32 @@
+// JSON condenser example
+
+// This example parses JSON text from stdin with validation,
+// and re-output the JSON content to stdout without whitespace.
+
+#include "rapidjson/reader.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/error/en.h"
+
+using namespace rapidjson;
+
+int main(int, char*[]) {
+ // Prepare JSON reader and input stream.
+ Reader reader;
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+
+ // Prepare JSON writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+ Writer<FileWriteStream> writer(os);
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ if (!reader.Parse(is, writer)) {
+ fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/jsonx/jsonx.cpp b/3rdparty/rapidjson/example/jsonx/jsonx.cpp
new file mode 100644
index 00000000000..c253ac096df
--- /dev/null
+++ b/3rdparty/rapidjson/example/jsonx/jsonx.cpp
@@ -0,0 +1,200 @@
+// JSON to JSONx conversion exmaple, using SAX API.
+// JSONx is an IBM standard format to represent JSON as XML.
+// https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html
+// This example parses JSON text from stdin with validation,
+// and convert to JSONx format to stdout.
+// Need compile with -D__STDC_FORMAT_MACROS for defining PRId64 and PRIu64 macros.
+
+#include "rapidjson/reader.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/error/en.h"
+#include <cstdio>
+
+using namespace rapidjson;
+
+// For simplicity, this example only read/write in UTF-8 encoding
+template <typename OutputStream>
+class JsonxWriter {
+public:
+ JsonxWriter(OutputStream& os) : os_(os), name_(), level_(0), hasName_(false) {
+ }
+
+ bool Null() {
+ return WriteStartElement("null", true);
+ }
+
+ bool Bool(bool b) {
+ return
+ WriteStartElement("boolean") &&
+ WriteString(b ? "true" : "false") &&
+ WriteEndElement("boolean");
+ }
+
+ bool Int(int i) {
+ char buffer[12];
+ return WriteNumberElement(buffer, sprintf(buffer, "%d", i));
+ }
+
+ bool Uint(unsigned i) {
+ char buffer[11];
+ return WriteNumberElement(buffer, sprintf(buffer, "%u", i));
+ }
+
+ bool Int64(int64_t i) {
+ char buffer[21];
+ return WriteNumberElement(buffer, sprintf(buffer, "%" PRId64, i));
+ }
+
+ bool Uint64(uint64_t i) {
+ char buffer[21];
+ return WriteNumberElement(buffer, sprintf(buffer, "%" PRIu64, i));
+ }
+
+ bool Double(double d) {
+ char buffer[30];
+ return WriteNumberElement(buffer, sprintf(buffer, "%.17g", d));
+ }
+
+ bool String(const char* str, SizeType length, bool) {
+ return
+ WriteStartElement("string") &&
+ WriteEscapedText(str, length) &&
+ WriteEndElement("string");
+ }
+
+ bool StartObject() {
+ return WriteStartElement("object");
+ }
+
+ bool Key(const char* str, SizeType length, bool) {
+ // backup key to name_
+ name_.Clear();
+ for (SizeType i = 0; i < length; i++)
+ name_.Put(str[i]);
+ hasName_ = true;
+ return true;
+ }
+
+ bool EndObject(SizeType) {
+ return WriteEndElement("object");
+ }
+
+ bool StartArray() {
+ return WriteStartElement("array");
+ }
+
+ bool EndArray(SizeType) {
+ return WriteEndElement("array");
+ }
+
+private:
+ bool WriteString(const char* s) {
+ while (*s)
+ os_.Put(*s++);
+ return true;
+ }
+
+ bool WriteEscapedAttributeValue(const char* s, size_t length) {
+ for (size_t i = 0; i < length; i++) {
+ switch (s[i]) {
+ case '&': WriteString("&amp;"); break;
+ case '<': WriteString("&lt;"); break;
+ case '"': WriteString("&quot;"); break;
+ default: os_.Put(s[i]); break;
+ }
+ }
+ return true;
+ }
+
+ bool WriteEscapedText(const char* s, size_t length) {
+ for (size_t i = 0; i < length; i++) {
+ switch (s[i]) {
+ case '&': WriteString("&amp;"); break;
+ case '<': WriteString("&lt;"); break;
+ default: os_.Put(s[i]); break;
+ }
+ }
+ return true;
+ }
+
+ bool WriteStartElement(const char* type, bool emptyElement = false) {
+ if (level_ == 0)
+ if (!WriteString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"))
+ return false;
+
+ if (!WriteString("<json:") || !WriteString(type))
+ return false;
+
+ // For root element, need to add declarations
+ if (level_ == 0) {
+ if (!WriteString(
+ " xsi:schemaLocation=\"http://www.datapower.com/schemas/json jsonx.xsd\""
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+ " xmlns:json=\"http://www.ibm.com/xmlns/prod/2009/jsonx\""))
+ return false;
+ }
+
+ if (hasName_) {
+ hasName_ = false;
+ if (!WriteString(" name=\"") ||
+ !WriteEscapedAttributeValue(name_.GetString(), name_.GetSize()) ||
+ !WriteString("\""))
+ return false;
+ }
+
+ if (emptyElement)
+ return WriteString("/>");
+ else {
+ level_++;
+ return WriteString(">");
+ }
+ }
+
+ bool WriteEndElement(const char* type) {
+ if (!WriteString("</json:") ||
+ !WriteString(type) ||
+ !WriteString(">"))
+ return false;
+
+ // For the last end tag, flush the output stream.
+ if (--level_ == 0)
+ os_.Flush();
+
+ return true;
+ }
+
+ bool WriteNumberElement(const char* buffer, int length) {
+ if (!WriteStartElement("number"))
+ return false;
+ for (int j = 0; j < length; j++)
+ os_.Put(buffer[j]);
+ return WriteEndElement("number");
+ }
+
+ OutputStream& os_;
+ StringBuffer name_;
+ unsigned level_;
+ bool hasName_;
+};
+
+int main(int, char*[]) {
+ // Prepare JSON reader and input stream.
+ Reader reader;
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+
+ // Prepare JSON writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+ JsonxWriter<FileWriteStream> writer(os);
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ if (!reader.Parse(is, writer)) {
+ fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/messagereader/messagereader.cpp b/3rdparty/rapidjson/example/messagereader/messagereader.cpp
new file mode 100644
index 00000000000..3399bc9400e
--- /dev/null
+++ b/3rdparty/rapidjson/example/messagereader/messagereader.cpp
@@ -0,0 +1,105 @@
+// Reading a message JSON with Reader (SAX-style API).
+// The JSON should be an object with key-string pairs.
+
+#include "rapidjson/reader.h"
+#include "rapidjson/error/en.h"
+#include <iostream>
+#include <string>
+#include <map>
+
+using namespace std;
+using namespace rapidjson;
+
+typedef map<string, string> MessageMap;
+
+#if defined(__GNUC__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(switch-enum)
+#endif
+
+struct MessageHandler
+ : public BaseReaderHandler<UTF8<>, MessageHandler> {
+ MessageHandler() : messages_(), state_(kExpectObjectStart), name_() {}
+
+ bool StartObject() {
+ switch (state_) {
+ case kExpectObjectStart:
+ state_ = kExpectNameOrObjectEnd;
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool String(const char* str, SizeType length, bool) {
+ switch (state_) {
+ case kExpectNameOrObjectEnd:
+ name_ = string(str, length);
+ state_ = kExpectValue;
+ return true;
+ case kExpectValue:
+ messages_.insert(MessageMap::value_type(name_, string(str, length)));
+ state_ = kExpectNameOrObjectEnd;
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }
+
+ bool Default() { return false; } // All other events are invalid.
+
+ MessageMap messages_;
+ enum State {
+ kExpectObjectStart,
+ kExpectNameOrObjectEnd,
+ kExpectValue
+ }state_;
+ std::string name_;
+};
+
+#if defined(__GNUC__)
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+static void ParseMessages(const char* json, MessageMap& messages) {
+ Reader reader;
+ MessageHandler handler;
+ StringStream ss(json);
+ if (reader.Parse(ss, handler))
+ messages.swap(handler.messages_); // Only change it if success.
+ else {
+ ParseErrorCode e = reader.GetParseErrorCode();
+ size_t o = reader.GetErrorOffset();
+ cout << "Error: " << GetParseError_En(e) << endl;;
+ cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;
+ }
+}
+
+int main() {
+ MessageMap messages;
+
+ const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
+ cout << json1 << endl;
+ ParseMessages(json1, messages);
+
+ for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
+ cout << itr->first << ": " << itr->second << endl;
+
+ cout << endl << "Parse a JSON with invalid schema." << endl;
+ const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
+ cout << json2 << endl;
+ ParseMessages(json2, messages);
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/pretty/pretty.cpp b/3rdparty/rapidjson/example/pretty/pretty.cpp
new file mode 100644
index 00000000000..2feff5d02ea
--- /dev/null
+++ b/3rdparty/rapidjson/example/pretty/pretty.cpp
@@ -0,0 +1,30 @@
+// JSON pretty formatting example
+// This example can only handle UTF-8. For handling other encodings, see prettyauto example.
+
+#include "rapidjson/reader.h"
+#include "rapidjson/prettywriter.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/error/en.h"
+
+using namespace rapidjson;
+
+int main(int, char*[]) {
+ // Prepare reader and input stream.
+ Reader reader;
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+
+ // Prepare writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+ PrettyWriter<FileWriteStream> writer(os);
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ if (!reader.Parse<kParseValidateEncodingFlag>(is, writer)) {
+ fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/prettyauto/prettyauto.cpp b/3rdparty/rapidjson/example/prettyauto/prettyauto.cpp
new file mode 100644
index 00000000000..1687bae5559
--- /dev/null
+++ b/3rdparty/rapidjson/example/prettyauto/prettyauto.cpp
@@ -0,0 +1,56 @@
+// JSON pretty formatting example
+// This example can handle UTF-8/UTF-16LE/UTF-16BE/UTF-32LE/UTF-32BE.
+// The input firstly convert to UTF8, and then write to the original encoding with pretty formatting.
+
+#include "rapidjson/reader.h"
+#include "rapidjson/prettywriter.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/encodedstream.h" // NEW
+#include "rapidjson/error/en.h"
+#ifdef _WIN32
+#include <fcntl.h>
+#include <io.h>
+#endif
+
+using namespace rapidjson;
+
+int main(int, char*[]) {
+#ifdef _WIN32
+ // Prevent Windows converting between CR+LF and LF
+ _setmode(_fileno(stdin), _O_BINARY); // NEW
+ _setmode(_fileno(stdout), _O_BINARY); // NEW
+#endif
+
+ // Prepare reader and input stream.
+ //Reader reader;
+ GenericReader<AutoUTF<unsigned>, UTF8<> > reader; // CHANGED
+ char readBuffer[65536];
+ FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
+ AutoUTFInputStream<unsigned, FileReadStream> eis(is); // NEW
+
+ // Prepare writer and output stream.
+ char writeBuffer[65536];
+ FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
+
+#if 1
+ // Use the same Encoding of the input. Also use BOM according to input.
+ typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream; // NEW
+ OutputStream eos(os, eis.GetType(), eis.HasBOM()); // NEW
+ PrettyWriter<OutputStream, UTF8<>, AutoUTF<unsigned> > writer(eos); // CHANGED
+#else
+ // You may also use static bound encoding type, such as output to UTF-16LE with BOM
+ typedef EncodedOutputStream<UTF16LE<>,FileWriteStream> OutputStream; // NEW
+ OutputStream eos(os, true); // NEW
+ PrettyWriter<OutputStream, UTF8<>, UTF16LE<> > writer(eos); // CHANGED
+#endif
+
+ // JSON reader parse from the input stream and let writer generate the output.
+ //if (!reader.Parse<kParseValidateEncodingFlag>(is, writer)) {
+ if (!reader.Parse<kParseValidateEncodingFlag>(eis, writer)) { // CHANGED
+ fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/schemavalidator/schemavalidator.cpp b/3rdparty/rapidjson/example/schemavalidator/schemavalidator.cpp
new file mode 100644
index 00000000000..ce36ea95f00
--- /dev/null
+++ b/3rdparty/rapidjson/example/schemavalidator/schemavalidator.cpp
@@ -0,0 +1,72 @@
+// Schema Validator example
+
+// The example validates JSON text from stdin with a JSON schema specified in the argument.
+
+#include "rapidjson/error/en.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/schema.h"
+#include "rapidjson/stringbuffer.h"
+
+using namespace rapidjson;
+
+int main(int argc, char *argv[]) {
+ if (argc != 2) {
+ fprintf(stderr, "Usage: schemavalidator schema.json < input.json\n");
+ return EXIT_FAILURE;
+ }
+
+ // Read a JSON schema from file into Document
+ Document d;
+ char buffer[4096];
+
+ {
+ FILE *fp = fopen(argv[1], "r");
+ if (!fp) {
+ printf("Schema file '%s' not found\n", argv[1]);
+ return -1;
+ }
+ FileReadStream fs(fp, buffer, sizeof(buffer));
+ d.ParseStream(fs);
+ if (d.HasParseError()) {
+ fprintf(stderr, "Schema file '%s' is not a valid JSON\n", argv[1]);
+ fprintf(stderr, "Error(offset %u): %s\n",
+ static_cast<unsigned>(d.GetErrorOffset()),
+ GetParseError_En(d.GetParseError()));
+ fclose(fp);
+ return EXIT_FAILURE;
+ }
+ fclose(fp);
+ }
+
+ // Then convert the Document into SchemaDocument
+ SchemaDocument sd(d);
+
+ // Use reader to parse the JSON in stdin, and forward SAX events to validator
+ SchemaValidator validator(sd);
+ Reader reader;
+ FileReadStream is(stdin, buffer, sizeof(buffer));
+ if (!reader.Parse(is, validator) && reader.GetParseErrorCode() != kParseErrorTermination) {
+ // Schema validator error would cause kParseErrorTermination, which will handle it in next step.
+ fprintf(stderr, "Input is not a valid JSON\n");
+ fprintf(stderr, "Error(offset %u): %s\n",
+ static_cast<unsigned>(reader.GetErrorOffset()),
+ GetParseError_En(reader.GetParseErrorCode()));
+ }
+
+ // Check the validation result
+ if (validator.IsValid()) {
+ printf("Input JSON is valid.\n");
+ return EXIT_SUCCESS;
+ }
+ else {
+ printf("Input JSON is invalid.\n");
+ StringBuffer sb;
+ validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ fprintf(stderr, "Invalid schema: %s\n", sb.GetString());
+ fprintf(stderr, "Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
+ sb.Clear();
+ validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ fprintf(stderr, "Invalid document: %s\n", sb.GetString());
+ return EXIT_FAILURE;
+ }
+}
diff --git a/3rdparty/rapidjson/example/serialize/serialize.cpp b/3rdparty/rapidjson/example/serialize/serialize.cpp
new file mode 100644
index 00000000000..12d87151e64
--- /dev/null
+++ b/3rdparty/rapidjson/example/serialize/serialize.cpp
@@ -0,0 +1,173 @@
+// Serialize example
+// This example shows writing JSON string with writer directly.
+
+#include "rapidjson/prettywriter.h" // for stringify JSON
+#include <cstdio>
+#include <string>
+#include <vector>
+
+using namespace rapidjson;
+
+class Person {
+public:
+ Person(const std::string& name, unsigned age) : name_(name), age_(age) {}
+ Person(const Person& rhs) : name_(rhs.name_), age_(rhs.age_) {}
+ virtual ~Person();
+
+ Person& operator=(const Person& rhs) {
+ name_ = rhs.name_;
+ age_ = rhs.age_;
+ return *this;
+ }
+
+protected:
+ template <typename Writer>
+ void Serialize(Writer& writer) const {
+ // This base class just write out name-value pairs, without wrapping within an object.
+ writer.String("name");
+#if RAPIDJSON_HAS_STDSTRING
+ writer.String(name_);
+#else
+ writer.String(name_.c_str(), static_cast<SizeType>(name_.length())); // Supplying length of string is faster.
+#endif
+ writer.String("age");
+ writer.Uint(age_);
+ }
+
+private:
+ std::string name_;
+ unsigned age_;
+};
+
+Person::~Person() {
+}
+
+class Education {
+public:
+ Education(const std::string& school, double GPA) : school_(school), GPA_(GPA) {}
+ Education(const Education& rhs) : school_(rhs.school_), GPA_(rhs.GPA_) {}
+
+ template <typename Writer>
+ void Serialize(Writer& writer) const {
+ writer.StartObject();
+
+ writer.String("school");
+#if RAPIDJSON_HAS_STDSTRING
+ writer.String(school_);
+#else
+ writer.String(school_.c_str(), static_cast<SizeType>(school_.length()));
+#endif
+
+ writer.String("GPA");
+ writer.Double(GPA_);
+
+ writer.EndObject();
+ }
+
+private:
+ std::string school_;
+ double GPA_;
+};
+
+class Dependent : public Person {
+public:
+ Dependent(const std::string& name, unsigned age, Education* education = 0) : Person(name, age), education_(education) {}
+ Dependent(const Dependent& rhs) : Person(rhs), education_(0) { education_ = (rhs.education_ == 0) ? 0 : new Education(*rhs.education_); }
+ virtual ~Dependent();
+
+ Dependent& operator=(const Dependent& rhs) {
+ if (this == &rhs)
+ return *this;
+ delete education_;
+ education_ = (rhs.education_ == 0) ? 0 : new Education(*rhs.education_);
+ return *this;
+ }
+
+ template <typename Writer>
+ void Serialize(Writer& writer) const {
+ writer.StartObject();
+
+ Person::Serialize(writer);
+
+ writer.String("education");
+ if (education_)
+ education_->Serialize(writer);
+ else
+ writer.Null();
+
+ writer.EndObject();
+ }
+
+private:
+
+ Education *education_;
+};
+
+Dependent::~Dependent() {
+ delete education_;
+}
+
+class Employee : public Person {
+public:
+ Employee(const std::string& name, unsigned age, bool married) : Person(name, age), dependents_(), married_(married) {}
+ Employee(const Employee& rhs) : Person(rhs), dependents_(rhs.dependents_), married_(rhs.married_) {}
+ virtual ~Employee();
+
+ Employee& operator=(const Employee& rhs) {
+ static_cast<Person&>(*this) = rhs;
+ dependents_ = rhs.dependents_;
+ married_ = rhs.married_;
+ return *this;
+ }
+
+ void AddDependent(const Dependent& dependent) {
+ dependents_.push_back(dependent);
+ }
+
+ template <typename Writer>
+ void Serialize(Writer& writer) const {
+ writer.StartObject();
+
+ Person::Serialize(writer);
+
+ writer.String("married");
+ writer.Bool(married_);
+
+ writer.String(("dependents"));
+ writer.StartArray();
+ for (std::vector<Dependent>::const_iterator dependentItr = dependents_.begin(); dependentItr != dependents_.end(); ++dependentItr)
+ dependentItr->Serialize(writer);
+ writer.EndArray();
+
+ writer.EndObject();
+ }
+
+private:
+ std::vector<Dependent> dependents_;
+ bool married_;
+};
+
+Employee::~Employee() {
+}
+
+int main(int, char*[]) {
+ std::vector<Employee> employees;
+
+ employees.push_back(Employee("Milo YIP", 34, true));
+ employees.back().AddDependent(Dependent("Lua YIP", 3, new Education("Happy Kindergarten", 3.5)));
+ employees.back().AddDependent(Dependent("Mio YIP", 1));
+
+ employees.push_back(Employee("Percy TSE", 30, false));
+
+ StringBuffer sb;
+ PrettyWriter<StringBuffer> writer(sb);
+
+ writer.StartArray();
+ for (std::vector<Employee>::const_iterator employeeItr = employees.begin(); employeeItr != employees.end(); ++employeeItr)
+ employeeItr->Serialize(writer);
+ writer.EndArray();
+
+ puts(sb.GetString());
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/simpledom/simpledom.cpp b/3rdparty/rapidjson/example/simpledom/simpledom.cpp
new file mode 100644
index 00000000000..80384199a92
--- /dev/null
+++ b/3rdparty/rapidjson/example/simpledom/simpledom.cpp
@@ -0,0 +1,29 @@
+// JSON simple example
+// This example does not handle errors.
+
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+
+int main() {
+ // 1. Parse a JSON string into DOM.
+ const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
+ Document d;
+ d.Parse(json);
+
+ // 2. Modify it by DOM.
+ Value& s = d["stars"];
+ s.SetInt(s.GetInt() + 1);
+
+ // 3. Stringify the DOM
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ d.Accept(writer);
+
+ // Output {"project":"rapidjson","stars":11}
+ std::cout << buffer.GetString() << std::endl;
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/simplereader/simplereader.cpp b/3rdparty/rapidjson/example/simplereader/simplereader.cpp
new file mode 100644
index 00000000000..edbdb6352c5
--- /dev/null
+++ b/3rdparty/rapidjson/example/simplereader/simplereader.cpp
@@ -0,0 +1,38 @@
+#include "rapidjson/reader.h"
+#include <iostream>
+
+using namespace rapidjson;
+using namespace std;
+
+struct MyHandler {
+ bool Null() { cout << "Null()" << endl; return true; }
+ bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
+ bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
+ bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; }
+ bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; }
+ bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; }
+ bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; }
+ bool String(const char* str, SizeType length, bool copy) {
+ cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
+ return true;
+ }
+ bool StartObject() { cout << "StartObject()" << endl; return true; }
+ bool Key(const char* str, SizeType length, bool copy) {
+ cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
+ return true;
+ }
+ bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
+ bool StartArray() { cout << "StartArray()" << endl; return true; }
+ bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
+};
+
+int main() {
+ const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
+
+ MyHandler handler;
+ Reader reader;
+ StringStream ss(json);
+ reader.Parse(ss, handler);
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/simplewriter/simplewriter.cpp b/3rdparty/rapidjson/example/simplewriter/simplewriter.cpp
new file mode 100644
index 00000000000..f8891504bc8
--- /dev/null
+++ b/3rdparty/rapidjson/example/simplewriter/simplewriter.cpp
@@ -0,0 +1,35 @@
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+using namespace std;
+
+int main() {
+ StringBuffer s;
+ Writer<StringBuffer> writer(s);
+
+ writer.StartObject();
+ writer.String("hello");
+ writer.String("world");
+ writer.String("t");
+ writer.Bool(true);
+ writer.String("f");
+ writer.Bool(false);
+ writer.String("n");
+ writer.Null();
+ writer.String("i");
+ writer.Uint(123);
+ writer.String("pi");
+ writer.Double(3.1416);
+ writer.String("a");
+ writer.StartArray();
+ for (unsigned i = 0; i < 4; i++)
+ writer.Uint(i);
+ writer.EndArray();
+ writer.EndObject();
+
+ cout << s.GetString() << endl;
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/example/tutorial/tutorial.cpp b/3rdparty/rapidjson/example/tutorial/tutorial.cpp
new file mode 100644
index 00000000000..c8bfcc14c18
--- /dev/null
+++ b/3rdparty/rapidjson/example/tutorial/tutorial.cpp
@@ -0,0 +1,151 @@
+// Hello World example
+// This example shows basic usage of DOM-style API.
+
+#include "rapidjson/document.h" // rapidjson's DOM-style API
+#include "rapidjson/prettywriter.h" // for stringify JSON
+#include <cstdio>
+
+using namespace rapidjson;
+using namespace std;
+
+int main(int, char*[]) {
+ ////////////////////////////////////////////////////////////////////////////
+ // 1. Parse a JSON text string to a document.
+
+ const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
+ printf("Original JSON:\n %s\n", json);
+
+ Document document; // Default template parameter uses UTF8 and MemoryPoolAllocator.
+
+#if 0
+ // "normal" parsing, decode strings to new buffers. Can use other input stream via ParseStream().
+ if (document.Parse(json).HasParseError())
+ return 1;
+#else
+ // In-situ parsing, decode strings directly in the source string. Source must be string.
+ char buffer[sizeof(json)];
+ memcpy(buffer, json, sizeof(json));
+ if (document.ParseInsitu(buffer).HasParseError())
+ return 1;
+#endif
+
+ printf("\nParsing to document succeeded.\n");
+
+ ////////////////////////////////////////////////////////////////////////////
+ // 2. Access values in document.
+
+ printf("\nAccess values in document:\n");
+ assert(document.IsObject()); // Document is a JSON value represents the root of DOM. Root can be either an object or array.
+
+ assert(document.HasMember("hello"));
+ assert(document["hello"].IsString());
+ printf("hello = %s\n", document["hello"].GetString());
+
+ // Since version 0.2, you can use single lookup to check the existing of member and its value:
+ Value::MemberIterator hello = document.FindMember("hello");
+ assert(hello != document.MemberEnd());
+ assert(hello->value.IsString());
+ assert(strcmp("world", hello->value.GetString()) == 0);
+ (void)hello;
+
+ assert(document["t"].IsBool()); // JSON true/false are bool. Can also uses more specific function IsTrue().
+ printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
+
+ assert(document["f"].IsBool());
+ printf("f = %s\n", document["f"].GetBool() ? "true" : "false");
+
+ printf("n = %s\n", document["n"].IsNull() ? "null" : "?");
+
+ assert(document["i"].IsNumber()); // Number is a JSON type, but C++ needs more specific type.
+ assert(document["i"].IsInt()); // In this case, IsUint()/IsInt64()/IsUInt64() also return true.
+ printf("i = %d\n", document["i"].GetInt()); // Alternative (int)document["i"]
+
+ assert(document["pi"].IsNumber());
+ assert(document["pi"].IsDouble());
+ printf("pi = %g\n", document["pi"].GetDouble());
+
+ {
+ const Value& a = document["a"]; // Using a reference for consecutive access is handy and faster.
+ assert(a.IsArray());
+ for (SizeType i = 0; i < a.Size(); i++) // rapidjson uses SizeType instead of size_t.
+ printf("a[%d] = %d\n", i, a[i].GetInt());
+
+ int y = a[0].GetInt();
+ (void)y;
+
+ // Iterating array with iterators
+ printf("a = ");
+ for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
+ printf("%d ", itr->GetInt());
+ printf("\n");
+ }
+
+ // Iterating object members
+ static const char* kTypeNames[] = { "Null", "False", "True", "Object", "Array", "String", "Number" };
+ for (Value::ConstMemberIterator itr = document.MemberBegin(); itr != document.MemberEnd(); ++itr)
+ printf("Type of member %s is %s\n", itr->name.GetString(), kTypeNames[itr->value.GetType()]);
+
+ ////////////////////////////////////////////////////////////////////////////
+ // 3. Modify values in document.
+
+ // Change i to a bigger number
+ {
+ uint64_t f20 = 1; // compute factorial of 20
+ for (uint64_t j = 1; j <= 20; j++)
+ f20 *= j;
+ document["i"] = f20; // Alternate form: document["i"].SetUint64(f20)
+ assert(!document["i"].IsInt()); // No longer can be cast as int or uint.
+ }
+
+ // Adding values to array.
+ {
+ Value& a = document["a"]; // This time we uses non-const reference.
+ Document::AllocatorType& allocator = document.GetAllocator();
+ for (int i = 5; i <= 10; i++)
+ a.PushBack(i, allocator); // May look a bit strange, allocator is needed for potentially realloc. We normally uses the document's.
+
+ // Fluent API
+ a.PushBack("Lua", allocator).PushBack("Mio", allocator);
+ }
+
+ // Making string values.
+
+ // This version of SetString() just store the pointer to the string.
+ // So it is for literal and string that exists within value's life-cycle.
+ {
+ document["hello"] = "rapidjson"; // This will invoke strlen()
+ // Faster version:
+ // document["hello"].SetString("rapidjson", 9);
+ }
+
+ // This version of SetString() needs an allocator, which means it will allocate a new buffer and copy the the string into the buffer.
+ Value author;
+ {
+ char buffer2[10];
+ int len = sprintf(buffer2, "%s %s", "Milo", "Yip"); // synthetic example of dynamically created string.
+
+ author.SetString(buffer2, static_cast<SizeType>(len), document.GetAllocator());
+ // Shorter but slower version:
+ // document["hello"].SetString(buffer, document.GetAllocator());
+
+ // Constructor version:
+ // Value author(buffer, len, document.GetAllocator());
+ // Value author(buffer, document.GetAllocator());
+ memset(buffer2, 0, sizeof(buffer2)); // For demonstration purpose.
+ }
+ // Variable 'buffer' is unusable now but 'author' has already made a copy.
+ document.AddMember("author", author, document.GetAllocator());
+
+ assert(author.IsNull()); // Move semantic for assignment. After this variable is assigned as a member, the variable becomes null.
+
+ ////////////////////////////////////////////////////////////////////////////
+ // 4. Stringify JSON
+
+ printf("\nModified JSON with reformatting:\n");
+ StringBuffer sb;
+ PrettyWriter<StringBuffer> writer(sb);
+ document.Accept(writer); // Accept() traverses the DOM and generates Handler events.
+ puts(sb.GetString());
+
+ return 0;
+}
diff --git a/3rdparty/rapidjson/include/rapidjson/allocators.h b/3rdparty/rapidjson/include/rapidjson/allocators.h
new file mode 100644
index 00000000000..c705969729a
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/allocators.h
@@ -0,0 +1,263 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_ALLOCATORS_H_
+#define RAPIDJSON_ALLOCATORS_H_
+
+#include "rapidjson.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// Allocator
+
+/*! \class rapidjson::Allocator
+ \brief Concept for allocating, resizing and freeing memory block.
+
+ Note that Malloc() and Realloc() are non-static but Free() is static.
+
+ So if an allocator need to support Free(), it needs to put its pointer in
+ the header of memory block.
+
+\code
+concept Allocator {
+ static const bool kNeedFree; //!< Whether this allocator needs to call Free().
+
+ // Allocate a memory block.
+ // \param size of the memory block in bytes.
+ // \returns pointer to the memory block.
+ void* Malloc(size_t size);
+
+ // Resize a memory block.
+ // \param originalPtr The pointer to current memory block. Null pointer is permitted.
+ // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)
+ // \param newSize the new size in bytes.
+ void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);
+
+ // Free a memory block.
+ // \param pointer to the memory block. Null pointer is permitted.
+ static void Free(void *ptr);
+};
+\endcode
+*/
+
+///////////////////////////////////////////////////////////////////////////////
+// CrtAllocator
+
+//! C-runtime library allocator.
+/*! This class is just wrapper for standard C library memory routines.
+ \note implements Allocator concept
+*/
+class CrtAllocator {
+public:
+ static const bool kNeedFree = true;
+ void* Malloc(size_t size) {
+ if (size) // behavior of malloc(0) is implementation defined.
+ return std::malloc(size);
+ else
+ return NULL; // standardize to returning NULL.
+ }
+ void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {
+ (void)originalSize;
+ if (newSize == 0) {
+ std::free(originalPtr);
+ return NULL;
+ }
+ return std::realloc(originalPtr, newSize);
+ }
+ static void Free(void *ptr) { std::free(ptr); }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// MemoryPoolAllocator
+
+//! Default memory allocator used by the parser and DOM.
+/*! This allocator allocate memory blocks from pre-allocated memory chunks.
+
+ It does not free memory blocks. And Realloc() only allocate new memory.
+
+ The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default.
+
+ User may also supply a buffer as the first chunk.
+
+ If the user-buffer is full then additional chunks are allocated by BaseAllocator.
+
+ The user-buffer is not deallocated by this allocator.
+
+ \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator.
+ \note implements Allocator concept
+*/
+template <typename BaseAllocator = CrtAllocator>
+class MemoryPoolAllocator {
+public:
+ static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator)
+
+ //! Constructor with chunkSize.
+ /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize.
+ \param baseAllocator The allocator for allocating memory chunks.
+ */
+ MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :
+ chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0)
+ {
+ }
+
+ //! Constructor with user-supplied buffer.
+ /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size.
+
+ The user buffer will not be deallocated when this allocator is destructed.
+
+ \param buffer User supplied buffer.
+ \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader).
+ \param chunkSize The size of memory chunk. The default is kDefaultChunkSize.
+ \param baseAllocator The allocator for allocating memory chunks.
+ */
+ MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :
+ chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0)
+ {
+ RAPIDJSON_ASSERT(buffer != 0);
+ RAPIDJSON_ASSERT(size > sizeof(ChunkHeader));
+ chunkHead_ = reinterpret_cast<ChunkHeader*>(buffer);
+ chunkHead_->capacity = size - sizeof(ChunkHeader);
+ chunkHead_->size = 0;
+ chunkHead_->next = 0;
+ }
+
+ //! Destructor.
+ /*! This deallocates all memory chunks, excluding the user-supplied buffer.
+ */
+ ~MemoryPoolAllocator() {
+ Clear();
+ RAPIDJSON_DELETE(ownBaseAllocator_);
+ }
+
+ //! Deallocates all memory chunks, excluding the user-supplied buffer.
+ void Clear() {
+ while (chunkHead_ && chunkHead_ != userBuffer_) {
+ ChunkHeader* next = chunkHead_->next;
+ baseAllocator_->Free(chunkHead_);
+ chunkHead_ = next;
+ }
+ if (chunkHead_ && chunkHead_ == userBuffer_)
+ chunkHead_->size = 0; // Clear user buffer
+ }
+
+ //! Computes the total capacity of allocated memory chunks.
+ /*! \return total capacity in bytes.
+ */
+ size_t Capacity() const {
+ size_t capacity = 0;
+ for (ChunkHeader* c = chunkHead_; c != 0; c = c->next)
+ capacity += c->capacity;
+ return capacity;
+ }
+
+ //! Computes the memory blocks allocated.
+ /*! \return total used bytes.
+ */
+ size_t Size() const {
+ size_t size = 0;
+ for (ChunkHeader* c = chunkHead_; c != 0; c = c->next)
+ size += c->size;
+ return size;
+ }
+
+ //! Allocates a memory block. (concept Allocator)
+ void* Malloc(size_t size) {
+ if (!size)
+ return NULL;
+
+ size = RAPIDJSON_ALIGN(size);
+ if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity)
+ AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size);
+
+ void *buffer = reinterpret_cast<char *>(chunkHead_) + RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size;
+ chunkHead_->size += size;
+ return buffer;
+ }
+
+ //! Resizes a memory block (concept Allocator)
+ void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {
+ if (originalPtr == 0)
+ return Malloc(newSize);
+
+ if (newSize == 0)
+ return NULL;
+
+ originalSize = RAPIDJSON_ALIGN(originalSize);
+ newSize = RAPIDJSON_ALIGN(newSize);
+
+ // Do not shrink if new size is smaller than original
+ if (originalSize >= newSize)
+ return originalPtr;
+
+ // Simply expand it if it is the last allocation and there is sufficient space
+ if (originalPtr == reinterpret_cast<char *>(chunkHead_) + RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size - originalSize) {
+ size_t increment = static_cast<size_t>(newSize - originalSize);
+ if (chunkHead_->size + increment <= chunkHead_->capacity) {
+ chunkHead_->size += increment;
+ return originalPtr;
+ }
+ }
+
+ // Realloc process: allocate and copy memory, do not free original buffer.
+ void* newBuffer = Malloc(newSize);
+ RAPIDJSON_ASSERT(newBuffer != 0); // Do not handle out-of-memory explicitly.
+ if (originalSize)
+ std::memcpy(newBuffer, originalPtr, originalSize);
+ return newBuffer;
+ }
+
+ //! Frees a memory block (concept Allocator)
+ static void Free(void *ptr) { (void)ptr; } // Do nothing
+
+private:
+ //! Copy constructor is not permitted.
+ MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */;
+ //! Copy assignment operator is not permitted.
+ MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */;
+
+ //! Creates a new chunk.
+ /*! \param capacity Capacity of the chunk in bytes.
+ */
+ void AddChunk(size_t capacity) {
+ if (!baseAllocator_)
+ ownBaseAllocator_ = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator());
+ ChunkHeader* chunk = reinterpret_cast<ChunkHeader*>(baseAllocator_->Malloc(RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + capacity));
+ chunk->capacity = capacity;
+ chunk->size = 0;
+ chunk->next = chunkHead_;
+ chunkHead_ = chunk;
+ }
+
+ static const int kDefaultChunkCapacity = 64 * 1024; //!< Default chunk capacity.
+
+ //! Chunk header for perpending to each chunk.
+ /*! Chunks are stored as a singly linked list.
+ */
+ struct ChunkHeader {
+ size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself).
+ size_t size; //!< Current size of allocated memory in bytes.
+ ChunkHeader *next; //!< Next chunk in the linked list.
+ };
+
+ ChunkHeader *chunkHead_; //!< Head of the chunk linked-list. Only the head chunk serves allocation.
+ size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated.
+ void *userBuffer_; //!< User supplied buffer.
+ BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks.
+ BaseAllocator* ownBaseAllocator_; //!< base allocator created by this object.
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_ENCODINGS_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/document.h b/3rdparty/rapidjson/include/rapidjson/document.h
new file mode 100644
index 00000000000..b3c9e0667e6
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/document.h
@@ -0,0 +1,2189 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_DOCUMENT_H_
+#define RAPIDJSON_DOCUMENT_H_
+
+/*! \file document.h */
+
+#include "reader.h"
+#include "internal/meta.h"
+#include "internal/strfunc.h"
+#include <new> // placement new
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+RAPIDJSON_DIAG_OFF(switch-enum)
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+#ifndef RAPIDJSON_NOMEMBERITERATORCLASS
+#include <iterator> // std::iterator, std::random_access_iterator_tag
+#endif
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+#include <utility> // std::move
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+// Forward declaration.
+template <typename Encoding, typename Allocator>
+class GenericValue;
+
+template <typename Encoding, typename Allocator, typename StackAllocator>
+class GenericDocument;
+
+//! Name-value pair in a JSON object value.
+/*!
+ This class was internal to GenericValue. It used to be a inner struct.
+ But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct.
+ https://code.google.com/p/rapidjson/issues/detail?id=64
+*/
+template <typename Encoding, typename Allocator>
+struct GenericMember {
+ GenericValue<Encoding, Allocator> name; //!< name of member (must be a string)
+ GenericValue<Encoding, Allocator> value; //!< value of member.
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericMemberIterator
+
+#ifndef RAPIDJSON_NOMEMBERITERATORCLASS
+
+//! (Constant) member iterator for a JSON object value
+/*!
+ \tparam Const Is this a constant iterator?
+ \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document)
+ \tparam Allocator Allocator type for allocating memory of object, array and string.
+
+ This class implements a Random Access Iterator for GenericMember elements
+ of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements].
+
+ \note This iterator implementation is mainly intended to avoid implicit
+ conversions from iterator values to \c NULL,
+ e.g. from GenericValue::FindMember.
+
+ \note Define \c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a
+ pointer-based implementation, if your platform doesn't provide
+ the C++ <iterator> header.
+
+ \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator
+ */
+template <bool Const, typename Encoding, typename Allocator>
+class GenericMemberIterator
+ : public std::iterator<std::random_access_iterator_tag
+ , typename internal::MaybeAddConst<Const,GenericMember<Encoding,Allocator> >::Type> {
+
+ friend class GenericValue<Encoding,Allocator>;
+ template <bool, typename, typename> friend class GenericMemberIterator;
+
+ typedef GenericMember<Encoding,Allocator> PlainType;
+ typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;
+ typedef std::iterator<std::random_access_iterator_tag,ValueType> BaseType;
+
+public:
+ //! Iterator type itself
+ typedef GenericMemberIterator Iterator;
+ //! Constant iterator type
+ typedef GenericMemberIterator<true,Encoding,Allocator> ConstIterator;
+ //! Non-constant iterator type
+ typedef GenericMemberIterator<false,Encoding,Allocator> NonConstIterator;
+
+ //! Pointer to (const) GenericMember
+ typedef typename BaseType::pointer Pointer;
+ //! Reference to (const) GenericMember
+ typedef typename BaseType::reference Reference;
+ //! Signed integer type (e.g. \c ptrdiff_t)
+ typedef typename BaseType::difference_type DifferenceType;
+
+ //! Default constructor (singular value)
+ /*! Creates an iterator pointing to no element.
+ \note All operations, except for comparisons, are undefined on such values.
+ */
+ GenericMemberIterator() : ptr_() {}
+
+ //! Iterator conversions to more const
+ /*!
+ \param it (Non-const) iterator to copy from
+
+ Allows the creation of an iterator from another GenericMemberIterator
+ that is "less const". Especially, creating a non-constant iterator
+ from a constant iterator are disabled:
+ \li const -> non-const (not ok)
+ \li const -> const (ok)
+ \li non-const -> const (ok)
+ \li non-const -> non-const (ok)
+
+ \note If the \c Const template parameter is already \c false, this
+ constructor effectively defines a regular copy-constructor.
+ Otherwise, the copy constructor is implicitly defined.
+ */
+ GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {}
+ Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; }
+
+ //! @name stepping
+ //@{
+ Iterator& operator++(){ ++ptr_; return *this; }
+ Iterator& operator--(){ --ptr_; return *this; }
+ Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; }
+ Iterator operator--(int){ Iterator old(*this); --ptr_; return old; }
+ //@}
+
+ //! @name increment/decrement
+ //@{
+ Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); }
+ Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); }
+
+ Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; }
+ Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; }
+ //@}
+
+ //! @name relations
+ //@{
+ bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; }
+ bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; }
+ bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; }
+ bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; }
+ bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; }
+ bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; }
+ //@}
+
+ //! @name dereference
+ //@{
+ Reference operator*() const { return *ptr_; }
+ Pointer operator->() const { return ptr_; }
+ Reference operator[](DifferenceType n) const { return ptr_[n]; }
+ //@}
+
+ //! Distance
+ DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; }
+
+private:
+ //! Internal constructor from plain pointer
+ explicit GenericMemberIterator(Pointer p) : ptr_(p) {}
+
+ Pointer ptr_; //!< raw pointer
+};
+
+#else // RAPIDJSON_NOMEMBERITERATORCLASS
+
+// class-based member iterator implementation disabled, use plain pointers
+
+template <bool Const, typename Encoding, typename Allocator>
+struct GenericMemberIterator;
+
+//! non-const GenericMemberIterator
+template <typename Encoding, typename Allocator>
+struct GenericMemberIterator<false,Encoding,Allocator> {
+ //! use plain pointer as iterator type
+ typedef GenericMember<Encoding,Allocator>* Iterator;
+};
+//! const GenericMemberIterator
+template <typename Encoding, typename Allocator>
+struct GenericMemberIterator<true,Encoding,Allocator> {
+ //! use plain const pointer as iterator type
+ typedef const GenericMember<Encoding,Allocator>* Iterator;
+};
+
+#endif // RAPIDJSON_NOMEMBERITERATORCLASS
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericStringRef
+
+//! Reference to a constant string (not taking a copy)
+/*!
+ \tparam CharType character type of the string
+
+ This helper class is used to automatically infer constant string
+ references for string literals, especially from \c const \b (!)
+ character arrays.
+
+ The main use is for creating JSON string values without copying the
+ source string via an \ref Allocator. This requires that the referenced
+ string pointers have a sufficient lifetime, which exceeds the lifetime
+ of the associated GenericValue.
+
+ \b Example
+ \code
+ Value v("foo"); // ok, no need to copy & calculate length
+ const char foo[] = "foo";
+ v.SetString(foo); // ok
+
+ const char* bar = foo;
+ // Value x(bar); // not ok, can't rely on bar's lifetime
+ Value x(StringRef(bar)); // lifetime explicitly guaranteed by user
+ Value y(StringRef(bar, 3)); // ok, explicitly pass length
+ \endcode
+
+ \see StringRef, GenericValue::SetString
+*/
+template<typename CharType>
+struct GenericStringRef {
+ typedef CharType Ch; //!< character type of the string
+
+ //! Create string reference from \c const character array
+#ifndef __clang__ // -Wdocumentation
+ /*!
+ This constructor implicitly creates a constant string reference from
+ a \c const character array. It has better performance than
+ \ref StringRef(const CharType*) by inferring the string \ref length
+ from the array length, and also supports strings containing null
+ characters.
+
+ \tparam N length of the string, automatically inferred
+
+ \param str Constant character array, lifetime assumed to be longer
+ than the use of the string in e.g. a GenericValue
+
+ \post \ref s == str
+
+ \note Constant complexity.
+ \note There is a hidden, private overload to disallow references to
+ non-const character arrays to be created via this constructor.
+ By this, e.g. function-scope arrays used to be filled via
+ \c snprintf are excluded from consideration.
+ In such cases, the referenced string should be \b copied to the
+ GenericValue instead.
+ */
+#endif
+ template<SizeType N>
+ GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT
+ : s(str), length(N-1) {}
+
+ //! Explicitly create string reference from \c const character pointer
+#ifndef __clang__ // -Wdocumentation
+ /*!
+ This constructor can be used to \b explicitly create a reference to
+ a constant string pointer.
+
+ \see StringRef(const CharType*)
+
+ \param str Constant character pointer, lifetime assumed to be longer
+ than the use of the string in e.g. a GenericValue
+
+ \post \ref s == str
+
+ \note There is a hidden, private overload to disallow references to
+ non-const character arrays to be created via this constructor.
+ By this, e.g. function-scope arrays used to be filled via
+ \c snprintf are excluded from consideration.
+ In such cases, the referenced string should be \b copied to the
+ GenericValue instead.
+ */
+#endif
+ explicit GenericStringRef(const CharType* str)
+ : s(str), length(internal::StrLen(str)){ RAPIDJSON_ASSERT(s != NULL); }
+
+ //! Create constant string reference from pointer and length
+#ifndef __clang__ // -Wdocumentation
+ /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
+ \param len length of the string, excluding the trailing NULL terminator
+
+ \post \ref s == str && \ref length == len
+ \note Constant complexity.
+ */
+#endif
+ GenericStringRef(const CharType* str, SizeType len)
+ : s(str), length(len) { RAPIDJSON_ASSERT(s != NULL); }
+
+ //! implicit conversion to plain CharType pointer
+ operator const Ch *() const { return s; }
+
+ const Ch* const s; //!< plain CharType pointer
+ const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
+
+private:
+ //! Disallow construction from non-const array
+ template<SizeType N>
+ GenericStringRef(CharType (&str)[N]) /* = delete */;
+};
+
+//! Mark a character pointer as constant string
+/*! Mark a plain character pointer as a "string literal". This function
+ can be used to avoid copying a character string to be referenced as a
+ value in a JSON GenericValue object, if the string's lifetime is known
+ to be valid long enough.
+ \tparam CharType Character type of the string
+ \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
+ \return GenericStringRef string reference object
+ \relatesalso GenericStringRef
+
+ \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember
+*/
+template<typename CharType>
+inline GenericStringRef<CharType> StringRef(const CharType* str) {
+ return GenericStringRef<CharType>(str, internal::StrLen(str));
+}
+
+//! Mark a character pointer as constant string
+/*! Mark a plain character pointer as a "string literal". This function
+ can be used to avoid copying a character string to be referenced as a
+ value in a JSON GenericValue object, if the string's lifetime is known
+ to be valid long enough.
+
+ This version has better performance with supplied length, and also
+ supports string containing null characters.
+
+ \tparam CharType character type of the string
+ \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
+ \param length The length of source string.
+ \return GenericStringRef string reference object
+ \relatesalso GenericStringRef
+*/
+template<typename CharType>
+inline GenericStringRef<CharType> StringRef(const CharType* str, size_t length) {
+ return GenericStringRef<CharType>(str, SizeType(length));
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+//! Mark a string object as constant string
+/*! Mark a string object (e.g. \c std::string) as a "string literal".
+ This function can be used to avoid copying a string to be referenced as a
+ value in a JSON GenericValue object, if the string's lifetime is known
+ to be valid long enough.
+
+ \tparam CharType character type of the string
+ \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
+ \return GenericStringRef string reference object
+ \relatesalso GenericStringRef
+ \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
+*/
+template<typename CharType>
+inline GenericStringRef<CharType> StringRef(const std::basic_string<CharType>& str) {
+ return GenericStringRef<CharType>(str.data(), SizeType(str.size()));
+}
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericValue type traits
+namespace internal {
+
+template <typename T, typename Encoding = void, typename Allocator = void>
+struct IsGenericValueImpl : FalseType {};
+
+// select candidates according to nested encoding and allocator types
+template <typename T> struct IsGenericValueImpl<T, typename Void<typename T::EncodingType>::Type, typename Void<typename T::AllocatorType>::Type>
+ : IsBaseOf<GenericValue<typename T::EncodingType, typename T::AllocatorType>, T>::Type {};
+
+// helper to match arbitrary GenericValue instantiations, including derived classes
+template <typename T> struct IsGenericValue : IsGenericValueImpl<T>::Type {};
+
+} // namespace internal
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericValue
+
+//! Represents a JSON value. Use Value for UTF8 encoding and default allocator.
+/*!
+ A JSON value can be one of 7 types. This class is a variant type supporting
+ these types.
+
+ Use the Value if UTF8 and default allocator
+
+ \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document)
+ \tparam Allocator Allocator type for allocating memory of object, array and string.
+*/
+template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
+class GenericValue {
+public:
+ //! Name-value pair in an object.
+ typedef GenericMember<Encoding, Allocator> Member;
+ typedef Encoding EncodingType; //!< Encoding type from template parameter.
+ typedef Allocator AllocatorType; //!< Allocator type from template parameter.
+ typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding.
+ typedef GenericStringRef<Ch> StringRefType; //!< Reference to a constant string
+ typedef typename GenericMemberIterator<false,Encoding,Allocator>::Iterator MemberIterator; //!< Member iterator for iterating in object.
+ typedef typename GenericMemberIterator<true,Encoding,Allocator>::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object.
+ typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array.
+ typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array.
+ typedef GenericValue<Encoding, Allocator> ValueType; //!< Value type of itself.
+
+ //!@name Constructors and destructor.
+ //@{
+
+ //! Default constructor creates a null value.
+ GenericValue() RAPIDJSON_NOEXCEPT : data_(), flags_(kNullFlag) {}
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ //! Move constructor in C++11
+ GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_), flags_(rhs.flags_) {
+ rhs.flags_ = kNullFlag; // give up contents
+ }
+#endif
+
+private:
+ //! Copy constructor is not permitted.
+ GenericValue(const GenericValue& rhs);
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ //! Moving from a GenericDocument is not permitted.
+ template <typename StackAllocator>
+ GenericValue(GenericDocument<Encoding,Allocator,StackAllocator>&& rhs);
+
+ //! Move assignment from a GenericDocument is not permitted.
+ template <typename StackAllocator>
+ GenericValue& operator=(GenericDocument<Encoding,Allocator,StackAllocator>&& rhs);
+#endif
+
+public:
+
+ //! Constructor with JSON value type.
+ /*! This creates a Value of specified type with default content.
+ \param type Type of the value.
+ \note Default content for number is zero.
+ */
+ explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_(), flags_() {
+ static const unsigned defaultFlags[7] = {
+ kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag,
+ kNumberAnyFlag
+ };
+ RAPIDJSON_ASSERT(type <= kNumberType);
+ flags_ = defaultFlags[type];
+
+ // Use ShortString to store empty string.
+ if (type == kStringType)
+ data_.ss.SetLength(0);
+ }
+
+ //! Explicit copy constructor (with allocator)
+ /*! Creates a copy of a Value by using the given Allocator
+ \tparam SourceAllocator allocator of \c rhs
+ \param rhs Value to copy from (read-only)
+ \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator().
+ \see CopyFrom()
+ */
+ template< typename SourceAllocator >
+ GenericValue(const GenericValue<Encoding, SourceAllocator>& rhs, Allocator & allocator);
+
+ //! Constructor for boolean value.
+ /*! \param b Boolean value
+ \note This constructor is limited to \em real boolean values and rejects
+ implicitly converted types like arbitrary pointers. Use an explicit cast
+ to \c bool, if you want to construct a boolean JSON value in such cases.
+ */
+#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen
+ template <typename T>
+ explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame<bool, T>))) RAPIDJSON_NOEXCEPT // See #472
+#else
+ explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT
+#endif
+ : data_(), flags_(b ? kTrueFlag : kFalseFlag) {
+ // safe-guard against failing SFINAE
+ RAPIDJSON_STATIC_ASSERT((internal::IsSame<bool,T>::Value));
+ }
+
+ //! Constructor for int value.
+ explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberIntFlag) {
+ data_.n.i64 = i;
+ if (i >= 0)
+ flags_ |= kUintFlag | kUint64Flag;
+ }
+
+ //! Constructor for unsigned value.
+ explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUintFlag) {
+ data_.n.u64 = u;
+ if (!(u & 0x80000000))
+ flags_ |= kIntFlag | kInt64Flag;
+ }
+
+ //! Constructor for int64_t value.
+ explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberInt64Flag) {
+ data_.n.i64 = i64;
+ if (i64 >= 0) {
+ flags_ |= kNumberUint64Flag;
+ if (!(static_cast<uint64_t>(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000)))
+ flags_ |= kUintFlag;
+ if (!(static_cast<uint64_t>(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))
+ flags_ |= kIntFlag;
+ }
+ else if (i64 >= static_cast<int64_t>(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))
+ flags_ |= kIntFlag;
+ }
+
+ //! Constructor for uint64_t value.
+ explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUint64Flag) {
+ data_.n.u64 = u64;
+ if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000)))
+ flags_ |= kInt64Flag;
+ if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000)))
+ flags_ |= kUintFlag;
+ if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))
+ flags_ |= kIntFlag;
+ }
+
+ //! Constructor for double value.
+ explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberDoubleFlag) { data_.n.d = d; }
+
+ //! Constructor for constant string (i.e. do not make a copy of string)
+ GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_(), flags_() { SetStringRaw(StringRef(s, length)); }
+
+ //! Constructor for constant string (i.e. do not make a copy of string)
+ explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_(), flags_() { SetStringRaw(s); }
+
+ //! Constructor for copy-string (i.e. do make a copy of string)
+ GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s, length), allocator); }
+
+ //! Constructor for copy-string (i.e. do make a copy of string)
+ GenericValue(const Ch*s, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s), allocator); }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Constructor for copy-string from a string object (i.e. do make a copy of string)
+ /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
+ */
+ GenericValue(const std::basic_string<Ch>& s, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s), allocator); }
+#endif
+
+ //! Destructor.
+ /*! Need to destruct elements of array, members of object, or copy-string.
+ */
+ ~GenericValue() {
+ if (Allocator::kNeedFree) { // Shortcut by Allocator's trait
+ switch(flags_) {
+ case kArrayFlag:
+ for (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v)
+ v->~GenericValue();
+ Allocator::Free(data_.a.elements);
+ break;
+
+ case kObjectFlag:
+ for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)
+ m->~Member();
+ Allocator::Free(data_.o.members);
+ break;
+
+ case kCopyStringFlag:
+ Allocator::Free(const_cast<Ch*>(data_.s.str));
+ break;
+
+ default:
+ break; // Do nothing for other types.
+ }
+ }
+ }
+
+ //@}
+
+ //!@name Assignment operators
+ //@{
+
+ //! Assignment with move semantics.
+ /*! \param rhs Source of the assignment. It will become a null value after assignment.
+ */
+ GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT {
+ RAPIDJSON_ASSERT(this != &rhs);
+ this->~GenericValue();
+ RawAssign(rhs);
+ return *this;
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ //! Move assignment in C++11
+ GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT {
+ return *this = rhs.Move();
+ }
+#endif
+
+ //! Assignment of constant string reference (no copy)
+ /*! \param str Constant string reference to be assigned
+ \note This overload is needed to avoid clashes with the generic primitive type assignment overload below.
+ \see GenericStringRef, operator=(T)
+ */
+ GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT {
+ GenericValue s(str);
+ return *this = s;
+ }
+
+ //! Assignment with primitive types.
+ /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
+ \param value The value to be assigned.
+
+ \note The source type \c T explicitly disallows all pointer types,
+ especially (\c const) \ref Ch*. This helps avoiding implicitly
+ referencing character strings with insufficient lifetime, use
+ \ref SetString(const Ch*, Allocator&) (for copying) or
+ \ref StringRef() (to explicitly mark the pointer as constant) instead.
+ All other pointer types would implicitly convert to \c bool,
+ use \ref SetBool() instead.
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer<T>), (GenericValue&))
+ operator=(T value) {
+ GenericValue v(value);
+ return *this = v;
+ }
+
+ //! Deep-copy assignment from Value
+ /*! Assigns a \b copy of the Value to the current Value object
+ \tparam SourceAllocator Allocator type of \c rhs
+ \param rhs Value to copy from (read-only)
+ \param allocator Allocator to use for copying
+ */
+ template <typename SourceAllocator>
+ GenericValue& CopyFrom(const GenericValue<Encoding, SourceAllocator>& rhs, Allocator& allocator) {
+ RAPIDJSON_ASSERT(static_cast<void*>(this) != static_cast<void const*>(&rhs));
+ this->~GenericValue();
+ new (this) GenericValue(rhs, allocator);
+ return *this;
+ }
+
+ //! Exchange the contents of this value with those of other.
+ /*!
+ \param other Another value.
+ \note Constant complexity.
+ */
+ GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT {
+ GenericValue temp;
+ temp.RawAssign(*this);
+ RawAssign(other);
+ other.RawAssign(temp);
+ return *this;
+ }
+
+ //! free-standing swap function helper
+ /*!
+ Helper function to enable support for common swap implementation pattern based on \c std::swap:
+ \code
+ void swap(MyClass& a, MyClass& b) {
+ using std::swap;
+ swap(a.value, b.value);
+ // ...
+ }
+ \endcode
+ \see Swap()
+ */
+ friend inline void swap(GenericValue& a, GenericValue& b) RAPIDJSON_NOEXCEPT { a.Swap(b); }
+
+ //! Prepare Value for move semantics
+ /*! \return *this */
+ GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; }
+ //@}
+
+ //!@name Equal-to and not-equal-to operators
+ //@{
+ //! Equal-to operator
+ /*!
+ \note If an object contains duplicated named member, comparing equality with any object is always \c false.
+ \note Linear time complexity (number of all values in the subtree and total lengths of all strings).
+ */
+ template <typename SourceAllocator>
+ bool operator==(const GenericValue<Encoding, SourceAllocator>& rhs) const {
+ typedef GenericValue<Encoding, SourceAllocator> RhsType;
+ if (GetType() != rhs.GetType())
+ return false;
+
+ switch (GetType()) {
+ case kObjectType: // Warning: O(n^2) inner-loop
+ if (data_.o.size != rhs.data_.o.size)
+ return false;
+ for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) {
+ typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name);
+ if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value)
+ return false;
+ }
+ return true;
+
+ case kArrayType:
+ if (data_.a.size != rhs.data_.a.size)
+ return false;
+ for (SizeType i = 0; i < data_.a.size; i++)
+ if ((*this)[i] != rhs[i])
+ return false;
+ return true;
+
+ case kStringType:
+ return StringEqual(rhs);
+
+ case kNumberType:
+ if (IsDouble() || rhs.IsDouble()) {
+ double a = GetDouble(); // May convert from integer to double.
+ double b = rhs.GetDouble(); // Ditto
+ return a >= b && a <= b; // Prevent -Wfloat-equal
+ }
+ else
+ return data_.n.u64 == rhs.data_.n.u64;
+
+ default:
+ return true;
+ }
+ }
+
+ //! Equal-to operator with const C-string pointer
+ bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Equal-to operator with string object
+ /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
+ */
+ bool operator==(const std::basic_string<Ch>& rhs) const { return *this == GenericValue(StringRef(rhs)); }
+#endif
+
+ //! Equal-to operator with primitive types
+ /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false
+ */
+ template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>,internal::IsGenericValue<T> >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); }
+
+ //! Not-equal-to operator
+ /*! \return !(*this == rhs)
+ */
+ template <typename SourceAllocator>
+ bool operator!=(const GenericValue<Encoding, SourceAllocator>& rhs) const { return !(*this == rhs); }
+
+ //! Not-equal-to operator with const C-string pointer
+ bool operator!=(const Ch* rhs) const { return !(*this == rhs); }
+
+ //! Not-equal-to operator with arbitrary types
+ /*! \return !(*this == rhs)
+ */
+ template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }
+
+ //! Equal-to operator with arbitrary types (symmetric version)
+ /*! \return (rhs == lhs)
+ */
+ template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; }
+
+ //! Not-Equal-to operator with arbitrary types (symmetric version)
+ /*! \return !(rhs == lhs)
+ */
+ template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); }
+ //@}
+
+ //!@name Type
+ //@{
+
+ Type GetType() const { return static_cast<Type>(flags_ & kTypeMask); }
+ bool IsNull() const { return flags_ == kNullFlag; }
+ bool IsFalse() const { return flags_ == kFalseFlag; }
+ bool IsTrue() const { return flags_ == kTrueFlag; }
+ bool IsBool() const { return (flags_ & kBoolFlag) != 0; }
+ bool IsObject() const { return flags_ == kObjectFlag; }
+ bool IsArray() const { return flags_ == kArrayFlag; }
+ bool IsNumber() const { return (flags_ & kNumberFlag) != 0; }
+ bool IsInt() const { return (flags_ & kIntFlag) != 0; }
+ bool IsUint() const { return (flags_ & kUintFlag) != 0; }
+ bool IsInt64() const { return (flags_ & kInt64Flag) != 0; }
+ bool IsUint64() const { return (flags_ & kUint64Flag) != 0; }
+ bool IsDouble() const { return (flags_ & kDoubleFlag) != 0; }
+ bool IsString() const { return (flags_ & kStringFlag) != 0; }
+
+ // Checks whether a number can be losslessly converted to a double.
+ bool IsLosslessDouble() const {
+ if (!IsNumber()) return false;
+ if (IsUint64()) {
+ uint64_t u = GetUint64();
+ volatile double d = static_cast<double>(u);
+ return static_cast<uint64_t>(d) == u;
+ }
+ if (IsInt64()) {
+ int64_t i = GetInt64();
+ volatile double d = static_cast<double>(i);
+ return static_cast< int64_t>(d) == i;
+ }
+ return true; // double, int, uint are always lossless
+ }
+
+ // Checks whether a number is a float (possible lossy).
+ bool IsFloat() const {
+ if ((flags_ & kDoubleFlag) == 0)
+ return false;
+ double d = GetDouble();
+ return d >= -3.4028234e38 && d <= 3.4028234e38;
+ }
+ // Checks whether a number can be losslessly converted to a float.
+ bool IsLosslessFloat() const {
+ if (!IsNumber()) return false;
+ double a = GetDouble();
+ double b = static_cast<double>(static_cast<float>(a));
+ return a >= b && a <= b; // Prevent -Wfloat-equal
+ }
+
+ //@}
+
+ //!@name Null
+ //@{
+
+ GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; }
+
+ //@}
+
+ //!@name Bool
+ //@{
+
+ bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return flags_ == kTrueFlag; }
+ //!< Set boolean value
+ /*! \post IsBool() == true */
+ GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; }
+
+ //@}
+
+ //!@name Object
+ //@{
+
+ //! Set this value as an empty object.
+ /*! \post IsObject() == true */
+ GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; }
+
+ //! Get the number of members in the object.
+ SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; }
+
+ //! Check whether the object is empty.
+ bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; }
+
+ //! Get a value from an object associated with the name.
+ /*! \pre IsObject() == true
+ \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType))
+ \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7.
+ Since 0.2, if the name is not correct, it will assert.
+ If user is unsure whether a member exists, user should use HasMember() first.
+ A better approach is to use FindMember().
+ \note Linear time complexity.
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >),(GenericValue&)) operator[](T* name) {
+ GenericValue n(StringRef(name));
+ return (*this)[n];
+ }
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast<GenericValue&>(*this)[name]; }
+
+ //! Get a value from an object associated with the name.
+ /*! \pre IsObject() == true
+ \tparam SourceAllocator Allocator of the \c name value
+
+ \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen().
+ And it can also handle strings with embedded null characters.
+
+ \note Linear time complexity.
+ */
+ template <typename SourceAllocator>
+ GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) {
+ MemberIterator member = FindMember(name);
+ if (member != MemberEnd())
+ return member->value;
+ else {
+ RAPIDJSON_ASSERT(false); // see above note
+
+ // This will generate -Wexit-time-destructors in clang
+ // static GenericValue NullValue;
+ // return NullValue;
+
+ // Use static buffer and placement-new to prevent destruction
+ static char buffer[sizeof(GenericValue)];
+ return *new (buffer) GenericValue();
+ }
+ }
+ template <typename SourceAllocator>
+ const GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) const { return const_cast<GenericValue&>(*this)[name]; }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Get a value from an object associated with name (string object).
+ GenericValue& operator[](const std::basic_string<Ch>& name) { return (*this)[GenericValue(StringRef(name))]; }
+ const GenericValue& operator[](const std::basic_string<Ch>& name) const { return (*this)[GenericValue(StringRef(name))]; }
+#endif
+
+ //! Const member iterator
+ /*! \pre IsObject() == true */
+ ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(data_.o.members); }
+ //! Const \em past-the-end member iterator
+ /*! \pre IsObject() == true */
+ ConstMemberIterator MemberEnd() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(data_.o.members + data_.o.size); }
+ //! Member iterator
+ /*! \pre IsObject() == true */
+ MemberIterator MemberBegin() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(data_.o.members); }
+ //! \em Past-the-end member iterator
+ /*! \pre IsObject() == true */
+ MemberIterator MemberEnd() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(data_.o.members + data_.o.size); }
+
+ //! Check whether a member exists in the object.
+ /*!
+ \param name Member name to be searched.
+ \pre IsObject() == true
+ \return Whether a member with that name exists.
+ \note It is better to use FindMember() directly if you need the obtain the value as well.
+ \note Linear time complexity.
+ */
+ bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Check whether a member exists in the object with string object.
+ /*!
+ \param name Member name to be searched.
+ \pre IsObject() == true
+ \return Whether a member with that name exists.
+ \note It is better to use FindMember() directly if you need the obtain the value as well.
+ \note Linear time complexity.
+ */
+ bool HasMember(const std::basic_string<Ch>& name) const { return FindMember(name) != MemberEnd(); }
+#endif
+
+ //! Check whether a member exists in the object with GenericValue name.
+ /*!
+ This version is faster because it does not need a StrLen(). It can also handle string with null character.
+ \param name Member name to be searched.
+ \pre IsObject() == true
+ \return Whether a member with that name exists.
+ \note It is better to use FindMember() directly if you need the obtain the value as well.
+ \note Linear time complexity.
+ */
+ template <typename SourceAllocator>
+ bool HasMember(const GenericValue<Encoding, SourceAllocator>& name) const { return FindMember(name) != MemberEnd(); }
+
+ //! Find member by name.
+ /*!
+ \param name Member name to be searched.
+ \pre IsObject() == true
+ \return Iterator to member, if it exists.
+ Otherwise returns \ref MemberEnd().
+
+ \note Earlier versions of Rapidjson returned a \c NULL pointer, in case
+ the requested member doesn't exist. For consistency with e.g.
+ \c std::map, this has been changed to MemberEnd() now.
+ \note Linear time complexity.
+ */
+ MemberIterator FindMember(const Ch* name) {
+ GenericValue n(StringRef(name));
+ return FindMember(n);
+ }
+
+ ConstMemberIterator FindMember(const Ch* name) const { return const_cast<GenericValue&>(*this).FindMember(name); }
+
+ //! Find member by name.
+ /*!
+ This version is faster because it does not need a StrLen(). It can also handle string with null character.
+ \param name Member name to be searched.
+ \pre IsObject() == true
+ \return Iterator to member, if it exists.
+ Otherwise returns \ref MemberEnd().
+
+ \note Earlier versions of Rapidjson returned a \c NULL pointer, in case
+ the requested member doesn't exist. For consistency with e.g.
+ \c std::map, this has been changed to MemberEnd() now.
+ \note Linear time complexity.
+ */
+ template <typename SourceAllocator>
+ MemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) {
+ RAPIDJSON_ASSERT(IsObject());
+ RAPIDJSON_ASSERT(name.IsString());
+ MemberIterator member = MemberBegin();
+ for ( ; member != MemberEnd(); ++member)
+ if (name.StringEqual(member->name))
+ break;
+ return member;
+ }
+ template <typename SourceAllocator> ConstMemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) const { return const_cast<GenericValue&>(*this).FindMember(name); }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Find member by string object name.
+ /*!
+ \param name Member name to be searched.
+ \pre IsObject() == true
+ \return Iterator to member, if it exists.
+ Otherwise returns \ref MemberEnd().
+ */
+ MemberIterator FindMember(const std::basic_string<Ch>& name) { return FindMember(StringRef(name)); }
+ ConstMemberIterator FindMember(const std::basic_string<Ch>& name) const { return FindMember(StringRef(name)); }
+#endif
+
+ //! Add a member (name-value pair) to the object.
+ /*! \param name A string value as name of member.
+ \param value Value of any type.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \note The ownership of \c name and \c value will be transferred to this object on success.
+ \pre IsObject() && name.IsString()
+ \post name.IsNull() && value.IsNull()
+ \note Amortized Constant time complexity.
+ */
+ GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) {
+ RAPIDJSON_ASSERT(IsObject());
+ RAPIDJSON_ASSERT(name.IsString());
+
+ Object& o = data_.o;
+ if (o.size >= o.capacity) {
+ if (o.capacity == 0) {
+ o.capacity = kDefaultObjectCapacity;
+ o.members = reinterpret_cast<Member*>(allocator.Malloc(o.capacity * sizeof(Member)));
+ }
+ else {
+ SizeType oldCapacity = o.capacity;
+ o.capacity += (oldCapacity + 1) / 2; // grow by factor 1.5
+ o.members = reinterpret_cast<Member*>(allocator.Realloc(o.members, oldCapacity * sizeof(Member), o.capacity * sizeof(Member)));
+ }
+ }
+ o.members[o.size].name.RawAssign(name);
+ o.members[o.size].value.RawAssign(value);
+ o.size++;
+ return *this;
+ }
+
+ //! Add a constant string value as member (name-value pair) to the object.
+ /*! \param name A string value as name of member.
+ \param value constant string reference as value of member.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \pre IsObject()
+ \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below.
+ \note Amortized Constant time complexity.
+ */
+ GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) {
+ GenericValue v(value);
+ return AddMember(name, v, allocator);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Add a string object as member (name-value pair) to the object.
+ /*! \param name A string value as name of member.
+ \param value constant string reference as value of member.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \pre IsObject()
+ \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below.
+ \note Amortized Constant time complexity.
+ */
+ GenericValue& AddMember(GenericValue& name, std::basic_string<Ch>& value, Allocator& allocator) {
+ GenericValue v(value, allocator);
+ return AddMember(name, v, allocator);
+ }
+#endif
+
+ //! Add any primitive value as member (name-value pair) to the object.
+ /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
+ \param name A string value as name of member.
+ \param value Value of primitive type \c T as value of member
+ \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \pre IsObject()
+
+ \note The source type \c T explicitly disallows all pointer types,
+ especially (\c const) \ref Ch*. This helps avoiding implicitly
+ referencing character strings with insufficient lifetime, use
+ \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref
+ AddMember(StringRefType, StringRefType, Allocator&).
+ All other pointer types would implicitly convert to \c bool,
+ use an explicit cast instead, if needed.
+ \note Amortized Constant time complexity.
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))
+ AddMember(GenericValue& name, T value, Allocator& allocator) {
+ GenericValue v(value);
+ return AddMember(name, v, allocator);
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) {
+ return AddMember(name, value, allocator);
+ }
+ GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) {
+ return AddMember(name, value, allocator);
+ }
+ GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) {
+ return AddMember(name, value, allocator);
+ }
+ GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) {
+ GenericValue n(name);
+ return AddMember(n, value, allocator);
+ }
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+
+ //! Add a member (name-value pair) to the object.
+ /*! \param name A constant string reference as name of member.
+ \param value Value of any type.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \note The ownership of \c value will be transferred to this object on success.
+ \pre IsObject()
+ \post value.IsNull()
+ \note Amortized Constant time complexity.
+ */
+ GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) {
+ GenericValue n(name);
+ return AddMember(n, value, allocator);
+ }
+
+ //! Add a constant string value as member (name-value pair) to the object.
+ /*! \param name A constant string reference as name of member.
+ \param value constant string reference as value of member.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \pre IsObject()
+ \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below.
+ \note Amortized Constant time complexity.
+ */
+ GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) {
+ GenericValue v(value);
+ return AddMember(name, v, allocator);
+ }
+
+ //! Add any primitive value as member (name-value pair) to the object.
+ /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
+ \param name A constant string reference as name of member.
+ \param value Value of primitive type \c T as value of member
+ \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \pre IsObject()
+
+ \note The source type \c T explicitly disallows all pointer types,
+ especially (\c const) \ref Ch*. This helps avoiding implicitly
+ referencing character strings with insufficient lifetime, use
+ \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref
+ AddMember(StringRefType, StringRefType, Allocator&).
+ All other pointer types would implicitly convert to \c bool,
+ use an explicit cast instead, if needed.
+ \note Amortized Constant time complexity.
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))
+ AddMember(StringRefType name, T value, Allocator& allocator) {
+ GenericValue n(name);
+ return AddMember(n, value, allocator);
+ }
+
+ //! Remove all members in the object.
+ /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged.
+ \note Linear time complexity.
+ */
+ void RemoveAllMembers() {
+ RAPIDJSON_ASSERT(IsObject());
+ for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)
+ m->~Member();
+ data_.o.size = 0;
+ }
+
+ //! Remove a member in object by its name.
+ /*! \param name Name of member to be removed.
+ \return Whether the member existed.
+ \note This function may reorder the object members. Use \ref
+ EraseMember(ConstMemberIterator) if you need to preserve the
+ relative order of the remaining members.
+ \note Linear time complexity.
+ */
+ bool RemoveMember(const Ch* name) {
+ GenericValue n(StringRef(name));
+ return RemoveMember(n);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ bool RemoveMember(const std::basic_string<Ch>& name) { return RemoveMember(GenericValue(StringRef(name))); }
+#endif
+
+ template <typename SourceAllocator>
+ bool RemoveMember(const GenericValue<Encoding, SourceAllocator>& name) {
+ MemberIterator m = FindMember(name);
+ if (m != MemberEnd()) {
+ RemoveMember(m);
+ return true;
+ }
+ else
+ return false;
+ }
+
+ //! Remove a member in object by iterator.
+ /*! \param m member iterator (obtained by FindMember() or MemberBegin()).
+ \return the new iterator after removal.
+ \note This function may reorder the object members. Use \ref
+ EraseMember(ConstMemberIterator) if you need to preserve the
+ relative order of the remaining members.
+ \note Constant time complexity.
+ */
+ MemberIterator RemoveMember(MemberIterator m) {
+ RAPIDJSON_ASSERT(IsObject());
+ RAPIDJSON_ASSERT(data_.o.size > 0);
+ RAPIDJSON_ASSERT(data_.o.members != 0);
+ RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd());
+
+ MemberIterator last(data_.o.members + (data_.o.size - 1));
+ if (data_.o.size > 1 && m != last) {
+ // Move the last one to this place
+ *m = *last;
+ }
+ else {
+ // Only one left, just destroy
+ m->~Member();
+ }
+ --data_.o.size;
+ return m;
+ }
+
+ //! Remove a member from an object by iterator.
+ /*! \param pos iterator to the member to remove
+ \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd()
+ \return Iterator following the removed element.
+ If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned.
+ \note This function preserves the relative order of the remaining object
+ members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator).
+ \note Linear time complexity.
+ */
+ MemberIterator EraseMember(ConstMemberIterator pos) {
+ return EraseMember(pos, pos +1);
+ }
+
+ //! Remove members in the range [first, last) from an object.
+ /*! \param first iterator to the first member to remove
+ \param last iterator following the last member to remove
+ \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd()
+ \return Iterator following the last removed element.
+ \note This function preserves the relative order of the remaining object
+ members.
+ \note Linear time complexity.
+ */
+ MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) {
+ RAPIDJSON_ASSERT(IsObject());
+ RAPIDJSON_ASSERT(data_.o.size > 0);
+ RAPIDJSON_ASSERT(data_.o.members != 0);
+ RAPIDJSON_ASSERT(first >= MemberBegin());
+ RAPIDJSON_ASSERT(first <= last);
+ RAPIDJSON_ASSERT(last <= MemberEnd());
+
+ MemberIterator pos = MemberBegin() + (first - MemberBegin());
+ for (MemberIterator itr = pos; itr != last; ++itr)
+ itr->~Member();
+ std::memmove(&*pos, &*last, static_cast<size_t>(MemberEnd() - last) * sizeof(Member));
+ data_.o.size -= static_cast<SizeType>(last - first);
+ return pos;
+ }
+
+ //! Erase a member in object by its name.
+ /*! \param name Name of member to be removed.
+ \return Whether the member existed.
+ \note Linear time complexity.
+ */
+ bool EraseMember(const Ch* name) {
+ GenericValue n(StringRef(name));
+ return EraseMember(n);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ bool EraseMember(const std::basic_string<Ch>& name) { return EraseMember(GenericValue(StringRef(name))); }
+#endif
+
+ template <typename SourceAllocator>
+ bool EraseMember(const GenericValue<Encoding, SourceAllocator>& name) {
+ MemberIterator m = FindMember(name);
+ if (m != MemberEnd()) {
+ EraseMember(m);
+ return true;
+ }
+ else
+ return false;
+ }
+
+ //@}
+
+ //!@name Array
+ //@{
+
+ //! Set this value as an empty array.
+ /*! \post IsArray == true */
+ GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; }
+
+ //! Get the number of elements in array.
+ SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; }
+
+ //! Get the capacity of array.
+ SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; }
+
+ //! Check whether the array is empty.
+ bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; }
+
+ //! Remove all elements in the array.
+ /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged.
+ \note Linear time complexity.
+ */
+ void Clear() {
+ RAPIDJSON_ASSERT(IsArray());
+ for (SizeType i = 0; i < data_.a.size; ++i)
+ data_.a.elements[i].~GenericValue();
+ data_.a.size = 0;
+ }
+
+ //! Get an element from array by index.
+ /*! \pre IsArray() == true
+ \param index Zero-based index of element.
+ \see operator[](T*)
+ */
+ GenericValue& operator[](SizeType index) {
+ RAPIDJSON_ASSERT(IsArray());
+ RAPIDJSON_ASSERT(index < data_.a.size);
+ return data_.a.elements[index];
+ }
+ const GenericValue& operator[](SizeType index) const { return const_cast<GenericValue&>(*this)[index]; }
+
+ //! Element iterator
+ /*! \pre IsArray() == true */
+ ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements; }
+ //! \em Past-the-end element iterator
+ /*! \pre IsArray() == true */
+ ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements + data_.a.size; }
+ //! Constant element iterator
+ /*! \pre IsArray() == true */
+ ConstValueIterator Begin() const { return const_cast<GenericValue&>(*this).Begin(); }
+ //! Constant \em past-the-end element iterator
+ /*! \pre IsArray() == true */
+ ConstValueIterator End() const { return const_cast<GenericValue&>(*this).End(); }
+
+ //! Request the array to have enough capacity to store elements.
+ /*! \param newCapacity The capacity that the array at least need to have.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \note Linear time complexity.
+ */
+ GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) {
+ RAPIDJSON_ASSERT(IsArray());
+ if (newCapacity > data_.a.capacity) {
+ data_.a.elements = static_cast<GenericValue*>(allocator.Realloc(data_.a.elements, data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)));
+ data_.a.capacity = newCapacity;
+ }
+ return *this;
+ }
+
+ //! Append a GenericValue at the end of the array.
+ /*! \param value Value to be appended.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \pre IsArray() == true
+ \post value.IsNull() == true
+ \return The value itself for fluent API.
+ \note The ownership of \c value will be transferred to this array on success.
+ \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
+ \note Amortized constant time complexity.
+ */
+ GenericValue& PushBack(GenericValue& value, Allocator& allocator) {
+ RAPIDJSON_ASSERT(IsArray());
+ if (data_.a.size >= data_.a.capacity)
+ Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator);
+ data_.a.elements[data_.a.size++].RawAssign(value);
+ return *this;
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ GenericValue& PushBack(GenericValue&& value, Allocator& allocator) {
+ return PushBack(value, allocator);
+ }
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+ //! Append a constant string reference at the end of the array.
+ /*! \param value Constant string reference to be appended.
+ \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator().
+ \pre IsArray() == true
+ \return The value itself for fluent API.
+ \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
+ \note Amortized constant time complexity.
+ \see GenericStringRef
+ */
+ GenericValue& PushBack(StringRefType value, Allocator& allocator) {
+ return (*this).template PushBack<StringRefType>(value, allocator);
+ }
+
+ //! Append a primitive value at the end of the array.
+ /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
+ \param value Value of primitive type T to be appended.
+ \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
+ \pre IsArray() == true
+ \return The value itself for fluent API.
+ \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
+
+ \note The source type \c T explicitly disallows all pointer types,
+ especially (\c const) \ref Ch*. This helps avoiding implicitly
+ referencing character strings with insufficient lifetime, use
+ \ref PushBack(GenericValue&, Allocator&) or \ref
+ PushBack(StringRefType, Allocator&).
+ All other pointer types would implicitly convert to \c bool,
+ use an explicit cast instead, if needed.
+ \note Amortized constant time complexity.
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))
+ PushBack(T value, Allocator& allocator) {
+ GenericValue v(value);
+ return PushBack(v, allocator);
+ }
+
+ //! Remove the last element in the array.
+ /*!
+ \note Constant time complexity.
+ */
+ GenericValue& PopBack() {
+ RAPIDJSON_ASSERT(IsArray());
+ RAPIDJSON_ASSERT(!Empty());
+ data_.a.elements[--data_.a.size].~GenericValue();
+ return *this;
+ }
+
+ //! Remove an element of array by iterator.
+ /*!
+ \param pos iterator to the element to remove
+ \pre IsArray() == true && \ref Begin() <= \c pos < \ref End()
+ \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned.
+ \note Linear time complexity.
+ */
+ ValueIterator Erase(ConstValueIterator pos) {
+ return Erase(pos, pos + 1);
+ }
+
+ //! Remove elements in the range [first, last) of the array.
+ /*!
+ \param first iterator to the first element to remove
+ \param last iterator following the last element to remove
+ \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End()
+ \return Iterator following the last removed element.
+ \note Linear time complexity.
+ */
+ ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) {
+ RAPIDJSON_ASSERT(IsArray());
+ RAPIDJSON_ASSERT(data_.a.size > 0);
+ RAPIDJSON_ASSERT(data_.a.elements != 0);
+ RAPIDJSON_ASSERT(first >= Begin());
+ RAPIDJSON_ASSERT(first <= last);
+ RAPIDJSON_ASSERT(last <= End());
+ ValueIterator pos = Begin() + (first - Begin());
+ for (ValueIterator itr = pos; itr != last; ++itr)
+ itr->~GenericValue();
+ std::memmove(pos, last, static_cast<size_t>(End() - last) * sizeof(GenericValue));
+ data_.a.size -= static_cast<SizeType>(last - first);
+ return pos;
+ }
+
+ //@}
+
+ //!@name Number
+ //@{
+
+ int GetInt() const { RAPIDJSON_ASSERT(flags_ & kIntFlag); return data_.n.i.i; }
+ unsigned GetUint() const { RAPIDJSON_ASSERT(flags_ & kUintFlag); return data_.n.u.u; }
+ int64_t GetInt64() const { RAPIDJSON_ASSERT(flags_ & kInt64Flag); return data_.n.i64; }
+ uint64_t GetUint64() const { RAPIDJSON_ASSERT(flags_ & kUint64Flag); return data_.n.u64; }
+
+ //! Get the value as double type.
+ /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless.
+ */
+ double GetDouble() const {
+ RAPIDJSON_ASSERT(IsNumber());
+ if ((flags_ & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion.
+ if ((flags_ & kIntFlag) != 0) return data_.n.i.i; // int -> double
+ if ((flags_ & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double
+ if ((flags_ & kInt64Flag) != 0) return static_cast<double>(data_.n.i64); // int64_t -> double (may lose precision)
+ RAPIDJSON_ASSERT((flags_ & kUint64Flag) != 0); return static_cast<double>(data_.n.u64); // uint64_t -> double (may lose precision)
+ }
+
+ //! Get the value as float type.
+ /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless.
+ */
+ float GetFloat() const {
+ RAPIDJSON_ASSERT(IsFloat());
+ return static_cast<float>(GetDouble());
+ }
+
+ GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; }
+ GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; }
+ GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; }
+ GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; }
+ GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; }
+ GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(f); return *this; }
+
+ //@}
+
+ //!@name String
+ //@{
+
+ const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return ((flags_ & kInlineStrFlag) ? data_.ss.str : data_.s.str); }
+
+ //! Get the length of string.
+ /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().
+ */
+ SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return ((flags_ & kInlineStrFlag) ? (data_.ss.GetLength()) : data_.s.length); }
+
+ //! Set this value as a string without copying source string.
+ /*! This version has better performance with supplied length, and also support string containing null character.
+ \param s source string pointer.
+ \param length The length of source string, excluding the trailing null terminator.
+ \return The value itself for fluent API.
+ \post IsString() == true && GetString() == s && GetStringLength() == length
+ \see SetString(StringRefType)
+ */
+ GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); }
+
+ //! Set this value as a string without copying source string.
+ /*! \param s source string reference
+ \return The value itself for fluent API.
+ \post IsString() == true && GetString() == s && GetStringLength() == s.length
+ */
+ GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; }
+
+ //! Set this value as a string by copying from source string.
+ /*! This version has better performance with supplied length, and also support string containing null character.
+ \param s source string.
+ \param length The length of source string, excluding the trailing null terminator.
+ \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length
+ */
+ GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { this->~GenericValue(); SetStringRaw(StringRef(s, length), allocator); return *this; }
+
+ //! Set this value as a string by copying from source string.
+ /*! \param s source string.
+ \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length
+ */
+ GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(s, internal::StrLen(s), allocator); }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Set this value as a string by copying from source string.
+ /*! \param s source string.
+ \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
+ \return The value itself for fluent API.
+ \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size()
+ \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
+ */
+ GenericValue& SetString(const std::basic_string<Ch>& s, Allocator& allocator) { return SetString(s.data(), SizeType(s.size()), allocator); }
+#endif
+
+ //@}
+
+ //! Generate events of this value to a Handler.
+ /*! This function adopts the GoF visitor pattern.
+ Typical usage is to output this JSON value as JSON text via Writer, which is a Handler.
+ It can also be used to deep clone this value via GenericDocument, which is also a Handler.
+ \tparam Handler type of handler.
+ \param handler An object implementing concept Handler.
+ */
+ template <typename Handler>
+ bool Accept(Handler& handler) const {
+ switch(GetType()) {
+ case kNullType: return handler.Null();
+ case kFalseType: return handler.Bool(false);
+ case kTrueType: return handler.Bool(true);
+
+ case kObjectType:
+ if (RAPIDJSON_UNLIKELY(!handler.StartObject()))
+ return false;
+ for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) {
+ RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator.
+ if (RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.flags_ & kCopyFlag) != 0)))
+ return false;
+ if (RAPIDJSON_UNLIKELY(!m->value.Accept(handler)))
+ return false;
+ }
+ return handler.EndObject(data_.o.size);
+
+ case kArrayType:
+ if (RAPIDJSON_UNLIKELY(!handler.StartArray()))
+ return false;
+ for (const GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v)
+ if (RAPIDJSON_UNLIKELY(!v->Accept(handler)))
+ return false;
+ return handler.EndArray(data_.a.size);
+
+ case kStringType:
+ return handler.String(GetString(), GetStringLength(), (flags_ & kCopyFlag) != 0);
+
+ default:
+ RAPIDJSON_ASSERT(GetType() == kNumberType);
+ if (IsDouble()) return handler.Double(data_.n.d);
+ else if (IsInt()) return handler.Int(data_.n.i.i);
+ else if (IsUint()) return handler.Uint(data_.n.u.u);
+ else if (IsInt64()) return handler.Int64(data_.n.i64);
+ else return handler.Uint64(data_.n.u64);
+ }
+ }
+
+private:
+ template <typename, typename> friend class GenericValue;
+ template <typename, typename, typename> friend class GenericDocument;
+
+ enum {
+ kBoolFlag = 0x100,
+ kNumberFlag = 0x200,
+ kIntFlag = 0x400,
+ kUintFlag = 0x800,
+ kInt64Flag = 0x1000,
+ kUint64Flag = 0x2000,
+ kDoubleFlag = 0x4000,
+ kStringFlag = 0x100000,
+ kCopyFlag = 0x200000,
+ kInlineStrFlag = 0x400000,
+
+ // Initial flags of different types.
+ kNullFlag = kNullType,
+ kTrueFlag = kTrueType | kBoolFlag,
+ kFalseFlag = kFalseType | kBoolFlag,
+ kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag,
+ kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag,
+ kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,
+ kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag,
+ kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag,
+ kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag,
+ kConstStringFlag = kStringType | kStringFlag,
+ kCopyStringFlag = kStringType | kStringFlag | kCopyFlag,
+ kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag,
+ kObjectFlag = kObjectType,
+ kArrayFlag = kArrayType,
+
+ kTypeMask = 0xFF // bitwise-and with mask of 0xFF can be optimized by compiler
+ };
+
+ static const SizeType kDefaultArrayCapacity = 16;
+ static const SizeType kDefaultObjectCapacity = 16;
+
+ struct String {
+ const Ch* str;
+ SizeType length;
+ unsigned hashcode; //!< reserved
+ }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
+
+ // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars
+ // (excluding the terminating zero) and store a value to determine the length of the contained
+ // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string
+ // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as
+ // the string terminator as well. For getting the string length back from that value just use
+ // "MaxSize - str[LenPos]".
+ // This allows to store 11-chars strings in 32-bit mode and 15-chars strings in 64-bit mode
+ // inline (for `UTF8`-encoded strings).
+ struct ShortString {
+ enum { MaxChars = sizeof(String) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize };
+ Ch str[MaxChars];
+
+ inline static bool Usable(SizeType len) { return (MaxSize >= len); }
+ inline void SetLength(SizeType len) { str[LenPos] = static_cast<Ch>(MaxSize - len); }
+ inline SizeType GetLength() const { return static_cast<SizeType>(MaxSize - str[LenPos]); }
+ }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
+
+ // By using proper binary layout, retrieval of different integer types do not need conversions.
+ union Number {
+#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN
+ struct I {
+ int i;
+ char padding[4];
+ }i;
+ struct U {
+ unsigned u;
+ char padding2[4];
+ }u;
+#else
+ struct I {
+ char padding[4];
+ int i;
+ }i;
+ struct U {
+ char padding2[4];
+ unsigned u;
+ }u;
+#endif
+ int64_t i64;
+ uint64_t u64;
+ double d;
+ }; // 8 bytes
+
+ struct Object {
+ Member* members;
+ SizeType size;
+ SizeType capacity;
+ }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
+
+ struct Array {
+ GenericValue* elements;
+ SizeType size;
+ SizeType capacity;
+ }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
+
+ union Data {
+ String s;
+ ShortString ss;
+ Number n;
+ Object o;
+ Array a;
+ }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
+
+ // Initialize this value as array with initial data, without calling destructor.
+ void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) {
+ flags_ = kArrayFlag;
+ if (count) {
+ data_.a.elements = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
+ std::memcpy(data_.a.elements, values, count * sizeof(GenericValue));
+ }
+ else
+ data_.a.elements = NULL;
+ data_.a.size = data_.a.capacity = count;
+ }
+
+ //! Initialize this value as object with initial data, without calling destructor.
+ void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) {
+ flags_ = kObjectFlag;
+ if (count) {
+ data_.o.members = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
+ std::memcpy(data_.o.members, members, count * sizeof(Member));
+ }
+ else
+ data_.o.members = NULL;
+ data_.o.size = data_.o.capacity = count;
+ }
+
+ //! Initialize this value as constant string, without calling destructor.
+ void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT {
+ flags_ = kConstStringFlag;
+ data_.s.str = s;
+ data_.s.length = s.length;
+ }
+
+ //! Initialize this value as copy string with initial data, without calling destructor.
+ void SetStringRaw(StringRefType s, Allocator& allocator) {
+ Ch* str = NULL;
+ if(ShortString::Usable(s.length)) {
+ flags_ = kShortStringFlag;
+ data_.ss.SetLength(s.length);
+ str = data_.ss.str;
+ } else {
+ flags_ = kCopyStringFlag;
+ data_.s.length = s.length;
+ str = static_cast<Ch *>(allocator.Malloc((s.length + 1) * sizeof(Ch)));
+ data_.s.str = str;
+ }
+ std::memcpy(str, s, s.length * sizeof(Ch));
+ str[s.length] = '\0';
+ }
+
+ //! Assignment without calling destructor
+ void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT {
+ data_ = rhs.data_;
+ flags_ = rhs.flags_;
+ rhs.flags_ = kNullFlag;
+ }
+
+ template <typename SourceAllocator>
+ bool StringEqual(const GenericValue<Encoding, SourceAllocator>& rhs) const {
+ RAPIDJSON_ASSERT(IsString());
+ RAPIDJSON_ASSERT(rhs.IsString());
+
+ const SizeType len1 = GetStringLength();
+ const SizeType len2 = rhs.GetStringLength();
+ if(len1 != len2) { return false; }
+
+ const Ch* const str1 = GetString();
+ const Ch* const str2 = rhs.GetString();
+ if(str1 == str2) { return true; } // fast path for constant string
+
+ return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0);
+ }
+
+ Data data_;
+ unsigned flags_;
+};
+
+//! GenericValue with UTF8 encoding
+typedef GenericValue<UTF8<> > Value;
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericDocument
+
+//! A document for parsing JSON text as DOM.
+/*!
+ \note implements Handler concept
+ \tparam Encoding Encoding for both parsing and string storage.
+ \tparam Allocator Allocator for allocating memory for the DOM
+ \tparam StackAllocator Allocator for allocating memory for stack during parsing.
+ \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue.
+*/
+template <typename Encoding, typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>
+class GenericDocument : public GenericValue<Encoding, Allocator> {
+public:
+ typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding.
+ typedef GenericValue<Encoding, Allocator> ValueType; //!< Value type of the document.
+ typedef Allocator AllocatorType; //!< Allocator type from template parameter.
+
+ //! Constructor
+ /*! Creates an empty document of specified type.
+ \param type Mandatory type of object to create.
+ \param allocator Optional allocator for allocating memory.
+ \param stackCapacity Optional initial capacity of stack in bytes.
+ \param stackAllocator Optional allocator for allocating memory for stack.
+ */
+ explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) :
+ GenericValue<Encoding, Allocator>(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_()
+ {
+ if (!allocator_)
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
+ }
+
+ //! Constructor
+ /*! Creates an empty document which type is Null.
+ \param allocator Optional allocator for allocating memory.
+ \param stackCapacity Optional initial capacity of stack in bytes.
+ \param stackAllocator Optional allocator for allocating memory for stack.
+ */
+ GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) :
+ allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_()
+ {
+ if (!allocator_)
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ //! Move constructor in C++11
+ GenericDocument(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT
+ : ValueType(std::forward<ValueType>(rhs)), // explicit cast to avoid prohibited move from Document
+ allocator_(rhs.allocator_),
+ ownAllocator_(rhs.ownAllocator_),
+ stack_(std::move(rhs.stack_)),
+ parseResult_(rhs.parseResult_)
+ {
+ rhs.allocator_ = 0;
+ rhs.ownAllocator_ = 0;
+ rhs.parseResult_ = ParseResult();
+ }
+#endif
+
+ ~GenericDocument() {
+ Destroy();
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ //! Move assignment in C++11
+ GenericDocument& operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT
+ {
+ // The cast to ValueType is necessary here, because otherwise it would
+ // attempt to call GenericValue's templated assignment operator.
+ ValueType::operator=(std::forward<ValueType>(rhs));
+
+ // Calling the destructor here would prematurely call stack_'s destructor
+ Destroy();
+
+ allocator_ = rhs.allocator_;
+ ownAllocator_ = rhs.ownAllocator_;
+ stack_ = std::move(rhs.stack_);
+ parseResult_ = rhs.parseResult_;
+
+ rhs.allocator_ = 0;
+ rhs.ownAllocator_ = 0;
+ rhs.parseResult_ = ParseResult();
+
+ return *this;
+ }
+#endif
+
+ //! Exchange the contents of this document with those of another.
+ /*!
+ \param rhs Another document.
+ \note Constant complexity.
+ \see GenericValue::Swap
+ */
+ GenericDocument& Swap(GenericDocument& rhs) RAPIDJSON_NOEXCEPT {
+ ValueType::Swap(rhs);
+ stack_.Swap(rhs.stack_);
+ internal::Swap(allocator_, rhs.allocator_);
+ internal::Swap(ownAllocator_, rhs.ownAllocator_);
+ internal::Swap(parseResult_, rhs.parseResult_);
+ return *this;
+ }
+
+ //! free-standing swap function helper
+ /*!
+ Helper function to enable support for common swap implementation pattern based on \c std::swap:
+ \code
+ void swap(MyClass& a, MyClass& b) {
+ using std::swap;
+ swap(a.doc, b.doc);
+ // ...
+ }
+ \endcode
+ \see Swap()
+ */
+ friend inline void swap(GenericDocument& a, GenericDocument& b) RAPIDJSON_NOEXCEPT { a.Swap(b); }
+
+ //! Populate this document by a generator which produces SAX events.
+ /*! \tparam Generator A functor with <tt>bool f(Handler)</tt> prototype.
+ \param g Generator functor which sends SAX events to the parameter.
+ \return The document itself for fluent API.
+ */
+ template <typename Generator>
+ GenericDocument& Populate(Generator& g) {
+ ClearStackOnExit scope(*this);
+ if (g(*this)) {
+ RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object
+ ValueType::operator=(*stack_.template Pop<ValueType>(1));// Move value from stack to document
+ }
+ return *this;
+ }
+
+ //!@name Parse from stream
+ //!@{
+
+ //! Parse JSON text from an input stream (with Encoding conversion)
+ /*! \tparam parseFlags Combination of \ref ParseFlag.
+ \tparam SourceEncoding Encoding of input stream
+ \tparam InputStream Type of input stream, implementing Stream concept
+ \param is Input stream to be parsed.
+ \return The document itself for fluent API.
+ */
+ template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
+ GenericDocument& ParseStream(InputStream& is) {
+ GenericReader<SourceEncoding, Encoding, StackAllocator> reader(
+ stack_.HasAllocator() ? &stack_.GetAllocator() : 0);
+ ClearStackOnExit scope(*this);
+ parseResult_ = reader.template Parse<parseFlags>(is, *this);
+ if (parseResult_) {
+ RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object
+ ValueType::operator=(*stack_.template Pop<ValueType>(1));// Move value from stack to document
+ }
+ return *this;
+ }
+
+ //! Parse JSON text from an input stream
+ /*! \tparam parseFlags Combination of \ref ParseFlag.
+ \tparam InputStream Type of input stream, implementing Stream concept
+ \param is Input stream to be parsed.
+ \return The document itself for fluent API.
+ */
+ template <unsigned parseFlags, typename InputStream>
+ GenericDocument& ParseStream(InputStream& is) {
+ return ParseStream<parseFlags, Encoding, InputStream>(is);
+ }
+
+ //! Parse JSON text from an input stream (with \ref kParseDefaultFlags)
+ /*! \tparam InputStream Type of input stream, implementing Stream concept
+ \param is Input stream to be parsed.
+ \return The document itself for fluent API.
+ */
+ template <typename InputStream>
+ GenericDocument& ParseStream(InputStream& is) {
+ return ParseStream<kParseDefaultFlags, Encoding, InputStream>(is);
+ }
+ //!@}
+
+ //!@name Parse in-place from mutable string
+ //!@{
+
+ //! Parse JSON text from a mutable string
+ /*! \tparam parseFlags Combination of \ref ParseFlag.
+ \param str Mutable zero-terminated string to be parsed.
+ \return The document itself for fluent API.
+ */
+ template <unsigned parseFlags>
+ GenericDocument& ParseInsitu(Ch* str) {
+ GenericInsituStringStream<Encoding> s(str);
+ return ParseStream<parseFlags | kParseInsituFlag>(s);
+ }
+
+ //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags)
+ /*! \param str Mutable zero-terminated string to be parsed.
+ \return The document itself for fluent API.
+ */
+ GenericDocument& ParseInsitu(Ch* str) {
+ return ParseInsitu<kParseDefaultFlags>(str);
+ }
+ //!@}
+
+ //!@name Parse from read-only string
+ //!@{
+
+ //! Parse JSON text from a read-only string (with Encoding conversion)
+ /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag).
+ \tparam SourceEncoding Transcoding from input Encoding
+ \param str Read-only zero-terminated string to be parsed.
+ */
+ template <unsigned parseFlags, typename SourceEncoding>
+ GenericDocument& Parse(const typename SourceEncoding::Ch* str) {
+ RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag));
+ GenericStringStream<SourceEncoding> s(str);
+ return ParseStream<parseFlags, SourceEncoding>(s);
+ }
+
+ //! Parse JSON text from a read-only string
+ /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag).
+ \param str Read-only zero-terminated string to be parsed.
+ */
+ template <unsigned parseFlags>
+ GenericDocument& Parse(const Ch* str) {
+ return Parse<parseFlags, Encoding>(str);
+ }
+
+ //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags)
+ /*! \param str Read-only zero-terminated string to be parsed.
+ */
+ GenericDocument& Parse(const Ch* str) {
+ return Parse<kParseDefaultFlags>(str);
+ }
+ //!@}
+
+ //!@name Handling parse errors
+ //!@{
+
+ //! Whether a parse error has occured in the last parsing.
+ bool HasParseError() const { return parseResult_.IsError(); }
+
+ //! Get the \ref ParseErrorCode of last parsing.
+ ParseErrorCode GetParseError() const { return parseResult_.Code(); }
+
+ //! Get the position of last parsing error in input, 0 otherwise.
+ size_t GetErrorOffset() const { return parseResult_.Offset(); }
+
+ //! Implicit conversion to get the last parse result
+#ifndef __clang // -Wdocumentation
+ /*! \return \ref ParseResult of the last parse operation
+
+ \code
+ Document doc;
+ ParseResult ok = doc.Parse(json);
+ if (!ok)
+ printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset());
+ \endcode
+ */
+#endif
+ operator ParseResult() const { return parseResult_; }
+ //!@}
+
+ //! Get the allocator of this document.
+ Allocator& GetAllocator() {
+ RAPIDJSON_ASSERT(allocator_);
+ return *allocator_;
+ }
+
+ //! Get the capacity of stack in bytes.
+ size_t GetStackCapacity() const { return stack_.GetCapacity(); }
+
+private:
+ // clear stack on any exit from ParseStream, e.g. due to exception
+ struct ClearStackOnExit {
+ explicit ClearStackOnExit(GenericDocument& d) : d_(d) {}
+ ~ClearStackOnExit() { d_.ClearStack(); }
+ private:
+ ClearStackOnExit(const ClearStackOnExit&);
+ ClearStackOnExit& operator=(const ClearStackOnExit&);
+ GenericDocument& d_;
+ };
+
+ // callers of the following private Handler functions
+ // template <typename,typename,typename> friend class GenericReader; // for parsing
+ template <typename, typename> friend class GenericValue; // for deep copying
+
+public:
+ // Implementation of Handler
+ bool Null() { new (stack_.template Push<ValueType>()) ValueType(); return true; }
+ bool Bool(bool b) { new (stack_.template Push<ValueType>()) ValueType(b); return true; }
+ bool Int(int i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
+ bool Uint(unsigned i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
+ bool Int64(int64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
+ bool Uint64(uint64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
+ bool Double(double d) { new (stack_.template Push<ValueType>()) ValueType(d); return true; }
+
+ bool String(const Ch* str, SizeType length, bool copy) {
+ if (copy)
+ new (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());
+ else
+ new (stack_.template Push<ValueType>()) ValueType(str, length);
+ return true;
+ }
+
+ bool StartObject() { new (stack_.template Push<ValueType>()) ValueType(kObjectType); return true; }
+
+ bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); }
+
+ bool EndObject(SizeType memberCount) {
+ typename ValueType::Member* members = stack_.template Pop<typename ValueType::Member>(memberCount);
+ stack_.template Top<ValueType>()->SetObjectRaw(members, memberCount, GetAllocator());
+ return true;
+ }
+
+ bool StartArray() { new (stack_.template Push<ValueType>()) ValueType(kArrayType); return true; }
+
+ bool EndArray(SizeType elementCount) {
+ ValueType* elements = stack_.template Pop<ValueType>(elementCount);
+ stack_.template Top<ValueType>()->SetArrayRaw(elements, elementCount, GetAllocator());
+ return true;
+ }
+
+private:
+ //! Prohibit copying
+ GenericDocument(const GenericDocument&);
+ //! Prohibit assignment
+ GenericDocument& operator=(const GenericDocument&);
+
+ void ClearStack() {
+ if (Allocator::kNeedFree)
+ while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects)
+ (stack_.template Pop<ValueType>(1))->~ValueType();
+ else
+ stack_.Clear();
+ stack_.ShrinkToFit();
+ }
+
+ void Destroy() {
+ RAPIDJSON_DELETE(ownAllocator_);
+ }
+
+ static const size_t kDefaultStackCapacity = 1024;
+ Allocator* allocator_;
+ Allocator* ownAllocator_;
+ internal::Stack<StackAllocator> stack_;
+ ParseResult parseResult_;
+};
+
+//! GenericDocument with UTF8 encoding
+typedef GenericDocument<UTF8<> > Document;
+
+// defined here due to the dependency on GenericDocument
+template <typename Encoding, typename Allocator>
+template <typename SourceAllocator>
+inline
+GenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,SourceAllocator>& rhs, Allocator& allocator)
+{
+ switch (rhs.GetType()) {
+ case kObjectType:
+ case kArrayType: { // perform deep copy via SAX Handler
+ GenericDocument<Encoding,Allocator> d(&allocator);
+ rhs.Accept(d);
+ RawAssign(*d.stack_.template Pop<GenericValue>(1));
+ }
+ break;
+ case kStringType:
+ if (rhs.flags_ == kConstStringFlag) {
+ flags_ = rhs.flags_;
+ data_ = *reinterpret_cast<const Data*>(&rhs.data_);
+ } else {
+ SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator);
+ }
+ break;
+ default:
+ flags_ = rhs.flags_;
+ data_ = *reinterpret_cast<const Data*>(&rhs.data_);
+ break;
+ }
+}
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_DOCUMENT_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/encodedstream.h b/3rdparty/rapidjson/include/rapidjson/encodedstream.h
new file mode 100644
index 00000000000..87d09bbb150
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/encodedstream.h
@@ -0,0 +1,270 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_ENCODEDSTREAM_H_
+#define RAPIDJSON_ENCODEDSTREAM_H_
+
+#include "stream.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Input byte stream wrapper with a statically bound encoding.
+/*!
+ \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
+ \tparam InputByteStream Type of input byte stream. For example, FileReadStream.
+*/
+template <typename Encoding, typename InputByteStream>
+class EncodedInputStream {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+public:
+ typedef typename Encoding::Ch Ch;
+
+ EncodedInputStream(InputByteStream& is) : is_(is) {
+ current_ = Encoding::TakeBOM(is_);
+ }
+
+ Ch Peek() const { return current_; }
+ Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; }
+ size_t Tell() const { return is_.Tell(); }
+
+ // Not implemented
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ EncodedInputStream(const EncodedInputStream&);
+ EncodedInputStream& operator=(const EncodedInputStream&);
+
+ InputByteStream& is_;
+ Ch current_;
+};
+
+//! Output byte stream wrapper with statically bound encoding.
+/*!
+ \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
+ \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream.
+*/
+template <typename Encoding, typename OutputByteStream>
+class EncodedOutputStream {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+public:
+ typedef typename Encoding::Ch Ch;
+
+ EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) {
+ if (putBOM)
+ Encoding::PutBOM(os_);
+ }
+
+ void Put(Ch c) { Encoding::Put(os_, c); }
+ void Flush() { os_.Flush(); }
+
+ // Not implemented
+ Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;}
+ Ch Take() { RAPIDJSON_ASSERT(false); return 0;}
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ EncodedOutputStream(const EncodedOutputStream&);
+ EncodedOutputStream& operator=(const EncodedOutputStream&);
+
+ OutputByteStream& os_;
+};
+
+#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
+
+//! Input stream wrapper with dynamically bound encoding and automatic encoding detection.
+/*!
+ \tparam CharType Type of character for reading.
+ \tparam InputByteStream type of input byte stream to be wrapped.
+*/
+template <typename CharType, typename InputByteStream>
+class AutoUTFInputStream {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+public:
+ typedef CharType Ch;
+
+ //! Constructor.
+ /*!
+ \param is input stream to be wrapped.
+ \param type UTF encoding type if it is not detected from the stream.
+ */
+ AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) {
+ RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
+ DetectType();
+ static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) };
+ takeFunc_ = f[type_];
+ current_ = takeFunc_(*is_);
+ }
+
+ UTFType GetType() const { return type_; }
+ bool HasBOM() const { return hasBOM_; }
+
+ Ch Peek() const { return current_; }
+ Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; }
+ size_t Tell() const { return is_->Tell(); }
+
+ // Not implemented
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ AutoUTFInputStream(const AutoUTFInputStream&);
+ AutoUTFInputStream& operator=(const AutoUTFInputStream&);
+
+ // Detect encoding type with BOM or RFC 4627
+ void DetectType() {
+ // BOM (Byte Order Mark):
+ // 00 00 FE FF UTF-32BE
+ // FF FE 00 00 UTF-32LE
+ // FE FF UTF-16BE
+ // FF FE UTF-16LE
+ // EF BB BF UTF-8
+
+ const unsigned char* c = reinterpret_cast<const unsigned char *>(is_->Peek4());
+ if (!c)
+ return;
+
+ unsigned bom = static_cast<unsigned>(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24));
+ hasBOM_ = false;
+ if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }
+ else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }
+ else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); }
+ else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); }
+ else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); }
+
+ // RFC 4627: Section 3
+ // "Since the first two characters of a JSON text will always be ASCII
+ // characters [RFC0020], it is possible to determine whether an octet
+ // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking
+ // at the pattern of nulls in the first four octets."
+ // 00 00 00 xx UTF-32BE
+ // 00 xx 00 xx UTF-16BE
+ // xx 00 00 00 UTF-32LE
+ // xx 00 xx 00 UTF-16LE
+ // xx xx xx xx UTF-8
+
+ if (!hasBOM_) {
+ unsigned pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0);
+ switch (pattern) {
+ case 0x08: type_ = kUTF32BE; break;
+ case 0x0A: type_ = kUTF16BE; break;
+ case 0x01: type_ = kUTF32LE; break;
+ case 0x05: type_ = kUTF16LE; break;
+ case 0x0F: type_ = kUTF8; break;
+ default: break; // Use type defined by user.
+ }
+ }
+
+ // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
+ if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
+ if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
+ }
+
+ typedef Ch (*TakeFunc)(InputByteStream& is);
+ InputByteStream* is_;
+ UTFType type_;
+ Ch current_;
+ TakeFunc takeFunc_;
+ bool hasBOM_;
+};
+
+//! Output stream wrapper with dynamically bound encoding and automatic encoding detection.
+/*!
+ \tparam CharType Type of character for writing.
+ \tparam OutputByteStream type of output byte stream to be wrapped.
+*/
+template <typename CharType, typename OutputByteStream>
+class AutoUTFOutputStream {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+public:
+ typedef CharType Ch;
+
+ //! Constructor.
+ /*!
+ \param os output stream to be wrapped.
+ \param type UTF encoding type.
+ \param putBOM Whether to write BOM at the beginning of the stream.
+ */
+ AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) {
+ RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
+
+ // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
+ if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
+ if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
+
+ static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };
+ putFunc_ = f[type_];
+
+ if (putBOM)
+ PutBOM();
+ }
+
+ UTFType GetType() const { return type_; }
+
+ void Put(Ch c) { putFunc_(*os_, c); }
+ void Flush() { os_->Flush(); }
+
+ // Not implemented
+ Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;}
+ Ch Take() { RAPIDJSON_ASSERT(false); return 0;}
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ AutoUTFOutputStream(const AutoUTFOutputStream&);
+ AutoUTFOutputStream& operator=(const AutoUTFOutputStream&);
+
+ void PutBOM() {
+ typedef void (*PutBOMFunc)(OutputByteStream&);
+ static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) };
+ f[type_](*os_);
+ }
+
+ typedef void (*PutFunc)(OutputByteStream&, Ch);
+
+ OutputByteStream* os_;
+ UTFType type_;
+ PutFunc putFunc_;
+};
+
+#undef RAPIDJSON_ENCODINGS_FUNC
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_FILESTREAM_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/encodings.h b/3rdparty/rapidjson/include/rapidjson/encodings.h
new file mode 100644
index 00000000000..edfc9901615
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/encodings.h
@@ -0,0 +1,712 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_ENCODINGS_H_
+#define RAPIDJSON_ENCODINGS_H_
+
+#include "rapidjson.h"
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data
+RAPIDJSON_DIAG_OFF(4702) // unreachable code
+#elif defined(__GNUC__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+RAPIDJSON_DIAG_OFF(overflow)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// Encoding
+
+/*! \class rapidjson::Encoding
+ \brief Concept for encoding of Unicode characters.
+
+\code
+concept Encoding {
+ typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition.
+
+ enum { supportUnicode = 1 }; // or 0 if not supporting unicode
+
+ //! \brief Encode a Unicode codepoint to an output stream.
+ //! \param os Output stream.
+ //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively.
+ template<typename OutputStream>
+ static void Encode(OutputStream& os, unsigned codepoint);
+
+ //! \brief Decode a Unicode codepoint from an input stream.
+ //! \param is Input stream.
+ //! \param codepoint Output of the unicode codepoint.
+ //! \return true if a valid codepoint can be decoded from the stream.
+ template <typename InputStream>
+ static bool Decode(InputStream& is, unsigned* codepoint);
+
+ //! \brief Validate one Unicode codepoint from an encoded stream.
+ //! \param is Input stream to obtain codepoint.
+ //! \param os Output for copying one codepoint.
+ //! \return true if it is valid.
+ //! \note This function just validating and copying the codepoint without actually decode it.
+ template <typename InputStream, typename OutputStream>
+ static bool Validate(InputStream& is, OutputStream& os);
+
+ // The following functions are deal with byte streams.
+
+ //! Take a character from input byte stream, skip BOM if exist.
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is);
+
+ //! Take a character from input byte stream.
+ template <typename InputByteStream>
+ static Ch Take(InputByteStream& is);
+
+ //! Put BOM to output byte stream.
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os);
+
+ //! Put a character to output byte stream.
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, Ch c);
+};
+\endcode
+*/
+
+///////////////////////////////////////////////////////////////////////////////
+// UTF8
+
+//! UTF-8 encoding.
+/*! http://en.wikipedia.org/wiki/UTF-8
+ http://tools.ietf.org/html/rfc3629
+ \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char.
+ \note implements Encoding concept
+*/
+template<typename CharType = char>
+struct UTF8 {
+ typedef CharType Ch;
+
+ enum { supportUnicode = 1 };
+
+ template<typename OutputStream>
+ static void Encode(OutputStream& os, unsigned codepoint) {
+ if (codepoint <= 0x7F)
+ os.Put(static_cast<Ch>(codepoint & 0xFF));
+ else if (codepoint <= 0x7FF) {
+ os.Put(static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));
+ os.Put(static_cast<Ch>(0x80 | ((codepoint & 0x3F))));
+ }
+ else if (codepoint <= 0xFFFF) {
+ os.Put(static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));
+ os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
+ os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));
+ }
+ else {
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
+ os.Put(static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));
+ os.Put(static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));
+ os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
+ os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));
+ }
+ }
+
+ template<typename OutputStream>
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
+ if (codepoint <= 0x7F)
+ PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF));
+ else if (codepoint <= 0x7FF) {
+ PutUnsafe(os, static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint & 0x3F))));
+ }
+ else if (codepoint <= 0xFFFF) {
+ PutUnsafe(os, static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
+ PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F)));
+ }
+ else {
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
+ PutUnsafe(os, static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));
+ PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
+ PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F)));
+ }
+ }
+
+ template <typename InputStream>
+ static bool Decode(InputStream& is, unsigned* codepoint) {
+#define COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast<unsigned char>(c) & 0x3Fu)
+#define TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
+#define TAIL() COPY(); TRANS(0x70)
+ typename InputStream::Ch c = is.Take();
+ if (!(c & 0x80)) {
+ *codepoint = static_cast<unsigned char>(c);
+ return true;
+ }
+
+ unsigned char type = GetRange(static_cast<unsigned char>(c));
+ *codepoint = (0xFF >> type) & static_cast<unsigned char>(c);
+ bool result = true;
+ switch (type) {
+ case 2: TAIL(); return result;
+ case 3: TAIL(); TAIL(); return result;
+ case 4: COPY(); TRANS(0x50); TAIL(); return result;
+ case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result;
+ case 6: TAIL(); TAIL(); TAIL(); return result;
+ case 10: COPY(); TRANS(0x20); TAIL(); return result;
+ case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result;
+ default: return false;
+ }
+#undef COPY
+#undef TRANS
+#undef TAIL
+ }
+
+ template <typename InputStream, typename OutputStream>
+ static bool Validate(InputStream& is, OutputStream& os) {
+#define COPY() os.Put(c = is.Take())
+#define TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
+#define TAIL() COPY(); TRANS(0x70)
+ Ch c;
+ COPY();
+ if (!(c & 0x80))
+ return true;
+
+ bool result = true;
+ switch (GetRange(static_cast<unsigned char>(c))) {
+ case 2: TAIL(); return result;
+ case 3: TAIL(); TAIL(); return result;
+ case 4: COPY(); TRANS(0x50); TAIL(); return result;
+ case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result;
+ case 6: TAIL(); TAIL(); TAIL(); return result;
+ case 10: COPY(); TRANS(0x20); TAIL(); return result;
+ case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result;
+ default: return false;
+ }
+#undef COPY
+#undef TRANS
+#undef TAIL
+ }
+
+ static unsigned char GetRange(unsigned char c) {
+ // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
+ // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types.
+ static const unsigned char type[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+ 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
+ };
+ return type[c];
+ }
+
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ typename InputByteStream::Ch c = Take(is);
+ if (static_cast<unsigned char>(c) != 0xEFu) return c;
+ c = is.Take();
+ if (static_cast<unsigned char>(c) != 0xBBu) return c;
+ c = is.Take();
+ if (static_cast<unsigned char>(c) != 0xBFu) return c;
+ c = is.Take();
+ return c;
+ }
+
+ template <typename InputByteStream>
+ static Ch Take(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ return static_cast<Ch>(is.Take());
+ }
+
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xEFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xBBu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xBFu));
+ }
+
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, Ch c) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(c));
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// UTF16
+
+//! UTF-16 encoding.
+/*! http://en.wikipedia.org/wiki/UTF-16
+ http://tools.ietf.org/html/rfc2781
+ \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.
+ \note implements Encoding concept
+
+ \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.
+ For streaming, use UTF16LE and UTF16BE, which handle endianness.
+*/
+template<typename CharType = wchar_t>
+struct UTF16 {
+ typedef CharType Ch;
+ RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2);
+
+ enum { supportUnicode = 1 };
+
+ template<typename OutputStream>
+ static void Encode(OutputStream& os, unsigned codepoint) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
+ if (codepoint <= 0xFFFF) {
+ RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
+ os.Put(static_cast<typename OutputStream::Ch>(codepoint));
+ }
+ else {
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
+ unsigned v = codepoint - 0x10000;
+ os.Put(static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
+ os.Put((v & 0x3FF) | 0xDC00);
+ }
+ }
+
+
+ template<typename OutputStream>
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
+ if (codepoint <= 0xFFFF) {
+ RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
+ PutUnsafe(os, static_cast<typename OutputStream::Ch>(codepoint));
+ }
+ else {
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
+ unsigned v = codepoint - 0x10000;
+ PutUnsafe(os, static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
+ PutUnsafe(os, (v & 0x3FF) | 0xDC00);
+ }
+ }
+
+ template <typename InputStream>
+ static bool Decode(InputStream& is, unsigned* codepoint) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);
+ typename InputStream::Ch c = is.Take();
+ if (c < 0xD800 || c > 0xDFFF) {
+ *codepoint = static_cast<unsigned>(c);
+ return true;
+ }
+ else if (c <= 0xDBFF) {
+ *codepoint = (static_cast<unsigned>(c) & 0x3FF) << 10;
+ c = is.Take();
+ *codepoint |= (static_cast<unsigned>(c) & 0x3FF);
+ *codepoint += 0x10000;
+ return c >= 0xDC00 && c <= 0xDFFF;
+ }
+ return false;
+ }
+
+ template <typename InputStream, typename OutputStream>
+ static bool Validate(InputStream& is, OutputStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
+ typename InputStream::Ch c;
+ os.Put(static_cast<typename OutputStream::Ch>(c = is.Take()));
+ if (c < 0xD800 || c > 0xDFFF)
+ return true;
+ else if (c <= 0xDBFF) {
+ os.Put(c = is.Take());
+ return c >= 0xDC00 && c <= 0xDFFF;
+ }
+ return false;
+ }
+};
+
+//! UTF-16 little endian encoding.
+template<typename CharType = wchar_t>
+struct UTF16LE : UTF16<CharType> {
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ CharType c = Take(is);
+ return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
+ }
+
+ template <typename InputByteStream>
+ static CharType Take(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ unsigned c = static_cast<uint8_t>(is.Take());
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
+ return static_cast<CharType>(c);
+ }
+
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
+ }
+
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, CharType c) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
+ }
+};
+
+//! UTF-16 big endian encoding.
+template<typename CharType = wchar_t>
+struct UTF16BE : UTF16<CharType> {
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ CharType c = Take(is);
+ return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
+ }
+
+ template <typename InputByteStream>
+ static CharType Take(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
+ c |= static_cast<uint8_t>(is.Take());
+ return static_cast<CharType>(c);
+ }
+
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
+ }
+
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, CharType c) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// UTF32
+
+//! UTF-32 encoding.
+/*! http://en.wikipedia.org/wiki/UTF-32
+ \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead.
+ \note implements Encoding concept
+
+ \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.
+ For streaming, use UTF32LE and UTF32BE, which handle endianness.
+*/
+template<typename CharType = unsigned>
+struct UTF32 {
+ typedef CharType Ch;
+ RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4);
+
+ enum { supportUnicode = 1 };
+
+ template<typename OutputStream>
+ static void Encode(OutputStream& os, unsigned codepoint) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
+ os.Put(codepoint);
+ }
+
+ template<typename OutputStream>
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
+ RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
+ PutUnsafe(os, codepoint);
+ }
+
+ template <typename InputStream>
+ static bool Decode(InputStream& is, unsigned* codepoint) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
+ Ch c = is.Take();
+ *codepoint = c;
+ return c <= 0x10FFFF;
+ }
+
+ template <typename InputStream, typename OutputStream>
+ static bool Validate(InputStream& is, OutputStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
+ Ch c;
+ os.Put(c = is.Take());
+ return c <= 0x10FFFF;
+ }
+};
+
+//! UTF-32 little endian enocoding.
+template<typename CharType = unsigned>
+struct UTF32LE : UTF32<CharType> {
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ CharType c = Take(is);
+ return static_cast<uint32_t>(c) == 0x0000FEFFu ? Take(is) : c;
+ }
+
+ template <typename InputByteStream>
+ static CharType Take(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ unsigned c = static_cast<uint8_t>(is.Take());
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 16;
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 24;
+ return static_cast<CharType>(c);
+ }
+
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
+ }
+
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, CharType c) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(c & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 8) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 16) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 24) & 0xFFu));
+ }
+};
+
+//! UTF-32 big endian encoding.
+template<typename CharType = unsigned>
+struct UTF32BE : UTF32<CharType> {
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ CharType c = Take(is);
+ return static_cast<uint32_t>(c) == 0x0000FEFFu ? Take(is) : c;
+ }
+
+ template <typename InputByteStream>
+ static CharType Take(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 24;
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 16;
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
+ c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take()));
+ return static_cast<CharType>(c);
+ }
+
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
+ }
+
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, CharType c) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 24) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 16) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>((c >> 8) & 0xFFu));
+ os.Put(static_cast<typename OutputByteStream::Ch>(c & 0xFFu));
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// ASCII
+
+//! ASCII encoding.
+/*! http://en.wikipedia.org/wiki/ASCII
+ \tparam CharType Code unit for storing 7-bit ASCII data. Default is char.
+ \note implements Encoding concept
+*/
+template<typename CharType = char>
+struct ASCII {
+ typedef CharType Ch;
+
+ enum { supportUnicode = 0 };
+
+ template<typename OutputStream>
+ static void Encode(OutputStream& os, unsigned codepoint) {
+ RAPIDJSON_ASSERT(codepoint <= 0x7F);
+ os.Put(static_cast<Ch>(codepoint & 0xFF));
+ }
+
+ template<typename OutputStream>
+ static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
+ RAPIDJSON_ASSERT(codepoint <= 0x7F);
+ PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF));
+ }
+
+ template <typename InputStream>
+ static bool Decode(InputStream& is, unsigned* codepoint) {
+ uint8_t c = static_cast<uint8_t>(is.Take());
+ *codepoint = c;
+ return c <= 0X7F;
+ }
+
+ template <typename InputStream, typename OutputStream>
+ static bool Validate(InputStream& is, OutputStream& os) {
+ uint8_t c = static_cast<uint8_t>(is.Take());
+ os.Put(static_cast<typename OutputStream::Ch>(c));
+ return c <= 0x7F;
+ }
+
+ template <typename InputByteStream>
+ static CharType TakeBOM(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ uint8_t c = static_cast<uint8_t>(Take(is));
+ return static_cast<Ch>(c);
+ }
+
+ template <typename InputByteStream>
+ static Ch Take(InputByteStream& is) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
+ return static_cast<Ch>(is.Take());
+ }
+
+ template <typename OutputByteStream>
+ static void PutBOM(OutputByteStream& os) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ (void)os;
+ }
+
+ template <typename OutputByteStream>
+ static void Put(OutputByteStream& os, Ch c) {
+ RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
+ os.Put(static_cast<typename OutputByteStream::Ch>(c));
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// AutoUTF
+
+//! Runtime-specified UTF encoding type of a stream.
+enum UTFType {
+ kUTF8 = 0, //!< UTF-8.
+ kUTF16LE = 1, //!< UTF-16 little endian.
+ kUTF16BE = 2, //!< UTF-16 big endian.
+ kUTF32LE = 3, //!< UTF-32 little endian.
+ kUTF32BE = 4 //!< UTF-32 big endian.
+};
+
+//! Dynamically select encoding according to stream's runtime-specified UTF encoding type.
+/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType().
+*/
+template<typename CharType>
+struct AutoUTF {
+ typedef CharType Ch;
+
+ enum { supportUnicode = 1 };
+
+#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
+
+ template<typename OutputStream>
+ RAPIDJSON_FORCEINLINE static void Encode(OutputStream& os, unsigned codepoint) {
+ typedef void (*EncodeFunc)(OutputStream&, unsigned);
+ static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) };
+ (*f[os.GetType()])(os, codepoint);
+ }
+
+ template<typename OutputStream>
+ RAPIDJSON_FORCEINLINE static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
+ typedef void (*EncodeFunc)(OutputStream&, unsigned);
+ static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) };
+ (*f[os.GetType()])(os, codepoint);
+ }
+
+ template <typename InputStream>
+ RAPIDJSON_FORCEINLINE static bool Decode(InputStream& is, unsigned* codepoint) {
+ typedef bool (*DecodeFunc)(InputStream&, unsigned*);
+ static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) };
+ return (*f[is.GetType()])(is, codepoint);
+ }
+
+ template <typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
+ typedef bool (*ValidateFunc)(InputStream&, OutputStream&);
+ static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) };
+ return (*f[is.GetType()])(is, os);
+ }
+
+#undef RAPIDJSON_ENCODINGS_FUNC
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Transcoder
+
+//! Encoding conversion.
+template<typename SourceEncoding, typename TargetEncoding>
+struct Transcoder {
+ //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream.
+ template<typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {
+ unsigned codepoint;
+ if (!SourceEncoding::Decode(is, &codepoint))
+ return false;
+ TargetEncoding::Encode(os, codepoint);
+ return true;
+ }
+
+ template<typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
+ unsigned codepoint;
+ if (!SourceEncoding::Decode(is, &codepoint))
+ return false;
+ TargetEncoding::EncodeUnsafe(os, codepoint);
+ return true;
+ }
+
+ //! Validate one Unicode codepoint from an encoded stream.
+ template<typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
+ return Transcode(is, os); // Since source/target encoding is different, must transcode.
+ }
+};
+
+// Forward declaration.
+template<typename Stream>
+inline void PutUnsafe(Stream& stream, typename Stream::Ch c);
+
+//! Specialization of Transcoder with same source and target encoding.
+template<typename Encoding>
+struct Transcoder<Encoding, Encoding> {
+ template<typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {
+ os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class.
+ return true;
+ }
+
+ template<typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
+ PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class.
+ return true;
+ }
+
+ template<typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {
+ return Encoding::Validate(is, os); // source/target encoding are the same
+ }
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#if defined(__GNUC__) || defined(_MSC_VER)
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_ENCODINGS_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/error/en.h b/3rdparty/rapidjson/include/rapidjson/error/en.h
new file mode 100644
index 00000000000..c2315fda7d5
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/error/en.h
@@ -0,0 +1,74 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_ERROR_EN_H_
+#define RAPIDJSON_ERROR_EN_H_
+
+#include "error.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(switch-enum)
+RAPIDJSON_DIAG_OFF(covered-switch-default)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Maps error code of parsing into error message.
+/*!
+ \ingroup RAPIDJSON_ERRORS
+ \param parseErrorCode Error code obtained in parsing.
+ \return the error message.
+ \note User can make a copy of this function for localization.
+ Using switch-case is safer for future modification of error codes.
+*/
+inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) {
+ switch (parseErrorCode) {
+ case kParseErrorNone: return RAPIDJSON_ERROR_STRING("No error.");
+
+ case kParseErrorDocumentEmpty: return RAPIDJSON_ERROR_STRING("The document is empty.");
+ case kParseErrorDocumentRootNotSingular: return RAPIDJSON_ERROR_STRING("The document root must not follow by other values.");
+
+ case kParseErrorValueInvalid: return RAPIDJSON_ERROR_STRING("Invalid value.");
+
+ case kParseErrorObjectMissName: return RAPIDJSON_ERROR_STRING("Missing a name for object member.");
+ case kParseErrorObjectMissColon: return RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member.");
+ case kParseErrorObjectMissCommaOrCurlyBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member.");
+
+ case kParseErrorArrayMissCommaOrSquareBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element.");
+
+ case kParseErrorStringUnicodeEscapeInvalidHex: return RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string.");
+ case kParseErrorStringUnicodeSurrogateInvalid: return RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid.");
+ case kParseErrorStringEscapeInvalid: return RAPIDJSON_ERROR_STRING("Invalid escape character in string.");
+ case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string.");
+ case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoding in string.");
+
+ case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double.");
+ case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number.");
+ case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number.");
+
+ case kParseErrorTermination: return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error.");
+ case kParseErrorUnspecificSyntaxError: return RAPIDJSON_ERROR_STRING("Unspecific syntax error.");
+
+ default: return RAPIDJSON_ERROR_STRING("Unknown error.");
+ }
+}
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_ERROR_EN_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/error/error.h b/3rdparty/rapidjson/include/rapidjson/error/error.h
new file mode 100644
index 00000000000..95cb31a72fe
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/error/error.h
@@ -0,0 +1,155 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_ERROR_ERROR_H_
+#define RAPIDJSON_ERROR_ERROR_H_
+
+#include "../rapidjson.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+/*! \file error.h */
+
+/*! \defgroup RAPIDJSON_ERRORS RapidJSON error handling */
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_ERROR_CHARTYPE
+
+//! Character type of error messages.
+/*! \ingroup RAPIDJSON_ERRORS
+ The default character type is \c char.
+ On Windows, user can define this macro as \c TCHAR for supporting both
+ unicode/non-unicode settings.
+*/
+#ifndef RAPIDJSON_ERROR_CHARTYPE
+#define RAPIDJSON_ERROR_CHARTYPE char
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_ERROR_STRING
+
+//! Macro for converting string literial to \ref RAPIDJSON_ERROR_CHARTYPE[].
+/*! \ingroup RAPIDJSON_ERRORS
+ By default this conversion macro does nothing.
+ On Windows, user can define this macro as \c _T(x) for supporting both
+ unicode/non-unicode settings.
+*/
+#ifndef RAPIDJSON_ERROR_STRING
+#define RAPIDJSON_ERROR_STRING(x) x
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// ParseErrorCode
+
+//! Error code of parsing.
+/*! \ingroup RAPIDJSON_ERRORS
+ \see GenericReader::Parse, GenericReader::GetParseErrorCode
+*/
+enum ParseErrorCode {
+ kParseErrorNone = 0, //!< No error.
+
+ kParseErrorDocumentEmpty, //!< The document is empty.
+ kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values.
+
+ kParseErrorValueInvalid, //!< Invalid value.
+
+ kParseErrorObjectMissName, //!< Missing a name for object member.
+ kParseErrorObjectMissColon, //!< Missing a colon after a name of object member.
+ kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member.
+
+ kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element.
+
+ kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string.
+ kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid.
+ kParseErrorStringEscapeInvalid, //!< Invalid escape character in string.
+ kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string.
+ kParseErrorStringInvalidEncoding, //!< Invalid encoding in string.
+
+ kParseErrorNumberTooBig, //!< Number too big to be stored in double.
+ kParseErrorNumberMissFraction, //!< Miss fraction part in number.
+ kParseErrorNumberMissExponent, //!< Miss exponent in number.
+
+ kParseErrorTermination, //!< Parsing was terminated.
+ kParseErrorUnspecificSyntaxError //!< Unspecific syntax error.
+};
+
+//! Result of parsing (wraps ParseErrorCode)
+/*!
+ \ingroup RAPIDJSON_ERRORS
+ \code
+ Document doc;
+ ParseResult ok = doc.Parse("[42]");
+ if (!ok) {
+ fprintf(stderr, "JSON parse error: %s (%u)",
+ GetParseError_En(ok.Code()), ok.Offset());
+ exit(EXIT_FAILURE);
+ }
+ \endcode
+ \see GenericReader::Parse, GenericDocument::Parse
+*/
+struct ParseResult {
+public:
+ //! Default constructor, no error.
+ ParseResult() : code_(kParseErrorNone), offset_(0) {}
+ //! Constructor to set an error.
+ ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {}
+
+ //! Get the error code.
+ ParseErrorCode Code() const { return code_; }
+ //! Get the error offset, if \ref IsError(), 0 otherwise.
+ size_t Offset() const { return offset_; }
+
+ //! Conversion to \c bool, returns \c true, iff !\ref IsError().
+ operator bool() const { return !IsError(); }
+ //! Whether the result is an error.
+ bool IsError() const { return code_ != kParseErrorNone; }
+
+ bool operator==(const ParseResult& that) const { return code_ == that.code_; }
+ bool operator==(ParseErrorCode code) const { return code_ == code; }
+ friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; }
+
+ //! Reset error code.
+ void Clear() { Set(kParseErrorNone); }
+ //! Update error code and offset.
+ void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; }
+
+private:
+ ParseErrorCode code_;
+ size_t offset_;
+};
+
+//! Function pointer type of GetParseError().
+/*! \ingroup RAPIDJSON_ERRORS
+
+ This is the prototype for \c GetParseError_X(), where \c X is a locale.
+ User can dynamically change locale in runtime, e.g.:
+\code
+ GetParseErrorFunc GetParseError = GetParseError_En; // or whatever
+ const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode());
+\endcode
+*/
+typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode);
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_ERROR_ERROR_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/filereadstream.h b/3rdparty/rapidjson/include/rapidjson/filereadstream.h
new file mode 100644
index 00000000000..b56ea13b342
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/filereadstream.h
@@ -0,0 +1,99 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_FILEREADSTREAM_H_
+#define RAPIDJSON_FILEREADSTREAM_H_
+
+#include "stream.h"
+#include <cstdio>
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+RAPIDJSON_DIAG_OFF(unreachable-code)
+RAPIDJSON_DIAG_OFF(missing-noreturn)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! File byte stream for input using fread().
+/*!
+ \note implements Stream concept
+*/
+class FileReadStream {
+public:
+ typedef char Ch; //!< Character type (byte).
+
+ //! Constructor.
+ /*!
+ \param fp File pointer opened for read.
+ \param buffer user-supplied buffer.
+ \param bufferSize size of buffer in bytes. Must >=4 bytes.
+ */
+ FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
+ RAPIDJSON_ASSERT(fp_ != 0);
+ RAPIDJSON_ASSERT(bufferSize >= 4);
+ Read();
+ }
+
+ Ch Peek() const { return *current_; }
+ Ch Take() { Ch c = *current_; Read(); return c; }
+ size_t Tell() const { return count_ + static_cast<size_t>(current_ - buffer_); }
+
+ // Not implemented
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+ // For encoding detection only.
+ const Ch* Peek4() const {
+ return (current_ + 4 <= bufferLast_) ? current_ : 0;
+ }
+
+private:
+ void Read() {
+ if (current_ < bufferLast_)
+ ++current_;
+ else if (!eof_) {
+ count_ += readCount_;
+ readCount_ = fread(buffer_, 1, bufferSize_, fp_);
+ bufferLast_ = buffer_ + readCount_ - 1;
+ current_ = buffer_;
+
+ if (readCount_ < bufferSize_) {
+ buffer_[readCount_] = '\0';
+ ++bufferLast_;
+ eof_ = true;
+ }
+ }
+ }
+
+ std::FILE* fp_;
+ Ch *buffer_;
+ size_t bufferSize_;
+ Ch *bufferLast_;
+ Ch *current_;
+ size_t readCount_;
+ size_t count_; //!< Number of characters read
+ bool eof_;
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_FILESTREAM_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/filewritestream.h b/3rdparty/rapidjson/include/rapidjson/filewritestream.h
new file mode 100644
index 00000000000..6378dd60ed4
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/filewritestream.h
@@ -0,0 +1,104 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_FILEWRITESTREAM_H_
+#define RAPIDJSON_FILEWRITESTREAM_H_
+
+#include "stream.h"
+#include <cstdio>
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(unreachable-code)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Wrapper of C file stream for input using fread().
+/*!
+ \note implements Stream concept
+*/
+class FileWriteStream {
+public:
+ typedef char Ch; //!< Character type. Only support char.
+
+ FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) {
+ RAPIDJSON_ASSERT(fp_ != 0);
+ }
+
+ void Put(char c) {
+ if (current_ >= bufferEnd_)
+ Flush();
+
+ *current_++ = c;
+ }
+
+ void PutN(char c, size_t n) {
+ size_t avail = static_cast<size_t>(bufferEnd_ - current_);
+ while (n > avail) {
+ std::memset(current_, c, avail);
+ current_ += avail;
+ Flush();
+ n -= avail;
+ avail = static_cast<size_t>(bufferEnd_ - current_);
+ }
+
+ if (n > 0) {
+ std::memset(current_, c, n);
+ current_ += n;
+ }
+ }
+
+ void Flush() {
+ if (current_ != buffer_) {
+ size_t result = fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);
+ if (result < static_cast<size_t>(current_ - buffer_)) {
+ // failure deliberately ignored at this time
+ // added to avoid warn_unused_result build errors
+ }
+ current_ = buffer_;
+ }
+ }
+
+ // Not implemented
+ char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
+ char Take() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
+ char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ // Prohibit copy constructor & assignment operator.
+ FileWriteStream(const FileWriteStream&);
+ FileWriteStream& operator=(const FileWriteStream&);
+
+ std::FILE* fp_;
+ char *buffer_;
+ char *bufferEnd_;
+ char *current_;
+};
+
+//! Implement specialized version of PutN() with memset() for better performance.
+template<>
+inline void PutN(FileWriteStream& stream, char c, size_t n) {
+ stream.PutN(c, n);
+}
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_FILESTREAM_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/fwd.h b/3rdparty/rapidjson/include/rapidjson/fwd.h
new file mode 100644
index 00000000000..e8104e841bc
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/fwd.h
@@ -0,0 +1,151 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_FWD_H_
+#define RAPIDJSON_FWD_H_
+
+#include "rapidjson.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+// encodings.h
+
+template<typename CharType> struct UTF8;
+template<typename CharType> struct UTF16;
+template<typename CharType> struct UTF16BE;
+template<typename CharType> struct UTF16LE;
+template<typename CharType> struct UTF32;
+template<typename CharType> struct UTF32BE;
+template<typename CharType> struct UTF32LE;
+template<typename CharType> struct ASCII;
+template<typename CharType> struct AutoUTF;
+
+template<typename SourceEncoding, typename TargetEncoding>
+struct Transcoder;
+
+// allocators.h
+
+class CrtAllocator;
+
+template <typename BaseAllocator>
+class MemoryPoolAllocator;
+
+// stream.h
+
+template <typename Encoding>
+struct GenericStringStream;
+
+typedef GenericStringStream<UTF8<char> > StringStream;
+
+template <typename Encoding>
+struct GenericInsituStringStream;
+
+typedef GenericInsituStringStream<UTF8<char> > InsituStringStream;
+
+// stringbuffer.h
+
+template <typename Encoding, typename Allocator>
+class GenericStringBuffer;
+
+typedef GenericStringBuffer<UTF8<char>, CrtAllocator> StringBuffer;
+
+// filereadstream.h
+
+class FileReadStream;
+
+// filewritestream.h
+
+class FileWriteStream;
+
+// memorybuffer.h
+
+template <typename Allocator>
+struct GenericMemoryBuffer;
+
+typedef GenericMemoryBuffer<CrtAllocator> MemoryBuffer;
+
+// memorystream.h
+
+struct MemoryStream;
+
+// reader.h
+
+template<typename Encoding, typename Derived>
+struct BaseReaderHandler;
+
+template <typename SourceEncoding, typename TargetEncoding, typename StackAllocator>
+class GenericReader;
+
+typedef GenericReader<UTF8<char>, UTF8<char>, CrtAllocator> Reader;
+
+// writer.h
+
+template<typename OutputStream, typename SourceEncoding, typename TargetEncoding, typename StackAllocator, unsigned writeFlags>
+class Writer;
+
+// prettywriter.h
+
+template<typename OutputStream, typename SourceEncoding, typename TargetEncoding, typename StackAllocator, unsigned writeFlags>
+class PrettyWriter;
+
+// document.h
+
+template <typename Encoding, typename Allocator>
+struct GenericMember;
+
+template <bool Const, typename Encoding, typename Allocator>
+class GenericMemberIterator;
+
+template<typename CharType>
+struct GenericStringRef;
+
+template <typename Encoding, typename Allocator>
+class GenericValue;
+
+typedef GenericValue<UTF8<char>, MemoryPoolAllocator<CrtAllocator> > Value;
+
+template <typename Encoding, typename Allocator, typename StackAllocator>
+class GenericDocument;
+
+typedef GenericDocument<UTF8<char>, MemoryPoolAllocator<CrtAllocator>, CrtAllocator> Document;
+
+// pointer.h
+
+template <typename ValueType, typename Allocator>
+class GenericPointer;
+
+typedef GenericPointer<Value, CrtAllocator> Pointer;
+
+// schema.h
+
+template <typename SchemaDocumentType>
+class IGenericRemoteSchemaDocumentProvider;
+
+template <typename ValueT, typename Allocator>
+class GenericSchemaDocument;
+
+typedef GenericSchemaDocument<Value, CrtAllocator> SchemaDocument;
+typedef IGenericRemoteSchemaDocumentProvider<SchemaDocument> IRemoteSchemaDocumentProvider;
+
+template <
+ typename SchemaDocumentType,
+ typename OutputHandler,
+ typename StateAllocator>
+class GenericSchemaValidator;
+
+typedef GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<char>, void>, CrtAllocator> SchemaValidator;
+
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_RAPIDJSONFWD_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/biginteger.h b/3rdparty/rapidjson/include/rapidjson/internal/biginteger.h
new file mode 100644
index 00000000000..9d3e88c9981
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/biginteger.h
@@ -0,0 +1,290 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_BIGINTEGER_H_
+#define RAPIDJSON_BIGINTEGER_H_
+
+#include "../rapidjson.h"
+
+#if defined(_MSC_VER) && defined(_M_AMD64)
+#include <intrin.h> // for _umul128
+#pragma intrinsic(_umul128)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+class BigInteger {
+public:
+ typedef uint64_t Type;
+
+ BigInteger(const BigInteger& rhs) : count_(rhs.count_) {
+ std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
+ }
+
+ explicit BigInteger(uint64_t u) : count_(1) {
+ digits_[0] = u;
+ }
+
+ BigInteger(const char* decimals, size_t length) : count_(1) {
+ RAPIDJSON_ASSERT(length > 0);
+ digits_[0] = 0;
+ size_t i = 0;
+ const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19
+ while (length >= kMaxDigitPerIteration) {
+ AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration);
+ length -= kMaxDigitPerIteration;
+ i += kMaxDigitPerIteration;
+ }
+
+ if (length > 0)
+ AppendDecimal64(decimals + i, decimals + i + length);
+ }
+
+ BigInteger& operator=(const BigInteger &rhs)
+ {
+ if (this != &rhs) {
+ count_ = rhs.count_;
+ std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
+ }
+ return *this;
+ }
+
+ BigInteger& operator=(uint64_t u) {
+ digits_[0] = u;
+ count_ = 1;
+ return *this;
+ }
+
+ BigInteger& operator+=(uint64_t u) {
+ Type backup = digits_[0];
+ digits_[0] += u;
+ for (size_t i = 0; i < count_ - 1; i++) {
+ if (digits_[i] >= backup)
+ return *this; // no carry
+ backup = digits_[i + 1];
+ digits_[i + 1] += 1;
+ }
+
+ // Last carry
+ if (digits_[count_ - 1] < backup)
+ PushBack(1);
+
+ return *this;
+ }
+
+ BigInteger& operator*=(uint64_t u) {
+ if (u == 0) return *this = 0;
+ if (u == 1) return *this;
+ if (*this == 1) return *this = u;
+
+ uint64_t k = 0;
+ for (size_t i = 0; i < count_; i++) {
+ uint64_t hi;
+ digits_[i] = MulAdd64(digits_[i], u, k, &hi);
+ k = hi;
+ }
+
+ if (k > 0)
+ PushBack(k);
+
+ return *this;
+ }
+
+ BigInteger& operator*=(uint32_t u) {
+ if (u == 0) return *this = 0;
+ if (u == 1) return *this;
+ if (*this == 1) return *this = u;
+
+ uint64_t k = 0;
+ for (size_t i = 0; i < count_; i++) {
+ const uint64_t c = digits_[i] >> 32;
+ const uint64_t d = digits_[i] & 0xFFFFFFFF;
+ const uint64_t uc = u * c;
+ const uint64_t ud = u * d;
+ const uint64_t p0 = ud + k;
+ const uint64_t p1 = uc + (p0 >> 32);
+ digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32);
+ k = p1 >> 32;
+ }
+
+ if (k > 0)
+ PushBack(k);
+
+ return *this;
+ }
+
+ BigInteger& operator<<=(size_t shift) {
+ if (IsZero() || shift == 0) return *this;
+
+ size_t offset = shift / kTypeBit;
+ size_t interShift = shift % kTypeBit;
+ RAPIDJSON_ASSERT(count_ + offset <= kCapacity);
+
+ if (interShift == 0) {
+ std::memmove(&digits_[count_ - 1 + offset], &digits_[count_ - 1], count_ * sizeof(Type));
+ count_ += offset;
+ }
+ else {
+ digits_[count_] = 0;
+ for (size_t i = count_; i > 0; i--)
+ digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift));
+ digits_[offset] = digits_[0] << interShift;
+ count_ += offset;
+ if (digits_[count_])
+ count_++;
+ }
+
+ std::memset(digits_, 0, offset * sizeof(Type));
+
+ return *this;
+ }
+
+ bool operator==(const BigInteger& rhs) const {
+ return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0;
+ }
+
+ bool operator==(const Type rhs) const {
+ return count_ == 1 && digits_[0] == rhs;
+ }
+
+ BigInteger& MultiplyPow5(unsigned exp) {
+ static const uint32_t kPow5[12] = {
+ 5,
+ 5 * 5,
+ 5 * 5 * 5,
+ 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
+ 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5
+ };
+ if (exp == 0) return *this;
+ for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27
+ for (; exp >= 13; exp -= 13) *this *= static_cast<uint32_t>(1220703125u); // 5^13
+ if (exp > 0) *this *= kPow5[exp - 1];
+ return *this;
+ }
+
+ // Compute absolute difference of this and rhs.
+ // Assume this != rhs
+ bool Difference(const BigInteger& rhs, BigInteger* out) const {
+ int cmp = Compare(rhs);
+ RAPIDJSON_ASSERT(cmp != 0);
+ const BigInteger *a, *b; // Makes a > b
+ bool ret;
+ if (cmp < 0) { a = &rhs; b = this; ret = true; }
+ else { a = this; b = &rhs; ret = false; }
+
+ Type borrow = 0;
+ for (size_t i = 0; i < a->count_; i++) {
+ Type d = a->digits_[i] - borrow;
+ if (i < b->count_)
+ d -= b->digits_[i];
+ borrow = (d > a->digits_[i]) ? 1 : 0;
+ out->digits_[i] = d;
+ if (d != 0)
+ out->count_ = i + 1;
+ }
+
+ return ret;
+ }
+
+ int Compare(const BigInteger& rhs) const {
+ if (count_ != rhs.count_)
+ return count_ < rhs.count_ ? -1 : 1;
+
+ for (size_t i = count_; i-- > 0;)
+ if (digits_[i] != rhs.digits_[i])
+ return digits_[i] < rhs.digits_[i] ? -1 : 1;
+
+ return 0;
+ }
+
+ size_t GetCount() const { return count_; }
+ Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; }
+ bool IsZero() const { return count_ == 1 && digits_[0] == 0; }
+
+private:
+ void AppendDecimal64(const char* begin, const char* end) {
+ uint64_t u = ParseUint64(begin, end);
+ if (IsZero())
+ *this = u;
+ else {
+ unsigned exp = static_cast<unsigned>(end - begin);
+ (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u
+ }
+ }
+
+ void PushBack(Type digit) {
+ RAPIDJSON_ASSERT(count_ < kCapacity);
+ digits_[count_++] = digit;
+ }
+
+ static uint64_t ParseUint64(const char* begin, const char* end) {
+ uint64_t r = 0;
+ for (const char* p = begin; p != end; ++p) {
+ RAPIDJSON_ASSERT(*p >= '0' && *p <= '9');
+ r = r * 10u + static_cast<unsigned>(*p - '0');
+ }
+ return r;
+ }
+
+ // Assume a * b + k < 2^128
+ static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) {
+#if defined(_MSC_VER) && defined(_M_AMD64)
+ uint64_t low = _umul128(a, b, outHigh) + k;
+ if (low < k)
+ (*outHigh)++;
+ return low;
+#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)
+ __extension__ typedef unsigned __int128 uint128;
+ uint128 p = static_cast<uint128>(a) * static_cast<uint128>(b);
+ p += k;
+ *outHigh = static_cast<uint64_t>(p >> 64);
+ return static_cast<uint64_t>(p);
+#else
+ const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32;
+ uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1;
+ x1 += (x0 >> 32); // can't give carry
+ x1 += x2;
+ if (x1 < x2)
+ x3 += (static_cast<uint64_t>(1) << 32);
+ uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF);
+ uint64_t hi = x3 + (x1 >> 32);
+
+ lo += k;
+ if (lo < k)
+ hi++;
+ *outHigh = hi;
+ return lo;
+#endif
+ }
+
+ static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000
+ static const size_t kCapacity = kBitCount / sizeof(Type);
+ static const size_t kTypeBit = sizeof(Type) * 8;
+
+ Type digits_[kCapacity];
+ size_t count_;
+};
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_BIGINTEGER_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/diyfp.h b/3rdparty/rapidjson/include/rapidjson/internal/diyfp.h
new file mode 100644
index 00000000000..c9fefdc6139
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/diyfp.h
@@ -0,0 +1,258 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+// This is a C++ header-only implementation of Grisu2 algorithm from the publication:
+// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with
+// integers." ACM Sigplan Notices 45.6 (2010): 233-243.
+
+#ifndef RAPIDJSON_DIYFP_H_
+#define RAPIDJSON_DIYFP_H_
+
+#include "../rapidjson.h"
+
+#if defined(_MSC_VER) && defined(_M_AMD64)
+#include <intrin.h>
+#pragma intrinsic(_BitScanReverse64)
+#pragma intrinsic(_umul128)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+struct DiyFp {
+ DiyFp() : f(), e() {}
+
+ DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {}
+
+ explicit DiyFp(double d) {
+ union {
+ double d;
+ uint64_t u64;
+ } u = { d };
+
+ int biased_e = static_cast<int>((u.u64 & kDpExponentMask) >> kDpSignificandSize);
+ uint64_t significand = (u.u64 & kDpSignificandMask);
+ if (biased_e != 0) {
+ f = significand + kDpHiddenBit;
+ e = biased_e - kDpExponentBias;
+ }
+ else {
+ f = significand;
+ e = kDpMinExponent + 1;
+ }
+ }
+
+ DiyFp operator-(const DiyFp& rhs) const {
+ return DiyFp(f - rhs.f, e);
+ }
+
+ DiyFp operator*(const DiyFp& rhs) const {
+#if defined(_MSC_VER) && defined(_M_AMD64)
+ uint64_t h;
+ uint64_t l = _umul128(f, rhs.f, &h);
+ if (l & (uint64_t(1) << 63)) // rounding
+ h++;
+ return DiyFp(h, e + rhs.e + 64);
+#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)
+ __extension__ typedef unsigned __int128 uint128;
+ uint128 p = static_cast<uint128>(f) * static_cast<uint128>(rhs.f);
+ uint64_t h = static_cast<uint64_t>(p >> 64);
+ uint64_t l = static_cast<uint64_t>(p);
+ if (l & (uint64_t(1) << 63)) // rounding
+ h++;
+ return DiyFp(h, e + rhs.e + 64);
+#else
+ const uint64_t M32 = 0xFFFFFFFF;
+ const uint64_t a = f >> 32;
+ const uint64_t b = f & M32;
+ const uint64_t c = rhs.f >> 32;
+ const uint64_t d = rhs.f & M32;
+ const uint64_t ac = a * c;
+ const uint64_t bc = b * c;
+ const uint64_t ad = a * d;
+ const uint64_t bd = b * d;
+ uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32);
+ tmp += 1U << 31; /// mult_round
+ return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64);
+#endif
+ }
+
+ DiyFp Normalize() const {
+#if defined(_MSC_VER) && defined(_M_AMD64)
+ unsigned long index;
+ _BitScanReverse64(&index, f);
+ return DiyFp(f << (63 - index), e - (63 - index));
+#elif defined(__GNUC__) && __GNUC__ >= 4
+ int s = __builtin_clzll(f);
+ return DiyFp(f << s, e - s);
+#else
+ DiyFp res = *this;
+ while (!(res.f & (static_cast<uint64_t>(1) << 63))) {
+ res.f <<= 1;
+ res.e--;
+ }
+ return res;
+#endif
+ }
+
+ DiyFp NormalizeBoundary() const {
+ DiyFp res = *this;
+ while (!(res.f & (kDpHiddenBit << 1))) {
+ res.f <<= 1;
+ res.e--;
+ }
+ res.f <<= (kDiySignificandSize - kDpSignificandSize - 2);
+ res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2);
+ return res;
+ }
+
+ void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const {
+ DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary();
+ DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1);
+ mi.f <<= mi.e - pl.e;
+ mi.e = pl.e;
+ *plus = pl;
+ *minus = mi;
+ }
+
+ double ToDouble() const {
+ union {
+ double d;
+ uint64_t u64;
+ }u;
+ const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 :
+ static_cast<uint64_t>(e + kDpExponentBias);
+ u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize);
+ return u.d;
+ }
+
+ static const int kDiySignificandSize = 64;
+ static const int kDpSignificandSize = 52;
+ static const int kDpExponentBias = 0x3FF + kDpSignificandSize;
+ static const int kDpMaxExponent = 0x7FF - kDpExponentBias;
+ static const int kDpMinExponent = -kDpExponentBias;
+ static const int kDpDenormalExponent = -kDpExponentBias + 1;
+ static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
+ static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
+ static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
+
+ uint64_t f;
+ int e;
+};
+
+inline DiyFp GetCachedPowerByIndex(size_t index) {
+ // 10^-348, 10^-340, ..., 10^340
+ static const uint64_t kCachedPowers_F[] = {
+ RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76),
+ RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea),
+ RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df),
+ RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f),
+ RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c),
+ RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5),
+ RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d),
+ RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637),
+ RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7),
+ RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5),
+ RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b),
+ RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996),
+ RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6),
+ RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8),
+ RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053),
+ RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd),
+ RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94),
+ RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b),
+ RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac),
+ RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3),
+ RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb),
+ RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c),
+ RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000),
+ RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984),
+ RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70),
+ RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245),
+ RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8),
+ RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a),
+ RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea),
+ RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85),
+ RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2),
+ RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3),
+ RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25),
+ RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece),
+ RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5),
+ RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a),
+ RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c),
+ RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a),
+ RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129),
+ RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429),
+ RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d),
+ RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841),
+ RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9),
+ RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b)
+ };
+ static const int16_t kCachedPowers_E[] = {
+ -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,
+ -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,
+ -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,
+ -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,
+ -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,
+ 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,
+ 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,
+ 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,
+ 907, 933, 960, 986, 1013, 1039, 1066
+ };
+ return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]);
+}
+
+inline DiyFp GetCachedPower(int e, int* K) {
+
+ //int k = static_cast<int>(ceil((-61 - e) * 0.30102999566398114)) + 374;
+ double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive
+ int k = static_cast<int>(dk);
+ if (dk - k > 0.0)
+ k++;
+
+ unsigned index = static_cast<unsigned>((k >> 3) + 1);
+ *K = -(-348 + static_cast<int>(index << 3)); // decimal exponent no need lookup table
+
+ return GetCachedPowerByIndex(index);
+}
+
+inline DiyFp GetCachedPower10(int exp, int *outExp) {
+ unsigned index = (static_cast<unsigned>(exp) + 348u) / 8u;
+ *outExp = -348 + static_cast<int>(index) * 8;
+ return GetCachedPowerByIndex(index);
+ }
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_DIYFP_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/dtoa.h b/3rdparty/rapidjson/include/rapidjson/internal/dtoa.h
new file mode 100644
index 00000000000..940d61a0548
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/dtoa.h
@@ -0,0 +1,243 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+// This is a C++ header-only implementation of Grisu2 algorithm from the publication:
+// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with
+// integers." ACM Sigplan Notices 45.6 (2010): 233-243.
+
+#ifndef RAPIDJSON_DTOA_
+#define RAPIDJSON_DTOA_
+
+#include "itoa.h" // GetDigitsLut()
+#include "diyfp.h"
+#include "ieee754.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) {
+ while (rest < wp_w && delta - rest >= ten_kappa &&
+ (rest + ten_kappa < wp_w || /// closer
+ wp_w - rest > rest + ten_kappa - wp_w)) {
+ buffer[len - 1]--;
+ rest += ten_kappa;
+ }
+}
+
+inline unsigned CountDecimalDigit32(uint32_t n) {
+ // Simple pure C++ implementation was faster than __builtin_clz version in this situation.
+ if (n < 10) return 1;
+ if (n < 100) return 2;
+ if (n < 1000) return 3;
+ if (n < 10000) return 4;
+ if (n < 100000) return 5;
+ if (n < 1000000) return 6;
+ if (n < 10000000) return 7;
+ if (n < 100000000) return 8;
+ // Will not reach 10 digits in DigitGen()
+ //if (n < 1000000000) return 9;
+ //return 10;
+ return 9;
+}
+
+inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) {
+ static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
+ const DiyFp one(uint64_t(1) << -Mp.e, Mp.e);
+ const DiyFp wp_w = Mp - W;
+ uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e);
+ uint64_t p2 = Mp.f & (one.f - 1);
+ unsigned kappa = CountDecimalDigit32(p1); // kappa in [0, 9]
+ *len = 0;
+
+ while (kappa > 0) {
+ uint32_t d = 0;
+ switch (kappa) {
+ case 9: d = p1 / 100000000; p1 %= 100000000; break;
+ case 8: d = p1 / 10000000; p1 %= 10000000; break;
+ case 7: d = p1 / 1000000; p1 %= 1000000; break;
+ case 6: d = p1 / 100000; p1 %= 100000; break;
+ case 5: d = p1 / 10000; p1 %= 10000; break;
+ case 4: d = p1 / 1000; p1 %= 1000; break;
+ case 3: d = p1 / 100; p1 %= 100; break;
+ case 2: d = p1 / 10; p1 %= 10; break;
+ case 1: d = p1; p1 = 0; break;
+ default:;
+ }
+ if (d || *len)
+ buffer[(*len)++] = static_cast<char>('0' + static_cast<char>(d));
+ kappa--;
+ uint64_t tmp = (static_cast<uint64_t>(p1) << -one.e) + p2;
+ if (tmp <= delta) {
+ *K += kappa;
+ GrisuRound(buffer, *len, delta, tmp, static_cast<uint64_t>(kPow10[kappa]) << -one.e, wp_w.f);
+ return;
+ }
+ }
+
+ // kappa = 0
+ for (;;) {
+ p2 *= 10;
+ delta *= 10;
+ char d = static_cast<char>(p2 >> -one.e);
+ if (d || *len)
+ buffer[(*len)++] = static_cast<char>('0' + d);
+ p2 &= one.f - 1;
+ kappa--;
+ if (p2 < delta) {
+ *K += kappa;
+ GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * kPow10[-static_cast<int>(kappa)]);
+ return;
+ }
+ }
+}
+
+inline void Grisu2(double value, char* buffer, int* length, int* K) {
+ const DiyFp v(value);
+ DiyFp w_m, w_p;
+ v.NormalizedBoundaries(&w_m, &w_p);
+
+ const DiyFp c_mk = GetCachedPower(w_p.e, K);
+ const DiyFp W = v.Normalize() * c_mk;
+ DiyFp Wp = w_p * c_mk;
+ DiyFp Wm = w_m * c_mk;
+ Wm.f++;
+ Wp.f--;
+ DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K);
+}
+
+inline char* WriteExponent(int K, char* buffer) {
+ if (K < 0) {
+ *buffer++ = '-';
+ K = -K;
+ }
+
+ if (K >= 100) {
+ *buffer++ = static_cast<char>('0' + static_cast<char>(K / 100));
+ K %= 100;
+ const char* d = GetDigitsLut() + K * 2;
+ *buffer++ = d[0];
+ *buffer++ = d[1];
+ }
+ else if (K >= 10) {
+ const char* d = GetDigitsLut() + K * 2;
+ *buffer++ = d[0];
+ *buffer++ = d[1];
+ }
+ else
+ *buffer++ = static_cast<char>('0' + static_cast<char>(K));
+
+ return buffer;
+}
+
+inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) {
+ const int kk = length + k; // 10^(kk-1) <= v < 10^kk
+
+ if (length <= kk && kk <= 21) {
+ // 1234e7 -> 12340000000
+ for (int i = length; i < kk; i++)
+ buffer[i] = '0';
+ buffer[kk] = '.';
+ buffer[kk + 1] = '0';
+ return &buffer[kk + 2];
+ }
+ else if (0 < kk && kk <= 21) {
+ // 1234e-2 -> 12.34
+ std::memmove(&buffer[kk + 1], &buffer[kk], static_cast<size_t>(length - kk));
+ buffer[kk] = '.';
+ if (length > kk + maxDecimalPlaces) {
+ // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1
+ // Remove extra trailing zeros (at least one) after truncation.
+ for (int i = kk + maxDecimalPlaces; i > kk + 1; i--)
+ if (buffer[i] != '0')
+ return &buffer[i + 1];
+ return &buffer[kk + 2]; // Reserve one zero
+ }
+ else
+ return &buffer[length + 1];
+ }
+ else if (-6 < kk && kk <= 0) {
+ // 1234e-6 -> 0.001234
+ const int offset = 2 - kk;
+ std::memmove(&buffer[offset], &buffer[0], static_cast<size_t>(length));
+ buffer[0] = '0';
+ buffer[1] = '.';
+ for (int i = 2; i < offset; i++)
+ buffer[i] = '0';
+ if (length + offset > maxDecimalPlaces) {
+ // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1
+ // Remove extra trailing zeros (at least one) after truncation.
+ for (int i = maxDecimalPlaces + 1; i > 2; i--)
+ if (buffer[i] != '0')
+ return &buffer[i + 1];
+ return &buffer[3]; // Reserve one zero
+ }
+ else
+ return &buffer[length + offset];
+ }
+ else if (kk < -maxDecimalPlaces) {
+ // Truncate to zero
+ buffer[0] = '0';
+ buffer[1] = '.';
+ buffer[2] = '0';
+ return &buffer[3];
+ }
+ else if (length == 1) {
+ // 1e30
+ buffer[1] = 'e';
+ return WriteExponent(kk - 1, &buffer[2]);
+ }
+ else {
+ // 1234e30 -> 1.234e33
+ std::memmove(&buffer[2], &buffer[1], static_cast<size_t>(length - 1));
+ buffer[1] = '.';
+ buffer[length + 1] = 'e';
+ return WriteExponent(kk - 1, &buffer[0 + length + 2]);
+ }
+}
+
+inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) {
+ RAPIDJSON_ASSERT(maxDecimalPlaces >= 1);
+ Double d(value);
+ if (d.IsZero()) {
+ if (d.Sign())
+ *buffer++ = '-'; // -0.0, Issue #289
+ buffer[0] = '0';
+ buffer[1] = '.';
+ buffer[2] = '0';
+ return &buffer[3];
+ }
+ else {
+ if (value < 0) {
+ *buffer++ = '-';
+ value = -value;
+ }
+ int length, K;
+ Grisu2(value, buffer, &length, &K);
+ return Prettify(buffer, length, K, maxDecimalPlaces);
+ }
+}
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_DTOA_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/ieee754.h b/3rdparty/rapidjson/include/rapidjson/internal/ieee754.h
new file mode 100644
index 00000000000..82bb0b99e5c
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/ieee754.h
@@ -0,0 +1,78 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_IEEE754_
+#define RAPIDJSON_IEEE754_
+
+#include "../rapidjson.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+class Double {
+public:
+ Double() {}
+ Double(double d) : d_(d) {}
+ Double(uint64_t u) : u_(u) {}
+
+ double Value() const { return d_; }
+ uint64_t Uint64Value() const { return u_; }
+
+ double NextPositiveDouble() const {
+ RAPIDJSON_ASSERT(!Sign());
+ return Double(u_ + 1).Value();
+ }
+
+ bool Sign() const { return (u_ & kSignMask) != 0; }
+ uint64_t Significand() const { return u_ & kSignificandMask; }
+ int Exponent() const { return static_cast<int>(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); }
+
+ bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; }
+ bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; }
+ bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; }
+ bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; }
+ bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; }
+
+ uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); }
+ int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; }
+ uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; }
+
+ static unsigned EffectiveSignificandSize(int order) {
+ if (order >= -1021)
+ return 53;
+ else if (order <= -1074)
+ return 0;
+ else
+ return static_cast<unsigned>(order) + 1074;
+ }
+
+private:
+ static const int kSignificandSize = 52;
+ static const int kExponentBias = 0x3FF;
+ static const int kDenormalExponent = 1 - kExponentBias;
+ static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000);
+ static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
+ static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
+ static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
+
+ union {
+ double d_;
+ uint64_t u_;
+ };
+};
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_IEEE754_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/itoa.h b/3rdparty/rapidjson/include/rapidjson/internal/itoa.h
new file mode 100644
index 00000000000..01a4e7e72d7
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/itoa.h
@@ -0,0 +1,304 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_ITOA_
+#define RAPIDJSON_ITOA_
+
+#include "../rapidjson.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+inline const char* GetDigitsLut() {
+ static const char cDigitsLut[200] = {
+ '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9',
+ '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9',
+ '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9',
+ '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9',
+ '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9',
+ '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9',
+ '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9',
+ '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9',
+ '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9',
+ '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9'
+ };
+ return cDigitsLut;
+}
+
+inline char* u32toa(uint32_t value, char* buffer) {
+ const char* cDigitsLut = GetDigitsLut();
+
+ if (value < 10000) {
+ const uint32_t d1 = (value / 100) << 1;
+ const uint32_t d2 = (value % 100) << 1;
+
+ if (value >= 1000)
+ *buffer++ = cDigitsLut[d1];
+ if (value >= 100)
+ *buffer++ = cDigitsLut[d1 + 1];
+ if (value >= 10)
+ *buffer++ = cDigitsLut[d2];
+ *buffer++ = cDigitsLut[d2 + 1];
+ }
+ else if (value < 100000000) {
+ // value = bbbbcccc
+ const uint32_t b = value / 10000;
+ const uint32_t c = value % 10000;
+
+ const uint32_t d1 = (b / 100) << 1;
+ const uint32_t d2 = (b % 100) << 1;
+
+ const uint32_t d3 = (c / 100) << 1;
+ const uint32_t d4 = (c % 100) << 1;
+
+ if (value >= 10000000)
+ *buffer++ = cDigitsLut[d1];
+ if (value >= 1000000)
+ *buffer++ = cDigitsLut[d1 + 1];
+ if (value >= 100000)
+ *buffer++ = cDigitsLut[d2];
+ *buffer++ = cDigitsLut[d2 + 1];
+
+ *buffer++ = cDigitsLut[d3];
+ *buffer++ = cDigitsLut[d3 + 1];
+ *buffer++ = cDigitsLut[d4];
+ *buffer++ = cDigitsLut[d4 + 1];
+ }
+ else {
+ // value = aabbbbcccc in decimal
+
+ const uint32_t a = value / 100000000; // 1 to 42
+ value %= 100000000;
+
+ if (a >= 10) {
+ const unsigned i = a << 1;
+ *buffer++ = cDigitsLut[i];
+ *buffer++ = cDigitsLut[i + 1];
+ }
+ else
+ *buffer++ = static_cast<char>('0' + static_cast<char>(a));
+
+ const uint32_t b = value / 10000; // 0 to 9999
+ const uint32_t c = value % 10000; // 0 to 9999
+
+ const uint32_t d1 = (b / 100) << 1;
+ const uint32_t d2 = (b % 100) << 1;
+
+ const uint32_t d3 = (c / 100) << 1;
+ const uint32_t d4 = (c % 100) << 1;
+
+ *buffer++ = cDigitsLut[d1];
+ *buffer++ = cDigitsLut[d1 + 1];
+ *buffer++ = cDigitsLut[d2];
+ *buffer++ = cDigitsLut[d2 + 1];
+ *buffer++ = cDigitsLut[d3];
+ *buffer++ = cDigitsLut[d3 + 1];
+ *buffer++ = cDigitsLut[d4];
+ *buffer++ = cDigitsLut[d4 + 1];
+ }
+ return buffer;
+}
+
+inline char* i32toa(int32_t value, char* buffer) {
+ uint32_t u = static_cast<uint32_t>(value);
+ if (value < 0) {
+ *buffer++ = '-';
+ u = ~u + 1;
+ }
+
+ return u32toa(u, buffer);
+}
+
+inline char* u64toa(uint64_t value, char* buffer) {
+ const char* cDigitsLut = GetDigitsLut();
+ const uint64_t kTen8 = 100000000;
+ const uint64_t kTen9 = kTen8 * 10;
+ const uint64_t kTen10 = kTen8 * 100;
+ const uint64_t kTen11 = kTen8 * 1000;
+ const uint64_t kTen12 = kTen8 * 10000;
+ const uint64_t kTen13 = kTen8 * 100000;
+ const uint64_t kTen14 = kTen8 * 1000000;
+ const uint64_t kTen15 = kTen8 * 10000000;
+ const uint64_t kTen16 = kTen8 * kTen8;
+
+ if (value < kTen8) {
+ uint32_t v = static_cast<uint32_t>(value);
+ if (v < 10000) {
+ const uint32_t d1 = (v / 100) << 1;
+ const uint32_t d2 = (v % 100) << 1;
+
+ if (v >= 1000)
+ *buffer++ = cDigitsLut[d1];
+ if (v >= 100)
+ *buffer++ = cDigitsLut[d1 + 1];
+ if (v >= 10)
+ *buffer++ = cDigitsLut[d2];
+ *buffer++ = cDigitsLut[d2 + 1];
+ }
+ else {
+ // value = bbbbcccc
+ const uint32_t b = v / 10000;
+ const uint32_t c = v % 10000;
+
+ const uint32_t d1 = (b / 100) << 1;
+ const uint32_t d2 = (b % 100) << 1;
+
+ const uint32_t d3 = (c / 100) << 1;
+ const uint32_t d4 = (c % 100) << 1;
+
+ if (value >= 10000000)
+ *buffer++ = cDigitsLut[d1];
+ if (value >= 1000000)
+ *buffer++ = cDigitsLut[d1 + 1];
+ if (value >= 100000)
+ *buffer++ = cDigitsLut[d2];
+ *buffer++ = cDigitsLut[d2 + 1];
+
+ *buffer++ = cDigitsLut[d3];
+ *buffer++ = cDigitsLut[d3 + 1];
+ *buffer++ = cDigitsLut[d4];
+ *buffer++ = cDigitsLut[d4 + 1];
+ }
+ }
+ else if (value < kTen16) {
+ const uint32_t v0 = static_cast<uint32_t>(value / kTen8);
+ const uint32_t v1 = static_cast<uint32_t>(value % kTen8);
+
+ const uint32_t b0 = v0 / 10000;
+ const uint32_t c0 = v0 % 10000;
+
+ const uint32_t d1 = (b0 / 100) << 1;
+ const uint32_t d2 = (b0 % 100) << 1;
+
+ const uint32_t d3 = (c0 / 100) << 1;
+ const uint32_t d4 = (c0 % 100) << 1;
+
+ const uint32_t b1 = v1 / 10000;
+ const uint32_t c1 = v1 % 10000;
+
+ const uint32_t d5 = (b1 / 100) << 1;
+ const uint32_t d6 = (b1 % 100) << 1;
+
+ const uint32_t d7 = (c1 / 100) << 1;
+ const uint32_t d8 = (c1 % 100) << 1;
+
+ if (value >= kTen15)
+ *buffer++ = cDigitsLut[d1];
+ if (value >= kTen14)
+ *buffer++ = cDigitsLut[d1 + 1];
+ if (value >= kTen13)
+ *buffer++ = cDigitsLut[d2];
+ if (value >= kTen12)
+ *buffer++ = cDigitsLut[d2 + 1];
+ if (value >= kTen11)
+ *buffer++ = cDigitsLut[d3];
+ if (value >= kTen10)
+ *buffer++ = cDigitsLut[d3 + 1];
+ if (value >= kTen9)
+ *buffer++ = cDigitsLut[d4];
+ if (value >= kTen8)
+ *buffer++ = cDigitsLut[d4 + 1];
+
+ *buffer++ = cDigitsLut[d5];
+ *buffer++ = cDigitsLut[d5 + 1];
+ *buffer++ = cDigitsLut[d6];
+ *buffer++ = cDigitsLut[d6 + 1];
+ *buffer++ = cDigitsLut[d7];
+ *buffer++ = cDigitsLut[d7 + 1];
+ *buffer++ = cDigitsLut[d8];
+ *buffer++ = cDigitsLut[d8 + 1];
+ }
+ else {
+ const uint32_t a = static_cast<uint32_t>(value / kTen16); // 1 to 1844
+ value %= kTen16;
+
+ if (a < 10)
+ *buffer++ = static_cast<char>('0' + static_cast<char>(a));
+ else if (a < 100) {
+ const uint32_t i = a << 1;
+ *buffer++ = cDigitsLut[i];
+ *buffer++ = cDigitsLut[i + 1];
+ }
+ else if (a < 1000) {
+ *buffer++ = static_cast<char>('0' + static_cast<char>(a / 100));
+
+ const uint32_t i = (a % 100) << 1;
+ *buffer++ = cDigitsLut[i];
+ *buffer++ = cDigitsLut[i + 1];
+ }
+ else {
+ const uint32_t i = (a / 100) << 1;
+ const uint32_t j = (a % 100) << 1;
+ *buffer++ = cDigitsLut[i];
+ *buffer++ = cDigitsLut[i + 1];
+ *buffer++ = cDigitsLut[j];
+ *buffer++ = cDigitsLut[j + 1];
+ }
+
+ const uint32_t v0 = static_cast<uint32_t>(value / kTen8);
+ const uint32_t v1 = static_cast<uint32_t>(value % kTen8);
+
+ const uint32_t b0 = v0 / 10000;
+ const uint32_t c0 = v0 % 10000;
+
+ const uint32_t d1 = (b0 / 100) << 1;
+ const uint32_t d2 = (b0 % 100) << 1;
+
+ const uint32_t d3 = (c0 / 100) << 1;
+ const uint32_t d4 = (c0 % 100) << 1;
+
+ const uint32_t b1 = v1 / 10000;
+ const uint32_t c1 = v1 % 10000;
+
+ const uint32_t d5 = (b1 / 100) << 1;
+ const uint32_t d6 = (b1 % 100) << 1;
+
+ const uint32_t d7 = (c1 / 100) << 1;
+ const uint32_t d8 = (c1 % 100) << 1;
+
+ *buffer++ = cDigitsLut[d1];
+ *buffer++ = cDigitsLut[d1 + 1];
+ *buffer++ = cDigitsLut[d2];
+ *buffer++ = cDigitsLut[d2 + 1];
+ *buffer++ = cDigitsLut[d3];
+ *buffer++ = cDigitsLut[d3 + 1];
+ *buffer++ = cDigitsLut[d4];
+ *buffer++ = cDigitsLut[d4 + 1];
+ *buffer++ = cDigitsLut[d5];
+ *buffer++ = cDigitsLut[d5 + 1];
+ *buffer++ = cDigitsLut[d6];
+ *buffer++ = cDigitsLut[d6 + 1];
+ *buffer++ = cDigitsLut[d7];
+ *buffer++ = cDigitsLut[d7 + 1];
+ *buffer++ = cDigitsLut[d8];
+ *buffer++ = cDigitsLut[d8 + 1];
+ }
+
+ return buffer;
+}
+
+inline char* i64toa(int64_t value, char* buffer) {
+ uint64_t u = static_cast<uint64_t>(value);
+ if (value < 0) {
+ *buffer++ = '-';
+ u = ~u + 1;
+ }
+
+ return u64toa(u, buffer);
+}
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_ITOA_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/meta.h b/3rdparty/rapidjson/include/rapidjson/internal/meta.h
new file mode 100644
index 00000000000..5a9aaa42866
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/meta.h
@@ -0,0 +1,181 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_INTERNAL_META_H_
+#define RAPIDJSON_INTERNAL_META_H_
+
+#include "../rapidjson.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+#if defined(_MSC_VER)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(6334)
+#endif
+
+#if RAPIDJSON_HAS_CXX11_TYPETRAITS
+#include <type_traits>
+#endif
+
+//@cond RAPIDJSON_INTERNAL
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching
+template <typename T> struct Void { typedef void Type; };
+
+///////////////////////////////////////////////////////////////////////////////
+// BoolType, TrueType, FalseType
+//
+template <bool Cond> struct BoolType {
+ static const bool Value = Cond;
+ typedef BoolType Type;
+};
+typedef BoolType<true> TrueType;
+typedef BoolType<false> FalseType;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr
+//
+
+template <bool C> struct SelectIfImpl { template <typename T1, typename T2> struct Apply { typedef T1 Type; }; };
+template <> struct SelectIfImpl<false> { template <typename T1, typename T2> struct Apply { typedef T2 Type; }; };
+template <bool C, typename T1, typename T2> struct SelectIfCond : SelectIfImpl<C>::template Apply<T1,T2> {};
+template <typename C, typename T1, typename T2> struct SelectIf : SelectIfCond<C::Value, T1, T2> {};
+
+template <bool Cond1, bool Cond2> struct AndExprCond : FalseType {};
+template <> struct AndExprCond<true, true> : TrueType {};
+template <bool Cond1, bool Cond2> struct OrExprCond : TrueType {};
+template <> struct OrExprCond<false, false> : FalseType {};
+
+template <typename C> struct BoolExpr : SelectIf<C,TrueType,FalseType>::Type {};
+template <typename C> struct NotExpr : SelectIf<C,FalseType,TrueType>::Type {};
+template <typename C1, typename C2> struct AndExpr : AndExprCond<C1::Value, C2::Value>::Type {};
+template <typename C1, typename C2> struct OrExpr : OrExprCond<C1::Value, C2::Value>::Type {};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// AddConst, MaybeAddConst, RemoveConst
+template <typename T> struct AddConst { typedef const T Type; };
+template <bool Constify, typename T> struct MaybeAddConst : SelectIfCond<Constify, const T, T> {};
+template <typename T> struct RemoveConst { typedef T Type; };
+template <typename T> struct RemoveConst<const T> { typedef T Type; };
+
+
+///////////////////////////////////////////////////////////////////////////////
+// IsSame, IsConst, IsMoreConst, IsPointer
+//
+template <typename T, typename U> struct IsSame : FalseType {};
+template <typename T> struct IsSame<T, T> : TrueType {};
+
+template <typename T> struct IsConst : FalseType {};
+template <typename T> struct IsConst<const T> : TrueType {};
+
+template <typename CT, typename T>
+struct IsMoreConst
+ : AndExpr<IsSame<typename RemoveConst<CT>::Type, typename RemoveConst<T>::Type>,
+ BoolType<IsConst<CT>::Value >= IsConst<T>::Value> >::Type {};
+
+template <typename T> struct IsPointer : FalseType {};
+template <typename T> struct IsPointer<T*> : TrueType {};
+
+///////////////////////////////////////////////////////////////////////////////
+// IsBaseOf
+//
+#if RAPIDJSON_HAS_CXX11_TYPETRAITS
+
+template <typename B, typename D> struct IsBaseOf
+ : BoolType< ::std::is_base_of<B,D>::value> {};
+
+#else // simplified version adopted from Boost
+
+template<typename B, typename D> struct IsBaseOfImpl {
+ RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0);
+ RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0);
+
+ typedef char (&Yes)[1];
+ typedef char (&No) [2];
+
+ template <typename T>
+ static Yes Check(const D*, T);
+ static No Check(const B*, int);
+
+ struct Host {
+ operator const B*() const;
+ operator const D*();
+ };
+
+ enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) };
+};
+
+template <typename B, typename D> struct IsBaseOf
+ : OrExpr<IsSame<B, D>, BoolExpr<IsBaseOfImpl<B, D> > >::Type {};
+
+#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS
+
+
+//////////////////////////////////////////////////////////////////////////
+// EnableIf / DisableIf
+//
+template <bool Condition, typename T = void> struct EnableIfCond { typedef T Type; };
+template <typename T> struct EnableIfCond<false, T> { /* empty */ };
+
+template <bool Condition, typename T = void> struct DisableIfCond { typedef T Type; };
+template <typename T> struct DisableIfCond<true, T> { /* empty */ };
+
+template <typename Condition, typename T = void>
+struct EnableIf : EnableIfCond<Condition::Value, T> {};
+
+template <typename Condition, typename T = void>
+struct DisableIf : DisableIfCond<Condition::Value, T> {};
+
+// SFINAE helpers
+struct SfinaeTag {};
+template <typename T> struct RemoveSfinaeTag;
+template <typename T> struct RemoveSfinaeTag<SfinaeTag&(*)(T)> { typedef T Type; };
+
+#define RAPIDJSON_REMOVEFPTR_(type) \
+ typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \
+ < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type
+
+#define RAPIDJSON_ENABLEIF(cond) \
+ typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \
+ <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
+
+#define RAPIDJSON_DISABLEIF(cond) \
+ typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \
+ <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
+
+#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \
+ typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \
+ <RAPIDJSON_REMOVEFPTR_(cond), \
+ RAPIDJSON_REMOVEFPTR_(returntype)>::Type
+
+#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \
+ typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \
+ <RAPIDJSON_REMOVEFPTR_(cond), \
+ RAPIDJSON_REMOVEFPTR_(returntype)>::Type
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+//@endcond
+
+#if defined(__GNUC__) || defined(_MSC_VER)
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_INTERNAL_META_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/pow10.h b/3rdparty/rapidjson/include/rapidjson/internal/pow10.h
new file mode 100644
index 00000000000..02f475d705f
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/pow10.h
@@ -0,0 +1,55 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_POW10_
+#define RAPIDJSON_POW10_
+
+#include "../rapidjson.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+//! Computes integer powers of 10 in double (10.0^n).
+/*! This function uses lookup table for fast and accurate results.
+ \param n non-negative exponent. Must <= 308.
+ \return 10.0^n
+*/
+inline double Pow10(int n) {
+ static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes
+ 1e+0,
+ 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20,
+ 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40,
+ 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60,
+ 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80,
+ 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100,
+ 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120,
+ 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140,
+ 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160,
+ 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180,
+ 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200,
+ 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220,
+ 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240,
+ 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260,
+ 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280,
+ 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300,
+ 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308
+ };
+ RAPIDJSON_ASSERT(n >= 0 && n <= 308);
+ return e[n];
+}
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_POW10_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/regex.h b/3rdparty/rapidjson/include/rapidjson/internal/regex.h
new file mode 100644
index 00000000000..aeb0e3ef535
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/regex.h
@@ -0,0 +1,696 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_INTERNAL_REGEX_H_
+#define RAPIDJSON_INTERNAL_REGEX_H_
+
+#include "../allocators.h"
+#include "../stream.h"
+#include "stack.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+RAPIDJSON_DIAG_OFF(switch-enum)
+RAPIDJSON_DIAG_OFF(implicit-fallthrough)
+#endif
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+#ifndef RAPIDJSON_REGEX_VERBOSE
+#define RAPIDJSON_REGEX_VERBOSE 0
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericRegex
+
+static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1
+static const SizeType kRegexInvalidRange = ~SizeType(0);
+
+//! Regular expression engine with subset of ECMAscript grammar.
+/*!
+ Supported regular expression syntax:
+ - \c ab Concatenation
+ - \c a|b Alternation
+ - \c a? Zero or one
+ - \c a* Zero or more
+ - \c a+ One or more
+ - \c a{3} Exactly 3 times
+ - \c a{3,} At least 3 times
+ - \c a{3,5} 3 to 5 times
+ - \c (ab) Grouping
+ - \c ^a At the beginning
+ - \c a$ At the end
+ - \c . Any character
+ - \c [abc] Character classes
+ - \c [a-c] Character class range
+ - \c [a-z0-9_] Character class combination
+ - \c [^abc] Negated character classes
+ - \c [^a-c] Negated character class range
+ - \c [\b] Backspace (U+0008)
+ - \c \\| \\\\ ... Escape characters
+ - \c \\f Form feed (U+000C)
+ - \c \\n Line feed (U+000A)
+ - \c \\r Carriage return (U+000D)
+ - \c \\t Tab (U+0009)
+ - \c \\v Vertical tab (U+000B)
+
+ \note This is a Thompson NFA engine, implemented with reference to
+ Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).",
+ https://swtch.com/~rsc/regexp/regexp1.html
+*/
+template <typename Encoding, typename Allocator = CrtAllocator>
+class GenericRegex {
+public:
+ typedef typename Encoding::Ch Ch;
+
+ GenericRegex(const Ch* source, Allocator* allocator = 0) :
+ states_(allocator, 256), ranges_(allocator, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(),
+ stateSet_(), state0_(allocator, 0), state1_(allocator, 0), anchorBegin_(), anchorEnd_()
+ {
+ GenericStringStream<Encoding> ss(source);
+ DecodedStream<GenericStringStream<Encoding> > ds(ss);
+ Parse(ds);
+ }
+
+ ~GenericRegex() {
+ Allocator::Free(stateSet_);
+ }
+
+ bool IsValid() const {
+ return root_ != kRegexInvalidState;
+ }
+
+ template <typename InputStream>
+ bool Match(InputStream& is) const {
+ return SearchWithAnchoring(is, true, true);
+ }
+
+ bool Match(const Ch* s) const {
+ GenericStringStream<Encoding> is(s);
+ return Match(is);
+ }
+
+ template <typename InputStream>
+ bool Search(InputStream& is) const {
+ return SearchWithAnchoring(is, anchorBegin_, anchorEnd_);
+ }
+
+ bool Search(const Ch* s) const {
+ GenericStringStream<Encoding> is(s);
+ return Search(is);
+ }
+
+private:
+ enum Operator {
+ kZeroOrOne,
+ kZeroOrMore,
+ kOneOrMore,
+ kConcatenation,
+ kAlternation,
+ kLeftParenthesis
+ };
+
+ static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.'
+ static const unsigned kRangeCharacterClass = 0xFFFFFFFE;
+ static const unsigned kRangeNegationFlag = 0x80000000;
+
+ struct Range {
+ unsigned start; //
+ unsigned end;
+ SizeType next;
+ };
+
+ struct State {
+ SizeType out; //!< Equals to kInvalid for matching state
+ SizeType out1; //!< Equals to non-kInvalid for split
+ SizeType rangeStart;
+ unsigned codepoint;
+ };
+
+ struct Frag {
+ Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {}
+ SizeType start;
+ SizeType out; //!< link-list of all output states
+ SizeType minIndex;
+ };
+
+ template <typename SourceStream>
+ class DecodedStream {
+ public:
+ DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); }
+ unsigned Peek() { return codepoint_; }
+ unsigned Take() {
+ unsigned c = codepoint_;
+ if (c) // No further decoding when '\0'
+ Decode();
+ return c;
+ }
+
+ private:
+ void Decode() {
+ if (!Encoding::Decode(ss_, &codepoint_))
+ codepoint_ = 0;
+ }
+
+ SourceStream& ss_;
+ unsigned codepoint_;
+ };
+
+ State& GetState(SizeType index) {
+ RAPIDJSON_ASSERT(index < stateCount_);
+ return states_.template Bottom<State>()[index];
+ }
+
+ const State& GetState(SizeType index) const {
+ RAPIDJSON_ASSERT(index < stateCount_);
+ return states_.template Bottom<State>()[index];
+ }
+
+ Range& GetRange(SizeType index) {
+ RAPIDJSON_ASSERT(index < rangeCount_);
+ return ranges_.template Bottom<Range>()[index];
+ }
+
+ const Range& GetRange(SizeType index) const {
+ RAPIDJSON_ASSERT(index < rangeCount_);
+ return ranges_.template Bottom<Range>()[index];
+ }
+
+ template <typename InputStream>
+ void Parse(DecodedStream<InputStream>& ds) {
+ Allocator allocator;
+ Stack<Allocator> operandStack(&allocator, 256); // Frag
+ Stack<Allocator> operatorStack(&allocator, 256); // Operator
+ Stack<Allocator> atomCountStack(&allocator, 256); // unsigned (Atom per parenthesis)
+
+ *atomCountStack.template Push<unsigned>() = 0;
+
+ unsigned codepoint;
+ while (ds.Peek() != 0) {
+ switch (codepoint = ds.Take()) {
+ case '^':
+ anchorBegin_ = true;
+ break;
+
+ case '$':
+ anchorEnd_ = true;
+ break;
+
+ case '|':
+ while (!operatorStack.Empty() && *operatorStack.template Top<Operator>() < kAlternation)
+ if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
+ return;
+ *operatorStack.template Push<Operator>() = kAlternation;
+ *atomCountStack.template Top<unsigned>() = 0;
+ break;
+
+ case '(':
+ *operatorStack.template Push<Operator>() = kLeftParenthesis;
+ *atomCountStack.template Push<unsigned>() = 0;
+ break;
+
+ case ')':
+ while (!operatorStack.Empty() && *operatorStack.template Top<Operator>() != kLeftParenthesis)
+ if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
+ return;
+ if (operatorStack.Empty())
+ return;
+ operatorStack.template Pop<Operator>(1);
+ atomCountStack.template Pop<unsigned>(1);
+ ImplicitConcatenation(atomCountStack, operatorStack);
+ break;
+
+ case '?':
+ if (!Eval(operandStack, kZeroOrOne))
+ return;
+ break;
+
+ case '*':
+ if (!Eval(operandStack, kZeroOrMore))
+ return;
+ break;
+
+ case '+':
+ if (!Eval(operandStack, kOneOrMore))
+ return;
+ break;
+
+ case '{':
+ {
+ unsigned n, m;
+ if (!ParseUnsigned(ds, &n))
+ return;
+
+ if (ds.Peek() == ',') {
+ ds.Take();
+ if (ds.Peek() == '}')
+ m = kInfinityQuantifier;
+ else if (!ParseUnsigned(ds, &m) || m < n)
+ return;
+ }
+ else
+ m = n;
+
+ if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}')
+ return;
+ ds.Take();
+ }
+ break;
+
+ case '.':
+ PushOperand(operandStack, kAnyCharacterClass);
+ ImplicitConcatenation(atomCountStack, operatorStack);
+ break;
+
+ case '[':
+ {
+ SizeType range;
+ if (!ParseRange(ds, &range))
+ return;
+ SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass);
+ GetState(s).rangeStart = range;
+ *operandStack.template Push<Frag>() = Frag(s, s, s);
+ }
+ ImplicitConcatenation(atomCountStack, operatorStack);
+ break;
+
+ case '\\': // Escape character
+ if (!CharacterEscape(ds, &codepoint))
+ return; // Unsupported escape character
+ // fall through to default
+
+ default: // Pattern character
+ PushOperand(operandStack, codepoint);
+ ImplicitConcatenation(atomCountStack, operatorStack);
+ }
+ }
+
+ while (!operatorStack.Empty())
+ if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
+ return;
+
+ // Link the operand to matching state.
+ if (operandStack.GetSize() == sizeof(Frag)) {
+ Frag* e = operandStack.template Pop<Frag>(1);
+ Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0));
+ root_ = e->start;
+
+#if RAPIDJSON_REGEX_VERBOSE
+ printf("root: %d\n", root_);
+ for (SizeType i = 0; i < stateCount_ ; i++) {
+ State& s = GetState(i);
+ printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint);
+ }
+ printf("\n");
+#endif
+ }
+
+ // Preallocate buffer for SearchWithAnchoring()
+ RAPIDJSON_ASSERT(stateSet_ == 0);
+ if (stateCount_ > 0) {
+ stateSet_ = static_cast<unsigned*>(states_.GetAllocator().Malloc(GetStateSetSize()));
+ state0_.template Reserve<SizeType>(stateCount_);
+ state1_.template Reserve<SizeType>(stateCount_);
+ }
+ }
+
+ SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) {
+ State* s = states_.template Push<State>();
+ s->out = out;
+ s->out1 = out1;
+ s->codepoint = codepoint;
+ s->rangeStart = kRegexInvalidRange;
+ return stateCount_++;
+ }
+
+ void PushOperand(Stack<Allocator>& operandStack, unsigned codepoint) {
+ SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint);
+ *operandStack.template Push<Frag>() = Frag(s, s, s);
+ }
+
+ void ImplicitConcatenation(Stack<Allocator>& atomCountStack, Stack<Allocator>& operatorStack) {
+ if (*atomCountStack.template Top<unsigned>())
+ *operatorStack.template Push<Operator>() = kConcatenation;
+ (*atomCountStack.template Top<unsigned>())++;
+ }
+
+ SizeType Append(SizeType l1, SizeType l2) {
+ SizeType old = l1;
+ while (GetState(l1).out != kRegexInvalidState)
+ l1 = GetState(l1).out;
+ GetState(l1).out = l2;
+ return old;
+ }
+
+ void Patch(SizeType l, SizeType s) {
+ for (SizeType next; l != kRegexInvalidState; l = next) {
+ next = GetState(l).out;
+ GetState(l).out = s;
+ }
+ }
+
+ bool Eval(Stack<Allocator>& operandStack, Operator op) {
+ switch (op) {
+ case kConcatenation:
+ if (operandStack.GetSize() >= sizeof(Frag) * 2) {
+ Frag e2 = *operandStack.template Pop<Frag>(1);
+ Frag e1 = *operandStack.template Pop<Frag>(1);
+ Patch(e1.out, e2.start);
+ *operandStack.template Push<Frag>() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex));
+ return true;
+ }
+ return false;
+
+ case kAlternation:
+ if (operandStack.GetSize() >= sizeof(Frag) * 2) {
+ Frag e2 = *operandStack.template Pop<Frag>(1);
+ Frag e1 = *operandStack.template Pop<Frag>(1);
+ SizeType s = NewState(e1.start, e2.start, 0);
+ *operandStack.template Push<Frag>() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex));
+ return true;
+ }
+ return false;
+
+ case kZeroOrOne:
+ if (operandStack.GetSize() >= sizeof(Frag)) {
+ Frag e = *operandStack.template Pop<Frag>(1);
+ SizeType s = NewState(kRegexInvalidState, e.start, 0);
+ *operandStack.template Push<Frag>() = Frag(s, Append(e.out, s), e.minIndex);
+ return true;
+ }
+ return false;
+
+ case kZeroOrMore:
+ if (operandStack.GetSize() >= sizeof(Frag)) {
+ Frag e = *operandStack.template Pop<Frag>(1);
+ SizeType s = NewState(kRegexInvalidState, e.start, 0);
+ Patch(e.out, s);
+ *operandStack.template Push<Frag>() = Frag(s, s, e.minIndex);
+ return true;
+ }
+ return false;
+
+ case kOneOrMore:
+ if (operandStack.GetSize() >= sizeof(Frag)) {
+ Frag e = *operandStack.template Pop<Frag>(1);
+ SizeType s = NewState(kRegexInvalidState, e.start, 0);
+ Patch(e.out, s);
+ *operandStack.template Push<Frag>() = Frag(e.start, s, e.minIndex);
+ return true;
+ }
+ return false;
+
+ default:
+ return false;
+ }
+ }
+
+ bool EvalQuantifier(Stack<Allocator>& operandStack, unsigned n, unsigned m) {
+ RAPIDJSON_ASSERT(n <= m);
+ if (operandStack.GetSize() < sizeof(Frag))
+ return false;
+
+ if (n == 0) {
+ if (m == 0) // a{0} not support
+ return false;
+ else if (m == kInfinityQuantifier)
+ Eval(operandStack, kZeroOrMore); // a{0,} -> a*
+ else {
+ Eval(operandStack, kZeroOrOne); // a{0,5} -> a?
+ for (unsigned i = 0; i < m - 1; i++)
+ CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a?
+ for (unsigned i = 0; i < m - 1; i++)
+ Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a?
+ }
+ return true;
+ }
+
+ for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a
+ CloneTopOperand(operandStack);
+
+ if (m == kInfinityQuantifier)
+ Eval(operandStack, kOneOrMore); // a{3,} -> a a a+
+ else if (m > n) {
+ CloneTopOperand(operandStack); // a{3,5} -> a a a a
+ Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a?
+ for (unsigned i = n; i < m - 1; i++)
+ CloneTopOperand(operandStack); // a{3,5} -> a a a a? a?
+ for (unsigned i = n; i < m; i++)
+ Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a?
+ }
+
+ for (unsigned i = 0; i < n - 1; i++)
+ Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a?
+
+ return true;
+ }
+
+ static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; }
+
+ void CloneTopOperand(Stack<Allocator>& operandStack) {
+ const Frag *src = operandStack.template Top<Frag>();
+ SizeType count = stateCount_ - src->minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_)
+ State* s = states_.template Push<State>(count);
+ memcpy(s, &GetState(src->minIndex), count * sizeof(State));
+ for (SizeType j = 0; j < count; j++) {
+ if (s[j].out != kRegexInvalidState)
+ s[j].out += count;
+ if (s[j].out1 != kRegexInvalidState)
+ s[j].out1 += count;
+ }
+ *operandStack.template Push<Frag>() = Frag(src->start + count, src->out + count, src->minIndex + count);
+ stateCount_ += count;
+ }
+
+ template <typename InputStream>
+ bool ParseUnsigned(DecodedStream<InputStream>& ds, unsigned* u) {
+ unsigned r = 0;
+ if (ds.Peek() < '0' || ds.Peek() > '9')
+ return false;
+ while (ds.Peek() >= '0' && ds.Peek() <= '9') {
+ if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295
+ return false; // overflow
+ r = r * 10 + (ds.Take() - '0');
+ }
+ *u = r;
+ return true;
+ }
+
+ template <typename InputStream>
+ bool ParseRange(DecodedStream<InputStream>& ds, SizeType* range) {
+ bool isBegin = true;
+ bool negate = false;
+ int step = 0;
+ SizeType start = kRegexInvalidRange;
+ SizeType current = kRegexInvalidRange;
+ unsigned codepoint;
+ while ((codepoint = ds.Take()) != 0) {
+ if (isBegin) {
+ isBegin = false;
+ if (codepoint == '^') {
+ negate = true;
+ continue;
+ }
+ }
+
+ switch (codepoint) {
+ case ']':
+ if (start == kRegexInvalidRange)
+ return false; // Error: nothing inside []
+ if (step == 2) { // Add trailing '-'
+ SizeType r = NewRange('-');
+ RAPIDJSON_ASSERT(current != kRegexInvalidRange);
+ GetRange(current).next = r;
+ }
+ if (negate)
+ GetRange(start).start |= kRangeNegationFlag;
+ *range = start;
+ return true;
+
+ case '\\':
+ if (ds.Peek() == 'b') {
+ ds.Take();
+ codepoint = 0x0008; // Escape backspace character
+ }
+ else if (!CharacterEscape(ds, &codepoint))
+ return false;
+ // fall through to default
+
+ default:
+ switch (step) {
+ case 1:
+ if (codepoint == '-') {
+ step++;
+ break;
+ }
+ // fall through to step 0 for other characters
+
+ case 0:
+ {
+ SizeType r = NewRange(codepoint);
+ if (current != kRegexInvalidRange)
+ GetRange(current).next = r;
+ if (start == kRegexInvalidRange)
+ start = r;
+ current = r;
+ }
+ step = 1;
+ break;
+
+ default:
+ RAPIDJSON_ASSERT(step == 2);
+ GetRange(current).end = codepoint;
+ step = 0;
+ }
+ }
+ }
+ return false;
+ }
+
+ SizeType NewRange(unsigned codepoint) {
+ Range* r = ranges_.template Push<Range>();
+ r->start = r->end = codepoint;
+ r->next = kRegexInvalidRange;
+ return rangeCount_++;
+ }
+
+ template <typename InputStream>
+ bool CharacterEscape(DecodedStream<InputStream>& ds, unsigned* escapedCodepoint) {
+ unsigned codepoint;
+ switch (codepoint = ds.Take()) {
+ case '^':
+ case '$':
+ case '|':
+ case '(':
+ case ')':
+ case '?':
+ case '*':
+ case '+':
+ case '.':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '\\':
+ *escapedCodepoint = codepoint; return true;
+ case 'f': *escapedCodepoint = 0x000C; return true;
+ case 'n': *escapedCodepoint = 0x000A; return true;
+ case 'r': *escapedCodepoint = 0x000D; return true;
+ case 't': *escapedCodepoint = 0x0009; return true;
+ case 'v': *escapedCodepoint = 0x000B; return true;
+ default:
+ return false; // Unsupported escape character
+ }
+ }
+
+ template <typename InputStream>
+ bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) const {
+ RAPIDJSON_ASSERT(IsValid());
+ DecodedStream<InputStream> ds(is);
+
+ state0_.Clear();
+ Stack<Allocator> *current = &state0_, *next = &state1_;
+ const size_t stateSetSize = GetStateSetSize();
+ std::memset(stateSet_, 0, stateSetSize);
+
+ bool matched = AddState(*current, root_);
+ unsigned codepoint;
+ while (!current->Empty() && (codepoint = ds.Take()) != 0) {
+ std::memset(stateSet_, 0, stateSetSize);
+ next->Clear();
+ matched = false;
+ for (const SizeType* s = current->template Bottom<SizeType>(); s != current->template End<SizeType>(); ++s) {
+ const State& sr = GetState(*s);
+ if (sr.codepoint == codepoint ||
+ sr.codepoint == kAnyCharacterClass ||
+ (sr.codepoint == kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint)))
+ {
+ matched = AddState(*next, sr.out) || matched;
+ if (!anchorEnd && matched)
+ return true;
+ }
+ if (!anchorBegin)
+ AddState(*next, root_);
+ }
+ internal::Swap(current, next);
+ }
+
+ return matched;
+ }
+
+ size_t GetStateSetSize() const {
+ return (stateCount_ + 31) / 32 * 4;
+ }
+
+ // Return whether the added states is a match state
+ bool AddState(Stack<Allocator>& l, SizeType index) const {
+ if (index == kRegexInvalidState)
+ return true;
+
+ const State& s = GetState(index);
+ if (s.out1 != kRegexInvalidState) { // Split
+ bool matched = AddState(l, s.out);
+ return AddState(l, s.out1) || matched;
+ }
+ else if (!(stateSet_[index >> 5] & (1 << (index & 31)))) {
+ stateSet_[index >> 5] |= (1 << (index & 31));
+ *l.template PushUnsafe<SizeType>() = index;
+ }
+ return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation.
+ }
+
+ bool MatchRange(SizeType rangeIndex, unsigned codepoint) const {
+ bool yes = (GetRange(rangeIndex).start & kRangeNegationFlag) == 0;
+ while (rangeIndex != kRegexInvalidRange) {
+ const Range& r = GetRange(rangeIndex);
+ if (codepoint >= (r.start & ~kRangeNegationFlag) && codepoint <= r.end)
+ return yes;
+ rangeIndex = r.next;
+ }
+ return !yes;
+ }
+
+ Stack<Allocator> states_;
+ Stack<Allocator> ranges_;
+ SizeType root_;
+ SizeType stateCount_;
+ SizeType rangeCount_;
+
+ static const unsigned kInfinityQuantifier = ~0u;
+
+ // For SearchWithAnchoring()
+ uint32_t* stateSet_; // allocated by states_.GetAllocator()
+ mutable Stack<Allocator> state0_;
+ mutable Stack<Allocator> state1_;
+ bool anchorBegin_;
+ bool anchorEnd_;
+};
+
+typedef GenericRegex<UTF8<> > Regex;
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_INTERNAL_REGEX_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/stack.h b/3rdparty/rapidjson/include/rapidjson/internal/stack.h
new file mode 100644
index 00000000000..022c9aab411
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/stack.h
@@ -0,0 +1,230 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_INTERNAL_STACK_H_
+#define RAPIDJSON_INTERNAL_STACK_H_
+
+#include "../allocators.h"
+#include "swap.h"
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+///////////////////////////////////////////////////////////////////////////////
+// Stack
+
+//! A type-unsafe stack for storing different types of data.
+/*! \tparam Allocator Allocator for allocating stack memory.
+*/
+template <typename Allocator>
+class Stack {
+public:
+ // Optimization note: Do not allocate memory for stack_ in constructor.
+ // Do it lazily when first Push() -> Expand() -> Resize().
+ Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) {
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ Stack(Stack&& rhs)
+ : allocator_(rhs.allocator_),
+ ownAllocator_(rhs.ownAllocator_),
+ stack_(rhs.stack_),
+ stackTop_(rhs.stackTop_),
+ stackEnd_(rhs.stackEnd_),
+ initialCapacity_(rhs.initialCapacity_)
+ {
+ rhs.allocator_ = 0;
+ rhs.ownAllocator_ = 0;
+ rhs.stack_ = 0;
+ rhs.stackTop_ = 0;
+ rhs.stackEnd_ = 0;
+ rhs.initialCapacity_ = 0;
+ }
+#endif
+
+ ~Stack() {
+ Destroy();
+ }
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ Stack& operator=(Stack&& rhs) {
+ if (&rhs != this)
+ {
+ Destroy();
+
+ allocator_ = rhs.allocator_;
+ ownAllocator_ = rhs.ownAllocator_;
+ stack_ = rhs.stack_;
+ stackTop_ = rhs.stackTop_;
+ stackEnd_ = rhs.stackEnd_;
+ initialCapacity_ = rhs.initialCapacity_;
+
+ rhs.allocator_ = 0;
+ rhs.ownAllocator_ = 0;
+ rhs.stack_ = 0;
+ rhs.stackTop_ = 0;
+ rhs.stackEnd_ = 0;
+ rhs.initialCapacity_ = 0;
+ }
+ return *this;
+ }
+#endif
+
+ void Swap(Stack& rhs) RAPIDJSON_NOEXCEPT {
+ internal::Swap(allocator_, rhs.allocator_);
+ internal::Swap(ownAllocator_, rhs.ownAllocator_);
+ internal::Swap(stack_, rhs.stack_);
+ internal::Swap(stackTop_, rhs.stackTop_);
+ internal::Swap(stackEnd_, rhs.stackEnd_);
+ internal::Swap(initialCapacity_, rhs.initialCapacity_);
+ }
+
+ void Clear() { stackTop_ = stack_; }
+
+ void ShrinkToFit() {
+ if (Empty()) {
+ // If the stack is empty, completely deallocate the memory.
+ Allocator::Free(stack_);
+ stack_ = 0;
+ stackTop_ = 0;
+ stackEnd_ = 0;
+ }
+ else
+ Resize(GetSize());
+ }
+
+ // Optimization note: try to minimize the size of this function for force inline.
+ // Expansion is run very infrequently, so it is moved to another (probably non-inline) function.
+ template<typename T>
+ RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) {
+ // Expand the stack if needed
+ if (RAPIDJSON_UNLIKELY(stackTop_ + sizeof(T) * count > stackEnd_))
+ Expand<T>(count);
+ }
+
+ template<typename T>
+ RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) {
+ Reserve<T>(count);
+ return PushUnsafe<T>(count);
+ }
+
+ template<typename T>
+ RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) {
+ RAPIDJSON_ASSERT(stackTop_ + sizeof(T) * count <= stackEnd_);
+ T* ret = reinterpret_cast<T*>(stackTop_);
+ stackTop_ += sizeof(T) * count;
+ return ret;
+ }
+
+ template<typename T>
+ T* Pop(size_t count) {
+ RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T));
+ stackTop_ -= count * sizeof(T);
+ return reinterpret_cast<T*>(stackTop_);
+ }
+
+ template<typename T>
+ T* Top() {
+ RAPIDJSON_ASSERT(GetSize() >= sizeof(T));
+ return reinterpret_cast<T*>(stackTop_ - sizeof(T));
+ }
+
+ template<typename T>
+ const T* Top() const {
+ RAPIDJSON_ASSERT(GetSize() >= sizeof(T));
+ return reinterpret_cast<T*>(stackTop_ - sizeof(T));
+ }
+
+ template<typename T>
+ T* End() { return reinterpret_cast<T*>(stackTop_); }
+
+ template<typename T>
+ const T* End() const { return reinterpret_cast<T*>(stackTop_); }
+
+ template<typename T>
+ T* Bottom() { return reinterpret_cast<T*>(stack_); }
+
+ template<typename T>
+ const T* Bottom() const { return reinterpret_cast<T*>(stack_); }
+
+ bool HasAllocator() const {
+ return allocator_ != 0;
+ }
+
+ Allocator& GetAllocator() {
+ RAPIDJSON_ASSERT(allocator_);
+ return *allocator_;
+ }
+
+ bool Empty() const { return stackTop_ == stack_; }
+ size_t GetSize() const { return static_cast<size_t>(stackTop_ - stack_); }
+ size_t GetCapacity() const { return static_cast<size_t>(stackEnd_ - stack_); }
+
+private:
+ template<typename T>
+ void Expand(size_t count) {
+ // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity.
+ size_t newCapacity;
+ if (stack_ == 0) {
+ if (!allocator_)
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
+ newCapacity = initialCapacity_;
+ } else {
+ newCapacity = GetCapacity();
+ newCapacity += (newCapacity + 1) / 2;
+ }
+ size_t newSize = GetSize() + sizeof(T) * count;
+ if (newCapacity < newSize)
+ newCapacity = newSize;
+
+ Resize(newCapacity);
+ }
+
+ void Resize(size_t newCapacity) {
+ const size_t size = GetSize(); // Backup the current size
+ stack_ = static_cast<char*>(allocator_->Realloc(stack_, GetCapacity(), newCapacity));
+ stackTop_ = stack_ + size;
+ stackEnd_ = stack_ + newCapacity;
+ }
+
+ void Destroy() {
+ Allocator::Free(stack_);
+ RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack
+ }
+
+ // Prohibit copy constructor & assignment operator.
+ Stack(const Stack&);
+ Stack& operator=(const Stack&);
+
+ Allocator* allocator_;
+ Allocator* ownAllocator_;
+ char *stack_;
+ char *stackTop_;
+ char *stackEnd_;
+ size_t initialCapacity_;
+};
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_STACK_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/strfunc.h b/3rdparty/rapidjson/include/rapidjson/internal/strfunc.h
new file mode 100644
index 00000000000..2edfae52678
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/strfunc.h
@@ -0,0 +1,55 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
+#define RAPIDJSON_INTERNAL_STRFUNC_H_
+
+#include "../stream.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+//! Custom strlen() which works on different character types.
+/*! \tparam Ch Character type (e.g. char, wchar_t, short)
+ \param s Null-terminated input string.
+ \return Number of characters in the string.
+ \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
+*/
+template <typename Ch>
+inline SizeType StrLen(const Ch* s) {
+ const Ch* p = s;
+ while (*p) ++p;
+ return SizeType(p - s);
+}
+
+//! Returns number of code points in a encoded string.
+template<typename Encoding>
+bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) {
+ GenericStringStream<Encoding> is(s);
+ const typename Encoding::Ch* end = s + length;
+ SizeType count = 0;
+ while (is.src_ < end) {
+ unsigned codepoint;
+ if (!Encoding::Decode(is, &codepoint))
+ return false;
+ count++;
+ }
+ *outCount = count;
+ return true;
+}
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_INTERNAL_STRFUNC_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/strtod.h b/3rdparty/rapidjson/include/rapidjson/internal/strtod.h
new file mode 100644
index 00000000000..fd4b01e8dde
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/strtod.h
@@ -0,0 +1,269 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_STRTOD_
+#define RAPIDJSON_STRTOD_
+
+#include "ieee754.h"
+#include "biginteger.h"
+#include "diyfp.h"
+#include "pow10.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+inline double FastPath(double significand, int exp) {
+ if (exp < -308)
+ return 0.0;
+ else if (exp >= 0)
+ return significand * internal::Pow10(exp);
+ else
+ return significand / internal::Pow10(-exp);
+}
+
+inline double StrtodNormalPrecision(double d, int p) {
+ if (p < -308) {
+ // Prevent expSum < -308, making Pow10(p) = 0
+ d = FastPath(d, -308);
+ d = FastPath(d, p + 308);
+ }
+ else
+ d = FastPath(d, p);
+ return d;
+}
+
+template <typename T>
+inline T Min3(T a, T b, T c) {
+ T m = a;
+ if (m > b) m = b;
+ if (m > c) m = c;
+ return m;
+}
+
+inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) {
+ const Double db(b);
+ const uint64_t bInt = db.IntegerSignificand();
+ const int bExp = db.IntegerExponent();
+ const int hExp = bExp - 1;
+
+ int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0;
+
+ // Adjust for decimal exponent
+ if (dExp >= 0) {
+ dS_Exp2 += dExp;
+ dS_Exp5 += dExp;
+ }
+ else {
+ bS_Exp2 -= dExp;
+ bS_Exp5 -= dExp;
+ hS_Exp2 -= dExp;
+ hS_Exp5 -= dExp;
+ }
+
+ // Adjust for binary exponent
+ if (bExp >= 0)
+ bS_Exp2 += bExp;
+ else {
+ dS_Exp2 -= bExp;
+ hS_Exp2 -= bExp;
+ }
+
+ // Adjust for half ulp exponent
+ if (hExp >= 0)
+ hS_Exp2 += hExp;
+ else {
+ dS_Exp2 -= hExp;
+ bS_Exp2 -= hExp;
+ }
+
+ // Remove common power of two factor from all three scaled values
+ int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2);
+ dS_Exp2 -= common_Exp2;
+ bS_Exp2 -= common_Exp2;
+ hS_Exp2 -= common_Exp2;
+
+ BigInteger dS = d;
+ dS.MultiplyPow5(static_cast<unsigned>(dS_Exp5)) <<= static_cast<unsigned>(dS_Exp2);
+
+ BigInteger bS(bInt);
+ bS.MultiplyPow5(static_cast<unsigned>(bS_Exp5)) <<= static_cast<unsigned>(bS_Exp2);
+
+ BigInteger hS(1);
+ hS.MultiplyPow5(static_cast<unsigned>(hS_Exp5)) <<= static_cast<unsigned>(hS_Exp2);
+
+ BigInteger delta(0);
+ dS.Difference(bS, &delta);
+
+ return delta.Compare(hS);
+}
+
+inline bool StrtodFast(double d, int p, double* result) {
+ // Use fast path for string-to-double conversion if possible
+ // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/
+ if (p > 22 && p < 22 + 16) {
+ // Fast Path Cases In Disguise
+ d *= internal::Pow10(p - 22);
+ p = 22;
+ }
+
+ if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1
+ *result = FastPath(d, p);
+ return true;
+ }
+ else
+ return false;
+}
+
+// Compute an approximation and see if it is within 1/2 ULP
+inline bool StrtodDiyFp(const char* decimals, size_t length, size_t decimalPosition, int exp, double* result) {
+ uint64_t significand = 0;
+ size_t i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999
+ for (; i < length; i++) {
+ if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) ||
+ (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > '5'))
+ break;
+ significand = significand * 10u + static_cast<unsigned>(decimals[i] - '0');
+ }
+
+ if (i < length && decimals[i] >= '5') // Rounding
+ significand++;
+
+ size_t remaining = length - i;
+ const unsigned kUlpShift = 3;
+ const unsigned kUlp = 1 << kUlpShift;
+ int error = (remaining == 0) ? 0 : kUlp / 2;
+
+ DiyFp v(significand, 0);
+ v = v.Normalize();
+ error <<= -v.e;
+
+ const int dExp = static_cast<int>(decimalPosition) - static_cast<int>(i) + exp;
+
+ int actualExp;
+ DiyFp cachedPower = GetCachedPower10(dExp, &actualExp);
+ if (actualExp != dExp) {
+ static const DiyFp kPow10[] = {
+ DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 00000000), -60), // 10^1
+ DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 00000000), -57), // 10^2
+ DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 00000000), -54), // 10^3
+ DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 00000000), -50), // 10^4
+ DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 00000000), -47), // 10^5
+ DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 00000000), -44), // 10^6
+ DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 00000000), -40) // 10^7
+ };
+ int adjustment = dExp - actualExp - 1;
+ RAPIDJSON_ASSERT(adjustment >= 0 && adjustment < 7);
+ v = v * kPow10[adjustment];
+ if (length + static_cast<unsigned>(adjustment)> 19u) // has more digits than decimal digits in 64-bit
+ error += kUlp / 2;
+ }
+
+ v = v * cachedPower;
+
+ error += kUlp + (error == 0 ? 0 : 1);
+
+ const int oldExp = v.e;
+ v = v.Normalize();
+ error <<= oldExp - v.e;
+
+ const unsigned effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e);
+ unsigned precisionSize = 64 - effectiveSignificandSize;
+ if (precisionSize + kUlpShift >= 64) {
+ unsigned scaleExp = (precisionSize + kUlpShift) - 63;
+ v.f >>= scaleExp;
+ v.e += scaleExp;
+ error = (error >> scaleExp) + 1 + static_cast<int>(kUlp);
+ precisionSize -= scaleExp;
+ }
+
+ DiyFp rounded(v.f >> precisionSize, v.e + static_cast<int>(precisionSize));
+ const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp;
+ const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp;
+ if (precisionBits >= halfWay + static_cast<unsigned>(error)) {
+ rounded.f++;
+ if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340)
+ rounded.f >>= 1;
+ rounded.e++;
+ }
+ }
+
+ *result = rounded.ToDouble();
+
+ return halfWay - static_cast<unsigned>(error) >= precisionBits || precisionBits >= halfWay + static_cast<unsigned>(error);
+}
+
+inline double StrtodBigInteger(double approx, const char* decimals, size_t length, size_t decimalPosition, int exp) {
+ const BigInteger dInt(decimals, length);
+ const int dExp = static_cast<int>(decimalPosition) - static_cast<int>(length) + exp;
+ Double a(approx);
+ int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp);
+ if (cmp < 0)
+ return a.Value(); // within half ULP
+ else if (cmp == 0) {
+ // Round towards even
+ if (a.Significand() & 1)
+ return a.NextPositiveDouble();
+ else
+ return a.Value();
+ }
+ else // adjustment
+ return a.NextPositiveDouble();
+}
+
+inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t length, size_t decimalPosition, int exp) {
+ RAPIDJSON_ASSERT(d >= 0.0);
+ RAPIDJSON_ASSERT(length >= 1);
+
+ double result;
+ if (StrtodFast(d, p, &result))
+ return result;
+
+ // Trim leading zeros
+ while (*decimals == '0' && length > 1) {
+ length--;
+ decimals++;
+ decimalPosition--;
+ }
+
+ // Trim trailing zeros
+ while (decimals[length - 1] == '0' && length > 1) {
+ length--;
+ decimalPosition--;
+ exp++;
+ }
+
+ // Trim right-most digits
+ const int kMaxDecimalDigit = 780;
+ if (static_cast<int>(length) > kMaxDecimalDigit) {
+ int delta = (static_cast<int>(length) - kMaxDecimalDigit);
+ exp += delta;
+ decimalPosition -= static_cast<unsigned>(delta);
+ length = kMaxDecimalDigit;
+ }
+
+ // If too small, underflow to zero
+ if (int(length) + exp < -324)
+ return 0.0;
+
+ if (StrtodDiyFp(decimals, length, decimalPosition, exp, &result))
+ return result;
+
+ // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison
+ return StrtodBigInteger(result, decimals, length, decimalPosition, exp);
+}
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_STRTOD_
diff --git a/3rdparty/rapidjson/include/rapidjson/internal/swap.h b/3rdparty/rapidjson/include/rapidjson/internal/swap.h
new file mode 100644
index 00000000000..666e49f97b6
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/internal/swap.h
@@ -0,0 +1,46 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_INTERNAL_SWAP_H_
+#define RAPIDJSON_INTERNAL_SWAP_H_
+
+#include "../rapidjson.h"
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+namespace internal {
+
+//! Custom swap() to avoid dependency on C++ <algorithm> header
+/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only.
+ \note This has the same semantics as std::swap().
+*/
+template <typename T>
+inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT {
+ T tmp = a;
+ a = b;
+ b = tmp;
+}
+
+} // namespace internal
+RAPIDJSON_NAMESPACE_END
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_INTERNAL_SWAP_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/istreamwrapper.h b/3rdparty/rapidjson/include/rapidjson/istreamwrapper.h
new file mode 100644
index 00000000000..9efeea24f46
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/istreamwrapper.h
@@ -0,0 +1,105 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "stream.h"
+#include <iosfwd>
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept.
+/*!
+ The classes can be wrapped including but not limited to:
+
+ - \c std::istringstream
+ - \c std::stringstream
+ - \c std::wistringstream
+ - \c std::wstringstream
+ - \c std::ifstream
+ - \c std::fstream
+ - \c std::wifstream
+ - \c std::wfstream
+
+ \tparam StreamType Class derived from \c std::basic_istream.
+*/
+
+template <typename StreamType>
+class BasicIStreamWrapper {
+public:
+ typedef typename StreamType::char_type Ch;
+ BasicIStreamWrapper(StreamType& stream) : stream_(stream), count_(), peekBuffer_() {}
+
+ Ch Peek() const {
+ typename StreamType::int_type c = stream_.peek();
+ return RAPIDJSON_LIKELY(c != StreamType::traits_type::eof()) ? static_cast<Ch>(c) : '\0';
+ }
+
+ Ch Take() {
+ typename StreamType::int_type c = stream_.get();
+ if (RAPIDJSON_LIKELY(c != StreamType::traits_type::eof())) {
+ count_++;
+ return static_cast<Ch>(c);
+ }
+ else
+ return '\0';
+ }
+
+ // tellg() may return -1 when failed. So we count by ourself.
+ size_t Tell() const { return count_; }
+
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+ // For encoding detection only.
+ const Ch* Peek4() const {
+ RAPIDJSON_ASSERT(sizeof(Ch) == 1); // Only usable for byte stream.
+ int i;
+ bool hasError = false;
+ for (i = 0; i < 4; ++i) {
+ typename StreamType::int_type c = stream_.get();
+ if (c == StreamType::traits_type::eof()) {
+ hasError = true;
+ stream_.clear();
+ break;
+ }
+ peekBuffer_[i] = static_cast<Ch>(c);
+ }
+ for (--i; i >= 0; --i)
+ stream_.putback(peekBuffer_[i]);
+ return !hasError ? peekBuffer_ : 0;
+ }
+
+private:
+ BasicIStreamWrapper(const BasicIStreamWrapper&);
+ BasicIStreamWrapper& operator=(const BasicIStreamWrapper&);
+
+ StreamType& stream_;
+ size_t count_; //!< Number of characters read. Note:
+ mutable Ch peekBuffer_[4];
+};
+
+typedef BasicIStreamWrapper<std::istream> IStreamWrapper;
+typedef BasicIStreamWrapper<std::wistream> WIStreamWrapper;
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+RAPIDJSON_NAMESPACE_END
diff --git a/3rdparty/rapidjson/include/rapidjson/memorybuffer.h b/3rdparty/rapidjson/include/rapidjson/memorybuffer.h
new file mode 100644
index 00000000000..39bee1dec1c
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/memorybuffer.h
@@ -0,0 +1,70 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_MEMORYBUFFER_H_
+#define RAPIDJSON_MEMORYBUFFER_H_
+
+#include "stream.h"
+#include "internal/stack.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Represents an in-memory output byte stream.
+/*!
+ This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
+
+ It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
+
+ Differences between MemoryBuffer and StringBuffer:
+ 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
+ 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
+
+ \tparam Allocator type for allocating memory buffer.
+ \note implements Stream concept
+*/
+template <typename Allocator = CrtAllocator>
+struct GenericMemoryBuffer {
+ typedef char Ch; // byte
+
+ GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
+
+ void Put(Ch c) { *stack_.template Push<Ch>() = c; }
+ void Flush() {}
+
+ void Clear() { stack_.Clear(); }
+ void ShrinkToFit() { stack_.ShrinkToFit(); }
+ Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
+ void Pop(size_t count) { stack_.template Pop<Ch>(count); }
+
+ const Ch* GetBuffer() const {
+ return stack_.template Bottom<Ch>();
+ }
+
+ size_t GetSize() const { return stack_.GetSize(); }
+
+ static const size_t kDefaultCapacity = 256;
+ mutable internal::Stack<Allocator> stack_;
+};
+
+typedef GenericMemoryBuffer<> MemoryBuffer;
+
+//! Implement specialized version of PutN() with memset() for better performance.
+template<>
+inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
+ std::memset(memoryBuffer.stack_.Push<char>(n), c, n * sizeof(c));
+}
+
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_MEMORYBUFFER_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/memorystream.h b/3rdparty/rapidjson/include/rapidjson/memorystream.h
new file mode 100644
index 00000000000..7381e0b7dd2
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/memorystream.h
@@ -0,0 +1,71 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_MEMORYSTREAM_H_
+#define RAPIDJSON_MEMORYSTREAM_H_
+
+#include "stream.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(unreachable-code)
+RAPIDJSON_DIAG_OFF(missing-noreturn)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Represents an in-memory input byte stream.
+/*!
+ This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream.
+
+ It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file.
+
+ Differences between MemoryStream and StringStream:
+ 1. StringStream has encoding but MemoryStream is a byte stream.
+ 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source.
+ 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4().
+ \note implements Stream concept
+*/
+struct MemoryStream {
+ typedef char Ch; // byte
+
+ MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {}
+
+ Ch Peek() const { return (src_ == end_) ? '\0' : *src_; }
+ Ch Take() { return (src_ == end_) ? '\0' : *src_++; }
+ size_t Tell() const { return static_cast<size_t>(src_ - begin_); }
+
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+ // For encoding detection only.
+ const Ch* Peek4() const {
+ return Tell() + 4 <= size_ ? src_ : 0;
+ }
+
+ const Ch* src_; //!< Current read position.
+ const Ch* begin_; //!< Original head of the string.
+ const Ch* end_; //!< End of stream.
+ size_t size_; //!< Size of the stream.
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_MEMORYBUFFER_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/msinttypes/inttypes.h b/3rdparty/rapidjson/include/rapidjson/msinttypes/inttypes.h
new file mode 100644
index 00000000000..18111286bf5
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/msinttypes/inttypes.h
@@ -0,0 +1,316 @@
+// ISO C9x compliant inttypes.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006-2013 Alexander Chemeris
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the product nor the names of its contributors may
+// be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// The above software in this distribution may have been modified by
+// THL A29 Limited ("Tencent Modifications").
+// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited.
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_INTTYPES_H_ // [
+#define _MSC_INTTYPES_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include "stdint.h"
+
+// miloyip: VC supports inttypes.h since VC2013
+#if _MSC_VER >= 1800
+#include <inttypes.h>
+#else
+
+// 7.8 Format conversion of integer types
+
+typedef struct {
+ intmax_t quot;
+ intmax_t rem;
+} imaxdiv_t;
+
+// 7.8.1 Macros for format specifiers
+
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
+
+// The fprintf macros for signed integers are:
+#define PRId8 "d"
+#define PRIi8 "i"
+#define PRIdLEAST8 "d"
+#define PRIiLEAST8 "i"
+#define PRIdFAST8 "d"
+#define PRIiFAST8 "i"
+
+#define PRId16 "hd"
+#define PRIi16 "hi"
+#define PRIdLEAST16 "hd"
+#define PRIiLEAST16 "hi"
+#define PRIdFAST16 "hd"
+#define PRIiFAST16 "hi"
+
+#define PRId32 "I32d"
+#define PRIi32 "I32i"
+#define PRIdLEAST32 "I32d"
+#define PRIiLEAST32 "I32i"
+#define PRIdFAST32 "I32d"
+#define PRIiFAST32 "I32i"
+
+#define PRId64 "I64d"
+#define PRIi64 "I64i"
+#define PRIdLEAST64 "I64d"
+#define PRIiLEAST64 "I64i"
+#define PRIdFAST64 "I64d"
+#define PRIiFAST64 "I64i"
+
+#define PRIdMAX "I64d"
+#define PRIiMAX "I64i"
+
+#define PRIdPTR "Id"
+#define PRIiPTR "Ii"
+
+// The fprintf macros for unsigned integers are:
+#define PRIo8 "o"
+#define PRIu8 "u"
+#define PRIx8 "x"
+#define PRIX8 "X"
+#define PRIoLEAST8 "o"
+#define PRIuLEAST8 "u"
+#define PRIxLEAST8 "x"
+#define PRIXLEAST8 "X"
+#define PRIoFAST8 "o"
+#define PRIuFAST8 "u"
+#define PRIxFAST8 "x"
+#define PRIXFAST8 "X"
+
+#define PRIo16 "ho"
+#define PRIu16 "hu"
+#define PRIx16 "hx"
+#define PRIX16 "hX"
+#define PRIoLEAST16 "ho"
+#define PRIuLEAST16 "hu"
+#define PRIxLEAST16 "hx"
+#define PRIXLEAST16 "hX"
+#define PRIoFAST16 "ho"
+#define PRIuFAST16 "hu"
+#define PRIxFAST16 "hx"
+#define PRIXFAST16 "hX"
+
+#define PRIo32 "I32o"
+#define PRIu32 "I32u"
+#define PRIx32 "I32x"
+#define PRIX32 "I32X"
+#define PRIoLEAST32 "I32o"
+#define PRIuLEAST32 "I32u"
+#define PRIxLEAST32 "I32x"
+#define PRIXLEAST32 "I32X"
+#define PRIoFAST32 "I32o"
+#define PRIuFAST32 "I32u"
+#define PRIxFAST32 "I32x"
+#define PRIXFAST32 "I32X"
+
+#define PRIo64 "I64o"
+#define PRIu64 "I64u"
+#define PRIx64 "I64x"
+#define PRIX64 "I64X"
+#define PRIoLEAST64 "I64o"
+#define PRIuLEAST64 "I64u"
+#define PRIxLEAST64 "I64x"
+#define PRIXLEAST64 "I64X"
+#define PRIoFAST64 "I64o"
+#define PRIuFAST64 "I64u"
+#define PRIxFAST64 "I64x"
+#define PRIXFAST64 "I64X"
+
+#define PRIoMAX "I64o"
+#define PRIuMAX "I64u"
+#define PRIxMAX "I64x"
+#define PRIXMAX "I64X"
+
+#define PRIoPTR "Io"
+#define PRIuPTR "Iu"
+#define PRIxPTR "Ix"
+#define PRIXPTR "IX"
+
+// The fscanf macros for signed integers are:
+#define SCNd8 "d"
+#define SCNi8 "i"
+#define SCNdLEAST8 "d"
+#define SCNiLEAST8 "i"
+#define SCNdFAST8 "d"
+#define SCNiFAST8 "i"
+
+#define SCNd16 "hd"
+#define SCNi16 "hi"
+#define SCNdLEAST16 "hd"
+#define SCNiLEAST16 "hi"
+#define SCNdFAST16 "hd"
+#define SCNiFAST16 "hi"
+
+#define SCNd32 "ld"
+#define SCNi32 "li"
+#define SCNdLEAST32 "ld"
+#define SCNiLEAST32 "li"
+#define SCNdFAST32 "ld"
+#define SCNiFAST32 "li"
+
+#define SCNd64 "I64d"
+#define SCNi64 "I64i"
+#define SCNdLEAST64 "I64d"
+#define SCNiLEAST64 "I64i"
+#define SCNdFAST64 "I64d"
+#define SCNiFAST64 "I64i"
+
+#define SCNdMAX "I64d"
+#define SCNiMAX "I64i"
+
+#ifdef _WIN64 // [
+# define SCNdPTR "I64d"
+# define SCNiPTR "I64i"
+#else // _WIN64 ][
+# define SCNdPTR "ld"
+# define SCNiPTR "li"
+#endif // _WIN64 ]
+
+// The fscanf macros for unsigned integers are:
+#define SCNo8 "o"
+#define SCNu8 "u"
+#define SCNx8 "x"
+#define SCNX8 "X"
+#define SCNoLEAST8 "o"
+#define SCNuLEAST8 "u"
+#define SCNxLEAST8 "x"
+#define SCNXLEAST8 "X"
+#define SCNoFAST8 "o"
+#define SCNuFAST8 "u"
+#define SCNxFAST8 "x"
+#define SCNXFAST8 "X"
+
+#define SCNo16 "ho"
+#define SCNu16 "hu"
+#define SCNx16 "hx"
+#define SCNX16 "hX"
+#define SCNoLEAST16 "ho"
+#define SCNuLEAST16 "hu"
+#define SCNxLEAST16 "hx"
+#define SCNXLEAST16 "hX"
+#define SCNoFAST16 "ho"
+#define SCNuFAST16 "hu"
+#define SCNxFAST16 "hx"
+#define SCNXFAST16 "hX"
+
+#define SCNo32 "lo"
+#define SCNu32 "lu"
+#define SCNx32 "lx"
+#define SCNX32 "lX"
+#define SCNoLEAST32 "lo"
+#define SCNuLEAST32 "lu"
+#define SCNxLEAST32 "lx"
+#define SCNXLEAST32 "lX"
+#define SCNoFAST32 "lo"
+#define SCNuFAST32 "lu"
+#define SCNxFAST32 "lx"
+#define SCNXFAST32 "lX"
+
+#define SCNo64 "I64o"
+#define SCNu64 "I64u"
+#define SCNx64 "I64x"
+#define SCNX64 "I64X"
+#define SCNoLEAST64 "I64o"
+#define SCNuLEAST64 "I64u"
+#define SCNxLEAST64 "I64x"
+#define SCNXLEAST64 "I64X"
+#define SCNoFAST64 "I64o"
+#define SCNuFAST64 "I64u"
+#define SCNxFAST64 "I64x"
+#define SCNXFAST64 "I64X"
+
+#define SCNoMAX "I64o"
+#define SCNuMAX "I64u"
+#define SCNxMAX "I64x"
+#define SCNXMAX "I64X"
+
+#ifdef _WIN64 // [
+# define SCNoPTR "I64o"
+# define SCNuPTR "I64u"
+# define SCNxPTR "I64x"
+# define SCNXPTR "I64X"
+#else // _WIN64 ][
+# define SCNoPTR "lo"
+# define SCNuPTR "lu"
+# define SCNxPTR "lx"
+# define SCNXPTR "lX"
+#endif // _WIN64 ]
+
+#endif // __STDC_FORMAT_MACROS ]
+
+// 7.8.2 Functions for greatest-width integer types
+
+// 7.8.2.1 The imaxabs function
+#define imaxabs _abs64
+
+// 7.8.2.2 The imaxdiv function
+
+// This is modified version of div() function from Microsoft's div.c found
+// in %MSVC.NET%\crt\src\div.c
+#ifdef STATIC_IMAXDIV // [
+static
+#else // STATIC_IMAXDIV ][
+_inline
+#endif // STATIC_IMAXDIV ]
+imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
+{
+ imaxdiv_t result;
+
+ result.quot = numer / denom;
+ result.rem = numer % denom;
+
+ if (numer < 0 && result.rem > 0) {
+ // did division wrong; must fix up
+ ++result.quot;
+ result.rem -= denom;
+ }
+
+ return result;
+}
+
+// 7.8.2.3 The strtoimax and strtoumax functions
+#define strtoimax _strtoi64
+#define strtoumax _strtoui64
+
+// 7.8.2.4 The wcstoimax and wcstoumax functions
+#define wcstoimax _wcstoi64
+#define wcstoumax _wcstoui64
+
+#endif // _MSC_VER >= 1800
+
+#endif // _MSC_INTTYPES_H_ ]
diff --git a/3rdparty/rapidjson/include/rapidjson/msinttypes/stdint.h b/3rdparty/rapidjson/include/rapidjson/msinttypes/stdint.h
new file mode 100644
index 00000000000..3d4477b9a02
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/msinttypes/stdint.h
@@ -0,0 +1,300 @@
+// ISO C9x compliant stdint.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006-2013 Alexander Chemeris
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the product nor the names of its contributors may
+// be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// The above software in this distribution may have been modified by
+// THL A29 Limited ("Tencent Modifications").
+// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited.
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_STDINT_H_ // [
+#define _MSC_STDINT_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010.
+#if _MSC_VER >= 1600 // [
+#include <stdint.h>
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
+
+#undef INT8_C
+#undef INT16_C
+#undef INT32_C
+#undef INT64_C
+#undef UINT8_C
+#undef UINT16_C
+#undef UINT32_C
+#undef UINT64_C
+
+// 7.18.4.1 Macros for minimum-width integer constants
+
+#define INT8_C(val) val##i8
+#define INT16_C(val) val##i16
+#define INT32_C(val) val##i32
+#define INT64_C(val) val##i64
+
+#define UINT8_C(val) val##ui8
+#define UINT16_C(val) val##ui16
+#define UINT32_C(val) val##ui32
+#define UINT64_C(val) val##ui64
+
+// 7.18.4.2 Macros for greatest-width integer constants
+// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
+// Check out Issue 9 for the details.
+#ifndef INTMAX_C // [
+# define INTMAX_C INT64_C
+#endif // INTMAX_C ]
+#ifndef UINTMAX_C // [
+# define UINTMAX_C UINT64_C
+#endif // UINTMAX_C ]
+
+#endif // __STDC_CONSTANT_MACROS ]
+
+#else // ] _MSC_VER >= 1700 [
+
+#include <limits.h>
+
+// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
+// compiling for ARM we have to wrap <wchar.h> include with 'extern "C++" {}'
+// or compiler would give many errors like this:
+// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+#if defined(__cplusplus) && !defined(_M_ARM)
+extern "C" {
+#endif
+# include <wchar.h>
+#if defined(__cplusplus) && !defined(_M_ARM)
+}
+#endif
+
+// Define _W64 macros to mark types changing their size, like intptr_t.
+#ifndef _W64
+# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+# define _W64 __w64
+# else
+# define _W64
+# endif
+#endif
+
+
+// 7.18.1 Integer types
+
+// 7.18.1.1 Exact-width integer types
+
+// Visual Studio 6 and Embedded Visual C++ 4 doesn't
+// realize that, e.g. char has the same size as __int8
+// so we give up on __intX for them.
+#if (_MSC_VER < 1300)
+ typedef signed char int8_t;
+ typedef signed short int16_t;
+ typedef signed int int32_t;
+ typedef unsigned char uint8_t;
+ typedef unsigned short uint16_t;
+ typedef unsigned int uint32_t;
+#else
+ typedef signed __int8 int8_t;
+ typedef signed __int16 int16_t;
+ typedef signed __int32 int32_t;
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int16 uint16_t;
+ typedef unsigned __int32 uint32_t;
+#endif
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+
+
+// 7.18.1.2 Minimum-width integer types
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
+
+// 7.18.1.3 Fastest minimum-width integer types
+typedef int8_t int_fast8_t;
+typedef int16_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef int64_t int_fast64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint16_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+typedef uint64_t uint_fast64_t;
+
+// 7.18.1.4 Integer types capable of holding object pointers
+#ifdef _WIN64 // [
+ typedef signed __int64 intptr_t;
+ typedef unsigned __int64 uintptr_t;
+#else // _WIN64 ][
+ typedef _W64 signed int intptr_t;
+ typedef _W64 unsigned int uintptr_t;
+#endif // _WIN64 ]
+
+// 7.18.1.5 Greatest-width integer types
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
+
+
+// 7.18.2 Limits of specified-width integer types
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
+
+// 7.18.2.1 Limits of exact-width integer types
+#define INT8_MIN ((int8_t)_I8_MIN)
+#define INT8_MAX _I8_MAX
+#define INT16_MIN ((int16_t)_I16_MIN)
+#define INT16_MAX _I16_MAX
+#define INT32_MIN ((int32_t)_I32_MIN)
+#define INT32_MAX _I32_MAX
+#define INT64_MIN ((int64_t)_I64_MIN)
+#define INT64_MAX _I64_MAX
+#define UINT8_MAX _UI8_MAX
+#define UINT16_MAX _UI16_MAX
+#define UINT32_MAX _UI32_MAX
+#define UINT64_MAX _UI64_MAX
+
+// 7.18.2.2 Limits of minimum-width integer types
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MIN INT64_MIN
+#define INT_LEAST64_MAX INT64_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+// 7.18.2.3 Limits of fastest minimum-width integer types
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MIN INT64_MIN
+#define INT_FAST64_MAX INT64_MAX
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+// 7.18.2.4 Limits of integer types capable of holding object pointers
+#ifdef _WIN64 // [
+# define INTPTR_MIN INT64_MIN
+# define INTPTR_MAX INT64_MAX
+# define UINTPTR_MAX UINT64_MAX
+#else // _WIN64 ][
+# define INTPTR_MIN INT32_MIN
+# define INTPTR_MAX INT32_MAX
+# define UINTPTR_MAX UINT32_MAX
+#endif // _WIN64 ]
+
+// 7.18.2.5 Limits of greatest-width integer types
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+// 7.18.3 Limits of other integer types
+
+#ifdef _WIN64 // [
+# define PTRDIFF_MIN _I64_MIN
+# define PTRDIFF_MAX _I64_MAX
+#else // _WIN64 ][
+# define PTRDIFF_MIN _I32_MIN
+# define PTRDIFF_MAX _I32_MAX
+#endif // _WIN64 ]
+
+#define SIG_ATOMIC_MIN INT_MIN
+#define SIG_ATOMIC_MAX INT_MAX
+
+#ifndef SIZE_MAX // [
+# ifdef _WIN64 // [
+# define SIZE_MAX _UI64_MAX
+# else // _WIN64 ][
+# define SIZE_MAX _UI32_MAX
+# endif // _WIN64 ]
+#endif // SIZE_MAX ]
+
+// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
+#ifndef WCHAR_MIN // [
+# define WCHAR_MIN 0
+#endif // WCHAR_MIN ]
+#ifndef WCHAR_MAX // [
+# define WCHAR_MAX _UI16_MAX
+#endif // WCHAR_MAX ]
+
+#define WINT_MIN 0
+#define WINT_MAX _UI16_MAX
+
+#endif // __STDC_LIMIT_MACROS ]
+
+
+// 7.18.4 Limits of other integer types
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
+
+// 7.18.4.1 Macros for minimum-width integer constants
+
+#define INT8_C(val) val##i8
+#define INT16_C(val) val##i16
+#define INT32_C(val) val##i32
+#define INT64_C(val) val##i64
+
+#define UINT8_C(val) val##ui8
+#define UINT16_C(val) val##ui16
+#define UINT32_C(val) val##ui32
+#define UINT64_C(val) val##ui64
+
+// 7.18.4.2 Macros for greatest-width integer constants
+// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
+// Check out Issue 9 for the details.
+#ifndef INTMAX_C // [
+# define INTMAX_C INT64_C
+#endif // INTMAX_C ]
+#ifndef UINTMAX_C // [
+# define UINTMAX_C UINT64_C
+#endif // UINTMAX_C ]
+
+#endif // __STDC_CONSTANT_MACROS ]
+
+#endif // _MSC_VER >= 1600 ]
+
+#endif // _MSC_STDINT_H_ ]
diff --git a/3rdparty/rapidjson/include/rapidjson/ostreamwrapper.h b/3rdparty/rapidjson/include/rapidjson/ostreamwrapper.h
new file mode 100644
index 00000000000..8bf36dcd04c
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/ostreamwrapper.h
@@ -0,0 +1,76 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "stream.h"
+#include <iosfwd>
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept.
+/*!
+ The classes can be wrapped including but not limited to:
+
+ - \c std::ostringstream
+ - \c std::stringstream
+ - \c std::wpstringstream
+ - \c std::wstringstream
+ - \c std::ifstream
+ - \c std::fstream
+ - \c std::wofstream
+ - \c std::wfstream
+
+ \tparam StreamType Class derived from \c std::basic_ostream.
+*/
+
+template <typename StreamType>
+class BasicOStreamWrapper {
+public:
+ typedef typename StreamType::char_type Ch;
+ BasicOStreamWrapper(StreamType& stream) : stream_(stream) {}
+
+ void Put(Ch c) {
+ stream_.put(c);
+ }
+
+ void Flush() {
+ stream_.flush();
+ }
+
+ // Not implemented
+ char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
+ char Take() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
+ char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ BasicOStreamWrapper(const BasicOStreamWrapper&);
+ BasicOStreamWrapper& operator=(const BasicOStreamWrapper&);
+
+ StreamType& stream_;
+};
+
+typedef BasicOStreamWrapper<std::ostream> OStreamWrapper;
+typedef BasicOStreamWrapper<std::wostream> WOStreamWrapper;
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+RAPIDJSON_NAMESPACE_END
diff --git a/3rdparty/rapidjson/include/rapidjson/pointer.h b/3rdparty/rapidjson/include/rapidjson/pointer.h
new file mode 100644
index 00000000000..eddeab427ea
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/pointer.h
@@ -0,0 +1,1345 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_POINTER_H_
+#define RAPIDJSON_POINTER_H_
+
+#include "document.h"
+#include "internal/itoa.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(switch-enum)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token
+
+//! Error code of parsing.
+/*! \ingroup RAPIDJSON_ERRORS
+ \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode
+*/
+enum PointerParseErrorCode {
+ kPointerParseErrorNone = 0, //!< The parse is successful
+
+ kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/'
+ kPointerParseErrorInvalidEscape, //!< Invalid escape
+ kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment
+ kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericPointer
+
+//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator.
+/*!
+ This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer"
+ (https://tools.ietf.org/html/rfc6901).
+
+ A JSON pointer is for identifying a specific value in a JSON document
+ (GenericDocument). It can simplify coding of DOM tree manipulation, because it
+ can access multiple-level depth of DOM tree with single API call.
+
+ After it parses a string representation (e.g. "/foo/0" or URI fragment
+ representation (e.g. "#/foo/0") into its internal representation (tokens),
+ it can be used to resolve a specific value in multiple documents, or sub-tree
+ of documents.
+
+ Contrary to GenericValue, Pointer can be copy constructed and copy assigned.
+ Apart from assignment, a Pointer cannot be modified after construction.
+
+ Although Pointer is very convenient, please aware that constructing Pointer
+ involves parsing and dynamic memory allocation. A special constructor with user-
+ supplied tokens eliminates these.
+
+ GenericPointer depends on GenericDocument and GenericValue.
+
+ \tparam ValueType The value type of the DOM tree. E.g. GenericValue<UTF8<> >
+ \tparam Allocator The allocator type for allocating memory for internal representation.
+
+ \note GenericPointer uses same encoding of ValueType.
+ However, Allocator of GenericPointer is independent of Allocator of Value.
+*/
+template <typename ValueType, typename Allocator = CrtAllocator>
+class GenericPointer {
+public:
+ typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value
+ typedef typename ValueType::Ch Ch; //!< Character type from Value
+
+ //! A token is the basic units of internal representation.
+ /*!
+ A JSON pointer string representation "/foo/123" is parsed to two tokens:
+ "foo" and 123. 123 will be represented in both numeric form and string form.
+ They are resolved according to the actual value type (object or array).
+
+ For token that are not numbers, or the numeric value is out of bound
+ (greater than limits of SizeType), they are only treated as string form
+ (i.e. the token's index will be equal to kPointerInvalidIndex).
+
+ This struct is public so that user can create a Pointer without parsing and
+ allocation, using a special constructor.
+ */
+ struct Token {
+ const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character.
+ SizeType length; //!< Length of the name.
+ SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex.
+ };
+
+ //!@name Constructors and destructor.
+ //@{
+
+ //! Default constructor.
+ GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {}
+
+ //! Constructor that parses a string or URI fragment representation.
+ /*!
+ \param source A null-terminated, string or URI fragment representation of JSON pointer.
+ \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
+ */
+ explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
+ Parse(source, internal::StrLen(source));
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Constructor that parses a string or URI fragment representation.
+ /*!
+ \param source A string or URI fragment representation of JSON pointer.
+ \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
+ \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
+ */
+ explicit GenericPointer(const std::basic_string<Ch>& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
+ Parse(source.c_str(), source.size());
+ }
+#endif
+
+ //! Constructor that parses a string or URI fragment representation, with length of the source string.
+ /*!
+ \param source A string or URI fragment representation of JSON pointer.
+ \param length Length of source.
+ \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
+ \note Slightly faster than the overload without length.
+ */
+ GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
+ Parse(source, length);
+ }
+
+ //! Constructor with user-supplied tokens.
+ /*!
+ This constructor let user supplies const array of tokens.
+ This prevents the parsing process and eliminates allocation.
+ This is preferred for memory constrained environments.
+
+ \param tokens An constant array of tokens representing the JSON pointer.
+ \param tokenCount Number of tokens.
+
+ \b Example
+ \code
+ #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
+ #define INDEX(i) { #i, sizeof(#i) - 1, i }
+
+ static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
+ static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
+ // Equivalent to static const Pointer p("/foo/123");
+
+ #undef NAME
+ #undef INDEX
+ \endcode
+ */
+ GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast<Token*>(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {}
+
+ //! Copy constructor.
+ GenericPointer(const GenericPointer& rhs, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
+ *this = rhs;
+ }
+
+ //! Destructor.
+ ~GenericPointer() {
+ if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated.
+ Allocator::Free(tokens_);
+ RAPIDJSON_DELETE(ownAllocator_);
+ }
+
+ //! Assignment operator.
+ GenericPointer& operator=(const GenericPointer& rhs) {
+ if (this != &rhs) {
+ // Do not delete ownAllcator
+ if (nameBuffer_)
+ Allocator::Free(tokens_);
+
+ tokenCount_ = rhs.tokenCount_;
+ parseErrorOffset_ = rhs.parseErrorOffset_;
+ parseErrorCode_ = rhs.parseErrorCode_;
+
+ if (rhs.nameBuffer_)
+ CopyFromRaw(rhs); // Normally parsed tokens.
+ else {
+ tokens_ = rhs.tokens_; // User supplied const tokens.
+ nameBuffer_ = 0;
+ }
+ }
+ return *this;
+ }
+
+ //@}
+
+ //!@name Append token
+ //@{
+
+ //! Append a token and return a new Pointer
+ /*!
+ \param token Token to be appended.
+ \param allocator Allocator for the newly return Pointer.
+ \return A new Pointer with appended token.
+ */
+ GenericPointer Append(const Token& token, Allocator* allocator = 0) const {
+ GenericPointer r;
+ r.allocator_ = allocator;
+ Ch *p = r.CopyFromRaw(*this, 1, token.length + 1);
+ std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch));
+ r.tokens_[tokenCount_].name = p;
+ r.tokens_[tokenCount_].length = token.length;
+ r.tokens_[tokenCount_].index = token.index;
+ return r;
+ }
+
+ //! Append a name token with length, and return a new Pointer
+ /*!
+ \param name Name to be appended.
+ \param length Length of name.
+ \param allocator Allocator for the newly return Pointer.
+ \return A new Pointer with appended token.
+ */
+ GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const {
+ Token token = { name, length, kPointerInvalidIndex };
+ return Append(token, allocator);
+ }
+
+ //! Append a name token without length, and return a new Pointer
+ /*!
+ \param name Name (const Ch*) to be appended.
+ \param allocator Allocator for the newly return Pointer.
+ \return A new Pointer with appended token.
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >), (GenericPointer))
+ Append(T* name, Allocator* allocator = 0) const {
+ return Append(name, StrLen(name), allocator);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Append a name token, and return a new Pointer
+ /*!
+ \param name Name to be appended.
+ \param allocator Allocator for the newly return Pointer.
+ \return A new Pointer with appended token.
+ */
+ GenericPointer Append(const std::basic_string<Ch>& name, Allocator* allocator = 0) const {
+ return Append(name.c_str(), static_cast<SizeType>(name.size()), allocator);
+ }
+#endif
+
+ //! Append a index token, and return a new Pointer
+ /*!
+ \param index Index to be appended.
+ \param allocator Allocator for the newly return Pointer.
+ \return A new Pointer with appended token.
+ */
+ GenericPointer Append(SizeType index, Allocator* allocator = 0) const {
+ char buffer[21];
+ char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer);
+ SizeType length = static_cast<SizeType>(end - buffer);
+ buffer[length] = '\0';
+
+ if (sizeof(Ch) == 1) {
+ Token token = { reinterpret_cast<Ch*>(buffer), length, index };
+ return Append(token, allocator);
+ }
+ else {
+ Ch name[21];
+ for (size_t i = 0; i <= length; i++)
+ name[i] = buffer[i];
+ Token token = { name, length, index };
+ return Append(token, allocator);
+ }
+ }
+
+ //! Append a token by value, and return a new Pointer
+ /*!
+ \param token token to be appended.
+ \param allocator Allocator for the newly return Pointer.
+ \return A new Pointer with appended token.
+ */
+ GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const {
+ if (token.IsString())
+ return Append(token.GetString(), token.GetStringLength(), allocator);
+ else {
+ RAPIDJSON_ASSERT(token.IsUint64());
+ RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0));
+ return Append(static_cast<SizeType>(token.GetUint64()), allocator);
+ }
+ }
+
+ //!@name Handling Parse Error
+ //@{
+
+ //! Check whether this is a valid pointer.
+ bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; }
+
+ //! Get the parsing error offset in code unit.
+ size_t GetParseErrorOffset() const { return parseErrorOffset_; }
+
+ //! Get the parsing error code.
+ PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; }
+
+ //@}
+
+ //! Get the allocator of this pointer.
+ Allocator& GetAllocator() { return *allocator_; }
+
+ //!@name Tokens
+ //@{
+
+ //! Get the token array (const version only).
+ const Token* GetTokens() const { return tokens_; }
+
+ //! Get the number of tokens.
+ size_t GetTokenCount() const { return tokenCount_; }
+
+ //@}
+
+ //!@name Equality/inequality operators
+ //@{
+
+ //! Equality operator.
+ /*!
+ \note When any pointers are invalid, always returns false.
+ */
+ bool operator==(const GenericPointer& rhs) const {
+ if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_)
+ return false;
+
+ for (size_t i = 0; i < tokenCount_; i++) {
+ if (tokens_[i].index != rhs.tokens_[i].index ||
+ tokens_[i].length != rhs.tokens_[i].length ||
+ (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ //! Inequality operator.
+ /*!
+ \note When any pointers are invalid, always returns true.
+ */
+ bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); }
+
+ //@}
+
+ //!@name Stringify
+ //@{
+
+ //! Stringify the pointer into string representation.
+ /*!
+ \tparam OutputStream Type of output stream.
+ \param os The output stream.
+ */
+ template<typename OutputStream>
+ bool Stringify(OutputStream& os) const {
+ return Stringify<false, OutputStream>(os);
+ }
+
+ //! Stringify the pointer into URI fragment representation.
+ /*!
+ \tparam OutputStream Type of output stream.
+ \param os The output stream.
+ */
+ template<typename OutputStream>
+ bool StringifyUriFragment(OutputStream& os) const {
+ return Stringify<true, OutputStream>(os);
+ }
+
+ //@}
+
+ //!@name Create value
+ //@{
+
+ //! Create a value in a subtree.
+ /*!
+ If the value is not exist, it creates all parent values and a JSON Null value.
+ So it always succeed and return the newly created or existing value.
+
+ Remind that it may change types of parents according to tokens, so it
+ potentially removes previously stored values. For example, if a document
+ was an array, and "/foo" is used to create a value, then the document
+ will be changed to an object, and all existing array elements are lost.
+
+ \param root Root value of a DOM subtree to be resolved. It can be any value other than document root.
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
+ \param alreadyExist If non-null, it stores whether the resolved value is already exist.
+ \return The resolved newly created (a JSON Null value), or already exists value.
+ */
+ ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const {
+ RAPIDJSON_ASSERT(IsValid());
+ ValueType* v = &root;
+ bool exist = true;
+ for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
+ if (v->IsArray() && t->name[0] == '-' && t->length == 1) {
+ v->PushBack(ValueType().Move(), allocator);
+ v = &((*v)[v->Size() - 1]);
+ exist = false;
+ }
+ else {
+ if (t->index == kPointerInvalidIndex) { // must be object name
+ if (!v->IsObject())
+ v->SetObject(); // Change to Object
+ }
+ else { // object name or array index
+ if (!v->IsArray() && !v->IsObject())
+ v->SetArray(); // Change to Array
+ }
+
+ if (v->IsArray()) {
+ if (t->index >= v->Size()) {
+ v->Reserve(t->index + 1, allocator);
+ while (t->index >= v->Size())
+ v->PushBack(ValueType().Move(), allocator);
+ exist = false;
+ }
+ v = &((*v)[t->index]);
+ }
+ else {
+ typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
+ if (m == v->MemberEnd()) {
+ v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator);
+ v = &(--v->MemberEnd())->value; // Assumes AddMember() appends at the end
+ exist = false;
+ }
+ else
+ v = &m->value;
+ }
+ }
+ }
+
+ if (alreadyExist)
+ *alreadyExist = exist;
+
+ return *v;
+ }
+
+ //! Creates a value in a document.
+ /*!
+ \param document A document to be resolved.
+ \param alreadyExist If non-null, it stores whether the resolved value is already exist.
+ \return The resolved newly created, or already exists value.
+ */
+ template <typename stackAllocator>
+ ValueType& Create(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, bool* alreadyExist = 0) const {
+ return Create(document, document.GetAllocator(), alreadyExist);
+ }
+
+ //@}
+
+ //!@name Query value
+ //@{
+
+ //! Query a value in a subtree.
+ /*!
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
+ \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token.
+ \return Pointer to the value if it can be resolved. Otherwise null.
+
+ \note
+ There are only 3 situations when a value cannot be resolved:
+ 1. A value in the path is not an array nor object.
+ 2. An object value does not contain the token.
+ 3. A token is out of range of an array value.
+
+ Use unresolvedTokenIndex to retrieve the token index.
+ */
+ ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const {
+ RAPIDJSON_ASSERT(IsValid());
+ ValueType* v = &root;
+ for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
+ switch (v->GetType()) {
+ case kObjectType:
+ {
+ typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
+ if (m == v->MemberEnd())
+ break;
+ v = &m->value;
+ }
+ continue;
+ case kArrayType:
+ if (t->index == kPointerInvalidIndex || t->index >= v->Size())
+ break;
+ v = &((*v)[t->index]);
+ continue;
+ default:
+ break;
+ }
+
+ // Error: unresolved token
+ if (unresolvedTokenIndex)
+ *unresolvedTokenIndex = static_cast<size_t>(t - tokens_);
+ return 0;
+ }
+ return v;
+ }
+
+ //! Query a const value in a const subtree.
+ /*!
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
+ \return Pointer to the value if it can be resolved. Otherwise null.
+ */
+ const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const {
+ return Get(const_cast<ValueType&>(root), unresolvedTokenIndex);
+ }
+
+ //@}
+
+ //!@name Query a value with default
+ //@{
+
+ //! Query a value in a subtree with default value.
+ /*!
+ Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value.
+ So that this function always succeed.
+
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
+ \param defaultValue Default value to be cloned if the value was not exists.
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
+ \see Create()
+ */
+ ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const {
+ bool alreadyExist;
+ Value& v = Create(root, allocator, &alreadyExist);
+ return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
+ }
+
+ //! Query a value in a subtree with default null-terminated string.
+ ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const {
+ bool alreadyExist;
+ Value& v = Create(root, allocator, &alreadyExist);
+ return alreadyExist ? v : v.SetString(defaultValue, allocator);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Query a value in a subtree with default std::basic_string.
+ ValueType& GetWithDefault(ValueType& root, const std::basic_string<Ch>& defaultValue, typename ValueType::AllocatorType& allocator) const {
+ bool alreadyExist;
+ Value& v = Create(root, allocator, &alreadyExist);
+ return alreadyExist ? v : v.SetString(defaultValue, allocator);
+ }
+#endif
+
+ //! Query a value in a subtree with default primitive value.
+ /*!
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
+ GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const {
+ return GetWithDefault(root, ValueType(defaultValue).Move(), allocator);
+ }
+
+ //! Query a value in a document with default value.
+ template <typename stackAllocator>
+ ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const ValueType& defaultValue) const {
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
+ }
+
+ //! Query a value in a document with default null-terminated string.
+ template <typename stackAllocator>
+ ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const Ch* defaultValue) const {
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Query a value in a document with default std::basic_string.
+ template <typename stackAllocator>
+ ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const std::basic_string<Ch>& defaultValue) const {
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
+ }
+#endif
+
+ //! Query a value in a document with default primitive value.
+ /*!
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
+ */
+ template <typename T, typename stackAllocator>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
+ GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, T defaultValue) const {
+ return GetWithDefault(document, defaultValue, document.GetAllocator());
+ }
+
+ //@}
+
+ //!@name Set a value
+ //@{
+
+ //! Set a value in a subtree, with move semantics.
+ /*!
+ It creates all parents if they are not exist or types are different to the tokens.
+ So this function always succeeds but potentially remove existing values.
+
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
+ \param value Value to be set.
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
+ \see Create()
+ */
+ ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const {
+ return Create(root, allocator) = value;
+ }
+
+ //! Set a value in a subtree, with copy semantics.
+ ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const {
+ return Create(root, allocator).CopyFrom(value, allocator);
+ }
+
+ //! Set a null-terminated string in a subtree.
+ ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const {
+ return Create(root, allocator) = ValueType(value, allocator).Move();
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Set a std::basic_string in a subtree.
+ ValueType& Set(ValueType& root, const std::basic_string<Ch>& value, typename ValueType::AllocatorType& allocator) const {
+ return Create(root, allocator) = ValueType(value, allocator).Move();
+ }
+#endif
+
+ //! Set a primitive value in a subtree.
+ /*!
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
+ */
+ template <typename T>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
+ Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const {
+ return Create(root, allocator) = ValueType(value).Move();
+ }
+
+ //! Set a value in a document, with move semantics.
+ template <typename stackAllocator>
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, ValueType& value) const {
+ return Create(document) = value;
+ }
+
+ //! Set a value in a document, with copy semantics.
+ template <typename stackAllocator>
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const ValueType& value) const {
+ return Create(document).CopyFrom(value, document.GetAllocator());
+ }
+
+ //! Set a null-terminated string in a document.
+ template <typename stackAllocator>
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const Ch* value) const {
+ return Create(document) = ValueType(value, document.GetAllocator()).Move();
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ //! Sets a std::basic_string in a document.
+ template <typename stackAllocator>
+ ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const std::basic_string<Ch>& value) const {
+ return Create(document) = ValueType(value, document.GetAllocator()).Move();
+ }
+#endif
+
+ //! Set a primitive value in a document.
+ /*!
+ \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
+ */
+ template <typename T, typename stackAllocator>
+ RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
+ Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, T value) const {
+ return Create(document) = value;
+ }
+
+ //@}
+
+ //!@name Swap a value
+ //@{
+
+ //! Swap a value with a value in a subtree.
+ /*!
+ It creates all parents if they are not exist or types are different to the tokens.
+ So this function always succeeds but potentially remove existing values.
+
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
+ \param value Value to be swapped.
+ \param allocator Allocator for creating the values if the specified value or its parents are not exist.
+ \see Create()
+ */
+ ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const {
+ return Create(root, allocator).Swap(value);
+ }
+
+ //! Swap a value with a value in a document.
+ template <typename stackAllocator>
+ ValueType& Swap(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, ValueType& value) const {
+ return Create(document).Swap(value);
+ }
+
+ //@}
+
+ //! Erase a value in a subtree.
+ /*!
+ \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
+ \return Whether the resolved value is found and erased.
+
+ \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false.
+ */
+ bool Erase(ValueType& root) const {
+ RAPIDJSON_ASSERT(IsValid());
+ if (tokenCount_ == 0) // Cannot erase the root
+ return false;
+
+ ValueType* v = &root;
+ const Token* last = tokens_ + (tokenCount_ - 1);
+ for (const Token *t = tokens_; t != last; ++t) {
+ switch (v->GetType()) {
+ case kObjectType:
+ {
+ typename ValueType::MemberIterator m = v->FindMember(GenericStringRef<Ch>(t->name, t->length));
+ if (m == v->MemberEnd())
+ return false;
+ v = &m->value;
+ }
+ break;
+ case kArrayType:
+ if (t->index == kPointerInvalidIndex || t->index >= v->Size())
+ return false;
+ v = &((*v)[t->index]);
+ break;
+ default:
+ return false;
+ }
+ }
+
+ switch (v->GetType()) {
+ case kObjectType:
+ return v->EraseMember(GenericStringRef<Ch>(last->name, last->length));
+ case kArrayType:
+ if (last->index == kPointerInvalidIndex || last->index >= v->Size())
+ return false;
+ v->Erase(v->Begin() + last->index);
+ return true;
+ default:
+ return false;
+ }
+ }
+
+private:
+ //! Clone the content from rhs to this.
+ /*!
+ \param rhs Source pointer.
+ \param extraToken Extra tokens to be allocated.
+ \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated.
+ \return Start of non-occupied name buffer, for storing extra names.
+ */
+ Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) {
+ if (!allocator_) // allocator is independently owned.
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
+
+ size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens
+ for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t)
+ nameBufferSize += t->length;
+
+ tokenCount_ = rhs.tokenCount_ + extraToken;
+ tokens_ = static_cast<Token *>(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch)));
+ nameBuffer_ = reinterpret_cast<Ch *>(tokens_ + tokenCount_);
+ std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token));
+ std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch));
+
+ // Adjust pointers to name buffer
+ std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_;
+ for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t)
+ t->name += diff;
+
+ return nameBuffer_ + nameBufferSize;
+ }
+
+ //! Check whether a character should be percent-encoded.
+ /*!
+ According to RFC 3986 2.3 Unreserved Characters.
+ \param c The character (code unit) to be tested.
+ */
+ bool NeedPercentEncode(Ch c) const {
+ return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~');
+ }
+
+ //! Parse a JSON String or its URI fragment representation into tokens.
+#ifndef __clang__ // -Wdocumentation
+ /*!
+ \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated.
+ \param length Length of the source string.
+ \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped.
+ */
+#endif
+ void Parse(const Ch* source, size_t length) {
+ RAPIDJSON_ASSERT(source != NULL);
+ RAPIDJSON_ASSERT(nameBuffer_ == 0);
+ RAPIDJSON_ASSERT(tokens_ == 0);
+
+ // Create own allocator if user did not supply.
+ if (!allocator_)
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
+
+ // Count number of '/' as tokenCount
+ tokenCount_ = 0;
+ for (const Ch* s = source; s != source + length; s++)
+ if (*s == '/')
+ tokenCount_++;
+
+ Token* token = tokens_ = static_cast<Token *>(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch)));
+ Ch* name = nameBuffer_ = reinterpret_cast<Ch *>(tokens_ + tokenCount_);
+ size_t i = 0;
+
+ // Detect if it is a URI fragment
+ bool uriFragment = false;
+ if (source[i] == '#') {
+ uriFragment = true;
+ i++;
+ }
+
+ if (i != length && source[i] != '/') {
+ parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus;
+ goto error;
+ }
+
+ while (i < length) {
+ RAPIDJSON_ASSERT(source[i] == '/');
+ i++; // consumes '/'
+
+ token->name = name;
+ bool isNumber = true;
+
+ while (i < length && source[i] != '/') {
+ Ch c = source[i];
+ if (uriFragment) {
+ // Decoding percent-encoding for URI fragment
+ if (c == '%') {
+ PercentDecodeStream is(&source[i], source + length);
+ GenericInsituStringStream<EncodingType> os(name);
+ Ch* begin = os.PutBegin();
+ if (!Transcoder<UTF8<>, EncodingType>().Validate(is, os) || !is.IsValid()) {
+ parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding;
+ goto error;
+ }
+ size_t len = os.PutEnd(begin);
+ i += is.Tell() - 1;
+ if (len == 1)
+ c = *name;
+ else {
+ name += len;
+ isNumber = false;
+ i++;
+ continue;
+ }
+ }
+ else if (NeedPercentEncode(c)) {
+ parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode;
+ goto error;
+ }
+ }
+
+ i++;
+
+ // Escaping "~0" -> '~', "~1" -> '/'
+ if (c == '~') {
+ if (i < length) {
+ c = source[i];
+ if (c == '0') c = '~';
+ else if (c == '1') c = '/';
+ else {
+ parseErrorCode_ = kPointerParseErrorInvalidEscape;
+ goto error;
+ }
+ i++;
+ }
+ else {
+ parseErrorCode_ = kPointerParseErrorInvalidEscape;
+ goto error;
+ }
+ }
+
+ // First check for index: all of characters are digit
+ if (c < '0' || c > '9')
+ isNumber = false;
+
+ *name++ = c;
+ }
+ token->length = static_cast<SizeType>(name - token->name);
+ if (token->length == 0)
+ isNumber = false;
+ *name++ = '\0'; // Null terminator
+
+ // Second check for index: more than one digit cannot have leading zero
+ if (isNumber && token->length > 1 && token->name[0] == '0')
+ isNumber = false;
+
+ // String to SizeType conversion
+ SizeType n = 0;
+ if (isNumber) {
+ for (size_t j = 0; j < token->length; j++) {
+ SizeType m = n * 10 + static_cast<SizeType>(token->name[j] - '0');
+ if (m < n) { // overflow detection
+ isNumber = false;
+ break;
+ }
+ n = m;
+ }
+ }
+
+ token->index = isNumber ? n : kPointerInvalidIndex;
+ token++;
+ }
+
+ RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer
+ parseErrorCode_ = kPointerParseErrorNone;
+ return;
+
+ error:
+ Allocator::Free(tokens_);
+ nameBuffer_ = 0;
+ tokens_ = 0;
+ tokenCount_ = 0;
+ parseErrorOffset_ = i;
+ return;
+ }
+
+ //! Stringify to string or URI fragment representation.
+ /*!
+ \tparam uriFragment True for stringifying to URI fragment representation. False for string representation.
+ \tparam OutputStream type of output stream.
+ \param os The output stream.
+ */
+ template<bool uriFragment, typename OutputStream>
+ bool Stringify(OutputStream& os) const {
+ RAPIDJSON_ASSERT(IsValid());
+
+ if (uriFragment)
+ os.Put('#');
+
+ for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
+ os.Put('/');
+ for (size_t j = 0; j < t->length; j++) {
+ Ch c = t->name[j];
+ if (c == '~') {
+ os.Put('~');
+ os.Put('0');
+ }
+ else if (c == '/') {
+ os.Put('~');
+ os.Put('1');
+ }
+ else if (uriFragment && NeedPercentEncode(c)) {
+ // Transcode to UTF8 sequence
+ GenericStringStream<typename ValueType::EncodingType> source(&t->name[j]);
+ PercentEncodeStream<OutputStream> target(os);
+ if (!Transcoder<EncodingType, UTF8<> >().Validate(source, target))
+ return false;
+ j += source.Tell() - 1;
+ }
+ else
+ os.Put(c);
+ }
+ }
+ return true;
+ }
+
+ //! A helper stream for decoding a percent-encoded sequence into code unit.
+ /*!
+ This stream decodes %XY triplet into code unit (0-255).
+ If it encounters invalid characters, it sets output code unit as 0 and
+ mark invalid, and to be checked by IsValid().
+ */
+ class PercentDecodeStream {
+ public:
+ typedef typename ValueType::Ch Ch;
+
+ //! Constructor
+ /*!
+ \param source Start of the stream
+ \param end Past-the-end of the stream.
+ */
+ PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {}
+
+ Ch Take() {
+ if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet
+ valid_ = false;
+ return 0;
+ }
+ src_++;
+ Ch c = 0;
+ for (int j = 0; j < 2; j++) {
+ c <<= 4;
+ Ch h = *src_;
+ if (h >= '0' && h <= '9') c += h - '0';
+ else if (h >= 'A' && h <= 'F') c += h - 'A' + 10;
+ else if (h >= 'a' && h <= 'f') c += h - 'a' + 10;
+ else {
+ valid_ = false;
+ return 0;
+ }
+ src_++;
+ }
+ return c;
+ }
+
+ size_t Tell() const { return static_cast<size_t>(src_ - head_); }
+ bool IsValid() const { return valid_; }
+
+ private:
+ const Ch* src_; //!< Current read position.
+ const Ch* head_; //!< Original head of the string.
+ const Ch* end_; //!< Past-the-end position.
+ bool valid_; //!< Whether the parsing is valid.
+ };
+
+ //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence.
+ template <typename OutputStream>
+ class PercentEncodeStream {
+ public:
+ PercentEncodeStream(OutputStream& os) : os_(os) {}
+ void Put(char c) { // UTF-8 must be byte
+ unsigned char u = static_cast<unsigned char>(c);
+ static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ os_.Put('%');
+ os_.Put(hexDigits[u >> 4]);
+ os_.Put(hexDigits[u & 15]);
+ }
+ private:
+ OutputStream& os_;
+ };
+
+ Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_.
+ Allocator* ownAllocator_; //!< Allocator owned by this Pointer.
+ Ch* nameBuffer_; //!< A buffer containing all names in tokens.
+ Token* tokens_; //!< A list of tokens.
+ size_t tokenCount_; //!< Number of tokens in tokens_.
+ size_t parseErrorOffset_; //!< Offset in code unit when parsing fail.
+ PointerParseErrorCode parseErrorCode_; //!< Parsing error code.
+};
+
+//! GenericPointer for Value (UTF-8, default allocator).
+typedef GenericPointer<Value> Pointer;
+
+//!@name Helper functions for GenericPointer
+//@{
+
+//////////////////////////////////////////////////////////////////////////////
+
+template <typename T>
+typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::AllocatorType& a) {
+ return pointer.Create(root, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Create(root, a);
+}
+
+// No allocator parameter
+
+template <typename DocumentType>
+typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer) {
+ return pointer.Create(document);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Create(document);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+template <typename T>
+typename T::ValueType* GetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, size_t* unresolvedTokenIndex = 0) {
+ return pointer.Get(root, unresolvedTokenIndex);
+}
+
+template <typename T>
+const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer<typename T::ValueType>& pointer, size_t* unresolvedTokenIndex = 0) {
+ return pointer.Get(root, unresolvedTokenIndex);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
+}
+
+template <typename T, typename CharType, size_t N>
+const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+template <typename T>
+typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) {
+ return pointer.GetWithDefault(root, defaultValue, a);
+}
+
+template <typename T>
+typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) {
+ return pointer.GetWithDefault(root, defaultValue, a);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename T>
+typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const std::basic_string<typename T::Ch>& defaultValue, typename T::AllocatorType& a) {
+ return pointer.GetWithDefault(root, defaultValue, a);
+}
+#endif
+
+template <typename T, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
+GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, T2 defaultValue, typename T::AllocatorType& a) {
+ return pointer.GetWithDefault(root, defaultValue, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string<typename T::Ch>& defaultValue, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
+}
+#endif
+
+template <typename T, typename CharType, size_t N, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
+GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
+}
+
+// No allocator parameter
+
+template <typename DocumentType>
+typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::ValueType& defaultValue) {
+ return pointer.GetWithDefault(document, defaultValue);
+}
+
+template <typename DocumentType>
+typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::Ch* defaultValue) {
+ return pointer.GetWithDefault(document, defaultValue);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename DocumentType>
+typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const std::basic_string<typename DocumentType::Ch>& defaultValue) {
+ return pointer.GetWithDefault(document, defaultValue);
+}
+#endif
+
+template <typename DocumentType, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
+GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, T2 defaultValue) {
+ return pointer.GetWithDefault(document, defaultValue);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string<typename DocumentType::Ch>& defaultValue) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
+}
+#endif
+
+template <typename DocumentType, typename CharType, size_t N, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
+GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+template <typename T>
+typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::ValueType& value, typename T::AllocatorType& a) {
+ return pointer.Set(root, value, a);
+}
+
+template <typename T>
+typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) {
+ return pointer.Set(root, value, a);
+}
+
+template <typename T>
+typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::Ch* value, typename T::AllocatorType& a) {
+ return pointer.Set(root, value, a);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename T>
+typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const std::basic_string<typename T::Ch>& value, typename T::AllocatorType& a) {
+ return pointer.Set(root, value, a);
+}
+#endif
+
+template <typename T, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
+SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, T2 value, typename T::AllocatorType& a) {
+ return pointer.Set(root, value, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string<typename T::Ch>& value, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
+}
+#endif
+
+template <typename T, typename CharType, size_t N, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
+SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
+}
+
+// No allocator parameter
+
+template <typename DocumentType>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, typename DocumentType::ValueType& value) {
+ return pointer.Set(document, value);
+}
+
+template <typename DocumentType>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::ValueType& value) {
+ return pointer.Set(document, value);
+}
+
+template <typename DocumentType>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::Ch* value) {
+ return pointer.Set(document, value);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename DocumentType>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const std::basic_string<typename DocumentType::Ch>& value) {
+ return pointer.Set(document, value);
+}
+#endif
+
+template <typename DocumentType, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
+SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, T2 value) {
+ return pointer.Set(document, value);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string<typename DocumentType::Ch>& value) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
+}
+#endif
+
+template <typename DocumentType, typename CharType, size_t N, typename T2>
+RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
+SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+template <typename T>
+typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::ValueType& value, typename T::AllocatorType& a) {
+ return pointer.Swap(root, value, a);
+}
+
+template <typename T, typename CharType, size_t N>
+typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Swap(root, value, a);
+}
+
+template <typename DocumentType>
+typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, typename DocumentType::ValueType& value) {
+ return pointer.Swap(document, value);
+}
+
+template <typename DocumentType, typename CharType, size_t N>
+typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) {
+ return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Swap(document, value);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+template <typename T>
+bool EraseValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer) {
+ return pointer.Erase(root);
+}
+
+template <typename T, typename CharType, size_t N>
+bool EraseValueByPointer(T& root, const CharType(&source)[N]) {
+ return GenericPointer<typename T::ValueType>(source, N - 1).Erase(root);
+}
+
+//@}
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_POINTER_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/prettywriter.h b/3rdparty/rapidjson/include/rapidjson/prettywriter.h
new file mode 100644
index 00000000000..c74e1f10b01
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/prettywriter.h
@@ -0,0 +1,223 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_PRETTYWRITER_H_
+#define RAPIDJSON_PRETTYWRITER_H_
+
+#include "writer.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Writer with indentation and spacing.
+/*!
+ \tparam OutputStream Type of ouptut os.
+ \tparam SourceEncoding Encoding of source string.
+ \tparam TargetEncoding Encoding of output stream.
+ \tparam StackAllocator Type of allocator for allocating memory of stack.
+*/
+template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
+class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
+public:
+ typedef Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator> Base;
+ typedef typename Base::Ch Ch;
+
+ //! Constructor
+ /*! \param os Output stream.
+ \param allocator User supplied allocator. If it is null, it will create a private one.
+ \param levelDepth Initial capacity of stack.
+ */
+ explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
+ Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}
+
+
+ explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
+ Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}
+
+ //! Set custom indentation.
+ /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r').
+ \param indentCharCount Number of indent characters for each indentation level.
+ \note The default indentation is 4 spaces.
+ */
+ PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) {
+ RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r');
+ indentChar_ = indentChar;
+ indentCharCount_ = indentCharCount;
+ return *this;
+ }
+
+ /*! @name Implementation of Handler
+ \see Handler
+ */
+ //@{
+
+ bool Null() { PrettyPrefix(kNullType); return Base::WriteNull(); }
+ bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::WriteBool(b); }
+ bool Int(int i) { PrettyPrefix(kNumberType); return Base::WriteInt(i); }
+ bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::WriteUint(u); }
+ bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::WriteInt64(i64); }
+ bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::WriteUint64(u64); }
+ bool Double(double d) { PrettyPrefix(kNumberType); return Base::WriteDouble(d); }
+
+ bool String(const Ch* str, SizeType length, bool copy = false) {
+ (void)copy;
+ PrettyPrefix(kStringType);
+ return Base::WriteString(str, length);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ bool String(const std::basic_string<Ch>& str) {
+ return String(str.data(), SizeType(str.size()));
+ }
+#endif
+
+ bool StartObject() {
+ PrettyPrefix(kObjectType);
+ new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(false);
+ return Base::WriteStartObject();
+ }
+
+ bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }
+
+ bool EndObject(SizeType memberCount = 0) {
+ (void)memberCount;
+ RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));
+ RAPIDJSON_ASSERT(!Base::level_stack_.template Top<typename Base::Level>()->inArray);
+ bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
+
+ if (!empty) {
+ Base::os_->Put('\n');
+ WriteIndent();
+ }
+ bool ret = Base::WriteEndObject();
+ (void)ret;
+ RAPIDJSON_ASSERT(ret == true);
+ if (Base::level_stack_.Empty()) // end of json text
+ Base::os_->Flush();
+ return true;
+ }
+
+ bool StartArray() {
+ PrettyPrefix(kArrayType);
+ new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(true);
+ return Base::WriteStartArray();
+ }
+
+ bool EndArray(SizeType memberCount = 0) {
+ (void)memberCount;
+ RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));
+ RAPIDJSON_ASSERT(Base::level_stack_.template Top<typename Base::Level>()->inArray);
+ bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
+
+ if (!empty) {
+ Base::os_->Put('\n');
+ WriteIndent();
+ }
+ bool ret = Base::WriteEndArray();
+ (void)ret;
+ RAPIDJSON_ASSERT(ret == true);
+ if (Base::level_stack_.Empty()) // end of json text
+ Base::os_->Flush();
+ return true;
+ }
+
+ //@}
+
+ /*! @name Convenience extensions */
+ //@{
+
+ //! Simpler but slower overload.
+ bool String(const Ch* str) { return String(str, internal::StrLen(str)); }
+ bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }
+
+ //@}
+
+ //! Write a raw JSON value.
+ /*!
+ For user to write a stringified JSON as a value.
+
+ \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
+ \param length Length of the json.
+ \param type Type of the root of json.
+ \note When using PrettyWriter::RawValue(), the result json may not be indented correctly.
+ */
+ bool RawValue(const Ch* json, size_t length, Type type) { PrettyPrefix(type); return Base::WriteRawValue(json, length); }
+
+protected:
+ void PrettyPrefix(Type type) {
+ (void)type;
+ if (Base::level_stack_.GetSize() != 0) { // this value is not at root
+ typename Base::Level* level = Base::level_stack_.template Top<typename Base::Level>();
+
+ if (level->inArray) {
+ if (level->valueCount > 0) {
+ Base::os_->Put(','); // add comma if it is not the first element in array
+ Base::os_->Put('\n');
+ }
+ else
+ Base::os_->Put('\n');
+ WriteIndent();
+ }
+ else { // in object
+ if (level->valueCount > 0) {
+ if (level->valueCount % 2 == 0) {
+ Base::os_->Put(',');
+ Base::os_->Put('\n');
+ }
+ else {
+ Base::os_->Put(':');
+ Base::os_->Put(' ');
+ }
+ }
+ else
+ Base::os_->Put('\n');
+
+ if (level->valueCount % 2 == 0)
+ WriteIndent();
+ }
+ if (!level->inArray && level->valueCount % 2 == 0)
+ RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name
+ level->valueCount++;
+ }
+ else {
+ RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root.
+ Base::hasRoot_ = true;
+ }
+ }
+
+ void WriteIndent() {
+ size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_;
+ PutN(*Base::os_, static_cast<typename TargetEncoding::Ch>(indentChar_), count);
+ }
+
+ Ch indentChar_;
+ unsigned indentCharCount_;
+
+private:
+ // Prohibit copy constructor & assignment operator.
+ PrettyWriter(const PrettyWriter&);
+ PrettyWriter& operator=(const PrettyWriter&);
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_RAPIDJSON_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/rapidjson.h b/3rdparty/rapidjson/include/rapidjson/rapidjson.h
new file mode 100644
index 00000000000..7a5db71bd0a
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/rapidjson.h
@@ -0,0 +1,569 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_RAPIDJSON_H_
+#define RAPIDJSON_RAPIDJSON_H_
+
+/*!\file rapidjson.h
+ \brief common definitions and configuration
+
+ \see RAPIDJSON_CONFIG
+ */
+
+/*! \defgroup RAPIDJSON_CONFIG RapidJSON configuration
+ \brief Configuration macros for library features
+
+ Some RapidJSON features are configurable to adapt the library to a wide
+ variety of platforms, environments and usage scenarios. Most of the
+ features can be configured in terms of overriden or predefined
+ preprocessor macros at compile-time.
+
+ Some additional customization is available in the \ref RAPIDJSON_ERRORS APIs.
+
+ \note These macros should be given on the compiler command-line
+ (where applicable) to avoid inconsistent values when compiling
+ different translation units of a single application.
+ */
+
+#include <cstdlib> // malloc(), realloc(), free(), size_t
+#include <cstring> // memset(), memcpy(), memmove(), memcmp()
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_VERSION_STRING
+//
+// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt.
+//
+
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+// token stringification
+#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x)
+#define RAPIDJSON_DO_STRINGIFY(x) #x
+//!@endcond
+
+/*! \def RAPIDJSON_MAJOR_VERSION
+ \ingroup RAPIDJSON_CONFIG
+ \brief Major version of RapidJSON in integer.
+*/
+/*! \def RAPIDJSON_MINOR_VERSION
+ \ingroup RAPIDJSON_CONFIG
+ \brief Minor version of RapidJSON in integer.
+*/
+/*! \def RAPIDJSON_PATCH_VERSION
+ \ingroup RAPIDJSON_CONFIG
+ \brief Patch version of RapidJSON in integer.
+*/
+/*! \def RAPIDJSON_VERSION_STRING
+ \ingroup RAPIDJSON_CONFIG
+ \brief Version of RapidJSON in "<major>.<minor>.<patch>" string format.
+*/
+#define RAPIDJSON_MAJOR_VERSION 1
+#define RAPIDJSON_MINOR_VERSION 0
+#define RAPIDJSON_PATCH_VERSION 2
+#define RAPIDJSON_VERSION_STRING \
+ RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION)
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_NAMESPACE_(BEGIN|END)
+/*! \def RAPIDJSON_NAMESPACE
+ \ingroup RAPIDJSON_CONFIG
+ \brief provide custom rapidjson namespace
+
+ In order to avoid symbol clashes and/or "One Definition Rule" errors
+ between multiple inclusions of (different versions of) RapidJSON in
+ a single binary, users can customize the name of the main RapidJSON
+ namespace.
+
+ In case of a single nesting level, defining \c RAPIDJSON_NAMESPACE
+ to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple
+ levels are needed, both \ref RAPIDJSON_NAMESPACE_BEGIN and \ref
+ RAPIDJSON_NAMESPACE_END need to be defined as well:
+
+ \code
+ // in some .cpp file
+ #define RAPIDJSON_NAMESPACE my::rapidjson
+ #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson {
+ #define RAPIDJSON_NAMESPACE_END } }
+ #include "rapidjson/..."
+ \endcode
+
+ \see rapidjson
+ */
+/*! \def RAPIDJSON_NAMESPACE_BEGIN
+ \ingroup RAPIDJSON_CONFIG
+ \brief provide custom rapidjson namespace (opening expression)
+ \see RAPIDJSON_NAMESPACE
+*/
+/*! \def RAPIDJSON_NAMESPACE_END
+ \ingroup RAPIDJSON_CONFIG
+ \brief provide custom rapidjson namespace (closing expression)
+ \see RAPIDJSON_NAMESPACE
+*/
+#ifndef RAPIDJSON_NAMESPACE
+#define RAPIDJSON_NAMESPACE rapidjson
+#endif
+#ifndef RAPIDJSON_NAMESPACE_BEGIN
+#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE {
+#endif
+#ifndef RAPIDJSON_NAMESPACE_END
+#define RAPIDJSON_NAMESPACE_END }
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_HAS_STDSTRING
+
+#ifndef RAPIDJSON_HAS_STDSTRING
+#ifdef RAPIDJSON_DOXYGEN_RUNNING
+#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation
+#else
+#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default
+#endif
+/*! \def RAPIDJSON_HAS_STDSTRING
+ \ingroup RAPIDJSON_CONFIG
+ \brief Enable RapidJSON support for \c std::string
+
+ By defining this preprocessor symbol to \c 1, several convenience functions for using
+ \ref rapidjson::GenericValue with \c std::string are enabled, especially
+ for construction and comparison.
+
+ \hideinitializer
+*/
+#endif // !defined(RAPIDJSON_HAS_STDSTRING)
+
+#if RAPIDJSON_HAS_STDSTRING
+#include <string>
+#endif // RAPIDJSON_HAS_STDSTRING
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_NO_INT64DEFINE
+
+/*! \def RAPIDJSON_NO_INT64DEFINE
+ \ingroup RAPIDJSON_CONFIG
+ \brief Use external 64-bit integer types.
+
+ RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types
+ to be available at global scope.
+
+ If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to
+ prevent RapidJSON from defining its own types.
+*/
+#ifndef RAPIDJSON_NO_INT64DEFINE
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+#ifdef _MSC_VER
+#include "msinttypes/stdint.h"
+#include "msinttypes/inttypes.h"
+#else
+// Other compilers should have this.
+#include <stdint.h>
+#include <inttypes.h>
+#endif
+//!@endcond
+#ifdef RAPIDJSON_DOXYGEN_RUNNING
+#define RAPIDJSON_NO_INT64DEFINE
+#endif
+#endif // RAPIDJSON_NO_INT64TYPEDEF
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_FORCEINLINE
+
+#ifndef RAPIDJSON_FORCEINLINE
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+#if defined(_MSC_VER) && defined(NDEBUG)
+#define RAPIDJSON_FORCEINLINE __forceinline
+#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG)
+#define RAPIDJSON_FORCEINLINE __attribute__((always_inline))
+#else
+#define RAPIDJSON_FORCEINLINE
+#endif
+//!@endcond
+#endif // RAPIDJSON_FORCEINLINE
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_ENDIAN
+#define RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine
+#define RAPIDJSON_BIGENDIAN 1 //!< Big endian machine
+
+//! Endianness of the machine.
+/*!
+ \def RAPIDJSON_ENDIAN
+ \ingroup RAPIDJSON_CONFIG
+
+ GCC 4.6 provided macro for detecting endianness of the target machine. But other
+ compilers may not have this. User can define RAPIDJSON_ENDIAN to either
+ \ref RAPIDJSON_LITTLEENDIAN or \ref RAPIDJSON_BIGENDIAN.
+
+ Default detection implemented with reference to
+ \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html
+ \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp
+*/
+#ifndef RAPIDJSON_ENDIAN
+// Detect with GCC 4.6's macro
+# ifdef __BYTE_ORDER__
+# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
+# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
+# else
+# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.
+# endif // __BYTE_ORDER__
+// Detect with GLIBC's endian.h
+# elif defined(__GLIBC__)
+# include <endian.h>
+# if (__BYTE_ORDER == __LITTLE_ENDIAN)
+# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
+# elif (__BYTE_ORDER == __BIG_ENDIAN)
+# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
+# else
+# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.
+# endif // __GLIBC__
+// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro
+# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
+# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
+# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
+# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
+// Detect with architecture macros
+# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__)
+# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
+# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)
+# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
+# elif defined(_MSC_VER) && defined(_M_ARM)
+# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
+# elif defined(RAPIDJSON_DOXYGEN_RUNNING)
+# define RAPIDJSON_ENDIAN
+# else
+# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.
+# endif
+#endif // RAPIDJSON_ENDIAN
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_64BIT
+
+//! Whether using 64-bit architecture
+#ifndef RAPIDJSON_64BIT
+#if defined(__LP64__) || defined(_WIN64) || defined(__EMSCRIPTEN__)
+#define RAPIDJSON_64BIT 1
+#else
+#define RAPIDJSON_64BIT 0
+#endif
+#endif // RAPIDJSON_64BIT
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_ALIGN
+
+//! Data alignment of the machine.
+/*! \ingroup RAPIDJSON_CONFIG
+ \param x pointer to align
+
+ Some machines require strict data alignment. Currently the default uses 4 bytes
+ alignment. User can customize by defining the RAPIDJSON_ALIGN function macro.
+*/
+#ifndef RAPIDJSON_ALIGN
+#if RAPIDJSON_64BIT == 1
+#define RAPIDJSON_ALIGN(x) (((x) + static_cast<uint64_t>(7u)) & ~static_cast<uint64_t>(7u))
+#else
+#define RAPIDJSON_ALIGN(x) (((x) + 3u) & ~3u)
+#endif
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_UINT64_C2
+
+//! Construct a 64-bit literal by a pair of 32-bit integer.
+/*!
+ 64-bit literal with or without ULL suffix is prone to compiler warnings.
+ UINT64_C() is C macro which cause compilation problems.
+ Use this macro to define 64-bit constants by a pair of 32-bit integer.
+*/
+#ifndef RAPIDJSON_UINT64_C2
+#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast<uint64_t>(high32) << 32) | static_cast<uint64_t>(low32))
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_SIMD
+
+/*! \def RAPIDJSON_SIMD
+ \ingroup RAPIDJSON_CONFIG
+ \brief Enable SSE2/SSE4.2 optimization.
+
+ RapidJSON supports optimized implementations for some parsing operations
+ based on the SSE2 or SSE4.2 SIMD extensions on modern Intel-compatible
+ processors.
+
+ To enable these optimizations, two different symbols can be defined;
+ \code
+ // Enable SSE2 optimization.
+ #define RAPIDJSON_SSE2
+
+ // Enable SSE4.2 optimization.
+ #define RAPIDJSON_SSE42
+ \endcode
+
+ \c RAPIDJSON_SSE42 takes precedence, if both are defined.
+
+ If any of these symbols is defined, RapidJSON defines the macro
+ \c RAPIDJSON_SIMD to indicate the availability of the optimized code.
+*/
+#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \
+ || defined(RAPIDJSON_DOXYGEN_RUNNING)
+#define RAPIDJSON_SIMD
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_NO_SIZETYPEDEFINE
+
+#ifndef RAPIDJSON_NO_SIZETYPEDEFINE
+/*! \def RAPIDJSON_NO_SIZETYPEDEFINE
+ \ingroup RAPIDJSON_CONFIG
+ \brief User-provided \c SizeType definition.
+
+ In order to avoid using 32-bit size types for indexing strings and arrays,
+ define this preprocessor symbol and provide the type rapidjson::SizeType
+ before including RapidJSON:
+ \code
+ #define RAPIDJSON_NO_SIZETYPEDEFINE
+ namespace rapidjson { typedef ::std::size_t SizeType; }
+ #include "rapidjson/..."
+ \endcode
+
+ \see rapidjson::SizeType
+*/
+#ifdef RAPIDJSON_DOXYGEN_RUNNING
+#define RAPIDJSON_NO_SIZETYPEDEFINE
+#endif
+RAPIDJSON_NAMESPACE_BEGIN
+//! Size type (for string lengths, array sizes, etc.)
+/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms,
+ instead of using \c size_t. Users may override the SizeType by defining
+ \ref RAPIDJSON_NO_SIZETYPEDEFINE.
+*/
+typedef unsigned SizeType;
+RAPIDJSON_NAMESPACE_END
+#endif
+
+// always import std::size_t to rapidjson namespace
+RAPIDJSON_NAMESPACE_BEGIN
+using std::size_t;
+RAPIDJSON_NAMESPACE_END
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_ASSERT
+
+//! Assertion.
+/*! \ingroup RAPIDJSON_CONFIG
+ By default, rapidjson uses C \c assert() for internal assertions.
+ User can override it by defining RAPIDJSON_ASSERT(x) macro.
+
+ \note Parsing errors are handled and can be customized by the
+ \ref RAPIDJSON_ERRORS APIs.
+*/
+#ifndef RAPIDJSON_ASSERT
+#include <cassert>
+#define RAPIDJSON_ASSERT(x) assert(x)
+#endif // RAPIDJSON_ASSERT
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_STATIC_ASSERT
+
+// Adopt from boost
+#ifndef RAPIDJSON_STATIC_ASSERT
+#ifndef __clang__
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+#endif
+RAPIDJSON_NAMESPACE_BEGIN
+template <bool x> struct STATIC_ASSERTION_FAILURE;
+template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
+template<int x> struct StaticAssertTest {};
+RAPIDJSON_NAMESPACE_END
+
+#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y)
+#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y)
+#define RAPIDJSON_DO_JOIN2(X, Y) X##Y
+
+#if defined(__GNUC__)
+#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
+#else
+#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
+#endif
+#ifndef __clang__
+//!@endcond
+#endif
+
+/*! \def RAPIDJSON_STATIC_ASSERT
+ \brief (Internal) macro to check for conditions at compile-time
+ \param x compile-time condition
+ \hideinitializer
+ */
+#define RAPIDJSON_STATIC_ASSERT(x) \
+ typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest< \
+ sizeof(::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE<bool(x) >)> \
+ RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_LIKELY, RAPIDJSON_UNLIKELY
+
+//! Compiler branching hint for expression with high probability to be true.
+/*!
+ \ingroup RAPIDJSON_CONFIG
+ \param x Boolean expression likely to be true.
+*/
+#ifndef RAPIDJSON_LIKELY
+#if defined(__GNUC__) || defined(__clang__)
+#define RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1)
+#else
+#define RAPIDJSON_LIKELY(x) x
+#endif
+#endif
+
+//! Compiler branching hint for expression with low probability to be true.
+/*!
+ \ingroup RAPIDJSON_CONFIG
+ \param x Boolean expression unlikely to be true.
+*/
+#ifndef RAPIDJSON_UNLIKELY
+#if defined(__GNUC__) || defined(__clang__)
+#define RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0)
+#else
+#define RAPIDJSON_UNLIKELY(x) x
+#endif
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Helpers
+
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+
+#define RAPIDJSON_MULTILINEMACRO_BEGIN do {
+#define RAPIDJSON_MULTILINEMACRO_END \
+} while((void)0, 0)
+
+// adopted from Boost
+#define RAPIDJSON_VERSION_CODE(x,y,z) \
+ (((x)*100000) + ((y)*100) + (z))
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF
+
+#if defined(__GNUC__)
+#define RAPIDJSON_GNUC \
+ RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__)
+#endif
+
+#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0))
+
+#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x))
+#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x)
+#define RAPIDJSON_DIAG_OFF(x) \
+ RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x)))
+
+// push/pop support in Clang and GCC>=4.6
+#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0))
+#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)
+#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop)
+#else // GCC >= 4.2, < 4.6
+#define RAPIDJSON_DIAG_PUSH /* ignored */
+#define RAPIDJSON_DIAG_POP /* ignored */
+#endif
+
+#elif defined(_MSC_VER)
+
+// pragma (MSVC specific)
+#define RAPIDJSON_PRAGMA(x) __pragma(x)
+#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x))
+
+#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x)
+#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)
+#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop)
+
+#else
+
+#define RAPIDJSON_DIAG_OFF(x) /* ignored */
+#define RAPIDJSON_DIAG_PUSH /* ignored */
+#define RAPIDJSON_DIAG_POP /* ignored */
+
+#endif // RAPIDJSON_DIAG_*
+
+///////////////////////////////////////////////////////////////////////////////
+// C++11 features
+
+#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS
+#if defined(__clang__)
+#define RAPIDJSON_HAS_CXX11_RVALUE_REFS __has_feature(cxx_rvalue_references) && \
+ (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306)
+#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
+ (defined(_MSC_VER) && _MSC_VER >= 1600)
+
+#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
+#else
+#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
+#endif
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT
+#if defined(__clang__)
+#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept)
+#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__))
+// (defined(_MSC_VER) && _MSC_VER >= ????) // not yet supported
+#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
+#else
+#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
+#endif
+#endif
+#if RAPIDJSON_HAS_CXX11_NOEXCEPT
+#define RAPIDJSON_NOEXCEPT noexcept
+#else
+#define RAPIDJSON_NOEXCEPT /* noexcept */
+#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
+
+// no automatic detection, yet
+#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS
+#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0
+#endif
+
+//!@endcond
+
+///////////////////////////////////////////////////////////////////////////////
+// new/delete
+
+#ifndef RAPIDJSON_NEW
+///! customization point for global \c new
+#define RAPIDJSON_NEW(x) new x
+#endif
+#ifndef RAPIDJSON_DELETE
+///! customization point for global \c delete
+#define RAPIDJSON_DELETE(x) delete x
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Type
+
+/*! \namespace rapidjson
+ \brief main RapidJSON namespace
+ \see RAPIDJSON_NAMESPACE
+*/
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Type of JSON value
+enum Type {
+ kNullType = 0, //!< null
+ kFalseType = 1, //!< false
+ kTrueType = 2, //!< true
+ kObjectType = 3, //!< object
+ kArrayType = 4, //!< array
+ kStringType = 5, //!< string
+ kNumberType = 6 //!< number
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_RAPIDJSON_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/reader.h b/3rdparty/rapidjson/include/rapidjson/reader.h
new file mode 100644
index 00000000000..ed6a1e77cc4
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/reader.h
@@ -0,0 +1,1696 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_READER_H_
+#define RAPIDJSON_READER_H_
+
+/*! \file reader.h */
+
+#include "allocators.h"
+#include "stream.h"
+#include "internal/meta.h"
+#include "internal/stack.h"
+#include "internal/strtod.h"
+
+#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
+#include <intrin.h>
+#pragma intrinsic(_BitScanForward)
+#endif
+#ifdef RAPIDJSON_SSE42
+#include <nmmintrin.h>
+#elif defined(RAPIDJSON_SSE2)
+#include <emmintrin.h>
+#endif
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
+RAPIDJSON_DIAG_OFF(4702) // unreachable code
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+RAPIDJSON_DIAG_OFF(switch-enum)
+#endif
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+#define RAPIDJSON_NOTHING /* deliberately empty */
+#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN
+#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \
+ RAPIDJSON_MULTILINEMACRO_BEGIN \
+ if (RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \
+ RAPIDJSON_MULTILINEMACRO_END
+#endif
+#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING)
+//!@endcond
+
+/*! \def RAPIDJSON_PARSE_ERROR_NORETURN
+ \ingroup RAPIDJSON_ERRORS
+ \brief Macro to indicate a parse error.
+ \param parseErrorCode \ref rapidjson::ParseErrorCode of the error
+ \param offset position of the error in JSON input (\c size_t)
+
+ This macros can be used as a customization point for the internal
+ error handling mechanism of RapidJSON.
+
+ A common usage model is to throw an exception instead of requiring the
+ caller to explicitly check the \ref rapidjson::GenericReader::Parse's
+ return value:
+
+ \code
+ #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \
+ throw ParseException(parseErrorCode, #parseErrorCode, offset)
+
+ #include <stdexcept> // std::runtime_error
+ #include "rapidjson/error/error.h" // rapidjson::ParseResult
+
+ struct ParseException : std::runtime_error, rapidjson::ParseResult {
+ ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset)
+ : std::runtime_error(msg), ParseResult(code, offset) {}
+ };
+
+ #include "rapidjson/reader.h"
+ \endcode
+
+ \see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse
+ */
+#ifndef RAPIDJSON_PARSE_ERROR_NORETURN
+#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \
+ RAPIDJSON_MULTILINEMACRO_BEGIN \
+ RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \
+ SetParseError(parseErrorCode, offset); \
+ RAPIDJSON_MULTILINEMACRO_END
+#endif
+
+/*! \def RAPIDJSON_PARSE_ERROR
+ \ingroup RAPIDJSON_ERRORS
+ \brief (Internal) macro to indicate and handle a parse error.
+ \param parseErrorCode \ref rapidjson::ParseErrorCode of the error
+ \param offset position of the error in JSON input (\c size_t)
+
+ Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing.
+
+ \see RAPIDJSON_PARSE_ERROR_NORETURN
+ \hideinitializer
+ */
+#ifndef RAPIDJSON_PARSE_ERROR
+#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \
+ RAPIDJSON_MULTILINEMACRO_BEGIN \
+ RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \
+ RAPIDJSON_MULTILINEMACRO_END
+#endif
+
+#include "error/error.h" // ParseErrorCode, ParseResult
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// ParseFlag
+
+/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS
+ \ingroup RAPIDJSON_CONFIG
+ \brief User-defined kParseDefaultFlags definition.
+
+ User can define this as any \c ParseFlag combinations.
+*/
+#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS
+#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags
+#endif
+
+//! Combination of parseFlags
+/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream
+ */
+enum ParseFlag {
+ kParseNoFlags = 0, //!< No flags are set.
+ kParseInsituFlag = 1, //!< In-situ(destructive) parsing.
+ kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings.
+ kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing.
+ kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error.
+ kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower).
+ kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments.
+ kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Handler
+
+/*! \class rapidjson::Handler
+ \brief Concept for receiving events from GenericReader upon parsing.
+ The functions return true if no error occurs. If they return false,
+ the event publisher should terminate the process.
+\code
+concept Handler {
+ typename Ch;
+
+ bool Null();
+ bool Bool(bool b);
+ bool Int(int i);
+ bool Uint(unsigned i);
+ bool Int64(int64_t i);
+ bool Uint64(uint64_t i);
+ bool Double(double d);
+ bool String(const Ch* str, SizeType length, bool copy);
+ bool StartObject();
+ bool Key(const Ch* str, SizeType length, bool copy);
+ bool EndObject(SizeType memberCount);
+ bool StartArray();
+ bool EndArray(SizeType elementCount);
+};
+\endcode
+*/
+///////////////////////////////////////////////////////////////////////////////
+// BaseReaderHandler
+
+//! Default implementation of Handler.
+/*! This can be used as base class of any reader handler.
+ \note implements Handler concept
+*/
+template<typename Encoding = UTF8<>, typename Derived = void>
+struct BaseReaderHandler {
+ typedef typename Encoding::Ch Ch;
+
+ typedef typename internal::SelectIf<internal::IsSame<Derived, void>, BaseReaderHandler, Derived>::Type Override;
+
+ bool Default() { return true; }
+ bool Null() { return static_cast<Override&>(*this).Default(); }
+ bool Bool(bool) { return static_cast<Override&>(*this).Default(); }
+ bool Int(int) { return static_cast<Override&>(*this).Default(); }
+ bool Uint(unsigned) { return static_cast<Override&>(*this).Default(); }
+ bool Int64(int64_t) { return static_cast<Override&>(*this).Default(); }
+ bool Uint64(uint64_t) { return static_cast<Override&>(*this).Default(); }
+ bool Double(double) { return static_cast<Override&>(*this).Default(); }
+ bool String(const Ch*, SizeType, bool) { return static_cast<Override&>(*this).Default(); }
+ bool StartObject() { return static_cast<Override&>(*this).Default(); }
+ bool Key(const Ch* str, SizeType len, bool copy) { return static_cast<Override&>(*this).String(str, len, copy); }
+ bool EndObject(SizeType) { return static_cast<Override&>(*this).Default(); }
+ bool StartArray() { return static_cast<Override&>(*this).Default(); }
+ bool EndArray(SizeType) { return static_cast<Override&>(*this).Default(); }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// StreamLocalCopy
+
+namespace internal {
+
+template<typename Stream, int = StreamTraits<Stream>::copyOptimization>
+class StreamLocalCopy;
+
+//! Do copy optimization.
+template<typename Stream>
+class StreamLocalCopy<Stream, 1> {
+public:
+ StreamLocalCopy(Stream& original) : s(original), original_(original) {}
+ ~StreamLocalCopy() { original_ = s; }
+
+ Stream s;
+
+private:
+ StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */;
+
+ Stream& original_;
+};
+
+//! Keep reference.
+template<typename Stream>
+class StreamLocalCopy<Stream, 0> {
+public:
+ StreamLocalCopy(Stream& original) : s(original) {}
+
+ Stream& s;
+
+private:
+ StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */;
+};
+
+} // namespace internal
+
+///////////////////////////////////////////////////////////////////////////////
+// SkipWhitespace
+
+//! Skip the JSON white spaces in a stream.
+/*! \param is A input stream for skipping white spaces.
+ \note This function has SSE2/SSE4.2 specialization.
+*/
+template<typename InputStream>
+void SkipWhitespace(InputStream& is) {
+ internal::StreamLocalCopy<InputStream> copy(is);
+ InputStream& s(copy.s);
+
+ while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
+ s.Take();
+}
+
+#ifdef RAPIDJSON_SSE42
+//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once.
+inline const char *SkipWhitespace_SIMD(const char* p) {
+ // Fast return for single non-whitespace
+ if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
+ ++p;
+ else
+ return p;
+
+ // 16-byte align to the next boundary
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+ while (p != nextAligned)
+ if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
+ ++p;
+ else
+ return p;
+
+ // The rest of string using SIMD
+ static const char whitespace[16] = " \n\r\t";
+ const __m128i w = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespace[0]));
+
+ for (;; p += 16) {
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+ const int r = _mm_cvtsi128_si32(_mm_cmpistrm(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK | _SIDD_NEGATIVE_POLARITY));
+ if (r != 0) { // some of characters is non-whitespace
+#ifdef _MSC_VER // Find the index of first non-whitespace
+ unsigned long offset;
+ _BitScanForward(&offset, r);
+ return p + offset;
+#else
+ return p + __builtin_ffs(r) - 1;
+#endif
+ }
+ }
+}
+
+#elif defined(RAPIDJSON_SSE2)
+
+//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once.
+inline const char *SkipWhitespace_SIMD(const char* p) {
+ // Fast return for single non-whitespace
+ if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
+ ++p;
+ else
+ return p;
+
+ // 16-byte align to the next boundary
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+ while (p != nextAligned)
+ if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
+ ++p;
+ else
+ return p;
+
+ // The rest of string
+ #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c }
+ static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') };
+ #undef C16
+
+ const __m128i w0 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[0][0]));
+ const __m128i w1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[1][0]));
+ const __m128i w2 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[2][0]));
+ const __m128i w3 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[3][0]));
+
+ for (;; p += 16) {
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+ __m128i x = _mm_cmpeq_epi8(s, w0);
+ x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1));
+ x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2));
+ x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3));
+ unsigned short r = static_cast<unsigned short>(~_mm_movemask_epi8(x));
+ if (r != 0) { // some of characters may be non-whitespace
+#ifdef _MSC_VER // Find the index of first non-whitespace
+ unsigned long offset;
+ _BitScanForward(&offset, r);
+ return p + offset;
+#else
+ return p + __builtin_ffs(r) - 1;
+#endif
+ }
+ }
+}
+
+#endif // RAPIDJSON_SSE2
+
+#ifdef RAPIDJSON_SIMD
+//! Template function specialization for InsituStringStream
+template<> inline void SkipWhitespace(InsituStringStream& is) {
+ is.src_ = const_cast<char*>(SkipWhitespace_SIMD(is.src_));
+}
+
+//! Template function specialization for StringStream
+template<> inline void SkipWhitespace(StringStream& is) {
+ is.src_ = SkipWhitespace_SIMD(is.src_);
+}
+#endif // RAPIDJSON_SIMD
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericReader
+
+//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator.
+/*! GenericReader parses JSON text from a stream, and send events synchronously to an
+ object implementing Handler concept.
+
+ It needs to allocate a stack for storing a single decoded string during
+ non-destructive parsing.
+
+ For in-situ parsing, the decoded string is directly written to the source
+ text string, no temporary buffer is required.
+
+ A GenericReader object can be reused for parsing multiple JSON text.
+
+ \tparam SourceEncoding Encoding of the input stream.
+ \tparam TargetEncoding Encoding of the parse output.
+ \tparam StackAllocator Allocator type for stack.
+*/
+template <typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
+class GenericReader {
+public:
+ typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type
+
+ //! Constructor.
+ /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing)
+ \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing)
+ */
+ GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(stackAllocator, stackCapacity), parseResult_() {}
+
+ //! Parse JSON text.
+ /*! \tparam parseFlags Combination of \ref ParseFlag.
+ \tparam InputStream Type of input stream, implementing Stream concept.
+ \tparam Handler Type of handler, implementing Handler concept.
+ \param is Input stream to be parsed.
+ \param handler The handler to receive events.
+ \return Whether the parsing is successful.
+ */
+ template <unsigned parseFlags, typename InputStream, typename Handler>
+ ParseResult Parse(InputStream& is, Handler& handler) {
+ if (parseFlags & kParseIterativeFlag)
+ return IterativeParse<parseFlags>(is, handler);
+
+ parseResult_.Clear();
+
+ ClearStackOnExit scope(*this);
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+
+ if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) {
+ RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell());
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+ }
+ else {
+ ParseValue<parseFlags>(is, handler);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+
+ if (!(parseFlags & kParseStopWhenDoneFlag)) {
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+
+ if (RAPIDJSON_UNLIKELY(is.Peek() != '\0')) {
+ RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell());
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+ }
+ }
+ }
+
+ return parseResult_;
+ }
+
+ //! Parse JSON text (with \ref kParseDefaultFlags)
+ /*! \tparam InputStream Type of input stream, implementing Stream concept
+ \tparam Handler Type of handler, implementing Handler concept.
+ \param is Input stream to be parsed.
+ \param handler The handler to receive events.
+ \return Whether the parsing is successful.
+ */
+ template <typename InputStream, typename Handler>
+ ParseResult Parse(InputStream& is, Handler& handler) {
+ return Parse<kParseDefaultFlags>(is, handler);
+ }
+
+ //! Whether a parse error has occured in the last parsing.
+ bool HasParseError() const { return parseResult_.IsError(); }
+
+ //! Get the \ref ParseErrorCode of last parsing.
+ ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); }
+
+ //! Get the position of last parsing error in input, 0 otherwise.
+ size_t GetErrorOffset() const { return parseResult_.Offset(); }
+
+protected:
+ void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); }
+
+private:
+ // Prohibit copy constructor & assignment operator.
+ GenericReader(const GenericReader&);
+ GenericReader& operator=(const GenericReader&);
+
+ void ClearStack() { stack_.Clear(); }
+
+ // clear stack on any exit from ParseStream, e.g. due to exception
+ struct ClearStackOnExit {
+ explicit ClearStackOnExit(GenericReader& r) : r_(r) {}
+ ~ClearStackOnExit() { r_.ClearStack(); }
+ private:
+ GenericReader& r_;
+ ClearStackOnExit(const ClearStackOnExit&);
+ ClearStackOnExit& operator=(const ClearStackOnExit&);
+ };
+
+ template<unsigned parseFlags, typename InputStream>
+ void SkipWhitespaceAndComments(InputStream& is) {
+ SkipWhitespace(is);
+
+ if (parseFlags & kParseCommentsFlag) {
+ while (RAPIDJSON_UNLIKELY(Consume(is, '/'))) {
+ if (Consume(is, '*')) {
+ while (true) {
+ if (RAPIDJSON_UNLIKELY(is.Peek() == '\0'))
+ RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell());
+ else if (Consume(is, '*')) {
+ if (Consume(is, '/'))
+ break;
+ }
+ else
+ is.Take();
+ }
+ }
+ else if (RAPIDJSON_LIKELY(Consume(is, '/')))
+ while (is.Peek() != '\0' && is.Take() != '\n');
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell());
+
+ SkipWhitespace(is);
+ }
+ }
+ }
+
+ // Parse object: { string : value, ... }
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseObject(InputStream& is, Handler& handler) {
+ RAPIDJSON_ASSERT(is.Peek() == '{');
+ is.Take(); // Skip '{'
+
+ if (RAPIDJSON_UNLIKELY(!handler.StartObject()))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ if (Consume(is, '}')) {
+ if (RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ return;
+ }
+
+ for (SizeType memberCount = 0;;) {
+ if (RAPIDJSON_UNLIKELY(is.Peek() != '"'))
+ RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell());
+
+ ParseString<parseFlags>(is, handler, true);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ if (RAPIDJSON_UNLIKELY(!Consume(is, ':')))
+ RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell());
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ ParseValue<parseFlags>(is, handler);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ ++memberCount;
+
+ switch (is.Peek()) {
+ case ',':
+ is.Take();
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+ break;
+ case '}':
+ is.Take();
+ if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount)))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ return;
+ default:
+ RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell());
+ break;
+ }
+ }
+ }
+
+ // Parse array: [ value, ... ]
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseArray(InputStream& is, Handler& handler) {
+ RAPIDJSON_ASSERT(is.Peek() == '[');
+ is.Take(); // Skip '['
+
+ if (RAPIDJSON_UNLIKELY(!handler.StartArray()))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ if (Consume(is, ']')) {
+ if (RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ return;
+ }
+
+ for (SizeType elementCount = 0;;) {
+ ParseValue<parseFlags>(is, handler);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ ++elementCount;
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+
+ if (Consume(is, ',')) {
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+ }
+ else if (Consume(is, ']')) {
+ if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount)))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ return;
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell());
+ }
+ }
+
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseNull(InputStream& is, Handler& handler) {
+ RAPIDJSON_ASSERT(is.Peek() == 'n');
+ is.Take();
+
+ if (RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) {
+ if (RAPIDJSON_UNLIKELY(!handler.Null()))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell());
+ }
+
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseTrue(InputStream& is, Handler& handler) {
+ RAPIDJSON_ASSERT(is.Peek() == 't');
+ is.Take();
+
+ if (RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) {
+ if (RAPIDJSON_UNLIKELY(!handler.Bool(true)))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell());
+ }
+
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseFalse(InputStream& is, Handler& handler) {
+ RAPIDJSON_ASSERT(is.Peek() == 'f');
+ is.Take();
+
+ if (RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) {
+ if (RAPIDJSON_UNLIKELY(!handler.Bool(false)))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell());
+ }
+
+ template<typename InputStream>
+ RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) {
+ if (RAPIDJSON_LIKELY(is.Peek() == expect)) {
+ is.Take();
+ return true;
+ }
+ else
+ return false;
+ }
+
+ // Helper function to parse four hexidecimal digits in \uXXXX in ParseString().
+ template<typename InputStream>
+ unsigned ParseHex4(InputStream& is, size_t escapeOffset) {
+ unsigned codepoint = 0;
+ for (int i = 0; i < 4; i++) {
+ Ch c = is.Peek();
+ codepoint <<= 4;
+ codepoint += static_cast<unsigned>(c);
+ if (c >= '0' && c <= '9')
+ codepoint -= '0';
+ else if (c >= 'A' && c <= 'F')
+ codepoint -= 'A' - 10;
+ else if (c >= 'a' && c <= 'f')
+ codepoint -= 'a' - 10;
+ else {
+ RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0);
+ }
+ is.Take();
+ }
+ return codepoint;
+ }
+
+ template <typename CharType>
+ class StackStream {
+ public:
+ typedef CharType Ch;
+
+ StackStream(internal::Stack<StackAllocator>& stack) : stack_(stack), length_(0) {}
+ RAPIDJSON_FORCEINLINE void Put(Ch c) {
+ *stack_.template Push<Ch>() = c;
+ ++length_;
+ }
+
+ RAPIDJSON_FORCEINLINE void* Push(SizeType count) {
+ length_ += count;
+ return stack_.template Push<Ch>(count);
+ }
+
+ size_t Length() const { return length_; }
+
+ Ch* Pop() {
+ return stack_.template Pop<Ch>(length_);
+ }
+
+ private:
+ StackStream(const StackStream&);
+ StackStream& operator=(const StackStream&);
+
+ internal::Stack<StackAllocator>& stack_;
+ SizeType length_;
+ };
+
+ // Parse string and generate String event. Different code paths for kParseInsituFlag.
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseString(InputStream& is, Handler& handler, bool isKey = false) {
+ internal::StreamLocalCopy<InputStream> copy(is);
+ InputStream& s(copy.s);
+
+ RAPIDJSON_ASSERT(s.Peek() == '\"');
+ s.Take(); // Skip '\"'
+
+ bool success = false;
+ if (parseFlags & kParseInsituFlag) {
+ typename InputStream::Ch *head = s.PutBegin();
+ ParseStringToStream<parseFlags, SourceEncoding, SourceEncoding>(s, s);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+ size_t length = s.PutEnd(head) - 1;
+ RAPIDJSON_ASSERT(length <= 0xFFFFFFFF);
+ const typename TargetEncoding::Ch* const str = reinterpret_cast<typename TargetEncoding::Ch*>(head);
+ success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false));
+ }
+ else {
+ StackStream<typename TargetEncoding::Ch> stackStream(stack_);
+ ParseStringToStream<parseFlags, SourceEncoding, TargetEncoding>(s, stackStream);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+ SizeType length = static_cast<SizeType>(stackStream.Length()) - 1;
+ const typename TargetEncoding::Ch* const str = stackStream.Pop();
+ success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true));
+ }
+ if (RAPIDJSON_UNLIKELY(!success))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell());
+ }
+
+ // Parse string to an output is
+ // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation.
+ template<unsigned parseFlags, typename SEncoding, typename TEncoding, typename InputStream, typename OutputStream>
+ RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) {
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ static const char escape[256] = {
+ Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/',
+ Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0,
+ 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0,
+ 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16
+ };
+#undef Z16
+//!@endcond
+
+ for (;;) {
+ // Scan and copy string before "\\\"" or < 0x20. This is an optional optimzation.
+ if (!(parseFlags & kParseValidateEncodingFlag))
+ ScanCopyUnescapedString(is, os);
+
+ Ch c = is.Peek();
+ if (RAPIDJSON_UNLIKELY(c == '\\')) { // Escape
+ size_t escapeOffset = is.Tell(); // For invalid escaping, report the inital '\\' as error offset
+ is.Take();
+ Ch e = is.Peek();
+ if ((sizeof(Ch) == 1 || unsigned(e) < 256) && RAPIDJSON_LIKELY(escape[static_cast<unsigned char>(e)])) {
+ is.Take();
+ os.Put(static_cast<typename TEncoding::Ch>(escape[static_cast<unsigned char>(e)]));
+ }
+ else if (RAPIDJSON_LIKELY(e == 'u')) { // Unicode
+ is.Take();
+ unsigned codepoint = ParseHex4(is, escapeOffset);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+ if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDBFF)) {
+ // Handle UTF-16 surrogate pair
+ if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u')))
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
+ unsigned codepoint2 = ParseHex4(is, escapeOffset);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
+ if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF))
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
+ codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000;
+ }
+ TEncoding::Encode(os, codepoint);
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset);
+ }
+ else if (RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote
+ is.Take();
+ os.Put('\0'); // null-terminate the string
+ return;
+ }
+ else if (RAPIDJSON_UNLIKELY(static_cast<unsigned>(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
+ if (c == '\0')
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell());
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, is.Tell());
+ }
+ else {
+ size_t offset = is.Tell();
+ if (RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ?
+ !Transcoder<SEncoding, TEncoding>::Validate(is, os) :
+ !Transcoder<SEncoding, TEncoding>::Transcode(is, os))))
+ RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset);
+ }
+ }
+ }
+
+ template<typename InputStream, typename OutputStream>
+ static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) {
+ // Do nothing for generic version
+ }
+
+#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
+ // StringStream -> StackStream<char>
+ static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream<char>& os) {
+ const char* p = is.src_;
+
+ // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+ while (p != nextAligned)
+ if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
+ is.src_ = p;
+ return;
+ }
+ else
+ os.Put(*p++);
+
+ // The rest of string using SIMD
+ static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
+ static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
+ static const char space[16] = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 };
+ const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
+ const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
+ const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
+
+ for (;; p += 16) {
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+ const __m128i t1 = _mm_cmpeq_epi8(s, dq);
+ const __m128i t2 = _mm_cmpeq_epi8(s, bs);
+ const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x19) == 0x19
+ const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
+ unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
+ if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
+ SizeType length;
+ #ifdef _MSC_VER // Find the index of first escaped
+ unsigned long offset;
+ _BitScanForward(&offset, r);
+ length = offset;
+ #else
+ length = static_cast<SizeType>(__builtin_ffs(r) - 1);
+ #endif
+ char* q = reinterpret_cast<char*>(os.Push(length));
+ for (size_t i = 0; i < length; i++)
+ q[i] = p[i];
+
+ p += length;
+ break;
+ }
+ _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s);
+ }
+
+ is.src_ = p;
+ }
+
+ // InsituStringStream -> InsituStringStream
+ static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) {
+ RAPIDJSON_ASSERT(&is == &os);
+ (void)os;
+
+ if (is.src_ == is.dst_) {
+ SkipUnescapedString(is);
+ return;
+ }
+
+ char* p = is.src_;
+ char *q = is.dst_;
+
+ // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+ while (p != nextAligned)
+ if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
+ is.src_ = p;
+ is.dst_ = q;
+ return;
+ }
+ else
+ *q++ = *p++;
+
+ // The rest of string using SIMD
+ static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
+ static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
+ static const char space[16] = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 };
+ const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
+ const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
+ const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
+
+ for (;; p += 16, q += 16) {
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+ const __m128i t1 = _mm_cmpeq_epi8(s, dq);
+ const __m128i t2 = _mm_cmpeq_epi8(s, bs);
+ const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x19) == 0x19
+ const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
+ unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
+ if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
+ size_t length;
+#ifdef _MSC_VER // Find the index of first escaped
+ unsigned long offset;
+ _BitScanForward(&offset, r);
+ length = offset;
+#else
+ length = static_cast<size_t>(__builtin_ffs(r) - 1);
+#endif
+ for (const char* pend = p + length; p != pend; )
+ *q++ = *p++;
+ break;
+ }
+ _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s);
+ }
+
+ is.src_ = p;
+ is.dst_ = q;
+ }
+
+ // When read/write pointers are the same for insitu stream, just skip unescaped characters
+ static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) {
+ RAPIDJSON_ASSERT(is.src_ == is.dst_);
+ char* p = is.src_;
+
+ // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+ for (; p != nextAligned; p++)
+ if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
+ is.src_ = is.dst_ = p;
+ return;
+ }
+
+ // The rest of string using SIMD
+ static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
+ static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
+ static const char space[16] = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 };
+ const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
+ const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
+ const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
+
+ for (;; p += 16) {
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+ const __m128i t1 = _mm_cmpeq_epi8(s, dq);
+ const __m128i t2 = _mm_cmpeq_epi8(s, bs);
+ const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x19) == 0x19
+ const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
+ unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
+ if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
+ size_t length;
+#ifdef _MSC_VER // Find the index of first escaped
+ unsigned long offset;
+ _BitScanForward(&offset, r);
+ length = offset;
+#else
+ length = static_cast<size_t>(__builtin_ffs(r) - 1);
+#endif
+ p += length;
+ break;
+ }
+ }
+
+ is.src_ = is.dst_ = p;
+ }
+#endif
+
+ template<typename InputStream, bool backup>
+ class NumberStream;
+
+ template<typename InputStream>
+ class NumberStream<InputStream, false> {
+ public:
+ typedef typename InputStream::Ch Ch;
+
+ NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; }
+ ~NumberStream() {}
+
+ RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); }
+ RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); }
+ RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); }
+ size_t Tell() { return is.Tell(); }
+ size_t Length() { return 0; }
+ const char* Pop() { return 0; }
+
+ protected:
+ NumberStream& operator=(const NumberStream&);
+
+ InputStream& is;
+ };
+
+ template<typename InputStream>
+ class NumberStream<InputStream, true> : public NumberStream<InputStream, false> {
+ typedef NumberStream<InputStream, false> Base;
+ public:
+ NumberStream(GenericReader& reader, InputStream& is) : NumberStream<InputStream, false>(reader, is), stackStream(reader.stack_) {}
+ ~NumberStream() {}
+
+ RAPIDJSON_FORCEINLINE Ch TakePush() {
+ stackStream.Put(static_cast<char>(Base::is.Peek()));
+ return Base::is.Take();
+ }
+
+ size_t Length() { return stackStream.Length(); }
+
+ const char* Pop() {
+ stackStream.Put('\0');
+ return stackStream.Pop();
+ }
+
+ private:
+ StackStream<char> stackStream;
+ };
+
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseNumber(InputStream& is, Handler& handler) {
+ internal::StreamLocalCopy<InputStream> copy(is);
+ NumberStream<InputStream, (parseFlags & kParseFullPrecisionFlag) != 0> s(*this, copy.s);
+ size_t startOffset = s.Tell();
+
+ // Parse minus
+ bool minus = Consume(s, '-');
+
+ // Parse int: zero / ( digit1-9 *DIGIT )
+ unsigned i = 0;
+ uint64_t i64 = 0;
+ bool use64bit = false;
+ int significandDigit = 0;
+ if (RAPIDJSON_UNLIKELY(s.Peek() == '0')) {
+ i = 0;
+ s.TakePush();
+ }
+ else if (RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) {
+ i = static_cast<unsigned>(s.TakePush() - '0');
+
+ if (minus)
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648
+ if (RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) {
+ i64 = i;
+ use64bit = true;
+ break;
+ }
+ }
+ i = i * 10 + static_cast<unsigned>(s.TakePush() - '0');
+ significandDigit++;
+ }
+ else
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295
+ if (RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) {
+ i64 = i;
+ use64bit = true;
+ break;
+ }
+ }
+ i = i * 10 + static_cast<unsigned>(s.TakePush() - '0');
+ significandDigit++;
+ }
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell());
+
+ // Parse 64bit int
+ bool useDouble = false;
+ double d = 0.0;
+ if (use64bit) {
+ if (minus)
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808
+ if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) {
+ d = static_cast<double>(i64);
+ useDouble = true;
+ break;
+ }
+ i64 = i64 * 10 + static_cast<unsigned>(s.TakePush() - '0');
+ significandDigit++;
+ }
+ else
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615
+ if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) {
+ d = static_cast<double>(i64);
+ useDouble = true;
+ break;
+ }
+ i64 = i64 * 10 + static_cast<unsigned>(s.TakePush() - '0');
+ significandDigit++;
+ }
+ }
+
+ // Force double for big integer
+ if (useDouble) {
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (RAPIDJSON_UNLIKELY(d >= 1.7976931348623157e307)) // DBL_MAX / 10.0
+ RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset);
+ d = d * 10 + (s.TakePush() - '0');
+ }
+ }
+
+ // Parse frac = decimal-point 1*DIGIT
+ int expFrac = 0;
+ size_t decimalPosition;
+ if (Consume(s, '.')) {
+ decimalPosition = s.Length();
+
+ if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9')))
+ RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell());
+
+ if (!useDouble) {
+#if RAPIDJSON_64BIT
+ // Use i64 to store significand in 64-bit architecture
+ if (!use64bit)
+ i64 = i;
+
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (i64 > RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path
+ break;
+ else {
+ i64 = i64 * 10 + static_cast<unsigned>(s.TakePush() - '0');
+ --expFrac;
+ if (i64 != 0)
+ significandDigit++;
+ }
+ }
+
+ d = static_cast<double>(i64);
+#else
+ // Use double to store significand in 32-bit architecture
+ d = static_cast<double>(use64bit ? i64 : i);
+#endif
+ useDouble = true;
+ }
+
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ if (significandDigit < 17) {
+ d = d * 10.0 + (s.TakePush() - '0');
+ --expFrac;
+ if (RAPIDJSON_LIKELY(d > 0.0))
+ significandDigit++;
+ }
+ else
+ s.TakePush();
+ }
+ }
+ else
+ decimalPosition = s.Length(); // decimal position at the end of integer.
+
+ // Parse exp = e [ minus / plus ] 1*DIGIT
+ int exp = 0;
+ if (Consume(s, 'e') || Consume(s, 'E')) {
+ if (!useDouble) {
+ d = static_cast<double>(use64bit ? i64 : i);
+ useDouble = true;
+ }
+
+ bool expMinus = false;
+ if (Consume(s, '+'))
+ ;
+ else if (Consume(s, '-'))
+ expMinus = true;
+
+ if (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ exp = static_cast<int>(s.Take() - '0');
+ if (expMinus) {
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ exp = exp * 10 + static_cast<int>(s.Take() - '0');
+ if (exp >= 214748364) { // Issue #313: prevent overflow exponent
+ while (RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent
+ s.Take();
+ }
+ }
+ }
+ else { // positive exp
+ int maxExp = 308 - expFrac;
+ while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
+ exp = exp * 10 + static_cast<int>(s.Take() - '0');
+ if (RAPIDJSON_UNLIKELY(exp > maxExp))
+ RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset);
+ }
+ }
+ }
+ else
+ RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell());
+
+ if (expMinus)
+ exp = -exp;
+ }
+
+ // Finish parsing, call event according to the type of number.
+ bool cont = true;
+ size_t length = s.Length();
+ const char* decimal = s.Pop(); // Pop stack no matter if it will be used or not.
+
+ if (useDouble) {
+ int p = exp + expFrac;
+ if (parseFlags & kParseFullPrecisionFlag)
+ d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp);
+ else
+ d = internal::StrtodNormalPrecision(d, p);
+
+ cont = handler.Double(minus ? -d : d);
+ }
+ else {
+ if (use64bit) {
+ if (minus)
+ cont = handler.Int64(static_cast<int64_t>(~i64 + 1));
+ else
+ cont = handler.Uint64(i64);
+ }
+ else {
+ if (minus)
+ cont = handler.Int(static_cast<int32_t>(~i + 1));
+ else
+ cont = handler.Uint(i);
+ }
+ }
+ if (RAPIDJSON_UNLIKELY(!cont))
+ RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset);
+ }
+
+ // Parse any JSON value
+ template<unsigned parseFlags, typename InputStream, typename Handler>
+ void ParseValue(InputStream& is, Handler& handler) {
+ switch (is.Peek()) {
+ case 'n': ParseNull <parseFlags>(is, handler); break;
+ case 't': ParseTrue <parseFlags>(is, handler); break;
+ case 'f': ParseFalse <parseFlags>(is, handler); break;
+ case '"': ParseString<parseFlags>(is, handler); break;
+ case '{': ParseObject<parseFlags>(is, handler); break;
+ case '[': ParseArray <parseFlags>(is, handler); break;
+ default :
+ ParseNumber<parseFlags>(is, handler);
+ break;
+
+ }
+ }
+
+ // Iterative Parsing
+
+ // States
+ enum IterativeParsingState {
+ IterativeParsingStartState = 0,
+ IterativeParsingFinishState,
+ IterativeParsingErrorState,
+
+ // Object states
+ IterativeParsingObjectInitialState,
+ IterativeParsingMemberKeyState,
+ IterativeParsingKeyValueDelimiterState,
+ IterativeParsingMemberValueState,
+ IterativeParsingMemberDelimiterState,
+ IterativeParsingObjectFinishState,
+
+ // Array states
+ IterativeParsingArrayInitialState,
+ IterativeParsingElementState,
+ IterativeParsingElementDelimiterState,
+ IterativeParsingArrayFinishState,
+
+ // Single value state
+ IterativeParsingValueState
+ };
+
+ enum { cIterativeParsingStateCount = IterativeParsingValueState + 1 };
+
+ // Tokens
+ enum Token {
+ LeftBracketToken = 0,
+ RightBracketToken,
+
+ LeftCurlyBracketToken,
+ RightCurlyBracketToken,
+
+ CommaToken,
+ ColonToken,
+
+ StringToken,
+ FalseToken,
+ TrueToken,
+ NullToken,
+ NumberToken,
+
+ kTokenCount
+ };
+
+ RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) {
+
+//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
+#define N NumberToken
+#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N
+ // Maps from ASCII to Token
+ static const unsigned char tokenMap[256] = {
+ N16, // 00~0F
+ N16, // 10~1F
+ N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F
+ N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F
+ N16, // 40~4F
+ N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F
+ N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F
+ N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F
+ N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF
+ };
+#undef N
+#undef N16
+//!@endcond
+
+ if (sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256)
+ return static_cast<Token>(tokenMap[static_cast<unsigned char>(c)]);
+ else
+ return NumberToken;
+ }
+
+ RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) {
+ // current state x one lookahead token -> new state
+ static const char G[cIterativeParsingStateCount][kTokenCount] = {
+ // Start
+ {
+ IterativeParsingArrayInitialState, // Left bracket
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingObjectInitialState, // Left curly bracket
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingValueState, // String
+ IterativeParsingValueState, // False
+ IterativeParsingValueState, // True
+ IterativeParsingValueState, // Null
+ IterativeParsingValueState // Number
+ },
+ // Finish(sink state)
+ {
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState
+ },
+ // Error(sink state)
+ {
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState
+ },
+ // ObjectInitial
+ {
+ IterativeParsingErrorState, // Left bracket
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingErrorState, // Left curly bracket
+ IterativeParsingObjectFinishState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingMemberKeyState, // String
+ IterativeParsingErrorState, // False
+ IterativeParsingErrorState, // True
+ IterativeParsingErrorState, // Null
+ IterativeParsingErrorState // Number
+ },
+ // MemberKey
+ {
+ IterativeParsingErrorState, // Left bracket
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingErrorState, // Left curly bracket
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingKeyValueDelimiterState, // Colon
+ IterativeParsingErrorState, // String
+ IterativeParsingErrorState, // False
+ IterativeParsingErrorState, // True
+ IterativeParsingErrorState, // Null
+ IterativeParsingErrorState // Number
+ },
+ // KeyValueDelimiter
+ {
+ IterativeParsingArrayInitialState, // Left bracket(push MemberValue state)
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state)
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingMemberValueState, // String
+ IterativeParsingMemberValueState, // False
+ IterativeParsingMemberValueState, // True
+ IterativeParsingMemberValueState, // Null
+ IterativeParsingMemberValueState // Number
+ },
+ // MemberValue
+ {
+ IterativeParsingErrorState, // Left bracket
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingErrorState, // Left curly bracket
+ IterativeParsingObjectFinishState, // Right curly bracket
+ IterativeParsingMemberDelimiterState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingErrorState, // String
+ IterativeParsingErrorState, // False
+ IterativeParsingErrorState, // True
+ IterativeParsingErrorState, // Null
+ IterativeParsingErrorState // Number
+ },
+ // MemberDelimiter
+ {
+ IterativeParsingErrorState, // Left bracket
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingErrorState, // Left curly bracket
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingMemberKeyState, // String
+ IterativeParsingErrorState, // False
+ IterativeParsingErrorState, // True
+ IterativeParsingErrorState, // Null
+ IterativeParsingErrorState // Number
+ },
+ // ObjectFinish(sink state)
+ {
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState
+ },
+ // ArrayInitial
+ {
+ IterativeParsingArrayInitialState, // Left bracket(push Element state)
+ IterativeParsingArrayFinishState, // Right bracket
+ IterativeParsingObjectInitialState, // Left curly bracket(push Element state)
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingElementState, // String
+ IterativeParsingElementState, // False
+ IterativeParsingElementState, // True
+ IterativeParsingElementState, // Null
+ IterativeParsingElementState // Number
+ },
+ // Element
+ {
+ IterativeParsingErrorState, // Left bracket
+ IterativeParsingArrayFinishState, // Right bracket
+ IterativeParsingErrorState, // Left curly bracket
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingElementDelimiterState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingErrorState, // String
+ IterativeParsingErrorState, // False
+ IterativeParsingErrorState, // True
+ IterativeParsingErrorState, // Null
+ IterativeParsingErrorState // Number
+ },
+ // ElementDelimiter
+ {
+ IterativeParsingArrayInitialState, // Left bracket(push Element state)
+ IterativeParsingErrorState, // Right bracket
+ IterativeParsingObjectInitialState, // Left curly bracket(push Element state)
+ IterativeParsingErrorState, // Right curly bracket
+ IterativeParsingErrorState, // Comma
+ IterativeParsingErrorState, // Colon
+ IterativeParsingElementState, // String
+ IterativeParsingElementState, // False
+ IterativeParsingElementState, // True
+ IterativeParsingElementState, // Null
+ IterativeParsingElementState // Number
+ },
+ // ArrayFinish(sink state)
+ {
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState
+ },
+ // Single Value (sink state)
+ {
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
+ IterativeParsingErrorState
+ }
+ }; // End of G
+
+ return static_cast<IterativeParsingState>(G[state][token]);
+ }
+
+ // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit().
+ // May return a new state on state pop.
+ template <unsigned parseFlags, typename InputStream, typename Handler>
+ RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) {
+ (void)token;
+
+ switch (dst) {
+ case IterativeParsingErrorState:
+ return dst;
+
+ case IterativeParsingObjectInitialState:
+ case IterativeParsingArrayInitialState:
+ {
+ // Push the state(Element or MemeberValue) if we are nested in another array or value of member.
+ // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop.
+ IterativeParsingState n = src;
+ if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState)
+ n = IterativeParsingElementState;
+ else if (src == IterativeParsingKeyValueDelimiterState)
+ n = IterativeParsingMemberValueState;
+ // Push current state.
+ *stack_.template Push<SizeType>(1) = n;
+ // Initialize and push the member/element count.
+ *stack_.template Push<SizeType>(1) = 0;
+ // Call handler
+ bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray();
+ // On handler short circuits the parsing.
+ if (!hr) {
+ RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());
+ return IterativeParsingErrorState;
+ }
+ else {
+ is.Take();
+ return dst;
+ }
+ }
+
+ case IterativeParsingMemberKeyState:
+ ParseString<parseFlags>(is, handler, true);
+ if (HasParseError())
+ return IterativeParsingErrorState;
+ else
+ return dst;
+
+ case IterativeParsingKeyValueDelimiterState:
+ RAPIDJSON_ASSERT(token == ColonToken);
+ is.Take();
+ return dst;
+
+ case IterativeParsingMemberValueState:
+ // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
+ ParseValue<parseFlags>(is, handler);
+ if (HasParseError()) {
+ return IterativeParsingErrorState;
+ }
+ return dst;
+
+ case IterativeParsingElementState:
+ // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
+ ParseValue<parseFlags>(is, handler);
+ if (HasParseError()) {
+ return IterativeParsingErrorState;
+ }
+ return dst;
+
+ case IterativeParsingMemberDelimiterState:
+ case IterativeParsingElementDelimiterState:
+ is.Take();
+ // Update member/element count.
+ *stack_.template Top<SizeType>() = *stack_.template Top<SizeType>() + 1;
+ return dst;
+
+ case IterativeParsingObjectFinishState:
+ {
+ // Get member count.
+ SizeType c = *stack_.template Pop<SizeType>(1);
+ // If the object is not empty, count the last member.
+ if (src == IterativeParsingMemberValueState)
+ ++c;
+ // Restore the state.
+ IterativeParsingState n = static_cast<IterativeParsingState>(*stack_.template Pop<SizeType>(1));
+ // Transit to Finish state if this is the topmost scope.
+ if (n == IterativeParsingStartState)
+ n = IterativeParsingFinishState;
+ // Call handler
+ bool hr = handler.EndObject(c);
+ // On handler short circuits the parsing.
+ if (!hr) {
+ RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());
+ return IterativeParsingErrorState;
+ }
+ else {
+ is.Take();
+ return n;
+ }
+ }
+
+ case IterativeParsingArrayFinishState:
+ {
+ // Get element count.
+ SizeType c = *stack_.template Pop<SizeType>(1);
+ // If the array is not empty, count the last element.
+ if (src == IterativeParsingElementState)
+ ++c;
+ // Restore the state.
+ IterativeParsingState n = static_cast<IterativeParsingState>(*stack_.template Pop<SizeType>(1));
+ // Transit to Finish state if this is the topmost scope.
+ if (n == IterativeParsingStartState)
+ n = IterativeParsingFinishState;
+ // Call handler
+ bool hr = handler.EndArray(c);
+ // On handler short circuits the parsing.
+ if (!hr) {
+ RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());
+ return IterativeParsingErrorState;
+ }
+ else {
+ is.Take();
+ return n;
+ }
+ }
+
+ default:
+ // This branch is for IterativeParsingValueState actually.
+ // Use `default:` rather than
+ // `case IterativeParsingValueState:` is for code coverage.
+
+ // The IterativeParsingStartState is not enumerated in this switch-case.
+ // It is impossible for that case. And it can be caught by following assertion.
+
+ // The IterativeParsingFinishState is not enumerated in this switch-case either.
+ // It is a "derivative" state which cannot triggered from Predict() directly.
+ // Therefore it cannot happen here. And it can be caught by following assertion.
+ RAPIDJSON_ASSERT(dst == IterativeParsingValueState);
+
+ // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
+ ParseValue<parseFlags>(is, handler);
+ if (HasParseError()) {
+ return IterativeParsingErrorState;
+ }
+ return IterativeParsingFinishState;
+ }
+ }
+
+ template <typename InputStream>
+ void HandleError(IterativeParsingState src, InputStream& is) {
+ if (HasParseError()) {
+ // Error flag has been set.
+ return;
+ }
+
+ switch (src) {
+ case IterativeParsingStartState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return;
+ case IterativeParsingFinishState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return;
+ case IterativeParsingObjectInitialState:
+ case IterativeParsingMemberDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return;
+ case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return;
+ case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return;
+ case IterativeParsingElementState: RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return;
+ default: RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); return;
+ }
+ }
+
+ template <unsigned parseFlags, typename InputStream, typename Handler>
+ ParseResult IterativeParse(InputStream& is, Handler& handler) {
+ parseResult_.Clear();
+ ClearStackOnExit scope(*this);
+ IterativeParsingState state = IterativeParsingStartState;
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+ while (is.Peek() != '\0') {
+ Token t = Tokenize(is.Peek());
+ IterativeParsingState n = Predict(state, t);
+ IterativeParsingState d = Transit<parseFlags>(state, t, n, is, handler);
+
+ if (d == IterativeParsingErrorState) {
+ HandleError(state, is);
+ break;
+ }
+
+ state = d;
+
+ // Do not further consume streams if a root JSON has been parsed.
+ if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState)
+ break;
+
+ SkipWhitespaceAndComments<parseFlags>(is);
+ RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
+ }
+
+ // Handle the end of file.
+ if (state != IterativeParsingFinishState)
+ HandleError(state, is);
+
+ return parseResult_;
+ }
+
+ static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string.
+ internal::Stack<StackAllocator> stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing.
+ ParseResult parseResult_;
+}; // class GenericReader
+
+//! Reader with UTF8 encoding and default allocator.
+typedef GenericReader<UTF8<>, UTF8<> > Reader;
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_READER_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/schema.h b/3rdparty/rapidjson/include/rapidjson/schema.h
new file mode 100644
index 00000000000..e47f89aa3ba
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/schema.h
@@ -0,0 +1,1979 @@
+// Tencent is pleased to support the open source community by making RapidJSON available->
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved->
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License-> You may obtain a copy of the License at
+//
+// http://opensource->org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied-> See the License for the
+// specific language governing permissions and limitations under the License->
+
+#ifndef RAPIDJSON_SCHEMA_H_
+#define RAPIDJSON_SCHEMA_H_
+
+#include "document.h"
+#include "pointer.h"
+#include <cmath> // abs, floor
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(weak-vtables)
+RAPIDJSON_DIAG_OFF(exit-time-destructors)
+RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
+#endif
+
+#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX)
+#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1
+#else
+#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0
+#endif
+
+#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && !defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800))
+#define RAPIDJSON_SCHEMA_USE_STDREGEX 1
+#else
+#define RAPIDJSON_SCHEMA_USE_STDREGEX 0
+#endif
+
+#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
+#include "internal/regex.h"
+#elif RAPIDJSON_SCHEMA_USE_STDREGEX
+#include <regex>
+#endif
+
+#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX || RAPIDJSON_SCHEMA_USE_STDREGEX
+#define RAPIDJSON_SCHEMA_HAS_REGEX 1
+#else
+#define RAPIDJSON_SCHEMA_HAS_REGEX 0
+#endif
+
+#ifndef RAPIDJSON_SCHEMA_VERBOSE
+#define RAPIDJSON_SCHEMA_VERBOSE 0
+#endif
+
+#if RAPIDJSON_SCHEMA_VERBOSE
+#include "stringbuffer.h"
+#endif
+
+#if defined(__GNUC__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(variadic-macros)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// Verbose Utilities
+
+#if RAPIDJSON_SCHEMA_VERBOSE
+
+namespace internal {
+
+inline void PrintInvalidKeyword(const char* keyword) {
+ printf("Fail keyword: %s\n", keyword);
+}
+
+inline void PrintInvalidKeyword(const wchar_t* keyword) {
+ wprintf(L"Fail keyword: %ls\n", keyword);
+}
+
+inline void PrintInvalidDocument(const char* document) {
+ printf("Fail document: %s\n\n", document);
+}
+
+inline void PrintInvalidDocument(const wchar_t* document) {
+ wprintf(L"Fail document: %ls\n\n", document);
+}
+
+inline void PrintValidatorPointers(unsigned depth, const char* s, const char* d) {
+ printf("S: %*s%s\nD: %*s%s\n\n", depth * 4, " ", s, depth * 4, " ", d);
+}
+
+inline void PrintValidatorPointers(unsigned depth, const wchar_t* s, const wchar_t* d) {
+ wprintf(L"S: %*ls%ls\nD: %*ls%ls\n\n", depth * 4, L" ", s, depth * 4, L" ", d);
+}
+
+} // namespace internal
+
+#endif // RAPIDJSON_SCHEMA_VERBOSE
+
+///////////////////////////////////////////////////////////////////////////////
+// RAPIDJSON_INVALID_KEYWORD_RETURN
+
+#if RAPIDJSON_SCHEMA_VERBOSE
+#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) internal::PrintInvalidKeyword(keyword)
+#else
+#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword)
+#endif
+
+#define RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)\
+RAPIDJSON_MULTILINEMACRO_BEGIN\
+ context.invalidKeyword = keyword.GetString();\
+ RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword.GetString());\
+ return false;\
+RAPIDJSON_MULTILINEMACRO_END
+
+///////////////////////////////////////////////////////////////////////////////
+// Forward declarations
+
+template <typename ValueType, typename Allocator>
+class GenericSchemaDocument;
+
+namespace internal {
+
+template <typename SchemaDocumentType>
+class Schema;
+
+///////////////////////////////////////////////////////////////////////////////
+// ISchemaValidator
+
+class ISchemaValidator {
+public:
+ virtual ~ISchemaValidator() {}
+ virtual bool IsValid() const = 0;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// ISchemaStateFactory
+
+template <typename SchemaType>
+class ISchemaStateFactory {
+public:
+ virtual ~ISchemaStateFactory() {}
+ virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&) = 0;
+ virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0;
+ virtual void* CreateHasher() = 0;
+ virtual uint64_t GetHashCode(void* hasher) = 0;
+ virtual void DestroryHasher(void* hasher) = 0;
+ virtual void* MallocState(size_t size) = 0;
+ virtual void* ReallocState(void* originalPtr, size_t originalSize, size_t newSize) = 0;
+ virtual void FreeState(void* p) = 0;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Hasher
+
+// For comparison of compound value
+template<typename Encoding, typename Allocator>
+class Hasher {
+public:
+ typedef typename Encoding::Ch Ch;
+
+ Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {}
+
+ bool Null() { return WriteType(kNullType); }
+ bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); }
+ bool Int(int i) { Number n; n.u.i = i; n.d = static_cast<double>(i); return WriteNumber(n); }
+ bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast<double>(u); return WriteNumber(n); }
+ bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast<double>(i); return WriteNumber(n); }
+ bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast<double>(u); return WriteNumber(n); }
+ bool Double(double d) {
+ Number n;
+ if (d < 0) n.u.i = static_cast<int64_t>(d);
+ else n.u.u = static_cast<uint64_t>(d);
+ n.d = d;
+ return WriteNumber(n);
+ }
+
+ bool String(const Ch* str, SizeType len, bool) {
+ WriteBuffer(kStringType, str, len * sizeof(Ch));
+ return true;
+ }
+
+ bool StartObject() { return true; }
+ bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); }
+ bool EndObject(SizeType memberCount) {
+ uint64_t h = Hash(0, kObjectType);
+ uint64_t* kv = stack_.template Pop<uint64_t>(memberCount * 2);
+ for (SizeType i = 0; i < memberCount; i++)
+ h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive
+ *stack_.template Push<uint64_t>() = h;
+ return true;
+ }
+
+ bool StartArray() { return true; }
+ bool EndArray(SizeType elementCount) {
+ uint64_t h = Hash(0, kArrayType);
+ uint64_t* e = stack_.template Pop<uint64_t>(elementCount);
+ for (SizeType i = 0; i < elementCount; i++)
+ h = Hash(h, e[i]); // Use hash to achieve element order sensitive
+ *stack_.template Push<uint64_t>() = h;
+ return true;
+ }
+
+ bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); }
+
+ uint64_t GetHashCode() const {
+ RAPIDJSON_ASSERT(IsValid());
+ return *stack_.template Top<uint64_t>();
+ }
+
+private:
+ static const size_t kDefaultSize = 256;
+ struct Number {
+ union U {
+ uint64_t u;
+ int64_t i;
+ }u;
+ double d;
+ };
+
+ bool WriteType(Type type) { return WriteBuffer(type, 0, 0); }
+
+ bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); }
+
+ bool WriteBuffer(Type type, const void* data, size_t len) {
+ // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/
+ uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type);
+ const unsigned char* d = static_cast<const unsigned char*>(data);
+ for (size_t i = 0; i < len; i++)
+ h = Hash(h, d[i]);
+ *stack_.template Push<uint64_t>() = h;
+ return true;
+ }
+
+ static uint64_t Hash(uint64_t h, uint64_t d) {
+ static const uint64_t kPrime = RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3);
+ h ^= d;
+ h *= kPrime;
+ return h;
+ }
+
+ Stack<Allocator> stack_;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// SchemaValidationContext
+
+template <typename SchemaDocumentType>
+struct SchemaValidationContext {
+ typedef Schema<SchemaDocumentType> SchemaType;
+ typedef ISchemaStateFactory<SchemaType> SchemaValidatorFactoryType;
+ typedef typename SchemaType::ValueType ValueType;
+ typedef typename ValueType::Ch Ch;
+
+ enum PatternValidatorType {
+ kPatternValidatorOnly,
+ kPatternValidatorWithProperty,
+ kPatternValidatorWithAdditionalProperty
+ };
+
+ SchemaValidationContext(SchemaValidatorFactoryType& f, const SchemaType* s) :
+ factory(f),
+ schema(s),
+ valueSchema(),
+ invalidKeyword(),
+ hasher(),
+ arrayElementHashCodes(),
+ validators(),
+ validatorCount(),
+ patternPropertiesValidators(),
+ patternPropertiesValidatorCount(),
+ patternPropertiesSchemas(),
+ patternPropertiesSchemaCount(),
+ valuePatternValidatorType(kPatternValidatorOnly),
+ objectDependencies(),
+ inArray(false),
+ valueUniqueness(false),
+ arrayUniqueness(false)
+ {
+ }
+
+ ~SchemaValidationContext() {
+ if (hasher)
+ factory.DestroryHasher(hasher);
+ if (validators) {
+ for (SizeType i = 0; i < validatorCount; i++)
+ factory.DestroySchemaValidator(validators[i]);
+ factory.FreeState(validators);
+ }
+ if (patternPropertiesValidators) {
+ for (SizeType i = 0; i < patternPropertiesValidatorCount; i++)
+ factory.DestroySchemaValidator(patternPropertiesValidators[i]);
+ factory.FreeState(patternPropertiesValidators);
+ }
+ if (patternPropertiesSchemas)
+ factory.FreeState(patternPropertiesSchemas);
+ if (objectDependencies)
+ factory.FreeState(objectDependencies);
+ }
+
+ SchemaValidatorFactoryType& factory;
+ const SchemaType* schema;
+ const SchemaType* valueSchema;
+ const Ch* invalidKeyword;
+ void* hasher; // Only validator access
+ void* arrayElementHashCodes; // Only validator access this
+ ISchemaValidator** validators;
+ SizeType validatorCount;
+ ISchemaValidator** patternPropertiesValidators;
+ SizeType patternPropertiesValidatorCount;
+ const SchemaType** patternPropertiesSchemas;
+ SizeType patternPropertiesSchemaCount;
+ PatternValidatorType valuePatternValidatorType;
+ PatternValidatorType objectPatternValidatorType;
+ SizeType objectRequiredCount;
+ SizeType arrayElementIndex;
+ bool* objectDependencies;
+ bool inArray;
+ bool valueUniqueness;
+ bool arrayUniqueness;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Schema
+
+template <typename SchemaDocumentType>
+class Schema {
+public:
+ typedef typename SchemaDocumentType::ValueType ValueType;
+ typedef typename SchemaDocumentType::AllocatorType AllocatorType;
+ typedef typename SchemaDocumentType::PointerType PointerType;
+ typedef typename ValueType::EncodingType EncodingType;
+ typedef typename EncodingType::Ch Ch;
+ typedef SchemaValidationContext<SchemaDocumentType> Context;
+ typedef Schema<SchemaDocumentType> SchemaType;
+ typedef GenericValue<EncodingType, AllocatorType> SValue;
+ friend class GenericSchemaDocument<ValueType, AllocatorType>;
+
+ Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) :
+ allocator_(allocator),
+ enum_(),
+ enumCount_(),
+ not_(),
+ type_((1 << kTotalSchemaType) - 1), // typeless
+ validatorCount_(),
+ properties_(),
+ additionalPropertiesSchema_(),
+ patternProperties_(),
+ patternPropertyCount_(),
+ propertyCount_(),
+ requiredCount_(),
+ minProperties_(),
+ maxProperties_(SizeType(~0)),
+ additionalProperties_(true),
+ hasDependencies_(),
+ hasSchemaDependencies_(),
+ additionalItemsSchema_(),
+ itemsList_(),
+ itemsTuple_(),
+ itemsTupleCount_(),
+ minItems_(),
+ maxItems_(SizeType(~0)),
+ additionalItems_(true),
+ uniqueItems_(false),
+ pattern_(),
+ minLength_(0),
+ maxLength_(~SizeType(0)),
+ exclusiveMinimum_(false),
+ exclusiveMaximum_(false)
+ {
+ typedef typename SchemaDocumentType::ValueType ValueType;
+ typedef typename ValueType::ConstValueIterator ConstValueIterator;
+ typedef typename ValueType::ConstMemberIterator ConstMemberIterator;
+
+ if (!value.IsObject())
+ return;
+
+ if (const ValueType* v = GetMember(value, GetTypeString())) {
+ type_ = 0;
+ if (v->IsString())
+ AddType(*v);
+ else if (v->IsArray())
+ for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr)
+ AddType(*itr);
+ }
+
+ if (const ValueType* v = GetMember(value, GetEnumString()))
+ if (v->IsArray() && v->Size() > 0) {
+ enum_ = static_cast<uint64_t*>(allocator_->Malloc(sizeof(uint64_t) * v->Size()));
+ for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) {
+ typedef Hasher<EncodingType, MemoryPoolAllocator<> > EnumHasherType;
+ char buffer[256 + 24];
+ MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer));
+ EnumHasherType h(&hasherAllocator, 256);
+ itr->Accept(h);
+ enum_[enumCount_++] = h.GetHashCode();
+ }
+ }
+
+ AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document);
+ AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document);
+ AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document);
+
+ if (const ValueType* v = GetMember(value, GetNotString())) {
+ schemaDocument->CreateSchema(&not_, p.Append(GetNotString(), allocator_), *v, document);
+ notValidatorIndex_ = validatorCount_;
+ validatorCount_++;
+ }
+
+ // Object
+
+ const ValueType* properties = GetMember(value, GetPropertiesString());
+ const ValueType* required = GetMember(value, GetRequiredString());
+ const ValueType* dependencies = GetMember(value, GetDependenciesString());
+ {
+ // Gather properties from properties/required/dependencies
+ SValue allProperties(kArrayType);
+
+ if (properties && properties->IsObject())
+ for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr)
+ AddUniqueElement(allProperties, itr->name);
+
+ if (required && required->IsArray())
+ for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
+ if (itr->IsString())
+ AddUniqueElement(allProperties, *itr);
+
+ if (dependencies && dependencies->IsObject())
+ for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
+ AddUniqueElement(allProperties, itr->name);
+ if (itr->value.IsArray())
+ for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i)
+ if (i->IsString())
+ AddUniqueElement(allProperties, *i);
+ }
+
+ if (allProperties.Size() > 0) {
+ propertyCount_ = allProperties.Size();
+ properties_ = static_cast<Property*>(allocator_->Malloc(sizeof(Property) * propertyCount_));
+ for (SizeType i = 0; i < propertyCount_; i++) {
+ new (&properties_[i]) Property();
+ properties_[i].name = allProperties[i];
+ properties_[i].schema = GetTypeless();
+ }
+ }
+ }
+
+ if (properties && properties->IsObject()) {
+ PointerType q = p.Append(GetPropertiesString(), allocator_);
+ for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) {
+ SizeType index;
+ if (FindPropertyIndex(itr->name, &index))
+ schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document);
+ }
+ }
+
+ if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) {
+ PointerType q = p.Append(GetPatternPropertiesString(), allocator_);
+ patternProperties_ = static_cast<PatternProperty*>(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount()));
+ patternPropertyCount_ = 0;
+
+ for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) {
+ new (&patternProperties_[patternPropertyCount_]) PatternProperty();
+ patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name);
+ schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, q.Append(itr->name, allocator_), itr->value, document);
+ patternPropertyCount_++;
+ }
+ }
+
+ if (required && required->IsArray())
+ for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
+ if (itr->IsString()) {
+ SizeType index;
+ if (FindPropertyIndex(*itr, &index)) {
+ properties_[index].required = true;
+ requiredCount_++;
+ }
+ }
+
+ if (dependencies && dependencies->IsObject()) {
+ PointerType q = p.Append(GetDependenciesString(), allocator_);
+ hasDependencies_ = true;
+ for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
+ SizeType sourceIndex;
+ if (FindPropertyIndex(itr->name, &sourceIndex)) {
+ if (itr->value.IsArray()) {
+ properties_[sourceIndex].dependencies = static_cast<bool*>(allocator_->Malloc(sizeof(bool) * propertyCount_));
+ std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_);
+ for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) {
+ SizeType targetIndex;
+ if (FindPropertyIndex(*targetItr, &targetIndex))
+ properties_[sourceIndex].dependencies[targetIndex] = true;
+ }
+ }
+ else if (itr->value.IsObject()) {
+ hasSchemaDependencies_ = true;
+ schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document);
+ properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_;
+ validatorCount_++;
+ }
+ }
+ }
+ }
+
+ if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) {
+ if (v->IsBool())
+ additionalProperties_ = v->GetBool();
+ else if (v->IsObject())
+ schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document);
+ }
+
+ AssignIfExist(minProperties_, value, GetMinPropertiesString());
+ AssignIfExist(maxProperties_, value, GetMaxPropertiesString());
+
+ // Array
+ if (const ValueType* v = GetMember(value, GetItemsString())) {
+ PointerType q = p.Append(GetItemsString(), allocator_);
+ if (v->IsObject()) // List validation
+ schemaDocument->CreateSchema(&itemsList_, q, *v, document);
+ else if (v->IsArray()) { // Tuple validation
+ itemsTuple_ = static_cast<const Schema**>(allocator_->Malloc(sizeof(const Schema*) * v->Size()));
+ SizeType index = 0;
+ for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++)
+ schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document);
+ }
+ }
+
+ AssignIfExist(minItems_, value, GetMinItemsString());
+ AssignIfExist(maxItems_, value, GetMaxItemsString());
+
+ if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) {
+ if (v->IsBool())
+ additionalItems_ = v->GetBool();
+ else if (v->IsObject())
+ schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document);
+ }
+
+ AssignIfExist(uniqueItems_, value, GetUniqueItemsString());
+
+ // String
+ AssignIfExist(minLength_, value, GetMinLengthString());
+ AssignIfExist(maxLength_, value, GetMaxLengthString());
+
+ if (const ValueType* v = GetMember(value, GetPatternString()))
+ pattern_ = CreatePattern(*v);
+
+ // Number
+ if (const ValueType* v = GetMember(value, GetMinimumString()))
+ if (v->IsNumber())
+ minimum_.CopyFrom(*v, *allocator_);
+
+ if (const ValueType* v = GetMember(value, GetMaximumString()))
+ if (v->IsNumber())
+ maximum_.CopyFrom(*v, *allocator_);
+
+ AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString());
+ AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString());
+
+ if (const ValueType* v = GetMember(value, GetMultipleOfString()))
+ if (v->IsNumber() && v->GetDouble() > 0.0)
+ multipleOf_.CopyFrom(*v, *allocator_);
+ }
+
+ ~Schema() {
+ allocator_->Free(enum_);
+ if (properties_) {
+ for (SizeType i = 0; i < propertyCount_; i++)
+ properties_[i].~Property();
+ AllocatorType::Free(properties_);
+ }
+ if (patternProperties_) {
+ for (SizeType i = 0; i < patternPropertyCount_; i++)
+ patternProperties_[i].~PatternProperty();
+ AllocatorType::Free(patternProperties_);
+ }
+ AllocatorType::Free(itemsTuple_);
+#if RAPIDJSON_SCHEMA_HAS_REGEX
+ if (pattern_) {
+ pattern_->~RegexType();
+ allocator_->Free(pattern_);
+ }
+#endif
+ }
+
+ bool BeginValue(Context& context) const {
+ if (context.inArray) {
+ if (uniqueItems_)
+ context.valueUniqueness = true;
+
+ if (itemsList_)
+ context.valueSchema = itemsList_;
+ else if (itemsTuple_) {
+ if (context.arrayElementIndex < itemsTupleCount_)
+ context.valueSchema = itemsTuple_[context.arrayElementIndex];
+ else if (additionalItemsSchema_)
+ context.valueSchema = additionalItemsSchema_;
+ else if (additionalItems_)
+ context.valueSchema = GetTypeless();
+ else
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetItemsString());
+ }
+ else
+ context.valueSchema = GetTypeless();
+
+ context.arrayElementIndex++;
+ }
+ return true;
+ }
+
+ RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const {
+ if (context.patternPropertiesValidatorCount > 0) {
+ bool otherValid = false;
+ SizeType count = context.patternPropertiesValidatorCount;
+ if (context.objectPatternValidatorType != Context::kPatternValidatorOnly)
+ otherValid = context.patternPropertiesValidators[--count]->IsValid();
+
+ bool patternValid = true;
+ for (SizeType i = 0; i < count; i++)
+ if (!context.patternPropertiesValidators[i]->IsValid()) {
+ patternValid = false;
+ break;
+ }
+
+ if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) {
+ if (!patternValid)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString());
+ }
+ else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) {
+ if (!patternValid || !otherValid)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString());
+ }
+ else if (!patternValid && !otherValid) // kPatternValidatorWithAdditionalProperty)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString());
+ }
+
+ if (enum_) {
+ const uint64_t h = context.factory.GetHashCode(context.hasher);
+ for (SizeType i = 0; i < enumCount_; i++)
+ if (enum_[i] == h)
+ goto foundEnum;
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetEnumString());
+ foundEnum:;
+ }
+
+ if (allOf_.schemas)
+ for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++)
+ if (!context.validators[i]->IsValid())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetAllOfString());
+
+ if (anyOf_.schemas) {
+ for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++)
+ if (context.validators[i]->IsValid())
+ goto foundAny;
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetAnyOfString());
+ foundAny:;
+ }
+
+ if (oneOf_.schemas) {
+ bool oneValid = false;
+ for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++)
+ if (context.validators[i]->IsValid()) {
+ if (oneValid)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString());
+ else
+ oneValid = true;
+ }
+ if (!oneValid)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString());
+ }
+
+ if (not_ && context.validators[notValidatorIndex_]->IsValid())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetNotString());
+
+ return true;
+ }
+
+ bool Null(Context& context) const {
+ if (!(type_ & (1 << kNullSchemaType)))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+ return CreateParallelValidator(context);
+ }
+
+ bool Bool(Context& context, bool) const {
+ if (!(type_ & (1 << kBooleanSchemaType)))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+ return CreateParallelValidator(context);
+ }
+
+ bool Int(Context& context, int i) const {
+ if (!CheckInt(context, i))
+ return false;
+ return CreateParallelValidator(context);
+ }
+
+ bool Uint(Context& context, unsigned u) const {
+ if (!CheckUint(context, u))
+ return false;
+ return CreateParallelValidator(context);
+ }
+
+ bool Int64(Context& context, int64_t i) const {
+ if (!CheckInt(context, i))
+ return false;
+ return CreateParallelValidator(context);
+ }
+
+ bool Uint64(Context& context, uint64_t u) const {
+ if (!CheckUint(context, u))
+ return false;
+ return CreateParallelValidator(context);
+ }
+
+ bool Double(Context& context, double d) const {
+ if (!(type_ & (1 << kNumberSchemaType)))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+
+ if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d))
+ return false;
+
+ if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d))
+ return false;
+
+ if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d))
+ return false;
+
+ return CreateParallelValidator(context);
+ }
+
+ bool String(Context& context, const Ch* str, SizeType length, bool) const {
+ if (!(type_ & (1 << kStringSchemaType)))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+
+ if (minLength_ != 0 || maxLength_ != SizeType(~0)) {
+ SizeType count;
+ if (internal::CountStringCodePoint<EncodingType>(str, length, &count)) {
+ if (count < minLength_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinLengthString());
+ if (count > maxLength_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxLengthString());
+ }
+ }
+
+ if (pattern_ && !IsPatternMatch(pattern_, str, length))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternString());
+
+ return CreateParallelValidator(context);
+ }
+
+ bool StartObject(Context& context) const {
+ if (!(type_ & (1 << kObjectSchemaType)))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+
+ context.objectRequiredCount = 0;
+ if (hasDependencies_) {
+ context.objectDependencies = static_cast<bool*>(context.factory.MallocState(sizeof(bool) * propertyCount_));
+ std::memset(context.objectDependencies, 0, sizeof(bool) * propertyCount_);
+ }
+
+ if (patternProperties_) { // pre-allocate schema array
+ SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType
+ context.patternPropertiesSchemas = static_cast<const SchemaType**>(context.factory.MallocState(sizeof(const SchemaType*) * count));
+ context.patternPropertiesSchemaCount = 0;
+ std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count);
+ }
+
+ return CreateParallelValidator(context);
+ }
+
+ bool Key(Context& context, const Ch* str, SizeType len, bool) const {
+ if (patternProperties_) {
+ context.patternPropertiesSchemaCount = 0;
+ for (SizeType i = 0; i < patternPropertyCount_; i++)
+ if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len))
+ context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema;
+ }
+
+ SizeType index;
+ if (FindPropertyIndex(ValueType(str, len).Move(), &index)) {
+ if (context.patternPropertiesSchemaCount > 0) {
+ context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema;
+ context.valueSchema = GetTypeless();
+ context.valuePatternValidatorType = Context::kPatternValidatorWithProperty;
+ }
+ else
+ context.valueSchema = properties_[index].schema;
+
+ if (properties_[index].required)
+ context.objectRequiredCount++;
+
+ if (hasDependencies_)
+ context.objectDependencies[index] = true;
+
+ return true;
+ }
+
+ if (additionalPropertiesSchema_) {
+ if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) {
+ context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_;
+ context.valueSchema = GetTypeless();
+ context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty;
+ }
+ else
+ context.valueSchema = additionalPropertiesSchema_;
+ return true;
+ }
+ else if (additionalProperties_) {
+ context.valueSchema = GetTypeless();
+ return true;
+ }
+
+ if (context.patternPropertiesSchemaCount == 0) // patternProperties are not additional properties
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetAdditionalPropertiesString());
+
+ return true;
+ }
+
+ bool EndObject(Context& context, SizeType memberCount) const {
+ if (context.objectRequiredCount != requiredCount_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetRequiredString());
+
+ if (memberCount < minProperties_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinPropertiesString());
+
+ if (memberCount > maxProperties_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxPropertiesString());
+
+ if (hasDependencies_) {
+ for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++)
+ if (context.objectDependencies[sourceIndex]) {
+ if (properties_[sourceIndex].dependencies) {
+ for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++)
+ if (properties_[sourceIndex].dependencies[targetIndex] && !context.objectDependencies[targetIndex])
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString());
+ }
+ else if (properties_[sourceIndex].dependenciesSchema)
+ if (!context.validators[properties_[sourceIndex].dependenciesValidatorIndex]->IsValid())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString());
+ }
+ }
+
+ return true;
+ }
+
+ bool StartArray(Context& context) const {
+ if (!(type_ & (1 << kArraySchemaType)))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+
+ context.arrayElementIndex = 0;
+ context.inArray = true;
+
+ return CreateParallelValidator(context);
+ }
+
+ bool EndArray(Context& context, SizeType elementCount) const {
+ context.inArray = false;
+
+ if (elementCount < minItems_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinItemsString());
+
+ if (elementCount > maxItems_)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxItemsString());
+
+ return true;
+ }
+
+ // Generate functions for string literal according to Ch
+#define RAPIDJSON_STRING_(name, ...) \
+ static const ValueType& Get##name##String() {\
+ static const Ch s[] = { __VA_ARGS__, '\0' };\
+ static const ValueType v(s, sizeof(s) / sizeof(Ch) - 1);\
+ return v;\
+ }
+
+ RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l')
+ RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n')
+ RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't')
+ RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y')
+ RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g')
+ RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r')
+ RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r')
+ RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e')
+ RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm')
+ RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f')
+ RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f')
+ RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f')
+ RAPIDJSON_STRING_(Not, 'n', 'o', 't')
+ RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
+ RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd')
+ RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's')
+ RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
+ RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
+ RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
+ RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
+ RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's')
+ RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's')
+ RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's')
+ RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's')
+ RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's')
+ RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h')
+ RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h')
+ RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n')
+ RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm')
+ RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm')
+ RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm')
+ RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm')
+ RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f')
+
+#undef RAPIDJSON_STRING_
+
+private:
+ enum SchemaValueType {
+ kNullSchemaType,
+ kBooleanSchemaType,
+ kObjectSchemaType,
+ kArraySchemaType,
+ kStringSchemaType,
+ kNumberSchemaType,
+ kIntegerSchemaType,
+ kTotalSchemaType
+ };
+
+#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
+ typedef internal::GenericRegex<EncodingType> RegexType;
+#elif RAPIDJSON_SCHEMA_USE_STDREGEX
+ typedef std::basic_regex<Ch> RegexType;
+#else
+ typedef char RegexType;
+#endif
+
+ struct SchemaArray {
+ SchemaArray() : schemas(), count() {}
+ ~SchemaArray() { AllocatorType::Free(schemas); }
+ const SchemaType** schemas;
+ SizeType begin; // begin index of context.validators
+ SizeType count;
+ };
+
+ static const SchemaType* GetTypeless() {
+ static SchemaType typeless(0, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), 0);
+ return &typeless;
+ }
+
+ template <typename V1, typename V2>
+ void AddUniqueElement(V1& a, const V2& v) {
+ for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
+ if (*itr == v)
+ return;
+ V1 c(v, *allocator_);
+ a.PushBack(c, *allocator_);
+ }
+
+ static const ValueType* GetMember(const ValueType& value, const ValueType& name) {
+ typename ValueType::ConstMemberIterator itr = value.FindMember(name);
+ return itr != value.MemberEnd() ? &(itr->value) : 0;
+ }
+
+ static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) {
+ if (const ValueType* v = GetMember(value, name))
+ if (v->IsBool())
+ out = v->GetBool();
+ }
+
+ static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) {
+ if (const ValueType* v = GetMember(value, name))
+ if (v->IsUint64() && v->GetUint64() <= SizeType(~0))
+ out = static_cast<SizeType>(v->GetUint64());
+ }
+
+ void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) {
+ if (const ValueType* v = GetMember(value, name)) {
+ if (v->IsArray() && v->Size() > 0) {
+ PointerType q = p.Append(name, allocator_);
+ out.count = v->Size();
+ out.schemas = static_cast<const Schema**>(allocator_->Malloc(out.count * sizeof(const Schema*)));
+ memset(out.schemas, 0, sizeof(Schema*)* out.count);
+ for (SizeType i = 0; i < out.count; i++)
+ schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document);
+ out.begin = validatorCount_;
+ validatorCount_ += out.count;
+ }
+ }
+ }
+
+#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
+ template <typename ValueType>
+ RegexType* CreatePattern(const ValueType& value) {
+ if (value.IsString()) {
+ RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
+ if (!r->IsValid()) {
+ r->~RegexType();
+ r = 0;
+ }
+ return r;
+ }
+ return 0;
+ }
+
+ static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) {
+ return pattern->Search(str);
+ }
+#elif RAPIDJSON_SCHEMA_USE_STDREGEX
+ template <typename ValueType>
+ RegexType* CreatePattern(const ValueType& value) {
+ if (value.IsString())
+ try {
+ return new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
+ }
+ catch (const std::regex_error&) {
+ }
+ return 0;
+ }
+
+ static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) {
+ std::match_results<const Ch*> r;
+ return std::regex_search(str, str + length, r, *pattern);
+ }
+#else
+ template <typename ValueType>
+ RegexType* CreatePattern(const ValueType&) { return 0; }
+
+ static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; }
+#endif // RAPIDJSON_SCHEMA_USE_STDREGEX
+
+ void AddType(const ValueType& type) {
+ if (type == GetNullString() ) type_ |= 1 << kNullSchemaType;
+ else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType;
+ else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType;
+ else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType;
+ else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType;
+ else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType;
+ else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType);
+ }
+
+ bool CreateParallelValidator(Context& context) const {
+ if (enum_ || context.arrayUniqueness)
+ context.hasher = context.factory.CreateHasher();
+
+ if (validatorCount_) {
+ RAPIDJSON_ASSERT(context.validators == 0);
+ context.validators = static_cast<ISchemaValidator**>(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_));
+ context.validatorCount = validatorCount_;
+
+ if (allOf_.schemas)
+ CreateSchemaValidators(context, allOf_);
+
+ if (anyOf_.schemas)
+ CreateSchemaValidators(context, anyOf_);
+
+ if (oneOf_.schemas)
+ CreateSchemaValidators(context, oneOf_);
+
+ if (not_)
+ context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_);
+
+ if (hasSchemaDependencies_) {
+ for (SizeType i = 0; i < propertyCount_; i++)
+ if (properties_[i].dependenciesSchema)
+ context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema);
+ }
+ }
+
+ return true;
+ }
+
+ void CreateSchemaValidators(Context& context, const SchemaArray& schemas) const {
+ for (SizeType i = 0; i < schemas.count; i++)
+ context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i]);
+ }
+
+ // O(n)
+ bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const {
+ SizeType len = name.GetStringLength();
+ const Ch* str = name.GetString();
+ for (SizeType index = 0; index < propertyCount_; index++)
+ if (properties_[index].name.GetStringLength() == len &&
+ (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0))
+ {
+ *outIndex = index;
+ return true;
+ }
+ return false;
+ }
+
+ bool CheckInt(Context& context, int64_t i) const {
+ if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType))))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+
+ if (!minimum_.IsNull()) {
+ if (minimum_.IsInt64()) {
+ if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString());
+ }
+ else if (!CheckDoubleMinimum(context, static_cast<double>(i)))
+ return false;
+ }
+
+ if (!maximum_.IsNull()) {
+ if (maximum_.IsInt64()) {
+ if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString());
+ }
+ else if (!CheckDoubleMaximum(context, static_cast<double>(i)))
+ return false;
+ }
+
+ if (!multipleOf_.IsNull()) {
+ if (multipleOf_.IsUint64()) {
+ if (static_cast<uint64_t>(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString());
+ }
+ else if (!CheckDoubleMultipleOf(context, static_cast<double>(i)))
+ return false;
+ }
+
+ return true;
+ }
+
+ bool CheckUint(Context& context, uint64_t i) const {
+ if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType))))
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
+
+ if (!minimum_.IsNull()) {
+ if (minimum_.IsUint64()) {
+ if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString());
+ }
+ else if (!CheckDoubleMinimum(context, static_cast<double>(i)))
+ return false;
+ }
+
+ if (!maximum_.IsNull()) {
+ if (maximum_.IsUint64()) {
+ if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString());
+ }
+ else if (!CheckDoubleMaximum(context, static_cast<double>(i)))
+ return false;
+ }
+
+ if (!multipleOf_.IsNull()) {
+ if (multipleOf_.IsUint64()) {
+ if (i % multipleOf_.GetUint64() != 0)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString());
+ }
+ else if (!CheckDoubleMultipleOf(context, static_cast<double>(i)))
+ return false;
+ }
+
+ return true;
+ }
+
+ bool CheckDoubleMinimum(Context& context, double d) const {
+ if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString());
+ return true;
+ }
+
+ bool CheckDoubleMaximum(Context& context, double d) const {
+ if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble())
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString());
+ return true;
+ }
+
+ bool CheckDoubleMultipleOf(Context& context, double d) const {
+ double a = std::abs(d), b = std::abs(multipleOf_.GetDouble());
+ double q = std::floor(a / b);
+ double r = a - q * b;
+ if (r > 0.0)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString());
+ return true;
+ }
+
+ struct Property {
+ Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {}
+ ~Property() { AllocatorType::Free(dependencies); }
+ SValue name;
+ const SchemaType* schema;
+ const SchemaType* dependenciesSchema;
+ SizeType dependenciesValidatorIndex;
+ bool* dependencies;
+ bool required;
+ };
+
+ struct PatternProperty {
+ PatternProperty() : schema(), pattern() {}
+ ~PatternProperty() {
+ if (pattern) {
+ pattern->~RegexType();
+ AllocatorType::Free(pattern);
+ }
+ }
+ const SchemaType* schema;
+ RegexType* pattern;
+ };
+
+ AllocatorType* allocator_;
+ uint64_t* enum_;
+ SizeType enumCount_;
+ SchemaArray allOf_;
+ SchemaArray anyOf_;
+ SchemaArray oneOf_;
+ const SchemaType* not_;
+ unsigned type_; // bitmask of kSchemaType
+ SizeType validatorCount_;
+ SizeType notValidatorIndex_;
+
+ Property* properties_;
+ const SchemaType* additionalPropertiesSchema_;
+ PatternProperty* patternProperties_;
+ SizeType patternPropertyCount_;
+ SizeType propertyCount_;
+ SizeType requiredCount_;
+ SizeType minProperties_;
+ SizeType maxProperties_;
+ bool additionalProperties_;
+ bool hasDependencies_;
+ bool hasSchemaDependencies_;
+
+ const SchemaType* additionalItemsSchema_;
+ const SchemaType* itemsList_;
+ const SchemaType** itemsTuple_;
+ SizeType itemsTupleCount_;
+ SizeType minItems_;
+ SizeType maxItems_;
+ bool additionalItems_;
+ bool uniqueItems_;
+
+ RegexType* pattern_;
+ SizeType minLength_;
+ SizeType maxLength_;
+
+ SValue minimum_;
+ SValue maximum_;
+ SValue multipleOf_;
+ bool exclusiveMinimum_;
+ bool exclusiveMaximum_;
+};
+
+template<typename Stack, typename Ch>
+struct TokenHelper {
+ RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
+ *documentStack.template Push<Ch>() = '/';
+ char buffer[21];
+ size_t length = static_cast<size_t>((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer);
+ for (size_t i = 0; i < length; i++)
+ *documentStack.template Push<Ch>() = buffer[i];
+ }
+};
+
+// Partial specialized version for char to prevent buffer copying.
+template <typename Stack>
+struct TokenHelper<Stack, char> {
+ RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
+ if (sizeof(SizeType) == 4) {
+ char *buffer = documentStack.template Push<char>(1 + 10); // '/' + uint
+ *buffer++ = '/';
+ const char* end = internal::u32toa(index, buffer);
+ documentStack.template Pop<char>(static_cast<size_t>(10 - (end - buffer)));
+ }
+ else {
+ char *buffer = documentStack.template Push<char>(1 + 20); // '/' + uint64
+ *buffer++ = '/';
+ const char* end = internal::u64toa(index, buffer);
+ documentStack.template Pop<char>(static_cast<size_t>(20 - (end - buffer)));
+ }
+ }
+};
+
+} // namespace internal
+
+///////////////////////////////////////////////////////////////////////////////
+// IGenericRemoteSchemaDocumentProvider
+
+template <typename SchemaDocumentType>
+class IGenericRemoteSchemaDocumentProvider {
+public:
+ typedef typename SchemaDocumentType::Ch Ch;
+
+ virtual ~IGenericRemoteSchemaDocumentProvider() {}
+ virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericSchemaDocument
+
+//! JSON schema document.
+/*!
+ A JSON schema document is a compiled version of a JSON schema.
+ It is basically a tree of internal::Schema.
+
+ \note This is an immutable class (i.e. its instance cannot be modified after construction).
+ \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding.
+ \tparam Allocator Allocator type for allocating memory of this document.
+*/
+template <typename ValueT, typename Allocator = CrtAllocator>
+class GenericSchemaDocument {
+public:
+ typedef ValueT ValueType;
+ typedef IGenericRemoteSchemaDocumentProvider<GenericSchemaDocument> IRemoteSchemaDocumentProviderType;
+ typedef Allocator AllocatorType;
+ typedef typename ValueType::EncodingType EncodingType;
+ typedef typename EncodingType::Ch Ch;
+ typedef internal::Schema<GenericSchemaDocument> SchemaType;
+ typedef GenericPointer<ValueType, Allocator> PointerType;
+ friend class internal::Schema<GenericSchemaDocument>;
+ template <typename, typename, typename>
+ friend class GenericSchemaValidator;
+
+ //! Constructor.
+ /*!
+ Compile a JSON document into schema document.
+
+ \param document A JSON document as source.
+ \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null.
+ \param allocator An optional allocator instance for allocating memory. Can be null.
+ */
+ GenericSchemaDocument(const ValueType& document, IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) :
+ remoteProvider_(remoteProvider),
+ allocator_(allocator),
+ ownAllocator_(),
+ root_(),
+ schemaMap_(allocator, kInitialSchemaMapSize),
+ schemaRef_(allocator, kInitialSchemaRefSize)
+ {
+ if (!allocator_)
+ ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
+
+ // Generate root schema, it will call CreateSchema() to create sub-schemas,
+ // And call AddRefSchema() if there are $ref.
+ CreateSchemaRecursive(&root_, PointerType(), document, document);
+
+ // Resolve $ref
+ while (!schemaRef_.Empty()) {
+ SchemaRefEntry* refEntry = schemaRef_.template Pop<SchemaRefEntry>(1);
+ if (const SchemaType* s = GetSchema(refEntry->target)) {
+ if (refEntry->schema)
+ *refEntry->schema = s;
+
+ // Create entry in map if not exist
+ if (!GetSchema(refEntry->source)) {
+ new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(refEntry->source, const_cast<SchemaType*>(s), false, allocator_);
+ }
+ }
+ refEntry->~SchemaRefEntry();
+ }
+
+ RAPIDJSON_ASSERT(root_ != 0);
+
+ schemaRef_.ShrinkToFit(); // Deallocate all memory for ref
+ }
+
+ //! Destructor
+ ~GenericSchemaDocument() {
+ while (!schemaMap_.Empty())
+ schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry();
+
+ RAPIDJSON_DELETE(ownAllocator_);
+ }
+
+ //! Get the root schema.
+ const SchemaType& GetRoot() const { return *root_; }
+
+private:
+ struct SchemaRefEntry {
+ SchemaRefEntry(const PointerType& s, const PointerType& t, const SchemaType** outSchema, Allocator *allocator) : source(s, allocator), target(t, allocator), schema(outSchema) {}
+ PointerType source;
+ PointerType target;
+ const SchemaType** schema;
+ };
+
+ struct SchemaEntry {
+ SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {}
+ ~SchemaEntry() {
+ if (owned) {
+ schema->~SchemaType();
+ Allocator::Free(schema);
+ }
+ }
+ PointerType pointer;
+ SchemaType* schema;
+ bool owned;
+ };
+
+ void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) {
+ if (schema)
+ *schema = SchemaType::GetTypeless();
+
+ if (v.GetType() == kObjectType) {
+ const SchemaType* s = GetSchema(pointer);
+ if (!s)
+ CreateSchema(schema, pointer, v, document);
+ else if (schema)
+ *schema = s;
+
+ for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr)
+ CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document);
+ }
+ else if (v.GetType() == kArrayType)
+ for (SizeType i = 0; i < v.Size(); i++)
+ CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document);
+ }
+
+ void CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) {
+ RAPIDJSON_ASSERT(pointer.IsValid());
+ if (v.IsObject()) {
+ if (!HandleRefSchema(pointer, schema, v, document)) {
+ SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_);
+ new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(pointer, s, true, allocator_);
+ if (schema)
+ *schema = s;
+ }
+ }
+ }
+
+ bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document) {
+ static const Ch kRefString[] = { '$', 'r', 'e', 'f', '\0' };
+ static const ValueType kRefValue(kRefString, 4);
+
+ typename ValueType::ConstMemberIterator itr = v.FindMember(kRefValue);
+ if (itr == v.MemberEnd())
+ return false;
+
+ if (itr->value.IsString()) {
+ SizeType len = itr->value.GetStringLength();
+ if (len > 0) {
+ const Ch* s = itr->value.GetString();
+ SizeType i = 0;
+ while (i < len && s[i] != '#') // Find the first #
+ i++;
+
+ if (i > 0) { // Remote reference, resolve immediately
+ if (remoteProvider_) {
+ if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i - 1)) {
+ PointerType pointer(&s[i], len - i, allocator_);
+ if (pointer.IsValid()) {
+ if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) {
+ if (schema)
+ *schema = sc;
+ return true;
+ }
+ }
+ }
+ }
+ }
+ else if (s[i] == '#') { // Local reference, defer resolution
+ PointerType pointer(&s[i], len - i, allocator_);
+ if (pointer.IsValid()) {
+ if (const ValueType* nv = pointer.Get(document))
+ if (HandleRefSchema(source, schema, *nv, document))
+ return true;
+
+ new (schemaRef_.template Push<SchemaRefEntry>()) SchemaRefEntry(source, pointer, schema, allocator_);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ const SchemaType* GetSchema(const PointerType& pointer) const {
+ for (const SchemaEntry* target = schemaMap_.template Bottom<SchemaEntry>(); target != schemaMap_.template End<SchemaEntry>(); ++target)
+ if (pointer == target->pointer)
+ return target->schema;
+ return 0;
+ }
+
+ PointerType GetPointer(const SchemaType* schema) const {
+ for (const SchemaEntry* target = schemaMap_.template Bottom<SchemaEntry>(); target != schemaMap_.template End<SchemaEntry>(); ++target)
+ if (schema == target->schema)
+ return target->pointer;
+ return PointerType();
+ }
+
+ static const size_t kInitialSchemaMapSize = 64;
+ static const size_t kInitialSchemaRefSize = 64;
+
+ IRemoteSchemaDocumentProviderType* remoteProvider_;
+ Allocator *allocator_;
+ Allocator *ownAllocator_;
+ const SchemaType* root_; //!< Root schema.
+ internal::Stack<Allocator> schemaMap_; // Stores created Pointer -> Schemas
+ internal::Stack<Allocator> schemaRef_; // Stores Pointer from $ref and schema which holds the $ref
+};
+
+//! GenericSchemaDocument using Value type.
+typedef GenericSchemaDocument<Value> SchemaDocument;
+//! IGenericRemoteSchemaDocumentProvider using SchemaDocument.
+typedef IGenericRemoteSchemaDocumentProvider<SchemaDocument> IRemoteSchemaDocumentProvider;
+
+///////////////////////////////////////////////////////////////////////////////
+// GenericSchemaValidator
+
+//! JSON Schema Validator.
+/*!
+ A SAX style JSON schema validator.
+ It uses a \c GenericSchemaDocument to validate SAX events.
+ It delegates the incoming SAX events to an output handler.
+ The default output handler does nothing.
+ It can be reused multiple times by calling \c Reset().
+
+ \tparam SchemaDocumentType Type of schema document.
+ \tparam OutputHandler Type of output handler. Default handler does nothing.
+ \tparam StateAllocator Allocator for storing the internal validation states.
+*/
+template <
+ typename SchemaDocumentType,
+ typename OutputHandler = BaseReaderHandler<typename SchemaDocumentType::SchemaType::EncodingType>,
+ typename StateAllocator = CrtAllocator>
+class GenericSchemaValidator :
+ public internal::ISchemaStateFactory<typename SchemaDocumentType::SchemaType>,
+ public internal::ISchemaValidator
+{
+public:
+ typedef typename SchemaDocumentType::SchemaType SchemaType;
+ typedef typename SchemaDocumentType::PointerType PointerType;
+ typedef typename SchemaType::EncodingType EncodingType;
+ typedef typename EncodingType::Ch Ch;
+
+ //! Constructor without output handler.
+ /*!
+ \param schemaDocument The schema document to conform to.
+ \param allocator Optional allocator for storing internal validation states.
+ \param schemaStackCapacity Optional initial capacity of schema path stack.
+ \param documentStackCapacity Optional initial capacity of document path stack.
+ */
+ GenericSchemaValidator(
+ const SchemaDocumentType& schemaDocument,
+ StateAllocator* allocator = 0,
+ size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
+ size_t documentStackCapacity = kDefaultDocumentStackCapacity)
+ :
+ schemaDocument_(&schemaDocument),
+ root_(schemaDocument.GetRoot()),
+ outputHandler_(GetNullHandler()),
+ stateAllocator_(allocator),
+ ownStateAllocator_(0),
+ schemaStack_(allocator, schemaStackCapacity),
+ documentStack_(allocator, documentStackCapacity),
+ valid_(true)
+#if RAPIDJSON_SCHEMA_VERBOSE
+ , depth_(0)
+#endif
+ {
+ }
+
+ //! Constructor with output handler.
+ /*!
+ \param schemaDocument The schema document to conform to.
+ \param allocator Optional allocator for storing internal validation states.
+ \param schemaStackCapacity Optional initial capacity of schema path stack.
+ \param documentStackCapacity Optional initial capacity of document path stack.
+ */
+ GenericSchemaValidator(
+ const SchemaDocumentType& schemaDocument,
+ OutputHandler& outputHandler,
+ StateAllocator* allocator = 0,
+ size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
+ size_t documentStackCapacity = kDefaultDocumentStackCapacity)
+ :
+ schemaDocument_(&schemaDocument),
+ root_(schemaDocument.GetRoot()),
+ outputHandler_(outputHandler),
+ stateAllocator_(allocator),
+ ownStateAllocator_(0),
+ schemaStack_(allocator, schemaStackCapacity),
+ documentStack_(allocator, documentStackCapacity),
+ valid_(true)
+#if RAPIDJSON_SCHEMA_VERBOSE
+ , depth_(0)
+#endif
+ {
+ }
+
+ //! Destructor.
+ ~GenericSchemaValidator() {
+ Reset();
+ RAPIDJSON_DELETE(ownStateAllocator_);
+ }
+
+ //! Reset the internal states.
+ void Reset() {
+ while (!schemaStack_.Empty())
+ PopSchema();
+ documentStack_.Clear();
+ valid_ = true;
+ }
+
+ //! Checks whether the current state is valid.
+ // Implementation of ISchemaValidator
+ virtual bool IsValid() const { return valid_; }
+
+ //! Gets the JSON pointer pointed to the invalid schema.
+ PointerType GetInvalidSchemaPointer() const {
+ return schemaStack_.Empty() ? PointerType() : schemaDocument_->GetPointer(&CurrentSchema());
+ }
+
+ //! Gets the keyword of invalid schema.
+ const Ch* GetInvalidSchemaKeyword() const {
+ return schemaStack_.Empty() ? 0 : CurrentContext().invalidKeyword;
+ }
+
+ //! Gets the JSON pointer pointed to the invalid value.
+ PointerType GetInvalidDocumentPointer() const {
+ return documentStack_.Empty() ? PointerType() : PointerType(documentStack_.template Bottom<Ch>(), documentStack_.GetSize() / sizeof(Ch));
+ }
+
+#if RAPIDJSON_SCHEMA_VERBOSE
+#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() \
+RAPIDJSON_MULTILINEMACRO_BEGIN\
+ *documentStack_.template Push<Ch>() = '\0';\
+ documentStack_.template Pop<Ch>(1);\
+ internal::PrintInvalidDocument(documentStack_.template Bottom<Ch>());\
+RAPIDJSON_MULTILINEMACRO_END
+#else
+#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_()
+#endif
+
+#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\
+ if (!valid_) return false; \
+ if (!BeginValue() || !CurrentSchema().method arg1) {\
+ RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_();\
+ return valid_ = false;\
+ }
+
+#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\
+ for (Context* context = schemaStack_.template Bottom<Context>(); context != schemaStack_.template End<Context>(); context++) {\
+ if (context->hasher)\
+ static_cast<HasherType*>(context->hasher)->method arg2;\
+ if (context->validators)\
+ for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\
+ static_cast<GenericSchemaValidator*>(context->validators[i_])->method arg2;\
+ if (context->patternPropertiesValidators)\
+ for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\
+ static_cast<GenericSchemaValidator*>(context->patternPropertiesValidators[i_])->method arg2;\
+ }
+
+#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\
+ return valid_ = EndValue() && outputHandler_.method arg2
+
+#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \
+ RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\
+ RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\
+ RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2)
+
+ bool Null() { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext() ), ( )); }
+ bool Bool(bool b) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); }
+ bool Int(int i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); }
+ bool Uint(unsigned u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); }
+ bool Int64(int64_t i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); }
+ bool Uint64(uint64_t u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); }
+ bool Double(double d) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); }
+ bool String(const Ch* str, SizeType length, bool copy)
+ { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
+
+ bool StartObject() {
+ RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext()));
+ RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ());
+ return valid_ = outputHandler_.StartObject();
+ }
+
+ bool Key(const Ch* str, SizeType len, bool copy) {
+ if (!valid_) return false;
+ AppendToken(str, len);
+ if (!CurrentSchema().Key(CurrentContext(), str, len, copy)) return valid_ = false;
+ RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy));
+ return valid_ = outputHandler_.Key(str, len, copy);
+ }
+
+ bool EndObject(SizeType memberCount) {
+ if (!valid_) return false;
+ RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount));
+ if (!CurrentSchema().EndObject(CurrentContext(), memberCount)) return valid_ = false;
+ RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount));
+ }
+
+ bool StartArray() {
+ RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext()));
+ RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ());
+ return valid_ = outputHandler_.StartArray();
+ }
+
+ bool EndArray(SizeType elementCount) {
+ if (!valid_) return false;
+ RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount));
+ if (!CurrentSchema().EndArray(CurrentContext(), elementCount)) return valid_ = false;
+ RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount));
+ }
+
+#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_
+#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_
+#undef RAPIDJSON_SCHEMA_HANDLE_PARALLEL_
+#undef RAPIDJSON_SCHEMA_HANDLE_VALUE_
+
+ // Implementation of ISchemaStateFactory<SchemaType>
+ virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root) {
+ return new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root,
+#if RAPIDJSON_SCHEMA_VERBOSE
+ depth_ + 1,
+#endif
+ &GetStateAllocator());
+ }
+
+ virtual void DestroySchemaValidator(ISchemaValidator* validator) {
+ GenericSchemaValidator* v = static_cast<GenericSchemaValidator*>(validator);
+ v->~GenericSchemaValidator();
+ StateAllocator::Free(v);
+ }
+
+ virtual void* CreateHasher() {
+ return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator());
+ }
+
+ virtual uint64_t GetHashCode(void* hasher) {
+ return static_cast<HasherType*>(hasher)->GetHashCode();
+ }
+
+ virtual void DestroryHasher(void* hasher) {
+ HasherType* h = static_cast<HasherType*>(hasher);
+ h->~HasherType();
+ StateAllocator::Free(h);
+ }
+
+ virtual void* MallocState(size_t size) {
+ return GetStateAllocator().Malloc(size);
+ }
+
+ virtual void* ReallocState(void* originalPtr, size_t originalSize, size_t newSize) {
+ return GetStateAllocator().Realloc(originalPtr, originalSize, newSize);
+ }
+
+ virtual void FreeState(void* p) {
+ return StateAllocator::Free(p);
+ }
+
+private:
+ typedef typename SchemaType::Context Context;
+ typedef GenericValue<UTF8<>, StateAllocator> HashCodeArray;
+ typedef internal::Hasher<EncodingType, StateAllocator> HasherType;
+
+ GenericSchemaValidator(
+ const SchemaDocumentType& schemaDocument,
+ const SchemaType& root,
+#if RAPIDJSON_SCHEMA_VERBOSE
+ unsigned depth,
+#endif
+ StateAllocator* allocator = 0,
+ size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
+ size_t documentStackCapacity = kDefaultDocumentStackCapacity)
+ :
+ schemaDocument_(&schemaDocument),
+ root_(root),
+ outputHandler_(GetNullHandler()),
+ stateAllocator_(allocator),
+ ownStateAllocator_(0),
+ schemaStack_(allocator, schemaStackCapacity),
+ documentStack_(allocator, documentStackCapacity),
+ valid_(true)
+#if RAPIDJSON_SCHEMA_VERBOSE
+ , depth_(depth)
+#endif
+ {
+ }
+
+ StateAllocator& GetStateAllocator() {
+ if (!stateAllocator_)
+ stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator());
+ return *stateAllocator_;
+ }
+
+ bool BeginValue() {
+ if (schemaStack_.Empty())
+ PushSchema(root_);
+ else {
+ if (CurrentContext().inArray)
+ internal::TokenHelper<internal::Stack<StateAllocator>, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex);
+
+ if (!CurrentSchema().BeginValue(CurrentContext()))
+ return false;
+
+ SizeType count = CurrentContext().patternPropertiesSchemaCount;
+ const SchemaType** sa = CurrentContext().patternPropertiesSchemas;
+ typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType;
+ bool valueUniqueness = CurrentContext().valueUniqueness;
+ if (CurrentContext().valueSchema)
+ PushSchema(*CurrentContext().valueSchema);
+
+ if (count > 0) {
+ CurrentContext().objectPatternValidatorType = patternValidatorType;
+ ISchemaValidator**& va = CurrentContext().patternPropertiesValidators;
+ SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount;
+ va = static_cast<ISchemaValidator**>(MallocState(sizeof(ISchemaValidator*) * count));
+ for (SizeType i = 0; i < count; i++)
+ va[validatorCount++] = CreateSchemaValidator(*sa[i]);
+ }
+
+ CurrentContext().arrayUniqueness = valueUniqueness;
+ }
+ return true;
+ }
+
+ bool EndValue() {
+ if (!CurrentSchema().EndValue(CurrentContext()))
+ return false;
+
+#if RAPIDJSON_SCHEMA_VERBOSE
+ GenericStringBuffer<EncodingType> sb;
+ schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb);
+
+ *documentStack_.template Push<Ch>() = '\0';
+ documentStack_.template Pop<Ch>(1);
+ internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom<Ch>());
+#endif
+
+ uint64_t h = CurrentContext().arrayUniqueness ? static_cast<HasherType*>(CurrentContext().hasher)->GetHashCode() : 0;
+
+ PopSchema();
+
+ if (!schemaStack_.Empty()) {
+ Context& context = CurrentContext();
+ if (context.valueUniqueness) {
+ HashCodeArray* a = static_cast<HashCodeArray*>(context.arrayElementHashCodes);
+ if (!a)
+ CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType);
+ for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr)
+ if (itr->GetUint64() == h)
+ RAPIDJSON_INVALID_KEYWORD_RETURN(SchemaType::GetUniqueItemsString());
+ a->PushBack(h, GetStateAllocator());
+ }
+ }
+
+ // Remove the last token of document pointer
+ while (!documentStack_.Empty() && *documentStack_.template Pop<Ch>(1) != '/')
+ ;
+
+ return true;
+ }
+
+ void AppendToken(const Ch* str, SizeType len) {
+ documentStack_.template Reserve<Ch>(1 + len * 2); // worst case all characters are escaped as two characters
+ *documentStack_.template PushUnsafe<Ch>() = '/';
+ for (SizeType i = 0; i < len; i++) {
+ if (str[i] == '~') {
+ *documentStack_.template PushUnsafe<Ch>() = '~';
+ *documentStack_.template PushUnsafe<Ch>() = '0';
+ }
+ else if (str[i] == '/') {
+ *documentStack_.template PushUnsafe<Ch>() = '~';
+ *documentStack_.template PushUnsafe<Ch>() = '1';
+ }
+ else
+ *documentStack_.template PushUnsafe<Ch>() = str[i];
+ }
+ }
+
+ RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push<Context>()) Context(*this, &schema); }
+
+ RAPIDJSON_FORCEINLINE void PopSchema() {
+ Context* c = schemaStack_.template Pop<Context>(1);
+ if (HashCodeArray* a = static_cast<HashCodeArray*>(c->arrayElementHashCodes)) {
+ a->~HashCodeArray();
+ StateAllocator::Free(a);
+ }
+ c->~Context();
+ }
+
+ const SchemaType& CurrentSchema() const { return *schemaStack_.template Top<Context>()->schema; }
+ Context& CurrentContext() { return *schemaStack_.template Top<Context>(); }
+ const Context& CurrentContext() const { return *schemaStack_.template Top<Context>(); }
+
+ static OutputHandler& GetNullHandler() {
+ static OutputHandler nullHandler;
+ return nullHandler;
+ }
+
+ static const size_t kDefaultSchemaStackCapacity = 1024;
+ static const size_t kDefaultDocumentStackCapacity = 256;
+ const SchemaDocumentType* schemaDocument_;
+ const SchemaType& root_;
+ OutputHandler& outputHandler_;
+ StateAllocator* stateAllocator_;
+ StateAllocator* ownStateAllocator_;
+ internal::Stack<StateAllocator> schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *)
+ internal::Stack<StateAllocator> documentStack_; //!< stack to store the current path of validating document (Ch)
+ bool valid_;
+#if RAPIDJSON_SCHEMA_VERBOSE
+ unsigned depth_;
+#endif
+};
+
+typedef GenericSchemaValidator<SchemaDocument> SchemaValidator;
+
+///////////////////////////////////////////////////////////////////////////////
+// SchemaValidatingReader
+
+//! A helper class for parsing with validation.
+/*!
+ This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate().
+
+ \tparam parseFlags Combination of \ref ParseFlag.
+ \tparam InputStream Type of input stream, implementing Stream concept.
+ \tparam SourceEncoding Encoding of the input stream.
+ \tparam SchemaDocumentType Type of schema document.
+ \tparam StackAllocator Allocator type for stack.
+*/
+template <
+ unsigned parseFlags,
+ typename InputStream,
+ typename SourceEncoding,
+ typename SchemaDocumentType = SchemaDocument,
+ typename StackAllocator = CrtAllocator>
+class SchemaValidatingReader {
+public:
+ typedef typename SchemaDocumentType::PointerType PointerType;
+ typedef typename InputStream::Ch Ch;
+
+ //! Constructor
+ /*!
+ \param is Input stream.
+ \param sd Schema document.
+ */
+ SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), isValid_(true) {}
+
+ template <typename Handler>
+ bool operator()(Handler& handler) {
+ GenericReader<SourceEncoding, typename SchemaDocumentType::EncodingType, StackAllocator> reader;
+ GenericSchemaValidator<SchemaDocumentType, Handler> validator(sd_, handler);
+ parseResult_ = reader.template Parse<parseFlags>(is_, validator);
+
+ if ((isValid_ = validator.IsValid())) {
+ invalidSchemaPointer_ = PointerType();
+ invalidSchemaKeyword_ = 0;
+ invalidDocumentPointer_ = PointerType();
+ }
+ else {
+ invalidSchemaPointer_ = validator.GetInvalidSchemaPointer();
+ invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword();
+ invalidDocumentPointer_ = validator.GetInvalidDocumentPointer();
+ }
+
+ return parseResult_;
+ }
+
+ const ParseResult& GetParseResult() const { return parseResult_; }
+ bool IsValid() const { return isValid_; }
+ const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; }
+ const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; }
+ const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; }
+
+private:
+ InputStream& is_;
+ const SchemaDocumentType& sd_;
+
+ ParseResult parseResult_;
+ PointerType invalidSchemaPointer_;
+ const Ch* invalidSchemaKeyword_;
+ PointerType invalidDocumentPointer_;
+ bool isValid_;
+};
+
+RAPIDJSON_NAMESPACE_END
+
+#if defined(__GNUC__)
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_SCHEMA_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/stream.h b/3rdparty/rapidjson/include/rapidjson/stream.h
new file mode 100644
index 00000000000..dd2783b4134
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/stream.h
@@ -0,0 +1,179 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "rapidjson.h"
+
+#ifndef RAPIDJSON_STREAM_H_
+#define RAPIDJSON_STREAM_H_
+
+#include "encodings.h"
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// Stream
+
+/*! \class rapidjson::Stream
+ \brief Concept for reading and writing characters.
+
+ For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd().
+
+ For write-only stream, only need to implement Put() and Flush().
+
+\code
+concept Stream {
+ typename Ch; //!< Character type of the stream.
+
+ //! Read the current character from stream without moving the read cursor.
+ Ch Peek() const;
+
+ //! Read the current character from stream and moving the read cursor to next character.
+ Ch Take();
+
+ //! Get the current read cursor.
+ //! \return Number of characters read from start.
+ size_t Tell();
+
+ //! Begin writing operation at the current read pointer.
+ //! \return The begin writer pointer.
+ Ch* PutBegin();
+
+ //! Write a character.
+ void Put(Ch c);
+
+ //! Flush the buffer.
+ void Flush();
+
+ //! End the writing operation.
+ //! \param begin The begin write pointer returned by PutBegin().
+ //! \return Number of characters written.
+ size_t PutEnd(Ch* begin);
+}
+\endcode
+*/
+
+//! Provides additional information for stream.
+/*!
+ By using traits pattern, this type provides a default configuration for stream.
+ For custom stream, this type can be specialized for other configuration.
+ See TEST(Reader, CustomStringStream) in readertest.cpp for example.
+*/
+template<typename Stream>
+struct StreamTraits {
+ //! Whether to make local copy of stream for optimization during parsing.
+ /*!
+ By default, for safety, streams do not use local copy optimization.
+ Stream that can be copied fast should specialize this, like StreamTraits<StringStream>.
+ */
+ enum { copyOptimization = 0 };
+};
+
+//! Reserve n characters for writing to a stream.
+template<typename Stream>
+inline void PutReserve(Stream& stream, size_t count) {
+ (void)stream;
+ (void)count;
+}
+
+//! Write character to a stream, presuming buffer is reserved.
+template<typename Stream>
+inline void PutUnsafe(Stream& stream, typename Stream::Ch c) {
+ stream.Put(c);
+}
+
+//! Put N copies of a character to a stream.
+template<typename Stream, typename Ch>
+inline void PutN(Stream& stream, Ch c, size_t n) {
+ PutReserve<Stream>(stream, n);
+ for (size_t i = 0; i < n; i++)
+ PutUnsafe(stream, c);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// StringStream
+
+//! Read-only string stream.
+/*! \note implements Stream concept
+*/
+template <typename Encoding>
+struct GenericStringStream {
+ typedef typename Encoding::Ch Ch;
+
+ GenericStringStream(const Ch *src) : src_(src), head_(src) {}
+
+ Ch Peek() const { return *src_; }
+ Ch Take() { return *src_++; }
+ size_t Tell() const { return static_cast<size_t>(src_ - head_); }
+
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+ const Ch* src_; //!< Current read position.
+ const Ch* head_; //!< Original head of the string.
+};
+
+template <typename Encoding>
+struct StreamTraits<GenericStringStream<Encoding> > {
+ enum { copyOptimization = 1 };
+};
+
+//! String stream with UTF8 encoding.
+typedef GenericStringStream<UTF8<> > StringStream;
+
+///////////////////////////////////////////////////////////////////////////////
+// InsituStringStream
+
+//! A read-write string stream.
+/*! This string stream is particularly designed for in-situ parsing.
+ \note implements Stream concept
+*/
+template <typename Encoding>
+struct GenericInsituStringStream {
+ typedef typename Encoding::Ch Ch;
+
+ GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {}
+
+ // Read
+ Ch Peek() { return *src_; }
+ Ch Take() { return *src_++; }
+ size_t Tell() { return static_cast<size_t>(src_ - head_); }
+
+ // Write
+ void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; }
+
+ Ch* PutBegin() { return dst_ = src_; }
+ size_t PutEnd(Ch* begin) { return static_cast<size_t>(dst_ - begin); }
+ void Flush() {}
+
+ Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; }
+ void Pop(size_t count) { dst_ -= count; }
+
+ Ch* src_;
+ Ch* dst_;
+ Ch* head_;
+};
+
+template <typename Encoding>
+struct StreamTraits<GenericInsituStringStream<Encoding> > {
+ enum { copyOptimization = 1 };
+};
+
+//! Insitu string stream with UTF8 encoding.
+typedef GenericInsituStringStream<UTF8<> > InsituStringStream;
+
+RAPIDJSON_NAMESPACE_END
+
+#endif // RAPIDJSON_STREAM_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/stringbuffer.h b/3rdparty/rapidjson/include/rapidjson/stringbuffer.h
new file mode 100644
index 00000000000..78f34d2098e
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/stringbuffer.h
@@ -0,0 +1,117 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_STRINGBUFFER_H_
+#define RAPIDJSON_STRINGBUFFER_H_
+
+#include "stream.h"
+#include "internal/stack.h"
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+#include <utility> // std::move
+#endif
+
+#include "internal/stack.h"
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+//! Represents an in-memory output stream.
+/*!
+ \tparam Encoding Encoding of the stream.
+ \tparam Allocator type for allocating memory buffer.
+ \note implements Stream concept
+*/
+template <typename Encoding, typename Allocator = CrtAllocator>
+class GenericStringBuffer {
+public:
+ typedef typename Encoding::Ch Ch;
+
+ GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {}
+ GenericStringBuffer& operator=(GenericStringBuffer&& rhs) {
+ if (&rhs != this)
+ stack_ = std::move(rhs.stack_);
+ return *this;
+ }
+#endif
+
+ void Put(Ch c) { *stack_.template Push<Ch>() = c; }
+ void PutUnsafe(Ch c) { *stack_.template PushUnsafe<Ch>() = c; }
+ void Flush() {}
+
+ void Clear() { stack_.Clear(); }
+ void ShrinkToFit() {
+ // Push and pop a null terminator. This is safe.
+ *stack_.template Push<Ch>() = '\0';
+ stack_.ShrinkToFit();
+ stack_.template Pop<Ch>(1);
+ }
+
+ void Reserve(size_t count) { stack_.template Reserve<Ch>(count); }
+ Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
+ Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe<Ch>(count); }
+ void Pop(size_t count) { stack_.template Pop<Ch>(count); }
+
+ const Ch* GetString() const {
+ // Push and pop a null terminator. This is safe.
+ *stack_.template Push<Ch>() = '\0';
+ stack_.template Pop<Ch>(1);
+
+ return stack_.template Bottom<Ch>();
+ }
+
+ size_t GetSize() const { return stack_.GetSize(); }
+
+ static const size_t kDefaultCapacity = 256;
+ mutable internal::Stack<Allocator> stack_;
+
+private:
+ // Prohibit copy constructor & assignment operator.
+ GenericStringBuffer(const GenericStringBuffer&);
+ GenericStringBuffer& operator=(const GenericStringBuffer&);
+};
+
+//! String buffer with UTF8 encoding
+typedef GenericStringBuffer<UTF8<> > StringBuffer;
+
+template<typename Encoding, typename Allocator>
+inline void PutReserve(GenericStringBuffer<Encoding, Allocator>& stream, size_t count) {
+ stream.Reserve(count);
+}
+
+template<typename Encoding, typename Allocator>
+inline void PutUnsafe(GenericStringBuffer<Encoding, Allocator>& stream, typename Encoding::Ch c) {
+ stream.PutUnsafe(c);
+}
+
+//! Implement specialized version of PutN() with memset() for better performance.
+template<>
+inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
+ std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
+}
+
+RAPIDJSON_NAMESPACE_END
+
+#if defined(__clang__)
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_STRINGBUFFER_H_
diff --git a/3rdparty/rapidjson/include/rapidjson/writer.h b/3rdparty/rapidjson/include/rapidjson/writer.h
new file mode 100644
index 00000000000..a64c79fe245
--- /dev/null
+++ b/3rdparty/rapidjson/include/rapidjson/writer.h
@@ -0,0 +1,558 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef RAPIDJSON_WRITER_H_
+#define RAPIDJSON_WRITER_H_
+
+#include "stream.h"
+#include "internal/stack.h"
+#include "internal/strfunc.h"
+#include "internal/dtoa.h"
+#include "internal/itoa.h"
+#include "stringbuffer.h"
+#include <new> // placement new
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(padded)
+#endif
+
+RAPIDJSON_NAMESPACE_BEGIN
+
+///////////////////////////////////////////////////////////////////////////////
+// WriteFlag
+
+/*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS
+ \ingroup RAPIDJSON_CONFIG
+ \brief User-defined kWriteDefaultFlags definition.
+
+ User can define this as any \c WriteFlag combinations.
+*/
+#ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS
+#define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags
+#endif
+
+//! Combination of writeFlags
+enum WriteFlag {
+ kWriteNoFlags = 0, //!< No flags are set.
+ kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings.
+ kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS
+};
+
+//! JSON writer
+/*! Writer implements the concept Handler.
+ It generates JSON text by events to an output os.
+
+ User may programmatically calls the functions of a writer to generate JSON text.
+
+ On the other side, a writer can also be passed to objects that generates events,
+
+ for example Reader::Parse() and Document::Accept().
+
+ \tparam OutputStream Type of output stream.
+ \tparam SourceEncoding Encoding of source string.
+ \tparam TargetEncoding Encoding of output stream.
+ \tparam StackAllocator Type of allocator for allocating memory of stack.
+ \note implements Handler concept
+*/
+template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
+class Writer {
+public:
+ typedef typename SourceEncoding::Ch Ch;
+
+ static const int kDefaultMaxDecimalPlaces = 324;
+
+ //! Constructor
+ /*! \param os Output stream.
+ \param stackAllocator User supplied allocator. If it is null, it will create a private one.
+ \param levelDepth Initial capacity of stack.
+ */
+ explicit
+ Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) :
+ os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
+
+ explicit
+ Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) :
+ os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
+
+ //! Reset the writer with a new stream.
+ /*!
+ This function reset the writer with a new stream and default settings,
+ in order to make a Writer object reusable for output multiple JSONs.
+
+ \param os New output stream.
+ \code
+ Writer<OutputStream> writer(os1);
+ writer.StartObject();
+ // ...
+ writer.EndObject();
+
+ writer.Reset(os2);
+ writer.StartObject();
+ // ...
+ writer.EndObject();
+ \endcode
+ */
+ void Reset(OutputStream& os) {
+ os_ = &os;
+ hasRoot_ = false;
+ level_stack_.Clear();
+ }
+
+ //! Checks whether the output is a complete JSON.
+ /*!
+ A complete JSON has a complete root object or array.
+ */
+ bool IsComplete() const {
+ return hasRoot_ && level_stack_.Empty();
+ }
+
+ int GetMaxDecimalPlaces() const {
+ return maxDecimalPlaces_;
+ }
+
+ //! Sets the maximum number of decimal places for double output.
+ /*!
+ This setting truncates the output with specified number of decimal places.
+
+ For example,
+
+ \code
+ writer.SetMaxDecimalPlaces(3);
+ writer.StartArray();
+ writer.Double(0.12345); // "0.123"
+ writer.Double(0.0001); // "0.0"
+ writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent)
+ writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent)
+ writer.EndArray();
+ \endcode
+
+ The default setting does not truncate any decimal places. You can restore to this setting by calling
+ \code
+ writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces);
+ \endcode
+ */
+ void SetMaxDecimalPlaces(int maxDecimalPlaces) {
+ maxDecimalPlaces_ = maxDecimalPlaces;
+ }
+
+ /*!@name Implementation of Handler
+ \see Handler
+ */
+ //@{
+
+ bool Null() { Prefix(kNullType); return WriteNull(); }
+ bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return WriteBool(b); }
+ bool Int(int i) { Prefix(kNumberType); return WriteInt(i); }
+ bool Uint(unsigned u) { Prefix(kNumberType); return WriteUint(u); }
+ bool Int64(int64_t i64) { Prefix(kNumberType); return WriteInt64(i64); }
+ bool Uint64(uint64_t u64) { Prefix(kNumberType); return WriteUint64(u64); }
+
+ //! Writes the given \c double value to the stream
+ /*!
+ \param d The value to be written.
+ \return Whether it is succeed.
+ */
+ bool Double(double d) { Prefix(kNumberType); return WriteDouble(d); }
+
+ bool String(const Ch* str, SizeType length, bool copy = false) {
+ (void)copy;
+ Prefix(kStringType);
+ return WriteString(str, length);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ bool String(const std::basic_string<Ch>& str) {
+ return String(str.data(), SizeType(str.size()));
+ }
+#endif
+
+ bool StartObject() {
+ Prefix(kObjectType);
+ new (level_stack_.template Push<Level>()) Level(false);
+ return WriteStartObject();
+ }
+
+ bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }
+
+ bool EndObject(SizeType memberCount = 0) {
+ (void)memberCount;
+ RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));
+ RAPIDJSON_ASSERT(!level_stack_.template Top<Level>()->inArray);
+ level_stack_.template Pop<Level>(1);
+ bool ret = WriteEndObject();
+ if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text
+ os_->Flush();
+ return ret;
+ }
+
+ bool StartArray() {
+ Prefix(kArrayType);
+ new (level_stack_.template Push<Level>()) Level(true);
+ return WriteStartArray();
+ }
+
+ bool EndArray(SizeType elementCount = 0) {
+ (void)elementCount;
+ RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));
+ RAPIDJSON_ASSERT(level_stack_.template Top<Level>()->inArray);
+ level_stack_.template Pop<Level>(1);
+ bool ret = WriteEndArray();
+ if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text
+ os_->Flush();
+ return ret;
+ }
+ //@}
+
+ /*! @name Convenience extensions */
+ //@{
+
+ //! Simpler but slower overload.
+ bool String(const Ch* str) { return String(str, internal::StrLen(str)); }
+ bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }
+
+ //@}
+
+ //! Write a raw JSON value.
+ /*!
+ For user to write a stringified JSON as a value.
+
+ \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
+ \param length Length of the json.
+ \param type Type of the root of json.
+ */
+ bool RawValue(const Ch* json, size_t length, Type type) { Prefix(type); return WriteRawValue(json, length); }
+
+protected:
+ //! Information for each nested level
+ struct Level {
+ Level(bool inArray_) : valueCount(0), inArray(inArray_) {}
+ size_t valueCount; //!< number of values in this level
+ bool inArray; //!< true if in array, otherwise in object
+ };
+
+ static const size_t kDefaultLevelDepth = 32;
+
+ bool WriteNull() {
+ PutReserve(*os_, 4);
+ PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true;
+ }
+
+ bool WriteBool(bool b) {
+ if (b) {
+ PutReserve(*os_, 4);
+ PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e');
+ }
+ else {
+ PutReserve(*os_, 5);
+ PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e');
+ }
+ return true;
+ }
+
+ bool WriteInt(int i) {
+ char buffer[11];
+ const char* end = internal::i32toa(i, buffer);
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
+ for (const char* p = buffer; p != end; ++p)
+ PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+ return true;
+ }
+
+ bool WriteUint(unsigned u) {
+ char buffer[10];
+ const char* end = internal::u32toa(u, buffer);
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
+ for (const char* p = buffer; p != end; ++p)
+ PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+ return true;
+ }
+
+ bool WriteInt64(int64_t i64) {
+ char buffer[21];
+ const char* end = internal::i64toa(i64, buffer);
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
+ for (const char* p = buffer; p != end; ++p)
+ PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+ return true;
+ }
+
+ bool WriteUint64(uint64_t u64) {
+ char buffer[20];
+ char* end = internal::u64toa(u64, buffer);
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
+ for (char* p = buffer; p != end; ++p)
+ PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+ return true;
+ }
+
+ bool WriteDouble(double d) {
+ if (internal::Double(d).IsNanOrInf())
+ return false;
+
+ char buffer[25];
+ char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
+ PutReserve(*os_, static_cast<size_t>(end - buffer));
+ for (char* p = buffer; p != end; ++p)
+ PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(*p));
+ return true;
+ }
+
+ bool WriteString(const Ch* str, SizeType length) {
+ static const typename TargetEncoding::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ static const char escape[256] = {
+#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ //0 1 2 3 4 5 6 7 8 9 A B C D E F
+ 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00
+ 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10
+ 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20
+ Z16, Z16, // 30~4F
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50
+ Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF
+#undef Z16
+ };
+
+ if (TargetEncoding::supportUnicode)
+ PutReserve(*os_, 2 + length * 6); // "\uxxxx..."
+ else
+ PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..."
+
+ PutUnsafe(*os_, '\"');
+ GenericStringStream<SourceEncoding> is(str);
+ while (ScanWriteUnescapedString(is, length)) {
+ const Ch c = is.Peek();
+ if (!TargetEncoding::supportUnicode && static_cast<unsigned>(c) >= 0x80) {
+ // Unicode escaping
+ unsigned codepoint;
+ if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint)))
+ return false;
+ PutUnsafe(*os_, '\\');
+ PutUnsafe(*os_, 'u');
+ if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) {
+ PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]);
+ PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]);
+ PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]);
+ PutUnsafe(*os_, hexDigits[(codepoint ) & 15]);
+ }
+ else {
+ RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF);
+ // Surrogate pair
+ unsigned s = codepoint - 0x010000;
+ unsigned lead = (s >> 10) + 0xD800;
+ unsigned trail = (s & 0x3FF) + 0xDC00;
+ PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]);
+ PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]);
+ PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]);
+ PutUnsafe(*os_, hexDigits[(lead ) & 15]);
+ PutUnsafe(*os_, '\\');
+ PutUnsafe(*os_, 'u');
+ PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]);
+ PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]);
+ PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]);
+ PutUnsafe(*os_, hexDigits[(trail ) & 15]);
+ }
+ }
+ else if ((sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast<unsigned char>(c)])) {
+ is.Take();
+ PutUnsafe(*os_, '\\');
+ PutUnsafe(*os_, static_cast<typename TargetEncoding::Ch>(escape[static_cast<unsigned char>(c)]));
+ if (escape[static_cast<unsigned char>(c)] == 'u') {
+ PutUnsafe(*os_, '0');
+ PutUnsafe(*os_, '0');
+ PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) >> 4]);
+ PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) & 0xF]);
+ }
+ }
+ else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ?
+ Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
+ Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
+ return false;
+ }
+ PutUnsafe(*os_, '\"');
+ return true;
+ }
+
+ bool ScanWriteUnescapedString(GenericStringStream<SourceEncoding>& is, size_t length) {
+ return RAPIDJSON_LIKELY(is.Tell() < length);
+ }
+
+ bool WriteStartObject() { os_->Put('{'); return true; }
+ bool WriteEndObject() { os_->Put('}'); return true; }
+ bool WriteStartArray() { os_->Put('['); return true; }
+ bool WriteEndArray() { os_->Put(']'); return true; }
+
+ bool WriteRawValue(const Ch* json, size_t length) {
+ PutReserve(*os_, length);
+ for (size_t i = 0; i < length; i++) {
+ RAPIDJSON_ASSERT(json[i] != '\0');
+ PutUnsafe(*os_, json[i]);
+ }
+ return true;
+ }
+
+ void Prefix(Type type) {
+ (void)type;
+ if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root
+ Level* level = level_stack_.template Top<Level>();
+ if (level->valueCount > 0) {
+ if (level->inArray)
+ os_->Put(','); // add comma if it is not the first element in array
+ else // in object
+ os_->Put((level->valueCount % 2 == 0) ? ',' : ':');
+ }
+ if (!level->inArray && level->valueCount % 2 == 0)
+ RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name
+ level->valueCount++;
+ }
+ else {
+ RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root.
+ hasRoot_ = true;
+ }
+ }
+
+ OutputStream* os_;
+ internal::Stack<StackAllocator> level_stack_;
+ int maxDecimalPlaces_;
+ bool hasRoot_;
+
+private:
+ // Prohibit copy constructor & assignment operator.
+ Writer(const Writer&);
+ Writer& operator=(const Writer&);
+};
+
+// Full specialization for StringStream to prevent memory copying
+
+template<>
+inline bool Writer<StringBuffer>::WriteInt(int i) {
+ char *buffer = os_->Push(11);
+ const char* end = internal::i32toa(i, buffer);
+ os_->Pop(static_cast<size_t>(11 - (end - buffer)));
+ return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteUint(unsigned u) {
+ char *buffer = os_->Push(10);
+ const char* end = internal::u32toa(u, buffer);
+ os_->Pop(static_cast<size_t>(10 - (end - buffer)));
+ return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteInt64(int64_t i64) {
+ char *buffer = os_->Push(21);
+ const char* end = internal::i64toa(i64, buffer);
+ os_->Pop(static_cast<size_t>(21 - (end - buffer)));
+ return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteUint64(uint64_t u) {
+ char *buffer = os_->Push(20);
+ const char* end = internal::u64toa(u, buffer);
+ os_->Pop(static_cast<size_t>(20 - (end - buffer)));
+ return true;
+}
+
+template<>
+inline bool Writer<StringBuffer>::WriteDouble(double d) {
+ if (internal::Double(d).IsNanOrInf())
+ return false;
+
+ char *buffer = os_->Push(25);
+ char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
+ os_->Pop(static_cast<size_t>(25 - (end - buffer)));
+ return true;
+}
+
+#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
+template<>
+inline bool Writer<StringBuffer>::ScanWriteUnescapedString(StringStream& is, size_t length) {
+ if (length < 16)
+ return RAPIDJSON_LIKELY(is.Tell() < length);
+
+ if (!RAPIDJSON_LIKELY(is.Tell() < length))
+ return false;
+
+ const char* p = is.src_;
+ const char* end = is.head_ + length;
+ const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
+ const char* endAligned = reinterpret_cast<const char*>(reinterpret_cast<size_t>(end) & static_cast<size_t>(~15));
+ if (nextAligned > end)
+ return true;
+
+ while (p != nextAligned)
+ if (*p < 0x20 || *p == '\"' || *p == '\\') {
+ is.src_ = p;
+ return RAPIDJSON_LIKELY(is.Tell() < length);
+ }
+ else
+ os_->PutUnsafe(*p++);
+
+ // The rest of string using SIMD
+ static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
+ static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
+ static const char space[16] = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 };
+ const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
+ const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
+ const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
+
+ for (; p != endAligned; p += 16) {
+ const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
+ const __m128i t1 = _mm_cmpeq_epi8(s, dq);
+ const __m128i t2 = _mm_cmpeq_epi8(s, bs);
+ const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x19) == 0x19
+ const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
+ unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
+ if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
+ SizeType len;
+#ifdef _MSC_VER // Find the index of first escaped
+ unsigned long offset;
+ _BitScanForward(&offset, r);
+ len = offset;
+#else
+ len = static_cast<SizeType>(__builtin_ffs(r) - 1);
+#endif
+ char* q = reinterpret_cast<char*>(os_->PushUnsafe(len));
+ for (size_t i = 0; i < len; i++)
+ q[i] = p[i];
+
+ p += len;
+ break;
+ }
+ _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s);
+ }
+
+ is.src_ = p;
+ return RAPIDJSON_LIKELY(is.Tell() < length);
+}
+#endif // defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
+
+RAPIDJSON_NAMESPACE_END
+
+#ifdef _MSC_VER
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
+
+#endif // RAPIDJSON_RAPIDJSON_H_
diff --git a/3rdparty/rapidjson/library.json b/3rdparty/rapidjson/library.json
new file mode 100644
index 00000000000..47fd352ac7e
--- /dev/null
+++ b/3rdparty/rapidjson/library.json
@@ -0,0 +1,12 @@
+{
+ "name": "RapidJSON",
+ "keywords": "json, sax, dom, parser, generator",
+ "description": "A fast JSON parser/generator for C++ with both SAX/DOM style API",
+ "include": "include",
+ "examples": "example/*/*.cpp",
+ "repository":
+ {
+ "type": "git",
+ "url": "https://github.com/miloyip/rapidjson"
+ }
+}
diff --git a/3rdparty/rapidjson/license.txt b/3rdparty/rapidjson/license.txt
new file mode 100644
index 00000000000..7ccc161c84b
--- /dev/null
+++ b/3rdparty/rapidjson/license.txt
@@ -0,0 +1,57 @@
+Tencent is pleased to support the open source community by making RapidJSON available.
+
+Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+
+If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License.
+If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. To avoid the problematic JSON license in your own projects, it's sufficient to exclude the bin/jsonchecker/ directory, as it's the only code under the JSON license.
+A copy of the MIT License is included in this file.
+
+Other dependencies and licenses:
+
+Open Source Software Licensed Under the BSD License:
+--------------------------------------------------------------------
+
+The msinttypes r29
+Copyright (c) 2006-2013 Alexander Chemeris
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+* Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Open Source Software Licensed Under the JSON License:
+--------------------------------------------------------------------
+
+json.org
+Copyright (c) 2002 JSON.org
+All Rights Reserved.
+
+JSON_checker
+Copyright (c) 2002 JSON.org
+All Rights Reserved.
+
+
+Terms of the JSON License:
+---------------------------------------------------
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+Terms of the MIT License:
+--------------------------------------------------------------------
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/3rdparty/rapidjson/rapidjson.autopkg b/3rdparty/rapidjson/rapidjson.autopkg
new file mode 100644
index 00000000000..d91aaeff681
--- /dev/null
+++ b/3rdparty/rapidjson/rapidjson.autopkg
@@ -0,0 +1,75 @@
+nuget {
+ //Usage: Write-NuGetPackage rapidjson.autopkg -defines:MYVERSION=1.0.2
+ //Be sure you are running Powershell 3.0 and have the CoApp powershell extensions installed properly.
+ nuspec {
+ id = rapidjson;
+ version : ${MYVERSION};
+ title: "rapidjson";
+ authors: {"https://github.com/miloyip/rapidjson/releases/tag/v1.0.2"};
+ owners: {"@lsantos (github)"};
+ licenseUrl: "https://github.com/miloyip/rapidjson/blob/master/license.txt";
+ projectUrl: "https://github.com/miloyip/rapidjson/";
+ iconUrl: "https://cdn1.iconfinder.com/data/icons/fatcow/32x32/json.png";
+ requireLicenseAcceptance:false;
+ summary: @"A fast JSON parser/generator for C++ with both SAX/DOM style API";
+
+ // if you need to span several lines you can prefix a string with an @ symbol (exactly like c# does).
+ description: @"Rapidjson is an attempt to create the fastest JSON parser and generator.
+
+ - Small but complete. Supports both SAX and DOM style API. SAX parser only a few hundred lines of code.
+ - Fast. In the order of magnitude of strlen(). Optionally supports SSE2/SSE4.2 for acceleration.
+ - Self-contained. Minimal dependency on standard libraries. No BOOST, not even STL.
+ - Compact. Each JSON value is 16 or 20 bytes for 32 or 64-bit machines respectively (excluding text string storage). With the custom memory allocator, parser allocates memory compactly during parsing.
+ - Full RFC4627 compliance. Supports UTF-8, UTF-16 and UTF-32.
+ - Support both in-situ parsing (directly decode strings into the source JSON text) and non-destructive parsing (decode strings into new buffers).
+ - Parse number to int/unsigned/int64_t/uint64_t/double depending on input
+ - Support custom memory allocation. Also, the default memory pool allocator can also be supplied with a user buffer (such as a buffer allocated on user's heap or - programme stack) to minimize allocation.
+
+ As the name implies, rapidjson is inspired by rapidxml.";
+
+ releaseNotes: @"
+Added
+ Add Value::XXXMember(...) overloads for std::string (#335)
+
+Fixed
+ Include rapidjson.h for all internal/error headers.
+ Parsing some numbers incorrectly in full-precision mode (kFullPrecisionParseFlag) (#342)
+ Fix alignment of 64bit platforms (#328)
+ Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502)
+
+Changed
+ CMakeLists for include as a thirdparty in projects (#334, #337)
+ Change Document::ParseStream() to use stack allocator for Reader (ffbe386)";
+
+ copyright: "Copyright 2015";
+ tags: { native, coapp, JSON, nativepackage };
+ language: en-US;
+ };
+
+ dependencies {
+ packages : {
+ //TODO: Add dependecies here in [pkg.name]/[version] form per newline
+ //zlib/[1.2.8],
+ };
+ }
+
+ // the files that go into the content folders
+ files {
+ #defines {
+ SDK_ROOT = .\;
+ }
+
+ // grab all the files in the include folder
+ // the folder that contains all the .h files will
+ // automatically get added to the Includes path.
+ nestedinclude += {
+ #destination = ${d_include}rapidjson;
+ "${SDK_ROOT}include\rapidjson\**\*.h"
+ };
+ };
+
+ targets {
+ // We're trying to be standard about these sorts of thing. (Will help with config.h later :D)
+ //Defines += HAS_EQCORE;
+ };
+} \ No newline at end of file
diff --git a/3rdparty/rapidjson/readme.md b/3rdparty/rapidjson/readme.md
new file mode 100644
index 00000000000..9a3d6a7b5be
--- /dev/null
+++ b/3rdparty/rapidjson/readme.md
@@ -0,0 +1,129 @@
+![](doc/logo/rapidjson.png)
+
+![](https://img.shields.io/badge/release-v1.0.2-blue.png)
+
+## A fast JSON parser/generator for C++ with both SAX/DOM style API
+
+Tencent is pleased to support the open source community by making RapidJSON available.
+
+Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+
+* [RapidJSON GitHub](https://github.com/miloyip/rapidjson/)
+* RapidJSON Documentation
+ * [English](http://rapidjson.org/)
+ * [简体中文](http://rapidjson.org/zh-cn/)
+ * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/) with downloadable PDF/EPUB/MOBI, without API reference.
+
+## Build status
+
+| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |
+| :---------------: | :-----------------: | :-------------------: |
+| ![lin-badge] | ![win-badge] | ![cov-badge] |
+
+[lin-badge]: https://travis-ci.org/miloyip/rapidjson.png?branch=master "Travis build status"
+[lin-link]: https://travis-ci.org/miloyip/rapidjson "Travis build status"
+[win-badge]: https://ci.appveyor.com/api/projects/status/u658dcuwxo14a8m9/branch/master "AppVeyor build status"
+[win-link]: https://ci.appveyor.com/project/miloyip/rapidjson/branch/master "AppVeyor build status"
+[cov-badge]: https://coveralls.io/repos/miloyip/rapidjson/badge.png?branch=master
+[cov-link]: https://coveralls.io/r/miloyip/rapidjson?branch=master
+
+## Introduction
+
+RapidJSON is a JSON parser and generator for C++. It was inspired by [RapidXml](http://rapidxml.sourceforge.net/).
+
+* RapidJSON is **small** but **complete**. It supports both SAX and DOM style API. The SAX parser is only a half thousand lines of code.
+
+* RapidJSON is **fast**. Its performance can be comparable to `strlen()`. It also optionally supports SSE2/SSE4.2 for acceleration.
+
+* RapidJSON is **self-contained** and **header-only**. It does not depend on external libraries such as BOOST. It even does not depend on STL.
+
+* RapidJSON is **memory-friendly**. Each JSON value occupies exactly 16/20 bytes for most 32/64-bit machines (excluding text string). By default it uses a fast memory allocator, and the parser allocates memory compactly during parsing.
+
+* RapidJSON is **Unicode-friendly**. It supports UTF-8, UTF-16, UTF-32 (LE & BE), and their detection, validation and transcoding internally. For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM. It also supports surrogates and "\u0000" (null character).
+
+More features can be read [here](doc/features.md).
+
+JSON(JavaScript Object Notation) is a light-weight data exchange format. RapidJSON should be in fully compliance with RFC7159/ECMA-404. More information about JSON can be obtained at
+* [Introducing JSON](http://json.org/)
+* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](http://www.ietf.org/rfc/rfc7159.txt)
+* [Standard ECMA-404: The JSON Data Interchange Format](http://www.ecma-international.org/publications/standards/Ecma-404.htm)
+
+## Compatibility
+
+RapidJSON is cross-platform. Some platform/compiler combinations which have been tested are shown as follows.
+* Visual C++ 2008/2010/2013 on Windows (32/64-bit)
+* GNU C++ 3.8.x on Cygwin
+* Clang 3.4 on Mac OS X (32/64-bit) and iOS
+* Clang 3.4 on Android NDK
+
+Users can build and run the unit tests on their platform/compiler.
+
+## Installation
+
+RapidJSON is a header-only C++ library. Just copy the `include/rapidjson` folder to system or project's include path.
+
+RapidJSON uses following software as its dependencies:
+* [CMake](https://cmake.org/) as a general build tool
+* (optional)[Doxygen](http://www.doxygen.org) to build documentation
+* (optional)[googletest](https://github.com/google/googletest) for unit and performance testing
+
+To generate user documentation and run tests please proceed with the steps below:
+
+1. Execute `git submodule update --init` to get the files of thirdparty submodules (google test).
+2. Create directory called `build` in rapidjson source directory.
+3. Change to `build` directory and run `cmake ..` command to configure your build. Windows users can do the same with cmake-gui application.
+4. On Windows, build the solution found in the build directory. On Linux, run `make` from the build directory.
+
+On successfull build you will find compiled test and example binaries in `bin`
+directory. The generated documentation will be available in `doc/html`
+directory of the build tree. To run tests after finished build please run `make
+test` or `ctest` from your build tree. You can get detailed output using `ctest
+-V` command.
+
+It is possible to install library system-wide by running `make install` command
+from the build tree with administrative privileges. This will install all files
+according to system preferences. Once RapidJSON is installed, it is possible
+to use it from other CMake projects by adding `find_package(RapidJSON)` line to
+your CMakeLists.txt.
+
+## Usage at a glance
+
+This simple example parses a JSON string into a document (DOM), make a simple modification of the DOM, and finally stringify the DOM to a JSON string.
+
+~~~~~~~~~~cpp
+// rapidjson/example/simpledom/simpledom.cpp`
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+
+int main() {
+ // 1. Parse a JSON string into DOM.
+ const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
+ Document d;
+ d.Parse(json);
+
+ // 2. Modify it by DOM.
+ Value& s = d["stars"];
+ s.SetInt(s.GetInt() + 1);
+
+ // 3. Stringify the DOM
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ d.Accept(writer);
+
+ // Output {"project":"rapidjson","stars":11}
+ std::cout << buffer.GetString() << std::endl;
+ return 0;
+}
+~~~~~~~~~~
+
+Note that this example did not handle potential errors.
+
+The following diagram shows the process.
+
+![simpledom](doc/diagram/simpledom.png)
+
+More [examples](https://github.com/miloyip/rapidjson/tree/master/example) are available.
diff --git a/3rdparty/rapidjson/readme.zh-cn.md b/3rdparty/rapidjson/readme.zh-cn.md
new file mode 100644
index 00000000000..5124f8eedef
--- /dev/null
+++ b/3rdparty/rapidjson/readme.zh-cn.md
@@ -0,0 +1,121 @@
+![](doc/logo/rapidjson.png)
+
+![](https://img.shields.io/badge/release-v1.0.2-blue.png)
+
+## 高效的C++ JSONè§£æžï¼ç”Ÿæˆå™¨ï¼Œæä¾›SAXåŠDOM风格API
+
+Tencent is pleased to support the open source community by making RapidJSON available.
+
+Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+
+* [RapidJSON GitHub](https://github.com/miloyip/rapidjson/)
+* RapidJSON 文档
+ * [English](http://rapidjson.org/)
+ * [简体中文](http://rapidjson.org/zh-cn/)
+ * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/)å¯ä¸‹è½½PDF/EPUB/MOBI,但ä¸å«APIå‚考手册。
+
+## Build 状æ€
+
+| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |
+| :---------------: | :-----------------: | :-------------------: |
+| ![lin-badge] | ![win-badge] | ![cov-badge] |
+
+[lin-badge]: https://travis-ci.org/miloyip/rapidjson.png?branch=master "Travis build status"
+[lin-link]: https://travis-ci.org/miloyip/rapidjson "Travis build status"
+[win-badge]: https://ci.appveyor.com/api/projects/status/u658dcuwxo14a8m9/branch/master "AppVeyor build status"
+[win-link]: https://ci.appveyor.com/project/miloyip/rapidjson/branch/master "AppVeyor build status"
+[cov-badge]: https://coveralls.io/repos/miloyip/rapidjson/badge.png?branch=master
+[cov-link]: https://coveralls.io/r/miloyip/rapidjson?branch=master
+
+## 简介
+
+RapidJSON是一个C++çš„JSONè§£æžå™¨åŠç”Ÿæˆå™¨ã€‚å®ƒçš„çµæ„Ÿæ¥è‡ª[RapidXml](http://rapidxml.sourceforge.net/)。
+
+* RapidJSONå°è€Œå…¨ã€‚å®ƒåŒæ—¶æ”¯æŒSAXå’ŒDOM风格的API。SAXè§£æžå™¨åªæœ‰çº¦500行代ç ã€‚
+
+* RapidJSON快。它的性能å¯ä¸Ž`strlen()`ç›¸æ¯”ã€‚å¯æ”¯æŒSSE2/SSE4.2加速。
+
+* RapidJSON独立。它ä¸ä¾èµ–于BOOST等外部库。它甚至ä¸ä¾èµ–于STL。
+
+* RapidJSON对内存å‹å¥½ã€‚在大部分32/64使œºå™¨ä¸Šï¼Œæ¯ä¸ªJSON值åªå 16或20字节(除字符串外)。它预设使用一个快速的内存分é…器,令分æžå™¨å¯ä»¥ç´§å‡‘地分é…内存。
+
+* RapidJSON对Unicodeå‹å¥½ã€‚它支æŒUTF-8ã€UTF-16ã€UTF-32 (大端åºï¼å°ç«¯åº),并内部支æŒè¿™äº›ç¼–ç çš„æ£€æµ‹ã€æ ¡éªŒåŠè½¬ç ã€‚例如,RapidJSONå¯ä»¥åœ¨åˆ†æžä¸€ä¸ªUTF-8文件至DOM时,把当中的JSON字符串转ç è‡³UTF-16。它也支æŒä»£ç†å¯¹ï¼ˆsurrogate pair)åŠ`"\u0000"`(空字符)。
+
+在[这里](doc/features.md)å¯è¯»å–更多特点。
+
+JSON(JavaScript Object Notation)是一个轻é‡çš„æ•°æ®äº¤æ¢æ ¼å¼ã€‚RapidJSON应该完全éµä»ŽRFC7159/ECMA-404。 关于JSON的更多信æ¯å¯å‚考:
+* [Introducing JSON](http://json.org/)
+* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](http://www.ietf.org/rfc/rfc7159.txt)
+* [Standard ECMA-404: The JSON Data Interchange Format](http://www.ecma-international.org/publications/standards/Ecma-404.htm)
+
+## 兼容性
+
+RapidJSON是跨平å°çš„。以下是一些曾测试的平å°ï¼ç¼–译器组åˆï¼š
+* Visual C++ 2008/2010/2013 在 Windows (32/64-bit)
+* GNU C++ 3.8.x 在 Cygwin
+* Clang 3.4 在 Mac OS X (32/64-bit) åŠ iOS
+* Clang 3.4 在 Android NDK
+
+用户也å¯ä»¥åœ¨ä»–们的平å°ä¸Šç”ŸæˆåŠæ‰§è¡Œå•元测试。
+
+## 安装
+
+RapidJSONæ˜¯åªæœ‰å¤´æ–‡ä»¶çš„C++库。åªéœ€æŠŠ`include/rapidjson`目录å¤åˆ¶è‡³ç³»ç»Ÿæˆ–项目的include目录中。
+
+RapidJSONä¾èµ–于以下软件:
+* [CMake](http://www.cmake.org) 作为通用生æˆå·¥å…·
+* (optional)[Doxygen](http://www.doxygen.org)ç”¨äºŽç”Ÿæˆæ–‡æ¡£
+* (optional)[googletest](https://code.google.com/p/googletest/)用于å•å…ƒåŠæ€§èƒ½æµ‹è¯•
+
+ç”Ÿæˆæµ‹è¯•åŠä¾‹å­çš„æ­¥éª¤ï¼š
+
+1. 执行 `git submodule update --init` åŽ»èŽ·å– thirdparty submodules (google test)。
+2. 在rapidjson目渌下,建立一个`build`目录。
+3. 在`build`目录下执行`cmake ..`命令以设置生æˆã€‚Windows用户å¯ä½¿ç”¨cmake-gui应用程åºã€‚
+4. 在Windows下,编译生æˆåœ¨build目录中的solution。在Linux下,于build目录è¿è¡Œ`make`。
+
+æˆåŠŸç”ŸæˆåŽï¼Œä½ ä¼šåœ¨`bin`的目录下找到编译åŽçš„æµ‹è¯•åŠä¾‹å­å¯æ‰§è¡Œæ–‡ä»¶ã€‚而生æˆçš„æ–‡æ¡£å°†ä½äºŽbuild下的`doc/html`ç›®å½•ã€‚è¦æ‰§è¡Œæµ‹è¯•,请在build下执行`make test`或`ctest`。使用`ctest -V`命令å¯èŽ·å–详细的输出。
+
+我们也å¯ä»¥æŠŠç¨‹åºåº“安装至全系统中,åªè¦åœ¨å…·ç®¡ç†æ¬Šé™ä¸‹ä»Žbuild目录执行`make install`命令。这样会按系统的å好设置安装所有文件。当安装RapidJSONåŽï¼Œå…¶ä»–çš„CMake项目需è¦ä½¿ç”¨å®ƒæ—¶ï¼Œå¯ä»¥é€šè¿‡åœ¨`CMakeLists.txt`加入一å¥`find_package(RapidJSON)`。
+
+## 用法一览
+
+此简å•例å­è§£æžä¸€ä¸ªJSON字符串至一个document (DOM),对DOM作出简å•修改,最终把DOM转æ¢ï¼ˆstringify)至JSON字符串。
+
+~~~~~~~~~~cpp
+// rapidjson/example/simpledom/simpledom.cpp`
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+#include <iostream>
+
+using namespace rapidjson;
+
+int main() {
+ // 1. 把JSONè§£æžè‡³DOM。
+ const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
+ Document d;
+ d.Parse(json);
+
+ // 2. 利用DOM作出修改。
+ Value& s = d["stars"];
+ s.SetInt(s.GetInt() + 1);
+
+ // 3. 把DOM转æ¢ï¼ˆstringify)æˆJSON。
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ d.Accept(writer);
+
+ // Output {"project":"rapidjson","stars":11}
+ std::cout << buffer.GetString() << std::endl;
+ return 0;
+}
+~~~~~~~~~~
+
+æ³¨æ„æ­¤ä¾‹å­å¹¶æ²¡æœ‰å¤„ç†æ½œåœ¨é”™è¯¯ã€‚
+
+下图展示执行过程。
+
+![simpledom](doc/diagram/simpledom.png)
+
+还有许多[例å­](https://github.com/miloyip/rapidjson/tree/master/example)å¯ä¾›å‚考。
diff --git a/3rdparty/rapidjson/test/CMakeLists.txt b/3rdparty/rapidjson/test/CMakeLists.txt
new file mode 100644
index 00000000000..11c1b04c7d1
--- /dev/null
+++ b/3rdparty/rapidjson/test/CMakeLists.txt
@@ -0,0 +1,20 @@
+find_package(GTestSrc)
+
+IF(GTESTSRC_FOUND)
+ enable_testing()
+
+ if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW))
+ set(gtest_disable_pthreads ON)
+ set(gtest_force_shared_crt ON)
+ endif()
+
+ add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest)
+ include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
+
+ set(TEST_LIBRARIES gtest gtest_main)
+
+ add_custom_target(tests ALL)
+ add_subdirectory(perftest)
+ add_subdirectory(unittest)
+
+ENDIF(GTESTSRC_FOUND)
diff --git a/3rdparty/rapidjson/test/perftest/CMakeLists.txt b/3rdparty/rapidjson/test/perftest/CMakeLists.txt
new file mode 100644
index 00000000000..c88cf707451
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(PERFTEST_SOURCES
+ misctest.cpp
+ perftest.cpp
+ platformtest.cpp
+ rapidjsontest.cpp
+ schematest.cpp)
+
+add_executable(perftest ${PERFTEST_SOURCES})
+target_link_libraries(perftest ${TEST_LIBRARIES})
+
+add_dependencies(tests perftest)
+
+IF(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug"))
+add_test(NAME perftest
+ COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
+ENDIF()
diff --git a/3rdparty/rapidjson/test/perftest/misctest.cpp b/3rdparty/rapidjson/test/perftest/misctest.cpp
new file mode 100644
index 00000000000..aac84778429
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/misctest.cpp
@@ -0,0 +1,974 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "perftest.h"
+
+#if TEST_MISC
+
+#define __STDC_FORMAT_MACROS
+#include "rapidjson/stringbuffer.h"
+
+#define protected public
+#include "rapidjson/writer.h"
+#undef private
+
+class Misc : public PerfTest {
+};
+
+// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
+// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
+
+#define UTF8_ACCEPT 0
+#define UTF8_REJECT 12
+
+static const unsigned char utf8d[] = {
+ // The first part of the table maps bytes to character classes that
+ // to reduce the size of the transition table and create bitmasks.
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
+
+ // The second part is a transition table that maps a combination
+ // of a state of the automaton and a character class to a state.
+ 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
+ 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
+ 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
+ 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
+ 12,36,12,12,12,12,12,12,12,12,12,12,
+};
+
+static unsigned inline decode(unsigned* state, unsigned* codep, unsigned byte) {
+ unsigned type = utf8d[byte];
+
+ *codep = (*state != UTF8_ACCEPT) ?
+ (byte & 0x3fu) | (*codep << 6) :
+ (0xff >> type) & (byte);
+
+ *state = utf8d[256 + *state + type];
+ return *state;
+}
+
+static bool IsUTF8(unsigned char* s) {
+ unsigned codepoint, state = 0;
+
+ while (*s)
+ decode(&state, &codepoint, *s++);
+
+ return state == UTF8_ACCEPT;
+}
+
+TEST_F(Misc, Hoehrmann_IsUTF8) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ EXPECT_TRUE(IsUTF8((unsigned char*)json_));
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// CountDecimalDigit: Count number of decimal places
+
+inline unsigned CountDecimalDigit_naive(unsigned n) {
+ unsigned count = 1;
+ while (n >= 10) {
+ n /= 10;
+ count++;
+ }
+ return count;
+}
+
+inline unsigned CountDecimalDigit_enroll4(unsigned n) {
+ unsigned count = 1;
+ while (n >= 10000) {
+ n /= 10000u;
+ count += 4;
+ }
+ if (n < 10) return count;
+ if (n < 100) return count + 1;
+ if (n < 1000) return count + 2;
+ return count + 3;
+}
+
+inline unsigned CountDecimalDigit64_enroll4(uint64_t n) {
+ unsigned count = 1;
+ while (n >= 10000) {
+ n /= 10000u;
+ count += 4;
+ }
+ if (n < 10) return count;
+ if (n < 100) return count + 1;
+ if (n < 1000) return count + 2;
+ return count + 3;
+}
+
+inline unsigned CountDecimalDigit_fast(unsigned n) {
+ static const uint32_t powers_of_10[] = {
+ 0,
+ 10,
+ 100,
+ 1000,
+ 10000,
+ 100000,
+ 1000000,
+ 10000000,
+ 100000000,
+ 1000000000
+ };
+
+#if defined(_M_IX86) || defined(_M_X64)
+ unsigned long i = 0;
+ _BitScanReverse(&i, n | 1);
+ uint32_t t = (i + 1) * 1233 >> 12;
+#elif defined(__GNUC__)
+ uint32_t t = (32 - __builtin_clz(n | 1)) * 1233 >> 12;
+#else
+#error
+#endif
+ return t - (n < powers_of_10[t]) + 1;
+}
+
+inline unsigned CountDecimalDigit64_fast(uint64_t n) {
+ static const uint64_t powers_of_10[] = {
+ 0,
+ 10,
+ 100,
+ 1000,
+ 10000,
+ 100000,
+ 1000000,
+ 10000000,
+ 100000000,
+ 1000000000,
+ 10000000000,
+ 100000000000,
+ 1000000000000,
+ 10000000000000,
+ 100000000000000,
+ 1000000000000000,
+ 10000000000000000,
+ 100000000000000000,
+ 1000000000000000000,
+ 10000000000000000000U
+ };
+
+#if defined(_M_IX86)
+ uint64_t m = n | 1;
+ unsigned long i = 0;
+ if (_BitScanReverse(&i, m >> 32))
+ i += 32;
+ else
+ _BitScanReverse(&i, m & 0xFFFFFFFF);
+ uint32_t t = (i + 1) * 1233 >> 12;
+#elif defined(_M_X64)
+ unsigned long i = 0;
+ _BitScanReverse64(&i, n | 1);
+ uint32_t t = (i + 1) * 1233 >> 12;
+#elif defined(__GNUC__)
+ uint32_t t = (64 - __builtin_clzll(n | 1)) * 1233 >> 12;
+#else
+#error
+#endif
+
+ return t - (n < powers_of_10[t]) + 1;
+}
+
+#if 0
+// Exhaustive, very slow
+TEST_F(Misc, CountDecimalDigit_Verify) {
+ unsigned i = 0;
+ do {
+ if (i % (65536 * 256) == 0)
+ printf("%u\n", i);
+ ASSERT_EQ(CountDecimalDigit_enroll4(i), CountDecimalDigit_fast(i));
+ i++;
+ } while (i != 0);
+}
+
+static const unsigned kDigits10Trial = 1000000000u;
+TEST_F(Misc, CountDecimalDigit_naive) {
+ unsigned sum = 0;
+ for (unsigned i = 0; i < kDigits10Trial; i++)
+ sum += CountDecimalDigit_naive(i);
+ printf("%u\n", sum);
+}
+
+TEST_F(Misc, CountDecimalDigit_enroll4) {
+ unsigned sum = 0;
+ for (unsigned i = 0; i < kDigits10Trial; i++)
+ sum += CountDecimalDigit_enroll4(i);
+ printf("%u\n", sum);
+}
+
+TEST_F(Misc, CountDecimalDigit_fast) {
+ unsigned sum = 0;
+ for (unsigned i = 0; i < kDigits10Trial; i++)
+ sum += CountDecimalDigit_fast(i);
+ printf("%u\n", sum);
+}
+#endif
+
+TEST_F(Misc, CountDecimalDigit64_VerifyFast) {
+ uint64_t i = 1, j;
+ do {
+ //printf("%" PRIu64 "\n", i);
+ ASSERT_EQ(CountDecimalDigit64_enroll4(i), CountDecimalDigit64_fast(i));
+ j = i;
+ i *= 3;
+ } while (j < i);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// integer-to-string conversion
+
+// https://gist.github.com/anonymous/7179097
+static const int randval[] ={
+ 936116, 369532, 453755, -72860, 209713, 268347, 435278, -360266, -416287, -182064,
+ -644712, 944969, 640463, -366588, 471577, -69401, -744294, -505829, 923883, 831785,
+ -601136, -636767, -437054, 591718, 100758, 231907, -719038, 973540, -605220, 506659,
+ -871653, 462533, 764843, -919138, 404305, -630931, -288711, -751454, -173726, -718208,
+ 432689, -281157, 360737, 659827, 19174, -376450, 769984, -858198, 439127, 734703,
+ -683426, 7, 386135, 186997, -643900, -744422, -604708, -629545, 42313, -933592,
+ -635566, 182308, 439024, -367219, -73924, -516649, 421935, -470515, 413507, -78952,
+ -427917, -561158, 737176, 94538, 572322, 405217, 709266, -357278, -908099, -425447,
+ 601119, 750712, -862285, -177869, 900102, 384877, 157859, -641680, 503738, -702558,
+ 278225, 463290, 268378, -212840, 580090, 347346, -473985, -950968, -114547, -839893,
+ -738032, -789424, 409540, 493495, 432099, 119755, 905004, -174834, 338266, 234298,
+ 74641, -965136, -754593, 685273, 466924, 920560, 385062, 796402, -67229, 994864,
+ 376974, 299869, -647540, -128724, 469890, -163167, -547803, -743363, 486463, -621028,
+ 612288, 27459, -514224, 126342, -66612, 803409, -777155, -336453, -284002, 472451,
+ 342390, -163630, 908356, -456147, -825607, 268092, -974715, 287227, 227890, -524101,
+ 616370, -782456, 922098, -624001, -813690, 171605, -192962, 796151, 707183, -95696,
+ -23163, -721260, 508892, 430715, 791331, 482048, -996102, 863274, 275406, -8279,
+ -556239, -902076, 268647, -818565, 260069, -798232, -172924, -566311, -806503, -885992,
+ 813969, -78468, 956632, 304288, 494867, -508784, 381751, 151264, 762953, 76352,
+ 594902, 375424, 271700, -743062, 390176, 924237, 772574, 676610, 435752, -153847,
+ 3959, -971937, -294181, -538049, -344620, -170136, 19120, -703157, 868152, -657961,
+ -818631, 219015, -872729, -940001, -956570, 880727, -345910, 942913, -942271, -788115,
+ 225294, 701108, -517736, -416071, 281940, 488730, 942698, 711494, 838382, -892302,
+ -533028, 103052, 528823, 901515, 949577, 159364, 718227, -241814, -733661, -462928,
+ -495829, 165170, 513580, -629188, -509571, -459083, 198437, 77198, -644612, 811276,
+ -422298, -860842, -52584, 920369, 686424, -530667, -243476, 49763, 345866, -411960,
+ -114863, 470810, -302860, 683007, -509080, 2, -174981, -772163, -48697, 447770,
+ -268246, 213268, 269215, 78810, -236340, -639140, -864323, 505113, -986569, -325215,
+ 541859, 163070, -819998, -645161, -583336, 573414, 696417, -132375, 3, -294501,
+ 320435, 682591, 840008, 351740, 426951, 609354, 898154, -943254, 227321, -859793,
+ -727993, 44137, -497965, -782239, 14955, -746080, -243366, 9837, -233083, 606507,
+ -995864, -615287, -994307, 602715, 770771, -315040, 610860, 446102, -307120, 710728,
+ -590392, -230474, -762625, -637525, 134963, -202700, -766902, -985541, 218163, 682009,
+ 926051, 525156, -61195, 403211, -810098, 245539, -431733, 179998, -806533, 745943,
+ 447597, 131973, -187130, 826019, 286107, -937230, -577419, 20254, 681802, -340500,
+ 323080, 266283, -667617, 309656, 416386, 611863, 759991, -534257, 523112, -634892,
+ -169913, -204905, -909867, -882185, -944908, 741811, -717675, 967007, -317396, 407230,
+ -412805, 792905, 994873, 744793, -456797, 713493, 355232, 116900, -945199, 880539,
+ 342505, -580824, -262273, 982968, -349497, -735488, 311767, -455191, 570918, 389734,
+ -958386, 10262, -99267, 155481, 304210, 204724, 704367, -144893, -233664, -671441,
+ 896849, 408613, 762236, 322697, 981321, 688476, 13663, -970704, -379507, 896412,
+ 977084, 348869, 875948, 341348, 318710, 512081, 6163, 669044, 833295, 811883,
+ 708756, -802534, -536057, 608413, -389625, -694603, 541106, -110037, 720322, -540581,
+ 645420, 32980, 62442, 510157, -981870, -87093, -325960, -500494, -718291, -67889,
+ 991501, 374804, 769026, -978869, 294747, 714623, 413327, -199164, 671368, 804789,
+ -362507, 798196, -170790, -568895, -869379, 62020, -316693, -837793, 644994, -39341,
+ -417504, -243068, -957756, 99072, 622234, -739992, 225668, 8863, -505910, 82483,
+ -559244, 241572, 1315, -36175, -54990, 376813, -11, 162647, -688204, -486163,
+ -54934, -197470, 744223, -762707, 732540, 996618, 351561, -445933, -898491, 486531,
+ 456151, 15276, 290186, -817110, -52995, 313046, -452533, -96267, 94470, -500176,
+ -818026, -398071, -810548, -143325, -819741, 1338, -897676, -101577, -855445, 37309,
+ 285742, 953804, -777927, -926962, -811217, -936744, -952245, -802300, -490188, -964953,
+ -552279, 329142, -570048, -505756, 682898, -381089, -14352, 175138, 152390, -582268,
+ -485137, 717035, 805329, 239572, -730409, 209643, -184403, -385864, 675086, 819648,
+ 629058, -527109, -488666, -171981, 532788, 552441, 174666, 984921, 766514, 758787,
+ 716309, 338801, -978004, -412163, 876079, -734212, 789557, -160491, -522719, 56644,
+ -991, -286038, -53983, 663740, 809812, 919889, -717502, -137704, 220511, 184396,
+ -825740, -588447, 430870, 124309, 135956, 558662, -307087, -788055, -451328, 812260,
+ 931601, 324347, -482989, -117858, -278861, 189068, -172774, 929057, 293787, 198161,
+ -342386, -47173, 906555, -759955, -12779, 777604, -97869, 899320, 927486, -25284,
+ -848550, 259450, -485856, -17820, 88, 171400, 235492, -326783, -340793, 886886,
+ 112428, -246280, 5979, 648444, -114982, 991013, -56489, -9497, 419706, 632820,
+ -341664, 393926, -848977, -22538, 257307, 773731, -905319, 491153, 734883, -868212,
+ -951053, 644458, -580758, 764735, 584316, 297077, 28852, -397710, -953669, 201772,
+ 879050, -198237, -588468, 448102, -116837, 770007, -231812, 642906, -582166, -885828,
+ 9, 305082, -996577, 303559, 75008, -772956, -447960, 599825, -295552, 870739,
+ -386278, -950300, 485359, -457081, 629461, -850276, 550496, -451755, -620841, -11766,
+ -950137, 832337, 28711, -273398, -507197, 91921, -271360, -705991, -753220, -388968,
+ 967945, 340434, -320883, -662793, -554617, -574568, 477946, -6148, -129519, 689217,
+ 920020, -656315, -974523, -212525, 80921, -612532, 645096, 545655, 655713, -591631,
+ -307385, -816688, -618823, -113713, 526430, 673063, 735916, -809095, -850417, 639004,
+ 432281, -388185, 270708, 860146, -39902, -786157, -258180, -246169, -966720, -264957,
+ 548072, -306010, -57367, -635665, 933824, 70553, -989936, -488741, 72411, -452509,
+ 529831, 956277, 449019, -577850, -360986, -803418, 48833, 296073, 203430, 609591,
+ 715483, 470964, 658106, -718254, -96424, 790163, 334739, 181070, -373578, 5,
+ -435088, 329841, 330939, -256602, 394355, 912412, 231910, 927278, -661933, 788539,
+ -769664, -893274, -96856, 298205, 901043, -608122, -527430, 183618, -553963, -35246,
+ -393924, 948832, -483198, 594501, 35460, -407007, 93494, -336881, -634072, 984205,
+ -812161, 944664, -31062, 753872, 823933, -69566, 50445, 290147, 85134, 34706,
+ 551902, 405202, -991246, -84642, 154341, 316432, -695101, -651588, -5030, 137564,
+ -294665, 332541, 528307, -90572, -344923, 523766, -758498, -968047, 339028, 494578,
+ 593129, -725773, 31834, -718406, -208638, 159665, -2043, 673344, -442767, 75816,
+ 755442, 769257, -158730, -410272, 691688, 589550, -878398, -184121, 460679, 346312,
+ 294163, -544602, 653308, 254167, -276979, 52073, -892684, 887653, -41222, 983065,
+ -68258, -408799, -99069, -674069, -863635, -32890, 622757, -743862, 40872, -4837,
+ -967228, 522370, -903951, -818669, 524459, 514702, 925801, 20007, -299229, 579348,
+ 626021, 430089, 348139, -562692, -607728, -130606, -928451, -424793, -458647, -448892,
+ -312230, 143337, 109746, 880042, -339658, -785614, 938995, 540916, 118429, 661351,
+ -402967, 404729, -40918, -976535, 743230, 713110, 440182, -381314, -499252, 74613,
+ 193652, 912717, 491323, 583633, 324691, 459397, 281253, 195540, -2764, -888651,
+ 892449, 132663, -478373, -430002, -314551, 527826, 247165, 557966, 554778, 481531,
+ -946634, 431685, -769059, -348371, 174046, 184597, -354867, 584422, 227390, -850397,
+ -542924, -849093, -737769, 325359, 736314, 269101, 767940, 674809, 81413, -447458,
+ 445076, 189072, 906218, 502688, -718476, -863827, -731381, 100660, 623249, 710008,
+ 572060, 922203, 685740, 55096, 263394, -243695, -353910, -516788, 388471, 455165,
+ 844103, -643772, 363976, 268875, -899450, 104470, 104029, -238874, -274659, 732969,
+ -676443, 953291, -916289, -861849, -242344, 958083, -479593, -970395, 799831, 277841,
+ -243236, -283462, -201510, 166263, -259105, -575706, 878926, 891064, 895297, 655262,
+ -34807, -809833, -89281, 342585, 554920, 1, 902141, -333425, 139703, 852318,
+ -618438, 329498, -932596, -692836, -513372, 733656, -523411, 85779, 500478, -682697,
+ -502836, 138776, 156341, -420037, -557964, -556378, 710993, -50383, -877159, 916334,
+ 132996, 583516, -603392, -111615, -12288, -780214, 476780, 123327, 137607, 519956,
+ 745837, 17358, -158581, -53490
+};
+static const size_t randvalCount = sizeof(randval) / sizeof(randval[0]);
+static const size_t kItoaTrialCount = 10000;
+
+static const char digits[201] =
+"0001020304050607080910111213141516171819"
+"2021222324252627282930313233343536373839"
+"4041424344454647484950515253545556575859"
+"6061626364656667686970717273747576777879"
+"8081828384858687888990919293949596979899";
+
+// Prevent code being optimized out
+//#define OUTPUT_LENGTH(length) printf("", length)
+#define OUTPUT_LENGTH(length) printf("%u\n", (unsigned)length)
+
+template<typename OutputStream>
+class Writer1 {
+public:
+ Writer1() : os_() {}
+ Writer1(OutputStream& os) : os_(&os) {}
+
+ void Reset(OutputStream& os) {
+ os_ = &os;
+ }
+
+ bool WriteInt(int i) {
+ if (i < 0) {
+ os_->Put('-');
+ i = -i;
+ }
+ return WriteUint((unsigned)i);
+ }
+
+ bool WriteUint(unsigned u) {
+ char buffer[10];
+ char *p = buffer;
+ do {
+ *p++ = char(u % 10) + '0';
+ u /= 10;
+ } while (u > 0);
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+ bool WriteInt64(int64_t i64) {
+ if (i64 < 0) {
+ os_->Put('-');
+ i64 = -i64;
+ }
+ WriteUint64((uint64_t)i64);
+ return true;
+ }
+
+ bool WriteUint64(uint64_t u64) {
+ char buffer[20];
+ char *p = buffer;
+ do {
+ *p++ = char(u64 % 10) + '0';
+ u64 /= 10;
+ } while (u64 > 0);
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+private:
+ OutputStream* os_;
+};
+
+template<>
+bool Writer1<rapidjson::StringBuffer>::WriteUint(unsigned u) {
+ char buffer[10];
+ char* p = buffer;
+ do {
+ *p++ = char(u % 10) + '0';
+ u /= 10;
+ } while (u > 0);
+
+ char* d = os_->Push(p - buffer);
+ do {
+ --p;
+ *d++ = *p;
+ } while (p != buffer);
+ return true;
+}
+
+// Using digits LUT to reduce divsion/modulo
+template<typename OutputStream>
+class Writer2 {
+public:
+ Writer2() : os_() {}
+ Writer2(OutputStream& os) : os_(&os) {}
+
+ void Reset(OutputStream& os) {
+ os_ = &os;
+ }
+
+ bool WriteInt(int i) {
+ if (i < 0) {
+ os_->Put('-');
+ i = -i;
+ }
+ return WriteUint((unsigned)i);
+ }
+
+ bool WriteUint(unsigned u) {
+ char buffer[10];
+ char* p = buffer;
+ while (u >= 100) {
+ const unsigned i = (u % 100) << 1;
+ u /= 100;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+ if (u < 10)
+ *p++ = char(u) + '0';
+ else {
+ const unsigned i = u << 1;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+ bool WriteInt64(int64_t i64) {
+ if (i64 < 0) {
+ os_->Put('-');
+ i64 = -i64;
+ }
+ WriteUint64((uint64_t)i64);
+ return true;
+ }
+
+ bool WriteUint64(uint64_t u64) {
+ char buffer[20];
+ char* p = buffer;
+ while (u64 >= 100) {
+ const unsigned i = static_cast<unsigned>(u64 % 100) << 1;
+ u64 /= 100;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+ if (u64 < 10)
+ *p++ = char(u64) + '0';
+ else {
+ const unsigned i = static_cast<unsigned>(u64) << 1;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+private:
+ OutputStream* os_;
+};
+
+// First pass to count digits
+template<typename OutputStream>
+class Writer3 {
+public:
+ Writer3() : os_() {}
+ Writer3(OutputStream& os) : os_(&os) {}
+
+ void Reset(OutputStream& os) {
+ os_ = &os;
+ }
+
+ bool WriteInt(int i) {
+ if (i < 0) {
+ os_->Put('-');
+ i = -i;
+ }
+ return WriteUint((unsigned)i);
+ }
+
+ bool WriteUint(unsigned u) {
+ char buffer[10];
+ char *p = buffer;
+ do {
+ *p++ = char(u % 10) + '0';
+ u /= 10;
+ } while (u > 0);
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+ bool WriteInt64(int64_t i64) {
+ if (i64 < 0) {
+ os_->Put('-');
+ i64 = -i64;
+ }
+ WriteUint64((uint64_t)i64);
+ return true;
+ }
+
+ bool WriteUint64(uint64_t u64) {
+ char buffer[20];
+ char *p = buffer;
+ do {
+ *p++ = char(u64 % 10) + '0';
+ u64 /= 10;
+ } while (u64 > 0);
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+private:
+ void WriteUintReverse(char* d, unsigned u) {
+ do {
+ *--d = char(u % 10) + '0';
+ u /= 10;
+ } while (u > 0);
+ }
+
+ void WriteUint64Reverse(char* d, uint64_t u) {
+ do {
+ *--d = char(u % 10) + '0';
+ u /= 10;
+ } while (u > 0);
+ }
+
+ OutputStream* os_;
+};
+
+template<>
+inline bool Writer3<rapidjson::StringBuffer>::WriteUint(unsigned u) {
+ unsigned digit = CountDecimalDigit_fast(u);
+ WriteUintReverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template<>
+inline bool Writer3<rapidjson::InsituStringStream>::WriteUint(unsigned u) {
+ unsigned digit = CountDecimalDigit_fast(u);
+ WriteUintReverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template<>
+inline bool Writer3<rapidjson::StringBuffer>::WriteUint64(uint64_t u) {
+ unsigned digit = CountDecimalDigit64_fast(u);
+ WriteUint64Reverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template<>
+inline bool Writer3<rapidjson::InsituStringStream>::WriteUint64(uint64_t u) {
+ unsigned digit = CountDecimalDigit64_fast(u);
+ WriteUint64Reverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+// Using digits LUT to reduce divsion/modulo, two passes
+template<typename OutputStream>
+class Writer4 {
+public:
+ Writer4() : os_() {}
+ Writer4(OutputStream& os) : os_(&os) {}
+
+ void Reset(OutputStream& os) {
+ os_ = &os;
+ }
+
+ bool WriteInt(int i) {
+ if (i < 0) {
+ os_->Put('-');
+ i = -i;
+ }
+ return WriteUint((unsigned)i);
+ }
+
+ bool WriteUint(unsigned u) {
+ char buffer[10];
+ char* p = buffer;
+ while (u >= 100) {
+ const unsigned i = (u % 100) << 1;
+ u /= 100;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+ if (u < 10)
+ *p++ = char(u) + '0';
+ else {
+ const unsigned i = u << 1;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+ bool WriteInt64(int64_t i64) {
+ if (i64 < 0) {
+ os_->Put('-');
+ i64 = -i64;
+ }
+ WriteUint64((uint64_t)i64);
+ return true;
+ }
+
+ bool WriteUint64(uint64_t u64) {
+ char buffer[20];
+ char* p = buffer;
+ while (u64 >= 100) {
+ const unsigned i = static_cast<unsigned>(u64 % 100) << 1;
+ u64 /= 100;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+ if (u64 < 10)
+ *p++ = char(u64) + '0';
+ else {
+ const unsigned i = static_cast<unsigned>(u64) << 1;
+ *p++ = digits[i + 1];
+ *p++ = digits[i];
+ }
+
+ do {
+ --p;
+ os_->Put(*p);
+ } while (p != buffer);
+ return true;
+ }
+
+private:
+ void WriteUintReverse(char* d, unsigned u) {
+ while (u >= 100) {
+ const unsigned i = (u % 100) << 1;
+ u /= 100;
+ *--d = digits[i + 1];
+ *--d = digits[i];
+ }
+ if (u < 10) {
+ *--d = char(u) + '0';
+ }
+ else {
+ const unsigned i = u << 1;
+ *--d = digits[i + 1];
+ *--d = digits[i];
+ }
+ }
+
+ void WriteUint64Reverse(char* d, uint64_t u) {
+ while (u >= 100) {
+ const unsigned i = (u % 100) << 1;
+ u /= 100;
+ *--d = digits[i + 1];
+ *--d = digits[i];
+ }
+ if (u < 10) {
+ *--d = char(u) + '0';
+ }
+ else {
+ const unsigned i = u << 1;
+ *--d = digits[i + 1];
+ *--d = digits[i];
+ }
+ }
+
+ OutputStream* os_;
+};
+
+template<>
+inline bool Writer4<rapidjson::StringBuffer>::WriteUint(unsigned u) {
+ unsigned digit = CountDecimalDigit_fast(u);
+ WriteUintReverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template<>
+inline bool Writer4<rapidjson::InsituStringStream>::WriteUint(unsigned u) {
+ unsigned digit = CountDecimalDigit_fast(u);
+ WriteUintReverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template<>
+inline bool Writer4<rapidjson::StringBuffer>::WriteUint64(uint64_t u) {
+ unsigned digit = CountDecimalDigit64_fast(u);
+ WriteUint64Reverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template<>
+inline bool Writer4<rapidjson::InsituStringStream>::WriteUint64(uint64_t u) {
+ unsigned digit = CountDecimalDigit64_fast(u);
+ WriteUint64Reverse(os_->Push(digit) + digit, u);
+ return true;
+}
+
+template <typename Writer>
+void itoa_Writer_StringBufferVerify() {
+ rapidjson::StringBuffer sb;
+ Writer writer(sb);
+ for (size_t j = 0; j < randvalCount; j++) {
+ char buffer[32];
+ sprintf(buffer, "%d", randval[j]);
+ writer.WriteInt(randval[j]);
+ ASSERT_STREQ(buffer, sb.GetString());
+ sb.Clear();
+ }
+}
+
+template <typename Writer>
+void itoa_Writer_InsituStringStreamVerify() {
+ Writer writer;
+ for (size_t j = 0; j < randvalCount; j++) {
+ char buffer[32];
+ sprintf(buffer, "%d", randval[j]);
+ char buffer2[32];
+ rapidjson::InsituStringStream ss(buffer2);
+ writer.Reset(ss);
+ char* begin = ss.PutBegin();
+ writer.WriteInt(randval[j]);
+ ss.Put('\0');
+ ss.PutEnd(begin);
+ ASSERT_STREQ(buffer, buffer2);
+ }
+}
+
+template <typename Writer>
+void itoa_Writer_StringBuffer() {
+ size_t length = 0;
+
+ rapidjson::StringBuffer sb;
+ Writer writer(sb);
+
+ for (size_t i = 0; i < kItoaTrialCount; i++) {
+ for (size_t j = 0; j < randvalCount; j++) {
+ writer.WriteInt(randval[j]);
+ length += sb.GetSize();
+ sb.Clear();
+ }
+ }
+ OUTPUT_LENGTH(length);
+}
+
+template <typename Writer>
+void itoa_Writer_InsituStringStream() {
+ size_t length = 0;
+
+ char buffer[32];
+ Writer writer;
+ for (size_t i = 0; i < kItoaTrialCount; i++) {
+ for (size_t j = 0; j < randvalCount; j++) {
+ rapidjson::InsituStringStream ss(buffer);
+ writer.Reset(ss);
+ char* begin = ss.PutBegin();
+ writer.WriteInt(randval[j]);
+ length += ss.PutEnd(begin);
+ }
+ }
+ OUTPUT_LENGTH(length);
+};
+
+template <typename Writer>
+void itoa64_Writer_StringBufferVerify() {
+ rapidjson::StringBuffer sb;
+ Writer writer(sb);
+ for (size_t j = 0; j < randvalCount; j++) {
+ char buffer[32];
+ int64_t x = randval[j] * randval[j];
+ sprintf(buffer, "%" PRIi64, x);
+ writer.WriteInt64(x);
+ ASSERT_STREQ(buffer, sb.GetString());
+ sb.Clear();
+ }
+}
+
+template <typename Writer>
+void itoa64_Writer_InsituStringStreamVerify() {
+ Writer writer;
+ for (size_t j = 0; j < randvalCount; j++) {
+ char buffer[32];
+ int64_t x = randval[j] * randval[j];
+ sprintf(buffer, "%" PRIi64, x);
+ char buffer2[32];
+ rapidjson::InsituStringStream ss(buffer2);
+ writer.Reset(ss);
+ char* begin = ss.PutBegin();
+ writer.WriteInt64(x);
+ ss.Put('\0');
+ ss.PutEnd(begin);
+ ASSERT_STREQ(buffer, buffer2);
+ }
+}
+
+template <typename Writer>
+void itoa64_Writer_StringBuffer() {
+ size_t length = 0;
+
+ rapidjson::StringBuffer sb;
+ Writer writer(sb);
+
+ for (size_t i = 0; i < kItoaTrialCount; i++) {
+ for (size_t j = 0; j < randvalCount; j++) {
+ writer.WriteInt64(randval[j] * randval[j]);
+ length += sb.GetSize();
+ sb.Clear();
+ }
+ }
+ OUTPUT_LENGTH(length);
+}
+
+template <typename Writer>
+void itoa64_Writer_InsituStringStream() {
+ size_t length = 0;
+
+ char buffer[32];
+ Writer writer;
+ for (size_t i = 0; i < kItoaTrialCount; i++) {
+ for (size_t j = 0; j < randvalCount; j++) {
+ rapidjson::InsituStringStream ss(buffer);
+ writer.Reset(ss);
+ char* begin = ss.PutBegin();
+ writer.WriteInt64(randval[j] * randval[j]);
+ length += ss.PutEnd(begin);
+ }
+ }
+ OUTPUT_LENGTH(length);
+};
+
+// Full specialization for InsituStringStream to prevent memory copying
+// (normally we will not use InsituStringStream for writing, just for testing)
+
+namespace rapidjson {
+
+template<>
+bool rapidjson::Writer<InsituStringStream>::WriteInt(int i) {
+ char *buffer = os_->Push(11);
+ const char* end = internal::i32toa(i, buffer);
+ os_->Pop(11 - (end - buffer));
+ return true;
+}
+
+template<>
+bool Writer<InsituStringStream>::WriteUint(unsigned u) {
+ char *buffer = os_->Push(10);
+ const char* end = internal::u32toa(u, buffer);
+ os_->Pop(10 - (end - buffer));
+ return true;
+}
+
+template<>
+bool Writer<InsituStringStream>::WriteInt64(int64_t i64) {
+ char *buffer = os_->Push(21);
+ const char* end = internal::i64toa(i64, buffer);
+ os_->Pop(21 - (end - buffer));
+ return true;
+}
+
+template<>
+bool Writer<InsituStringStream>::WriteUint64(uint64_t u) {
+ char *buffer = os_->Push(20);
+ const char* end = internal::u64toa(u, buffer);
+ os_->Pop(20 - (end - buffer));
+ return true;
+}
+
+} // namespace rapidjson
+
+TEST_F(Misc, itoa_Writer_StringBufferVerify) { itoa_Writer_StringBufferVerify<rapidjson::Writer<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer1_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer1<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer2_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer2<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer3_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer3<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer4_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer4<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer1_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer1<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer2_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer2<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer3_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer3<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer4_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer4<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer_StringBuffer) { itoa_Writer_StringBuffer<rapidjson::Writer<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer1_StringBuffer) { itoa_Writer_StringBuffer<Writer1<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer2_StringBuffer) { itoa_Writer_StringBuffer<Writer2<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer3_StringBuffer) { itoa_Writer_StringBuffer<Writer3<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer4_StringBuffer) { itoa_Writer_StringBuffer<Writer4<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa_Writer_InsituStringStream) { itoa_Writer_InsituStringStream<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer1_InsituStringStream) { itoa_Writer_InsituStringStream<Writer1<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer2_InsituStringStream) { itoa_Writer_InsituStringStream<Writer2<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer3_InsituStringStream) { itoa_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa_Writer4_InsituStringStream) { itoa_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }
+
+TEST_F(Misc, itoa64_Writer_StringBufferVerify) { itoa64_Writer_StringBufferVerify<rapidjson::Writer<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer1_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer1<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer2_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer2<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer3_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer3<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer4_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer4<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer1_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer1<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer2_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer2<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer3_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer3<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer4_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer4<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer_StringBuffer) { itoa64_Writer_StringBuffer<rapidjson::Writer<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer1_StringBuffer) { itoa64_Writer_StringBuffer<Writer1<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer2_StringBuffer) { itoa64_Writer_StringBuffer<Writer2<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer3_StringBuffer) { itoa64_Writer_StringBuffer<Writer3<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer4_StringBuffer) { itoa64_Writer_StringBuffer<Writer4<rapidjson::StringBuffer> >(); }
+TEST_F(Misc, itoa64_Writer_InsituStringStream) { itoa64_Writer_InsituStringStream<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer1_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer1<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer2_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer2<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer3_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }
+TEST_F(Misc, itoa64_Writer4_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }
+
+#endif // TEST_MISC
diff --git a/3rdparty/rapidjson/test/perftest/perftest.cpp b/3rdparty/rapidjson/test/perftest/perftest.cpp
new file mode 100644
index 00000000000..4e79f1f5180
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/perftest.cpp
@@ -0,0 +1,24 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "perftest.h"
+
+int main(int argc, char **argv) {
+#if _MSC_VER
+ _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
+ //void *testWhetherMemoryLeakDetectionWorks = malloc(1);
+#endif
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/3rdparty/rapidjson/test/perftest/perftest.h b/3rdparty/rapidjson/test/perftest/perftest.h
new file mode 100644
index 00000000000..029940934c7
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/perftest.h
@@ -0,0 +1,180 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef PERFTEST_H_
+#define PERFTEST_H_
+
+#define TEST_RAPIDJSON 1
+#define TEST_PLATFORM 0
+#define TEST_MISC 0
+
+#define TEST_VERSION_CODE(x,y,z) \
+ (((x)*100000) + ((y)*100) + (z))
+
+// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler.
+// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported.
+#if defined(__SSE4_2__)
+# define RAPIDJSON_SSE42
+#elif defined(__SSE2__)
+# define RAPIDJSON_SSE2
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// Google Test
+
+#ifdef __cplusplus
+
+// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.
+#ifndef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
+#endif
+
+#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Weffc++"
+#endif
+
+#include "gtest/gtest.h"
+
+#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#pragma GCC diagnostic pop
+#endif
+
+#ifdef _MSC_VER
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+#pragma warning(disable : 4996) // 'function': was declared deprecated
+#endif
+
+//! Base class for all performance tests
+class PerfTest : public ::testing::Test {
+public:
+ PerfTest() : filename_(), json_(), length_(), whitespace_(), whitespace_length_() {}
+
+ virtual void SetUp() {
+ {
+ const char *paths[] = {
+ "data/sample.json",
+ "bin/data/sample.json",
+ "../bin/data/sample.json",
+ "../../bin/data/sample.json",
+ "../../../bin/data/sample.json"
+ };
+
+ FILE *fp = 0;
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ fp = fopen(filename_ = paths[i], "rb");
+ if (fp)
+ break;
+ }
+ ASSERT_TRUE(fp != 0);
+
+ fseek(fp, 0, SEEK_END);
+ length_ = (size_t)ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ json_ = (char*)malloc(length_ + 1);
+ ASSERT_EQ(length_, fread(json_, 1, length_, fp));
+ json_[length_] = '\0';
+ fclose(fp);
+ }
+
+ // whitespace test
+ {
+ whitespace_length_ = 1024 * 1024;
+ whitespace_ = (char *)malloc(whitespace_length_ + 4);
+ char *p = whitespace_;
+ for (size_t i = 0; i < whitespace_length_; i += 4) {
+ *p++ = ' ';
+ *p++ = '\n';
+ *p++ = '\r';
+ *p++ = '\t';
+ }
+ *p++ = '[';
+ *p++ = '0';
+ *p++ = ']';
+ *p++ = '\0';
+ }
+
+ // types test
+ {
+ const char *typespaths[] = {
+ "data/types",
+ "bin/types",
+ "../bin/types",
+ "../../bin/types/",
+ "../../../bin/types"
+ };
+
+ const char* typesfilenames[] = {
+ "booleans.json",
+ "floats.json",
+ "guids.json",
+ "integers.json",
+ "mixed.json",
+ "nulls.json",
+ "paragraphs.json"
+ };
+
+ for (size_t j = 0; j < sizeof(typesfilenames) / sizeof(typesfilenames[0]); j++) {
+ types_[j] = 0;
+ for (size_t i = 0; i < sizeof(typespaths) / sizeof(typespaths[0]); i++) {
+ char filename[256];
+ sprintf(filename, "%s/%s", typespaths[i], typesfilenames[j]);
+ if (FILE* fp = fopen(filename, "rb")) {
+ fseek(fp, 0, SEEK_END);
+ typesLength_[j] = (size_t)ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ types_[j] = (char*)malloc(typesLength_[j] + 1);
+ ASSERT_EQ(typesLength_[j], fread(types_[j], 1, typesLength_[j], fp));
+ types_[j][typesLength_[j]] = '\0';
+ fclose(fp);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ virtual void TearDown() {
+ free(json_);
+ free(whitespace_);
+ json_ = 0;
+ whitespace_ = 0;
+ for (size_t i = 0; i < 7; i++) {
+ free(types_[i]);
+ types_[i] = 0;
+ }
+ }
+
+private:
+ PerfTest(const PerfTest&);
+ PerfTest& operator=(const PerfTest&);
+
+protected:
+ const char* filename_;
+ char *json_;
+ size_t length_;
+ char *whitespace_;
+ size_t whitespace_length_;
+ char *types_[7];
+ size_t typesLength_[7];
+
+ static const size_t kTrialCount = 1000;
+};
+
+#endif // __cplusplus
+
+#endif // PERFTEST_H_
diff --git a/3rdparty/rapidjson/test/perftest/platformtest.cpp b/3rdparty/rapidjson/test/perftest/platformtest.cpp
new file mode 100644
index 00000000000..bb905ca73be
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/platformtest.cpp
@@ -0,0 +1,166 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "perftest.h"
+
+// This file is for giving the performance characteristics of the platform (compiler/OS/CPU).
+
+#if TEST_PLATFORM
+
+#include <cmath>
+#include <fcntl.h>
+
+// Windows
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+// UNIX
+#if defined(unix) || defined(__unix__) || defined(__unix)
+#include <unistd.h>
+#ifdef _POSIX_MAPPED_FILES
+#include <sys/mman.h>
+#endif
+#endif
+
+class Platform : public PerfTest {
+public:
+ virtual void SetUp() {
+ PerfTest::SetUp();
+
+ // temp buffer for testing
+ temp_ = (char *)malloc(length_ + 1);
+ memcpy(temp_, json_, length_);
+ checkSum_ = CheckSum();
+ }
+
+ char CheckSum() {
+ char c = 0;
+ for (size_t i = 0; i < length_; ++i)
+ c += temp_[i];
+ return c;
+ }
+
+ virtual void TearDown() {
+ PerfTest::TearDown();
+ free(temp_);
+ }
+
+protected:
+ char *temp_;
+ char checkSum_;
+};
+
+TEST_F(Platform, CheckSum) {
+ for (int i = 0; i < kTrialCount; i++)
+ EXPECT_EQ(checkSum_, CheckSum());
+}
+
+TEST_F(Platform, strlen) {
+ for (int i = 0; i < kTrialCount; i++) {
+ size_t l = strlen(json_);
+ EXPECT_EQ(length_, l);
+ }
+}
+
+TEST_F(Platform, memcmp) {
+ for (int i = 0; i < kTrialCount; i++) {
+ EXPECT_EQ(0, memcmp(temp_, json_, length_));
+ }
+}
+
+TEST_F(Platform, pow) {
+ double sum = 0;
+ for (int i = 0; i < kTrialCount * kTrialCount; i++)
+ sum += pow(10.0, i & 255);
+ EXPECT_GT(sum, 0.0);
+}
+
+TEST_F(Platform, Whitespace_strlen) {
+ for (int i = 0; i < kTrialCount; i++) {
+ size_t l = strlen(whitespace_);
+ EXPECT_GT(l, whitespace_length_);
+ }
+}
+
+TEST_F(Platform, Whitespace_strspn) {
+ for (int i = 0; i < kTrialCount; i++) {
+ size_t l = strspn(whitespace_, " \n\r\t");
+ EXPECT_EQ(whitespace_length_, l);
+ }
+}
+
+TEST_F(Platform, fread) {
+ for (int i = 0; i < kTrialCount; i++) {
+ FILE *fp = fopen(filename_, "rb");
+ ASSERT_EQ(length_, fread(temp_, 1, length_, fp));
+ EXPECT_EQ(checkSum_, CheckSum());
+ fclose(fp);
+ }
+}
+
+#ifdef _MSC_VER
+TEST_F(Platform, read) {
+ for (int i = 0; i < kTrialCount; i++) {
+ int fd = _open(filename_, _O_BINARY | _O_RDONLY);
+ ASSERT_NE(-1, fd);
+ ASSERT_EQ(length_, _read(fd, temp_, length_));
+ EXPECT_EQ(checkSum_, CheckSum());
+ _close(fd);
+ }
+}
+#else
+TEST_F(Platform, read) {
+ for (int i = 0; i < kTrialCount; i++) {
+ int fd = open(filename_, O_RDONLY);
+ ASSERT_NE(-1, fd);
+ ASSERT_EQ(length_, read(fd, temp_, length_));
+ EXPECT_EQ(checkSum_, CheckSum());
+ close(fd);
+ }
+}
+#endif
+
+#ifdef _WIN32
+TEST_F(Platform, MapViewOfFile) {
+ for (int i = 0; i < kTrialCount; i++) {
+ HANDLE file = CreateFile(filename_, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ ASSERT_NE(INVALID_HANDLE_VALUE, file);
+ HANDLE mapObject = CreateFileMapping(file, NULL, PAGE_READONLY, 0, length_, NULL);
+ ASSERT_NE(INVALID_HANDLE_VALUE, mapObject);
+ void *p = MapViewOfFile(mapObject, FILE_MAP_READ, 0, 0, length_);
+ ASSERT_TRUE(p != NULL);
+ EXPECT_EQ(checkSum_, CheckSum());
+ ASSERT_TRUE(UnmapViewOfFile(p) == TRUE);
+ ASSERT_TRUE(CloseHandle(mapObject) == TRUE);
+ ASSERT_TRUE(CloseHandle(file) == TRUE);
+ }
+}
+#endif
+
+#ifdef _POSIX_MAPPED_FILES
+TEST_F(Platform, mmap) {
+ for (int i = 0; i < kTrialCount; i++) {
+ int fd = open(filename_, O_RDONLY);
+ ASSERT_NE(-1, fd);
+ void *p = mmap(NULL, length_, PROT_READ, MAP_PRIVATE, fd, 0);
+ ASSERT_TRUE(p != NULL);
+ EXPECT_EQ(checkSum_, CheckSum());
+ munmap(p, length_);
+ close(fd);
+ }
+}
+#endif
+
+#endif // TEST_PLATFORM
diff --git a/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp b/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp
new file mode 100644
index 00000000000..74424ac332b
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp
@@ -0,0 +1,422 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "perftest.h"
+
+#if TEST_RAPIDJSON
+
+#include "rapidjson/rapidjson.h"
+#include "rapidjson/document.h"
+#include "rapidjson/prettywriter.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/memorystream.h"
+
+#ifdef RAPIDJSON_SSE2
+#define SIMD_SUFFIX(name) name##_SSE2
+#elif defined(RAPIDJSON_SSE42)
+#define SIMD_SUFFIX(name) name##_SSE42
+#else
+#define SIMD_SUFFIX(name) name
+#endif
+
+using namespace rapidjson;
+
+class RapidJson : public PerfTest {
+public:
+ RapidJson() : temp_(), doc_() {}
+
+ virtual void SetUp() {
+ PerfTest::SetUp();
+
+ // temp buffer for insitu parsing.
+ temp_ = (char *)malloc(length_ + 1);
+
+ // Parse as a document
+ EXPECT_FALSE(doc_.Parse(json_).HasParseError());
+
+ for (size_t i = 0; i < 7; i++)
+ EXPECT_FALSE(typesDoc_[i].Parse(types_[i]).HasParseError());
+ }
+
+ virtual void TearDown() {
+ PerfTest::TearDown();
+ free(temp_);
+ }
+
+private:
+ RapidJson(const RapidJson&);
+ RapidJson& operator=(const RapidJson&);
+
+protected:
+ char *temp_;
+ Document doc_;
+ Document typesDoc_[7];
+};
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ memcpy(temp_, json_, length_ + 1);
+ InsituStringStream s(temp_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_ValidateEncoding)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ memcpy(temp_, json_, length_ + 1);
+ InsituStringStream s(temp_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseValidateEncodingFlag>(s, h));
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringStream s(json_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse(s, h));
+ }
+}
+
+#define TEST_TYPED(index, Name)\
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_##Name)) {\
+ for (size_t i = 0; i < kTrialCount * 10; i++) {\
+ StringStream s(types_[index]);\
+ BaseReaderHandler<> h;\
+ Reader reader;\
+ EXPECT_TRUE(reader.Parse(s, h));\
+ }\
+}\
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_##Name)) {\
+ for (size_t i = 0; i < kTrialCount * 10; i++) {\
+ memcpy(temp_, types_[index], typesLength_[index] + 1);\
+ InsituStringStream s(temp_);\
+ BaseReaderHandler<> h;\
+ Reader reader;\
+ EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));\
+ }\
+}
+
+TEST_TYPED(0, Booleans)
+TEST_TYPED(1, Floats)
+TEST_TYPED(2, Guids)
+TEST_TYPED(3, Integers)
+TEST_TYPED(4, Mixed)
+TEST_TYPED(5, Nulls)
+TEST_TYPED(6, Paragraphs)
+
+#undef TEST_TYPED
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FullPrecision)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringStream s(json_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseFullPrecisionFlag>(s, h));
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterative_DummyHandler)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringStream s(json_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseIterativeFlag>(s, h));
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterativeInsitu_DummyHandler)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ memcpy(temp_, json_, length_ + 1);
+ InsituStringStream s(temp_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseIterativeFlag|kParseInsituFlag>(s, h));
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_ValidateEncoding)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringStream s(json_);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseValidateEncodingFlag>(s, h));
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseInsitu_MemoryPoolAllocator)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ memcpy(temp_, json_, length_ + 1);
+ Document doc;
+ doc.ParseInsitu(temp_);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterativeInsitu_MemoryPoolAllocator)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ memcpy(temp_, json_, length_ + 1);
+ Document doc;
+ doc.ParseInsitu<kParseIterativeFlag>(temp_);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_MemoryPoolAllocator)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ Document doc;
+ doc.Parse(json_);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterative_MemoryPoolAllocator)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ Document doc;
+ doc.Parse<kParseIterativeFlag>(json_);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_CrtAllocator)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ memcpy(temp_, json_, length_ + 1);
+ GenericDocument<UTF8<>, CrtAllocator> doc;
+ doc.Parse(temp_);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseEncodedInputStream_MemoryStream)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ MemoryStream ms(json_, length_);
+ EncodedInputStream<UTF8<>, MemoryStream> is(ms);
+ Document doc;
+ doc.ParseStream<0, UTF8<> >(is);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseAutoUTFInputStream_MemoryStream)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ MemoryStream ms(json_, length_);
+ AutoUTFInputStream<unsigned, MemoryStream> is(ms);
+ Document doc;
+ doc.ParseStream<0, AutoUTF<unsigned> >(is);
+ ASSERT_TRUE(doc.IsObject());
+ }
+}
+
+template<typename T>
+size_t Traverse(const T& value) {
+ size_t count = 1;
+ switch(value.GetType()) {
+ case kObjectType:
+ for (typename T::ConstMemberIterator itr = value.MemberBegin(); itr != value.MemberEnd(); ++itr) {
+ count++; // name
+ count += Traverse(itr->value);
+ }
+ break;
+
+ case kArrayType:
+ for (typename T::ConstValueIterator itr = value.Begin(); itr != value.End(); ++itr)
+ count += Traverse(*itr);
+ break;
+
+ default:
+ // Do nothing.
+ break;
+ }
+ return count;
+}
+
+TEST_F(RapidJson, DocumentTraverse) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ size_t count = Traverse(doc_);
+ EXPECT_EQ(4339u, count);
+ //if (i == 0)
+ // std::cout << count << std::endl;
+ }
+}
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+struct ValueCounter : public BaseReaderHandler<> {
+ ValueCounter() : count_(1) {} // root
+
+ bool EndObject(SizeType memberCount) { count_ += memberCount * 2; return true; }
+ bool EndArray(SizeType elementCount) { count_ += elementCount; return true; }
+
+ SizeType count_;
+};
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+TEST_F(RapidJson, DocumentAccept) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ ValueCounter counter;
+ doc_.Accept(counter);
+ EXPECT_EQ(4339u, counter.count_);
+ }
+}
+
+struct NullStream {
+ typedef char Ch;
+
+ NullStream() /*: length_(0)*/ {}
+ void Put(Ch) { /*++length_;*/ }
+ void Flush() {}
+ //size_t length_;
+};
+
+TEST_F(RapidJson, Writer_NullStream) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ NullStream s;
+ Writer<NullStream> writer(s);
+ doc_.Accept(writer);
+ //if (i == 0)
+ // std::cout << s.length_ << std::endl;
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(Writer_StringBuffer)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringBuffer s(0, 1024 * 1024);
+ Writer<StringBuffer> writer(s);
+ doc_.Accept(writer);
+ const char* str = s.GetString();
+ (void)str;
+ //if (i == 0)
+ // std::cout << strlen(str) << std::endl;
+ }
+}
+
+#define TEST_TYPED(index, Name)\
+TEST_F(RapidJson, SIMD_SUFFIX(Writer_StringBuffer_##Name)) {\
+ for (size_t i = 0; i < kTrialCount * 10; i++) {\
+ StringBuffer s(0, 1024 * 1024);\
+ Writer<StringBuffer> writer(s);\
+ typesDoc_[index].Accept(writer);\
+ const char* str = s.GetString();\
+ (void)str;\
+ }\
+}
+
+TEST_TYPED(0, Booleans)
+TEST_TYPED(1, Floats)
+TEST_TYPED(2, Guids)
+TEST_TYPED(3, Integers)
+TEST_TYPED(4, Mixed)
+TEST_TYPED(5, Nulls)
+TEST_TYPED(6, Paragraphs)
+
+#undef TEST_TYPED
+
+TEST_F(RapidJson, SIMD_SUFFIX(PrettyWriter_StringBuffer)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringBuffer s(0, 2048 * 1024);
+ PrettyWriter<StringBuffer> writer(s);
+ writer.SetIndent(' ', 1);
+ doc_.Accept(writer);
+ const char* str = s.GetString();
+ (void)str;
+ //if (i == 0)
+ // std::cout << strlen(str) << std::endl;
+ }
+}
+
+TEST_F(RapidJson, internal_Pow10) {
+ double sum = 0;
+ for (size_t i = 0; i < kTrialCount * kTrialCount; i++)
+ sum += internal::Pow10(int(i & 255));
+ EXPECT_GT(sum, 0.0);
+}
+
+TEST_F(RapidJson, SkipWhitespace_Basic) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ rapidjson::StringStream s(whitespace_);
+ while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
+ s.Take();
+ ASSERT_EQ('[', s.Peek());
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(SkipWhitespace)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ rapidjson::StringStream s(whitespace_);
+ rapidjson::SkipWhitespace(s);
+ ASSERT_EQ('[', s.Peek());
+ }
+}
+
+TEST_F(RapidJson, SkipWhitespace_strspn) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ const char* s = whitespace_ + std::strspn(whitespace_, " \t\r\n");
+ ASSERT_EQ('[', *s);
+ }
+}
+
+TEST_F(RapidJson, UTF8_Validate) {
+ NullStream os;
+
+ for (size_t i = 0; i < kTrialCount; i++) {
+ StringStream is(json_);
+ bool result = true;
+ while (is.Peek() != '\0')
+ result &= UTF8<>::Validate(is, os);
+ EXPECT_TRUE(result);
+ }
+}
+
+TEST_F(RapidJson, FileReadStream) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ FILE *fp = fopen(filename_, "rb");
+ char buffer[65536];
+ FileReadStream s(fp, buffer, sizeof(buffer));
+ while (s.Take() != '\0')
+ ;
+ fclose(fp);
+ }
+}
+
+TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FileReadStream)) {
+ for (size_t i = 0; i < kTrialCount; i++) {
+ FILE *fp = fopen(filename_, "rb");
+ char buffer[65536];
+ FileReadStream s(fp, buffer, sizeof(buffer));
+ BaseReaderHandler<> h;
+ Reader reader;
+ reader.Parse(s, h);
+ fclose(fp);
+ }
+}
+
+TEST_F(RapidJson, StringBuffer) {
+ StringBuffer sb;
+ for (int i = 0; i < 32 * 1024 * 1024; i++)
+ sb.Put(i & 0x7f);
+}
+
+#endif // TEST_RAPIDJSON
diff --git a/3rdparty/rapidjson/test/perftest/schematest.cpp b/3rdparty/rapidjson/test/perftest/schematest.cpp
new file mode 100644
index 00000000000..468f5fe6f6a
--- /dev/null
+++ b/3rdparty/rapidjson/test/perftest/schematest.cpp
@@ -0,0 +1,216 @@
+#include "perftest.h"
+
+#if TEST_RAPIDJSON
+
+#include "rapidjson/schema.h"
+#include <ctime>
+#include <string>
+#include <vector>
+
+#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
+
+using namespace rapidjson;
+
+template <typename Allocator>
+static char* ReadFile(const char* filename, Allocator& allocator) {
+ const char *paths[] = {
+ "",
+ "bin/",
+ "../bin/",
+ "../../bin/",
+ "../../../bin/"
+ };
+ char buffer[1024];
+ FILE *fp = 0;
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ sprintf(buffer, "%s%s", paths[i], filename);
+ fp = fopen(buffer, "rb");
+ if (fp)
+ break;
+ }
+
+ if (!fp)
+ return 0;
+
+ fseek(fp, 0, SEEK_END);
+ size_t length = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+ char* json = reinterpret_cast<char*>(allocator.Malloc(length + 1));
+ size_t readLength = fread(json, 1, length, fp);
+ json[readLength] = '\0';
+ fclose(fp);
+ return json;
+}
+
+class Schema : public PerfTest {
+public:
+ Schema() {}
+
+ virtual void SetUp() {
+ PerfTest::SetUp();
+
+ const char* filenames[] = {
+ "additionalItems.json",
+ "additionalProperties.json",
+ "allOf.json",
+ "anyOf.json",
+ "default.json",
+ "definitions.json",
+ "dependencies.json",
+ "enum.json",
+ "items.json",
+ "maximum.json",
+ "maxItems.json",
+ "maxLength.json",
+ "maxProperties.json",
+ "minimum.json",
+ "minItems.json",
+ "minLength.json",
+ "minProperties.json",
+ "multipleOf.json",
+ "not.json",
+ "oneOf.json",
+ "pattern.json",
+ "patternProperties.json",
+ "properties.json",
+ "ref.json",
+ "refRemote.json",
+ "required.json",
+ "type.json",
+ "uniqueItems.json"
+ };
+
+ char jsonBuffer[65536];
+ MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
+
+ for (size_t i = 0; i < ARRAY_SIZE(filenames); i++) {
+ char filename[FILENAME_MAX];
+ sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
+ char* json = ReadFile(filename, jsonAllocator);
+ if (!json) {
+ printf("json test suite file %s not found", filename);
+ return;
+ }
+
+ Document d;
+ d.Parse(json);
+ if (d.HasParseError()) {
+ printf("json test suite file %s has parse error", filename);
+ return;
+ }
+
+ for (Value::ConstValueIterator schemaItr = d.Begin(); schemaItr != d.End(); ++schemaItr) {
+ std::string schemaDescription = (*schemaItr)["description"].GetString();
+ if (IsExcludeTestSuite(schemaDescription))
+ continue;
+
+ TestSuite* ts = new TestSuite;
+ ts->schema = new SchemaDocument((*schemaItr)["schema"]);
+
+ const Value& tests = (*schemaItr)["tests"];
+ for (Value::ConstValueIterator testItr = tests.Begin(); testItr != tests.End(); ++testItr) {
+ if (IsExcludeTest(schemaDescription + ", " + (*testItr)["description"].GetString()))
+ continue;
+
+ Document* d2 = new Document;
+ d2->CopyFrom((*testItr)["data"], d2->GetAllocator());
+ ts->tests.push_back(d2);
+ }
+ testSuites.push_back(ts);
+ }
+ }
+ }
+
+ virtual void TearDown() {
+ PerfTest::TearDown();
+ for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr)
+ delete *itr;
+ testSuites.clear();
+ }
+
+private:
+ // Using the same exclusion in https://github.com/json-schema/JSON-Schema-Test-Suite
+ static bool IsExcludeTestSuite(const std::string& description) {
+ const char* excludeTestSuites[] = {
+ //lost failing these tests
+ "remote ref",
+ "remote ref, containing refs itself",
+ "fragment within remote ref",
+ "ref within remote ref",
+ "change resolution scope",
+ // these below were added to get jsck in the benchmarks)
+ "uniqueItems validation",
+ "valid definition",
+ "invalid definition"
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(excludeTestSuites); i++)
+ if (excludeTestSuites[i] == description)
+ return true;
+ return false;
+ }
+
+ // Using the same exclusion in https://github.com/json-schema/JSON-Schema-Test-Suite
+ static bool IsExcludeTest(const std::string& description) {
+ const char* excludeTests[] = {
+ //lots of validators fail these
+ "invalid definition, invalid definition schema",
+ "maxLength validation, two supplementary Unicode code points is long enough",
+ "minLength validation, one supplementary Unicode code point is not long enough",
+ //this is to get tv4 in the benchmarks
+ "heterogeneous enum validation, something else is invalid"
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(excludeTests); i++)
+ if (excludeTests[i] == description)
+ return true;
+ return false;
+ }
+
+ Schema(const Schema&);
+ Schema& operator=(const Schema&);
+
+protected:
+ typedef std::vector<Document*> DocumentList;
+
+ struct TestSuite {
+ TestSuite() : schema() {}
+ ~TestSuite() {
+ delete schema;
+ for (DocumentList::iterator itr = tests.begin(); itr != tests.end(); ++itr)
+ delete *itr;
+ }
+ SchemaDocument* schema;
+ DocumentList tests;
+ };
+
+ typedef std::vector<TestSuite* > TestSuiteList;
+ TestSuiteList testSuites;
+};
+
+TEST_F(Schema, TestSuite) {
+ char validatorBuffer[65536];
+ MemoryPoolAllocator<> validatorAllocator(validatorBuffer, sizeof(validatorBuffer));
+
+ const int trialCount = 100000;
+ int testCount = 0;
+ clock_t start = clock();
+ for (int i = 0; i < trialCount; i++) {
+ for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr) {
+ const TestSuite& ts = **itr;
+ GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > validator(*ts.schema, &validatorAllocator);
+ for (DocumentList::const_iterator testItr = ts.tests.begin(); testItr != ts.tests.end(); ++testItr) {
+ validator.Reset();
+ (*testItr)->Accept(validator);
+ testCount++;
+ }
+ validatorAllocator.Clear();
+ }
+ }
+ clock_t end = clock();
+ double duration = double(end - start) / CLOCKS_PER_SEC;
+ printf("%d trials in %f s -> %f trials per sec\n", trialCount, duration, trialCount / duration);
+ printf("%d tests per trial\n", testCount / trialCount);
+}
+
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/CMakeLists.txt b/3rdparty/rapidjson/test/unittest/CMakeLists.txt
new file mode 100644
index 00000000000..0ae166282e5
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/CMakeLists.txt
@@ -0,0 +1,61 @@
+set(UNITTEST_SOURCES
+ allocatorstest.cpp
+ bigintegertest.cpp
+ documenttest.cpp
+ dtoatest.cpp
+ encodedstreamtest.cpp
+ encodingstest.cpp
+ fwdtest.cpp
+ filestreamtest.cpp
+ itoatest.cpp
+ istreamwrappertest.cpp
+ jsoncheckertest.cpp
+ namespacetest.cpp
+ pointertest.cpp
+ prettywritertest.cpp
+ ostreamwrappertest.cpp
+ readertest.cpp
+ regextest.cpp
+ schematest.cpp
+ simdtest.cpp
+ strfunctest.cpp
+ stringbuffertest.cpp
+ strtodtest.cpp
+ unittest.cpp
+ valuetest.cpp
+ writertest.cpp)
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal")
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything")
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
+endif()
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRAPIDJSON_HAS_STDSTRING=1")
+
+add_library(namespacetest STATIC namespacetest.cpp)
+
+add_executable(unittest ${UNITTEST_SOURCES})
+target_link_libraries(unittest ${TEST_LIBRARIES} namespacetest)
+
+add_dependencies(tests unittest)
+
+add_test(NAME unittest
+ COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
+
+if(NOT MSVC)
+ # Not running SIMD.* unit test cases for Valgrind
+ add_test(NAME valgrind_unittest
+ COMMAND valgrind --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.*
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
+
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_test(NAME symbol_check
+ COMMAND sh -c "objdump -t -C libnamespacetest.a | grep rapidjson ; test $? -ne 0"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
+
+endif(NOT MSVC)
diff --git a/3rdparty/rapidjson/test/unittest/allocatorstest.cpp b/3rdparty/rapidjson/test/unittest/allocatorstest.cpp
new file mode 100644
index 00000000000..a5958de199e
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/allocatorstest.cpp
@@ -0,0 +1,102 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/allocators.h"
+
+using namespace rapidjson;
+
+template <typename Allocator>
+void TestAllocator(Allocator& a) {
+ EXPECT_TRUE(a.Malloc(0) == 0);
+
+ uint8_t* p = static_cast<uint8_t*>(a.Malloc(100));
+ EXPECT_TRUE(p != 0);
+ for (size_t i = 0; i < 100; i++)
+ p[i] = static_cast<uint8_t>(i);
+
+ // Expand
+ uint8_t* q = static_cast<uint8_t*>(a.Realloc(p, 100, 200));
+ EXPECT_TRUE(q != 0);
+ for (size_t i = 0; i < 100; i++)
+ EXPECT_EQ(i, q[i]);
+ for (size_t i = 100; i < 200; i++)
+ q[i] = static_cast<uint8_t>(i);
+
+ // Shrink
+ uint8_t *r = static_cast<uint8_t*>(a.Realloc(q, 200, 150));
+ EXPECT_TRUE(r != 0);
+ for (size_t i = 0; i < 150; i++)
+ EXPECT_EQ(i, r[i]);
+
+ Allocator::Free(r);
+
+ // Realloc to zero size
+ EXPECT_TRUE(a.Realloc(a.Malloc(1), 1, 0) == 0);
+}
+
+TEST(Allocator, CrtAllocator) {
+ CrtAllocator a;
+ TestAllocator(a);
+}
+
+TEST(Allocator, MemoryPoolAllocator) {
+ MemoryPoolAllocator<> a;
+ TestAllocator(a);
+
+ for (size_t i = 1; i < 1000; i++) {
+ EXPECT_TRUE(a.Malloc(i) != 0);
+ EXPECT_LE(a.Size(), a.Capacity());
+ }
+}
+
+TEST(Allocator, Alignment) {
+#if RAPIDJSON_64BIT == 1
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000000, 0x00000000), RAPIDJSON_ALIGN(0));
+ for (uint64_t i = 1; i < 8; i++) {
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000000, 0x00000008), RAPIDJSON_ALIGN(i));
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000000, 0x00000010), RAPIDJSON_ALIGN(RAPIDJSON_UINT64_C2(0x00000000, 0x00000008) + i));
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000001, 0x00000000), RAPIDJSON_ALIGN(RAPIDJSON_UINT64_C2(0x00000000, 0xFFFFFFF8) + i));
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF8), RAPIDJSON_ALIGN(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0) + i));
+ }
+#else
+ EXPECT_EQ(0u, RAPIDJSON_ALIGN(0u));
+ for (uint32_t i = 1; i < 4; i++) {
+ EXPECT_EQ(4u, RAPIDJSON_ALIGN(i));
+ EXPECT_EQ(8u, RAPIDJSON_ALIGN(4u + i));
+ EXPECT_EQ(0xFFFFFFF8u, RAPIDJSON_ALIGN(0xFFFFFFF4u + i));
+ EXPECT_EQ(0xFFFFFFFCu, RAPIDJSON_ALIGN(0xFFFFFFF8u + i));
+ }
+#endif
+}
+
+TEST(Allocator, Issue399) {
+ MemoryPoolAllocator<> a;
+ void* p = a.Malloc(100);
+ void* q = a.Realloc(p, 100, 200);
+ EXPECT_EQ(p, q);
+
+ // exhuasive testing
+ for (size_t j = 1; j < 32; j++) {
+ a.Clear();
+ a.Malloc(j); // some unaligned size
+ p = a.Malloc(1);
+ for (size_t i = 1; i < 1024; i++) {
+ q = a.Realloc(p, i, i + 1);
+ EXPECT_EQ(p, q);
+ p = q;
+ }
+ }
+}
diff --git a/3rdparty/rapidjson/test/unittest/bigintegertest.cpp b/3rdparty/rapidjson/test/unittest/bigintegertest.cpp
new file mode 100644
index 00000000000..a68e1444672
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/bigintegertest.cpp
@@ -0,0 +1,133 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/internal/biginteger.h"
+
+using namespace rapidjson::internal;
+
+#define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1)
+
+static const BigInteger kZero(0);
+static const BigInteger kOne(1);
+static const BigInteger kUint64Max = BIGINTEGER_LITERAL("18446744073709551615");
+static const BigInteger kTwo64 = BIGINTEGER_LITERAL("18446744073709551616");
+
+TEST(BigInteger, Constructor) {
+ EXPECT_TRUE(kZero.IsZero());
+ EXPECT_TRUE(kZero == kZero);
+ EXPECT_TRUE(kZero == BIGINTEGER_LITERAL("0"));
+ EXPECT_TRUE(kZero == BIGINTEGER_LITERAL("00"));
+
+ const BigInteger a(123);
+ EXPECT_TRUE(a == a);
+ EXPECT_TRUE(a == BIGINTEGER_LITERAL("123"));
+ EXPECT_TRUE(a == BIGINTEGER_LITERAL("0123"));
+
+ EXPECT_EQ(2u, kTwo64.GetCount());
+ EXPECT_EQ(0u, kTwo64.GetDigit(0));
+ EXPECT_EQ(1u, kTwo64.GetDigit(1));
+}
+
+TEST(BigInteger, AddUint64) {
+ BigInteger a = kZero;
+ a += 0u;
+ EXPECT_TRUE(kZero == a);
+
+ a += 1u;
+ EXPECT_TRUE(kOne == a);
+
+ a += 1u;
+ EXPECT_TRUE(BigInteger(2) == a);
+
+ EXPECT_TRUE(BigInteger(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)) == kUint64Max);
+ BigInteger b = kUint64Max;
+ b += 1u;
+ EXPECT_TRUE(kTwo64 == b);
+ b += RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF);
+ EXPECT_TRUE(BIGINTEGER_LITERAL("36893488147419103231") == b);
+}
+
+TEST(BigInteger, MultiplyUint64) {
+ BigInteger a = kZero;
+ a *= static_cast <uint64_t>(0);
+ EXPECT_TRUE(kZero == a);
+ a *= static_cast <uint64_t>(123);
+ EXPECT_TRUE(kZero == a);
+
+ BigInteger b = kOne;
+ b *= static_cast<uint64_t>(1);
+ EXPECT_TRUE(kOne == b);
+ b *= static_cast<uint64_t>(0);
+ EXPECT_TRUE(kZero == b);
+
+ BigInteger c(123);
+ c *= static_cast<uint64_t>(456u);
+ EXPECT_TRUE(BigInteger(123u * 456u) == c);
+ c *= RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF);
+ EXPECT_TRUE(BIGINTEGER_LITERAL("1034640981606221330982120") == c);
+ c *= RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF);
+ EXPECT_TRUE(BIGINTEGER_LITERAL("19085757395861596536664473018420572782123800") == c);
+}
+
+TEST(BigInteger, MultiplyUint32) {
+ BigInteger a = kZero;
+ a *= static_cast <uint32_t>(0);
+ EXPECT_TRUE(kZero == a);
+ a *= static_cast <uint32_t>(123);
+ EXPECT_TRUE(kZero == a);
+
+ BigInteger b = kOne;
+ b *= static_cast<uint32_t>(1);
+ EXPECT_TRUE(kOne == b);
+ b *= static_cast<uint32_t>(0);
+ EXPECT_TRUE(kZero == b);
+
+ BigInteger c(123);
+ c *= static_cast<uint32_t>(456u);
+ EXPECT_TRUE(BigInteger(123u * 456u) == c);
+ c *= 0xFFFFFFFFu;
+ EXPECT_TRUE(BIGINTEGER_LITERAL("240896125641960") == c);
+ c *= 0xFFFFFFFFu;
+ EXPECT_TRUE(BIGINTEGER_LITERAL("1034640981124429079698200") == c);
+}
+
+TEST(BigInteger, LeftShift) {
+ BigInteger a = kZero;
+ a <<= 1;
+ EXPECT_TRUE(kZero == a);
+ a <<= 64;
+ EXPECT_TRUE(kZero == a);
+
+ a = BigInteger(123);
+ a <<= 0;
+ EXPECT_TRUE(BigInteger(123) == a);
+ a <<= 1;
+ EXPECT_TRUE(BigInteger(246) == a);
+ a <<= 64;
+ EXPECT_TRUE(BIGINTEGER_LITERAL("4537899042132549697536") == a);
+ a <<= 99;
+ EXPECT_TRUE(BIGINTEGER_LITERAL("2876235222267216943024851750785644982682875244576768") == a);
+}
+
+TEST(BigInteger, Compare) {
+ EXPECT_EQ(0, kZero.Compare(kZero));
+ EXPECT_EQ(1, kOne.Compare(kZero));
+ EXPECT_EQ(-1, kZero.Compare(kOne));
+ EXPECT_EQ(0, kUint64Max.Compare(kUint64Max));
+ EXPECT_EQ(0, kTwo64.Compare(kTwo64));
+ EXPECT_EQ(-1, kUint64Max.Compare(kTwo64));
+ EXPECT_EQ(1, kTwo64.Compare(kUint64Max));
+}
diff --git a/3rdparty/rapidjson/test/unittest/documenttest.cpp b/3rdparty/rapidjson/test/unittest/documenttest.cpp
new file mode 100644
index 00000000000..afe696a1e21
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/documenttest.cpp
@@ -0,0 +1,589 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/stringbuffer.h"
+#include <sstream>
+#include <algorithm>
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+RAPIDJSON_DIAG_OFF(missing-variable-declarations)
+#endif
+
+using namespace rapidjson;
+
+template <typename DocumentType>
+void ParseCheck(DocumentType& doc) {
+ typedef typename DocumentType::ValueType ValueType;
+
+ EXPECT_FALSE(doc.HasParseError());
+ EXPECT_TRUE(static_cast<ParseResult>(doc));
+
+ EXPECT_TRUE(doc.IsObject());
+
+ EXPECT_TRUE(doc.HasMember("hello"));
+ const ValueType& hello = doc["hello"];
+ EXPECT_TRUE(hello.IsString());
+ EXPECT_STREQ("world", hello.GetString());
+
+ EXPECT_TRUE(doc.HasMember("t"));
+ const ValueType& t = doc["t"];
+ EXPECT_TRUE(t.IsTrue());
+
+ EXPECT_TRUE(doc.HasMember("f"));
+ const ValueType& f = doc["f"];
+ EXPECT_TRUE(f.IsFalse());
+
+ EXPECT_TRUE(doc.HasMember("n"));
+ const ValueType& n = doc["n"];
+ EXPECT_TRUE(n.IsNull());
+
+ EXPECT_TRUE(doc.HasMember("i"));
+ const ValueType& i = doc["i"];
+ EXPECT_TRUE(i.IsNumber());
+ EXPECT_EQ(123, i.GetInt());
+
+ EXPECT_TRUE(doc.HasMember("pi"));
+ const ValueType& pi = doc["pi"];
+ EXPECT_TRUE(pi.IsNumber());
+ EXPECT_DOUBLE_EQ(3.1416, pi.GetDouble());
+
+ EXPECT_TRUE(doc.HasMember("a"));
+ const ValueType& a = doc["a"];
+ EXPECT_TRUE(a.IsArray());
+ EXPECT_EQ(4u, a.Size());
+ for (SizeType j = 0; j < 4; j++)
+ EXPECT_EQ(j + 1, a[j].GetUint());
+}
+
+template <typename Allocator, typename StackAllocator>
+void ParseTest() {
+ typedef GenericDocument<UTF8<>, Allocator, StackAllocator> DocumentType;
+ DocumentType doc;
+
+ const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
+
+ doc.Parse(json);
+ ParseCheck(doc);
+
+ doc.SetNull();
+ StringStream s(json);
+ doc.template ParseStream<0>(s);
+ ParseCheck(doc);
+
+ doc.SetNull();
+ char *buffer = strdup(json);
+ doc.ParseInsitu(buffer);
+ ParseCheck(doc);
+ free(buffer);
+}
+
+TEST(Document, Parse) {
+ ParseTest<MemoryPoolAllocator<>, CrtAllocator>();
+ ParseTest<MemoryPoolAllocator<>, MemoryPoolAllocator<> >();
+ ParseTest<CrtAllocator, MemoryPoolAllocator<> >();
+ ParseTest<CrtAllocator, CrtAllocator>();
+}
+
+TEST(Document, UnchangedOnParseError) {
+ Document doc;
+ doc.SetArray().PushBack(0, doc.GetAllocator());
+
+ ParseResult err = doc.Parse("{]");
+ EXPECT_TRUE(doc.HasParseError());
+ EXPECT_EQ(err.Code(), doc.GetParseError());
+ EXPECT_EQ(err.Offset(), doc.GetErrorOffset());
+ EXPECT_TRUE(doc.IsArray());
+ EXPECT_EQ(doc.Size(), 1u);
+
+ err = doc.Parse("{}");
+ EXPECT_FALSE(doc.HasParseError());
+ EXPECT_FALSE(err.IsError());
+ EXPECT_EQ(err.Code(), doc.GetParseError());
+ EXPECT_EQ(err.Offset(), doc.GetErrorOffset());
+ EXPECT_TRUE(doc.IsObject());
+ EXPECT_EQ(doc.MemberCount(), 0u);
+}
+
+static FILE* OpenEncodedFile(const char* filename) {
+ const char *paths[] = {
+ "encodings",
+ "bin/encodings",
+ "../bin/encodings",
+ "../../bin/encodings",
+ "../../../bin/encodings"
+ };
+ char buffer[1024];
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ sprintf(buffer, "%s/%s", paths[i], filename);
+ FILE *fp = fopen(buffer, "rb");
+ if (fp)
+ return fp;
+ }
+ return 0;
+}
+
+TEST(Document, ParseStream_EncodedInputStream) {
+ // UTF8 -> UTF16
+ FILE* fp = OpenEncodedFile("utf8.json");
+ char buffer[256];
+ FileReadStream bis(fp, buffer, sizeof(buffer));
+ EncodedInputStream<UTF8<>, FileReadStream> eis(bis);
+
+ GenericDocument<UTF16<> > d;
+ d.ParseStream<0, UTF8<> >(eis);
+ EXPECT_FALSE(d.HasParseError());
+
+ fclose(fp);
+
+ wchar_t expected[] = L"I can eat glass and it doesn't hurt me.";
+ GenericValue<UTF16<> >& v = d[L"en"];
+ EXPECT_TRUE(v.IsString());
+ EXPECT_EQ(sizeof(expected) / sizeof(wchar_t) - 1, v.GetStringLength());
+ EXPECT_EQ(0, StrCmp(expected, v.GetString()));
+
+ // UTF16 -> UTF8 in memory
+ StringBuffer bos;
+ typedef EncodedOutputStream<UTF8<>, StringBuffer> OutputStream;
+ OutputStream eos(bos, false); // Not writing BOM
+ {
+ Writer<OutputStream, UTF16<>, UTF8<> > writer(eos);
+ d.Accept(writer);
+ }
+
+ // Condense the original file and compare.
+ fp = OpenEncodedFile("utf8.json");
+ FileReadStream is(fp, buffer, sizeof(buffer));
+ Reader reader;
+ StringBuffer bos2;
+ Writer<StringBuffer> writer2(bos2);
+ reader.Parse(is, writer2);
+ fclose(fp);
+
+ EXPECT_EQ(bos.GetSize(), bos2.GetSize());
+ EXPECT_EQ(0, memcmp(bos.GetString(), bos2.GetString(), bos2.GetSize()));
+}
+
+TEST(Document, ParseStream_AutoUTFInputStream) {
+ // Any -> UTF8
+ FILE* fp = OpenEncodedFile("utf32be.json");
+ char buffer[256];
+ FileReadStream bis(fp, buffer, sizeof(buffer));
+ AutoUTFInputStream<unsigned, FileReadStream> eis(bis);
+
+ Document d;
+ d.ParseStream<0, AutoUTF<unsigned> >(eis);
+ EXPECT_FALSE(d.HasParseError());
+
+ fclose(fp);
+
+ char expected[] = "I can eat glass and it doesn't hurt me.";
+ Value& v = d["en"];
+ EXPECT_TRUE(v.IsString());
+ EXPECT_EQ(sizeof(expected) - 1, v.GetStringLength());
+ EXPECT_EQ(0, StrCmp(expected, v.GetString()));
+
+ // UTF8 -> UTF8 in memory
+ StringBuffer bos;
+ Writer<StringBuffer> writer(bos);
+ d.Accept(writer);
+
+ // Condense the original file and compare.
+ fp = OpenEncodedFile("utf8.json");
+ FileReadStream is(fp, buffer, sizeof(buffer));
+ Reader reader;
+ StringBuffer bos2;
+ Writer<StringBuffer> writer2(bos2);
+ reader.Parse(is, writer2);
+ fclose(fp);
+
+ EXPECT_EQ(bos.GetSize(), bos2.GetSize());
+ EXPECT_EQ(0, memcmp(bos.GetString(), bos2.GetString(), bos2.GetSize()));
+}
+
+TEST(Document, Swap) {
+ Document d1;
+ Document::AllocatorType& a = d1.GetAllocator();
+
+ d1.SetArray().PushBack(1, a).PushBack(2, a);
+
+ Value o;
+ o.SetObject().AddMember("a", 1, a);
+
+ // Swap between Document and Value
+ // d1.Swap(o); // doesn't compile
+ o.Swap(d1);
+ EXPECT_TRUE(d1.IsObject());
+ EXPECT_TRUE(o.IsArray());
+
+ // Swap between Document and Document
+ Document d2;
+ d2.SetArray().PushBack(3, a);
+ d1.Swap(d2);
+ EXPECT_TRUE(d1.IsArray());
+ EXPECT_TRUE(d2.IsObject());
+ EXPECT_EQ(&d2.GetAllocator(), &a);
+
+ // reset value
+ Value().Swap(d1);
+ EXPECT_TRUE(d1.IsNull());
+
+ // reset document, including allocator
+ Document().Swap(d2);
+ EXPECT_TRUE(d2.IsNull());
+ EXPECT_NE(&d2.GetAllocator(), &a);
+
+ // testing std::swap compatibility
+ d1.SetBool(true);
+ using std::swap;
+ swap(d1, d2);
+ EXPECT_TRUE(d1.IsNull());
+ EXPECT_TRUE(d2.IsTrue());
+
+ swap(o, d2);
+ EXPECT_TRUE(o.IsTrue());
+ EXPECT_TRUE(d2.IsArray());
+}
+
+
+// This should be slow due to assignment in inner-loop.
+struct OutputStringStream : public std::ostringstream {
+ typedef char Ch;
+
+ virtual ~OutputStringStream();
+
+ void Put(char c) {
+ put(c);
+ }
+ void Flush() {}
+};
+
+OutputStringStream::~OutputStringStream() {}
+
+TEST(Document, AcceptWriter) {
+ Document doc;
+ doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
+
+ OutputStringStream os;
+ Writer<OutputStringStream> writer(os);
+ doc.Accept(writer);
+
+ EXPECT_EQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3,4]}", os.str());
+}
+
+TEST(Document, UserBuffer) {
+ typedef GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<> > DocumentType;
+ char valueBuffer[4096];
+ char parseBuffer[1024];
+ MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer));
+ MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer));
+ DocumentType doc(&valueAllocator, sizeof(parseBuffer) / 2, &parseAllocator);
+ doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
+ EXPECT_FALSE(doc.HasParseError());
+ EXPECT_LE(valueAllocator.Size(), sizeof(valueBuffer));
+ EXPECT_LE(parseAllocator.Size(), sizeof(parseBuffer));
+
+ // Cover MemoryPoolAllocator::Capacity()
+ EXPECT_LE(valueAllocator.Size(), valueAllocator.Capacity());
+ EXPECT_LE(parseAllocator.Size(), parseAllocator.Capacity());
+}
+
+// Issue 226: Value of string type should not point to NULL
+TEST(Document, AssertAcceptInvalidNameType) {
+ Document doc;
+ doc.SetObject();
+ doc.AddMember("a", 0, doc.GetAllocator());
+ doc.FindMember("a")->name.SetNull(); // Change name to non-string type.
+
+ OutputStringStream os;
+ Writer<OutputStringStream> writer(os);
+ ASSERT_THROW(doc.Accept(writer), AssertException);
+}
+
+// Issue 44: SetStringRaw doesn't work with wchar_t
+TEST(Document, UTF16_Document) {
+ GenericDocument< UTF16<> > json;
+ json.Parse<kParseValidateEncodingFlag>(L"[{\"created_at\":\"Wed Oct 30 17:13:20 +0000 2012\"}]");
+
+ ASSERT_TRUE(json.IsArray());
+ GenericValue< UTF16<> >& v = json[0];
+ ASSERT_TRUE(v.IsObject());
+
+ GenericValue< UTF16<> >& s = v[L"created_at"];
+ ASSERT_TRUE(s.IsString());
+
+ EXPECT_EQ(0, memcmp(L"Wed Oct 30 17:13:20 +0000 2012", s.GetString(), (s.GetStringLength() + 1) * sizeof(wchar_t)));
+}
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+#if 0 // Many old compiler does not support these. Turn it off temporaily.
+
+#include <type_traits>
+
+TEST(Document, Traits) {
+ static_assert(std::is_constructible<Document>::value, "");
+ static_assert(std::is_default_constructible<Document>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_copy_constructible<Document>::value, "");
+#endif
+ static_assert(std::is_move_constructible<Document>::value, "");
+
+ static_assert(!std::is_nothrow_constructible<Document>::value, "");
+ static_assert(!std::is_nothrow_default_constructible<Document>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_nothrow_copy_constructible<Document>::value, "");
+ static_assert(std::is_nothrow_move_constructible<Document>::value, "");
+#endif
+
+ static_assert(std::is_assignable<Document,Document>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_copy_assignable<Document>::value, "");
+#endif
+ static_assert(std::is_move_assignable<Document>::value, "");
+
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_assignable<Document, Document>::value, "");
+#endif
+ static_assert(!std::is_nothrow_copy_assignable<Document>::value, "");
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_move_assignable<Document>::value, "");
+#endif
+
+ static_assert( std::is_destructible<Document>::value, "");
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_destructible<Document>::value, "");
+#endif
+}
+
+#endif
+
+template <typename Allocator>
+struct DocumentMove: public ::testing::Test {
+};
+
+typedef ::testing::Types< CrtAllocator, MemoryPoolAllocator<> > MoveAllocatorTypes;
+TYPED_TEST_CASE(DocumentMove, MoveAllocatorTypes);
+
+TYPED_TEST(DocumentMove, MoveConstructor) {
+ typedef TypeParam Allocator;
+ typedef GenericDocument<UTF8<>, Allocator> Document;
+ Allocator allocator;
+
+ Document a(&allocator);
+ a.Parse("[\"one\", \"two\", \"three\"]");
+ EXPECT_FALSE(a.HasParseError());
+ EXPECT_TRUE(a.IsArray());
+ EXPECT_EQ(3u, a.Size());
+ EXPECT_EQ(&a.GetAllocator(), &allocator);
+
+ // Document b(a); // does not compile (!is_copy_constructible)
+ Document b(std::move(a));
+ EXPECT_TRUE(a.IsNull());
+ EXPECT_TRUE(b.IsArray());
+ EXPECT_EQ(3u, b.Size());
+ EXPECT_THROW(a.GetAllocator(), AssertException);
+ EXPECT_EQ(&b.GetAllocator(), &allocator);
+
+ b.Parse("{\"Foo\": \"Bar\", \"Baz\": 42}");
+ EXPECT_FALSE(b.HasParseError());
+ EXPECT_TRUE(b.IsObject());
+ EXPECT_EQ(2u, b.MemberCount());
+
+ // Document c = a; // does not compile (!is_copy_constructible)
+ Document c = std::move(b);
+ EXPECT_TRUE(b.IsNull());
+ EXPECT_TRUE(c.IsObject());
+ EXPECT_EQ(2u, c.MemberCount());
+ EXPECT_THROW(b.GetAllocator(), AssertException);
+ EXPECT_EQ(&c.GetAllocator(), &allocator);
+}
+
+TYPED_TEST(DocumentMove, MoveConstructorParseError) {
+ typedef TypeParam Allocator;
+ typedef GenericDocument<UTF8<>, Allocator> Document;
+
+ ParseResult noError;
+ Document a;
+ a.Parse("{ 4 = 4]");
+ ParseResult error(a.GetParseError(), a.GetErrorOffset());
+ EXPECT_TRUE(a.HasParseError());
+ EXPECT_NE(error.Code(), noError.Code());
+ EXPECT_NE(error.Offset(), noError.Offset());
+
+ Document b(std::move(a));
+ EXPECT_FALSE(a.HasParseError());
+ EXPECT_TRUE(b.HasParseError());
+ EXPECT_EQ(a.GetParseError(), noError.Code());
+ EXPECT_EQ(b.GetParseError(), error.Code());
+ EXPECT_EQ(a.GetErrorOffset(), noError.Offset());
+ EXPECT_EQ(b.GetErrorOffset(), error.Offset());
+
+ Document c(std::move(b));
+ EXPECT_FALSE(b.HasParseError());
+ EXPECT_TRUE(c.HasParseError());
+ EXPECT_EQ(b.GetParseError(), noError.Code());
+ EXPECT_EQ(c.GetParseError(), error.Code());
+ EXPECT_EQ(b.GetErrorOffset(), noError.Offset());
+ EXPECT_EQ(c.GetErrorOffset(), error.Offset());
+}
+
+// This test does not properly use parsing, just for testing.
+// It must call ClearStack() explicitly to prevent memory leak.
+// But here we cannot as ClearStack() is private.
+#if 0
+TYPED_TEST(DocumentMove, MoveConstructorStack) {
+ typedef TypeParam Allocator;
+ typedef UTF8<> Encoding;
+ typedef GenericDocument<Encoding, Allocator> Document;
+
+ Document a;
+ size_t defaultCapacity = a.GetStackCapacity();
+
+ // Trick Document into getting GetStackCapacity() to return non-zero
+ typedef GenericReader<Encoding, Encoding, Allocator> Reader;
+ Reader reader(&a.GetAllocator());
+ GenericStringStream<Encoding> is("[\"one\", \"two\", \"three\"]");
+ reader.template Parse<kParseDefaultFlags>(is, a);
+ size_t capacity = a.GetStackCapacity();
+ EXPECT_GT(capacity, 0u);
+
+ Document b(std::move(a));
+ EXPECT_EQ(a.GetStackCapacity(), defaultCapacity);
+ EXPECT_EQ(b.GetStackCapacity(), capacity);
+
+ Document c = std::move(b);
+ EXPECT_EQ(b.GetStackCapacity(), defaultCapacity);
+ EXPECT_EQ(c.GetStackCapacity(), capacity);
+}
+#endif
+
+TYPED_TEST(DocumentMove, MoveAssignment) {
+ typedef TypeParam Allocator;
+ typedef GenericDocument<UTF8<>, Allocator> Document;
+ Allocator allocator;
+
+ Document a(&allocator);
+ a.Parse("[\"one\", \"two\", \"three\"]");
+ EXPECT_FALSE(a.HasParseError());
+ EXPECT_TRUE(a.IsArray());
+ EXPECT_EQ(3u, a.Size());
+ EXPECT_EQ(&a.GetAllocator(), &allocator);
+
+ // Document b; b = a; // does not compile (!is_copy_assignable)
+ Document b;
+ b = std::move(a);
+ EXPECT_TRUE(a.IsNull());
+ EXPECT_TRUE(b.IsArray());
+ EXPECT_EQ(3u, b.Size());
+ EXPECT_THROW(a.GetAllocator(), AssertException);
+ EXPECT_EQ(&b.GetAllocator(), &allocator);
+
+ b.Parse("{\"Foo\": \"Bar\", \"Baz\": 42}");
+ EXPECT_FALSE(b.HasParseError());
+ EXPECT_TRUE(b.IsObject());
+ EXPECT_EQ(2u, b.MemberCount());
+
+ // Document c; c = a; // does not compile (see static_assert)
+ Document c;
+ c = std::move(b);
+ EXPECT_TRUE(b.IsNull());
+ EXPECT_TRUE(c.IsObject());
+ EXPECT_EQ(2u, c.MemberCount());
+ EXPECT_THROW(b.GetAllocator(), AssertException);
+ EXPECT_EQ(&c.GetAllocator(), &allocator);
+}
+
+TYPED_TEST(DocumentMove, MoveAssignmentParseError) {
+ typedef TypeParam Allocator;
+ typedef GenericDocument<UTF8<>, Allocator> Document;
+
+ ParseResult noError;
+ Document a;
+ a.Parse("{ 4 = 4]");
+ ParseResult error(a.GetParseError(), a.GetErrorOffset());
+ EXPECT_TRUE(a.HasParseError());
+ EXPECT_NE(error.Code(), noError.Code());
+ EXPECT_NE(error.Offset(), noError.Offset());
+
+ Document b;
+ b = std::move(a);
+ EXPECT_FALSE(a.HasParseError());
+ EXPECT_TRUE(b.HasParseError());
+ EXPECT_EQ(a.GetParseError(), noError.Code());
+ EXPECT_EQ(b.GetParseError(), error.Code());
+ EXPECT_EQ(a.GetErrorOffset(), noError.Offset());
+ EXPECT_EQ(b.GetErrorOffset(), error.Offset());
+
+ Document c;
+ c = std::move(b);
+ EXPECT_FALSE(b.HasParseError());
+ EXPECT_TRUE(c.HasParseError());
+ EXPECT_EQ(b.GetParseError(), noError.Code());
+ EXPECT_EQ(c.GetParseError(), error.Code());
+ EXPECT_EQ(b.GetErrorOffset(), noError.Offset());
+ EXPECT_EQ(c.GetErrorOffset(), error.Offset());
+}
+
+// This test does not properly use parsing, just for testing.
+// It must call ClearStack() explicitly to prevent memory leak.
+// But here we cannot as ClearStack() is private.
+#if 0
+TYPED_TEST(DocumentMove, MoveAssignmentStack) {
+ typedef TypeParam Allocator;
+ typedef UTF8<> Encoding;
+ typedef GenericDocument<Encoding, Allocator> Document;
+
+ Document a;
+ size_t defaultCapacity = a.GetStackCapacity();
+
+ // Trick Document into getting GetStackCapacity() to return non-zero
+ typedef GenericReader<Encoding, Encoding, Allocator> Reader;
+ Reader reader(&a.GetAllocator());
+ GenericStringStream<Encoding> is("[\"one\", \"two\", \"three\"]");
+ reader.template Parse<kParseDefaultFlags>(is, a);
+ size_t capacity = a.GetStackCapacity();
+ EXPECT_GT(capacity, 0u);
+
+ Document b;
+ b = std::move(a);
+ EXPECT_EQ(a.GetStackCapacity(), defaultCapacity);
+ EXPECT_EQ(b.GetStackCapacity(), capacity);
+
+ Document c;
+ c = std::move(b);
+ EXPECT_EQ(b.GetStackCapacity(), defaultCapacity);
+ EXPECT_EQ(c.GetStackCapacity(), capacity);
+}
+#endif
+
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+// Issue 22: Memory corruption via operator=
+// Fixed by making unimplemented assignment operator private.
+//TEST(Document, Assignment) {
+// Document d1;
+// Document d2;
+// d1 = d2;
+//}
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/dtoatest.cpp b/3rdparty/rapidjson/test/unittest/dtoatest.cpp
new file mode 100644
index 00000000000..da020957211
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/dtoatest.cpp
@@ -0,0 +1,91 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/internal/dtoa.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(type-limits)
+#endif
+
+using namespace rapidjson::internal;
+
+TEST(dtoa, normal) {
+ char buffer[30];
+
+#define TEST_DTOA(d, a)\
+ *dtoa(d, buffer) = '\0';\
+ EXPECT_STREQ(a, buffer)
+
+ TEST_DTOA(0.0, "0.0");
+ TEST_DTOA(-0.0, "-0.0");
+ TEST_DTOA(1.0, "1.0");
+ TEST_DTOA(-1.0, "-1.0");
+ TEST_DTOA(1.2345, "1.2345");
+ TEST_DTOA(1.2345678, "1.2345678");
+ TEST_DTOA(0.123456789012, "0.123456789012");
+ TEST_DTOA(1234567.8, "1234567.8");
+ TEST_DTOA(0.000001, "0.000001");
+ TEST_DTOA(0.0000001, "1e-7");
+ TEST_DTOA(1e30, "1e30");
+ TEST_DTOA(1.234567890123456e30, "1.234567890123456e30");
+ TEST_DTOA(5e-324, "5e-324"); // Min subnormal positive double
+ TEST_DTOA(2.225073858507201e-308, "2.225073858507201e-308"); // Max subnormal positive double
+ TEST_DTOA(2.2250738585072014e-308, "2.2250738585072014e-308"); // Min normal positive double
+ TEST_DTOA(1.7976931348623157e308, "1.7976931348623157e308"); // Max double
+
+#undef TEST_DTOA
+}
+
+TEST(dtoa, maxDecimalPlaces) {
+ char buffer[30];
+
+#define TEST_DTOA(m, d, a)\
+ *dtoa(d, buffer, m) = '\0';\
+ EXPECT_STREQ(a, buffer)
+
+ TEST_DTOA(3, 0.0, "0.0");
+ TEST_DTOA(1, 0.0, "0.0");
+ TEST_DTOA(3, -0.0, "-0.0");
+ TEST_DTOA(3, 1.0, "1.0");
+ TEST_DTOA(3, -1.0, "-1.0");
+ TEST_DTOA(3, 1.2345, "1.234");
+ TEST_DTOA(2, 1.2345, "1.23");
+ TEST_DTOA(1, 1.2345, "1.2");
+ TEST_DTOA(3, 1.2345678, "1.234");
+ TEST_DTOA(3, 1.0001, "1.0");
+ TEST_DTOA(2, 1.0001, "1.0");
+ TEST_DTOA(1, 1.0001, "1.0");
+ TEST_DTOA(3, 0.123456789012, "0.123");
+ TEST_DTOA(2, 0.123456789012, "0.12");
+ TEST_DTOA(1, 0.123456789012, "0.1");
+ TEST_DTOA(4, 0.0001, "0.0001");
+ TEST_DTOA(3, 0.0001, "0.0");
+ TEST_DTOA(2, 0.0001, "0.0");
+ TEST_DTOA(1, 0.0001, "0.0");
+ TEST_DTOA(3, 1234567.8, "1234567.8");
+ TEST_DTOA(3, 1e30, "1e30");
+ TEST_DTOA(3, 5e-324, "0.0"); // Min subnormal positive double
+ TEST_DTOA(3, 2.225073858507201e-308, "0.0"); // Max subnormal positive double
+ TEST_DTOA(3, 2.2250738585072014e-308, "0.0"); // Min normal positive double
+ TEST_DTOA(3, 1.7976931348623157e308, "1.7976931348623157e308"); // Max double
+
+#undef TEST_DTOA
+}
+
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/encodedstreamtest.cpp b/3rdparty/rapidjson/test/unittest/encodedstreamtest.cpp
new file mode 100644
index 00000000000..bc234d3ba76
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/encodedstreamtest.cpp
@@ -0,0 +1,313 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/memorystream.h"
+#include "rapidjson/memorybuffer.h"
+
+using namespace rapidjson;
+
+class EncodedStreamTest : public ::testing::Test {
+public:
+ EncodedStreamTest() : json_(), length_() {}
+ virtual ~EncodedStreamTest();
+
+ virtual void SetUp() {
+ json_ = ReadFile("utf8.json", true, &length_);
+ }
+
+ virtual void TearDown() {
+ free(json_);
+ json_ = 0;
+ }
+
+private:
+ EncodedStreamTest(const EncodedStreamTest&);
+ EncodedStreamTest& operator=(const EncodedStreamTest&);
+
+protected:
+ static FILE* Open(const char* filename) {
+ const char *paths[] = {
+ "encodings",
+ "bin/encodings",
+ "../bin/encodings",
+ "../../bin/encodings",
+ "../../../bin/encodings"
+ };
+ char buffer[1024];
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ sprintf(buffer, "%s/%s", paths[i], filename);
+ FILE *fp = fopen(buffer, "rb");
+ if (fp)
+ return fp;
+ }
+ return 0;
+ }
+
+ static char *ReadFile(const char* filename, bool appendPath, size_t* outLength) {
+ FILE *fp = appendPath ? Open(filename) : fopen(filename, "rb");
+
+ if (!fp) {
+ *outLength = 0;
+ return 0;
+ }
+
+ fseek(fp, 0, SEEK_END);
+ *outLength = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+ char* buffer = static_cast<char*>(malloc(*outLength + 1));
+ size_t readLength = fread(buffer, 1, *outLength, fp);
+ buffer[readLength] = '\0';
+ fclose(fp);
+ return buffer;
+ }
+
+ template <typename FileEncoding, typename MemoryEncoding>
+ void TestEncodedInputStream(const char* filename) {
+ // Test FileReadStream
+ {
+ char buffer[16];
+ FILE *fp = Open(filename);
+ ASSERT_TRUE(fp != 0);
+ FileReadStream fs(fp, buffer, sizeof(buffer));
+ EncodedInputStream<FileEncoding, FileReadStream> eis(fs);
+ StringStream s(json_);
+
+ while (eis.Peek() != '\0') {
+ unsigned expected, actual;
+ EXPECT_TRUE(UTF8<>::Decode(s, &expected));
+ EXPECT_TRUE(MemoryEncoding::Decode(eis, &actual));
+ EXPECT_EQ(expected, actual);
+ }
+ EXPECT_EQ('\0', s.Peek());
+ fclose(fp);
+ }
+
+ // Test MemoryStream
+ {
+ size_t size;
+ char* data = ReadFile(filename, true, &size);
+ MemoryStream ms(data, size);
+ EncodedInputStream<FileEncoding, MemoryStream> eis(ms);
+ StringStream s(json_);
+
+ while (eis.Peek() != '\0') {
+ unsigned expected, actual;
+ EXPECT_TRUE(UTF8<>::Decode(s, &expected));
+ EXPECT_TRUE(MemoryEncoding::Decode(eis, &actual));
+ EXPECT_EQ(expected, actual);
+ }
+ EXPECT_EQ('\0', s.Peek());
+ free(data);
+ EXPECT_EQ(size, eis.Tell());
+ }
+ }
+
+ void TestAutoUTFInputStream(const char *filename, bool expectHasBOM) {
+ // Test FileReadStream
+ {
+ char buffer[16];
+ FILE *fp = Open(filename);
+ ASSERT_TRUE(fp != 0);
+ FileReadStream fs(fp, buffer, sizeof(buffer));
+ AutoUTFInputStream<unsigned, FileReadStream> eis(fs);
+ EXPECT_EQ(expectHasBOM, eis.HasBOM());
+ StringStream s(json_);
+ while (eis.Peek() != '\0') {
+ unsigned expected, actual;
+ EXPECT_TRUE(UTF8<>::Decode(s, &expected));
+ EXPECT_TRUE(AutoUTF<unsigned>::Decode(eis, &actual));
+ EXPECT_EQ(expected, actual);
+ }
+ EXPECT_EQ('\0', s.Peek());
+ fclose(fp);
+ }
+
+ // Test MemoryStream
+ {
+ size_t size;
+ char* data = ReadFile(filename, true, &size);
+ MemoryStream ms(data, size);
+ AutoUTFInputStream<unsigned, MemoryStream> eis(ms);
+ EXPECT_EQ(expectHasBOM, eis.HasBOM());
+ StringStream s(json_);
+
+ while (eis.Peek() != '\0') {
+ unsigned expected, actual;
+ EXPECT_TRUE(UTF8<>::Decode(s, &expected));
+ EXPECT_TRUE(AutoUTF<unsigned>::Decode(eis, &actual));
+ EXPECT_EQ(expected, actual);
+ }
+ EXPECT_EQ('\0', s.Peek());
+ free(data);
+ EXPECT_EQ(size, eis.Tell());
+ }
+ }
+
+ template <typename FileEncoding, typename MemoryEncoding>
+ void TestEncodedOutputStream(const char* expectedFilename, bool putBOM) {
+ // Test FileWriteStream
+ {
+ char filename[L_tmpnam];
+ FILE* fp = TempFile(filename);
+ char buffer[16];
+ FileWriteStream os(fp, buffer, sizeof(buffer));
+ EncodedOutputStream<FileEncoding, FileWriteStream> eos(os, putBOM);
+ StringStream s(json_);
+ while (s.Peek() != '\0') {
+ bool success = Transcoder<UTF8<>, MemoryEncoding>::Transcode(s, eos);
+ EXPECT_TRUE(success);
+ }
+ eos.Flush();
+ fclose(fp);
+ EXPECT_TRUE(CompareFile(filename, expectedFilename));
+ remove(filename);
+ }
+
+ // Test MemoryBuffer
+ {
+ MemoryBuffer mb;
+ EncodedOutputStream<FileEncoding, MemoryBuffer> eos(mb, putBOM);
+ StringStream s(json_);
+ while (s.Peek() != '\0') {
+ bool success = Transcoder<UTF8<>, MemoryEncoding>::Transcode(s, eos);
+ EXPECT_TRUE(success);
+ }
+ eos.Flush();
+ EXPECT_TRUE(CompareBufferFile(mb.GetBuffer(), mb.GetSize(), expectedFilename));
+ }
+ }
+
+ void TestAutoUTFOutputStream(UTFType type, bool putBOM, const char *expectedFilename) {
+ // Test FileWriteStream
+ {
+ char filename[L_tmpnam];
+ FILE* fp = TempFile(filename);
+
+ char buffer[16];
+ FileWriteStream os(fp, buffer, sizeof(buffer));
+ AutoUTFOutputStream<unsigned, FileWriteStream> eos(os, type, putBOM);
+ StringStream s(json_);
+ while (s.Peek() != '\0') {
+ bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);
+ EXPECT_TRUE(success);
+ }
+ eos.Flush();
+ fclose(fp);
+ EXPECT_TRUE(CompareFile(filename, expectedFilename));
+ remove(filename);
+ }
+
+ // Test MemoryBuffer
+ {
+ MemoryBuffer mb;
+ AutoUTFOutputStream<unsigned, MemoryBuffer> eos(mb, type, putBOM);
+ StringStream s(json_);
+ while (s.Peek() != '\0') {
+ bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);
+ EXPECT_TRUE(success);
+ }
+ eos.Flush();
+ EXPECT_TRUE(CompareBufferFile(mb.GetBuffer(), mb.GetSize(), expectedFilename));
+ }
+ }
+
+ bool CompareFile(const char* filename, const char* expectedFilename) {
+ size_t actualLength, expectedLength;
+ char* actualBuffer = ReadFile(filename, false, &actualLength);
+ char* expectedBuffer = ReadFile(expectedFilename, true, &expectedLength);
+ bool ret = (expectedLength == actualLength) && memcmp(expectedBuffer, actualBuffer, actualLength) == 0;
+ free(actualBuffer);
+ free(expectedBuffer);
+ return ret;
+ }
+
+ bool CompareBufferFile(const char* actualBuffer, size_t actualLength, const char* expectedFilename) {
+ size_t expectedLength;
+ char* expectedBuffer = ReadFile(expectedFilename, true, &expectedLength);
+ bool ret = (expectedLength == actualLength) && memcmp(expectedBuffer, actualBuffer, actualLength) == 0;
+ free(expectedBuffer);
+ return ret;
+ }
+
+ char *json_;
+ size_t length_;
+};
+
+EncodedStreamTest::~EncodedStreamTest() {}
+
+TEST_F(EncodedStreamTest, EncodedInputStream) {
+ TestEncodedInputStream<UTF8<>, UTF8<> >("utf8.json");
+ TestEncodedInputStream<UTF8<>, UTF8<> >("utf8bom.json");
+ TestEncodedInputStream<UTF16LE<>, UTF16<> >("utf16le.json");
+ TestEncodedInputStream<UTF16LE<>, UTF16<> >("utf16lebom.json");
+ TestEncodedInputStream<UTF16BE<>, UTF16<> >("utf16be.json");
+ TestEncodedInputStream<UTF16BE<>, UTF16<> >("utf16bebom.json");
+ TestEncodedInputStream<UTF32LE<>, UTF32<> >("utf32le.json");
+ TestEncodedInputStream<UTF32LE<>, UTF32<> >("utf32lebom.json");
+ TestEncodedInputStream<UTF32BE<>, UTF32<> >("utf32be.json");
+ TestEncodedInputStream<UTF32BE<>, UTF32<> >("utf32bebom.json");
+}
+
+TEST_F(EncodedStreamTest, AutoUTFInputStream) {
+ TestAutoUTFInputStream("utf8.json", false);
+ TestAutoUTFInputStream("utf8bom.json", true);
+ TestAutoUTFInputStream("utf16le.json", false);
+ TestAutoUTFInputStream("utf16lebom.json",true);
+ TestAutoUTFInputStream("utf16be.json", false);
+ TestAutoUTFInputStream("utf16bebom.json",true);
+ TestAutoUTFInputStream("utf32le.json", false);
+ TestAutoUTFInputStream("utf32lebom.json",true);
+ TestAutoUTFInputStream("utf32be.json", false);
+ TestAutoUTFInputStream("utf32bebom.json", true);
+
+ {
+ // Auto detection fail, use user defined UTF type
+ const char json[] = "{ }";
+ MemoryStream ms(json, sizeof(json));
+ AutoUTFInputStream<unsigned, MemoryStream> eis(ms, kUTF8);
+ EXPECT_FALSE(eis.HasBOM());
+ EXPECT_EQ(kUTF8, eis.GetType());
+ }
+}
+
+TEST_F(EncodedStreamTest, EncodedOutputStream) {
+ TestEncodedOutputStream<UTF8<>, UTF8<> >("utf8.json", false);
+ TestEncodedOutputStream<UTF8<>, UTF8<> >("utf8bom.json", true);
+ TestEncodedOutputStream<UTF16LE<>, UTF16<> >("utf16le.json", false);
+ TestEncodedOutputStream<UTF16LE<>, UTF16<> >("utf16lebom.json",true);
+ TestEncodedOutputStream<UTF16BE<>, UTF16<> >("utf16be.json", false);
+ TestEncodedOutputStream<UTF16BE<>, UTF16<> >("utf16bebom.json",true);
+ TestEncodedOutputStream<UTF32LE<>, UTF32<> >("utf32le.json", false);
+ TestEncodedOutputStream<UTF32LE<>, UTF32<> >("utf32lebom.json",true);
+ TestEncodedOutputStream<UTF32BE<>, UTF32<> >("utf32be.json", false);
+ TestEncodedOutputStream<UTF32BE<>, UTF32<> >("utf32bebom.json",true);
+}
+
+TEST_F(EncodedStreamTest, AutoUTFOutputStream) {
+ TestAutoUTFOutputStream(kUTF8, false, "utf8.json");
+ TestAutoUTFOutputStream(kUTF8, true, "utf8bom.json");
+ TestAutoUTFOutputStream(kUTF16LE, false, "utf16le.json");
+ TestAutoUTFOutputStream(kUTF16LE, true, "utf16lebom.json");
+ TestAutoUTFOutputStream(kUTF16BE, false, "utf16be.json");
+ TestAutoUTFOutputStream(kUTF16BE, true, "utf16bebom.json");
+ TestAutoUTFOutputStream(kUTF32LE, false, "utf32le.json");
+ TestAutoUTFOutputStream(kUTF32LE, true, "utf32lebom.json");
+ TestAutoUTFOutputStream(kUTF32BE, false, "utf32be.json");
+ TestAutoUTFOutputStream(kUTF32BE, true, "utf32bebom.json");
+}
diff --git a/3rdparty/rapidjson/test/unittest/encodingstest.cpp b/3rdparty/rapidjson/test/unittest/encodingstest.cpp
new file mode 100644
index 00000000000..b3cbb76607b
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/encodingstest.cpp
@@ -0,0 +1,425 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/stringbuffer.h"
+
+using namespace rapidjson;
+
+// Verification of encoders/decoders with Hoehrmann's UTF8 decoder
+
+// http://www.unicode.org/Public/UNIDATA/Blocks.txt
+static const unsigned kCodepointRanges[] = {
+ 0x0000, 0x007F, // Basic Latin
+ 0x0080, 0x00FF, // Latin-1 Supplement
+ 0x0100, 0x017F, // Latin Extended-A
+ 0x0180, 0x024F, // Latin Extended-B
+ 0x0250, 0x02AF, // IPA Extensions
+ 0x02B0, 0x02FF, // Spacing Modifier Letters
+ 0x0300, 0x036F, // Combining Diacritical Marks
+ 0x0370, 0x03FF, // Greek and Coptic
+ 0x0400, 0x04FF, // Cyrillic
+ 0x0500, 0x052F, // Cyrillic Supplement
+ 0x0530, 0x058F, // Armenian
+ 0x0590, 0x05FF, // Hebrew
+ 0x0600, 0x06FF, // Arabic
+ 0x0700, 0x074F, // Syriac
+ 0x0750, 0x077F, // Arabic Supplement
+ 0x0780, 0x07BF, // Thaana
+ 0x07C0, 0x07FF, // NKo
+ 0x0800, 0x083F, // Samaritan
+ 0x0840, 0x085F, // Mandaic
+ 0x0900, 0x097F, // Devanagari
+ 0x0980, 0x09FF, // Bengali
+ 0x0A00, 0x0A7F, // Gurmukhi
+ 0x0A80, 0x0AFF, // Gujarati
+ 0x0B00, 0x0B7F, // Oriya
+ 0x0B80, 0x0BFF, // Tamil
+ 0x0C00, 0x0C7F, // Telugu
+ 0x0C80, 0x0CFF, // Kannada
+ 0x0D00, 0x0D7F, // Malayalam
+ 0x0D80, 0x0DFF, // Sinhala
+ 0x0E00, 0x0E7F, // Thai
+ 0x0E80, 0x0EFF, // Lao
+ 0x0F00, 0x0FFF, // Tibetan
+ 0x1000, 0x109F, // Myanmar
+ 0x10A0, 0x10FF, // Georgian
+ 0x1100, 0x11FF, // Hangul Jamo
+ 0x1200, 0x137F, // Ethiopic
+ 0x1380, 0x139F, // Ethiopic Supplement
+ 0x13A0, 0x13FF, // Cherokee
+ 0x1400, 0x167F, // Unified Canadian Aboriginal Syllabics
+ 0x1680, 0x169F, // Ogham
+ 0x16A0, 0x16FF, // Runic
+ 0x1700, 0x171F, // Tagalog
+ 0x1720, 0x173F, // Hanunoo
+ 0x1740, 0x175F, // Buhid
+ 0x1760, 0x177F, // Tagbanwa
+ 0x1780, 0x17FF, // Khmer
+ 0x1800, 0x18AF, // Mongolian
+ 0x18B0, 0x18FF, // Unified Canadian Aboriginal Syllabics Extended
+ 0x1900, 0x194F, // Limbu
+ 0x1950, 0x197F, // Tai Le
+ 0x1980, 0x19DF, // New Tai Lue
+ 0x19E0, 0x19FF, // Khmer Symbols
+ 0x1A00, 0x1A1F, // Buginese
+ 0x1A20, 0x1AAF, // Tai Tham
+ 0x1B00, 0x1B7F, // Balinese
+ 0x1B80, 0x1BBF, // Sundanese
+ 0x1BC0, 0x1BFF, // Batak
+ 0x1C00, 0x1C4F, // Lepcha
+ 0x1C50, 0x1C7F, // Ol Chiki
+ 0x1CD0, 0x1CFF, // Vedic Extensions
+ 0x1D00, 0x1D7F, // Phonetic Extensions
+ 0x1D80, 0x1DBF, // Phonetic Extensions Supplement
+ 0x1DC0, 0x1DFF, // Combining Diacritical Marks Supplement
+ 0x1E00, 0x1EFF, // Latin Extended Additional
+ 0x1F00, 0x1FFF, // Greek Extended
+ 0x2000, 0x206F, // General Punctuation
+ 0x2070, 0x209F, // Superscripts and Subscripts
+ 0x20A0, 0x20CF, // Currency Symbols
+ 0x20D0, 0x20FF, // Combining Diacritical Marks for Symbols
+ 0x2100, 0x214F, // Letterlike Symbols
+ 0x2150, 0x218F, // Number Forms
+ 0x2190, 0x21FF, // Arrows
+ 0x2200, 0x22FF, // Mathematical Operators
+ 0x2300, 0x23FF, // Miscellaneous Technical
+ 0x2400, 0x243F, // Control Pictures
+ 0x2440, 0x245F, // Optical Character Recognition
+ 0x2460, 0x24FF, // Enclosed Alphanumerics
+ 0x2500, 0x257F, // Box Drawing
+ 0x2580, 0x259F, // Block Elements
+ 0x25A0, 0x25FF, // Geometric Shapes
+ 0x2600, 0x26FF, // Miscellaneous Symbols
+ 0x2700, 0x27BF, // Dingbats
+ 0x27C0, 0x27EF, // Miscellaneous Mathematical Symbols-A
+ 0x27F0, 0x27FF, // Supplemental Arrows-A
+ 0x2800, 0x28FF, // Braille Patterns
+ 0x2900, 0x297F, // Supplemental Arrows-B
+ 0x2980, 0x29FF, // Miscellaneous Mathematical Symbols-B
+ 0x2A00, 0x2AFF, // Supplemental Mathematical Operators
+ 0x2B00, 0x2BFF, // Miscellaneous Symbols and Arrows
+ 0x2C00, 0x2C5F, // Glagolitic
+ 0x2C60, 0x2C7F, // Latin Extended-C
+ 0x2C80, 0x2CFF, // Coptic
+ 0x2D00, 0x2D2F, // Georgian Supplement
+ 0x2D30, 0x2D7F, // Tifinagh
+ 0x2D80, 0x2DDF, // Ethiopic Extended
+ 0x2DE0, 0x2DFF, // Cyrillic Extended-A
+ 0x2E00, 0x2E7F, // Supplemental Punctuation
+ 0x2E80, 0x2EFF, // CJK Radicals Supplement
+ 0x2F00, 0x2FDF, // Kangxi Radicals
+ 0x2FF0, 0x2FFF, // Ideographic Description Characters
+ 0x3000, 0x303F, // CJK Symbols and Punctuation
+ 0x3040, 0x309F, // Hiragana
+ 0x30A0, 0x30FF, // Katakana
+ 0x3100, 0x312F, // Bopomofo
+ 0x3130, 0x318F, // Hangul Compatibility Jamo
+ 0x3190, 0x319F, // Kanbun
+ 0x31A0, 0x31BF, // Bopomofo Extended
+ 0x31C0, 0x31EF, // CJK Strokes
+ 0x31F0, 0x31FF, // Katakana Phonetic Extensions
+ 0x3200, 0x32FF, // Enclosed CJK Letters and Months
+ 0x3300, 0x33FF, // CJK Compatibility
+ 0x3400, 0x4DBF, // CJK Unified Ideographs Extension A
+ 0x4DC0, 0x4DFF, // Yijing Hexagram Symbols
+ 0x4E00, 0x9FFF, // CJK Unified Ideographs
+ 0xA000, 0xA48F, // Yi Syllables
+ 0xA490, 0xA4CF, // Yi Radicals
+ 0xA4D0, 0xA4FF, // Lisu
+ 0xA500, 0xA63F, // Vai
+ 0xA640, 0xA69F, // Cyrillic Extended-B
+ 0xA6A0, 0xA6FF, // Bamum
+ 0xA700, 0xA71F, // Modifier Tone Letters
+ 0xA720, 0xA7FF, // Latin Extended-D
+ 0xA800, 0xA82F, // Syloti Nagri
+ 0xA830, 0xA83F, // Common Indic Number Forms
+ 0xA840, 0xA87F, // Phags-pa
+ 0xA880, 0xA8DF, // Saurashtra
+ 0xA8E0, 0xA8FF, // Devanagari Extended
+ 0xA900, 0xA92F, // Kayah Li
+ 0xA930, 0xA95F, // Rejang
+ 0xA960, 0xA97F, // Hangul Jamo Extended-A
+ 0xA980, 0xA9DF, // Javanese
+ 0xAA00, 0xAA5F, // Cham
+ 0xAA60, 0xAA7F, // Myanmar Extended-A
+ 0xAA80, 0xAADF, // Tai Viet
+ 0xAB00, 0xAB2F, // Ethiopic Extended-A
+ 0xABC0, 0xABFF, // Meetei Mayek
+ 0xAC00, 0xD7AF, // Hangul Syllables
+ 0xD7B0, 0xD7FF, // Hangul Jamo Extended-B
+ //0xD800, 0xDB7F, // High Surrogates
+ //0xDB80, 0xDBFF, // High Private Use Surrogates
+ //0xDC00, 0xDFFF, // Low Surrogates
+ 0xE000, 0xF8FF, // Private Use Area
+ 0xF900, 0xFAFF, // CJK Compatibility Ideographs
+ 0xFB00, 0xFB4F, // Alphabetic Presentation Forms
+ 0xFB50, 0xFDFF, // Arabic Presentation Forms-A
+ 0xFE00, 0xFE0F, // Variation Selectors
+ 0xFE10, 0xFE1F, // Vertical Forms
+ 0xFE20, 0xFE2F, // Combining Half Marks
+ 0xFE30, 0xFE4F, // CJK Compatibility Forms
+ 0xFE50, 0xFE6F, // Small Form Variants
+ 0xFE70, 0xFEFF, // Arabic Presentation Forms-B
+ 0xFF00, 0xFFEF, // Halfwidth and Fullwidth Forms
+ 0xFFF0, 0xFFFF, // Specials
+ 0x10000, 0x1007F, // Linear B Syllabary
+ 0x10080, 0x100FF, // Linear B Ideograms
+ 0x10100, 0x1013F, // Aegean Numbers
+ 0x10140, 0x1018F, // Ancient Greek Numbers
+ 0x10190, 0x101CF, // Ancient Symbols
+ 0x101D0, 0x101FF, // Phaistos Disc
+ 0x10280, 0x1029F, // Lycian
+ 0x102A0, 0x102DF, // Carian
+ 0x10300, 0x1032F, // Old Italic
+ 0x10330, 0x1034F, // Gothic
+ 0x10380, 0x1039F, // Ugaritic
+ 0x103A0, 0x103DF, // Old Persian
+ 0x10400, 0x1044F, // Deseret
+ 0x10450, 0x1047F, // Shavian
+ 0x10480, 0x104AF, // Osmanya
+ 0x10800, 0x1083F, // Cypriot Syllabary
+ 0x10840, 0x1085F, // Imperial Aramaic
+ 0x10900, 0x1091F, // Phoenician
+ 0x10920, 0x1093F, // Lydian
+ 0x10A00, 0x10A5F, // Kharoshthi
+ 0x10A60, 0x10A7F, // Old South Arabian
+ 0x10B00, 0x10B3F, // Avestan
+ 0x10B40, 0x10B5F, // Inscriptional Parthian
+ 0x10B60, 0x10B7F, // Inscriptional Pahlavi
+ 0x10C00, 0x10C4F, // Old Turkic
+ 0x10E60, 0x10E7F, // Rumi Numeral Symbols
+ 0x11000, 0x1107F, // Brahmi
+ 0x11080, 0x110CF, // Kaithi
+ 0x12000, 0x123FF, // Cuneiform
+ 0x12400, 0x1247F, // Cuneiform Numbers and Punctuation
+ 0x13000, 0x1342F, // Egyptian Hieroglyphs
+ 0x16800, 0x16A3F, // Bamum Supplement
+ 0x1B000, 0x1B0FF, // Kana Supplement
+ 0x1D000, 0x1D0FF, // Byzantine Musical Symbols
+ 0x1D100, 0x1D1FF, // Musical Symbols
+ 0x1D200, 0x1D24F, // Ancient Greek Musical Notation
+ 0x1D300, 0x1D35F, // Tai Xuan Jing Symbols
+ 0x1D360, 0x1D37F, // Counting Rod Numerals
+ 0x1D400, 0x1D7FF, // Mathematical Alphanumeric Symbols
+ 0x1F000, 0x1F02F, // Mahjong Tiles
+ 0x1F030, 0x1F09F, // Domino Tiles
+ 0x1F0A0, 0x1F0FF, // Playing Cards
+ 0x1F100, 0x1F1FF, // Enclosed Alphanumeric Supplement
+ 0x1F200, 0x1F2FF, // Enclosed Ideographic Supplement
+ 0x1F300, 0x1F5FF, // Miscellaneous Symbols And Pictographs
+ 0x1F600, 0x1F64F, // Emoticons
+ 0x1F680, 0x1F6FF, // Transport And Map Symbols
+ 0x1F700, 0x1F77F, // Alchemical Symbols
+ 0x20000, 0x2A6DF, // CJK Unified Ideographs Extension B
+ 0x2A700, 0x2B73F, // CJK Unified Ideographs Extension C
+ 0x2B740, 0x2B81F, // CJK Unified Ideographs Extension D
+ 0x2F800, 0x2FA1F, // CJK Compatibility Ideographs Supplement
+ 0xE0000, 0xE007F, // Tags
+ 0xE0100, 0xE01EF, // Variation Selectors Supplement
+ 0xF0000, 0xFFFFF, // Supplementary Private Use Area-A
+ 0x100000, 0x10FFFF, // Supplementary Private Use Area-B
+ 0xFFFFFFFF
+};
+
+// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
+// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
+
+#define UTF8_ACCEPT 0u
+
+static const unsigned char utf8d[] = {
+ // The first part of the table maps bytes to character classes that
+ // to reduce the size of the transition table and create bitmasks.
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
+
+ // The second part is a transition table that maps a combination
+ // of a state of the automaton and a character class to a state.
+ 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
+ 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
+ 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
+ 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
+ 12,36,12,12,12,12,12,12,12,12,12,12,
+};
+
+static unsigned inline decode(unsigned* state, unsigned* codep, unsigned byte) {
+ unsigned type = utf8d[byte];
+
+ *codep = (*state != UTF8_ACCEPT) ?
+ (byte & 0x3fu) | (*codep << 6) :
+ (0xff >> type) & (byte);
+
+ *state = utf8d[256 + *state + type];
+ return *state;
+}
+
+//static bool IsUTF8(unsigned char* s) {
+// unsigned codepoint, state = 0;
+//
+// while (*s)
+// decode(&state, &codepoint, *s++);
+//
+// return state == UTF8_ACCEPT;
+//}
+
+TEST(EncodingsTest, UTF8) {
+ StringBuffer os, os2;
+ for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
+ for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
+ os.Clear();
+ UTF8<>::Encode(os, codepoint);
+ const char* encodedStr = os.GetString();
+
+ // Decode with Hoehrmann
+ {
+ unsigned decodedCodepoint = 0;
+ unsigned state = 0;
+
+ unsigned decodedCount = 0;
+ for (const char* s = encodedStr; *s; ++s)
+ if (!decode(&state, &decodedCodepoint, static_cast<unsigned char>(*s))) {
+ EXPECT_EQ(codepoint, decodedCodepoint);
+ decodedCount++;
+ }
+
+ if (*encodedStr) // This decoder cannot handle U+0000
+ EXPECT_EQ(1u, decodedCount); // Should only contain one code point
+
+ EXPECT_EQ(UTF8_ACCEPT, state);
+ if (UTF8_ACCEPT != state)
+ std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
+ }
+
+ // Decode
+ {
+ StringStream is(encodedStr);
+ unsigned decodedCodepoint;
+ bool result = UTF8<>::Decode(is, &decodedCodepoint);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(codepoint, decodedCodepoint);
+ if (!result || codepoint != decodedCodepoint)
+ std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
+ }
+
+ // Validate
+ {
+ StringStream is(encodedStr);
+ os2.Clear();
+ bool result = UTF8<>::Validate(is, os2);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
+ }
+ }
+ }
+}
+
+TEST(EncodingsTest, UTF16) {
+ GenericStringBuffer<UTF16<> > os, os2;
+ GenericStringBuffer<UTF8<> > utf8os;
+ for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
+ for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
+ os.Clear();
+ UTF16<>::Encode(os, codepoint);
+ const UTF16<>::Ch* encodedStr = os.GetString();
+
+ // Encode with Hoehrmann's code
+ if (codepoint != 0) // cannot handle U+0000
+ {
+ // encode with UTF8<> first
+ utf8os.Clear();
+ UTF8<>::Encode(utf8os, codepoint);
+
+ // transcode from UTF8 to UTF16 with Hoehrmann's code
+ unsigned decodedCodepoint = 0;
+ unsigned state = 0;
+ UTF16<>::Ch buffer[3], *p = &buffer[0];
+ for (const char* s = utf8os.GetString(); *s; ++s) {
+ if (!decode(&state, &decodedCodepoint, static_cast<unsigned char>(*s)))
+ break;
+ }
+
+ if (codepoint <= 0xFFFF)
+ *p++ = static_cast<UTF16<>::Ch>(decodedCodepoint);
+ else {
+ // Encode code points above U+FFFF as surrogate pair.
+ *p++ = static_cast<UTF16<>::Ch>(0xD7C0 + (decodedCodepoint >> 10));
+ *p++ = static_cast<UTF16<>::Ch>(0xDC00 + (decodedCodepoint & 0x3FF));
+ }
+ *p++ = '\0';
+
+ EXPECT_EQ(0, StrCmp(buffer, encodedStr));
+ }
+
+ // Decode
+ {
+ GenericStringStream<UTF16<> > is(encodedStr);
+ unsigned decodedCodepoint;
+ bool result = UTF16<>::Decode(is, &decodedCodepoint);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(codepoint, decodedCodepoint);
+ if (!result || codepoint != decodedCodepoint)
+ std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
+ }
+
+ // Validate
+ {
+ GenericStringStream<UTF16<> > is(encodedStr);
+ os2.Clear();
+ bool result = UTF16<>::Validate(is, os2);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
+ }
+ }
+ }
+}
+
+TEST(EncodingsTest, UTF32) {
+ GenericStringBuffer<UTF32<> > os, os2;
+ for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
+ for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
+ os.Clear();
+ UTF32<>::Encode(os, codepoint);
+ const UTF32<>::Ch* encodedStr = os.GetString();
+
+ // Decode
+ {
+ GenericStringStream<UTF32<> > is(encodedStr);
+ unsigned decodedCodepoint;
+ bool result = UTF32<>::Decode(is, &decodedCodepoint);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(codepoint, decodedCodepoint);
+ if (!result || codepoint != decodedCodepoint)
+ std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
+ }
+
+ // Validate
+ {
+ GenericStringStream<UTF32<> > is(encodedStr);
+ os2.Clear();
+ bool result = UTF32<>::Validate(is, os2);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
+ }
+ }
+ }
+}
diff --git a/3rdparty/rapidjson/test/unittest/filestreamtest.cpp b/3rdparty/rapidjson/test/unittest/filestreamtest.cpp
new file mode 100644
index 00000000000..a38133fa7f6
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/filestreamtest.cpp
@@ -0,0 +1,112 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/encodedstream.h"
+
+using namespace rapidjson;
+
+class FileStreamTest : public ::testing::Test {
+public:
+ FileStreamTest() : filename_(), json_(), length_() {}
+ virtual ~FileStreamTest();
+
+ virtual void SetUp() {
+ const char *paths[] = {
+ "data/sample.json",
+ "bin/data/sample.json",
+ "../bin/data/sample.json",
+ "../../bin/data/sample.json",
+ "../../../bin/data/sample.json"
+ };
+ FILE* fp = 0;
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ fp = fopen(paths[i], "rb");
+ if (fp) {
+ filename_ = paths[i];
+ break;
+ }
+ }
+ ASSERT_TRUE(fp != 0);
+
+ fseek(fp, 0, SEEK_END);
+ length_ = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+ json_ = static_cast<char*>(malloc(length_ + 1));
+ size_t readLength = fread(json_, 1, length_, fp);
+ json_[readLength] = '\0';
+ fclose(fp);
+ }
+
+ virtual void TearDown() {
+ free(json_);
+ json_ = 0;
+ }
+
+private:
+ FileStreamTest(const FileStreamTest&);
+ FileStreamTest& operator=(const FileStreamTest&);
+
+protected:
+ const char* filename_;
+ char *json_;
+ size_t length_;
+};
+
+FileStreamTest::~FileStreamTest() {}
+
+TEST_F(FileStreamTest, FileReadStream) {
+ FILE *fp = fopen(filename_, "rb");
+ ASSERT_TRUE(fp != 0);
+ char buffer[65536];
+ FileReadStream s(fp, buffer, sizeof(buffer));
+
+ for (size_t i = 0; i < length_; i++) {
+ EXPECT_EQ(json_[i], s.Peek());
+ EXPECT_EQ(json_[i], s.Peek()); // 2nd time should be the same
+ EXPECT_EQ(json_[i], s.Take());
+ }
+
+ EXPECT_EQ(length_, s.Tell());
+ EXPECT_EQ('\0', s.Peek());
+
+ fclose(fp);
+}
+
+TEST_F(FileStreamTest, FileWriteStream) {
+ char filename[L_tmpnam];
+ FILE* fp = TempFile(filename);
+
+ char buffer[65536];
+ FileWriteStream os(fp, buffer, sizeof(buffer));
+ for (size_t i = 0; i < length_; i++)
+ os.Put(json_[i]);
+ os.Flush();
+ fclose(fp);
+
+ // Read it back to verify
+ fp = fopen(filename, "rb");
+ FileReadStream is(fp, buffer, sizeof(buffer));
+
+ for (size_t i = 0; i < length_; i++)
+ EXPECT_EQ(json_[i], is.Take());
+
+ EXPECT_EQ(length_, is.Tell());
+ fclose(fp);
+
+ //std::cout << filename << std::endl;
+ remove(filename);
+}
diff --git a/3rdparty/rapidjson/test/unittest/fwdtest.cpp b/3rdparty/rapidjson/test/unittest/fwdtest.cpp
new file mode 100644
index 00000000000..4f326846116
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/fwdtest.cpp
@@ -0,0 +1,227 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+// Using forward declared types here.
+
+#include "rapidjson/fwd.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+using namespace rapidjson;
+
+struct Foo {
+ Foo();
+ ~Foo();
+
+ // encodings.h
+ UTF8<char>* utf8;
+ UTF16<wchar_t>* utf16;
+ UTF16BE<wchar_t>* utf16be;
+ UTF16LE<wchar_t>* utf16le;
+ UTF32<unsigned>* utf32;
+ UTF32BE<unsigned>* utf32be;
+ UTF32LE<unsigned>* utf32le;
+ ASCII<char>* ascii;
+ AutoUTF<unsigned>* autoutf;
+ Transcoder<UTF8<char>, UTF8<char> >* transcoder;
+
+ // allocators.h
+ CrtAllocator* crtallocator;
+ MemoryPoolAllocator<CrtAllocator>* memorypoolallocator;
+
+ // stream.h
+ StringStream* stringstream;
+ InsituStringStream* insitustringstream;
+
+ // stringbuffer.h
+ StringBuffer* stringbuffer;
+
+ // // filereadstream.h
+ // FileReadStream* filereadstream;
+
+ // // filewritestream.h
+ // FileWriteStream* filewritestream;
+
+ // memorybuffer.h
+ MemoryBuffer* memorybuffer;
+
+ // memorystream.h
+ MemoryStream* memorystream;
+
+ // reader.h
+ BaseReaderHandler<UTF8<char>, void>* basereaderhandler;
+ Reader* reader;
+
+ // writer.h
+ Writer<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* writer;
+
+ // prettywriter.h
+ PrettyWriter<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* prettywriter;
+
+ // document.h
+ Value* value;
+ Document* document;
+
+ // pointer.h
+ Pointer* pointer;
+
+ // schema.h
+ SchemaDocument* schemadocument;
+ SchemaValidator* schemavalidator;
+
+ // char buffer[16];
+};
+
+// Using type definitions here.
+
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/memorybuffer.h"
+#include "rapidjson/memorystream.h"
+#include "rapidjson/document.h" // -> reader.h
+#include "rapidjson/writer.h"
+#include "rapidjson/prettywriter.h"
+#include "rapidjson/schema.h" // -> pointer.h
+
+Foo::Foo() :
+ // encodings.h
+ utf8(RAPIDJSON_NEW(UTF8<>)),
+ utf16(RAPIDJSON_NEW(UTF16<>)),
+ utf16be(RAPIDJSON_NEW(UTF16BE<>)),
+ utf16le(RAPIDJSON_NEW(UTF16LE<>)),
+ utf32(RAPIDJSON_NEW(UTF32<>)),
+ utf32be(RAPIDJSON_NEW(UTF32BE<>)),
+ utf32le(RAPIDJSON_NEW(UTF32LE<>)),
+ ascii(RAPIDJSON_NEW(ASCII<>)),
+ autoutf(RAPIDJSON_NEW(AutoUTF<unsigned>)),
+ transcoder(RAPIDJSON_NEW((Transcoder<UTF8<>, UTF8<> >))),
+
+ // allocators.h
+ crtallocator(RAPIDJSON_NEW(CrtAllocator)),
+ memorypoolallocator(RAPIDJSON_NEW(MemoryPoolAllocator<>)),
+
+ // stream.h
+ stringstream(RAPIDJSON_NEW(StringStream(0))),
+ insitustringstream(RAPIDJSON_NEW(InsituStringStream(0))),
+
+ // stringbuffer.h
+ stringbuffer(RAPIDJSON_NEW(StringBuffer)),
+
+ // // filereadstream.h
+ // filereadstream(RAPIDJSON_NEW(FileReadStream(stdout, buffer, sizeof(buffer)))),
+
+ // // filewritestream.h
+ // filewritestream(RAPIDJSON_NEW(FileWriteStream(stdout, buffer, sizeof(buffer)))),
+
+ // memorybuffer.h
+ memorybuffer(RAPIDJSON_NEW(MemoryBuffer)),
+
+ // memorystream.h
+ memorystream(RAPIDJSON_NEW(MemoryStream(0, 0))),
+
+ // reader.h
+ basereaderhandler(RAPIDJSON_NEW((BaseReaderHandler<UTF8<>, void>))),
+ reader(RAPIDJSON_NEW(Reader)),
+
+ // writer.h
+ writer(RAPIDJSON_NEW((Writer<StringBuffer>))),
+
+ // prettywriter.h
+ prettywriter(RAPIDJSON_NEW((PrettyWriter<StringBuffer>))),
+
+ // document.h
+ value(RAPIDJSON_NEW(Value)),
+ document(RAPIDJSON_NEW(Document)),
+
+ // pointer.h
+ pointer(RAPIDJSON_NEW(Pointer)),
+
+ // schema.h
+ schemadocument(RAPIDJSON_NEW(SchemaDocument(*document))),
+ schemavalidator(RAPIDJSON_NEW(SchemaValidator(*schemadocument)))
+{
+
+}
+
+Foo::~Foo() {
+ // encodings.h
+ RAPIDJSON_DELETE(utf8);
+ RAPIDJSON_DELETE(utf16);
+ RAPIDJSON_DELETE(utf16be);
+ RAPIDJSON_DELETE(utf16le);
+ RAPIDJSON_DELETE(utf32);
+ RAPIDJSON_DELETE(utf32be);
+ RAPIDJSON_DELETE(utf32le);
+ RAPIDJSON_DELETE(ascii);
+ RAPIDJSON_DELETE(autoutf);
+ RAPIDJSON_DELETE(transcoder);
+
+ // allocators.h
+ RAPIDJSON_DELETE(crtallocator);
+ RAPIDJSON_DELETE(memorypoolallocator);
+
+ // stream.h
+ RAPIDJSON_DELETE(stringstream);
+ RAPIDJSON_DELETE(insitustringstream);
+
+ // stringbuffer.h
+ RAPIDJSON_DELETE(stringbuffer);
+
+ // // filereadstream.h
+ // RAPIDJSON_DELETE(filereadstream);
+
+ // // filewritestream.h
+ // RAPIDJSON_DELETE(filewritestream);
+
+ // memorybuffer.h
+ RAPIDJSON_DELETE(memorybuffer);
+
+ // memorystream.h
+ RAPIDJSON_DELETE(memorystream);
+
+ // reader.h
+ RAPIDJSON_DELETE(basereaderhandler);
+ RAPIDJSON_DELETE(reader);
+
+ // writer.h
+ RAPIDJSON_DELETE(writer);
+
+ // prettywriter.h
+ RAPIDJSON_DELETE(prettywriter);
+
+ // document.h
+ RAPIDJSON_DELETE(value);
+ RAPIDJSON_DELETE(document);
+
+ // pointer.h
+ RAPIDJSON_DELETE(pointer);
+
+ // schema.h
+ RAPIDJSON_DELETE(schemadocument);
+ RAPIDJSON_DELETE(schemavalidator);
+}
+
+TEST(Fwd, Fwd) {
+ Foo f;
+}
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/istreamwrappertest.cpp b/3rdparty/rapidjson/test/unittest/istreamwrappertest.cpp
new file mode 100644
index 00000000000..f6b0fa916e2
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/istreamwrappertest.cpp
@@ -0,0 +1,171 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/istreamwrapper.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/document.h"
+#include <sstream>
+#include <fstream>
+
+using namespace rapidjson;
+using namespace std;
+
+template <typename StringStreamType>
+static void TestStringStream() {
+ typedef typename StringStreamType::char_type Ch;
+
+ {
+ StringStreamType iss;
+ BasicIStreamWrapper<StringStreamType> is(iss);
+ EXPECT_EQ(0, is.Tell());
+ if (sizeof(Ch) == 1) {
+ EXPECT_EQ(0, is.Peek4());
+ EXPECT_EQ(0, is.Tell());
+ }
+ EXPECT_EQ(0, is.Peek());
+ EXPECT_EQ(0, is.Take());
+ EXPECT_EQ(0, is.Tell());
+ }
+
+ {
+ Ch s[] = { 'A', 'B', 'C', '\0' };
+ StringStreamType iss(s);
+ BasicIStreamWrapper<StringStreamType> is(iss);
+ EXPECT_EQ(0, is.Tell());
+ if (sizeof(Ch) == 1)
+ EXPECT_EQ(0, is.Peek4()); // less than 4 bytes
+ for (int i = 0; i < 3; i++) {
+ EXPECT_EQ(static_cast<size_t>(i), is.Tell());
+ EXPECT_EQ('A' + i, is.Peek());
+ EXPECT_EQ('A' + i, is.Peek());
+ EXPECT_EQ('A' + i, is.Take());
+ }
+ EXPECT_EQ(3, is.Tell());
+ EXPECT_EQ(0, is.Peek());
+ EXPECT_EQ(0, is.Take());
+ }
+
+ {
+ Ch s[] = { 'A', 'B', 'C', 'D', 'E', '\0' };
+ StringStreamType iss(s);
+ BasicIStreamWrapper<StringStreamType> is(iss);
+ if (sizeof(Ch) == 1) {
+ const Ch* c = is.Peek4();
+ for (int i = 0; i < 4; i++)
+ EXPECT_EQ('A' + i, c[i]);
+ EXPECT_EQ(0, is.Tell());
+ }
+ for (int i = 0; i < 5; i++) {
+ EXPECT_EQ(static_cast<size_t>(i), is.Tell());
+ EXPECT_EQ('A' + i, is.Peek());
+ EXPECT_EQ('A' + i, is.Peek());
+ EXPECT_EQ('A' + i, is.Take());
+ }
+ EXPECT_EQ(5, is.Tell());
+ EXPECT_EQ(0, is.Peek());
+ EXPECT_EQ(0, is.Take());
+ }
+}
+
+TEST(IStreamWrapper, istringstream) {
+ TestStringStream<istringstream>();
+}
+
+TEST(IStreamWrapper, stringstream) {
+ TestStringStream<stringstream>();
+}
+
+TEST(IStreamWrapper, wistringstream) {
+ TestStringStream<wistringstream>();
+}
+
+TEST(IStreamWrapper, wstringstream) {
+ TestStringStream<wstringstream>();
+}
+
+template <typename FileStreamType>
+static bool Open(FileStreamType& fs, const char* filename) {
+ const char *paths[] = {
+ "encodings",
+ "bin/encodings",
+ "../bin/encodings",
+ "../../bin/encodings",
+ "../../../bin/encodings"
+ };
+ char buffer[1024];
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ sprintf(buffer, "%s/%s", paths[i], filename);
+ fs.open(buffer, ios_base::in | ios_base::binary);
+ if (fs.is_open())
+ return true;
+ }
+ return false;
+}
+
+TEST(IStreamWrapper, ifstream) {
+ ifstream ifs;
+ ASSERT_TRUE(Open(ifs, "utf8bom.json"));
+ IStreamWrapper isw(ifs);
+ EncodedInputStream<UTF8<>, IStreamWrapper> eis(isw);
+ Document d;
+ EXPECT_TRUE(!d.ParseStream(eis).HasParseError());
+ EXPECT_TRUE(d.IsObject());
+ EXPECT_EQ(5, d.MemberCount());
+}
+
+TEST(IStreamWrapper, fstream) {
+ fstream fs;
+ ASSERT_TRUE(Open(fs, "utf8bom.json"));
+ IStreamWrapper isw(fs);
+ EncodedInputStream<UTF8<>, IStreamWrapper> eis(isw);
+ Document d;
+ EXPECT_TRUE(!d.ParseStream(eis).HasParseError());
+ EXPECT_TRUE(d.IsObject());
+ EXPECT_EQ(5, d.MemberCount());
+}
+
+// wifstream/wfstream only works on C++11 with codecvt_utf16
+// But many C++11 library still not have it.
+#if 0
+#include <codecvt>
+
+TEST(IStreamWrapper, wifstream) {
+ wifstream ifs;
+ ASSERT_TRUE(Open(ifs, "utf16bebom.json"));
+ ifs.imbue(std::locale(ifs.getloc(),
+ new std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header>));
+ WIStreamWrapper isw(ifs);
+ GenericDocument<UTF16<> > d;
+ d.ParseStream<kParseDefaultFlags, UTF16<>, WIStreamWrapper>(isw);
+ EXPECT_TRUE(!d.HasParseError());
+ EXPECT_TRUE(d.IsObject());
+ EXPECT_EQ(5, d.MemberCount());
+}
+
+TEST(IStreamWrapper, wfstream) {
+ wfstream fs;
+ ASSERT_TRUE(Open(fs, "utf16bebom.json"));
+ fs.imbue(std::locale(fs.getloc(),
+ new std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header>));
+ WIStreamWrapper isw(fs);
+ GenericDocument<UTF16<> > d;
+ d.ParseStream<kParseDefaultFlags, UTF16<>, WIStreamWrapper>(isw);
+ EXPECT_TRUE(!d.HasParseError());
+ EXPECT_TRUE(d.IsObject());
+ EXPECT_EQ(5, d.MemberCount());
+}
+
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
diff --git a/3rdparty/rapidjson/test/unittest/itoatest.cpp b/3rdparty/rapidjson/test/unittest/itoatest.cpp
new file mode 100644
index 00000000000..9c3107d4178
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/itoatest.cpp
@@ -0,0 +1,158 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/internal/itoa.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(type-limits)
+#endif
+
+using namespace rapidjson::internal;
+
+template <typename T>
+struct Traits {
+};
+
+template <>
+struct Traits<uint32_t> {
+ enum { kBufferSize = 11 };
+ enum { kMaxDigit = 10 };
+ static uint32_t Negate(uint32_t x) { return x; }
+};
+
+template <>
+struct Traits<int32_t> {
+ enum { kBufferSize = 12 };
+ enum { kMaxDigit = 10 };
+ static int32_t Negate(int32_t x) { return -x; }
+};
+
+template <>
+struct Traits<uint64_t> {
+ enum { kBufferSize = 21 };
+ enum { kMaxDigit = 20 };
+ static uint64_t Negate(uint64_t x) { return x; }
+};
+
+template <>
+struct Traits<int64_t> {
+ enum { kBufferSize = 22 };
+ enum { kMaxDigit = 20 };
+ static int64_t Negate(int64_t x) { return -x; }
+};
+
+template <typename T>
+static void VerifyValue(T value, void(*f)(T, char*), char* (*g)(T, char*)) {
+ char buffer1[Traits<T>::kBufferSize];
+ char buffer2[Traits<T>::kBufferSize];
+
+ f(value, buffer1);
+ *g(value, buffer2) = '\0';
+
+
+ EXPECT_STREQ(buffer1, buffer2);
+}
+
+template <typename T>
+static void Verify(void(*f)(T, char*), char* (*g)(T, char*)) {
+ // Boundary cases
+ VerifyValue<T>(0, f, g);
+ VerifyValue<T>(std::numeric_limits<T>::min(), f, g);
+ VerifyValue<T>(std::numeric_limits<T>::max(), f, g);
+
+ // 2^n - 1, 2^n, 10^n - 1, 10^n until overflow
+ for (uint32_t power = 2; power <= 10; power += 8) {
+ T i = 1, last;
+ do {
+ VerifyValue<T>(i - 1, f, g);
+ VerifyValue<T>(i, f, g);
+ if (std::numeric_limits<T>::min() < 0) {
+ VerifyValue<T>(Traits<T>::Negate(i), f, g);
+ VerifyValue<T>(Traits<T>::Negate(i + 1), f, g);
+ }
+ last = i;
+ i *= power;
+ } while (last < i);
+ }
+}
+
+static void u32toa_naive(uint32_t value, char* buffer) {
+ char temp[10];
+ char *p = temp;
+ do {
+ *p++ = char(value % 10) + '0';
+ value /= 10;
+ } while (value > 0);
+
+ do {
+ *buffer++ = *--p;
+ } while (p != temp);
+
+ *buffer = '\0';
+}
+
+static void i32toa_naive(int32_t value, char* buffer) {
+ uint32_t u = static_cast<uint32_t>(value);
+ if (value < 0) {
+ *buffer++ = '-';
+ u = ~u + 1;
+ }
+ u32toa_naive(u, buffer);
+}
+
+static void u64toa_naive(uint64_t value, char* buffer) {
+ char temp[20];
+ char *p = temp;
+ do {
+ *p++ = char(value % 10) + '0';
+ value /= 10;
+ } while (value > 0);
+
+ do {
+ *buffer++ = *--p;
+ } while (p != temp);
+
+ *buffer = '\0';
+}
+
+static void i64toa_naive(int64_t value, char* buffer) {
+ uint64_t u = static_cast<uint64_t>(value);
+ if (value < 0) {
+ *buffer++ = '-';
+ u = ~u + 1;
+ }
+ u64toa_naive(u, buffer);
+}
+
+TEST(itoa, u32toa) {
+ Verify(u32toa_naive, u32toa);
+}
+
+TEST(itoa, i32toa) {
+ Verify(i32toa_naive, i32toa);
+}
+
+TEST(itoa, u64toa) {
+ Verify(u64toa_naive, u64toa);
+}
+
+TEST(itoa, i64toa) {
+ Verify(i64toa_naive, i64toa);
+}
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/jsoncheckertest.cpp b/3rdparty/rapidjson/test/unittest/jsoncheckertest.cpp
new file mode 100644
index 00000000000..bea788d26e3
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/jsoncheckertest.cpp
@@ -0,0 +1,99 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/document.h"
+
+using namespace rapidjson;
+
+static char* ReadFile(const char* filename, size_t& length) {
+ const char *paths[] = {
+ "jsonchecker",
+ "bin/jsonchecker",
+ "../bin/jsonchecker",
+ "../../bin/jsonchecker",
+ "../../../bin/jsonchecker"
+ };
+ char buffer[1024];
+ FILE *fp = 0;
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ sprintf(buffer, "%s/%s", paths[i], filename);
+ fp = fopen(buffer, "rb");
+ if (fp)
+ break;
+ }
+
+ if (!fp)
+ return 0;
+
+ fseek(fp, 0, SEEK_END);
+ length = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+ char* json = static_cast<char*>(malloc(length + 1));
+ size_t readLength = fread(json, 1, length, fp);
+ json[readLength] = '\0';
+ fclose(fp);
+ return json;
+}
+
+TEST(JsonChecker, Reader) {
+ char filename[256];
+
+ // jsonchecker/failXX.json
+ for (int i = 1; i <= 33; i++) {
+ if (i == 1) // fail1.json is valid in rapidjson, which has no limitation on type of root element (RFC 7159).
+ continue;
+ if (i == 18) // fail18.json is valid in rapidjson, which has no limitation on depth of nesting.
+ continue;
+
+ sprintf(filename, "fail%d.json", i);
+ size_t length;
+ char* json = ReadFile(filename, length);
+ if (!json) {
+ printf("jsonchecker file %s not found", filename);
+ ADD_FAILURE();
+ continue;
+ }
+
+ GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
+ document.Parse(json);
+ EXPECT_TRUE(document.HasParseError());
+
+ document.Parse<kParseIterativeFlag>(json);
+ EXPECT_TRUE(document.HasParseError());
+
+ free(json);
+ }
+
+ // passX.json
+ for (int i = 1; i <= 3; i++) {
+ sprintf(filename, "pass%d.json", i);
+ size_t length;
+ char* json = ReadFile(filename, length);
+ if (!json) {
+ printf("jsonchecker file %s not found", filename);
+ continue;
+ }
+
+ GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
+ document.Parse(json);
+ EXPECT_FALSE(document.HasParseError());
+
+ document.Parse<kParseIterativeFlag>(json);
+ EXPECT_FALSE(document.HasParseError());
+
+ free(json);
+ }
+}
diff --git a/3rdparty/rapidjson/test/unittest/namespacetest.cpp b/3rdparty/rapidjson/test/unittest/namespacetest.cpp
new file mode 100644
index 00000000000..1814724aec6
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/namespacetest.cpp
@@ -0,0 +1,70 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+// test another instantiation of RapidJSON in a different namespace
+
+#define RAPIDJSON_NAMESPACE my::rapid::json
+#define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapid { namespace json {
+#define RAPIDJSON_NAMESPACE_END } } }
+
+// include lots of RapidJSON files
+
+#include "rapidjson/document.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/filereadstream.h"
+#include "rapidjson/filewritestream.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/stringbuffer.h"
+
+static const char json[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3,4]}";
+
+TEST(NamespaceTest,Using) {
+ using namespace RAPIDJSON_NAMESPACE;
+ typedef GenericDocument<UTF8<>, CrtAllocator> DocumentType;
+ DocumentType doc;
+
+ doc.Parse(json);
+ EXPECT_TRUE(!doc.HasParseError());
+}
+
+TEST(NamespaceTest,Direct) {
+ typedef RAPIDJSON_NAMESPACE::Document Document;
+ typedef RAPIDJSON_NAMESPACE::Reader Reader;
+ typedef RAPIDJSON_NAMESPACE::StringStream StringStream;
+ typedef RAPIDJSON_NAMESPACE::StringBuffer StringBuffer;
+ typedef RAPIDJSON_NAMESPACE::Writer<StringBuffer> WriterType;
+
+ StringStream s(json);
+ StringBuffer buffer;
+ WriterType writer(buffer);
+ buffer.ShrinkToFit();
+ Reader reader;
+ reader.Parse(s, writer);
+
+ EXPECT_STREQ(json, buffer.GetString());
+ EXPECT_EQ(sizeof(json)-1, buffer.GetSize());
+ EXPECT_TRUE(writer.IsComplete());
+
+ Document doc;
+ doc.Parse(buffer.GetString());
+ EXPECT_TRUE(!doc.HasParseError());
+
+ buffer.Clear();
+ writer.Reset(buffer);
+ doc.Accept(writer);
+ EXPECT_STREQ(json, buffer.GetString());
+ EXPECT_TRUE(writer.IsComplete());
+}
diff --git a/3rdparty/rapidjson/test/unittest/ostreamwrappertest.cpp b/3rdparty/rapidjson/test/unittest/ostreamwrappertest.cpp
new file mode 100644
index 00000000000..b1d1cd827fc
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/ostreamwrappertest.cpp
@@ -0,0 +1,91 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/ostreamwrapper.h"
+#include "rapidjson/encodedstream.h"
+#include "rapidjson/document.h"
+#include <sstream>
+#include <fstream>
+
+using namespace rapidjson;
+using namespace std;
+
+template <typename StringStreamType>
+static void TestStringStream() {
+ typedef typename StringStreamType::char_type Ch;
+
+ Ch s[] = { 'A', 'B', 'C', '\0' };
+ StringStreamType oss(s);
+ BasicOStreamWrapper<StringStreamType> os(oss);
+ for (size_t i = 0; i < 3; i++)
+ os.Put(s[i]);
+ os.Flush();
+ for (size_t i = 0; i < 3; i++)
+ EXPECT_EQ(s[i], oss.str()[i]);
+}
+
+TEST(OStreamWrapper, ostringstream) {
+ TestStringStream<ostringstream>();
+}
+
+TEST(OStreamWrapper, stringstream) {
+ TestStringStream<stringstream>();
+}
+
+TEST(OStreamWrapper, wostringstream) {
+ TestStringStream<wostringstream>();
+}
+
+TEST(OStreamWrapper, wstringstream) {
+ TestStringStream<wstringstream>();
+}
+
+TEST(OStreamWrapper, cout) {
+ OStreamWrapper os(cout);
+ const char* s = "Hello World!\n";
+ while (*s)
+ os.Put(*s++);
+ os.Flush();
+}
+
+template <typename FileStreamType>
+static void TestFileStream() {
+ char filename[L_tmpnam];
+ FILE* fp = TempFile(filename);
+ fclose(fp);
+
+ const char* s = "Hello World!\n";
+ {
+ ofstream ofs(filename, ios::out | ios::binary);
+ BasicOStreamWrapper<ofstream> osw(ofs);
+ for (const char* p = s; *p; p++)
+ osw.Put(*p);
+ osw.Flush();
+ }
+
+ fp = fopen(filename, "r");
+ for (const char* p = s; *p; p++)
+ EXPECT_EQ(*p, static_cast<char>(fgetc(fp)));
+ fclose(fp);
+}
+
+TEST(OStreamWrapper, ofstream) {
+ TestFileStream<ofstream>();
+}
+
+TEST(OStreamWrapper, fstream) {
+ TestFileStream<fstream>();
+}
diff --git a/3rdparty/rapidjson/test/unittest/pointertest.cpp b/3rdparty/rapidjson/test/unittest/pointertest.cpp
new file mode 100644
index 00000000000..dbddbedee25
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/pointertest.cpp
@@ -0,0 +1,1524 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/pointer.h"
+#include "rapidjson/stringbuffer.h"
+#include <sstream>
+
+using namespace rapidjson;
+
+static const char kJson[] = "{\n"
+" \"foo\":[\"bar\", \"baz\"],\n"
+" \"\" : 0,\n"
+" \"a/b\" : 1,\n"
+" \"c%d\" : 2,\n"
+" \"e^f\" : 3,\n"
+" \"g|h\" : 4,\n"
+" \"i\\\\j\" : 5,\n"
+" \"k\\\"l\" : 6,\n"
+" \" \" : 7,\n"
+" \"m~n\" : 8\n"
+"}";
+
+TEST(Pointer, DefaultConstructor) {
+ Pointer p;
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(0u, p.GetTokenCount());
+}
+
+TEST(Pointer, Parse) {
+ {
+ Pointer p("");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(0u, p.GetTokenCount());
+ }
+
+ {
+ Pointer p("/");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(0u, p.GetTokens()[0].length);
+ EXPECT_STREQ("", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+
+ {
+ Pointer p("/foo");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("foo", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+
+ #if RAPIDJSON_HAS_STDSTRING
+ {
+ Pointer p(std::string("/foo"));
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("foo", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+ #endif
+
+ {
+ Pointer p("/foo/0");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(2u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("foo", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ EXPECT_EQ(1u, p.GetTokens()[1].length);
+ EXPECT_STREQ("0", p.GetTokens()[1].name);
+ EXPECT_EQ(0u, p.GetTokens()[1].index);
+ }
+
+ {
+ // Unescape ~1
+ Pointer p("/a~1b");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("a/b", p.GetTokens()[0].name);
+ }
+
+ {
+ // Unescape ~0
+ Pointer p("/m~0n");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("m~n", p.GetTokens()[0].name);
+ }
+
+ {
+ // empty name
+ Pointer p("/");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(0u, p.GetTokens()[0].length);
+ EXPECT_STREQ("", p.GetTokens()[0].name);
+ }
+
+ {
+ // empty and non-empty name
+ Pointer p("//a");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(2u, p.GetTokenCount());
+ EXPECT_EQ(0u, p.GetTokens()[0].length);
+ EXPECT_STREQ("", p.GetTokens()[0].name);
+ EXPECT_EQ(1u, p.GetTokens()[1].length);
+ EXPECT_STREQ("a", p.GetTokens()[1].name);
+ }
+
+ {
+ // Null characters
+ Pointer p("/\0\0", 3);
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(2u, p.GetTokens()[0].length);
+ EXPECT_EQ('\0', p.GetTokens()[0].name[0]);
+ EXPECT_EQ('\0', p.GetTokens()[0].name[1]);
+ EXPECT_EQ('\0', p.GetTokens()[0].name[2]);
+ }
+
+ {
+ // Valid index
+ Pointer p("/123");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("123", p.GetTokens()[0].name);
+ EXPECT_EQ(123u, p.GetTokens()[0].index);
+ }
+
+ {
+ // Invalid index (with leading zero)
+ Pointer p("/01");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("01", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+
+ if (sizeof(SizeType) == 4) {
+ // Invalid index (overflow)
+ Pointer p("/4294967296");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("4294967296", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+
+ {
+ // kPointerParseErrorTokenMustBeginWithSolidus
+ Pointer p(" ");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorTokenMustBeginWithSolidus, p.GetParseErrorCode());
+ EXPECT_EQ(0u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidEscape
+ Pointer p("/~");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidEscape
+ Pointer p("/~2");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+}
+
+TEST(Pointer, Parse_URIFragment) {
+ {
+ Pointer p("#");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(0u, p.GetTokenCount());
+ }
+
+ {
+ Pointer p("#/foo");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("foo", p.GetTokens()[0].name);
+ }
+
+ {
+ Pointer p("#/foo/0");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(2u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("foo", p.GetTokens()[0].name);
+ EXPECT_EQ(1u, p.GetTokens()[1].length);
+ EXPECT_STREQ("0", p.GetTokens()[1].name);
+ EXPECT_EQ(0u, p.GetTokens()[1].index);
+ }
+
+ {
+ // Unescape ~1
+ Pointer p("#/a~1b");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("a/b", p.GetTokens()[0].name);
+ }
+
+ {
+ // Unescape ~0
+ Pointer p("#/m~0n");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("m~n", p.GetTokens()[0].name);
+ }
+
+ {
+ // empty name
+ Pointer p("#/");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(0u, p.GetTokens()[0].length);
+ EXPECT_STREQ("", p.GetTokens()[0].name);
+ }
+
+ {
+ // empty and non-empty name
+ Pointer p("#//a");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(2u, p.GetTokenCount());
+ EXPECT_EQ(0u, p.GetTokens()[0].length);
+ EXPECT_STREQ("", p.GetTokens()[0].name);
+ EXPECT_EQ(1u, p.GetTokens()[1].length);
+ EXPECT_STREQ("a", p.GetTokens()[1].name);
+ }
+
+ {
+ // Null characters
+ Pointer p("#/%00%00");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(2u, p.GetTokens()[0].length);
+ EXPECT_EQ('\0', p.GetTokens()[0].name[0]);
+ EXPECT_EQ('\0', p.GetTokens()[0].name[1]);
+ EXPECT_EQ('\0', p.GetTokens()[0].name[2]);
+ }
+
+ {
+ // Percentage Escapes
+ EXPECT_STREQ("c%d", Pointer("#/c%25d").GetTokens()[0].name);
+ EXPECT_STREQ("e^f", Pointer("#/e%5Ef").GetTokens()[0].name);
+ EXPECT_STREQ("g|h", Pointer("#/g%7Ch").GetTokens()[0].name);
+ EXPECT_STREQ("i\\j", Pointer("#/i%5Cj").GetTokens()[0].name);
+ EXPECT_STREQ("k\"l", Pointer("#/k%22l").GetTokens()[0].name);
+ EXPECT_STREQ(" ", Pointer("#/%20").GetTokens()[0].name);
+ }
+
+ {
+ // Valid index
+ Pointer p("#/123");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("123", p.GetTokens()[0].name);
+ EXPECT_EQ(123u, p.GetTokens()[0].index);
+ }
+
+ {
+ // Invalid index (with leading zero)
+ Pointer p("#/01");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("01", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+
+ if (sizeof(SizeType) == 4) {
+ // Invalid index (overflow)
+ Pointer p("#/4294967296");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("4294967296", p.GetTokens()[0].name);
+ EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
+ }
+
+ {
+ // Decode UTF-8 perecent encoding to UTF-8
+ Pointer p("#/%C2%A2");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_STREQ("\xC2\xA2", p.GetTokens()[0].name);
+ }
+
+ {
+ // Decode UTF-8 perecent encoding to UTF-16
+ GenericPointer<GenericValue<UTF16<> > > p(L"#/%C2%A2");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(static_cast<UTF16<>::Ch>(0x00A2), p.GetTokens()[0].name[0]);
+ EXPECT_EQ(1u, p.GetTokens()[0].length);
+ }
+
+ {
+ // Decode UTF-8 perecent encoding to UTF-16
+ GenericPointer<GenericValue<UTF16<> > > p(L"#/%E2%82%AC");
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(1u, p.GetTokenCount());
+ EXPECT_EQ(static_cast<UTF16<>::Ch>(0x20AC), p.GetTokens()[0].name[0]);
+ EXPECT_EQ(1u, p.GetTokens()[0].length);
+ }
+
+ {
+ // kPointerParseErrorTokenMustBeginWithSolidus
+ Pointer p("# ");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorTokenMustBeginWithSolidus, p.GetParseErrorCode());
+ EXPECT_EQ(1u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidEscape
+ Pointer p("#/~");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
+ EXPECT_EQ(3u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidEscape
+ Pointer p("#/~2");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
+ EXPECT_EQ(3u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidPercentEncoding
+ Pointer p("#/%");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidPercentEncoding (invalid hex)
+ Pointer p("#/%g0");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidPercentEncoding (invalid hex)
+ Pointer p("#/%0g");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorInvalidPercentEncoding (incomplete UTF-8 sequence)
+ Pointer p("#/%C2");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorCharacterMustPercentEncode
+ Pointer p("#/ ");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorCharacterMustPercentEncode, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+
+ {
+ // kPointerParseErrorCharacterMustPercentEncode
+ Pointer p("#/\n");
+ EXPECT_FALSE(p.IsValid());
+ EXPECT_EQ(kPointerParseErrorCharacterMustPercentEncode, p.GetParseErrorCode());
+ EXPECT_EQ(2u, p.GetParseErrorOffset());
+ }
+}
+
+TEST(Pointer, Stringify) {
+ // Test by roundtrip
+ const char* sources[] = {
+ "",
+ "/foo",
+ "/foo/0",
+ "/",
+ "/a~1b",
+ "/c%d",
+ "/e^f",
+ "/g|h",
+ "/i\\j",
+ "/k\"l",
+ "/ ",
+ "/m~0n",
+ "/\xC2\xA2",
+ "/\xE2\x82\xAC",
+ "/\xF0\x9D\x84\x9E"
+ };
+
+ for (size_t i = 0; i < sizeof(sources) / sizeof(sources[0]); i++) {
+ Pointer p(sources[i]);
+ StringBuffer s;
+ EXPECT_TRUE(p.Stringify(s));
+ EXPECT_STREQ(sources[i], s.GetString());
+
+ // Stringify to URI fragment
+ StringBuffer s2;
+ EXPECT_TRUE(p.StringifyUriFragment(s2));
+ Pointer p2(s2.GetString(), s2.GetSize());
+ EXPECT_TRUE(p2.IsValid());
+ EXPECT_TRUE(p == p2);
+ }
+
+ {
+ // Strigify to URI fragment with an invalid UTF-8 sequence
+ Pointer p("/\xC2");
+ StringBuffer s;
+ EXPECT_FALSE(p.StringifyUriFragment(s));
+ }
+}
+
+// Construct a Pointer with static tokens, no dynamic allocation involved.
+#define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
+#define INDEX(i) { #i, sizeof(#i) - 1, i }
+
+static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(0) }; // equivalent to "/foo/0"
+
+#undef NAME
+#undef INDEX
+
+TEST(Pointer, ConstructorWithToken) {
+ Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
+ EXPECT_TRUE(p.IsValid());
+ EXPECT_EQ(2u, p.GetTokenCount());
+ EXPECT_EQ(3u, p.GetTokens()[0].length);
+ EXPECT_STREQ("foo", p.GetTokens()[0].name);
+ EXPECT_EQ(1u, p.GetTokens()[1].length);
+ EXPECT_STREQ("0", p.GetTokens()[1].name);
+ EXPECT_EQ(0u, p.GetTokens()[1].index);
+}
+
+TEST(Pointer, CopyConstructor) {
+ {
+ Pointer p("/foo/0");
+ Pointer q(p);
+ EXPECT_TRUE(q.IsValid());
+ EXPECT_EQ(2u, q.GetTokenCount());
+ EXPECT_EQ(3u, q.GetTokens()[0].length);
+ EXPECT_STREQ("foo", q.GetTokens()[0].name);
+ EXPECT_EQ(1u, q.GetTokens()[1].length);
+ EXPECT_STREQ("0", q.GetTokens()[1].name);
+ EXPECT_EQ(0u, q.GetTokens()[1].index);
+ }
+
+ // Static tokens
+ {
+ Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
+ Pointer q(p);
+ EXPECT_TRUE(q.IsValid());
+ EXPECT_EQ(2u, q.GetTokenCount());
+ EXPECT_EQ(3u, q.GetTokens()[0].length);
+ EXPECT_STREQ("foo", q.GetTokens()[0].name);
+ EXPECT_EQ(1u, q.GetTokens()[1].length);
+ EXPECT_STREQ("0", q.GetTokens()[1].name);
+ EXPECT_EQ(0u, q.GetTokens()[1].index);
+ }
+}
+
+TEST(Pointer, Assignment) {
+ {
+ Pointer p("/foo/0");
+ Pointer q;
+ q = p;
+ EXPECT_TRUE(q.IsValid());
+ EXPECT_EQ(2u, q.GetTokenCount());
+ EXPECT_EQ(3u, q.GetTokens()[0].length);
+ EXPECT_STREQ("foo", q.GetTokens()[0].name);
+ EXPECT_EQ(1u, q.GetTokens()[1].length);
+ EXPECT_STREQ("0", q.GetTokens()[1].name);
+ EXPECT_EQ(0u, q.GetTokens()[1].index);
+ q = q;
+ EXPECT_TRUE(q.IsValid());
+ EXPECT_EQ(2u, q.GetTokenCount());
+ EXPECT_EQ(3u, q.GetTokens()[0].length);
+ EXPECT_STREQ("foo", q.GetTokens()[0].name);
+ EXPECT_EQ(1u, q.GetTokens()[1].length);
+ EXPECT_STREQ("0", q.GetTokens()[1].name);
+ EXPECT_EQ(0u, q.GetTokens()[1].index);
+ }
+
+ // Static tokens
+ {
+ Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
+ Pointer q;
+ q = p;
+ EXPECT_TRUE(q.IsValid());
+ EXPECT_EQ(2u, q.GetTokenCount());
+ EXPECT_EQ(3u, q.GetTokens()[0].length);
+ EXPECT_STREQ("foo", q.GetTokens()[0].name);
+ EXPECT_EQ(1u, q.GetTokens()[1].length);
+ EXPECT_STREQ("0", q.GetTokens()[1].name);
+ EXPECT_EQ(0u, q.GetTokens()[1].index);
+ }
+}
+
+TEST(Pointer, Append) {
+ {
+ Pointer p;
+ Pointer q = p.Append("foo");
+ EXPECT_TRUE(Pointer("/foo") == q);
+ q = q.Append(1234);
+ EXPECT_TRUE(Pointer("/foo/1234") == q);
+ q = q.Append("");
+ EXPECT_TRUE(Pointer("/foo/1234/") == q);
+ }
+
+ {
+ Pointer p;
+ Pointer q = p.Append(Value("foo").Move());
+ EXPECT_TRUE(Pointer("/foo") == q);
+ q = q.Append(Value(1234).Move());
+ EXPECT_TRUE(Pointer("/foo/1234") == q);
+ q = q.Append(Value(kStringType).Move());
+ EXPECT_TRUE(Pointer("/foo/1234/") == q);
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ {
+ Pointer p;
+ Pointer q = p.Append(std::string("foo"));
+ EXPECT_TRUE(Pointer("/foo") == q);
+ }
+#endif
+}
+
+TEST(Pointer, Equality) {
+ EXPECT_TRUE(Pointer("/foo/0") == Pointer("/foo/0"));
+ EXPECT_FALSE(Pointer("/foo/0") == Pointer("/foo/1"));
+ EXPECT_FALSE(Pointer("/foo/0") == Pointer("/foo/0/1"));
+ EXPECT_FALSE(Pointer("/foo/0") == Pointer("a"));
+ EXPECT_FALSE(Pointer("a") == Pointer("a")); // Invalid always not equal
+}
+
+TEST(Pointer, Inequality) {
+ EXPECT_FALSE(Pointer("/foo/0") != Pointer("/foo/0"));
+ EXPECT_TRUE(Pointer("/foo/0") != Pointer("/foo/1"));
+ EXPECT_TRUE(Pointer("/foo/0") != Pointer("/foo/0/1"));
+ EXPECT_TRUE(Pointer("/foo/0") != Pointer("a"));
+ EXPECT_TRUE(Pointer("a") != Pointer("a")); // Invalid always not equal
+}
+
+TEST(Pointer, Create) {
+ Document d;
+ {
+ Value* v = &Pointer("").Create(d, d.GetAllocator());
+ EXPECT_EQ(&d, v);
+ }
+ {
+ Value* v = &Pointer("/foo").Create(d, d.GetAllocator());
+ EXPECT_EQ(&d["foo"], v);
+ }
+ {
+ Value* v = &Pointer("/foo/0").Create(d, d.GetAllocator());
+ EXPECT_EQ(&d["foo"][0], v);
+ }
+ {
+ Value* v = &Pointer("/foo/-").Create(d, d.GetAllocator());
+ EXPECT_EQ(&d["foo"][1], v);
+ }
+
+ {
+ Value* v = &Pointer("/foo/-/-").Create(d, d.GetAllocator());
+ // "foo/-" is a newly created null value x.
+ // "foo/-/-" finds that x is not an array, it converts x to empty object
+ // and treats - as "-" member name
+ EXPECT_EQ(&d["foo"][2]["-"], v);
+ }
+
+ {
+ // Document with no allocator
+ Value* v = &Pointer("/foo/-").Create(d);
+ EXPECT_EQ(&d["foo"][3], v);
+ }
+
+ {
+ // Value (not document) must give allocator
+ Value* v = &Pointer("/-").Create(d["foo"], d.GetAllocator());
+ EXPECT_EQ(&d["foo"][4], v);
+ }
+}
+
+TEST(Pointer, Get) {
+ Document d;
+ d.Parse(kJson);
+
+ EXPECT_EQ(&d, Pointer("").Get(d));
+ EXPECT_EQ(&d["foo"], Pointer("/foo").Get(d));
+ EXPECT_EQ(&d["foo"][0], Pointer("/foo/0").Get(d));
+ EXPECT_EQ(&d[""], Pointer("/").Get(d));
+ EXPECT_EQ(&d["a/b"], Pointer("/a~1b").Get(d));
+ EXPECT_EQ(&d["c%d"], Pointer("/c%d").Get(d));
+ EXPECT_EQ(&d["e^f"], Pointer("/e^f").Get(d));
+ EXPECT_EQ(&d["g|h"], Pointer("/g|h").Get(d));
+ EXPECT_EQ(&d["i\\j"], Pointer("/i\\j").Get(d));
+ EXPECT_EQ(&d["k\"l"], Pointer("/k\"l").Get(d));
+ EXPECT_EQ(&d[" "], Pointer("/ ").Get(d));
+ EXPECT_EQ(&d["m~n"], Pointer("/m~0n").Get(d));
+ EXPECT_TRUE(Pointer("/abc").Get(d) == 0);
+ size_t unresolvedTokenIndex;
+ EXPECT_TRUE(Pointer("/foo/2").Get(d, &unresolvedTokenIndex) == 0); // Out of boundary
+ EXPECT_EQ(1, unresolvedTokenIndex);
+ EXPECT_TRUE(Pointer("/foo/a").Get(d, &unresolvedTokenIndex) == 0); // "/foo" is an array, cannot query by "a"
+ EXPECT_EQ(1, unresolvedTokenIndex);
+ EXPECT_TRUE(Pointer("/foo/0/0").Get(d, &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
+ EXPECT_EQ(2, unresolvedTokenIndex);
+ EXPECT_TRUE(Pointer("/foo/0/a").Get(d, &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
+ EXPECT_EQ(2, unresolvedTokenIndex);
+}
+
+TEST(Pointer, GetWithDefault) {
+ Document d;
+ d.Parse(kJson);
+
+ // Value version
+ Document::AllocatorType& a = d.GetAllocator();
+ const Value v("qux");
+ EXPECT_TRUE(Value("bar") == Pointer("/foo/0").GetWithDefault(d, v, a));
+ EXPECT_TRUE(Value("baz") == Pointer("/foo/1").GetWithDefault(d, v, a));
+ EXPECT_TRUE(Value("qux") == Pointer("/foo/2").GetWithDefault(d, v, a));
+ EXPECT_TRUE(Value("last") == Pointer("/foo/-").GetWithDefault(d, Value("last").Move(), a));
+ EXPECT_STREQ("last", d["foo"][3].GetString());
+
+ EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, Value().Move(), a).IsNull());
+ EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, "x", a).IsNull());
+
+ // Generic version
+ EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -1, a).GetInt());
+ EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -2, a).GetInt());
+ EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x87654321, a).GetUint());
+ EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x12345678, a).GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64, a).GetInt64());
+ EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64 + 1, a).GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64, a).GetUint64());
+ EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64 - 1, a).GetUint64());
+
+ EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, true, a).IsTrue());
+ EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, false, a).IsTrue());
+
+ EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, false, a).IsFalse());
+ EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, true, a).IsFalse());
+
+ // StringRef version
+ EXPECT_STREQ("Hello", Pointer("/foo/hello").GetWithDefault(d, "Hello", a).GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ EXPECT_STREQ("World", Pointer("/foo/world").GetWithDefault(d, buffer, a).GetString());
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("C++", Pointer("/foo/C++").GetWithDefault(d, std::string("C++"), a).GetString());
+#endif
+}
+
+TEST(Pointer, GetWithDefault_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+
+ // Value version
+ const Value v("qux");
+ EXPECT_TRUE(Value("bar") == Pointer("/foo/0").GetWithDefault(d, v));
+ EXPECT_TRUE(Value("baz") == Pointer("/foo/1").GetWithDefault(d, v));
+ EXPECT_TRUE(Value("qux") == Pointer("/foo/2").GetWithDefault(d, v));
+ EXPECT_TRUE(Value("last") == Pointer("/foo/-").GetWithDefault(d, Value("last").Move()));
+ EXPECT_STREQ("last", d["foo"][3].GetString());
+
+ EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, Value().Move()).IsNull());
+ EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, "x").IsNull());
+
+ // Generic version
+ EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -1).GetInt());
+ EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -2).GetInt());
+ EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x87654321).GetUint());
+ EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x12345678).GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64).GetInt64());
+ EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64 + 1).GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64).GetUint64());
+ EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64 - 1).GetUint64());
+
+ EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, true).IsTrue());
+ EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, false).IsTrue());
+
+ EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, false).IsFalse());
+ EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, true).IsFalse());
+
+ // StringRef version
+ EXPECT_STREQ("Hello", Pointer("/foo/hello").GetWithDefault(d, "Hello").GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ EXPECT_STREQ("World", Pointer("/foo/world").GetWithDefault(d, buffer).GetString());
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("C++", Pointer("/foo/C++").GetWithDefault(d, std::string("C++")).GetString());
+#endif
+}
+
+TEST(Pointer, Set) {
+ Document d;
+ d.Parse(kJson);
+ Document::AllocatorType& a = d.GetAllocator();
+
+ // Value version
+ Pointer("/foo/0").Set(d, Value(123).Move(), a);
+ EXPECT_EQ(123, d["foo"][0].GetInt());
+
+ Pointer("/foo/-").Set(d, Value(456).Move(), a);
+ EXPECT_EQ(456, d["foo"][2].GetInt());
+
+ Pointer("/foo/null").Set(d, Value().Move(), a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
+
+ // Const Value version
+ const Value foo(d["foo"], a);
+ Pointer("/clone").Set(d, foo, a);
+ EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
+
+ // Generic version
+ Pointer("/foo/int").Set(d, -1, a);
+ EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
+
+ Pointer("/foo/uint").Set(d, 0x87654321, a);
+ EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ Pointer("/foo/int64").Set(d, i64, a);
+ EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ Pointer("/foo/uint64").Set(d, u64, a);
+ EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
+
+ Pointer("/foo/true").Set(d, true, a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
+
+ Pointer("/foo/false").Set(d, false, a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
+
+ // StringRef version
+ Pointer("/foo/hello").Set(d, "Hello", a);
+ EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ Pointer("/foo/world").Set(d, buffer, a);
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ Pointer("/foo/c++").Set(d, std::string("C++"), a);
+ EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
+#endif
+}
+
+TEST(Pointer, Set_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+
+ // Value version
+ Pointer("/foo/0").Set(d, Value(123).Move());
+ EXPECT_EQ(123, d["foo"][0].GetInt());
+
+ Pointer("/foo/-").Set(d, Value(456).Move());
+ EXPECT_EQ(456, d["foo"][2].GetInt());
+
+ Pointer("/foo/null").Set(d, Value().Move());
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
+
+ // Const Value version
+ const Value foo(d["foo"], d.GetAllocator());
+ Pointer("/clone").Set(d, foo);
+ EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
+
+ // Generic version
+ Pointer("/foo/int").Set(d, -1);
+ EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
+
+ Pointer("/foo/uint").Set(d, 0x87654321);
+ EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ Pointer("/foo/int64").Set(d, i64);
+ EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ Pointer("/foo/uint64").Set(d, u64);
+ EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
+
+ Pointer("/foo/true").Set(d, true);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
+
+ Pointer("/foo/false").Set(d, false);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
+
+ // StringRef version
+ Pointer("/foo/hello").Set(d, "Hello");
+ EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ Pointer("/foo/world").Set(d, buffer);
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ Pointer("/foo/c++").Set(d, std::string("C++"));
+ EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
+#endif
+}
+
+TEST(Pointer, Swap) {
+ Document d;
+ d.Parse(kJson);
+ Document::AllocatorType& a = d.GetAllocator();
+ Pointer("/foo/0").Swap(d, *Pointer("/foo/1").Get(d), a);
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_STREQ("bar", d["foo"][1].GetString());
+}
+
+TEST(Pointer, Swap_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+ Pointer("/foo/0").Swap(d, *Pointer("/foo/1").Get(d));
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_STREQ("bar", d["foo"][1].GetString());
+}
+
+TEST(Pointer, Erase) {
+ Document d;
+ d.Parse(kJson);
+
+ EXPECT_FALSE(Pointer("").Erase(d));
+ EXPECT_FALSE(Pointer("/nonexist").Erase(d));
+ EXPECT_FALSE(Pointer("/nonexist/nonexist").Erase(d));
+ EXPECT_FALSE(Pointer("/foo/nonexist").Erase(d));
+ EXPECT_FALSE(Pointer("/foo/nonexist/nonexist").Erase(d));
+ EXPECT_FALSE(Pointer("/foo/0/nonexist").Erase(d));
+ EXPECT_FALSE(Pointer("/foo/0/nonexist/nonexist").Erase(d));
+ EXPECT_FALSE(Pointer("/foo/2/nonexist").Erase(d));
+ EXPECT_TRUE(Pointer("/foo/0").Erase(d));
+ EXPECT_EQ(1u, d["foo"].Size());
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_TRUE(Pointer("/foo/0").Erase(d));
+ EXPECT_TRUE(d["foo"].Empty());
+ EXPECT_TRUE(Pointer("/foo").Erase(d));
+ EXPECT_TRUE(Pointer("/foo").Get(d) == 0);
+
+ Pointer("/a/0/b/0").Create(d);
+
+ EXPECT_TRUE(Pointer("/a/0/b/0").Get(d) != 0);
+ EXPECT_TRUE(Pointer("/a/0/b/0").Erase(d));
+ EXPECT_TRUE(Pointer("/a/0/b/0").Get(d) == 0);
+
+ EXPECT_TRUE(Pointer("/a/0/b").Get(d) != 0);
+ EXPECT_TRUE(Pointer("/a/0/b").Erase(d));
+ EXPECT_TRUE(Pointer("/a/0/b").Get(d) == 0);
+
+ EXPECT_TRUE(Pointer("/a/0").Get(d) != 0);
+ EXPECT_TRUE(Pointer("/a/0").Erase(d));
+ EXPECT_TRUE(Pointer("/a/0").Get(d) == 0);
+
+ EXPECT_TRUE(Pointer("/a").Get(d) != 0);
+ EXPECT_TRUE(Pointer("/a").Erase(d));
+ EXPECT_TRUE(Pointer("/a").Get(d) == 0);
+}
+
+TEST(Pointer, CreateValueByPointer) {
+ Document d;
+ Document::AllocatorType& a = d.GetAllocator();
+
+ {
+ Value& v = CreateValueByPointer(d, Pointer("/foo/0"), a);
+ EXPECT_EQ(&d["foo"][0], &v);
+ }
+ {
+ Value& v = CreateValueByPointer(d, "/foo/1", a);
+ EXPECT_EQ(&d["foo"][1], &v);
+ }
+}
+
+TEST(Pointer, CreateValueByPointer_NoAllocator) {
+ Document d;
+
+ {
+ Value& v = CreateValueByPointer(d, Pointer("/foo/0"));
+ EXPECT_EQ(&d["foo"][0], &v);
+ }
+ {
+ Value& v = CreateValueByPointer(d, "/foo/1");
+ EXPECT_EQ(&d["foo"][1], &v);
+ }
+}
+
+TEST(Pointer, GetValueByPointer) {
+ Document d;
+ d.Parse(kJson);
+
+ EXPECT_EQ(&d["foo"][0], GetValueByPointer(d, Pointer("/foo/0")));
+ EXPECT_EQ(&d["foo"][0], GetValueByPointer(d, "/foo/0"));
+
+ size_t unresolvedTokenIndex;
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/2", &unresolvedTokenIndex) == 0); // Out of boundary
+ EXPECT_EQ(1, unresolvedTokenIndex);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/a", &unresolvedTokenIndex) == 0); // "/foo" is an array, cannot query by "a"
+ EXPECT_EQ(1, unresolvedTokenIndex);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/0/0", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
+ EXPECT_EQ(2, unresolvedTokenIndex);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/0/a", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
+ EXPECT_EQ(2, unresolvedTokenIndex);
+
+ // const version
+ const Value& v = d;
+ EXPECT_EQ(&d["foo"][0], GetValueByPointer(v, Pointer("/foo/0")));
+ EXPECT_EQ(&d["foo"][0], GetValueByPointer(v, "/foo/0"));
+
+ EXPECT_TRUE(GetValueByPointer(v, "/foo/2", &unresolvedTokenIndex) == 0); // Out of boundary
+ EXPECT_EQ(1, unresolvedTokenIndex);
+ EXPECT_TRUE(GetValueByPointer(v, "/foo/a", &unresolvedTokenIndex) == 0); // "/foo" is an array, cannot query by "a"
+ EXPECT_EQ(1, unresolvedTokenIndex);
+ EXPECT_TRUE(GetValueByPointer(v, "/foo/0/0", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
+ EXPECT_EQ(2, unresolvedTokenIndex);
+ EXPECT_TRUE(GetValueByPointer(v, "/foo/0/a", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
+ EXPECT_EQ(2, unresolvedTokenIndex);
+
+}
+
+TEST(Pointer, GetValueByPointerWithDefault_Pointer) {
+ Document d;
+ d.Parse(kJson);
+
+ Document::AllocatorType& a = d.GetAllocator();
+ const Value v("qux");
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v, a));
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v, a));
+ EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, Pointer("/foo/1"), v, a));
+ EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, Pointer("/foo/2"), v, a));
+ EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, Pointer("/foo/-"), Value("last").Move(), a));
+ EXPECT_STREQ("last", d["foo"][3].GetString());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), Value().Move(), a).IsNull());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), "x", a).IsNull());
+
+ // Generic version
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -1, a).GetInt());
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -2, a).GetInt());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x87654321, a).GetUint());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x12345678, a).GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64, a).GetInt64());
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64 + 1, a).GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64, a).GetUint64());
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64 - 1, a).GetUint64());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), true, a).IsTrue());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), false, a).IsTrue());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), false, a).IsFalse());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), true, a).IsFalse());
+
+ // StringRef version
+ EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, Pointer("/foo/hello"), "Hello", a).GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ EXPECT_STREQ("World", GetValueByPointerWithDefault(d, Pointer("/foo/world"), buffer, a).GetString());
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, Pointer("/foo/world"))->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, Pointer("/foo/C++"), std::string("C++"), a).GetString());
+#endif
+}
+
+TEST(Pointer, GetValueByPointerWithDefault_String) {
+ Document d;
+ d.Parse(kJson);
+
+ Document::AllocatorType& a = d.GetAllocator();
+ const Value v("qux");
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v, a));
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v, a));
+ EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, "/foo/1", v, a));
+ EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, "/foo/2", v, a));
+ EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, "/foo/-", Value("last").Move(), a));
+ EXPECT_STREQ("last", d["foo"][3].GetString());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", Value().Move(), a).IsNull());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", "x", a).IsNull());
+
+ // Generic version
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -1, a).GetInt());
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -2, a).GetInt());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x87654321, a).GetUint());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x12345678, a).GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64, a).GetInt64());
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64 + 1, a).GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64, a).GetUint64());
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64 - 1, a).GetUint64());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", true, a).IsTrue());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", false, a).IsTrue());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", false, a).IsFalse());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", true, a).IsFalse());
+
+ // StringRef version
+ EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, "/foo/hello", "Hello", a).GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ EXPECT_STREQ("World", GetValueByPointerWithDefault(d, "/foo/world", buffer, a).GetString());
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, "/foo/C++", std::string("C++"), a).GetString());
+#endif
+}
+
+TEST(Pointer, GetValueByPointerWithDefault_Pointer_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+
+ const Value v("qux");
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v));
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v));
+ EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, Pointer("/foo/1"), v));
+ EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, Pointer("/foo/2"), v));
+ EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, Pointer("/foo/-"), Value("last").Move()));
+ EXPECT_STREQ("last", d["foo"][3].GetString());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), Value().Move()).IsNull());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), "x").IsNull());
+
+ // Generic version
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -1).GetInt());
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -2).GetInt());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x87654321).GetUint());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x12345678).GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64).GetInt64());
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64 + 1).GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64).GetUint64());
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64 - 1).GetUint64());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), true).IsTrue());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), false).IsTrue());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), false).IsFalse());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), true).IsFalse());
+
+ // StringRef version
+ EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, Pointer("/foo/hello"), "Hello").GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ EXPECT_STREQ("World", GetValueByPointerWithDefault(d, Pointer("/foo/world"), buffer).GetString());
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, Pointer("/foo/world"))->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, Pointer("/foo/C++"), std::string("C++")).GetString());
+#endif
+}
+
+TEST(Pointer, GetValueByPointerWithDefault_String_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+
+ const Value v("qux");
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v));
+ EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v));
+ EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, "/foo/1", v));
+ EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, "/foo/2", v));
+ EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, "/foo/-", Value("last").Move()));
+ EXPECT_STREQ("last", d["foo"][3].GetString());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", Value().Move()).IsNull());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", "x").IsNull());
+
+ // Generic version
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -1).GetInt());
+ EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -2).GetInt());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x87654321).GetUint());
+ EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x12345678).GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64).GetInt64());
+ EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64 + 1).GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64).GetUint64());
+ EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64 - 1).GetUint64());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", true).IsTrue());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", false).IsTrue());
+
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", false).IsFalse());
+ EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", true).IsFalse());
+
+ // StringRef version
+ EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, "/foo/hello", "Hello").GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ EXPECT_STREQ("World", GetValueByPointerWithDefault(d, "/foo/world", buffer).GetString());
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, Pointer("/foo/C++"), std::string("C++")).GetString());
+#endif
+}
+
+TEST(Pointer, SetValueByPointer_Pointer) {
+ Document d;
+ d.Parse(kJson);
+ Document::AllocatorType& a = d.GetAllocator();
+
+ // Value version
+ SetValueByPointer(d, Pointer("/foo/0"), Value(123).Move(), a);
+ EXPECT_EQ(123, d["foo"][0].GetInt());
+
+ SetValueByPointer(d, Pointer("/foo/null"), Value().Move(), a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
+
+ // Const Value version
+ const Value foo(d["foo"], d.GetAllocator());
+ SetValueByPointer(d, Pointer("/clone"), foo, a);
+ EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
+
+ // Generic version
+ SetValueByPointer(d, Pointer("/foo/int"), -1, a);
+ EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
+
+ SetValueByPointer(d, Pointer("/foo/uint"), 0x87654321, a);
+ EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ SetValueByPointer(d, Pointer("/foo/int64"), i64, a);
+ EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ SetValueByPointer(d, Pointer("/foo/uint64"), u64, a);
+ EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
+
+ SetValueByPointer(d, Pointer("/foo/true"), true, a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
+
+ SetValueByPointer(d, Pointer("/foo/false"), false, a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
+
+ // StringRef version
+ SetValueByPointer(d, Pointer("/foo/hello"), "Hello", a);
+ EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ SetValueByPointer(d, Pointer("/foo/world"), buffer, a);
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ SetValueByPointer(d, Pointer("/foo/c++"), std::string("C++"), a);
+ EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
+#endif
+}
+
+TEST(Pointer, SetValueByPointer_String) {
+ Document d;
+ d.Parse(kJson);
+ Document::AllocatorType& a = d.GetAllocator();
+
+ // Value version
+ SetValueByPointer(d, "/foo/0", Value(123).Move(), a);
+ EXPECT_EQ(123, d["foo"][0].GetInt());
+
+ SetValueByPointer(d, "/foo/null", Value().Move(), a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
+
+ // Const Value version
+ const Value foo(d["foo"], d.GetAllocator());
+ SetValueByPointer(d, "/clone", foo, a);
+ EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
+
+ // Generic version
+ SetValueByPointer(d, "/foo/int", -1, a);
+ EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
+
+ SetValueByPointer(d, "/foo/uint", 0x87654321, a);
+ EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ SetValueByPointer(d, "/foo/int64", i64, a);
+ EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ SetValueByPointer(d, "/foo/uint64", u64, a);
+ EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
+
+ SetValueByPointer(d, "/foo/true", true, a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
+
+ SetValueByPointer(d, "/foo/false", false, a);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
+
+ // StringRef version
+ SetValueByPointer(d, "/foo/hello", "Hello", a);
+ EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ SetValueByPointer(d, "/foo/world", buffer, a);
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ SetValueByPointer(d, "/foo/c++", std::string("C++"), a);
+ EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
+#endif
+}
+
+TEST(Pointer, SetValueByPointer_Pointer_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+
+ // Value version
+ SetValueByPointer(d, Pointer("/foo/0"), Value(123).Move());
+ EXPECT_EQ(123, d["foo"][0].GetInt());
+
+ SetValueByPointer(d, Pointer("/foo/null"), Value().Move());
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
+
+ // Const Value version
+ const Value foo(d["foo"], d.GetAllocator());
+ SetValueByPointer(d, Pointer("/clone"), foo);
+ EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
+
+ // Generic version
+ SetValueByPointer(d, Pointer("/foo/int"), -1);
+ EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
+
+ SetValueByPointer(d, Pointer("/foo/uint"), 0x87654321);
+ EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ SetValueByPointer(d, Pointer("/foo/int64"), i64);
+ EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ SetValueByPointer(d, Pointer("/foo/uint64"), u64);
+ EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
+
+ SetValueByPointer(d, Pointer("/foo/true"), true);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
+
+ SetValueByPointer(d, Pointer("/foo/false"), false);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
+
+ // StringRef version
+ SetValueByPointer(d, Pointer("/foo/hello"), "Hello");
+ EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ SetValueByPointer(d, Pointer("/foo/world"), buffer);
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ SetValueByPointer(d, Pointer("/foo/c++"), std::string("C++"));
+ EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
+#endif
+}
+
+TEST(Pointer, SetValueByPointer_String_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+
+ // Value version
+ SetValueByPointer(d, "/foo/0", Value(123).Move());
+ EXPECT_EQ(123, d["foo"][0].GetInt());
+
+ SetValueByPointer(d, "/foo/null", Value().Move());
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
+
+ // Const Value version
+ const Value foo(d["foo"], d.GetAllocator());
+ SetValueByPointer(d, "/clone", foo);
+ EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
+
+ // Generic version
+ SetValueByPointer(d, "/foo/int", -1);
+ EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
+
+ SetValueByPointer(d, "/foo/uint", 0x87654321);
+ EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
+
+ const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
+ SetValueByPointer(d, "/foo/int64", i64);
+ EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
+
+ const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
+ SetValueByPointer(d, "/foo/uint64", u64);
+ EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
+
+ SetValueByPointer(d, "/foo/true", true);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
+
+ SetValueByPointer(d, "/foo/false", false);
+ EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
+
+ // StringRef version
+ SetValueByPointer(d, "/foo/hello", "Hello");
+ EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
+
+ // Copy string version
+ {
+ char buffer[256];
+ strcpy(buffer, "World");
+ SetValueByPointer(d, "/foo/world", buffer);
+ memset(buffer, 0, sizeof(buffer));
+ }
+ EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ SetValueByPointer(d, "/foo/c++", std::string("C++"));
+ EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
+#endif
+}
+
+TEST(Pointer, SwapValueByPointer) {
+ Document d;
+ d.Parse(kJson);
+ Document::AllocatorType& a = d.GetAllocator();
+ SwapValueByPointer(d, Pointer("/foo/0"), *GetValueByPointer(d, "/foo/1"), a);
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_STREQ("bar", d["foo"][1].GetString());
+
+ SwapValueByPointer(d, "/foo/0", *GetValueByPointer(d, "/foo/1"), a);
+ EXPECT_STREQ("bar", d["foo"][0].GetString());
+ EXPECT_STREQ("baz", d["foo"][1].GetString());
+}
+
+TEST(Pointer, SwapValueByPointer_NoAllocator) {
+ Document d;
+ d.Parse(kJson);
+ SwapValueByPointer(d, Pointer("/foo/0"), *GetValueByPointer(d, "/foo/1"));
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_STREQ("bar", d["foo"][1].GetString());
+
+ SwapValueByPointer(d, "/foo/0", *GetValueByPointer(d, "/foo/1"));
+ EXPECT_STREQ("bar", d["foo"][0].GetString());
+ EXPECT_STREQ("baz", d["foo"][1].GetString());
+}
+
+TEST(Pointer, EraseValueByPointer_Pointer) {
+ Document d;
+ d.Parse(kJson);
+
+ EXPECT_FALSE(EraseValueByPointer(d, Pointer("")));
+ EXPECT_FALSE(Pointer("/foo/nonexist").Erase(d));
+ EXPECT_TRUE(EraseValueByPointer(d, Pointer("/foo/0")));
+ EXPECT_EQ(1u, d["foo"].Size());
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_TRUE(EraseValueByPointer(d, Pointer("/foo/0")));
+ EXPECT_TRUE(d["foo"].Empty());
+ EXPECT_TRUE(EraseValueByPointer(d, Pointer("/foo")));
+ EXPECT_TRUE(Pointer("/foo").Get(d) == 0);
+}
+
+TEST(Pointer, EraseValueByPointer_String) {
+ Document d;
+ d.Parse(kJson);
+
+ EXPECT_FALSE(EraseValueByPointer(d, ""));
+ EXPECT_FALSE(Pointer("/foo/nonexist").Erase(d));
+ EXPECT_TRUE(EraseValueByPointer(d, "/foo/0"));
+ EXPECT_EQ(1u, d["foo"].Size());
+ EXPECT_STREQ("baz", d["foo"][0].GetString());
+ EXPECT_TRUE(EraseValueByPointer(d, "/foo/0"));
+ EXPECT_TRUE(d["foo"].Empty());
+ EXPECT_TRUE(EraseValueByPointer(d, "/foo"));
+ EXPECT_TRUE(Pointer("/foo").Get(d) == 0);
+}
+
+TEST(Pointer, Ambiguity) {
+ {
+ Document d;
+ d.Parse("{\"0\" : [123]}");
+ EXPECT_EQ(123, Pointer("/0/0").Get(d)->GetInt());
+ Pointer("/0/a").Set(d, 456); // Change array [123] to object {456}
+ EXPECT_EQ(456, Pointer("/0/a").Get(d)->GetInt());
+ }
+
+ {
+ Document d;
+ EXPECT_FALSE(d.Parse("[{\"0\": 123}]").HasParseError());
+ EXPECT_EQ(123, Pointer("/0/0").Get(d)->GetInt());
+ Pointer("/0/1").Set(d, 456); // 1 is treated as "1" to index object
+ EXPECT_EQ(123, Pointer("/0/0").Get(d)->GetInt());
+ EXPECT_EQ(456, Pointer("/0/1").Get(d)->GetInt());
+ }
+}
+
+// https://github.com/miloyip/rapidjson/issues/483
+namespace myjson {
+
+class MyAllocator
+{
+public:
+ static const bool kNeedFree = true;
+ void * Malloc(size_t _size) { return malloc(_size); }
+ void * Realloc(void *_org_p, size_t _org_size, size_t _new_size) { (void)_org_size; return realloc(_org_p, _new_size); }
+ static void Free(void *_p) { return free(_p); }
+};
+
+typedef rapidjson::GenericDocument<
+ rapidjson::UTF8<>,
+ rapidjson::MemoryPoolAllocator< MyAllocator >,
+ MyAllocator
+ > Document;
+
+typedef rapidjson::GenericPointer<
+ ::myjson::Document::ValueType,
+ MyAllocator
+ > Pointer;
+
+typedef ::myjson::Document::ValueType Value;
+
+}
+
+TEST(Pointer, Issue483) {
+ std::string mystr, path;
+ myjson::Document document;
+ myjson::Value value(rapidjson::kStringType);
+ value.SetString(mystr.c_str(), static_cast<SizeType>(mystr.length()), document.GetAllocator());
+ myjson::Pointer(path.c_str()).Set(document, value, document.GetAllocator());
+}
diff --git a/3rdparty/rapidjson/test/unittest/prettywritertest.cpp b/3rdparty/rapidjson/test/unittest/prettywritertest.cpp
new file mode 100644
index 00000000000..e05d710f8cb
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/prettywritertest.cpp
@@ -0,0 +1,180 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/reader.h"
+#include "rapidjson/prettywriter.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/filewritestream.h"
+
+using namespace rapidjson;
+
+static const char kJson[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3,-1],\"u64\":1234567890123456789,\"i64\":-1234567890123456789}";
+static const char kPrettyJson[] =
+"{\n"
+" \"hello\": \"world\",\n"
+" \"t\": true,\n"
+" \"f\": false,\n"
+" \"n\": null,\n"
+" \"i\": 123,\n"
+" \"pi\": 3.1416,\n"
+" \"a\": [\n"
+" 1,\n"
+" 2,\n"
+" 3,\n"
+" -1\n"
+" ],\n"
+" \"u64\": 1234567890123456789,\n"
+" \"i64\": -1234567890123456789\n"
+"}";
+
+TEST(PrettyWriter, Basic) {
+ StringBuffer buffer;
+ PrettyWriter<StringBuffer> writer(buffer);
+ Reader reader;
+ StringStream s(kJson);
+ reader.Parse(s, writer);
+ EXPECT_STREQ(kPrettyJson, buffer.GetString());
+}
+
+TEST(PrettyWriter, SetIndent) {
+ StringBuffer buffer;
+ PrettyWriter<StringBuffer> writer(buffer);
+ writer.SetIndent('\t', 1);
+ Reader reader;
+ StringStream s(kJson);
+ reader.Parse(s, writer);
+ EXPECT_STREQ(
+ "{\n"
+ "\t\"hello\": \"world\",\n"
+ "\t\"t\": true,\n"
+ "\t\"f\": false,\n"
+ "\t\"n\": null,\n"
+ "\t\"i\": 123,\n"
+ "\t\"pi\": 3.1416,\n"
+ "\t\"a\": [\n"
+ "\t\t1,\n"
+ "\t\t2,\n"
+ "\t\t3,\n"
+ "\t\t-1\n"
+ "\t],\n"
+ "\t\"u64\": 1234567890123456789,\n"
+ "\t\"i64\": -1234567890123456789\n"
+ "}",
+ buffer.GetString());
+}
+
+TEST(PrettyWriter, String) {
+ StringBuffer buffer;
+ PrettyWriter<StringBuffer> writer(buffer);
+ EXPECT_TRUE(writer.StartArray());
+ EXPECT_TRUE(writer.String("Hello\n"));
+ EXPECT_TRUE(writer.EndArray());
+ EXPECT_STREQ("[\n \"Hello\\n\"\n]", buffer.GetString());
+}
+
+#if RAPIDJSON_HAS_STDSTRING
+TEST(PrettyWriter, String_STDSTRING) {
+ StringBuffer buffer;
+ PrettyWriter<StringBuffer> writer(buffer);
+ EXPECT_TRUE(writer.StartArray());
+ EXPECT_TRUE(writer.String(std::string("Hello\n")));
+ EXPECT_TRUE(writer.EndArray());
+ EXPECT_STREQ("[\n \"Hello\\n\"\n]", buffer.GetString());
+}
+#endif
+
+#include <sstream>
+
+class OStreamWrapper {
+public:
+ typedef char Ch;
+
+ OStreamWrapper(std::ostream& os) : os_(os) {}
+
+ Ch Peek() const { assert(false); return '\0'; }
+ Ch Take() { assert(false); return '\0'; }
+ size_t Tell() const { return 0; }
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch c) { os_.put(c); }
+ void Flush() { os_.flush(); }
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ OStreamWrapper(const OStreamWrapper&);
+ OStreamWrapper& operator=(const OStreamWrapper&);
+
+ std::ostream& os_;
+};
+
+// For covering PutN() generic version
+TEST(PrettyWriter, OStreamWrapper) {
+ StringStream s(kJson);
+
+ std::stringstream ss;
+ OStreamWrapper os(ss);
+
+ PrettyWriter<OStreamWrapper> writer(os);
+
+ Reader reader;
+ reader.Parse(s, writer);
+
+ std::string actual = ss.str();
+ EXPECT_STREQ(kPrettyJson, actual.c_str());
+}
+
+// For covering FileWriteStream::PutN()
+TEST(PrettyWriter, FileWriteStream) {
+ char filename[L_tmpnam];
+ FILE* fp = TempFile(filename);
+ char buffer[16];
+ FileWriteStream os(fp, buffer, sizeof(buffer));
+ PrettyWriter<FileWriteStream> writer(os);
+ Reader reader;
+ StringStream s(kJson);
+ reader.Parse(s, writer);
+ fclose(fp);
+
+ fp = fopen(filename, "rb");
+ fseek(fp, 0, SEEK_END);
+ size_t size = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+ char* json = static_cast<char*>(malloc(size + 1));
+ size_t readLength = fread(json, 1, size, fp);
+ json[readLength] = '\0';
+ fclose(fp);
+ remove(filename);
+ EXPECT_STREQ(kPrettyJson, json);
+ free(json);
+}
+
+TEST(PrettyWriter, RawValue) {
+ StringBuffer buffer;
+ PrettyWriter<StringBuffer> writer(buffer);
+ writer.StartObject();
+ writer.Key("a");
+ writer.Int(1);
+ writer.Key("raw");
+ const char json[] = "[\"Hello\\nWorld\", 123.456]";
+ writer.RawValue(json, strlen(json), kArrayType);
+ writer.EndObject();
+ EXPECT_TRUE(writer.IsComplete());
+ EXPECT_STREQ(
+ "{\n"
+ " \"a\": 1,\n"
+ " \"raw\": [\"Hello\\nWorld\", 123.456]\n" // no indentation within raw value
+ "}",
+ buffer.GetString());
+}
diff --git a/3rdparty/rapidjson/test/unittest/readertest.cpp b/3rdparty/rapidjson/test/unittest/readertest.cpp
new file mode 100644
index 00000000000..a07e59a6c9f
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/readertest.cpp
@@ -0,0 +1,1517 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/reader.h"
+#include "rapidjson/internal/dtoa.h"
+#include "rapidjson/internal/itoa.h"
+#include "rapidjson/memorystream.h"
+
+using namespace rapidjson;
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+RAPIDJSON_DIAG_OFF(float-equal)
+RAPIDJSON_DIAG_OFF(missing-noreturn)
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(variadic-macros)
+RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
+#endif
+
+template<bool expect>
+struct ParseBoolHandler : BaseReaderHandler<UTF8<>, ParseBoolHandler<expect> > {
+ ParseBoolHandler() : step_(0) {}
+ bool Default() { ADD_FAILURE(); return false; }
+ // gcc 4.8.x generates warning in EXPECT_EQ(bool, bool) on this gtest version.
+ // Workaround with EXPECT_TRUE().
+ bool Bool(bool b) { /*EXPECT_EQ(expect, b); */EXPECT_TRUE(expect == b); ++step_; return true; }
+
+ unsigned step_;
+};
+
+TEST(Reader, ParseTrue) {
+ StringStream s("true");
+ ParseBoolHandler<true> h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(1u, h.step_);
+}
+
+TEST(Reader, ParseFalse) {
+ StringStream s("false");
+ ParseBoolHandler<false> h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(1u, h.step_);
+}
+
+struct ParseIntHandler : BaseReaderHandler<UTF8<>, ParseIntHandler> {
+ ParseIntHandler() : step_(0), actual_() {}
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Int(int i) { actual_ = i; step_++; return true; }
+
+ unsigned step_;
+ int actual_;
+};
+
+struct ParseUintHandler : BaseReaderHandler<UTF8<>, ParseUintHandler> {
+ ParseUintHandler() : step_(0), actual_() {}
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Uint(unsigned i) { actual_ = i; step_++; return true; }
+
+ unsigned step_;
+ unsigned actual_;
+};
+
+struct ParseInt64Handler : BaseReaderHandler<UTF8<>, ParseInt64Handler> {
+ ParseInt64Handler() : step_(0), actual_() {}
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Int64(int64_t i) { actual_ = i; step_++; return true; }
+
+ unsigned step_;
+ int64_t actual_;
+};
+
+struct ParseUint64Handler : BaseReaderHandler<UTF8<>, ParseUint64Handler> {
+ ParseUint64Handler() : step_(0), actual_() {}
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Uint64(uint64_t i) { actual_ = i; step_++; return true; }
+
+ unsigned step_;
+ uint64_t actual_;
+};
+
+struct ParseDoubleHandler : BaseReaderHandler<UTF8<>, ParseDoubleHandler> {
+ ParseDoubleHandler() : step_(0), actual_() {}
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Double(double d) { actual_ = d; step_++; return true; }
+
+ unsigned step_;
+ double actual_;
+};
+
+TEST(Reader, ParseNumber_Integer) {
+#define TEST_INTEGER(Handler, str, x) \
+ { \
+ StringStream s(str); \
+ Handler h; \
+ Reader reader; \
+ reader.Parse(s, h); \
+ EXPECT_EQ(1u, h.step_); \
+ EXPECT_EQ(x, h.actual_); \
+ }
+
+ TEST_INTEGER(ParseUintHandler, "0", 0u);
+ TEST_INTEGER(ParseUintHandler, "123", 123u);
+ TEST_INTEGER(ParseUintHandler, "2147483648", 2147483648u); // 2^31 - 1 (cannot be stored in int)
+ TEST_INTEGER(ParseUintHandler, "4294967295", 4294967295u);
+
+ TEST_INTEGER(ParseIntHandler, "-123", -123);
+ TEST_INTEGER(ParseIntHandler, "-2147483648", static_cast<int32_t>(0x80000000)); // -2^31 (min of int)
+
+ TEST_INTEGER(ParseUint64Handler, "4294967296", RAPIDJSON_UINT64_C2(1, 0)); // 2^32 (max of unsigned + 1, force to use uint64_t)
+ TEST_INTEGER(ParseUint64Handler, "18446744073709551615", RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)); // 2^64 - 1 (max of uint64_t)
+
+ TEST_INTEGER(ParseInt64Handler, "-2147483649", static_cast<int64_t>(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x7FFFFFFF))); // -2^31 -1 (min of int - 1, force to use int64_t)
+ TEST_INTEGER(ParseInt64Handler, "-9223372036854775808", static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))); // -2^63 (min of int64_t)
+
+ // Random test for uint32_t/int32_t
+ {
+ union {
+ uint32_t u;
+ int32_t i;
+ }u;
+ Random r;
+
+ for (unsigned i = 0; i < 100000; i++) {
+ u.u = r();
+
+ char buffer[32];
+ *internal::u32toa(u.u, buffer) = '\0';
+ TEST_INTEGER(ParseUintHandler, buffer, u.u);
+
+ if (u.i < 0) {
+ *internal::i32toa(u.i, buffer) = '\0';
+ TEST_INTEGER(ParseIntHandler, buffer, u.i);
+ }
+ }
+ }
+
+ // Random test for uint64_t/int64_t
+ {
+ union {
+ uint64_t u;
+ int64_t i;
+ }u;
+ Random r;
+
+ for (unsigned i = 0; i < 100000; i++) {
+ u.u = uint64_t(r()) << 32;
+ u.u |= r();
+
+ char buffer[32];
+ if (u.u > uint64_t(4294967295u)) {
+ *internal::u64toa(u.u, buffer) = '\0';
+ TEST_INTEGER(ParseUint64Handler, buffer, u.u);
+ }
+
+ if (u.i < -int64_t(2147483648u)) {
+ *internal::i64toa(u.i, buffer) = '\0';
+ TEST_INTEGER(ParseInt64Handler, buffer, u.i);
+ }
+ }
+ }
+#undef TEST_INTEGER
+}
+
+template<bool fullPrecision>
+static void TestParseDouble() {
+#define TEST_DOUBLE(fullPrecision, str, x) \
+ { \
+ StringStream s(str); \
+ ParseDoubleHandler h; \
+ Reader reader; \
+ ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code()); \
+ EXPECT_EQ(1u, h.step_); \
+ internal::Double e(x), a(h.actual_); \
+ if (fullPrecision) { \
+ EXPECT_EQ(e.Uint64Value(), a.Uint64Value()); \
+ if (e.Uint64Value() != a.Uint64Value()) \
+ printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", str, h.actual_, x); \
+ } \
+ else { \
+ EXPECT_EQ(e.Sign(), a.Sign()); /* for 0.0 != -0.0 */ \
+ EXPECT_DOUBLE_EQ(x, h.actual_); \
+ } \
+ }
+
+ TEST_DOUBLE(fullPrecision, "0.0", 0.0);
+ TEST_DOUBLE(fullPrecision, "-0.0", -0.0); // For checking issue #289
+ TEST_DOUBLE(fullPrecision, "1.0", 1.0);
+ TEST_DOUBLE(fullPrecision, "-1.0", -1.0);
+ TEST_DOUBLE(fullPrecision, "1.5", 1.5);
+ TEST_DOUBLE(fullPrecision, "-1.5", -1.5);
+ TEST_DOUBLE(fullPrecision, "3.1416", 3.1416);
+ TEST_DOUBLE(fullPrecision, "1E10", 1E10);
+ TEST_DOUBLE(fullPrecision, "1e10", 1e10);
+ TEST_DOUBLE(fullPrecision, "1E+10", 1E+10);
+ TEST_DOUBLE(fullPrecision, "1E-10", 1E-10);
+ TEST_DOUBLE(fullPrecision, "-1E10", -1E10);
+ TEST_DOUBLE(fullPrecision, "-1e10", -1e10);
+ TEST_DOUBLE(fullPrecision, "-1E+10", -1E+10);
+ TEST_DOUBLE(fullPrecision, "-1E-10", -1E-10);
+ TEST_DOUBLE(fullPrecision, "1.234E+10", 1.234E+10);
+ TEST_DOUBLE(fullPrecision, "1.234E-10", 1.234E-10);
+ TEST_DOUBLE(fullPrecision, "1.79769e+308", 1.79769e+308);
+ TEST_DOUBLE(fullPrecision, "2.22507e-308", 2.22507e-308);
+ TEST_DOUBLE(fullPrecision, "-1.79769e+308", -1.79769e+308);
+ TEST_DOUBLE(fullPrecision, "-2.22507e-308", -2.22507e-308);
+ TEST_DOUBLE(fullPrecision, "4.9406564584124654e-324", 4.9406564584124654e-324); // minimum denormal
+ TEST_DOUBLE(fullPrecision, "2.2250738585072009e-308", 2.2250738585072009e-308); // Max subnormal double
+ TEST_DOUBLE(fullPrecision, "2.2250738585072014e-308", 2.2250738585072014e-308); // Min normal positive double
+ TEST_DOUBLE(fullPrecision, "1.7976931348623157e+308", 1.7976931348623157e+308); // Max double
+ TEST_DOUBLE(fullPrecision, "1e-10000", 0.0); // must underflow
+ TEST_DOUBLE(fullPrecision, "18446744073709551616", 18446744073709551616.0); // 2^64 (max of uint64_t + 1, force to use double)
+ TEST_DOUBLE(fullPrecision, "-9223372036854775809", -9223372036854775809.0); // -2^63 - 1(min of int64_t + 1, force to use double)
+ TEST_DOUBLE(fullPrecision, "0.9868011474609375", 0.9868011474609375); // https://github.com/miloyip/rapidjson/issues/120
+ TEST_DOUBLE(fullPrecision, "123e34", 123e34); // Fast Path Cases In Disguise
+ TEST_DOUBLE(fullPrecision, "45913141877270640000.0", 45913141877270640000.0);
+ TEST_DOUBLE(fullPrecision, "2.2250738585072011e-308", 2.2250738585072011e-308); // http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
+ TEST_DOUBLE(fullPrecision, "1e-00011111111111", 0.0); // Issue #313
+ TEST_DOUBLE(fullPrecision, "-1e-00011111111111", -0.0);
+ TEST_DOUBLE(fullPrecision, "1e-214748363", 0.0); // Maximum supported negative exponent
+ TEST_DOUBLE(fullPrecision, "1e-214748364", 0.0);
+ TEST_DOUBLE(fullPrecision, "1e-21474836311", 0.0);
+ TEST_DOUBLE(fullPrecision, "0.017976931348623157e+310", 1.7976931348623157e+308); // Max double in another form
+
+ // Since
+ // abs((2^-1022 - 2^-1074) - 2.2250738585072012e-308) = 3.109754131239141401123495768877590405345064751974375599... ¡Á 10^-324
+ // abs((2^-1022) - 2.2250738585072012e-308) = 1.830902327173324040642192159804623318305533274168872044... ¡Á 10 ^ -324
+ // So 2.2250738585072012e-308 should round to 2^-1022 = 2.2250738585072014e-308
+ TEST_DOUBLE(fullPrecision, "2.2250738585072012e-308", 2.2250738585072014e-308); // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
+
+ // More closer to normal/subnormal boundary
+ // boundary = 2^-1022 - 2^-1075 = 2.225073858507201136057409796709131975934819546351645648... ¡Á 10^-308
+ TEST_DOUBLE(fullPrecision, "2.22507385850720113605740979670913197593481954635164564e-308", 2.2250738585072009e-308);
+ TEST_DOUBLE(fullPrecision, "2.22507385850720113605740979670913197593481954635164565e-308", 2.2250738585072014e-308);
+
+ // 1.0 is in (1.0 - 2^-54, 1.0 + 2^-53)
+ // 1.0 - 2^-54 = 0.999999999999999944488848768742172978818416595458984375
+ TEST_DOUBLE(fullPrecision, "0.999999999999999944488848768742172978818416595458984375", 1.0); // round to even
+ TEST_DOUBLE(fullPrecision, "0.999999999999999944488848768742172978818416595458984374", 0.99999999999999989); // previous double
+ TEST_DOUBLE(fullPrecision, "0.999999999999999944488848768742172978818416595458984376", 1.0); // next double
+ // 1.0 + 2^-53 = 1.00000000000000011102230246251565404236316680908203125
+ TEST_DOUBLE(fullPrecision, "1.00000000000000011102230246251565404236316680908203125", 1.0); // round to even
+ TEST_DOUBLE(fullPrecision, "1.00000000000000011102230246251565404236316680908203124", 1.0); // previous double
+ TEST_DOUBLE(fullPrecision, "1.00000000000000011102230246251565404236316680908203126", 1.00000000000000022); // next double
+
+ // Numbers from https://github.com/floitsch/double-conversion/blob/master/test/cctest/test-strtod.cc
+
+ TEST_DOUBLE(fullPrecision, "72057594037927928.0", 72057594037927928.0);
+ TEST_DOUBLE(fullPrecision, "72057594037927936.0", 72057594037927936.0);
+ TEST_DOUBLE(fullPrecision, "72057594037927932.0", 72057594037927936.0);
+ TEST_DOUBLE(fullPrecision, "7205759403792793199999e-5", 72057594037927928.0);
+ TEST_DOUBLE(fullPrecision, "7205759403792793200001e-5", 72057594037927936.0);
+
+ TEST_DOUBLE(fullPrecision, "9223372036854774784.0", 9223372036854774784.0);
+ TEST_DOUBLE(fullPrecision, "9223372036854775808.0", 9223372036854775808.0);
+ TEST_DOUBLE(fullPrecision, "9223372036854775296.0", 9223372036854775808.0);
+ TEST_DOUBLE(fullPrecision, "922337203685477529599999e-5", 9223372036854774784.0);
+ TEST_DOUBLE(fullPrecision, "922337203685477529600001e-5", 9223372036854775808.0);
+
+ TEST_DOUBLE(fullPrecision, "10141204801825834086073718800384", 10141204801825834086073718800384.0);
+ TEST_DOUBLE(fullPrecision, "10141204801825835211973625643008", 10141204801825835211973625643008.0);
+ TEST_DOUBLE(fullPrecision, "10141204801825834649023672221696", 10141204801825835211973625643008.0);
+ TEST_DOUBLE(fullPrecision, "1014120480182583464902367222169599999e-5", 10141204801825834086073718800384.0);
+ TEST_DOUBLE(fullPrecision, "1014120480182583464902367222169600001e-5", 10141204801825835211973625643008.0);
+
+ TEST_DOUBLE(fullPrecision, "5708990770823838890407843763683279797179383808", 5708990770823838890407843763683279797179383808.0);
+ TEST_DOUBLE(fullPrecision, "5708990770823839524233143877797980545530986496", 5708990770823839524233143877797980545530986496.0);
+ TEST_DOUBLE(fullPrecision, "5708990770823839207320493820740630171355185152", 5708990770823839524233143877797980545530986496.0);
+ TEST_DOUBLE(fullPrecision, "5708990770823839207320493820740630171355185151999e-3", 5708990770823838890407843763683279797179383808.0);
+ TEST_DOUBLE(fullPrecision, "5708990770823839207320493820740630171355185152001e-3", 5708990770823839524233143877797980545530986496.0);
+
+ {
+ char n1e308[310]; // '1' followed by 308 '0'
+ n1e308[0] = '1';
+ for (int i = 1; i < 309; i++)
+ n1e308[i] = '0';
+ n1e308[309] = '\0';
+ TEST_DOUBLE(fullPrecision, n1e308, 1E308);
+ }
+
+ // Cover trimming
+ TEST_DOUBLE(fullPrecision,
+"2.22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508"
+"7914149158913039621106870086438694594645527657207407820621743379988141063267329253552286881372149012"
+"9811224514518898490572223072852551331557550159143974763979834118019993239625482890171070818506906306"
+"6665599493827577257201576306269066333264756530000924588831643303777979186961204949739037782970490505"
+"1080609940730262937128958950003583799967207254304360284078895771796150945516748243471030702609144621"
+"5722898802581825451803257070188608721131280795122334262883686223215037756666225039825343359745688844"
+"2390026549819838548794829220689472168983109969836584681402285424333066033985088644580400103493397042"
+"7567186443383770486037861622771738545623065874679014086723327636718751234567890123456789012345678901"
+"e-308",
+ 2.2250738585072014e-308);
+
+ {
+ static const unsigned count = 100; // Tested with 1000000 locally
+ Random r;
+ Reader reader; // Reusing reader to prevent heap allocation
+
+ // Exhaustively test different exponents with random significant
+ for (uint64_t exp = 0; exp < 2047; exp++) {
+ ;
+ for (unsigned i = 0; i < count; i++) {
+ // Need to call r() in two statements for cross-platform coherent sequence.
+ uint64_t u = (exp << 52) | uint64_t(r() & 0x000FFFFF) << 32;
+ u |= uint64_t(r());
+ internal::Double d = internal::Double(u);
+
+ char buffer[32];
+ *internal::dtoa(d.Value(), buffer) = '\0';
+
+ StringStream s(buffer);
+ ParseDoubleHandler h;
+ ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code());
+ EXPECT_EQ(1u, h.step_);
+ internal::Double a(h.actual_);
+ if (fullPrecision) {
+ EXPECT_EQ(d.Uint64Value(), a.Uint64Value());
+ if (d.Uint64Value() != a.Uint64Value())
+ printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", buffer, h.actual_, d.Value());
+ }
+ else {
+ EXPECT_EQ(d.Sign(), a.Sign()); // for 0.0 != -0.0
+ EXPECT_DOUBLE_EQ(d.Value(), h.actual_);
+ }
+ }
+ }
+ }
+
+ // Issue #340
+ TEST_DOUBLE(fullPrecision, "7.450580596923828e-9", 7.450580596923828e-9);
+ {
+ internal::Double d(1.0);
+ for (int i = 0; i < 324; i++) {
+ char buffer[32];
+ *internal::dtoa(d.Value(), buffer) = '\0';
+
+ StringStream s(buffer);
+ ParseDoubleHandler h;
+ Reader reader;
+ ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code());
+ EXPECT_EQ(1u, h.step_);
+ internal::Double a(h.actual_);
+ if (fullPrecision) {
+ EXPECT_EQ(d.Uint64Value(), a.Uint64Value());
+ if (d.Uint64Value() != a.Uint64Value())
+ printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", buffer, h.actual_, d.Value());
+ }
+ else {
+ EXPECT_EQ(d.Sign(), a.Sign()); // for 0.0 != -0.0
+ EXPECT_DOUBLE_EQ(d.Value(), h.actual_);
+ }
+
+
+ d = d.Value() * 0.5;
+ }
+ }
+#undef TEST_DOUBLE
+}
+
+TEST(Reader, ParseNumber_NormalPrecisionDouble) {
+ TestParseDouble<false>();
+}
+
+TEST(Reader, ParseNumber_FullPrecisionDouble) {
+ TestParseDouble<true>();
+}
+
+TEST(Reader, ParseNumber_NormalPrecisionError) {
+ static unsigned count = 1000000;
+ Random r;
+
+ double ulpSum = 0.0;
+ double ulpMax = 0.0;
+ for (unsigned i = 0; i < count; i++) {
+ internal::Double e, a;
+ do {
+ // Need to call r() in two statements for cross-platform coherent sequence.
+ uint64_t u = uint64_t(r()) << 32;
+ u |= uint64_t(r());
+ e = u;
+ } while (e.IsNan() || e.IsInf() || !e.IsNormal());
+
+ char buffer[32];
+ *internal::dtoa(e.Value(), buffer) = '\0';
+
+ StringStream s(buffer);
+ ParseDoubleHandler h;
+ Reader reader;
+ ASSERT_EQ(kParseErrorNone, reader.Parse(s, h).Code());
+ EXPECT_EQ(1u, h.step_);
+
+ a = h.actual_;
+ uint64_t bias1 = e.ToBias();
+ uint64_t bias2 = a.ToBias();
+ double ulp = static_cast<double>(bias1 >= bias2 ? bias1 - bias2 : bias2 - bias1);
+ ulpMax = std::max(ulpMax, ulp);
+ ulpSum += ulp;
+ }
+ printf("ULP Average = %g, Max = %g \n", ulpSum / count, ulpMax);
+}
+
+TEST(Reader, ParseNumber_Error) {
+#define TEST_NUMBER_ERROR(errorCode, str, errorOffset, streamPos) \
+ { \
+ char buffer[1001]; \
+ sprintf(buffer, "%s", str); \
+ InsituStringStream s(buffer); \
+ BaseReaderHandler<> h; \
+ Reader reader; \
+ EXPECT_FALSE(reader.Parse(s, h)); \
+ EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
+ EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
+ EXPECT_EQ(streamPos, s.Tell());\
+ }
+
+ // Number too big to be stored in double.
+ {
+ char n1e309[311]; // '1' followed by 309 '0'
+ n1e309[0] = '1';
+ for (int i = 1; i < 310; i++)
+ n1e309[i] = '0';
+ n1e309[310] = '\0';
+ TEST_NUMBER_ERROR(kParseErrorNumberTooBig, n1e309, 0, 309);
+ }
+ TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e309", 0, 5);
+
+ // Miss fraction part in number.
+ TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1.", 2, 2);
+ TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1.a", 2, 2);
+
+ // Miss exponent in number.
+ TEST_NUMBER_ERROR(kParseErrorNumberMissExponent, "1e", 2, 2);
+ TEST_NUMBER_ERROR(kParseErrorNumberMissExponent, "1e_", 2, 2);
+
+#undef TEST_NUMBER_ERROR
+}
+
+template <typename Encoding>
+struct ParseStringHandler : BaseReaderHandler<Encoding, ParseStringHandler<Encoding> > {
+ ParseStringHandler() : str_(0), length_(0), copy_() {}
+ ~ParseStringHandler() { EXPECT_TRUE(str_ != 0); if (copy_) free(const_cast<typename Encoding::Ch*>(str_)); }
+
+ ParseStringHandler(const ParseStringHandler&);
+ ParseStringHandler& operator=(const ParseStringHandler&);
+
+ bool Default() { ADD_FAILURE(); return false; }
+ bool String(const typename Encoding::Ch* str, size_t length, bool copy) {
+ EXPECT_EQ(0, str_);
+ if (copy) {
+ str_ = static_cast<typename Encoding::Ch*>(malloc((length + 1) * sizeof(typename Encoding::Ch)));
+ memcpy(const_cast<typename Encoding::Ch*>(str_), str, (length + 1) * sizeof(typename Encoding::Ch));
+ }
+ else
+ str_ = str;
+ length_ = length;
+ copy_ = copy;
+ return true;
+ }
+
+ const typename Encoding::Ch* str_;
+ size_t length_;
+ bool copy_;
+};
+
+TEST(Reader, ParseString) {
+#define TEST_STRING(Encoding, e, x) \
+ { \
+ Encoding::Ch* buffer = StrDup(x); \
+ GenericInsituStringStream<Encoding> is(buffer); \
+ ParseStringHandler<Encoding> h; \
+ GenericReader<Encoding, Encoding> reader; \
+ reader.Parse<kParseInsituFlag | kParseValidateEncodingFlag>(is, h); \
+ EXPECT_EQ(0, StrCmp<Encoding::Ch>(e, h.str_)); \
+ EXPECT_EQ(StrLen(e), h.length_); \
+ free(buffer); \
+ GenericStringStream<Encoding> s(x); \
+ ParseStringHandler<Encoding> h2; \
+ GenericReader<Encoding, Encoding> reader2; \
+ reader2.Parse(s, h2); \
+ EXPECT_EQ(0, StrCmp<Encoding::Ch>(e, h2.str_)); \
+ EXPECT_EQ(StrLen(e), h2.length_); \
+ }
+
+ // String constant L"\xXX" can only specify character code in bytes, which is not endianness-neutral.
+ // And old compiler does not support u"" and U"" string literal. So here specify string literal by array of Ch.
+ // In addition, GCC 4.8 generates -Wnarrowing warnings when character code >= 128 are assigned to signed integer types.
+ // Therefore, utype is added for declaring unsigned array, and then cast it to Encoding::Ch.
+#define ARRAY(...) { __VA_ARGS__ }
+#define TEST_STRINGARRAY(Encoding, utype, array, x) \
+ { \
+ static const utype ue[] = array; \
+ static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \
+ TEST_STRING(Encoding, e, x); \
+ }
+
+#define TEST_STRINGARRAY2(Encoding, utype, earray, xarray) \
+ { \
+ static const utype ue[] = earray; \
+ static const utype xe[] = xarray; \
+ static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \
+ static const Encoding::Ch* x = reinterpret_cast<const Encoding::Ch *>(&xe[0]); \
+ TEST_STRING(Encoding, e, x); \
+ }
+
+ TEST_STRING(UTF8<>, "", "\"\"");
+ TEST_STRING(UTF8<>, "Hello", "\"Hello\"");
+ TEST_STRING(UTF8<>, "Hello\nWorld", "\"Hello\\nWorld\"");
+ TEST_STRING(UTF8<>, "\"\\/\b\f\n\r\t", "\"\\\"\\\\/\\b\\f\\n\\r\\t\"");
+ TEST_STRING(UTF8<>, "\x24", "\"\\u0024\""); // Dollar sign U+0024
+ TEST_STRING(UTF8<>, "\xC2\xA2", "\"\\u00A2\""); // Cents sign U+00A2
+ TEST_STRING(UTF8<>, "\xE2\x82\xAC", "\"\\u20AC\""); // Euro sign U+20AC
+ TEST_STRING(UTF8<>, "\xF0\x9D\x84\x9E", "\"\\uD834\\uDD1E\""); // G clef sign U+1D11E
+
+ // UTF16
+ TEST_STRING(UTF16<>, L"", L"\"\"");
+ TEST_STRING(UTF16<>, L"Hello", L"\"Hello\"");
+ TEST_STRING(UTF16<>, L"Hello\nWorld", L"\"Hello\\nWorld\"");
+ TEST_STRING(UTF16<>, L"\"\\/\b\f\n\r\t", L"\"\\\"\\\\/\\b\\f\\n\\r\\t\"");
+ TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x0024, 0x0000), L"\"\\u0024\"");
+ TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x00A2, 0x0000), L"\"\\u00A2\""); // Cents sign U+00A2
+ TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x20AC, 0x0000), L"\"\\u20AC\""); // Euro sign U+20AC
+ TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0xD834, 0xDD1E, 0x0000), L"\"\\uD834\\uDD1E\""); // G clef sign U+1D11E
+
+ // UTF32
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('\0'), ARRAY('\"', '\"', '\0'));
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('H', 'e', 'l', 'l', 'o', '\0'), ARRAY('\"', 'H', 'e', 'l', 'l', 'o', '\"', '\0'));
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('H', 'e', 'l', 'l', 'o', '\n', 'W', 'o', 'r', 'l', 'd', '\0'), ARRAY('\"', 'H', 'e', 'l', 'l', 'o', '\\', 'n', 'W', 'o', 'r', 'l', 'd', '\"', '\0'));
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('\"', '\\', '/', '\b', '\f', '\n', '\r', '\t', '\0'), ARRAY('\"', '\\', '\"', '\\', '\\', '/', '\\', 'b', '\\', 'f', '\\', 'n', '\\', 'r', '\\', 't', '\"', '\0'));
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x00024, 0x0000), ARRAY('\"', '\\', 'u', '0', '0', '2', '4', '\"', '\0'));
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x000A2, 0x0000), ARRAY('\"', '\\', 'u', '0', '0', 'A', '2', '\"', '\0')); // Cents sign U+00A2
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x020AC, 0x0000), ARRAY('\"', '\\', 'u', '2', '0', 'A', 'C', '\"', '\0')); // Euro sign U+20AC
+ TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x1D11E, 0x0000), ARRAY('\"', '\\', 'u', 'D', '8', '3', '4', '\\', 'u', 'D', 'D', '1', 'E', '\"', '\0')); // G clef sign U+1D11E
+
+#undef TEST_STRINGARRAY
+#undef ARRAY
+#undef TEST_STRING
+
+ // Support of null character in string
+ {
+ StringStream s("\"Hello\\u0000World\"");
+ const char e[] = "Hello\0World";
+ ParseStringHandler<UTF8<> > h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(0, memcmp(e, h.str_, h.length_ + 1));
+ EXPECT_EQ(11u, h.length_);
+ }
+}
+
+TEST(Reader, ParseString_Transcoding) {
+ const char* x = "\"Hello\"";
+ const wchar_t* e = L"Hello";
+ GenericStringStream<UTF8<> > is(x);
+ GenericReader<UTF8<>, UTF16<> > reader;
+ ParseStringHandler<UTF16<> > h;
+ reader.Parse(is, h);
+ EXPECT_EQ(0, StrCmp<UTF16<>::Ch>(e, h.str_));
+ EXPECT_EQ(StrLen(e), h.length_);
+}
+
+TEST(Reader, ParseString_TranscodingWithValidation) {
+ const char* x = "\"Hello\"";
+ const wchar_t* e = L"Hello";
+ GenericStringStream<UTF8<> > is(x);
+ GenericReader<UTF8<>, UTF16<> > reader;
+ ParseStringHandler<UTF16<> > h;
+ reader.Parse<kParseValidateEncodingFlag>(is, h);
+ EXPECT_EQ(0, StrCmp<UTF16<>::Ch>(e, h.str_));
+ EXPECT_EQ(StrLen(e), h.length_);
+}
+
+TEST(Reader, ParseString_NonDestructive) {
+ StringStream s("\"Hello\\nWorld\"");
+ ParseStringHandler<UTF8<> > h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(0, StrCmp("Hello\nWorld", h.str_));
+ EXPECT_EQ(11u, h.length_);
+}
+
+template <typename Encoding>
+ParseErrorCode TestString(const typename Encoding::Ch* str) {
+ GenericStringStream<Encoding> s(str);
+ BaseReaderHandler<Encoding> h;
+ GenericReader<Encoding, Encoding> reader;
+ reader.template Parse<kParseValidateEncodingFlag>(s, h);
+ return reader.GetParseErrorCode();
+}
+
+TEST(Reader, ParseString_Error) {
+#define TEST_STRING_ERROR(errorCode, str, errorOffset, streamPos)\
+{\
+ GenericStringStream<UTF8<> > s(str);\
+ BaseReaderHandler<UTF8<> > h;\
+ GenericReader<UTF8<> , UTF8<> > reader;\
+ reader.Parse<kParseValidateEncodingFlag>(s, h);\
+ EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
+ EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
+ EXPECT_EQ(streamPos, s.Tell());\
+}
+
+#define ARRAY(...) { __VA_ARGS__ }
+#define TEST_STRINGENCODING_ERROR(Encoding, TargetEncoding, utype, array) \
+ { \
+ static const utype ue[] = array; \
+ static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \
+ EXPECT_EQ(kParseErrorStringInvalidEncoding, TestString<Encoding>(e));\
+ /* decode error */\
+ GenericStringStream<Encoding> s(e);\
+ BaseReaderHandler<TargetEncoding> h;\
+ GenericReader<Encoding, TargetEncoding> reader;\
+ reader.Parse(s, h);\
+ EXPECT_EQ(kParseErrorStringInvalidEncoding, reader.GetParseErrorCode());\
+ }
+
+ // Invalid escape character in string.
+ TEST_STRING_ERROR(kParseErrorStringEscapeInvalid, "[\"\\a\"]", 2, 3);
+
+ // Incorrect hex digit after \\u escape in string.
+ TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, "[\"\\uABCG\"]", 2, 7);
+
+ // Quotation in \\u escape in string (Issue #288)
+ TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, "[\"\\uaaa\"]", 2, 7);
+ TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, "[\"\\uD800\\uFFF\"]", 2, 13);
+
+ // The surrogate pair in string is invalid.
+ TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, "[\"\\uD800X\"]", 2, 8);
+ TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, "[\"\\uD800\\uFFFF\"]", 2, 14);
+
+ // Missing a closing quotation mark in string.
+ TEST_STRING_ERROR(kParseErrorStringMissQuotationMark, "[\"Test]", 7, 7);
+
+ // http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
+
+ // 3 Malformed sequences
+
+ // 3.1 Unexpected continuation bytes
+ {
+ char e[] = { '[', '\"', 0, '\"', ']', '\0' };
+ for (unsigned char c = 0x80u; c <= 0xBFu; c++) {
+ e[2] = static_cast<char>(c);
+ ParseErrorCode error = TestString<UTF8<> >(e);
+ EXPECT_EQ(kParseErrorStringInvalidEncoding, error);
+ if (error != kParseErrorStringInvalidEncoding)
+ std::cout << static_cast<unsigned>(c) << std::endl;
+ }
+ }
+
+ // 3.2 Lonely start characters, 3.5 Impossible bytes
+ {
+ char e[] = { '[', '\"', 0, ' ', '\"', ']', '\0' };
+ for (unsigned c = 0xC0u; c <= 0xFFu; c++) {
+ e[2] = static_cast<char>(c);
+ int streamPos;
+ if (c <= 0xC1u)
+ streamPos = 3; // 0xC0 - 0xC1
+ else if (c <= 0xDFu)
+ streamPos = 4; // 0xC2 - 0xDF
+ else if (c <= 0xEFu)
+ streamPos = 5; // 0xE0 - 0xEF
+ else if (c <= 0xF4u)
+ streamPos = 6; // 0xF0 - 0xF4
+ else
+ streamPos = 3; // 0xF5 - 0xFF
+ TEST_STRING_ERROR(kParseErrorStringInvalidEncoding, e, 2, streamPos);
+ }
+ }
+
+ // 4 Overlong sequences
+
+ // 4.1 Examples of an overlong ASCII character
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xC0u, 0xAFu, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xE0u, 0x80u, 0xAFu, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xF0u, 0x80u, 0x80u, 0xAFu, '\"', ']', '\0'));
+
+ // 4.2 Maximum overlong sequences
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xC1u, 0xBFu, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xE0u, 0x9Fu, 0xBFu, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xF0u, 0x8Fu, 0xBFu, 0xBFu, '\"', ']', '\0'));
+
+ // 4.3 Overlong representation of the NUL character
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xC0u, 0x80u, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xE0u, 0x80u, 0x80u, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xF0u, 0x80u, 0x80u, 0x80u, '\"', ']', '\0'));
+
+ // 5 Illegal code positions
+
+ // 5.1 Single UTF-16 surrogates
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xA0u, 0x80u, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xADu, 0xBFu, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xAEu, 0x80u, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xAFu, 0xBFu, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xB0u, 0x80u, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xBEu, 0x80u, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xBFu, 0xBFu, '\"', ']', '\0'));
+
+ // Malform UTF-16 sequences
+ TEST_STRINGENCODING_ERROR(UTF16<>, UTF8<>, wchar_t, ARRAY('[', '\"', 0xDC00, 0xDC00, '\"', ']', '\0'));
+ TEST_STRINGENCODING_ERROR(UTF16<>, UTF8<>, wchar_t, ARRAY('[', '\"', 0xD800, 0xD800, '\"', ']', '\0'));
+
+ // Malform UTF-32 sequence
+ TEST_STRINGENCODING_ERROR(UTF32<>, UTF8<>, unsigned, ARRAY('[', '\"', 0x110000, '\"', ']', '\0'));
+
+ // Malform ASCII sequence
+ TEST_STRINGENCODING_ERROR(ASCII<>, UTF8<>, char, ARRAY('[', '\"', char(0x80), '\"', ']', '\0'));
+
+#undef ARRAY
+#undef TEST_STRINGARRAY_ERROR
+}
+
+template <unsigned count>
+struct ParseArrayHandler : BaseReaderHandler<UTF8<>, ParseArrayHandler<count> > {
+ ParseArrayHandler() : step_(0) {}
+
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Uint(unsigned i) { EXPECT_EQ(step_, i); step_++; return true; }
+ bool StartArray() { EXPECT_EQ(0u, step_); step_++; return true; }
+ bool EndArray(SizeType) { step_++; return true; }
+
+ unsigned step_;
+};
+
+TEST(Reader, ParseEmptyArray) {
+ char *json = StrDup("[ ] ");
+ InsituStringStream s(json);
+ ParseArrayHandler<0> h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(2u, h.step_);
+ free(json);
+}
+
+TEST(Reader, ParseArray) {
+ char *json = StrDup("[1, 2, 3, 4]");
+ InsituStringStream s(json);
+ ParseArrayHandler<4> h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(6u, h.step_);
+ free(json);
+}
+
+TEST(Reader, ParseArray_Error) {
+#define TEST_ARRAY_ERROR(errorCode, str, errorOffset) \
+ { \
+ int streamPos = errorOffset; \
+ char buffer[1001]; \
+ strncpy(buffer, str, 1000); \
+ InsituStringStream s(buffer); \
+ BaseReaderHandler<> h; \
+ GenericReader<UTF8<>, UTF8<>, CrtAllocator> reader; \
+ EXPECT_FALSE(reader.Parse(s, h)); \
+ EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
+ EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
+ EXPECT_EQ(streamPos, s.Tell());\
+ }
+
+ // Missing a comma or ']' after an array element.
+ TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, "[1", 2);
+ TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, "[1}", 2);
+ TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, "[1 2]", 3);
+
+#undef TEST_ARRAY_ERROR
+}
+
+struct ParseObjectHandler : BaseReaderHandler<UTF8<>, ParseObjectHandler> {
+ ParseObjectHandler() : step_(0) {}
+
+ bool Default() { ADD_FAILURE(); return false; }
+ bool Null() { EXPECT_EQ(8u, step_); step_++; return true; }
+ bool Bool(bool b) {
+ switch(step_) {
+ case 4: EXPECT_TRUE(b); step_++; return true;
+ case 6: EXPECT_FALSE(b); step_++; return true;
+ default: ADD_FAILURE(); return false;
+ }
+ }
+ bool Int(int i) {
+ switch(step_) {
+ case 10: EXPECT_EQ(123, i); step_++; return true;
+ case 15: EXPECT_EQ(1, i); step_++; return true;
+ case 16: EXPECT_EQ(2, i); step_++; return true;
+ case 17: EXPECT_EQ(3, i); step_++; return true;
+ default: ADD_FAILURE(); return false;
+ }
+ }
+ bool Uint(unsigned i) { return Int(static_cast<int>(i)); }
+ bool Double(double d) { EXPECT_EQ(12u, step_); EXPECT_DOUBLE_EQ(3.1416, d); step_++; return true; }
+ bool String(const char* str, size_t, bool) {
+ switch(step_) {
+ case 1: EXPECT_STREQ("hello", str); step_++; return true;
+ case 2: EXPECT_STREQ("world", str); step_++; return true;
+ case 3: EXPECT_STREQ("t", str); step_++; return true;
+ case 5: EXPECT_STREQ("f", str); step_++; return true;
+ case 7: EXPECT_STREQ("n", str); step_++; return true;
+ case 9: EXPECT_STREQ("i", str); step_++; return true;
+ case 11: EXPECT_STREQ("pi", str); step_++; return true;
+ case 13: EXPECT_STREQ("a", str); step_++; return true;
+ default: ADD_FAILURE(); return false;
+ }
+ }
+ bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }
+ bool EndObject(SizeType memberCount) { EXPECT_EQ(19u, step_); EXPECT_EQ(7u, memberCount); step_++; return true; }
+ bool StartArray() { EXPECT_EQ(14u, step_); step_++; return true; }
+ bool EndArray(SizeType elementCount) { EXPECT_EQ(18u, step_); EXPECT_EQ(3u, elementCount); step_++; return true; }
+
+ unsigned step_;
+};
+
+TEST(Reader, ParseObject) {
+ const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ";
+
+ // Insitu
+ {
+ char* json2 = StrDup(json);
+ InsituStringStream s(json2);
+ ParseObjectHandler h;
+ Reader reader;
+ reader.Parse<kParseInsituFlag>(s, h);
+ EXPECT_EQ(20u, h.step_);
+ free(json2);
+ }
+
+ // Normal
+ {
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(20u, h.step_);
+ }
+}
+
+struct ParseEmptyObjectHandler : BaseReaderHandler<UTF8<>, ParseEmptyObjectHandler> {
+ ParseEmptyObjectHandler() : step_(0) {}
+
+ bool Default() { ADD_FAILURE(); return false; }
+ bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }
+ bool EndObject(SizeType) { EXPECT_EQ(1u, step_); step_++; return true; }
+
+ unsigned step_;
+};
+
+TEST(Reader, Parse_EmptyObject) {
+ StringStream s("{ } ");
+ ParseEmptyObjectHandler h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(2u, h.step_);
+}
+
+struct ParseMultipleRootHandler : BaseReaderHandler<UTF8<>, ParseMultipleRootHandler> {
+ ParseMultipleRootHandler() : step_(0) {}
+
+ bool Default() { ADD_FAILURE(); return false; }
+ bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }
+ bool EndObject(SizeType) { EXPECT_EQ(1u, step_); step_++; return true; }
+ bool StartArray() { EXPECT_EQ(2u, step_); step_++; return true; }
+ bool EndArray(SizeType) { EXPECT_EQ(3u, step_); step_++; return true; }
+
+ unsigned step_;
+};
+
+template <unsigned parseFlags>
+void TestMultipleRoot() {
+ StringStream s("{}[] a");
+ ParseMultipleRootHandler h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<parseFlags>(s, h));
+ EXPECT_EQ(2u, h.step_);
+ EXPECT_TRUE(reader.Parse<parseFlags>(s, h));
+ EXPECT_EQ(4u, h.step_);
+ EXPECT_EQ(' ', s.Take());
+ EXPECT_EQ('a', s.Take());
+}
+
+TEST(Reader, Parse_MultipleRoot) {
+ TestMultipleRoot<kParseStopWhenDoneFlag>();
+}
+
+TEST(Reader, ParseIterative_MultipleRoot) {
+ TestMultipleRoot<kParseIterativeFlag | kParseStopWhenDoneFlag>();
+}
+
+template <unsigned parseFlags>
+void TestInsituMultipleRoot() {
+ char* buffer = strdup("{}[] a");
+ InsituStringStream s(buffer);
+ ParseMultipleRootHandler h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseInsituFlag | parseFlags>(s, h));
+ EXPECT_EQ(2u, h.step_);
+ EXPECT_TRUE(reader.Parse<kParseInsituFlag | parseFlags>(s, h));
+ EXPECT_EQ(4u, h.step_);
+ EXPECT_EQ(' ', s.Take());
+ EXPECT_EQ('a', s.Take());
+ free(buffer);
+}
+
+TEST(Reader, ParseInsitu_MultipleRoot) {
+ TestInsituMultipleRoot<kParseStopWhenDoneFlag>();
+}
+
+TEST(Reader, ParseInsituIterative_MultipleRoot) {
+ TestInsituMultipleRoot<kParseIterativeFlag | kParseStopWhenDoneFlag>();
+}
+
+#define TEST_ERROR(errorCode, str, errorOffset) \
+ { \
+ int streamPos = errorOffset; \
+ char buffer[1001]; \
+ strncpy(buffer, str, 1000); \
+ InsituStringStream s(buffer); \
+ BaseReaderHandler<> h; \
+ Reader reader; \
+ EXPECT_FALSE(reader.Parse(s, h)); \
+ EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
+ EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
+ EXPECT_EQ(streamPos, s.Tell());\
+ }
+
+TEST(Reader, ParseDocument_Error) {
+ // The document is empty.
+ TEST_ERROR(kParseErrorDocumentEmpty, "", 0);
+ TEST_ERROR(kParseErrorDocumentEmpty, " ", 1);
+ TEST_ERROR(kParseErrorDocumentEmpty, " \n", 2);
+
+ // The document root must not follow by other values.
+ TEST_ERROR(kParseErrorDocumentRootNotSingular, "[] 0", 3);
+ TEST_ERROR(kParseErrorDocumentRootNotSingular, "{} 0", 3);
+ TEST_ERROR(kParseErrorDocumentRootNotSingular, "null []", 5);
+ TEST_ERROR(kParseErrorDocumentRootNotSingular, "0 {}", 2);
+}
+
+TEST(Reader, ParseValue_Error) {
+ // Invalid value.
+ TEST_ERROR(kParseErrorValueInvalid, "nulL", 3);
+ TEST_ERROR(kParseErrorValueInvalid, "truE", 3);
+ TEST_ERROR(kParseErrorValueInvalid, "falsE", 4);
+ TEST_ERROR(kParseErrorValueInvalid, "a]", 0);
+ TEST_ERROR(kParseErrorValueInvalid, ".1", 0);
+}
+
+TEST(Reader, ParseObject_Error) {
+ // Missing a name for object member.
+ TEST_ERROR(kParseErrorObjectMissName, "{1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{null:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{true:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{false:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{1:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{[]:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{{}:1}", 1);
+ TEST_ERROR(kParseErrorObjectMissName, "{xyz:1}", 1);
+
+ // Missing a colon after a name of object member.
+ TEST_ERROR(kParseErrorObjectMissColon, "{\"a\" 1}", 5);
+ TEST_ERROR(kParseErrorObjectMissColon, "{\"a\",1}", 4);
+
+ // Must be a comma or '}' after an object member
+ TEST_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, "{\"a\":1]", 6);
+
+ // This tests that MemoryStream is checking the length in Peek().
+ {
+ MemoryStream ms("{\"a\"", 1);
+ BaseReaderHandler<> h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseStopWhenDoneFlag>(ms, h));
+ EXPECT_EQ(kParseErrorObjectMissName, reader.GetParseErrorCode());
+ }
+}
+
+#undef TEST_ERROR
+
+TEST(Reader, SkipWhitespace) {
+ StringStream ss(" A \t\tB\n \n\nC\r\r \rD \t\n\r E");
+ const char* expected = "ABCDE";
+ for (size_t i = 0; i < 5; i++) {
+ SkipWhitespace(ss);
+ EXPECT_EQ(expected[i], ss.Take());
+ }
+}
+
+// Test implementing a stream without copy stream optimization.
+// Clone from GenericStringStream except that copy constructor is disabled.
+template <typename Encoding>
+class CustomStringStream {
+public:
+ typedef typename Encoding::Ch Ch;
+
+ CustomStringStream(const Ch *src) : src_(src), head_(src) {}
+
+ Ch Peek() const { return *src_; }
+ Ch Take() { return *src_++; }
+ size_t Tell() const { return static_cast<size_t>(src_ - head_); }
+
+ Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
+ void Put(Ch) { RAPIDJSON_ASSERT(false); }
+ void Flush() { RAPIDJSON_ASSERT(false); }
+ size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
+
+private:
+ // Prohibit copy constructor & assignment operator.
+ CustomStringStream(const CustomStringStream&);
+ CustomStringStream& operator=(const CustomStringStream&);
+
+ const Ch* src_; //!< Current read position.
+ const Ch* head_; //!< Original head of the string.
+};
+
+// If the following code is compiled, it should generate compilation error as predicted.
+// Because CustomStringStream<> is not copyable via making copy constructor private.
+#if 0
+namespace rapidjson {
+
+template <typename Encoding>
+struct StreamTraits<CustomStringStream<Encoding> > {
+ enum { copyOptimization = 1 };
+};
+
+} // namespace rapidjson
+#endif
+
+TEST(Reader, CustomStringStream) {
+ const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ";
+ CustomStringStream<UTF8<char> > s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ reader.Parse(s, h);
+ EXPECT_EQ(20u, h.step_);
+}
+
+#include <sstream>
+
+class IStreamWrapper {
+public:
+ typedef char Ch;
+
+ IStreamWrapper(std::istream& is) : is_(is) {}
+
+ Ch Peek() const {
+ int c = is_.peek();
+ return c == std::char_traits<char>::eof() ? '\0' : static_cast<Ch>(c);
+ }
+
+ Ch Take() {
+ int c = is_.get();
+ return c == std::char_traits<char>::eof() ? '\0' : static_cast<Ch>(c);
+ }
+
+ size_t Tell() const { return static_cast<size_t>(is_.tellg()); }
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch) { assert(false); }
+ void Flush() { assert(false); }
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ IStreamWrapper(const IStreamWrapper&);
+ IStreamWrapper& operator=(const IStreamWrapper&);
+
+ std::istream& is_;
+};
+
+TEST(Reader, Parse_IStreamWrapper_StringStream) {
+ const char* json = "[1,2,3,4]";
+
+ std::stringstream ss(json);
+ IStreamWrapper is(ss);
+
+ Reader reader;
+ ParseArrayHandler<4> h;
+ reader.Parse(is, h);
+ EXPECT_FALSE(reader.HasParseError());
+}
+
+// Test iterative parsing.
+
+#define TESTERRORHANDLING(text, errorCode, offset)\
+{\
+ int streamPos = offset; \
+ StringStream json(text); \
+ BaseReaderHandler<> handler; \
+ Reader reader; \
+ reader.Parse<kParseIterativeFlag>(json, handler); \
+ EXPECT_TRUE(reader.HasParseError()); \
+ EXPECT_EQ(errorCode, reader.GetParseErrorCode()); \
+ EXPECT_EQ(offset, reader.GetErrorOffset()); \
+ EXPECT_EQ(streamPos, json.Tell()); \
+}
+
+TEST(Reader, IterativeParsing_ErrorHandling) {
+ TESTERRORHANDLING("{\"a\": a}", kParseErrorValueInvalid, 6u);
+
+ TESTERRORHANDLING("", kParseErrorDocumentEmpty, 0u);
+ TESTERRORHANDLING("{}{}", kParseErrorDocumentRootNotSingular, 2u);
+
+ TESTERRORHANDLING("{1}", kParseErrorObjectMissName, 1u);
+ TESTERRORHANDLING("{\"a\", 1}", kParseErrorObjectMissColon, 4u);
+ TESTERRORHANDLING("{\"a\"}", kParseErrorObjectMissColon, 4u);
+ TESTERRORHANDLING("{\"a\": 1", kParseErrorObjectMissCommaOrCurlyBracket, 7u);
+ TESTERRORHANDLING("[1 2 3]", kParseErrorArrayMissCommaOrSquareBracket, 3u);
+ TESTERRORHANDLING("{\"a: 1", kParseErrorStringMissQuotationMark, 6u);
+
+ // Any JSON value can be a valid root element in RFC7159.
+ TESTERRORHANDLING("\"ab", kParseErrorStringMissQuotationMark, 3u);
+ TESTERRORHANDLING("truE", kParseErrorValueInvalid, 3u);
+ TESTERRORHANDLING("False", kParseErrorValueInvalid, 0u);
+ TESTERRORHANDLING("true, false", kParseErrorDocumentRootNotSingular, 4u);
+ TESTERRORHANDLING("false, false", kParseErrorDocumentRootNotSingular, 5u);
+ TESTERRORHANDLING("nulL", kParseErrorValueInvalid, 3u);
+ TESTERRORHANDLING("null , null", kParseErrorDocumentRootNotSingular, 5u);
+ TESTERRORHANDLING("1a", kParseErrorDocumentRootNotSingular, 1u);
+}
+
+template<typename Encoding = UTF8<> >
+struct IterativeParsingReaderHandler {
+ typedef typename Encoding::Ch Ch;
+
+ const static int LOG_NULL = -1;
+ const static int LOG_BOOL = -2;
+ const static int LOG_INT = -3;
+ const static int LOG_UINT = -4;
+ const static int LOG_INT64 = -5;
+ const static int LOG_UINT64 = -6;
+ const static int LOG_DOUBLE = -7;
+ const static int LOG_STRING = -8;
+ const static int LOG_STARTOBJECT = -9;
+ const static int LOG_KEY = -10;
+ const static int LOG_ENDOBJECT = -11;
+ const static int LOG_STARTARRAY = -12;
+ const static int LOG_ENDARRAY = -13;
+
+ const static size_t LogCapacity = 256;
+ int Logs[LogCapacity];
+ size_t LogCount;
+
+ IterativeParsingReaderHandler() : LogCount(0) {
+ }
+
+ bool Null() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_NULL; return true; }
+
+ bool Bool(bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_BOOL; return true; }
+
+ bool Int(int) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT; return true; }
+
+ bool Uint(unsigned) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT; return true; }
+
+ bool Int64(int64_t) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT64; return true; }
+
+ bool Uint64(uint64_t) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_UINT64; return true; }
+
+ bool Double(double) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_DOUBLE; return true; }
+
+ bool String(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; }
+
+ bool StartObject() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTOBJECT; return true; }
+
+ bool Key (const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_KEY; return true; }
+
+ bool EndObject(SizeType c) {
+ RAPIDJSON_ASSERT(LogCount < LogCapacity);
+ Logs[LogCount++] = LOG_ENDOBJECT;
+ Logs[LogCount++] = static_cast<int>(c);
+ return true;
+ }
+
+ bool StartArray() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTARRAY; return true; }
+
+ bool EndArray(SizeType c) {
+ RAPIDJSON_ASSERT(LogCount < LogCapacity);
+ Logs[LogCount++] = LOG_ENDARRAY;
+ Logs[LogCount++] = static_cast<int>(c);
+ return true;
+ }
+};
+
+TEST(Reader, IterativeParsing_General) {
+ {
+ StringStream is("[1, {\"k\": [1, 2]}, null, false, true, \"string\", 1.2]");
+ Reader reader;
+ IterativeParsingReaderHandler<> handler;
+
+ ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
+
+ EXPECT_FALSE(r.IsError());
+ EXPECT_FALSE(reader.HasParseError());
+
+ int e[] = {
+ handler.LOG_STARTARRAY,
+ handler.LOG_INT,
+ handler.LOG_STARTOBJECT,
+ handler.LOG_KEY,
+ handler.LOG_STARTARRAY,
+ handler.LOG_INT,
+ handler.LOG_INT,
+ handler.LOG_ENDARRAY, 2,
+ handler.LOG_ENDOBJECT, 1,
+ handler.LOG_NULL,
+ handler.LOG_BOOL,
+ handler.LOG_BOOL,
+ handler.LOG_STRING,
+ handler.LOG_DOUBLE,
+ handler.LOG_ENDARRAY, 7
+ };
+
+ EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount);
+
+ for (size_t i = 0; i < handler.LogCount; ++i) {
+ EXPECT_EQ(e[i], handler.Logs[i]) << "i = " << i;
+ }
+ }
+}
+
+TEST(Reader, IterativeParsing_Count) {
+ {
+ StringStream is("[{}, {\"k\": 1}, [1], []]");
+ Reader reader;
+ IterativeParsingReaderHandler<> handler;
+
+ ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
+
+ EXPECT_FALSE(r.IsError());
+ EXPECT_FALSE(reader.HasParseError());
+
+ int e[] = {
+ handler.LOG_STARTARRAY,
+ handler.LOG_STARTOBJECT,
+ handler.LOG_ENDOBJECT, 0,
+ handler.LOG_STARTOBJECT,
+ handler.LOG_KEY,
+ handler.LOG_INT,
+ handler.LOG_ENDOBJECT, 1,
+ handler.LOG_STARTARRAY,
+ handler.LOG_INT,
+ handler.LOG_ENDARRAY, 1,
+ handler.LOG_STARTARRAY,
+ handler.LOG_ENDARRAY, 0,
+ handler.LOG_ENDARRAY, 4
+ };
+
+ EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount);
+
+ for (size_t i = 0; i < handler.LogCount; ++i) {
+ EXPECT_EQ(e[i], handler.Logs[i]) << "i = " << i;
+ }
+ }
+}
+
+// Test iterative parsing on kParseErrorTermination.
+struct HandlerTerminateAtStartObject : public IterativeParsingReaderHandler<> {
+ bool StartObject() { return false; }
+};
+
+struct HandlerTerminateAtStartArray : public IterativeParsingReaderHandler<> {
+ bool StartArray() { return false; }
+};
+
+struct HandlerTerminateAtEndObject : public IterativeParsingReaderHandler<> {
+ bool EndObject(SizeType) { return false; }
+};
+
+struct HandlerTerminateAtEndArray : public IterativeParsingReaderHandler<> {
+ bool EndArray(SizeType) { return false; }
+};
+
+TEST(Reader, IterativeParsing_ShortCircuit) {
+ {
+ HandlerTerminateAtStartObject handler;
+ Reader reader;
+ StringStream is("[1, {}]");
+
+ ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
+
+ EXPECT_TRUE(reader.HasParseError());
+ EXPECT_EQ(kParseErrorTermination, r.Code());
+ EXPECT_EQ(4u, r.Offset());
+ }
+
+ {
+ HandlerTerminateAtStartArray handler;
+ Reader reader;
+ StringStream is("{\"a\": []}");
+
+ ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
+
+ EXPECT_TRUE(reader.HasParseError());
+ EXPECT_EQ(kParseErrorTermination, r.Code());
+ EXPECT_EQ(6u, r.Offset());
+ }
+
+ {
+ HandlerTerminateAtEndObject handler;
+ Reader reader;
+ StringStream is("[1, {}]");
+
+ ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
+
+ EXPECT_TRUE(reader.HasParseError());
+ EXPECT_EQ(kParseErrorTermination, r.Code());
+ EXPECT_EQ(5u, r.Offset());
+ }
+
+ {
+ HandlerTerminateAtEndArray handler;
+ Reader reader;
+ StringStream is("{\"a\": []}");
+
+ ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
+
+ EXPECT_TRUE(reader.HasParseError());
+ EXPECT_EQ(kParseErrorTermination, r.Code());
+ EXPECT_EQ(7u, r.Offset());
+ }
+}
+
+// For covering BaseReaderHandler default functions
+TEST(Reader, BaseReaderHandler_Default) {
+ BaseReaderHandler<> h;
+ Reader reader;
+ StringStream is("[null, true, -1, 1, -1234567890123456789, 1234567890123456789, 3.14, \"s\", { \"a\" : 1 }]");
+ EXPECT_TRUE(reader.Parse(is, h));
+}
+
+template <int e>
+struct TerminateHandler {
+ bool Null() { return e != 0; }
+ bool Bool(bool) { return e != 1; }
+ bool Int(int) { return e != 2; }
+ bool Uint(unsigned) { return e != 3; }
+ bool Int64(int64_t) { return e != 4; }
+ bool Uint64(uint64_t) { return e != 5; }
+ bool Double(double) { return e != 6; }
+ bool String(const char*, SizeType, bool) { return e != 7; }
+ bool StartObject() { return e != 8; }
+ bool Key(const char*, SizeType, bool) { return e != 9; }
+ bool EndObject(SizeType) { return e != 10; }
+ bool StartArray() { return e != 11; }
+ bool EndArray(SizeType) { return e != 12; }
+};
+
+#define TEST_TERMINATION(e, json)\
+{\
+ Reader reader;\
+ TerminateHandler<e> h;\
+ StringStream is(json);\
+ EXPECT_FALSE(reader.Parse(is, h));\
+ EXPECT_EQ(kParseErrorTermination, reader.GetParseErrorCode());\
+}
+
+TEST(Reader, ParseTerminationByHandler) {
+ TEST_TERMINATION(0, "[null");
+ TEST_TERMINATION(1, "[true");
+ TEST_TERMINATION(1, "[false");
+ TEST_TERMINATION(2, "[-1");
+ TEST_TERMINATION(3, "[1");
+ TEST_TERMINATION(4, "[-1234567890123456789");
+ TEST_TERMINATION(5, "[1234567890123456789");
+ TEST_TERMINATION(6, "[0.5]");
+ TEST_TERMINATION(7, "[\"a\"");
+ TEST_TERMINATION(8, "[{");
+ TEST_TERMINATION(9, "[{\"a\"");
+ TEST_TERMINATION(10, "[{}");
+ TEST_TERMINATION(10, "[{\"a\":1}"); // non-empty object
+ TEST_TERMINATION(11, "{\"a\":[");
+ TEST_TERMINATION(12, "{\"a\":[]");
+ TEST_TERMINATION(12, "{\"a\":[1]"); // non-empty array
+}
+
+TEST(Reader, ParseComments) {
+ const char* json =
+ "// Here is a one-line comment.\n"
+ "{// And here's another one\n"
+ " /*And here's an in-line one.*/\"hello\" : \"world\","
+ " \"t\" :/* And one with '*' symbol*/true ,"
+ "/* A multiline comment\n"
+ " goes here*/"
+ " \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3]"
+ "}/*And the last one to be sure */";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(20u, h.step_);
+}
+
+TEST(Reader, ParseEmptyInlineComment) {
+ const char* json = "{/**/\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(20u, h.step_);
+}
+
+TEST(Reader, ParseEmptyOnelineComment) {
+ const char* json = "{//\n\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(20u, h.step_);
+}
+
+TEST(Reader, ParseMultipleCommentsInARow) {
+ const char* json =
+ "{/* first comment *//* second */\n"
+ "/* third */ /*fourth*/// last one\n"
+ "\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(20u, h.step_);
+}
+
+TEST(Reader, InlineCommentsAreDisabledByDefault) {
+ {
+ const char* json = "{/* Inline comment. */\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseDefaultFlags>(s, h));
+ }
+
+ {
+ const char* json =
+ "{\"hello\" : /* Multiline comment starts here\n"
+ " continues here\n"
+ " and ends here */\"world\", \"t\" :true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseDefaultFlags>(s, h));
+ }
+}
+
+TEST(Reader, OnelineCommentsAreDisabledByDefault) {
+ const char* json = "{// One-line comment\n\"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseDefaultFlags>(s, h));
+}
+
+TEST(Reader, EofAfterOneLineComment) {
+ const char* json = "{\"hello\" : \"world\" // EOF is here -->\0 \n}";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(kParseErrorObjectMissCommaOrCurlyBracket, reader.GetParseErrorCode());
+}
+
+TEST(Reader, IncompleteMultilineComment) {
+ const char* json = "{\"hello\" : \"world\" /* EOF is here -->\0 */}";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(kParseErrorUnspecificSyntaxError, reader.GetParseErrorCode());
+}
+
+TEST(Reader, IncompleteMultilineComment2) {
+ const char* json = "{\"hello\" : \"world\" /* *\0 */}";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(kParseErrorUnspecificSyntaxError, reader.GetParseErrorCode());
+}
+
+TEST(Reader, UnrecognizedComment) {
+ const char* json = "{\"hello\" : \"world\" /! }";
+
+ StringStream s(json);
+ ParseObjectHandler h;
+ Reader reader;
+ EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
+ EXPECT_EQ(kParseErrorUnspecificSyntaxError, reader.GetParseErrorCode());
+}
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/regextest.cpp b/3rdparty/rapidjson/test/unittest/regextest.cpp
new file mode 100644
index 00000000000..e3371d168ca
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/regextest.cpp
@@ -0,0 +1,576 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/internal/regex.h"
+
+using namespace rapidjson::internal;
+
+TEST(Regex, Concatenation) {
+ Regex re("abc");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abc"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("a"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("abcd"));
+}
+
+TEST(Regex, Alternation1) {
+ Regex re("abab|abbb");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abab"));
+ EXPECT_TRUE(re.Match("abbb"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("ababa"));
+ EXPECT_FALSE(re.Match("abb"));
+ EXPECT_FALSE(re.Match("abbbb"));
+}
+
+TEST(Regex, Alternation2) {
+ Regex re("a|b|c");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("c"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("aa"));
+ EXPECT_FALSE(re.Match("ab"));
+}
+
+TEST(Regex, Parenthesis1) {
+ Regex re("(ab)c");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abc"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("a"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("abcd"));
+}
+
+TEST(Regex, Parenthesis2) {
+ Regex re("a(bc)");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abc"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("a"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("abcd"));
+}
+
+TEST(Regex, Parenthesis3) {
+ Regex re("(a|b)(c|d)");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ac"));
+ EXPECT_TRUE(re.Match("ad"));
+ EXPECT_TRUE(re.Match("bc"));
+ EXPECT_TRUE(re.Match("bd"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("cd"));
+}
+
+TEST(Regex, ZeroOrOne1) {
+ Regex re("a?");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match(""));
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, ZeroOrOne2) {
+ Regex re("a?b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("a"));
+ EXPECT_FALSE(re.Match("aa"));
+ EXPECT_FALSE(re.Match("bb"));
+ EXPECT_FALSE(re.Match("ba"));
+}
+
+TEST(Regex, ZeroOrOne3) {
+ Regex re("ab?");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("aa"));
+ EXPECT_FALSE(re.Match("bb"));
+ EXPECT_FALSE(re.Match("ba"));
+}
+
+TEST(Regex, ZeroOrOne4) {
+ Regex re("a?b?");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match(""));
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_FALSE(re.Match("aa"));
+ EXPECT_FALSE(re.Match("bb"));
+ EXPECT_FALSE(re.Match("ba"));
+ EXPECT_FALSE(re.Match("abc"));
+}
+
+TEST(Regex, ZeroOrOne5) {
+ Regex re("a(ab)?b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_TRUE(re.Match("aabb"));
+ EXPECT_FALSE(re.Match("aab"));
+ EXPECT_FALSE(re.Match("abb"));
+}
+
+TEST(Regex, ZeroOrMore1) {
+ Regex re("a*");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match(""));
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("aa"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("ab"));
+}
+
+TEST(Regex, ZeroOrMore2) {
+ Regex re("a*b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_TRUE(re.Match("aab"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("bb"));
+}
+
+TEST(Regex, ZeroOrMore3) {
+ Regex re("a*b*");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match(""));
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("aa"));
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("bb"));
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_TRUE(re.Match("aabb"));
+ EXPECT_FALSE(re.Match("ba"));
+}
+
+TEST(Regex, ZeroOrMore4) {
+ Regex re("a(ab)*b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_TRUE(re.Match("aabb"));
+ EXPECT_TRUE(re.Match("aababb"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, OneOrMore1) {
+ Regex re("a+");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("aa"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("ab"));
+}
+
+TEST(Regex, OneOrMore2) {
+ Regex re("a+b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_TRUE(re.Match("aab"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("b"));
+}
+
+TEST(Regex, OneOrMore3) {
+ Regex re("a+b+");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ab"));
+ EXPECT_TRUE(re.Match("aab"));
+ EXPECT_TRUE(re.Match("abb"));
+ EXPECT_TRUE(re.Match("aabb"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("ba"));
+}
+
+TEST(Regex, OneOrMore4) {
+ Regex re("a(ab)+b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("aabb"));
+ EXPECT_TRUE(re.Match("aababb"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("ab"));
+}
+
+TEST(Regex, QuantifierExact1) {
+ Regex re("ab{3}c");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abbbc"));
+ EXPECT_FALSE(re.Match("ac"));
+ EXPECT_FALSE(re.Match("abc"));
+ EXPECT_FALSE(re.Match("abbc"));
+ EXPECT_FALSE(re.Match("abbbbc"));
+}
+
+TEST(Regex, QuantifierExact2) {
+ Regex re("a(bc){3}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abcbcbcd"));
+ EXPECT_FALSE(re.Match("ad"));
+ EXPECT_FALSE(re.Match("abcd"));
+ EXPECT_FALSE(re.Match("abcbcd"));
+ EXPECT_FALSE(re.Match("abcbcbcbcd"));
+}
+
+TEST(Regex, QuantifierExact3) {
+ Regex re("a(b|c){3}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abbbd"));
+ EXPECT_TRUE(re.Match("acccd"));
+ EXPECT_TRUE(re.Match("abcbd"));
+ EXPECT_FALSE(re.Match("ad"));
+ EXPECT_FALSE(re.Match("abbd"));
+ EXPECT_FALSE(re.Match("accccd"));
+ EXPECT_FALSE(re.Match("abbbbd"));
+}
+
+TEST(Regex, QuantifierMin1) {
+ Regex re("ab{3,}c");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abbbc"));
+ EXPECT_TRUE(re.Match("abbbbc"));
+ EXPECT_TRUE(re.Match("abbbbbc"));
+ EXPECT_FALSE(re.Match("ac"));
+ EXPECT_FALSE(re.Match("abc"));
+ EXPECT_FALSE(re.Match("abbc"));
+}
+
+TEST(Regex, QuantifierMin2) {
+ Regex re("a(bc){3,}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abcbcbcd"));
+ EXPECT_TRUE(re.Match("abcbcbcbcd"));
+ EXPECT_FALSE(re.Match("ad"));
+ EXPECT_FALSE(re.Match("abcd"));
+ EXPECT_FALSE(re.Match("abcbcd"));
+}
+
+TEST(Regex, QuantifierMin3) {
+ Regex re("a(b|c){3,}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abbbd"));
+ EXPECT_TRUE(re.Match("acccd"));
+ EXPECT_TRUE(re.Match("abcbd"));
+ EXPECT_TRUE(re.Match("accccd"));
+ EXPECT_TRUE(re.Match("abbbbd"));
+ EXPECT_FALSE(re.Match("ad"));
+ EXPECT_FALSE(re.Match("abbd"));
+}
+
+TEST(Regex, QuantifierMinMax1) {
+ Regex re("ab{3,5}c");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abbbc"));
+ EXPECT_TRUE(re.Match("abbbbc"));
+ EXPECT_TRUE(re.Match("abbbbbc"));
+ EXPECT_FALSE(re.Match("ac"));
+ EXPECT_FALSE(re.Match("abc"));
+ EXPECT_FALSE(re.Match("abbc"));
+ EXPECT_FALSE(re.Match("abbbbbbc"));
+}
+
+TEST(Regex, QuantifierMinMax2) {
+ Regex re("a(bc){3,5}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abcbcbcd"));
+ EXPECT_TRUE(re.Match("abcbcbcbcd"));
+ EXPECT_TRUE(re.Match("abcbcbcbcbcd"));
+ EXPECT_FALSE(re.Match("ad"));
+ EXPECT_FALSE(re.Match("abcd"));
+ EXPECT_FALSE(re.Match("abcbcd"));
+ EXPECT_FALSE(re.Match("abcbcbcbcbcbcd"));
+}
+
+TEST(Regex, QuantifierMinMax3) {
+ Regex re("a(b|c){3,5}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("abbbd"));
+ EXPECT_TRUE(re.Match("acccd"));
+ EXPECT_TRUE(re.Match("abcbd"));
+ EXPECT_TRUE(re.Match("accccd"));
+ EXPECT_TRUE(re.Match("abbbbd"));
+ EXPECT_TRUE(re.Match("acccccd"));
+ EXPECT_TRUE(re.Match("abbbbbd"));
+ EXPECT_FALSE(re.Match("ad"));
+ EXPECT_FALSE(re.Match("abbd"));
+ EXPECT_FALSE(re.Match("accccccd"));
+ EXPECT_FALSE(re.Match("abbbbbbd"));
+}
+
+// Issue538
+TEST(Regex, QuantifierMinMax4) {
+ Regex re("a(b|c){0,3}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ad"));
+ EXPECT_TRUE(re.Match("abd"));
+ EXPECT_TRUE(re.Match("acd"));
+ EXPECT_TRUE(re.Match("abbd"));
+ EXPECT_TRUE(re.Match("accd"));
+ EXPECT_TRUE(re.Match("abcd"));
+ EXPECT_TRUE(re.Match("abbbd"));
+ EXPECT_TRUE(re.Match("acccd"));
+ EXPECT_FALSE(re.Match("abbbbd"));
+ EXPECT_FALSE(re.Match("add"));
+ EXPECT_FALSE(re.Match("accccd"));
+ EXPECT_FALSE(re.Match("abcbcd"));
+}
+
+// Issue538
+TEST(Regex, QuantifierMinMax5) {
+ Regex re("a(b|c){0,}d");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("ad"));
+ EXPECT_TRUE(re.Match("abd"));
+ EXPECT_TRUE(re.Match("acd"));
+ EXPECT_TRUE(re.Match("abbd"));
+ EXPECT_TRUE(re.Match("accd"));
+ EXPECT_TRUE(re.Match("abcd"));
+ EXPECT_TRUE(re.Match("abbbd"));
+ EXPECT_TRUE(re.Match("acccd"));
+ EXPECT_TRUE(re.Match("abbbbd"));
+ EXPECT_TRUE(re.Match("accccd"));
+ EXPECT_TRUE(re.Match("abcbcd"));
+ EXPECT_FALSE(re.Match("add"));
+ EXPECT_FALSE(re.Match("aad"));
+}
+
+#define EURO "\xE2\x82\xAC" // "\xE2\x82\xAC" is UTF-8 sequence of Euro sign U+20AC
+
+TEST(Regex, Unicode) {
+ Regex re("a" EURO "+b");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a" EURO "b"));
+ EXPECT_TRUE(re.Match("a" EURO EURO "b"));
+ EXPECT_FALSE(re.Match("a?b"));
+ EXPECT_FALSE(re.Match("a" EURO "\xAC" "b")); // unaware of UTF-8 will match
+}
+
+TEST(Regex, AnyCharacter) {
+ Regex re(".");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match(EURO));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, CharacterRange1) {
+ Regex re("[abc]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("c"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("`"));
+ EXPECT_FALSE(re.Match("d"));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, CharacterRange2) {
+ Regex re("[^abc]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("`"));
+ EXPECT_TRUE(re.Match("d"));
+ EXPECT_FALSE(re.Match("a"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("c"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, CharacterRange3) {
+ Regex re("[a-c]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("b"));
+ EXPECT_TRUE(re.Match("c"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("`"));
+ EXPECT_FALSE(re.Match("d"));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, CharacterRange4) {
+ Regex re("[^a-c]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("`"));
+ EXPECT_TRUE(re.Match("d"));
+ EXPECT_FALSE(re.Match("a"));
+ EXPECT_FALSE(re.Match("b"));
+ EXPECT_FALSE(re.Match("c"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("aa"));
+}
+
+TEST(Regex, CharacterRange5) {
+ Regex re("[-]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("-"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("a"));
+}
+
+TEST(Regex, CharacterRange6) {
+ Regex re("[a-]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("-"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("`"));
+ EXPECT_FALSE(re.Match("b"));
+}
+
+TEST(Regex, CharacterRange7) {
+ Regex re("[-a]");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("a"));
+ EXPECT_TRUE(re.Match("-"));
+ EXPECT_FALSE(re.Match(""));
+ EXPECT_FALSE(re.Match("`"));
+ EXPECT_FALSE(re.Match("b"));
+}
+
+TEST(Regex, CharacterRange8) {
+ Regex re("[a-zA-Z0-9]*");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("Milo"));
+ EXPECT_TRUE(re.Match("MT19937"));
+ EXPECT_TRUE(re.Match("43"));
+ EXPECT_FALSE(re.Match("a_b"));
+ EXPECT_FALSE(re.Match("!"));
+}
+
+TEST(Regex, Search) {
+ Regex re("abc");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Search("abc"));
+ EXPECT_TRUE(re.Search("_abc"));
+ EXPECT_TRUE(re.Search("abc_"));
+ EXPECT_TRUE(re.Search("_abc_"));
+ EXPECT_TRUE(re.Search("__abc__"));
+ EXPECT_TRUE(re.Search("abcabc"));
+ EXPECT_FALSE(re.Search("a"));
+ EXPECT_FALSE(re.Search("ab"));
+ EXPECT_FALSE(re.Search("bc"));
+ EXPECT_FALSE(re.Search("cba"));
+}
+
+TEST(Regex, Search_BeginAnchor) {
+ Regex re("^abc");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Search("abc"));
+ EXPECT_TRUE(re.Search("abc_"));
+ EXPECT_TRUE(re.Search("abcabc"));
+ EXPECT_FALSE(re.Search("_abc"));
+ EXPECT_FALSE(re.Search("_abc_"));
+ EXPECT_FALSE(re.Search("a"));
+ EXPECT_FALSE(re.Search("ab"));
+ EXPECT_FALSE(re.Search("bc"));
+ EXPECT_FALSE(re.Search("cba"));
+}
+
+TEST(Regex, Search_EndAnchor) {
+ Regex re("abc$");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Search("abc"));
+ EXPECT_TRUE(re.Search("_abc"));
+ EXPECT_TRUE(re.Search("abcabc"));
+ EXPECT_FALSE(re.Search("abc_"));
+ EXPECT_FALSE(re.Search("_abc_"));
+ EXPECT_FALSE(re.Search("a"));
+ EXPECT_FALSE(re.Search("ab"));
+ EXPECT_FALSE(re.Search("bc"));
+ EXPECT_FALSE(re.Search("cba"));
+}
+
+TEST(Regex, Search_BothAnchor) {
+ Regex re("^abc$");
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Search("abc"));
+ EXPECT_FALSE(re.Search(""));
+ EXPECT_FALSE(re.Search("a"));
+ EXPECT_FALSE(re.Search("b"));
+ EXPECT_FALSE(re.Search("ab"));
+ EXPECT_FALSE(re.Search("abcd"));
+}
+
+TEST(Regex, Escape) {
+ const char* s = "\\^\\$\\|\\(\\)\\?\\*\\+\\.\\[\\]\\{\\}\\\\\\f\\n\\r\\t\\v[\\b][\\[][\\]]";
+ Regex re(s);
+ ASSERT_TRUE(re.IsValid());
+ EXPECT_TRUE(re.Match("^$|()?*+.[]{}\\\x0C\n\r\t\x0B\b[]"));
+ EXPECT_FALSE(re.Match(s)); // Not escaping
+}
+
+TEST(Regex, Invalid) {
+#define TEST_INVALID(s) \
+ {\
+ Regex re(s);\
+ EXPECT_FALSE(re.IsValid());\
+ }
+
+ TEST_INVALID("");
+ TEST_INVALID("a|");
+ TEST_INVALID("()");
+ TEST_INVALID(")");
+ TEST_INVALID("(a))");
+ TEST_INVALID("(a|)");
+ TEST_INVALID("(a||b)");
+ TEST_INVALID("(|b)");
+ TEST_INVALID("?");
+ TEST_INVALID("*");
+ TEST_INVALID("+");
+ TEST_INVALID("{");
+ TEST_INVALID("{}");
+ TEST_INVALID("a{a}");
+ TEST_INVALID("a{0}");
+ TEST_INVALID("a{-1}");
+ TEST_INVALID("a{}");
+ // TEST_INVALID("a{0,}"); // Support now
+ TEST_INVALID("a{,0}");
+ TEST_INVALID("a{1,0}");
+ TEST_INVALID("a{-1,0}");
+ TEST_INVALID("a{-1,1}");
+ TEST_INVALID("[]");
+ TEST_INVALID("[^]");
+ TEST_INVALID("[\\a]");
+ TEST_INVALID("\\a");
+
+#undef TEST_INVALID
+}
+
+TEST(Regex, Issue538) {
+ Regex re("^[0-9]+(\\\\.[0-9]+){0,2}");
+ EXPECT_TRUE(re.IsValid());
+}
+
+#undef EURO
diff --git a/3rdparty/rapidjson/test/unittest/schematest.cpp b/3rdparty/rapidjson/test/unittest/schematest.cpp
new file mode 100644
index 00000000000..623c65ac61e
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/schematest.cpp
@@ -0,0 +1,1157 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/schema.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/writer.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(variadic-macros)
+#endif
+
+using namespace rapidjson;
+
+#define TEST_HASHER(json1, json2, expected) \
+{\
+ Document d1, d2;\
+ d1.Parse(json1);\
+ ASSERT_FALSE(d1.HasParseError());\
+ d2.Parse(json2);\
+ ASSERT_FALSE(d2.HasParseError());\
+ internal::Hasher<Value, CrtAllocator> h1, h2;\
+ d1.Accept(h1);\
+ d2.Accept(h2);\
+ ASSERT_TRUE(h1.IsValid());\
+ ASSERT_TRUE(h2.IsValid());\
+ /*printf("%s: 0x%016llx\n%s: 0x%016llx\n\n", json1, h1.GetHashCode(), json2, h2.GetHashCode());*/\
+ EXPECT_TRUE(expected == (h1.GetHashCode() == h2.GetHashCode()));\
+}
+
+TEST(SchemaValidator, Hasher) {
+ TEST_HASHER("null", "null", true);
+
+ TEST_HASHER("true", "true", true);
+ TEST_HASHER("false", "false", true);
+ TEST_HASHER("true", "false", false);
+ TEST_HASHER("false", "true", false);
+ TEST_HASHER("true", "null", false);
+ TEST_HASHER("false", "null", false);
+
+ TEST_HASHER("1", "1", true);
+ TEST_HASHER("1.5", "1.5", true);
+ TEST_HASHER("1", "1.0", true);
+ TEST_HASHER("1", "-1", false);
+ TEST_HASHER("0.0", "-0.0", false);
+ TEST_HASHER("1", "true", false);
+ TEST_HASHER("0", "false", false);
+ TEST_HASHER("0", "null", false);
+
+ TEST_HASHER("\"\"", "\"\"", true);
+ TEST_HASHER("\"\"", "\"\\u0000\"", false);
+ TEST_HASHER("\"Hello\"", "\"Hello\"", true);
+ TEST_HASHER("\"Hello\"", "\"World\"", false);
+ TEST_HASHER("\"Hello\"", "null", false);
+ TEST_HASHER("\"Hello\\u0000\"", "\"Hello\"", false);
+ TEST_HASHER("\"\"", "null", false);
+ TEST_HASHER("\"\"", "true", false);
+ TEST_HASHER("\"\"", "false", false);
+
+ TEST_HASHER("[]", "[ ]", true);
+ TEST_HASHER("[1, true, false]", "[1, true, false]", true);
+ TEST_HASHER("[1, true, false]", "[1, true]", false);
+ TEST_HASHER("[1, 2]", "[2, 1]", false);
+ TEST_HASHER("[[1], 2]", "[[1, 2]]", false);
+ TEST_HASHER("[1, 2]", "[1, [2]]", false);
+ TEST_HASHER("[]", "null", false);
+ TEST_HASHER("[]", "true", false);
+ TEST_HASHER("[]", "false", false);
+ TEST_HASHER("[]", "0", false);
+ TEST_HASHER("[]", "0.0", false);
+ TEST_HASHER("[]", "\"\"", false);
+
+ TEST_HASHER("{}", "{ }", true);
+ TEST_HASHER("{\"a\":1}", "{\"a\":1}", true);
+ TEST_HASHER("{\"a\":1}", "{\"b\":1}", false);
+ TEST_HASHER("{\"a\":1}", "{\"a\":2}", false);
+ TEST_HASHER("{\"a\":1, \"b\":2}", "{\"b\":2, \"a\":1}", true); // Member order insensitive
+ TEST_HASHER("{}", "null", false);
+ TEST_HASHER("{}", "false", false);
+ TEST_HASHER("{}", "true", false);
+ TEST_HASHER("{}", "0", false);
+ TEST_HASHER("{}", "0.0", false);
+ TEST_HASHER("{}", "\"\"", false);
+}
+
+// Test cases following http://spacetelescope.github.io/understanding-json-schema
+
+#define VALIDATE(schema, json, expected) \
+{\
+ SchemaValidator validator(schema);\
+ Document d;\
+ /*printf("\n%s\n", json);*/\
+ d.Parse(json);\
+ EXPECT_FALSE(d.HasParseError());\
+ EXPECT_TRUE(expected == d.Accept(validator));\
+ EXPECT_TRUE(expected == validator.IsValid());\
+ if (expected && !validator.IsValid()) {\
+ StringBuffer sb;\
+ validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);\
+ printf("Invalid schema: %s\n", sb.GetString());\
+ printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());\
+ sb.Clear();\
+ validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);\
+ printf("Invalid document: %s\n", sb.GetString());\
+ }\
+}
+
+#define INVALIDATE(schema, json, invalidSchemaPointer, invalidSchemaKeyword, invalidDocumentPointer) \
+{\
+ SchemaValidator validator(schema);\
+ Document d;\
+ /*printf("\n%s\n", json);*/\
+ d.Parse(json);\
+ EXPECT_FALSE(d.HasParseError());\
+ EXPECT_FALSE(d.Accept(validator));\
+ EXPECT_FALSE(validator.IsValid());\
+ if (validator.GetInvalidSchemaPointer() != Pointer(invalidSchemaPointer)) {\
+ StringBuffer sb;\
+ validator.GetInvalidSchemaPointer().Stringify(sb);\
+ printf("GetInvalidSchemaPointer() Expected: %s Actual: %s\n", invalidSchemaPointer, sb.GetString());\
+ ADD_FAILURE();\
+ }\
+ ASSERT_TRUE(validator.GetInvalidSchemaKeyword() != 0);\
+ if (strcmp(validator.GetInvalidSchemaKeyword(), invalidSchemaKeyword) != 0) {\
+ printf("GetInvalidSchemaKeyword() Expected: %s Actual %s\n", invalidSchemaKeyword, validator.GetInvalidSchemaKeyword());\
+ ADD_FAILURE();\
+ }\
+ if (validator.GetInvalidDocumentPointer() != Pointer(invalidDocumentPointer)) {\
+ StringBuffer sb;\
+ validator.GetInvalidDocumentPointer().Stringify(sb);\
+ printf("GetInvalidDocumentPointer() Expected: %s Actual: %s\n", invalidDocumentPointer, sb.GetString());\
+ ADD_FAILURE();\
+ }\
+}
+
+TEST(SchemaValidator, Typeless) {
+ Document sd;
+ sd.Parse("{}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "42", true);
+ VALIDATE(s, "\"I'm a string\"", true);
+ VALIDATE(s, "{ \"an\": [ \"arbitrarily\", \"nested\" ], \"data\": \"structure\" }", true);
+}
+
+TEST(SchemaValidator, MultiType) {
+ Document sd;
+ sd.Parse("{ \"type\": [\"number\", \"string\"] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "42", true);
+ VALIDATE(s, "\"Life, the universe, and everything\"", true);
+ INVALIDATE(s, "[\"Life\", \"the universe\", \"and everything\"]", "", "type", "");
+}
+
+TEST(SchemaValidator, Enum_Typed) {
+ Document sd;
+ sd.Parse("{ \"type\": \"string\", \"enum\" : [\"red\", \"amber\", \"green\"] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"red\"", true);
+ INVALIDATE(s, "\"blue\"", "", "enum", "");
+}
+
+TEST(SchemaValidator, Enum_Typless) {
+ Document sd;
+ sd.Parse("{ \"enum\": [\"red\", \"amber\", \"green\", null, 42] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"red\"", true);
+ VALIDATE(s, "null", true);
+ VALIDATE(s, "42", true);
+ INVALIDATE(s, "0", "", "enum", "");
+}
+
+TEST(SchemaValidator, Enum_InvalidType) {
+ Document sd;
+ sd.Parse("{ \"type\": \"string\", \"enum\": [\"red\", \"amber\", \"green\", null] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"red\"", true);
+ INVALIDATE(s, "null", "", "type", "");
+}
+
+TEST(SchemaValidator, AllOf) {
+ {
+ Document sd;
+ sd.Parse("{\"allOf\": [{ \"type\": \"string\" }, { \"type\": \"string\", \"maxLength\": 5 }]}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"ok\"", true);
+ INVALIDATE(s, "\"too long\"", "", "allOf", "");
+ }
+ {
+ Document sd;
+ sd.Parse("{\"allOf\": [{ \"type\": \"string\" }, { \"type\": \"number\" } ] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"No way\"", false);
+ INVALIDATE(s, "-1", "", "allOf", "");
+ }
+}
+
+TEST(SchemaValidator, AnyOf) {
+ Document sd;
+ sd.Parse("{\"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"number\" } ] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"Yes\"", true);
+ VALIDATE(s, "42", true);
+ INVALIDATE(s, "{ \"Not a\": \"string or number\" }", "", "anyOf", "");
+}
+
+TEST(SchemaValidator, OneOf) {
+ Document sd;
+ sd.Parse("{\"oneOf\": [{ \"type\": \"number\", \"multipleOf\": 5 }, { \"type\": \"number\", \"multipleOf\": 3 } ] }");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "10", true);
+ VALIDATE(s, "9", true);
+ INVALIDATE(s, "2", "", "oneOf", "");
+ INVALIDATE(s, "15", "", "oneOf", "");
+}
+
+TEST(SchemaValidator, Not) {
+ Document sd;
+ sd.Parse("{\"not\":{ \"type\": \"string\"}}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "42", true);
+ VALIDATE(s, "{ \"key\": \"value\" }", true);
+ INVALIDATE(s, "\"I am a string\"", "", "not", "");
+}
+
+TEST(SchemaValidator, Ref) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"$schema\": \"http://json-schema.org/draft-04/schema#\","
+ ""
+ " \"definitions\": {"
+ " \"address\": {"
+ " \"type\": \"object\","
+ " \"properties\": {"
+ " \"street_address\": { \"type\": \"string\" },"
+ " \"city\": { \"type\": \"string\" },"
+ " \"state\": { \"type\": \"string\" }"
+ " },"
+ " \"required\": [\"street_address\", \"city\", \"state\"]"
+ " }"
+ " },"
+ " \"type\": \"object\","
+ " \"properties\": {"
+ " \"billing_address\": { \"$ref\": \"#/definitions/address\" },"
+ " \"shipping_address\": { \"$ref\": \"#/definitions/address\" }"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{\"shipping_address\": {\"street_address\": \"1600 Pennsylvania Avenue NW\", \"city\": \"Washington\", \"state\": \"DC\"}, \"billing_address\": {\"street_address\": \"1st Street SE\", \"city\": \"Washington\", \"state\": \"DC\"} }", true);
+}
+
+TEST(SchemaValidator, Ref_AllOf) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"$schema\": \"http://json-schema.org/draft-04/schema#\","
+ ""
+ " \"definitions\": {"
+ " \"address\": {"
+ " \"type\": \"object\","
+ " \"properties\": {"
+ " \"street_address\": { \"type\": \"string\" },"
+ " \"city\": { \"type\": \"string\" },"
+ " \"state\": { \"type\": \"string\" }"
+ " },"
+ " \"required\": [\"street_address\", \"city\", \"state\"]"
+ " }"
+ " },"
+ " \"type\": \"object\","
+ " \"properties\": {"
+ " \"billing_address\": { \"$ref\": \"#/definitions/address\" },"
+ " \"shipping_address\": {"
+ " \"allOf\": ["
+ " { \"$ref\": \"#/definitions/address\" },"
+ " { \"properties\":"
+ " { \"type\": { \"enum\": [ \"residential\", \"business\" ] } },"
+ " \"required\": [\"type\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "{\"shipping_address\": {\"street_address\": \"1600 Pennsylvania Avenue NW\", \"city\": \"Washington\", \"state\": \"DC\"} }", "/properties/shipping_address", "allOf", "/shipping_address");
+ VALIDATE(s, "{\"shipping_address\": {\"street_address\": \"1600 Pennsylvania Avenue NW\", \"city\": \"Washington\", \"state\": \"DC\", \"type\": \"business\"} }", true);
+}
+
+TEST(SchemaValidator, String) {
+ Document sd;
+ sd.Parse("{\"type\":\"string\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"I'm a string\"", true);
+ INVALIDATE(s, "42", "", "type", "");
+}
+
+TEST(SchemaValidator, String_LengthRange) {
+ Document sd;
+ sd.Parse("{\"type\":\"string\",\"minLength\":2,\"maxLength\":3}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "\"A\"", "", "minLength", "");
+ VALIDATE(s, "\"AB\"", true);
+ VALIDATE(s, "\"ABC\"", true);
+ INVALIDATE(s, "\"ABCD\"", "", "maxLength", "");
+}
+
+#if RAPIDJSON_SCHEMA_HAS_REGEX
+TEST(SchemaValidator, String_Pattern) {
+ Document sd;
+ sd.Parse("{\"type\":\"string\",\"pattern\":\"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"555-1212\"", true);
+ VALIDATE(s, "\"(888)555-1212\"", true);
+ INVALIDATE(s, "\"(888)555-1212 ext. 532\"", "", "pattern", "");
+ INVALIDATE(s, "\"(800)FLOWERS\"", "", "pattern", "");
+}
+#endif
+
+TEST(SchemaValidator, Integer) {
+ Document sd;
+ sd.Parse("{\"type\":\"integer\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "42", true);
+ VALIDATE(s, "-1", true);
+ INVALIDATE(s, "3.1415926", "", "type", "");
+ INVALIDATE(s, "\"42\"", "", "type", "");
+}
+
+TEST(SchemaValidator, Integer_Range) {
+ Document sd;
+ sd.Parse("{\"type\":\"integer\",\"minimum\":0,\"maximum\":100,\"exclusiveMaximum\":true}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "-1", "", "minimum", "");
+ VALIDATE(s, "0", true);
+ VALIDATE(s, "10", true);
+ VALIDATE(s, "99", true);
+ INVALIDATE(s, "100", "", "maximum", "");
+ INVALIDATE(s, "101", "", "maximum", "");
+}
+
+TEST(SchemaValidator, Integer_Range64Boundary) {
+ Document sd;
+ sd.Parse("{\"type\":\"integer\",\"minimum\":-9223372036854775807,\"maximum\":18446744073709551614}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "-9223372036854775808", "", "minimum", "");
+ VALIDATE(s, "-9223372036854775807", true);
+ VALIDATE(s, "18446744073709551614", true);
+ INVALIDATE(s, "18446744073709551615", "", "maximum", "");
+}
+
+TEST(SchemaValidator, Integer_Range64BoundaryExclusive) {
+ Document sd;
+ sd.Parse("{\"type\":\"integer\",\"minimum\":-9223372036854775808,\"maximum\":18446744073709551615,\"exclusiveMinimum\":true,\"exclusiveMaximum\":true}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "-9223372036854775808", "", "minimum", "");
+ VALIDATE(s, "-9223372036854775807", true);
+ VALIDATE(s, "18446744073709551614", true);
+ INVALIDATE(s, "18446744073709551615", "", "maximum", "");
+}
+
+TEST(SchemaValidator, Integer_MultipleOf) {
+ Document sd;
+ sd.Parse("{\"type\":\"integer\",\"multipleOf\":10}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "0", true);
+ VALIDATE(s, "10", true);
+ VALIDATE(s, "-10", true);
+ VALIDATE(s, "20", true);
+ INVALIDATE(s, "23", "", "multipleOf", "");
+ INVALIDATE(s, "-23", "", "multipleOf", "");
+}
+
+TEST(SchemaValidator, Integer_MultipleOf64Boundary) {
+ Document sd;
+ sd.Parse("{\"type\":\"integer\",\"multipleOf\":18446744073709551615}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "0", true);
+ VALIDATE(s, "18446744073709551615", true);
+ INVALIDATE(s, "18446744073709551614", "", "multipleOf", "");
+}
+
+TEST(SchemaValidator, Number_Range) {
+ Document sd;
+ sd.Parse("{\"type\":\"number\",\"minimum\":0,\"maximum\":100,\"exclusiveMaximum\":true}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "-1", "", "minimum", "");
+ VALIDATE(s, "0", true);
+ VALIDATE(s, "10", true);
+ VALIDATE(s, "99", true);
+ INVALIDATE(s, "100", "", "maximum", "");
+ INVALIDATE(s, "101", "", "maximum", "");
+}
+
+TEST(SchemaValidator, Number_MultipleOf) {
+ Document sd;
+ sd.Parse("{\"type\":\"number\",\"multipleOf\":10.0}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "0", true);
+ VALIDATE(s, "10", true);
+ VALIDATE(s, "-10", true);
+ VALIDATE(s, "20", true);
+ INVALIDATE(s, "23", "", "multipleOf", "");
+}
+
+TEST(SchemaValidator, Number_MultipleOfOne) {
+ Document sd;
+ sd.Parse("{\"type\":\"number\",\"multipleOf\":1}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "42", true);
+ VALIDATE(s, "42.0", true);
+ INVALIDATE(s, "3.1415926", "", "multipleOf", "");
+}
+
+TEST(SchemaValidator, Object) {
+ Document sd;
+ sd.Parse("{\"type\":\"object\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{\"key\":\"value\",\"another_key\":\"another_value\"}", true);
+ VALIDATE(s, "{\"Sun\":1.9891e30,\"Jupiter\":1.8986e27,\"Saturn\":5.6846e26,\"Neptune\":10.243e25,\"Uranus\":8.6810e25,\"Earth\":5.9736e24,\"Venus\":4.8685e24,\"Mars\":6.4185e23,\"Mercury\":3.3022e23,\"Moon\":7.349e22,\"Pluto\":1.25e22}", true);
+ INVALIDATE(s, "[\"An\", \"array\", \"not\", \"an\", \"object\"]", "", "type", "");
+ INVALIDATE(s, "\"Not an object\"", "", "type", "");
+}
+
+TEST(SchemaValidator, Object_Properties) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\" : {"
+ " \"number\": { \"type\": \"number\" },"
+ " \"street_name\" : { \"type\": \"string\" },"
+ " \"street_type\" : { \"type\": \"string\", \"enum\" : [\"Street\", \"Avenue\", \"Boulevard\"] }"
+ " }"
+ "}");
+
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", true);
+ INVALIDATE(s, "{ \"number\": \"1600\", \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", "/properties/number", "type", "/number");
+ VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\" }", true);
+ VALIDATE(s, "{}", true);
+ VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"direction\": \"NW\" }", true);
+}
+
+TEST(SchemaValidator, Object_AdditionalPropertiesBoolean) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\" : {"
+ " \"number\": { \"type\": \"number\" },"
+ " \"street_name\" : { \"type\": \"string\" },"
+ " \"street_type\" : { \"type\": \"string\","
+ " \"enum\" : [\"Street\", \"Avenue\", \"Boulevard\"]"
+ " }"
+ " },"
+ " \"additionalProperties\": false"
+ "}");
+
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", true);
+ INVALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"direction\": \"NW\" }", "", "additionalProperties", "/direction");
+}
+
+TEST(SchemaValidator, Object_AdditionalPropertiesObject) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\" : {"
+ " \"number\": { \"type\": \"number\" },"
+ " \"street_name\" : { \"type\": \"string\" },"
+ " \"street_type\" : { \"type\": \"string\","
+ " \"enum\" : [\"Street\", \"Avenue\", \"Boulevard\"]"
+ " }"
+ " },"
+ " \"additionalProperties\": { \"type\": \"string\" }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", true);
+ VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"direction\": \"NW\" }", true);
+ INVALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"office_number\": 201 }", "/additionalProperties", "type", "/office_number");
+}
+
+TEST(SchemaValidator, Object_Required) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\" : {"
+ " \"name\": { \"type\": \"string\" },"
+ " \"email\" : { \"type\": \"string\" },"
+ " \"address\" : { \"type\": \"string\" },"
+ " \"telephone\" : { \"type\": \"string\" }"
+ " },"
+ " \"required\":[\"name\", \"email\"]"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"name\": \"William Shakespeare\", \"email\" : \"bill@stratford-upon-avon.co.uk\" }", true);
+ VALIDATE(s, "{ \"name\": \"William Shakespeare\", \"email\" : \"bill@stratford-upon-avon.co.uk\", \"address\" : \"Henley Street, Stratford-upon-Avon, Warwickshire, England\", \"authorship\" : \"in question\"}", true);
+ INVALIDATE(s, "{ \"name\": \"William Shakespeare\", \"address\" : \"Henley Street, Stratford-upon-Avon, Warwickshire, England\" }", "", "required", "");
+}
+
+
+TEST(SchemaValidator, Object_PropertiesRange) {
+ Document sd;
+ sd.Parse("{\"type\":\"object\", \"minProperties\":2, \"maxProperties\":3}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "{}", "", "minProperties", "");
+ INVALIDATE(s, "{\"a\":0}", "", "minProperties", "");
+ VALIDATE(s, "{\"a\":0,\"b\":1}", true);
+ VALIDATE(s, "{\"a\":0,\"b\":1,\"c\":2}", true);
+ INVALIDATE(s, "{\"a\":0,\"b\":1,\"c\":2,\"d\":3}", "", "maxProperties", "");
+}
+
+TEST(SchemaValidator, Object_PropertyDependencies) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\": {"
+ " \"name\": { \"type\": \"string\" },"
+ " \"credit_card\": { \"type\": \"number\" },"
+ " \"billing_address\": { \"type\": \"string\" }"
+ " },"
+ " \"required\": [\"name\"],"
+ " \"dependencies\": {"
+ " \"credit_card\": [\"billing_address\"]"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"name\": \"John Doe\", \"credit_card\": 5555555555555555, \"billing_address\": \"555 Debtor's Lane\" }", true);
+ INVALIDATE(s, "{ \"name\": \"John Doe\", \"credit_card\": 5555555555555555 }", "", "dependencies", "");
+ VALIDATE(s, "{ \"name\": \"John Doe\"}", true);
+ VALIDATE(s, "{ \"name\": \"John Doe\", \"billing_address\": \"555 Debtor's Lane\" }", true);
+}
+
+TEST(SchemaValidator, Object_SchemaDependencies) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\" : {"
+ " \"name\": { \"type\": \"string\" },"
+ " \"credit_card\" : { \"type\": \"number\" }"
+ " },"
+ " \"required\" : [\"name\"],"
+ " \"dependencies\" : {"
+ " \"credit_card\": {"
+ " \"properties\": {"
+ " \"billing_address\": { \"type\": \"string\" }"
+ " },"
+ " \"required\" : [\"billing_address\"]"
+ " }"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{\"name\": \"John Doe\", \"credit_card\" : 5555555555555555,\"billing_address\" : \"555 Debtor's Lane\"}", true);
+ INVALIDATE(s, "{\"name\": \"John Doe\", \"credit_card\" : 5555555555555555 }", "", "dependencies", "");
+ VALIDATE(s, "{\"name\": \"John Doe\", \"billing_address\" : \"555 Debtor's Lane\"}", true);
+}
+
+#if RAPIDJSON_SCHEMA_HAS_REGEX
+TEST(SchemaValidator, Object_PatternProperties) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"patternProperties\": {"
+ " \"^S_\": { \"type\": \"string\" },"
+ " \"^I_\": { \"type\": \"integer\" }"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"S_25\": \"This is a string\" }", true);
+ VALIDATE(s, "{ \"I_0\": 42 }", true);
+ INVALIDATE(s, "{ \"S_0\": 42 }", "", "patternProperties", "/S_0");
+ INVALIDATE(s, "{ \"I_42\": \"This is a string\" }", "", "patternProperties", "/I_42");
+ VALIDATE(s, "{ \"keyword\": \"value\" }", true);
+}
+
+TEST(SchemaValidator, Object_PatternProperties_AdditionalProperties) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"object\","
+ " \"properties\": {"
+ " \"builtin\": { \"type\": \"number\" }"
+ " },"
+ " \"patternProperties\": {"
+ " \"^S_\": { \"type\": \"string\" },"
+ " \"^I_\": { \"type\": \"integer\" }"
+ " },"
+ " \"additionalProperties\": { \"type\": \"string\" }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"builtin\": 42 }", true);
+ VALIDATE(s, "{ \"keyword\": \"value\" }", true);
+ INVALIDATE(s, "{ \"keyword\": 42 }", "/additionalProperties", "type", "/keyword");
+}
+#endif
+
+TEST(SchemaValidator, Array) {
+ Document sd;
+ sd.Parse("{\"type\":\"array\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "[1, 2, 3, 4, 5]", true);
+ VALIDATE(s, "[3, \"different\", { \"types\" : \"of values\" }]", true);
+ INVALIDATE(s, "{\"Not\": \"an array\"}", "", "type", "");
+}
+
+TEST(SchemaValidator, Array_ItemsList) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"array\","
+ " \"items\" : {"
+ " \"type\": \"number\""
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "[1, 2, 3, 4, 5]", true);
+ INVALIDATE(s, "[1, 2, \"3\", 4, 5]", "/items", "type", "/2");
+ VALIDATE(s, "[]", true);
+}
+
+TEST(SchemaValidator, Array_ItemsTuple) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"array\","
+ " \"items\": ["
+ " {"
+ " \"type\": \"number\""
+ " },"
+ " {"
+ " \"type\": \"string\""
+ " },"
+ " {"
+ " \"type\": \"string\","
+ " \"enum\": [\"Street\", \"Avenue\", \"Boulevard\"]"
+ " },"
+ " {"
+ " \"type\": \"string\","
+ " \"enum\": [\"NW\", \"NE\", \"SW\", \"SE\"]"
+ " }"
+ " ]"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\"]", true);
+ INVALIDATE(s, "[24, \"Sussex\", \"Drive\"]", "/items/2", "enum", "/2");
+ INVALIDATE(s, "[\"Palais de l'Elysee\"]", "/items/0", "type", "/0");
+ VALIDATE(s, "[10, \"Downing\", \"Street\"]", true);
+ VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\", \"Washington\"]", true);
+}
+
+TEST(SchemaValidator, Array_AdditionalItmes) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": \"array\","
+ " \"items\": ["
+ " {"
+ " \"type\": \"number\""
+ " },"
+ " {"
+ " \"type\": \"string\""
+ " },"
+ " {"
+ " \"type\": \"string\","
+ " \"enum\": [\"Street\", \"Avenue\", \"Boulevard\"]"
+ " },"
+ " {"
+ " \"type\": \"string\","
+ " \"enum\": [\"NW\", \"NE\", \"SW\", \"SE\"]"
+ " }"
+ " ],"
+ " \"additionalItems\": false"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\"]", true);
+ VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\"]", true);
+ INVALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\", \"Washington\"]", "", "items", "/4");
+}
+
+TEST(SchemaValidator, Array_ItemsRange) {
+ Document sd;
+ sd.Parse("{\"type\": \"array\",\"minItems\": 2,\"maxItems\" : 3}");
+ SchemaDocument s(sd);
+
+ INVALIDATE(s, "[]", "", "minItems", "");
+ INVALIDATE(s, "[1]", "", "minItems", "");
+ VALIDATE(s, "[1, 2]", true);
+ VALIDATE(s, "[1, 2, 3]", true);
+ INVALIDATE(s, "[1, 2, 3, 4]", "", "maxItems", "");
+}
+
+TEST(SchemaValidator, Array_UniqueItems) {
+ Document sd;
+ sd.Parse("{\"type\": \"array\", \"uniqueItems\": true}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "[1, 2, 3, 4, 5]", true);
+ INVALIDATE(s, "[1, 2, 3, 3, 4]", "", "uniqueItems", "/3");
+ VALIDATE(s, "[]", true);
+}
+
+TEST(SchemaValidator, Boolean) {
+ Document sd;
+ sd.Parse("{\"type\":\"boolean\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "true", true);
+ VALIDATE(s, "false", true);
+ INVALIDATE(s, "\"true\"", "", "type", "");
+ INVALIDATE(s, "0", "", "type", "");
+}
+
+TEST(SchemaValidator, Null) {
+ Document sd;
+ sd.Parse("{\"type\":\"null\"}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "null", true);
+ INVALIDATE(s, "false", "", "type", "");
+ INVALIDATE(s, "0", "", "type", "");
+ INVALIDATE(s, "\"\"", "", "type", "");
+}
+
+// Additional tests
+
+TEST(SchemaValidator, ObjectInArray) {
+ Document sd;
+ sd.Parse("{\"type\":\"array\", \"items\": { \"type\":\"string\" }}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "[\"a\"]", true);
+ INVALIDATE(s, "[1]", "/items", "type", "/0");
+ INVALIDATE(s, "[{}]", "/items", "type", "/0");
+}
+
+TEST(SchemaValidator, MultiTypeInObject) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\":\"object\","
+ " \"properties\": {"
+ " \"tel\" : {"
+ " \"type\":[\"integer\", \"string\"]"
+ " }"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "{ \"tel\": 999 }", true);
+ VALIDATE(s, "{ \"tel\": \"123-456\" }", true);
+ INVALIDATE(s, "{ \"tel\": true }", "/properties/tel", "type", "/tel");
+}
+
+TEST(SchemaValidator, MultiTypeWithObject) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"type\": [\"object\",\"string\"],"
+ " \"properties\": {"
+ " \"tel\" : {"
+ " \"type\": \"integer\""
+ " }"
+ " }"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"Hello\"", true);
+ VALIDATE(s, "{ \"tel\": 999 }", true);
+ INVALIDATE(s, "{ \"tel\": \"fail\" }", "/properties/tel", "type", "/tel");
+}
+
+TEST(SchemaValidator, AllOf_Nested) {
+ Document sd;
+ sd.Parse(
+ "{"
+ " \"allOf\": ["
+ " { \"type\": \"string\", \"minLength\": 2 },"
+ " { \"type\": \"string\", \"maxLength\": 5 },"
+ " { \"allOf\": [ { \"enum\" : [\"ok\", \"okay\", \"OK\", \"o\"] }, { \"enum\" : [\"ok\", \"OK\", \"o\"]} ] }"
+ " ]"
+ "}");
+ SchemaDocument s(sd);
+
+ VALIDATE(s, "\"ok\"", true);
+ VALIDATE(s, "\"OK\"", true);
+ INVALIDATE(s, "\"okay\"", "", "allOf", "");
+ INVALIDATE(s, "\"o\"", "", "allOf", "");
+ INVALIDATE(s, "\"n\"", "", "allOf", "");
+ INVALIDATE(s, "\"too long\"", "", "allOf", "");
+ INVALIDATE(s, "123", "", "allOf", "");
+}
+
+template <typename Allocator>
+static char* ReadFile(const char* filename, Allocator& allocator) {
+ const char *paths[] = {
+ "",
+ "bin/",
+ "../bin/",
+ "../../bin/",
+ "../../../bin/"
+ };
+ char buffer[1024];
+ FILE *fp = 0;
+ for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
+ sprintf(buffer, "%s%s", paths[i], filename);
+ fp = fopen(buffer, "rb");
+ if (fp)
+ break;
+ }
+
+ if (!fp)
+ return 0;
+
+ fseek(fp, 0, SEEK_END);
+ size_t length = static_cast<size_t>(ftell(fp));
+ fseek(fp, 0, SEEK_SET);
+ char* json = reinterpret_cast<char*>(allocator.Malloc(length + 1));
+ size_t readLength = fread(json, 1, length, fp);
+ json[readLength] = '\0';
+ fclose(fp);
+ return json;
+}
+
+TEST(SchemaValidator, ValidateMetaSchema) {
+ CrtAllocator allocator;
+ char* json = ReadFile("draft-04/schema", allocator);
+ Document d;
+ d.Parse(json);
+ ASSERT_FALSE(d.HasParseError());
+ SchemaDocument sd(d);
+ SchemaValidator validator(sd);
+ if (!d.Accept(validator)) {
+ StringBuffer sb;
+ validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ printf("Invalid schema: %s\n", sb.GetString());
+ printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
+ sb.Clear();
+ validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ printf("Invalid document: %s\n", sb.GetString());
+ ADD_FAILURE();
+ }
+ CrtAllocator::Free(json);
+}
+
+TEST(SchemaValidator, ValidateMetaSchema_UTF16) {
+ typedef GenericDocument<UTF16<> > D;
+ typedef GenericSchemaDocument<D::ValueType> SD;
+ typedef GenericSchemaValidator<SD> SV;
+
+ CrtAllocator allocator;
+ char* json = ReadFile("draft-04/schema", allocator);
+
+ D d;
+ StringStream ss(json);
+ d.ParseStream<0, UTF8<> >(ss);
+ ASSERT_FALSE(d.HasParseError());
+ SD sd(d);
+ SV validator(sd);
+ if (!d.Accept(validator)) {
+ GenericStringBuffer<UTF16<> > sb;
+ validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
+ wprintf(L"Invalid schema: %ls\n", sb.GetString());
+ wprintf(L"Invalid keyword: %ls\n", validator.GetInvalidSchemaKeyword());
+ sb.Clear();
+ validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
+ wprintf(L"Invalid document: %ls\n", sb.GetString());
+ ADD_FAILURE();
+ }
+ CrtAllocator::Free(json);
+}
+
+template <typename SchemaDocumentType = SchemaDocument>
+class RemoteSchemaDocumentProvider : public IGenericRemoteSchemaDocumentProvider<SchemaDocumentType> {
+public:
+ RemoteSchemaDocumentProvider() :
+ documentAllocator_(documentBuffer_, sizeof(documentBuffer_)),
+ schemaAllocator_(schemaBuffer_, sizeof(schemaBuffer_))
+ {
+ const char* filenames[kCount] = {
+ "jsonschema/remotes/integer.json",
+ "jsonschema/remotes/subSchemas.json",
+ "jsonschema/remotes/folder/folderInteger.json",
+ "draft-04/schema"
+ };
+
+ for (size_t i = 0; i < kCount; i++) {
+ sd_[i] = 0;
+
+ char jsonBuffer[8192];
+ MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
+ char* json = ReadFile(filenames[i], jsonAllocator);
+ if (!json) {
+ printf("json remote file %s not found", filenames[i]);
+ ADD_FAILURE();
+ }
+ else {
+ char stackBuffer[4096];
+ MemoryPoolAllocator<> stackAllocator(stackBuffer, sizeof(stackBuffer));
+ DocumentType d(&documentAllocator_, 1024, &stackAllocator);
+ d.Parse(json);
+ sd_[i] = new SchemaDocumentType(d, 0, &schemaAllocator_);
+ MemoryPoolAllocator<>::Free(json);
+ }
+ };
+ }
+
+ ~RemoteSchemaDocumentProvider() {
+ for (size_t i = 0; i < kCount; i++)
+ delete sd_[i];
+ }
+
+ virtual const SchemaDocumentType* GetRemoteDocument(const char* uri, SizeType length) {
+ const char* uris[kCount] = {
+ "http://localhost:1234/integer.json",
+ "http://localhost:1234/subSchemas.json",
+ "http://localhost:1234/folder/folderInteger.json",
+ "http://json-schema.org/draft-04/schema"
+ };
+
+ for (size_t i = 0; i < kCount; i++)
+ if (strncmp(uri, uris[i], length) == 0)
+ return sd_[i];
+ return 0;
+ }
+
+private:
+ typedef GenericDocument<typename SchemaDocumentType::EncodingType, MemoryPoolAllocator<>, MemoryPoolAllocator<> > DocumentType;
+
+ RemoteSchemaDocumentProvider(const RemoteSchemaDocumentProvider&);
+ RemoteSchemaDocumentProvider& operator=(const RemoteSchemaDocumentProvider&);
+
+ static const size_t kCount = 4;
+ SchemaDocumentType* sd_[kCount];
+ typename DocumentType::AllocatorType documentAllocator_;
+ typename SchemaDocumentType::AllocatorType schemaAllocator_;
+ char documentBuffer_[16384];
+ char schemaBuffer_[128 * 1024];
+};
+
+TEST(SchemaValidator, TestSuite) {
+ const char* filenames[] = {
+ "additionalItems.json",
+ "additionalProperties.json",
+ "allOf.json",
+ "anyOf.json",
+ "default.json",
+ "definitions.json",
+ "dependencies.json",
+ "enum.json",
+ "items.json",
+ "maximum.json",
+ "maxItems.json",
+ "maxLength.json",
+ "maxProperties.json",
+ "minimum.json",
+ "minItems.json",
+ "minLength.json",
+ "minProperties.json",
+ "multipleOf.json",
+ "not.json",
+ "oneOf.json",
+ "pattern.json",
+ "patternProperties.json",
+ "properties.json",
+ "ref.json",
+ "refRemote.json",
+ "required.json",
+ "type.json",
+ "uniqueItems.json"
+ };
+
+ const char* onlyRunDescription = 0;
+ //const char* onlyRunDescription = "a string is a string";
+
+ unsigned testCount = 0;
+ unsigned passCount = 0;
+
+ typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
+ RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
+
+ char jsonBuffer[65536];
+ char documentBuffer[65536];
+ char documentStackBuffer[65536];
+ char schemaBuffer[65536];
+ char validatorBuffer[65536];
+ MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
+ MemoryPoolAllocator<> documentAllocator(documentBuffer, sizeof(documentBuffer));
+ MemoryPoolAllocator<> documentStackAllocator(documentStackBuffer, sizeof(documentStackBuffer));
+ MemoryPoolAllocator<> schemaAllocator(schemaBuffer, sizeof(schemaBuffer));
+ MemoryPoolAllocator<> validatorAllocator(validatorBuffer, sizeof(validatorBuffer));
+
+ for (size_t i = 0; i < sizeof(filenames) / sizeof(filenames[0]); i++) {
+ char filename[FILENAME_MAX];
+ sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
+ char* json = ReadFile(filename, jsonAllocator);
+ if (!json) {
+ printf("json test suite file %s not found", filename);
+ ADD_FAILURE();
+ }
+ else {
+ GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<> > d(&documentAllocator, 1024, &documentStackAllocator);
+ d.Parse(json);
+ if (d.HasParseError()) {
+ printf("json test suite file %s has parse error", filename);
+ ADD_FAILURE();
+ }
+ else {
+ for (Value::ConstValueIterator schemaItr = d.Begin(); schemaItr != d.End(); ++schemaItr) {
+ {
+ SchemaDocumentType schema((*schemaItr)["schema"], &provider, &schemaAllocator);
+ GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > validator(schema, &validatorAllocator);
+ const char* description1 = (*schemaItr)["description"].GetString();
+ const Value& tests = (*schemaItr)["tests"];
+ for (Value::ConstValueIterator testItr = tests.Begin(); testItr != tests.End(); ++testItr) {
+ const char* description2 = (*testItr)["description"].GetString();
+ if (!onlyRunDescription || strcmp(description2, onlyRunDescription) == 0) {
+ const Value& data = (*testItr)["data"];
+ bool expected = (*testItr)["valid"].GetBool();
+ testCount++;
+ validator.Reset();
+ bool actual = data.Accept(validator);
+ if (expected != actual)
+ printf("Fail: %30s \"%s\" \"%s\"\n", filename, description1, description2);
+ else
+ passCount++;
+ }
+ }
+ //printf("%zu %zu %zu\n", documentAllocator.Size(), schemaAllocator.Size(), validatorAllocator.Size());
+ }
+ schemaAllocator.Clear();
+ validatorAllocator.Clear();
+ }
+ }
+ }
+ documentAllocator.Clear();
+ MemoryPoolAllocator<>::Free(json);
+ jsonAllocator.Clear();
+ }
+ printf("%d / %d passed (%2d%%)\n", passCount, testCount, passCount * 100 / testCount);
+ // if (passCount != testCount)
+ // ADD_FAILURE();
+}
+
+TEST(SchemaValidatingReader, Simple) {
+ Document sd;
+ sd.Parse("{ \"type\": \"string\", \"enum\" : [\"red\", \"amber\", \"green\"] }");
+ SchemaDocument s(sd);
+
+ Document d;
+ StringStream ss("\"red\"");
+ SchemaValidatingReader<kParseDefaultFlags, StringStream, UTF8<> > reader(ss, s);
+ d.Populate(reader);
+ EXPECT_TRUE(reader.GetParseResult());
+ EXPECT_TRUE(reader.IsValid());
+ EXPECT_TRUE(d.IsString());
+ EXPECT_STREQ("red", d.GetString());
+}
+
+TEST(SchemaValidatingReader, Invalid) {
+ Document sd;
+ sd.Parse("{\"type\":\"string\",\"minLength\":2,\"maxLength\":3}");
+ SchemaDocument s(sd);
+
+ Document d;
+ StringStream ss("\"ABCD\"");
+ SchemaValidatingReader<kParseDefaultFlags, StringStream, UTF8<> > reader(ss, s);
+ d.Populate(reader);
+ EXPECT_FALSE(reader.GetParseResult());
+ EXPECT_FALSE(reader.IsValid());
+ EXPECT_EQ(kParseErrorTermination, reader.GetParseResult().Code());
+ EXPECT_STREQ("maxLength", reader.GetInvalidSchemaKeyword());
+ EXPECT_TRUE(reader.GetInvalidSchemaPointer() == SchemaDocument::PointerType(""));
+ EXPECT_TRUE(reader.GetInvalidDocumentPointer() == SchemaDocument::PointerType(""));
+ EXPECT_TRUE(d.IsNull());
+}
+
+TEST(SchemaValidatingWriter, Simple) {
+ Document sd;
+ sd.Parse("{\"type\":\"string\",\"minLength\":2,\"maxLength\":3}");
+ SchemaDocument s(sd);
+
+ Document d;
+ StringBuffer sb;
+ Writer<StringBuffer> writer(sb);
+ GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
+
+ d.Parse("\"red\"");
+ EXPECT_TRUE(d.Accept(validator));
+ EXPECT_TRUE(validator.IsValid());
+ EXPECT_STREQ("\"red\"", sb.GetString());
+
+ sb.Clear();
+ validator.Reset();
+ d.Parse("\"ABCD\"");
+ EXPECT_FALSE(d.Accept(validator));
+ EXPECT_FALSE(validator.IsValid());
+ EXPECT_TRUE(validator.GetInvalidSchemaPointer() == SchemaDocument::PointerType(""));
+ EXPECT_TRUE(validator.GetInvalidDocumentPointer() == SchemaDocument::PointerType(""));
+}
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/simdtest.cpp b/3rdparty/rapidjson/test/unittest/simdtest.cpp
new file mode 100644
index 00000000000..6ded7402fbf
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/simdtest.cpp
@@ -0,0 +1,159 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+// Since Travis CI installs old Valgrind 3.7.0, which fails with some SSE4.2
+// The unit tests prefix with SIMD should be skipped by Valgrind test
+
+// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler.
+// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported.
+#if defined(__SSE4_2__)
+# define RAPIDJSON_SSE42
+#elif defined(__SSE2__)
+# define RAPIDJSON_SSE2
+#endif
+
+#define RAPIDJSON_NAMESPACE rapidjson_simd
+
+#include "unittest.h"
+
+#include "rapidjson/reader.h"
+#include "rapidjson/writer.h"
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(effc++)
+#endif
+
+using namespace rapidjson_simd;
+
+#ifdef RAPIDJSON_SSE2
+#define SIMD_SUFFIX(name) name##_SSE2
+#elif defined(RAPIDJSON_SSE42)
+#define SIMD_SUFFIX(name) name##_SSE42
+#else
+#define SIMD_SUFFIX(name) name
+#endif
+
+template <typename StreamType>
+void TestSkipWhitespace() {
+ for (size_t step = 1; step < 32; step++) {
+ char buffer[1025];
+ for (size_t i = 0; i < 1024; i++)
+ buffer[i] = " \t\r\n"[i % 4];
+ for (size_t i = 0; i < 1024; i += step)
+ buffer[i] = 'X';
+ buffer[1024] = '\0';
+
+ StreamType s(buffer);
+ size_t i = 0;
+ for (;;) {
+ SkipWhitespace(s);
+ if (s.Peek() == '\0')
+ break;
+ EXPECT_EQ(i, s.Tell());
+ EXPECT_EQ('X', s.Take());
+ i += step;
+ }
+ }
+}
+
+TEST(SIMD, SIMD_SUFFIX(SkipWhitespace)) {
+ TestSkipWhitespace<StringStream>();
+ TestSkipWhitespace<InsituStringStream>();
+}
+
+struct ScanCopyUnescapedStringHandler : BaseReaderHandler<UTF8<>, ScanCopyUnescapedStringHandler> {
+ bool String(const char* str, size_t length, bool) {
+ memcpy(buffer, str, length + 1);
+ return true;
+ }
+ char buffer[1024 + 5];
+};
+
+template <unsigned parseFlags, typename StreamType>
+void TestScanCopyUnescapedString() {
+ for (size_t step = 0; step < 1024; step++) {
+ char json[1024 + 5];
+ char *p = json;
+ *p ++= '\"';
+ for (size_t i = 0; i < step; i++)
+ *p++= "ABCD"[i % 4];
+ *p++ = '\\';
+ *p++ = '\\';
+ *p++ = '\"';
+ *p++ = '\0';
+
+ StreamType s(json);
+ Reader reader;
+ ScanCopyUnescapedStringHandler h;
+ reader.Parse<parseFlags>(s, h);
+ EXPECT_TRUE(memcmp(h.buffer, json + 1, step) == 0);
+ EXPECT_EQ('\\', h.buffer[step]); // escaped
+ EXPECT_EQ('\0', h.buffer[step + 1]);
+ }
+}
+
+TEST(SIMD, SIMD_SUFFIX(ScanCopyUnescapedString)) {
+ TestScanCopyUnescapedString<kParseDefaultFlags, StringStream>();
+ TestScanCopyUnescapedString<kParseInsituFlag, InsituStringStream>();
+}
+
+TEST(SIMD, SIMD_SUFFIX(ScanWriteUnescapedString)) {
+ for (size_t step = 0; step < 1024; step++) {
+ char s[2048 + 1];
+ char *p = s;
+ for (size_t i = 0; i < step; i++)
+ *p++= "ABCD"[i % 4];
+ char escape = "\0\n\\\""[step % 4];
+ *p++ = escape;
+ for (size_t i = 0; i < step; i++)
+ *p++= "ABCD"[i % 4];
+
+ StringBuffer sb;
+ Writer<StringBuffer> writer(sb);
+ writer.String(s, SizeType(step * 2 + 1));
+ const char* q = sb.GetString();
+ EXPECT_EQ('\"', *q++);
+ for (size_t i = 0; i < step; i++)
+ EXPECT_EQ("ABCD"[i % 4], *q++);
+ if (escape == '\0') {
+ EXPECT_EQ('\\', *q++);
+ EXPECT_EQ('u', *q++);
+ EXPECT_EQ('0', *q++);
+ EXPECT_EQ('0', *q++);
+ EXPECT_EQ('0', *q++);
+ EXPECT_EQ('0', *q++);
+ }
+ else if (escape == '\n') {
+ EXPECT_EQ('\\', *q++);
+ EXPECT_EQ('n', *q++);
+ }
+ else if (escape == '\\') {
+ EXPECT_EQ('\\', *q++);
+ EXPECT_EQ('\\', *q++);
+ }
+ else if (escape == '\"') {
+ EXPECT_EQ('\\', *q++);
+ EXPECT_EQ('\"', *q++);
+ }
+ for (size_t i = 0; i < step; i++)
+ EXPECT_EQ("ABCD"[i % 4], *q++);
+ EXPECT_EQ('\"', *q++);
+ EXPECT_EQ('\0', *q++);
+ }
+}
+
+#ifdef __GNUC__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/strfunctest.cpp b/3rdparty/rapidjson/test/unittest/strfunctest.cpp
new file mode 100644
index 00000000000..cc1bb22f0e9
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/strfunctest.cpp
@@ -0,0 +1,30 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/internal/strfunc.h"
+
+using namespace rapidjson;
+using namespace rapidjson::internal;
+
+TEST(StrFunc, CountStringCodePoint) {
+ SizeType count;
+ EXPECT_TRUE(CountStringCodePoint<UTF8<> >("", 0, &count));
+ EXPECT_EQ(0u, count);
+ EXPECT_TRUE(CountStringCodePoint<UTF8<> >("Hello", 5, &count));
+ EXPECT_EQ(5u, count);
+ EXPECT_TRUE(CountStringCodePoint<UTF8<> >("\xC2\xA2\xE2\x82\xAC\xF0\x9D\x84\x9E", 9, &count)); // cents euro G-clef
+ EXPECT_EQ(3u, count);
+ EXPECT_FALSE(CountStringCodePoint<UTF8<> >("\xC2\xA2\xE2\x82\xAC\xF0\x9D\x84\x9E\x80", 10, &count));
+}
diff --git a/3rdparty/rapidjson/test/unittest/stringbuffertest.cpp b/3rdparty/rapidjson/test/unittest/stringbuffertest.cpp
new file mode 100644
index 00000000000..9be98fce268
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/stringbuffertest.cpp
@@ -0,0 +1,163 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/writer.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+using namespace rapidjson;
+
+TEST(StringBuffer, InitialSize) {
+ StringBuffer buffer;
+ EXPECT_EQ(0u, buffer.GetSize());
+ EXPECT_STREQ("", buffer.GetString());
+}
+
+TEST(StringBuffer, Put) {
+ StringBuffer buffer;
+ buffer.Put('A');
+
+ EXPECT_EQ(1u, buffer.GetSize());
+ EXPECT_STREQ("A", buffer.GetString());
+}
+
+TEST(StringBuffer, Clear) {
+ StringBuffer buffer;
+ buffer.Put('A');
+ buffer.Put('B');
+ buffer.Put('C');
+ buffer.Clear();
+
+ EXPECT_EQ(0u, buffer.GetSize());
+ EXPECT_STREQ("", buffer.GetString());
+}
+
+TEST(StringBuffer, Push) {
+ StringBuffer buffer;
+ buffer.Push(5);
+
+ EXPECT_EQ(5u, buffer.GetSize());
+
+ // Causes sudden expansion to make the stack's capacity equal to size
+ buffer.Push(65536u);
+ EXPECT_EQ(5u + 65536u, buffer.GetSize());
+}
+
+TEST(StringBuffer, Pop) {
+ StringBuffer buffer;
+ buffer.Put('A');
+ buffer.Put('B');
+ buffer.Put('C');
+ buffer.Put('D');
+ buffer.Put('E');
+ buffer.Pop(3);
+
+ EXPECT_EQ(2u, buffer.GetSize());
+ EXPECT_STREQ("AB", buffer.GetString());
+}
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+#if 0 // Many old compiler does not support these. Turn it off temporaily.
+
+#include <type_traits>
+
+TEST(StringBuffer, Traits) {
+ static_assert( std::is_constructible<StringBuffer>::value, "");
+ static_assert( std::is_default_constructible<StringBuffer>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_copy_constructible<StringBuffer>::value, "");
+#endif
+ static_assert( std::is_move_constructible<StringBuffer>::value, "");
+
+ static_assert(!std::is_nothrow_constructible<StringBuffer>::value, "");
+ static_assert(!std::is_nothrow_default_constructible<StringBuffer>::value, "");
+
+#if !defined(_MSC_VER) || _MSC_VER >= 1800
+ static_assert(!std::is_nothrow_copy_constructible<StringBuffer>::value, "");
+ static_assert(!std::is_nothrow_move_constructible<StringBuffer>::value, "");
+#endif
+
+ static_assert( std::is_assignable<StringBuffer,StringBuffer>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_copy_assignable<StringBuffer>::value, "");
+#endif
+ static_assert( std::is_move_assignable<StringBuffer>::value, "");
+
+#if !defined(_MSC_VER) || _MSC_VER >= 1800
+ static_assert(!std::is_nothrow_assignable<StringBuffer, StringBuffer>::value, "");
+#endif
+
+ static_assert(!std::is_nothrow_copy_assignable<StringBuffer>::value, "");
+ static_assert(!std::is_nothrow_move_assignable<StringBuffer>::value, "");
+
+ static_assert( std::is_destructible<StringBuffer>::value, "");
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_destructible<StringBuffer>::value, "");
+#endif
+}
+
+#endif
+
+TEST(StringBuffer, MoveConstructor) {
+ StringBuffer x;
+ x.Put('A');
+ x.Put('B');
+ x.Put('C');
+ x.Put('D');
+
+ EXPECT_EQ(4u, x.GetSize());
+ EXPECT_STREQ("ABCD", x.GetString());
+
+ // StringBuffer y(x); // does not compile (!is_copy_constructible)
+ StringBuffer y(std::move(x));
+ EXPECT_EQ(0u, x.GetSize());
+ EXPECT_EQ(4u, y.GetSize());
+ EXPECT_STREQ("ABCD", y.GetString());
+
+ // StringBuffer z = y; // does not compile (!is_copy_assignable)
+ StringBuffer z = std::move(y);
+ EXPECT_EQ(0u, y.GetSize());
+ EXPECT_EQ(4u, z.GetSize());
+ EXPECT_STREQ("ABCD", z.GetString());
+}
+
+TEST(StringBuffer, MoveAssignment) {
+ StringBuffer x;
+ x.Put('A');
+ x.Put('B');
+ x.Put('C');
+ x.Put('D');
+
+ EXPECT_EQ(4u, x.GetSize());
+ EXPECT_STREQ("ABCD", x.GetString());
+
+ StringBuffer y;
+ // y = x; // does not compile (!is_copy_assignable)
+ y = std::move(x);
+ EXPECT_EQ(0u, x.GetSize());
+ EXPECT_EQ(4u, y.GetSize());
+ EXPECT_STREQ("ABCD", y.GetString());
+}
+
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/strtodtest.cpp b/3rdparty/rapidjson/test/unittest/strtodtest.cpp
new file mode 100644
index 00000000000..a42d96e4a67
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/strtodtest.cpp
@@ -0,0 +1,132 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/internal/strtod.h"
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(unreachable-code)
+#endif
+
+#define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1)
+
+using namespace rapidjson::internal;
+
+TEST(Strtod, CheckApproximationCase) {
+ static const int kSignificandSize = 52;
+ static const int kExponentBias = 0x3FF;
+ static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
+ static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
+ static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
+
+ // http://www.exploringbinary.com/using-integers-to-check-a-floating-point-approximation/
+ // Let b = 0x1.465a72e467d88p-149
+ // = 5741268244528520 x 2^-201
+ union {
+ double d;
+ uint64_t u;
+ }u;
+ u.u = 0x465a72e467d88 | ((static_cast<uint64_t>(-149 + kExponentBias)) << kSignificandSize);
+ const double b = u.d;
+ const uint64_t bInt = (u.u & kSignificandMask) | kHiddenBit;
+ const int bExp = ((u.u & kExponentMask) >> kSignificandSize) - kExponentBias - kSignificandSize;
+ EXPECT_DOUBLE_EQ(1.7864e-45, b);
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0x001465a7, 0x2e467d88), bInt);
+ EXPECT_EQ(-201, bExp);
+
+ // Let d = 17864 x 10-49
+ const char dInt[] = "17864";
+ const int dExp = -49;
+
+ // Let h = 2^(bExp-1)
+ const int hExp = bExp - 1;
+ EXPECT_EQ(-202, hExp);
+
+ int dS_Exp2 = 0;
+ int dS_Exp5 = 0;
+ int bS_Exp2 = 0;
+ int bS_Exp5 = 0;
+ int hS_Exp2 = 0;
+ int hS_Exp5 = 0;
+
+ // Adjust for decimal exponent
+ if (dExp >= 0) {
+ dS_Exp2 += dExp;
+ dS_Exp5 += dExp;
+ }
+ else {
+ bS_Exp2 -= dExp;
+ bS_Exp5 -= dExp;
+ hS_Exp2 -= dExp;
+ hS_Exp5 -= dExp;
+ }
+
+ // Adjust for binary exponent
+ if (bExp >= 0)
+ bS_Exp2 += bExp;
+ else {
+ dS_Exp2 -= bExp;
+ hS_Exp2 -= bExp;
+ }
+
+ // Adjust for half ulp exponent
+ if (hExp >= 0)
+ hS_Exp2 += hExp;
+ else {
+ dS_Exp2 -= hExp;
+ bS_Exp2 -= hExp;
+ }
+
+ // Remove common power of two factor from all three scaled values
+ int common_Exp2 = std::min(dS_Exp2, std::min(bS_Exp2, hS_Exp2));
+ dS_Exp2 -= common_Exp2;
+ bS_Exp2 -= common_Exp2;
+ hS_Exp2 -= common_Exp2;
+
+ EXPECT_EQ(153, dS_Exp2);
+ EXPECT_EQ(0, dS_Exp5);
+ EXPECT_EQ(1, bS_Exp2);
+ EXPECT_EQ(49, bS_Exp5);
+ EXPECT_EQ(0, hS_Exp2);
+ EXPECT_EQ(49, hS_Exp5);
+
+ BigInteger dS = BIGINTEGER_LITERAL(dInt);
+ dS.MultiplyPow5(static_cast<unsigned>(dS_Exp5)) <<= static_cast<size_t>(dS_Exp2);
+
+ BigInteger bS(bInt);
+ bS.MultiplyPow5(static_cast<unsigned>(bS_Exp5)) <<= static_cast<size_t>(bS_Exp2);
+
+ BigInteger hS(1);
+ hS.MultiplyPow5(static_cast<unsigned>(hS_Exp5)) <<= static_cast<size_t>(hS_Exp2);
+
+ EXPECT_TRUE(BIGINTEGER_LITERAL("203970822259994138521801764465966248930731085529088") == dS);
+ EXPECT_TRUE(BIGINTEGER_LITERAL("203970822259994122305215569213032722473144531250000") == bS);
+ EXPECT_TRUE(BIGINTEGER_LITERAL("17763568394002504646778106689453125") == hS);
+
+ EXPECT_EQ(1, dS.Compare(bS));
+
+ BigInteger delta(0);
+ EXPECT_FALSE(dS.Difference(bS, &delta));
+ EXPECT_TRUE(BIGINTEGER_LITERAL("16216586195252933526457586554279088") == delta);
+ EXPECT_TRUE(bS.Difference(dS, &delta));
+ EXPECT_TRUE(BIGINTEGER_LITERAL("16216586195252933526457586554279088") == delta);
+
+ EXPECT_EQ(-1, delta.Compare(hS));
+}
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/unittest.cpp b/3rdparty/rapidjson/test/unittest/unittest.cpp
new file mode 100644
index 00000000000..e0e8576ee21
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/unittest.cpp
@@ -0,0 +1,50 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/rapidjson.h"
+
+#ifdef __clang__
+#pragma GCC diagnostic push
+#if __has_warning("-Wdeprecated")
+#pragma GCC diagnostic ignored "-Wdeprecated"
+#endif
+#endif
+
+AssertException::~AssertException() throw() {}
+
+#ifdef __clang__
+#pragma GCC diagnostic pop
+#endif
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+
+ std::cout << "RapidJSON v" << RAPIDJSON_VERSION_STRING << std::endl;
+
+#ifdef _MSC_VER
+ _CrtMemState memoryState = { 0 };
+ _CrtMemCheckpoint(&memoryState);
+ //_CrtSetBreakAlloc(X);
+ //void *testWhetherMemoryLeakDetectionWorks = malloc(1);
+#endif
+
+ int ret = RUN_ALL_TESTS();
+
+#ifdef _MSC_VER
+ // Current gtest constantly leak 2 blocks at exit
+ _CrtMemDumpAllObjectsSince(&memoryState);
+#endif
+ return ret;
+}
diff --git a/3rdparty/rapidjson/test/unittest/unittest.h b/3rdparty/rapidjson/test/unittest/unittest.h
new file mode 100644
index 00000000000..e125bf88dc3
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/unittest.h
@@ -0,0 +1,135 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#ifndef UNITTEST_H_
+#define UNITTEST_H_
+
+// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.
+#ifndef __STDC_CONSTANT_MACROS
+#ifdef __clang__
+#pragma GCC diagnostic push
+#if __has_warning("-Wreserved-id-macro")
+#pragma GCC diagnostic ignored "-Wreserved-id-macro"
+#endif
+#endif
+
+# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
+
+#ifdef __clang__
+#pragma GCC diagnostic pop
+#endif
+#endif
+
+#ifdef _MSC_VER
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+#pragma warning(disable : 4996) // 'function': was declared deprecated
+#endif
+
+#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Weffc++"
+#endif
+
+#include "gtest/gtest.h"
+#include <stdexcept>
+
+#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#pragma GCC diagnostic pop
+#endif
+
+#ifdef __clang__
+// All TEST() macro generated this warning, disable globally
+#pragma GCC diagnostic ignored "-Wglobal-constructors"
+#endif
+
+template <typename Ch>
+inline unsigned StrLen(const Ch* s) {
+ const Ch* p = s;
+ while (*p) p++;
+ return unsigned(p - s);
+}
+
+template<typename Ch>
+inline int StrCmp(const Ch* s1, const Ch* s2) {
+ while(*s1 && (*s1 == *s2)) { s1++; s2++; }
+ return static_cast<unsigned>(*s1) < static_cast<unsigned>(*s2) ? -1 : static_cast<unsigned>(*s1) > static_cast<unsigned>(*s2);
+}
+
+template <typename Ch>
+inline Ch* StrDup(const Ch* str) {
+ size_t bufferSize = sizeof(Ch) * (StrLen(str) + 1);
+ Ch* buffer = static_cast<Ch*>(malloc(bufferSize));
+ memcpy(buffer, str, bufferSize);
+ return buffer;
+}
+
+inline FILE* TempFile(char *filename) {
+#ifdef _MSC_VER
+ filename = tmpnam(filename);
+
+ // For Visual Studio, tmpnam() adds a backslash in front. Remove it.
+ if (filename[0] == '\\')
+ for (int i = 0; filename[i] != '\0'; i++)
+ filename[i] = filename[i + 1];
+
+ return fopen(filename, "wb");
+#else
+ strcpy(filename, "/tmp/fileXXXXXX");
+ int fd = mkstemp(filename);
+ return fdopen(fd, "w");
+#endif
+}
+
+// Use exception for catching assert
+#ifdef _MSC_VER
+#pragma warning(disable : 4127)
+#endif
+
+#ifdef __clang__
+#pragma GCC diagnostic push
+#if __has_warning("-Wdeprecated")
+#pragma GCC diagnostic ignored "-Wdeprecated"
+#endif
+#endif
+
+class AssertException : public std::logic_error {
+public:
+ AssertException(const char* w) : std::logic_error(w) {}
+ AssertException(const AssertException& rhs) : std::logic_error(rhs) {}
+ virtual ~AssertException() throw();
+};
+
+#ifdef __clang__
+#pragma GCC diagnostic pop
+#endif
+
+#define RAPIDJSON_ASSERT(x) if (!(x)) throw AssertException(RAPIDJSON_STRINGIFY(x))
+
+class Random {
+public:
+ Random(unsigned seed = 0) : mSeed(seed) {}
+
+ unsigned operator()() {
+ mSeed = 214013 * mSeed + 2531011;
+ return mSeed;
+ }
+
+private:
+ unsigned mSeed;
+};
+
+#endif // UNITTEST_H_
diff --git a/3rdparty/rapidjson/test/unittest/valuetest.cpp b/3rdparty/rapidjson/test/unittest/valuetest.cpp
new file mode 100644
index 00000000000..5e88a77e3a3
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/valuetest.cpp
@@ -0,0 +1,1498 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+#include "rapidjson/document.h"
+#include <algorithm>
+
+#ifdef __clang__
+RAPIDJSON_DIAG_PUSH
+RAPIDJSON_DIAG_OFF(c++98-compat)
+#endif
+
+using namespace rapidjson;
+
+TEST(Value, DefaultConstructor) {
+ Value x;
+ EXPECT_EQ(kNullType, x.GetType());
+ EXPECT_TRUE(x.IsNull());
+
+ //std::cout << "sizeof(Value): " << sizeof(x) << std::endl;
+}
+
+// Should not pass compilation
+//TEST(Value, copy_constructor) {
+// Value x(1234);
+// Value y = x;
+//}
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+#if 0 // Many old compiler does not support these. Turn it off temporaily.
+
+#include <type_traits>
+
+TEST(Value, Traits) {
+ typedef GenericValue<UTF8<>, CrtAllocator> Value;
+ static_assert(std::is_constructible<Value>::value, "");
+ static_assert(std::is_default_constructible<Value>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_copy_constructible<Value>::value, "");
+#endif
+ static_assert(std::is_move_constructible<Value>::value, "");
+
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_constructible<Value>::value, "");
+ static_assert(std::is_nothrow_default_constructible<Value>::value, "");
+ static_assert(!std::is_nothrow_copy_constructible<Value>::value, "");
+ static_assert(std::is_nothrow_move_constructible<Value>::value, "");
+#endif
+
+ static_assert(std::is_assignable<Value,Value>::value, "");
+#ifndef _MSC_VER
+ static_assert(!std::is_copy_assignable<Value>::value, "");
+#endif
+ static_assert(std::is_move_assignable<Value>::value, "");
+
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_assignable<Value, Value>::value, "");
+#endif
+ static_assert(!std::is_nothrow_copy_assignable<Value>::value, "");
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_move_assignable<Value>::value, "");
+#endif
+
+ static_assert(std::is_destructible<Value>::value, "");
+#ifndef _MSC_VER
+ static_assert(std::is_nothrow_destructible<Value>::value, "");
+#endif
+}
+
+#endif
+
+TEST(Value, MoveConstructor) {
+ typedef GenericValue<UTF8<>, CrtAllocator> Value;
+ Value::AllocatorType allocator;
+
+ Value x((Value(kArrayType)));
+ x.Reserve(4u, allocator);
+ x.PushBack(1, allocator).PushBack(2, allocator).PushBack(3, allocator).PushBack(4, allocator);
+ EXPECT_TRUE(x.IsArray());
+ EXPECT_EQ(4u, x.Size());
+
+ // Value y(x); // does not compile (!is_copy_constructible)
+ Value y(std::move(x));
+ EXPECT_TRUE(x.IsNull());
+ EXPECT_TRUE(y.IsArray());
+ EXPECT_EQ(4u, y.Size());
+
+ // Value z = y; // does not compile (!is_copy_assignable)
+ Value z = std::move(y);
+ EXPECT_TRUE(y.IsNull());
+ EXPECT_TRUE(z.IsArray());
+ EXPECT_EQ(4u, z.Size());
+}
+
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+
+TEST(Value, AssignmentOperator) {
+ Value x(1234);
+ Value y;
+ y = x;
+ EXPECT_TRUE(x.IsNull()); // move semantic
+ EXPECT_EQ(1234, y.GetInt());
+
+ y = 5678;
+ EXPECT_TRUE(y.IsInt());
+ EXPECT_EQ(5678, y.GetInt());
+
+ x = "Hello";
+ EXPECT_TRUE(x.IsString());
+ EXPECT_STREQ(x.GetString(),"Hello");
+
+ y = StringRef(x.GetString(),x.GetStringLength());
+ EXPECT_TRUE(y.IsString());
+ EXPECT_EQ(y.GetString(),x.GetString());
+ EXPECT_EQ(y.GetStringLength(),x.GetStringLength());
+
+ static char mstr[] = "mutable";
+ // y = mstr; // should not compile
+ y = StringRef(mstr);
+ EXPECT_TRUE(y.IsString());
+ EXPECT_EQ(y.GetString(),mstr);
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ // C++11 move assignment
+ x = Value("World");
+ EXPECT_TRUE(x.IsString());
+ EXPECT_STREQ("World", x.GetString());
+
+ x = std::move(y);
+ EXPECT_TRUE(y.IsNull());
+ EXPECT_TRUE(x.IsString());
+ EXPECT_EQ(x.GetString(), mstr);
+
+ y = std::move(Value().SetInt(1234));
+ EXPECT_TRUE(y.IsInt());
+ EXPECT_EQ(1234, y);
+#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
+}
+
+template <typename A, typename B>
+void TestEqual(const A& a, const B& b) {
+ EXPECT_TRUE (a == b);
+ EXPECT_FALSE(a != b);
+ EXPECT_TRUE (b == a);
+ EXPECT_FALSE(b != a);
+}
+
+template <typename A, typename B>
+void TestUnequal(const A& a, const B& b) {
+ EXPECT_FALSE(a == b);
+ EXPECT_TRUE (a != b);
+ EXPECT_FALSE(b == a);
+ EXPECT_TRUE (b != a);
+}
+
+TEST(Value, EqualtoOperator) {
+ Value::AllocatorType allocator;
+ Value x(kObjectType);
+ x.AddMember("hello", "world", allocator)
+ .AddMember("t", Value(true).Move(), allocator)
+ .AddMember("f", Value(false).Move(), allocator)
+ .AddMember("n", Value(kNullType).Move(), allocator)
+ .AddMember("i", 123, allocator)
+ .AddMember("pi", 3.14, allocator)
+ .AddMember("a", Value(kArrayType).Move().PushBack(1, allocator).PushBack(2, allocator).PushBack(3, allocator), allocator);
+
+ // Test templated operator==() and operator!=()
+ TestEqual(x["hello"], "world");
+ const char* cc = "world";
+ TestEqual(x["hello"], cc);
+ char* c = strdup("world");
+ TestEqual(x["hello"], c);
+ free(c);
+
+ TestEqual(x["t"], true);
+ TestEqual(x["f"], false);
+ TestEqual(x["i"], 123);
+ TestEqual(x["pi"], 3.14);
+
+ // Test operator==() (including different allocators)
+ CrtAllocator crtAllocator;
+ GenericValue<UTF8<>, CrtAllocator> y;
+ GenericDocument<UTF8<>, CrtAllocator> z(&crtAllocator);
+ y.CopyFrom(x, crtAllocator);
+ z.CopyFrom(y, z.GetAllocator());
+ TestEqual(x, y);
+ TestEqual(y, z);
+ TestEqual(z, x);
+
+ // Swapping member order should be fine.
+ EXPECT_TRUE(y.RemoveMember("t"));
+ TestUnequal(x, y);
+ TestUnequal(z, y);
+ EXPECT_TRUE(z.RemoveMember("t"));
+ TestUnequal(x, z);
+ TestEqual(y, z);
+ y.AddMember("t", false, crtAllocator);
+ z.AddMember("t", false, z.GetAllocator());
+ TestUnequal(x, y);
+ TestUnequal(z, x);
+ y["t"] = true;
+ z["t"] = true;
+ TestEqual(x, y);
+ TestEqual(y, z);
+ TestEqual(z, x);
+
+ // Swapping element order is not OK
+ x["a"][0].Swap(x["a"][1]);
+ TestUnequal(x, y);
+ x["a"][0].Swap(x["a"][1]);
+ TestEqual(x, y);
+
+ // Array of different size
+ x["a"].PushBack(4, allocator);
+ TestUnequal(x, y);
+ x["a"].PopBack();
+ TestEqual(x, y);
+
+ // Issue #129: compare Uint64
+ x.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0));
+ y.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF));
+ TestUnequal(x, y);
+}
+
+template <typename Value>
+void TestCopyFrom() {
+ typename Value::AllocatorType a;
+ Value v1(1234);
+ Value v2(v1, a); // deep copy constructor
+ EXPECT_TRUE(v1.GetType() == v2.GetType());
+ EXPECT_EQ(v1.GetInt(), v2.GetInt());
+
+ v1.SetString("foo");
+ v2.CopyFrom(v1, a);
+ EXPECT_TRUE(v1.GetType() == v2.GetType());
+ EXPECT_STREQ(v1.GetString(), v2.GetString());
+ EXPECT_EQ(v1.GetString(), v2.GetString()); // string NOT copied
+
+ v1.SetString("bar", a); // copy string
+ v2.CopyFrom(v1, a);
+ EXPECT_TRUE(v1.GetType() == v2.GetType());
+ EXPECT_STREQ(v1.GetString(), v2.GetString());
+ EXPECT_NE(v1.GetString(), v2.GetString()); // string copied
+
+
+ v1.SetArray().PushBack(1234, a);
+ v2.CopyFrom(v1, a);
+ EXPECT_TRUE(v2.IsArray());
+ EXPECT_EQ(v1.Size(), v2.Size());
+
+ v1.PushBack(Value().SetString("foo", a), a); // push string copy
+ EXPECT_TRUE(v1.Size() != v2.Size());
+ v2.CopyFrom(v1, a);
+ EXPECT_TRUE(v1.Size() == v2.Size());
+ EXPECT_STREQ(v1[1].GetString(), v2[1].GetString());
+ EXPECT_NE(v1[1].GetString(), v2[1].GetString()); // string got copied
+}
+
+TEST(Value, CopyFrom) {
+ TestCopyFrom<Value>();
+ TestCopyFrom<GenericValue<UTF8<>, CrtAllocator> >();
+}
+
+TEST(Value, Swap) {
+ Value v1(1234);
+ Value v2(kObjectType);
+
+ EXPECT_EQ(&v1, &v1.Swap(v2));
+ EXPECT_TRUE(v1.IsObject());
+ EXPECT_TRUE(v2.IsInt());
+ EXPECT_EQ(1234, v2.GetInt());
+
+ // testing std::swap compatibility
+ using std::swap;
+ swap(v1, v2);
+ EXPECT_TRUE(v1.IsInt());
+ EXPECT_TRUE(v2.IsObject());
+}
+
+TEST(Value, Null) {
+ // Default constructor
+ Value x;
+ EXPECT_EQ(kNullType, x.GetType());
+ EXPECT_TRUE(x.IsNull());
+
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsNumber());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // Constructor with type
+ Value y(kNullType);
+ EXPECT_TRUE(y.IsNull());
+
+ // SetNull();
+ Value z(true);
+ z.SetNull();
+ EXPECT_TRUE(z.IsNull());
+}
+
+TEST(Value, True) {
+ // Constructor with bool
+ Value x(true);
+ EXPECT_EQ(kTrueType, x.GetType());
+ EXPECT_TRUE(x.GetBool());
+ EXPECT_TRUE(x.IsBool());
+ EXPECT_TRUE(x.IsTrue());
+
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsNumber());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // Constructor with type
+ Value y(kTrueType);
+ EXPECT_TRUE(y.IsTrue());
+
+ // SetBool()
+ Value z;
+ z.SetBool(true);
+ EXPECT_TRUE(z.IsTrue());
+}
+
+TEST(Value, False) {
+ // Constructor with bool
+ Value x(false);
+ EXPECT_EQ(kFalseType, x.GetType());
+ EXPECT_TRUE(x.IsBool());
+ EXPECT_TRUE(x.IsFalse());
+
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.GetBool());
+ //EXPECT_FALSE((bool)x);
+ EXPECT_FALSE(x.IsNumber());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // Constructor with type
+ Value y(kFalseType);
+ EXPECT_TRUE(y.IsFalse());
+
+ // SetBool()
+ Value z;
+ z.SetBool(false);
+ EXPECT_TRUE(z.IsFalse());
+}
+
+TEST(Value, Int) {
+ // Constructor with int
+ Value x(1234);
+ EXPECT_EQ(kNumberType, x.GetType());
+ EXPECT_EQ(1234, x.GetInt());
+ EXPECT_EQ(1234u, x.GetUint());
+ EXPECT_EQ(1234, x.GetInt64());
+ EXPECT_EQ(1234u, x.GetUint64());
+ EXPECT_NEAR(1234.0, x.GetDouble(), 0.0);
+ //EXPECT_EQ(1234, (int)x);
+ //EXPECT_EQ(1234, (unsigned)x);
+ //EXPECT_EQ(1234, (int64_t)x);
+ //EXPECT_EQ(1234, (uint64_t)x);
+ //EXPECT_EQ(1234, (double)x);
+ EXPECT_TRUE(x.IsNumber());
+ EXPECT_TRUE(x.IsInt());
+ EXPECT_TRUE(x.IsUint());
+ EXPECT_TRUE(x.IsInt64());
+ EXPECT_TRUE(x.IsUint64());
+
+ EXPECT_FALSE(x.IsDouble());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ Value nx(-1234);
+ EXPECT_EQ(-1234, nx.GetInt());
+ EXPECT_EQ(-1234, nx.GetInt64());
+ EXPECT_TRUE(nx.IsInt());
+ EXPECT_TRUE(nx.IsInt64());
+ EXPECT_FALSE(nx.IsUint());
+ EXPECT_FALSE(nx.IsUint64());
+
+ // Constructor with type
+ Value y(kNumberType);
+ EXPECT_TRUE(y.IsNumber());
+ EXPECT_TRUE(y.IsInt());
+ EXPECT_EQ(0, y.GetInt());
+
+ // SetInt()
+ Value z;
+ z.SetInt(1234);
+ EXPECT_EQ(1234, z.GetInt());
+
+ // operator=(int)
+ z = 5678;
+ EXPECT_EQ(5678, z.GetInt());
+}
+
+TEST(Value, Uint) {
+ // Constructor with int
+ Value x(1234u);
+ EXPECT_EQ(kNumberType, x.GetType());
+ EXPECT_EQ(1234, x.GetInt());
+ EXPECT_EQ(1234u, x.GetUint());
+ EXPECT_EQ(1234, x.GetInt64());
+ EXPECT_EQ(1234u, x.GetUint64());
+ EXPECT_TRUE(x.IsNumber());
+ EXPECT_TRUE(x.IsInt());
+ EXPECT_TRUE(x.IsUint());
+ EXPECT_TRUE(x.IsInt64());
+ EXPECT_TRUE(x.IsUint64());
+ EXPECT_NEAR(1234.0, x.GetDouble(), 0.0); // Number can always be cast as double but !IsDouble().
+
+ EXPECT_FALSE(x.IsDouble());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // SetUint()
+ Value z;
+ z.SetUint(1234);
+ EXPECT_EQ(1234u, z.GetUint());
+
+ // operator=(unsigned)
+ z = 5678u;
+ EXPECT_EQ(5678u, z.GetUint());
+
+ z = 2147483648u; // 2^31, cannot cast as int
+ EXPECT_EQ(2147483648u, z.GetUint());
+ EXPECT_FALSE(z.IsInt());
+ EXPECT_TRUE(z.IsInt64()); // Issue 41: Incorrect parsing of unsigned int number types
+}
+
+TEST(Value, Int64) {
+ // Constructor with int
+ Value x(int64_t(1234));
+ EXPECT_EQ(kNumberType, x.GetType());
+ EXPECT_EQ(1234, x.GetInt());
+ EXPECT_EQ(1234u, x.GetUint());
+ EXPECT_EQ(1234, x.GetInt64());
+ EXPECT_EQ(1234u, x.GetUint64());
+ EXPECT_TRUE(x.IsNumber());
+ EXPECT_TRUE(x.IsInt());
+ EXPECT_TRUE(x.IsUint());
+ EXPECT_TRUE(x.IsInt64());
+ EXPECT_TRUE(x.IsUint64());
+
+ EXPECT_FALSE(x.IsDouble());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ Value nx(int64_t(-1234));
+ EXPECT_EQ(-1234, nx.GetInt());
+ EXPECT_EQ(-1234, nx.GetInt64());
+ EXPECT_TRUE(nx.IsInt());
+ EXPECT_TRUE(nx.IsInt64());
+ EXPECT_FALSE(nx.IsUint());
+ EXPECT_FALSE(nx.IsUint64());
+
+ // SetInt64()
+ Value z;
+ z.SetInt64(1234);
+ EXPECT_EQ(1234, z.GetInt64());
+
+ z.SetInt64(2147483648u); // 2^31, cannot cast as int
+ EXPECT_FALSE(z.IsInt());
+ EXPECT_TRUE(z.IsUint());
+ EXPECT_NEAR(2147483648.0, z.GetDouble(), 0.0);
+
+ z.SetInt64(int64_t(4294967295u) + 1); // 2^32, cannot cast as uint
+ EXPECT_FALSE(z.IsInt());
+ EXPECT_FALSE(z.IsUint());
+ EXPECT_NEAR(4294967296.0, z.GetDouble(), 0.0);
+
+ z.SetInt64(-int64_t(2147483648u) - 1); // -2^31-1, cannot cast as int
+ EXPECT_FALSE(z.IsInt());
+ EXPECT_NEAR(-2147483649.0, z.GetDouble(), 0.0);
+
+ z.SetInt64(static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 00000000)));
+ EXPECT_DOUBLE_EQ(-9223372036854775808.0, z.GetDouble());
+}
+
+TEST(Value, Uint64) {
+ // Constructor with int
+ Value x(uint64_t(1234));
+ EXPECT_EQ(kNumberType, x.GetType());
+ EXPECT_EQ(1234, x.GetInt());
+ EXPECT_EQ(1234u, x.GetUint());
+ EXPECT_EQ(1234, x.GetInt64());
+ EXPECT_EQ(1234u, x.GetUint64());
+ EXPECT_TRUE(x.IsNumber());
+ EXPECT_TRUE(x.IsInt());
+ EXPECT_TRUE(x.IsUint());
+ EXPECT_TRUE(x.IsInt64());
+ EXPECT_TRUE(x.IsUint64());
+
+ EXPECT_FALSE(x.IsDouble());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // SetUint64()
+ Value z;
+ z.SetUint64(1234);
+ EXPECT_EQ(1234u, z.GetUint64());
+
+ z.SetUint64(uint64_t(2147483648u)); // 2^31, cannot cast as int
+ EXPECT_FALSE(z.IsInt());
+ EXPECT_TRUE(z.IsUint());
+ EXPECT_TRUE(z.IsInt64());
+
+ z.SetUint64(uint64_t(4294967295u) + 1); // 2^32, cannot cast as uint
+ EXPECT_FALSE(z.IsInt());
+ EXPECT_FALSE(z.IsUint());
+ EXPECT_TRUE(z.IsInt64());
+
+ z.SetUint64(RAPIDJSON_UINT64_C2(0x80000000, 0x00000000)); // 2^63 cannot cast as int64
+ EXPECT_FALSE(z.IsInt64());
+ EXPECT_EQ(RAPIDJSON_UINT64_C2(0x80000000, 0x00000000), z.GetUint64()); // Issue 48
+ EXPECT_DOUBLE_EQ(9223372036854775808.0, z.GetDouble());
+}
+
+TEST(Value, Double) {
+ // Constructor with double
+ Value x(12.34);
+ EXPECT_EQ(kNumberType, x.GetType());
+ EXPECT_NEAR(12.34, x.GetDouble(), 0.0);
+ EXPECT_TRUE(x.IsNumber());
+ EXPECT_TRUE(x.IsDouble());
+
+ EXPECT_FALSE(x.IsInt());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // SetDouble()
+ Value z;
+ z.SetDouble(12.34);
+ EXPECT_NEAR(12.34, z.GetDouble(), 0.0);
+
+ z = 56.78;
+ EXPECT_NEAR(56.78, z.GetDouble(), 0.0);
+}
+
+TEST(Value, Float) {
+ // Constructor with double
+ Value x(12.34f);
+ EXPECT_EQ(kNumberType, x.GetType());
+ EXPECT_NEAR(12.34f, x.GetFloat(), 0.0);
+ EXPECT_TRUE(x.IsNumber());
+ EXPECT_TRUE(x.IsDouble());
+ EXPECT_TRUE(x.IsFloat());
+
+ EXPECT_FALSE(x.IsInt());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ // SetFloat()
+ Value z;
+ z.SetFloat(12.34f);
+ EXPECT_NEAR(12.34f, z.GetFloat(), 0.0f);
+
+ z = 56.78f;
+ EXPECT_NEAR(56.78f, z.GetFloat(), 0.0f);
+}
+
+TEST(Value, IsLosslessDouble) {
+ EXPECT_TRUE(Value(12.34).IsLosslessDouble());
+ EXPECT_TRUE(Value(-123).IsLosslessDouble());
+ EXPECT_TRUE(Value(2147483648u).IsLosslessDouble());
+ EXPECT_TRUE(Value(static_cast<int64_t>(-RAPIDJSON_UINT64_C2(0x40000000, 0x00000000))).IsLosslessDouble());
+ EXPECT_TRUE(Value(RAPIDJSON_UINT64_C2(0xA0000000, 0x00000000)).IsLosslessDouble());
+
+ EXPECT_FALSE(Value(static_cast<int64_t>(-RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble());
+ EXPECT_FALSE(Value(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)).IsLosslessDouble());
+}
+
+TEST(Value, IsLosslessFloat) {
+ EXPECT_TRUE(Value(12.25).IsLosslessFloat());
+ EXPECT_TRUE(Value(-123).IsLosslessFloat());
+ EXPECT_TRUE(Value(2147483648u).IsLosslessFloat());
+ EXPECT_TRUE(Value(3.4028234e38f).IsLosslessFloat());
+ EXPECT_TRUE(Value(-3.4028234e38f).IsLosslessFloat());
+ EXPECT_FALSE(Value(3.4028235e38).IsLosslessFloat());
+ EXPECT_FALSE(Value(0.3).IsLosslessFloat());
+}
+
+TEST(Value, String) {
+ // Construction with const string
+ Value x("Hello", 5); // literal
+ EXPECT_EQ(kStringType, x.GetType());
+ EXPECT_TRUE(x.IsString());
+ EXPECT_STREQ("Hello", x.GetString());
+ EXPECT_EQ(5u, x.GetStringLength());
+
+ EXPECT_FALSE(x.IsNumber());
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsObject());
+ EXPECT_FALSE(x.IsArray());
+
+ static const char cstr[] = "World"; // const array
+ Value(cstr).Swap(x);
+ EXPECT_TRUE(x.IsString());
+ EXPECT_EQ(x.GetString(), cstr);
+ EXPECT_EQ(x.GetStringLength(), sizeof(cstr)-1);
+
+ static char mstr[] = "Howdy"; // non-const array
+ // Value(mstr).Swap(x); // should not compile
+ Value(StringRef(mstr)).Swap(x);
+ EXPECT_TRUE(x.IsString());
+ EXPECT_EQ(x.GetString(), mstr);
+ EXPECT_EQ(x.GetStringLength(), sizeof(mstr)-1);
+ strncpy(mstr,"Hello", sizeof(mstr));
+ EXPECT_STREQ(x.GetString(), "Hello");
+
+ const char* pstr = cstr;
+ //Value(pstr).Swap(x); // should not compile
+ Value(StringRef(pstr)).Swap(x);
+ EXPECT_TRUE(x.IsString());
+ EXPECT_EQ(x.GetString(), cstr);
+ EXPECT_EQ(x.GetStringLength(), sizeof(cstr)-1);
+
+ char* mpstr = mstr;
+ Value(StringRef(mpstr,sizeof(mstr)-1)).Swap(x);
+ EXPECT_TRUE(x.IsString());
+ EXPECT_EQ(x.GetString(), mstr);
+ EXPECT_EQ(x.GetStringLength(), 5u);
+ EXPECT_STREQ(x.GetString(), "Hello");
+
+ // Constructor with copy string
+ MemoryPoolAllocator<> allocator;
+ Value c(x.GetString(), x.GetStringLength(), allocator);
+ EXPECT_NE(x.GetString(), c.GetString());
+ EXPECT_EQ(x.GetStringLength(), c.GetStringLength());
+ EXPECT_STREQ(x.GetString(), c.GetString());
+ //x.SetString("World");
+ x.SetString("World", 5);
+ EXPECT_STREQ("Hello", c.GetString());
+ EXPECT_EQ(5u, c.GetStringLength());
+
+ // Constructor with type
+ Value y(kStringType);
+ EXPECT_TRUE(y.IsString());
+ EXPECT_STREQ("", y.GetString()); // Empty string should be "" instead of 0 (issue 226)
+ EXPECT_EQ(0u, y.GetStringLength());
+
+ // SetConsttring()
+ Value z;
+ z.SetString("Hello");
+ EXPECT_TRUE(x.IsString());
+ z.SetString("Hello", 5);
+ EXPECT_STREQ("Hello", z.GetString());
+ EXPECT_STREQ("Hello", z.GetString());
+ EXPECT_EQ(5u, z.GetStringLength());
+
+ z.SetString("Hello");
+ EXPECT_TRUE(z.IsString());
+ EXPECT_STREQ("Hello", z.GetString());
+
+ //z.SetString(mstr); // should not compile
+ //z.SetString(pstr); // should not compile
+ z.SetString(StringRef(mstr));
+ EXPECT_TRUE(z.IsString());
+ EXPECT_STREQ(z.GetString(), mstr);
+
+ z.SetString(cstr);
+ EXPECT_TRUE(z.IsString());
+ EXPECT_EQ(cstr, z.GetString());
+
+ z = cstr;
+ EXPECT_TRUE(z.IsString());
+ EXPECT_EQ(cstr, z.GetString());
+
+ // SetString()
+ char s[] = "World";
+ Value w;
+ w.SetString(s, static_cast<SizeType>(strlen(s)), allocator);
+ s[0] = '\0';
+ EXPECT_STREQ("World", w.GetString());
+ EXPECT_EQ(5u, w.GetStringLength());
+
+#if RAPIDJSON_HAS_STDSTRING
+ {
+ std::string str = "Hello World";
+ str[5] = '\0';
+ EXPECT_STREQ(str.data(),"Hello"); // embedded '\0'
+ EXPECT_EQ(str.size(), 11u);
+
+ // no copy
+ Value vs0(StringRef(str));
+ EXPECT_TRUE(vs0.IsString());
+ EXPECT_EQ(vs0.GetString(), str.data());
+ EXPECT_EQ(vs0.GetStringLength(), str.size());
+ TestEqual(vs0, str);
+
+ // do copy
+ Value vs1(str, allocator);
+ EXPECT_TRUE(vs1.IsString());
+ EXPECT_NE(vs1.GetString(), str.data());
+ EXPECT_NE(vs1.GetString(), str); // not equal due to embedded '\0'
+ EXPECT_EQ(vs1.GetStringLength(), str.size());
+ TestEqual(vs1, str);
+
+ // SetString
+ str = "World";
+ vs0.SetNull().SetString(str, allocator);
+ EXPECT_TRUE(vs0.IsString());
+ EXPECT_STREQ(vs0.GetString(), str.c_str());
+ EXPECT_EQ(vs0.GetStringLength(), str.size());
+ TestEqual(str, vs0);
+ TestUnequal(str, vs1);
+
+ // vs1 = str; // should not compile
+ vs1 = StringRef(str);
+ TestEqual(str, vs1);
+ TestEqual(vs0, vs1);
+ }
+#endif // RAPIDJSON_HAS_STDSTRING
+}
+
+// Issue 226: Value of string type should not point to NULL
+TEST(Value, SetStringNullException) {
+ Value v;
+ EXPECT_THROW(v.SetString(0, 0), AssertException);
+}
+
+TEST(Value, Array) {
+ Value x(kArrayType);
+ const Value& y = x;
+ Value::AllocatorType allocator;
+
+ EXPECT_EQ(kArrayType, x.GetType());
+ EXPECT_TRUE(x.IsArray());
+ EXPECT_TRUE(x.Empty());
+ EXPECT_EQ(0u, x.Size());
+ EXPECT_TRUE(y.IsArray());
+ EXPECT_TRUE(y.Empty());
+ EXPECT_EQ(0u, y.Size());
+
+ EXPECT_FALSE(x.IsNull());
+ EXPECT_FALSE(x.IsBool());
+ EXPECT_FALSE(x.IsFalse());
+ EXPECT_FALSE(x.IsTrue());
+ EXPECT_FALSE(x.IsString());
+ EXPECT_FALSE(x.IsObject());
+
+ // PushBack()
+ Value v;
+ x.PushBack(v, allocator);
+ v.SetBool(true);
+ x.PushBack(v, allocator);
+ v.SetBool(false);
+ x.PushBack(v, allocator);
+ v.SetInt(123);
+ x.PushBack(v, allocator);
+ //x.PushBack((const char*)"foo", allocator); // should not compile
+ x.PushBack("foo", allocator);
+
+ EXPECT_FALSE(x.Empty());
+ EXPECT_EQ(5u, x.Size());
+ EXPECT_FALSE(y.Empty());
+ EXPECT_EQ(5u, y.Size());
+ EXPECT_TRUE(x[SizeType(0)].IsNull());
+ EXPECT_TRUE(x[1].IsTrue());
+ EXPECT_TRUE(x[2].IsFalse());
+ EXPECT_TRUE(x[3].IsInt());
+ EXPECT_EQ(123, x[3].GetInt());
+ EXPECT_TRUE(y[SizeType(0)].IsNull());
+ EXPECT_TRUE(y[1].IsTrue());
+ EXPECT_TRUE(y[2].IsFalse());
+ EXPECT_TRUE(y[3].IsInt());
+ EXPECT_EQ(123, y[3].GetInt());
+ EXPECT_TRUE(y[4].IsString());
+ EXPECT_STREQ("foo", y[4].GetString());
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ // PushBack(GenericValue&&, Allocator&);
+ {
+ Value y2(kArrayType);
+ y2.PushBack(Value(true), allocator);
+ y2.PushBack(std::move(Value(kArrayType).PushBack(Value(1), allocator).PushBack("foo", allocator)), allocator);
+ EXPECT_EQ(2u, y2.Size());
+ EXPECT_TRUE(y2[0].IsTrue());
+ EXPECT_TRUE(y2[1].IsArray());
+ EXPECT_EQ(2u, y2[1].Size());
+ EXPECT_TRUE(y2[1][0].IsInt());
+ EXPECT_TRUE(y2[1][1].IsString());
+ }
+#endif
+
+ // iterator
+ Value::ValueIterator itr = x.Begin();
+ EXPECT_TRUE(itr != x.End());
+ EXPECT_TRUE(itr->IsNull());
+ ++itr;
+ EXPECT_TRUE(itr != x.End());
+ EXPECT_TRUE(itr->IsTrue());
+ ++itr;
+ EXPECT_TRUE(itr != x.End());
+ EXPECT_TRUE(itr->IsFalse());
+ ++itr;
+ EXPECT_TRUE(itr != x.End());
+ EXPECT_TRUE(itr->IsInt());
+ EXPECT_EQ(123, itr->GetInt());
+ ++itr;
+ EXPECT_TRUE(itr != x.End());
+ EXPECT_TRUE(itr->IsString());
+ EXPECT_STREQ("foo", itr->GetString());
+
+ // const iterator
+ Value::ConstValueIterator citr = y.Begin();
+ EXPECT_TRUE(citr != y.End());
+ EXPECT_TRUE(citr->IsNull());
+ ++citr;
+ EXPECT_TRUE(citr != y.End());
+ EXPECT_TRUE(citr->IsTrue());
+ ++citr;
+ EXPECT_TRUE(citr != y.End());
+ EXPECT_TRUE(citr->IsFalse());
+ ++citr;
+ EXPECT_TRUE(citr != y.End());
+ EXPECT_TRUE(citr->IsInt());
+ EXPECT_EQ(123, citr->GetInt());
+ ++citr;
+ EXPECT_TRUE(citr != y.End());
+ EXPECT_TRUE(citr->IsString());
+ EXPECT_STREQ("foo", citr->GetString());
+
+ // PopBack()
+ x.PopBack();
+ EXPECT_EQ(4u, x.Size());
+ EXPECT_TRUE(y[SizeType(0)].IsNull());
+ EXPECT_TRUE(y[1].IsTrue());
+ EXPECT_TRUE(y[2].IsFalse());
+ EXPECT_TRUE(y[3].IsInt());
+
+ // Clear()
+ x.Clear();
+ EXPECT_TRUE(x.Empty());
+ EXPECT_EQ(0u, x.Size());
+ EXPECT_TRUE(y.Empty());
+ EXPECT_EQ(0u, y.Size());
+
+ // Erase(ValueIterator)
+
+ // Use array of array to ensure removed elements' destructor is called.
+ // [[0],[1],[2],...]
+ for (int i = 0; i < 10; i++)
+ x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
+
+ // Erase the first
+ itr = x.Erase(x.Begin());
+ EXPECT_EQ(x.Begin(), itr);
+ EXPECT_EQ(9u, x.Size());
+ for (int i = 0; i < 9; i++)
+ EXPECT_EQ(i + 1, x[static_cast<SizeType>(i)][0].GetInt());
+
+ // Ease the last
+ itr = x.Erase(x.End() - 1);
+ EXPECT_EQ(x.End(), itr);
+ EXPECT_EQ(8u, x.Size());
+ for (int i = 0; i < 8; i++)
+ EXPECT_EQ(i + 1, x[static_cast<SizeType>(i)][0].GetInt());
+
+ // Erase the middle
+ itr = x.Erase(x.Begin() + 4);
+ EXPECT_EQ(x.Begin() + 4, itr);
+ EXPECT_EQ(7u, x.Size());
+ for (int i = 0; i < 4; i++)
+ EXPECT_EQ(i + 1, x[static_cast<SizeType>(i)][0].GetInt());
+ for (int i = 4; i < 7; i++)
+ EXPECT_EQ(i + 2, x[static_cast<SizeType>(i)][0].GetInt());
+
+ // Erase(ValueIterator, ValueIterator)
+ // Exhaustive test with all 0 <= first < n, first <= last <= n cases
+ const unsigned n = 10;
+ for (unsigned first = 0; first < n; first++) {
+ for (unsigned last = first; last <= n; last++) {
+ x.Clear();
+ for (unsigned i = 0; i < n; i++)
+ x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
+
+ itr = x.Erase(x.Begin() + first, x.Begin() + last);
+ if (last == n)
+ EXPECT_EQ(x.End(), itr);
+ else
+ EXPECT_EQ(x.Begin() + first, itr);
+
+ size_t removeCount = last - first;
+ EXPECT_EQ(n - removeCount, x.Size());
+ for (unsigned i = 0; i < first; i++)
+ EXPECT_EQ(i, x[i][0].GetUint());
+ for (unsigned i = first; i < n - removeCount; i++)
+ EXPECT_EQ(i + removeCount, x[static_cast<SizeType>(i)][0].GetUint());
+ }
+ }
+
+ // Working in gcc without C++11, but VS2013 cannot compile. To be diagnosed.
+ // http://en.wikipedia.org/wiki/Erase-remove_idiom
+ x.Clear();
+ for (int i = 0; i < 10; i++)
+ if (i % 2 == 0)
+ x.PushBack(i, allocator);
+ else
+ x.PushBack(Value(kNullType).Move(), allocator);
+
+ const Value null(kNullType);
+ x.Erase(std::remove(x.Begin(), x.End(), null), x.End());
+ EXPECT_EQ(5u, x.Size());
+ for (int i = 0; i < 5; i++)
+ EXPECT_EQ(i * 2, x[static_cast<SizeType>(i)]);
+
+ // SetArray()
+ Value z;
+ z.SetArray();
+ EXPECT_TRUE(z.IsArray());
+ EXPECT_TRUE(z.Empty());
+}
+
+TEST(Value, Object) {
+ Value x(kObjectType);
+ const Value& y = x; // const version
+ Value::AllocatorType allocator;
+
+ EXPECT_EQ(kObjectType, x.GetType());
+ EXPECT_TRUE(x.IsObject());
+ EXPECT_TRUE(x.ObjectEmpty());
+ EXPECT_EQ(0u, x.MemberCount());
+ EXPECT_EQ(kObjectType, y.GetType());
+ EXPECT_TRUE(y.IsObject());
+ EXPECT_TRUE(y.ObjectEmpty());
+ EXPECT_EQ(0u, y.MemberCount());
+
+ // AddMember()
+ x.AddMember("A", "Apple", allocator);
+ EXPECT_FALSE(x.ObjectEmpty());
+ EXPECT_EQ(1u, x.MemberCount());
+
+ Value value("Banana", 6);
+ x.AddMember("B", "Banana", allocator);
+ EXPECT_EQ(2u, x.MemberCount());
+
+ // AddMember<T>(StringRefType, T, Allocator)
+ {
+ Value o(kObjectType);
+ o.AddMember("true", true, allocator);
+ o.AddMember("false", false, allocator);
+ o.AddMember("int", -1, allocator);
+ o.AddMember("uint", 1u, allocator);
+ o.AddMember("int64", int64_t(-4294967296), allocator);
+ o.AddMember("uint64", uint64_t(4294967296), allocator);
+ o.AddMember("double", 3.14, allocator);
+ o.AddMember("string", "Jelly", allocator);
+
+ EXPECT_TRUE(o["true"].GetBool());
+ EXPECT_FALSE(o["false"].GetBool());
+ EXPECT_EQ(-1, o["int"].GetInt());
+ EXPECT_EQ(1u, o["uint"].GetUint());
+ EXPECT_EQ(int64_t(-4294967296), o["int64"].GetInt64());
+ EXPECT_EQ(uint64_t(4294967296), o["uint64"].GetUint64());
+ EXPECT_STREQ("Jelly",o["string"].GetString());
+ EXPECT_EQ(8u, o.MemberCount());
+ }
+
+ // AddMember<T>(Value&, T, Allocator)
+ {
+ Value o(kObjectType);
+
+ Value n("s");
+ o.AddMember(n, "string", allocator);
+ EXPECT_EQ(1u, o.MemberCount());
+
+ Value count("#");
+ o.AddMember(count, o.MemberCount(), allocator);
+ EXPECT_EQ(2u, o.MemberCount());
+ }
+
+#if RAPIDJSON_HAS_STDSTRING
+ {
+ // AddMember(StringRefType, const std::string&, Allocator)
+ Value o(kObjectType);
+ o.AddMember("b", std::string("Banana"), allocator);
+ EXPECT_STREQ("Banana", o["b"].GetString());
+
+ // RemoveMember(const std::string&)
+ o.RemoveMember(std::string("b"));
+ EXPECT_TRUE(o.ObjectEmpty());
+ }
+#endif
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+ // AddMember(GenericValue&&, ...) variants
+ {
+ Value o(kObjectType);
+ o.AddMember(Value("true"), Value(true), allocator);
+ o.AddMember(Value("false"), Value(false).Move(), allocator); // value is lvalue ref
+ o.AddMember(Value("int").Move(), Value(-1), allocator); // name is lvalue ref
+ o.AddMember("uint", std::move(Value().SetUint(1u)), allocator); // name is literal, value is rvalue
+ EXPECT_TRUE(o["true"].GetBool());
+ EXPECT_FALSE(o["false"].GetBool());
+ EXPECT_EQ(-1, o["int"].GetInt());
+ EXPECT_EQ(1u, o["uint"].GetUint());
+ EXPECT_EQ(4u, o.MemberCount());
+ }
+#endif
+
+ // Tests a member with null character
+ Value name;
+ const Value C0D("C\0D", 3);
+ name.SetString(C0D.GetString(), 3);
+ value.SetString("CherryD", 7);
+ x.AddMember(name, value, allocator);
+
+ // HasMember()
+ EXPECT_TRUE(x.HasMember("A"));
+ EXPECT_TRUE(x.HasMember("B"));
+ EXPECT_TRUE(y.HasMember("A"));
+ EXPECT_TRUE(y.HasMember("B"));
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_TRUE(x.HasMember(std::string("A")));
+#endif
+
+ name.SetString("C\0D");
+ EXPECT_TRUE(x.HasMember(name));
+ EXPECT_TRUE(y.HasMember(name));
+
+ GenericValue<UTF8<>, CrtAllocator> othername("A");
+ EXPECT_TRUE(x.HasMember(othername));
+ EXPECT_TRUE(y.HasMember(othername));
+ othername.SetString("C\0D");
+ EXPECT_TRUE(x.HasMember(othername));
+ EXPECT_TRUE(y.HasMember(othername));
+
+ // operator[]
+ EXPECT_STREQ("Apple", x["A"].GetString());
+ EXPECT_STREQ("Banana", x["B"].GetString());
+ EXPECT_STREQ("CherryD", x[C0D].GetString());
+ EXPECT_STREQ("CherryD", x[othername].GetString());
+ EXPECT_THROW(x["nonexist"], AssertException);
+
+ // const operator[]
+ EXPECT_STREQ("Apple", y["A"].GetString());
+ EXPECT_STREQ("Banana", y["B"].GetString());
+ EXPECT_STREQ("CherryD", y[C0D].GetString());
+
+#if RAPIDJSON_HAS_STDSTRING
+ EXPECT_STREQ("Apple", x["A"].GetString());
+ EXPECT_STREQ("Apple", y[std::string("A")].GetString());
+#endif
+
+ // member iterator
+ Value::MemberIterator itr = x.MemberBegin();
+ EXPECT_TRUE(itr != x.MemberEnd());
+ EXPECT_STREQ("A", itr->name.GetString());
+ EXPECT_STREQ("Apple", itr->value.GetString());
+ ++itr;
+ EXPECT_TRUE(itr != x.MemberEnd());
+ EXPECT_STREQ("B", itr->name.GetString());
+ EXPECT_STREQ("Banana", itr->value.GetString());
+ ++itr;
+ EXPECT_TRUE(itr != x.MemberEnd());
+ EXPECT_TRUE(memcmp(itr->name.GetString(), "C\0D", 4) == 0);
+ EXPECT_STREQ("CherryD", itr->value.GetString());
+ ++itr;
+ EXPECT_FALSE(itr != x.MemberEnd());
+
+ // const member iterator
+ Value::ConstMemberIterator citr = y.MemberBegin();
+ EXPECT_TRUE(citr != y.MemberEnd());
+ EXPECT_STREQ("A", citr->name.GetString());
+ EXPECT_STREQ("Apple", citr->value.GetString());
+ ++citr;
+ EXPECT_TRUE(citr != y.MemberEnd());
+ EXPECT_STREQ("B", citr->name.GetString());
+ EXPECT_STREQ("Banana", citr->value.GetString());
+ ++citr;
+ EXPECT_TRUE(citr != y.MemberEnd());
+ EXPECT_TRUE(memcmp(citr->name.GetString(), "C\0D", 4) == 0);
+ EXPECT_STREQ("CherryD", citr->value.GetString());
+ ++citr;
+ EXPECT_FALSE(citr != y.MemberEnd());
+
+ // member iterator conversions/relations
+ itr = x.MemberBegin();
+ citr = x.MemberBegin(); // const conversion
+ TestEqual(itr, citr);
+ EXPECT_TRUE(itr < x.MemberEnd());
+ EXPECT_FALSE(itr > y.MemberEnd());
+ EXPECT_TRUE(citr < x.MemberEnd());
+ EXPECT_FALSE(citr > y.MemberEnd());
+ ++citr;
+ TestUnequal(itr, citr);
+ EXPECT_FALSE(itr < itr);
+ EXPECT_TRUE(itr < citr);
+ EXPECT_FALSE(itr > itr);
+ EXPECT_TRUE(citr > itr);
+ EXPECT_EQ(1, citr - x.MemberBegin());
+ EXPECT_EQ(0, itr - y.MemberBegin());
+ itr += citr - x.MemberBegin();
+ EXPECT_EQ(1, itr - y.MemberBegin());
+ TestEqual(citr, itr);
+ EXPECT_TRUE(itr <= citr);
+ EXPECT_TRUE(citr <= itr);
+ itr++;
+ EXPECT_TRUE(itr >= citr);
+ EXPECT_FALSE(citr >= itr);
+
+ // RemoveMember()
+ EXPECT_TRUE(x.RemoveMember("A"));
+ EXPECT_FALSE(x.HasMember("A"));
+
+ EXPECT_TRUE(x.RemoveMember("B"));
+ EXPECT_FALSE(x.HasMember("B"));
+
+ EXPECT_FALSE(x.RemoveMember("nonexist"));
+
+ EXPECT_TRUE(x.RemoveMember(othername));
+ EXPECT_FALSE(x.HasMember(name));
+
+ EXPECT_TRUE(x.MemberBegin() == x.MemberEnd());
+
+ // EraseMember(ConstMemberIterator)
+
+ // Use array members to ensure removed elements' destructor is called.
+ // { "a": [0], "b": [1],[2],...]
+ const char keys[][2] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
+ for (int i = 0; i < 10; i++)
+ x.AddMember(keys[i], Value(kArrayType).PushBack(i, allocator), allocator);
+
+ // MemberCount, iterator difference
+ EXPECT_EQ(x.MemberCount(), SizeType(x.MemberEnd() - x.MemberBegin()));
+
+ // Erase the first
+ itr = x.EraseMember(x.MemberBegin());
+ EXPECT_FALSE(x.HasMember(keys[0]));
+ EXPECT_EQ(x.MemberBegin(), itr);
+ EXPECT_EQ(9u, x.MemberCount());
+ for (; itr != x.MemberEnd(); ++itr) {
+ size_t i = static_cast<size_t>((itr - x.MemberBegin())) + 1;
+ EXPECT_STREQ(itr->name.GetString(), keys[i]);
+ EXPECT_EQ(i, itr->value[0].GetInt());
+ }
+
+ // Erase the last
+ itr = x.EraseMember(x.MemberEnd() - 1);
+ EXPECT_FALSE(x.HasMember(keys[9]));
+ EXPECT_EQ(x.MemberEnd(), itr);
+ EXPECT_EQ(8u, x.MemberCount());
+ for (; itr != x.MemberEnd(); ++itr) {
+ size_t i = static_cast<size_t>(itr - x.MemberBegin()) + 1;
+ EXPECT_STREQ(itr->name.GetString(), keys[i]);
+ EXPECT_EQ(i, itr->value[0].GetInt());
+ }
+
+ // Erase the middle
+ itr = x.EraseMember(x.MemberBegin() + 4);
+ EXPECT_FALSE(x.HasMember(keys[5]));
+ EXPECT_EQ(x.MemberBegin() + 4, itr);
+ EXPECT_EQ(7u, x.MemberCount());
+ for (; itr != x.MemberEnd(); ++itr) {
+ size_t i = static_cast<size_t>(itr - x.MemberBegin());
+ i += (i < 4) ? 1 : 2;
+ EXPECT_STREQ(itr->name.GetString(), keys[i]);
+ EXPECT_EQ(i, itr->value[0].GetInt());
+ }
+
+ // EraseMember(ConstMemberIterator, ConstMemberIterator)
+ // Exhaustive test with all 0 <= first < n, first <= last <= n cases
+ const unsigned n = 10;
+ for (unsigned first = 0; first < n; first++) {
+ for (unsigned last = first; last <= n; last++) {
+ Value(kObjectType).Swap(x);
+ for (unsigned i = 0; i < n; i++)
+ x.AddMember(keys[i], Value(kArrayType).PushBack(i, allocator), allocator);
+
+ itr = x.EraseMember(x.MemberBegin() + static_cast<int>(first), x.MemberBegin() + static_cast<int>(last));
+ if (last == n)
+ EXPECT_EQ(x.MemberEnd(), itr);
+ else
+ EXPECT_EQ(x.MemberBegin() + static_cast<int>(first), itr);
+
+ size_t removeCount = last - first;
+ EXPECT_EQ(n - removeCount, x.MemberCount());
+ for (unsigned i = 0; i < first; i++)
+ EXPECT_EQ(i, x[keys[i]][0].GetUint());
+ for (unsigned i = first; i < n - removeCount; i++)
+ EXPECT_EQ(i + removeCount, x[keys[i+removeCount]][0].GetUint());
+ }
+ }
+
+ // RemoveAllMembers()
+ x.RemoveAllMembers();
+ EXPECT_TRUE(x.ObjectEmpty());
+ EXPECT_EQ(0u, x.MemberCount());
+
+ // SetObject()
+ Value z;
+ z.SetObject();
+ EXPECT_TRUE(z.IsObject());
+}
+
+TEST(Value, EraseMember_String) {
+ Value::AllocatorType allocator;
+ Value x(kObjectType);
+ x.AddMember("A", "Apple", allocator);
+ x.AddMember("B", "Banana", allocator);
+
+ EXPECT_TRUE(x.EraseMember("B"));
+ EXPECT_FALSE(x.HasMember("B"));
+
+ EXPECT_FALSE(x.EraseMember("nonexist"));
+
+ GenericValue<UTF8<>, CrtAllocator> othername("A");
+ EXPECT_TRUE(x.EraseMember(othername));
+ EXPECT_FALSE(x.HasMember("A"));
+
+ EXPECT_TRUE(x.MemberBegin() == x.MemberEnd());
+}
+
+TEST(Value, BigNestedArray) {
+ MemoryPoolAllocator<> allocator;
+ Value x(kArrayType);
+ static const SizeType n = 200;
+
+ for (SizeType i = 0; i < n; i++) {
+ Value y(kArrayType);
+ for (SizeType j = 0; j < n; j++) {
+ Value number(static_cast<int>(i * n + j));
+ y.PushBack(number, allocator);
+ }
+ x.PushBack(y, allocator);
+ }
+
+ for (SizeType i = 0; i < n; i++)
+ for (SizeType j = 0; j < n; j++) {
+ EXPECT_TRUE(x[i][j].IsInt());
+ EXPECT_EQ(static_cast<int>(i * n + j), x[i][j].GetInt());
+ }
+}
+
+TEST(Value, BigNestedObject) {
+ MemoryPoolAllocator<> allocator;
+ Value x(kObjectType);
+ static const SizeType n = 200;
+
+ for (SizeType i = 0; i < n; i++) {
+ char name1[10];
+ sprintf(name1, "%d", i);
+
+ // Value name(name1); // should not compile
+ Value name(name1, static_cast<SizeType>(strlen(name1)), allocator);
+ Value object(kObjectType);
+
+ for (SizeType j = 0; j < n; j++) {
+ char name2[10];
+ sprintf(name2, "%d", j);
+
+ Value name3(name2, static_cast<SizeType>(strlen(name2)), allocator);
+ Value number(static_cast<int>(i * n + j));
+ object.AddMember(name3, number, allocator);
+ }
+
+ // x.AddMember(name1, object, allocator); // should not compile
+ x.AddMember(name, object, allocator);
+ }
+
+ for (SizeType i = 0; i < n; i++) {
+ char name1[10];
+ sprintf(name1, "%d", i);
+
+ for (SizeType j = 0; j < n; j++) {
+ char name2[10];
+ sprintf(name2, "%d", j);
+ x[name1];
+ EXPECT_EQ(static_cast<int>(i * n + j), x[name1][name2].GetInt());
+ }
+ }
+}
+
+// Issue 18: Error removing last element of object
+// http://code.google.com/p/rapidjson/issues/detail?id=18
+TEST(Value, RemoveLastElement) {
+ rapidjson::Document doc;
+ rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
+ rapidjson::Value objVal(rapidjson::kObjectType);
+ objVal.AddMember("var1", 123, allocator);
+ objVal.AddMember("var2", "444", allocator);
+ objVal.AddMember("var3", 555, allocator);
+ EXPECT_TRUE(objVal.HasMember("var3"));
+ objVal.RemoveMember("var3"); // Assertion here in r61
+ EXPECT_FALSE(objVal.HasMember("var3"));
+}
+
+// Issue 38: Segmentation fault with CrtAllocator
+TEST(Document, CrtAllocator) {
+ typedef GenericValue<UTF8<>, CrtAllocator> V;
+
+ V::AllocatorType allocator;
+ V o(kObjectType);
+ o.AddMember("x", 1, allocator); // Should not call destructor on uninitialized name/value of newly allocated members.
+
+ V a(kArrayType);
+ a.PushBack(1, allocator); // Should not call destructor on uninitialized Value of newly allocated elements.
+}
+
+static void TestShortStringOptimization(const char* str) {
+ const rapidjson::SizeType len = static_cast<rapidjson::SizeType>(strlen(str));
+
+ rapidjson::Document doc;
+ rapidjson::Value val;
+ val.SetString(str, len, doc.GetAllocator());
+
+ EXPECT_EQ(val.GetStringLength(), len);
+ EXPECT_STREQ(val.GetString(), str);
+}
+
+TEST(Value, AllocateShortString) {
+ TestShortStringOptimization(""); // edge case: empty string
+ TestShortStringOptimization("12345678"); // regular case for short strings: 8 chars
+ TestShortStringOptimization("12345678901"); // edge case: 11 chars in 32-bit mode (=> short string)
+ TestShortStringOptimization("123456789012"); // edge case: 12 chars in 32-bit mode (=> regular string)
+ TestShortStringOptimization("123456789012345"); // edge case: 15 chars in 64-bit mode (=> short string)
+ TestShortStringOptimization("1234567890123456"); // edge case: 16 chars in 64-bit mode (=> regular string)
+}
+
+template <int e>
+struct TerminateHandler {
+ bool Null() { return e != 0; }
+ bool Bool(bool) { return e != 1; }
+ bool Int(int) { return e != 2; }
+ bool Uint(unsigned) { return e != 3; }
+ bool Int64(int64_t) { return e != 4; }
+ bool Uint64(uint64_t) { return e != 5; }
+ bool Double(double) { return e != 6; }
+ bool String(const char*, SizeType, bool) { return e != 7; }
+ bool StartObject() { return e != 8; }
+ bool Key(const char*, SizeType, bool) { return e != 9; }
+ bool EndObject(SizeType) { return e != 10; }
+ bool StartArray() { return e != 11; }
+ bool EndArray(SizeType) { return e != 12; }
+};
+
+#define TEST_TERMINATION(e, json)\
+{\
+ Document d; \
+ EXPECT_FALSE(d.Parse(json).HasParseError()); \
+ Reader reader; \
+ TerminateHandler<e> h;\
+ EXPECT_FALSE(d.Accept(h));\
+}
+
+TEST(Value, AcceptTerminationByHandler) {
+ TEST_TERMINATION(0, "[null]");
+ TEST_TERMINATION(1, "[true]");
+ TEST_TERMINATION(1, "[false]");
+ TEST_TERMINATION(2, "[-1]");
+ TEST_TERMINATION(3, "[2147483648]");
+ TEST_TERMINATION(4, "[-1234567890123456789]");
+ TEST_TERMINATION(5, "[9223372036854775808]");
+ TEST_TERMINATION(6, "[0.5]");
+ TEST_TERMINATION(7, "[\"a\"]");
+ TEST_TERMINATION(8, "[{}]");
+ TEST_TERMINATION(9, "[{\"a\":1}]");
+ TEST_TERMINATION(10, "[{}]");
+ TEST_TERMINATION(11, "{\"a\":[]}");
+ TEST_TERMINATION(12, "{\"a\":[]}");
+}
+
+struct ValueIntComparer {
+ bool operator()(const Value& lhs, const Value& rhs) const {
+ return lhs.GetInt() < rhs.GetInt();
+ }
+};
+
+#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
+TEST(Value, Sorting) {
+ Value::AllocatorType allocator;
+ Value a(kArrayType);
+ a.PushBack(5, allocator);
+ a.PushBack(1, allocator);
+ a.PushBack(3, allocator);
+ std::sort(a.Begin(), a.End(), ValueIntComparer());
+ EXPECT_EQ(1, a[0].GetInt());
+ EXPECT_EQ(3, a[1].GetInt());
+ EXPECT_EQ(5, a[2].GetInt());
+}
+#endif
+
+// http://stackoverflow.com/questions/35222230/
+
+static void MergeDuplicateKey(Value& v, Value::AllocatorType& a) {
+ if (v.IsObject()) {
+ // Convert all key:value into key:[value]
+ for (Value::MemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr)
+ itr->value = Value(kArrayType).Move().PushBack(itr->value, a);
+
+ // Merge arrays if key is duplicated
+ for (Value::MemberIterator itr = v.MemberBegin(); itr != v.MemberEnd();) {
+ Value::MemberIterator itr2 = v.FindMember(itr->name);
+ if (itr != itr2) {
+ itr2->value.PushBack(itr->value[0], a);
+ itr = v.EraseMember(itr);
+ }
+ else
+ ++itr;
+ }
+
+ // Convert key:[values] back to key:value if there is only one value
+ for (Value::MemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) {
+ if (itr->value.Size() == 1)
+ itr->value = itr->value[0];
+ MergeDuplicateKey(itr->value, a); // Recursion on the value
+ }
+ }
+ else if (v.IsArray())
+ for (Value::ValueIterator itr = v.Begin(); itr != v.End(); ++itr)
+ MergeDuplicateKey(*itr, a);
+}
+
+TEST(Value, MergeDuplicateKey) {
+ Document d;
+ d.Parse(
+ "{"
+ " \"key1\": {"
+ " \"a\": \"asdf\","
+ " \"b\": \"foo\","
+ " \"b\": \"bar\","
+ " \"c\": \"fdas\""
+ " }"
+ "}");
+
+ Document d2;
+ d2.Parse(
+ "{"
+ " \"key1\": {"
+ " \"a\": \"asdf\","
+ " \"b\": ["
+ " \"foo\","
+ " \"bar\""
+ " ],"
+ " \"c\": \"fdas\""
+ " }"
+ "}");
+
+ EXPECT_NE(d2, d);
+ MergeDuplicateKey(d, d.GetAllocator());
+ EXPECT_EQ(d2, d);
+}
+
+#ifdef __clang__
+RAPIDJSON_DIAG_POP
+#endif
diff --git a/3rdparty/rapidjson/test/unittest/writertest.cpp b/3rdparty/rapidjson/test/unittest/writertest.cpp
new file mode 100644
index 00000000000..238aa79e72e
--- /dev/null
+++ b/3rdparty/rapidjson/test/unittest/writertest.cpp
@@ -0,0 +1,441 @@
+// Tencent is pleased to support the open source community by making RapidJSON available.
+//
+// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
+//
+// Licensed under the MIT License (the "License"); you may not use this file except
+// in compliance with the License. You may obtain a copy of the License at
+//
+// http://opensource.org/licenses/MIT
+//
+// Unless required by applicable law or agreed to in writing, software distributed
+// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+// CONDITIONS OF ANY KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations under the License.
+
+#include "unittest.h"
+
+#include "rapidjson/document.h"
+#include "rapidjson/reader.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/stringbuffer.h"
+
+using namespace rapidjson;
+
+TEST(Writer, Compact) {
+ StringStream s("{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ");
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ buffer.ShrinkToFit();
+ Reader reader;
+ reader.Parse<0>(s, writer);
+ EXPECT_STREQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3]}", buffer.GetString());
+ EXPECT_EQ(77u, buffer.GetSize());
+ EXPECT_TRUE(writer.IsComplete());
+}
+
+// json -> parse -> writer -> json
+#define TEST_ROUNDTRIP(json) \
+ { \
+ StringStream s(json); \
+ StringBuffer buffer; \
+ Writer<StringBuffer> writer(buffer); \
+ Reader reader; \
+ reader.Parse<kParseFullPrecisionFlag>(s, writer); \
+ EXPECT_STREQ(json, buffer.GetString()); \
+ EXPECT_TRUE(writer.IsComplete()); \
+ }
+
+TEST(Writer, Root) {
+ TEST_ROUNDTRIP("null");
+ TEST_ROUNDTRIP("true");
+ TEST_ROUNDTRIP("false");
+ TEST_ROUNDTRIP("0");
+ TEST_ROUNDTRIP("\"foo\"");
+ TEST_ROUNDTRIP("[]");
+ TEST_ROUNDTRIP("{}");
+}
+
+TEST(Writer, Int) {
+ TEST_ROUNDTRIP("[-1]");
+ TEST_ROUNDTRIP("[-123]");
+ TEST_ROUNDTRIP("[-2147483648]");
+}
+
+TEST(Writer, UInt) {
+ TEST_ROUNDTRIP("[0]");
+ TEST_ROUNDTRIP("[1]");
+ TEST_ROUNDTRIP("[123]");
+ TEST_ROUNDTRIP("[2147483647]");
+ TEST_ROUNDTRIP("[4294967295]");
+}
+
+TEST(Writer, Int64) {
+ TEST_ROUNDTRIP("[-1234567890123456789]");
+ TEST_ROUNDTRIP("[-9223372036854775808]");
+}
+
+TEST(Writer, Uint64) {
+ TEST_ROUNDTRIP("[1234567890123456789]");
+ TEST_ROUNDTRIP("[9223372036854775807]");
+}
+
+TEST(Writer, String) {
+ TEST_ROUNDTRIP("[\"Hello\"]");
+ TEST_ROUNDTRIP("[\"Hello\\u0000World\"]");
+ TEST_ROUNDTRIP("[\"\\\"\\\\/\\b\\f\\n\\r\\t\"]");
+
+#if RAPIDJSON_HAS_STDSTRING
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.String(std::string("Hello\n"));
+ EXPECT_STREQ("\"Hello\\n\"", buffer.GetString());
+ }
+#endif
+}
+
+TEST(Writer, Double) {
+ TEST_ROUNDTRIP("[1.2345,1.2345678,0.123456789012,1234567.8]");
+ TEST_ROUNDTRIP("0.0");
+ TEST_ROUNDTRIP("-0.0"); // Issue #289
+ TEST_ROUNDTRIP("1e30");
+ TEST_ROUNDTRIP("1.0");
+ TEST_ROUNDTRIP("5e-324"); // Min subnormal positive double
+ TEST_ROUNDTRIP("2.225073858507201e-308"); // Max subnormal positive double
+ TEST_ROUNDTRIP("2.2250738585072014e-308"); // Min normal positive double
+ TEST_ROUNDTRIP("1.7976931348623157e308"); // Max double
+
+}
+
+TEST(Writer, Transcode) {
+ const char json[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3],\"dollar\":\"\x24\",\"cents\":\"\xC2\xA2\",\"euro\":\"\xE2\x82\xAC\",\"gclef\":\"\xF0\x9D\x84\x9E\"}";
+
+ // UTF8 -> UTF16 -> UTF8
+ {
+ StringStream s(json);
+ StringBuffer buffer;
+ Writer<StringBuffer, UTF16<>, UTF8<> > writer(buffer);
+ GenericReader<UTF8<>, UTF16<> > reader;
+ reader.Parse(s, writer);
+ EXPECT_STREQ(json, buffer.GetString());
+ }
+
+ // UTF8 -> UTF8 -> ASCII -> UTF8 -> UTF8
+ {
+ StringStream s(json);
+ StringBuffer buffer;
+ Writer<StringBuffer, UTF8<>, ASCII<> > writer(buffer);
+ Reader reader;
+ reader.Parse(s, writer);
+
+ StringBuffer buffer2;
+ Writer<StringBuffer> writer2(buffer2);
+ GenericReader<ASCII<>, UTF8<> > reader2;
+ StringStream s2(buffer.GetString());
+ reader2.Parse(s2, writer2);
+
+ EXPECT_STREQ(json, buffer2.GetString());
+ }
+}
+
+#include <sstream>
+
+class OStreamWrapper {
+public:
+ typedef char Ch;
+
+ OStreamWrapper(std::ostream& os) : os_(os) {}
+
+ Ch Peek() const { assert(false); return '\0'; }
+ Ch Take() { assert(false); return '\0'; }
+ size_t Tell() const { return 0; }
+
+ Ch* PutBegin() { assert(false); return 0; }
+ void Put(Ch c) { os_.put(c); }
+ void Flush() { os_.flush(); }
+ size_t PutEnd(Ch*) { assert(false); return 0; }
+
+private:
+ OStreamWrapper(const OStreamWrapper&);
+ OStreamWrapper& operator=(const OStreamWrapper&);
+
+ std::ostream& os_;
+};
+
+TEST(Writer, OStreamWrapper) {
+ StringStream s("{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3], \"u64\": 1234567890123456789, \"i64\":-1234567890123456789 } ");
+
+ std::stringstream ss;
+ OStreamWrapper os(ss);
+
+ Writer<OStreamWrapper> writer(os);
+
+ Reader reader;
+ reader.Parse<0>(s, writer);
+
+ std::string actual = ss.str();
+ EXPECT_STREQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3],\"u64\":1234567890123456789,\"i64\":-1234567890123456789}", actual.c_str());
+}
+
+TEST(Writer, AssertRootMayBeAnyValue) {
+#define T(x)\
+ {\
+ StringBuffer buffer;\
+ Writer<StringBuffer> writer(buffer);\
+ EXPECT_TRUE(x);\
+ }
+ T(writer.Bool(false));
+ T(writer.Bool(true));
+ T(writer.Null());
+ T(writer.Int(0));
+ T(writer.Uint(0));
+ T(writer.Int64(0));
+ T(writer.Uint64(0));
+ T(writer.Double(0));
+ T(writer.String("foo"));
+#undef T
+}
+
+TEST(Writer, AssertIncorrectObjectLevel) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartObject();
+ writer.EndObject();
+ ASSERT_THROW(writer.EndObject(), AssertException);
+}
+
+TEST(Writer, AssertIncorrectArrayLevel) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartArray();
+ writer.EndArray();
+ ASSERT_THROW(writer.EndArray(), AssertException);
+}
+
+TEST(Writer, AssertIncorrectEndObject) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartObject();
+ ASSERT_THROW(writer.EndArray(), AssertException);
+}
+
+TEST(Writer, AssertIncorrectEndArray) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartObject();
+ ASSERT_THROW(writer.EndArray(), AssertException);
+}
+
+TEST(Writer, AssertObjectKeyNotString) {
+#define T(x)\
+ {\
+ StringBuffer buffer;\
+ Writer<StringBuffer> writer(buffer);\
+ writer.StartObject();\
+ ASSERT_THROW(x, AssertException); \
+ }
+ T(writer.Bool(false));
+ T(writer.Bool(true));
+ T(writer.Null());
+ T(writer.Int(0));
+ T(writer.Uint(0));
+ T(writer.Int64(0));
+ T(writer.Uint64(0));
+ T(writer.Double(0));
+ T(writer.StartObject());
+ T(writer.StartArray());
+#undef T
+}
+
+TEST(Writer, AssertMultipleRoot) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+
+ writer.StartObject();
+ writer.EndObject();
+ ASSERT_THROW(writer.StartObject(), AssertException);
+
+ writer.Reset(buffer);
+ writer.Null();
+ ASSERT_THROW(writer.Int(0), AssertException);
+
+ writer.Reset(buffer);
+ writer.String("foo");
+ ASSERT_THROW(writer.StartArray(), AssertException);
+
+ writer.Reset(buffer);
+ writer.StartArray();
+ writer.EndArray();
+ //ASSERT_THROW(writer.Double(3.14), AssertException);
+}
+
+TEST(Writer, RootObjectIsComplete) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ EXPECT_FALSE(writer.IsComplete());
+ writer.StartObject();
+ EXPECT_FALSE(writer.IsComplete());
+ writer.String("foo");
+ EXPECT_FALSE(writer.IsComplete());
+ writer.Int(1);
+ EXPECT_FALSE(writer.IsComplete());
+ writer.EndObject();
+ EXPECT_TRUE(writer.IsComplete());
+}
+
+TEST(Writer, RootArrayIsComplete) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ EXPECT_FALSE(writer.IsComplete());
+ writer.StartArray();
+ EXPECT_FALSE(writer.IsComplete());
+ writer.String("foo");
+ EXPECT_FALSE(writer.IsComplete());
+ writer.Int(1);
+ EXPECT_FALSE(writer.IsComplete());
+ writer.EndArray();
+ EXPECT_TRUE(writer.IsComplete());
+}
+
+TEST(Writer, RootValueIsComplete) {
+#define T(x)\
+ {\
+ StringBuffer buffer;\
+ Writer<StringBuffer> writer(buffer);\
+ EXPECT_FALSE(writer.IsComplete()); \
+ x; \
+ EXPECT_TRUE(writer.IsComplete()); \
+ }
+ T(writer.Null());
+ T(writer.Bool(true));
+ T(writer.Bool(false));
+ T(writer.Int(0));
+ T(writer.Uint(0));
+ T(writer.Int64(0));
+ T(writer.Uint64(0));
+ T(writer.Double(0));
+ T(writer.String(""));
+#undef T
+}
+
+TEST(Writer, InvalidEncoding) {
+ // Fail in decoding invalid UTF-8 sequence http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
+ {
+ GenericStringBuffer<UTF16<> > buffer;
+ Writer<GenericStringBuffer<UTF16<> >, UTF8<>, UTF16<> > writer(buffer);
+ writer.StartArray();
+ EXPECT_FALSE(writer.String("\xfe"));
+ EXPECT_FALSE(writer.String("\xff"));
+ EXPECT_FALSE(writer.String("\xfe\xfe\xff\xff"));
+ writer.EndArray();
+ }
+
+ // Fail in encoding
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer, UTF32<> > writer(buffer);
+ static const UTF32<>::Ch s[] = { 0x110000, 0 }; // Out of U+0000 to U+10FFFF
+ EXPECT_FALSE(writer.String(s));
+ }
+
+ // Fail in unicode escaping in ASCII output
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer, UTF32<>, ASCII<> > writer(buffer);
+ static const UTF32<>::Ch s[] = { 0x110000, 0 }; // Out of U+0000 to U+10FFFF
+ EXPECT_FALSE(writer.String(s));
+ }
+}
+
+TEST(Writer, ValidateEncoding) {
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteValidateEncodingFlag> writer(buffer);
+ writer.StartArray();
+ EXPECT_TRUE(writer.String("\x24")); // Dollar sign U+0024
+ EXPECT_TRUE(writer.String("\xC2\xA2")); // Cents sign U+00A2
+ EXPECT_TRUE(writer.String("\xE2\x82\xAC")); // Euro sign U+20AC
+ EXPECT_TRUE(writer.String("\xF0\x9D\x84\x9E")); // G clef sign U+1D11E
+ writer.EndArray();
+ EXPECT_STREQ("[\"\x24\",\"\xC2\xA2\",\"\xE2\x82\xAC\",\"\xF0\x9D\x84\x9E\"]", buffer.GetString());
+ }
+
+ // Fail in decoding invalid UTF-8 sequence http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteValidateEncodingFlag> writer(buffer);
+ writer.StartArray();
+ EXPECT_FALSE(writer.String("\xfe"));
+ EXPECT_FALSE(writer.String("\xff"));
+ EXPECT_FALSE(writer.String("\xfe\xfe\xff\xff"));
+ writer.EndArray();
+ }
+}
+
+TEST(Writer, InvalidEventSequence) {
+ // {]
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartObject();
+ EXPECT_THROW(writer.EndArray(), AssertException);
+ EXPECT_FALSE(writer.IsComplete());
+ }
+
+ // [}
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartArray();
+ EXPECT_THROW(writer.EndObject(), AssertException);
+ EXPECT_FALSE(writer.IsComplete());
+ }
+
+ // { 1:
+ {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartObject();
+ EXPECT_THROW(writer.Int(1), AssertException);
+ EXPECT_FALSE(writer.IsComplete());
+ }
+}
+
+extern double zero; // clang -Wmissing-variable-declarations
+double zero = 0.0; // Use global variable to prevent compiler warning
+
+TEST(Writer, NaN) {
+ double nan = zero / zero;
+ EXPECT_TRUE(internal::Double(nan).IsNan());
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ EXPECT_FALSE(writer.Double(nan));
+}
+
+TEST(Writer, Inf) {
+ double inf = 1.0 / zero;
+ EXPECT_TRUE(internal::Double(inf).IsInf());
+ StringBuffer buffer;
+ {
+ Writer<StringBuffer> writer(buffer);
+ EXPECT_FALSE(writer.Double(inf));
+ }
+ {
+ Writer<StringBuffer> writer(buffer);
+ EXPECT_FALSE(writer.Double(-inf));
+ }
+}
+
+TEST(Writer, RawValue) {
+ StringBuffer buffer;
+ Writer<StringBuffer> writer(buffer);
+ writer.StartObject();
+ writer.Key("a");
+ writer.Int(1);
+ writer.Key("raw");
+ const char json[] = "[\"Hello\\nWorld\", 123.456]";
+ writer.RawValue(json, strlen(json), kArrayType);
+ writer.EndObject();
+ EXPECT_TRUE(writer.IsComplete());
+ EXPECT_STREQ("{\"a\":1,\"raw\":[\"Hello\\nWorld\", 123.456]}", buffer.GetString());
+}
diff --git a/3rdparty/rapidjson/travis-doxygen.sh b/3rdparty/rapidjson/travis-doxygen.sh
new file mode 100644
index 00000000000..e9eb6b9c2b9
--- /dev/null
+++ b/3rdparty/rapidjson/travis-doxygen.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+# Update Doxygen documentation after push to 'master'.
+# Author: @pah
+
+set -e
+
+DOXYGEN_VER=doxygen-1.8.7
+DOXYGEN_TAR=${DOXYGEN_VER}.linux.bin.tar.gz
+DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/${DOXYGEN_TAR}"
+DOXYGEN_BIN="/usr/local/bin/doxygen"
+
+: ${GITHUB_REPO:="miloyip/rapidjson"}
+GITHUB_HOST="github.com"
+GITHUB_CLONE="git://${GITHUB_HOST}/${GITHUB_REPO}"
+GITHUB_URL="https://${GITHUB_HOST}/${GITHUB_PUSH-${GITHUB_REPO}}"
+
+# if not set, ignore password
+#GIT_ASKPASS="${TRAVIS_BUILD_DIR}/gh_ignore_askpass.sh"
+
+skip() {
+ echo "$@" 1>&2
+ echo "Exiting..." 1>&2
+ exit 0
+}
+
+abort() {
+ echo "Error: $@" 1>&2
+ echo "Exiting..." 1>&2
+ exit 1
+}
+
+# TRAVIS_BUILD_DIR not set, exiting
+[ -d "${TRAVIS_BUILD_DIR-/nonexistent}" ] || \
+ abort '${TRAVIS_BUILD_DIR} not set or nonexistent.'
+
+# check for pull-requests
+[ "${TRAVIS_PULL_REQUEST}" = "false" ] || \
+ skip "Not running Doxygen for pull-requests."
+
+# check for branch name
+[ "${TRAVIS_BRANCH}" = "master" ] || \
+ skip "Running Doxygen only for updates on 'master' branch (current: ${TRAVIS_BRANCH})."
+
+# check for job number
+[ "${TRAVIS_JOB_NUMBER}" = "${TRAVIS_BUILD_NUMBER}.1" ] || \
+ skip "Running Doxygen only on first job of build ${TRAVIS_BUILD_NUMBER} (current: ${TRAVIS_JOB_NUMBER})."
+
+# install doxygen binary distribution
+doxygen_install()
+{
+ wget -O - "${DOXYGEN_URL}" | \
+ tar xz -C ${TMPDIR-/tmp} ${DOXYGEN_VER}/bin/doxygen
+ export PATH="${TMPDIR-/tmp}/${DOXYGEN_VER}/bin:$PATH"
+}
+
+doxygen_run()
+{
+ cd "${TRAVIS_BUILD_DIR}";
+ doxygen ${TRAVIS_BUILD_DIR}/build/doc/Doxyfile;
+ doxygen ${TRAVIS_BUILD_DIR}/build/doc/Doxyfile.zh-cn;
+}
+
+gh_pages_prepare()
+{
+ cd "${TRAVIS_BUILD_DIR}/build/doc";
+ [ ! -d "html" ] || \
+ abort "Doxygen target directory already exists."
+ git --version
+ git clone -b gh-pages "${GITHUB_CLONE}" html
+ cd html
+ # setup git config (with defaults)
+ git config user.name "${GIT_NAME-travis}"
+ git config user.email "${GIT_EMAIL-"travis@localhost"}"
+ # clean working dir
+ rm -f .git/index
+ git clean -df
+}
+
+gh_pages_commit() {
+ cd "${TRAVIS_BUILD_DIR}/build/doc/html";
+ echo "rapidjson.org" > CNAME
+ git add --all;
+ git diff-index --quiet HEAD || git commit -m "Automatic doxygen build";
+}
+
+gh_setup_askpass() {
+ cat > ${GIT_ASKPASS} <<EOF
+#!/bin/bash
+echo
+exit 0
+EOF
+ chmod a+x "$GIT_ASKPASS"
+}
+
+gh_pages_push() {
+ # check for secure variables
+ [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] || \
+ skip "Secure variables not available, not updating GitHub pages."
+ # check for GitHub access token
+ [ "${GH_TOKEN+set}" = set ] || \
+ skip "GitHub access token not available, not updating GitHub pages."
+ [ "${#GH_TOKEN}" -eq 40 ] || \
+ abort "GitHub token invalid: found ${#GH_TOKEN} characters, expected 40."
+
+ cd "${TRAVIS_BUILD_DIR}/build/doc/html";
+ # setup credentials (hide in "set -x" mode)
+ git remote set-url --push origin "${GITHUB_URL}"
+ git config credential.helper 'store'
+ # ( set +x ; git config credential.username "${GH_TOKEN}" )
+ ( set +x ; [ -f ${HOME}/.git-credentials ] || \
+ ( echo "https://${GH_TOKEN}:@${GITHUB_HOST}" > ${HOME}/.git-credentials ; \
+ chmod go-rw ${HOME}/.git-credentials ) )
+ # push to GitHub
+ git push origin gh-pages
+}
+
+doxygen_install
+gh_pages_prepare
+doxygen_run
+gh_pages_commit
+gh_pages_push
+
diff --git a/bgfx/chains/test.json b/bgfx/chains/test.json
new file mode 100644
index 00000000000..d5b815ca3fc
--- /dev/null
+++ b/bgfx/chains/test.json
@@ -0,0 +1,98 @@
+{ "name": "Test Shader Chain"
+ "author": "Ryan Holtz"
+ "sliders": [
+ { "type": "bool", "name": "adjustments", "text": "Enable Adjustments", "default": false },
+ { "type": "float", "name": "ratio_amount", "text": "Ratio Amount", "default": 0, "max": 1, "min": 0 },
+
+ { "type": "color", "name": "red_ratios", "text": "Red Amount", "default": [ 1, 0, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] },
+ { "type": "color", "name": "grn_ratios", "text": "Green Amount", "default": [ 0, 1, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] },
+ { "type": "color", "name": "blu_ratios", "text": "Blue Amount", "default": [ 0, 0, 1 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] },
+ { "type": "color", "name": "tint": "text": "Tint", "default": [ 1, 1, 1 ], "max": [ 1, 1, 1 ], "min": [ 0, 0, 0 ] }
+ { "type": "color", "name": "phosphor", "text": "Phosphor Amount", "default": [ 0, 0, 0 ], "max": [ 1, 1, 1 ], "min": [ 0, 0 ,0 ] },
+ { "type": "vec2", "name": "shift", "text": "Frame Shift", "default": [ 0, 0 ], "max": [ 25, 25 ], "min": [ -25, -25 ] }
+ ]
+ "parameters": [
+ { "name": "alternating", "type": "frame_mask", "period": 2 }
+ ]
+ "targets": [
+ { "name": "native",
+ "screen": true,
+ },
+ { "name": "previous",
+ "screen": true,
+ "prescale": true
+ }
+ ]
+ "passes": [
+ { "effect": "ratios",
+ "name": "Matrix Pass"
+ "disable_conditions": [
+ { "type": "slider", "name": "adjustments", "value": false },
+ { "type": "slider", "name": "ratio_amount", "value": 0 }
+ ],
+ "uniforms": [
+ { "name": "u_ratio_amount", "slider": "ratio_amount" },
+ { "name": "u_red_ratios", "slider": "red_ratios" },
+ { "name": "u_grn_ratios", "slider": "grn_ratios" },
+ { "name": "u_blu_ratios", "slider": "blu_ratios" }
+ ],
+ "input": [
+ { "sampler": "s_tex", "texture": "screen" }
+ ],
+ "output": "native"
+ },
+ { "effect": "tint",
+ "name": "Tint Pass"
+ "disable_conditions": [
+ { "type": "slider", "name": "adjustments", "value": false }
+ ],
+ "uniforms": [
+ { "name": "u_tint", "slider": "tint" },
+ { "name": "u_shift", "slider": "shift" }
+ ],
+ "input": [
+ { "sampler": "s_tex", "texture": "native" }
+ ],
+ "output": "native"
+ },
+ { "effect": "phosphor"
+ "name": "Phosphor Decay",
+ "disable_conditions": [
+ { "type": "slider", "name": "adjustments", "value": false },
+ { "type": "slider", "name": "phosphor", "value": [ 0, 0, 0 ] }
+ ],
+ "uniforms": [
+ { "name": "u_passthrough", "value": [ 0.0f ] },
+ { "name": "u_phosphor", "slider": "phosphor" }
+ ],
+ "input": [
+ { "sampler": "s_tex", "texture": "native" },
+ { "sampler": "s_prev", "texture": "previous" }
+ ],
+ "output": "native"
+ },
+ { "effect": "phosphor"
+ "name": "Phosphor Store",
+ "disable_conditions": [
+ { "type": "slider", "name": "adjustments", "value": false },
+ { "type": "slider", "name": "phosphor", "value": [ 0, 0, 0 ] }
+ ],
+ "uniforms": [
+ { "name": "u_passthrough", "value": [ 1.0f ] },
+ { "name": "u_phosphor", "slider": "phosphor" }
+ ],
+ "input": [
+ { "sampler": "s_tex", "texture": "native" },
+ { "sampler": "s_prev", "texture": "native" }
+ ],
+ "output": "previous"
+ },
+ { "effect": "blit"
+ "name": "Final Blit",
+ "input": [
+ { "sampler": "s_tex", "texture": "native" }
+ ],
+ "output": "backbuffer"
+ }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/gui_add.json b/bgfx/effects/gui_add.json
new file mode 100644
index 00000000000..d8672a0f026
--- /dev/null
+++ b/bgfx/effects/gui_add.json
@@ -0,0 +1,22 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "srcAlpha",
+ "dstColor": "1",
+ "srcAlpha": "srcAlpha",
+ "dstAlpha": "1"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_gui",
+ "fragment": "fs_gui",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/gui_blend.json b/bgfx/effects/gui_blend.json
new file mode 100644
index 00000000000..d8cfda51672
--- /dev/null
+++ b/bgfx/effects/gui_blend.json
@@ -0,0 +1,22 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "srcAlpha",
+ "dstColor": "1-srcAlpha",
+ "srcAlpha": "srcAlpha",
+ "dstAlpha": "1-srcAlpha"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_gui",
+ "fragment": "fs_gui",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/gui_multiply.json b/bgfx/effects/gui_multiply.json
new file mode 100644
index 00000000000..fa70d303aec
--- /dev/null
+++ b/bgfx/effects/gui_multiply.json
@@ -0,0 +1,22 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "dstColor",
+ "dstColor": "0",
+ "srcAlpha": "dstAlpha",
+ "dstAlpha": "0"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_gui",
+ "fragment": "fs_gui",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/gui_opaque.json b/bgfx/effects/gui_opaque.json
new file mode 100644
index 00000000000..58d1a324d2d
--- /dev/null
+++ b/bgfx/effects/gui_opaque.json
@@ -0,0 +1,22 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_gui",
+ "fragment": "fs_gui",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/screen_add.json b/bgfx/effects/screen_add.json
new file mode 100644
index 00000000000..43d110fc2d1
--- /dev/null
+++ b/bgfx/effects/screen_add.json
@@ -0,0 +1,23 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "srcAlpha",
+ "dstColor": "1",
+ "srcAlpha": "srcAlpha",
+ "dstAlpha": "1"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_screen",
+ "fragment": "fs_screen",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/screen_blend.json b/bgfx/effects/screen_blend.json
new file mode 100644
index 00000000000..37da6abf24f
--- /dev/null
+++ b/bgfx/effects/screen_blend.json
@@ -0,0 +1,23 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "srcAlpha",
+ "dstColor": "1-srcAlpha",
+ "srcAlpha": "srcAlpha",
+ "dstAlpha": "1-srcAlpha"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_screen",
+ "fragment": "fs_screen",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/screen_multiply.json b/bgfx/effects/screen_multiply.json
new file mode 100644
index 00000000000..cd37b997954
--- /dev/null
+++ b/bgfx/effects/screen_multiply.json
@@ -0,0 +1,23 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "dstColor",
+ "dstColor": "0",
+ "srcAlpha": "dstAlpha",
+ "dstAlpha": "0"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_screen",
+ "fragment": "fs_screen",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/bgfx/effects/screen_opaque.json b/bgfx/effects/screen_opaque.json
new file mode 100644
index 00000000000..e3ac55387c3
--- /dev/null
+++ b/bgfx/effects/screen_opaque.json
@@ -0,0 +1,23 @@
+{
+ "blend": {
+ "equation": "add",
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
+ },
+ "depth": {
+ "function": "always"
+ },
+ "cull": { "mode": "none" },
+ "write": {
+ "rgb": "true",
+ "alpha": "true"
+ },
+ "vertex": "vs_screen",
+ "fragment": "fs_screen",
+ "uniforms": [
+ { "name": "s_tex", "type": "int", "values": [ 1.0 ] },
+ { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }
+ ]
+} \ No newline at end of file
diff --git a/docs/luaengine.md b/docs/luaengine.md
index a17cefcdb80..223a421cc27 100644
--- a/docs/luaengine.md
+++ b/docs/luaengine.md
@@ -26,9 +26,10 @@ currently available to LUA scripts:
* machine metadata (app version, current rom, rom details)
* machine control (starting, pausing, resetting, stopping)
* machine hooks (on frame painting and on user events)
+ * machine options (hard reset required for options to take affect)
* devices introspection (device tree listing, memory and register enumeration)
* screens introspection (screens listing, screen details, frames counting)
- * screen HUD drawing (text, lines, boxes on multiple screens)
+ * screen snaps and HUD drawing (text, lines, boxes on multiple screens)
* memory read/write (8/16/32/64 bits, signed and unsigned)
* registers and states control (states enumeration, get and set)
@@ -155,3 +156,35 @@ program
41
```
+manager:options()
+manager:machine():options()
+manager:machine():ui():options()
+```
+> opts = manager:machine():options()
+> for k, entry in pairs(opts.entries) do print(string.format("%10s: %s\n%11s %s", k, entry:value(), "", entry:description())) end
+diff_directory: diff
+ directory to save hard drive image differeVnce files
+joystick_contradictory: false
+ enable contradictory direction digital joystick input at the same time
+ scalemode: none
+ Scale mode: none, hwblit, hwbest, yv12, yuy2, yv12x2, yuy2x2 (-video soft only)
+ oslog: false
+ output error.log data to the system debugger
+[...]
+> print(opts.entries["sleep"]:value())
+true
+> print(opts.entries["sleep"]:value("invalid"))
+Illegal boolean value for sleep: "invalid"; reverting to 1
+true
+> print(opts.entries["sleep"]:value(false))
+false
+```
+
+individual screen snapshots
+```
+> local screen = manager:machine().screens[":screen"]
+> screen:snapshot()
+saved snap/gridlee/0000.png
+> screen:snapshot('%g.png')
+saved snap/gridlee.png
+```
diff --git a/hash/a2600.xml b/hash/a2600.xml
index da2b856f6dc..bc707e4fc27 100644
--- a/hash/a2600.xml
+++ b/hash/a2600.xml
@@ -6,6 +6,58 @@ Info from Atariage and Atarimania
<softwarelist name="a2600" description="Atari 2600 cartridges">
+ <software name="adventp">
+ <description>Adventure +</description>
+ <year>2003</year>
+ <publisher>Homebrew</publisher>
+ <info name="programmer" value="Steve Engelhardt" />
+ <sharedfeat name="compatibility" value="NTSC" />
+ <part name="cart" interface="a2600_cart">
+ <dataarea name="rom" size="4096">
+ <rom name="Adventure Plus.a26" size="4096" crc="0a25900b" sha1="cf0efc58ffc8ae2ac49d96177cc8b3e299e95160" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="elfadven">
+ <description>Elf Adventure (Prototype)</description>
+ <year>1983</year>
+ <publisher>Atari</publisher>
+ <info name="programmer" value="Warren Robinett" />
+ <sharedfeat name="compatibility" value="NTSC" />
+ <part name="cart" interface="a2600_cart">
+ <dataarea name="rom" size="4096">
+ <rom name="Elf Adventure.bin" size="4096" crc="91647218" sha1="93cf13c16d995c69c78085effb555f17105f8b01" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ret2hh">
+ <description>Return to Haunted House (Flashback 2)</description>
+ <year>2005</year>
+ <publisher>Syzygy Company</publisher>
+ <info name="programmer" value="Curt Vensel" />
+ <sharedfeat name="compatibility" value="NTSC" />
+ <part name="cart" interface="a2600_cart">
+ <dataarea name="rom" size="4096">
+ <rom name="ret2hh.bin" size="4096" crc="95d29756" sha1="70a5f2a6a21b970a60d531ca23ef20336a0058ff" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="advent2" supported="no">
+ <description>Adventure II (Flashback 2)</description>
+ <year>2005</year>
+ <publisher>Syzygy Company</publisher>
+ <info name="programmer" value="Curt Vensel" />
+ <sharedfeat name="compatibility" value="NTSC" />
+ <part name="cart" interface="a2600_cart">
+ <dataarea name="rom" size="8192">
+ <rom name="Adventure 2.a26" size="8192" crc="bfd846c5" sha1="48d3b94e41371dd7f41d96e1195c324913c228bd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="2pakblac">
<description>2 Pak Special: Challenge + Surfing (PAL)</description>
<year>1990</year>
diff --git a/hash/a800_flop.xml b/hash/a800_flop.xml
index fd1bae04bd7..4a86cc2948f 100644
--- a/hash/a800_flop.xml
+++ b/hash/a800_flop.xml
@@ -13,6 +13,358 @@
<softwarelist name="a800_flop" description="Atari 400 / 800 floppy disks">
+ <software name="strraid2">
+ <description>Star Raiders II [Aric Wilmunder]</description>
+ <year>1984</year>
+ <publisher>Atari</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Wilmunder_Star_Raiders_II_8-2.atr" size="92176" crc="fd4e3401" sha1="90a53c361bb3a89f6c5db93b0441d04feccc6d90" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="sam" supported="no">
+ <description>S.A.M.</description>
+ <year>1982</year>
+ <publisher>Don't Ask</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="sam.atr" size="92176" crc="a5895d13" sha1="da2118f26dd46b0435ba6a486f17069734bad812" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ulysses" supported="no">
+ <description>Ulysses and the Golden Fleece</description>
+ <year>1986</year>
+ <publisher>Sierra On-Line</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Ulysses And The Golden Fleece [Rel. 1] [Side A].atr" size="92176" crc="e16b8dc8" sha1="4e55312b5259c96138f48703fcaa58a6edd0d922" offset="0" />
+ </dataarea>
+ </part>
+ <part name="flop2" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Ulysses And The Golden Fleece [Side B].atr" size="92176" crc="40915a46" sha1="a0c539aba57f93a44e23fd20bf444b0ae59c582c" offset="0" />
+ </dataarea>
+ </part>
+ <part name="flop3" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Ulysses And The Golden Fleece [Side C].atr" size="92176" crc="525a47fb" sha1="6afd6d46af274d96a3cce97dfb4ec7776fe47a6b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="tagalon">
+ <description>Tagalon</description>
+ <year>1986</year>
+ <publisher>Tynesoft</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Tagalon.ATR" size="92176" crc="f1d7bc3b" sha1="ced50da056a9fc208b613dbf1a51c0053ec251d1" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ninja">
+ <description>Ninja</description>
+ <year>1986</year>
+ <publisher>Mastertronic</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Ninja (v1).atr" size="92176" crc="54c732ed" sha1="8cd6d106904d62bb417acc0c58928dc40e10c462" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="countdwn">
+ <description>Countdown</description>
+ <year>1984</year>
+ <publisher>Synapse</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Countdown.atr" size="92176" crc="0471796a" sha1="d02b8ad67b2f1f27b340e6fa94aa0c9bc03d2ad7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="silents">
+ <description>Silent Service</description>
+ <year>1985</year>
+ <publisher>Microprose</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Silent Service.atr" size="92176" crc="bda9ac46" sha1="312c76e40f0941749e3909afd4a7d7a83f398210" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="templtri">
+ <description>Temple Of Apshai Triology</description>
+ <year>1985</year>
+ <publisher>Epyx</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Temple of Apshai Trilogy (The).atr" size="92176" crc="a5cdca88" sha1="e9955303ba855beeafb0e5bf9b5b683d0fbb8701" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="necroman">
+ <description>Necromancer</description>
+ <year>1982</year>
+ <publisher>Synapse</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Necromancer (v3).atr" size="92176" crc="e88a29c6" sha1="2445a652bb2980b7def4b189718332997f9fa584" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="shamus2">
+ <description>Shamus: Case II</description>
+ <year>1983</year>
+ <publisher>Synapse</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Shamus - Case II.atr" size="92176" crc="2b6696c6" sha1="f3079c19f54ae5dc6fc9de6ca80341e9a2527c05" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="wkarate">
+ <description>World Karate Championship</description>
+ <year>1986</year>
+ <publisher>Epyx</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="133136">
+ <rom name="World Karate Championship (v4).atr" size="133136" crc="a89bf1e6" sha1="97fbaf575d9f9ddbecd1528c7d5090d2fdac6f3e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="loderunr">
+ <description>Lode Runner</description>
+ <year>1983</year>
+ <publisher>Broderbund</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Lode Runner (1983)(Broderbund).atr" size="92176" crc="3a6f19ae" sha1="1add070c088b73488fb83e815294cd1d0e38e039" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="cloderun">
+ <description>Championship Lode Runner</description>
+ <year>1985</year>
+ <publisher>Broderbund</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Championship Lode Runner.atr" size="92176" crc="53e02689" sha1="dc92e8616fa2e00432b388df97d508c1a0b6db3c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="marsmis2">
+ <description>Mars Mission II</description>
+ <year>1981</year>
+ <publisher>Antic</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Mars Mission II.atr" size="92176" crc="59694595" sha1="4b2ad8bdcbbd4c8f5aef154e55bf4950b15798f3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ckhafka">
+ <description>Caverns of Khafka</description>
+ <year>1983</year>
+ <publisher>Cosmi</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Caverns of Khafka.atr" size="92176" crc="587862ff" sha1="53ec7aa10e7f7231b4cc7d194b21fda735135263" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="brucelee">
+ <description>Bruce Lee</description>
+ <year>1984</year>
+ <publisher>Datasoft</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Bruce Lee (v1).atr" size="92176" crc="5870eb7f" sha1="789b4c0ce4ade89559179999751a29f250325787" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="bdash2">
+ <description>Boulder Dash II</description>
+ <year>1985</year>
+ <publisher>First Star</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Boulder Dash II (v4).atr" size="92176" crc="1145500d" sha1="6cbbe6c497f6462b1e3aabaa72a91ce5daa35fb6" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="bmax2001">
+ <description>Blue Max 2001</description>
+ <year>1984</year>
+ <publisher>Synapse</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="65552">
+ <rom name="Blue Max 2001.atr" size="65552" crc="e8fb6d8f" sha1="2b3fe701ea1a7d4660d5d6d403228fbabf4cc711" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="azteccha">
+ <description>Aztec Challenge</description>
+ <year>1983</year>
+ <publisher>Cosmi</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="13584">
+ <rom name="Aztec Challenge.atr" size="13584" crc="ea4be8e7" sha1="bd9362aa4023a54a35ef2c3f3c7100523100820b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="spyvspy">
+ <description>Spy Vs Spy</description>
+ <year>1984</year>
+ <publisher>First Star</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Spy Vs Spy (1984)(First Star).atr" size="92176" crc="91940f40" sha1="d57d8ecbb0b14987c8fc64b27fe1511779c62f4d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="spyvspya">
+ <description>Spy Vs Spy - Arctic Antics</description>
+ <year>1987</year>
+ <publisher>First Star</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Spy Vs Spy - Arctic Antics (1987)(First Star).atr" size="92176" crc="0bd44669" sha1="e6fe39584e5facc62116c7c4f5952e4d5046323a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="spyvspyi">
+ <description>Spy Vs Spy - The Island Caper</description>
+ <year>1985</year>
+ <publisher>First Star Software</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Spy Vs Spy - The Island Caper (1985)(First Star).atr" size="92176" crc="7ac8a99a" sha1="ce4241641a3d0981beaa766f01bf0093552c70de" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="montzuma">
+ <description>Montezuma's Revenge</description>
+ <year>1984</year>
+ <publisher>Parker Brothers</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="Montezuma's Revenge _ Parker Brothers.atr" size="92176" crc="3ec0b7e2" sha1="3535dfc1cf25f59c8bdc050689bb89877fef9da0" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="montzump">
+ <description>Montezuma's Revenge! (Prototype)</description>
+ <year>1983</year>
+ <publisher>Utopia Software</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="34960">
+ <rom name="Montezuma's Revenge!.atr" size="34960" crc="fd7387dd" sha1="563832104dd0658d09411b24cc0c251be5041d33" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+
+ <software name="mrrobot">
+ <description>Mr. Robot and his Robot Factory</description>
+ <year>1983</year>
+ <publisher>Datamost</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="mr robot and his robot factory.atr" size="92176" crc="36f3bdb0" sha1="8bb1f04783e883bb20aec5b83e3493632d9dd0bd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="castwolf" supported="partial">
+ <description>Castle Wolfenstein</description>
+ <year>1983</year>
+ <publisher>Muse Software</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="castle wolfenstein.atr" size="92176" crc="7745cd05" sha1="03ba4218d20f260f3e17c7ce540c952cd071bdf5" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="bcastwlf">
+ <description>Beyond Castle Wolfenstein</description>
+ <year>1984</year>
+ <publisher>Muse Software</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="beyond castle wolfenstein.atr" size="92176" crc="78ef8db7" sha1="a0916bd0dde1b748834411c96cb2ae058b38f3c2" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="quasmodo">
+ <description>Quasimodo</description>
+ <year>1984</year>
+ <publisher>Synapse</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="27024">
+ <rom name="quasmodo.atr" size="27024" crc="0a2e0469" sha1="ae973c2b8f7863ce7b519a2a4dd689ad1a4b20a3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zorro">
+ <description>Zorro</description>
+ <year>1985</year>
+ <publisher>Datasoft</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="zorro.atr" size="92176" crc="df552763" sha1="c219f6eb373df61e620b40d19aef66f8f03e7356" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="alleycat">
+ <description>Alley Cat</description>
+ <year>1983</year>
+ <publisher>Synapse</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="65552">
+ <rom name="alleycat.atr" size="65552" crc="12e2eb0d" sha1="a99e131f024e5df10316860b6d174a16aadc8651" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="galahad">
+ <description>Galahad and the Holy Grail</description>
+ <year>1982</year>
+ <publisher>Atari Program Exchange</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="92176">
+ <rom name="galahad.atr" size="92176" crc="d575a0bb" sha1="9f03ddbd745919e93113daed1117a59751f22ae5" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="jumpman">
<description>Jumpman</description>
<year>1983</year>
diff --git a/hash/c128_cart.xml b/hash/c128_cart.xml
index 37793234d7f..953195810c2 100644
--- a/hash/c128_cart.xml
+++ b/hash/c128_cart.xml
@@ -12,7 +12,7 @@ Missing dumps:
-->
<software name="c128diag">
- <description>C128 Diagnostic (v1.1)</description>
+ <description>C-128 Diagnostic (v1.1)</description>
<year>1987</year>
<publisher>Commodore</publisher>
@@ -21,13 +21,13 @@ Missing dumps:
<feature name="exrom" value="1" />
<dataarea name="roml" size="0x2000">
- <rom name="c128diag.bin" size="0x2000" crc="584f6750" sha1="b3cfd8508b887e9c7e72ed2b0c44fe63e6b44ac4" offset="0x0000" />
+ <rom name="c128diag.bin" size="0x2000" crc="584f6750" sha1="b3cfd8508b887e9c7e72ed2b0c44fe63e6b44ac4" offset="0" />
</dataarea>
</part>
</software>
<software name="c128diaga" cloneof="c128diag">
- <description>C128 Diagnostic</description>
+ <description>C-128 Diagnostic (v1.4)</description>
<year>198?</year>
<publisher>Commodore</publisher>
@@ -41,8 +41,23 @@ Missing dumps:
</part>
</software>
+ <software name="c128diagb" cloneof="c128diag">
+ <description>C128/C128D Diagnostic (Rev 785260)</description>
+ <year>198?</year>
+ <publisher>Commodore</publisher>
+
+ <part name="cart" interface="c64_cart">
+ <feature name="game" value="1" />
+ <feature name="exrom" value="1" />
+
+ <dataarea name="roml" size="0x4000">
+ <rom name="c128_785260.bin" size="0x2000" crc="d4a4e162" sha1="2c861c89be4e556982435d076b012362545f03ca" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="c128diagdcr" cloneof="c128diag">
- <description>C128DCR Diagnostic</description>
+ <description>C-128DCR Integral Diag 1.0</description>
<year>198?</year>
<publisher>Commodore</publisher>
@@ -67,7 +82,23 @@ Missing dumps:
<feature name="exrom" value="1" />
<dataarea name="roml" size="0x2000">
- <rom name="c128diag.bin" size="0x2000" crc="b11107be" sha1="c7149ed420d95faa1ab2ecb4a536f5e6effd45e3" offset="0" />
+ <rom name="c128diag_588121.bin" size="0x2000" crc="b11107be" sha1="c7149ed420d95faa1ab2ecb4a536f5e6effd45e3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="c128dg40a" cloneof="c128dg40">
+ <description>C128/40 Diagnostic (Rev 789010)</description>
+ <year>198?</year>
+ <publisher>Commodore</publisher>
+ <sharedfeat name="compatibility" value="NTSC,PAL"/>
+
+ <part name="cart" interface="c64_cart">
+ <feature name="game" value="1" />
+ <feature name="exrom" value="1" />
+
+ <dataarea name="roml" size="0x2000">
+ <rom name="c128diag_789010.bin" size="0x2000" crc="3b5fcdbd" sha1="da8851745b90dfafe4e05b2bf4e8e224b553170a" offset="0" />
</dataarea>
</part>
</software>
@@ -101,7 +132,7 @@ Missing dumps:
<feature name="exrom" value="1" />
<dataarea name="roml" size="0x2000">
- <rom name="mach_128_v1a.bin" size="0x2000" crc="f91ed380" sha1="6f04d73fcde8b28903075e3adcd2d7ff49d2518a" offset="0x0000" />
+ <rom name="mach_128_v1a.bin" size="0x2000" crc="f91ed380" sha1="6f04d73fcde8b28903075e3adcd2d7ff49d2518a" offset="0" />
</dataarea>
</part>
@@ -123,7 +154,7 @@ Missing dumps:
<feature name="exrom" value="1" />
<dataarea name="roml" size="0x2000">
- <rom name="mach_128_v2a.bin" size="0x2000" crc="fc60d92e" sha1="7f487134d314b4c5158954ad057e01c0da32a468" offset="0x0000" />
+ <rom name="mach_128_v2a.bin" size="0x2000" crc="fc60d92e" sha1="7f487134d314b4c5158954ad057e01c0da32a468" offset="0" />
</dataarea>
</part>
diff --git a/hash/c64_cart.xml b/hash/c64_cart.xml
index fe0fcd71bbc..e908c22b88c 100644
--- a/hash/c64_cart.xml
+++ b/hash/c64_cart.xml
@@ -4772,7 +4772,7 @@
</software>
<software name="c64diag">
- <description>C-64 Diagnostic r.586220</description>
+ <description>C-64 Diagnostic (Rev 586220)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="c64_cart">
@@ -4844,6 +4844,7 @@
<description>C64 Diagnostic</description>
<year>19??</year>
<publisher>Commodore</publisher>
+ <info name="serial" value="324528-02" />
<part name="cart" interface="c64_cart">
<feature name="exrom" value="0" />
<feature name="game" value="1" />
@@ -4853,6 +4854,19 @@
</part>
</software>
+ <software name="c64dia41">
+ <description>C-64 Diagnostic (Rev 4.1.0)</description>
+ <year>19??</year>
+ <publisher>Commodore</publisher>
+ <part name="cart" interface="c64_cart">
+ <feature name="exrom" value="0" />
+ <feature name="game" value="1" />
+ <dataarea name="roml" size="0x2000">
+ <rom name="commodorediagrev410.bin" size="0x2000" crc="9d1a9181" sha1="5800219da86c00e583f7100e91febe528208ec46" offset="0x0000" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="calcres">
<description>Calc Result</description>
<year>1983</year>
diff --git a/hash/m5_cart.xml b/hash/m5_cart.xml
index c090bd9cfe1..833a930b8d0 100644
--- a/hash/m5_cart.xml
+++ b/hash/m5_cart.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
<!--
@@ -667,8 +667,8 @@ come from... they might be eventually removed -->
<!-- Brno mod ROMs -->
- <software name="brnoboot" supported="no">
- <description>Boot for Brno ramdisk</description>
+ <software name="brno_con" supported="no">
+ <description>Boot for Brno ramdisk [console version]</description>
<year>1989</year>
<publisher>&lt;Pavel Brychta a spol.&gt;</publisher>
<part name="cart" interface="m5_cart">
@@ -679,7 +679,7 @@ come from... they might be eventually removed -->
</software>
<software name="brno_win" supported="no">
- <description>Brno windows boot</description>
+ <description>Boot for Brno ramdisk [windows version]</description>
<year>1989</year>
<publisher>&lt;Ladislav Novak&gt;</publisher>
<part name="cart" interface="m5_cart">
diff --git a/hash/m5_flop.xml b/hash/m5_flop.xml
index 54ab259fc8c..d025b9552ac 100644
--- a/hash/m5_flop.xml
+++ b/hash/m5_flop.xml
@@ -6,7 +6,7 @@
<description>Booting diskette for CP/M.[Brno mod]</description>
<year>1989</year>
<publisher></publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="860416">
<rom name="brno_boot_cpm.dsk" size="860416" crc="9484f399" sha1="efd1e664d5f4b80a7d49078cc80d187f72f4bc2f" offset="0" />
</dataarea>
diff --git a/hash/snotec.xml b/hash/snotec.xml
index 2873bd4f522..b34d3410bf3 100644
--- a/hash/snotec.xml
+++ b/hash/snotec.xml
@@ -72,4 +72,42 @@
</dataarea>
</part>
</software>
+
+ <software name="caudit">
+ <description>Challenge Audition</description>
+ <year>1998</year>
+ <publisher>Bandai</publisher>
+ <part name="rom" interface="genius_cart">
+ <dataarea name="rom" size="0x40000">
+ <rom name="Audition.ic1" size="0x40000" crc="685fc899" sha1="0e203ed002450031663d6626380d39b88dc7b1ab" offset="0" />
+ </dataarea>
+ <dataarea name="eeprom" size="0x4000">
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="conan">
+ <description>Detective Conan</description>
+ <year>1996</year>
+ <publisher>Bandai</publisher>
+ <part name="rom" interface="genius_cart">
+ <dataarea name="rom" size="0x40000">
+ <rom name="LH532KV6.IC1" size="0x40000" crc="edf3cc1e" sha1="0b759ff7dd2bd6809e5634679f758de106fed654" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="magicalf">
+ <description>Magical Fortune</description>
+ <year>1996</year>
+ <publisher>Bandai</publisher>
+ <part name="rom" interface="genius_cart">
+ <dataarea name="rom" size="0x40000">
+ <rom name="LH532KWU.ic1" size="0x40000" crc="b0017e0d" sha1="0147f0c61fa47509971222cbacfafd382ed2e31d" offset="0" />
+ </dataarea>
+ <dataarea name="eeprom" size="0x800">
+ </dataarea>
+ </part>
+ </software>
+
</softwarelist>
diff --git a/language/Afrikaans/strings.po b/language/Afrikaans/strings.po
new file mode 100644
index 00000000000..2ce14821ff8
--- /dev/null
+++ b/language/Afrikaans/strings.po
@@ -0,0 +1,1084 @@
+# Afrikaans translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: af\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Albanian/strings.po b/language/Albanian/strings.po
new file mode 100644
index 00000000000..3f06fdaf4f9
--- /dev/null
+++ b/language/Albanian/strings.po
@@ -0,0 +1,1084 @@
+# Albanian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: sq\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Arabic/strings.po b/language/Arabic/strings.po
new file mode 100644
index 00000000000..1b3914316db
--- /dev/null
+++ b/language/Arabic/strings.po
@@ -0,0 +1,1084 @@
+# Arabic translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ar\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Basque/strings.po b/language/Basque/strings.po
new file mode 100644
index 00000000000..e64ad4ed57f
--- /dev/null
+++ b/language/Basque/strings.po
@@ -0,0 +1,1085 @@
+# Basque translations for PACKAGE package
+# PACKAGE paketearen Ingelesezko itzulpena.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: eu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Belarusian/strings.po b/language/Belarusian/strings.po
new file mode 100644
index 00000000000..712e64fbb33
--- /dev/null
+++ b/language/Belarusian/strings.po
@@ -0,0 +1,1087 @@
+# Belarusian translations for PACKAGE package
+# Áåëàðóñê³ ïåðàêëàä äëÿ PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: be\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Bosnian/strings.po b/language/Bosnian/strings.po
new file mode 100644
index 00000000000..94f6753862e
--- /dev/null
+++ b/language/Bosnian/strings.po
@@ -0,0 +1,1084 @@
+# Bosnian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: bs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Bulgarian/strings.po b/language/Bulgarian/strings.po
new file mode 100644
index 00000000000..6094aaab20a
--- /dev/null
+++ b/language/Bulgarian/strings.po
@@ -0,0 +1,1086 @@
+# Bulgarian translations for PACKAGE package
+# Áúëãàðñêè ïðåâîä çà ïàêåò PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Burmese/strings.po b/language/Burmese/strings.po
new file mode 100644
index 00000000000..6fbb6075b16
--- /dev/null
+++ b/language/Burmese/strings.po
@@ -0,0 +1,1084 @@
+# Burmese translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: my\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Catalan/strings.po b/language/Catalan/strings.po
new file mode 100644
index 00000000000..489756d006b
--- /dev/null
+++ b/language/Catalan/strings.po
@@ -0,0 +1,1085 @@
+# Catalan translations for PACKAGE package
+# Traduccions al català del paquet «PACKAGE».
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Chinese_Simplified/strings.po b/language/Chinese_Simplified/strings.po
new file mode 100644
index 00000000000..9b468a4dda0
--- /dev/null
+++ b/language/Chinese_Simplified/strings.po
@@ -0,0 +1,1119 @@
+# Chinese Simplified translations for PACKAGE package
+# PACKAGE 套件的简体中文翻译
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-22 01:50+0800\n"
+"Last-Translator: YuiFAN\n"
+"Language-Team: MAME Language Team\n"
+"Language: zh\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr "正在校验中..."
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr "æ–°æ¡ç :"
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr "输入æ¡ç "
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr "æ¡ç é•¿åº¦æ— æ•ˆ!"
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+"ä½œå¼Šç æ³¨è§£:\n"
+"%s"
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr "全部作弊ç å·²é‡æ–°è½½å…¥"
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr "连å‘设定"
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr "全部é‡è®¾"
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr "å…¨éƒ¨é‡æ–°è½½å…¥"
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr "连å‘状æ€"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr "å·²åœç”¨"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr "å·²å¯ç”¨"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr "å¼€"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr "å…³"
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr "在此机器上找ä¸åˆ°æŒ‰é’®!"
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr "连å‘延迟"
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr "é…置光枪设备"
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr "é…置轨迹çƒè®¾å¤‡"
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr "é…ç½®è¸æ¿è®¾å¤‡"
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr "é…ç½® AD æ¸¸æˆæ†è®¾å¤‡"
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr "é…ç½®æ“纵æ†è®¾å¤‡"
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr "é…置方å‘盘设备"
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr "é…置定ä½è®¾å¤‡"
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr "设备"
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr "装置映对"
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr "主è¦è¿‡æ»¤å™¨"
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr "其他过滤器"
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr "移除最åŽè¿‡æ»¤å™¨"
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr "新增过滤器"
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr "选择自订过滤器:"
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr "显示全部"
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr "éšè—过滤器"
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr "éšè—资讯/图片"
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr "éšè—两者"
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr "字体"
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr "颜色"
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr "语言"
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr "显示侧é¢ç‰ˆ"
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr "连å‘设定"
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr "UI 字体"
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr "粗体"
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr "斜体"
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr "行"
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr "采样文字 - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr "一般文本"
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr "选择色彩"
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr "一般文本背景"
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr "选择背景颜色"
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr "å­é¡¹ç›®é¢œè‰²"
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr "克隆"
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr "边框"
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr "背景"
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr "机å°è®¾å®šå¼€å…³"
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr "未拥有游æˆé¢œè‰²"
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr "傿•°è°ƒæ•´"
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr "图形检视器背景"
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr "é¼ æ ‡ç»è¿‡é¢œè‰²"
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr "é¼ æ ‡ç»è¿‡èƒŒæ™¯é¢œè‰²"
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr "鼠标按下颜色"
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr "鼠标按下背景颜色"
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr "还原至原本颜色"
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr "UI 色彩设定"
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr "åŒå‡»æˆ–按下 "
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr " 以改å˜é¢œè‰²å€¼"
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr "èœå•预览"
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr "一般"
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr "å­é¡¹ç›®"
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr "已选择"
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr "é¼ æ ‡ç»è¿‡"
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr "从色盘选择"
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr "颜色预览 ="
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr "软件历å²"
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr "软件用法"
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr "版本: "
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr "历å²"
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr "指令"
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr "ROM"
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr "使用者介é¢"
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr "采样文件"
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr "图示"
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr "ä½œå¼Šç æ–‡ä»¶ (cheat)"
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr "å¿«ç…§ (snap)"
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr "机å°å›¾ (cabinets)"
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr "广告图 (flyers)"
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr "标题图 (titles)"
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr "è´´ç”» (marquees)"
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr "æŽ§åˆ¶é¢æ¿"
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr "å字准星"
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr "选择"
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr "游æˆç»“æŸ"
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr "标题图"
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr "得分"
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr "对战"
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr "视讯选项"
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr "输入设定 (一般)"
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr "输入设定 (本机器)"
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr "类比控制"
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr "机å°è®¾å®šå¼€å…³"
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr "机器设定"
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr "收入信æ¯"
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr "机器信æ¯"
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr "æ˜ åƒæ¡£ä¿¡æ¯"
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr "文件管ç†å™¨"
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr "ç£å¸¦æŽ§åˆ¶"
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr "伪终端"
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr "选择 BIOS"
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr "æ’æ§½è®¾å¤‡"
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr "æ¡ç è¯»å–器"
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr "网路装置"
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr "键盘模å¼"
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr "傿•°è°ƒæ•´"
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr "视频选项"
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr "å字准星选项"
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr "游æˆä½œå¼Š"
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr "外部 DAT 检视"
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr "新增至最爱"
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr "从最爱移除"
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr "选择新机器"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr "键盘模å¼:"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr "自然"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr "é‡è®¾"
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr " (å·²é”定)"
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr "å¯è§åº¦å»¶è¿Ÿ"
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr "釿–°é€‰æ‹©å‰ä¸€æ¬¡æ‰§è¡Œçš„æœºå°"
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr "å³ä¾§é¢ç‰ˆæ”¾å¤§å›¾ç‰‡"
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr "显示鼠标指标"
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr "从机å°é€€å‡ºæ—¶éœ€ç¡®è®¤"
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr "略过å¯åŠ¨æ—¶çš„æ˜¾ç¤ºèµ„è®¯ç”»é¢"
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr "强制 4:3 外观供软体撷图"
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr "使用图片作为背景"
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr "略过 BIOS 选择选å•"
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr "略过软件部分选择选å•"
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr "æ‚项选项"
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr "筛选"
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr "自订 UI"
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr "声音选项"
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr "一般输入"
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr "设定"
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr "**ä¿å­˜è‡³ ui.ini 时错误**"
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr "é€‰é¡¹æ¸…å• - æœå¯»: "
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr " 选择"
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr "设定选项"
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr "设定目录"
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr "ä¿å­˜è®¾å®š"
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr " æœå¯»: "
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr "æ— å¯ç”¨èµ„讯"
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr "用法"
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr " (缺çœ)"
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr "区域: "
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr "出版商: "
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr "年份: "
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr "软件清å•: "
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr "装置类别: "
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr "æœå¯»: "
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr "软件部分选项: "
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr "选择 BIOS"
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr " [内部]"
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr "声音"
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr "采样率"
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr "使用外部采样率"
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr "此驱动需è¦é¢å¤–è½½å…¥ä¸‹åˆ—è£…ç½®çš„æ˜ åƒæ¡£: "
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+"è‘—ä½œæƒæ³•ç¦æ­¢ä½¿ç”¨æ¨¡æ‹Ÿå™¨æ‰§è¡Œéžæ³•æŒæœ‰çš„ ROM 档案。"
+"\n"
+"\n"
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+"如果您没有在本模拟器上执行 \"%s\" çš„åˆæ³•æƒåŠ›ï¼Œè¯·æŒ‰ ESC 键。\n"
+"\n"
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr "å¦åˆ™ï¼Œè¯·é”®å…¥ OK 或移动摇æ†çš„å·¦ã€å³æ–¹å‘ç»§ç»­"
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+"æœ¬æœºå°æœ‰ä¸€ä¸ªæˆ–更多的 ROM/CHD æ˜¯ä¸æ­£ç¡®çš„。此机å°å¯èƒ½æ— æ³•正确执行。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+"本机å°å·²çŸ¥å…·æœ‰ä¸‹åˆ—的问题\n"
+"\n"
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+"æœ¬æœºå°æœ‰ä¸€ä¸ªæˆ–更多的 ROM/CHD 尚未正确地被 DUMP。\n"
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr "键盘模拟å¯èƒ½æœªè¾¾åˆ° 100% 精确。"
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr "色彩是完全错误的。"
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr "色彩尚未达到 100% 精确。"
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr "视讯模拟尚未达到 100% 精确。"
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr "声音模拟尚未达到 100% 精确。"
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr "机å°ç¼ºå°‘声音。"
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr "尚未支æ´å°é¢åž‹ç­ä½“模å¼çš„ç”»é¢ç¿»è½¬ã€‚"
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr "机å°éœ€è¦å¤–部装饰图档案"
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+"æœ¬æœºå°æ— æ³•完æˆï¼Œå¹¶éžæ¨¡æ‹Ÿä¸­çš„错误而å¯èƒ½å‘ˆçŽ°æ€ªå¼‚çš„è¡Œä¸ºæˆ–ç¼ºå°‘å…ƒä»¶ã€‚"
+"\n"
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+"æœ¬æœºå°æ— å£°éŸ³ç¡¬ä½“,故 MAME å°†ä¸ä¼šäº§ç”Ÿå£°éŸ³ï¼Œè¿™æ˜¯å¯é¢„期的行为。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr "机å°å…·æœ‰ä¿æŠ¤å°šæœªå®Œå…¨æ¨¡æ‹Ÿã€‚"
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+"æ­¤æœºå°æ— æ³•执行,机å°çš„æ¨¡æ‹Ÿè¿˜ä¸å®Œå…¨ã€‚"
+"除了等待开å‘人员改良模拟之外,没有方法å¯ä»¥è§£å†³è¿™ä¸ªé—®é¢˜ã€‚"
+"\n"
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+"\n"
+"本机å°çš„的部分元件无法模拟,因其需è¦å®žé™…活动的互动或机械装置的组åˆã€‚"
+"æ•…æ— æ³•å®Œæˆæ­¤æ¸¸æˆçš„æ‰§è¡Œã€‚"
+"\n"
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+"\n"
+"\n"
+"本机å°å°šæœ‰å¯æ‰§è¡Œçš„仿制版: "
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr "请键入 OK 或移动摇æ†çš„å·¦ã€å³æ–¹å‘ç»§ç»­"
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+"\n"
+"声音:\n"
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+"\n"
+"视讯:\n"
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr "æ— \n"
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr "å‘é‡\n"
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr "键盘模拟状æ€"
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr "模å¼: 部分模拟"
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr "UI: å·²å¯ç”¨"
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr "**使用 ScrLock 键切æ¢**"
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr "模å¼: 完整模拟"
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr "UI: å·²åœç”¨"
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr "无法å¯ç”¨è¿žå°„"
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr "选择ä¿å­˜ä½ç½®"
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr "选择载入ä½ç½®"
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr "å–æ¶ˆä¿å­˜"
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr "å–æ¶ˆè½½å…¥"
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr "ä¿å­˜è‡³ä½ç½® %s"
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr "从ä½ç½® %s 载入"
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+"确定è¦é€€å‡ºå—?\n"
+"\n"
+"按 ''%s'' 退出,\n"
+"按 ''%s'' 继续模拟。"
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr "主音é‡"
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr " 音é‡"
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr "å‘é‡é—ªçƒåº¦"
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr "最å°å…‰æŸå®½åº¦"
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr "最大光æŸå®½åº¦"
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr "å…‰æŸå¼ºåº¦"
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr "ç”»é¢ '%s'"
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr "ç”»é¢"
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr "å字准星尺度"
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr "å字准星ä½ç§»"
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr "ç”»é¢ #%d"
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr "旋转"
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr "背景图"
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr "覆å å›¾"
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr "外框图"
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr "æ“作å°"
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr "检视"
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr "è£åˆ‡"
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr "全部"
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr " 色彩"
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr " PENS" \ No newline at end of file
diff --git a/language/Chinese_Traditional/strings.po b/language/Chinese_Traditional/strings.po
new file mode 100644
index 00000000000..6fc2b2a0ac0
--- /dev/null
+++ b/language/Chinese_Traditional/strings.po
@@ -0,0 +1,1119 @@
+# Chinese Traditional translations for PACKAGE package
+# PACKAGE 套件的正體中文翻譯
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-22 01:30+0800\n"
+"Last-Translator: YuiFAN\n"
+"Language-Team: MAME Language Team\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr "正在驗證中..."
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr "æ–°æ¢ç¢¼:"
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr "輸入æ¢ç¢¼"
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr "æ¢ç¢¼é•·åº¦ç„¡æ•ˆ!"
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+"作弊碼註解:\n"
+"%s"
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr "å…¨éƒ¨ä½œå¼Šç¢¼å·²é‡æ–°è¼‰å…¥"
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr "連射設定"
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr "全部é‡è¨­"
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr "å…¨éƒ¨é‡æ–°è¼‰å…¥"
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr "連射狀態"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr "å·²åœç”¨"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr "已啟用"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr "é–‹"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr "關"
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr "此機å°ä¸Šç„¡å¯ç”¨æŒ‰éµ!"
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr "連射延é²"
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr "指派光線æ§è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr "指派軌跡çƒè£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr "æŒ‡æ´¾è¸æ¿è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr "指派 AD æ–æ¡¿è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr "指派æ“縱桿è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr "指派轉盤è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr "指派定ä½è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr "指派滑鼠è£ç½®"
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr "è£ç½®æ˜ å°"
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr "主è¦ç¯©é¸"
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr "其他篩é¸"
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr "移除最後篩é¸"
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr "新增篩é¸"
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr "鏿“‡è‡ªè¨‚篩é¸:"
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr "顯示全部"
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr "éš±è—篩é¸"
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr "éš±è—資訊/圖片"
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr "éš±è—兩者"
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr "å­—é«”"
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr "é¡è‰²"
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr "語言"
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr "顯示å´é¢ç‰ˆ"
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr "連射設定"
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr "UI å­—é«”"
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr "ç²—é«”"
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr "斜體"
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr "行"
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr "資訊字體大å°"
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr "UI 字體設定"
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr "樣本文字 - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr "一般文字"
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr "鏿“‡è‰²å½©"
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr "一般文字背景"
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr "鏿“‡èƒŒæ™¯é¡è‰²"
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr "å­é …ç›®é¡è‰²"
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr "相容版本"
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr "邊框"
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr "背景"
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr "機å°è¨­å®šé–‹é—œ"
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr "æœªæ“æœ‰éŠæˆ²é¡è‰²"
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr "åƒæ•¸èª¿æ•´"
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr "圖形檢視器背景"
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr "滑鼠經éŽé¡è‰²"
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr "滑鼠經éŽèƒŒæ™¯é¡è‰²"
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr "滑鼠按下é¡è‰²"
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr "滑鼠按下背景é¡è‰²"
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr "還原至原本é¡è‰²"
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr "UI 色彩設定"
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr "雙擊或按下 "
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr " 以改變é¡è‰²å€¼"
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr "é¸å–®é è¦½"
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr "一般"
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr "å­é …ç›®"
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr "已鏿“‡"
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr "滑鼠經éŽ"
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr "å¾žè‰²ç›¤é¸æ“‡"
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr " - ARGB 設定"
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr "é¡è‰²é è¦½ ="
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr "軟體歷å²"
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr "軟體用法"
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr "版本: "
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr "æ­·å²"
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr "Mameinfo"
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr "Messinfo"
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr "系統資訊"
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr "Mamescore"
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr "指令"
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr "ROM"
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr "使用者介é¢"
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr "樣本檔"
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr "DAT"
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr "INI"
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr "é¡å¤–çš„ INI"
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr "圖示"
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr "作弊引擎"
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr "擷圖"
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr "ç­é«”圖"
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr "廣告圖"
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr "標題圖"
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr "çµæŸåœ–"
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr "PCB 圖"
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr "標籤圖"
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr "æ“作檯"
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr "å字準星"
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr "è£é£¾åœ–"
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr "首領"
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr "è£é£¾åœ–é è¦½"
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr "鏿“‡"
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr "éŠæˆ²çµæŸ"
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr "說明圖"
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr "標題圖"
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr "得分"
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr "å°æˆ°"
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr "資料夾設定"
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr "ç¾æœ‰ "
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr " 資料夾"
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr "變更資料夾"
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr "新增資料夾"
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr "移除資料夾"
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr " 變更)"
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr "新增"
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr " 資料夾 - æœå°‹: "
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr "按下 TAB éµè¨­å®š"
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr "移除 "
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr " 資料夾"
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr "視訊é¸é …"
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr "輸入設定 (一般)"
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr "輸入設定 (本機å°)"
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr "類比控制"
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr "機å°è¨­å®šé–‹é—œ"
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr "機å°è¨­å®š"
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr "收入資訊"
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr "機å°è³‡è¨Š"
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr "æ˜ åƒæª”資訊"
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr "檔案管ç†å“¡"
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr "ç£å¸¶æŽ§åˆ¶"
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr "å½çµ‚端"
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr "鏿“‡ BIOS"
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr "æ’æ§½è£ç½®"
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr "æ¢ç¢¼è®€å–器"
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr "網路è£ç½®"
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr "éµç›¤æ¨¡å¼"
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr "åƒæ•¸èª¿æ•´"
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr "視訊é¸é …"
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr "å字準星é¸é …"
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr "作弊引擎"
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr "外部 DAT 檢視"
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr "新增至最愛"
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr "從最愛移除"
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr "鏿“‡æ–°æ©Ÿå°"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr "éµç›¤æ¨¡å¼:"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr "自然"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr "模擬"
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr "é‡è¨­"
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr " (已鎖定)"
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr "å¯è¦‹åº¦å»¶é²"
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr "釿–°é¸æ“‡å‰ä¸€æ¬¡åŸ·è¡Œçš„æ©Ÿå°"
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr "å³å´é¢ç‰ˆæ”¾å¤§åœ–片"
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr "DAT 資訊"
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr "顯示滑鼠指標"
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr "從機å°é€€å‡ºæ™‚需確èª"
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr "ç•¥éŽå•Ÿå‹•時的顯示資訊畫é¢"
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr "強制 4:3 外觀供軟體擷圖"
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr "使用圖片作為背景"
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr "ç•¥éŽ BIOS 鏿“‡é¸å–®"
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr "ç•¥éŽè»Ÿé«”éƒ¨åˆ†é¸æ“‡é¸å–®"
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr "雜項é¸é …"
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr "篩é¸"
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr "自訂 UI"
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr "è²éŸ³é¸é …"
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr "一般輸入"
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr "設定"
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr "**儲存至 ui.ini 時錯誤**"
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr "é¸é …清單 - æœå°‹: "
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr " 以鏿“‡"
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr "設定é¸é …"
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr "設定目錄"
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr "儲存設定"
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr " æœå°‹: "
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr "ç„¡å¯ç”¨è³‡è¨Š"
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr "用法"
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr " (é è¨­)"
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr "å€åŸŸ: "
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr "出版商: "
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr "年份: "
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr "軟體清單: "
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr "è£ç½®é¡žåˆ¥: "
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr "æœå°‹: "
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr "軟體部分é¸é …: "
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr "鏿“‡ BIOS"
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr " [內部]"
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr "è²éŸ³"
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr "å–æ¨£é »çއ"
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr "ä½¿ç”¨å¤–éƒ¨å–æ¨£"
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr "此驅動需è¦é¡å¤–載入下列è£ç½®çš„æ˜ åƒæª”: "
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+"è‘—ä½œæ¬Šæ³•ç¦æ­¢ä½¿ç”¨æ¨¡æ“¬å™¨åŸ·è¡Œéžæ³•æŒæœ‰çš„ ROM 檔案。"
+"\n"
+"\n"
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+"如果您沒有在本模擬器上執行 \"%s\" çš„åˆæ³•權力,請按 ESC éµã€‚\n"
+"\n"
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr "å¦å‰‡ï¼Œè«‹éµå…¥ OK æˆ–ç§»å‹•æ–æ¡¿çš„å·¦ã€å³æ–¹å‘繼續"
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+"æœ¬æ©Ÿå°æœ‰ä¸€å€‹æˆ–更多的 ROM/CHD æ˜¯ä¸æ­£ç¢ºçš„。此機å°å¯èƒ½ç„¡æ³•正確執行。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+"本機å°å·²çŸ¥å…·æœ‰ä¸‹åˆ—çš„å•題\n"
+"\n"
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+"æœ¬æ©Ÿå°æœ‰ä¸€å€‹æˆ–更多的 ROM/CHD 尚未正確地被 DUMP。\n"
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr "éµç›¤æ¨¡æ“¬å¯èƒ½æœªé”到 100% 精確。"
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr "色彩是完全錯誤的。"
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr "色彩尚未é”到 100% 精確。"
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr "視訊模擬尚未é”到 100% 精確。"
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr "è²éŸ³æ¨¡æ“¬å°šæœªé”到 100% 精確。"
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr "機å°ç¼ºå°‘è²éŸ³ã€‚"
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr "å°šæœªæ”¯æ´æª¯é¢åž‹ç­é«”模å¼çš„ç•«é¢ç¿»è½‰ã€‚"
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr "機å°éœ€è¦å¤–部è£é£¾åœ–檔案"
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+"本機å°ç„¡æ³•完æˆï¼Œä¸¦éžæ¨¡æ“¬ä¸­çš„錯誤而å¯èƒ½å‘ˆç¾æ€ªç•°çš„行為或缺少元件。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+"本機å°ç„¡è²éŸ³ç¡¬é«”,故 MAME 將䏿œƒç”¢ç”Ÿè²éŸ³ï¼Œé€™æ˜¯å¯é æœŸçš„行為。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr "機å°å…·æœ‰ä¿è­·å°šæœªå®Œå…¨æ¨¡æ“¬ã€‚"
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+"此機å°ç„¡æ³•執行,機å°çš„æ¨¡æ“¬é‚„ä¸å®Œå…¨ã€‚"
+"除了等待開發人員改良模擬之外,沒有方法å¯ä»¥è§£æ±ºé€™å€‹å•題。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+"\n"
+"本機å°çš„的部分元件無法模擬,因其需è¦å¯¦é𛿴»å‹•的互動或機械è£ç½®çš„組åˆã€‚"
+"æ•…ç„¡æ³•å®Œæˆæ­¤éŠæˆ²çš„執行。"
+"\n"
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+"\n"
+"\n"
+"本機å°å°šæœ‰å¯åŸ·è¡Œçš„仿製版: "
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr "è«‹éµå…¥ OK æˆ–ç§»å‹•æ–æ¡¿çš„å·¦ã€å³æ–¹å‘繼續"
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+"\n"
+"è²éŸ³:\n"
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+"\n"
+"視訊:\n"
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr "ç„¡\n"
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr "å‘é‡\n"
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr "éµç›¤æ¨¡æ“¬ç‹€æ…‹"
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr "模å¼: 部分模擬"
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr "UI: 已啟用"
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr "**使用 ScrLock éµåˆ‡æ›**"
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr "模å¼: 完整模擬"
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr "UI: å·²åœç”¨"
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr "無法啟用連射"
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr "鏿“‡å„²å­˜ä½ç½®"
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr "鏿“‡è¼‰å…¥ä½ç½®"
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr "å–æ¶ˆå„²å­˜"
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr "å–æ¶ˆè¼‰å…¥"
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr "儲存至ä½ç½® %s"
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr "從ä½ç½® %s 載入"
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+"確定è¦é€€å‡ºå—Ž?\n"
+"\n"
+"按 ''%s'' 退出,\n"
+"按 ''%s'' 繼續模擬。"
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr "主音é‡"
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr " 音é‡"
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr "å‘é‡é–ƒçˆåº¦"
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr "最å°å…‰æŸå¯¬åº¦"
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr "最大光æŸå¯¬åº¦"
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr "å…‰æŸå¼·åº¦"
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr "ç•«é¢ '%s'"
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr "ç•«é¢"
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr "å字準星尺度"
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr "å字準星ä½ç§»"
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr "ç•«é¢ #%d"
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr "旋轉"
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr "背景圖"
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr "覆疊圖"
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr "外框圖"
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr "æ“作檯"
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr "檢視"
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr "è£åˆ‡"
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr "全部"
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr " 色彩"
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr " PENS"
diff --git a/language/Croatian/strings.po b/language/Croatian/strings.po
new file mode 100644
index 00000000000..dba1eee2eac
--- /dev/null
+++ b/language/Croatian/strings.po
@@ -0,0 +1,1086 @@
+# Croatian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Czech/strings.po b/language/Czech/strings.po
new file mode 100644
index 00000000000..4ee076f78d8
--- /dev/null
+++ b/language/Czech/strings.po
@@ -0,0 +1,1085 @@
+# Czech translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Danish/strings.po b/language/Danish/strings.po
new file mode 100644
index 00000000000..5c4bf713740
--- /dev/null
+++ b/language/Danish/strings.po
@@ -0,0 +1,1086 @@
+# Danish translations for PACKAGE package
+# Danske oversættelser for pakke PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Dutch/strings.po b/language/Dutch/strings.po
new file mode 100644
index 00000000000..048e9dbf8d0
--- /dev/null
+++ b/language/Dutch/strings.po
@@ -0,0 +1,1086 @@
+# Dutch translations for PACKAGE package
+# Nederlandse vertalingen voor het pakket PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/English/strings.po b/language/English/strings.po
new file mode 100644
index 00000000000..bb0633dbeeb
--- /dev/null
+++ b/language/English/strings.po
@@ -0,0 +1,1115 @@
+# English translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: en\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr "Audit in progress..."
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr "New Barcode:"
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr "Enter Code"
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr "Barcode length invalid!"
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+"Cheat Comment:\n"
+"%s"
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr "All cheats reloaded"
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr "Autofire Settings"
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr "Reset All"
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr "Reload All"
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr "Autofire Status"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr "Disabled"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr "Enabled"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr "On"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr "Off"
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr "No buttons found on this machine!"
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr "Autofire Delay"
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr "Device Mapping"
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr "Main filter"
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr "Other filter"
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr "Remove last filter"
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr "Add filter"
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr "Select custom filters:"
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+#, fuzzy
+msgid "Hide Filters"
+msgstr "Add filter"
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+#, fuzzy
+msgid "Custom UI Settings"
+msgstr "Autofire Settings"
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+#, fuzzy
+msgid "Selected color"
+msgstr "Select custom filters:"
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+#, fuzzy
+msgid "Dipswitch"
+msgstr "Dip Switches"
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+#, fuzzy
+msgid "Slider color"
+msgstr "Slider Controls"
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+#, fuzzy
+msgid "UI Colors Settings"
+msgstr "Autofire Settings"
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+#, fuzzy
+msgid " - ARGB Settings"
+msgstr "Autofire Settings"
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+#, fuzzy
+msgid "Cheats"
+msgstr "Cheat"
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+#, fuzzy
+msgid "Crosshairs"
+msgstr "Crosshair Options"
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+#, fuzzy
+msgid "Artworks Preview"
+msgstr "Network Devices"
+
+#: src/emu/ui/dirmenu.cpp:52
+#, fuzzy
+msgid "Select"
+msgstr "Bios Selection"
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+#, fuzzy
+msgid "Add Folder"
+msgstr "Add filter"
+
+#: src/emu/ui/dirmenu.cpp:198
+#, fuzzy
+msgid "Remove Folder"
+msgstr "Remove last filter"
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+#, fuzzy
+msgid "Display Options"
+msgstr "Video Options"
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr "Input (general)"
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr "Input (this Machine)"
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr "Analog Controls"
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr "Dip Switches"
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr "Machine Configuration"
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr "Bookkeeping Info"
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr "Machine Information"
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr "Image Information"
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr "File Manager"
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr "Tape Control"
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr "Pseudo terminals"
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr "Bios Selection"
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr "Slot Devices"
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr "Barcode Reader"
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr "Network Devices"
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr "Keyboard Mode"
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr "Slider Controls"
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr "Video Options"
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr "Crosshair Options"
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr "Cheat"
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr "External DAT View"
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr "Add To Favorites"
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr "Remove From Favorites"
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr "Select New Machine"
+
+#: src/emu/ui/miscmenu.cpp:35
+#, fuzzy
+msgid "Keyboard Mode:"
+msgstr "Keyboard Mode"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+#, fuzzy
+msgid "Reset"
+msgstr "Reset All"
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+#, fuzzy
+msgid "Skip bios selection menu"
+msgstr "Bios Selection"
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+#, fuzzy
+msgid "Miscellaneous Options"
+msgstr "Video Options"
+
+#: src/emu/ui/optsmenu.cpp:201
+#, fuzzy
+msgid "Filter"
+msgstr "Add filter"
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+#, fuzzy
+msgid "Sound Options"
+msgstr "Video Options"
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+#, fuzzy
+msgid "Settings"
+msgstr "Autofire Settings"
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+#, fuzzy
+msgid "Configure Options"
+msgstr "Crosshair Options"
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+#, fuzzy
+msgid "Save Configuration"
+msgstr "Machine Configuration"
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+#, fuzzy
+msgid "Bios selection:"
+msgstr "Bios Selection"
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+#, fuzzy
+msgid "UI: Enabled"
+msgstr "Enabled"
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+#, fuzzy
+msgid "UI: Disabled"
+msgstr "Disabled"
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+#, fuzzy
+msgid "Crosshair Scale"
+msgstr "Crosshair Options"
+
+#: src/emu/ui/ui.cpp:2579
+#, fuzzy
+msgid "Crosshair Offset"
+msgstr "Crosshair Options"
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Estonian/strings.po b/language/Estonian/strings.po
new file mode 100644
index 00000000000..c33f15987e7
--- /dev/null
+++ b/language/Estonian/strings.po
@@ -0,0 +1,1085 @@
+# Estonian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: et\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Finnish/strings.po b/language/Finnish/strings.po
new file mode 100644
index 00000000000..ebb6d16571b
--- /dev/null
+++ b/language/Finnish/strings.po
@@ -0,0 +1,1086 @@
+# Finnish translations for PACKAGE package
+# Suomenkielinen käännös PACKAGE-paketille.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/French/strings.po b/language/French/strings.po
new file mode 100644
index 00000000000..4e89e51d023
--- /dev/null
+++ b/language/French/strings.po
@@ -0,0 +1,1086 @@
+# French translations for PACKAGE package
+# Traductions françaises du paquet PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/French_Canada/strings.po b/language/French_Canada/strings.po
new file mode 100644
index 00000000000..f581140de6a
--- /dev/null
+++ b/language/French_Canada/strings.po
@@ -0,0 +1,1086 @@
+# French translations for PACKAGE package
+# Traductions françaises du paquet PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: fr_CA\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Georgian/strings.po b/language/Georgian/strings.po
new file mode 100644
index 00000000000..22ab725001f
--- /dev/null
+++ b/language/Georgian/strings.po
@@ -0,0 +1,1084 @@
+# Georgian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ka\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/German/strings.po b/language/German/strings.po
new file mode 100644
index 00000000000..9f15615b8a3
--- /dev/null
+++ b/language/German/strings.po
@@ -0,0 +1,1116 @@
+# German translations for PACKAGE package
+# German translation for PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr "Audit läuft..."
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr "Neuer Barcode:"
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr "Code eingeben"
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr "Barcodelänge ungültig!"
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+"Cheat Kommentar:\n"
+"%s"
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr "Alle Cheats neu geladen"
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr "Einstellungen Autofeuer"
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr "Alle zurücksetzen"
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr "Alle neu laden"
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr "Status Autofeuer"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr "Deaktiviert"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr "Aktiviert"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr "An"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr "Aus"
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr "Keine Knöpfe für diese Maschine gefunden!"
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr "Verzögerung für Autofeuer"
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr "Zuordnung Lichtpistolen"
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr "Zuordnung Trackballs"
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr "Zuordnung Pedale"
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr "Zuordnung ADStick"
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr "Zuordnung Paddel"
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr "Zuordnung Wählscheiben"
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr "Zuordnung Positionsgeräte"
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr "Zuordnung Mäuse"
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr "Gerätezuordnung"
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr "Hauptfilter"
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr "Weiterer Filter"
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr "Letzten Filter entfernen"
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr "Filter hinzufügen"
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr "Filter auswählen"
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+#, fuzzy
+msgid "Hide Filters"
+msgstr "Filter hinzufügen"
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+#, fuzzy
+msgid "Custom UI Settings"
+msgstr "Einstellungen Autofeuer"
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+#, fuzzy
+msgid "Selected color"
+msgstr "Filter auswählen"
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+#, fuzzy
+msgid "Dipswitch"
+msgstr "Dipschalter"
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+#, fuzzy
+msgid "Slider color"
+msgstr "Schieberegler"
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+#, fuzzy
+msgid "UI Colors Settings"
+msgstr "Einstellungen Autofeuer"
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+#, fuzzy
+msgid " - ARGB Settings"
+msgstr "Einstellungen Autofeuer"
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+#, fuzzy
+msgid "Cheats"
+msgstr "Cheat"
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+#, fuzzy
+msgid "Crosshairs"
+msgstr "Fadenkreuzeinstellungen"
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+#, fuzzy
+msgid "Artworks Preview"
+msgstr "Netzwerkgeräte"
+
+#: src/emu/ui/dirmenu.cpp:52
+#, fuzzy
+msgid "Select"
+msgstr "Biosauswahl"
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+#, fuzzy
+msgid "Add Folder"
+msgstr "Filter hinzufügen"
+
+#: src/emu/ui/dirmenu.cpp:198
+#, fuzzy
+msgid "Remove Folder"
+msgstr "Letzten Filter entfernen"
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+#, fuzzy
+msgid "Display Options"
+msgstr "Videoeinstellungen"
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr "Eingabe (Basis)"
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr "Eingabe (für diese Maschine)"
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr "Analoge Bedienelemente"
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr "Dipschalter"
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr "Konfiguration der Maschine"
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr "Buchhaltungsinformationen"
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr "Information über die Maschine"
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr "Informationen über die Software"
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr "Dateimanager"
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr "Bedienung Cassettendeck"
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr "Pseudoterminals"
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr "Biosauswahl"
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr "Steckplatzgeräte"
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr "Barcodeleser"
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr "Netzwerkgeräte"
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr "Keyboardmodus"
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr "Schieberegler"
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr "Videoeinstellungen"
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr "Fadenkreuzeinstellungen"
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr "Cheat"
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr "Externe DAT Anzeige"
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr "Zu Favoriten hinzufügen"
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr "Aus Favoriten entfernen"
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr "Neue Maschine auswählen"
+
+#: src/emu/ui/miscmenu.cpp:35
+#, fuzzy
+msgid "Keyboard Mode:"
+msgstr "Keyboardmodus"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+#, fuzzy
+msgid "Reset"
+msgstr "Alle zurücksetzen"
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+#, fuzzy
+msgid "Skip bios selection menu"
+msgstr "Biosauswahl"
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+#, fuzzy
+msgid "Miscellaneous Options"
+msgstr "Videoeinstellungen"
+
+#: src/emu/ui/optsmenu.cpp:201
+#, fuzzy
+msgid "Filter"
+msgstr "Filter hinzufügen"
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+#, fuzzy
+msgid "Sound Options"
+msgstr "Videoeinstellungen"
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+#, fuzzy
+msgid "Settings"
+msgstr "Einstellungen Autofeuer"
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+#, fuzzy
+msgid "Configure Options"
+msgstr "Fadenkreuzeinstellungen"
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+#, fuzzy
+msgid "Save Configuration"
+msgstr "Konfiguration der Maschine"
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+#, fuzzy
+msgid "Bios selection:"
+msgstr "Biosauswahl"
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+#, fuzzy
+msgid "UI: Enabled"
+msgstr "Aktiviert"
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+#, fuzzy
+msgid "UI: Disabled"
+msgstr "Deaktiviert"
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+#, fuzzy
+msgid "Crosshair Scale"
+msgstr "Fadenkreuzeinstellungen"
+
+#: src/emu/ui/ui.cpp:2579
+#, fuzzy
+msgid "Crosshair Offset"
+msgstr "Fadenkreuzeinstellungen"
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Greek/strings.po b/language/Greek/strings.po
new file mode 100644
index 00000000000..1349f848d85
--- /dev/null
+++ b/language/Greek/strings.po
@@ -0,0 +1,1085 @@
+# Greek translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Hebrew/strings.po b/language/Hebrew/strings.po
new file mode 100644
index 00000000000..49caafc4c0f
--- /dev/null
+++ b/language/Hebrew/strings.po
@@ -0,0 +1,1085 @@
+# Hebrew translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: he\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Hindi/strings.po b/language/Hindi/strings.po
new file mode 100644
index 00000000000..040f0b14481
--- /dev/null
+++ b/language/Hindi/strings.po
@@ -0,0 +1,1084 @@
+# Hindi translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: hi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Hungarian/strings.po b/language/Hungarian/strings.po
new file mode 100644
index 00000000000..ed960d70a90
--- /dev/null
+++ b/language/Hungarian/strings.po
@@ -0,0 +1,1085 @@
+# Hungarian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Indonesian/strings.po b/language/Indonesian/strings.po
new file mode 100644
index 00000000000..63a6eafc904
--- /dev/null
+++ b/language/Indonesian/strings.po
@@ -0,0 +1,1085 @@
+# Indonesian translations for PACKAGE package
+# Terjemahan bahasa inggris untuk paket PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Italian/strings.po b/language/Italian/strings.po
new file mode 100644
index 00000000000..6097a3cc0f4
--- /dev/null
+++ b/language/Italian/strings.po
@@ -0,0 +1,1086 @@
+# Italian translations for PACKAGE package
+# Traduzioni italiane per il pacchetto PACKAGE..
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Japanese/strings.po b/language/Japanese/strings.po
new file mode 100644
index 00000000000..cbb26995e63
--- /dev/null
+++ b/language/Japanese/strings.po
@@ -0,0 +1,1086 @@
+# Japanese translations for PACKAGE package
+# PACKAGE ƒpƒbƒP[ƒW‚ɑ΂·‚é‰p–ó.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Korean/strings.po b/language/Korean/strings.po
new file mode 100644
index 00000000000..34489f8e2aa
--- /dev/null
+++ b/language/Korean/strings.po
@@ -0,0 +1,1086 @@
+# Korean translations for PACKAGE package
+# PACKAGE ÆÐŰÁö¿¡ ´ëÇÑ Çѱ¹¾î ¹ø¿ª¹®.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Latvian/strings.po b/language/Latvian/strings.po
new file mode 100644
index 00000000000..26dd408e43f
--- /dev/null
+++ b/language/Latvian/strings.po
@@ -0,0 +1,1086 @@
+# Latvian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: lv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : "
+"2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Lithuanian/strings.po b/language/Lithuanian/strings.po
new file mode 100644
index 00000000000..e95345cb6b0
--- /dev/null
+++ b/language/Lithuanian/strings.po
@@ -0,0 +1,1086 @@
+# Lithuanian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: lt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n"
+"%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Macedonian/strings.po b/language/Macedonian/strings.po
new file mode 100644
index 00000000000..3c13969f177
--- /dev/null
+++ b/language/Macedonian/strings.po
@@ -0,0 +1,1084 @@
+# Macedonian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: mk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Norwegian/strings.po b/language/Norwegian/strings.po
new file mode 100644
index 00000000000..521261ff8bc
--- /dev/null
+++ b/language/Norwegian/strings.po
@@ -0,0 +1,1085 @@
+# Norwegian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: no\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Persian/strings.po b/language/Persian/strings.po
new file mode 100644
index 00000000000..472266e65a8
--- /dev/null
+++ b/language/Persian/strings.po
@@ -0,0 +1,1084 @@
+# Persian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: fa\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Polish/strings.po b/language/Polish/strings.po
new file mode 100644
index 00000000000..e6895f243b6
--- /dev/null
+++ b/language/Polish/strings.po
@@ -0,0 +1,1087 @@
+# Polish translations for PACKAGE package
+# Polskie t³umaczenia dla pakietu PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Portuguese/strings.po b/language/Portuguese/strings.po
new file mode 100644
index 00000000000..1709984b94f
--- /dev/null
+++ b/language/Portuguese/strings.po
@@ -0,0 +1,1085 @@
+# Portuguese translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Portuguese_Brazil/strings.po b/language/Portuguese_Brazil/strings.po
new file mode 100644
index 00000000000..2380d0412b7
--- /dev/null
+++ b/language/Portuguese_Brazil/strings.po
@@ -0,0 +1,1086 @@
+# Portuguese translations for PACKAGE package
+# Traduções em português brasileiro para o pacote PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Romanian/strings.po b/language/Romanian/strings.po
new file mode 100644
index 00000000000..e20774556d3
--- /dev/null
+++ b/language/Romanian/strings.po
@@ -0,0 +1,1087 @@
+# Romanian translations for PACKAGE package
+# Traducerea în limba românã pentru pachetul PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
+"20)) ? 1 : 2;\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Russian/strings.po b/language/Russian/strings.po
new file mode 100644
index 00000000000..9b43b91ade2
--- /dev/null
+++ b/language/Russian/strings.po
@@ -0,0 +1,1116 @@
+# Russian translations for PACKAGE package
+# РуÑÑкий перевод Ð´Ð»Ñ Ð¿Ð°ÐºÐµÑ‚Ð° PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr "Идет проверка..."
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr "Ðовый штрих-код:"
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr "Введите код"
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr "Ðе Ð²ÐµÑ€Ð½Ð°Ñ Ð´Ð»Ð¸Ð½Ð° штрих-кода!"
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+"Коментарий чита:\n"
+"%s"
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr "Ð’Ñе читы перезагружены"
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr "ÐаÑтройка авто-огнÑ"
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr "СброÑить вÑе"
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr "Перезагрузить вÑе"
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr "СоÑтоÑние"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr "Выключен"
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr "Включен"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr "Вкл"
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr "Выкл"
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr "У Ñтой ÑиÑтемы нет кнопок огонь!"
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr "Задержка"
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr "УÑтройÑтва управленÑ"
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr "Главный фильтр"
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr "Дополнительные фильтры"
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr "Удалить поÑледний фильтр"
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr "Добавить фильтр"
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr "Выберите фильтры:"
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+#, fuzzy
+msgid "Hide Filters"
+msgstr "Добавить фильтр"
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+#, fuzzy
+msgid "Custom UI Settings"
+msgstr "ÐаÑтройка авто-огнÑ"
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+#, fuzzy
+msgid "Selected color"
+msgstr "Выберите фильтры:"
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+#, fuzzy
+msgid "Dipswitch"
+msgstr "DIP переключатели"
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+#, fuzzy
+msgid "UI Colors Settings"
+msgstr "ÐаÑтройка авто-огнÑ"
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+#, fuzzy
+msgid " - ARGB Settings"
+msgstr "ÐаÑтройка авто-огнÑ"
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+#, fuzzy
+msgid "Cheats"
+msgstr "Читы"
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+#, fuzzy
+msgid "Crosshairs"
+msgstr "ÐаÑтройки прицела"
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+#, fuzzy
+msgid "Artworks Preview"
+msgstr "Сетевые уÑтройÑтва"
+
+#: src/emu/ui/dirmenu.cpp:52
+#, fuzzy
+msgid "Select"
+msgstr "Выбор BIOS"
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+#, fuzzy
+msgid "Add Folder"
+msgstr "Добавить фильтр"
+
+#: src/emu/ui/dirmenu.cpp:198
+#, fuzzy
+msgid "Remove Folder"
+msgstr "Удалить поÑледний фильтр"
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+#, fuzzy
+msgid "Display Options"
+msgstr "ÐаÑтройки видео"
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr "Управление (общее)"
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr "Управление (Ñта ÑиÑтема)"
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr "Ðналоговое управление"
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr "DIP переключатели"
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr "ÐаÑтройки ÑиÑтемы"
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr "СтатиÑтика игры"
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ ÑиÑтеме"
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr "Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ образах"
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr "Файловый менеджер"
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr "Управление лентой"
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr "ПÑевдо терминалы"
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr "Выбор BIOS"
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr "Подключаемые уÑтройÑтва"
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr "Сканер штрих-кодов"
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr "Сетевые уÑтройÑтва"
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr "Режим клавиатуры"
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr "ÐаÑтройки видео"
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr "ÐаÑтройки прицела"
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr "Читы"
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr "ПроÑмотр DAT-файлов"
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr "Добавить в Избранное"
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr "Удалить из Избранного"
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr "Выбрать новую ÑиÑтему"
+
+#: src/emu/ui/miscmenu.cpp:35
+#, fuzzy
+msgid "Keyboard Mode:"
+msgstr "Режим клавиатуры"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+#, fuzzy
+msgid "Reset"
+msgstr "СброÑить вÑе"
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+#, fuzzy
+msgid "Skip bios selection menu"
+msgstr "Выбор BIOS"
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+#, fuzzy
+msgid "Miscellaneous Options"
+msgstr "ÐаÑтройки видео"
+
+#: src/emu/ui/optsmenu.cpp:201
+#, fuzzy
+msgid "Filter"
+msgstr "Добавить фильтр"
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+#, fuzzy
+msgid "Sound Options"
+msgstr "ÐаÑтройки видео"
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+#, fuzzy
+msgid "Settings"
+msgstr "ÐаÑтройка авто-огнÑ"
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+#, fuzzy
+msgid "Configure Options"
+msgstr "ÐаÑтройки прицела"
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+#, fuzzy
+msgid "Save Configuration"
+msgstr "ÐаÑтройки ÑиÑтемы"
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+#, fuzzy
+msgid "Bios selection:"
+msgstr "Выбор BIOS"
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+#, fuzzy
+msgid "UI: Enabled"
+msgstr "Включен"
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+#, fuzzy
+msgid "UI: Disabled"
+msgstr "Выключен"
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+#, fuzzy
+msgid "Crosshair Scale"
+msgstr "ÐаÑтройки прицела"
+
+#: src/emu/ui/ui.cpp:2579
+#, fuzzy
+msgid "Crosshair Offset"
+msgstr "ÐаÑтройки прицела"
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Serbian/strings.po b/language/Serbian/strings.po
new file mode 100644
index 00000000000..8128c823ede
--- /dev/null
+++ b/language/Serbian/strings.po
@@ -0,0 +1,1086 @@
+# Serbian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Serbian_Cyrillic/strings.po b/language/Serbian_Cyrillic/strings.po
new file mode 100644
index 00000000000..6b5a53a3ffd
--- /dev/null
+++ b/language/Serbian_Cyrillic/strings.po
@@ -0,0 +1,1098 @@
+# Serbian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+#, fuzzy
+msgid "Slider color"
+msgstr "Клизачи"
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+#, fuzzy
+msgid "Cheats"
+msgstr "Варања"
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+#, fuzzy
+msgid "Artworks Preview"
+msgstr "Мрежни уређаји"
+
+#: src/emu/ui/dirmenu.cpp:52
+#, fuzzy
+msgid "Select"
+msgstr "Селекција биоÑа"
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+#, fuzzy
+msgid "Display Options"
+msgstr "Видео операције"
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr "Улази (генерално)"
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr "Улази (ова машина)"
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr "Ðналогне контроле"
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr "Конфигурација"
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr "Информације о машини"
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr "Информације о датотеци"
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr "Менаџер датотека"
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr "Контрола каÑете"
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr "ПÑеудо терминал"
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr "Селекција биоÑа"
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr "Слот уређаји"
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr "Читач бар кода"
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr "Мрежни уређаји"
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr "Мод таÑтатуре"
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr "Клизачи"
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr "Видео операције"
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr "Варања"
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr "Додај у омиљене"
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr "Уклони из омиљених"
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr "Селектуј нову машину"
+
+#: src/emu/ui/miscmenu.cpp:35
+#, fuzzy
+msgid "Keyboard Mode:"
+msgstr "Мод таÑтатуре"
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+#, fuzzy
+msgid "Skip bios selection menu"
+msgstr "Селекција биоÑа"
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+#, fuzzy
+msgid "Miscellaneous Options"
+msgstr "Видео операције"
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+#, fuzzy
+msgid "Sound Options"
+msgstr "Видео операције"
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+#, fuzzy
+msgid "Configure Options"
+msgstr "Видео операције"
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+#, fuzzy
+msgid "Save Configuration"
+msgstr "Конфигурација"
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+#, fuzzy
+msgid "Bios selection:"
+msgstr "Селекција биоÑа"
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Slovak/strings.po b/language/Slovak/strings.po
new file mode 100644
index 00000000000..8c3aa0b1eca
--- /dev/null
+++ b/language/Slovak/strings.po
@@ -0,0 +1,1086 @@
+# Slovak translations for PACKAGE package
+# Slovenské preklady pre balík PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: sk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Slovenian/strings.po b/language/Slovenian/strings.po
new file mode 100644
index 00000000000..c948f4abf29
--- /dev/null
+++ b/language/Slovenian/strings.po
@@ -0,0 +1,1087 @@
+# Slovenian translations for PACKAGE package
+# Slovenski prevodi paketa PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
+"%100==4 ? 2 : 3);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Spanish/strings.po b/language/Spanish/strings.po
new file mode 100644
index 00000000000..2a71a46407c
--- /dev/null
+++ b/language/Spanish/strings.po
@@ -0,0 +1,1086 @@
+# Spanish translations for PACKAGE package
+# Traducciones al español para el paquete PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Spanish_Mexico/strings.po b/language/Spanish_Mexico/strings.po
new file mode 100644
index 00000000000..93f62025a02
--- /dev/null
+++ b/language/Spanish_Mexico/strings.po
@@ -0,0 +1,1086 @@
+# Spanish translations for PACKAGE package
+# Traducciones al español para el paquete PACKAGE.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: es_MX\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Swedish/strings.po b/language/Swedish/strings.po
new file mode 100644
index 00000000000..e0bc0d38bf3
--- /dev/null
+++ b/language/Swedish/strings.po
@@ -0,0 +1,1085 @@
+# Swedish translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Thai/strings.po b/language/Thai/strings.po
new file mode 100644
index 00000000000..e92bba3161b
--- /dev/null
+++ b/language/Thai/strings.po
@@ -0,0 +1,1084 @@
+# Thai translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: th\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Turkish/strings.po b/language/Turkish/strings.po
new file mode 100644
index 00000000000..e1ea5d52ee9
--- /dev/null
+++ b/language/Turkish/strings.po
@@ -0,0 +1,1086 @@
+# Turkish translations for PACKAGE package
+# PACKAGE paketi için Türkçe çeviriler.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Ukrainian/strings.po b/language/Ukrainian/strings.po
new file mode 100644
index 00000000000..4f8e2cdeb56
--- /dev/null
+++ b/language/Ukrainian/strings.po
@@ -0,0 +1,1086 @@
+# Ukrainian translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/language/Vietnamese/strings.po b/language/Vietnamese/strings.po
new file mode 100644
index 00000000000..6d4c389dcb9
--- /dev/null
+++ b/language/Vietnamese/strings.po
@@ -0,0 +1,1085 @@
+# Vietnamese translations for PACKAGE package.
+# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Automatically generated, 2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MAME\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-02-21 20:49+0100\n"
+"PO-Revision-Date: 2016-02-20 18:03+0100\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: MAME Language Team\n"
+"Language: vi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: src/emu/ui/auditmenu.cpp:111
+msgid "Audit in progress..."
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:72
+msgid "New Barcode:"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:76
+msgid "Enter Code"
+msgstr ""
+
+#: src/emu/ui/barcode.cpp:118
+msgid "Barcode length invalid!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:78
+#, c-format
+msgid ""
+"Cheat Comment:\n"
+"%s"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:91
+msgid "All cheats reloaded"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:122
+msgid "Autofire Settings"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:140
+msgid "Reset All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:143
+msgid "Reload All"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259
+msgid "Autofire Status"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Disabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:259 src/emu/ui/ui.cpp:1755
+#: src/emu/ui/videoopt.cpp:207 src/emu/ui/videoopt.cpp:211
+#: src/emu/ui/videoopt.cpp:215 src/emu/ui/videoopt.cpp:219
+#: src/emu/ui/videoopt.cpp:223
+msgid "Enabled"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "On"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:285 src/emu/ui/cheatopt.cpp:291
+msgid "Off"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:302
+msgid "No buttons found on this machine!"
+msgstr ""
+
+#: src/emu/ui/cheatopt.cpp:313 src/emu/ui/cheatopt.cpp:317
+msgid "Autofire Delay"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:20
+msgid "Lightgun Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:21
+msgid "Trackball Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:22
+msgid "Pedal Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:23
+msgid "Adstick Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:24
+msgid "Paddle Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:25
+msgid "Dial Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:26
+msgid "Positional Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:27
+msgid "Mouse Device Assignment"
+msgstr ""
+
+#: src/emu/ui/ctrlmenu.cpp:106 src/emu/ui/ctrlmenu.cpp:126
+#: src/emu/ui/optsmenu.cpp:251
+msgid "Device Mapping"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:156 src/emu/ui/custmenu.cpp:441
+msgid "Main filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:165 src/emu/ui/custmenu.cpp:450
+msgid "Other filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:192 src/emu/ui/custmenu.cpp:504
+msgid "Remove last filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:195 src/emu/ui/custmenu.cpp:507
+msgid "Add filter"
+msgstr ""
+
+#: src/emu/ui/custmenu.cpp:210 src/emu/ui/custmenu.cpp:230
+#: src/emu/ui/custmenu.cpp:523 src/emu/ui/custmenu.cpp:543
+msgid "Select custom filters:"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:20
+msgid "Show All"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:21
+msgid "Hide Filters"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:22
+msgid "Hide Info/Image"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:23
+msgid "Hide Both"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:137
+msgid "Fonts"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:138
+msgid "Colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:143 src/emu/ui/dirmenu.cpp:33
+msgid "Language"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:147
+msgid "Show side panels"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:162 src/emu/ui/custui.cpp:182
+msgid "Custom UI Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:369
+msgid "UI Font"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:373
+msgid "Bold"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:374
+msgid "Italic"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:380
+msgid "Lines"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:388
+msgid "Infos text size"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:405
+msgid "UI Fonts Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:432
+msgid "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+msgstr ""
+
+#: src/emu/ui/custui.cpp:530
+msgid "Normal text"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:531
+msgid "Selected color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:532
+msgid "Normal text background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:533
+msgid "Selected background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:534
+msgid "Subitem color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:535 src/emu/ui/custui.cpp:630
+msgid "Clone"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:536
+msgid "Border"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:537
+msgid "Background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:538
+msgid "Dipswitch"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:539
+msgid "Unavailable color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:540
+msgid "Slider color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:541
+msgid "Gfx viewer background"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:542
+msgid "Mouse over color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:543
+msgid "Mouse over background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:544
+msgid "Mouse down color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:545
+msgid "Mouse down background color"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:548
+msgid "Restore originals colors"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:564
+msgid "UI Colors Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592 src/emu/ui/selector.cpp:181
+msgid "Double click or press "
+msgstr ""
+
+#: src/emu/ui/custui.cpp:592
+msgid " to change the color value"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:618
+msgid "Menu Preview"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:626
+msgid "Normal"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:627
+msgid "Subitem"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:628
+msgid "Selected"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:629
+msgid "Mouse Over"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:896
+msgid "Choose from palette"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:912
+msgid " - ARGB Settings"
+msgstr ""
+
+#: src/emu/ui/custui.cpp:936
+msgid "Color preview ="
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:59
+msgid "Software History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:61
+msgid "Software Usage"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:199
+msgid "Revision: "
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:291 src/emu/ui/selgame.cpp:2054
+#: src/emu/ui/selgame.cpp:2063 src/emu/ui/selsoft.cpp:1441
+#: src/emu/ui/selsoft.cpp:1450
+msgid "History"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:293
+msgid "Mameinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:295
+msgid "Messinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:297
+msgid "Sysinfo"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:299
+msgid "Mamescore"
+msgstr ""
+
+#: src/emu/ui/datmenu.cpp:301
+msgid "Command"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:31
+msgid "ROMs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:32
+msgid "UI"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:34
+msgid "Samples"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:35
+msgid "DATs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:36
+msgid "INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:37
+msgid "Extra INIs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:38
+msgid "Icons"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:39 src/emu/ui/miscmenu.cpp:565
+msgid "Cheats"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:40
+msgid "Snapshots"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:41
+msgid "Cabinets"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:42
+msgid "Flyers"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:43
+msgid "Titles"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:44
+msgid "Ends"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:45
+msgid "PCBs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:46 src/emu/ui/videoopt.cpp:223
+msgid "Marquees"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:47
+msgid "Controls Panels"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:48
+msgid "Crosshairs"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:49
+msgid "Artworks"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:50
+msgid "Bosses"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:51
+msgid "Artworks Preview"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:52
+msgid "Select"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:53
+msgid "GameOver"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:54
+msgid "HowTo"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:55
+msgid "Logos"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:56
+msgid "Scores"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:57
+msgid "Versus"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:115 src/emu/ui/dirmenu.cpp:135
+msgid "Folders Setup"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid "Current "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:182
+msgid " Folders"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Change Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:195
+msgid "Add Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:198
+msgid "Remove Folder"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Change)"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:512
+msgid "Add"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:513
+msgid " Folder - Search: "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:548
+msgid "Press TAB to set"
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid "Remove "
+msgstr ""
+
+#: src/emu/ui/dirmenu.cpp:660
+msgid " Folder"
+msgstr ""
+
+#: src/emu/ui/dsplmenu.cpp:205 src/emu/ui/dsplmenu.cpp:225
+#: src/emu/ui/optsmenu.cpp:248
+msgid "Display Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:53
+msgid "Input (general)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:55
+msgid "Input (this Machine)"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:59
+msgid "Analog Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:61
+msgid "Dip Switches"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:64
+msgid "Machine Configuration"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:68
+msgid "Bookkeeping Info"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:71
+msgid "Machine Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:77
+msgid "Image Information"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:80
+msgid "File Manager"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:85
+msgid "Tape Control"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:90
+msgid "Pseudo terminals"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:93
+msgid "Bios Selection"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:99
+msgid "Slot Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:106
+msgid "Barcode Reader"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:113
+msgid "Network Devices"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:118
+msgid "Keyboard Mode"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:121
+msgid "Slider Controls"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:124
+msgid "Video Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:128
+msgid "Crosshair Options"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:132
+msgid "Cheat"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:136
+msgid "External DAT View"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:142
+msgid "Add To Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:144
+msgid "Remove From Favorites"
+msgstr ""
+
+#: src/emu/ui/mainmenu.cpp:151
+msgid "Select New Machine"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Keyboard Mode:"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Natural"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:35
+msgid "Emulated"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:89 src/emu/ui/slotopt.cpp:172
+msgid "Reset"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:263
+msgid " (locked)"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:523
+msgid "Visible Delay"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:562
+msgid "Re-select last machine played"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:563
+msgid "Enlarge images in the right panel"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:564
+msgid "DATs info"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:566
+msgid "Show mouse pointer"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:567
+msgid "Confirm quit from machines"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:568
+msgid "Skip displaying information's screen at startup"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:569
+msgid "Force 4:3 appearance for software snapshot"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:570
+msgid "Use image as background"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:571
+msgid "Skip bios selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:572
+msgid "Skip software parts selection menu"
+msgstr ""
+
+#: src/emu/ui/miscmenu.cpp:653 src/emu/ui/miscmenu.cpp:673
+#: src/emu/ui/optsmenu.cpp:250
+msgid "Miscellaneous Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:201
+msgid "Filter"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:246
+msgid "Customize UI"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:249 src/emu/ui/sndmenu.cpp:152
+#: src/emu/ui/sndmenu.cpp:172
+msgid "Sound Options"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:252
+msgid "General Inputs"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:267 src/emu/ui/optsmenu.cpp:287
+msgid "Settings"
+msgstr ""
+
+#: src/emu/ui/optsmenu.cpp:307
+msgid "**Error to save ui.ini**"
+msgstr ""
+
+#: src/emu/ui/selector.cpp:152
+msgid "Selection List - Search: "
+msgstr ""
+
+#: src/emu/ui/selector.cpp:181
+msgid " to select"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:623 src/emu/ui/simpleselgame.cpp:264
+msgid "Configure Options"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:624
+msgid "Configure Directories"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:625 src/emu/ui/simpleselgame.cpp:265
+msgid "Save Configuration"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:746
+msgid " Search: "
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:1951 src/emu/ui/selgame.cpp:2098
+#: src/emu/ui/selsoft.cpp:1486
+msgid "No Infos Available"
+msgstr ""
+
+#: src/emu/ui/selgame.cpp:2064 src/emu/ui/selsoft.cpp:1451
+msgid "Usage"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:109
+msgid " (default)"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:621
+msgid "Region: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:623
+msgid "Publisher: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:625
+msgid "Year: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:627
+msgid "Software List: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:629
+msgid "Device type: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:631
+msgid "Search: "
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1822 src/emu/ui/selsoft.cpp:1842
+msgid "Software part selection:"
+msgstr ""
+
+#: src/emu/ui/selsoft.cpp:1960 src/emu/ui/selsoft.cpp:1980
+msgid "Bios selection:"
+msgstr ""
+
+#: src/emu/ui/slotopt.cpp:166
+msgid " [internal]"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:136
+msgid "Sound"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:137
+msgid "Sample Rate"
+msgstr ""
+
+#: src/emu/ui/sndmenu.cpp:138
+msgid "Use External Samples"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:415
+msgid "This driver requires images to be loaded in the following device(s): "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1062
+msgid ""
+"Usage of emulators in conjunction with ROMs you don't own is forbidden by "
+"copyright law.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1063
+#, c-format
+msgid ""
+"IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1064
+msgid "Otherwise, type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1099
+msgid ""
+"One or more ROMs/CHDs for this machine are incorrect. The machine may not "
+"run correctly.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1112
+msgid ""
+"There are known problems with this machine\n"
+"\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1116
+msgid ""
+"One or more ROMs/CHDs for this machine have not been correctly dumped.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1120
+#, c-format
+msgid "The keyboard emulation may not be 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1122
+#, c-format
+msgid "The colors aren't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1124
+msgid "The colors are completely wrong.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1126
+#, c-format
+msgid "The video emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1128
+#, c-format
+msgid "The sound emulation isn't 100% accurate.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1130
+msgid "The machine lacks sound.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1133
+msgid "Screen flipping in cocktail mode is not supported.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1137
+msgid "The machine requires external artwork files\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1142
+msgid ""
+"This machine was never completed. It may exhibit strange behavior or missing "
+"elements that are not bugs in the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1147
+msgid ""
+"This machine has no sound hardware, MAME will produce no sounds, this is "
+"expected behaviour.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1155
+msgid "The machine has protection which isn't fully emulated.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1158
+msgid ""
+"\n"
+"THIS MACHINE DOESN'T WORK. The emulation for this machine is not yet "
+"complete. There is nothing you can do to fix this problem except wait for "
+"the developers to improve the emulation.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1162
+msgid ""
+"\n"
+"Certain elements of this machine cannot be emulated as it requires actual "
+"physical interaction or consists of mechanical devices. It is not possible "
+"to fully play this machine.\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1181
+msgid ""
+"\n"
+"\n"
+"There are working clones of this machine: "
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1195
+msgid ""
+"\n"
+"\n"
+"Type OK or move the joystick left then right to continue"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1254
+msgid ""
+"\n"
+"Sound:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1282
+msgid ""
+"\n"
+"Video:\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1286
+msgid "None\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1298
+msgid "Vector\n"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1590 src/emu/ui/ui.cpp:1600
+msgid "Keyboard Emulation Status"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1592
+msgid "Mode: PARTIAL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1593
+msgid "UI: Enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1595 src/emu/ui/ui.cpp:1605
+msgid "**Use ScrLock to toggle**"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1602
+msgid "Mode: FULL Emulation"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1603
+msgid "UI: Disabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1749
+msgid "Autofire can't be enabled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1788
+msgid "Select position to save to"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1790
+msgid "Select position to load from"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1814
+msgid "Save cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1816
+msgid "Load cancelled"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1859
+#, c-format
+msgid "Save to position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1864
+#, c-format
+msgid "Load from position %s"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1904
+#, c-format
+msgid ""
+"Are you sure you want to quit?\n"
+"\n"
+"Press ''%s'' to quit,\n"
+"Press ''%s'' to return to emulation."
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1980
+msgid "Master Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:1991
+msgid " Volume"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2094
+msgid "Vector Flicker"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2096
+msgid "Beam Width Minimum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2098
+msgid "Beam Width Maximum"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2100
+msgid "Beam Intensity Weight"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2540
+#, c-format
+msgid "Screen '%s'"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2542
+msgid "Screen"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2560
+msgid "Crosshair Scale"
+msgstr ""
+
+#: src/emu/ui/ui.cpp:2579
+msgid "Crosshair Offset"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:55
+#, c-format
+msgid "Screen #%d"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:203
+msgid "Rotate"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:207
+msgid "Backdrops"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:211
+msgid "Overlays"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:215
+msgid "Bezels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:219
+msgid "CPanels"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "View"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Cropped"
+msgstr ""
+
+#: src/emu/ui/videoopt.cpp:227
+msgid "Full"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " COLORS"
+msgstr ""
+
+#: src/emu/ui/viewgfx.cpp:391
+msgid " PENS"
+msgstr ""
diff --git a/makefile b/makefile
index 308b2cb0958..076d6a6d24b 100644
--- a/makefile
+++ b/makefile
@@ -23,8 +23,6 @@
# BENCHMARKS = 1
# OSD = sdl
-# USE_BGFX = 1
-# NO_OPENGL = 1
# USE_DISPATCH_GL = 0
# MODERN_WIN_API = 0
# USE_XAUDIO2 = 0
@@ -68,13 +66,13 @@
# MESA_INSTALL_ROOT = /opt/mesa
# SDL_INSTALL_ROOT = /opt/sdl2
# SDL_FRAMEWORK_PATH = $(HOME)/Library/Frameworks
-# SDL_LIBVER = sdl
-# MACOSX_USE_LIBSDL = 1
+# USE_LIBSDL = 1
# CYGWIN_BUILD = 1
# BUILDDIR = build
# TARGETOS = windows
# CROSS_BUILD = 1
+# TOOLCHAIN =
# OVERRIDE_CC = cc
# OVERRIDE_CXX = c++
# OVERRIDE_LD = ld
@@ -270,9 +268,9 @@ WINDRES := $(MINGW32)/bin/windres
endif
else
ifeq ($(ARCHITECTURE),_x64)
-WINDRES := x86_64-w64-mingw32-windres
+WINDRES := $(word 1,$(TOOLCHAIN) x86_64-w64-mingw32-)windres
else
-WINDRES := i686-w64-mingw32-windres
+WINDRES := $(word 1,$(TOOLCHAIN) i686-w64-mingw32-)windres
endif
endif
@@ -311,6 +309,7 @@ PYTHON := $(PYTHON_EXECUTABLE)
endif
CC := $(SILENT)gcc
LD := $(SILENT)g++
+CXX:= $(SILENT)g++
#-------------------------------------------------
# specify OSD layer: windows, sdl, etc.
@@ -406,6 +405,9 @@ endif
PARAMS+= --distro=$(DISTRO)
+ifdef TOOLCHAIN
+PARAMS += --TOOLCHAIN='$(TOOLCHAIN)'
+endif
ifdef OVERRIDE_CC
PARAMS += --CC='$(OVERRIDE_CC)'
ifndef CROSS_BUILD
@@ -558,10 +560,6 @@ ifdef DONT_USE_NETWORK
PARAMS += --DONT_USE_NETWORK='$(DONT_USE_NETWORK)'
endif
-ifdef NO_OPENGL
-PARAMS += --NO_OPENGL='$(NO_OPENGL)'
-endif
-
ifdef USE_DISPATCH_GL
PARAMS += --USE_DISPATCH_GL='$(USE_DISPATCH_GL)'
endif
@@ -626,8 +624,8 @@ ifdef SDL_FRAMEWORK_PATH
PARAMS += --SDL_FRAMEWORK_PATH='$(SDL_FRAMEWORK_PATH)'
endif
-ifdef MACOSX_USE_LIBSDL
-PARAMS += --MACOSX_USE_LIBSDL='$(MACOSX_USE_LIBSDL)'
+ifdef USE_LIBSDL
+PARAMS += --USE_LIBSDL='$(USE_LIBSDL)'
endif
ifdef LDOPTS
@@ -776,12 +774,12 @@ endif
ifeq ($(OS),windows)
ifeq (posix,$(SHELLTYPE))
-GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null)
-CLANG_VERSION := $(shell $(subst @,,$(CC)) --version 2> /dev/null| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1)
+GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null)
+CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1)
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
else
-GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> NUL)
-CLANG_VERSION := $(shell $(subst @,,$(CC)) --version 2> NUL| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1)
+GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> NUL)
+CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> NUL| head -n 1 | grep clang | sed "s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$$/\1/" | head -n 1)
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > NUL 2>&1 && echo python)
endif
ifdef MSBUILD
@@ -798,9 +796,9 @@ MSBUILD_PARAMS += /p:Platform=win32
endif
endif
else
-GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null)
+GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) -dumpversion 2> /dev/null)
ifneq ($(OS),solaris)
-CLANG_VERSION := $(shell $(subst @,,$(CC)) --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\.[0-9]\(\.[0-9]\)\?' -o | grep -e '[0-9]\.[0-9]\(\.[0-9]\)\?' -o | tail -n 1)
+CLANG_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(CC)) --version 2> /dev/null | head -n 1 | grep -e 'version [0-9]\.[0-9]\(\.[0-9]\)\?' -o | grep -e '[0-9]\.[0-9]\(\.[0-9]\)\?' -o | tail -n 1)
endif
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
endif
@@ -1096,10 +1094,10 @@ macosx_x86_clang: generate $(PROJECTDIR)/gmake-osx-clang/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-osx-clang config=$(CONFIG)32
xcode4: generate
- $(SILENT) $(GENIE) $(PARAMS) --targetos=macosx --xcode=osx xcode4
+ $(SILENT) $(GENIE) $(PARAMS) --gcc=osx-clang --gcc_version=$(CLANG_VERSION) --targetos=macosx --xcode=osx xcode4
xcode4-ios: generate
- $(SILENT) $(GENIE) $(PARAMS) --targetos=macosx --xcode=ios xcode4
+ $(SILENT) $(GENIE) $(PARAMS) --gcc=osx-clang --gcc_version=$(CLANG_VERSION) --targetos=macosx --xcode=ios xcode4
#-------------------------------------------------
# gmake-solaris
@@ -1195,7 +1193,7 @@ endif
ifndef MARVELL_ROOTFS
$(error MARVELL_ROOTFS is not set)
endif
- $(SILENT) $(GENIE) $(PARAMS) --gcc=steamlink --gcc_version=$(GCC_VERSION) --USE_BGFX=0 --NO_OPENGL=1 --NO_USE_MIDI=1 --NO_X11=1 --NOASM=1 --SDL_INSTALL_ROOT=$(MARVELL_ROOTFS)/usr gmake
+ $(SILENT) $(GENIE) $(PARAMS) --gcc=steamlink --gcc_version=$(GCC_VERSION) --NO_OPENGL=1 --NO_USE_MIDI=1 --NO_X11=1 --NOASM=1 --SDL_INSTALL_ROOT=$(MARVELL_ROOTFS)/usr gmake
.PHONY: steamlink
ifndef MARVELL_SDK_PATH
@@ -1235,14 +1233,18 @@ $(GENIE): $(GENIE_SRC)
3rdparty/genie/src/hosts/%.c:
-clean:
+.PHONY: genieclean
+genieclean:
+ $(SILENT) $(MAKE) $(MAKEPARAMS) -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make clean
+
+clean: genieclean
@echo Cleaning...
-@rm -rf $(BUILDDIR)
- $(SILENT) $(MAKE) $(MAKEPARAMS) -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make clean
$(SILENT) $(MAKE) -C $(SRC)/devices/cpu/m68000 clean
GEN_FOLDERS := $(GENDIR)/$(TARGET)/layout/ $(GENDIR)/$(TARGET)/$(SUBTARGET)/
+rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
LAYOUTS=$(wildcard $(SRC)/$(TARGET)/layout/*.lay)
ifneq (,$(wildcard src/osd/$(OSD)/$(OSD).mak))
@@ -1256,9 +1258,12 @@ endif
$(GEN_FOLDERS):
-$(call MKDIR,$@)
+genie: $(GENIE)
+
generate: \
- $(GENIE) \
+ genie \
$(GEN_FOLDERS) \
+ $(patsubst %.po,%.mo,$(call rwildcard, language/, *.po)) \
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS)) \
$(SRC)/devices/cpu/m68000/m68kops.cpp
@@ -1273,6 +1278,10 @@ else
$(SILENT) $(MAKE) -C $(SRC)/devices/cpu/m68000 CC="$(CC)" CXX="$(CXX)"
endif
+%.mo: %.po
+ @echo Converting translation $<...
+ $(SILENT)$(PYTHON) scripts/build/msgfmt.py --output-file $@ $<
+
#-------------------------------------------------
# Regression tests
#-------------------------------------------------
@@ -1371,3 +1380,11 @@ cppcheck:
shaders:
$(SILENT) $(MAKE) -C $(SRC)/osd/modules/render/bgfx rebuild
+
+.PHONY: translation
+
+translation:
+ $(SILENT) echo Generating mame.pot
+ $(SILENT) find src -iname "*.cpp" | xargs xgettext --from-code=UTF-8 -k_ -k__ -o mame.pot
+ $(SILENT) find language -iname "*.po" | xargs -n 1 -I %% msgmerge -U %% mame.pot
+
diff --git a/plugins/boot.lua b/plugins/boot.lua
new file mode 100644
index 00000000000..4f8c6a0ee96
--- /dev/null
+++ b/plugins/boot.lua
@@ -0,0 +1,24 @@
+require('lfs')
+local uv = require('luv')
+local cwd = uv.cwd()
+package.path = cwd .. "/plugins/?.lua;" .. cwd .. "/plugins/?/init.lua"
+
+local json = require('json')
+function readAll(file)
+ local f = io.open(file, "rb")
+ local content = f:read("*all")
+ f:close()
+ return content
+end
+
+for file in lfs.dir("plugins") do
+ if (file~="." and file~=".." and lfs.attributes("plugins/" .. file,"mode")=="directory") then
+ local filename = "plugins/" .. file .. "/plugin.json"
+ local meta = json.parse(readAll(filename))
+ if (meta["plugin"]["type"]=="plugin") and (meta["plugin"]["start"]=="true") then
+ server = require(meta["plugin"]["name"])
+ server.startplugin();
+ end
+ end
+end
+
diff --git a/plugins/coro-channel/LICENSE b/plugins/coro-channel/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/coro-channel/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/coro-channel/README.md b/plugins/coro-channel/README.md
new file mode 100644
index 00000000000..3f5bb397c69
--- /dev/null
+++ b/plugins/coro-channel/README.md
@@ -0,0 +1,2 @@
+# luv-coro-channel
+A luv port of creationix/coro-channel from lit.luvit.io
diff --git a/plugins/coro-channel/init.lua b/plugins/coro-channel/init.lua
new file mode 100644
index 00000000000..0b715a0d470
--- /dev/null
+++ b/plugins/coro-channel/init.lua
@@ -0,0 +1,128 @@
+local exports = {}
+exports.name = "creationix/coro-channel"
+exports.version = "1.2.0"
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/coro-channel.lua"
+exports.description = "An adapter for wrapping uv streams as coro-streams and chaining filters."
+exports.tags = {"coro", "adapter"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+local function wrapRead(socket)
+ local paused = true
+ local queue = {}
+ local waiting
+ local onRead
+
+ function onRead(err, chunk)
+ local data = err and {nil, err} or {chunk}
+ if waiting then
+ local thread = waiting
+ waiting = nil
+ assert(coroutine.resume(thread, unpack(data)))
+ else
+ queue[#queue + 1] = data
+ if not paused then
+ paused = true
+ assert(socket:read_stop())
+ end
+ end
+ end
+
+ return function ()
+ if #queue > 0 then
+ return unpack(table.remove(queue, 1))
+ end
+ if paused then
+ paused = false
+ assert(socket:read_start(onRead))
+ end
+ waiting = coroutine.running()
+ return coroutine.yield()
+ end
+
+end
+
+local function wrapWrite(socket)
+
+ local function wait()
+ local thread = coroutine.running()
+ return function (err)
+ assert(coroutine.resume(thread, err))
+ end
+ end
+
+ local function shutdown()
+ socket:shutdown(wait())
+ coroutine.yield()
+ if not socket:is_closing() then
+ socket:close()
+ end
+ end
+
+ return function (chunk)
+ if chunk == nil then
+ return shutdown()
+ end
+ assert(socket:write(chunk, wait()))
+ local err = coroutine.yield()
+ return not err, err
+ end
+
+end
+
+exports.wrapRead = wrapRead
+exports.wrapWrite = wrapWrite
+
+-- Given a raw uv_stream_t userdata, return coro-friendly read/write functions.
+function exports.wrapStream(socket)
+ return wrapRead(socket), wrapWrite(socket)
+end
+
+
+function exports.chain(...)
+ local args = {...}
+ local nargs = select("#", ...)
+ return function (read, write)
+ local threads = {} -- coroutine thread for each item
+ local waiting = {} -- flag when waiting to pull from upstream
+ local boxes = {} -- storage when waiting to write to downstream
+ for i = 1, nargs do
+ threads[i] = coroutine.create(args[i])
+ waiting[i] = false
+ local r, w
+ if i == 1 then
+ r = read
+ else
+ function r()
+ local j = i - 1
+ if boxes[j] then
+ local data = boxes[j]
+ boxes[j] = nil
+ assert(coroutine.resume(threads[j]))
+ return unpack(data)
+ else
+ waiting[i] = true
+ return coroutine.yield()
+ end
+ end
+ end
+ if i == nargs then
+ w = write
+ else
+ function w(...)
+ local j = i + 1
+ if waiting[j] then
+ waiting[j] = false
+ assert(coroutine.resume(threads[j], ...))
+ else
+ boxes[i] = {...}
+ coroutine.yield()
+ end
+ end
+ end
+ assert(coroutine.resume(threads[i], r, w))
+ end
+ end
+end
+
+return exports
diff --git a/plugins/coro-channel/plugin.json b/plugins/coro-channel/plugin.json
new file mode 100644
index 00000000000..5a3f5af8813
--- /dev/null
+++ b/plugins/coro-channel/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "coro-channel",
+ "version": "1.2.0",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/coro-fs/LICENSE b/plugins/coro-fs/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/coro-fs/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/coro-fs/README.md b/plugins/coro-fs/README.md
new file mode 100644
index 00000000000..79ef57330a0
--- /dev/null
+++ b/plugins/coro-fs/README.md
@@ -0,0 +1,2 @@
+# luv-coro-fs
+A luv port of lit's coro-fs module
diff --git a/plugins/coro-fs/init.lua b/plugins/coro-fs/init.lua
new file mode 100644
index 00000000000..f4be5bff832
--- /dev/null
+++ b/plugins/coro-fs/init.lua
@@ -0,0 +1,222 @@
+local exports = {}
+exports.name = "creationix/coro-fs"
+exports.version = "1.3.0"
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/coro-fs.lua"
+exports.description = "A coro style interface to the filesystem."
+exports.tags = {"coro", "fs"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+local uv = require('luv')
+local fs = exports
+local pathJoin = require('path').join
+
+local function noop() end
+
+local function makeCallback()
+ local thread = coroutine.running()
+ return function (err, value, ...)
+ if err then
+ assert(coroutine.resume(thread, nil, err))
+ else
+ assert(coroutine.resume(thread, value == nil and true or value, ...))
+ end
+ end
+end
+
+function fs.mkdir(path, mode)
+ uv.fs_mkdir(path, mode or 511, makeCallback())
+ return coroutine.yield()
+end
+function fs.open(path, flags, mode)
+ uv.fs_open(path, flags or "r", mode or 438, makeCallback())
+ return coroutine.yield()
+end
+function fs.unlink(path)
+ uv.fs_unlink(path, makeCallback())
+ return coroutine.yield()
+end
+function fs.stat(path)
+ uv.fs_stat(path, makeCallback())
+ return coroutine.yield()
+end
+function fs.lstat(path)
+ uv.fs_lstat(path, makeCallback())
+ return coroutine.yield()
+end
+function fs.symlink(target, path)
+ uv.fs_symlink(target, path, makeCallback())
+ return coroutine.yield()
+end
+function fs.readlink(path)
+ uv.fs_readlink(path, makeCallback())
+ return coroutine.yield()
+end
+function fs.fstat(fd)
+ uv.fs_fstat(fd, makeCallback())
+ return coroutine.yield()
+end
+function fs.chmod(fd, path)
+ uv.fs_chmod(fd, path, makeCallback())
+ return coroutine.yield()
+end
+function fs.fchmod(fd, mode)
+ uv.fs_fchmod(fd, mode, makeCallback())
+ return coroutine.yield()
+end
+function fs.read(fd, length, offset)
+ uv.fs_read(fd, length or 1024*48, offset or -1, makeCallback())
+ return coroutine.yield()
+end
+function fs.write(fd, data, offset)
+ uv.fs_write(fd, data, offset or -1, makeCallback())
+ return coroutine.yield()
+end
+function fs.close(fd)
+ uv.fs_close(fd, makeCallback())
+ return coroutine.yield()
+end
+function fs.access(path, flags)
+ uv.fs_access(path, flags or "", makeCallback())
+ return coroutine.yield()
+end
+function fs.rename(path, newPath)
+ uv.fs_rename(path, newPath, makeCallback())
+ return coroutine.yield()
+end
+function fs.rmdir(path)
+ uv.fs_rmdir(path, makeCallback())
+ return coroutine.yield()
+end
+function fs.rmrf(path)
+ local success, err
+ success, err = fs.rmdir(path)
+ if success then return success end
+ if err:match("^ENOTDIR:") then return fs.unlink(path) end
+ if not err:match("^ENOTEMPTY:") then return success, err end
+ for entry in assert(fs.scandir(path)) do
+ local subPath = pathJoin(path, entry.name)
+ if entry.type == "directory" then
+ success, err = fs.rmrf(pathJoin(path, entry.name))
+ else
+ success, err = fs.unlink(subPath)
+ end
+ if not success then return success, err end
+ end
+ return fs.rmdir(path)
+end
+function fs.scandir(path)
+ uv.fs_scandir(path, makeCallback())
+ local req, err = coroutine.yield()
+ if not req then return nil, err end
+ return function ()
+ return uv.fs_scandir_next(req)
+ end
+end
+
+function fs.readFile(path)
+ local fd, stat, data, err
+ fd, err = fs.open(path)
+ if err then return nil, err end
+ stat, err = fs.fstat(fd)
+ if stat then
+ data, err = fs.read(fd, stat.size)
+ end
+ uv.fs_close(fd, noop)
+ return data, err
+end
+
+function fs.writeFile(path, data, mkdir)
+ local fd, success, err
+ fd, err = fs.open(path, "w")
+ if err then
+ if mkdir and string.match(err, "^ENOENT:") then
+ success, err = fs.mkdirp(pathJoin(path, ".."))
+ if success then return fs.writeFile(path, data) end
+ end
+ return nil, err
+ end
+ success, err = fs.write(fd, data)
+ uv.fs_close(fd, noop)
+ return success, err
+end
+
+function fs.mkdirp(path, mode)
+ local success, err = fs.mkdir(path, mode)
+ if success or string.match(err, "^EEXIST") then
+ return true
+ end
+ if string.match(err, "^ENOENT:") then
+ success, err = fs.mkdirp(pathJoin(path, ".."), mode)
+ if not success then return nil, err end
+ return fs.mkdir(path, mode)
+ end
+ return nil, err
+end
+
+function fs.chroot(base)
+ local chroot = {
+ base = base,
+ fstat = fs.fstat,
+ fchmod = fs.fchmod,
+ read = fs.read,
+ write = fs.write,
+ close = fs.close,
+ }
+ local function resolve(path)
+ assert(path, "path missing")
+ return pathJoin(base, pathJoin(path))
+ end
+ function chroot.mkdir(path, mode)
+ return fs.mkdir(resolve(path), mode)
+ end
+ function chroot.mkdirp(path, mode)
+ return fs.mkdirp(resolve(path), mode)
+ end
+ function chroot.open(path, flags, mode)
+ return fs.open(resolve(path), flags, mode)
+ end
+ function chroot.unlink(path)
+ return fs.unlink(resolve(path))
+ end
+ function chroot.stat(path)
+ return fs.stat(resolve(path))
+ end
+ function chroot.lstat(path)
+ return fs.lstat(resolve(path))
+ end
+ function chroot.symlink(target, path)
+ -- TODO: should we resolve absolute target paths or treat it as opaque data?
+ return fs.symlink(target, resolve(path))
+ end
+ function chroot.readlink(path)
+ return fs.readlink(resolve(path))
+ end
+ function chroot.chmod(path, mode)
+ return fs.chmod(resolve(path), mode)
+ end
+ function chroot.access(path, flags)
+ return fs.access(resolve(path), flags)
+ end
+ function chroot.rename(path, newPath)
+ return fs.rename(resolve(path), resolve(newPath))
+ end
+ function chroot.rmdir(path)
+ return fs.rmdir(resolve(path))
+ end
+ function chroot.rmrf(path)
+ return fs.rmrf(resolve(path))
+ end
+ function chroot.scandir(path, iter)
+ return fs.scandir(resolve(path), iter)
+ end
+ function chroot.readFile(path)
+ return fs.readFile(resolve(path))
+ end
+ function chroot.writeFile(path, data, mkdir)
+ return fs.writeFile(resolve(path), data, mkdir)
+ end
+ return chroot
+end
+
+return exports
diff --git a/plugins/coro-fs/plugin.json b/plugins/coro-fs/plugin.json
new file mode 100644
index 00000000000..c35d9e27315
--- /dev/null
+++ b/plugins/coro-fs/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "coro-fs",
+ "version": "1.3.0",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/coro-http/LICENSE b/plugins/coro-http/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/coro-http/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/coro-http/README.md b/plugins/coro-http/README.md
new file mode 100644
index 00000000000..271b6698f5d
--- /dev/null
+++ b/plugins/coro-http/README.md
@@ -0,0 +1,2 @@
+# luv-coro-http
+A luv port of lit's coro-http library.
diff --git a/plugins/coro-http/init.lua b/plugins/coro-http/init.lua
new file mode 100644
index 00000000000..49613403eaf
--- /dev/null
+++ b/plugins/coro-http/init.lua
@@ -0,0 +1,187 @@
+local exports = {}
+exports.name = "creationix/coro-http"
+exports.version = "1.2.1-1"
+exports.dependencies = {
+ "creationix/coro-net@1.1.1",
+ "creationix/coro-tls@1.2.1",
+ "creationix/coro-wrapper@1.0.0",
+ "luvit/http-codec@1.0.0"
+}
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/coro-http.lua"
+exports.description = "An coro style http(s) client and server helper."
+exports.tags = {"coro", "http"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+local httpCodec = require('http-codec')
+local net = require('coro-net')
+local connect = net.connect
+local createServer = net.createServer
+--local tlsWrap = require('coro-tls').wrap
+local wrapper = require('coro-wrapper')
+
+function exports.createServer(options, onConnect)
+ createServer(options, function (rawRead, rawWrite, socket)
+ local read = wrapper.reader(rawRead, httpCodec.decoder())
+ local write = wrapper.writer(rawWrite, httpCodec.encoder())
+ for head in read do
+ local parts = {}
+ for part in read do
+ if #part > 0 then
+ parts[#parts + 1] = part
+ else
+ break
+ end
+ end
+ local body = table.concat(parts)
+ head, body = onConnect(head, body, socket)
+ write(head)
+ if body then write(body) end
+ write("")
+ if not head.keepAlive then break end
+ end
+ end)
+end
+
+local function parseUrl(url)
+ local protocol, host, hostname, port, path = url:match("^(https?:)//(([^/:]+):?([0-9]*))(/?.*)$")
+ if not protocol then error("Not a valid http url: " .. url) end
+ local tls = protocol == "https:"
+ port = port and tonumber(port) or (tls and 443 or 80)
+ if path == "" then path = "/" end
+ return {
+ tls = tls,
+ host = host,
+ hostname = hostname,
+ port = port,
+ path = path
+ }
+end
+exports.parseUrl = parseUrl
+
+local connections = {}
+
+local function getConnection(host, port, tls)
+ for i = #connections, 1, -1 do
+ local connection = connections[i]
+ if connection.host == host and connection.port == port and connection.tls == tls then
+ table.remove(connections, i)
+ -- Make sure the connection is still alive before reusing it.
+ if not connection.socket:is_closing() then
+ connection.reused = true
+ connection.socket:ref()
+ return connection
+ end
+ end
+ end
+ local read, write, socket = assert(connect({host=host,port=port}))
+ --if tls then
+ --read, write = tlsWrap(read, write)
+ --end
+ local httpRead, updateRead = wrapper.reader(read, httpCodec.decoder())
+ return {
+ socket = socket,
+ host = host,
+ port = port,
+ tls = tls,
+ read = httpRead,
+ write = wrapper.writer(write, httpCodec.encoder()),
+ reset = function ()
+ -- This is called after parsing the response head from a HEAD request.
+ -- If you forget, the codec might hang waiting for a body that doesn't exist.
+ updateRead(httpCodec.decoder())
+ end
+ }
+end
+exports.getConnection = getConnection
+
+local function saveConnection(connection)
+ if connection.socket:is_closing() then return end
+ connections[#connections + 1] = connection
+ connection.socket:unref()
+end
+exports.saveConnection = saveConnection
+
+function exports.request(method, url, headers, body)
+ local uri = parseUrl(url)
+ local connection = getConnection(uri.hostname, uri.port, uri.tls)
+ local read = connection.read
+ local write = connection.write
+
+ local req = {
+ method = method,
+ path = uri.path,
+ {"Host", uri.host}
+ }
+ local contentLength
+ local chunked
+ if headers then
+ for i = 1, #headers do
+ local key, value = unpack(headers[i])
+ key = key:lower()
+ if key == "content-length" then
+ contentLength = value
+ elseif key == "content-encoding" and value:lower() == "chunked" then
+ chunked = true
+ end
+ req[#req + 1] = headers[i]
+ end
+ end
+
+ if type(body) == "string" then
+ if not chunked and not contentLength then
+ req[#req + 1] = {"Content-Length", #body}
+ end
+ end
+
+ write(req)
+ if body then write(body) end
+ local res = read()
+ if not res then
+ write()
+ -- If we get an immediate close on a reused socket, try again with a new socket.
+ -- TODO: think about if this could resend requests with side effects and cause
+ -- them to double execute in the remote server.
+ if connection.reused then
+ return exports.request(method, url, headers, body)
+ end
+ error("Connection closed")
+ end
+
+ body = {}
+ if req.method == "HEAD" then
+ connection.reset()
+ else
+ while true do
+ local item = read()
+ if not item then
+ res.keepAlive = false
+ break
+ end
+ if #item == 0 then
+ break
+ end
+ body[#body + 1] = item
+ end
+ end
+
+ if res.keepAlive then
+ saveConnection(connection)
+ else
+ write()
+ end
+
+ -- Follow redirects
+ if method == "GET" and (res.code == 302 or res.code == 307) then
+ for i = 1, #res do
+ local key, location = unpack(res[i])
+ if key:lower() == "location" then
+ return exports.request(method, location, headers)
+ end
+ end
+ end
+
+ return res, table.concat(body)
+end
+
+return exports
diff --git a/plugins/coro-http/plugin.json b/plugins/coro-http/plugin.json
new file mode 100644
index 00000000000..0c8047c9ebe
--- /dev/null
+++ b/plugins/coro-http/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "coro-http",
+ "version": "1.2.1-1",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/coro-net/LICENSE b/plugins/coro-net/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/coro-net/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/coro-net/README.md b/plugins/coro-net/README.md
new file mode 100644
index 00000000000..c8a94b9980a
--- /dev/null
+++ b/plugins/coro-net/README.md
@@ -0,0 +1,2 @@
+# luv-coro-net
+A luv port of creationix/coro-net from lit.luvit.io
diff --git a/plugins/coro-net/init.lua b/plugins/coro-net/init.lua
new file mode 100644
index 00000000000..3ae6c2ad824
--- /dev/null
+++ b/plugins/coro-net/init.lua
@@ -0,0 +1,113 @@
+local exports = {}
+exports.name = "creationix/coro-net"
+exports.version = "1.1.1-1"
+exports.dependencies = {
+ "creationix/coro-channel@1.2.0"
+}
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/coro-net.lua"
+exports.description = "An coro style client and server helper for tcp and pipes."
+exports.tags = {"coro", "tcp", "pipe", "net"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+local uv = require('luv')
+local wrapStream = require('coro-channel').wrapStream
+
+local function makeCallback(timeout)
+ local thread = coroutine.running()
+ local timer, done
+ if timeout then
+ timer = uv.new_timer()
+ timer:start(timeout, 0, function ()
+ if done then return end
+ done = true
+ timer:close()
+ return assert(coroutine.resume(thread, nil, "timeout"))
+ end)
+ end
+ return function (err, data)
+ if done then return end
+ done = true
+ if timer then timer:close() end
+ if err then
+ return assert(coroutine.resume(thread, nil, err))
+ end
+ return assert(coroutine.resume(thread, data or true))
+ end
+end
+exports.makeCallback = makeCallback
+
+local function normalize(options)
+ local t = type(options)
+ if t == "string" then
+ options = {path=options}
+ elseif t == "number" then
+ options = {port=options}
+ elseif t ~= "table" then
+ assert("Net options must be table, string, or number")
+ end
+ if options.port or options.host then
+ return true,
+ options.host or "127.0.0.1",
+ assert(options.port, "options.port is required for tcp connections")
+ elseif options.path then
+ return false, options.path
+ else
+ error("Must set either options.path or options.port")
+ end
+end
+
+function exports.connect(options)
+ local socket, success, err
+ local isTcp, host, port = normalize(options)
+ if isTcp then
+ assert(uv.getaddrinfo(host, port, {
+ socktype = options.socktype or "stream",
+ family = options.family or "inet",
+ }, makeCallback(options.timeout)))
+ local res
+ res, err = coroutine.yield()
+ if not res then return nil, err end
+ socket = uv.new_tcp()
+ socket:connect(res[1].addr, res[1].port, makeCallback(options.timeout))
+ else
+ socket = uv.new_pipe(false)
+ socket:connect(host, makeCallback(options.timeout))
+ end
+ success, err = coroutine.yield()
+ if not success then return nil, err end
+ local read, write = wrapStream(socket)
+ return read, write, socket
+end
+
+function exports.createServer(options, onConnect)
+ local server
+ local isTcp, host, port = normalize(options)
+ if isTcp then
+ server = uv.new_tcp()
+ assert(server:bind(host, port))
+ else
+ server = uv.new_pipe(false)
+ assert(server:bind(host))
+ end
+ assert(server:listen(256, function (err)
+ assert(not err, err)
+ local socket = isTcp and uv.new_tcp() or uv.new_pipe(false)
+ server:accept(socket)
+ coroutine.wrap(function ()
+ local success, failure = xpcall(function ()
+ local read, write = wrapStream(socket)
+ return onConnect(read, write, socket)
+ end, debug.traceback)
+ if not success then
+ print(failure)
+ end
+ if not socket:is_closing() then
+ socket:close()
+ end
+ end)()
+ end))
+ return server
+end
+
+return exports
diff --git a/plugins/coro-net/plugin.json b/plugins/coro-net/plugin.json
new file mode 100644
index 00000000000..cf839aad881
--- /dev/null
+++ b/plugins/coro-net/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "coro-net",
+ "version": "1.1.1-1",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/coro-tls/LICENSE b/plugins/coro-tls/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/coro-tls/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/coro-tls/README.md b/plugins/coro-tls/README.md
new file mode 100644
index 00000000000..50aae3f7657
--- /dev/null
+++ b/plugins/coro-tls/README.md
@@ -0,0 +1,2 @@
+# luv-coro-tls
+A luv port of lit's coro-tls module
diff --git a/plugins/coro-tls/init.lua b/plugins/coro-tls/init.lua
new file mode 100644
index 00000000000..03d6e1c3f76
--- /dev/null
+++ b/plugins/coro-tls/init.lua
@@ -0,0 +1,122 @@
+local exports = {}
+exports.name = "creationix/coro-tls"
+exports.version = "1.2.1"
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/coro-tls.lua"
+exports.description = "A coro-stream wrapper implementing tls sessions."
+exports.tags = {"coro", "tls", "ssl"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+local openssl = require('openssl')
+local bit = require('bit')
+
+local DEFAULT_CIPHERS = 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:' .. -- TLS 1.2
+ 'RC4:HIGH:!MD5:!aNULL:!EDH' -- TLS 1.0
+
+-- Given a read/write pair, return a new read/write pair for plaintext
+exports.wrap = function (read, write, options)
+ if not options then
+ options = {}
+ end
+
+ local ctx = openssl.ssl.ctx_new(options.protocol or 'TLSv1_2', options.ciphers or DEFAULT_CIPHERS)
+
+ local key, cert, ca
+ if options.key then
+ key = assert(openssl.pkey.read(options.key, true, 'pem'))
+ end
+ if options.cert then
+ cert = assert(openssl.x509.read(options.cert))
+ end
+ if options.ca then
+ if type(options.ca) == "string" then
+ ca = { assert(openssl.x509.read(options.ca)) }
+ elseif type(options.ca) == "table" then
+ ca = {}
+ for i = 1, #options.ca do
+ ca[i] = assert(openssl.x509.read(options.ca[i]))
+ end
+ else
+ error("options.ca must be string or table of strings")
+ end
+ end
+ if key and cert then
+ assert(ctx:use(key, cert))
+ end
+ if ca then
+ local store = openssl.x509.store:new()
+ for i = 1, #ca do
+ assert(store:add(ca[i]))
+ end
+ ctx:cert_store(store)
+ else
+ ctx:verify_mode({"none"})
+ end
+
+ ctx:options(bit.bor(
+ openssl.ssl.no_sslv2,
+ openssl.ssl.no_sslv3,
+ openssl.ssl.no_compression))
+ local bin, bout = openssl.bio.mem(8192), openssl.bio.mem(8192)
+ local ssl = ctx:ssl(bin, bout, options.server)
+
+ local function flush()
+ while bout:pending() > 0 do
+ write(bout:read())
+ end
+ end
+
+ -- Do handshake
+ while true do
+ if ssl:handshake() then break end
+ flush()
+ local chunk = read()
+ if chunk then
+ bin:write(chunk)
+ else
+ error("disconnect while handshaking")
+ end
+ end
+ flush()
+
+ local done = false
+ local function shutdown()
+ if done then return end
+ done = true
+ while true do
+ if ssl:shutdown() then break end
+ flush()
+ local chunk = read()
+ if chunk then
+ bin:write(chunk)
+ else
+ break
+ end
+ end
+ flush()
+ write()
+ end
+
+ local function plainRead()
+ while true do
+ local chunk = ssl:read()
+ if chunk then return chunk end
+ local cipher = read()
+ if not cipher then return end
+ bin:write(cipher)
+ end
+ end
+
+ local function plainWrite(plain)
+ if not plain then
+ return shutdown()
+ end
+ ssl:write(plain)
+ flush()
+ end
+
+ return plainRead, plainWrite
+
+end
+
+return exports
diff --git a/plugins/coro-tls/plugin.json b/plugins/coro-tls/plugin.json
new file mode 100644
index 00000000000..257224e2ea3
--- /dev/null
+++ b/plugins/coro-tls/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "coro-tls",
+ "version": "1.2.1",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/coro-wrapper/LICENSE b/plugins/coro-wrapper/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/coro-wrapper/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/coro-wrapper/README.md b/plugins/coro-wrapper/README.md
new file mode 100644
index 00000000000..a9351a7f531
--- /dev/null
+++ b/plugins/coro-wrapper/README.md
@@ -0,0 +1,2 @@
+# luv-coro-wrapper
+A luv port of lit's coro-wrapper module
diff --git a/plugins/coro-wrapper/init.lua b/plugins/coro-wrapper/init.lua
new file mode 100644
index 00000000000..aab2683baf3
--- /dev/null
+++ b/plugins/coro-wrapper/init.lua
@@ -0,0 +1,41 @@
+local exports = {}
+exports.name = "creationix/coro-wrapper"
+exports.version = "1.0.0-1"
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/coro-wrapper.lua"
+exports.description = "An adapter for applying decoders to coro-streams."
+exports.tags = {"coro", "decoder", "adapter"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+function exports.reader(read, decode)
+ local buffer = ""
+ return function ()
+ while true do
+ local item, extra = decode(buffer)
+ if item then
+ buffer = extra
+ return item
+ end
+ local chunk = read()
+ if not chunk then return end
+ buffer = buffer .. chunk
+ end
+ end,
+ function (newDecode)
+ decode = newDecode
+ end
+end
+
+function exports.writer(write, encode)
+ return function (item)
+ if not item then
+ return write()
+ end
+ return write(encode(item))
+ end,
+ function (newEncode)
+ encode = newEncode
+ end
+end
+
+return exports
diff --git a/plugins/coro-wrapper/plugin.json b/plugins/coro-wrapper/plugin.json
new file mode 100644
index 00000000000..6075edba1fa
--- /dev/null
+++ b/plugins/coro-wrapper/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "coro-wrapper",
+ "version": "1.0.0-1",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/dummy/init.lua b/plugins/dummy/init.lua
new file mode 100644
index 00000000000..8c4fbe6a0f5
--- /dev/null
+++ b/plugins/dummy/init.lua
@@ -0,0 +1,20 @@
+local exports = {}
+exports.name = "dummy"
+exports.version = "0.0.1"
+exports.description = "A dummy example"
+exports.license = "MIT"
+exports.author = { name = "Miodrag Milanovic" }
+
+local dummy = exports
+
+function dummy.startplugin()
+ emu.register_start(function()
+ print("Starting " .. emu.gamename())
+ end)
+
+ emu.register_stop(function()
+ print("Exiting " .. emu.gamename())
+ end)
+end
+
+return exports
diff --git a/plugins/dummy/plugin.json b/plugins/dummy/plugin.json
new file mode 100644
index 00000000000..4d877fa4dfa
--- /dev/null
+++ b/plugins/dummy/plugin.json
@@ -0,0 +1,9 @@
+{
+ "plugin": {
+ "name": "dummy",
+ "version": "0.0.1",
+ "author": "Miodrag Milanovic",
+ "type": "plugin",
+ "start": "false",
+ }
+} \ No newline at end of file
diff --git a/plugins/http-codec/LICENSE b/plugins/http-codec/LICENSE
new file mode 100644
index 00000000000..8f71f43fee3
--- /dev/null
+++ b/plugins/http-codec/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/plugins/http-codec/README.md b/plugins/http-codec/README.md
new file mode 100644
index 00000000000..80d050416ae
--- /dev/null
+++ b/plugins/http-codec/README.md
@@ -0,0 +1,2 @@
+# luv-http-codec
+A luv port of luvit's http-codec
diff --git a/plugins/http-codec/init.lua b/plugins/http-codec/init.lua
new file mode 100644
index 00000000000..11a32945729
--- /dev/null
+++ b/plugins/http-codec/init.lua
@@ -0,0 +1,291 @@
+--[[
+
+Copyright 2014-2015 The Luvit Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS-IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--]]
+
+local exports = {}
+
+exports.name = "luvit/http-codec"
+exports.version = "1.0.0-1"
+exports.homepage = "https://github.com/luvit/luvit/blob/master/deps/http-codec.lua"
+exports.description = "A simple pair of functions for converting between hex and raw strings."
+exports.tags = {"codec", "http"}
+exports.license = "Apache 2"
+exports.author = { name = "Tim Caswell" }
+
+local sub = string.sub
+local gsub = string.gsub
+local lower = string.lower
+local find = string.find
+local format = string.format
+local concat = table.concat
+local match = string.match
+
+local STATUS_CODES = {
+ [100] = 'Continue',
+ [101] = 'Switching Protocols',
+ [102] = 'Processing', -- RFC 2518, obsoleted by RFC 4918
+ [200] = 'OK',
+ [201] = 'Created',
+ [202] = 'Accepted',
+ [203] = 'Non-Authoritative Information',
+ [204] = 'No Content',
+ [205] = 'Reset Content',
+ [206] = 'Partial Content',
+ [207] = 'Multi-Status', -- RFC 4918
+ [300] = 'Multiple Choices',
+ [301] = 'Moved Permanently',
+ [302] = 'Moved Temporarily',
+ [303] = 'See Other',
+ [304] = 'Not Modified',
+ [305] = 'Use Proxy',
+ [307] = 'Temporary Redirect',
+ [400] = 'Bad Request',
+ [401] = 'Unauthorized',
+ [402] = 'Payment Required',
+ [403] = 'Forbidden',
+ [404] = 'Not Found',
+ [405] = 'Method Not Allowed',
+ [406] = 'Not Acceptable',
+ [407] = 'Proxy Authentication Required',
+ [408] = 'Request Time-out',
+ [409] = 'Conflict',
+ [410] = 'Gone',
+ [411] = 'Length Required',
+ [412] = 'Precondition Failed',
+ [413] = 'Request Entity Too Large',
+ [414] = 'Request-URI Too Large',
+ [415] = 'Unsupported Media Type',
+ [416] = 'Requested Range Not Satisfiable',
+ [417] = 'Expectation Failed',
+ [418] = "I'm a teapot", -- RFC 2324
+ [422] = 'Unprocessable Entity', -- RFC 4918
+ [423] = 'Locked', -- RFC 4918
+ [424] = 'Failed Dependency', -- RFC 4918
+ [425] = 'Unordered Collection', -- RFC 4918
+ [426] = 'Upgrade Required', -- RFC 2817
+ [500] = 'Internal Server Error',
+ [501] = 'Not Implemented',
+ [502] = 'Bad Gateway',
+ [503] = 'Service Unavailable',
+ [504] = 'Gateway Time-out',
+ [505] = 'HTTP Version not supported',
+ [506] = 'Variant Also Negotiates', -- RFC 2295
+ [507] = 'Insufficient Storage', -- RFC 4918
+ [509] = 'Bandwidth Limit Exceeded',
+ [510] = 'Not Extended' -- RFC 2774
+}
+
+exports.encoder = function ()
+
+ local mode
+ local encodeHead, encodeRaw, encodeChunked
+
+ function encodeHead(item)
+ if not item or item == "" then
+ return item
+ elseif not (type(item) == "table") then
+ error("expected a table but got a " .. type(item) .. " when encoding data")
+ end
+ local head, chunkedEncoding
+ local version = item.version or 1.1
+ if item.method then
+ local path = item.path
+ assert(path and #path > 0, "expected non-empty path")
+ head = { item.method .. ' ' .. item.path .. ' HTTP/' .. version .. '\r\n' }
+ else
+ local reason = item.reason or STATUS_CODES[item.code]
+ head = { 'HTTP/' .. version .. ' ' .. item.code .. ' ' .. reason .. '\r\n' }
+ end
+ for i = 1, #item do
+ local key, value = unpack(item[i])
+ local lowerKey = lower(key)
+ if lowerKey == "transfer-encoding" then
+ chunkedEncoding = lower(value) == "chunked"
+ end
+ value = gsub(tostring(value), "[\r\n]+", " ")
+ head[#head + 1] = key .. ': ' .. tostring(value) .. '\r\n'
+ end
+ head[#head + 1] = '\r\n'
+
+ mode = chunkedEncoding and encodeChunked or encodeRaw
+ return concat(head)
+ end
+
+ function encodeRaw(item)
+ if type(item) ~= "string" then
+ mode = encodeHead
+ return encodeHead(item)
+ end
+ return item
+ end
+
+ function encodeChunked(item)
+ if type(item) ~= "string" then
+ mode = encodeHead
+ local extra = encodeHead(item)
+ if extra then
+ return "0\r\n\r\n" .. extra
+ else
+ return "0\r\n\r\n"
+ end
+ end
+ if #item == 0 then
+ mode = encodeHead
+ end
+ return format("%x", #item) .. "\r\n" .. item .. "\r\n"
+ end
+
+ mode = encodeHead
+ return function (item)
+ return mode(item)
+ end
+end
+
+exports.decoder = function ()
+
+ -- This decoder is somewhat stateful with 5 different parsing states.
+ local decodeHead, decodeEmpty, decodeRaw, decodeChunked, decodeCounted
+ local mode -- state variable that points to various decoders
+ local bytesLeft -- For counted decoder
+
+ -- This state is for decoding the status line and headers.
+ function decodeHead(chunk)
+ if not chunk then return end
+
+ local _, length = find(chunk, "\r?\n\r?\n", 1)
+ -- First make sure we have all the head before continuing
+ if not length then
+ if #chunk < 8 * 1024 then return end
+ -- But protect against evil clients by refusing heads over 8K long.
+ error("entity too large")
+ end
+
+ -- Parse the status/request line
+ local head = {}
+ local _, offset
+ local version
+ _, offset, version, head.code, head.reason =
+ find(chunk, "^HTTP/(%d%.%d) (%d+) ([^\r\n]+)\r?\n")
+ if offset then
+ head.code = tonumber(head.code)
+ else
+ _, offset, head.method, head.path, version =
+ find(chunk, "^(%u+) ([^ ]+) HTTP/(%d%.%d)\r?\n")
+ if not offset then
+ error("expected HTTP data")
+ end
+ end
+ version = tonumber(version)
+ head.version = version
+ head.keepAlive = version > 1.0
+
+ -- We need to inspect some headers to know how to parse the body.
+ local contentLength
+ local chunkedEncoding
+
+ -- Parse the header lines
+ while true do
+ local key, value
+ _, offset, key, value = find(chunk, "^([^:\r\n]+): *([^\r\n]+)\r?\n", offset + 1)
+ if not offset then break end
+ local lowerKey = lower(key)
+
+ -- Inspect a few headers and remember the values
+ if lowerKey == "content-length" then
+ contentLength = tonumber(value)
+ elseif lowerKey == "transfer-encoding" then
+ chunkedEncoding = lower(value) == "chunked"
+ elseif lowerKey == "connection" then
+ head.keepAlive = lower(value) == "keep-alive"
+ end
+ head[#head + 1] = {key, value}
+ end
+
+ if head.keepAlive and (not (chunkedEncoding or (contentLength and contentLength > 0)))
+ or (head.method == "GET" or head.method == "HEAD") then
+ mode = decodeEmpty
+ elseif chunkedEncoding then
+ mode = decodeChunked
+ elseif contentLength then
+ bytesLeft = contentLength
+ mode = decodeCounted
+ elseif not head.keepAlive then
+ mode = decodeRaw
+ end
+
+ return head, sub(chunk, length + 1)
+
+ end
+
+ -- This is used for inserting a single empty string into the output string for known empty bodies
+ function decodeEmpty(chunk)
+ mode = decodeHead
+ return "", chunk or ""
+ end
+
+ function decodeRaw(chunk)
+ if not chunk then return "", "" end
+ if #chunk == 0 then return end
+ return chunk, ""
+ end
+
+ function decodeChunked(chunk)
+ local len, term
+ len, term = match(chunk, "^(%x+)(..)")
+ if not len then return end
+ assert(term == "\r\n")
+ local length = tonumber(len, 16)
+ if #chunk < length + 4 + #len then return end
+ if length == 0 then
+ mode = decodeHead
+ end
+ chunk = sub(chunk, #len + 3)
+ assert(sub(chunk, length + 1, length + 2) == "\r\n")
+ return sub(chunk, 1, length), sub(chunk, length + 3)
+ end
+
+ function decodeCounted(chunk)
+ if bytesLeft == 0 then
+ mode = decodeEmpty
+ return mode(chunk)
+ end
+ local length = #chunk
+ -- Make sure we have at least one byte to process
+ if length == 0 then return end
+
+ if length >= bytesLeft then
+ mode = decodeEmpty
+ end
+
+ -- If the entire chunk fits, pass it all through
+ if length <= bytesLeft then
+ bytesLeft = bytesLeft - length
+ return chunk, ""
+ end
+
+ return sub(chunk, 1, bytesLeft), sub(chunk, bytesLeft + 1)
+ end
+
+ -- Switch between states by changing which decoder mode points to
+ mode = decodeHead
+ return function (chunk)
+ return mode(chunk)
+ end
+
+end
+
+return exports
diff --git a/plugins/http-codec/plugin.json b/plugins/http-codec/plugin.json
new file mode 100644
index 00000000000..ce511afa785
--- /dev/null
+++ b/plugins/http-codec/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "http-codec",
+ "version": "1.0.0-1",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/json/LICENSE b/plugins/json/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/json/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/json/README.md b/plugins/json/README.md
new file mode 100644
index 00000000000..71965e3d0f7
--- /dev/null
+++ b/plugins/json/README.md
@@ -0,0 +1,2 @@
+# luv-json
+A luv port of luvit's json module
diff --git a/plugins/json/init.lua b/plugins/json/init.lua
new file mode 100644
index 00000000000..d49352cc6ff
--- /dev/null
+++ b/plugins/json/init.lua
@@ -0,0 +1,732 @@
+local exports = {}
+exports.name = "luvit/json"
+exports.version = "2.5.0"
+exports.homepage = "http://dkolf.de/src/dkjson-lua.fsl"
+exports.description = "David Kolf's JSON library repackaged for lit."
+exports.tags = {"json", "codec"}
+exports.license = "MIT"
+exports.author = {
+ name = "David Kolf",
+ homepage = "http://dkolf.de/",
+}
+exports.contributors = {
+ "Tim Caswell",
+}
+
+-- Module options:
+local always_try_using_lpeg = false
+local register_global_module_table = false
+local global_module_name = 'json'
+
+--[==[
+
+David Kolf's JSON module for Lua 5.1/5.2
+
+Version 2.5
+
+
+For the documentation see the corresponding readme.txt or visit
+<http://dkolf.de/src/dkjson-lua.fsl/>.
+
+You can contact the author by sending an e-mail to 'david' at the
+domain 'dkolf.de'.
+
+
+Copyright (C) 2010-2013 David Heiko Kolf
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+--]==]
+
+-- global dependencies:
+local pairs, type, tostring, tonumber, getmetatable, setmetatable =
+ pairs, type, tostring, tonumber, getmetatable, setmetatable
+local error, require, pcall, select = error, require, pcall, select
+local floor, huge = math.floor, math.huge
+local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat =
+ string.rep, string.gsub, string.sub, string.byte, string.char,
+ string.find, string.len, string.format
+local strmatch = string.match
+local concat = table.concat
+
+local json = exports
+json.original_version = "dkjson 2.5"
+
+if register_global_module_table then
+ _G[global_module_name] = json
+end
+
+_ENV = nil -- blocking globals in Lua 5.2
+
+pcall (function()
+ -- Enable access to blocked metatables.
+ -- Don't worry, this module doesn't change anything in them.
+ local debmeta = require "debug".getmetatable
+ if debmeta then getmetatable = debmeta end
+end)
+
+json.null = setmetatable ({}, {
+ __tojson = function () return "null" end
+})
+
+local function isarray (tbl)
+ local max, n, arraylen = 0, 0, 0
+ for k,v in pairs (tbl) do
+ if k == 'n' and type(v) == 'number' then
+ arraylen = v
+ if v > max then
+ max = v
+ end
+ else
+ if type(k) ~= 'number' or k < 1 or floor(k) ~= k then
+ return false
+ end
+ if k > max then
+ max = k
+ end
+ n = n + 1
+ end
+ end
+ if max > 10 and max > arraylen and max > n * 2 then
+ return false -- don't create an array with too many holes
+ end
+ return true, max
+end
+
+local escapecodes = {
+ ["\""] = "\\\"", ["\\"] = "\\\\", ["\b"] = "\\b", ["\f"] = "\\f",
+ ["\n"] = "\\n", ["\r"] = "\\r", ["\t"] = "\\t"
+}
+
+local function escapeutf8 (uchar)
+ local value = escapecodes[uchar]
+ if value then
+ return value
+ end
+ local a, b, c, d = strbyte (uchar, 1, 4)
+ a, b, c, d = a or 0, b or 0, c or 0, d or 0
+ if a <= 0x7f then
+ value = a
+ elseif 0xc0 <= a and a <= 0xdf and b >= 0x80 then
+ value = (a - 0xc0) * 0x40 + b - 0x80
+ elseif 0xe0 <= a and a <= 0xef and b >= 0x80 and c >= 0x80 then
+ value = ((a - 0xe0) * 0x40 + b - 0x80) * 0x40 + c - 0x80
+ elseif 0xf0 <= a and a <= 0xf7 and b >= 0x80 and c >= 0x80 and d >= 0x80 then
+ value = (((a - 0xf0) * 0x40 + b - 0x80) * 0x40 + c - 0x80) * 0x40 + d - 0x80
+ else
+ return ""
+ end
+ if value <= 0xffff then
+ return strformat ("\\u%.4x", value)
+ elseif value <= 0x10ffff then
+ -- encode as UTF-16 surrogate pair
+ value = value - 0x10000
+ local highsur, lowsur = 0xD800 + floor (value/0x400), 0xDC00 + (value % 0x400)
+ return strformat ("\\u%.4x\\u%.4x", highsur, lowsur)
+ else
+ return ""
+ end
+end
+
+local function fsub (str, pattern, repl)
+ -- gsub always builds a new string in a buffer, even when no match
+ -- exists. First using find should be more efficient when most strings
+ -- don't contain the pattern.
+ if strfind (str, pattern) then
+ return gsub (str, pattern, repl)
+ else
+ return str
+ end
+end
+
+local function quotestring (value)
+ -- based on the regexp "escapable" in https://github.com/douglascrockford/JSON-js
+ value = fsub (value, "[%z\1-\31\"\\\127]", escapeutf8)
+ if strfind (value, "[\194\216\220\225\226\239]") then
+ value = fsub (value, "\194[\128-\159\173]", escapeutf8)
+ value = fsub (value, "\216[\128-\132]", escapeutf8)
+ value = fsub (value, "\220\143", escapeutf8)
+ value = fsub (value, "\225\158[\180\181]", escapeutf8)
+ value = fsub (value, "\226\128[\140-\143\168-\175]", escapeutf8)
+ value = fsub (value, "\226\129[\160-\175]", escapeutf8)
+ value = fsub (value, "\239\187\191", escapeutf8)
+ value = fsub (value, "\239\191[\176-\191]", escapeutf8)
+ end
+ return "\"" .. value .. "\""
+end
+json.quotestring = quotestring
+
+local function replace(str, o, n)
+ local i, j = strfind (str, o, 1, true)
+ if i then
+ return strsub(str, 1, i-1) .. n .. strsub(str, j+1, -1)
+ else
+ return str
+ end
+end
+
+-- locale independent num2str and str2num functions
+local decpoint, numfilter
+
+local function updatedecpoint ()
+ decpoint = strmatch(tostring(0.5), "([^05+])")
+ -- build a filter that can be used to remove group separators
+ numfilter = "[^0-9%-%+eE" .. gsub(decpoint, "[%^%$%(%)%%%.%[%]%*%+%-%?]", "%%%0") .. "]+"
+end
+
+updatedecpoint()
+
+local function num2str (num)
+ return replace(fsub(tostring(num), numfilter, ""), decpoint, ".")
+end
+
+local function str2num (str)
+ local num = tonumber(replace(str, ".", decpoint))
+ if not num then
+ updatedecpoint()
+ num = tonumber(replace(str, ".", decpoint))
+ end
+ return num
+end
+
+local function addnewline2 (level, buffer, buflen)
+ buffer[buflen+1] = "\n"
+ buffer[buflen+2] = strrep (" ", level)
+ buflen = buflen + 2
+ return buflen
+end
+
+function json.addnewline (state)
+ if state.indent then
+ state.bufferlen = addnewline2 (state.level or 0,
+ state.buffer, state.bufferlen or #(state.buffer))
+ end
+end
+
+local encode2 -- forward declaration
+
+local function addpair (key, value, prev, indent, level, buffer, buflen, tables, globalorder, state)
+ local kt = type (key)
+ if kt ~= 'string' and kt ~= 'number' then
+ return nil, "type '" .. kt .. "' is not supported as a key by JSON."
+ end
+ if prev then
+ buflen = buflen + 1
+ buffer[buflen] = ","
+ end
+ if indent then
+ buflen = addnewline2 (level, buffer, buflen)
+ end
+ buffer[buflen+1] = quotestring (key)
+ buffer[buflen+2] = ":"
+ return encode2 (value, indent, level, buffer, buflen + 2, tables, globalorder, state)
+end
+
+local function appendcustom(res, buffer, state)
+ local buflen = state.bufferlen
+ if type (res) == 'string' then
+ buflen = buflen + 1
+ buffer[buflen] = res
+ end
+ return buflen
+end
+
+local function exception(reason, value, state, buffer, buflen, defaultmessage)
+ defaultmessage = defaultmessage or reason
+ local handler = state.exception
+ if not handler then
+ return nil, defaultmessage
+ else
+ state.bufferlen = buflen
+ local ret, msg = handler (reason, value, state, defaultmessage)
+ if not ret then return nil, msg or defaultmessage end
+ return appendcustom(ret, buffer, state)
+ end
+end
+
+function json.encodeexception(reason, value, state, defaultmessage)
+ return quotestring("<" .. defaultmessage .. ">")
+end
+
+encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, state)
+ local valtype = type (value)
+ local valmeta = getmetatable (value)
+ valmeta = type (valmeta) == 'table' and valmeta -- only tables
+ local valtojson = valmeta and valmeta.__tojson
+ if valtojson then
+ if tables[value] then
+ return exception('reference cycle', value, state, buffer, buflen)
+ end
+ tables[value] = true
+ state.bufferlen = buflen
+ local ret, msg = valtojson (value, state)
+ if not ret then return exception('custom encoder failed', value, state, buffer, buflen, msg) end
+ tables[value] = nil
+ buflen = appendcustom(ret, buffer, state)
+ elseif value == nil then
+ buflen = buflen + 1
+ buffer[buflen] = "null"
+ elseif valtype == 'number' then
+ local s
+ if value ~= value or value >= huge or -value >= huge then
+ -- This is the behaviour of the original JSON implementation.
+ s = "null"
+ else
+ s = num2str (value)
+ end
+ buflen = buflen + 1
+ buffer[buflen] = s
+ elseif valtype == 'boolean' then
+ buflen = buflen + 1
+ buffer[buflen] = value and "true" or "false"
+ elseif valtype == 'string' then
+ buflen = buflen + 1
+ buffer[buflen] = quotestring (value)
+ elseif valtype == 'table' then
+ if tables[value] then
+ return exception('reference cycle', value, state, buffer, buflen)
+ end
+ tables[value] = true
+ level = level + 1
+ local isa, n = isarray (value)
+ if n == 0 and valmeta and valmeta.__jsontype == 'object' then
+ isa = false
+ end
+ local msg
+ if isa then -- JSON array
+ buflen = buflen + 1
+ buffer[buflen] = "["
+ for i = 1, n do
+ buflen, msg = encode2 (value[i], indent, level, buffer, buflen, tables, globalorder, state)
+ if not buflen then return nil, msg end
+ if i < n then
+ buflen = buflen + 1
+ buffer[buflen] = ","
+ end
+ end
+ buflen = buflen + 1
+ buffer[buflen] = "]"
+ else -- JSON object
+ local prev = false
+ buflen = buflen + 1
+ buffer[buflen] = "{"
+ local order = valmeta and valmeta.__jsonorder or globalorder
+ if order then
+ local used = {}
+ n = #order
+ for i = 1, n do
+ local k = order[i]
+ local v = value[k]
+ local _
+ if v then
+ used[k] = true
+ buflen, _ = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
+ prev = true -- add a seperator before the next element
+ end
+ end
+ for k,v in pairs (value) do
+ if not used[k] then
+ buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
+ if not buflen then return nil, msg end
+ prev = true -- add a seperator before the next element
+ end
+ end
+ else -- unordered
+ for k,v in pairs (value) do
+ buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
+ if not buflen then return nil, msg end
+ prev = true -- add a seperator before the next element
+ end
+ end
+ if indent then
+ buflen = addnewline2 (level - 1, buffer, buflen)
+ end
+ buflen = buflen + 1
+ buffer[buflen] = "}"
+ end
+ tables[value] = nil
+ else
+ return exception ('unsupported type', value, state, buffer, buflen,
+ "type '" .. valtype .. "' is not supported by JSON.")
+ end
+ return buflen
+end
+
+function json.encode (value, state)
+ state = state or {}
+ local oldbuffer = state.buffer
+ local buffer = oldbuffer or {}
+ state.buffer = buffer
+ updatedecpoint()
+ local ret, msg = encode2 (value, state.indent, state.level or 0,
+ buffer, state.bufferlen or 0, state.tables or {}, state.keyorder, state)
+ if not ret then
+ error (msg, 2)
+ elseif oldbuffer == buffer then
+ state.bufferlen = ret
+ return true
+ else
+ state.bufferlen = nil
+ state.buffer = nil
+ return concat (buffer)
+ end
+end
+
+local function loc (str, where)
+ local line, pos, linepos = 1, 1, 0
+ while true do
+ pos = strfind (str, "\n", pos, true)
+ if pos and pos < where then
+ line = line + 1
+ linepos = pos
+ pos = pos + 1
+ else
+ break
+ end
+ end
+ return "line " .. line .. ", column " .. (where - linepos)
+end
+
+local function unterminated (str, what, where)
+ return nil, strlen (str) + 1, "unterminated " .. what .. " at " .. loc (str, where)
+end
+
+local function scanwhite (str, pos)
+ while true do
+ pos = strfind (str, "%S", pos)
+ if not pos then return nil end
+ local sub2 = strsub (str, pos, pos + 1)
+ if sub2 == "\239\187" and strsub (str, pos + 2, pos + 2) == "\191" then
+ -- UTF-8 Byte Order Mark
+ pos = pos + 3
+ elseif sub2 == "//" then
+ pos = strfind (str, "[\n\r]", pos + 2)
+ if not pos then return nil end
+ elseif sub2 == "/*" then
+ pos = strfind (str, "*/", pos + 2)
+ if not pos then return nil end
+ pos = pos + 2
+ else
+ return pos
+ end
+ end
+end
+
+local escapechars = {
+ ["\""] = "\"", ["\\"] = "\\", ["/"] = "/", ["b"] = "\b", ["f"] = "\f",
+ ["n"] = "\n", ["r"] = "\r", ["t"] = "\t"
+}
+
+local function unichar (value)
+ if value < 0 then
+ return nil
+ elseif value <= 0x007f then
+ return strchar (value)
+ elseif value <= 0x07ff then
+ return strchar (0xc0 + floor(value/0x40),
+ 0x80 + (floor(value) % 0x40))
+ elseif value <= 0xffff then
+ return strchar (0xe0 + floor(value/0x1000),
+ 0x80 + (floor(value/0x40) % 0x40),
+ 0x80 + (floor(value) % 0x40))
+ elseif value <= 0x10ffff then
+ return strchar (0xf0 + floor(value/0x40000),
+ 0x80 + (floor(value/0x1000) % 0x40),
+ 0x80 + (floor(value/0x40) % 0x40),
+ 0x80 + (floor(value) % 0x40))
+ else
+ return nil
+ end
+end
+
+local function scanstring (str, pos)
+ local lastpos = pos + 1
+ local buffer, n = {}, 0
+ while true do
+ local nextpos = strfind (str, "[\"\\]", lastpos)
+ if not nextpos then
+ return unterminated (str, "string", pos)
+ end
+ if nextpos > lastpos then
+ n = n + 1
+ buffer[n] = strsub (str, lastpos, nextpos - 1)
+ end
+ if strsub (str, nextpos, nextpos) == "\"" then
+ lastpos = nextpos + 1
+ break
+ else
+ local escchar = strsub (str, nextpos + 1, nextpos + 1)
+ local value
+ if escchar == "u" then
+ value = tonumber (strsub (str, nextpos + 2, nextpos + 5), 16)
+ if value then
+ local value2
+ if 0xD800 <= value and value <= 0xDBff then
+ -- we have the high surrogate of UTF-16. Check if there is a
+ -- low surrogate escaped nearby to combine them.
+ if strsub (str, nextpos + 6, nextpos + 7) == "\\u" then
+ value2 = tonumber (strsub (str, nextpos + 8, nextpos + 11), 16)
+ if value2 and 0xDC00 <= value2 and value2 <= 0xDFFF then
+ value = (value - 0xD800) * 0x400 + (value2 - 0xDC00) + 0x10000
+ else
+ value2 = nil -- in case it was out of range for a low surrogate
+ end
+ end
+ end
+ value = value and unichar (value)
+ if value then
+ if value2 then
+ lastpos = nextpos + 12
+ else
+ lastpos = nextpos + 6
+ end
+ end
+ end
+ end
+ if not value then
+ value = escapechars[escchar] or escchar
+ lastpos = nextpos + 2
+ end
+ n = n + 1
+ buffer[n] = value
+ end
+ end
+ if n == 1 then
+ return buffer[1], lastpos
+ elseif n > 1 then
+ return concat (buffer), lastpos
+ else
+ return "", lastpos
+ end
+end
+
+local scanvalue -- forward declaration
+
+local function scantable (what, closechar, str, startpos, nullval, objectmeta, arraymeta)
+ local tbl, n = {}, 0
+ local pos = startpos + 1
+ if what == 'object' then
+ setmetatable (tbl, objectmeta)
+ else
+ setmetatable (tbl, arraymeta)
+ end
+ while true do
+ pos = scanwhite (str, pos)
+ if not pos then return unterminated (str, what, startpos) end
+ local char = strsub (str, pos, pos)
+ if char == closechar then
+ return tbl, pos + 1
+ end
+ local val1, err
+ val1, pos, err = scanvalue (str, pos, nullval, objectmeta, arraymeta)
+ if err then return nil, pos, err end
+ pos = scanwhite (str, pos)
+ if not pos then return unterminated (str, what, startpos) end
+ char = strsub (str, pos, pos)
+ if char == ":" then
+ if val1 == nil then
+ return nil, pos, "cannot use nil as table index (at " .. loc (str, pos) .. ")"
+ end
+ pos = scanwhite (str, pos + 1)
+ if not pos then return unterminated (str, what, startpos) end
+ local val2
+ val2, pos, err = scanvalue (str, pos, nullval, objectmeta, arraymeta)
+ if err then return nil, pos, err end
+ tbl[val1] = val2
+ pos = scanwhite (str, pos)
+ if not pos then return unterminated (str, what, startpos) end
+ char = strsub (str, pos, pos)
+ else
+ n = n + 1
+ tbl[n] = val1
+ end
+ if char == "," then
+ pos = pos + 1
+ end
+ end
+end
+
+scanvalue = function (str, pos, nullval, objectmeta, arraymeta)
+ pos = pos or 1
+ pos = scanwhite (str, pos)
+ if not pos then
+ return nil, strlen (str) + 1, "no valid JSON value (reached the end)"
+ end
+ local char = strsub (str, pos, pos)
+ if char == "{" then
+ return scantable ('object', "}", str, pos, nullval, objectmeta, arraymeta)
+ elseif char == "[" then
+ return scantable ('array', "]", str, pos, nullval, objectmeta, arraymeta)
+ elseif char == "\"" then
+ return scanstring (str, pos)
+ else
+ local pstart, pend = strfind (str, "^%-?[%d%.]+[eE]?[%+%-]?%d*", pos)
+ if pstart then
+ local number = str2num (strsub (str, pstart, pend))
+ if number then
+ return number, pend + 1
+ end
+ end
+ pstart, pend = strfind (str, "^%a%w*", pos)
+ if pstart then
+ local name = strsub (str, pstart, pend)
+ if name == "true" then
+ return true, pend + 1
+ elseif name == "false" then
+ return false, pend + 1
+ elseif name == "null" then
+ return nullval, pend + 1
+ end
+ end
+ return nil, pos, "no valid JSON value at " .. loc (str, pos)
+ end
+end
+
+local function optionalmetatables(...)
+ if select("#", ...) > 0 then
+ return ...
+ else
+ return {__jsontype = 'object'}, {__jsontype = 'array'}
+ end
+end
+
+function json.decode (str, pos, nullval, ...)
+ local objectmeta, arraymeta = optionalmetatables(...)
+ return scanvalue (str, pos, nullval, objectmeta, arraymeta)
+end
+
+function json.use_lpeg ()
+ local g = require ("lpeg")
+
+ if g.version() == "0.11" then
+ error "due to a bug in LPeg 0.11, it cannot be used for JSON matching"
+ end
+
+ local pegmatch = g.match
+ local P, S, R = g.P, g.S, g.R
+
+ local function ErrorCall (str, pos, msg, state)
+ if not state.msg then
+ state.msg = msg .. " at " .. loc (str, pos)
+ state.pos = pos
+ end
+ return false
+ end
+
+ local function Err (msg)
+ return g.Cmt (g.Cc (msg) * g.Carg (2), ErrorCall)
+ end
+
+ local SingleLineComment = P"//" * (1 - S"\n\r")^0
+ local MultiLineComment = P"/*" * (1 - P"*/")^0 * P"*/"
+ local Space = (S" \n\r\t" + P"\239\187\191" + SingleLineComment + MultiLineComment)^0
+
+ local PlainChar = 1 - S"\"\\\n\r"
+ local EscapeSequence = (P"\\" * g.C (S"\"\\/bfnrt" + Err "unsupported escape sequence")) / escapechars
+ local HexDigit = R("09", "af", "AF")
+ local function UTF16Surrogate (match, pos, high, low)
+ high, low = tonumber (high, 16), tonumber (low, 16)
+ if 0xD800 <= high and high <= 0xDBff and 0xDC00 <= low and low <= 0xDFFF then
+ return true, unichar ((high - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000)
+ else
+ return false
+ end
+ end
+ local function UTF16BMP (hex)
+ return unichar (tonumber (hex, 16))
+ end
+ local U16Sequence = (P"\\u" * g.C (HexDigit * HexDigit * HexDigit * HexDigit))
+ local UnicodeEscape = g.Cmt (U16Sequence * U16Sequence, UTF16Surrogate) + U16Sequence/UTF16BMP
+ local Char = UnicodeEscape + EscapeSequence + PlainChar
+ local String = P"\"" * g.Cs (Char ^ 0) * (P"\"" + Err "unterminated string")
+ local Integer = P"-"^(-1) * (P"0" + (R"19" * R"09"^0))
+ local Fractal = P"." * R"09"^0
+ local Exponent = (S"eE") * (S"+-")^(-1) * R"09"^1
+ local Number = (Integer * Fractal^(-1) * Exponent^(-1))/str2num
+ local Constant = P"true" * g.Cc (true) + P"false" * g.Cc (false) + P"null" * g.Carg (1)
+ local SimpleValue = Number + String + Constant
+ local ArrayContent, ObjectContent
+
+ -- The functions parsearray and parseobject parse only a single value/pair
+ -- at a time and store them directly to avoid hitting the LPeg limits.
+ local function parsearray (str, pos, nullval, state)
+ local obj, cont
+ local npos
+ local t, nt = {}, 0
+ repeat
+ obj, cont, npos = pegmatch (ArrayContent, str, pos, nullval, state)
+ if not npos then break end
+ pos = npos
+ nt = nt + 1
+ t[nt] = obj
+ until cont == 'last'
+ return pos, setmetatable (t, state.arraymeta)
+ end
+
+ local function parseobject (str, pos, nullval, state)
+ local obj, key, cont
+ local npos
+ local t = {}
+ repeat
+ key, obj, cont, npos = pegmatch (ObjectContent, str, pos, nullval, state)
+ if not npos then break end
+ pos = npos
+ t[key] = obj
+ until cont == 'last'
+ return pos, setmetatable (t, state.objectmeta)
+ end
+
+ local Array = P"[" * g.Cmt (g.Carg(1) * g.Carg(2), parsearray) * Space * (P"]" + Err "']' expected")
+ local Object = P"{" * g.Cmt (g.Carg(1) * g.Carg(2), parseobject) * Space * (P"}" + Err "'}' expected")
+ local Value = Space * (Array + Object + SimpleValue)
+ local ExpectedValue = Value + Space * Err "value expected"
+ ArrayContent = Value * Space * (P"," * g.Cc'cont' + g.Cc'last') * g.Cp()
+ local Pair = g.Cg (Space * String * Space * (P":" + Err "colon expected") * ExpectedValue)
+ ObjectContent = Pair * Space * (P"," * g.Cc'cont' + g.Cc'last') * g.Cp()
+ local DecodeValue = ExpectedValue * g.Cp ()
+
+ function json.decode (str, pos, nullval, ...)
+ local state = {}
+ state.objectmeta, state.arraymeta = optionalmetatables(...)
+ local obj, retpos = pegmatch (DecodeValue, str, pos, nullval, state)
+ if state.msg then
+ return nil, state.pos, state.msg
+ else
+ return obj, retpos
+ end
+ end
+
+ -- use this function only once:
+ json.use_lpeg = function () return json end
+
+ json.using_lpeg = true
+
+ return json -- so you can get the module using json = require "dkjson".use_lpeg()
+end
+
+if always_try_using_lpeg then
+ pcall (json.use_lpeg)
+end
+
+json.parse = json.decode
+json.stringify = json.encode
+
+return exports
diff --git a/plugins/json/plugin.json b/plugins/json/plugin.json
new file mode 100644
index 00000000000..c5a0c77355d
--- /dev/null
+++ b/plugins/json/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "json",
+ "version": "2.5.0",
+ "author": "David Kolf",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/mime/LICENSE b/plugins/mime/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/mime/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/mime/README.md b/plugins/mime/README.md
new file mode 100644
index 00000000000..550ba582b69
--- /dev/null
+++ b/plugins/mime/README.md
@@ -0,0 +1,2 @@
+# luv-mime
+A luv port of weblit's mime module
diff --git a/plugins/mime/init.lua b/plugins/mime/init.lua
new file mode 100644
index 00000000000..ac41dad1cfc
--- /dev/null
+++ b/plugins/mime/init.lua
@@ -0,0 +1,194 @@
+local exports = {}
+exports.name = "creationix/mime"
+exports.version = "0.1.2-1"
+exports.description = "A simple mime type database useful for serving static files over http."
+exports.tags = {"mime", "static"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+exports.homepage = "https://github.com/creationix/weblit/blob/master/libs/mime.lua"
+
+local mime = exports
+local table = {
+ ["3gp"] = "video/3gpp",
+ a = "application/octet-stream",
+ ai = "application/postscript",
+ aif = "audio/x-aiff",
+ aiff = "audio/x-aiff",
+ asc = "application/pgp-signature",
+ asf = "video/x-ms-asf",
+ asm = "text/x-asm",
+ asx = "video/x-ms-asf",
+ atom = "application/atom+xml",
+ au = "audio/basic",
+ avi = "video/x-msvideo",
+ bat = "application/x-msdownload",
+ bin = "application/octet-stream",
+ bmp = "image/bmp",
+ bz2 = "application/x-bzip2",
+ c = "text/x-c",
+ cab = "application/vnd.ms-cab-compressed",
+ cc = "text/x-c",
+ chm = "application/vnd.ms-htmlhelp",
+ class = "application/octet-stream",
+ com = "application/x-msdownload",
+ conf = "text/plain",
+ cpp = "text/x-c",
+ crt = "application/x-x509-ca-cert",
+ css = "text/css",
+ csv = "text/csv",
+ cxx = "text/x-c",
+ deb = "application/x-debian-package",
+ der = "application/x-x509-ca-cert",
+ diff = "text/x-diff",
+ djv = "image/vnd.djvu",
+ djvu = "image/vnd.djvu",
+ dll = "application/x-msdownload",
+ dmg = "application/octet-stream",
+ doc = "application/msword",
+ dot = "application/msword",
+ dtd = "application/xml-dtd",
+ dvi = "application/x-dvi",
+ ear = "application/java-archive",
+ eml = "message/rfc822",
+ eps = "application/postscript",
+ exe = "application/x-msdownload",
+ f = "text/x-fortran",
+ f77 = "text/x-fortran",
+ f90 = "text/x-fortran",
+ flv = "video/x-flv",
+ ["for"] = "text/x-fortran",
+ gem = "application/octet-stream",
+ gemspec = "text/x-script.ruby",
+ gif = "image/gif",
+ gz = "application/x-gzip",
+ h = "text/x-c",
+ hh = "text/x-c",
+ htm = "text/html",
+ html = "text/html",
+ ico = "image/vnd.microsoft.icon",
+ ics = "text/calendar",
+ ifb = "text/calendar",
+ iso = "application/octet-stream",
+ jar = "application/java-archive",
+ java = "text/x-java-source",
+ jnlp = "application/x-java-jnlp-file",
+ jpeg = "image/jpeg",
+ jpg = "image/jpeg",
+ js = "application/javascript",
+ json = "application/json",
+ less = "text/css",
+ log = "text/plain",
+ lua = "text/x-lua",
+ luac = "application/x-lua-bytecode",
+ m3u = "audio/x-mpegurl",
+ m4v = "video/mp4",
+ man = "text/troff",
+ manifest = "text/cache-manifest",
+ markdown = "text/markdown",
+ mathml = "application/mathml+xml",
+ mbox = "application/mbox",
+ mdoc = "text/troff",
+ md = "text/markdown",
+ me = "text/troff",
+ mid = "audio/midi",
+ midi = "audio/midi",
+ mime = "message/rfc822",
+ mml = "application/mathml+xml",
+ mng = "video/x-mng",
+ mov = "video/quicktime",
+ mp3 = "audio/mpeg",
+ mp4 = "video/mp4",
+ mp4v = "video/mp4",
+ mpeg = "video/mpeg",
+ mpg = "video/mpeg",
+ ms = "text/troff",
+ msi = "application/x-msdownload",
+ odp = "application/vnd.oasis.opendocument.presentation",
+ ods = "application/vnd.oasis.opendocument.spreadsheet",
+ odt = "application/vnd.oasis.opendocument.text",
+ ogg = "application/ogg",
+ p = "text/x-pascal",
+ pas = "text/x-pascal",
+ pbm = "image/x-portable-bitmap",
+ pdf = "application/pdf",
+ pem = "application/x-x509-ca-cert",
+ pgm = "image/x-portable-graymap",
+ pgp = "application/pgp-encrypted",
+ pkg = "application/octet-stream",
+ pl = "text/x-script.perl",
+ pm = "text/x-script.perl-module",
+ png = "image/png",
+ pnm = "image/x-portable-anymap",
+ ppm = "image/x-portable-pixmap",
+ pps = "application/vnd.ms-powerpoint",
+ ppt = "application/vnd.ms-powerpoint",
+ ps = "application/postscript",
+ psd = "image/vnd.adobe.photoshop",
+ py = "text/x-script.python",
+ qt = "video/quicktime",
+ ra = "audio/x-pn-realaudio",
+ rake = "text/x-script.ruby",
+ ram = "audio/x-pn-realaudio",
+ rar = "application/x-rar-compressed",
+ rb = "text/x-script.ruby",
+ rdf = "application/rdf+xml",
+ roff = "text/troff",
+ rpm = "application/x-redhat-package-manager",
+ rss = "application/rss+xml",
+ rtf = "application/rtf",
+ ru = "text/x-script.ruby",
+ s = "text/x-asm",
+ sgm = "text/sgml",
+ sgml = "text/sgml",
+ sh = "application/x-sh",
+ sig = "application/pgp-signature",
+ snd = "audio/basic",
+ so = "application/octet-stream",
+ svg = "image/svg+xml",
+ svgz = "image/svg+xml",
+ swf = "application/x-shockwave-flash",
+ t = "text/troff",
+ tar = "application/x-tar",
+ tbz = "application/x-bzip-compressed-tar",
+ tci = "application/x-topcloud",
+ tcl = "application/x-tcl",
+ tex = "application/x-tex",
+ texi = "application/x-texinfo",
+ texinfo = "application/x-texinfo",
+ text = "text/plain",
+ tif = "image/tiff",
+ tiff = "image/tiff",
+ torrent = "application/x-bittorrent",
+ tr = "text/troff",
+ ttf = "application/x-font-ttf",
+ txt = "text/plain",
+ vcf = "text/x-vcard",
+ vcs = "text/x-vcalendar",
+ vrml = "model/vrml",
+ war = "application/java-archive",
+ wav = "audio/x-wav",
+ webm = "video/webm",
+ wma = "audio/x-ms-wma",
+ wmv = "video/x-ms-wmv",
+ wmx = "video/x-ms-wmx",
+ wrl = "model/vrml",
+ wsdl = "application/wsdl+xml",
+ xbm = "image/x-xbitmap",
+ xhtml = "application/xhtml+xml",
+ xls = "application/vnd.ms-excel",
+ xml = "application/xml",
+ xpm = "image/x-xpixmap",
+ xsl = "application/xml",
+ xslt = "application/xslt+xml",
+ yaml = "text/yaml",
+ yml = "text/yaml",
+ zip = "application/zip",
+}
+mime.table = table
+mime.default = "application/octet-stream"
+
+function mime.getType(path)
+ return mime.table[path:lower():match("[^.]*$")] or mime.default
+end
+
+return mime
diff --git a/plugins/mime/plugin.json b/plugins/mime/plugin.json
new file mode 100644
index 00000000000..ee55fd559b3
--- /dev/null
+++ b/plugins/mime/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "mime",
+ "version": "0.1.2-1",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/path/LICENSE b/plugins/path/LICENSE
new file mode 100644
index 00000000000..8f71f43fee3
--- /dev/null
+++ b/plugins/path/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/plugins/path/README.md b/plugins/path/README.md
new file mode 100644
index 00000000000..75d881e35e3
--- /dev/null
+++ b/plugins/path/README.md
@@ -0,0 +1,2 @@
+# luv-path
+A luv port of luvi's path module
diff --git a/plugins/path/init.lua b/plugins/path/init.lua
new file mode 100644
index 00000000000..d0e427d02ee
--- /dev/null
+++ b/plugins/path/init.lua
@@ -0,0 +1,139 @@
+--[[
+
+Copyright 2014 The Luvit Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS-IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--]]
+
+-- Extracted from https://github.com/luvit/luvi/blob/master/src/lua/init.lua
+
+local isWindows
+if jit and jit.os then
+ -- Luajit provides explicit platform detection
+ isWindows = jit.os == "Windows"
+else
+ -- Normal lua will only have \ for path separator on windows.
+ isWindows = package.config:find("\\") and true or false
+end
+
+local uv = require('luv')
+
+local getPrefix, splitPath, joinParts
+
+if isWindows then
+ -- Windows aware path utilities
+ function getPrefix(path)
+ return path:match("^%a:\\") or
+ path:match("^/") or
+ path:match("^\\+")
+ end
+ function splitPath(path)
+ local parts = {}
+ for part in string.gmatch(path, '([^/\\]+)') do
+ table.insert(parts, part)
+ end
+ return parts
+ end
+ function joinParts(prefix, parts, i, j)
+ if not prefix then
+ return table.concat(parts, '/', i, j)
+ elseif prefix ~= '/' then
+ return prefix .. table.concat(parts, '\\', i, j)
+ else
+ return prefix .. table.concat(parts, '/', i, j)
+ end
+ end
+else
+ -- Simple optimized versions for UNIX systems
+ function getPrefix(path)
+ return path:match("^/")
+ end
+ function splitPath(path)
+ local parts = {}
+ for part in string.gmatch(path, '([^/]+)') do
+ table.insert(parts, part)
+ end
+ return parts
+ end
+ function joinParts(prefix, parts, i, j)
+ if prefix then
+ return prefix .. table.concat(parts, '/', i, j)
+ end
+ return table.concat(parts, '/', i, j)
+ end
+end
+
+local function pathJoin(...)
+ local inputs = {...}
+ local l = #inputs
+
+ -- Find the last segment that is an absolute path
+ -- Or if all are relative, prefix will be nil
+ local i = l
+ local prefix
+ while true do
+ prefix = getPrefix(inputs[i])
+ if prefix or i <= 1 then break end
+ i = i - 1
+ end
+
+ -- If there was one, remove its prefix from its segment
+ if prefix then
+ inputs[i] = inputs[i]:sub(#prefix)
+ end
+
+ -- Split all the paths segments into one large list
+ local parts = {}
+ while i <= l do
+ local sub = splitPath(inputs[i])
+ for j = 1, #sub do
+ parts[#parts + 1] = sub[j]
+ end
+ i = i + 1
+ end
+
+ -- Evaluate special segments in reverse order.
+ local skip = 0
+ local reversed = {}
+ for idx = #parts, 1, -1 do
+ local part = parts[idx]
+ if part == '.' then
+ -- Ignore
+ elseif part == '..' then
+ skip = skip + 1
+ elseif skip > 0 then
+ skip = skip - 1
+ else
+ reversed[#reversed + 1] = part
+ end
+ end
+
+ -- Reverse the list again to get the correct order
+ parts = reversed
+ for idx = 1, #parts / 2 do
+ local j = #parts - idx + 1
+ parts[idx], parts[j] = parts[j], parts[idx]
+ end
+
+ local path = joinParts(prefix, parts)
+ return path
+end
+
+return {
+ isWindows = isWindows,
+ join = pathJoin,
+ getPrefix = getPrefix,
+ splitPath = splitPath,
+ joinparts = joinParts,
+}
diff --git a/plugins/path/plugin.json b/plugins/path/plugin.json
new file mode 100644
index 00000000000..c88de67d77c
--- /dev/null
+++ b/plugins/path/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "path",
+ "version": "1.0.0",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/pretty-print/LICENSE b/plugins/pretty-print/LICENSE
new file mode 100644
index 00000000000..8f71f43fee3
--- /dev/null
+++ b/plugins/pretty-print/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/plugins/pretty-print/README.md b/plugins/pretty-print/README.md
new file mode 100644
index 00000000000..82372160e09
--- /dev/null
+++ b/plugins/pretty-print/README.md
@@ -0,0 +1,2 @@
+# luv-pretty-print
+luvit's pretty-print module re-packaged as a luv submodule.
diff --git a/plugins/pretty-print/init.lua b/plugins/pretty-print/init.lua
new file mode 100644
index 00000000000..f1c112d6e4f
--- /dev/null
+++ b/plugins/pretty-print/init.lua
@@ -0,0 +1,362 @@
+--[[
+
+Copyright 2014-2015 The Luvit Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS-IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--]]
+
+-- Luv port by Tim Caswell <tim@creationix.com>
+
+local exports = {}
+exports.name = "luvit/pretty-print"
+exports.version = "1.0.3"
+exports.homepage = "https://github.com/luvit/luvit/blob/master/deps/pretty-print.lua"
+exports.description = "A lua value pretty printer and colorizer for terminals."
+exports.tags = {"colors", "tty"}
+exports.license = "Apache 2"
+exports.author = { name = "Tim Caswell" }
+
+local uv = require('luv')
+
+local prettyPrint, dump, strip, color, colorize, loadColors
+local theme = {}
+local useColors = false
+local defaultTheme
+
+local stdout, stdin, stderr, width
+
+local quote, quote2, dquote, dquote2, obracket, cbracket, obrace, cbrace, comma, equals, controls
+
+local themes = {
+ -- nice color theme using 16 ansi colors
+ [16] = {
+ property = "0;37", -- white
+ sep = "1;30", -- bright-black
+ braces = "1;30", -- bright-black
+
+ ["nil"] = "1;30", -- bright-black
+ boolean = "0;33", -- yellow
+ number = "1;33", -- bright-yellow
+ string = "0;32", -- green
+ quotes = "1;32", -- bright-green
+ escape = "1;32", -- bright-green
+ ["function"] = "0;35", -- purple
+ thread = "1;35", -- bright-purple
+
+ table = "1;34", -- bright blue
+ userdata = "1;36", -- bright cyan
+ cdata = "0;36", -- cyan
+
+ err = "1;31", -- bright red
+ success = "1;33;42", -- bright-yellow on green
+ failure = "1;33;41", -- bright-yellow on red
+ highlight = "1;36;44", -- bright-cyan on blue
+ },
+ -- nice color theme using ansi 256-mode colors
+ [256] = {
+ property = "38;5;253",
+ braces = "38;5;247",
+ sep = "38;5;240",
+
+ ["nil"] = "38;5;244",
+ boolean = "38;5;220", -- yellow-orange
+ number = "38;5;202", -- orange
+ string = "38;5;34", -- darker green
+ quotes = "38;5;40", -- green
+ escape = "38;5;46", -- bright green
+ ["function"] = "38;5;129", -- purple
+ thread = "38;5;199", -- pink
+
+ table = "38;5;27", -- blue
+ userdata = "38;5;39", -- blue2
+ cdata = "38;5;69", -- teal
+
+ err = "38;5;196", -- bright red
+ success = "38;5;120;48;5;22", -- bright green on dark green
+ failure = "38;5;215;48;5;52", -- bright red on dark red
+ highlight = "38;5;45;48;5;236", -- bright teal on dark grey
+ },
+}
+
+local special = {
+ [7] = 'a',
+ [8] = 'b',
+ [9] = 't',
+ [10] = 'n',
+ [11] = 'v',
+ [12] = 'f',
+ [13] = 'r'
+}
+
+function strip(str)
+ return string.gsub(str, '\027%[[^m]*m', '')
+end
+
+
+function loadColors(index)
+ if index == nil then index = defaultTheme end
+
+ -- Remove the old theme
+ for key in pairs(theme) do
+ theme[key] = nil
+ end
+
+ if index then
+ local new = themes[index]
+ if not new then error("Invalid theme index: " .. tostring(index)) end
+ -- Add the new theme
+ for key in pairs(new) do
+ theme[key] = new[key]
+ end
+ useColors = true
+ else
+ useColors = false
+ end
+
+ quote = colorize('quotes', "'", 'string')
+ quote2 = colorize('quotes', "'")
+ dquote = colorize('quotes', '"', 'string')
+ dquote2 = colorize('quotes', '"')
+ obrace = colorize('braces', '{ ')
+ cbrace = colorize('braces', '}')
+ obracket = colorize('property', '[')
+ cbracket = colorize('property', ']')
+ comma = colorize('sep', ', ')
+ equals = colorize('sep', ' = ')
+
+ controls = {}
+ for i = 0, 31 do
+ local c = special[i]
+ if not c then
+ if i < 10 then
+ c = "00" .. tostring(i)
+ else
+ c = "0" .. tostring(i)
+ end
+ end
+ controls[i] = colorize('escape', '\\' .. c, 'string')
+ end
+ controls[92] = colorize('escape', '\\\\', 'string')
+ controls[34] = colorize('escape', '\\"', 'string')
+ controls[39] = colorize('escape', "\\'", 'string')
+ for i = 128, 255 do
+ local c
+ if i < 100 then
+ c = "0" .. tostring(i)
+ else
+ c = tostring(i)
+ end
+ controls[i] = colorize('escape', '\\' .. c, 'string')
+ end
+
+end
+
+function color(colorName)
+ return '\27[' .. (theme[colorName] or '0') .. 'm'
+end
+
+function colorize(colorName, string, resetName)
+ return useColors and
+ (color(colorName) .. tostring(string) .. color(resetName)) or
+ tostring(string)
+end
+
+local function stringEscape(c)
+ return controls[string.byte(c, 1)]
+end
+
+function dump(value, recurse, nocolor)
+ local seen = {}
+ local output = {}
+ local offset = 0
+ local stack = {}
+
+ local function recalcOffset(index)
+ for i = index + 1, #output do
+ local m = string.match(output[i], "\n([^\n]*)$")
+ if m then
+ offset = #(strip(m))
+ else
+ offset = offset + #(strip(output[i]))
+ end
+ end
+ end
+
+ local function write(text, length)
+ if not length then length = #(strip(text)) end
+ -- Create room for data by opening parent blocks
+ -- Start at the root and go down.
+ local i = 1
+ while offset + length > width and stack[i] do
+ local entry = stack[i]
+ if not entry.opened then
+ entry.opened = true
+ table.insert(output, entry.index + 1, "\n" .. string.rep(" ", i))
+ -- Recalculate the offset
+ recalcOffset(entry.index)
+ -- Bump the index of all deeper entries
+ for j = i + 1, #stack do
+ stack[j].index = stack[j].index + 1
+ end
+ end
+ i = i + 1
+ end
+ output[#output + 1] = text
+ offset = offset + length
+ if offset > width then
+ return dump(stack)
+ end
+ end
+
+ local function indent()
+ stack[#stack + 1] = {
+ index = #output,
+ opened = false,
+ }
+ end
+
+ local function unindent()
+ stack[#stack] = nil
+ end
+
+ local function process(value)
+ local typ = type(value)
+ if typ == 'string' then
+ if string.match(value, "'") and not string.match(value, '"') then
+ write(dquote .. string.gsub(value, '[%c\\\128-\255]', stringEscape) .. dquote2)
+ else
+ write(quote .. string.gsub(value, "[%c\\'\128-\255]", stringEscape) .. quote2)
+ end
+ elseif typ == 'table' and not seen[value] then
+ if not recurse then seen[value] = true end
+ write(obrace)
+ local i = 1
+ -- Count the number of keys so we know when to stop adding commas
+ local total = 0
+ for _ in pairs(value) do total = total + 1 end
+
+ local nextIndex = 1
+ for k, v in pairs(value) do
+ indent()
+ if k == nextIndex then
+ -- if the key matches the last numerical index + 1
+ -- This is how lists print without keys
+ nextIndex = k + 1
+ process(v)
+ else
+ if type(k) == "string" and string.find(k,"^[%a_][%a%d_]*$") then
+ write(colorize("property", k) .. equals)
+ else
+ write(obracket)
+ process(k)
+ write(cbracket .. equals)
+ end
+ if type(v) == "table" then
+ process(v)
+ else
+ indent()
+ process(v)
+ unindent()
+ end
+ end
+ if i < total then
+ write(comma)
+ else
+ write(" ")
+ end
+ i = i + 1
+ unindent()
+ end
+ write(cbrace)
+ else
+ write(colorize(typ, tostring(value)))
+ end
+ end
+
+ process(value)
+ local s = table.concat(output, "")
+ return nocolor and strip(s) or s
+end
+
+-- Print replacement that goes through libuv. This is useful on windows
+-- to use libuv's code to translate ansi escape codes to windows API calls.
+function _G.print(...)
+ local n = select('#', ...)
+ local arguments = {...}
+ for i = 1, n do
+ arguments[i] = tostring(arguments[i])
+ end
+ uv.write(stdout, table.concat(arguments, "\t") .. "\n")
+end
+
+function prettyPrint(...)
+ local n = select('#', ...)
+ local arguments = { ... }
+
+ for i = 1, n do
+ arguments[i] = dump(arguments[i])
+ end
+
+ print(table.concat(arguments, "\t"))
+end
+
+function strip(str)
+ return string.gsub(str, '\027%[[^m]*m', '')
+end
+
+if uv.guess_handle(0) == 'tty' then
+ stdin = assert(uv.new_tty(0, true))
+else
+ stdin = uv.new_pipe(false)
+ uv.pipe_open(stdin, 0)
+end
+
+if uv.guess_handle(1) == 'tty' then
+ stdout = assert(uv.new_tty(1, false))
+ width = uv.tty_get_winsize(stdout)
+ if width == 0 then width = 80 end
+ -- auto-detect when 16 color mode should be used
+ local term = os.getenv("TERM")
+ if term == 'xterm' or term == 'xterm-256color' then
+ defaultTheme = 256
+ else
+ defaultTheme = 16
+ end
+else
+ stdout = uv.new_pipe(false)
+ uv.pipe_open(stdout, 1)
+ width = 80
+end
+loadColors()
+
+if uv.guess_handle(2) == 'tty' then
+ stderr = assert(uv.new_tty(2, false))
+else
+ stderr = uv.new_pipe(false)
+ uv.pipe_open(stderr, 2)
+end
+
+exports.loadColors = loadColors
+exports.theme = theme
+exports.print = print
+exports.prettyPrint = prettyPrint
+exports.dump = dump
+exports.color = color
+exports.colorize = colorize
+exports.stdin = stdin
+exports.stdout = stdout
+exports.stderr = stderr
+exports.strip = strip
+
+return exports
diff --git a/plugins/pretty-print/plugin.json b/plugins/pretty-print/plugin.json
new file mode 100644
index 00000000000..556608c8dd6
--- /dev/null
+++ b/plugins/pretty-print/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "pretty-print",
+ "version": "1.0.3",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/querystring/LICENSE b/plugins/querystring/LICENSE
new file mode 100644
index 00000000000..8f71f43fee3
--- /dev/null
+++ b/plugins/querystring/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/plugins/querystring/README.md b/plugins/querystring/README.md
new file mode 100644
index 00000000000..7f3437312bb
--- /dev/null
+++ b/plugins/querystring/README.md
@@ -0,0 +1,2 @@
+# luv-querystring
+A luv port of luvit's querystring
diff --git a/plugins/querystring/init.lua b/plugins/querystring/init.lua
new file mode 100644
index 00000000000..0e2675f9252
--- /dev/null
+++ b/plugins/querystring/init.lua
@@ -0,0 +1,105 @@
+--[[
+
+Copyright 2015 The Luvit Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS-IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--]]
+
+local exports = {}
+exports.name = "luvit/querystring"
+exports.version = "1.0.2"
+exports.license = "Apache 2"
+exports.homepage = "https://github.com/luvit/luvit/blob/master/deps/querystring.lua"
+exports.description = "Node-style query-string codec for luvit"
+exports.tags = {"luvit", "url", "codec"}
+
+local find = string.find
+local gsub = string.gsub
+local char = string.char
+local byte = string.byte
+local format = string.format
+local match = string.match
+local gmatch = string.gmatch
+
+function exports.urldecode(str)
+ str = gsub(str, '+', ' ')
+ str = gsub(str, '%%(%x%x)', function(h)
+ return char(tonumber(h, 16))
+ end)
+ str = gsub(str, '\r\n', '\n')
+ return str
+end
+
+function exports.urlencode(str)
+ if str then
+ str = gsub(str, '\n', '\r\n')
+ str = gsub(str, '([^%w])', function(c)
+ return format('%%%02X', byte(c))
+ end)
+ end
+ return str
+end
+
+local function stringifyPrimitive(v)
+ return tostring(v)
+end
+
+function exports.stringify(params, sep, eq)
+ if not sep then sep = '&' end
+ if not eq then eq = '=' end
+ if type(params) == "table" then
+ local fields = {}
+ for key,value in pairs(params) do
+ local keyString = exports.urlencode(stringifyPrimitive(key)) .. eq
+ if type(value) == "table" then
+ for _, v in ipairs(value) do
+ table.insert(fields, keyString .. exports.urlencode(stringifyPrimitive(v)))
+ end
+ else
+ table.insert(fields, keyString .. exports.urlencode(stringifyPrimitive(value)))
+ end
+ end
+ return table.concat(fields, sep)
+ end
+ return ''
+end
+
+-- parse querystring into table. urldecode tokens
+function exports.parse(str, sep, eq)
+ if not sep then sep = '&' end
+ if not eq then eq = '=' end
+ local vars = {}
+ for pair in gmatch(tostring(str), '[^' .. sep .. ']+') do
+ if not find(pair, eq) then
+ vars[exports.urldecode(pair)] = ''
+ else
+ local key, value = match(pair, '([^' .. eq .. ']*)' .. eq .. '(.*)')
+ if key then
+ key = exports.urldecode(key)
+ value = exports.urldecode(value)
+ local type = type(vars[key])
+ if type=='nil' then
+ vars[key] = value
+ elseif type=='table' then
+ table.insert(vars[key], value)
+ else
+ vars[key] = {vars[key],value}
+ end
+ end
+ end
+ end
+ return vars
+end
+
+return exports
diff --git a/plugins/querystring/plugin.json b/plugins/querystring/plugin.json
new file mode 100644
index 00000000000..ddd3cc4291e
--- /dev/null
+++ b/plugins/querystring/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "querystring",
+ "version": "1.0.2",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/weblit/LICENSE b/plugins/weblit/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/weblit/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/weblit/README.md b/plugins/weblit/README.md
new file mode 100644
index 00000000000..55d6085d22b
--- /dev/null
+++ b/plugins/weblit/README.md
@@ -0,0 +1,239 @@
+# weblit
+
+A web framework for luv (ported from luvit/lit)
+
+Weblit is a collection of lit packages that together form a nice web framework.
+
+## weblit/app
+
+This is the core of the framework. It's export value is the app itself. The
+config functions can be chained off this config for super terse syntax.
+
+```lua
+require('weblit/app')
+
+ .bind({
+ host = "0.0.0.0",
+ port = 8080
+ })
+
+ .use(require('weblit/logger'))
+ .use(require('weblit/auto-headers'))
+ .use(require('weblit/etag-cache'))
+
+ .route({
+ method = "GET",
+ path = "/do/:user/:action",
+ domain = "*.myapp.io"
+ }, function (req, res, go)
+ -- Handle route
+ end)
+
+ .start()
+
+```
+
+### bind(options)
+
+Use this to configure your server. You can bind to multiple addresses and
+ports. For example, the same server can listen on port `8080` using normal HTTP
+while also listening on port `8443` using HTTPS.
+
+```lua
+-- Listen on port 8080 internally using plain HTTP.
+.bind({
+ host = "127.0.0.1",
+ port = 8080
+})
+
+-- Also listen on port 8443 externally using encrypted HTTPS.
+.bind({
+ host = "0.0.0.0",
+ port = 8443,
+ tls = {
+ cert = module:load("cert.pem"),
+ key = module:load("key.pem",
+ }
+})
+```
+
+The `host` option defaults to `"127.0.0.1"`. The default port depends on if
+you're running as root and if the connection is TLS encrypted.
+
+ | Root | User
+------|-----:|------:
+HTTP | 80 | 8080
+HTTPS | 442 | 8443
+
+
+### use(middleware)
+
+This adds a raw middleware to the chain. It's signature is:
+
+```lua
+.use(function (req, res, go)
+ -- Log the request table
+ p("request", req)
+ -- Hand off to the next layer.
+ return go()
+end)
+```
+
+The `req` table will contain information about the HTTP request. This includes
+several fields:
+
+ - `socket` - The raw libuv `uv_tty_t` socket.
+ - `method` - The HTTP request method verb like `GET` or `POST`.
+ - `path` - The raw HTTP request path (including query string).
+ - `headers` - A list of headers. Each header is a table with two entries for
+ key and value. For convenience, there are special `__index` and
+ `__newindex` metamethods that let you treat this like a case insensitive
+ key/value store.
+ - `version` - The HTTP version (Usually either `1.0` or `1.1`).
+ - `keepAlive` - A flag telling you if this should be a keepalive connection.
+ - `body` - The request body as a string. In the future, this may also be a stream.
+
+The `res` table also has some conventions used to form the response a piece at a
+time. Initially it contains:
+
+ - `code` - The response status code. Initially contains `404`.
+ - `headers` - Another special headers table like in `req`.
+ - `body` - The response body to send. Initially contains `"Not Found\n"`.
+
+The `go` function is to be called if you wish to not handle a request. This
+allows other middleware layers to get a chance to respond to the request. Use a
+tail call if there is nothing more to do.
+
+Otherwise do further processing after `go` returns. At this point, all inner
+layers have finished and a response is ready in `res`.
+
+### route(options, middleware)
+
+Route is like use, but allows you to pre-filter the requests before the middleware
+is called.
+
+```lua
+.route({
+ method = "PUT",
+ path = "/upload/:username"
+}, function (req, res, go)
+ local url = saveFile(req.params.username, req.body)
+ res.code = 201
+ res.headers.Location = url
+end)
+```
+
+The route options accept several parameters:
+
+ - `method` - This is a simple filter on a specific HTTP method verb.
+ - `path` - This is either an exact match or can contain patterns. Segments
+ looking like `:name` will match single path segments while `:name:` will
+ match multiple segments. The matches will go into `req.params`. Also any
+ query string will be stripped off, parsed out, and stored in `req.query`.
+ - `host` - Will filter against the `Host` header. This can be an exact match
+ or a glob match like `*.mydomain.org`.
+ - `filter` - Filter is a custom lua function that accepts `req` and returns
+ `true` or `false`.
+
+If the request matches all the requirements, then the middleware is called the
+same as with `use`.
+
+### start
+
+Bind to the port(s), listen on the socket(s) and start accepting connections.
+
+## weblit/logger
+
+This is a simple middleware that logs the request method, url and user agent.
+It also includes the response status code.
+
+Make sure to use it at the top of your middleware chain so that it's able to see
+the final response code sent to the client.
+
+```lua
+.use(require('weblit/logger'))
+```
+
+## weblit/auto-headers
+
+This implements lots of conventions and useful defaults that help your app
+implement a proper HTTP server.
+
+You should always use this near the top of the list. The only middleware that
+goes before this is the logger.
+
+
+```lua
+.use(require('weblit/auto-headers'))
+```
+
+## weblit/etag-cache
+
+This caches responses in memory keyed by etag. If there is no etag, but there
+is a response body, it will use the body to generate an etag.
+
+Put this in your list after auto-headers, but before custom server logic.
+
+```lua
+.use(require('weblit/etag-cache'))
+```
+
+## weblit/static
+
+This middleware serves static files to the user. Use this to serve your client-
+side web assets.
+
+Usage is pretty simplistic for now.
+
+```lua
+local static = require('weblit/static')
+app.use(static("path/to/static/assets"))
+```
+
+If you want to only match a sub-path, use the router.
+
+```lua
+app.route({
+ path = "/blog/:path:"
+}, static(pathJoin(module.dir, "articles")))
+```
+
+The `path` param will be used if it exists and the full path will be used
+otherwise.
+
+## weblit/websocket
+
+This implements a websocket upgrade handler. You can choose the subprotocol and
+other routing information.
+
+```lua
+app.websocket({
+ path = "/v2/socket", -- Prefix for matching
+ protocol = "virgo/2.0", -- Restrict to a websocket sub-protocol
+}, function (req, read, write)
+ -- Log the request headers
+ p(req)
+ -- Log and echo all messages
+ for message in read do
+ write(message)
+ end
+ -- End the stream
+ write()
+end)
+```
+
+
+## weblit
+
+This is the metapackage that simply includes the other modules.
+
+It exposes the other modules as a single exports table.
+
+```lua
+exports.app = require('weblit/app')
+exports.autoHeaders = require('weblit/auto-headers')
+exports.etagCache = require('weblit/etag-cache')
+exports.logger = require('weblit/logger')
+exports.static = require('weblit/static')
+exports.websocket = require('weblit/websocket')
+```
diff --git a/plugins/weblit/app.lua b/plugins/weblit/app.lua
new file mode 100644
index 00000000000..d3839c1df8e
--- /dev/null
+++ b/plugins/weblit/app.lua
@@ -0,0 +1,261 @@
+
+
+local createServer = require('coro-net').createServer
+local wrapper = require('coro-wrapper')
+local readWrap, writeWrap = wrapper.reader, wrapper.writer
+local httpCodec = require('http-codec')
+--local tlsWrap = require('coro-tls').wrap
+local parseQuery = require('querystring').parse
+
+-- Ignore SIGPIPE if it exists on platform
+local uv = require('luv')
+if uv.constants.SIGPIPE then
+ uv.new_signal():start("sigpipe")
+end
+
+local server = {}
+local handlers = {}
+local bindings = {}
+
+-- Provide a nice case insensitive interface to headers.
+local headerMeta = {
+ __index = function (list, name)
+ if type(name) ~= "string" then
+ return rawget(list, name)
+ end
+ name = name:lower()
+ for i = 1, #list do
+ local key, value = unpack(list[i])
+ if key:lower() == name then return value end
+ end
+ end,
+ __newindex = function (list, name, value)
+ -- non-string keys go through as-is.
+ if type(name) ~= "string" then
+ return rawset(list, name, value)
+ end
+ -- First remove any existing pairs with matching key
+ local lowerName = name:lower()
+ for i = #list, 1, -1 do
+ if list[i][1]:lower() == lowerName then
+ table.remove(list, i)
+ end
+ end
+ -- If value is nil, we're done
+ if value == nil then return end
+ -- Otherwise, set the key(s)
+ if (type(value) == "table") then
+ -- We accept a table of strings
+ for i = 1, #value do
+ rawset(list, #list + 1, {name, tostring(value[i])})
+ end
+ else
+ -- Or a single value interperted as string
+ rawset(list, #list + 1, {name, tostring(value)})
+ end
+ end,
+}
+
+local function handleRequest(head, input, socket)
+ local req = {
+ socket = socket,
+ method = head.method,
+ path = head.path,
+ headers = setmetatable({}, headerMeta),
+ version = head.version,
+ keepAlive = head.keepAlive,
+ body = input
+ }
+ for i = 1, #head do
+ req.headers[i] = head[i]
+ end
+
+ local res = {
+ code = 404,
+ headers = setmetatable({}, headerMeta),
+ body = "Not Found\n",
+ }
+
+ local function run(i)
+ local success, err = pcall(function ()
+ i = i or 1
+ local go = i < #handlers
+ and function ()
+ return run(i + 1)
+ end
+ or function () end
+ return handlers[i](req, res, go)
+ end)
+ if not success then
+ res.code = 500
+ res.headers = setmetatable({}, headerMeta)
+ res.body = err
+ print(err)
+ end
+ end
+ run(1)
+
+ local out = {
+ code = res.code,
+ keepAlive = res.keepAlive,
+ }
+ for i = 1, #res.headers do
+ out[i] = res.headers[i]
+ end
+ return out, res.body, res.upgrade
+end
+
+local function handleConnection(rawRead, rawWrite, socket)
+
+ -- Speak in HTTP events
+ local read, updateDecoder = readWrap(rawRead, httpCodec.decoder())
+ local write, updateEncoder = writeWrap(rawWrite, httpCodec.encoder())
+
+ for head in read do
+ local parts = {}
+ for chunk in read do
+ if #chunk > 0 then
+ parts[#parts + 1] = chunk
+ else
+ break
+ end
+ end
+ local res, body, upgrade = handleRequest(head, #parts > 0 and table.concat(parts) or nil, socket)
+ write(res)
+ if upgrade then
+ return upgrade(read, write, updateDecoder, updateEncoder, socket)
+ end
+ write(body)
+ if not (res.keepAlive and head.keepAlive) then
+ break
+ end
+ end
+ write()
+
+end
+
+function server.bind(options)
+ if not options.host then
+ options.host = "127.0.0.1"
+ end
+ if not options.port then
+ options.port = require('uv').getuid() == 0 and
+ (options.tls and 443 or 80) or
+ (options.tls and 8443 or 8080)
+ end
+ bindings[#bindings + 1] = options
+ return server
+end
+
+function server.use(handler)
+ handlers[#handlers + 1] = handler
+ return server
+end
+
+
+function server.start()
+ if #bindings == 0 then
+ server.bind({})
+ end
+ for i = 1, #bindings do
+ local options = bindings[i]
+ createServer(options, function (rawRead, rawWrite, socket)
+ --local tls = options.tls
+ --if tls then
+ --rawRead, rawWrite = tlsWrap(rawRead, rawWrite, {
+ -- server = true,
+ --key = assert(tls.key, "tls key required"),
+ --cert = assert(tls.cert, "tls cert required"),
+ --})
+ --end
+ return handleConnection(rawRead, rawWrite, socket)
+ end)
+ print("HTTP server listening at http" .. (options.tls and "s" or "") .. "://" .. options.host .. (options.port == (options.tls and 443 or 80) and "" or ":" .. options.port) .. "/")
+ end
+ return server
+end
+
+local quotepattern = '(['..("%^$().[]*+-?"):gsub("(.)", "%%%1")..'])'
+local function escape(str)
+ return str:gsub(quotepattern, "%%%1")
+end
+
+local function compileGlob(glob)
+ local parts = {"^"}
+ for a, b in glob:gmatch("([^*]*)(%**)") do
+ if #a > 0 then
+ parts[#parts + 1] = escape(a)
+ end
+ if #b > 0 then
+ parts[#parts + 1] = "(.*)"
+ end
+ end
+ parts[#parts + 1] = "$"
+ local pattern = table.concat(parts)
+ return function (string)
+ return string and string:match(pattern)
+ end
+end
+
+local function compileRoute(route)
+ local parts = {"^"}
+ local names = {}
+ for a, b, c, d in route:gmatch("([^:]*):([_%a][_%w]*)(:?)([^:]*)") do
+ if #a > 0 then
+ parts[#parts + 1] = escape(a)
+ end
+ if #c > 0 then
+ parts[#parts + 1] = "(.*)"
+ else
+ parts[#parts + 1] = "([^/]*)"
+ end
+ names[#names + 1] = b
+ if #d > 0 then
+ parts[#parts + 1] = escape(d)
+ end
+ end
+ if #parts == 1 then
+ return function (string)
+ if string == route then return {} end
+ end
+ end
+ parts[#parts + 1] = "$"
+ local pattern = table.concat(parts)
+ return function (string)
+ local matches = {string:match(pattern)}
+ if #matches > 0 then
+ local results = {}
+ for i = 1, #matches do
+ results[i] = matches[i]
+ results[names[i]] = matches[i]
+ end
+ return results
+ end
+ end
+end
+
+function server.route(options, handler)
+ local method = options.method
+ local path = options.path and compileRoute(options.path)
+ local host = options.host and compileGlob(options.host)
+ local filter = options.filter
+ server.use(function (req, res, go)
+ if method and req.method ~= method then return go() end
+ if host and not host(req.headers.host) then return go() end
+ if filter and not filter(req) then return go() end
+ local params
+ if path then
+ local pathname, query = req.path:match("^([^?]*)%??(.*)")
+ params = path(pathname)
+ if not params then return go() end
+ if #query > 0 then
+ req.query = parseQuery(query)
+ end
+ end
+ req.params = params or {}
+ return handler(req, res, go)
+ end)
+ return server
+end
+
+return server
diff --git a/plugins/weblit/auto-headers.lua b/plugins/weblit/auto-headers.lua
new file mode 100644
index 00000000000..44ad65779e9
--- /dev/null
+++ b/plugins/weblit/auto-headers.lua
@@ -0,0 +1,92 @@
+
+
+--[[
+
+Response automatic values:
+ - Auto Server header
+ - Auto Date Header
+ - code defaults to 404 with body "Not Found\n"
+ - if there is a string body add Content-Length and ETag if missing
+ - if string body and no Content-Type, use text/plain for valid utf-8, application/octet-stream otherwise
+ - Auto add "; charset=utf-8" to Content-Type when body is known to be valid utf-8
+ - Auto 304 responses for if-none-match requests
+ - Auto strip body with HEAD requests
+ - Auto chunked encoding if body with unknown length
+ - if Connection header set and not keep-alive, set res.keepAlive to false
+ - Add Connection Keep-Alive/Close if not found based on res.keepAlive
+
+--TODO: utf8 scanning
+
+]]
+
+--local digest = require('openssl').digest.digest
+local date = require('os').date
+
+return function (req, res, go)
+ local isHead = false
+ if req.method == "HEAD" then
+ req.method = "GET"
+ isHead = true
+ end
+
+ local requested = req.headers["if-none-match"]
+
+ go()
+
+ -- We could use the fancy metatable, but this is much faster
+ local lowerHeaders = {}
+ local headers = res.headers
+ for i = 1, #headers do
+ local key, value = unpack(headers[i])
+ lowerHeaders[key:lower()] = value
+ end
+
+
+ if not lowerHeaders.server then
+ headers[#headers + 1] = {"Server", serverName}
+ end
+ if not lowerHeaders.date then
+ headers[#headers + 1] = {"Date", date("!%a, %d %b %Y %H:%M:%S GMT")}
+ end
+
+ if not lowerHeaders.connection then
+ if req.keepAlive then
+ lowerHeaders.connection = "Keep-Alive"
+ headers[#headers + 1] = {"Connection", "Keep-Alive"}
+ else
+ headers[#headers + 1] = {"Connection", "Close"}
+ end
+ end
+ res.keepAlive = lowerHeaders.connection and lowerHeaders.connection:lower() == "keep-alive"
+
+ local body = res.body
+ if body then
+ local needLength = not lowerHeaders["content-length"] and not lowerHeaders["transfer-encoding"]
+ if type(body) == "string" then
+ if needLength then
+ headers[#headers + 1] = {"Content-Length", #body}
+ end
+ -- if not lowerHeaders.etag then
+ -- local etag = '"' .. digest("sha1", body) .. '"'
+ -- lowerHeaders.etag = etag
+ --headers[#headers + 1] = {"ETag", etag}
+ -- end
+ else
+ if needLength then
+ headers[#headers + 1] = {"Transfer-Encoding", "chunked"}
+ end
+ end
+ if not lowerHeaders["content-type"] then
+ headers[#headers + 1] = {"Content-Type", "text/plain"}
+ end
+ end
+
+ local etag = lowerHeaders.etag
+ if requested and res.code >= 200 and res.code < 300 and requested == etag then
+ res.code = 304
+ body = nil
+ end
+
+ if isHead then body = nil end
+ res.body = body
+end
diff --git a/plugins/weblit/etag-cache.lua b/plugins/weblit/etag-cache.lua
new file mode 100644
index 00000000000..e8c5d149b35
--- /dev/null
+++ b/plugins/weblit/etag-cache.lua
@@ -0,0 +1,39 @@
+
+local function clone(headers)
+ local copy = setmetatable({}, getmetatable(headers))
+ for i = 1, #headers do
+ copy[i] = headers[i]
+ end
+ return copy
+end
+
+local cache = {}
+return function (req, res, go)
+ local requested = req.headers["If-None-Match"]
+ local host = req.headers.Host
+ local key = host and host .. "|" .. req.path or req.path
+ local cached = cache[key]
+ if not requested and cached then
+ req.headers["If-None-Match"] = cached.etag
+ end
+ go()
+ local etag = res.headers.ETag
+ if not etag then return end
+ if res.code >= 200 and res.code < 300 then
+ local body = res.body
+ if not body or type(body) == "string" then
+ cache[key] = {
+ etag = etag,
+ code = res.code,
+ headers = clone(res.headers),
+ body = body
+ }
+ end
+ elseif res.code == 304 then
+ if not requested and cached and etag == cached.etag then
+ res.code = cached.code
+ res.headers = clone(cached.headers)
+ res.body = cached.body
+ end
+ end
+end
diff --git a/plugins/weblit/init.lua b/plugins/weblit/init.lua
new file mode 100644
index 00000000000..f9224b7880c
--- /dev/null
+++ b/plugins/weblit/init.lua
@@ -0,0 +1,8 @@
+local exports = {}
+exports.app = require('weblit/app')
+exports.autoHeaders = require('weblit/auto-headers')
+exports.etagCache = require('weblit/etag-cache')
+exports.logger = require('weblit/logger')
+exports.static = require('weblit/static')
+exports.websocket = require('weblit/websocket')
+return exports
diff --git a/plugins/weblit/logger.lua b/plugins/weblit/logger.lua
new file mode 100644
index 00000000000..912b4eed768
--- /dev/null
+++ b/plugins/weblit/logger.lua
@@ -0,0 +1,10 @@
+
+return function (req, res, go)
+ -- Skip this layer for clients who don't send User-Agent headers.
+ local userAgent = req.headers["user-agent"]
+ if not userAgent then return go() end
+ -- Run all inner layers first.
+ go()
+ -- And then log after everything is done
+ --print(string.format("%s %s %s %s", req.method, req.path, userAgent, res.code))
+end
diff --git a/plugins/weblit/plugin.json b/plugins/weblit/plugin.json
new file mode 100644
index 00000000000..69dd45ccc0e
--- /dev/null
+++ b/plugins/weblit/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "weblit",
+ "version": "1.0.0",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/plugins/weblit/static.lua b/plugins/weblit/static.lua
new file mode 100644
index 00000000000..b34ea638fa1
--- /dev/null
+++ b/plugins/weblit/static.lua
@@ -0,0 +1,62 @@
+
+local getType = require("mime").getType
+local jsonStringify = require('json').stringify
+
+local makeChroot = require('coro-fs').chroot
+
+return function (rootPath)
+
+ local fs = makeChroot(rootPath)
+
+ return function (req, res, go)
+ if req.method ~= "GET" then return go() end
+ local path = (req.params and req.params.path) or req.path
+ path = path:match("^[^?#]*")
+ if path:byte(1) == 47 then
+ path = path:sub(2)
+ end
+ local stat = fs.stat(path)
+ if not stat then return go() end
+
+ local function renderFile()
+ local body = assert(fs.readFile(path))
+ res.code = 200
+ res.headers["Content-Type"] = getType(path)
+ res.body = body
+ return
+ end
+
+ local function renderDirectory()
+ if req.path:byte(-1) ~= 47 then
+ res.code = 301
+ res.headers.Location = req.path .. '/'
+ return
+ end
+ local files = {}
+ for entry in fs.scandir(path) do
+ if entry.name == "index.html" and entry.type == "file" then
+ path = (#path > 0 and path .. "/" or "") .. "index.html"
+ return renderFile()
+ end
+ files[#files + 1] = entry
+ entry.url = "http://" .. req.headers.host .. req.path .. entry.name
+ end
+ local body = jsonStringify(files) .. "\n"
+ res.code = 200
+ res.headers["Content-Type"] = "application/json"
+ res.body = body
+ return
+ end
+
+ if stat.type == "directory" then
+ return renderDirectory()
+ elseif stat.type == "file" then
+ if req.path:byte(-1) == 47 then
+ res.code = 301
+ res.headers.Location = req.path:match("^(.*[^/])/+$")
+ return
+ end
+ return renderFile()
+ end
+ end
+end
diff --git a/plugins/weblit/websocket.lua b/plugins/weblit/websocket.lua
new file mode 100644
index 00000000000..d5dfe572ea6
--- /dev/null
+++ b/plugins/weblit/websocket.lua
@@ -0,0 +1,82 @@
+
+local websocketCodec = require('websocket-codec')
+
+local function websocketHandler(options, handler)
+ return function (req, res, go)
+ -- Websocket connections must be GET requests
+ -- with 'Upgrade: websocket'
+ -- and 'Connection: Upgrade' headers
+ local headers = req.headers
+ local connection = headers.connection
+ local upgrade = headers.upgrade
+ if not (
+ req.method == "GET" and
+ upgrade and upgrade:lower():find("websocket", 1, true) and
+ connection and connection:lower():find("upgrade", 1, true)
+ ) then
+ return go()
+ end
+
+ if options.filter and not options.filter(req) then
+ return go()
+ end
+
+ -- If there is a sub-protocol specified, filter on it.
+ local protocol = options.protocol
+ if protocol then
+ local list = headers["sec-websocket-protocol"]
+ local foundProtocol
+ if list then
+ for item in list:gmatch("[^, ]+") do
+ if item == protocol then
+ foundProtocol = true
+ break
+ end
+ end
+ end
+ if not foundProtocol then
+ return go()
+ end
+ end
+
+ -- Make sure it's a new client speaking v13 of the protocol
+ assert(tonumber(headers["sec-websocket-version"]) >= 13, "only websocket protocol v13 supported")
+
+ -- Get the security key
+ local key = assert(headers["sec-websocket-key"], "websocket security required")
+
+ res.code = 101
+ headers = res.headers
+ headers.Upgrade = "websocket"
+ headers.Connection = "Upgrade"
+ headers["Sec-WebSocket-Accept"] = websocketCodec.acceptKey(key)
+ if protocol then
+ headers["Sec-WebSocket-Protocol"] = protocol
+ end
+ function res.upgrade(read, write, updateDecoder, updateEncoder)
+ updateDecoder(websocketCodec.decode)
+ updateEncoder(websocketCodec.encode)
+ local success, err = pcall(handler, req, read, write)
+ if not success then
+ print(err)
+ write({
+ opcode = 1,
+ payload = err,
+ })
+ return write()
+ end
+ end
+ end
+end
+
+local server = require('weblit-app')
+function server.websocket(options, handler)
+ server.route({
+ method = "GET",
+ path = options.path,
+ host = options.host,
+ }, websocketHandler(options, handler))
+ return server
+end
+
+return websocketHandler
diff --git a/plugins/webserver/init.lua b/plugins/webserver/init.lua
new file mode 100644
index 00000000000..3d68b01e6d5
--- /dev/null
+++ b/plugins/webserver/init.lua
@@ -0,0 +1,34 @@
+local exports = {}
+exports.name = "webserver"
+exports.version = "1.0.0"
+exports.description = "A simple web server"
+exports.license = "MIT"
+exports.author = { name = "Miodrag Milanovic" }
+
+local ws = exports
+
+local app = require('weblit/app')
+
+function ws.startplugin()
+ app.bind({
+ host = "0.0.0.0",
+ port = 8080
+ })
+
+ app.use(require('weblit/logger'))
+ app.use(require('weblit/auto-headers'))
+ app.use(require('weblit/etag-cache'))
+
+ app.route({
+ method = "GET",
+ path = "/",
+ }, function (req, res, go)
+ res.code = 200
+ res.headers["Content-Type"] = "text/html"
+ res.body = "<h1>Hello!</h1>\n"
+ end)
+
+ app.start()
+end
+
+return exports
diff --git a/plugins/webserver/plugin.json b/plugins/webserver/plugin.json
new file mode 100644
index 00000000000..e420a5d5485
--- /dev/null
+++ b/plugins/webserver/plugin.json
@@ -0,0 +1,9 @@
+{
+ "plugin": {
+ "name": "webserver",
+ "version": "1.0.0",
+ "author": "Miodrag Milanovic",
+ "type": "plugin",
+ "start": "false",
+ }
+} \ No newline at end of file
diff --git a/plugins/websocket-codec/LICENSE b/plugins/websocket-codec/LICENSE
new file mode 100644
index 00000000000..5789b767285
--- /dev/null
+++ b/plugins/websocket-codec/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/plugins/websocket-codec/README.md b/plugins/websocket-codec/README.md
new file mode 100644
index 00000000000..50f41340dce
--- /dev/null
+++ b/plugins/websocket-codec/README.md
@@ -0,0 +1,2 @@
+# luv-websocket-codec
+A luv port of lit's websocket codec
diff --git a/plugins/websocket-codec/init.lua b/plugins/websocket-codec/init.lua
new file mode 100644
index 00000000000..8a7da7f9190
--- /dev/null
+++ b/plugins/websocket-codec/init.lua
@@ -0,0 +1,261 @@
+local exports = {}
+
+exports.name = "creationix/websocket-codec"
+exports.version = "1.0.7"
+exports.homepage = "https://github.com/luvit/lit/blob/master/deps/websocket-codec.lua"
+exports.description = "A codec implementing websocket framing and helpers for handshakeing"
+exports.tags = {"http", "websocket", "codec"}
+exports.license = "MIT"
+exports.author = { name = "Tim Caswell" }
+
+local digest = require('openssl').digest.digest
+local base64 = require('openssl').base64
+local random = require('openssl').random
+local bit = require('bit')
+
+local band = bit.band
+local bor = bit.bor
+local bxor = bit.bxor
+local rshift = bit.rshift
+local lshift = bit.lshift
+local char = string.char
+local byte = string.byte
+local sub = string.sub
+local gmatch = string.gmatch
+local lower = string.lower
+local gsub = string.gsub
+local concat = table.concat
+
+local function applyMask(data, mask)
+ local bytes = {
+ [0] = byte(mask, 1),
+ [1] = byte(mask, 2),
+ [2] = byte(mask, 3),
+ [3] = byte(mask, 4)
+ }
+ local out = {}
+ for i = 1, #data do
+ out[i] = char(
+ bxor(byte(data, i), bytes[(i - 1) % 4])
+ )
+ end
+ return concat(out)
+end
+
+function exports.decode(chunk)
+ if #chunk < 2 then return end
+ local second = byte(chunk, 2)
+ local len = band(second, 0x7f)
+ local offset
+ if len == 126 then
+ if #chunk < 4 then return end
+ len = bor(
+ lshift(byte(chunk, 3), 8),
+ byte(chunk, 4))
+ offset = 4
+ elseif len == 127 then
+ if #chunk < 10 then return end
+ len = bor(
+ lshift(byte(chunk, 3), 56),
+ lshift(byte(chunk, 4), 48),
+ lshift(byte(chunk, 5), 40),
+ lshift(byte(chunk, 6), 32),
+ lshift(byte(chunk, 7), 24),
+ lshift(byte(chunk, 8), 16),
+ lshift(byte(chunk, 9), 8),
+ byte(chunk, 10))
+ offset = 10
+ else
+ offset = 2
+ end
+ local mask = band(second, 0x80) > 0
+ if mask then
+ offset = offset + 4
+ end
+ if #chunk < offset + len then return end
+
+ local first = byte(chunk, 1)
+ local payload = sub(chunk, offset + 1, offset + len)
+ assert(#payload == len, "Length mismatch")
+ if mask then
+ payload = applyMask(payload, sub(chunk, offset - 3, offset))
+ end
+ local extra = sub(chunk, offset + len + 1)
+ return {
+ fin = band(first, 0x80) > 0,
+ rsv1 = band(first, 0x40) > 0,
+ rsv2 = band(first, 0x20) > 0,
+ rsv3 = band(first, 0x10) > 0,
+ opcode = band(first, 0xf),
+ mask = mask,
+ len = len,
+ payload = payload
+ }, extra
+end
+
+function exports.encode(item)
+ if type(item) == "string" then
+ item = {
+ opcode = 2,
+ payload = item
+ }
+ end
+ local payload = item.payload
+ assert(type(payload) == "string", "payload must be string")
+ local len = #payload
+ local fin = item.fin
+ if fin == nil then fin = true end
+ local rsv1 = item.rsv1
+ local rsv2 = item.rsv2
+ local rsv3 = item.rsv3
+ local opcode = item.opcode or 2
+ local mask = item.mask
+ local chars = {
+ char(bor(
+ fin and 0x80 or 0,
+ rsv1 and 0x40 or 0,
+ rsv2 and 0x20 or 0,
+ rsv3 and 0x10 or 0,
+ opcode
+ )),
+ char(bor(
+ mask and 0x80 or 0,
+ len < 126 and len or (len < 0x10000) and 126 or 127
+ ))
+ }
+ if len >= 0x10000 then
+ chars[3] = char(band(rshift(len, 56), 0xff))
+ chars[4] = char(band(rshift(len, 48), 0xff))
+ chars[5] = char(band(rshift(len, 40), 0xff))
+ chars[6] = char(band(rshift(len, 32), 0xff))
+ chars[7] = char(band(rshift(len, 24), 0xff))
+ chars[8] = char(band(rshift(len, 16), 0xff))
+ chars[9] = char(band(rshift(len, 8), 0xff))
+ chars[10] = char(band(len, 0xff))
+ elseif len >= 126 then
+ chars[3] = char(band(rshift(len, 8), 0xff))
+ chars[4] = char(band(len, 0xff))
+ end
+ if mask then
+ local key = random(4)
+ return concat(chars) .. key .. applyMask(payload, key)
+ end
+ return concat(chars) .. payload
+end
+
+local websocketGuid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
+
+function exports.acceptKey(key)
+ return gsub(base64(digest("sha1", key .. websocketGuid, true)), "\n", "")
+end
+local acceptKey = exports.acceptKey
+
+-- Make a client handshake connection
+function exports.handshake(options, request)
+ local key = gsub(base64(random(20)), "\n", "")
+ local host = options.host
+ local path = options.path or "/"
+ local protocol = options.protocol
+ local req = {
+ method = "GET",
+ path = path,
+ {"Connection", "Upgrade"},
+ {"Upgrade", "websocket"},
+ {"Sec-WebSocket-Version", "13"},
+ {"Sec-WebSocket-Key", key},
+ }
+ for i = 1, #options do
+ req[#req + 1] = options[i]
+ end
+ if host then
+ req[#req + 1] = {"Host", host}
+ end
+ if protocol then
+ req[#req + 1] = {"Sec-WebSocket-Protocol", protocol}
+ end
+ local res = request(req)
+ if not res then
+ return nil, "Missing response from server"
+ end
+ -- Parse the headers for quick reading
+ if res.code ~= 101 then
+ return nil, "response must be code 101"
+ end
+
+ local headers = {}
+ for i = 1, #res do
+ local name, value = unpack(res[i])
+ headers[lower(name)] = value
+ end
+
+ if not headers.connection or lower(headers.connection) ~= "upgrade" then
+ return nil, "Invalid or missing connection upgrade header in response"
+ end
+ if headers["sec-websocket-accept"] ~= acceptKey(key) then
+ return nil, "challenge key missing or mismatched"
+ end
+ if protocol and headers["sec-websocket-protocol"] ~= protocol then
+ return nil, "protocol missing or mistmatched"
+ end
+ return true
+end
+
+function exports.handleHandshake(head, protocol)
+
+ -- WebSocket connections must be GET requests
+ if not head.method == "GET" then return end
+
+ -- Parse the headers for quick reading
+ local headers = {}
+ for i = 1, #head do
+ local name, value = unpack(head[i])
+ headers[lower(name)] = value
+ end
+
+ -- Must have 'Upgrade: websocket' and 'Connection: Upgrade' headers
+ if not (headers.connection and headers.upgrade and
+ headers.connection:lower():find("upgrade", 1, true) and
+ headers.upgrade:lower():find("websocket", 1, true)) then return end
+
+ -- Make sure it's a new client speaking v13 of the protocol
+ if tonumber(headers["sec-websocket-version"]) < 13 then
+ return nil, "only websocket protocol v13 supported"
+ end
+
+ local key = headers["sec-websocket-key"]
+ if not key then
+ return nil, "websocket security key missing"
+ end
+
+ -- If the server wants a specified protocol, check for it.
+ if protocol then
+ local foundProtocol = false
+ local list = headers["sec-websocket-protocol"]
+ if list then
+ for item in gmatch(list, "[^, ]+") do
+ if item == protocol then
+ foundProtocol = true
+ break
+ end
+ end
+ end
+ if not foundProtocol then
+ return nil, "specified protocol missing in request"
+ end
+ end
+
+ local accept = acceptKey(key)
+
+ local res = {
+ code = 101,
+ {"Upgrade", "websocket"},
+ {"Connection", "Upgrade"},
+ {"Sec-WebSocket-Accept", accept},
+ }
+ if protocol then
+ res[#res + 1] = {"Sec-WebSocket-Protocol", protocol}
+ end
+
+ return res
+end
+return exports
diff --git a/plugins/websocket-codec/plugin.json b/plugins/websocket-codec/plugin.json
new file mode 100644
index 00000000000..00a49dbcba3
--- /dev/null
+++ b/plugins/websocket-codec/plugin.json
@@ -0,0 +1,8 @@
+{
+ "plugin": {
+ "name": "websocket-codec",
+ "version": "1.0.7",
+ "author": "Tim Caswell",
+ "type": "library",
+ }
+} \ No newline at end of file
diff --git a/regtests/jedutil/baseline/ampal18p8/pal10h8-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal10h8-as-ampal18p8.txt
new file mode 100644
index 00000000000..5b8dae63d99
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal10h8-as-ampal18p8.txt
@@ -0,0 +1,97 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+12 (Combinatorial, Output feedback output, Active high)
+13 (Combinatorial, Output feedback output, Active high)
+14 (Combinatorial, Output feedback output, Active high)
+15 (Combinatorial, Output feedback output, Active high)
+16 (Combinatorial, Output feedback output, Active high)
+17 (Combinatorial, Output feedback output, Active high)
+18 (Combinatorial, Output feedback output, Active high)
+19 (Combinatorial, Output feedback output, Active high)
+
+Equations:
+
+o12 = i2 +
+ i1 & i3 +
+ i4 & /i11 +
+ i5 +
+ i6 +
+ /i1 & i7 +
+ i8 +
+ i9 & i11
+o12.oe = vcc
+
+o13 = /i2 +
+ /i4 +
+ /i3 & /i6 +
+ /i8 +
+ /i11 +
+ /i9 +
+ /i1 & /i7 +
+ /i5
+o13.oe = vcc
+
+o14 = i4 +
+ /i8 & i11 +
+ /i6 +
+ /i2 +
+ i5 & /i11 +
+ i7 +
+ /i3 & /i9 +
+ /i1
+o14.oe = vcc
+
+o15 = i5 +
+ /i1 +
+ i1 & i7 +
+ /i3 +
+ i1 & /i3 +
+ i2 & i9 +
+ /i8 +
+ i4
+o15.oe = vcc
+
+o16 = i6 +
+ i3 & i11 +
+ i6 & i8 +
+ /i1 +
+ /i8 +
+ /i7 & /i8 +
+ /i2 & /i9 +
+ /i5 & i7 & i8
+o16.oe = vcc
+
+o17 = i7 +
+ i2 & i9 +
+ i3 & i4 +
+ /i5 +
+ /i9 +
+ /i8 +
+ /i1 & /i11 +
+ i6 & i9
+o17.oe = vcc
+
+o18 = /i1 +
+ /i3 +
+ /i5 +
+ /i7 +
+ /i9 +
+ /i11 +
+ i1 & i7 & i11 +
+ i3 & i5 & i9
+o18.oe = vcc
+
+o19 = i3 & i11 +
+ i1 +
+ /i1 & /i9 +
+ /i3 & /i5 & /i7 +
+ i2 +
+ i4 +
+ i6 +
+ i8
+o19.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal10l8-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal10l8-as-ampal18p8.txt
new file mode 100644
index 00000000000..78a3cef7b0d
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal10l8-as-ampal18p8.txt
@@ -0,0 +1,97 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+12 (Combinatorial, Output feedback output, Active low)
+13 (Combinatorial, Output feedback output, Active low)
+14 (Combinatorial, Output feedback output, Active low)
+15 (Combinatorial, Output feedback output, Active low)
+16 (Combinatorial, Output feedback output, Active low)
+17 (Combinatorial, Output feedback output, Active low)
+18 (Combinatorial, Output feedback output, Active low)
+19 (Combinatorial, Output feedback output, Active low)
+
+Equations:
+
+/o12 = /i1 & i7 +
+ i8 +
+ i9 & i11 +
+ i2 +
+ i1 & i3 +
+ i5 +
+ i4 & /i11 +
+ i6
+o12.oe = vcc
+
+/o13 = /i8 +
+ /i11 +
+ /i9 +
+ /i3 & /i6 +
+ /i1 & /i7 +
+ /i2 +
+ /i4 +
+ /i5
+o13.oe = vcc
+
+/o14 = /i3 & /i9 +
+ /i6 +
+ /i2 +
+ i4 +
+ /i8 & i11 +
+ i7 +
+ i5 & /i11 +
+ /i1
+o14.oe = vcc
+
+/o15 = i4 +
+ i1 & /i3 +
+ i2 & i9 +
+ i5 +
+ i1 & i7 +
+ /i3 +
+ /i8 +
+ /i1
+o15.oe = vcc
+
+/o16 = i6 +
+ /i2 & /i9 +
+ i3 & i11 +
+ /i8 +
+ i6 & i8 +
+ /i1 +
+ /i5 & i7 & i8 +
+ /i7 & /i8
+o16.oe = vcc
+
+/o17 = i3 & i4 +
+ /i5 +
+ /i9 +
+ /i1 & /i11 +
+ i7 +
+ i2 & i9 +
+ i6 & i9 +
+ /i8
+o17.oe = vcc
+
+/o18 = /i9 +
+ i3 & i5 & i9 +
+ /i7 +
+ /i11 +
+ /i1 +
+ /i3 +
+ /i5 +
+ i1 & i7 & i11
+o18.oe = vcc
+
+/o19 = /i3 & /i5 & /i7 +
+ i2 +
+ i8 +
+ i3 & i11 +
+ i1 +
+ i4 +
+ i6 +
+ /i1 & /i9
+o19.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal12h6-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal12h6-as-ampal18p8.txt
new file mode 100644
index 00000000000..4f70393f5b5
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal12h6-as-ampal18p8.txt
@@ -0,0 +1,75 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+13 (Combinatorial, Output feedback output, Active high)
+14 (Combinatorial, Output feedback output, Active high)
+15 (Combinatorial, Output feedback output, Active high)
+16 (Combinatorial, Output feedback output, Active high)
+17 (Combinatorial, Output feedback output, Active high)
+18 (Combinatorial, Output feedback output, Active high)
+
+Equations:
+
+o13 = /i2 +
+ /i4 +
+ /i3 & /i6 +
+ /i8 +
+ /i11 +
+ /i9 +
+ /i1 & /i7 +
+ /i5
+o13.oe = vcc
+
+o14 = i4 +
+ /i8 & i11 +
+ /i6 +
+ /i2 +
+ i5 & /i11 +
+ i7 +
+ /i3 & /i9 +
+ /i1 & /i12
+o14.oe = vcc
+
+o15 = i5 & i19 +
+ /i1 +
+ i1 & i7 +
+ /i3 +
+ i1 & /i3 +
+ i2 & i9 +
+ /i8 +
+ i4
+o15.oe = vcc
+
+o16 = i6 +
+ i3 & i11 +
+ i6 & i8 +
+ /i1 +
+ /i8 +
+ /i7 & /i8 +
+ /i2 & /i9 +
+ /i5 & i7 & i8
+o16.oe = vcc
+
+o17 = i7 & i12 +
+ i2 & i9 +
+ i3 & i4 +
+ /i5 +
+ /i9 +
+ /i8 +
+ /i1 & /i11 +
+ i6 & i9
+o17.oe = vcc
+
+o18 = /i1 +
+ /i3 +
+ /i5 +
+ /i7 +
+ /i9 & /i19 +
+ /i11 +
+ i1 & i7 & i11 +
+ i3 & i5 & i9
+o18.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal12l6-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal12l6-as-ampal18p8.txt
new file mode 100644
index 00000000000..31e39086292
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal12l6-as-ampal18p8.txt
@@ -0,0 +1,75 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+13 (Combinatorial, Output feedback output, Active low)
+14 (Combinatorial, Output feedback output, Active low)
+15 (Combinatorial, Output feedback output, Active low)
+16 (Combinatorial, Output feedback output, Active low)
+17 (Combinatorial, Output feedback output, Active low)
+18 (Combinatorial, Output feedback output, Active low)
+
+Equations:
+
+/o13 = /i8 +
+ /i11 +
+ /i9 +
+ /i3 & /i6 +
+ /i1 & /i7 +
+ /i2 +
+ /i4 & /i12 +
+ /i5
+o13.oe = vcc
+
+/o14 = /i3 & /i9 & i19 +
+ /i6 +
+ /i2 +
+ i4 +
+ /i8 & i11 +
+ i7 +
+ i5 & /i11 +
+ /i1
+o14.oe = vcc
+
+/o15 = i4 +
+ i1 & /i3 +
+ i2 & i9 +
+ i5 +
+ i1 & i7 +
+ /i3 +
+ /i8 +
+ /i1
+o15.oe = vcc
+
+/o16 = i6 +
+ /i2 & /i9 +
+ i3 & i11 +
+ /i8 +
+ i6 & i8 +
+ /i1 +
+ /i5 & i7 & i8 +
+ /i7 & /i8 & i12
+o16.oe = vcc
+
+/o17 = i3 & i4 +
+ /i5 +
+ /i9 +
+ /i1 & /i11 +
+ i7 +
+ i2 & i9 & /i19 +
+ i6 & i9 +
+ /i8
+o17.oe = vcc
+
+/o18 = /i9 +
+ i3 & i5 & i9 +
+ /i7 +
+ /i11 +
+ /i1 +
+ /i3 +
+ /i5 +
+ i1 & i7 & i11
+o18.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal14h4-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal14h4-as-ampal18p8.txt
new file mode 100644
index 00000000000..4c7f55a1dba
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal14h4-as-ampal18p8.txt
@@ -0,0 +1,53 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+14 (Combinatorial, Output feedback output, Active high)
+15 (Combinatorial, Output feedback output, Active high)
+16 (Combinatorial, Output feedback output, Active high)
+17 (Combinatorial, Output feedback output, Active high)
+
+Equations:
+
+o14 = i4 +
+ /i8 & i11 +
+ /i12 +
+ /i2 +
+ i5 & /i11 +
+ i7 & i12 +
+ /i3 & /i9 +
+ /i1
+o14.oe = vcc
+
+o15 = i5 +
+ /i13 +
+ i1 & i7 +
+ /i3 +
+ /i3 & i13 +
+ i2 & i9 +
+ /i8 +
+ i4
+o15.oe = vcc
+
+o16 = i6 +
+ i3 & i11 +
+ i6 & i18 +
+ /i1 +
+ /i18 +
+ /i7 & /i8 +
+ /i2 & /i9 +
+ /i5 & i7 & i8
+o16.oe = vcc
+
+o17 = i7 +
+ i2 & i19 +
+ i3 & i4 +
+ /i5 +
+ /i9 +
+ /i19 +
+ /i1 & /i11 +
+ i6 & i9
+o17.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal14l4-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal14l4-as-ampal18p8.txt
new file mode 100644
index 00000000000..967c5f1702d
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal14l4-as-ampal18p8.txt
@@ -0,0 +1,53 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+14 (Combinatorial, Output feedback output, Active low)
+15 (Combinatorial, Output feedback output, Active low)
+16 (Combinatorial, Output feedback output, Active low)
+17 (Combinatorial, Output feedback output, Active low)
+
+Equations:
+
+/o14 = /i8 & i11 +
+ i4 +
+ /i12 +
+ i5 & /i11 +
+ i1 +
+ i7 & i12 +
+ /i3 & /i9 +
+ /i2
+o14.oe = vcc
+
+/o15 = i1 & i7 +
+ /i8 +
+ i5 +
+ /i13 +
+ /i3 +
+ i2 & i9 +
+ i4 +
+ /i3 & i13
+o15.oe = vcc
+
+/o16 = /i18 +
+ i3 & i11 +
+ i6 +
+ i6 & i18 +
+ /i1 +
+ /i5 & i7 & i8 +
+ /i2 & /i9 +
+ /i7 & /i8
+o16.oe = vcc
+
+/o17 = i2 & i19 +
+ /i9 +
+ /i19 +
+ i3 & i4 +
+ i6 & i9 +
+ /i5 +
+ /i1 & /i11 +
+ i7
+o17.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal16h2-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal16h2-as-ampal18p8.txt
new file mode 100644
index 00000000000..358dc093584
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal16h2-as-ampal18p8.txt
@@ -0,0 +1,31 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+15 (Combinatorial, Output feedback output, Active high)
+16 (Combinatorial, Output feedback output, Active high)
+
+Equations:
+
+o15 = i5 +
+ /i13 & /i14 +
+ i1 & i7 +
+ /i3 & i14 +
+ /i3 & i13 +
+ i2 & i9 +
+ /i8 +
+ i4
+o15.oe = vcc
+
+o16 = i6 +
+ i3 & i11 +
+ i6 & i18 +
+ /i1 & /i17 +
+ /i18 +
+ /i7 & /i8 +
+ /i2 & /i9 +
+ /i5 & i7 & i8 & i17
+o16.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal16l2-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal16l2-as-ampal18p8.txt
new file mode 100644
index 00000000000..615dda7cdb6
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal16l2-as-ampal18p8.txt
@@ -0,0 +1,31 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+15 (Combinatorial, Output feedback output, Active low)
+16 (Combinatorial, Output feedback output, Active low)
+
+Equations:
+
+/o15 = i5 & /i11 +
+ /i3 & i14 +
+ /i3 & i13 +
+ /i13 & /i14 +
+ i1 & i7 & i12 +
+ /i8 & i18 +
+ i2 & i9 +
+ i4 & i17 & /i19
+o15.oe = vcc
+
+/o16 = /i2 & /i9 & i19 +
+ i3 & i11 & /i18 +
+ /i5 & i7 & i8 & i17 +
+ i6 & i18 +
+ /i1 & i14 & /i17 +
+ i13 & /i18 +
+ /i7 & /i8 & /i12 +
+ i6
+o16.oe = vcc
+
diff --git a/regtests/jedutil/baseline/ampal18p8/pal16l8-as-ampal18p8.txt b/regtests/jedutil/baseline/ampal18p8/pal16l8-as-ampal18p8.txt
new file mode 100644
index 00000000000..5608bdc0ccc
--- /dev/null
+++ b/regtests/jedutil/baseline/ampal18p8/pal16l8-as-ampal18p8.txt
@@ -0,0 +1,89 @@
+Inputs:
+
+1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19
+
+Outputs:
+
+12 (Combinatorial, Output feedback output, Active high)
+13 (Combinatorial, Output feedback output, Active low)
+14 (Combinatorial, Output feedback output, Active low)
+15 (Combinatorial, Output feedback output, Active low)
+16 (Combinatorial, Output feedback output, Active low)
+17 (Combinatorial, Output feedback output, Active low)
+18 (Combinatorial, Output feedback output, Active high)
+19 (Combinatorial, Output feedback output, Active high)
+
+Equations:
+
+o12 = i1 & /i2 +
+ /i1 & i3 +
+ /i3 & i7 +
+ i4 & o13 +
+ i6 & /o13 +
+ i6 & /i7 +
+ /i6 & /i8 & /i9
+o12.oe = /i5
+
+/o13 = i3 +
+ o14 +
+ /i11 +
+ i2 +
+ /i4 & /o14 +
+ i8 & i9 +
+ i5
+o13.oe = vcc
+
+/o14 = i4 +
+ /i8 & i11 +
+ o15 +
+ /i2 +
+ i5 & /i11 +
+ i7 +
+ /i3 & /i9
+o14.oe = i1
+
+/o15 = i5 +
+ /o16 +
+ i1 & i7 +
+ /i3 +
+ /i3 & o16 +
+ i2 & i9 +
+ /i8
+o15.oe = vcc
+
+/o16 = i6 +
+ i3 & i11 +
+ i6 & o17 +
+ /i1 +
+ /o17 +
+ /i7 & /i8 +
+ /i2 & /i9
+o16.oe = /i11
+
+/o17 = i7 +
+ i2 & o18 +
+ i3 & i4 +
+ /i5 +
+ /i9 +
+ /o18 +
+ /i1 & /i11
+o17.oe = vcc
+
+o18 = i3 +
+ i8 +
+ i9 & i11 +
+ i1 +
+ /i4 +
+ i2 +
+ i5 & /i7
+o18.oe = vcc
+
+o19 = o18 +
+ o17 +
+ o16 +
+ o15 +
+ o14 +
+ o13 +
+ /o13 & /o14 & /o15 & /o16 & /o17 & /o18
+o19.oe = i3
+
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal10h8-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal10h8-as-ampal18p8.pds
new file mode 100644
index 00000000000..3cf9c714392
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal10h8-as-ampal18p8.pds
@@ -0,0 +1,119 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL10H8 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL10H8Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 O12 COMBINATORIAL ;
+PIN 13 O13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 O18 COMBINATORIAL ;
+PIN 19 O19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+O12 = I2 +
+ I1 * I3 +
+ I4 * /I11 +
+ I5 +
+ I6 +
+ /I1 * I7 +
+ I8 +
+ I9 * I11
+
+O13 = /I2 +
+ /I4 +
+ /I3 * /I6 +
+ /I8 +
+ /I11 +
+ /I9 +
+ /I1 * /I7 +
+ /I5
+
+O14 = I4 +
+ /I8 * I11 +
+ /I6 +
+ /I2 +
+ I5 * /I11 +
+ I7 +
+ /I3 * /I9 +
+ /I1
+
+O15 = I5 +
+ /I1 +
+ I1 * I7 +
+ /I3 +
+ I1 * /I3 +
+ I2 * I9 +
+ /I8 +
+ I4
+
+O16 = I6 +
+ I3 * I11 +
+ I6 * I8 +
+ /I1 +
+ /I8 +
+ /I7 * /I8 +
+ /I2 * /I9 +
+ /i5 * I7 * I8
+
+O17 = I7 +
+ I2 * I9 +
+ I3 * I4 +
+ /I5 +
+ /I9 +
+ /I8 +
+ /I1 * /I11 +
+ I6 * I9
+
+O18 = /I1 +
+ /I3 +
+ /I5 +
+ /I7 +
+ /I9 +
+ /I11 +
+ I1 * I7 * I11 +
+ I3 * I5 * I9
+
+O19 = I3 * I11 +
+ I1 +
+ /I1 * /I9 +
+ /I3 * /I5 * /I7 +
+ I2 +
+ I4 +
+ I6 +
+ I8
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal10l8-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal10l8-as-ampal18p8.pds
new file mode 100644
index 00000000000..4841fd124fe
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal10l8-as-ampal18p8.pds
@@ -0,0 +1,119 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL10L8 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL10L8Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 O12 COMBINATORIAL ;
+PIN 13 O13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 O18 COMBINATORIAL ;
+PIN 19 O19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+/O12 = /I1 * I7 +
+ I8 +
+ I9 * I11 +
+ I2 +
+ I1 * I3 +
+ I5 +
+ I4 * /I11 +
+ I6
+
+/O13 = /I8 +
+ /I11 +
+ /I9 +
+ /I3 * /I6 +
+ /I1 * /I7 +
+ /I2 +
+ /I4 +
+ /I5
+
+/O14 = /I3 * /I9 +
+ /I6 +
+ /I2 +
+ I4 +
+ /I8 * I11 +
+ I7 +
+ I5 * /I11 +
+ /I1
+
+/O15 = I4 +
+ I1 * /I3 +
+ I2 * I9 +
+ I5 +
+ I1 * I7 +
+ /I3 +
+ /I8 +
+ /I1
+
+/O16 = I6 +
+ /I2 * /I9 +
+ I3 * I11 +
+ /I8 +
+ I6 * I8 +
+ /I1 +
+ /i5 * I7 * I8 +
+ /I7 * /I8
+
+/O17 = I3 * I4 +
+ /I5 +
+ /I9 +
+ /I1 * /I11 +
+ I7 +
+ I2 * I9 +
+ I6 * I9 +
+ /I8
+
+/O18 = /I9 +
+ I3 * I5 * I9 +
+ /I7 +
+ /I11 +
+ /I1 +
+ /I3 +
+ /I5 +
+ I1 * I7 * I11
+
+/O19 = /I3 * /I5 * /I7 +
+ I2 +
+ I8 +
+ I3 * I11 +
+ I1 +
+ I4 +
+ I6 +
+ /I1 * /I9
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal12h6-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal12h6-as-ampal18p8.pds
new file mode 100644
index 00000000000..ebe77ff8db4
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal12h6-as-ampal18p8.pds
@@ -0,0 +1,101 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL12H6 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL12H6Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 I12 COMBINATORIAL ;
+PIN 13 O13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 O18 COMBINATORIAL ;
+PIN 19 I19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+O13 = /I2 +
+ /I4 +
+ /I3 * /I6 +
+ /I8 +
+ /I11 +
+ /I9 +
+ /I1 * /I7 +
+ /I5
+
+O14 = I4 +
+ /I8 * I11 +
+ /I6 +
+ /I2 +
+ I5 * /I11 +
+ I7 +
+ /I3 * /I9 +
+ /I1 * /I12
+
+O15 = I5 * I19 +
+ /I1 +
+ I1 * I7 +
+ /I3 +
+ I1 * /I3 +
+ I2 * I9 +
+ /I8 +
+ I4
+
+O16 = I6 +
+ I3 * I11 +
+ I6 * I8 +
+ /I1 +
+ /I8 +
+ /I7 * /I8 +
+ /I2 * /I9 +
+ /i5 * I7 * I8
+
+O17 = I7 * I12 +
+ I2 * I9 +
+ I3 * I4 +
+ /I5 +
+ /I9 +
+ /I8 +
+ /I1 * /I11 +
+ I6 * I9
+
+O18 = /I1 +
+ /I3 +
+ /I5 +
+ /I7 +
+ /I9 * /I19 +
+ /I11 +
+ I1 * I7 * I11 +
+ I3 * I5 * I9
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal12l6-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal12l6-as-ampal18p8.pds
new file mode 100644
index 00000000000..3568dd79538
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal12l6-as-ampal18p8.pds
@@ -0,0 +1,101 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL12L6 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL12L6Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 I12 COMBINATORIAL ;
+PIN 13 O13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 O18 COMBINATORIAL ;
+PIN 19 I19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+/O13 = /I8 +
+ /I11 +
+ /I9 +
+ /I3 * /I6 +
+ /I1 * /I7 +
+ /I2 +
+ /I4 * /I12 +
+ /I5
+
+/O14 = /I3 * /I9 * I19 +
+ /I6 +
+ /I2 +
+ I4 +
+ /I8 * I11 +
+ I7 +
+ I5 * /I11 +
+ /I1
+
+/O15 = I4 +
+ I1 * /I3 +
+ I2 * I9 +
+ I5 +
+ I1 * I7 +
+ /I3 +
+ /I8 +
+ /I1
+
+/O16 = I6 +
+ /I2 * /I9 +
+ I3 * I11 +
+ /I8 +
+ I6 * I8 +
+ /I1 +
+ /i5 * I7 * I8 +
+ /I7 * /I8 * I12
+
+/O17 = I3 * I4 +
+ /I5 +
+ /I9 +
+ /I1 * /I11 +
+ I7 +
+ I2 * I9 * /I19 +
+ I6 * I9 +
+ /I8
+
+/O18 = /I9 +
+ I3 * I5 * I9 +
+ /I7 +
+ /I11 +
+ /I1 +
+ /I3 +
+ /I5 +
+ I1 * I7 * I11
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal14h4-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal14h4-as-ampal18p8.pds
new file mode 100644
index 00000000000..1da96c947de
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal14h4-as-ampal18p8.pds
@@ -0,0 +1,83 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL14H4 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL14H4Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 I12 COMBINATORIAL ;
+PIN 13 I13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 I18 COMBINATORIAL ;
+PIN 19 I19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+O14 = I4 +
+ /I8 * I11 +
+ /I12 +
+ /I2 +
+ I5 * /I11 +
+ I7 * I12 +
+ /I3 * /I9 +
+ /I1
+
+O15 = I5 +
+ /I13 +
+ I1 * I7 +
+ /I3 +
+ /I3 * I13 +
+ I2 * I9 +
+ /I8 +
+ I4
+
+O16 = I6 +
+ I3 * I11 +
+ I6 * I18 +
+ /I1 +
+ /I18 +
+ /I7 * /I8 +
+ /I2 * /I9 +
+ /i5 * I7 * I8
+
+O17 = I7 +
+ I2 * I19 +
+ I3 * I4 +
+ /I5 +
+ /I9 +
+ /I19 +
+ /I1 * /I11 +
+ I6 * I9
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal14l4-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal14l4-as-ampal18p8.pds
new file mode 100644
index 00000000000..a2857768646
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal14l4-as-ampal18p8.pds
@@ -0,0 +1,83 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL14L4 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL14L4Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 I12 COMBINATORIAL ;
+PIN 13 I13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 I18 COMBINATORIAL ;
+PIN 19 I19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+/O14 = /I8 * I11 +
+ I4 +
+ /I12 +
+ I5 * /I11 +
+ I1 +
+ I7 * I12 +
+ /I3 * /I9 +
+ /I2
+
+/O15 = I1 * I7 +
+ /I8 +
+ I5 +
+ /I13 +
+ /I3 +
+ I2 * I9 +
+ I4 +
+ /I3 * I13
+
+/O16 = /I18 +
+ I3 * I11 +
+ I6 +
+ I6 * I18 +
+ /I1 +
+ /i5 * I7 * I8 +
+ /I2 * /I9 +
+ /I7 * /I8
+
+/O17 = I2 * I19 +
+ /I9 +
+ /I19 +
+ I3 * I4 +
+ I6 * I9 +
+ /I5 +
+ /I1 * /I11 +
+ I7
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal16h2-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal16h2-as-ampal18p8.pds
new file mode 100644
index 00000000000..d9b7a4509a9
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal16h2-as-ampal18p8.pds
@@ -0,0 +1,65 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL16H2 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL16H2Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 I12 COMBINATORIAL ;
+PIN 13 I13 COMBINATORIAL ;
+PIN 14 I14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 I17 COMBINATORIAL ;
+PIN 18 I18 COMBINATORIAL ;
+PIN 19 I19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+O15 = I5 +
+ /I13 * /I14 +
+ I1 * I7 +
+ /I3 * I14 +
+ /I3 * I13 +
+ I2 * I9 +
+ /I8 +
+ I4
+
+O16 = I6 +
+ I3 * I11 +
+ I6 * I18 +
+ /I1 * /I17 +
+ /I18 +
+ /I7 * /I8 +
+ /I2 * /I9 +
+ /i5 * I7 * I8 * I17
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal16l2-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal16l2-as-ampal18p8.pds
new file mode 100644
index 00000000000..3b7fd87a2c9
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal16l2-as-ampal18p8.pds
@@ -0,0 +1,65 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL16L2 Test
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL16L2Test PAL18P8
+
+SIGNATURE #b0010011001100110011001100110011001100110011001100110011001100100
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 I12 COMBINATORIAL ;
+PIN 13 I13 COMBINATORIAL ;
+PIN 14 I14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 I17 COMBINATORIAL ;
+PIN 18 I18 COMBINATORIAL ;
+PIN 19 I19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+/O15 = I5 * /I11 +
+ /I3 * I14 +
+ /I3 * I13 +
+ /I13 * /I14 +
+ I1 * I7 * I12 +
+ /I8 * I18 +
+ I2 * I9 +
+ I4 * I17 * /I19
+
+/O16 = /I2 * /I9 * I19 +
+ I3 * I11 * /I18 +
+ /i5 * I7 * I8 * I17 +
+ I6 * I18 +
+ /I1 * I14 * /I17 +
+ I13 * /I18 +
+ /I7 * /I8 * /I12 +
+ I6
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/PALASM/ampal18p8/pal16l8-as-ampal18p8.pds b/regtests/jedutil/eqns/PALASM/ampal18p8/pal16l8-as-ampal18p8.pds
new file mode 100644
index 00000000000..ff01258418b
--- /dev/null
+++ b/regtests/jedutil/eqns/PALASM/ampal18p8/pal16l8-as-ampal18p8.pds
@@ -0,0 +1,119 @@
+;PALASM Design Description
+
+;---------------------------------- Declaration Segment ------------
+TITLE PAL16L8 Test 1
+PATTERN A
+REVISION 1.0
+AUTHOR MAMEDev
+COMPANY MAMEDev
+DATE 08/25/13
+
+CHIP PAL16L8 PAL18P8
+
+SIGNATURE #b1110011001100110011001100110011001100110011001100110011001100110
+
+;---------------------------------- PIN Declarations ---------------
+PIN 1 I1 COMBINATORIAL ;
+PIN 2 I2 COMBINATORIAL ;
+PIN 3 I3 COMBINATORIAL ;
+PIN 4 I4 COMBINATORIAL ;
+PIN 5 I5 COMBINATORIAL ;
+PIN 6 I6 COMBINATORIAL ;
+PIN 7 I7 COMBINATORIAL ;
+PIN 8 I8 COMBINATORIAL ;
+PIN 9 I9 COMBINATORIAL ;
+PIN 10 GND ;
+PIN 11 I11 COMBINATORIAL ;
+PIN 12 O12 COMBINATORIAL ;
+PIN 13 O13 COMBINATORIAL ;
+PIN 14 O14 COMBINATORIAL ;
+PIN 15 O15 COMBINATORIAL ;
+PIN 16 O16 COMBINATORIAL ;
+PIN 17 O17 COMBINATORIAL ;
+PIN 18 O18 COMBINATORIAL ;
+PIN 19 O19 COMBINATORIAL ;
+PIN 20 VCC ;
+
+;----------------------------------- Boolean Equation Segment ------
+EQUATIONS
+
+MINIMIZE_OFF
+
+O12 = I1 * /I2 +
+ /I1 * I3 +
+ /I3 * I7 +
+ I4 * O13 +
+ I6 * /O13 +
+ I6 * /I7 +
+ /I6 * /I8 * /I9
+O12.TRST = /I5
+
+/O13 = I3 +
+ O14 +
+ /I11 +
+ I2 +
+ /I4 * /O14 +
+ I8 * I9 +
+ I5
+O13.TRST = VCC
+
+/O14 = I4 +
+ /I8 * I11 +
+ O15 +
+ /I2 +
+ I5 * /I11 +
+ I7 +
+ /I3 * /I9
+O14.TRST = I1
+
+/O15 = I5 +
+ /O16 +
+ I1 * I7 +
+ /I3 +
+ /I3 * O16 +
+ I2 * I9 +
+ /I8
+O15.TRST = VCC
+
+/O16 = I6 +
+ I3 * I11 +
+ I6 * O17 +
+ /I1 +
+ /O17 +
+ /I7 * /I8 +
+ /I2 * /I9
+O16.TRST = /I11
+
+/O17 = I7 +
+ I2 * O18 +
+ I3 * I4 +
+ /I5 +
+ /I9 +
+ /O18 +
+ /I1 * /I11
+O17.TRST = VCC
+
+O18 = I3 +
+ I8 +
+ I9 * I11 +
+ I1 +
+ /I4 +
+ I2 +
+ I5 * /I7
+O18.TRST = VCC
+
+O19 = O18 +
+ O17 +
+ O16 +
+ O15 +
+ O14 +
+ O13 +
+ /O13 * /O14 * /O15 * /O16 * /O17 * /O18
+O19.TRST = I3
+
+MINIMIZE_ON
+
+;----------------------------------- Simulation Segment ------------
+SIMULATION
+
+;-------------------------------------------------------------------
diff --git a/regtests/jedutil/eqns/pal10l8/pal10l8.eqn b/regtests/jedutil/eqns/pal10l8/pal10l8.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal10l8/pal10l8.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal12h6/pal12h6.eqn b/regtests/jedutil/eqns/pal12h6/pal12h6.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal12h6/pal12h6.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal12l6/pal12l6.eqn b/regtests/jedutil/eqns/pal12l6/pal12l6.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal12l6/pal12l6.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal14h4/pal14h4.eqn b/regtests/jedutil/eqns/pal14h4/pal14h4.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal14h4/pal14h4.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal14l4/pal14l4.eqn b/regtests/jedutil/eqns/pal14l4/pal14l4.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal14l4/pal14l4.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16c1/pal16c1.eqn b/regtests/jedutil/eqns/pal16c1/pal16c1.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16c1/pal16c1.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16h2/pal16h2.eqn b/regtests/jedutil/eqns/pal16h2/pal16h2.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16h2/pal16h2.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16l2/pal16l2.eqn b/regtests/jedutil/eqns/pal16l2/pal16l2.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16l2/pal16l2.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16l8/pal16l8.eqn b/regtests/jedutil/eqns/pal16l8/pal16l8.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16l8/pal16l8.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16r4/pal16r4.eqn b/regtests/jedutil/eqns/pal16r4/pal16r4.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16r4/pal16r4.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16r6/pal16r6.eqn b/regtests/jedutil/eqns/pal16r6/pal16r6.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16r6/pal16r6.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal16r8/pal16r8.eqn b/regtests/jedutil/eqns/pal16r8/pal16r8.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal16r8/pal16r8.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal20l10/pal20l10.eqn b/regtests/jedutil/eqns/pal20l10/pal20l10.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal20l10/pal20l10.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal20l8/pal20l8.eqn b/regtests/jedutil/eqns/pal20l8/pal20l8.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal20l8/pal20l8.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal20r4/pal20r4.eqn b/regtests/jedutil/eqns/pal20r4/pal20r4.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal20r4/pal20r4.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal20r6/pal20r6.eqn b/regtests/jedutil/eqns/pal20r6/pal20r6.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal20r6/pal20r6.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/pal20r8/pal20r8.eqn b/regtests/jedutil/eqns/pal20r8/pal20r8.eqn
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/pal20r8/pal20r8.eqn
+++ /dev/null
diff --git a/regtests/jedutil/eqns/readme.txt b/regtests/jedutil/eqns/readme.txt
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/regtests/jedutil/eqns/readme.txt
+++ /dev/null
diff --git a/regtests/jedutil/jeds/ampal18p8/pal10h8-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal10h8-as-ampal18p8.jed
new file mode 100644
index 00000000000..0fb38aa728c
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal10h8-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL10H8 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL10H8TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 111111111111111111111111111111111111*
+L0036 111101111111111111111111111111011111*
+L0072 110111111111111111111111111111111111*
+L0108 111011111111111111111111111110111111*
+L0144 111110111111101111111011111111111111*
+L0180 011111111111111111111111111111111111*
+L0216 111111110111111111111111111111111111*
+L0252 111111111111111101111111111111111111*
+L0288 111111111111111111111111011111111111*
+L0324 111111111111111111111111111111111111*
+L0360 111011111111111111111111111111111111*
+L0396 111110111111111111111111111111111111*
+L0432 111111111111101111111111111111111111*
+L0468 111111111111111111111011111111111111*
+L0504 111111111111111111111111111110111111*
+L0540 111111111111111111111111111111101111*
+L0576 110111111111111111110111111111011111*
+L0612 111101111111011111111111111101111111*
+L0648 111111111111111111111111111111111111*
+L0684 111111111111111111110111111111111111*
+L0720 011111111111111111111111111101111111*
+L0756 111101110111111111111111111111111111*
+L0792 111111111111101111111111111111111111*
+L0828 111111111111111111111111111110111111*
+L0864 111111111111111111111111101111111111*
+L0900 111011111111111111111111111111101111*
+L0936 111111111111111101111111111101111111*
+L0972 111111111111111111111111111111111111*
+L1008 111111111111111101111111111111111111*
+L1044 111101111111111111111111111111011111*
+L1080 111111111111111101111111011111111111*
+L1116 111011111111111111111111111111111111*
+L1152 111111111111111111111111101111111111*
+L1188 111111111111111111111011101111111111*
+L1224 101111111111111111111111111110111111*
+L1260 111111111111101111110111011111111111*
+L1296 111111111111111111111111111111111111*
+L1332 111111111111011111111111111111111111*
+L1368 111011111111111111111111111111111111*
+L1404 110111111111111111110111111111111111*
+L1440 111110111111111111111111111111111111*
+L1476 110110111111111111111111111111111111*
+L1512 011111111111111111111111111101111111*
+L1548 111111111111111111111111101111111111*
+L1584 111111110111111111111111111111111111*
+L1620 111111111111111111111111111111111111*
+L1656 111111110111111111111111111111111111*
+L1692 111111111111111111111111101111011111*
+L1728 111111111111111110111111111111111111*
+L1764 101111111111111111111111111111111111*
+L1800 111111111111011111111111111111101111*
+L1836 111111111111111111110111111111111111*
+L1872 111110111111111111111111111110111111*
+L1908 111011111111111111111111111111111111*
+L1944 111111111111111111111111111111111111*
+L1980 101111111111111111111111111111111111*
+L2016 111111111011111111111111111111111111*
+L2052 111110111111111110111111111111111111*
+L2088 111111111111111111111111101111111111*
+L2124 111111111111111111111111111111101111*
+L2160 111111111111111111111111111110111111*
+L2196 111011111111111111111011111111111111*
+L2232 111111111111101111111111111111111111*
+L2268 111111111111111111111111111111111111*
+L2304 011111111111111111111111111111111111*
+L2340 110101111111111111111111111111111111*
+L2376 111111110111111111111111111111101111*
+L2412 111111111111011111111111111111111111*
+L2448 111111111111111101111111111111111111*
+L2484 111011111111111111110111111111111111*
+L2520 111111111111111111111111011111111111*
+L2556 111111111111111111111111111101011111*
+L2592 11111111*
+C3B70*
+67FE
diff --git a/regtests/jedutil/jeds/ampal18p8/pal10l8-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal10l8-as-ampal18p8.jed
new file mode 100644
index 00000000000..8c4757be5ad
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal10l8-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL10L8 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL10L8TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 111111111111111111111111111111111111*
+L0036 111110111111101111111011111111111111*
+L0072 011111111111111111111111111111111111*
+L0108 111111111111111111111111011111111111*
+L0144 111101111111111111111111111111011111*
+L0180 110111111111111111111111111111111111*
+L0216 111111110111111111111111111111111111*
+L0252 111111111111111101111111111111111111*
+L0288 111011111111111111111111111110111111*
+L0324 111111111111111111111111111111111111*
+L0360 111111111111111111111111111110111111*
+L0396 111101111111011111111111111101111111*
+L0432 111111111111111111111011111111111111*
+L0468 111111111111111111111111111111101111*
+L0504 111011111111111111111111111111111111*
+L0540 111110111111111111111111111111111111*
+L0576 111111111111101111111111111111111111*
+L0612 110111111111111111110111111111011111*
+L0648 111111111111111111111111111111111111*
+L0684 111101110111111111111111111111111111*
+L0720 111111111111101111111111111111111111*
+L0756 111111111111111111111111111110111111*
+L0792 111011111111111111111111111111101111*
+L0828 111111111111111111110111111111111111*
+L0864 011111111111111111111111111101111111*
+L0900 111111111111111101111111111101111111*
+L0936 111111111111111111111111101111111111*
+L0972 111111111111111111111111111111111111*
+L1008 111111111111111101111111111111111111*
+L1044 101111111111111111111111111110111111*
+L1080 111101111111111111111111111111011111*
+L1116 111111111111111111111111101111111111*
+L1152 111111111111111101111111011111111111*
+L1188 111011111111111111111111111111111111*
+L1224 111111111111101111110111011111111111*
+L1260 111111111111111111111011101111111111*
+L1296 111111111111111111111111111111111111*
+L1332 111111110111111111111111111111111111*
+L1368 110110111111111111111111111111111111*
+L1404 011111111111111111111111111101111111*
+L1440 111111111111011111111111111111111111*
+L1476 110111111111111111110111111111111111*
+L1512 111110111111111111111111111111111111*
+L1548 111111111111111111111111101111111111*
+L1584 111011111111111111111111111111111111*
+L1620 111111111111111111111111111111111111*
+L1656 111110111111111111111111111110111111*
+L1692 111111111111111110111111111111111111*
+L1728 101111111111111111111111111111111111*
+L1764 111111110111111111111111111111111111*
+L1800 111111111111111111111111101111011111*
+L1836 111111111111111111110111111111111111*
+L1872 111111111111011111111111111111101111*
+L1908 111011111111111111111111111111111111*
+L1944 111111111111111111111111111111111111*
+L1980 111111111111111111111111101111111111*
+L2016 111111111111111111111111111111101111*
+L2052 111111111111111111111111111110111111*
+L2088 111110111111111110111111111111111111*
+L2124 111011111111111111111011111111111111*
+L2160 101111111111111111111111111111111111*
+L2196 111111111011111111111111111111111111*
+L2232 111111111111101111111111111111111111*
+L2268 111111111111111111111111111111111111*
+L2304 111011111111111111110111111111111111*
+L2340 111111111111111111111111011111111111*
+L2376 111111111111111111111111111101011111*
+L2412 011111111111111111111111111111111111*
+L2448 110101111111111111111111111111111111*
+L2484 111111111111011111111111111111111111*
+L2520 111111110111111111111111111111101111*
+L2556 111111111111111101111111111111111111*
+L2592 00000000*
+C3981*
+67F3
diff --git a/regtests/jedutil/jeds/ampal18p8/pal12h6-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal12h6-as-ampal18p8.jed
new file mode 100644
index 00000000000..0af9422206e
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal12h6-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL12H6 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL12H6TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 000000000000000000000000000000000000*
+L0036 000000000000000000000000000000000000*
+L0072 000000000000000000000000000000000000*
+L0108 000000000000000000000000000000000000*
+L0144 000000000000000000000000000000000000*
+L0180 000000000000000000000000000000000000*
+L0216 000000000000000000000000000000000000*
+L0252 000000000000000000000000000000000000*
+L0288 000000000000000000000000000000000000*
+L0324 111111111111111111111111111111111111*
+L0360 111011111111111111111111111111111111*
+L0396 111110111111111111111111111111111111*
+L0432 111111111111101111111111111111111111*
+L0468 111111111111111111111011111111111111*
+L0504 111111111111111111111111111110111011*
+L0540 111111111111111111111111111111101111*
+L0576 110111111111111111110111111111011111*
+L0612 111101111111011111111111111101111111*
+L0648 111111111111111111111111111111111111*
+L0684 111111111111111111110111111111111101*
+L0720 011111111111111111111111111101111111*
+L0756 111101110111111111111111111111111111*
+L0792 111111111111101111111111111111111111*
+L0828 111111111111111111111111111110111111*
+L0864 111111111111111111111111101111111111*
+L0900 111011111111111111111111111111101111*
+L0936 111111111111111101111111111101111111*
+L0972 111111111111111111111111111111111111*
+L1008 111111111111111101111111111111111111*
+L1044 111101111111111111111111111111011111*
+L1080 111111111111111101111111011111111111*
+L1116 111011111111111111111111111111111111*
+L1152 111111111111111111111111101111111111*
+L1188 111111111111111111111011101111111111*
+L1224 101111111111111111111111111110111111*
+L1260 111111111111101111110111011111111111*
+L1296 111111111111111111111111111111111111*
+L1332 111111111111011111111111111111110111*
+L1368 111011111111111111111111111111111111*
+L1404 110111111111111111110111111111111111*
+L1440 111110111111111111111111111111111111*
+L1476 110110111111111111111111111111111111*
+L1512 011111111111111111111111111101111111*
+L1548 111111111111111111111111101111111111*
+L1584 111111110111111111111111111111111111*
+L1620 111111111111111111111111111111111111*
+L1656 111111110111111111111111111111111111*
+L1692 111111111111111111111111101111011111*
+L1728 111111111111111110111111111111111111*
+L1764 101111111111111111111111111111111111*
+L1800 111111111111011111111111111111101111*
+L1836 111111111111111111110111111111111111*
+L1872 111110111111111111111111111110111111*
+L1908 111011111111111111111111111111111110*
+L1944 111111111111111111111111111111111111*
+L1980 101111111111111111111111111111111111*
+L2016 111111111011111111111111111111111111*
+L2052 111110111111111110111111111111111111*
+L2088 111111111111111111111111101111111111*
+L2124 111111111111111111111111111111101111*
+L2160 111111111111111111111111111110111111*
+L2196 111011111111111111111011111111111111*
+L2232 111111111111101111111111111111111111*
+L2268 000000000000000000000000000000000000*
+L2304 000000000000000000000000000000000000*
+L2340 000000000000000000000000000000000000*
+L2376 000000000000000000000000000000000000*
+L2412 000000000000000000000000000000000000*
+L2448 000000000000000000000000000000000000*
+L2484 000000000000000000000000000000000000*
+L2520 000000000000000000000000000000000000*
+L2556 000000000000000000000000000000000000*
+L2592 01111110*
+CEBC7*
+65AD
diff --git a/regtests/jedutil/jeds/ampal18p8/pal12l6-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal12l6-as-ampal18p8.jed
new file mode 100644
index 00000000000..0e75276288c
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal12l6-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL12L6 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL12L6TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 000000000000000000000000000000000000*
+L0036 000000000000000000000000000000000000*
+L0072 000000000000000000000000000000000000*
+L0108 000000000000000000000000000000000000*
+L0144 000000000000000000000000000000000000*
+L0180 000000000000000000000000000000000000*
+L0216 000000000000000000000000000000000000*
+L0252 000000000000000000000000000000000000*
+L0288 000000000000000000000000000000000000*
+L0324 111111111111111111111111111111111111*
+L0360 111111111111111111111111111110111111*
+L0396 111101111111011111111111111101111111*
+L0432 111111111111111111111011111111111111*
+L0468 111111111111111111111111111111101111*
+L0504 111011111111111111111111111111111111*
+L0540 111110111111111111111111111111111111*
+L0576 111111111111101111111111111111111111*
+L0612 110111111111111111110111111111011111*
+L0648 111111111111111111111111111111111111*
+L0684 111101110111111111111111111111111111*
+L0720 111111111111101111111111111111111111*
+L0756 111111111111111111111111111110111111*
+L0792 111011111111111111111111111111101111*
+L0828 111111111111111111110111111111111111*
+L0864 011111111111111111111111111101111011*
+L0900 111111111111111101111111111101111111*
+L0936 111111111111111111111111101111111111*
+L0972 111111111111111111111111111111111111*
+L1008 111111111111111101111111111111111111*
+L1044 101111111111111111111111111110111111*
+L1080 111101111111111111111111111111011111*
+L1116 111111111111111111111111101111111111*
+L1152 111111111111111101111111011111111111*
+L1188 111011111111111111111111111111111111*
+L1224 111111111111101111110111011111111111*
+L1260 111111111111111111111011101111111101*
+L1296 111111111111111111111111111111111111*
+L1332 111111110111111111111111111111111111*
+L1368 110110111111111111111111111111111111*
+L1404 011111111111111111111111111101111111*
+L1440 111111111111011111111111111111111111*
+L1476 110111111111111111110111111111111111*
+L1512 111110111111111111111111111111111111*
+L1548 111111111111111111111111101111111111*
+L1584 111011111111111111111111111111111111*
+L1620 111111111111111111111111111111111111*
+L1656 111110111111111111111111111110110111*
+L1692 111111111111111110111111111111111111*
+L1728 101111111111111111111111111111111111*
+L1764 111111110111111111111111111111111111*
+L1800 111111111111111111111111101111011111*
+L1836 111111111111111111110111111111111111*
+L1872 111111111111011111111111111111101111*
+L1908 111011111111111111111111111111111111*
+L1944 111111111111111111111111111111111111*
+L1980 111111111111111111111111101111111111*
+L2016 111111111111111111111111111111101111*
+L2052 111111111111111111111111111110111111*
+L2088 111110111111111110111111111111111111*
+L2124 111011111111111111111011111111111111*
+L2160 101111111111111111111111111111111111*
+L2196 111111111011111111111111111111111110*
+L2232 111111111111101111111111111111111111*
+L2268 000000000000000000000000000000000000*
+L2304 000000000000000000000000000000000000*
+L2340 000000000000000000000000000000000000*
+L2376 000000000000000000000000000000000000*
+L2412 000000000000000000000000000000000000*
+L2448 000000000000000000000000000000000000*
+L2484 000000000000000000000000000000000000*
+L2520 000000000000000000000000000000000000*
+L2556 000000000000000000000000000000000000*
+L2592 00000000*
+CEA1D*
+65A5
diff --git a/regtests/jedutil/jeds/ampal18p8/pal14h4-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal14h4-as-ampal18p8.jed
new file mode 100644
index 00000000000..4c12853a026
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal14h4-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL14H4 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL14H4TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 000000000000000000000000000000000000*
+L0036 000000000000000000000000000000000000*
+L0072 000000000000000000000000000000000000*
+L0108 000000000000000000000000000000000000*
+L0144 000000000000000000000000000000000000*
+L0180 000000000000000000000000000000000000*
+L0216 000000000000000000000000000000000000*
+L0252 000000000000000000000000000000000000*
+L0288 000000000000000000000000000000000000*
+L0324 000000000000000000000000000000000000*
+L0360 000000000000000000000000000000000000*
+L0396 000000000000000000000000000000000000*
+L0432 000000000000000000000000000000000000*
+L0468 000000000000000000000000000000000000*
+L0504 000000000000000000000000000000000000*
+L0540 000000000000000000000000000000000000*
+L0576 000000000000000000000000000000000000*
+L0612 000000000000000000000000000000000000*
+L0648 111111111111111111111111111111111111*
+L0684 111111111111111111110111111111111111*
+L0720 011111111111111111111111111111110111*
+L0756 111101110111111111111111111111111111*
+L0792 111111111111101111111111111111111111*
+L0828 111111111111111111111111111110111111*
+L0864 111111111111111111111111111111111011*
+L0900 111011111111111111111111111111101111*
+L0936 111111111111111101111111111101111111*
+L0972 111111111111111111111111111111111111*
+L1008 111111111111111101111111111111111111*
+L1044 111101111111111111111111111111011111*
+L1080 111111011111111101111111111111111111*
+L1116 111011111111111111111111111111111111*
+L1152 111111101111111111111111111111111111*
+L1188 111111111111111111111011101111111111*
+L1224 101111111111111111111111111110111111*
+L1260 111111111111101111110111011111111111*
+L1296 111111111111111111111111111111111111*
+L1332 111111111111011111111111111111111111*
+L1368 111111111111111111111111111011111111*
+L1404 110111111111111111110111111111111111*
+L1440 111110111111111111111111111111111111*
+L1476 111110111111111111111111110111111111*
+L1512 011111111111111111111111111101111111*
+L1548 111111111111111111111111101111111111*
+L1584 111111110111111111111111111111111111*
+L1620 111111111111111111111111111111111111*
+L1656 111111110111111111111111111111111111*
+L1692 111111111111111111111111101111011111*
+L1728 111111111111111111111111111111111110*
+L1764 101111111111111111111111111111111111*
+L1800 111111111111011111111111111111101111*
+L1836 111111111111111111110111111111111101*
+L1872 111110111111111111111111111110111111*
+L1908 111011111111111111111111111111111111*
+L1944 000000000000000000000000000000000000*
+L1980 000000000000000000000000000000000000*
+L2016 000000000000000000000000000000000000*
+L2052 000000000000000000000000000000000000*
+L2088 000000000000000000000000000000000000*
+L2124 000000000000000000000000000000000000*
+L2160 000000000000000000000000000000000000*
+L2196 000000000000000000000000000000000000*
+L2232 000000000000000000000000000000000000*
+L2268 000000000000000000000000000000000000*
+L2304 000000000000000000000000000000000000*
+L2340 000000000000000000000000000000000000*
+L2376 000000000000000000000000000000000000*
+L2412 000000000000000000000000000000000000*
+L2448 000000000000000000000000000000000000*
+L2484 000000000000000000000000000000000000*
+L2520 000000000000000000000000000000000000*
+L2556 000000000000000000000000000000000000*
+L2592 00111100*
+C9C6F*
+6333
diff --git a/regtests/jedutil/jeds/ampal18p8/pal14l4-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal14l4-as-ampal18p8.jed
new file mode 100644
index 00000000000..26c645dcc77
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal14l4-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL14L4 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL14L4TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 000000000000000000000000000000000000*
+L0036 000000000000000000000000000000000000*
+L0072 000000000000000000000000000000000000*
+L0108 000000000000000000000000000000000000*
+L0144 000000000000000000000000000000000000*
+L0180 000000000000000000000000000000000000*
+L0216 000000000000000000000000000000000000*
+L0252 000000000000000000000000000000000000*
+L0288 000000000000000000000000000000000000*
+L0324 000000000000000000000000000000000000*
+L0360 000000000000000000000000000000000000*
+L0396 000000000000000000000000000000000000*
+L0432 000000000000000000000000000000000000*
+L0468 000000000000000000000000000000000000*
+L0504 000000000000000000000000000000000000*
+L0540 000000000000000000000000000000000000*
+L0576 000000000000000000000000000000000000*
+L0612 000000000000000000000000000000000000*
+L0648 111111111111111111111111111111111111*
+L0684 011111111111111111111111111111110111*
+L0720 111111111111111111111111111110111111*
+L0756 111111111111111111111111111111111011*
+L0792 111101110111111111111111111111111111*
+L0828 111111111111111101111111111101111111*
+L0864 111111111111101111111111111111111111*
+L0900 111011111111111111111111111111101111*
+L0936 111111111111111111110111111111111111*
+L0972 111111111111111111111111111111111111*
+L1008 111111101111111111111111111111111111*
+L1044 111101111111111111111111111111011111*
+L1080 111111111111111101111111111111111111*
+L1116 111111011111111101111111111111111111*
+L1152 111011111111111111111111111111111111*
+L1188 111111111111101111110111011111111111*
+L1224 101111111111111111111111111110111111*
+L1260 111111111111111111111011101111111111*
+L1296 111111111111111111111111111111111111*
+L1332 110111111111111111110111111111111111*
+L1368 111111111111111111111111101111111111*
+L1404 111111111111011111111111111111111111*
+L1440 111111111111111111111111111011111111*
+L1476 111110111111111111111111111111111111*
+L1512 011111111111111111111111111101111111*
+L1548 111111110111111111111111111111111111*
+L1584 111110111111111111111111110111111111*
+L1620 111111111111111111111111111111111111*
+L1656 111111111111111111111111101111011111*
+L1692 111111110111111111111111111111111111*
+L1728 111111111111111111111111111111111110*
+L1764 111111111111011111111111111111101111*
+L1800 110111111111111111111111111111111111*
+L1836 111111111111111111110111111111111101*
+L1872 111110111111111111111111111110111111*
+L1908 101111111111111111111111111111111111*
+L1944 000000000000000000000000000000000000*
+L1980 000000000000000000000000000000000000*
+L2016 000000000000000000000000000000000000*
+L2052 000000000000000000000000000000000000*
+L2088 000000000000000000000000000000000000*
+L2124 000000000000000000000000000000000000*
+L2160 000000000000000000000000000000000000*
+L2196 000000000000000000000000000000000000*
+L2232 000000000000000000000000000000000000*
+L2268 000000000000000000000000000000000000*
+L2304 000000000000000000000000000000000000*
+L2340 000000000000000000000000000000000000*
+L2376 000000000000000000000000000000000000*
+L2412 000000000000000000000000000000000000*
+L2448 000000000000000000000000000000000000*
+L2484 000000000000000000000000000000000000*
+L2520 000000000000000000000000000000000000*
+L2556 000000000000000000000000000000000000*
+L2592 00000000*
+C9D90*
+6321
diff --git a/regtests/jedutil/jeds/ampal18p8/pal16h2-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal16h2-as-ampal18p8.jed
new file mode 100644
index 00000000000..5482c396281
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal16h2-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL16H2 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL16H2TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 000000000000000000000000000000000000*
+L0036 000000000000000000000000000000000000*
+L0072 000000000000000000000000000000000000*
+L0108 000000000000000000000000000000000000*
+L0144 000000000000000000000000000000000000*
+L0180 000000000000000000000000000000000000*
+L0216 000000000000000000000000000000000000*
+L0252 000000000000000000000000000000000000*
+L0288 000000000000000000000000000000000000*
+L0324 000000000000000000000000000000000000*
+L0360 000000000000000000000000000000000000*
+L0396 000000000000000000000000000000000000*
+L0432 000000000000000000000000000000000000*
+L0468 000000000000000000000000000000000000*
+L0504 000000000000000000000000000000000000*
+L0540 000000000000000000000000000000000000*
+L0576 000000000000000000000000000000000000*
+L0612 000000000000000000000000000000000000*
+L0648 000000000000000000000000000000000000*
+L0684 000000000000000000000000000000000000*
+L0720 000000000000000000000000000000000000*
+L0756 000000000000000000000000000000000000*
+L0792 000000000000000000000000000000000000*
+L0828 000000000000000000000000000000000000*
+L0864 000000000000000000000000000000000000*
+L0900 000000000000000000000000000000000000*
+L0936 000000000000000000000000000000000000*
+L0972 111111111111111111111111111111111111*
+L1008 111111111111111101111111111111111111*
+L1044 111101111111111111111111111111011111*
+L1080 111111011111111101111111111111111111*
+L1116 111011111110111111111111111111111111*
+L1152 111111101111111111111111111111111111*
+L1188 111111111111111111111011101111111111*
+L1224 101111111111111111111111111110111111*
+L1260 111111111101101111110111011111111111*
+L1296 111111111111111111111111111111111111*
+L1332 111111111111011111111111111111111111*
+L1368 111111111111111111111110111011111111*
+L1404 110111111111111111110111111111111111*
+L1440 111110111111111111111101111111111111*
+L1476 111110111111111111111111110111111111*
+L1512 011111111111111111111111111101111111*
+L1548 111111111111111111111111101111111111*
+L1584 111111110111111111111111111111111111*
+L1620 000000000000000000000000000000000000*
+L1656 000000000000000000000000000000000000*
+L1692 000000000000000000000000000000000000*
+L1728 000000000000000000000000000000000000*
+L1764 000000000000000000000000000000000000*
+L1800 000000000000000000000000000000000000*
+L1836 000000000000000000000000000000000000*
+L1872 000000000000000000000000000000000000*
+L1908 000000000000000000000000000000000000*
+L1944 000000000000000000000000000000000000*
+L1980 000000000000000000000000000000000000*
+L2016 000000000000000000000000000000000000*
+L2052 000000000000000000000000000000000000*
+L2088 000000000000000000000000000000000000*
+L2124 000000000000000000000000000000000000*
+L2160 000000000000000000000000000000000000*
+L2196 000000000000000000000000000000000000*
+L2232 000000000000000000000000000000000000*
+L2268 000000000000000000000000000000000000*
+L2304 000000000000000000000000000000000000*
+L2340 000000000000000000000000000000000000*
+L2376 000000000000000000000000000000000000*
+L2412 000000000000000000000000000000000000*
+L2448 000000000000000000000000000000000000*
+L2484 000000000000000000000000000000000000*
+L2520 000000000000000000000000000000000000*
+L2556 000000000000000000000000000000000000*
+L2592 00011000*
+C4CCB*
+60C1
diff --git a/regtests/jedutil/jeds/ampal18p8/pal16l2-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal16l2-as-ampal18p8.jed
new file mode 100644
index 00000000000..46172b48c41
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal16l2-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL16L2 Test AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL16L2TEST*
+QP20*
+QF2600*
+G0*F0*
+L0000 000000000000000000000000000000000000*
+L0036 000000000000000000000000000000000000*
+L0072 000000000000000000000000000000000000*
+L0108 000000000000000000000000000000000000*
+L0144 000000000000000000000000000000000000*
+L0180 000000000000000000000000000000000000*
+L0216 000000000000000000000000000000000000*
+L0252 000000000000000000000000000000000000*
+L0288 000000000000000000000000000000000000*
+L0324 000000000000000000000000000000000000*
+L0360 000000000000000000000000000000000000*
+L0396 000000000000000000000000000000000000*
+L0432 000000000000000000000000000000000000*
+L0468 000000000000000000000000000000000000*
+L0504 000000000000000000000000000000000000*
+L0540 000000000000000000000000000000000000*
+L0576 000000000000000000000000000000000000*
+L0612 000000000000000000000000000000000000*
+L0648 000000000000000000000000000000000000*
+L0684 000000000000000000000000000000000000*
+L0720 000000000000000000000000000000000000*
+L0756 000000000000000000000000000000000000*
+L0792 000000000000000000000000000000000000*
+L0828 000000000000000000000000000000000000*
+L0864 000000000000000000000000000000000000*
+L0900 000000000000000000000000000000000000*
+L0936 000000000000000000000000000000000000*
+L0972 111111111111111111111111111111111111*
+L1008 101111111111111111111111111110110111*
+L1044 111101101111111111111111111111011111*
+L1080 111111111101101111110111011111111111*
+L1116 111111011111111101111111111111111111*
+L1152 111011111110111111111101111111111111*
+L1188 111111101111111111111111110111111111*
+L1224 111111111111111111111011101111111110*
+L1260 111111111111111101111111111111111111*
+L1296 111111111111111111111111111111111111*
+L1332 111111111111011111111111111111101111*
+L1368 111110111111111111111101111111111111*
+L1404 111110111111111111111111110111111111*
+L1440 111111111111111111111110111011111111*
+L1476 110111111111111111110111111111111101*
+L1512 111111011111111111111111101111111111*
+L1548 011111111111111111111111111101111111*
+L1584 111111110101111111111111111111111011*
+L1620 000000000000000000000000000000000000*
+L1656 000000000000000000000000000000000000*
+L1692 000000000000000000000000000000000000*
+L1728 000000000000000000000000000000000000*
+L1764 000000000000000000000000000000000000*
+L1800 000000000000000000000000000000000000*
+L1836 000000000000000000000000000000000000*
+L1872 000000000000000000000000000000000000*
+L1908 000000000000000000000000000000000000*
+L1944 000000000000000000000000000000000000*
+L1980 000000000000000000000000000000000000*
+L2016 000000000000000000000000000000000000*
+L2052 000000000000000000000000000000000000*
+L2088 000000000000000000000000000000000000*
+L2124 000000000000000000000000000000000000*
+L2160 000000000000000000000000000000000000*
+L2196 000000000000000000000000000000000000*
+L2232 000000000000000000000000000000000000*
+L2268 000000000000000000000000000000000000*
+L2304 000000000000000000000000000000000000*
+L2340 000000000000000000000000000000000000*
+L2376 000000000000000000000000000000000000*
+L2412 000000000000000000000000000000000000*
+L2448 000000000000000000000000000000000000*
+L2484 000000000000000000000000000000000000*
+L2520 000000000000000000000000000000000000*
+L2556 000000000000000000000000000000000000*
+L2592 00000000*
+C4D56*
+60A0
diff --git a/regtests/jedutil/jeds/ampal18p8/pal16l8-as-ampal18p8.jed b/regtests/jedutil/jeds/ampal18p8/pal16l8-as-ampal18p8.jed
new file mode 100644
index 00000000000..24a3d01d789
--- /dev/null
+++ b/regtests/jedutil/jeds/ampal18p8/pal16l8-as-ampal18p8.jed
@@ -0,0 +1,90 @@
+
+PALASM4 PAL ASSEMBLER - MARKET RELEASE 1.5a (8-20-92)
+ (C) - COPYRIGHT ADVANCED MICRO DEVICES INC., 1992
+
+
+TITLE :PAL16L8 Test 1 AUTHOR :MAMEDev
+PATTERN :A COMPANY:MAMEDev
+REVISION:1.0 DATE :08/25/13
+
+
+PAL18P8
+PAL16L8*
+QP20*
+QF2600*
+G0*F0*
+L0000 111101111111111111111111111111111111*
+L0036 111111011111111111111111111111111111*
+L0072 111111111101111111111111111111111111*
+L0108 111111111111110111111111111111111111*
+L0144 111111111111111111011111111111111111*
+L0180 111111111111111111111101111111111111*
+L0216 111111111111111111111111110111111111*
+L0252 111111101110111011101110111011111111*
+L0288 000000000000000000000000000000000000*
+L0324 111111111111111111111111111111111111*
+L0360 111101111111111111111111111111111111*
+L0396 111111111111111111111111011111111111*
+L0432 111111111111111111111111111101011111*
+L0468 110111111111111111111111111111111111*
+L0504 111111111011111111111111111111111111*
+L0540 011111111111111111111111111111111111*
+L0576 111111111111011111111011111111111111*
+L0612 000000000000000000000000000000000000*
+L0648 111111111111111111111111111111111111*
+L0684 111111111111111111110111111111111111*
+L0720 011111011111111111111111111111111111*
+L0756 111101110111111111111111111111111111*
+L0792 111111111111101111111111111111111111*
+L0828 111111111111111111111111111110111111*
+L0864 111111101111111111111111111111111111*
+L0900 111011111111111111111111111111101111*
+L0936 000000000000000000000000000000000000*
+L0972 111111111111111111111111111111101111*
+L1008 111111111111111101111111111111111111*
+L1044 111101111111111111111111111111011111*
+L1080 111111111101111101111111111111111111*
+L1116 111011111111111111111111111111111111*
+L1152 111111111110111111111111111111111111*
+L1188 111111111111111111111011101111111111*
+L1224 101111111111111111111111111110111111*
+L1260 000000000000000000000000000000000000*
+L1296 111111111111111111111111111111111111*
+L1332 111111111111011111111111111111111111*
+L1368 111111111111111011111111111111111111*
+L1404 110111111111111111110111111111111111*
+L1440 111110111111111111111111111111111111*
+L1476 111110111111110111111111111111111111*
+L1512 011111111111111111111111111101111111*
+L1548 111111111111111111111111101111111111*
+L1584 000000000000000000000000000000000000*
+L1620 110111111111111111111111111111111111*
+L1656 111111110111111111111111111111111111*
+L1692 111111111111111111111111101111011111*
+L1728 111111111111111111011111111111111111*
+L1764 101111111111111111111111111111111111*
+L1800 111111111111011111111111111111101111*
+L1836 111111111111111111110111111111111111*
+L1872 111110111111111111111111111110111111*
+L1908 000000000000000000000000000000000000*
+L1944 111111111111111111111111111111111111*
+L1980 111101111111111111111111111111111111*
+L2016 111111111111111111111101111111111111*
+L2052 111111111111111111111111111111101111*
+L2088 011111111111111111111111111111111111*
+L2124 111111111011111111111110111111111111*
+L2160 111111111111111111111111011101111111*
+L2196 111111111111011111111111111111111111*
+L2232 000000000000000000000000000000000000*
+L2268 111111111111101111111111111111111111*
+L2304 100111111111111111111111111111111111*
+L2340 111001111111111111111111111111111111*
+L2376 111110111111111111110111111111111111*
+L2412 111111110111111111111111110111111111*
+L2448 111111111111111101111111111011111111*
+L2484 111111111111111101111011111111111111*
+L2520 111111111111111110111111101110111111*
+L2556 000000000000000000000000000000000000*
+L2592 11000001*
+C1616*
+6599
diff --git a/scripts/build/msgfmt.py b/scripts/build/msgfmt.py
new file mode 100644
index 00000000000..f28c2fcf6c6
--- /dev/null
+++ b/scripts/build/msgfmt.py
@@ -0,0 +1,226 @@
+#!/usr/bin/env python2
+# -*- coding: iso-8859-1 -*-
+# Written by Martin v. Löwis <loewis@informatik.hu-berlin.de>
+
+"""Generate binary message catalog from textual translation description.
+
+This program converts a textual Uniforum-style message catalog (.po file) into
+a binary GNU catalog (.mo file). This is essentially the same function as the
+GNU msgfmt program, however, it is a simpler implementation.
+
+Usage: msgfmt.py [OPTIONS] filename.po
+
+Options:
+ -o file
+ --output-file=file
+ Specify the output file to write to. If omitted, output will go to a
+ file named filename.mo (based off the input file name).
+
+ -h
+ --help
+ Print this message and exit.
+
+ -V
+ --version
+ Display version information and exit.
+"""
+
+import os
+import sys
+import ast
+import getopt
+import struct
+import array
+
+__version__ = "1.1"
+
+MESSAGES = {}
+
+
+
+def usage(code, msg=''):
+ print >> sys.stderr, __doc__
+ if msg:
+ print >> sys.stderr, msg
+ sys.exit(code)
+
+
+
+def add(id, str, fuzzy):
+ "Add a non-fuzzy translation to the dictionary."
+ global MESSAGES
+ if not fuzzy and str:
+ MESSAGES[id] = str
+
+
+
+def generate():
+ "Return the generated output."
+ global MESSAGES
+ keys = MESSAGES.keys()
+ # the keys are sorted in the .mo file
+ keys.sort()
+ offsets = []
+ ids = strs = ''
+ for id in keys:
+ # For each string, we need size and file offset. Each string is NUL
+ # terminated; the NUL does not count into the size.
+ offsets.append((len(ids), len(id), len(strs), len(MESSAGES[id])))
+ ids += id + '\0'
+ strs += MESSAGES[id] + '\0'
+ output = ''
+ # The header is 7 32-bit unsigned integers. We don't use hash tables, so
+ # the keys start right after the index tables.
+ # translated string.
+ keystart = 7*4+16*len(keys)
+ # and the values start after the keys
+ valuestart = keystart + len(ids)
+ koffsets = []
+ voffsets = []
+ # The string table first has the list of keys, then the list of values.
+ # Each entry has first the size of the string, then the file offset.
+ for o1, l1, o2, l2 in offsets:
+ koffsets += [l1, o1+keystart]
+ voffsets += [l2, o2+valuestart]
+ offsets = koffsets + voffsets
+ output = struct.pack("Iiiiiii",
+ 0x950412deL, # Magic
+ 0, # Version
+ len(keys), # # of entries
+ 7*4, # start of key index
+ 7*4+len(keys)*8, # start of value index
+ 0, 0) # size and offset of hash table
+ output += array.array("i", offsets).tostring()
+ output += ids
+ output += strs
+ return output
+
+
+
+def make(filename, outfile):
+ ID = 1
+ STR = 2
+
+ # Compute .mo name from .po name and arguments
+ if filename.endswith('.po'):
+ infile = filename
+ else:
+ infile = filename + '.po'
+ if outfile is None:
+ outfile = os.path.splitext(infile)[0] + '.mo'
+
+ try:
+ lines = open(infile).readlines()
+ except IOError, msg:
+ print >> sys.stderr, msg
+ sys.exit(1)
+
+ section = None
+ fuzzy = 0
+
+ # Parse the catalog
+ lno = 0
+ for l in lines:
+ lno += 1
+ # If we get a comment line after a msgstr, this is a new entry
+ if l[0] == '#' and section == STR:
+ add(msgid, msgstr, fuzzy)
+ section = None
+ fuzzy = 0
+ # Record a fuzzy mark
+ if l[:2] == '#,' and 'fuzzy' in l:
+ fuzzy = 1
+ # Skip comments
+ if l[0] == '#':
+ continue
+ # Now we are in a msgid section, output previous section
+ if l.startswith('msgid') and not l.startswith('msgid_plural'):
+ if section == STR:
+ add(msgid, msgstr, fuzzy)
+ section = ID
+ l = l[5:]
+ msgid = msgstr = ''
+ is_plural = False
+ # This is a message with plural forms
+ elif l.startswith('msgid_plural'):
+ if section != ID:
+ print >> sys.stderr, 'msgid_plural not preceded by msgid on %s:%d' %\
+ (infile, lno)
+ sys.exit(1)
+ l = l[12:]
+ msgid += '\0' # separator of singular and plural
+ is_plural = True
+ # Now we are in a msgstr section
+ elif l.startswith('msgstr'):
+ section = STR
+ if l.startswith('msgstr['):
+ if not is_plural:
+ print >> sys.stderr, 'plural without msgid_plural on %s:%d' %\
+ (infile, lno)
+ sys.exit(1)
+ l = l.split(']', 1)[1]
+ if msgstr:
+ msgstr += '\0' # Separator of the various plural forms
+ else:
+ if is_plural:
+ print >> sys.stderr, 'indexed msgstr required for plural on %s:%d' %\
+ (infile, lno)
+ sys.exit(1)
+ l = l[6:]
+ # Skip empty lines
+ l = l.strip()
+ if not l:
+ continue
+ l = ast.literal_eval(l)
+ if section == ID:
+ msgid += l
+ elif section == STR:
+ msgstr += l
+ else:
+ print >> sys.stderr, 'Syntax error on %s:%d' % (infile, lno), \
+ 'before:'
+ print >> sys.stderr, l
+ sys.exit(1)
+ # Add last entry
+ if section == STR:
+ add(msgid, msgstr, fuzzy)
+
+ # Compute output
+ output = generate()
+
+ try:
+ open(outfile,"wb").write(output)
+ except IOError,msg:
+ print >> sys.stderr, msg
+
+
+
+def main():
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], 'hVo:',
+ ['help', 'version', 'output-file='])
+ except getopt.error, msg:
+ usage(1, msg)
+
+ outfile = None
+ # parse options
+ for opt, arg in opts:
+ if opt in ('-h', '--help'):
+ usage(0)
+ elif opt in ('-V', '--version'):
+ print >> sys.stderr, "msgfmt.py", __version__
+ sys.exit(0)
+ elif opt in ('-o', '--output-file'):
+ outfile = arg
+ # do it
+ if not args:
+ print >> sys.stderr, 'No input file given'
+ print >> sys.stderr, "Try `msgfmt --help' for more information."
+ return
+
+ for filename in args:
+ make(filename, outfile)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 34705beefa5..02259293cbe 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -54,7 +54,9 @@ function layoutbuildtask(_folder, _name)
end
function precompiledheaders()
- pchheader("emu.h")
+ configuration { "not xcode4" }
+ pchheader("emu.h")
+ configuration { }
end
function addprojectflags()
@@ -198,6 +200,11 @@ newoption {
}
newoption {
+ trigger = "TOOLCHAIN",
+ description = "Toolchain prefix"
+}
+
+newoption {
trigger = "PROFILE",
description = "Enable profiling.",
}
@@ -271,15 +278,6 @@ newoption {
}
newoption {
- trigger = "USE_BGFX",
- description = "Use of BGFX.",
- allowed = {
- { "0", "Disabled" },
- { "1", "Enabled" },
- }
-}
-
-newoption {
trigger = "DEPRECATED",
description = "Generate deprecation warnings during compilation.",
allowed = {
@@ -422,9 +420,8 @@ if _OPTIONS["NOASM"]=="1" and not _OPTIONS["FORCE_DRC_C_BACKEND"] then
_OPTIONS["FORCE_DRC_C_BACKEND"] = "1"
end
-USE_BGFX = 1
-if(_OPTIONS["USE_BGFX"]~=nil) then
- USE_BGFX = tonumber(_OPTIONS["USE_BGFX"])
+if(_OPTIONS["TOOLCHAIN"] == nil) then
+ _OPTIONS['TOOLCHAIN'] = ""
end
GEN_DIR = MAME_BUILD_DIR .. "generated/"
@@ -447,11 +444,17 @@ configurations {
"Release",
}
-platforms {
- "x32",
- "x64",
- "Native", -- for targets where bitness is not specified
-}
+if _ACTION == "xcode4" then
+ platforms {
+ "Universal",
+ }
+else
+ platforms {
+ "x32",
+ "x64",
+ "Native", -- for targets where bitness is not specified
+ }
+end
language "C++"
@@ -671,12 +674,13 @@ end
--DEFS += -DUSE_SYSTEM_JPEGLIB
--endif
- --To support casting in Lua 5.3
defines {
- "LUA_COMPAT_APIINTCASTS",
+ "LUA_COMPAT_ALL",
+ "LUA_COMPAT_5_1",
+ "LUA_COMPAT_5_2",
}
- if _ACTION == "gmake" then
+ if _ACTION == "gmake" or _ACTION == "xcode4" then
--we compile C-only to C99 standard with GNU extensions
@@ -1049,6 +1053,7 @@ configuration { "nacl*" }
configuration { "linux-*" }
links {
"dl",
+ "rt",
}
if _OPTIONS["distro"]=="debian-stable" then
defines
@@ -1062,12 +1067,15 @@ configuration { "linux-*" }
configuration { "steamlink" }
links {
"dl",
- }
+ "EGL",
+ "GLESv2",
+ "SDL2",
+ }
defines {
"EGL_API_FB",
}
-configuration { "osx*" }
+configuration { "osx* or xcode4" }
links {
"pthread",
}
@@ -1298,10 +1306,7 @@ else
startproject (_OPTIONS["subtarget"])
end
mainProject(_OPTIONS["target"],_OPTIONS["subtarget"])
-
-if (_OPTIONS["STRIP_SYMBOLS"]=="1") then
- strip()
-end
+strip()
if _OPTIONS["with-tools"] then
group "tools"
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 16b86dcbe21..8ef18689e66 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -60,7 +60,7 @@ project "zlib"
local version = str_to_version(_OPTIONS["gcc_version"])
if _OPTIONS["gcc"]~=nil and (string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs")) then
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
if (version >= 30700) then
buildoptions {
"-Wno-shift-negative-value",
@@ -85,7 +85,7 @@ end
"verbose=-1",
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-strict-prototypes",
}
@@ -271,7 +271,7 @@ end
"HAVE_CONFIG_H=1",
}
- configuration { "gmake"}
+ configuration { "gmake or xcode4"}
buildoptions_c {
"-Wno-unused-function",
"-O0",
@@ -280,6 +280,11 @@ end
buildoptions {
"-Wno-enum-conversion",
}
+ if _OPTIONS["targetos"]=="macosx" then
+ buildoptions_c {
+ "-Wno-unknown-attributes",
+ }
+ end
end
configuration { }
@@ -379,7 +384,7 @@ project "lua"
-- "ForceCPP",
--}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-bad-function-cast"
}
@@ -398,6 +403,8 @@ end
configuration { }
defines {
"LUA_COMPAT_ALL",
+ "LUA_COMPAT_5_1",
+ "LUA_COMPAT_5_2",
}
if not (_OPTIONS["targetos"]=="windows") and not (_OPTIONS["targetos"]=="asmjs") then
defines {
@@ -458,20 +465,19 @@ links {
end
--------------------------------------------------
--- sqlite3 lua library objects
+-- small lua library objects
--------------------------------------------------
-project "lsqlite3"
+project "lualibs"
uuid "1d84edab-94cf-48fb-83ee-b75bc697660e"
kind "StaticLib"
- -- options {
- -- "ForceCPP",
- -- }
-
configuration { "vs*" }
buildoptions {
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
+ "/wd4055", -- warning C4055: 'type cast': from data pointer 'void *' to function pointer 'xxx'
+ "/wd4152", -- warning C4152: nonstandard extension, function/data pointer conversion in expression
+ "/wd4130", -- warning C4130: '==': logical operation on address of string constant
}
configuration { }
@@ -487,9 +493,69 @@ project "lsqlite3"
MAME_DIR .. "3rdparty/lua/src",
}
end
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
files {
MAME_DIR .. "3rdparty/lsqlite3/lsqlite3.c",
+ MAME_DIR .. "3rdparty/lua-zlib/lua_zlib.c",
+ MAME_DIR .. "3rdparty/luafilesystem/src/lfs.c",
+ }
+
+--------------------------------------------------
+-- luv lua library objects
+--------------------------------------------------
+
+project "luv"
+ uuid "d98ec5ca-da2a-4a50-88a2-52061ca53871"
+ kind "StaticLib"
+
+ if _OPTIONS["targetos"]=="windows" then
+ defines {
+ "_WIN32_WINNT=0x0600",
+ }
+ end
+ configuration { "vs*" }
+ buildoptions {
+ "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
+ }
+
+ configuration { "gmake or xcode4" }
+ buildoptions_c {
+ "-Wno-unused-function",
+ "-Wno-strict-prototypes",
+ "-Wno-unused-variable",
+ "-Wno-maybe-uninitialized",
+ "-Wno-undef",
+ }
+
+ configuration { "vs2015" }
+ buildoptions {
+ "/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
+ "/wd4703", -- warning C4703: potentially uninitialized local pointer variable 'xxx' used
+ }
+
+ configuration { }
+ defines {
+ "LUA_COMPAT_ALL",
+ }
+
+ includedirs {
+ MAME_DIR .. "3rdparty/lua/src",
+ MAME_DIR .. "3rdparty/libuv/include",
+ }
+ if _OPTIONS["with-bundled-lua"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/luv/deps/lua/src",
+ }
+ end
+
+ files {
+ MAME_DIR .. "3rdparty/luv/src/luv.c",
+ MAME_DIR .. "3rdparty/luv/src/luv.h",
}
--------------------------------------------------
@@ -522,7 +588,7 @@ end
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-bad-function-cast",
"-Wno-undef",
@@ -639,7 +705,6 @@ end
-- BGFX library objects
--------------------------------------------------
-if (USE_BGFX == 1) then
project "bgfx"
uuid "d3e7e119-35cf-4f4f-aba0-d3bdcd1b879a"
kind "StaticLib"
@@ -664,10 +729,14 @@ end
MAME_DIR .. "3rdparty/bgfx/include",
MAME_DIR .. "3rdparty/bgfx/3rdparty",
MAME_DIR .. "3rdparty/bx/include",
- MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos",
MAME_DIR .. "3rdparty/bgfx/3rdparty/dxsdk/include",
}
+ configuration { "not steamlink"}
+ includedirs {
+ MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos",
+ }
+
configuration { "vs*" }
includedirs {
MAME_DIR .. "3rdparty/bx/include/compat/msvc",
@@ -677,7 +746,7 @@ end
MAME_DIR .. "3rdparty/bx/include/compat/mingw",
}
- configuration { "osx*" }
+ configuration { "osx* or xcode4" }
includedirs {
MAME_DIR .. "3rdparty/bx/include/compat/osx",
}
@@ -692,7 +761,7 @@ end
MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions {
"-Wno-uninitialized",
"-Wno-unused-function",
@@ -763,7 +832,6 @@ end
MAME_DIR .. "3rdparty/bgfx/src/renderer_mtl.mm",
}
end
-end
--------------------------------------------------
-- PortAudio library objects
@@ -796,7 +864,7 @@ end
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-strict-prototypes",
"-Wno-bad-function-cast",
@@ -931,7 +999,7 @@ project "uv"
MAME_DIR .. "3rdparty/libuv/src/win",
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-strict-prototypes",
"-Wno-bad-function-cast",
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua
index e0358285114..9413b092af7 100644
--- a/scripts/src/emu.lua
+++ b/scripts/src/emu.lua
@@ -149,6 +149,8 @@ files {
MAME_DIR .. "src/emu/inpttype.h",
MAME_DIR .. "src/emu/luaengine.cpp",
MAME_DIR .. "src/emu/luaengine.h",
+ MAME_DIR .. "src/emu/language.cpp",
+ MAME_DIR .. "src/emu/language.h",
MAME_DIR .. "src/emu/mame.cpp",
MAME_DIR .. "src/emu/mame.h",
MAME_DIR .. "src/emu/machine.cpp",
diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua
index 5a97d22d015..fbc923b3073 100644
--- a/scripts/src/machine.lua
+++ b/scripts/src/machine.lua
@@ -773,6 +773,18 @@ end
---------------------------------------------------
--
+--@src/devices/machine/hp_taco.h,MACHINES["HP_TACO"] = true
+---------------------------------------------------
+
+if (MACHINES["HP_TACO"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/machine/hp_taco.cpp",
+ MAME_DIR .. "src/devices/machine/hp_taco.h",
+ }
+end
+
+---------------------------------------------------
+--
--@src/devices/machine/i2cmem.h,MACHINES["I2CMEM"] = true
---------------------------------------------------
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index 2397a489e00..80ebe436e01 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -87,8 +87,21 @@ end
configuration { "asmjs" }
targetextension ".bc"
if os.getenv("EMSCRIPTEN") then
+ local emccopts = ""
+ emccopts = emccopts .. " -O3"
+ emccopts = emccopts .. " -s USE_SDL=2"
+ emccopts = emccopts .. " --memory-init-file 0"
+ emccopts = emccopts .. " -s ALLOW_MEMORY_GROWTH=0"
+ emccopts = emccopts .. " -s TOTAL_MEMORY=268435456"
+ emccopts = emccopts .. " -s DISABLE_EXCEPTION_CATCHING=2"
+ emccopts = emccopts .. " -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\"]'"
+ emccopts = emccopts .. " -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN10ui_manager12set_show_fpsEb', '__ZNK10ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio']\""
+ emccopts = emccopts .. " --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js"
+ emccopts = emccopts .. " --post-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/sdl/emscripten_post.js"
+ emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx@bgfx"
+ emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "shaders/gles@shaders/gles"
postbuildcommands {
- os.getenv("EMSCRIPTEN") .. "/emcc -O3 -s DISABLE_EXCEPTION_CATCHING=2 -s USE_SDL=2 --memory-init-file 0 -s ALLOW_MEMORY_GROWTH=0 -s TOTAL_MEMORY=268435456 -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\"]' -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN10ui_manager12set_show_fpsEb', '__ZNK10ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio']\" $(TARGET) -o " .. _MAKE.esc(MAME_DIR) .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".js --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js --post-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/sdl/emscripten_post.js",
+ os.getenv("EMSCRIPTEN") .. "/emcc " .. emccopts .. " $(TARGET) -o " .. _MAKE.esc(MAME_DIR) .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".js",
}
end
@@ -128,7 +141,8 @@ end
"jpeg",
"7z",
"lua",
- "lsqlite3",
+ "lualibs",
+ "luv",
"uv",
"http-parser",
}
@@ -168,12 +182,8 @@ end
"portmidi",
}
end
- if (USE_BGFX == 1) then
- links {
- "bgfx"
- }
- end
- links{
+ links {
+ "bgfx",
"ocore_" .. _OPTIONS["osd"],
}
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua
index 87e684a50f6..1dfa4317a48 100644
--- a/scripts/src/osd/modules.lua
+++ b/scripts/src/osd/modules.lua
@@ -89,7 +89,6 @@ function osdmodulesbuild()
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.h",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.h",
MAME_DIR .. "src/osd/modules/opengl/osd_opengl.h",
- MAME_DIR .. "src/osd/modules/opengl/SDL1211_opengl.h",
}
defines {
"USE_OPENGL=1",
@@ -101,18 +100,39 @@ function osdmodulesbuild()
end
end
- if USE_BGFX == 1 then
- files {
- MAME_DIR .. "src/osd/modules/render/drawbgfx.cpp",
- }
- defines {
- "USE_BGFX"
- }
- includedirs {
- MAME_DIR .. "3rdparty/bgfx/include",
- MAME_DIR .. "3rdparty/bx/include",
- }
- end
+ files {
+ MAME_DIR .. "src/osd/modules/render/drawbgfx.cpp",
+ MAME_DIR .. "src/osd/modules/render/binpacker.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/blendreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/cullreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/depthreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/effect.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/effectmanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/effectreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chain.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chainreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chainentry.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/chainentryreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/inputpair.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/shadermanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/statereader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/slider.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/sliderreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/parameter.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/paramreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/target.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/targetmanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/texture.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/texturemanager.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/uniform.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/uniformreader.cpp",
+ MAME_DIR .. "src/osd/modules/render/bgfx/writereader.cpp",
+ }
+ includedirs {
+ MAME_DIR .. "3rdparty/bgfx/include",
+ MAME_DIR .. "3rdparty/bx/include",
+ MAME_DIR .. "3rdparty/rapidjson/include",
+ }
if _OPTIONS["NO_USE_MIDI"]=="1" then
defines {
@@ -356,14 +376,6 @@ newoption {
},
}
-if not _OPTIONS["NO_OPENGL"] then
- if _OPTIONS["targetos"]=="os2" then
- _OPTIONS["NO_OPENGL"] = "1"
- else
- _OPTIONS["NO_OPENGL"] = "0"
- end
-end
-
newoption {
trigger = "USE_DISPATCH_GL",
description = "Use GL-dispatching",
@@ -374,11 +386,7 @@ newoption {
}
if not _OPTIONS["USE_DISPATCH_GL"] then
- if USE_BGFX == 1 then
- _OPTIONS["USE_DISPATCH_GL"] = "0"
- else
- _OPTIONS["USE_DISPATCH_GL"] = "1"
- end
+ _OPTIONS["USE_DISPATCH_GL"] = "0"
end
newoption {
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 6acb5a2d262..cb5bd6debdc 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -39,29 +39,23 @@ function maintargetosdoptions(_target,_subtarget)
end
if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" then
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2_ttf",
- }
- else
- links {
- "SDL_ttf",
- }
- end
+ links {
+ "SDL2_ttf",
+ }
local str = backtick("pkg-config --libs fontconfig")
addlibfromstring(str)
addoptionsfromstring(str)
end
if _OPTIONS["targetos"]=="windows" then
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
links {
"SDL2.dll",
}
else
- links {
- "SDL.dll",
- }
+ local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
links {
"psapi",
@@ -93,16 +87,21 @@ function maintargetosdoptions(_target,_subtarget)
configuration { "mingw*" or "vs*" }
targetprefix "sdl"
+ links {
+ "psapi"
+ }
configuration { }
end
function sdlconfigcmd()
- if not _OPTIONS["SDL_INSTALL_ROOT"] then
- return _OPTIONS["SDL_LIBVER"] .. "-config"
+ if _OPTIONS["targetos"]=="asmjs" then
+ return "sdl2-config"
+ elseif not _OPTIONS["SDL_INSTALL_ROOT"] then
+ return _OPTIONS['TOOLCHAIN'] .. "pkg-config sdl2"
else
- return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin",_OPTIONS["SDL_LIBVER"]) .. "-config"
+ return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin","sdl2") .. "-config"
end
end
@@ -148,23 +147,6 @@ if not _OPTIONS["NO_USE_XINPUT"] then
end
newoption {
- trigger = "SDL_LIBVER",
- description = "Choose SDL version",
- allowed = {
- { "sdl", "SDL" },
- { "sdl2", "SDL 2" },
- },
-}
-
-if not _OPTIONS["SDL_LIBVER"] then
- if _OPTIONS["targetos"]=="os2" then
- _OPTIONS["SDL_LIBVER"] = "sdl"
- else
- _OPTIONS["SDL_LIBVER"] = "sdl2"
- end
-end
-
-newoption {
trigger = "SDL2_MULTIAPI",
description = "Use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release)",
allowed = {
@@ -192,16 +174,16 @@ if not _OPTIONS["SDL_FRAMEWORK_PATH"] then
end
newoption {
- trigger = "MACOSX_USE_LIBSDL",
- description = "Use SDL library on OS (rather than framework)",
+ trigger = "USE_LIBSDL",
+ description = "Use SDL library on OS (rather than framework/dll)",
allowed = {
- { "0", "Use framework" },
+ { "0", "Use framework/dll" },
{ "1", "Use library" },
},
}
-if not _OPTIONS["MACOSX_USE_LIBSDL"] then
- _OPTIONS["MACOSX_USE_LIBSDL"] = "0"
+if not _OPTIONS["USE_LIBSDL"] then
+ _OPTIONS["USE_LIBSDL"] = "0"
end
@@ -235,10 +217,6 @@ elseif _OPTIONS["targetos"]=="os2" then
SYNC_IMPLEMENTATION = "os2"
end
-if _OPTIONS["SDL_LIBVER"]=="sdl" then
- USE_BGFX = 0
-end
-
if BASE_TARGETOS=="unix" then
if _OPTIONS["targetos"]=="macosx" then
local os_version = str_to_version(backtick("sw_vers -productVersion"))
@@ -255,39 +233,27 @@ if BASE_TARGETOS=="unix" then
"-weak_framework Metal",
}
end
- if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
linkoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2.framework",
- }
- else
- links {
- "SDL.framework",
- }
- end
+ links {
+ "SDL2.framework",
+ }
else
- local str = backtick(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'")
+ local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'")
addlibfromstring(str)
addoptionsfromstring(str)
end
else
if _OPTIONS["NO_X11"]=="1" then
_OPTIONS["USE_QTDEBUG"] = "0"
- USE_BGFX = 0
else
libdirs {
"/usr/X11/lib",
"/usr/X11R6/lib",
"/usr/openwin/lib",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl" then
- links {
- "X11",
- }
- end
end
local str = backtick(sdlconfigcmd() .. " --libs")
addlibfromstring(str)
@@ -404,13 +370,6 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.h",
MAME_DIR .. "src/osd/modules/debugger/osx/debugosx.h",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl" then
- -- SDLMain_tmpl isn't necessary for SDL2
- files {
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.mm",
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.h",
- }
- end
end
files {
@@ -425,18 +384,17 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl/video.h",
MAME_DIR .. "src/osd/sdl/window.cpp",
MAME_DIR .. "src/osd/sdl/window.h",
+ MAME_DIR .. "src/osd/modules/osdwindow.cpp",
MAME_DIR .. "src/osd/modules/osdwindow.h",
MAME_DIR .. "src/osd/sdl/output.cpp",
MAME_DIR .. "src/osd/sdl/watchdog.cpp",
MAME_DIR .. "src/osd/sdl/watchdog.h",
MAME_DIR .. "src/osd/modules/render/drawsdl.cpp",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- files {
- MAME_DIR .. "src/osd/modules/render/draw13.cpp",
- MAME_DIR .. "src/osd/modules/render/blit13.h",
- }
- end
+ files {
+ MAME_DIR .. "src/osd/modules/render/draw13.cpp",
+ MAME_DIR .. "src/osd/modules/render/blit13.h",
+ }
project ("ocore_" .. _OPTIONS["osd"])
@@ -529,14 +487,14 @@ if _OPTIONS["with-tools"] then
}
if _OPTIONS["targetos"] == "windows" then
- if _OPTIONS["SDL_LIBVER"] == "sdl2" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
links {
"SDL2.dll",
}
else
- links {
- "SDL.dll",
- }
+ local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
links {
"psapi",
@@ -547,12 +505,14 @@ if _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/sdl/main.cpp",
}
- elseif _OPTIONS["targetos"] == "macosx" and _OPTIONS["SDL_LIBVER"] == "sdl" then
- -- SDLMain_tmpl isn't necessary for SDL2
- files {
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.mm",
- }
end
+
+ configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+ configuration { }
+
+ strip()
end
@@ -594,4 +554,6 @@ if _OPTIONS["targetos"] == "macosx" and _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/sdl/aueffectutil.mm",
}
+
+ strip()
end
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index dd902d1fe60..bdeb7274ef1 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -56,18 +56,12 @@ if _OPTIONS["NO_USE_MIDI"]~="1" and _OPTIONS["targetos"]=="linux" then
}
end
-if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- defines {
- "SDLMAME_SDL2=1",
- }
- if _OPTIONS["SDL2_MULTIAPI"]=="1" then
- defines {
- "SDL2_MULTIAPI",
- }
- end
-else
+defines {
+ "SDLMAME_SDL2=1",
+}
+if _OPTIONS["SDL2_MULTIAPI"]=="1" then
defines {
- "SDLMAME_SDL2=0",
+ "SDL2_MULTIAPI",
}
end
@@ -81,7 +75,7 @@ if BASE_TARGETOS=="unix" then
"SDLMAME_UNIX",
}
if _OPTIONS["targetos"]=="macosx" then
- if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
buildoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua
index fd508e645c5..154d4732bc1 100644
--- a/scripts/src/osd/windows.lua
+++ b/scripts/src/osd/windows.lua
@@ -152,16 +152,17 @@ project ("osd_" .. _OPTIONS["osd"])
}
files {
- MAME_DIR .. "src/osd/modules/render/drawd3d.cpp",
- MAME_DIR .. "src/osd/modules/render/drawd3d.h",
MAME_DIR .. "src/osd/modules/render/d3d/d3d9intf.cpp",
+ MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h",
MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.cpp",
MAME_DIR .. "src/osd/modules/render/d3d/d3dcomm.h",
MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.h",
- MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h",
- MAME_DIR .. "src/osd/modules/render/drawdd.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawd3d.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawd3d.h",
MAME_DIR .. "src/osd/modules/render/drawgdi.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawgdi.h",
MAME_DIR .. "src/osd/modules/render/drawnone.cpp",
+ MAME_DIR .. "src/osd/modules/render/drawnone.h",
MAME_DIR .. "src/osd/windows/input.cpp",
MAME_DIR .. "src/osd/windows/input.h",
MAME_DIR .. "src/osd/windows/output.cpp",
@@ -170,6 +171,7 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/windows/video.h",
MAME_DIR .. "src/osd/windows/window.cpp",
MAME_DIR .. "src/osd/windows/window.h",
+ MAME_DIR .. "src/osd/modules/osdwindow.cpp",
MAME_DIR .. "src/osd/modules/osdwindow.h",
MAME_DIR .. "src/osd/windows/winmenu.cpp",
MAME_DIR .. "src/osd/windows/winmain.cpp",
diff --git a/scripts/src/osd/windows_cfg.lua b/scripts/src/osd/windows_cfg.lua
index 19ef05c3ce9..3e656017816 100644
--- a/scripts/src/osd/windows_cfg.lua
+++ b/scripts/src/osd/windows_cfg.lua
@@ -50,7 +50,7 @@ end
if _OPTIONS["USE_SDL"]=="1" then
defines {
- "SDLMAME_SDL2=0",
+ "SDLMAME_SDL2=1",
"USE_XINPUT=0",
"USE_SDL=1",
"USE_SDL_SOUND",
diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua
index 19942651f0c..421f5cc76b5 100644
--- a/scripts/src/tools.lua
+++ b/scripts/src/tools.lua
@@ -50,6 +50,13 @@ files {
MAME_DIR .. "src/tools/romcmp.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- chdman
--------------------------------------------------
@@ -104,6 +111,13 @@ files {
MAME_DIR .. "src/version.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- jedutil
--------------------------------------------------
@@ -145,6 +159,13 @@ files {
MAME_DIR .. "src/tools/jedutil.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- unidasm
--------------------------------------------------
@@ -201,6 +222,12 @@ files {
MAME_DIR .. "src/emu/emucore.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
--------------------------------------------------
-- ldresample
@@ -255,6 +282,13 @@ files {
MAME_DIR .. "src/tools/ldresample.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- ldverify
--------------------------------------------------
@@ -308,6 +342,13 @@ files {
MAME_DIR .. "src/tools/ldverify.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- regrep
--------------------------------------------------
@@ -349,6 +390,13 @@ files {
MAME_DIR .. "src/tools/regrep.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- srcclean
---------------------------------------------------
@@ -390,6 +438,13 @@ files {
MAME_DIR .. "src/tools/srcclean.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- src2html
--------------------------------------------------
@@ -431,6 +486,13 @@ files {
MAME_DIR .. "src/tools/src2html.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- split
--------------------------------------------------
@@ -483,6 +545,13 @@ files {
MAME_DIR .. "src/tools/split.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- pngcmp
--------------------------------------------------
@@ -524,6 +593,13 @@ files {
MAME_DIR .. "src/tools/pngcmp.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- nltool
--------------------------------------------------
@@ -578,6 +654,13 @@ files {
MAME_DIR .. "src/lib/netlist/prg/nltool.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- nlwav
--------------------------------------------------
@@ -610,6 +693,13 @@ files {
MAME_DIR .. "src/lib/netlist/prg/nlwav.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- castool
--------------------------------------------------
@@ -664,6 +754,13 @@ files {
MAME_DIR .. "src/tools/castool.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- floptool
--------------------------------------------------
@@ -719,6 +816,13 @@ files {
MAME_DIR .. "src/tools/floptool.cpp",
}
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
+
--------------------------------------------------
-- imgtool
--------------------------------------------------
@@ -822,3 +926,10 @@ files {
MAME_DIR .. "src/tools/imgtool/modules/bml3.cpp",
MAME_DIR .. "src/tools/imgtool/modules/hp48.cpp",
}
+
+configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+configuration { }
+
+strip()
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index cb9a150224a..281601e4d5f 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -398,6 +398,7 @@ MACHINES["ER2055"] = true
MACHINES["F3853"] = true
MACHINES["HD63450"] = true
MACHINES["HD64610"] = true
+MACHINES["HP_TACO"] = true
MACHINES["I2CMEM"] = true
MACHINES["I80130"] = true
MACHINES["I8089"] = true
@@ -1635,6 +1636,8 @@ files {
MAME_DIR .. "src/mame/machine/esqpanel.h",
MAME_DIR .. "src/mame/machine/esqvfd.cpp",
MAME_DIR .. "src/mame/machine/esqvfd.h",
+ MAME_DIR .. "src/mame/machine/esqlcd.cpp",
+ MAME_DIR .. "src/mame/machine/esqlcd.h",
}
createMESSProjects(_target, _subtarget, "enterprise")
diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua
index 7fad61ce928..137a873ae09 100644
--- a/scripts/toolchain.lua
+++ b/scripts/toolchain.lua
@@ -4,6 +4,11 @@
--
local naclToolchain = ""
+local toolchainPrefix = ""
+
+if _OPTIONS['TOOLCHAIN'] then
+ toolchainPrefix = _OPTIONS["TOOLCHAIN"]
+end
newoption {
trigger = "gcc",
@@ -204,15 +209,18 @@ function toolchain(_buildDir, _subDir)
if not os.getenv("MINGW32") then
print("Set MINGW32 envrionment variable.")
end
- premake.gcc.cc = "$(MINGW32)/bin/i686-w64-mingw32-gcc"
- premake.gcc.cxx = "$(MINGW32)/bin/i686-w64-mingw32-g++"
+ if not toolchainPrefix then
+ toolchainPrefix = "$(MINGW32)/bin/i686-w64-mingw32-"
+ end
+ premake.gcc.cc = toolchainPrefix .. "gcc"
+ premake.gcc.cxx = toolchainPrefix .. "g++"
-- work around GCC 4.9.2 not having proper linker for LTO=1 usage
local version_4_ar = str_to_version(_OPTIONS["gcc_version"])
if (version_4_ar < 50000) then
- premake.gcc.ar = "$(MINGW32)/bin/ar"
+ premake.gcc.ar = toolchainPrefix .. "ar"
end
if (version_4_ar >= 50000) then
- premake.gcc.ar = "$(MINGW32)/bin/gcc-ar"
+ premake.gcc.ar = toolchainPrefix .. "gcc-ar"
end
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw32-gcc")
end
@@ -221,20 +229,22 @@ function toolchain(_buildDir, _subDir)
if not os.getenv("MINGW64") then
print("Set MINGW64 envrionment variable.")
end
- premake.gcc.cc = "$(MINGW64)/bin/x86_64-w64-mingw32-gcc"
- premake.gcc.cxx = "$(MINGW64)/bin/x86_64-w64-mingw32-g++"
+ if not toolchainPrefix then
+ toolchainPrefix = "$(MINGW64)/bin/x86_64-w64-mingw32-"
+ end
+ premake.gcc.cc = toolchainPrefix .. "gcc"
+ premake.gcc.cxx = toolchainPrefix .. "g++"
-- work around GCC 4.9.2 not having proper linker for LTO=1 usage
local version_4_ar = str_to_version(_OPTIONS["gcc_version"])
if (version_4_ar < 50000) then
- premake.gcc.ar = "$(MINGW64)/bin/ar"
+ premake.gcc.ar = toolchainPrefix .. "ar"
end
if (version_4_ar >= 50000) then
- premake.gcc.ar = "$(MINGW64)/bin/gcc-ar"
+ premake.gcc.ar = toolchainPrefix .. "gcc-ar"
end
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc")
end
-
if "mingw-clang" == _OPTIONS["gcc"] then
premake.gcc.cc = "clang"
premake.gcc.cxx = "clang++"
@@ -283,18 +293,17 @@ function toolchain(_buildDir, _subDir)
if "osx" == _OPTIONS["gcc"] then
if os.is("linux") then
- local osxToolchain = "x86_64-apple-darwin13-"
- premake.gcc.cc = osxToolchain .. "clang"
- premake.gcc.cxx = osxToolchain .. "clang++"
- premake.gcc.ar = osxToolchain .. "ar"
+ premake.gcc.cc = toolchainPrefix .. "clang"
+ premake.gcc.cxx = toolchainPrefix .. "clang++"
+ premake.gcc.ar = toolchainPrefix .. "ar"
end
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx")
end
if "osx-clang" == _OPTIONS["gcc"] then
- premake.gcc.cc = "clang"
- premake.gcc.cxx = "clang++"
- premake.gcc.ar = "ar"
+ premake.gcc.cc = toolchainPrefix .. "clang"
+ premake.gcc.cxx = toolchainPrefix .. "clang++"
+ premake.gcc.ar = toolchainPrefix .. "ar"
location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang")
end
@@ -496,7 +505,9 @@ function toolchain(_buildDir, _subDir)
configuration { "steamlink" }
objdir ( _buildDir .. "steamlink/obj")
-
+ defines {
+ "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it.
+ }
buildoptions {
"-marm",
"-mfloat-abi=hard",
@@ -909,6 +920,15 @@ function toolchain(_buildDir, _subDir)
end
function strip()
+ if _OPTIONS["STRIP_SYMBOLS"]~="1" then
+ return true
+ end
+
+ configuration { "osx-*", "Release" }
+ postbuildcommands {
+ "$(SILENT) echo Stripping symbols.",
+ "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] and toolchainPrefix) .. "strip \"$(TARGET)\"",
+ }
configuration { "android-arm", "Release" }
postbuildcommands {
@@ -937,13 +957,12 @@ function strip()
configuration { "mingw*", "x64", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(MINGW64)/bin/strip -s \"$(TARGET)\"",
+ "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] and toolchainPrefix or "$(MINGW64)/bin/") .. "strip -s \"$(TARGET)\"",
}
-
configuration { "mingw*", "x32", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(MINGW32)/bin/strip -s \"$(TARGET)\""
+ "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] and toolchainPrefix or "$(MINGW32)/bin/") .. "strip -s \"$(TARGET)\"",
}
configuration { "pnacl" }
diff --git a/shaders/dx11/fs_quad_texture.bin b/shaders/dx11/fs_gui.bin
index 80d85fb1107..80d85fb1107 100644
--- a/shaders/dx11/fs_quad_texture.bin
+++ b/shaders/dx11/fs_gui.bin
Binary files differ
diff --git a/shaders/dx11/fs_line.bin b/shaders/dx11/fs_line.bin
deleted file mode 100644
index 5bd281a0889..00000000000
--- a/shaders/dx11/fs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx11/fs_quad.bin b/shaders/dx11/fs_quad.bin
deleted file mode 100644
index 5bd281a0889..00000000000
--- a/shaders/dx11/fs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx11/fs_screen.bin b/shaders/dx11/fs_screen.bin
new file mode 100644
index 00000000000..802d22a89ff
--- /dev/null
+++ b/shaders/dx11/fs_screen.bin
Binary files differ
diff --git a/shaders/dx11/vs_quad_texture.bin b/shaders/dx11/vs_gui.bin
index b0bebf9da4c..b0bebf9da4c 100644
--- a/shaders/dx11/vs_quad_texture.bin
+++ b/shaders/dx11/vs_gui.bin
Binary files differ
diff --git a/shaders/dx11/vs_line.bin b/shaders/dx11/vs_line.bin
deleted file mode 100644
index 24d50eb25ac..00000000000
--- a/shaders/dx11/vs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx11/vs_quad.bin b/shaders/dx11/vs_quad.bin
deleted file mode 100644
index 24d50eb25ac..00000000000
--- a/shaders/dx11/vs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx11/vs_screen.bin b/shaders/dx11/vs_screen.bin
new file mode 100644
index 00000000000..b0bebf9da4c
--- /dev/null
+++ b/shaders/dx11/vs_screen.bin
Binary files differ
diff --git a/shaders/dx9/fs_quad_texture.bin b/shaders/dx9/fs_gui.bin
index ef8fa0730c3..ee2b018cae8 100644
--- a/shaders/dx9/fs_quad_texture.bin
+++ b/shaders/dx9/fs_gui.bin
Binary files differ
diff --git a/shaders/dx9/fs_line.bin b/shaders/dx9/fs_line.bin
deleted file mode 100644
index 5bfd5497f0b..00000000000
--- a/shaders/dx9/fs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx9/fs_quad.bin b/shaders/dx9/fs_quad.bin
deleted file mode 100644
index 5bfd5497f0b..00000000000
--- a/shaders/dx9/fs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx9/fs_screen.bin b/shaders/dx9/fs_screen.bin
new file mode 100644
index 00000000000..cd32f845f00
--- /dev/null
+++ b/shaders/dx9/fs_screen.bin
Binary files differ
diff --git a/shaders/dx9/vs_quad_texture.bin b/shaders/dx9/vs_gui.bin
index ea94c83e62d..c071222605b 100644
--- a/shaders/dx9/vs_quad_texture.bin
+++ b/shaders/dx9/vs_gui.bin
Binary files differ
diff --git a/shaders/dx9/vs_line.bin b/shaders/dx9/vs_line.bin
deleted file mode 100644
index 9bd4a9797e0..00000000000
--- a/shaders/dx9/vs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx9/vs_quad.bin b/shaders/dx9/vs_quad.bin
deleted file mode 100644
index 9bd4a9797e0..00000000000
--- a/shaders/dx9/vs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/dx9/vs_screen.bin b/shaders/dx9/vs_screen.bin
new file mode 100644
index 00000000000..c071222605b
--- /dev/null
+++ b/shaders/dx9/vs_screen.bin
Binary files differ
diff --git a/shaders/gles/fs_quad_texture.bin b/shaders/gles/fs_gui.bin
index 22e2f0c23d0..22e2f0c23d0 100644
--- a/shaders/gles/fs_quad_texture.bin
+++ b/shaders/gles/fs_gui.bin
Binary files differ
diff --git a/shaders/gles/fs_line.bin b/shaders/gles/fs_line.bin
deleted file mode 100644
index de509a3eeb5..00000000000
--- a/shaders/gles/fs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/gles/fs_quad.bin b/shaders/gles/fs_quad.bin
deleted file mode 100644
index de509a3eeb5..00000000000
--- a/shaders/gles/fs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/gles/fs_screen.bin b/shaders/gles/fs_screen.bin
new file mode 100644
index 00000000000..e61cd98570a
--- /dev/null
+++ b/shaders/gles/fs_screen.bin
Binary files differ
diff --git a/shaders/gles/vs_quad_texture.bin b/shaders/gles/vs_gui.bin
index 9dd618de8a0..9dd618de8a0 100644
--- a/shaders/gles/vs_quad_texture.bin
+++ b/shaders/gles/vs_gui.bin
Binary files differ
diff --git a/shaders/gles/vs_line.bin b/shaders/gles/vs_line.bin
deleted file mode 100644
index db0ff91e152..00000000000
--- a/shaders/gles/vs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/gles/vs_quad.bin b/shaders/gles/vs_screen.bin
index db0ff91e152..9dd618de8a0 100644
--- a/shaders/gles/vs_quad.bin
+++ b/shaders/gles/vs_screen.bin
Binary files differ
diff --git a/shaders/glsl/fs_quad_texture.bin b/shaders/glsl/fs_gui.bin
index db0fe2b487b..db0fe2b487b 100644
--- a/shaders/glsl/fs_quad_texture.bin
+++ b/shaders/glsl/fs_gui.bin
Binary files differ
diff --git a/shaders/glsl/fs_line.bin b/shaders/glsl/fs_line.bin
deleted file mode 100644
index 6f8e3df8290..00000000000
--- a/shaders/glsl/fs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/glsl/fs_quad.bin b/shaders/glsl/fs_quad.bin
deleted file mode 100644
index 6f8e3df8290..00000000000
--- a/shaders/glsl/fs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/glsl/fs_screen.bin b/shaders/glsl/fs_screen.bin
new file mode 100644
index 00000000000..2dd75acfc5e
--- /dev/null
+++ b/shaders/glsl/fs_screen.bin
Binary files differ
diff --git a/shaders/glsl/vs_quad_texture.bin b/shaders/glsl/vs_gui.bin
index af6c9349f41..af6c9349f41 100644
--- a/shaders/glsl/vs_quad_texture.bin
+++ b/shaders/glsl/vs_gui.bin
Binary files differ
diff --git a/shaders/glsl/vs_quad.bin b/shaders/glsl/vs_quad.bin
deleted file mode 100644
index 7c8490550c7..00000000000
--- a/shaders/glsl/vs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/glsl/vs_line.bin b/shaders/glsl/vs_screen.bin
index 7c8490550c7..af6c9349f41 100644
--- a/shaders/glsl/vs_line.bin
+++ b/shaders/glsl/vs_screen.bin
Binary files differ
diff --git a/shaders/metal/fs_quad_texture.bin b/shaders/metal/fs_gui.bin
index 6a3da392480..6a3da392480 100644
--- a/shaders/metal/fs_quad_texture.bin
+++ b/shaders/metal/fs_gui.bin
Binary files differ
diff --git a/shaders/metal/fs_line.bin b/shaders/metal/fs_line.bin
deleted file mode 100644
index fb726f353c0..00000000000
--- a/shaders/metal/fs_line.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/metal/fs_quad.bin b/shaders/metal/fs_quad.bin
deleted file mode 100644
index fb726f353c0..00000000000
--- a/shaders/metal/fs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/metal/fs_screen.bin b/shaders/metal/fs_screen.bin
new file mode 100644
index 00000000000..c0c34d2553f
--- /dev/null
+++ b/shaders/metal/fs_screen.bin
Binary files differ
diff --git a/shaders/metal/vs_quad_texture.bin b/shaders/metal/vs_gui.bin
index 122b7dee5c3..122b7dee5c3 100644
--- a/shaders/metal/vs_quad_texture.bin
+++ b/shaders/metal/vs_gui.bin
Binary files differ
diff --git a/shaders/metal/vs_quad.bin b/shaders/metal/vs_quad.bin
deleted file mode 100644
index d2eeed80dfd..00000000000
--- a/shaders/metal/vs_quad.bin
+++ /dev/null
Binary files differ
diff --git a/shaders/metal/vs_line.bin b/shaders/metal/vs_screen.bin
index d2eeed80dfd..122b7dee5c3 100644
--- a/shaders/metal/vs_line.bin
+++ b/shaders/metal/vs_screen.bin
Binary files differ
diff --git a/src/devices/bus/isa/3c505.cpp b/src/devices/bus/isa/3c505.cpp
index 2cb640e91d5..371526d29ee 100644
--- a/src/devices/bus/isa/3c505.cpp
+++ b/src/devices/bus/isa/3c505.cpp
@@ -26,8 +26,6 @@ static int verbose = VERBOSE;
#define LOG1(d,x) { if (verbose > 0) LOG(d,x)}
#define LOG2(d,x) { if (verbose > 1) LOG(d,x)}
-#define MAINCPU "maincpu"
-
#ifdef LSB_FIRST
static UINT16 uint16_to_le(UINT16 value)
{
@@ -424,7 +422,7 @@ const char *threecom3c505_device::cpu_context()
{
static char statebuf[64]; /* string buffer containing state description */
- device_t *cpu = machine().device(MAINCPU);
+ device_t *cpu = machine().firstcpu;
osd_ticks_t t = osd_ticks();
int s = t / osd_ticks_per_second();
int ms = (t % osd_ticks_per_second()) / 1000;
@@ -442,6 +440,18 @@ const char *threecom3c505_device::cpu_context()
return statebuf;
}
+/*-------------------------------------------------
+ logerror - log an error message (w/o device tags)
+ -------------------------------------------------*/
+
+void threecom3c505_device::logerror(const char *format, ...) const
+{
+ va_list arg;
+ va_start(arg, format);
+ machine().vlogerror(format, arg);
+ va_end(arg);
+}
+
//**************************************************************************
// data_buffer
//**************************************************************************
@@ -855,8 +865,8 @@ void threecom3c505_device::do_receive_command()
void threecom3c505_device::set_command_pending(int state)
{
- LOG2(this,("set_command_pending %d -> %d m_wait_for_ack=%d m_wait_for_nak=%d m_rx_pending=%d%s",
- m_command_pending, state, m_wait_for_ack, m_wait_for_nak, m_rx_pending, state ? "" :"\n"));
+ LOG2(this,("set_command_pending %d -> %d m_wait_for_ack=%d m_wait_for_nak=%d m_rx_pending=%d",
+ m_command_pending, state, m_wait_for_ack, m_wait_for_nak, m_rx_pending));
//- verbose = onoff ? 1 : 2;
@@ -1657,7 +1667,7 @@ void threecom3c505_device::set_verbose(int on_off)
int threecom3c505_device::tx_data(device_t *device, const UINT8 data[], int length)
{
- LOG1(device,("threecom3c505_device::tx_data length=%d", length));
+ LOG1(this,("threecom3c505_device::tx_data length=%d", length));
return 1;
}
diff --git a/src/devices/bus/isa/3c505.h b/src/devices/bus/isa/3c505.h
index e31317792da..80cdd496a03 100644
--- a/src/devices/bus/isa/3c505.h
+++ b/src/devices/bus/isa/3c505.h
@@ -143,6 +143,7 @@ protected:
virtual int setfilter(device_t *, int);
const char *cpu_context();
+ void logerror(const char *format, ...) const;
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/bus/isa/omti8621.cpp b/src/devices/bus/isa/omti8621.cpp
index 5f42c31200b..a1379bc229d 100644
--- a/src/devices/bus/isa/omti8621.cpp
+++ b/src/devices/bus/isa/omti8621.cpp
@@ -73,6 +73,10 @@ protected:
virtual void device_reset() override;
void omti_disk_config(UINT16 disk_type);
+
+private:
+ void logerror(const char *format, ...) const;
+
public:
UINT16 m_type;
UINT16 m_cylinders;
@@ -685,6 +689,18 @@ void omti8621_device::set_esdi_defect_list(UINT8 lun, UINT8 head)
memset(disk->m_esdi_defect_list+6, 0xff, 5); // end of defect list
}
+/*-------------------------------------------------
+ logerror - log an error message (w/o device tags)
+ -------------------------------------------------*/
+
+void omti8621_device::logerror(const char *format, ...) const
+{
+ va_list arg;
+ va_start(arg, format);
+ machine().vlogerror(format, arg);
+ va_end(arg);
+}
+
/***************************************************************************
log_command - log command from a command descriptor block
***************************************************************************/
@@ -693,83 +709,80 @@ void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
{
if (verbose > 0) {
int i;
- char sb[100];
- std::string text(cpu_context(this));
- text += ": OMTI command ";
+ logerror("%s: OMTI command ", cpu_context(this));
switch (cdb[0]) {
case OMTI_CMD_TEST_DRIVE_READY: // 0x00
- text += "Test Drive Ready";
+ logerror("Test Drive Ready");
break;
case OMTI_CMD_RECALIBRATE: // 0x01
- text += "Recalibrate";
+ logerror("Recalibrate");
break;
case OMTI_CMD_REQUEST_SENSE: // 0x03
- text += "Request Sense";
+ logerror("Request Sense");
break;
case OMTI_CMD_READ_VERIFY: // 0x05
- text += "Read Verify";
+ logerror("Read Verify");
break;
case OMTI_CMD_FORMAT_TRACK: // 0x06
- text += "Format Track";
+ logerror("Format Track");
break;
case OMTI_CMD_FORMAT_BAD_TRACK: // 0x07
- text += "Format Bad Track";
+ logerror("Format Bad Track");
break;
case OMTI_CMD_READ: // 0x08
- text += "Read";
+ logerror("Read");
break;
case OMTI_CMD_WRITE: // 0x0A
- text += "Write";
+ logerror("Write");
break;
case OMTI_CMD_SEEK: // 0x0B
- text += "Seek";
+ logerror("Seek");
break;
case OMTI_CMD_READ_SECTOR_BUFFER: // 0x0E
- text += "Read Sector Buffer";
+ logerror("Read Sector Buffer");
break;
case OMTI_CMD_WRITE_SECTOR_BUFFER: // 0x0F
- text += "Write Sector Buffer";
+ logerror("Write Sector Buffer");
break;
case OMTI_CMD_ASSIGN_ALTERNATE_TRACK: // 0x11
- text += "Assign Alternate Track";
+ logerror("Assign Alternate Track");
break;
case OMTI_CMD_READ_DATA_TO_BUFFER: // 0x1E
- text += "Read Data to Buffer";
+ logerror("Read Data to Buffer");
break;
case OMTI_CMD_WRITE_DATA_FROM_BUFFER: // 0x1F
- text += "Write Data from Buffer";
+ logerror("Write Data from Buffer");
break;
case OMTI_CMD_COPY: // 0x20
- text += "Copy";
+ logerror("Copy");
break;
case OMTI_CMD_READ_ESDI_DEFECT_LIST: // 0x37
- text += "Read ESDI Defect List";
+ logerror("Read ESDI Defect List");
break;
case OMTI_CMD_RAM_DIAGNOSTICS: // 0xE0
- text += "RAM. Diagnostic";
+ logerror("RAM. Diagnostic");
break;
case OMTI_CMD_CONTROLLER_INT_DIAGNOSTIC: // 0xE4
- text += "Controller Int. Diagnostic";
+ logerror("Controller Int. Diagnostic");
break;
case OMTI_CMD_READ_LONG: // 0xE5
- text += "Read Long";
+ logerror("Read Long");
break;
case OMTI_CMD_WRITE_LONG: // 0xE6
- text += "Write Long";
+ logerror("Write Long");
break;
case OMTI_CMD_READ_CONFIGURATION: // 0xEC
- text += "Read Configuration";
+ logerror("Read Configuration");
break;
case OMTI_CMD_INVALID_COMMAND: // 0xFF
- text += "Invalid Command";
+ logerror("Invalid Command");
break;
default:
- text += "!!! Unexpected Command !!!";
+ logerror("!!! Unexpected Command !!!");
}
// logerror(" (%02x, length=%02x)", cdb[0], cdb_length);
for (i = 0; i < cdb_length; i++) {
- sprintf(sb, " %02x", cdb[i]);
- text += sb;
+ logerror(" %02x", cdb[i]);
}
switch (cdb[0]) {
@@ -780,12 +793,10 @@ void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
case OMTI_CMD_READ_DATA_TO_BUFFER: // 0x1E
case OMTI_CMD_WRITE_DATA_FROM_BUFFER: // 0x1F
case OMTI_CMD_COPY: // 0x20
- sprintf(sb, " (diskaddr=%x count=%x)", get_disk_address(cdb), cdb[4]);
- text += sb;
+ logerror(" (diskaddr=%x count=%x)", get_disk_address(cdb), cdb[4]);
break;
}
- text += "\n";
- logerror(text.c_str());
+ logerror("\n");
}
}
@@ -795,25 +806,18 @@ void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length)
void omti8621_device::log_data()
{
- if (verbose > 0)
- {
+ if (verbose > 0) {
int i;
- char sb[100];
- sprintf(sb, "%s: OMTI data (length=%02x)", cpu_context(this),
+ logerror("%s: OMTI data (length=%02x)", cpu_context(this),
data_length);
- std::string text(sb);
- for (i = 0; i < data_length && i < OMTI_DISK_SECTOR_SIZE; i++)
- {
- sprintf(sb, " %02x", data_buffer[i]);
- text += sb;
+ for (i = 0; i < data_length && i < OMTI_DISK_SECTOR_SIZE; i++) {
+ logerror(" %02x", data_buffer[i]);
}
- if (i < data_length)
- {
- text += " ...";
+ if (i < data_length) {
+ logerror(" ...");
}
- text += "\n";
- logerror(text.c_str());
+ logerror("\n");
}
}
@@ -1351,6 +1355,18 @@ void omti_disk_image_device::omti_disk_config(UINT16 disk_type)
}
/*-------------------------------------------------
+ logerror - log an error message (w/o device tags)
+ -------------------------------------------------*/
+
+void omti_disk_image_device::logerror(const char *format, ...) const
+{
+ va_list arg;
+ va_start(arg, format);
+ machine().vlogerror(format, arg);
+ va_end(arg);
+}
+
+/*-------------------------------------------------
device start callback
-------------------------------------------------*/
diff --git a/src/devices/bus/isa/omti8621.h b/src/devices/bus/isa/omti8621.h
index 04dff836316..7554df8ddf6 100644
--- a/src/devices/bus/isa/omti8621.h
+++ b/src/devices/bus/isa/omti8621.h
@@ -114,6 +114,9 @@ private:
void copy_sectors(INT32 dst_addr, INT32 src_addr, UINT8 count, UINT8 lun);
void format_track(const UINT8 * cdb);
void set_esdi_defect_list(UINT8 lun, UINT8 head);
+
+ void logerror(const char *format, ...) const;
+
void log_command(const UINT8 cdb[], const UINT16 cdb_length);
void log_data();
void do_command(const UINT8 cdb[], const UINT16 cdb_length);
diff --git a/src/devices/bus/isa/sc499.cpp b/src/devices/bus/isa/sc499.cpp
index 4effacb3394..3d94caa2b2c 100644
--- a/src/devices/bus/isa/sc499.cpp
+++ b/src/devices/bus/isa/sc499.cpp
@@ -409,16 +409,37 @@ const char *sc499_device::cpu_context()
{
static char statebuf[64]; /* string buffer containing state description */
+ device_t *cpu = machine().firstcpu;
osd_ticks_t t = osd_ticks();
int s = t / osd_ticks_per_second();
int ms = (t % osd_ticks_per_second()) / 1000;
- sprintf(statebuf, "%d.%03d%s:", s, ms, tag());
-
+ /* if we have an executing CPU, output data */
+ if (cpu != nullptr)
+ {
+ sprintf(statebuf, "%d.%03d %s pc=%08x - %s", s, ms, cpu->tag(),
+ cpu->safe_pcbase(), tag());
+ }
+ else
+ {
+ sprintf(statebuf, "%d.%03d", s, ms);
+ }
return statebuf;
}
/*-------------------------------------------------
+ logerror - log an error message (w/o device tags)
+ -------------------------------------------------*/
+
+void sc499_device::logerror(const char *format, ...) const
+{
+ va_list arg;
+ va_start(arg, format);
+ machine().vlogerror(format, arg);
+ va_end(arg);
+}
+
+/*-------------------------------------------------
tape_status_clear - clear bits in tape status
-------------------------------------------------*/
diff --git a/src/devices/bus/isa/sc499.h b/src/devices/bus/isa/sc499.h
index 8c63f810073..2b5b1ddaa6a 100644
--- a/src/devices/bus/isa/sc499.h
+++ b/src/devices/bus/isa/sc499.h
@@ -80,6 +80,7 @@ private:
virtual void eop_w(int state) override;
const char *cpu_context();
+ void logerror(const char *format, ...) const;
void tape_status_clear(UINT16 value);
void tape_status_set(UINT16 value);
diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp
index bc78626b00b..ba8b853e9ec 100644
--- a/src/devices/cpu/h8/h8.cpp
+++ b/src/devices/cpu/h8/h8.cpp
@@ -281,7 +281,7 @@ void h8_device::disassemble_am(char *&buffer, int am, offs_t pc, const UINT8 *op
"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7",
};
- static const char *const r32_names[88] = {
+ static const char *const r32_names[8] = {
"er0", "er1", "er2", "er3", "er4", "er5", "er6", "sp",
};
diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp
index 052c7058604..71aec796760 100644
--- a/src/devices/cpu/hphybrid/hphybrid.cpp
+++ b/src/devices/cpu/hphybrid/hphybrid.cpp
@@ -673,12 +673,7 @@ UINT16 hp_hybrid_cpu_device::RM(UINT32 addr)
return RIO(CURRENT_PA , addr_wo_bsc - HP_REG_R4_ADDR);
case HP_REG_IV_ADDR:
- // Correct?
- if (!BIT(m_flags , HPHYBRID_IRH_SVC_BIT) && !BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) {
- return m_reg_IV;
- } else {
- return m_reg_IV | CURRENT_PA;
- }
+ return m_reg_IV;
case HP_REG_PA_ADDR:
return CURRENT_PA;
@@ -1021,7 +1016,7 @@ void hp_hybrid_cpu_device::check_for_interrupts(void)
// Do a double-indirect JSM IV,I instruction
WM(AEC_CASE_C , ++m_reg_R , m_reg_P);
- m_reg_P = RM(AEC_CASE_I , RM(HP_REG_IV_ADDR));
+ m_reg_P = RM(AEC_CASE_I , m_reg_IV + CURRENT_PA);
m_reg_I = fetch();
}
diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp
index 62a65155a59..4f593de3dea 100644
--- a/src/devices/cpu/i386/i386.cpp
+++ b/src/devices/cpu/i386/i386.cpp
@@ -976,10 +976,10 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level)
//logerror("IRQ (%08x): Interrupt during V8086 task\n",m_pc);
if(type & 0x08)
{
- PUSH32(m_sreg[GS].selector & 0xffff);
- PUSH32(m_sreg[FS].selector & 0xffff);
- PUSH32(m_sreg[DS].selector & 0xffff);
- PUSH32(m_sreg[ES].selector & 0xffff);
+ PUSH32SEG(m_sreg[GS].selector & 0xffff);
+ PUSH32SEG(m_sreg[FS].selector & 0xffff);
+ PUSH32SEG(m_sreg[DS].selector & 0xffff);
+ PUSH32SEG(m_sreg[ES].selector & 0xffff);
}
else
{
@@ -1001,7 +1001,7 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level)
if(type & 0x08)
{
// 32-bit gate
- PUSH32(oldSS);
+ PUSH32SEG(oldSS);
PUSH32(oldESP);
}
else
@@ -1063,7 +1063,7 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level)
else
{
PUSH32(oldflags & 0x00ffffff );
- PUSH32(m_sreg[CS].selector );
+ PUSH32SEG(m_sreg[CS].selector );
if(irq == 3 || irq == 4 || irq == 9 || irq_gate == 1)
PUSH32(m_eip );
else
@@ -1935,7 +1935,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect,
if(operand32 != 0)
{
- PUSH32(oldSS);
+ PUSH32SEG(oldSS);
PUSH32(oldESP);
}
else
@@ -2069,7 +2069,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect,
else
{
/* 32-bit operand size */
- PUSH32(m_sreg[CS].selector );
+ PUSH32SEG(m_sreg[CS].selector );
PUSH32(m_eip );
m_sreg[CS].selector = selector;
m_performed_intersegment_jump = 1;
@@ -2364,6 +2364,7 @@ void i386_device::i386_protected_mode_iret(int operand32)
I386_SREG desc,stack;
UINT8 CPL, RPL, DPL;
UINT32 newflags;
+ UINT8 IOPL = m_IOP1 | (m_IOP2 << 1);
CPL = m_CPL;
UINT32 ea = i386_translate(SS, (STACK_32BIT)?REG32(ESP):REG16(SP), 0);
@@ -2383,7 +2384,7 @@ void i386_device::i386_protected_mode_iret(int operand32)
if(V8086_MODE)
{
UINT32 oldflags = get_flags();
- if(!m_IOP1 || !m_IOP2)
+ if(IOPL != 3)
{
logerror("IRET (%08x): Is in Virtual 8086 mode and IOPL != 3.\n",m_pc);
FAULT(FAULT_GP,0)
@@ -2455,6 +2456,8 @@ void i386_device::i386_protected_mode_iret(int operand32)
{
UINT32 oldflags = get_flags();
newflags = (newflags & ~0x00003000) | (oldflags & 0x00003000);
+ if(CPL > IOPL)
+ newflags = (newflags & ~0x200 ) | (oldflags & 0x200);
}
set_flags(newflags);
m_eip = POP32() & 0xffff; // high 16 bits are ignored
@@ -2571,7 +2574,7 @@ void i386_device::i386_protected_mode_iret(int operand32)
}
if((desc.flags & 0x0080) == 0)
{
- logerror("IRET: Return CS segment is not present.\n");
+ logerror("IRET: (%08x) Return CS segment is not present.\n", m_pc);
FAULT(FAULT_NP,newCS & ~0x03)
}
if(newEIP > desc.limit)
@@ -2584,6 +2587,8 @@ void i386_device::i386_protected_mode_iret(int operand32)
{
UINT32 oldflags = get_flags();
newflags = (newflags & ~0x00003000) | (oldflags & 0x00003000);
+ if(CPL > IOPL)
+ newflags = (newflags & ~0x200 ) | (oldflags & 0x200);
}
if(operand32 == 0)
@@ -2753,6 +2758,8 @@ void i386_device::i386_protected_mode_iret(int operand32)
{
UINT32 oldflags = get_flags();
newflags = (newflags & ~0x00003000) | (oldflags & 0x00003000);
+ if(CPL > IOPL)
+ newflags = (newflags & ~0x200 ) | (oldflags & 0x200);
}
if(operand32 == 0)
@@ -3749,6 +3756,7 @@ void i386_device::device_reset()
// Family 3 (386), Model 0 (DX), Stepping 8 (D1)
REG32(EAX) = 0;
REG32(EDX) = (3 << 8) | (0 << 4) | (8);
+ m_cpu_version = REG32(EDX);
m_CPL = 0;
@@ -3822,7 +3830,7 @@ void i386_device::pentium_smi()
WRITE32(REG32(ESI), smram_state+SMRAM_ESI);
WRITE32(REG32(EDI), smram_state+SMRAM_EDI);
WRITE32(m_eip, smram_state+SMRAM_EIP);
- WRITE32(old_flags, smram_state+SMRAM_EAX);
+ WRITE32(old_flags, smram_state+SMRAM_EFLAGS);
WRITE32(m_cr[3], smram_state+SMRAM_CR3);
WRITE32(old_cr0, smram_state+SMRAM_CR0);
@@ -4039,6 +4047,7 @@ void i486_device::device_reset()
// Family 4 (486), Model 0/1 (DX), Stepping 3
REG32(EAX) = 0;
REG32(EDX) = (4 << 8) | (0 << 4) | (3);
+ m_cpu_version = REG32(EDX);
CHANGE_PC(m_eip);
}
diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h
index 979aaf08f45..8e64458f228 100644
--- a/src/devices/cpu/i386/i386.h
+++ b/src/devices/cpu/i386/i386.h
@@ -333,6 +333,7 @@ struct I386_CALL_GATE
inline UINT32 DEC32(UINT32 dst);
inline void PUSH16(UINT16 value);
inline void PUSH32(UINT32 value);
+ inline void PUSH32SEG(UINT32 value);
inline void PUSH8(UINT8 value);
inline UINT8 POP8();
inline UINT16 POP16();
diff --git a/src/devices/cpu/i386/i386op32.inc b/src/devices/cpu/i386/i386op32.inc
index af5358e4bff..89c7bab44b4 100644
--- a/src/devices/cpu/i386/i386op32.inc
+++ b/src/devices/cpu/i386/i386op32.inc
@@ -475,7 +475,7 @@ void i386_device::i386_call_abs32() // Opcode 0x9a
}
else
{
- PUSH32(m_sreg[CS].selector );
+ PUSH32SEG(m_sreg[CS].selector );
PUSH32(m_eip );
m_sreg[CS].selector = ptr;
m_performed_intersegment_jump = 1;
@@ -1717,7 +1717,7 @@ void i386_device::i386_push_cs32() // Opcode 0x0e
else
offset = (REG16(SP) - 4) & 0xffff;
if(i386_limit_check(SS,offset) == 0)
- PUSH32(m_sreg[CS].selector );
+ PUSH32SEG(m_sreg[CS].selector );
else
FAULT(FAULT_SS,0)
CYCLES(CYCLES_PUSH_SREG);
@@ -1731,7 +1731,7 @@ void i386_device::i386_push_ds32() // Opcode 0x1e
else
offset = (REG16(SP) - 4) & 0xffff;
if(i386_limit_check(SS,offset) == 0)
- PUSH32(m_sreg[DS].selector );
+ PUSH32SEG(m_sreg[DS].selector );
else
FAULT(FAULT_SS,0)
CYCLES(CYCLES_PUSH_SREG);
@@ -1745,7 +1745,7 @@ void i386_device::i386_push_es32() // Opcode 0x06
else
offset = (REG16(SP) - 4) & 0xffff;
if(i386_limit_check(SS,offset) == 0)
- PUSH32(m_sreg[ES].selector );
+ PUSH32SEG(m_sreg[ES].selector );
else
FAULT(FAULT_SS,0)
CYCLES(CYCLES_PUSH_SREG);
@@ -1759,7 +1759,7 @@ void i386_device::i386_push_fs32() // Opcode 0x0f a0
else
offset = (REG16(SP) - 4) & 0xffff;
if(i386_limit_check(SS,offset) == 0)
- PUSH32(m_sreg[FS].selector );
+ PUSH32SEG(m_sreg[FS].selector );
else
FAULT(FAULT_SS,0)
CYCLES(CYCLES_PUSH_SREG);
@@ -1773,7 +1773,7 @@ void i386_device::i386_push_gs32() // Opcode 0x0f a8
else
offset = (REG16(SP) - 4) & 0xffff;
if(i386_limit_check(SS,offset) == 0)
- PUSH32(m_sreg[GS].selector );
+ PUSH32SEG(m_sreg[GS].selector );
else
FAULT(FAULT_SS,0)
CYCLES(CYCLES_PUSH_SREG);
@@ -1787,7 +1787,7 @@ void i386_device::i386_push_ss32() // Opcode 0x16
else
offset = (REG16(SP) - 4) & 0xffff;
if(i386_limit_check(SS,offset) == 0)
- PUSH32(m_sreg[SS].selector );
+ PUSH32SEG(m_sreg[SS].selector );
else
FAULT(FAULT_SS,0)
CYCLES(CYCLES_PUSH_SREG);
@@ -2845,7 +2845,7 @@ void i386_device::i386_groupFF_32() // Opcode 0xff
}
else
{
- PUSH32(m_sreg[CS].selector );
+ PUSH32SEG(m_sreg[CS].selector );
PUSH32(m_eip );
m_sreg[CS].selector = selector;
m_performed_intersegment_jump = 1;
diff --git a/src/devices/cpu/i386/i386ops.h b/src/devices/cpu/i386/i386ops.h
index 2760b9cf410..ccf89a8720d 100644
--- a/src/devices/cpu/i386/i386ops.h
+++ b/src/devices/cpu/i386/i386ops.h
@@ -297,6 +297,7 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] =
{ 0x03, OP_2BYTE|OP_I386, &i386_device::i386_lsl_r16_rm16, &i386_device::i386_lsl_r32_rm32, false},
{ 0x06, OP_2BYTE|OP_I386, &i386_device::i386_clts, &i386_device::i386_clts, false},
{ 0x07, OP_2BYTE|OP_I386, &i386_device::i386_loadall, &i386_device::i386_loadall, false},
+ { 0x07, OP_2BYTE|OP_I486, &i386_device::i386_invalid, &i386_device::i386_invalid, false},
{ 0x08, OP_2BYTE|OP_I486, &i386_device::i486_invd, &i386_device::i486_invd, false},
{ 0x09, OP_2BYTE|OP_I486, &i386_device::i486_wbinvd, &i386_device::i486_wbinvd, false},
{ 0x0B, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_ud2, &i386_device::pentium_ud2, false},
diff --git a/src/devices/cpu/i386/i386ops.inc b/src/devices/cpu/i386/i386ops.inc
index ea15f9a5923..2f13445c8be 100644
--- a/src/devices/cpu/i386/i386ops.inc
+++ b/src/devices/cpu/i386/i386ops.inc
@@ -2504,7 +2504,66 @@ void i386_device::i386_mov_tr_r32() // Opcode 0x0f 26
void i386_device::i386_loadall() // Opcode 0x0f 0x07 (0x0f 0x05 on 80286), undocumented
{
- fatalerror("i386: LOADALL unimplemented at %08X\n", m_pc - 1);
+ if(PROTECTED_MODE && (m_CPL != 0))
+ FAULT(FAULT_GP,0)
+ UINT32 ea = i386_translate(ES, REG32(EDI), 0);
+ m_cr[0] = READ32(ea) & 0xfffeffff; // wp not supported on 386
+ set_flags(READ32(ea + 0x04));
+ m_eip = READ32(ea + 0x08);
+ REG32(EDI) = READ32(ea + 0x0c);
+ REG32(ESI) = READ32(ea + 0x10);
+ REG32(EBP) = READ32(ea + 0x14);
+ REG32(ESP) = READ32(ea + 0x18);
+ REG32(EBX) = READ32(ea + 0x1c);
+ REG32(EDX) = READ32(ea + 0x20);
+ REG32(ECX) = READ32(ea + 0x24);
+ REG32(EAX) = READ32(ea + 0x28);
+ m_dr[6] = READ32(ea + 0x2c);
+ m_dr[7] = READ32(ea + 0x30);
+ m_task.segment = READ16(ea + 0x34);
+ m_ldtr.segment = READ16(ea + 0x38);
+ m_sreg[GS].selector = READ16(ea + 0x3c);
+ m_sreg[FS].selector = READ16(ea + 0x40);
+ m_sreg[DS].selector = READ16(ea + 0x44);
+ m_sreg[SS].selector = READ16(ea + 0x48);
+ m_sreg[CS].selector = READ16(ea + 0x4c);
+ m_sreg[ES].selector = READ16(ea + 0x50);
+ m_task.flags = READ32(ea + 0x54) >> 8;
+ m_task.base = READ32(ea + 0x58);
+ m_task.limit = READ32(ea + 0x5c);
+ m_idtr.base = READ32(ea + 0x64);
+ m_idtr.limit = READ32(ea + 0x68);
+ m_gdtr.base = READ32(ea + 0x70);
+ m_gdtr.limit = READ32(ea + 0x74);
+ m_ldtr.flags = READ32(ea + 0x78) >> 8;
+ m_ldtr.base = READ32(ea + 0x7c);
+ m_ldtr.limit = READ32(ea + 0x80);
+ m_sreg[GS].flags = READ32(ea + 0x84) >> 8;
+ m_sreg[GS].base = READ32(ea + 0x88);
+ m_sreg[GS].limit = READ32(ea + 0x8c);
+ m_sreg[FS].flags = READ32(ea + 0x90) >> 8;
+ m_sreg[FS].base = READ32(ea + 0x94);
+ m_sreg[FS].limit = READ32(ea + 0x98);
+ m_sreg[DS].flags = READ32(ea + 0x9c) >> 8;
+ m_sreg[DS].base = READ32(ea + 0xa0);
+ m_sreg[DS].limit = READ32(ea + 0xa4);
+ m_sreg[SS].flags = READ32(ea + 0xa8) >> 8;
+ m_sreg[SS].base = READ32(ea + 0xac);
+ m_sreg[SS].limit = READ32(ea + 0xb0);
+ m_sreg[CS].flags = READ32(ea + 0xb4) >> 8;
+ m_sreg[CS].base = READ32(ea + 0xb8);
+ m_sreg[CS].limit = READ32(ea + 0xbc);
+ m_sreg[ES].flags = READ32(ea + 0xc0) >> 8;
+ m_sreg[ES].base = READ32(ea + 0xc4);
+ m_sreg[ES].limit = READ32(ea + 0xc8);
+ m_CPL = (m_sreg[SS].flags >> 5) & 3; // cpl == dpl of ss
+
+ for(int i = 0; i < GS; i++)
+ {
+ m_sreg[i].valid = (m_sreg[i].flags & 0x80) ? true : false;
+ m_sreg[i].d = (m_sreg[i].flags & 0x4000) ? 1 : 0;
+ }
+ CHANGE_PC(m_eip);
}
void i386_device::i386_invalid()
diff --git a/src/devices/cpu/i386/i386priv.h b/src/devices/cpu/i386/i386priv.h
index 339e630d1cd..0a471adfe36 100644
--- a/src/devices/cpu/i386/i386priv.h
+++ b/src/devices/cpu/i386/i386priv.h
@@ -1000,6 +1000,23 @@ void i386_device::PUSH32(UINT32 value)
REG16(SP) = new_esp;
}
}
+
+void i386_device::PUSH32SEG(UINT32 value)
+{
+ UINT32 ea, new_esp;
+ if( STACK_32BIT ) {
+ new_esp = REG32(ESP) - 4;
+ ea = i386_translate(SS, new_esp, 1);
+ ((m_cpu_version & 0xf00) == 0x300) ? WRITE16(ea, value) : WRITE32(ea, value ); // 486 also?
+ REG32(ESP) = new_esp;
+ } else {
+ new_esp = (REG16(SP) - 4) & 0xffff;
+ ea = i386_translate(SS, new_esp, 1);
+ ((m_cpu_version & 0xf00) == 0x300) ? WRITE16(ea, value) : WRITE32(ea, value );
+ REG16(SP) = new_esp;
+ }
+}
+
void i386_device::PUSH8(UINT8 value)
{
if( m_operand_size ) {
diff --git a/src/devices/machine/com8116.cpp b/src/devices/machine/com8116.cpp
index 46a0ce83986..f5c177fef62 100644
--- a/src/devices/machine/com8116.cpp
+++ b/src/devices/machine/com8116.cpp
@@ -25,17 +25,59 @@
// device type definition
const device_type COM8116 = &device_creator<com8116_device>;
+// Parts with T after the number do not have an internal oscillator and require an external clock source
+// The SMC/COM 5xxx parts are all dual 5v/12v parts, while the 8xxx parts are 5v only
+// SMC/COM5016(T) with no dash, aka 'STD' part on the datasheet
+// Also COM8116(T)/8126(T)/8136(T)/8146(T) and Synertek sy2661-3 and GI AY-5-8116(T)-000 and GI AY-5-8136(T)-000 and WD WD-1943-00 (aka WD8136-00)
+// SMC/COM8156(T) is the same chip but clocked twice as fast and 32x clocks per baud instead of 16x
+// baud rates are 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200
const int com8116_device::divisors_16X_5_0688MHz[] =
{ 6336, 4224, 2880, 2355, 2112, 1056, 528, 264, 176, 158, 132, 88, 66, 44, 33, 16 };
+// SMC/COM8116-003
+// from http://www.vintagecomputer.net/fjkraan/comp/divcomp/doc/SMC_BaudGen.pdf page 283 (pdf page 20)
+// baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 9600, 19200
+const int com8116_device::divisors_16X_6_01835MHz[] =
+ { 7523, 5015, 3420, 2797, 2508, 1881, 1254, 627, 313, 209, 188, 157, 104, 78, 39, 20 };
+
+// SMC/COM5016(T)-5 and WD WD-1943-05; Synertek SY2661-1 and 2 are NOT the same as this despite using same clock speed, see below
+// SMC/COM8156(T)-5 is the same chip but clocked twice as fast and 32x clocks per baud instead of 16x
+// baud rates are 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200
const int com8116_device::divisors_16X_4_9152MHz[] =
{ 6144, 4096, 2793, 2284, 2048, 1024, 512, 256, 171, 154, 128, 85, 64, 43, 32, 16 };
+// SMC/COM5016(T)-6 and WD WD-1943-06
+// baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200
const int com8116_device::divisors_32X_5_0688MHz[] =
{ 3168, 2112, 1440, 1177, 1056, 792, 528, 264, 132, 88, 66, 44, 33, 22, 16, 8 };
+// SMC/COM5016(T)-013 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/terminal/vt100/EK-VT100-TM-003_VT100_Technical_Manual_Jul82.pdf page 4-27 (pdf page 78))
+// and from http://www.vintagecomputer.net/fjkraan/comp/divcomp/doc/SMC_BaudGen.pdf page 283 (pdf page 20)
+// SMC/COM5106-013A is the same chip clocked twice as fast, but with 32x clocks per baud instead of 16x
+// baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 9600, 19200
+const int com8116_device::divisors_16X_2_7648MHz[] =
+ { 3456, 2304, 1571, 1285, 1152, 864, 576, 288, 144, 96, 86, 72, 48, 36, 18, 9 };
+
+// SMC/COM5026(T)-030 (non-standard serial rates, from http://bitsavers.informatik.uni-stuttgart.de/pdf/standardMicrosystems/_dataBooks/1979_StandardMicrosystems.pdf page 135)
+const int com8116_device::divisors_16X_5_0688MHz_030[] =
+ { 731, 733, 735, 737, 741, 743, 745, 751, 6970, 5569, 5433, 4752, 4269, 1920, 1584, 301 };
+
+// SMC/COM5036(T)-080 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/standardMicrosystems/_dataBooks/1979_StandardMicrosystems.pdf page 135)
+const int com8116_device::divisors_16X_4_6080MHz[] =
+ { 5760, 3840, 2618, 2141, 1920, 960, 480, 240, 160, 144, 120, 80, 60, 40, 30, 15 };
+
+// COM8046 combines the -6 and STD tables into one device as a 32-entry table
+
+// Synertek SY2661-1 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/synertek/_dataBooks/Synertek_1981-1982_Data_Catalog.pdf page 3-40 (pdf page 139))
+// baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1050, 1200, 1800, 2000, 2400, 4800, 9600, 19200
+const int com8116_device::divisors_16X_4_9152MHz_SY2661_1[] =
+ { 6144, 4096, 2793, 2284, 2048, 1536, 1024, 512, 292, 256, 171, 154, 128, 64, 32, 16 };
+// Synertek SY2661-2 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/synertek/_dataBooks/Synertek_1981-1982_Data_Catalog.pdf page 3-40 (pdf page 139))
+// baud rates are 45.5, 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 4800, 9600, 19200, 38400
+const int com8116_device::divisors_16X_4_9152MHz_SY2661_2[] =
+ { 6752, 6144, 4096, 2793, 2284, 2048, 1024, 512, 256, 171, 154, 128, 64, 32, 16, 8 };
//**************************************************************************
// LIVE DEVICE
diff --git a/src/devices/machine/com8116.h b/src/devices/machine/com8116.h
index 119f40d4b3d..614be491318 100644
--- a/src/devices/machine/com8116.h
+++ b/src/devices/machine/com8116.h
@@ -63,8 +63,14 @@ public:
DECLARE_WRITE8_MEMBER( stt_w );
static const int divisors_16X_5_0688MHz[];
+ static const int divisors_16X_6_01835MHz[];
static const int divisors_16X_4_9152MHz[];
static const int divisors_32X_5_0688MHz[];
+ static const int divisors_16X_2_7648MHz[];
+ static const int divisors_16X_5_0688MHz_030[];
+ static const int divisors_16X_4_6080MHz[];
+ static const int divisors_16X_4_9152MHz_SY2661_1[];
+ static const int divisors_16X_4_9152MHz_SY2661_2[];
protected:
// device-level overrides
diff --git a/src/devices/machine/corvushd.cpp b/src/devices/machine/corvushd.cpp
index 558851c0b7a..08536344849 100644
--- a/src/devices/machine/corvushd.cpp
+++ b/src/devices/machine/corvushd.cpp
@@ -874,7 +874,7 @@ UINT8 corvus_hdc_t::corvus_read_firmware_block(UINT8 head, UINT8 sector) {
// Status of command
//
UINT8 corvus_hdc_t::corvus_write_firmware_block(UINT8 head, UINT8 sector, UINT8 *buffer) {
- UINT16 relative_sector; // Relative sector on drive for Physical Read
+ UINT16 relative_sector; // Relative sector on drive for Physical Write
UINT8 status;
relative_sector = head * m_sectors_per_track + sector;
diff --git a/src/devices/machine/hp_taco.cpp b/src/devices/machine/hp_taco.cpp
new file mode 100644
index 00000000000..76203d31ee3
--- /dev/null
+++ b/src/devices/machine/hp_taco.cpp
@@ -0,0 +1,1467 @@
+// license:BSD-3-Clause
+// copyright-holders:F. Ulivi
+/*********************************************************************
+
+ hp_taco.cpp
+
+ HP TApe COntroller (5006-3012)
+
+*********************************************************************/
+
+// This device has been reverse engineered entirely through documents & study of HP software.
+// I had no access to the real device to experiment.
+// Available documentation on the internal working of TACO chip is close to nothing. The best
+// I could find is [1] (see below) where all that's described is a (too) brief summary of registers and little else.
+// In other words, no description of the commands that can be issued to TACO chips.
+// So, my main source of information was the careful study of HP software, especially the 9845 system test ROM (09845-66520).
+// The second half of this ROM holds a comprehensive set of tape drive tests.
+// The main shortcomings of my approach are:
+// * I could indentify only those TACO commands that are actually used by the software. I managed
+// to identify 17 out of 32 possible commands. The purpose of the rest of commands is anyone's guess.
+// * I could only guess the behavior of TACO chips in corner cases (especially behavior in various error/abnormal
+// conditions)
+//
+// Documentation I used:
+// [1] HP, manual 64940-90905, may 80 rev. - Model 64940A tape control & drive service manual
+// [2] US patent 4,075,679 describing HP9825 system (this system had a discrete implementation of tape controller). The
+// firmware listing was quite useful in identifying sequences of commands (for example how to find a specific sector etc.).
+// [3] http://www.hp9845.net site
+// [4] April 1978 issue of HP Journal. There is a one-page summary of TACO chip on page 20.
+
+// This is an overview of the TACO/CPU interface.
+//
+// Reg. | R/W | Content
+// =====================
+// R4 | R/W | Data register: words read/written to/from tape pass through this register
+// R5 | R/W | Command and status register (see below)
+// R6 | R/W | Tachometer register. Writing it sets a pulse counter that counts up on either tachometer pulses or IRGs, depending
+// | | on command. When the counter rolls over from 0xffff to 0 it typically ends the command. It's not clear to me
+// | | what value could be read from this register, if it's just the same value that was written last time or the internal
+// | | counter or something else entirely.
+// R7 | R | Checksum register. Reading it clears it.
+// R7 | W | Timing register. It controls somehow the encoding and decoding of bits. For now I completely ignore it because its
+// | | content it's totally unknown to me. It seems safe to do so, anyway. I can see that it's always set to 0x661d before
+// | | writing to tape and to 0x0635 before reading.
+//
+// Format of TACO command/status register (R5)
+// Bit R/W Content
+// ===============
+// 15 RW Tape direction (1 = forward)
+// 14..10 RW Command (see the "enum" below)
+// 9 RW ? Drive ON according to [1], the actual use seems to be selection of gap length
+// 8 RW ? Size of gaps according to [1], N/U in my opinion
+// 7 RW Speed of tape (1 = 90 ips, 0 = 22 ips)
+// 6 RW Option bit for various commands
+// 5 R Current track (1 = B)
+// 4 R Gap detected (1)
+// 3 R Write protection (1)
+// 2 R Servo failure (1)
+// 1 R Cartridge out (1)
+// 0 R Hole detected (1)
+
+// Here's a summary of the on-tape format of HP9845 systems.
+// * A tape has two independent tracks (A & B).
+// * Each track holds 426 sectors.
+// * Each sector has an header and 256 bytes of payload (see below)
+// * Sectors are separated by gaps of uniform magnetization called IRGs (Inter-Record Gaps)
+// * The basic unit of data I/O are 16-bit words
+// * Bits are encoded by different distances between magnetic flux reversals
+// * The structure of tracks is:
+// - Begin of tape holes
+// - The deadzone: 350x 0xffff words
+// - 1" of IRG
+// - Sector #0 (track A) or #426 (track B)
+// - 1" of IRG (2.5" on track A)
+// - Sector #1 (track A) or #427 (track B)
+// - 1" of IRG
+// - Sector #2 (track A) or #428 (track B)
+// - ...and so on up to sector #425/#851
+// - 6" of final gap
+// - Non-recorded tape
+// - End of tape holes
+// * Sector #0 is not used
+// * Sectors #1 and #2 hold the first copy of tape directory
+// * Sectors #3 and #4 hold the second/backup copy of tape directory
+// * User data are stored starting from sector #5
+// * There is no "fragmentation" map (like file allocation table in FAT filesystem): a file
+// spanning more than 1 sector always occupy a single block of contiguous sectors.
+//
+// A sector is structured like this:
+// Word 0: Invisible preamble word (always 0). Preamble comes from 9825, don't know if it's
+// actually there in TACO encoding. I assumed it is.
+// Word 1: Format/sector in use and other unidentified bits.
+// Word 2: Sector number
+// Word 3: Sector length and other bits
+// Word 4: Checksum (sum of words 1..3)
+// Words 5..132: Payload
+// Word 133: Checksum (sum of words 5..132)
+//
+// Physical encoding of words is borrowed from 9825 as I wasn't able
+// to gather any info on the actual encoding of TACO chips.
+// This is how 9825 encodes words on tape:
+// - the unit of encoding are 16-bit words
+// - each word is encoded from MSB to LSB
+// - each word has an extra invisible "1" encoded at the end
+// - tape is read/written at slow speed only (21.98 ips)
+// - a 0 is encoded with a distance between flux reversals of 1/35200 s
+// (giving a maximum density of about 1600 reversals per inch)
+// - a 1 is encoded with a distance that's 1.75 times that of a 0
+//
+// This driver is based on the following model of the actual TACO/tape system:
+// * Tape immediately reaches working speed (no spin-up time)
+// * Inversion of tape direction and change of speed are immediate as well
+// * Time & distance to stop the tape are modeled, though. Firmware is upset by
+// a tape with null braking time/distance.
+// * Speed of tape is exceptionally accurate. Real tape was controlled by a closed loop
+// with something like 1% accuracy on speed.
+// * Storage is modeled by one "map" data structure per track. Each map maps the tape position
+// to the 16-bit word stored at that position. Gaps are modeled by lack of data in the map.
+// There is no model of the physical encoding of bits (except to compute how long each word
+// is on tape).
+// * Read threshold is ignored. Real tapes could be read with either a low or high threshold.
+// * "Flag" bit is used as a busy/ready signal in real TACO. Here I assumed the device is
+// always ready, so Flag is always active.
+// * I tried to fill the (many) gaps on chip behavior with "sensible" solutions. I could only
+// validate my solutions by running the original firmware in MAME, though (no real hw at hand).
+//
+// TODOs/issues:
+// * Some code cleanup
+// * Handling of tape holes seems to be wrong: test "C" of test ROM only works partially
+// * Find out what is read from register R6
+// * Handle device_image_interface::call_display to show state of tape
+// * Find more info on TACO chips (does anyone with a working 9845 or access to internal HP docs want to
+// help me here, please?)
+//
+#include "emu.h"
+#include "hp_taco.h"
+
+// Debugging
+#define VERBOSE 1
+#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
+#define VERBOSE_0 0
+#define LOG_0(x) do { if (VERBOSE_0) logerror x; } while (0)
+
+// Macros to clear/set single bits
+#define BIT_MASK(n) (1U << (n))
+#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n))
+#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
+
+// Timers
+enum {
+ TAPE_TMR_ID,
+ HOLE_TMR_ID
+};
+
+// Constants
+#define CMD_REG_MASK 0xffc0 // Command register mask
+#define STATUS_REG_MASK 0x003f // Status register mask
+#define TACH_TICKS_PER_INCH 968 // Tachometer pulses per inch of tape movement
+#define TAPE_POS_FRACT 1024 // 10 bits of fractional part in tape_pos_t
+#define ONE_INCH_POS (TACH_TICKS_PER_INCH * TAPE_POS_FRACT) // Value in tape_pos_t representing 1 inch of tape
+#define TACH_FREQ_SLOW 21276 // Tachometer pulse frequency for slow speed (21.98 ips)
+#define TACH_FREQ_FAST 87196 // Tachometer pulse frequency for fast speed (90.08 ips)
+#define TAPE_LENGTH ((140 * 12 + 72 * 2) * ONE_INCH_POS) // Tape length: 140 ft of usable tape + 72" of punched tape at either end
+#define TAPE_INIT_POS (80 * ONE_INCH_POS) // Initial tape position: 80" from beginning (just past the punched part)
+#define ZERO_BIT_LEN 619 // Length of 0 bits at slow tape speed: 1/(35200 Hz)
+#define ONE_BIT_LEN 1083 // Length of 1 bits at slow tape speed: 1.75 times ZERO_BIT_LEN
+#define QUICK_CMD_USEC 25 // usec for "quick" command execution
+#define FAST_BRAKE_MSEC 73 // Braking time from fast speed to stop (2 ips) in msec (deceleration is 1200 in/s^2)
+#define SLOW_BRAKE_MSEC 17 // Braking time from slow speed to stop in msec
+#define FAST_BRAKE_DIST 3350450 // Braking distance at fast speed (~3.38 in)
+#define SLOW_BRAKE_DIST 197883 // Braking distance at slow speed (~0.2 in)
+#define PREAMBLE_WORD 0 // Value of preamble word
+#define END_GAP_LENGTH (6 * ONE_INCH_POS) // Length of final gap: 6"
+#define MIN_IRG_LENGTH ((tape_pos_t)(0.2 * ONE_INCH_POS)) // Minimum length of IRGs: 0.2" (from 9825, not sure about value in TACO)
+#define NULL_TAPE_POS ((tape_pos_t)-1) // Special value for invalid/unknown tape position
+#define NO_DATA_GAP (17 * ONE_BIT_LEN) // Minimum gap size to detect end of data: length of longest word (0xffff)
+#define FILE_MAGIC 0x4f434154 // Magic value at start of image file: "TACO"
+
+// Parts of command register
+#define CMD_CODE(reg) \
+ (((reg) >> 10) & 0x1f)
+#define DIR_FWD(reg) \
+ (BIT(reg , 15))
+#define SPEED_FAST(reg) \
+ (BIT(reg , 7))
+#define CMD_OPT(reg) \
+ (BIT(reg , 6))
+#define UNKNOWN_B9(reg) \
+ (BIT(reg , 9))
+#define DIR_FWD_MASK BIT_MASK(15) // Direction = forward
+#define SPEED_FAST_MASK BIT_MASK(7) // Speed = fast
+
+// Commands
+enum {
+ CMD_INDTA_INGAP, // 00: scan for data first then for gap
+ CMD_UNK_01, // 01: unknown
+ CMD_FINAL_GAP, // 02: write final gap
+ CMD_INIT_WRITE, // 03: write words for tape formatting
+ CMD_STOP, // 04: stop
+ CMD_UNK_05, // 05: unknown
+ CMD_SET_TRACK, // 06: set A/B track
+ CMD_UNK_07, // 07: unknown
+ CMD_UNK_08, // 08: unknown
+ CMD_UNK_09, // 09: unknown
+ CMD_MOVE, // 0a: move tape
+ CMD_UNK_0b, // 0b: unknown
+ CMD_INGAP_MOVE, // 0c: scan for gap then move a bit further (used to gain some margin when inverting tape movement)
+ CMD_UNK_0d, // 0d: unknown
+ CMD_CLEAR, // 0e: clear errors/unlatch status bits
+ CMD_UNK_0f, // 0f: unknown
+ CMD_NOT_INDTA, // 10: scan for end of data
+ CMD_UNK_11, // 11: unknown
+ CMD_UNK_12, // 12: unknown
+ CMD_UNK_13, // 13: unknown
+ CMD_UNK_14, // 14: unknown
+ CMD_UNK_15, // 15: unknown
+ CMD_WRITE_IRG, // 16: write inter-record gap
+ CMD_UNK_17, // 17: unknown
+ CMD_SCAN_RECORDS, // 18: scan records (count IRGs)
+ CMD_RECORD_WRITE, // 19: write record words
+ CMD_MOVE_INDTA, // 1a: move then scan for data
+ CMD_UNK_1b, // 1b: unknown (for now it seems harmless to handle it as NOP)
+ CMD_DELTA_MOVE_HOLE, // 1c: move tape a given distance, intr at end or first hole found (whichever comes first)
+ CMD_START_READ, // 1d: start record reading
+ CMD_DELTA_MOVE_IRG, // 1e: move tape a given distance, detect gaps in parallel
+ CMD_END_READ // 1f: stop reading
+};
+
+// Bits of status register
+#define STATUS_HOLE_BIT 0 // Hole detected
+#define STATUS_CART_OUT_BIT 1 // Cartridge out
+#define STATUS_SFAIL_BIT 2 // Servo failure
+#define STATUS_WPR_BIT 3 // Write protection
+#define STATUS_GAP_BIT 4 // Gap detected
+#define STATUS_TRACKB_BIT 5 // Track B selected
+#define STATUS_CART_OUT_MASK BIT_MASK(STATUS_CART_OUT_BIT) // Cartridge out
+#define STATUS_WPR_MASK BIT_MASK(STATUS_WPR_BIT) // Write protection
+#define STATUS_ERR_MASK (STATUS_CART_OUT_MASK) // Mask of errors in status reg.
+
+// *** Position of tape holes ***
+// At beginning of tape:
+// *START*
+// |<-----24"----->|<---12"--->|<---12"--->|<-----24"----->|
+// O O O O O O O
+// |<->| |<->| |<->|
+// 0.218" 0.218" 0.218"
+// At end of tape:
+// *END*
+// |<-----24"----->|<---12"--->|<---12"--->|<-----24"----->|
+// O O O O
+//
+static const hp_taco_device::tape_pos_t tape_holes[] = {
+ (hp_taco_device::tape_pos_t)(23.891 * ONE_INCH_POS), // 24 - 0.218 / 2
+ (hp_taco_device::tape_pos_t)(24.109 * ONE_INCH_POS), // 24 + 0.218 / 2
+ (hp_taco_device::tape_pos_t)(35.891 * ONE_INCH_POS), // 36 - 0.218 / 2
+ (hp_taco_device::tape_pos_t)(36.109 * ONE_INCH_POS), // 36 + 0.218 / 2
+ (hp_taco_device::tape_pos_t)(47.891 * ONE_INCH_POS), // 48 - 0.218 / 2
+ (hp_taco_device::tape_pos_t)(48.109 * ONE_INCH_POS), // 48 + 0.218 / 2
+ 72 * ONE_INCH_POS, // 72
+ 1752 * ONE_INCH_POS, // 1752
+ 1776 * ONE_INCH_POS, // 1776
+ 1788 * ONE_INCH_POS, // 1788
+ 1800 * ONE_INCH_POS // 1800
+};
+
+// Device type definition
+const device_type HP_TACO = &device_creator<hp_taco_device>;
+
+// Constructors
+hp_taco_device::hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname)
+ : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
+ device_image_interface(mconfig , *this),
+ m_irq_handler(*this),
+ m_flg_handler(*this),
+ m_sts_handler(*this),
+ m_tape_pos(TAPE_INIT_POS),
+ m_image_dirty(false)
+{
+ clear_state();
+}
+
+hp_taco_device::hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, HP_TACO, "HP TACO", tag, owner, clock, "TACO", __FILE__),
+ device_image_interface(mconfig , *this),
+ m_irq_handler(*this),
+ m_flg_handler(*this),
+ m_sts_handler(*this),
+ m_tape_pos(TAPE_INIT_POS),
+ m_image_dirty(false)
+{
+ clear_state();
+}
+
+WRITE16_MEMBER(hp_taco_device::reg_w)
+{
+ LOG_0(("wr R%u = %04x\n", 4 + offset , data));
+
+ // Any I/O activity clears IRQ
+ irq_w(false);
+
+ switch (offset) {
+ case 0:
+ // Data register
+ m_data_reg = data;
+ m_data_reg_full = true;
+ break;
+
+ case 1:
+ // Command register
+ start_cmd_exec(data & CMD_REG_MASK);
+ break;
+
+ case 2:
+ // Tachometer register
+ m_tach_reg = data;
+ break;
+
+ case 3:
+ // Timing register
+ m_timing_reg = data;
+ break;
+ }
+}
+
+READ16_MEMBER(hp_taco_device::reg_r)
+{
+ UINT16 res = 0;
+
+ // Any I/O activity clears IRQ
+ irq_w(false);
+
+ switch (offset) {
+ case 0:
+ // Data register
+ res = m_data_reg;
+ break;
+
+ case 1:
+ // Command & status register
+ res = (m_cmd_reg & CMD_REG_MASK) | (m_status_reg & STATUS_REG_MASK);
+ break;
+
+ case 2:
+ // Tachometer register
+ res = m_tach_reg;
+ break;
+
+ case 3:
+ // Checksum register: it clears when read
+ res = m_checksum_reg;
+ m_checksum_reg = 0;
+ break;
+ }
+
+ LOG_0(("rd R%u = %04x\n", 4 + offset , res));
+
+ return res;
+}
+
+READ_LINE_MEMBER(hp_taco_device::flg_r)
+{
+ return m_flg;
+}
+
+READ_LINE_MEMBER(hp_taco_device::sts_r)
+{
+ return m_sts;
+}
+
+// device_config_complete
+void hp_taco_device::device_config_complete()
+{
+ LOG(("device_config_complete"));
+ update_names();
+}
+
+// device_start
+void hp_taco_device::device_start()
+{
+ LOG(("device_start"));
+ m_irq_handler.resolve_safe();
+ m_flg_handler.resolve_safe();
+ m_sts_handler.resolve_safe();
+
+ save_item(NAME(m_data_reg));
+ save_item(NAME(m_data_reg_full));
+ save_item(NAME(m_cmd_reg));
+ save_item(NAME(m_cmd_state));
+ save_item(NAME(m_status_reg));
+ save_item(NAME(m_tach_reg));
+ save_item(NAME(m_checksum_reg));
+ save_item(NAME(m_timing_reg));
+ save_item(NAME(m_irq));
+ save_item(NAME(m_flg));
+ save_item(NAME(m_sts));
+ save_item(NAME(m_tape_pos));
+ save_item(NAME(m_start_time));
+ save_item(NAME(m_tape_fwd));
+ save_item(NAME(m_tape_fast));
+ save_item(NAME(m_image_dirty));
+ save_item(NAME(m_tape_wr));
+ save_item(NAME(m_rw_pos));
+ save_item(NAME(m_next_word));
+ save_item(NAME(m_rd_it_valid));
+ save_item(NAME(m_gap_detect_start));
+
+ m_tape_timer = timer_alloc(TAPE_TMR_ID);
+ m_hole_timer = timer_alloc(HOLE_TMR_ID);
+}
+
+// device_stop
+void hp_taco_device::device_stop()
+{
+}
+
+// device_reset
+void hp_taco_device::device_reset()
+{
+ LOG(("device_reset"));
+ clear_state();
+
+ m_irq = false;
+ m_flg = true;
+
+ m_irq_handler(false);
+ m_flg_handler(true);
+ set_error(false);
+}
+
+void hp_taco_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (CMD_CODE(m_cmd_reg) != CMD_STOP) {
+ update_tape_pos();
+ }
+
+ switch (id) {
+ case TAPE_TMR_ID:
+ LOG_0(("Tape tmr @%g\n" , machine().time().as_double()));
+
+ tape_pos_t length;
+
+ switch (CMD_CODE(m_cmd_reg)) {
+ case CMD_INDTA_INGAP:
+ if (m_cmd_state == 0) {
+ m_cmd_state = 1;
+ tape_pos_t target = m_tape_pos;
+ if (next_n_gap(target, 1, MIN_IRG_LENGTH)) {
+ m_tape_timer->adjust(time_to_target(target));
+ }
+ return;
+ }
+ break;
+
+ case CMD_RECORD_WRITE:
+ if (m_cmd_state == 0) {
+ if (m_rd_it->second == PREAMBLE_WORD) {
+ LOG_0(("Got preamble\n"));
+ m_cmd_state = 1;
+ // m_rw_pos already at correct position
+ m_tape_timer->adjust(fetch_next_wr_word());
+ break;
+ } else {
+ adv_res_t res = adv_it(m_rd_it);
+ if (res != ADV_NO_MORE_DATA) {
+ m_tape_timer->adjust(time_to_rd_next_word(m_rw_pos));
+ }
+ // No IRQ
+ return;
+ }
+ }
+ // Intentional fall-through
+ case CMD_INIT_WRITE:
+ write_word(m_rw_pos , m_next_word , length);
+ pos_offset(m_rw_pos , length);
+ // Just to be sure..
+ m_tape_pos = m_rw_pos;
+ m_tape_timer->adjust(fetch_next_wr_word());
+ break;
+
+ case CMD_STOP:
+ move_tape_pos(m_tape_fast ? FAST_BRAKE_DIST : SLOW_BRAKE_DIST);
+ stop_tape();
+ break;
+
+ case CMD_INGAP_MOVE:
+ if (m_cmd_state == 0) {
+ m_cmd_state = 1;
+ m_tape_timer->adjust(time_to_tach_pulses());
+ return;
+ }
+ break;
+
+ case CMD_FINAL_GAP:
+ case CMD_WRITE_IRG:
+ write_gap(m_rw_pos , m_tape_pos);
+ m_hole_timer->reset();
+ break;
+
+ case CMD_SCAN_RECORDS:
+ if (m_cmd_state == 0) {
+ m_cmd_state = 1;
+ tape_pos_t target = m_tape_pos;
+ if (next_n_gap(target, 0x10000U - m_tach_reg, MIN_IRG_LENGTH)) {
+ LOG_0(("%u gaps @%d\n" , 0x10000U - m_tach_reg, target));
+ m_tape_timer->adjust(time_to_target(target));
+ }
+ return;
+ } else {
+ m_hole_timer->reset();
+ }
+ break;
+
+ case CMD_MOVE_INDTA:
+ if (m_cmd_state == 0) {
+ if (next_data(m_rd_it , m_tape_pos , true)) {
+ m_cmd_state = 1;
+ m_tape_timer->adjust(time_to_target(farthest_end(m_rd_it)));
+ }
+ // No IRQ
+ return;
+ }
+ // m_cmd_state == 1 -> IRQ & cmd end
+ break;
+
+ case CMD_DELTA_MOVE_HOLE:
+ case CMD_DELTA_MOVE_IRG:
+ // Interrupt at end of movement
+ m_hole_timer->reset();
+ break;
+
+ case CMD_START_READ:
+ {
+ bool set_intr = true;
+ // Just to be sure..
+ m_tape_pos = m_rw_pos;
+ if (m_cmd_state == 0) {
+ set_intr = false;
+ if (m_rd_it->second == PREAMBLE_WORD) {
+ m_cmd_state = 1;
+ }
+ LOG_0(("Got preamble\n"));
+ } else {
+ m_data_reg = m_rd_it->second;
+ m_checksum_reg += m_data_reg;
+ LOG_0(("RD %04x\n" , m_data_reg));
+ }
+ adv_res_t res = adv_it(m_rd_it);
+ LOG_0(("adv_it %d\n" , res));
+ if (res == ADV_NO_MORE_DATA) {
+ m_rd_it_valid = false;
+ } else {
+ if (res == ADV_DISCONT_DATA) {
+ // Hit a gap, restart preamble search
+ m_cmd_state = 0;
+ }
+ m_tape_timer->adjust(time_to_rd_next_word(m_rw_pos));
+ }
+ if (!set_intr) {
+ return;
+ }
+ }
+ break;
+
+ case CMD_END_READ:
+ {
+ m_tape_pos = m_rw_pos;
+ // Note: checksum is not updated
+ m_data_reg = m_rd_it->second;
+ LOG_0(("Final RD %04x\n" , m_data_reg));
+ adv_res_t res = adv_it(m_rd_it);
+ if (res == ADV_NO_MORE_DATA) {
+ m_rd_it_valid = false;
+ }
+ m_hole_timer->reset();
+ }
+ break;
+
+ default:
+ // Other commands: just raise irq
+ break;
+ }
+ irq_w(true);
+ break;
+
+ case HOLE_TMR_ID:
+ LOG_0(("Hole tmr @%g\n" , machine().time().as_double()));
+
+ BIT_SET(m_status_reg , STATUS_HOLE_BIT);
+
+ switch (CMD_CODE(m_cmd_reg)) {
+ case CMD_FINAL_GAP:
+ case CMD_WRITE_IRG:
+ write_gap(m_rw_pos , m_tape_pos);
+ m_rw_pos = m_tape_pos;
+ break;
+
+ case CMD_SCAN_RECORDS:
+ case CMD_DELTA_MOVE_HOLE:
+ // Cmds 18 & 1c are terminated at first hole
+ m_tape_timer->reset();
+ irq_w(true);
+ // No reloading of hole timer
+ return;
+
+ case CMD_DELTA_MOVE_IRG:
+ // TODO: update r6
+ m_hole_timer->adjust(time_to_next_hole());
+ // No IRQ at holes
+ return;
+
+ case CMD_START_READ:
+ case CMD_END_READ:
+ set_error(true);
+ break;
+
+ default:
+ // Other cmds: default processing (update tape pos, set IRQ, schedule timer for next hole)
+ break;
+ }
+
+ irq_w(true);
+ m_hole_timer->adjust(time_to_next_hole());
+ break;
+
+ default:
+ break;
+ }
+}
+
+void hp_taco_device::clear_state(void)
+{
+ m_data_reg = 0;
+ m_data_reg_full = false;
+ m_cmd_reg = 0;
+ m_status_reg = 0;
+ m_tach_reg = 0;
+ m_checksum_reg = 0;
+ m_timing_reg = 0;
+ m_cmd_state = 0;
+ // m_tape_pos is not reset, tape stays where it is
+ m_start_time = attotime::never;
+ m_tape_fwd = false;
+ m_tape_fast = false;
+ // m_image_dirty is not touched
+ m_tape_wr = false;
+ m_rw_pos = 0;
+ m_next_word = 0;
+ m_rd_it_valid = false;
+ m_gap_detect_start = NULL_TAPE_POS;
+
+ set_tape_present(false);
+ set_tape_present(is_loaded());
+}
+
+void hp_taco_device::irq_w(bool state)
+{
+ if (state != m_irq) {
+ m_irq = state;
+ m_irq_handler(state);
+ LOG_0(("IRQ = %d\n" , state));
+ }
+}
+
+void hp_taco_device::set_error(bool state)
+{
+ m_sts = !state;
+ m_sts_handler(m_sts);
+ LOG_0(("error = %d\n" , state));
+}
+
+unsigned hp_taco_device::speed_to_tick_freq(void) const
+{
+ return m_tape_fast ? TACH_FREQ_FAST * TAPE_POS_FRACT : TACH_FREQ_SLOW * TAPE_POS_FRACT;
+}
+
+bool hp_taco_device::pos_offset(tape_pos_t& pos , tape_pos_t offset) const
+{
+ if (offset == 0) {
+ return true;
+ }
+
+ if (!m_tape_fwd) {
+ offset = -offset;
+ }
+
+ pos += offset;
+
+ // In real life tape would unspool..
+ if (pos > TAPE_LENGTH) {
+ pos = TAPE_LENGTH;
+ return false;
+ } else if (pos < 0) {
+ pos = 0;
+ return false;
+ } else {
+ return true;
+ }
+}
+
+void hp_taco_device::move_tape_pos(tape_pos_t delta_pos)
+{
+ tape_pos_t tape_start_pos = m_tape_pos;
+ if (!pos_offset(m_tape_pos , delta_pos)) {
+ LOG(("Tape unspooled!\n"));
+ }
+ m_start_time = machine().time();
+ LOG_0(("Tape pos = %u\n" , m_tape_pos));
+ if (any_hole(tape_start_pos , m_tape_pos)) {
+ // Crossed one or more holes
+ BIT_SET(m_status_reg , STATUS_HOLE_BIT);
+ }
+}
+
+void hp_taco_device::update_tape_pos(void)
+{
+ if (m_start_time.is_never()) {
+ // Tape not moving
+ return;
+ }
+
+ attotime delta_time(machine().time() - m_start_time);
+ LOG_0(("delta_time = %g\n" , delta_time.as_double()));
+ // How many tachometer ticks has the tape moved?
+ tape_pos_t delta_tach = (tape_pos_t)(delta_time.as_ticks(speed_to_tick_freq()));
+ LOG_0(("delta_tach = %u\n" , delta_tach));
+
+ move_tape_pos(delta_tach);
+
+ // Gap detection
+ bool gap_detected = false;
+ if (m_gap_detect_start != NULL_TAPE_POS && abs(m_gap_detect_start - m_tape_pos) >= MIN_IRG_LENGTH) {
+ tape_pos_t tmp = m_tape_pos;
+ pos_offset(tmp , -MIN_IRG_LENGTH);
+ gap_detected = just_gap(tmp , m_tape_pos);
+ }
+ if (gap_detected) {
+ BIT_SET(m_status_reg, STATUS_GAP_BIT);
+ } else {
+ BIT_CLR(m_status_reg, STATUS_GAP_BIT);
+ }
+}
+
+void hp_taco_device::ensure_a_lt_b(tape_pos_t& a , tape_pos_t& b)
+{
+ if (a > b) {
+ // Ensure A always comes before B
+ tape_pos_t tmp;
+ tmp = a;
+ a = b;
+ b = tmp;
+ }
+}
+
+// Is there any hole in a given section of tape?
+bool hp_taco_device::any_hole(tape_pos_t tape_pos_a , tape_pos_t tape_pos_b)
+{
+ ensure_a_lt_b(tape_pos_a , tape_pos_b);
+
+ for (tape_pos_t hole : tape_holes) {
+ if (tape_pos_a < hole && tape_pos_b >= hole) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Position of next hole tape will reach in a given direction
+hp_taco_device::tape_pos_t hp_taco_device::next_hole(void) const
+{
+ if (m_tape_fwd) {
+ for (tape_pos_t hole : tape_holes) {
+ if (hole > m_tape_pos) {
+ LOG_0(("next hole fwd @%u = %u\n" , m_tape_pos , hole));
+ return hole;
+ }
+ }
+ // No more holes: will hit end of tape
+ return TAPE_LENGTH;
+ } else {
+ for (int i = (sizeof(tape_holes) / sizeof(tape_holes[ 0 ])) - 1; i >= 0; i--) {
+ if (tape_holes[ i ] < m_tape_pos) {
+ LOG_0(("next hole rev @%u = %u\n" , m_tape_pos , tape_holes[ i ]));
+ return tape_holes[ i ];
+ }
+ }
+ // No more holes: will hit start of tape
+ return 0;
+ }
+}
+
+attotime hp_taco_device::time_to_distance(tape_pos_t distance) const
+{
+ // +1 for rounding
+ return attotime::from_ticks(distance + 1 , speed_to_tick_freq());
+}
+
+attotime hp_taco_device::time_to_target(tape_pos_t target) const
+{
+ return time_to_distance(abs(target - m_tape_pos));
+}
+
+bool hp_taco_device::start_tape_cmd(UINT16 cmd_reg , UINT16 must_be_1 , UINT16 must_be_0)
+{
+ m_cmd_reg = cmd_reg;
+
+ UINT16 to_be_tested = (m_cmd_reg & CMD_REG_MASK) | (m_status_reg & STATUS_REG_MASK);
+ // Bits in STATUS_ERR_MASK must always be 0
+ must_be_0 |= STATUS_ERR_MASK;
+
+ // It's not an error if the error state is already set (sts false)
+ if (((to_be_tested & (must_be_1 | must_be_0)) ^ must_be_1) != 0) {
+ set_error(true);
+ return false;
+ } else {
+ bool prev_tape_wr = m_tape_wr;
+ bool prev_tape_fwd = m_tape_fwd;
+ bool prev_tape_fast = m_tape_fast;
+ bool not_moving = m_start_time.is_never();
+
+ m_start_time = machine().time();
+ m_tape_wr = (must_be_0 & STATUS_WPR_MASK) != 0;
+ m_tape_fwd = DIR_FWD(m_cmd_reg);
+ m_tape_fast = SPEED_FAST(m_cmd_reg);
+ // TODO: remove?
+ BIT_CLR(m_status_reg, STATUS_HOLE_BIT);
+
+ if (m_tape_wr) {
+ // Write command: disable gap detector
+ m_gap_detect_start = NULL_TAPE_POS;
+ BIT_CLR(m_status_reg, STATUS_GAP_BIT);
+ m_image_dirty = true;
+ } else if (not_moving || prev_tape_wr != m_tape_wr || prev_tape_fwd != m_tape_fwd || prev_tape_fast != m_tape_fast) {
+ // Tape started right now, switched from writing to reading, direction changed or speed changed: (re)start gap detector
+ m_gap_detect_start = m_tape_pos;
+ BIT_CLR(m_status_reg, STATUS_GAP_BIT);
+ }
+ return true;
+ }
+}
+
+void hp_taco_device::stop_tape(void)
+{
+ m_start_time = attotime::never;
+ m_gap_detect_start = NULL_TAPE_POS;
+}
+
+hp_taco_device::tape_track_t& hp_taco_device::current_track(void)
+{
+ return m_tracks[ BIT(m_status_reg , STATUS_TRACKB_BIT) ];
+}
+
+// Return physical length of a 16-bit word on tape
+hp_taco_device::tape_pos_t hp_taco_device::word_length(tape_word_t w)
+{
+ unsigned zeros , ones;
+
+ // pop count of w
+ ones = (w & 0x5555) + ((w >> 1) & 0x5555);
+ ones = (ones & 0x3333) + ((ones >> 2) & 0x3333);
+ ones = (ones & 0x0f0f) + ((ones >> 4) & 0x0f0f);
+ ones = (ones & 0x00ff) + ((ones >> 8) & 0x00ff);
+
+ zeros = 16 - ones;
+
+ return zeros * ZERO_BIT_LEN + (ones + 1) * ONE_BIT_LEN;
+}
+
+hp_taco_device::tape_pos_t hp_taco_device::word_end_pos(const tape_track_t::iterator& it)
+{
+ return it->first + word_length(it->second);
+}
+
+void hp_taco_device::adjust_it(tape_track_t& track , tape_track_t::iterator& it , tape_pos_t pos)
+{
+ if (it != track.begin()) {
+ it--;
+ if (word_end_pos(it) <= pos) {
+ it++;
+ }
+ }
+}
+
+// Write a word on current tape track
+void hp_taco_device::write_word(tape_pos_t start , tape_word_t word , tape_pos_t& length)
+{
+ tape_track_t& track = current_track();
+ tape_track_t::iterator it_low = track.lower_bound(start);
+ adjust_it(track , it_low , start);
+ length = word_length(word);
+ tape_pos_t end_pos = start + length;
+ tape_track_t::iterator it_high = track.lower_bound(end_pos);
+
+ track.erase(it_low , it_high);
+
+ track.insert(it_high , std::make_pair(start, word));
+ LOG_0(("WR %04x @ T%u:%u\n" , word , BIT(m_status_reg , STATUS_TRACKB_BIT) , start));
+}
+
+// Write a gap on current track
+void hp_taco_device::write_gap(tape_pos_t a , tape_pos_t b)
+{
+ ensure_a_lt_b(a , b);
+ tape_track_t& track = current_track();
+ tape_track_t::iterator it_low = track.lower_bound(a);
+ adjust_it(track , it_low , a);
+ tape_track_t::iterator it_high = track.lower_bound(b);
+
+ track.erase(it_low, it_high);
+
+ LOG_0(("GAP on T%u:[%u,%u)\n" , BIT(m_status_reg , STATUS_TRACKB_BIT) , a , b));
+}
+
+bool hp_taco_device::just_gap(tape_pos_t a , tape_pos_t b)
+{
+ ensure_a_lt_b(a , b);
+ tape_track_t& track = current_track();
+ tape_track_t::iterator it_low = track.lower_bound(a);
+ tape_track_t::iterator it_high = track.lower_bound(b);
+
+ adjust_it(track, it_low, a);
+
+ return it_low == it_high;
+}
+
+hp_taco_device::tape_pos_t hp_taco_device::farthest_end(const tape_track_t::iterator& it) const
+{
+ if (m_tape_fwd) {
+ return word_end_pos(it);
+ } else {
+ return it->first;
+ }
+}
+
+bool hp_taco_device::next_data(tape_track_t::iterator& it , tape_pos_t pos , bool inclusive)
+{
+ tape_track_t& track = current_track();
+ it = track.lower_bound(pos);
+ if (m_tape_fwd) {
+ if (inclusive) {
+ adjust_it(track, it, pos);
+ }
+ return it != track.end();
+ } else {
+ // Never more than 2 iterations
+ do {
+ if (it == track.begin()) {
+ it = track.end();
+ return false;
+ }
+ it--;
+ } while (!inclusive && word_end_pos(it) > pos);
+ return true;
+ }
+}
+
+hp_taco_device::adv_res_t hp_taco_device::adv_it(tape_track_t::iterator& it)
+{
+ tape_track_t& track = current_track();
+ if (m_tape_fwd) {
+ tape_pos_t prev_pos = word_end_pos(it);
+ it++;
+ if (it == track.end()) {
+ return ADV_NO_MORE_DATA;
+ } else {
+ adv_res_t res = prev_pos == it->first ? ADV_CONT_DATA : ADV_DISCONT_DATA;
+ return res;
+ }
+ } else {
+ if (it == track.begin()) {
+ it = track.end();
+ return ADV_NO_MORE_DATA;
+ } else {
+ tape_pos_t prev_pos = it->first;
+ it--;
+ return prev_pos == word_end_pos(it) ? ADV_CONT_DATA : ADV_DISCONT_DATA;
+ }
+ }
+}
+
+attotime hp_taco_device::fetch_next_wr_word(void)
+{
+ if (m_data_reg_full) {
+ m_next_word = m_data_reg;
+ m_data_reg_full = false;
+ LOG_0(("next %04x (DR)\n" , m_next_word));
+ } else {
+ // When data register is empty, write checksum word
+ m_next_word = m_checksum_reg;
+ LOG_0(("next %04x (CS)\n" , m_next_word));
+ }
+ // Update checksum with new word
+ m_checksum_reg += m_next_word;
+
+ return time_to_distance(word_length(m_next_word));
+}
+
+attotime hp_taco_device::time_to_rd_next_word(tape_pos_t& word_rd_pos)
+{
+ if (m_rd_it_valid) {
+ word_rd_pos = farthest_end(m_rd_it);
+ return time_to_target(word_rd_pos);
+ } else {
+ return attotime::never;
+ }
+}
+
+/**
+ * Scan for next "n_gaps" gaps
+ *
+ * @param[in,out] pos Start position on input, start of gap on output
+ * @param it Pointer to data word where scan is to start
+ * @param n_gaps Number of gaps to scan
+ * @param min_gap Minimum gap size
+ *
+ * @return true if n_gaps gaps are found
+ */
+bool hp_taco_device::next_n_gap(tape_pos_t& pos , tape_track_t::iterator it , unsigned n_gaps , tape_pos_t min_gap)
+{
+ tape_track_t& track = current_track();
+ bool done = false;
+ tape_track_t::iterator prev_it;
+
+ if (m_tape_fwd) {
+ tape_pos_t next_pos;
+
+ while (1) {
+ if (it == track.end()) {
+ next_pos = TAPE_LENGTH;
+ done = true;
+ } else {
+ next_pos = it->first;
+ }
+ if (((next_pos - pos) >= min_gap && --n_gaps == 0) || done) {
+ break;
+ }
+ adv_res_t adv_res;
+ do {
+ prev_it = it;
+ adv_res = adv_it(it);
+ } while (adv_res == ADV_CONT_DATA);
+ pos = word_end_pos(prev_it);
+ }
+ } else {
+ tape_pos_t next_pos;
+
+ while (1) {
+ if (it == track.end()) {
+ next_pos = 0;
+ done = true;
+ } else {
+ next_pos = word_end_pos(it);
+ }
+ if (((pos - next_pos) >= min_gap && --n_gaps == 0) || done) {
+ break;
+ }
+ adv_res_t adv_res;
+ do {
+ prev_it = it;
+ adv_res = adv_it(it);
+ } while (adv_res == ADV_CONT_DATA);
+ pos = prev_it->first;
+ }
+ }
+
+ // Set "pos" where minimum gap size is met
+ pos_offset(pos , min_gap);
+
+ return n_gaps == 0;
+}
+
+bool hp_taco_device::next_n_gap(tape_pos_t& pos , unsigned n_gaps , tape_pos_t min_gap)
+{
+ tape_track_t::iterator it;
+ // First align with next data
+ next_data(it, pos, true);
+ // Then scan for n_gaps
+ return next_n_gap(pos, it, n_gaps, min_gap);
+}
+
+void hp_taco_device::clear_tape(void)
+{
+ for (unsigned track_n = 0; track_n < 2; track_n++) {
+ m_tracks[ track_n ].clear();
+ }
+}
+
+void hp_taco_device::dump_sequence(tape_track_t::const_iterator it_start , unsigned n_words)
+{
+ if (n_words) {
+ UINT32 tmp32;
+ UINT16 tmp16;
+
+ tmp32 = n_words;
+ fwrite(&tmp32 , sizeof(tmp32));
+ tmp32 = it_start->first;
+ fwrite(&tmp32 , sizeof(tmp32));
+
+ for (unsigned i = 0; i < n_words; i++) {
+ tmp16 = it_start->second;
+ fwrite(&tmp16 , sizeof(tmp16));
+ it_start++;
+ }
+ }
+}
+
+void hp_taco_device::save_tape(void)
+{
+ UINT32 tmp32;
+
+ fseek(0, SEEK_SET);
+
+ tmp32 = FILE_MAGIC;
+ fwrite(&tmp32 , sizeof(tmp32));
+
+ for (unsigned track_n = 0; track_n < 2; track_n++) {
+ const tape_track_t& track = m_tracks[ track_n ];
+ tape_pos_t next_pos = (tape_pos_t)-1;
+ unsigned n_words = 0;
+ tape_track_t::const_iterator it_start;
+ for (tape_track_t::const_iterator it = track.cbegin(); it != track.cend(); it++) {
+ if (it->first != next_pos) {
+ dump_sequence(it_start , n_words);
+ it_start = it;
+ n_words = 0;
+ }
+ next_pos = it->first + word_length(it->second);
+ n_words++;
+ }
+ dump_sequence(it_start , n_words);
+ // End of track
+ tmp32 = (UINT32)-1;
+ fwrite(&tmp32 , sizeof(tmp32));
+ }
+}
+
+bool hp_taco_device::load_track(tape_track_t& track)
+{
+ UINT32 tmp32;
+
+ track.clear();
+
+ while (1) {
+ if (fread(&tmp32 , sizeof(tmp32)) != sizeof(tmp32)) {
+ return false;
+ }
+
+ if (tmp32 == (UINT32)-1) {
+ return true;
+ }
+
+ unsigned n_words = tmp32;
+
+ if (fread(&tmp32 , sizeof(tmp32)) != sizeof(tmp32)) {
+ return false;
+ }
+
+ tape_pos_t pos = (tape_pos_t)tmp32;
+
+ for (unsigned i = 0; i < n_words; i++) {
+ UINT16 tmp16;
+
+ if (fread(&tmp16 , sizeof(tmp16)) != sizeof(tmp16)) {
+ return false;
+ }
+
+ track.insert(std::make_pair(pos , tmp16));
+ pos += word_length(tmp16);
+ }
+ }
+}
+
+bool hp_taco_device::load_tape(void)
+{
+ UINT32 magic;
+
+ if (fread(&magic , sizeof(magic)) != sizeof(magic) ||
+ magic != FILE_MAGIC) {
+ return false;
+ }
+
+ for (unsigned track_n = 0; track_n < 2; track_n++) {
+ if (!load_track(m_tracks[ track_n ])) {
+ LOG(("load_tape failed"));
+ clear_tape();
+ return false;
+ }
+ }
+
+ LOG(("load_tape done\n"));
+ return true;
+}
+
+void hp_taco_device::set_tape_present(bool present)
+{
+ if (present) {
+ if (is_readonly()) {
+ BIT_SET(m_status_reg, STATUS_WPR_BIT);
+ } else {
+ BIT_CLR(m_status_reg, STATUS_WPR_BIT);
+ }
+ // STATUS_CART_OUT_BIT is reset by CMD_CLEAR
+ } else {
+ BIT_SET(m_status_reg, STATUS_CART_OUT_BIT);
+ BIT_SET(m_status_reg, STATUS_WPR_BIT);
+ }
+}
+
+attotime hp_taco_device::time_to_next_hole(void) const
+{
+ return time_to_target(next_hole());
+}
+
+attotime hp_taco_device::time_to_tach_pulses(void) const
+{
+ return time_to_distance((tape_pos_t)(0x10000U - m_tach_reg) * TAPE_POS_FRACT);
+}
+
+void hp_taco_device::start_cmd_exec(UINT16 new_cmd_reg)
+{
+ LOG(("Cmd = %02x\n" , CMD_CODE(new_cmd_reg)));
+
+ update_tape_pos();
+
+ attotime cmd_duration = attotime::never;
+ attotime time_to_hole = attotime::never;
+
+ unsigned new_cmd_code = CMD_CODE(new_cmd_reg);
+
+ if (new_cmd_code != CMD_START_READ &&
+ new_cmd_code != CMD_END_READ &&
+ new_cmd_code != CMD_CLEAR) {
+ m_rd_it_valid = false;
+ }
+
+ switch (new_cmd_code) {
+ case CMD_INDTA_INGAP:
+ // Errors: CART OUT,FAST SPEED
+ if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) {
+ m_cmd_state = 0;
+ if (next_data(m_rd_it , m_tape_pos , true)) {
+ cmd_duration = time_to_target(farthest_end(m_rd_it));
+ }
+ }
+ break;
+
+ case CMD_FINAL_GAP:
+ // Errors: WP,CART OUT
+ if (start_tape_cmd(new_cmd_reg , 0 , STATUS_WPR_MASK)) {
+ m_rw_pos = m_tape_pos;
+ cmd_duration = time_to_distance(END_GAP_LENGTH);
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ case CMD_CLEAR:
+ set_error(false);
+ BIT_CLR(m_status_reg, STATUS_HOLE_BIT);
+ BIT_CLR(m_status_reg, STATUS_CART_OUT_BIT);
+ BIT_CLR(m_status_reg, STATUS_WPR_BIT);
+ set_tape_present(is_loaded());
+ // This is a special command: it doesn't raise IRQ at completion and it
+ // doesn't replace current command
+ return;
+
+ case CMD_NOT_INDTA:
+ // Errors: CART OUT,FAST SPEED
+ if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) {
+ tape_pos_t target = m_tape_pos;
+ if (next_n_gap(target, 1, NO_DATA_GAP)) {
+ LOG_0(("End of data @%d\n" , target));
+ cmd_duration = time_to_target(target);
+ }
+ // Holes detected?
+ }
+ break;
+
+ case CMD_INIT_WRITE:
+ // Errors: WP,CART OUT,fast speed,reverse
+ if (start_tape_cmd(new_cmd_reg , DIR_FWD_MASK , STATUS_WPR_MASK | SPEED_FAST_MASK)) {
+ m_next_word = PREAMBLE_WORD;
+ m_rw_pos = m_tape_pos;
+ cmd_duration = time_to_distance(word_length(m_next_word));
+ }
+ break;
+
+ case CMD_STOP:
+ if (CMD_CODE(m_cmd_reg) != CMD_STOP) {
+ if (m_start_time.is_never()) {
+ // Tape is already stopped
+ cmd_duration = attotime::from_usec(QUICK_CMD_USEC);
+ } else {
+ // Start braking timer
+ cmd_duration = attotime::from_msec(m_tape_fast ? FAST_BRAKE_MSEC : SLOW_BRAKE_MSEC);
+ }
+ m_cmd_reg = new_cmd_reg;
+ } else {
+ // TODO: check if ok
+ return;
+ }
+ break;
+
+ case CMD_SET_TRACK:
+ // Don't know if this command really starts the tape or not (probably it doesn't)
+ if (start_tape_cmd(new_cmd_reg , 0 , 0)) {
+ // When b9 is 0, set track A/B
+ // When b9 is 1, ignore command (in TACO chip it has an unknown purpose)
+ if (!UNKNOWN_B9(new_cmd_reg)) {
+ if (CMD_OPT(new_cmd_reg)) {
+ BIT_SET(m_status_reg, STATUS_TRACKB_BIT);
+ } else {
+ BIT_CLR(m_status_reg, STATUS_TRACKB_BIT);
+ }
+ }
+ cmd_duration = attotime::from_usec(QUICK_CMD_USEC);
+ }
+ break;
+
+ case CMD_MOVE:
+ if (start_tape_cmd(new_cmd_reg , 0 , 0)) {
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ case CMD_INGAP_MOVE:
+ // Errors: CART OUT,FAST SPEED
+ if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) {
+ m_cmd_state = 0;
+ tape_pos_t target = m_tape_pos;
+ if (next_n_gap(target, 1, MIN_IRG_LENGTH)) {
+ LOG_0(("IRG @%d\n" , target));
+ cmd_duration = time_to_target(target);
+ }
+ // Holes detected?
+ }
+ break;
+
+ case CMD_WRITE_IRG:
+ // Errors: WP,CART OUT
+ if (start_tape_cmd(new_cmd_reg , 0 , STATUS_WPR_MASK)) {
+ m_rw_pos = m_tape_pos;
+ cmd_duration = time_to_tach_pulses();
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ case CMD_SCAN_RECORDS:
+ // Errors: CART OUT
+ if (start_tape_cmd(new_cmd_reg , 0 , 0)) {
+ m_cmd_state = 0;
+ if (next_data(m_rd_it , m_tape_pos , true)) {
+ cmd_duration = time_to_target(farthest_end(m_rd_it));
+ }
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ case CMD_RECORD_WRITE:
+ // Errors: WP,CART OUT,fast speed,reverse
+ if (start_tape_cmd(new_cmd_reg , DIR_FWD_MASK , STATUS_WPR_MASK | SPEED_FAST_MASK)) {
+ // Search for preamble first
+ m_cmd_state = 0;
+ m_rd_it_valid = next_data(m_rd_it , m_tape_pos , false);
+ cmd_duration = time_to_rd_next_word(m_rw_pos);
+ // Holes detected?
+ }
+ break;
+
+ case CMD_MOVE_INDTA:
+ // Errors: CART OUT,FAST SPEED
+ if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) {
+ m_cmd_state = 0;
+ cmd_duration = time_to_tach_pulses();
+ // Holes detected?
+ }
+ break;
+
+ case CMD_UNK_1b:
+ if (start_tape_cmd(new_cmd_reg , 0 , 0)) {
+ // Unknown purpose, but make it a NOP (it's used in "T" test of test ROM)
+ cmd_duration = attotime::from_usec(QUICK_CMD_USEC);
+ }
+ break;
+
+ case CMD_DELTA_MOVE_HOLE:
+ case CMD_DELTA_MOVE_IRG:
+ if (start_tape_cmd(new_cmd_reg , 0 , 0)) {
+ cmd_duration = time_to_tach_pulses();
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ case CMD_START_READ:
+ // Yes, you can read tape backwards: test "C" does that!
+ // Because of this DIR_FWD_MASK is not in the "must be 1" mask.
+ if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) {
+ // TODO: check anche m_rw_pos sforato
+ if (!m_rd_it_valid) {
+ // Search for preamble first
+ m_cmd_state = 0;
+ m_rd_it_valid = next_data(m_rd_it , m_tape_pos , false);
+ }
+
+ cmd_duration = time_to_rd_next_word(m_rw_pos);
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ case CMD_END_READ:
+ // This command only makes sense after CMD_START_READ
+ if (CMD_CODE(m_cmd_reg) == CMD_START_READ && m_cmd_state == 1 &&
+ start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) {
+ LOG_0(("END_READ %d\n" , m_rd_it_valid));
+ cmd_duration = time_to_rd_next_word(m_rw_pos);
+ time_to_hole = time_to_next_hole();
+ }
+ break;
+
+ default:
+ LOG(("Unrecognized command\n"));
+ break;
+ }
+
+ m_tape_timer->adjust(cmd_duration);
+ m_hole_timer->adjust(time_to_hole);
+}
+
+bool hp_taco_device::call_load()
+{
+ LOG(("call_load %d\n" , has_been_created()));
+ if (has_been_created()) {
+ clear_tape();
+ save_tape();
+ } else if (!load_tape()) {
+ seterror(IMAGE_ERROR_INVALIDIMAGE , "Wrong format");
+ set_tape_present(false);
+ return IMAGE_INIT_FAIL;
+ }
+
+ m_image_dirty = false;
+
+ set_tape_present(true);
+ return IMAGE_INIT_PASS;
+}
+
+bool hp_taco_device::call_create(int format_type, option_resolution *format_options)
+{
+ LOG(("call_create %d\n" , has_been_created()));
+ return call_load();
+}
+
+void hp_taco_device::call_unload()
+{
+ LOG(("call_unload dirty=%d\n" , m_image_dirty));
+ if (m_image_dirty) {
+ save_tape();
+ m_image_dirty = false;
+ }
+
+ clear_tape();
+ set_tape_present(false);
+}
+
+const char *hp_taco_device::file_extensions() const
+{
+ return "hti";
+}
diff --git a/src/devices/machine/hp_taco.h b/src/devices/machine/hp_taco.h
new file mode 100644
index 00000000000..c8b794c79a2
--- /dev/null
+++ b/src/devices/machine/hp_taco.h
@@ -0,0 +1,169 @@
+// license:BSD-3-Clause
+// copyright-holders:F. Ulivi
+/*********************************************************************
+
+ hp_taco.h
+
+ HP TApe COntroller (5006-3012)
+
+*********************************************************************/
+
+#ifndef __HP_TACO_H__
+#define __HP_TACO_H__
+
+#include <map>
+
+#define MCFG_TACO_IRQ_HANDLER(_devcb) \
+ devcb = &hp_taco_device::set_irq_handler(*device , DEVCB_##_devcb);
+
+#define MCFG_TACO_FLG_HANDLER(_devcb) \
+ devcb = &hp_taco_device::set_flg_handler(*device , DEVCB_##_devcb);
+
+#define MCFG_TACO_STS_HANDLER(_devcb) \
+ devcb = &hp_taco_device::set_sts_handler(*device , DEVCB_##_devcb);
+
+class hp_taco_device : public device_t ,
+ public device_image_interface
+{
+public:
+ // construction/destruction
+ hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
+ hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // static configuration helpers
+ template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast<hp_taco_device &>(device).m_irq_handler.set_callback(object); }
+ template<class _Object> static devcb_base &set_flg_handler(device_t &device, _Object object) { return downcast<hp_taco_device &>(device).m_flg_handler.set_callback(object); }
+ template<class _Object> static devcb_base &set_sts_handler(device_t &device, _Object object) { return downcast<hp_taco_device &>(device).m_sts_handler.set_callback(object); }
+
+ // Register read/write
+ DECLARE_WRITE16_MEMBER(reg_w);
+ DECLARE_READ16_MEMBER(reg_r);
+
+ // Flag & status read
+ DECLARE_READ_LINE_MEMBER(flg_r);
+ DECLARE_READ_LINE_MEMBER(sts_r);
+
+ // device_image_interface overrides
+ virtual bool call_load() override;
+ virtual bool call_create(int format_type, option_resolution *format_options) override;
+ virtual void call_unload() override;
+ virtual iodevice_t image_type() const override { return IO_MAGTAPE; }
+ virtual bool is_readable() const override { return true; }
+ virtual bool is_writeable() const override { return true; }
+ virtual bool is_creatable() const override { return true; }
+ virtual bool must_be_loaded() const override { return false; }
+ virtual bool is_reset_on_load() const override { return false; }
+ virtual const char *file_extensions() const override;
+ virtual const option_guide *create_option_guide() const override { return nullptr; }
+
+ // Tape position, 1 unit = 1 inch / (968 * 1024)
+ typedef INT32 tape_pos_t;
+
+ // Words stored on tape
+ typedef UINT16 tape_word_t;
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() override;
+ virtual void device_start() override;
+ virtual void device_stop() override;
+ virtual void device_reset() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+private:
+ // Storage of tracks: mapping from a tape position to word stored there
+ typedef std::map<tape_pos_t , tape_word_t> tape_track_t;
+
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_flg_handler;
+ devcb_write_line m_sts_handler;
+
+ // Registers
+ UINT16 m_data_reg;
+ bool m_data_reg_full;
+ UINT16 m_cmd_reg;
+ UINT16 m_status_reg;
+ UINT16 m_tach_reg;
+ UINT16 m_checksum_reg;
+ UINT16 m_timing_reg;
+
+ // State
+ bool m_irq;
+ bool m_flg;
+ bool m_sts;
+ UINT8 m_cmd_state;
+
+ // Tape position & motion
+ tape_pos_t m_tape_pos;
+ attotime m_start_time; // Tape moving if != never
+ bool m_tape_fwd;
+ bool m_tape_fast;
+
+ // Timers
+ emu_timer *m_tape_timer;
+ emu_timer *m_hole_timer;
+
+ // Content of tape tracks
+ tape_track_t m_tracks[ 2 ];
+ bool m_image_dirty;
+
+ // Reading & writing
+ bool m_tape_wr;
+ tape_pos_t m_rw_pos;
+ UINT16 m_next_word;
+ tape_track_t::iterator m_rd_it;
+ bool m_rd_it_valid;
+
+ // Gap detection
+ tape_pos_t m_gap_detect_start;
+
+ typedef enum {
+ ADV_NO_MORE_DATA,
+ ADV_CONT_DATA,
+ ADV_DISCONT_DATA
+ } adv_res_t;
+
+ void clear_state(void);
+ void irq_w(bool state);
+ void set_error(bool state);
+ unsigned speed_to_tick_freq(void) const;
+ bool pos_offset(tape_pos_t& pos , tape_pos_t offset) const;
+ void move_tape_pos(tape_pos_t delta_pos);
+ void update_tape_pos(void);
+ static void ensure_a_lt_b(tape_pos_t& a , tape_pos_t& b);
+ static bool any_hole(tape_pos_t tape_pos_a , tape_pos_t tape_pos_b);
+ tape_pos_t next_hole(void) const;
+ attotime time_to_distance(tape_pos_t distance) const;
+ attotime time_to_target(tape_pos_t target) const;
+ bool start_tape_cmd(UINT16 cmd_reg , UINT16 must_be_1 , UINT16 must_be_0);
+ void start_tape(UINT16 cmd_reg);
+ void stop_tape(void);
+ tape_track_t& current_track(void);
+ static tape_pos_t word_length(tape_word_t w);
+ static tape_pos_t word_end_pos(const tape_track_t::iterator& it);
+ static void adjust_it(tape_track_t& track , tape_track_t::iterator& it , tape_pos_t pos);
+ void write_word(tape_pos_t start , tape_word_t word , tape_pos_t& length);
+ void write_gap(tape_pos_t a , tape_pos_t b);
+ bool just_gap(tape_pos_t a , tape_pos_t b);
+ tape_pos_t farthest_end(const tape_track_t::iterator& it) const;
+ bool next_data(tape_track_t::iterator& it , tape_pos_t pos , bool inclusive);
+ adv_res_t adv_it(tape_track_t::iterator& it);
+ attotime fetch_next_wr_word(void);
+ attotime time_to_rd_next_word(tape_pos_t& word_rd_pos);
+ bool next_n_gap(tape_pos_t& pos , tape_track_t::iterator it , unsigned n_gaps , tape_pos_t min_gap);
+ bool next_n_gap(tape_pos_t& pos , unsigned n_gaps , tape_pos_t min_gap);
+ void clear_tape(void);
+ void dump_sequence(tape_track_t::const_iterator it_start , unsigned n_words);
+ void save_tape(void);
+ bool load_track(tape_track_t& track);
+ bool load_tape(void);
+ void set_tape_present(bool present);
+ attotime time_to_next_hole(void) const;
+ attotime time_to_tach_pulses(void) const;
+ void start_cmd_exec(UINT16 new_cmd_reg);
+};
+
+// device type definition
+extern const device_type HP_TACO;
+
+#endif /* __HP_TACO_H__ */
diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp
index 23548f1ecd7..32d4d2c3c63 100644
--- a/src/devices/video/upd7220.cpp
+++ b/src/devices/video/upd7220.cpp
@@ -71,7 +71,8 @@ enum
COMMAND_LPRD,
COMMAND_DMAR,
COMMAND_DMAW,
- COMMAND_5A
+ COMMAND_5A,
+ COMMAND_05
};
enum
@@ -93,6 +94,7 @@ enum
#define UPD7220_COMMAND_CCHAR 0x4b
#define UPD7220_COMMAND_START 0x6b
#define UPD7220_COMMAND_BCTRL 0x0c // & 0xfe
+#define UPD7220_COMMAND_05 0x05
#define UPD7220_COMMAND_ZOOM 0x46
#define UPD7220_COMMAND_CURS 0x49
#define UPD7220_COMMAND_PRAM 0x70 // & 0xf0
@@ -1049,6 +1051,7 @@ int upd7220_device::translate_command(UINT8 data)
case UPD7220_COMMAND_CURD: command = COMMAND_CURD; break;
case UPD7220_COMMAND_LPRD: command = COMMAND_LPRD; break;
case UPD7220_COMMAND_5A: command = COMMAND_5A; break;
+ case UPD7220_COMMAND_05: command = COMMAND_05; break;
default:
switch (data & 0xfe)
{
@@ -1226,6 +1229,10 @@ void upd7220_device::process_fifo()
//LOG(("uPD7220 '%s' DE: 1\n", tag()));
break;
+ case COMMAND_05:
+ m_de = 0;
+ break;
+
case COMMAND_BCTRL: /* display blanking control */
m_de = m_cr & 0x01;
diff --git a/src/emu/clifront.cpp b/src/emu/clifront.cpp
index a016d13a031..6b75841df83 100644
--- a/src/emu/clifront.cpp
+++ b/src/emu/clifront.cpp
@@ -89,7 +89,6 @@ cli_frontend::~cli_frontend()
m_options.remove_device_options();
}
-
//-------------------------------------------------
// execute - execute a game via the standard
// command line interface
@@ -99,6 +98,8 @@ int cli_frontend::execute(int argc, char **argv)
{
// wrap the core execution in a try/catch to field all fatal errors
m_result = MAMERR_NONE;
+ machine_manager *manager = machine_manager::instance(m_options, m_osd);
+
try
{
// first parse options to be able to get software from it
@@ -106,6 +107,11 @@ int cli_frontend::execute(int argc, char **argv)
m_options.parse_command_line(argc, argv, option_errors);
m_options.parse_standard_inis(option_errors);
+
+ //load_translation();
+ load_translation(m_options);
+
+ manager->start_luaengine();
if (*(m_options.software_name()) != 0)
{
@@ -211,9 +217,7 @@ int cli_frontend::execute(int argc, char **argv)
throw emu_fatalerror(MAMERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
// otherwise just run the game
- machine_manager *manager = machine_manager::instance(m_options, m_osd);
m_result = manager->execute();
- global_free(manager);
}
}
@@ -236,7 +240,7 @@ int cli_frontend::execute(int argc, char **argv)
// print them out
osd_printf_error("\n\"%s\" approximately matches the following\n"
- "supported %s (best match first):\n\n", m_options.system_name(),emulator_info::get_gamesnoun());
+ "supported machines (best match first):\n\n", m_options.system_name());
for (auto & matche : matches)
if (matche != -1)
osd_printf_error("%-18s%s\n", drivlist.driver(matche).name, drivlist.driver(matche).description);
@@ -264,6 +268,7 @@ int cli_frontend::execute(int argc, char **argv)
}
_7z_file_cache_clear();
+ global_free(manager);
return m_result;
}
@@ -1588,7 +1593,7 @@ void cli_frontend::execute_commands(const char *exename)
// showusage?
if (strcmp(m_options.command(), CLICOMMAND_SHOWUSAGE) == 0)
{
- emulator_info::printf_usage(exename, emulator_info::get_gamenoun());
+ osd_printf_info("Usage: %s [machine] [media] [software] [options]",exename);
osd_printf_info("\n\nOptions:\n%s", m_options.output_help().c_str());
return;
}
@@ -1690,8 +1695,10 @@ void cli_frontend::execute_commands(const char *exename)
void cli_frontend::display_help()
{
osd_printf_info("%s v%s\n%s\n\n", emulator_info::get_appname(),build_version,emulator_info::get_copyright_info());
- osd_printf_info("%s\n", emulator_info::get_disclaimer());
- emulator_info::printf_usage(emulator_info::get_appname(),emulator_info::get_gamenoun());
+ osd_printf_info("This software reproduces, more or less faithfully, the behaviour of a wide range\n"
+ "of machines. But hardware is useless without software, so images of the ROMs and\n"
+ "other media which run on that hardware are also required.\n\n");
+ osd_printf_info("Usage: %s [machine] [media] [software] [options]",emulator_info::get_appname());
osd_printf_info("\n\n"
" %s -showusage for a brief list of options\n"
" %s -showconfig for a list of configuration options\n"
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 293657b1f45..c4686c5566f 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -19,6 +19,7 @@
#include "uiinput.h"
#include "xmlfile.h"
#include "coreutil.h"
+#include "luaengine.h"
#include <ctype.h>
@@ -1928,6 +1929,8 @@ void device_debug::instruction_hook(offs_t curpc)
// flush any pending updates before waiting again
machine.debug_view().flush_osd_updates();
+ machine.manager().lua()->periodic_check();
+
// clear the memory modified flag and wait
global->memory_modified = false;
if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
diff --git a/src/emu/emu.h b/src/emu/emu.h
index 4e78d67282f..d45c08b3fef 100644
--- a/src/emu/emu.h
+++ b/src/emu/emu.h
@@ -92,6 +92,7 @@ typedef device_t * (*machine_config_constructor)(machine_config &config, device_
// the running machine
#include "mame.h"
+#include "language.h"
#include "machine.h"
#include "driver.h"
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp
index f5d014750b2..1fb827ed1a6 100644
--- a/src/emu/emuopts.cpp
+++ b/src/emu/emuopts.cpp
@@ -43,6 +43,8 @@ const options_entry emu_options::s_option_entries[] =
{ OPTION_FONTPATH, ".", OPTION_STRING, "path to font files" },
{ OPTION_CHEATPATH, "cheat", OPTION_STRING, "path to cheat files" },
{ OPTION_CROSSHAIRPATH, "crosshair", OPTION_STRING, "path to crosshair files" },
+ { OPTION_PLUGINSPATH, "plugins", OPTION_STRING, "path to plugin files" },
+ { OPTION_LANGUAGEPATH, "language", OPTION_STRING, "path to language files" },
// output directory options
{ nullptr, nullptr, OPTION_HEADER, "CORE OUTPUT DIRECTORY OPTIONS" },
@@ -181,12 +183,17 @@ const options_entry emu_options::s_option_entries[] =
{ OPTION_DRC_LOG_NATIVE, "0", OPTION_BOOLEAN, "write DRC native disassembly log" },
{ OPTION_BIOS, nullptr, OPTION_STRING, "select the system BIOS to use" },
{ OPTION_CHEAT ";c", "0", OPTION_BOOLEAN, "enable cheat subsystem" },
+ { OPTION_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" },
+ { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" },
{ OPTION_UI, "cabinet", OPTION_STRING, "type of UI (simple|cabinet)" },
{ OPTION_RAMSIZE ";ram", nullptr, OPTION_STRING, "size of RAM (if supported by driver)" },
+ { OPTION_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" },
+ { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" },
{ OPTION_AUTOBOOT_COMMAND ";ab", nullptr, OPTION_STRING, "command to execute after machine boot" },
{ OPTION_AUTOBOOT_DELAY, "2", OPTION_INTEGER, "timer delay in sec to trigger command execution on autoboot" },
{ OPTION_AUTOBOOT_SCRIPT ";script", nullptr, OPTION_STRING, "lua script to execute after machine boot" },
{ OPTION_CONSOLE, "0", OPTION_BOOLEAN, "enable emulator LUA console" },
+ { OPTION_LANGUAGE ";lang", "English", OPTION_STRING, "display language" },
{ nullptr }
};
diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h
index 916a0f263f5..85e054a4c43 100644
--- a/src/emu/emuopts.h
+++ b/src/emu/emuopts.h
@@ -56,6 +56,8 @@ enum
#define OPTION_FONTPATH "fontpath"
#define OPTION_CHEATPATH "cheatpath"
#define OPTION_CROSSHAIRPATH "crosshairpath"
+#define OPTION_PLUGINSPATH "pluginspath"
+#define OPTION_LANGUAGEPATH "languagepath"
// core directory options
#define OPTION_CFG_DIRECTORY "cfg_directory"
@@ -174,6 +176,8 @@ enum
#define OPTION_DRC_LOG_NATIVE "drc_log_native"
#define OPTION_BIOS "bios"
#define OPTION_CHEAT "cheat"
+#define OPTION_SKIP_GAMEINFO "skip_gameinfo"
+#define OPTION_UI_FONT "uifont"
#define OPTION_UI "ui"
#define OPTION_RAMSIZE "ramsize"
@@ -183,12 +187,17 @@ enum
#define OPTION_COMM_REMOTE_HOST "comm_remotehost"
#define OPTION_COMM_REMOTE_PORT "comm_remoteport"
+#define OPTION_CONFIRM_QUIT "confirm_quit"
+#define OPTION_UI_MOUSE "ui_mouse"
+
#define OPTION_AUTOBOOT_COMMAND "autoboot_command"
#define OPTION_AUTOBOOT_DELAY "autoboot_delay"
#define OPTION_AUTOBOOT_SCRIPT "autoboot_script"
#define OPTION_CONSOLE "console"
+#define OPTION_LANGUAGE "language"
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -231,6 +240,8 @@ public:
const char *font_path() const { return value(OPTION_FONTPATH); }
const char *cheat_path() const { return value(OPTION_CHEATPATH); }
const char *crosshair_path() const { return value(OPTION_CROSSHAIRPATH); }
+ const char *plugins_path() const { return value(OPTION_PLUGINSPATH); }
+ const char *language_path() const { return value(OPTION_LANGUAGEPATH); }
// core directory options
const char *cfg_directory() const { return value(OPTION_CFG_DIRECTORY); }
@@ -347,6 +358,8 @@ public:
bool drc_log_native() const { return bool_value(OPTION_DRC_LOG_NATIVE); }
const char *bios() const { return value(OPTION_BIOS); }
bool cheat() const { return bool_value(OPTION_CHEAT); }
+ bool skip_gameinfo() const { return bool_value(OPTION_SKIP_GAMEINFO); }
+ const char *ui_font() const { return value(OPTION_UI_FONT); }
const char *ui() const { return value(OPTION_UI); }
const char *ram_size() const { return value(OPTION_RAMSIZE); }
@@ -356,11 +369,17 @@ public:
const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); }
const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); }
+
+ bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); }
+ bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); }
+
const char *autoboot_command() const { return value(OPTION_AUTOBOOT_COMMAND); }
int autoboot_delay() const { return int_value(OPTION_AUTOBOOT_DELAY); }
const char *autoboot_script() const { return value(OPTION_AUTOBOOT_SCRIPT); }
bool console() const { return bool_value(OPTION_CONSOLE); }
+
+ const char *language() const { return value(OPTION_LANGUAGE); }
// FIXME: Couriersud: This should be in image_device_exit
void remove_device_options();
diff --git a/src/emu/info.cpp b/src/emu/info.cpp
index 21c98853adc..111022ae223 100644
--- a/src/emu/info.cpp
+++ b/src/emu/info.cpp
@@ -19,6 +19,9 @@
#include <ctype.h>
+#define XML_ROOT "mame"
+#define XML_TOP "machine"
+
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
@@ -195,8 +198,8 @@ void info_xml_creator::output(FILE *out, bool nodevices)
// output the DTD
fprintf(m_output, "<?xml version=\"1.0\"?>\n");
std::string dtd(s_dtd_string);
- strreplace(dtd, "__XML_ROOT__", emulator_info::get_xml_root());
- strreplace(dtd, "__XML_TOP__", emulator_info::get_xml_top());
+ strreplace(dtd, "__XML_ROOT__", XML_ROOT);
+ strreplace(dtd, "__XML_TOP__", XML_TOP);
fprintf(m_output, "%s\n\n", dtd.c_str());
@@ -208,7 +211,7 @@ void info_xml_creator::output(FILE *out, bool nodevices)
"no"
#endif
"\" mameconfig=\"%d\">\n",
- emulator_info::get_xml_root(),
+ XML_ROOT,
xml_normalize_string(build_version),
CONFIG_VERSION
);
@@ -222,7 +225,7 @@ void info_xml_creator::output(FILE *out, bool nodevices)
output_devices();
// close the top level tag
- fprintf(m_output, "</%s>\n",emulator_info::get_xml_root());
+ fprintf(m_output, "</%s>\n",XML_ROOT);
}
@@ -247,7 +250,7 @@ void info_xml_creator::output_one()
portlist.append(*device, errors);
// print the header and the game name
- fprintf(m_output, "\t<%s",emulator_info::get_xml_top());
+ fprintf(m_output, "\t<%s",XML_TOP);
fprintf(m_output, " name=\"%s\"", xml_normalize_string(driver.name));
// strip away any path information from the source_file and output it
@@ -309,7 +312,7 @@ void info_xml_creator::output_one()
output_ramoptions();
// close the topmost tag
- fprintf(m_output, "\t</%s>\n",emulator_info::get_xml_top());
+ fprintf(m_output, "\t</%s>\n",XML_TOP);
}
@@ -341,7 +344,7 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
}
// start to output info
- fprintf(m_output, "\t<%s", emulator_info::get_xml_top());
+ fprintf(m_output, "\t<%s", XML_TOP);
fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
std::string src(device.source());
strreplace(src,"../", "");
@@ -368,7 +371,7 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
output_adjusters(portlist);
output_images(device, devtag);
output_slots(device, devtag);
- fprintf(m_output, "\t</%s>\n", emulator_info::get_xml_top());
+ fprintf(m_output, "\t</%s>\n", XML_TOP);
}
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index 17e11748df1..a898a10051b 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -3424,7 +3424,7 @@ time_t ioport_manager::playback_init()
// verify the header against the current game
if (memcmp(machine().system().name, header + 0x14, strlen(machine().system().name) + 1) != 0)
- osd_printf_info("Input file is for %s '%s', not for current %s '%s'\n", emulator_info::get_gamenoun(), header + 0x14, emulator_info::get_gamenoun(), machine().system().name);
+ osd_printf_info("Input file is for machine '%s', not for current machine '%s'\n", header + 0x14, machine().system().name);
// enable compression
m_playback_file.compress(FCOMPRESS_MEDIUM);
diff --git a/src/emu/language.cpp b/src/emu/language.cpp
new file mode 100644
index 00000000000..23a2d251fab
--- /dev/null
+++ b/src/emu/language.cpp
@@ -0,0 +1,78 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ language.cpp
+
+ Multi-language support.
+
+***************************************************************************/
+
+#include "emu.h"
+
+static std::unordered_map<std::string, std::string> g_translation;
+
+const char *lang_translate(const char *word)
+{
+ if (g_translation.find(word) == g_translation.end())
+ {
+ return word;
+ }
+ return g_translation[word].c_str();
+}
+
+const UINT32 MO_MAGIC = 0x950412de;
+const UINT32 MO_MAGIC_REVERSED = 0xde120495;
+
+inline UINT32 endianchange(UINT32 value) {
+ UINT32 b0 = (value >> 0) & 0xff;
+ UINT32 b1 = (value >> 8) & 0xff;
+ UINT32 b2 = (value >> 16) & 0xff;
+ UINT32 b3 = (value >> 24) & 0xff;
+
+ return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3;
+}
+
+void load_translation(emu_options &m_options)
+{
+ g_translation.clear();
+ emu_file file(m_options.language_path(), OPEN_FLAG_READ);
+ auto name = std::string(m_options.language());
+ strreplace(name, " ", "_");
+ strreplace(name, "(", "");
+ strreplace(name, ")", "");
+ if (file.open(name.c_str(), PATH_SEPARATOR "strings.mo") == FILERR_NONE)
+ {
+ UINT64 size = file.size();
+ UINT32 *buffer = global_alloc_array(UINT32, size / 4 + 1);
+ file.read(buffer, size);
+ file.close();
+
+ if (buffer[0] != MO_MAGIC && buffer[0] != MO_MAGIC_REVERSED)
+ {
+ global_free_array(buffer);
+ return;
+ }
+ if (buffer[0] == MO_MAGIC_REVERSED)
+ {
+ for (auto i = 0; i < (size / 4) + 1; ++i)
+ {
+ buffer[i] = endianchange(buffer[i]);
+ }
+ }
+
+ UINT32 number_of_strings = buffer[2];
+ UINT32 original_table_offset = buffer[3] >> 2;
+ UINT32 translation_table_offset = buffer[4] >> 2;
+
+ const char *data = reinterpret_cast<const char*>(buffer);
+
+ for (auto i = 1; i < number_of_strings; ++i)
+ {
+ std::string original = (const char *)data + buffer[original_table_offset + 2 * i + 1];
+ std::string translation = (const char *)data + buffer[translation_table_offset + 2 * i + 1];
+ g_translation.insert(std::pair<std::string, std::string>(original, translation));
+ }
+ global_free_array(buffer);
+ }
+} \ No newline at end of file
diff --git a/src/emu/language.h b/src/emu/language.h
new file mode 100644
index 00000000000..ce536531d89
--- /dev/null
+++ b/src/emu/language.h
@@ -0,0 +1,32 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ language.h
+
+ Multi-language support.
+
+***************************************************************************/
+#pragma once
+
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
+#ifndef __LANGUAGE_H__
+#define __LANGUAGE_H__
+
+//**************************************************************************
+// LOCALIZATION SUPPORT
+//**************************************************************************
+
+#define _(param) lang_translate(param)
+// Fake one to make possible using it in static text definitions, on those
+// lang_translate must be called afterwards
+#define __(param) param
+
+void load_translation(emu_options &option);
+const char *lang_translate(const char *word);
+
+#endif /*__LANGUAGE_H__*/
+
diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp
index c4136cd744a..990f417eac4 100644
--- a/src/emu/luaengine.cpp
+++ b/src/emu/luaengine.cpp
@@ -14,10 +14,12 @@
#include "luabridge/Source/LuaBridge/LuaBridge.h"
#include <signal.h>
#include "emu.h"
+#include "cheat.h"
#include "drivenum.h"
#include "ui/ui.h"
#include "luaengine.h"
#include <mutex>
+#include "libuv/include/uv.h"
//**************************************************************************
// LUA ENGINE
@@ -46,6 +48,10 @@ lua_engine* lua_engine::luaThis = nullptr;
extern "C" {
int luaopen_lsqlite3(lua_State *L);
+ int luaopen_zlib(lua_State *L);
+ int luaopen_luv(lua_State *L);
+ int luaopen_lfs(lua_State *L);
+ uv_loop_t* luv_loop(lua_State* L);
}
static void lstop(lua_State *L, lua_Debug *ar)
@@ -369,6 +375,38 @@ void lua_engine::emu_set_hook(lua_State *L)
}
//-------------------------------------------------
+// options_entry - return table of option entries
+// -> manager:options().entries
+// -> manager:machine():options().entries
+// -> manager:machine():ui():options().entries
+//-------------------------------------------------
+
+template <typename T>
+luabridge::LuaRef lua_engine::l_options_get_entries(const T *o)
+{
+ T *options = const_cast<T *>(o);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef entries_table = luabridge::LuaRef::newTable(L);
+
+ int unadorned_index = 0;
+ for (typename T::entry *curentry = options->first(); curentry != nullptr; curentry = curentry->next())
+ {
+ const char *name = curentry->name();
+ bool is_unadorned = false;
+ // check if it's unadorned
+ if (name && strlen(name) && !strcmp(name, options->unadorned(unadorned_index)))
+ {
+ unadorned_index++;
+ is_unadorned = true;
+ }
+ if (!curentry->is_header() && !curentry->is_command() && !curentry->is_internal() && !is_unadorned)
+ entries_table[name] = curentry;
+ }
+
+ return entries_table;
+}
+
+//-------------------------------------------------
// machine_get_screens - return table of available screens userdata
// -> manager:machine().screens[":screen"]
//-------------------------------------------------
@@ -405,6 +443,103 @@ luabridge::LuaRef lua_engine::l_machine_get_devices(const running_machine *r)
return devs_table;
}
+//-------------------------------------------------
+// machine_cheat_entries - return cheat entries
+// -> manager:machine():cheat().entries[0]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_cheat_get_entries(const cheat_manager *c)
+{
+ cheat_manager *cm = const_cast<cheat_manager *>(c);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef entry_table = luabridge::LuaRef::newTable(L);
+
+ int cheatnum = 0;
+ for (cheat_entry *entry = cm->first(); entry != nullptr; entry = entry->next()) {
+ entry_table[cheatnum++] = entry;
+ }
+
+ return entry_table;
+}
+
+//-------------------------------------------------
+// cheat_entry_state - return cheat entry state
+// -> manager:machine():cheat().entries[0]:state()
+//-------------------------------------------------
+
+int lua_engine::lua_cheat_entry::l_get_state(lua_State *L)
+{
+ cheat_entry *ce = luabridge::Stack<cheat_entry *>::get(L, 1);
+
+ switch (ce->state())
+ {
+ case SCRIPT_STATE_ON: lua_pushliteral(L, "on"); break;
+ case SCRIPT_STATE_RUN: lua_pushliteral(L, "run"); break;
+ case SCRIPT_STATE_CHANGE: lua_pushliteral(L, "change"); break;
+ case SCRIPT_STATE_COUNT: lua_pushliteral(L, "count"); break;
+ default: lua_pushliteral(L, "off"); break;
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// machine_ioports - return table of ioports
+// -> manager:machine():ioport().ports[':P1']
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_ioport_get_ports(const ioport_manager *m)
+{
+ ioport_manager *im = const_cast<ioport_manager *>(m);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef port_table = luabridge::LuaRef::newTable(L);
+ ioport_port *port;
+
+ for (port = im->first_port(); port != nullptr; port = port->next()) {
+ port_table[port->tag()] = port;
+ }
+
+ return port_table;
+}
+
+//-------------------------------------------------
+// ioport_fields - return table of ioport fields
+// -> manager:machine().ioport().ports[':P1'].fields[':']
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_ioports_port_get_fields(const ioport_port *i)
+{
+ ioport_port *p = const_cast<ioport_port *>(i);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef f_table = luabridge::LuaRef::newTable(L);
+ ioport_field *field;
+
+ for (field = p->first_field(); field != nullptr; field = field->next()) {
+ f_table[field->name()] = field;
+ }
+
+ return f_table;
+}
+
+//-------------------------------------------------
+// render_get_targets - return table of render targets
+// -> manager:machine():render().targets[0]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_render_get_targets(const render_manager *r)
+{
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef target_table = luabridge::LuaRef::newTable(L);
+
+ int tc = 0;
+ for (render_target *curr_rt = r->first_target(); curr_rt != nullptr; curr_rt = curr_rt->next())
+ {
+ target_table[tc++] = curr_rt;
+ }
+
+ return target_table;
+}
+
// private helper for get_devices - DFS visit all devices in a running machine
luabridge::LuaRef lua_engine::devtree_dfs(device_t *root, luabridge::LuaRef devs_table)
{
@@ -586,6 +721,98 @@ int lua_engine::lua_addr_space::l_mem_write(lua_State *L)
return 0;
}
+int lua_engine::lua_options_entry::l_entry_value(lua_State *L)
+{
+ core_options::entry *e = luabridge::Stack<core_options::entry *>::get(L, 1);
+ if(!e) {
+ return 0;
+ }
+
+ luaL_argcheck(L, !lua_isfunction(L, 2), 2, "optional argument: unsupported value");
+
+ if (!lua_isnone(L, 2))
+ {
+ std::string error;
+ // FIXME: not working with ui_options::entry
+ // TODO: optional arg for priority
+ luaThis->machine().options().set_value(e->name(),
+ lua_isboolean(L, 2) ? (lua_toboolean(L, 2) ? "1" : "0") : lua_tostring(L, 2),
+ OPTION_PRIORITY_CMDLINE, error);
+
+ if (!error.empty())
+ {
+ luaL_error(L, "%s", error.c_str());
+ }
+ }
+
+ switch (e->type())
+ {
+ case OPTION_BOOLEAN:
+ lua_pushboolean(L, (atoi(e->value()) != 0));
+ break;
+ case OPTION_INTEGER:
+ lua_pushnumber(L, atoi(e->value()));
+ break;
+ case OPTION_FLOAT:
+ lua_pushnumber(L, atof(e->value()));
+ break;
+ default:
+ lua_pushstring(L, e->value());
+ break;
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// begin_recording - start avi
+// -> manager:machine():video():begin_recording()
+//-------------------------------------------------
+
+int lua_engine::lua_video::l_begin_recording(lua_State *L)
+{
+ video_manager *vm = luabridge::Stack<video_manager *>::get(L, 1);
+ if (!vm) {
+ return 0;
+ }
+
+ luaL_argcheck(L, lua_isstring(L, 2) || lua_isnone(L, 2), 2, "optional argument: filename, string expected");
+
+ const char *filename = lua_tostring(L, 2);
+ if (!lua_isnone(L, 2)) {
+ std::string vidname(filename);
+ strreplace(vidname, "/", PATH_SEPARATOR);
+ strreplace(vidname, "%g", luaThis->machine().basename());
+ filename = vidname.c_str();
+ } else {
+ filename = nullptr;
+ }
+ vm->begin_recording(filename, video_manager::MF_AVI);
+
+ return 1;
+}
+
+//-------------------------------------------------
+// end_recording - start saving avi
+// -> manager:machine():video():end_recording()
+//-------------------------------------------------
+
+int lua_engine::lua_video::l_end_recording(lua_State *L)
+{
+ video_manager *vm = luabridge::Stack<video_manager *>::get(L, 1);
+ if (!vm) {
+ return 0;
+ }
+
+ if (!vm->is_recording()) {
+ lua_writestringerror("%s", "No active recording to stop");
+ return 0;
+ }
+
+ vm->end_recording(video_manager::MF_AVI);
+ return 1;
+}
+
//-------------------------------------------------
// screen_height - return screen visible height
// -> manager:machine().screens[":screen"]:height()
@@ -619,6 +846,87 @@ int lua_engine::lua_screen::l_width(lua_State *L)
}
//-------------------------------------------------
+// screen_refresh - return screen refresh rate
+// -> manager:machine().screens[":screen"]:refresh()
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_refresh(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ lua_pushnumber(L, ATTOSECONDS_TO_HZ(sc->refresh_attoseconds()));
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_snapshot - save png bitmap of screen to snapshots folder
+// -> manager:machine().screens[":screen"]:snapshot("filename.png")
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_snapshot(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc || !sc->machine().render().is_live(*sc))
+ {
+ return 0;
+ }
+
+ luaL_argcheck(L, lua_isstring(L, 2) || lua_isnone(L, 2), 2, "optional argument: filename, string expected");
+
+ emu_file file(sc->machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ file_error filerr;
+
+ if (!lua_isnone(L, 2)) {
+ const char *filename = lua_tostring(L, 2);
+ std::string snapstr(filename);
+ strreplace(snapstr, "/", PATH_SEPARATOR);
+ strreplace(snapstr, "%g", sc->machine().basename());
+ filerr = file.open(snapstr.c_str());
+ }
+ else
+ {
+ filerr = sc->machine().video().open_next(file, "png");
+ }
+
+ if (filerr != FILERR_NONE)
+ {
+ luaL_error(L, "file_error=%d", filerr);
+ return 0;
+ }
+
+ sc->machine().video().save_snapshot(sc, file);
+ lua_writestringerror("saved %s", file.fullpath());
+ file.close();
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_type - return human readable screen type
+// -> manager:machine().screens[":screen"]:type()
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_type(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ switch (sc->screen_type())
+ {
+ case SCREEN_TYPE_RASTER: lua_pushliteral(L, "raster"); break;
+ case SCREEN_TYPE_VECTOR: lua_pushliteral(L, "vector"); break;
+ case SCREEN_TYPE_LCD: lua_pushliteral(L, "lcd"); break;
+ default: lua_pushliteral(L, "unknown"); break;
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
// draw_box - draw a box on a screen container
// -> manager:machine().screens[":screen"]:draw_box(x1, y1, x2, y2, bgcolor, linecolor)
//-------------------------------------------------
@@ -886,8 +1194,24 @@ lua_engine::lua_engine()
lua_gc(m_lua_state, LUA_GCSTOP, 0); /* stop collector during initialization */
luaL_openlibs(m_lua_state); /* open libraries */
- luaopen_lsqlite3(m_lua_state);
+ // Get package.preload so we can store builtins in it.
+ lua_getglobal(m_lua_state, "package");
+ lua_getfield(m_lua_state, -1, "preload");
+ lua_remove(m_lua_state, -2); // Remove package
+
+ // Store uv module definition at preload.uv
+ lua_pushcfunction(m_lua_state, luaopen_luv);
+ lua_setfield(m_lua_state, -2, "luv");
+ lua_pushcfunction(m_lua_state, luaopen_zlib);
+ lua_setfield(m_lua_state, -2, "zlib");
+
+ lua_pushcfunction(m_lua_state, luaopen_lsqlite3);
+ lua_setfield(m_lua_state, -2, "lsqlite3");
+
+ lua_pushcfunction(m_lua_state, luaopen_lfs);
+ lua_setfield(m_lua_state, -2, "lfs");
+
luaopen_ioport(m_lua_state);
lua_gc(m_lua_state, LUA_GCRESTART, 0);
@@ -905,6 +1229,98 @@ lua_engine::~lua_engine()
close();
}
+void lua_engine::execute_function(const char *id)
+{
+ lua_settop(m_lua_state, 0);
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, id);
+
+ if (lua_istable(m_lua_state, -1))
+ {
+ lua_pushnil(m_lua_state);
+ while (lua_next(m_lua_state, -2) != 0)
+ {
+ if (lua_isfunction(m_lua_state, -1))
+ {
+ lua_pcall(m_lua_state, 0, 0, 0);
+ }
+ else
+ {
+ lua_pop(m_lua_state, 1);
+ }
+ }
+ }
+}
+
+int lua_engine::register_function(lua_State *L, const char *id)
+{
+ if (!lua_isnil(L, 1))
+ luaL_checktype(L, 1, LUA_TFUNCTION);
+ lua_settop(L, 1);
+ lua_getfield(L, LUA_REGISTRYINDEX, id);
+ if (lua_isnil(L, -1))
+ {
+ lua_newtable(L);
+ }
+ luaL_checktype(L, -1, LUA_TTABLE);
+ int len = lua_rawlen(L, -1);
+ lua_pushnumber(L, len + 1);
+ lua_pushvalue(L, 1);
+ lua_rawset(L, -3); /* Stores the pair in the table */
+
+ lua_pushvalue(L, -1);
+ lua_setfield(L, LUA_REGISTRYINDEX, id);
+ return 1;
+}
+
+int lua_engine::l_emu_register_start(lua_State *L)
+{
+ return register_function(L, "LUA_ON_START");
+}
+
+int lua_engine::l_emu_register_stop(lua_State *L)
+{
+ return register_function(L, "LUA_ON_STOP");
+}
+
+int lua_engine::l_emu_register_pause(lua_State *L)
+{
+ return register_function(L, "LUA_ON_PAUSE");
+}
+
+int lua_engine::l_emu_register_resume(lua_State *L)
+{
+ return register_function(L, "LUA_ON_RESUME");
+}
+
+int lua_engine::l_emu_register_frame(lua_State *L)
+{
+ return register_function(L, "LUA_ON_FRAME");
+}
+
+void lua_engine::on_machine_start()
+{
+ execute_function("LUA_ON_START");
+}
+
+void lua_engine::on_machine_stop()
+{
+ execute_function("LUA_ON_STOP");
+}
+
+void lua_engine::on_machine_pause()
+{
+ execute_function("LUA_ON_PAUSE");
+}
+
+void lua_engine::on_machine_resume()
+{
+ execute_function("LUA_ON_RESUME");
+}
+
+void lua_engine::on_machine_frame()
+{
+ execute_function("LUA_ON_FRAME");
+}
void lua_engine::update_machine()
{
@@ -924,10 +1340,16 @@ void lua_engine::update_machine()
}
port = port->next();
}
+ machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(lua_engine::on_machine_start), this));
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(lua_engine::on_machine_stop), this));
+ machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(lua_engine::on_machine_pause), this));
+ machine().add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(FUNC(lua_engine::on_machine_resume), this));
+ machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(lua_engine::on_machine_frame), this));
}
lua_setglobal(m_lua_state, "ioport");
}
+
//-------------------------------------------------
// initialize - initialize lua hookup to emu engine
//-------------------------------------------------
@@ -950,6 +1372,11 @@ void lua_engine::initialize()
.addCFunction ("start", l_emu_start )
.addCFunction ("pause", l_emu_pause )
.addCFunction ("unpause", l_emu_unpause )
+ .addCFunction ("register_start", l_emu_register_start )
+ .addCFunction ("register_stop", l_emu_register_stop )
+ .addCFunction ("register_pause", l_emu_register_pause )
+ .addCFunction ("register_resume",l_emu_register_resume )
+ .addCFunction ("register_frame", l_emu_register_frame )
.beginClass <machine_manager> ("manager")
.addFunction ("machine", &machine_manager::machine)
.addFunction ("options", &machine_manager::options)
@@ -961,14 +1388,25 @@ void lua_engine::initialize()
.addFunction ("save", &running_machine::schedule_save)
.addFunction ("load", &running_machine::schedule_load)
.addFunction ("system", &running_machine::system)
+ .addFunction ("video", &running_machine::video)
+ .addFunction ("ui", &running_machine::ui)
+ .addFunction ("render", &running_machine::render)
+ .addFunction ("ioport", &running_machine::ioport)
+ .addFunction ("parameters", &running_machine::parameters)
+ .addFunction ("cheat", &running_machine::cheat)
+ .addFunction ("options", &running_machine::options)
.addProperty <luabridge::LuaRef, void> ("devices", &lua_engine::l_machine_get_devices)
.addProperty <luabridge::LuaRef, void> ("screens", &lua_engine::l_machine_get_screens)
.endClass ()
.beginClass <game_driver> ("game_driver")
+ .addData ("source_file", &game_driver::source_file)
+ .addData ("parent", &game_driver::parent)
.addData ("name", &game_driver::name)
.addData ("description", &game_driver::description)
.addData ("year", &game_driver::year)
.addData ("manufacturer", &game_driver::manufacturer)
+ .addData ("compatible_with", &game_driver::compatible_with)
+ .addData ("default_layout", &game_driver::default_layout)
.endClass ()
.beginClass <device_t> ("device")
.addFunction ("name", &device_t::name)
@@ -977,6 +1415,113 @@ void lua_engine::initialize()
.addProperty <luabridge::LuaRef, void> ("spaces", &lua_engine::l_dev_get_memspaces)
.addProperty <luabridge::LuaRef, void> ("state", &lua_engine::l_dev_get_states)
.endClass()
+ .beginClass <cheat_manager> ("cheat")
+ .addProperty <bool, bool> ("enabled", &cheat_manager::enabled, &cheat_manager::set_enable)
+ .addFunction ("reload", &cheat_manager::reload)
+ .addFunction ("save_all", &cheat_manager::save_all)
+ .addProperty <luabridge::LuaRef, void> ("entries", &lua_engine::l_cheat_get_entries)
+ .endClass()
+ .beginClass <lua_cheat_entry> ("lua_cheat_entry")
+ .addCFunction ("state", &lua_cheat_entry::l_get_state)
+ .endClass()
+ .deriveClass <cheat_entry, lua_cheat_entry> ("cheat_entry")
+ .addFunction ("description", &cheat_entry::description)
+ .addFunction ("comment", &cheat_entry::comment)
+ .addFunction ("has_run_script", &cheat_entry::has_run_script)
+ .addFunction ("has_on_script", &cheat_entry::has_on_script)
+ .addFunction ("has_off_script", &cheat_entry::has_off_script)
+ .addFunction ("has_change_script", &cheat_entry::has_change_script)
+ .addFunction ("execute_off_script", &cheat_entry::execute_off_script)
+ .addFunction ("execute_on_script", &cheat_entry::execute_on_script)
+ .addFunction ("execute_run_script", &cheat_entry::execute_run_script)
+ .addFunction ("execute_change_script", &cheat_entry::execute_change_script)
+ .addFunction ("is_text_only", &cheat_entry::is_text_only)
+ .addFunction ("is_oneshot", &cheat_entry::is_oneshot)
+ .addFunction ("is_onoff", &cheat_entry::is_onoff)
+ .addFunction ("is_value_parameter", &cheat_entry::is_value_parameter)
+ .addFunction ("is_itemlist_parameter", &cheat_entry::is_itemlist_parameter)
+ .addFunction ("is_oneshot_parameter", &cheat_entry::is_oneshot_parameter)
+ .addFunction ("activate", &cheat_entry::activate)
+ .addFunction ("select_default_state", &cheat_entry::select_default_state)
+ .addFunction ("select_previous_state", &cheat_entry::select_previous_state)
+ .addFunction ("select_next_state", &cheat_entry::select_next_state)
+ .endClass()
+ .beginClass <ioport_manager> ("ioport")
+ .addFunction ("has_configs", &ioport_manager::has_configs)
+ .addFunction ("has_analog", &ioport_manager::has_analog)
+ .addFunction ("has_dips", &ioport_manager::has_dips)
+ .addFunction ("has_bioses", &ioport_manager::has_bioses)
+ .addFunction ("has_keyboard", &ioport_manager::has_keyboard)
+ .addFunction ("count_players", &ioport_manager::count_players)
+ .addProperty <luabridge::LuaRef, void> ("ports", &lua_engine::l_ioport_get_ports)
+ .endClass()
+ .beginClass <ioport_port> ("ioport_port")
+ .addFunction ("tag", &ioport_port::tag)
+ .addFunction ("active", &ioport_port::active)
+ .addFunction ("live", &ioport_port::live)
+ .addProperty <luabridge::LuaRef, void> ("fields", &lua_engine::l_ioports_port_get_fields)
+ .endClass()
+ .beginClass <ioport_field> ("ioport_field")
+ .addFunction ("set_value", &ioport_field::set_value)
+ .addProperty ("device", &ioport_field::device)
+ .addProperty ("name", &ioport_field::name)
+ .addProperty <UINT8, UINT8> ("player", &ioport_field::player, &ioport_field::set_player)
+ .addProperty ("mask", &ioport_field::mask)
+ .addProperty ("defvalue", &ioport_field::defvalue)
+ .addProperty ("sensitivity", &ioport_field::sensitivity)
+ .addProperty ("way", &ioport_field::way)
+ .addProperty ("is_analog", &ioport_field::is_analog)
+ .addProperty ("is_digitial_joystick", &ioport_field::is_digital_joystick)
+ .addProperty ("enabled", &ioport_field::enabled)
+ .addProperty ("unused", &ioport_field::unused)
+ .addProperty ("cocktail", &ioport_field::cocktail)
+ .addProperty ("toggle", &ioport_field::toggle)
+ .addProperty ("rotated", &ioport_field::rotated)
+ .addProperty ("analog_reverse", &ioport_field::analog_reverse)
+ .addProperty ("analog_reset", &ioport_field::analog_reset)
+ .addProperty ("analog_wraps", &ioport_field::analog_wraps)
+ .addProperty ("analog_invert", &ioport_field::analog_invert)
+ .addProperty ("impulse", &ioport_field::impulse)
+ .addProperty <double, double> ("crosshair_scale", &ioport_field::crosshair_scale, &ioport_field::set_crosshair_scale)
+ .addProperty <double, double> ("crosshair_offset", &ioport_field::crosshair_offset, &ioport_field::set_crosshair_offset)
+ .endClass()
+ .beginClass <core_options> ("core_options")
+ .addFunction ("help", &core_options::output_help)
+ .addFunction ("command", &core_options::command)
+ .addProperty <luabridge::LuaRef, void> ("entries", &lua_engine::l_options_get_entries)
+ .endClass()
+ .beginClass <lua_options_entry> ("lua_options_entry")
+ .addCFunction ("value", &lua_options_entry::l_entry_value)
+ .endClass()
+ .deriveClass <core_options::entry, lua_options_entry> ("core_options_entry")
+ .addFunction ("description", &core_options::entry::description)
+ .addFunction ("default_value", &core_options::entry::default_value)
+ .addFunction ("minimum", &core_options::entry::minimum)
+ .addFunction ("maximum", &core_options::entry::maximum)
+ .addFunction ("has_range", &core_options::entry::has_range)
+ .endClass()
+ .deriveClass <emu_options, core_options> ("emu_options")
+ .endClass()
+ .deriveClass <ui_options, core_options> ("ui_options")
+ .endClass()
+ .beginClass <parameters_manager> ("parameters")
+ .addFunction ("add", &parameters_manager::add)
+ .addFunction ("lookup", &parameters_manager::lookup)
+ .endClass()
+ .beginClass <lua_video> ("lua_video_manager")
+ .addCFunction ("begin_recording", &lua_video::l_begin_recording)
+ .addCFunction ("end_recording", &lua_video::l_end_recording)
+ .endClass()
+ .deriveClass <video_manager, lua_video> ("video")
+ .addFunction ("snapshot", &video_manager::save_active_screen_snapshots)
+ .addFunction ("is_recording", &video_manager::is_recording)
+ .addFunction ("skip_this_frame", &video_manager::skip_this_frame)
+ .addFunction ("speed_factor", &video_manager::speed_factor)
+ .addFunction ("speed_percent", &video_manager::speed_percent)
+ .addProperty <int, int> ("frameskip", &video_manager::frameskip, &video_manager::set_frameskip)
+ .addProperty <bool, bool> ("throttled", &video_manager::throttled, &video_manager::set_throttled)
+ .addProperty <float, float> ("throttle_rate", &video_manager::throttle_rate, &video_manager::set_throttle_rate)
+ .endClass()
.beginClass <lua_addr_space> ("lua_addr_space")
.addCFunction ("read_i8", &lua_addr_space::l_mem_read<INT8>)
.addCFunction ("read_u8", &lua_addr_space::l_mem_read<UINT8>)
@@ -998,18 +1543,61 @@ void lua_engine::initialize()
.deriveClass <address_space, lua_addr_space> ("addr_space")
.addFunction("name", &address_space::name)
.endClass()
+ .beginClass <render_target> ("target")
+ .addFunction ("width", &render_target::width)
+ .addFunction ("height", &render_target::height)
+ .addFunction ("pixel_aspect", &render_target::pixel_aspect)
+ .addFunction ("hidden", &render_target::hidden)
+ .addFunction ("is_ui_target", &render_target::is_ui_target)
+ .addFunction ("index", &render_target::index)
+ .addProperty <float, float> ("max_update_rate", &render_target::max_update_rate, &render_target::set_max_update_rate)
+ .addProperty <int, int> ("view", &render_target::view, &render_target::set_view)
+ .addProperty <int, int> ("orientation", &render_target::orientation, &render_target::set_orientation)
+ .addProperty <bool, bool> ("backdrops", &render_target::backdrops_enabled, &render_target::set_backdrops_enabled)
+ .addProperty <bool, bool> ("overlays", &render_target::overlays_enabled, &render_target::set_overlays_enabled)
+ .addProperty <bool, bool> ("bezels", &render_target::bezels_enabled, &render_target::set_bezels_enabled)
+ .addProperty <bool, bool> ("marquees", &render_target::marquees_enabled, &render_target::set_marquees_enabled)
+ .addProperty <bool, bool> ("screen_overlay", &render_target::screen_overlay_enabled, &render_target::set_screen_overlay_enabled)
+ .addProperty <bool, bool> ("zoom", &render_target::zoom_to_screen, &render_target::set_zoom_to_screen)
+ .endClass()
+ .beginClass <render_container> ("render_container")
+ .addFunction ("orientation", &render_container::orientation)
+ .addFunction ("xscale", &render_container::xscale)
+ .addFunction ("yscale", &render_container::yscale)
+ .addFunction ("xoffset", &render_container::xoffset)
+ .addFunction ("yoffset", &render_container::yoffset)
+ .addFunction ("is_empty", &render_container::is_empty)
+ .endClass()
+ .beginClass <render_manager> ("render")
+ .addFunction ("max_update_rate", &render_manager::max_update_rate)
+ .addFunction ("ui_target", &render_manager::ui_target)
+ .addFunction ("ui_container", &render_manager::ui_container)
+ .addProperty <luabridge::LuaRef, void> ("targets", &lua_engine::l_render_get_targets)
+ .endClass()
+ .beginClass <ui_manager> ("ui")
+ .addFunction ("is_menu_active", &ui_manager::is_menu_active)
+ .addFunction ("options", &ui_manager::options)
+ .addProperty <bool, bool> ("show_fps", &ui_manager::show_fps, &ui_manager::set_show_fps)
+ .addProperty <bool, bool> ("show_profiler", &ui_manager::show_profiler, &ui_manager::set_show_profiler)
+ .addProperty <bool, bool> ("single_step", &ui_manager::single_step, &ui_manager::set_single_step)
+ .endClass()
.beginClass <lua_screen> ("lua_screen_dev")
.addCFunction ("draw_box", &lua_screen::l_draw_box)
.addCFunction ("draw_line", &lua_screen::l_draw_line)
.addCFunction ("draw_text", &lua_screen::l_draw_text)
.addCFunction ("height", &lua_screen::l_height)
.addCFunction ("width", &lua_screen::l_width)
+ .addCFunction ("refresh", &lua_screen::l_refresh)
+ .addCFunction ("snapshot", &lua_screen::l_snapshot)
+ .addCFunction ("type", &lua_screen::l_type)
.endClass()
.deriveClass <screen_device, lua_screen> ("screen_dev")
.addFunction ("frame_number", &screen_device::frame_number)
.addFunction ("name", &screen_device::name)
.addFunction ("shortname", &screen_device::shortname)
.addFunction ("tag", &screen_device::tag)
+ .addFunction ("xscale", &screen_device::xscale)
+ .addFunction ("yscale", &screen_device::yscale)
.endClass()
.beginClass <device_state_entry> ("dev_space")
.addFunction ("name", &device_state_entry::symbol)
@@ -1050,33 +1638,37 @@ void lua_engine::periodic_check()
{
std::lock_guard<std::mutex> lock(g_mutex);
if (msg.ready == 1) {
- lua_settop(m_lua_state, 0);
- int status = luaL_loadbuffer(m_lua_state, msg.text.c_str(), msg.text.length(), "=stdin");
- if (incomplete(status)==0) /* cannot try to add lines? */
- {
- if (status == LUA_OK) status = docall(0, LUA_MULTRET);
- report(status);
- if (status == LUA_OK && lua_gettop(m_lua_state) > 0) /* any result to print? */
+ lua_settop(m_lua_state, 0);
+ int status = luaL_loadbuffer(m_lua_state, msg.text.c_str(), msg.text.length(), "=stdin");
+ if (incomplete(status)==0) /* cannot try to add lines? */
{
- luaL_checkstack(m_lua_state, LUA_MINSTACK, "too many results to print");
- lua_getglobal(m_lua_state, "print");
- lua_insert(m_lua_state, 1);
- if (lua_pcall(m_lua_state, lua_gettop(m_lua_state) - 1, 0, 0) != LUA_OK)
- lua_writestringerror("%s\n", lua_pushfstring(m_lua_state,
- "error calling " LUA_QL("print") " (%s)",
- lua_tostring(m_lua_state, -1)));
+ if (status == LUA_OK) status = docall(0, LUA_MULTRET);
+ report(status);
+ if (status == LUA_OK && lua_gettop(m_lua_state) > 0) /* any result to print? */
+ {
+ luaL_checkstack(m_lua_state, LUA_MINSTACK, "too many results to print");
+ lua_getglobal(m_lua_state, "print");
+ lua_insert(m_lua_state, 1);
+ if (lua_pcall(m_lua_state, lua_gettop(m_lua_state) - 1, 0, 0) != LUA_OK)
+ lua_writestringerror("%s\n", lua_pushfstring(m_lua_state,
+ "error calling " LUA_QL("print") " (%s)",
+ lua_tostring(m_lua_state, -1)));
+ }
}
+ else
+ {
+ status = -1;
+ }
+ msg.status = status;
+ msg.response = msg.text;
+ msg.text = "";
+ msg.ready = 0;
+ msg.done = 1;
}
- else
- {
- status = -1;
- }
- msg.status = status;
- msg.response = msg.text;
- msg.text = "";
- msg.ready = 0;
- msg.done = 1;
- }
+ auto loop = luv_loop(m_lua_state);
+ if (loop!=nullptr)
+ uv_run(loop, UV_RUN_NOWAIT);
+
}
//-------------------------------------------------
diff --git a/src/emu/luaengine.h b/src/emu/luaengine.h
index 9bc6275100e..fca3a564618 100644
--- a/src/emu/luaengine.h
+++ b/src/emu/luaengine.h
@@ -24,6 +24,8 @@
#undef None
#endif
+class cheat_manager;
+
struct lua_State;
namespace luabridge
{
@@ -45,6 +47,7 @@ public:
void serve_lua();
void periodic_check();
bool frame_hook();
+ void execute_function(const char *id);
void resume(lua_State *L, int nparam = 0, lua_State *root = nullptr);
void set_machine(running_machine *machine) { m_machine = machine; update_machine(); }
@@ -78,6 +81,13 @@ private:
running_machine &machine() const { return *m_machine; }
void update_machine();
+
+ void on_machine_start();
+ void on_machine_stop();
+ void on_machine_pause();
+ void on_machine_resume();
+ void on_machine_frame();
+
void output_notifier(const char *outname, INT32 value);
static void s_output_notifier(const char *outname, INT32 value, void *param);
@@ -102,9 +112,18 @@ private:
static int l_emu_pause(lua_State *L);
static int l_emu_unpause(lua_State *L);
static int l_emu_set_hook(lua_State *L);
+ static int l_emu_register_start(lua_State *L);
+ static int l_emu_register_stop(lua_State *L);
+ static int l_emu_register_pause(lua_State *L);
+ static int l_emu_register_resume(lua_State *L);
+ static int l_emu_register_frame(lua_State *L);
+ static int register_function(lua_State *L, const char *id);
// "emu.machine" namespace
static luabridge::LuaRef l_machine_get_devices(const running_machine *r);
+ static luabridge::LuaRef l_ioport_get_ports(const ioport_manager *i);
+ static luabridge::LuaRef l_render_get_targets(const render_manager *r);
+ static luabridge::LuaRef l_ioports_port_get_fields(const ioport_port *i);
static luabridge::LuaRef devtree_dfs(device_t *root, luabridge::LuaRef dev_table);
static luabridge::LuaRef l_dev_get_states(const device_t *d);
static UINT64 l_state_get_value(const device_state_entry *d);
@@ -118,11 +137,29 @@ private:
struct lua_screen {
int l_height(lua_State *L);
int l_width(lua_State *L);
+ int l_refresh(lua_State *L);
+ int l_type(lua_State *L);
+ int l_snapshot(lua_State *L);
int l_draw_box(lua_State *L);
int l_draw_line(lua_State *L);
int l_draw_text(lua_State *L);
};
+ struct lua_video {
+ int l_begin_recording(lua_State *L);
+ int l_end_recording(lua_State *L);
+ };
+
+ static luabridge::LuaRef l_cheat_get_entries(const cheat_manager *c);
+ struct lua_cheat_entry {
+ int l_get_state(lua_State *L);
+ };
+
+ template<typename T> static luabridge::LuaRef l_options_get_entries(const T *o);
+ struct lua_options_entry {
+ int l_entry_value(lua_State *L);
+ };
+
void resume(void *L, INT32 param);
void start();
static int luaopen_ioport(lua_State *L);
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 7c59ef69a2d..5119dec397c 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -387,8 +387,10 @@ int running_machine::run(bool firstrun)
// execute CPUs if not paused
if (!m_paused)
+ {
m_scheduler.timeslice();
-
+ manager().lua()->periodic_check();
+ }
// otherwise, just pump video updates through
else
m_video->frame_update();
diff --git a/src/emu/mame.cpp b/src/emu/mame.cpp
index f17c04e3b68..813455e0b8d 100644
--- a/src/emu/mame.cpp
+++ b/src/emu/mame.cpp
@@ -151,6 +151,20 @@ void machine_manager::update_machine()
m_lua->set_machine(m_machine);
}
+
+void machine_manager::start_luaengine()
+{
+ m_lua->initialize();
+ {
+ emu_file file(options().plugins_path(), OPEN_FLAG_READ);
+ file_error filerr = file.open("boot.lua");
+ if (filerr == FILERR_NONE)
+ {
+ m_lua->load_script(file.fullpath());
+ }
+ }
+}
+
/*-------------------------------------------------
execute - run the core emulation
-------------------------------------------------*/
@@ -166,7 +180,6 @@ int machine_manager::execute()
bool exit_pending = false;
int error = MAMERR_NONE;
- m_lua->initialize();
if (m_options.console()) {
m_lua->start_console();
}
diff --git a/src/emu/mame.h b/src/emu/mame.h
index eb2f510c114..bc21d805716 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -55,18 +55,8 @@ public:
static const char * get_appname();
static const char * get_appname_lower();
static const char * get_configname();
- static const char * get_capgamenoun();
- static const char * get_capstartgamenoun();
- static const char * get_gamenoun();
- static const char * get_gamesnoun();
static const char * get_copyright();
static const char * get_copyright_info();
- static const char * get_disclaimer();
- static const char * get_usage();
- static const char * get_xml_root();
- static const char * get_xml_top();
- static const char * get_state_magic_num();
- static void printf_usage(const char *par1, const char *par2);
};
class lua_engine;
@@ -96,6 +86,7 @@ public:
/* execute as configured by the OPTION_SYSTEMNAME option on the specified options */
int execute();
+ void start_luaengine();
void schedule_new_driver(const game_driver &driver);
private:
osd_interface & m_osd; // reference to OSD system
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index e25f62a8e13..3de791eab52 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -442,7 +442,7 @@ void render_texture::hq_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const
// get_scaled - get a scaled bitmap (if we can)
//-------------------------------------------------
-void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist)
+void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist, UINT32 flags)
{
// source width/height come from the source bounds
int swidth = m_sbounds.width();
@@ -677,7 +677,7 @@ void render_container::add_char(float x0, float y0, float height, float aspect,
// add it like a quad
item &newitem = add_generic(CONTAINER_ITEM_QUAD, bounds.x0, bounds.y0, bounds.x1, bounds.y1, argb);
newitem.m_texture = texture;
- newitem.m_flags = PRIMFLAG_TEXORIENT(ROT0) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
+ newitem.m_flags = PRIMFLAG_TEXORIENT(ROT0) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_PACKABLE;
newitem.m_internal = INTERNAL_FLAG_CHAR;
}
@@ -1751,7 +1751,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const
width = MIN(width, m_maxtexwidth);
height = MIN(height, m_maxtexheight);
- curitem->texture()->get_scaled(width, height, prim->texture, list);
+ curitem->texture()->get_scaled(width, height, prim->texture, list, curitem->flags());
// set the palette
prim->texture.palette = curitem->texture()->get_adjusted_palette(container);
@@ -1854,7 +1854,7 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob
// get the scaled texture and append it
- texture->get_scaled(width, height, prim->texture, list);
+ texture->get_scaled(width, height, prim->texture, list, prim->flags);
// compute the clip rect
render_bounds cliprect;
diff --git a/src/emu/render.h b/src/emu/render.h
index e40c86b1c3c..6d55c75ada9 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -62,7 +62,9 @@ enum
BLENDMODE_NONE = 0, // no blending
BLENDMODE_ALPHA, // standard alpha blend
BLENDMODE_RGB_MULTIPLY, // apply source alpha to source pix, then multiply RGB values
- BLENDMODE_ADD // apply source alpha to source pix, then add to destination
+ BLENDMODE_ADD, // apply source alpha to source pix, then add to destination
+
+ BLENDMODE_COUNT
};
@@ -105,6 +107,9 @@ const UINT32 PRIMFLAG_TYPE_MASK = 3 << PRIMFLAG_TYPE_SHIFT;
const UINT32 PRIMFLAG_TYPE_LINE = 0 << PRIMFLAG_TYPE_SHIFT;
const UINT32 PRIMFLAG_TYPE_QUAD = 1 << PRIMFLAG_TYPE_SHIFT;
+const int PRIMFLAG_PACKABLE_SHIFT = 21;
+const UINT32 PRIMFLAG_PACKABLE = 1 << PRIMFLAG_PACKABLE_SHIFT;
+
//**************************************************************************
// MACROS
//**************************************************************************
@@ -323,6 +328,7 @@ public:
// getters
render_primitive *next() const { return m_next; }
+ bool packable(const INT32 pack_size) const { return (flags & PRIMFLAG_PACKABLE) && texture.base != nullptr && texture.width <= pack_size && texture.height <= pack_size; }
// reset to prepare for re-use
void reset();
@@ -430,7 +436,7 @@ public:
private:
// internal helpers
- void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist);
+ void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist, UINT32 flags = 0);
const rgb_t *get_adjusted_palette(render_container &container);
static const int MAX_TEXTURE_SCALES = 16;
diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp
index e33df543fbb..886093edf13 100644
--- a/src/emu/romload.cpp
+++ b/src/emu/romload.cpp
@@ -464,7 +464,7 @@ void rom_load_manager::display_loading_rom_message(const char *name, bool from_l
char buffer[200];
if (name != nullptr)
- sprintf(buffer, "Loading %s (%d%%)", from_list ? "Software" : emulator_info::get_capstartgamenoun(), (UINT32)(100 * (UINT64)m_romsloadedsize / (UINT64)m_romstotalsize));
+ sprintf(buffer, "%s (%d%%)", from_list ? "Loading Software" : "Loading Machine", (UINT32)(100 * (UINT64)m_romsloadedsize / (UINT64)m_romstotalsize));
else
sprintf(buffer, "Loading Complete");
@@ -488,15 +488,13 @@ void rom_load_manager::display_rom_load_results(bool from_list)
{
/* create the error message and exit fatally */
osd_printf_error("%s", m_errorstring.c_str());
- fatalerror_exitcode(machine(), MAMERR_MISSING_FILES, "Required files are missing, the %s cannot be run.",emulator_info::get_gamenoun());
+ fatalerror_exitcode(machine(), MAMERR_MISSING_FILES, "Required files are missing, the machine cannot be run.");
}
/* if we had warnings, output them, but continue */
if ((m_warnings) || (m_knownbad))
{
- m_errorstring.append("WARNING: the ");
- m_errorstring.append(emulator_info::get_gamenoun());
- m_errorstring.append(" might not run correctly.");
+ m_errorstring.append("WARNING: the machine might not run correctly.");
osd_printf_warning("%s\n", m_errorstring.c_str());
}
}
diff --git a/src/emu/save.cpp b/src/emu/save.cpp
index 4a5b3ef7ebf..89197ab224e 100644
--- a/src/emu/save.cpp
+++ b/src/emu/save.cpp
@@ -49,6 +49,7 @@ enum
SS_MSB_FIRST = 0x02
};
+#define STATE_MAGIC_NUM "MAMESAVE"
//**************************************************************************
// INITIALIZATION
@@ -292,7 +293,7 @@ save_error save_manager::write_file(emu_file &file)
// generate the header
UINT8 header[HEADER_SIZE];
- memcpy(&header[0], emulator_info::get_state_magic_num(), 8);
+ memcpy(&header[0], STATE_MAGIC_NUM, 8);
header[8] = SAVE_VERSION;
header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST);
strncpy((char *)&header[0x0a], machine().system().name, 0x1c - 0x0a);
@@ -365,7 +366,7 @@ save_error save_manager::validate_header(const UINT8 *header, const char *gamena
void (CLIB_DECL *errormsg)(const char *fmt, ...), const char *error_prefix)
{
// check magic number
- if (memcmp(header, emulator_info::get_state_magic_num(), 8))
+ if (memcmp(header, STATE_MAGIC_NUM, 8))
{
if (errormsg != nullptr)
(*errormsg)("%sThis is not a %s save file", error_prefix,emulator_info::get_appname());
diff --git a/src/emu/ui/auditmenu.cpp b/src/emu/ui/auditmenu.cpp
index 8b98f0d70a2..97d84568118 100644
--- a/src/emu/ui/auditmenu.cpp
+++ b/src/emu/ui/auditmenu.cpp
@@ -108,7 +108,7 @@ void ui_menu_audit::handle()
if (m_first)
{
- machine().ui().draw_text_box(container, "Audit in progress...", JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
+ machine().ui().draw_text_box(container, _("Audit in progress..."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
m_first = false;
return;
}
diff --git a/src/emu/ui/barcode.cpp b/src/emu/ui/barcode.cpp
index fece584c641..e9f779737a8 100644
--- a/src/emu/ui/barcode.cpp
+++ b/src/emu/ui/barcode.cpp
@@ -69,11 +69,11 @@ void ui_menu_barcode_reader::populate()
new_barcode = m_barcode_buffer;
}
- item_append("New Barcode:", new_barcode, 0, ITEMREF_NEW_BARCODE);
+ item_append(_("New Barcode:"), new_barcode, 0, ITEMREF_NEW_BARCODE);
// finish up the menu
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("Enter Code", nullptr, 0, ITEMREF_ENTER_BARCODE);
+ item_append(_("Enter Code"), nullptr, 0, ITEMREF_ENTER_BARCODE);
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
}
@@ -115,7 +115,7 @@ void ui_menu_barcode_reader::handle()
std::string tmp_file(m_barcode_buffer);
//printf("code %s\n", m_barcode_buffer);
if (!current_device()->is_valid(tmp_file.length()))
- machine().ui().popup_time(5, "Barcode length invalid!");
+ machine().ui().popup_time(5, "%s", _("Barcode length invalid!"));
else
{
current_device()->write_code(tmp_file.c_str(), tmp_file.length());
diff --git a/src/emu/ui/cheatopt.cpp b/src/emu/ui/cheatopt.cpp
index 2b9ce145879..6de3cb55936 100644
--- a/src/emu/ui/cheatopt.cpp
+++ b/src/emu/ui/cheatopt.cpp
@@ -74,7 +74,7 @@ void ui_menu_cheat::handle()
case IPT_UI_DOWN:
string = curcheat->comment();
if (string != nullptr && string[0] != 0)
- machine().popmessage("Cheat Comment:\n%s", string);
+ machine().popmessage(_("Cheat Comment:\n%s"), string);
break;
}
}
@@ -87,7 +87,7 @@ void ui_menu_cheat::handle()
/* display the reloaded cheats */
reset(UI_MENU_RESET_REMEMBER_REF);
- machine().popmessage("All cheats reloaded");
+ machine().popmessage(_("All cheats reloaded"));
}
/* handle autofire menu */
@@ -118,7 +118,7 @@ void ui_menu_cheat::populate()
std::string subtext;
// add the autofire menu
- item_append("Autofire Settings", nullptr, 0, (void *)ITEMREF_CHEATS_AUTOFIRE_SETTINGS);
+ item_append(_("Autofire Settings"), nullptr, 0, (void *)ITEMREF_CHEATS_AUTOFIRE_SETTINGS);
/* add a separator */
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
@@ -136,10 +136,10 @@ void ui_menu_cheat::populate()
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
/* add a reset all option */
- item_append("Reset All", nullptr, 0, (void *)ITEMREF_CHEATS_RESET_ALL);
+ item_append(_("Reset All"), nullptr, 0, (void *)ITEMREF_CHEATS_RESET_ALL);
/* add a reload all cheats option */
- item_append("Reload All", nullptr, 0, (void *)ITEMREF_CHEATS_RELOAD_ALL);
+ item_append(_("Reload All"), nullptr, 0, (void *)ITEMREF_CHEATS_RELOAD_ALL);
}
}
@@ -255,7 +255,7 @@ void ui_menu_autofire::populate()
/* add autofire toggle item */
bool autofire_toggle = machine().ioport().get_autofire_toggle();
- item_append("Autofire Status", (autofire_toggle ? "Disabled" : "Enabled"),
+ item_append(_("Autofire Status"), (autofire_toggle ? _("Disabled") : _("Enabled")),
(autofire_toggle ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW), (void *)ITEMREF_AUTOFIRE_STATUS);
/* iterate over the input ports and add autofire toggle items */
@@ -281,13 +281,13 @@ void ui_menu_autofire::populate()
if (!autofire_toggle)
{
// item is enabled and can be switched to values on/off
- item_append(field->name(), (settings.autofire ? "On" : "Off"),
+ item_append(field->name(), (settings.autofire ? _("On") : _("Off")),
(settings.autofire ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW), (void *)field);
}
else
{
// item is disabled
- item_append(field->name(), (settings.autofire ? "On" : "Off"),
+ item_append(field->name(), (settings.autofire ? _("On") : _("Off")),
MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr);
}
}
@@ -298,7 +298,7 @@ void ui_menu_autofire::populate()
if (menu_items==0)
{
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("No buttons found on this machine!", nullptr, MENU_FLAG_DISABLE, nullptr);
+ item_append(_("No buttons found on this machine!"), nullptr, MENU_FLAG_DISABLE, nullptr);
}
/* add a separator */
@@ -309,11 +309,11 @@ void ui_menu_autofire::populate()
snprintf(temp_text, ARRAY_LENGTH(temp_text), "%d = %.2f Hz", value, (float)refresh/value);
if (!autofire_toggle)
{
- item_append("Autofire Delay", temp_text, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)ITEMREF_AUTOFIRE_DELAY);
+ item_append(_("Autofire Delay"), temp_text, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)ITEMREF_AUTOFIRE_DELAY);
}
else
{
- item_append("Autofire Delay", temp_text, MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr);
+ item_append(_("Autofire Delay"), temp_text, MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr);
}
/* add a separator */
diff --git a/src/emu/ui/ctrlmenu.cpp b/src/emu/ui/ctrlmenu.cpp
index 5d006693faf..f954a596f7a 100644
--- a/src/emu/ui/ctrlmenu.cpp
+++ b/src/emu/ui/ctrlmenu.cpp
@@ -17,14 +17,14 @@ const char *ui_menu_controller_mapping::m_device_status[] = { "none", "keyboard"
ui_menu_controller_mapping::ctrl_option ui_menu_controller_mapping::m_options[] = {
{ 0, nullptr, nullptr },
- { 0, "Lightgun Device Assignment", OPTION_LIGHTGUN_DEVICE },
- { 0, "Trackball Device Assignment", OPTION_TRACKBALL_DEVICE },
- { 0, "Pedal Device Assignment", OPTION_PEDAL_DEVICE },
- { 0, "Adstick Device Assignment", OPTION_ADSTICK_DEVICE },
- { 0, "Paddle Device Assignment", OPTION_PADDLE_DEVICE },
- { 0, "Dial Device Assignment", OPTION_DIAL_DEVICE },
- { 0, "Positional Device Assignment", OPTION_POSITIONAL_DEVICE },
- { 0, "Mouse Device Assignment", OPTION_MOUSE_DEVICE }
+ { 0, __("Lightgun Device Assignment"), OPTION_LIGHTGUN_DEVICE },
+ { 0, __("Trackball Device Assignment"), OPTION_TRACKBALL_DEVICE },
+ { 0, __("Pedal Device Assignment"), OPTION_PEDAL_DEVICE },
+ { 0, __("Adstick Device Assignment"), OPTION_ADSTICK_DEVICE },
+ { 0, __("Paddle Device Assignment"), OPTION_PADDLE_DEVICE },
+ { 0, __("Dial Device Assignment"), OPTION_DIAL_DEVICE },
+ { 0, __("Positional Device Assignment"), OPTION_POSITIONAL_DEVICE },
+ { 0, __("Mouse Device Assignment"), OPTION_MOUSE_DEVICE }
};
//-------------------------------------------------
@@ -88,7 +88,7 @@ void ui_menu_controller_mapping::populate()
for (int d = 1; d < ARRAY_LENGTH(m_options); ++d)
{
UINT32 arrow_flags = get_arrow_flags(0, ARRAY_LENGTH(m_device_status) - 1, m_options[d].status);
- item_append(m_options[d].description, m_device_status[m_options[d].status], arrow_flags, (void *)(FPTR)d);
+ item_append(_(m_options[d].description), m_device_status[m_options[d].status], arrow_flags, (void *)(FPTR)d);
}
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
@@ -103,7 +103,7 @@ void ui_menu_controller_mapping::custom_render(void *selectedref, float top, flo
float width, maxwidth = origx2 - origx1;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Device Mapping", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Device Mapping"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = MAX(maxwidth, width);
@@ -123,7 +123,7 @@ void ui_menu_controller_mapping::custom_render(void *selectedref, float top, flo
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Device Mapping", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Device Mapping"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
diff --git a/src/emu/ui/custmenu.cpp b/src/emu/ui/custmenu.cpp
index 27cdf2c17c4..3a50f4bfc03 100644
--- a/src/emu/ui/custmenu.cpp
+++ b/src/emu/ui/custmenu.cpp
@@ -153,7 +153,7 @@ void ui_menu_custom_filter::populate()
{
// add main filter
UINT32 arrow_flags = get_arrow_flags((int)FILTER_ALL, (int)FILTER_UNAVAILABLE, custfltr::main);
- item_append("Main filter", main_filters::text[custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);
+ item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);
// add other filters
for (int x = 1; x <= custfltr::numother; x++)
@@ -162,7 +162,7 @@ void ui_menu_custom_filter::populate()
// add filter items
arrow_flags = get_arrow_flags((int)FILTER_UNAVAILABLE + 1, (int)FILTER_LAST - 1, custfltr::other[x]);
- item_append("Other filter", main_filters::text[custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));
+ item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));
if (m_added)
selected = item.size() - 2;
@@ -189,10 +189,10 @@ void ui_menu_custom_filter::populate()
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
if (custfltr::numother > 0)
- item_append("Remove last filter", nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
+ item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
if (custfltr::numother < MAX_CUST_FILTER - 2)
- item_append("Add filter", nullptr, 0, (void *)(FPTR)ADD_FILTER);
+ item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
@@ -207,7 +207,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo
ui_manager &mui = machine().ui();
// get the size of the text
- mui.draw_text_full(container, "Select custom filters:", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@@ -227,7 +227,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Select custom filters:", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
@@ -438,7 +438,7 @@ void ui_menu_swcustom_filter::populate()
{
// add main filter
UINT32 arrow_flags = get_arrow_flags((int)UI_SW_ALL, (int)UI_SW_UNAVAILABLE, sw_custfltr::main);
- item_append("Main filter", sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);
+ item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);
// add other filters
for (int x = 1; x <= sw_custfltr::numother; x++)
@@ -447,7 +447,7 @@ void ui_menu_swcustom_filter::populate()
// add filter items
arrow_flags = get_arrow_flags((int)UI_SW_UNAVAILABLE + 1, (int)UI_SW_LAST - 1, sw_custfltr::other[x]);
- item_append("Other filter", sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));
+ item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));
if (m_added)
selected = item.size() - 2;
@@ -501,10 +501,10 @@ void ui_menu_swcustom_filter::populate()
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
if (sw_custfltr::numother > 0)
- item_append("Remove last filter", nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
+ item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
if (sw_custfltr::numother < MAX_CUST_FILTER - 2)
- item_append("Add filter", nullptr, 0, (void *)(FPTR)ADD_FILTER);
+ item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
@@ -520,7 +520,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float
ui_manager &mui = machine().ui();
// get the size of the text
- mui.draw_text_full(container, "Select custom filters:", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = MAX(width, origx2 - origx1);
@@ -540,7 +540,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Select custom filters:", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
diff --git a/src/emu/ui/custui.cpp b/src/emu/ui/custui.cpp
index 355f486918a..6492faebabf 100644
--- a/src/emu/ui/custui.cpp
+++ b/src/emu/ui/custui.cpp
@@ -16,7 +16,11 @@
#include "ui/utils.h"
#include <algorithm>
-const char *ui_menu_custom_ui::hide_status[] = { "Show All", "Hide Filters", "Hide Info/Image", "Hide Both" };
+const char *ui_menu_custom_ui::hide_status[] = {
+ __("Show All"),
+ __("Hide Filters"),
+ __("Hide Info/Image"),
+ __("Hide Both") };
//-------------------------------------------------
// ctor
@@ -24,6 +28,22 @@ const char *ui_menu_custom_ui::hide_status[] = { "Show All", "Hide Filters", "Hi
ui_menu_custom_ui::ui_menu_custom_ui(running_machine &machine, render_container *container) : ui_menu(machine, container)
{
+ // load languages
+ file_enumerator path(machine.options().language_path());
+ const char *lang = machine.options().language();
+ const osd_directory_entry *dirent;
+ int cnt = 0;
+ while ((dirent = path.next()) != nullptr)
+ if (dirent->type == ENTTYPE_DIR && strcmp(dirent->name, ".") != 0 && strcmp(dirent->name, "..") != 0)
+ {
+ auto name = std::string(dirent->name);
+ int i = strreplace(name, "_", " (");
+ if (i > 0) name = name.append(")");
+ m_lang.push_back(name);
+ if (strcmp(name.c_str(), lang) == 0)
+ m_currlang = cnt;
+ ++cnt;
+ }
}
//-------------------------------------------------
@@ -34,6 +54,12 @@ ui_menu_custom_ui::~ui_menu_custom_ui()
{
std::string error_string;
machine().ui().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string);
+ if (!m_lang.empty())
+ {
+ machine().options().set_value(OPTION_LANGUAGE, m_lang[m_currlang].c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(OPTION_LANGUAGE);
+ load_translation(machine().options());
+ }
ui_globals::reset = true;
}
@@ -50,34 +76,50 @@ void ui_menu_custom_ui::handle()
if (m_event != nullptr && m_event->itemref != nullptr)
{
- if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
- {
- changed = true;
- (m_event->iptkey == IPT_UI_RIGHT) ? ui_globals::panels_status++ : ui_globals::panels_status--;
- }
-
-
- else if (m_event->iptkey == IPT_UI_SELECT)
+ switch ((FPTR)m_event->itemref)
{
- switch ((FPTR)m_event->itemref)
- {
- case FONT_MENU:
+ case FONT_MENU:
+ if (m_event->iptkey == IPT_UI_SELECT)
ui_menu::stack_push(global_alloc_clear<ui_menu_font_ui>(machine(), container));
- break;
-
- case COLORS_MENU:
+ break;
+ case COLORS_MENU:
+ if (m_event->iptkey == IPT_UI_SELECT)
ui_menu::stack_push(global_alloc_clear<ui_menu_colors_ui>(machine(), container));
- break;
- case HIDE_MENU:
+ break;
+ case HIDE_MENU:
+ {
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ changed = true;
+ (m_event->iptkey == IPT_UI_RIGHT) ? ui_globals::panels_status++ : ui_globals::panels_status--;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
{
int total = ARRAY_LENGTH(hide_status);
std::vector<std::string> s_sel(total);
for (int index = 0; index < total; ++index)
- s_sel[index] = hide_status[index];
+ s_sel[index] = _(hide_status[index]);
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ui_globals::panels_status));
}
}
+ case LANGUAGE_MENU:
+ {
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ changed = true;
+ (m_event->iptkey == IPT_UI_RIGHT) ? m_currlang++ : m_currlang--;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ int total = m_lang.size();
+ std::vector<std::string> s_sel(total);
+ for (int index = 0; index < total; ++index)
+ s_sel[index] = m_lang[index];
+
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, m_currlang));
+ }
+ }
}
}
@@ -91,11 +133,18 @@ void ui_menu_custom_ui::handle()
void ui_menu_custom_ui::populate()
{
- item_append("Fonts", nullptr, 0, (void *)(FPTR)FONT_MENU);
- item_append("Colors", nullptr, 0, (void *)(FPTR)COLORS_MENU);
+ UINT32 arrow_flags;
+ item_append(_("Fonts"), nullptr, 0, (void *)(FPTR)FONT_MENU);
+ item_append(_("Colors"), nullptr, 0, (void *)(FPTR)COLORS_MENU);
+
+ if (!m_lang.empty())
+ {
+ arrow_flags = get_arrow_flags(0, m_lang.size() - 1, m_currlang);
+ item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(FPTR)LANGUAGE_MENU);
+ }
- UINT32 arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, ui_globals::panels_status);
- item_append("Filters and Info/Image", hide_status[ui_globals::panels_status], arrow_flags, (void *)(FPTR)HIDE_MENU);
+ arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, ui_globals::panels_status);
+ item_append(_("Show side panels"), _(hide_status[ui_globals::panels_status]), arrow_flags, (void *)(FPTR)HIDE_MENU);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
@@ -110,7 +159,7 @@ void ui_menu_custom_ui::custom_render(void *selectedref, float top, float bottom
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Custom UI Settings", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -130,7 +179,7 @@ void ui_menu_custom_ui::custom_render(void *selectedref, float top, float bottom
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Custom UI Settings", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
@@ -143,7 +192,7 @@ ui_menu_font_ui::ui_menu_font_ui(running_machine &machine, render_container *con
ui_options &moptions = machine.ui().options();
#ifdef UI_WINDOWS
- std::string name(machine.ui().options().ui_font());
+ std::string name(machine.options().ui_font());
list();
m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0);
@@ -236,7 +285,8 @@ ui_menu_font_ui::~ui_menu_font_ui()
if (m_bold)
name.insert(0, "[B]");
}
- moptions.set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(OPTION_UI_FONT);
#endif
moptions.set_value(OPTION_INFOS_SIZE, m_info_size, OPTION_PRIORITY_CMDLINE, error_string);
@@ -317,18 +367,18 @@ void ui_menu_font_ui::populate()
// add fonts option
arrow_flags = get_arrow_flags(0, m_fonts.size() - 1, m_actual);
std::string name(m_fonts[m_actual]);
- item_append("UI Font", name.c_str(), arrow_flags, (void *)(FPTR)MUI_FNT);
+ item_append(_("UI Font"), name.c_str(), arrow_flags, (void *)(FPTR)MUI_FNT);
if (name != "default")
{
- item_append("Bold", m_bold ? "On" : "Off", m_bold ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_BOLD);
- item_append("Italic", m_italic ? "On" : "Off", m_italic ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_ITALIC);
+ item_append(_("Bold"), m_bold ? "On" : "Off", m_bold ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_BOLD);
+ item_append(_("Italic"), m_italic ? "On" : "Off", m_italic ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_ITALIC);
}
#endif
arrow_flags = get_arrow_flags(m_font_min, m_font_max, m_font_size);
strprintf(tmptxt, "%2d", m_font_size);
- item_append("Lines", tmptxt.c_str(), arrow_flags, (void *)(FPTR)FONT_SIZE);
+ item_append(_("Lines"), tmptxt.c_str(), arrow_flags, (void *)(FPTR)FONT_SIZE);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
@@ -336,7 +386,7 @@ void ui_menu_font_ui::populate()
tmptxt.clear();
strprintf(tmptxt, "%3.2f", m_info_size);
arrow_flags = get_arrow_flags(m_info_min, m_info_max, m_info_size);
- item_append("Infos text size", tmptxt.c_str(), arrow_flags, (void *)(FPTR)INFOS_SIZE);
+ item_append(_("Infos text size"), tmptxt.c_str(), arrow_flags, (void *)(FPTR)INFOS_SIZE);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
@@ -353,7 +403,7 @@ void ui_menu_font_ui::custom_render(void *selectedref, float top, float bottom,
ui_manager &mui = machine().ui();
// top text
- std::string topbuf("UI Fonts Settings");
+ std::string topbuf(_("UI Fonts Settings"));
mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
@@ -380,7 +430,7 @@ void ui_menu_font_ui::custom_render(void *selectedref, float top, float bottom,
if ((FPTR)selectedref == INFOS_SIZE)
{
- topbuf = "Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
+ topbuf = _("Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr, m_info_size);
@@ -478,25 +528,25 @@ void ui_menu_colors_ui::handle()
void ui_menu_colors_ui::populate()
{
- item_append("Normal text", nullptr, 0, (void *)(FPTR)MUI_TEXT_COLOR);
- item_append("Selected color", nullptr, 0, (void *)(FPTR)MUI_SELECTED_COLOR);
- item_append("Normal text background", nullptr, 0, (void *)(FPTR)MUI_TEXT_BG_COLOR);
- item_append("Selected background color", nullptr, 0, (void *)(FPTR)MUI_SELECTED_BG_COLOR);
- item_append("Subitem color", nullptr, 0, (void *)(FPTR)MUI_SUBITEM_COLOR);
- item_append("Clone", nullptr, 0, (void *)(FPTR)MUI_CLONE_COLOR);
- item_append("Border", nullptr, 0, (void *)(FPTR)MUI_BORDER_COLOR);
- item_append("Background", nullptr, 0, (void *)(FPTR)MUI_BACKGROUND_COLOR);
- item_append("Dipswitch", nullptr, 0, (void *)(FPTR)MUI_DIPSW_COLOR);
- item_append("Unavailable color", nullptr, 0, (void *)(FPTR)MUI_UNAVAILABLE_COLOR);
- item_append("Slider color", nullptr, 0, (void *)(FPTR)MUI_SLIDER_COLOR);
- item_append("Gfx viewer background", nullptr, 0, (void *)(FPTR)MUI_GFXVIEWER_BG_COLOR);
- item_append("Mouse over color", nullptr, 0, (void *)(FPTR)MUI_MOUSEOVER_COLOR);
- item_append("Mouse over background color", nullptr, 0, (void *)(FPTR)MUI_MOUSEOVER_BG_COLOR);
- item_append("Mouse down color", nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_COLOR);
- item_append("Mouse down background color", nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_BG_COLOR);
+ item_append(_("Normal text"), nullptr, 0, (void *)(FPTR)MUI_TEXT_COLOR);
+ item_append(_("Selected color"), nullptr, 0, (void *)(FPTR)MUI_SELECTED_COLOR);
+ item_append(_("Normal text background"), nullptr, 0, (void *)(FPTR)MUI_TEXT_BG_COLOR);
+ item_append(_("Selected background color"), nullptr, 0, (void *)(FPTR)MUI_SELECTED_BG_COLOR);
+ item_append(_("Subitem color"), nullptr, 0, (void *)(FPTR)MUI_SUBITEM_COLOR);
+ item_append(_("Clone"), nullptr, 0, (void *)(FPTR)MUI_CLONE_COLOR);
+ item_append(_("Border"), nullptr, 0, (void *)(FPTR)MUI_BORDER_COLOR);
+ item_append(_("Background"), nullptr, 0, (void *)(FPTR)MUI_BACKGROUND_COLOR);
+ item_append(_("Dipswitch"), nullptr, 0, (void *)(FPTR)MUI_DIPSW_COLOR);
+ item_append(_("Unavailable color"), nullptr, 0, (void *)(FPTR)MUI_UNAVAILABLE_COLOR);
+ item_append(_("Slider color"), nullptr, 0, (void *)(FPTR)MUI_SLIDER_COLOR);
+ item_append(_("Gfx viewer background"), nullptr, 0, (void *)(FPTR)MUI_GFXVIEWER_BG_COLOR);
+ item_append(_("Mouse over color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEOVER_COLOR);
+ item_append(_("Mouse over background color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEOVER_BG_COLOR);
+ item_append(_("Mouse down color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_COLOR);
+ item_append(_("Mouse down background color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_BG_COLOR);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("Restore originals colors", nullptr, 0, (void *)(FPTR)MUI_RESTORE);
+ item_append(_("Restore originals colors"), nullptr, 0, (void *)(FPTR)MUI_RESTORE);
custombottom = customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
}
@@ -512,7 +562,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom
float line_height = mui.get_line_height();
// top text
- std::string topbuf("UI Colors Settings");
+ std::string topbuf(_("UI Colors Settings"));
mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
@@ -540,7 +590,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom
// bottom text
// get the text for 'UI Select'
std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
- topbuf.assign("Double click or press ").append(ui_select_text.c_str()).append(" to change the color value");
+ topbuf.assign(_("Double click or press ")).append(ui_select_text.c_str()).append(_(" to change the color value"));
mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
@@ -566,7 +616,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// compute maxwidth
- topbuf = "Menu Preview";
+ topbuf = _("Menu Preview");
mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
@@ -574,11 +624,11 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom
std::string sampletxt[5];
- sampletxt[0] = "Normal";
- sampletxt[1] = "Subitem";
- sampletxt[2] = "Selected";
- sampletxt[3] = "Mouse Over";
- sampletxt[4] = "Clone";
+ sampletxt[0] = _("Normal");
+ sampletxt[1] = _("Subitem");
+ sampletxt[2] = _("Selected");
+ sampletxt[3] = _("Mouse Over");
+ sampletxt[4] = _("Clone");
for (auto & elem: sampletxt)
{
@@ -844,7 +894,7 @@ void ui_menu_rgb_ui::populate()
item_append("Blue", s_text.c_str(), 0, (void *)(FPTR)RGB_BLUE);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("Choose from palette", nullptr, 0, (void *)(FPTR)PALETTE_CHOOSE);
+ item_append(_("Choose from palette"), nullptr, 0, (void *)(FPTR)PALETTE_CHOOSE);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
custombottom = customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
@@ -860,7 +910,7 @@ void ui_menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, f
ui_manager &mui = machine().ui();
// top text
- std::string topbuf = std::string(m_title).append(" - ARGB Settings");
+ std::string topbuf = std::string(m_title).append(_(" - ARGB Settings"));
mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
@@ -884,7 +934,7 @@ void ui_menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, f
mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
- std::string sampletxt("Color preview =");
+ std::string sampletxt(_("Color preview ="));
maxwidth = origx2 - origx1;
mui.draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
diff --git a/src/emu/ui/custui.h b/src/emu/ui/custui.h
index 79f45cc3a6e..0a2caf8de8c 100644
--- a/src/emu/ui/custui.h
+++ b/src/emu/ui/custui.h
@@ -34,11 +34,14 @@ public:
private:
enum
{
- FONT_MENU = 1,
+ LANGUAGE_MENU = 1,
+ FONT_MENU,
COLORS_MENU,
HIDE_MENU
};
static const char *hide_status[];
+ std::vector<std::string> m_lang;
+ UINT16 m_currlang;
};
//-------------------------------------------------
diff --git a/src/emu/ui/datmenu.cpp b/src/emu/ui/datmenu.cpp
index 5e2d574edc0..ba8dde22bad 100644
--- a/src/emu/ui/datmenu.cpp
+++ b/src/emu/ui/datmenu.cpp
@@ -56,9 +56,9 @@ ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container
issoft = true;
if (machine.datfile().has_software(m_list, m_short, m_parent))
- m_items_list.emplace_back("Software History", UI_HISTORY_LOAD, machine.datfile().rev_history());
+ m_items_list.emplace_back(_("Software History"), UI_HISTORY_LOAD, machine.datfile().rev_history());
if (swinfo && !swinfo->usage.empty())
- m_items_list.emplace_back("Software Usage", 0, "");
+ m_items_list.emplace_back(_("Software Usage"), 0, "");
}
//-------------------------------------------------
@@ -196,7 +196,7 @@ void ui_menu_dats_view::custom_render(void *selectedref, float top, float bottom
// bottom
std::string revision;
- revision.assign("Revision: ").append(m_items_list[actual].revision);
+ revision.assign(_("Revision: ")).append(m_items_list[actual].revision);
mui.draw_text_full(container, revision.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
@@ -288,16 +288,16 @@ void ui_menu_dats_view::init_items()
{
datfile_manager &datfile = machine().datfile();
if (datfile.has_history(m_driver))
- m_items_list.emplace_back("History", UI_HISTORY_LOAD, datfile.rev_history());
+ m_items_list.emplace_back(_("History"), UI_HISTORY_LOAD, datfile.rev_history());
if (datfile.has_mameinfo(m_driver))
- m_items_list.emplace_back("Mameinfo", UI_MAMEINFO_LOAD, datfile.rev_mameinfo());
+ m_items_list.emplace_back(_("Mameinfo"), UI_MAMEINFO_LOAD, datfile.rev_mameinfo());
if (datfile.has_messinfo(m_driver))
- m_items_list.emplace_back("Messinfo", UI_MESSINFO_LOAD, datfile.rev_messinfo());
+ m_items_list.emplace_back(_("Messinfo"), UI_MESSINFO_LOAD, datfile.rev_messinfo());
if (datfile.has_sysinfo(m_driver))
- m_items_list.emplace_back("Sysinfo", UI_SYSINFO_LOAD, datfile.rev_sysinfo());
+ m_items_list.emplace_back(_("Sysinfo"), UI_SYSINFO_LOAD, datfile.rev_sysinfo());
if (datfile.has_story(m_driver))
- m_items_list.emplace_back("Mamescore", UI_STORY_LOAD, datfile.rev_storyinfo());
+ m_items_list.emplace_back(_("Mamescore"), UI_STORY_LOAD, datfile.rev_storyinfo());
if (datfile.has_command(m_driver))
- m_items_list.emplace_back("Command", UI_COMMAND_LOAD, "");
+ m_items_list.emplace_back(_("Command"), UI_COMMAND_LOAD, "");
}
diff --git a/src/emu/ui/dirmenu.cpp b/src/emu/ui/dirmenu.cpp
index 3ac9803cee6..f1cc16bae0b 100644
--- a/src/emu/ui/dirmenu.cpp
+++ b/src/emu/ui/dirmenu.cpp
@@ -16,61 +16,289 @@
#include "ui/utils.h"
#include "ui/optsmenu.h"
+static int ADDING = 1;
+static int CHANGE = 2;
+
struct folders_entry
{
const char *name;
const char *option;
+ const int action;
};
-static const folders_entry s_folders_entry[] =
+static const folders_entry s_folders[] =
{
- { "ROMs", OPTION_MEDIAPATH },
- { "UI", OPTION_UI_PATH },
- { "Samples", OPTION_SAMPLEPATH },
- { "DATs", OPTION_HISTORY_PATH },
- { "INIs", OPTION_INIPATH },
- { "Extra INIs", OPTION_EXTRAINI_PATH },
- { "Icons", OPTION_ICONS_PATH },
- { "Cheats", OPTION_CHEATPATH },
- { "Snapshots", OPTION_SNAPSHOT_DIRECTORY },
- { "Cabinets", OPTION_CABINETS_PATH },
- { "Flyers", OPTION_FLYERS_PATH },
- { "Titles", OPTION_TITLES_PATH },
- { "Ends", OPTION_ENDS_PATH },
- { "PCBs", OPTION_PCBS_PATH },
- { "Marquees", OPTION_MARQUEES_PATH },
- { "Controls Panels", OPTION_CPANELS_PATH },
- { "Crosshairs", OPTION_CROSSHAIRPATH },
- { "Artworks", OPTION_ARTPATH },
- { "Bosses", OPTION_BOSSES_PATH },
- { "Artworks Preview", OPTION_ARTPREV_PATH },
- { "Select", OPTION_SELECT_PATH },
- { "GameOver", OPTION_GAMEOVER_PATH },
- { "HowTo", OPTION_HOWTO_PATH },
- { "Logos", OPTION_LOGOS_PATH },
- { "Scores", OPTION_SCORES_PATH },
- { "Versus", OPTION_VERSUS_PATH },
- { nullptr }
+ { __("ROMs"), OPTION_MEDIAPATH, ADDING },
+ { __("UI"), OPTION_UI_PATH, CHANGE },
+ { __("Language"), OPTION_LANGUAGEPATH, CHANGE },
+ { __("Samples"), OPTION_SAMPLEPATH, ADDING },
+ { __("DATs"), OPTION_HISTORY_PATH, CHANGE },
+ { __("INIs"), OPTION_INIPATH, ADDING },
+ { __("Extra INIs"), OPTION_EXTRAINI_PATH, CHANGE },
+ { __("Icons"), OPTION_ICONS_PATH, ADDING },
+ { __("Cheats"), OPTION_CHEATPATH, ADDING },
+ { __("Snapshots"), OPTION_SNAPSHOT_DIRECTORY, ADDING },
+ { __("Cabinets"), OPTION_CABINETS_PATH, ADDING },
+ { __("Flyers"), OPTION_FLYERS_PATH, ADDING },
+ { __("Titles"), OPTION_TITLES_PATH, ADDING },
+ { __("Ends"), OPTION_ENDS_PATH, ADDING },
+ { __("PCBs"), OPTION_PCBS_PATH, ADDING },
+ { __("Marquees"), OPTION_MARQUEES_PATH, ADDING },
+ { __("Controls Panels"), OPTION_CPANELS_PATH, ADDING },
+ { __("Crosshairs"), OPTION_CROSSHAIRPATH, ADDING },
+ { __("Artworks"), OPTION_ARTPATH, ADDING },
+ { __("Bosses"), OPTION_BOSSES_PATH, ADDING },
+ { __("Artworks Preview"), OPTION_ARTPREV_PATH, ADDING },
+ { __("Select"), OPTION_SELECT_PATH, ADDING },
+ { __("GameOver"), OPTION_GAMEOVER_PATH, ADDING },
+ { __("HowTo"), OPTION_HOWTO_PATH, ADDING },
+ { __("Logos"), OPTION_LOGOS_PATH, ADDING },
+ { __("Scores"), OPTION_SCORES_PATH, ADDING },
+ { __("Versus"), OPTION_VERSUS_PATH, ADDING },
};
+
+/**************************************************
+ MENU DIRECTORY
+**************************************************/
+//-------------------------------------------------
+// ctor / dtor
+//-------------------------------------------------
+
+ui_menu_directory::ui_menu_directory(running_machine &machine, render_container *container) : ui_menu(machine, container)
+{
+}
+
+ui_menu_directory::~ui_menu_directory()
+{
+ save_ui_options(machine());
+ ui_globals::reset = true;
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_directory::handle()
+{
+ // process the menu
+ const ui_menu_event *m_event = process(0);
+
+ if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_display_actual>(machine(), container, selected));
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_directory::populate()
+{
+
+ for (auto & elem : s_folders)
+ item_append(_(elem.name), nullptr, 0, (void *)(FPTR)elem.action);
+
+ item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
+ customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_directory::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width;
+ ui_manager &mui = machine().ui();
+
+ // get the size of the text
+ mui.draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
+ float maxwidth = MAX(width, origx2 - origx1);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+}
+
+/**************************************************
+ MENU DISPLAY PATH
+**************************************************/
+//-------------------------------------------------
+// ctor / dtor
+//-------------------------------------------------
+
+ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref)
+ : ui_menu(machine, container), m_ref(ref)
+{
+}
+
+ui_menu_display_actual::~ui_menu_display_actual()
+{
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_display_actual::handle()
+{
+ // process the menu
+ const ui_menu_event *m_event = process(0);
+ if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
+ switch ((FPTR)m_event->itemref)
+ {
+ case REMOVE:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_remove_folder>(machine(), container, m_ref));
+ break;
+
+ case ADD_CHANGE:
+ ui_menu::stack_push(global_alloc_clear<ui_menu_add_change_folder>(machine(), container, m_ref));
+ break;
+ }
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_display_actual::populate()
+{
+ m_tempbuf.assign(_("Current ")).append(_(s_folders[m_ref].name)).append(_(" Folders"));
+ if (machine().ui().options().exists(s_folders[m_ref].option)) {
+ m_searchpath.assign(machine().ui().options().value(s_folders[m_ref].option));
+ }
+ else {
+ m_searchpath.assign(machine().options().value(s_folders[m_ref].option));
+ }
+ path_iterator path(m_searchpath.c_str());
+ std::string curpath;
+ m_folders.clear();
+ while (path.next(curpath, nullptr))
+ m_folders.push_back(curpath);
+
+ item_append((s_folders[m_ref].action == CHANGE) ? _("Change Folder") : _("Add Folder"), nullptr, 0, (void *)ADD_CHANGE);
+
+ if (m_folders.size() > 1)
+ item_append(_("Remove Folder"), nullptr, 0, (void *)REMOVE);
+
+ item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
+ customtop = (m_folders.size() + 1) * machine().ui().get_line_height() + 6.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_display_actual::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width, maxwidth = origx2 - origx1;
+ ui_manager &mui = machine().ui();
+ float lineh = mui.get_line_height();
+
+ for (auto & elem : m_folders)
+ {
+ mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
+ maxwidth = MAX(maxwidth, width);
+ }
+
+ // get the size of the text
+ mui.draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
+ maxwidth = MAX(width, maxwidth);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = y1 + lineh + 2.0f * UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ // compute our bounds
+ x1 = 0.5f - 0.5f * maxwidth;
+ x2 = x1 + maxwidth;
+ y1 = y2 + 2.0f * UI_BOX_TB_BORDER;
+ y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ for (auto & elem : m_folders)
+ {
+ mui.draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_TRUNCATE,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+ y1 += lineh;
+ }
+
+}
+
/**************************************************
- MENU ADD FOLDER
+MENU ADD FOLDER
**************************************************/
//-------------------------------------------------
// ctor / dtor
//-------------------------------------------------
-ui_menu_add_change_folder::ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref, bool _change) : ui_menu(machine, container)
+ui_menu_add_change_folder::ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
{
- m_ref = ref - 1;
- m_change = _change;
+ m_ref = ref;
+ m_change = (s_folders[ref].action == CHANGE);
m_search[0] = '\0';
- // configure the starting's path
+ // configure the starting path
char *dst = nullptr;
osd_get_full_path(&dst, ".");
m_current_path = dst;
osd_free(dst);
+
+ std::string searchpath;
+ if (machine.ui().options().exists(s_folders[m_ref].option))
+ {
+ searchpath = machine.ui().options().value(s_folders[m_ref].option);
+ }
+ else
+ {
+ searchpath = machine.options().value(s_folders[m_ref].option);
+ }
+
+ path_iterator path(searchpath.c_str());
+ std::string curpath;
+ while (path.next(curpath, nullptr))
+ m_folders.push_back(curpath);
+
}
ui_menu_add_change_folder::~ui_menu_add_change_folder()
@@ -144,38 +372,41 @@ void ui_menu_add_change_folder::handle()
std::string error_string;
if (m_change)
{
- if (machine().ui().options().exists(s_folders_entry[m_ref].option))
+ if (machine().ui().options().exists(s_folders[m_ref].option))
{
- machine().ui().options().set_value(s_folders_entry[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().ui().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
}
- else {
- if (strcmp(machine().options().value(s_folders_entry[m_ref].option), m_current_path.c_str()) != 0)
+ else
+ {
+ if (strcmp(machine().options().value(s_folders[m_ref].option), m_current_path.c_str()) != 0)
{
- machine().options().set_value(s_folders_entry[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
- machine().options().mark_changed(s_folders_entry[m_ref].option);
+ machine().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(s_folders[m_ref].option);
}
}
machine().datfile().reset_run();
}
else
{
+ m_folders.push_back(m_current_path);
std::string tmppath;
- if (machine().ui().options().exists(s_folders_entry[m_ref].option)) {
- tmppath.assign(machine().ui().options().value(s_folders_entry[m_ref].option)).append(";").append(m_current_path.c_str());
- }
- else {
- tmppath.assign(machine().options().value(s_folders_entry[m_ref].option)).append(";").append(m_current_path.c_str());
+ for (int x = 0; x < m_folders.size(); ++x)
+ {
+ tmppath.append(m_folders[x]);
+ if (x != m_folders.size() - 1)
+ tmppath.append(";");
}
-
- if (machine().ui().options().exists(s_folders_entry[m_ref].option))
+
+ if (machine().ui().options().exists(s_folders[m_ref].option))
{
- machine().ui().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
}
- else {
- if (strcmp(machine().options().value(s_folders_entry[m_ref].option), tmppath.c_str()) != 0)
+ else
+ {
+ if (strcmp(machine().options().value(s_folders[m_ref].option), tmppath.c_str()) != 0)
{
- machine().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
- machine().options().mark_changed(s_folders_entry[m_ref].option);
+ machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(s_folders[m_ref].option);
}
}
}
@@ -227,6 +458,7 @@ void ui_menu_add_change_folder::handle()
}
}
}
+ top_line = selected - (visible_lines / 2);
}
}
else if (m_event->iptkey == IPT_UI_CANCEL)
@@ -277,15 +509,15 @@ void ui_menu_add_change_folder::custom_render(void *selectedref, float top, floa
float width, maxwidth = origx2 - origx1;
ui_manager &mui = machine().ui();
std::string tempbuf[2];
- tempbuf[0] = (m_change) ? "Change" : "Add";
- tempbuf[0].append(" ").append(s_folders_entry[m_ref].name).append(" Folder - Search: ").append(m_search).append("_");
+ tempbuf[0] = (m_change) ? _("Change)") : _("Add");
+ tempbuf[0].append(" ").append(_(s_folders[m_ref].name)).append(_(" Folder - Search: ")).append(m_search).append("_");
tempbuf[1] = m_current_path;
// get the size of the text
- for (auto & elem: tempbuf)
+ for (auto & elem : tempbuf)
{
mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
- DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
maxwidth = MAX(width, maxwidth);
}
@@ -313,7 +545,7 @@ void ui_menu_add_change_folder::custom_render(void *selectedref, float top, floa
}
// bottom text
- tempbuf[0] = "Press TAB to set";
+ tempbuf[0] = _("Press TAB to set");
mui.draw_text_full(container, tempbuf[0].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
@@ -341,261 +573,24 @@ void ui_menu_add_change_folder::custom_render(void *selectedref, float top, floa
}
/**************************************************
- MENU DIRECTORY
-**************************************************/
-//-------------------------------------------------
-// ctor / dtor
-//-------------------------------------------------
-
-ui_menu_directory::ui_menu_directory(running_machine &machine, render_container *container) : ui_menu(machine, container)
-{
-}
-
-ui_menu_directory::~ui_menu_directory()
-{
- save_ui_options(machine());
- ui_globals::reset = true;
-}
-
-//-------------------------------------------------
-// handle
-//-------------------------------------------------
-
-void ui_menu_directory::handle()
-{
- // process the menu
- const ui_menu_event *m_event = process(0);
-
- if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
- {
- int ref = (FPTR)m_event->itemref;
- bool change = (ref == HISTORY_FOLDERS || ref == EXTRAINI_FOLDERS || ref == UI_FOLDERS);
- ui_menu::stack_push(global_alloc_clear<ui_menu_display_actual>(machine(), container, ref, change));
- }
-}
-
-//-------------------------------------------------
-// populate
-//-------------------------------------------------
-
-void ui_menu_directory::populate()
-{
- item_append("Roms", nullptr, 0, (void *)(FPTR)ROM_FOLDERS);
- item_append("UI", nullptr, 0, (void *)(FPTR)UI_FOLDERS);
- item_append("Samples", nullptr, 0, (void *)(FPTR)SAMPLE_FOLDERS);
- item_append("INIs", nullptr, 0, (void *)(FPTR)INI_FOLDERS);
- item_append("Artwork", nullptr, 0, (void *)(FPTR)ARTWORK_FOLDERS);
- item_append("DATs (History, Mameinfo, etc...)", nullptr, 0, (void *)(FPTR)HISTORY_FOLDERS);
- item_append("Extra INI (Category, etc...)", nullptr, 0, (void *)(FPTR)EXTRAINI_FOLDERS);
- item_append("Icons", nullptr, 0, (void *)(FPTR)ICON_FOLDERS);
- item_append("Cheats", nullptr, 0, (void *)(FPTR)CHEAT_FOLDERS);
- item_append("Snapshots", nullptr, 0, (void *)(FPTR)SNAPSHOT_FOLDERS);
- item_append("Cabinets", nullptr, 0, (void *)(FPTR)CABINET_FOLDERS);
- item_append("Flyers", nullptr, 0, (void *)(FPTR)FLYER_FOLDERS);
- item_append("Titles", nullptr, 0, (void *)(FPTR)TITLE_FOLDERS);
- item_append("Ends", nullptr, 0, (void *)(FPTR)ENDS_FOLDERS);
- item_append("PCBs", nullptr, 0, (void *)(FPTR)PCB_FOLDERS);
- item_append("Marquees", nullptr, 0, (void *)(FPTR)MARQUEES_FOLDERS);
- item_append("Control Panels", nullptr, 0, (void *)(FPTR)CPANEL_FOLDERS);
- item_append("Bosses", nullptr, 0, (void *)(FPTR)BOSSES_FOLDERS);
- item_append("Versus", nullptr, 0, (void *)(FPTR)VERSUS_FOLDERS);
- item_append("Game Over", nullptr, 0, (void *)(FPTR)GAMEOVER_FOLDERS);
- item_append("How To", nullptr, 0, (void *)(FPTR)HOWTO_FOLDERS);
- item_append("Select", nullptr, 0, (void *)(FPTR)SELECT_FOLDERS);
- item_append("Artwork Preview", nullptr, 0, (void *)(FPTR)ARTPREV_FOLDERS);
- item_append("Scores", nullptr, 0, (void *)(FPTR)SCORES_FOLDERS);
- item_append("Logos", nullptr, 0, (void *)(FPTR)LOGO_FOLDERS);
- item_append("Crosshairs", nullptr, 0, (void *)(FPTR)CROSSHAIR_FOLDERS);
-
- item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
-}
-
-//-------------------------------------------------
-// perform our special rendering
-//-------------------------------------------------
-
-void ui_menu_directory::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
-{
- float width;
- ui_manager &mui = machine().ui();
-
- // get the size of the text
- mui.draw_text_full(container, "Folder Setup", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
- DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
- width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
- float maxwidth = MAX(width, origx2 - origx1);
-
- // compute our bounds
- float x1 = 0.5f - 0.5f * maxwidth;
- float x2 = x1 + maxwidth;
- float y1 = origy1 - top;
- float y2 = origy1 - UI_BOX_TB_BORDER;
-
- // draw a box
- mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
-
- // take off the borders
- x1 += UI_BOX_LR_BORDER;
- x2 -= UI_BOX_LR_BORDER;
- y1 += UI_BOX_TB_BORDER;
-
- // draw the text within it
- mui.draw_text_full(container, "Folder Setup", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
- DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
-}
-
-/**************************************************
- MENU DISPLAY PATH
+ MENU REMOVE FOLDER
**************************************************/
//-------------------------------------------------
// ctor / dtor
//-------------------------------------------------
-ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref, bool _change) : ui_menu(machine, container)
+ui_menu_remove_folder::ui_menu_remove_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
{
m_ref = ref;
- m_change = _change;
-}
-
-ui_menu_display_actual::~ui_menu_display_actual()
-{
-}
-
-//-------------------------------------------------
-// handle
-//-------------------------------------------------
-
-void ui_menu_display_actual::handle()
-{
- // process the menu
- const ui_menu_event *m_event = process(0);
- if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
- switch ((FPTR)m_event->itemref)
- {
- case REMOVE_FOLDER:
- ui_menu::stack_push(global_alloc_clear<ui_menu_remove_folder>(machine(), container, m_ref));
- break;
-
- case ADD_FOLDER:
- case CHANGE_FOLDER:
- ui_menu::stack_push(global_alloc_clear<ui_menu_add_change_folder>(machine(), container, m_ref, m_change));
- break;
- }
-}
-
-//-------------------------------------------------
-// populate
-//-------------------------------------------------
+ if (machine.ui().options().exists(s_folders[m_ref].option))
+ m_searchpath.assign(machine.ui().options().value(s_folders[m_ref].option));
+ else
+ m_searchpath.assign(machine.options().value(s_folders[m_ref].option));
-void ui_menu_display_actual::populate()
-{
- m_tempbuf.assign("Current ").append(s_folders_entry[m_ref - 1].name).append(" Folders");
- if (machine().ui().options().exists(s_folders_entry[m_ref - 1].option)) {
- m_searchpath.assign(machine().ui().options().value(s_folders_entry[m_ref - 1].option));
- }
- else {
- m_searchpath.assign(machine().options().value(s_folders_entry[m_ref - 1].option));
- }
path_iterator path(m_searchpath.c_str());
std::string curpath;
- m_folders.clear();
while (path.next(curpath, nullptr))
m_folders.push_back(curpath);
-
- if (m_change)
- item_append("Change Folder", nullptr, 0, (void *)CHANGE_FOLDER);
- else
- item_append("Add Folder", nullptr, 0, (void *)ADD_FOLDER);
-
- if (m_folders.size() > 1)
- item_append("Remove Folder", nullptr, 0, (void *)REMOVE_FOLDER);
-
- item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- customtop = (m_folders.size() + 1) * machine().ui().get_line_height() + 6.0f * UI_BOX_TB_BORDER;
-}
-
-//-------------------------------------------------
-// perform our special rendering
-//-------------------------------------------------
-
-void ui_menu_display_actual::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
-{
- float width, maxwidth = origx2 - origx1;
- ui_manager &mui = machine().ui();
- float lineh = mui.get_line_height();
-
- for (auto & elem : m_folders)
- {
- mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
- width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
- maxwidth = MAX(maxwidth, width);
- }
-
- // get the size of the text
- mui.draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
- width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
- maxwidth = MAX(width, maxwidth);
-
- // compute our bounds
- float x1 = 0.5f - 0.5f * maxwidth;
- float x2 = x1 + maxwidth;
- float y1 = origy1 - top;
- float y2 = y1 + lineh + 2.0f * UI_BOX_TB_BORDER;
-
- // draw a box
- mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
-
- // take off the borders
- x1 += UI_BOX_LR_BORDER;
- x2 -= UI_BOX_LR_BORDER;
- y1 += UI_BOX_TB_BORDER;
-
- // draw the text within it
- mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
- DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
-
- // compute our bounds
- x1 = 0.5f - 0.5f * maxwidth;
- x2 = x1 + maxwidth;
- y1 = y2 + 2.0f * UI_BOX_TB_BORDER;
- y2 = origy1 - UI_BOX_TB_BORDER;
-
- // draw a box
- mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
-
- // take off the borders
- x1 += UI_BOX_LR_BORDER;
- x2 -= UI_BOX_LR_BORDER;
- y1 += UI_BOX_TB_BORDER;
-
- // draw the text within it
- for (auto & elem : m_folders)
- {
- mui.draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_TRUNCATE,
- DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
- y1 += lineh;
- }
-
-}
-
-/**************************************************
- MENU REMOVE FOLDER
-**************************************************/
-//-------------------------------------------------
-// ctor / dtor
-//-------------------------------------------------
-
-ui_menu_remove_folder::ui_menu_remove_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
-{
- m_ref = ref - 1;
- if (machine.ui().options().exists(s_folders_entry[m_ref].option)) {
- m_searchpath.assign(machine.ui().options().value(s_folders_entry[m_ref].option));
- }
- else {
- m_searchpath.assign(machine.options().value(s_folders_entry[m_ref].option));
- }
-
}
ui_menu_remove_folder::~ui_menu_remove_folder()
@@ -612,23 +607,25 @@ void ui_menu_remove_folder::handle()
const ui_menu_event *m_event = process(0);
if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
{
- int index = (FPTR)m_event->itemref - 1;
- std::string tmppath;
- for (size_t i = 0; i < item.size() - 2; i++)
- if (i != index)
- tmppath.append(item[i].text).append(";");
-
- tmppath.substr(0, tmppath.size() - 1);
- std::string error_string;
- if (machine().ui().options().exists(s_folders_entry[m_ref].option))
+ std::string tmppath, error_string;
+ for (int x = 0; x < m_folders.size(); ++x)
+ {
+ if (x != selected)
+ tmppath.append(m_folders[x]);
+ if (x < m_folders.size() - 1)
+ tmppath.append(";");
+ }
+
+ if (machine().ui().options().exists(s_folders[m_ref].option))
{
- machine().ui().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
}
- else {
- if (strcmp(machine().options().value(s_folders_entry[m_ref].option),tmppath.c_str())!=0)
+ else
+ {
+ if (strcmp(machine().options().value(s_folders[m_ref].option),tmppath.c_str())!=0)
{
- machine().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
- machine().options().mark_changed(s_folders_entry[m_ref].option);
+ machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(s_folders[m_ref].option);
}
}
@@ -643,12 +640,9 @@ void ui_menu_remove_folder::handle()
void ui_menu_remove_folder::populate()
{
- path_iterator path(m_searchpath.c_str());
- std::string curpath;
int folders_count = 0;
-
- while (path.next(curpath, nullptr))
- item_append(curpath.c_str(), nullptr, 0, (void *)(FPTR)++folders_count);
+ for (auto & elem : m_folders)
+ item_append(elem.c_str(), nullptr, 0, (void *)(FPTR)++folders_count);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
@@ -663,7 +657,7 @@ void ui_menu_remove_folder::custom_render(void *selectedref, float top, float bo
{
float width;
ui_manager &mui = machine().ui();
- std::string tempbuf = std::string("Remove ").append(s_folders_entry[m_ref].name).append(" Folder");
+ std::string tempbuf = std::string(_("Remove ")).append(_(s_folders[m_ref].name)).append(_(" Folder"));
// get the size of the text
mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
diff --git a/src/emu/ui/dirmenu.h b/src/emu/ui/dirmenu.h
index 47734fc6542..5c48d9ad696 100644
--- a/src/emu/ui/dirmenu.h
+++ b/src/emu/ui/dirmenu.h
@@ -25,37 +25,6 @@ public:
virtual void populate() override;
virtual void handle() override;
virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
-
-private:
- enum
- {
- ROM_FOLDERS = 1,
- UI_FOLDERS,
- SAMPLE_FOLDERS,
- HISTORY_FOLDERS,
- INI_FOLDERS,
- EXTRAINI_FOLDERS,
- ICON_FOLDERS,
- CHEAT_FOLDERS,
- SNAPSHOT_FOLDERS,
- CABINET_FOLDERS,
- FLYER_FOLDERS,
- TITLE_FOLDERS,
- ENDS_FOLDERS,
- PCB_FOLDERS,
- MARQUEES_FOLDERS,
- CPANEL_FOLDERS,
- CROSSHAIR_FOLDERS,
- ARTWORK_FOLDERS,
- BOSSES_FOLDERS,
- ARTPREV_FOLDERS,
- SELECT_FOLDERS,
- GAMEOVER_FOLDERS,
- HOWTO_FOLDERS,
- LOGO_FOLDERS,
- SCORES_FOLDERS,
- VERSUS_FOLDERS
- };
};
//-------------------------------------------------
@@ -65,7 +34,7 @@ private:
class ui_menu_display_actual : public ui_menu
{
public:
- ui_menu_display_actual(running_machine &machine, render_container *container, int selectedref, bool _change);
+ ui_menu_display_actual(running_machine &machine, render_container *container, int selectedref);
virtual ~ui_menu_display_actual();
virtual void populate() override;
virtual void handle() override;
@@ -75,13 +44,11 @@ private:
std::string m_tempbuf, m_searchpath;
std::vector<std::string> m_folders;
int m_ref;
- bool m_change;
enum
{
- ADD_FOLDER = 1,
- REMOVE_FOLDER,
- CHANGE_FOLDER
+ ADD_CHANGE = 1,
+ REMOVE,
};
};
@@ -101,6 +68,7 @@ public:
private:
std::string m_searchpath;
int m_ref;
+ std::vector<std::string> m_folders;
};
//-------------------------------------------------
@@ -110,7 +78,7 @@ private:
class ui_menu_add_change_folder : public ui_menu
{
public:
- ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref, bool change);
+ ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref);
virtual ~ui_menu_add_change_folder();
virtual void populate() override;
virtual void handle() override;
@@ -123,6 +91,7 @@ private:
std::string m_current_path;
char m_search[40];
bool m_change;
+ std::vector<std::string> m_folders;
};
#endif /* __UI_DIRMENU_H__ */
diff --git a/src/emu/ui/dsplmenu.cpp b/src/emu/ui/dsplmenu.cpp
index 57797f6281e..93cf3771133 100644
--- a/src/emu/ui/dsplmenu.cpp
+++ b/src/emu/ui/dsplmenu.cpp
@@ -79,7 +79,11 @@ ui_menu_display_options::ui_menu_display_options(running_machine &machine, rende
break;
p2 = descr.find_first_of(delim, p1 + 1);
if (p2 != std::string::npos)
+ {
+ std::string txt(descr.substr(p1, p2 - p1));
+ if (txt != "or" && txt != "none")
m_list.push_back(descr.substr(p1, p2 - p1));
+ }
else
{
m_list.push_back(descr.substr(p1));
@@ -198,7 +202,7 @@ void ui_menu_display_options::custom_render(void *selectedref, float top, float
{
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Display Options", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE,
+ mui.draw_text_full(container, _("Display Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE,
ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -218,6 +222,6 @@ void ui_menu_display_options::custom_render(void *selectedref, float top, float
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Display Options", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL,
+ mui.draw_text_full(container, _("Display Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL,
UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
diff --git a/src/emu/ui/filesel.cpp b/src/emu/ui/filesel.cpp
index 140bfdd492d..e757f537044 100644
--- a/src/emu/ui/filesel.cpp
+++ b/src/emu/ui/filesel.cpp
@@ -749,7 +749,10 @@ void ui_menu_file_selector::handle()
}
if (selected_entry != nullptr && selected_entry != cur_selected)
- set_selection((void *) selected_entry);
+ {
+ set_selection((void *)selected_entry);
+ top_line = selected - (visible_lines / 2);
+ }
}
}
else if (event->iptkey == IPT_UI_CANCEL)
diff --git a/src/emu/ui/mainmenu.cpp b/src/emu/ui/mainmenu.cpp
index bd1ac36ee48..caf531c41ef 100644
--- a/src/emu/ui/mainmenu.cpp
+++ b/src/emu/ui/mainmenu.cpp
@@ -49,113 +49,106 @@ ui_menu_main::ui_menu_main(running_machine &machine, render_container *container
void ui_menu_main::populate()
{
- std::string menu_text;
-
/* add input menu items */
- item_append("Input (general)", nullptr, 0, (void *)INPUT_GROUPS);
+ item_append(_("Input (general)"), nullptr, 0, (void *)INPUT_GROUPS);
- strprintf(menu_text, "Input (this %s)", emulator_info::get_capstartgamenoun());
- item_append(menu_text.c_str(), nullptr, 0, (void *)INPUT_SPECIFIC);
+ item_append(_("Input (this Machine)"), nullptr, 0, (void *)INPUT_SPECIFIC);
/* add optional input-related menus */
if (machine().ioport().has_analog())
- item_append("Analog Controls", nullptr, 0, (void *)ANALOG);
+ item_append(_("Analog Controls"), nullptr, 0, (void *)ANALOG);
if (machine().ioport().has_dips())
- item_append("Dip Switches", nullptr, 0, (void *)SETTINGS_DIP_SWITCHES);
+ item_append(_("Dip Switches"), nullptr, 0, (void *)SETTINGS_DIP_SWITCHES);
if (machine().ioport().has_configs())
{
- strprintf(menu_text, "%s Configuration", emulator_info::get_capstartgamenoun());
- item_append(menu_text.c_str(), nullptr, 0, (void *)SETTINGS_DRIVER_CONFIG);
+ item_append(_("Machine Configuration"), nullptr, 0, (void *)SETTINGS_DRIVER_CONFIG);
}
/* add bookkeeping menu */
- item_append("Bookkeeping Info", nullptr, 0, (void *)BOOKKEEPING);
+ item_append(_("Bookkeeping Info"), nullptr, 0, (void *)BOOKKEEPING);
/* add game info menu */
- strprintf(menu_text, "%s Information", emulator_info::get_capstartgamenoun());
- item_append(menu_text.c_str(), nullptr, 0, (void *)GAME_INFO);
+ item_append(_("Machine Information"), nullptr, 0, (void *)GAME_INFO);
image_interface_iterator imgiter(machine().root_device());
if (imgiter.first() != nullptr)
{
/* add image info menu */
- item_append("Image Information", nullptr, 0, (void *)IMAGE_MENU_IMAGE_INFO);
+ item_append(_("Image Information"), nullptr, 0, (void *)IMAGE_MENU_IMAGE_INFO);
/* add file manager menu */
- item_append("File Manager", nullptr, 0, (void *)IMAGE_MENU_FILE_MANAGER);
+ item_append(_("File Manager"), nullptr, 0, (void *)IMAGE_MENU_FILE_MANAGER);
/* add tape control menu */
cassette_device_iterator cassiter(machine().root_device());
if (cassiter.first() != nullptr)
- item_append("Tape Control", nullptr, 0, (void *)TAPE_CONTROL);
+ item_append(_("Tape Control"), nullptr, 0, (void *)TAPE_CONTROL);
}
pty_interface_iterator ptyiter(machine().root_device());
if (ptyiter.first() != nullptr) {
- item_append("Pseudo terminals", nullptr, 0, (void *)PTY_INFO);
+ item_append(_("Pseudo terminals"), nullptr, 0, (void *)PTY_INFO);
}
if (machine().ioport().has_bioses())
- item_append("Bios Selection", nullptr, 0, (void *)BIOS_SELECTION);
+ item_append(_("Bios Selection"), nullptr, 0, (void *)BIOS_SELECTION);
slot_interface_iterator slotiter(machine().root_device());
if (slotiter.first() != nullptr)
{
/* add slot info menu */
- item_append("Slot Devices", nullptr, 0, (void *)SLOT_DEVICES);
+ item_append(_("Slot Devices"), nullptr, 0, (void *)SLOT_DEVICES);
}
barcode_reader_device_iterator bcriter(machine().root_device());
if (bcriter.first() != nullptr)
{
/* add slot info menu */
- item_append("Barcode Reader", nullptr, 0, (void *)BARCODE_READ);
+ item_append(_("Barcode Reader"), nullptr, 0, (void *)BARCODE_READ);
}
network_interface_iterator netiter(machine().root_device());
if (netiter.first() != nullptr)
{
/* add image info menu */
- item_append("Network Devices", nullptr, 0, (void*)NETWORK_DEVICES);
+ item_append(_("Network Devices"), nullptr, 0, (void*)NETWORK_DEVICES);
}
/* add keyboard mode menu */
if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post())
- item_append("Keyboard Mode", nullptr, 0, (void *)KEYBOARD_MODE);
+ item_append(_("Keyboard Mode"), nullptr, 0, (void *)KEYBOARD_MODE);
/* add sliders menu */
- item_append("Slider Controls", nullptr, 0, (void *)SLIDERS);
+ item_append(_("Slider Controls"), nullptr, 0, (void *)SLIDERS);
/* add video options menu */
- item_append("Video Options", nullptr, 0, (machine().render().target_by_index(1) != nullptr) ? (void *)VIDEO_TARGETS : (void *)VIDEO_OPTIONS);
+ item_append(_("Video Options"), nullptr, 0, (machine().render().target_by_index(1) != nullptr) ? (void *)VIDEO_TARGETS : (void *)VIDEO_OPTIONS);
/* add crosshair options menu */
if (machine().crosshair().get_usage())
- item_append("Crosshair Options", nullptr, 0, (void *)CROSSHAIR);
+ item_append(_("Crosshair Options"), nullptr, 0, (void *)CROSSHAIR);
/* add cheat menu */
if (machine().options().cheat())
- item_append("Cheat", nullptr, 0, (void *)CHEAT);
+ item_append(_("Cheat"), nullptr, 0, (void *)CHEAT);
// add dats menu
if (machine().ui().options().enabled_dats() && machine().datfile().has_data(&machine().system()))
- item_append("External DAT View", nullptr, 0, (void *)EXTERNAL_DATS);
+ item_append(_("External DAT View"), nullptr, 0, (void *)EXTERNAL_DATS);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
/* add favorite menu */
if (!machine().favorite().isgame_favorite())
- item_append("Add To Favorites", nullptr, 0, (void *)ADD_FAVORITE);
+ item_append(_("Add To Favorites"), nullptr, 0, (void *)ADD_FAVORITE);
else
- item_append("Remove From Favorites", nullptr, 0, (void *)REMOVE_FAVORITE);
+ item_append(_("Remove From Favorites"), nullptr, 0, (void *)REMOVE_FAVORITE);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
-// menu_text.assign("Quit from ").append(emulator_info::get_capstartgamenoun());
-// item_append(menu_text.c_str(), nullptr, 0, (void *)QUIT_GAME);
+// item_append(_("Quit from Machine"), nullptr, 0, (void *)QUIT_GAME);
/* add reset and exit menus */
- strprintf(menu_text, "Select New %s", emulator_info::get_capstartgamenoun());
- item_append(menu_text.c_str(), nullptr, 0, (void *)SELECT_GAME);
+ item_append(_("Select New Machine"), nullptr, 0, (void *)SELECT_GAME);
}
ui_menu_main::~ui_menu_main()
diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp
index f831ffa725f..3803790c359 100644
--- a/src/emu/ui/menu.cpp
+++ b/src/emu/ui/menu.cpp
@@ -59,12 +59,12 @@ static const ui_arts_info arts_info[] =
{ nullptr }
};
-static const char *hover_msg[] = {
- "Add or remove favorites",
- "Export displayed list to file",
- "Show DATs view",
- "Setup directories",
- "Configure options"
+static const char *hover_msg[] = {
+ "Add or remove favorites",
+ "Export displayed list to file",
+ "Show DATs view",
+ "Setup directories",
+ "Configure options"
};
/***************************************************************************
@@ -249,7 +249,7 @@ void ui_menu::reset(ui_menu_reset_options options)
visitems = 0;
selected = 0;
std::string backtext;
- strprintf(backtext, "Return to %s", emulator_info::get_capstartgamenoun());
+ strprintf(backtext, "Return to Machine");
// add an item to return
if (parent == nullptr)
@@ -460,6 +460,13 @@ void ui_menu::set_selection(void *selected_itemref)
void ui_menu::draw(bool customonly, bool noimage, bool noinput)
{
+ // first draw the FPS counter
+ if (machine().ui().show_fps_counter())
+ {
+ machine().ui().draw_text_full(container, machine().video().speed_text().c_str(), 0.0f, 0.0f, 1.0f,
+ JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, nullptr, nullptr);
+ }
+
float line_height = machine().ui().get_line_height();
float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect();
float ud_arrow_width = line_height * machine().render().ui_aspect();
@@ -530,6 +537,8 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput)
machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
// determine the first visible line based on the current selection
+ if (selected > top_line + visible_lines)
+ top_line = selected - (visible_lines / 2);
if (top_line < 0 || selected == 0)
top_line = 0;
if (top_line + visible_lines >= item.size())
@@ -1251,7 +1260,7 @@ void ui_menu::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const
void ui_menu::highlight(render_container *container, float x0, float y0, float x1, float y1, rgb_t bgcolor)
{
- container->add_quad(x0, y0, x1, y1, bgcolor, hilight_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ container->add_quad(x0, y0, x1, y1, bgcolor, hilight_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE) | PRIMFLAG_PACKABLE);
}
@@ -1261,7 +1270,7 @@ void ui_menu::highlight(render_container *container, float x0, float y0, float x
void ui_menu::draw_arrow(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation)
{
- container->add_quad(x0, y0, x1, y1, fgcolor, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(orientation));
+ container->add_quad(x0, y0, x1, y1, fgcolor, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(orientation) | PRIMFLAG_PACKABLE);
}
//-------------------------------------------------
@@ -1302,7 +1311,7 @@ void ui_menu::init_ui(running_machine &machine)
star_texture = mrender.texture_alloc();
star_texture->set_bitmap(*star_bitmap, star_bitmap->cliprect(), TEXFORMAT_ARGB32);
- // allocates icons bitmap and texture
+ // allocate icons
for (int i = 0; i < MAX_ICONS_RENDER; i++)
{
icons_bitmap[i] = auto_alloc(machine, bitmap_argb32);
@@ -1343,7 +1352,7 @@ void ui_menu::init_ui(running_machine &machine)
toolbar_texture[x]->set_bitmap(*toolbar_bitmap[x], toolbar_bitmap[x]->cliprect(), TEXFORMAT_ARGB32);
else
toolbar_bitmap[x]->reset();
-
+
if (x == 0 || x == 2)
{
dst = &sw_toolbar_bitmap[x]->pix32(0);
@@ -1383,8 +1392,8 @@ void ui_menu::draw_select_game(bool noinput)
container->add_quad(0.0f, 0.0f, 1.0f, 1.0f, ARGB_WHITE, bgrnd_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
hover = item.size() + 1;
- visible_items = (is_swlist) ? item.size() - 2 : item.size() - 5;
- float extra_height = (is_swlist) ? 2.0f * line_height : 5.0f * line_height;
+ visible_items = (is_swlist) ? item.size() - 2 : item.size() - 2 - skip_main_items;
+ float extra_height = (is_swlist) ? 2.0f * line_height : (2.0f + skip_main_items) * line_height;
float visible_extra_menu_height = customtop + custombottom + extra_height;
// locate mouse
@@ -1480,7 +1489,7 @@ void ui_menu::draw_select_game(bool noinput)
// if we have some background hilighting to do, add a quad behind everything else
if (bgcolor != UI_TEXT_BG_COLOR)
- mui.draw_textured_box(container, line_x0 + 0.01f, line_y0, line_x1 - 0.01f, line_y1, bgcolor, rgb_t(255, 43, 43, 43),
+ mui.draw_textured_box(container, line_x0 + 0.01f, line_y0, line_x1 - 0.01f, line_y1, bgcolor, rgb_t(255, 43, 43, 43),
hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
// if we're on the top line, display the up arrow
@@ -1511,7 +1520,7 @@ void ui_menu::draw_select_game(bool noinput)
int item_invert = pitem.flags & MENU_FLAG_INVERT;
float space = 0.0f;
- if (!is_swlist)
+ if (ui_globals::has_icons && !is_swlist)
{
if (is_favorites)
{
@@ -1524,7 +1533,7 @@ void ui_menu::draw_select_game(bool noinput)
space = mui.get_line_height() * container->manager().ui_aspect() * 1.5f;
}
- mui.draw_text_full(container, itemtext, effective_left + space, line_y, effective_width - space, JUSTIFY_LEFT, WRAP_TRUNCATE,
+ mui.draw_text_full(container, itemtext, effective_left + space, line_y, effective_width - space, JUSTIFY_LEFT, WRAP_TRUNCATE,
DRAW_NORMAL, item_invert ? fgcolor3 : fgcolor, bgcolor, nullptr, nullptr);
}
else
@@ -1584,7 +1593,7 @@ void ui_menu::draw_select_game(bool noinput)
container->add_line(visible_left, line + 0.5f * line_height, visible_left + visible_width, line + 0.5f * line_height,
UI_LINE_WIDTH, UI_TEXT_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
else
- mui.draw_text_full(container, itemtext, effective_left, line, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, itemtext, effective_left, line, effective_width, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr);
line += line_height;
}
@@ -2109,7 +2118,7 @@ void ui_menu::draw_star(float x0, float y0)
{
float y1 = y0 + machine().ui().get_line_height();
float x1 = x0 + machine().ui().get_line_height() * container->manager().ui_aspect();
- container->add_quad(x0, y0, x1, y1, ARGB_WHITE, star_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ container->add_quad(x0, y0, x1, y1, ARGB_WHITE, star_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_PACKABLE);
}
//-------------------------------------------------
@@ -2174,7 +2183,6 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float
// if it fails, use the default image
if (!tmp_bitmap->valid())
{
- //tmp_bitmap->reset();
tmp_bitmap->allocate(256, 256);
for (int x = 0; x < 256; x++)
for (int y = 0; y < 256; y++)
@@ -2219,11 +2227,11 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float
}
bitmap_argb32 *dest_bitmap;
- dest_bitmap = auto_alloc(machine(), bitmap_argb32);
// resample if necessary
if (dest_xPixel != tmp_bitmap->width() || dest_yPixel != tmp_bitmap->height())
{
+ dest_bitmap = auto_alloc(machine(), bitmap_argb32);
dest_bitmap->allocate(dest_xPixel, dest_yPixel);
render_color color = { 1.0f, 1.0f, 1.0f, 1.0f };
render_resample_argb_bitmap_hq(*dest_bitmap, *tmp_bitmap, color, true);
@@ -2231,7 +2239,6 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float
else
dest_bitmap = tmp_bitmap;
- //snapx_bitmap->reset();
snapx_bitmap->allocate(panel_width_pixel, panel_height_pixel);
int x1 = (0.5f * panel_width_pixel) - (0.5f * dest_xPixel);
int y1 = (0.5f * panel_height_pixel) - (0.5f * dest_yPixel);
@@ -2291,13 +2298,13 @@ void ui_menu::draw_common_arrow(float origx1, float origy1, float origx2, float
// apply arrow
if (current == dmin)
- container->add_quad(ar_x0, ar_y0, ar_x1, ar_y1, fgcolor_right, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90));
+ container->add_quad(ar_x0, ar_y0, ar_x1, ar_y1, fgcolor_right, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90) | PRIMFLAG_PACKABLE);
else if (current == dmax)
- container->add_quad(al_x0, al_y0, al_x1, al_y1, fgcolor_left, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90 ^ ORIENTATION_FLIP_X));
+ container->add_quad(al_x0, al_y0, al_x1, al_y1, fgcolor_left, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90 ^ ORIENTATION_FLIP_X) | PRIMFLAG_PACKABLE);
else
{
- container->add_quad(ar_x0, ar_y0, ar_x1, ar_y1, fgcolor_right, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90));
- container->add_quad(al_x0, al_y0, al_x1, al_y1, fgcolor_left, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90 ^ ORIENTATION_FLIP_X));
+ container->add_quad(ar_x0, ar_y0, ar_x1, ar_y1, fgcolor_right, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90) | PRIMFLAG_PACKABLE);
+ container->add_quad(al_x0, al_y0, al_x1, al_y1, fgcolor_left, arrow_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(ROT90 ^ ORIENTATION_FLIP_X) | PRIMFLAG_PACKABLE);
}
}
@@ -2310,10 +2317,7 @@ void ui_menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
static const game_driver *olddriver[MAX_ICONS_RENDER] = { nullptr };
float x1 = x0 + machine().ui().get_line_height() * container->manager().ui_aspect(container);
float y1 = y0 + machine().ui().get_line_height();
- const game_driver *driver = ((FPTR)selectedref > 2) ? (const game_driver *)selectedref : nullptr;
-
- if (driver == nullptr)
- return;
+ const game_driver *driver = (const game_driver *)selectedref;
if (olddriver[linenum] != driver || ui_globals::redraw_icon)
{
@@ -2395,14 +2399,17 @@ void ui_menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
icons_texture[linenum]->set_bitmap(*icons_bitmap[linenum], icons_bitmap[linenum]->cliprect(), TEXFORMAT_ARGB32);
}
- else
- icons_bitmap[linenum]->reset();
-
+ else {
+ if (icons_bitmap[linenum] != nullptr)
+ {
+ icons_bitmap[linenum]->reset();
+ }
+ }
auto_free(machine(), tmp);
}
- if (icons_bitmap[linenum]->valid())
- container->add_quad(x0, y0, x1, y1, ARGB_WHITE, icons_texture[linenum], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ if (icons_bitmap[linenum] != nullptr && icons_bitmap[linenum]->valid())
+ container->add_quad(x0, y0, x1, y1, ARGB_WHITE, icons_texture[linenum], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_PACKABLE);
}
//-------------------------------------------------
diff --git a/src/emu/ui/menu.h b/src/emu/ui/menu.h
index 512436dc232..d5f5e8a33e6 100644
--- a/src/emu/ui/menu.h
+++ b/src/emu/ui/menu.h
@@ -232,6 +232,7 @@ protected:
int l_sw_hover;
int l_hover;
int totallines;
+ int skip_main_items;
// draw right box
float draw_right_box_title(float x1, float y1, float x2, float y2);
diff --git a/src/emu/ui/miscmenu.cpp b/src/emu/ui/miscmenu.cpp
index 0b41eed95bb..5d232729bd2 100644
--- a/src/emu/ui/miscmenu.cpp
+++ b/src/emu/ui/miscmenu.cpp
@@ -32,7 +32,7 @@ ui_menu_keyboard_mode::ui_menu_keyboard_mode(running_machine &machine, render_co
void ui_menu_keyboard_mode::populate()
{
bool natural = machine().ui().use_natural_keyboard();
- item_append("Keyboard Mode:", natural ? "Natural" : "Emulated", natural ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, nullptr);
+ item_append(_("Keyboard Mode:"), natural ? _("Natural") : _("Emulated"), natural ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, nullptr);
}
ui_menu_keyboard_mode::~ui_menu_keyboard_mode()
@@ -86,7 +86,7 @@ void ui_menu_bios_selection::populate()
}
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("Reset", nullptr, 0, (void *)1);
+ item_append(_("Reset"), nullptr, 0, (void *)1);
}
ui_menu_bios_selection::~ui_menu_bios_selection()
@@ -260,7 +260,7 @@ void ui_menu_bookkeeping::populate()
/* display whether or not we are locked out */
if (machine().bookkeeping().coin_lockout_get_state(ctrnum))
- tempstring.append(" (locked)");
+ tempstring.append(_(" (locked)"));
tempstring.append("\n");
}
@@ -520,7 +520,7 @@ void ui_menu_crosshair::populate()
/* add CROSSHAIR_ITEM_AUTO_TIME menu */
sprintf(temp_text, "%d", settings.auto_time);
- item_append("Visible Delay", temp_text, flags, data);
+ item_append(_("Visible Delay"), temp_text, flags, data);
}
// else
// /* leave a blank filler line when not in auto time so size does not rescale */
@@ -559,17 +559,17 @@ void ui_menu_quit_game::handle()
ui_menu_misc_options::misc_option ui_menu_misc_options::m_options[] = {
{ 0, nullptr, nullptr },
- { 0, "Re-select last machine played", OPTION_REMEMBER_LAST },
- { 0, "Enlarge images in the right panel", OPTION_ENLARGE_SNAPS },
- { 0, "DATs info", OPTION_DATS_ENABLED },
- { 0, "Cheats", OPTION_CHEAT },
- { 0, "Show mouse pointer", OPTION_UI_MOUSE },
- { 0, "Confirm quit from machines", OPTION_UI_CONFIRM_QUIT },
- { 0, "Skip displaying information's screen at startup", OPTION_UI_SKIP_GAMEINFO },
- { 0, "Force 4:3 appearance for software snapshot", OPTION_FORCED4X3 },
- { 0, "Use image as background", OPTION_USE_BACKGROUND },
- { 0, "Skip bios selection menu", OPTION_SKIP_BIOS_MENU },
- { 0, "Skip software parts selection menu", OPTION_SKIP_PARTS_MENU }
+ { 0, __("Re-select last machine played"), OPTION_REMEMBER_LAST },
+ { 0, __("Enlarge images in the right panel"), OPTION_ENLARGE_SNAPS },
+ { 0, __("DATs info"), OPTION_DATS_ENABLED },
+ { 0, __("Cheats"), OPTION_CHEAT },
+ { 0, __("Show mouse pointer"), OPTION_UI_MOUSE },
+ { 0, __("Confirm quit from machines"), OPTION_CONFIRM_QUIT },
+ { 0, __("Skip displaying information's screen at startup"), OPTION_SKIP_GAMEINFO },
+ { 0, __("Force 4:3 appearance for software snapshot"), OPTION_FORCED4X3 },
+ { 0, __("Use image as background"), OPTION_USE_BACKGROUND },
+ { 0, __("Skip bios selection menu"), OPTION_SKIP_BIOS_MENU },
+ { 0, __("Skip software parts selection menu"), OPTION_SKIP_PARTS_MENU }
};
//-------------------------------------------------
@@ -635,7 +635,7 @@ void ui_menu_misc_options::populate()
{
// add options items
for (int opt = 1; opt < ARRAY_LENGTH(m_options); ++opt)
- item_append(m_options[opt].description, m_options[opt].status ? "On" : "Off", m_options[opt].status ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)opt);
+ item_append(_(m_options[opt].description), m_options[opt].status ? "On" : "Off", m_options[opt].status ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)opt);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
@@ -650,7 +650,7 @@ void ui_menu_misc_options::custom_render(void *selectedref, float top, float bot
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Miscellaneous Options", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Miscellaneous Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -670,6 +670,6 @@ void ui_menu_misc_options::custom_render(void *selectedref, float top, float bot
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Miscellaneous Options", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Miscellaneous Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
diff --git a/src/emu/ui/moptions.cpp b/src/emu/ui/moptions.cpp
index dd4897749fc..63c51d26438 100644
--- a/src/emu/ui/moptions.cpp
+++ b/src/emu/ui/moptions.cpp
@@ -52,10 +52,6 @@ const options_entry ui_options::s_option_entries[] =
{ OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" },
{ OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" },
{ OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" },
- { OPTION_UI_SKIP_GAMEINFO, "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" },
- { OPTION_UI_FONT, "default", OPTION_STRING, "specify a font to use" },
- { OPTION_UI_CONFIRM_QUIT, "0", OPTION_BOOLEAN, "display confirm quit screen on exit" },
- { OPTION_UI_MOUSE, "1", OPTION_BOOLEAN, "display ui mouse cursor" },
// UI options
{ nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" },
diff --git a/src/emu/ui/moptions.h b/src/emu/ui/moptions.h
index 3b1ab8948c0..9706dcda7f5 100644
--- a/src/emu/ui/moptions.h
+++ b/src/emu/ui/moptions.h
@@ -70,12 +70,6 @@
#define OPTION_UI_DIPSW_COLOR "ui_dipsw_color"
#define OPTION_UI_SLIDER_COLOR "ui_slider_color"
-#define OPTION_UI_FONT "uifont"
-#define OPTION_UI_CONFIRM_QUIT "confirm_quit"
-#define OPTION_UI_MOUSE "ui_mouse"
-#define OPTION_UI_SKIP_GAMEINFO "skip_gameinfo"
-
-
class ui_options : public core_options
{
public:
@@ -136,11 +130,6 @@ public:
const char *ui_mousedown_bg_color() const { return value(OPTION_UI_MOUSEDOWN_BG_COLOR); }
const char *ui_dipsw_color() const { return value(OPTION_UI_DIPSW_COLOR); }
const char *ui_slider_color() const { return value(OPTION_UI_SLIDER_COLOR); }
-
- bool skip_gameinfo() const { return bool_value(OPTION_UI_SKIP_GAMEINFO); }
- const char *ui_font() const { return value(OPTION_UI_FONT); }
- bool confirm_quit() const { return bool_value(OPTION_UI_CONFIRM_QUIT); }
- bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); }
private:
static const options_entry s_option_entries[];
};
diff --git a/src/emu/ui/optsmenu.cpp b/src/emu/ui/optsmenu.cpp
index 44ed9e11a37..54e269bf4ed 100644
--- a/src/emu/ui/optsmenu.cpp
+++ b/src/emu/ui/optsmenu.cpp
@@ -198,7 +198,7 @@ void ui_menu_game_options::populate()
// add filter item
UINT32 arrow_flags = get_arrow_flags((int)FILTER_FIRST, (int)FILTER_LAST, main_filters::actual);
- item_append("Filter", main_filters::text[main_filters::actual], arrow_flags, (void *)(FPTR)FILTER_MENU);
+ item_append(_("Filter"), main_filters::text[main_filters::actual], arrow_flags, (void *)(FPTR)FILTER_MENU);
// add category subitem
if (main_filters::actual == FILTER_CATEGORY && !machine().inifile().ini_index.empty())
@@ -243,13 +243,13 @@ void ui_menu_game_options::populate()
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
// add options items
- item_append("Customize UI", nullptr, 0, (void *)(FPTR)CUSTOM_MENU);
+ item_append(_("Customize UI"), nullptr, 0, (void *)(FPTR)CUSTOM_MENU);
}
- item_append("Display Options", nullptr, 0, (void *)(FPTR)DISPLAY_MENU);
- item_append("Sound Options", nullptr, 0, (void *)(FPTR)SOUND_MENU);
- item_append("Miscellaneous Options", nullptr, 0, (void *)(FPTR)MISC_MENU);
- item_append("Device Mapping", nullptr, 0, (void *)(FPTR)CONTROLLER_MENU);
- item_append("General Inputs", nullptr, 0, (void *)(FPTR)CGI_MENU);
+ item_append(_("Display Options"), nullptr, 0, (void *)(FPTR)DISPLAY_MENU);
+ item_append(_("Sound Options"), nullptr, 0, (void *)(FPTR)SOUND_MENU);
+ item_append(_("Miscellaneous Options"), nullptr, 0, (void *)(FPTR)MISC_MENU);
+ item_append(_("Device Mapping"), nullptr, 0, (void *)(FPTR)CONTROLLER_MENU);
+ item_append(_("General Inputs"), nullptr, 0, (void *)(FPTR)CGI_MENU);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
custombottom = 2.0f * machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
@@ -264,7 +264,7 @@ void ui_menu_game_options::custom_render(void *selectedref, float top, float bot
{
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Settings", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -284,7 +284,7 @@ void ui_menu_game_options::custom_render(void *selectedref, float top, float bot
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Settings", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
@@ -304,5 +304,5 @@ void save_ui_options(running_machine &machine)
file.close();
}
else
- machine.popmessage("**Error to save ui.ini**", emulator_info::get_configname());
+ machine.popmessage(_("**Error to save ui.ini**"));
}
diff --git a/src/emu/ui/selector.cpp b/src/emu/ui/selector.cpp
index c9cc3c7b6c0..f4c94e6bc2d 100644
--- a/src/emu/ui/selector.cpp
+++ b/src/emu/ui/selector.cpp
@@ -149,7 +149,7 @@ void ui_menu_selector::custom_render(void *selectedref, float top, float bottom,
{
float width;
ui_manager &mui = machine().ui();
- std::string tempbuf = std::string("Selection List - Search: ").append(m_search).append("_");
+ std::string tempbuf = std::string(_("Selection List - Search: ")).append(m_search).append("_");
// get the size of the text
mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
@@ -178,7 +178,7 @@ void ui_menu_selector::custom_render(void *selectedref, float top, float bottom,
// bottom text
// get the text for 'UI Select'
std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
- tempbuf.assign("Double click or press ").append(ui_select_text).append(" to select");
+ tempbuf.assign(_("Double click or press ")).append(ui_select_text).append(_(" to select"));
mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
diff --git a/src/emu/ui/selgame.cpp b/src/emu/ui/selgame.cpp
index 592e24ebb41..e950c96b1b9 100644
--- a/src/emu/ui/selgame.cpp
+++ b/src/emu/ui/selgame.cpp
@@ -167,6 +167,20 @@ ui_menu_select_game::ui_menu_select_game(running_machine &machine, render_contai
// load drivers cache
init_sorted_list();
+ // check if there are available icons
+ ui_globals::has_icons = false;
+ file_enumerator path(moptions.icons_directory());
+ const osd_directory_entry *dir;
+ while ((dir = path.next()) != nullptr)
+ {
+ std::string src(dir->name);
+ if (src.find(".ico") != std::string::npos || src.find("icons") != std::string::npos)
+ {
+ ui_globals::has_icons = true;
+ break;
+ }
+ }
+
// build drivers list
if (!load_available_machines())
build_available_list();
@@ -601,11 +615,18 @@ void ui_menu_select_game::populate()
}
}
- // add special items
item_append(MENU_SEPARATOR_ITEM, nullptr, MENU_FLAG_UI, nullptr);
- item_append("Configure Options", nullptr, MENU_FLAG_UI, (void *)(FPTR)1);
- item_append("Configure Directories", nullptr, MENU_FLAG_UI, (void *)(FPTR)2);
- item_append("Save Configuration", nullptr, MENU_FLAG_UI, (void *)(FPTR)3);
+
+ // add special items
+ if (ui_menu::stack_has_special_main_menu())
+ {
+ item_append(_("Configure Options"), nullptr, MENU_FLAG_UI, (void *)(FPTR)1);
+ item_append(_("Configure Directories"), nullptr, MENU_FLAG_UI, (void *)(FPTR)2);
+ item_append(_("Save Configuration"), nullptr, MENU_FLAG_UI, (void *)(FPTR)3);
+ skip_main_items = 3;
+ }
+ else
+ skip_main_items = 0;
// configure the custom rendering
customtop = 3.0f * machine().ui().get_line_height() + 5.0f * UI_BOX_TB_BORDER;
@@ -722,7 +743,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott
if (isfavorite())
tempbuf[1].clear();
else
- tempbuf[1].assign(filtered).append(" Search: ").append(m_search).append("_");
+ tempbuf[1].assign(filtered).append(_(" Search: ")).append(m_search).append("_");
// get the size of the text
for (int line = 0; line < 2; ++line)
@@ -757,10 +778,10 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott
// determine the text to render below
if (!isfavorite())
- driver = ((FPTR)selectedref > 3) ? (const game_driver *)selectedref : nullptr;
+ driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr;
else
{
- swinfo = ((FPTR)selectedref > 3) ? (ui_software_info *)selectedref : nullptr;
+ swinfo = ((FPTR)selectedref > skip_main_items) ? (ui_software_info *)selectedref : nullptr;
if (swinfo && swinfo->startempty == 1)
driver = swinfo->driver;
}
@@ -1737,12 +1758,12 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
hover = phover + filter;
}
- if (afilter == filter)
+/* if (afilter == filter)
{
bgcolor = UI_SELECTED_BG_COLOR;
fgcolor = UI_SELECTED_COLOR;
}
-
+*/
if (bgcolor != UI_TEXT_BG_COLOR)
container->add_rect(x1, y1, x2, y1 + line_height_max, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
@@ -1769,6 +1790,12 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
}
convert_command_glyph(str);
}
+ else if (filter == main_filters::actual)
+ {
+ str.assign("@custom1 ").append(text[filter]);
+ x1t -= text_sign;
+ convert_command_glyph(str);
+ }
mui.draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
@@ -1845,7 +1872,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
if (is_favorites)
{
- soft = ((FPTR)selectedref > 3) ? (ui_software_info *)selectedref : nullptr;
+ soft = ((FPTR)selectedref > skip_main_items) ? (ui_software_info *)selectedref : nullptr;
if (soft && soft->startempty == 1)
{
driver = soft->driver;
@@ -1856,7 +1883,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
}
else
{
- driver = ((FPTR)selectedref > 3) ? (const game_driver *)selectedref : nullptr;
+ driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr;
oldsoft = nullptr;
}
@@ -1921,7 +1948,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
if (buffer.empty())
{
- mui.draw_text_full(container, "No Infos Available", origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
+ mui.draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
@@ -2024,7 +2051,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
// apply title to right panel
if (soft->usage.empty())
{
- mui.draw_text_full(container, "History", origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui_globals::cur_sw_dats_view = 0;
}
@@ -2033,8 +2060,8 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
float title_size = 0.0f;
float txt_lenght = 0.0f;
std::string t_text[2];
- t_text[0] = "History";
- t_text[1] = "Usage";
+ t_text[0] = _("History");
+ t_text[1] = _("Usage");
for (auto & elem: t_text)
{
@@ -2068,7 +2095,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
if (buffer.empty())
{
- mui.draw_text_full(container, "No Infos Available", origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
+ mui.draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
@@ -2165,7 +2192,7 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
if (is_favorites)
{
- soft = ((FPTR)selectedref > 3) ? (ui_software_info *)selectedref : nullptr;
+ soft = ((FPTR)selectedref > skip_main_items) ? (ui_software_info *)selectedref : nullptr;
if (soft && soft->startempty == 1)
{
driver = soft->driver;
@@ -2176,7 +2203,7 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
}
else
{
- driver = ((FPTR)selectedref > 3) ? (const game_driver *)selectedref : nullptr;
+ driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr;
oldsoft = nullptr;
}
diff --git a/src/emu/ui/selsoft.cpp b/src/emu/ui/selsoft.cpp
index d5697c3ba03..3122f286917 100644
--- a/src/emu/ui/selsoft.cpp
+++ b/src/emu/ui/selsoft.cpp
@@ -106,7 +106,7 @@ bool has_multiple_bios(const game_driver *driver, std::vector<s_bios> &biosname)
if (bname == default_name)
{
- name.append(" (default)");
+ name.append(_(" (default)"));
biosname.emplace(biosname.begin(), name, bios_flags - 1);
}
else
@@ -603,7 +603,7 @@ void ui_menu_select_software::build_software_list()
void ui_menu_select_software::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
- ui_software_info *swinfo = (FPTR)selectedref > 1 ? (ui_software_info *)selectedref : nullptr;
+ ui_software_info *swinfo = (ui_software_info *)selectedref;
const game_driver *driver = nullptr;
ui_manager &mui = machine().ui();
float width;
@@ -618,17 +618,17 @@ void ui_menu_select_software::custom_render(void *selectedref, float top, float
tempbuf[1].assign("Driver: \"").append(m_driver->description).append("\" software list ");
if (sw_filters::actual == UI_SW_REGION && m_filter.region.ui.size() != 0)
- filtered.assign("Region: ").append(m_filter.region.ui[m_filter.region.actual]).append(" - ");
+ filtered.assign(_("Region: ")).append(m_filter.region.ui[m_filter.region.actual]).append(" - ");
else if (sw_filters::actual == UI_SW_PUBLISHERS)
- filtered.assign("Publisher: ").append(m_filter.publisher.ui[m_filter.publisher.actual]).append(" - ");
+ filtered.assign(_("Publisher: ")).append(m_filter.publisher.ui[m_filter.publisher.actual]).append(" - ");
else if (sw_filters::actual == UI_SW_YEARS)
- filtered.assign("Year: ").append(m_filter.year.ui[m_filter.year.actual]).append(" - ");
+ filtered.assign(_("Year: ")).append(m_filter.year.ui[m_filter.year.actual]).append(" - ");
else if (sw_filters::actual == UI_SW_LIST)
- filtered.assign("Software List: ").append(m_filter.swlist.description[m_filter.swlist.actual]).append(" - ");
+ filtered.assign(_("Software List: ")).append(m_filter.swlist.description[m_filter.swlist.actual]).append(" - ");
else if (sw_filters::actual == UI_SW_TYPE)
- filtered.assign("Device type: ").append(m_filter.type.ui[m_filter.type.actual]).append(" - ");
+ filtered.assign(_("Device type: ")).append(m_filter.type.ui[m_filter.type.actual]).append(" - ");
- tempbuf[2].assign(filtered).append("Search: ").append(m_search).append("_");
+ tempbuf[2].assign(filtered).append(_("Search: ")).append(m_search).append("_");
// get the size of the text
float maxwidth = origx2 - origx1;
@@ -1319,12 +1319,12 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo
hover = phover + filter;
}
- if (afilter == filter)
+/* if (afilter == filter)
{
bgcolor = UI_SELECTED_BG_COLOR;
fgcolor = UI_SELECTED_COLOR;
}
-
+*/
if (bgcolor != UI_TEXT_BG_COLOR)
container->add_rect(x1, y1, x2, y1 + line_height, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
@@ -1351,6 +1351,12 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo
}
convert_command_glyph(str);
}
+ else if (filter == sw_filters::actual)
+ {
+ str.assign("@custom1 ").append(text[filter]);
+ x1t -= text_sign;
+ convert_command_glyph(str);
+ }
mui.draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size);
@@ -1421,7 +1427,7 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa
std::vector<int> xstart;
std::vector<int> xend;
float text_size = machine().ui().options().infos_size();
- ui_software_info *soft = ((FPTR)selectedref > 2) ? (ui_software_info *)selectedref : nullptr;
+ ui_software_info *soft = (ui_software_info *)selectedref;
static ui_software_info *oldsoft = nullptr;
static int old_sw_view = -1;
@@ -1432,7 +1438,7 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa
// apply title to right panel
if (soft && soft->usage.empty())
{
- mui.draw_text_full(container, "History", origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
ui_globals::cur_sw_dats_view = 0;
}
@@ -1441,8 +1447,8 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa
float title_size = 0.0f;
float txt_lenght = 0.0f;
std::string t_text[2];
- t_text[0] = "History";
- t_text[1] = "Usage";
+ t_text[0] = _("History");
+ t_text[1] = _("Usage");
for (auto & elem : t_text)
{
@@ -1477,7 +1483,7 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa
if (buffer.empty())
{
- mui.draw_text_full(container, "No Infos Available", origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
+ mui.draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER,
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
@@ -1526,7 +1532,7 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
static ui_software_info *oldsoft = nullptr;
static const game_driver *olddriver = nullptr;
const game_driver *driver = nullptr;
- ui_software_info *soft = ((FPTR)selectedref > 2) ? (ui_software_info *)selectedref : nullptr;
+ ui_software_info *soft = (ui_software_info *)selectedref;
if (soft && soft->startempty == 1)
{
@@ -1813,7 +1819,7 @@ void ui_software_parts::custom_render(void *selectedref, float top, float bottom
{
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Software part selection:", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Software part selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -1833,7 +1839,7 @@ void ui_software_parts::custom_render(void *selectedref, float top, float bottom
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Software part selection:", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Software part selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
@@ -1951,7 +1957,7 @@ void ui_bios_selection::custom_render(void *selectedref, float top, float bottom
{
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Bios selection:", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Bios selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -1971,6 +1977,6 @@ void ui_bios_selection::custom_render(void *selectedref, float top, float bottom
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Bios selection:", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Bios selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
diff --git a/src/emu/ui/simpleselgame.cpp b/src/emu/ui/simpleselgame.cpp
index 0c0705e8414..429ea61c9b7 100644
--- a/src/emu/ui/simpleselgame.cpp
+++ b/src/emu/ui/simpleselgame.cpp
@@ -231,10 +231,9 @@ void ui_simple_menu_select_game::populate()
if (matchcount == 0)
{
std::string txt;
- strprintf(txt, "No %s found. Please check the rompath specified in the %s.ini file.\n\n"
+ strprintf(txt, "No machines found. Please check the rompath specified in the %s.ini file.\n\n"
"If this is your first time using %s, please see the config.txt file in "
"the docs directory for information on configuring %s.",
- emulator_info::get_gamesnoun(),
emulator_info::get_configname(),
emulator_info::get_appname(),emulator_info::get_appname() );
item_append(txt.c_str(), nullptr, MENU_FLAG_MULTILINE | MENU_FLAG_REDTEXT, nullptr);
@@ -262,8 +261,9 @@ void ui_simple_menu_select_game::populate()
if (ui_menu::stack_has_special_main_menu())
{
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("Configure Options", nullptr, 0, (void *)1);
- item_append("Save Configuration", nullptr, 0, (void *)2);
+ item_append(_("Configure Options"), nullptr, 0, (void *)1);
+ item_append(_("Save Configuration"), nullptr, 0, (void *)2);
+ skip_main_items = 2;
}
// configure the custom rendering
@@ -316,8 +316,8 @@ void ui_simple_menu_select_game::custom_render(void *selectedref, float top, flo
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// determine the text to render below
- driver = ((FPTR)selectedref > 2) ? (const game_driver *)selectedref : nullptr;
- if ((FPTR)driver > 2)
+ driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr;
+ if (driver != nullptr)
{
const char *gfxstat, *soundstat;
diff --git a/src/emu/ui/sliders.cpp b/src/emu/ui/sliders.cpp
index e494213aa1b..d53ad402943 100644
--- a/src/emu/ui/sliders.cpp
+++ b/src/emu/ui/sliders.cpp
@@ -17,9 +17,9 @@
#include "ui/sliders.h"
-ui_menu_sliders::ui_menu_sliders(running_machine &machine, render_container *container, bool _menuless_mode) : ui_menu(machine, container)
+ui_menu_sliders::ui_menu_sliders(running_machine &machine, render_container *container, bool menuless_mode) : ui_menu(machine, container)
{
- menuless_mode = hidden = _menuless_mode;
+ m_menuless_mode = m_hidden = menuless_mode;
}
ui_menu_sliders::~ui_menu_sliders()
@@ -35,7 +35,7 @@ void ui_menu_sliders::handle()
const ui_menu_event *menu_event;
/* process the menu */
- menu_event = process(UI_MENU_PROCESS_LR_REPEAT | (hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0));
+ menu_event = process(UI_MENU_PROCESS_LR_REPEAT | (m_hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0));
if (menu_event != nullptr)
{
/* handle keys if there is a valid item selected */
@@ -49,10 +49,10 @@ void ui_menu_sliders::handle()
{
/* toggle visibility */
case IPT_UI_ON_SCREEN_DISPLAY:
- if (menuless_mode)
+ if (m_menuless_mode)
ui_menu::stack_pop(machine());
else
- hidden = !hidden;
+ m_hidden = !m_hidden;
break;
/* decrease value */
@@ -103,19 +103,25 @@ void ui_menu_sliders::handle()
}
/* if we are selecting an invalid item and we are hidden, skip to the next one */
- else if (hidden)
+ else if (m_hidden)
{
/* if we got here via up or page up, select the previous item */
if (menu_event->iptkey == IPT_UI_UP || menu_event->iptkey == IPT_UI_PAGE_UP)
{
- selected = (selected + item.size() - 1) % item.size();
+ do
+ {
+ selected = (selected + item.size() - 1) % item.size();
+ } while(((slider_state&)item[selected]).hidden);
validate_selection(-1);
}
/* otherwise select the next item */
else if (menu_event->iptkey == IPT_UI_DOWN || menu_event->iptkey == IPT_UI_PAGE_DOWN)
{
- selected = (selected + 1) % item.size();
+ do
+ {
+ selected = (selected + 1) % item.size();
+ } while(((slider_state&)item[selected]).hidden);
validate_selection(1);
}
}
@@ -252,5 +258,5 @@ UINT32 ui_menu_sliders::ui_handler(running_machine &machine, render_container *c
ui_menu::stack_pop(machine);
ui_menu_sliders *uim = dynamic_cast<ui_menu_sliders *>(menu_stack);
- return uim && uim->menuless_mode ? 0 : UI_HANDLER_CANCEL;
+ return uim && uim->m_menuless_mode ? 0 : UI_HANDLER_CANCEL;
}
diff --git a/src/emu/ui/sliders.h b/src/emu/ui/sliders.h
index d76a24c1671..c21555dc336 100644
--- a/src/emu/ui/sliders.h
+++ b/src/emu/ui/sliders.h
@@ -13,6 +13,8 @@
#ifndef __UI_SLIDERS_H__
#define __UI_SLIDERS_H__
+#include <map>
+
class ui_menu_sliders : public ui_menu {
public:
ui_menu_sliders(running_machine &machine, render_container *container, bool menuless_mode = false);
@@ -25,7 +27,8 @@ public:
static UINT32 ui_handler(running_machine &machine, render_container *container, UINT32 state);
private:
- bool menuless_mode, hidden;
+ bool m_menuless_mode;
+ bool m_hidden;
};
diff --git a/src/emu/ui/slotopt.cpp b/src/emu/ui/slotopt.cpp
index 959fef74adc..a67c217c7f1 100644
--- a/src/emu/ui/slotopt.cpp
+++ b/src/emu/ui/slotopt.cpp
@@ -163,13 +163,13 @@ void ui_menu_slot_devices::populate()
{
opt_name.assign(option->name());
if (slot->fixed() || slot_get_length(slot) == 0)
- opt_name.append(" [internal]");
+ opt_name.append(_(" [internal]"));
}
item_append(slot->device().tag() + 1, opt_name.c_str(), (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
}
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
- item_append("Reset", nullptr, 0, (void *)1);
+ item_append(_("Reset"), nullptr, 0, (void *)1);
}
ui_menu_slot_devices::~ui_menu_slot_devices()
diff --git a/src/emu/ui/sndmenu.cpp b/src/emu/ui/sndmenu.cpp
index 06563c661b3..37134f8db25 100644
--- a/src/emu/ui/sndmenu.cpp
+++ b/src/emu/ui/sndmenu.cpp
@@ -133,9 +133,9 @@ void ui_menu_sound_options::populate()
strprintf(s_text, "%d", m_sample_rate);
// add options items
- item_append("Sound", m_sound ? "On" : "Off", m_sound ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SOUND);
- item_append("Sample Rate", s_text.c_str(), arrow_flags, (void *)(FPTR)SAMPLE_RATE);
- item_append("Use External Samples", m_samples ? "On" : "Off", m_samples ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SAMPLES);
+ item_append(_("Sound"), m_sound ? "On" : "Off", m_sound ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SOUND);
+ item_append(_("Sample Rate"), s_text.c_str(), arrow_flags, (void *)(FPTR)SAMPLE_RATE);
+ item_append(_("Use External Samples"), m_samples ? "On" : "Off", m_samples ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SAMPLES);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
customtop = machine().ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER);
@@ -149,7 +149,7 @@ void ui_menu_sound_options::custom_render(void *selectedref, float top, float bo
{
float width;
ui_manager &mui = machine().ui();
- mui.draw_text_full(container, "Sound Options", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Sound Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = MAX(origx2 - origx1, width);
@@ -169,6 +169,6 @@ void ui_menu_sound_options::custom_render(void *selectedref, float top, float bo
y1 += UI_BOX_TB_BORDER;
// draw the text within it
- mui.draw_text_full(container, "Sound Options", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ mui.draw_text_full(container, _("Sound Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
diff --git a/src/emu/ui/swlist.cpp b/src/emu/ui/swlist.cpp
index d57c91fae40..1a3ce5fe736 100644
--- a/src/emu/ui/swlist.cpp
+++ b/src/emu/ui/swlist.cpp
@@ -355,7 +355,10 @@ void ui_menu_software_list::handle()
}
if (selected_entry != nullptr && selected_entry != cur_selected)
- set_selection((void *) selected_entry);
+ {
+ set_selection((void *)selected_entry);
+ top_line = selected - (visible_lines / 2);
+ }
}
}
else if (event->iptkey == IPT_UI_CANCEL)
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp
index 953882f8b07..f3ce51feea6 100644
--- a/src/emu/ui/ui.cpp
+++ b/src/emu/ui/ui.cpp
@@ -363,7 +363,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
{
const int maxstate = 4;
int str = machine().options().seconds_to_run();
- bool show_gameinfo = !machine().ui().options().skip_gameinfo();
+ bool show_gameinfo = !machine().options().skip_gameinfo();
bool show_warnings = true, show_mandatory_fileman = true;
int state;
@@ -412,7 +412,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
if (show_mandatory_fileman && machine().image().mandatory_scan(messagebox_text).length() > 0)
{
std::string warning;
- warning.assign("This driver requires images to be loaded in the following device(s): ").append(messagebox_text.substr(0, messagebox_text.length() - 2));
+ warning.assign(_("This driver requires images to be loaded in the following device(s): ")).append(messagebox_text.substr(0, messagebox_text.length() - 2));
ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.c_str());
}
break;
@@ -499,7 +499,7 @@ void ui_manager::update_and_render(render_container *container)
m_popup_text_end = 0;
// display the internal mouse cursor
- if (m_mouse_show || (is_menu_active() && machine().ui().options().ui_mouse()))
+ if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse()))
{
INT32 mouse_target_x, mouse_target_y;
bool mouse_button;
@@ -530,7 +530,7 @@ render_font *ui_manager::get_font()
{
// allocate the font and messagebox string
if (m_font == nullptr)
- m_font = machine().render().font_alloc(machine().ui().options().ui_font());
+ m_font = machine().render().font_alloc(machine().options().ui_font());
return m_font;
}
@@ -1059,9 +1059,9 @@ bool ui_manager::show_timecode_total()
std::string &ui_manager::disclaimer_string(std::string &str)
{
- str.assign("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n");
- strcatprintf(str, "IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine().system().description);
- str.append("Otherwise, type OK or move the joystick left then right to continue");
+ str.assign(_("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n"));
+ strcatprintf(str, _("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n"), machine().system().description);
+ str.append(_("Otherwise, type OK or move the joystick left then right to continue"));
return str;
}
@@ -1096,11 +1096,7 @@ std::string &ui_manager::warnings_string(std::string &str)
// add a warning if any ROMs were loaded with warnings
if (machine().rom_load().warnings() > 0)
{
- str.append("One or more ROMs/CHDs for this ");
- str.append(emulator_info::get_gamenoun());
- str.append(" are incorrect. The ");
- str.append(emulator_info::get_gamenoun());
- str.append(" may not run correctly.\n");
+ str.append(_("One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n"));
if (machine().system().flags & WARNING_FLAGS)
str.append("\n");
}
@@ -1113,54 +1109,42 @@ std::string &ui_manager::warnings_string(std::string &str)
// if we have at least one warning flag, print the general header
if ((machine().system().flags & WARNING_FLAGS) || machine().rom_load().knownbad() > 0)
{
- str.append("There are known problems with this ");
- str.append(emulator_info::get_gamenoun());
- str.append("\n\n");
+ str.append(_("There are known problems with this machine\n\n"));
// add a warning if any ROMs are flagged BAD_DUMP/NO_DUMP
if (machine().rom_load().knownbad() > 0) {
- str.append("One or more ROMs/CHDs for this ");
- str.append(emulator_info::get_gamenoun());
- str.append(" have not been correctly dumped.\n");
+ str.append(_("One or more ROMs/CHDs for this machine have not been correctly dumped.\n"));
}
// add one line per warning flag
if (machine().system().flags & MACHINE_IMPERFECT_KEYBOARD)
- str.append("The keyboard emulation may not be 100% accurate.\n");
+ str.append(_("The keyboard emulation may not be 100% accurate.\n"));
if (machine().system().flags & MACHINE_IMPERFECT_COLORS)
- str.append("The colors aren't 100% accurate.\n");
+ str.append(_("The colors aren't 100% accurate.\n"));
if (machine().system().flags & MACHINE_WRONG_COLORS)
- str.append("The colors are completely wrong.\n");
+ str.append(_("The colors are completely wrong.\n"));
if (machine().system().flags & MACHINE_IMPERFECT_GRAPHICS)
- str.append("The video emulation isn't 100% accurate.\n");
+ str.append(_("The video emulation isn't 100% accurate.\n"));
if (machine().system().flags & MACHINE_IMPERFECT_SOUND)
- str.append("The sound emulation isn't 100% accurate.\n");
+ str.append(_("The sound emulation isn't 100% accurate.\n"));
if (machine().system().flags & MACHINE_NO_SOUND) {
- str.append("The ");
- str.append(emulator_info::get_gamenoun());
- str.append(" lacks sound.\n");
+ str.append(_("The machine lacks sound.\n"));
}
if (machine().system().flags & MACHINE_NO_COCKTAIL)
- str.append("Screen flipping in cocktail mode is not supported.\n");
+ str.append(_("Screen flipping in cocktail mode is not supported.\n"));
// check if external artwork is present before displaying this warning?
if (machine().system().flags & MACHINE_REQUIRES_ARTWORK) {
- str.append("The ");
- str.append(emulator_info::get_gamenoun());
- str.append(" requires external artwork files\n");
+ str.append(_("The machine requires external artwork files\n"));
}
if (machine().system().flags & MACHINE_IS_INCOMPLETE )
{
- str.append("This ");
- str.append(emulator_info::get_gamenoun());
- str.append(" was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n");
+ str.append(_("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n"));
}
if (machine().system().flags & MACHINE_NO_SOUND_HW )
{
- str.append("This ");
- str.append(emulator_info::get_gamenoun());
- str.append(" has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n");
+ str.append(_("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n"));
}
// if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger
@@ -1168,25 +1152,15 @@ std::string &ui_manager::warnings_string(std::string &str)
{
// add the strings for these warnings
if (machine().system().flags & MACHINE_UNEMULATED_PROTECTION) {
- str.append("The ");
- str.append(emulator_info::get_gamenoun());
- str.append(" has protection which isn't fully emulated.\n");
+ str.append(_("The machine has protection which isn't fully emulated.\n"));
}
if (machine().system().flags & MACHINE_NOT_WORKING) {
- str.append("\nTHIS ");
- str.append(emulator_info::get_capgamenoun());
- str.append(" DOESN'T WORK. The emulation for this ");
- str.append(emulator_info::get_gamenoun());
- str.append(" is not yet complete. "
- "There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
+ str.append(_("\nTHIS MACHINE DOESN'T WORK. The emulation for this machine is not yet complete. "
+ "There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n"));
}
if (machine().system().flags & MACHINE_MECHANICAL) {
- str.append("\nCertain elements of this ");
- str.append(emulator_info::get_gamenoun());
- str.append(" cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
- "It is not possible to fully play this ");
- str.append(emulator_info::get_gamenoun());
- str.append(".\n");
+ str.append(_("\nCertain elements of this machine cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
+ "It is not possible to fully play this machine.\n"));
}
// find the parent of this driver
@@ -1204,9 +1178,7 @@ std::string &ui_manager::warnings_string(std::string &str)
{
// this one works, add a header and display the name of the clone
if (!foundworking) {
- str.append("\n\nThere are working clones of this ");
- str.append(emulator_info::get_gamenoun());
- str.append(": ");
+ str.append(_("\n\nThere are working clones of this machine: "));
}
else
str.append(", ");
@@ -1220,7 +1192,7 @@ std::string &ui_manager::warnings_string(std::string &str)
}
// add the 'press OK' string
- str.append("\n\nType OK or move the joystick left then right to continue");
+ str.append(_("\n\nType OK or move the joystick left then right to continue"));
return str;
}
@@ -1279,7 +1251,7 @@ std::string &ui_manager::game_info_astring(std::string &str)
// append the Sound: string
if (!found_sound)
- str.append("\nSound:\n");
+ str.append(_("\nSound:\n"));
found_sound = true;
// count how many identical sound chips we have
@@ -1307,11 +1279,11 @@ std::string &ui_manager::game_info_astring(std::string &str)
}
// display screen information
- str.append("\nVideo:\n");
+ str.append(_("\nVideo:\n"));
screen_device_iterator scriter(machine().root_device());
int scrcount = scriter.count();
if (scrcount == 0)
- str.append("None\n");
+ str.append(_("None\n"));
else
{
for (screen_device *screen = scriter.first(); screen != nullptr; screen = scriter.next())
@@ -1323,7 +1295,7 @@ std::string &ui_manager::game_info_astring(std::string &str)
}
if (screen->screen_type() == SCREEN_TYPE_VECTOR)
- str.append("Vector\n");
+ str.append(_("Vector\n"));
else
{
const rectangle &visarea = screen->visible_area();
@@ -1615,22 +1587,22 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
if (machine.ui_active())
{
machine.ui().popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
- "Keyboard Emulation Status",
+ _("Keyboard Emulation Status"),
"-------------------------",
- "Mode: PARTIAL Emulation",
- "UI: Enabled",
+ _("Mode: PARTIAL Emulation"),
+ _("UI: Enabled"),
"-------------------------",
- "**Use ScrLock to toggle**");
+ _("**Use ScrLock to toggle**"));
}
else
{
machine.ui().popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
- "Keyboard Emulation Status",
+ _("Keyboard Emulation Status"),
"-------------------------",
- "Mode: FULL Emulation",
- "UI: Disabled",
+ _("Mode: FULL Emulation"),
+ _("UI: Disabled"),
"-------------------------",
- "**Use ScrLock to toggle**");
+ _("**Use ScrLock to toggle**"));
}
}
}
@@ -1774,13 +1746,13 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
{
if (!machine.options().cheat())
{
- machine.popmessage("Autofire can't be enabled");
+ machine.popmessage(_("Autofire can't be enabled"));
}
else
{
bool autofire_toggle = machine.ioport().get_autofire_toggle();
machine.ioport().set_autofire_toggle(!autofire_toggle);
- machine.popmessage("Autofire %s", autofire_toggle ? "Enabled" : "Disabled");
+ machine.popmessage("Autofire %s", autofire_toggle ? _("Enabled") : _("Disabled"));
}
}
@@ -1813,9 +1785,9 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
// okay, we're waiting for a key to select a slot; display a message
if (state == LOADSAVE_SAVE)
- machine.ui().draw_message_window(container, "Select position to save to");
+ machine.ui().draw_message_window(container, _("Select position to save to"));
else
- machine.ui().draw_message_window(container, "Select position to load from");
+ machine.ui().draw_message_window(container, _("Select position to load from"));
// if load/save state sequence is still being pressed, do not read the filename yet
if (machine.ui().m_load_save_hold) {
@@ -1839,9 +1811,9 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
{
// display a popup indicating things were cancelled
if (state == LOADSAVE_SAVE)
- machine.popmessage("Save cancelled");
+ machine.popmessage(_("Save cancelled"));
else
- machine.popmessage("Load cancelled");
+ machine.popmessage(_("Load cancelled"));
// reset the state
machine.resume();
@@ -1884,12 +1856,12 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
// display a popup indicating that the save will proceed
if (state == LOADSAVE_SAVE)
{
- machine.popmessage("Save to position %s", filename);
+ machine.popmessage(_("Save to position %s"), filename);
machine.schedule_save(filename);
}
else
{
- machine.popmessage("Load from position %s", filename);
+ machine.popmessage(_("Load from position %s"), filename);
machine.schedule_load(filename);
}
@@ -1908,7 +1880,7 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container
void ui_manager::request_quit()
{
- if (!machine().ui().options().confirm_quit())
+ if (!machine().options().confirm_quit())
machine().schedule_exit();
else
set_handler(handler_confirm_quit, 0);
@@ -1929,9 +1901,9 @@ UINT32 ui_manager::handler_confirm_quit(running_machine &machine, render_contain
std::string ui_cancel_text = machine.input().seq_name(machine.ioport().type_seq(IPT_UI_CANCEL, 0, SEQ_TYPE_STANDARD));
// assemble the quit message
- std::string quit_message = strformat("Are you sure you want to quit?\n\n"
+ std::string quit_message = strformat(_("Are you sure you want to quit?\n\n"
"Press ''%s'' to quit,\n"
- "Press ''%s'' to return to emulation.",
+ "Press ''%s'' to return to emulation."),
ui_select_text.c_str(),
ui_cancel_text.c_str());
@@ -1982,6 +1954,8 @@ static slider_state *slider_alloc(running_machine &machine, const char *title, I
state->incval = incval;
state->update = update;
state->arg = arg;
+ state->hidden = false;
+ state->id = -1;
strcpy(state->description, title);
return state;
@@ -2003,7 +1977,7 @@ static slider_state *slider_init(running_machine &machine)
int item;
// add overall volume
- *tailptr = slider_alloc(machine, "Master Volume", -32, 0, 0, 1, slider_volume, nullptr);
+ *tailptr = slider_alloc(machine, _("Master Volume"), -32, 0, 0, 1, slider_volume, nullptr);
tailptr = &(*tailptr)->next;
// add per-channel volume
@@ -2014,7 +1988,7 @@ static slider_state *slider_init(running_machine &machine)
INT32 defval = 1000;
str.assign(info.stream->input_name(info.inputnum));
- str.append(" Volume");
+ str.append(_(" Volume"));
*tailptr = slider_alloc(machine, str.c_str(), 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item);
tailptr = &(*tailptr)->next;
}
@@ -2117,13 +2091,13 @@ static slider_state *slider_init(running_machine &machine)
if (screen->screen_type() == SCREEN_TYPE_VECTOR)
{
// add vector control
- *tailptr = slider_alloc(machine, "Vector Flicker", 0, 0, 1000, 10, slider_flicker, nullptr);
+ *tailptr = slider_alloc(machine, _("Vector Flicker"), 0, 0, 1000, 10, slider_flicker, nullptr);
tailptr = &(*tailptr)->next;
- *tailptr = slider_alloc(machine, "Beam Width Minimum", 1, 100, 1000, 1, slider_beam_width_min, nullptr);
+ *tailptr = slider_alloc(machine, _("Beam Width Minimum"), 1, 100, 1000, 1, slider_beam_width_min, nullptr);
tailptr = &(*tailptr)->next;
- *tailptr = slider_alloc(machine, "Beam Width Maximum", 1, 100, 1000, 1, slider_beam_width_max, nullptr);
+ *tailptr = slider_alloc(machine, _("Beam Width Maximum"), 1, 100, 1000, 1, slider_beam_width_max, nullptr);
tailptr = &(*tailptr)->next;
- *tailptr = slider_alloc(machine, "Beam Intensity Weight", -1000, 0, 1000, 10, slider_beam_intensity_weight, nullptr);
+ *tailptr = slider_alloc(machine, _("Beam Intensity Weight"), -1000, 0, 1000, 10, slider_beam_intensity_weight, nullptr);
tailptr = &(*tailptr)->next;
break;
}
@@ -2563,9 +2537,9 @@ static char *slider_get_screen_desc(screen_device &screen)
static char descbuf[256];
if (scrcount > 1)
- sprintf(descbuf, "Screen '%s'", screen.tag());
+ sprintf(descbuf, _("Screen '%s'"), screen.tag());
else
- strcpy(descbuf, "Screen");
+ strcpy(descbuf, _("Screen"));
return descbuf;
}
@@ -2583,7 +2557,7 @@ static INT32 slider_crossscale(running_machine &machine, void *arg, std::string
if (newval != SLIDER_NOCHANGE)
field->set_crosshair_scale(float(newval) * 0.001);
if (str != nullptr)
- strprintf(*str,"%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
+ strprintf(*str,"%s %s %1.3f", _("Crosshair Scale"), (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
return floor(field->crosshair_scale() * 1000.0f + 0.5f);
}
#endif
@@ -2602,7 +2576,7 @@ static INT32 slider_crossoffset(running_machine &machine, void *arg, std::string
if (newval != SLIDER_NOCHANGE)
field->set_crosshair_offset(float(newval) * 0.001f);
if (str != nullptr)
- strprintf(*str,"%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
+ strprintf(*str,"%s %s %1.3f", _("Crosshair Offset"), (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
return field->crosshair_offset();
}
#endif
@@ -2799,7 +2773,7 @@ rgb_t decode_ui_color(int id, running_machine *machine)
if (machine != nullptr) {
ui_options option;
- for (int x = 0; x < ARRAY_LENGTH(s_color_list); x++) {
+ for (int x = 0; x < ARRAY_LENGTH(s_color_list); ++x) {
const char *o_default = option.value(s_color_list[x]);
const char *s_option = machine->ui().options().value(s_color_list[x]);
int len = strlen(s_option);
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h
index 5334a1a1986..ffd2fddc371 100644
--- a/src/emu/ui/ui.h
+++ b/src/emu/ui/ui.h
@@ -86,7 +86,6 @@ enum
#define SLIDER_NOCHANGE 0x12345678
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
@@ -104,7 +103,9 @@ struct slider_state
INT32 defval; /* default value */
INT32 maxval; /* maximum value */
INT32 incval; /* increment value */
- char description[1]; /* textual description */
+ bool hidden; /* hidden or not */
+ INT32 id; /* unique identifier */
+ char description[1]; /* textual description */
};
@@ -122,7 +123,7 @@ public:
running_machine &machine() const { return m_machine; }
bool single_step() const { return m_single_step; }
ui_options &options() { return m_ui_options; }
-
+
// setters
void set_single_step(bool single_step) { m_single_step = single_step; }
@@ -225,5 +226,5 @@ private:
FUNCTION PROTOTYPES
***************************************************************************/
rgb_t decode_ui_color(int id, running_machine *machine = nullptr);
-int get_font_rows(running_machine *machine = NULL);
+int get_font_rows(running_machine *machine = nullptr);
#endif /* __USRINTRF_H__ */
diff --git a/src/emu/ui/utils.cpp b/src/emu/ui/utils.cpp
index 608b6b16a88..7ac94d5e050 100644
--- a/src/emu/ui/utils.cpp
+++ b/src/emu/ui/utils.cpp
@@ -48,6 +48,7 @@ bool ui_globals::redraw_icon = false;
int ui_globals::visible_main_lines = 0;
int ui_globals::visible_sw_lines = 0;
UINT16 ui_globals::panels_status = 0;
+bool ui_globals::has_icons = false;
// Custom filter
UINT16 custfltr::main = 0;
diff --git a/src/emu/ui/utils.h b/src/emu/ui/utils.h
index 232fb3ccb41..3c8da8ab16e 100644
--- a/src/emu/ui/utils.h
+++ b/src/emu/ui/utils.h
@@ -208,6 +208,7 @@ struct ui_globals
static bool switch_image, redraw_icon, default_image, reset;
static int visible_main_lines, visible_sw_lines;
static UINT16 panels_status;
+ static bool has_icons;
};
#define main_struct(name) \
diff --git a/src/emu/ui/videoopt.cpp b/src/emu/ui/videoopt.cpp
index aa3bc21dd5f..6ba6aa710f3 100644
--- a/src/emu/ui/videoopt.cpp
+++ b/src/emu/ui/videoopt.cpp
@@ -52,7 +52,7 @@ void ui_menu_video_targets::populate()
break;
/* add a menu item */
- sprintf(buffer, "Screen #%d", targetnum);
+ sprintf(buffer, _("Screen #%d"), targetnum);
item_append(buffer, nullptr, 0, target);
}
}
@@ -200,31 +200,31 @@ void ui_menu_video_options::populate()
case ROT180: subtext = "180" UTF8_DEGREES; break;
case ROT270: subtext = "CCW 90" UTF8_DEGREES; break;
}
- item_append("Rotate", subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE);
+ item_append(_("Rotate"), subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE);
/* backdrop item */
enabled = target->backdrops_enabled();
- item_append("Backdrops", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BACKDROPS);
+ item_append(_("Backdrops"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BACKDROPS);
/* overlay item */
enabled = target->overlays_enabled();
- item_append("Overlays", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_OVERLAYS);
+ item_append(_("Overlays"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_OVERLAYS);
/* bezel item */
enabled = target->bezels_enabled();
- item_append("Bezels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BEZELS);
+ item_append(_("Bezels"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BEZELS);
/* cpanel item */
enabled = target->cpanels_enabled();
- item_append("CPanels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_CPANELS);
+ item_append(_("CPanels"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_CPANELS);
/* marquee item */
enabled = target->marquees_enabled();
- item_append("Marquees", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_MARQUEES);
+ item_append(_("Marquees"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_MARQUEES);
/* cropping */
enabled = target->zoom_to_screen();
- item_append("View", enabled ? "Cropped" : "Full", enabled ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)VIDEO_ITEM_ZOOM);
+ item_append(_("View"), enabled ? _("Cropped") : _("Full"), enabled ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)VIDEO_ITEM_ZOOM);
}
ui_menu_video_options::~ui_menu_video_options()
diff --git a/src/emu/ui/viewgfx.cpp b/src/emu/ui/viewgfx.cpp
index 326e67779c9..ff34e732f1e 100644
--- a/src/emu/ui/viewgfx.cpp
+++ b/src/emu/ui/viewgfx.cpp
@@ -388,7 +388,7 @@ static void palette_handler(running_machine &machine, render_container *containe
cellboxbounds.y0 += 3.0f * chheight;
// figure out the title and expand the outer box to fit
- const char *suffix = palette->indirect_entries() == 0 ? "" : state.palette.which ? " COLORS" : " PENS";
+ const char *suffix = palette->indirect_entries() == 0 ? "" : state.palette.which ? _(" COLORS") : _(" PENS");
sprintf(title, "'%s'%s", palette->tag(), suffix);
titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
x0 = 0.0f;
diff --git a/src/emu/video.cpp b/src/emu/video.cpp
index 11f081636b8..7dc9470d54a 100644
--- a/src/emu/video.cpp
+++ b/src/emu/video.cpp
@@ -684,7 +684,7 @@ inline int video_manager::effective_frameskip() const
inline bool video_manager::effective_throttle() const
{
// if we're paused, or if the UI is active, we always throttle
- if (machine().paused() || machine().ui().is_menu_active())
+ if (machine().paused()) //|| machine().ui().is_menu_active())
return true;
// if we're fast forwarding, we don't throttle
diff --git a/src/emu/video.h b/src/emu/video.h
index e7ff281a260..7a1808ad095 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -76,6 +76,7 @@ public:
// misc
void toggle_throttle();
void toggle_record_movie();
+ file_error open_next(emu_file &file, const char *extension);
// render a frame
void frame_update(bool debug = false);
@@ -127,7 +128,6 @@ private:
// snapshot/movie helpers
void create_snapshot_bitmap(screen_device *screen);
- file_error open_next(emu_file &file, const char *extension);
void record_frame();
// internal state
diff --git a/src/ldplayer/ldplayer.cpp b/src/ldplayer/ldplayer.cpp
index bbd309dd0b9..4f16ba130b8 100644
--- a/src/ldplayer/ldplayer.cpp
+++ b/src/ldplayer/ldplayer.cpp
@@ -22,40 +22,14 @@
#define APPNAME "MAME"
#define APPNAME_LOWER "mame"
#define CONFIGNAME "mame"
-#define CAPGAMENOUN "GAME"
-#define CAPSTARTGAMENOUN "Game"
-#define GAMENOUN "game"
-#define GAMESNOUN "games"
#define COPYRIGHT "Copyright Nicola Salmoria\nand the MAME team\nhttp://mamedev.org"
#define COPYRIGHT_INFO "Copyright Nicola Salmoria and the MAME team"
-#define DISCLAIMER "MAME is an emulator: it reproduces, more or less faithfully, the behaviour of\n" \
- "several arcade machines. But hardware is useless without software, so an image\n" \
- "of the ROMs which run on that hardware is required. Such ROMs, like any other\n" \
- "commercial software, are copyrighted material and it is therefore illegal to\n" \
- "use them if you don't own the original arcade machine. Needless to say, ROMs\n" \
- "are not distributed together with MAME. Distribution of MAME together with ROM\n" \
- "images is a violation of copyright law and should be promptly reported to the\n" \
- "authors so that appropriate legal action can be taken.\n"
-#define USAGE "Usage: %s [%s] [options]"
-#define XML_ROOT "mame"
-#define XML_TOP "game"
-#define STATE_MAGIC_NUM "MAMESAVE"
const char * emulator_info::get_appname() { return APPNAME;}
const char * emulator_info::get_appname_lower() { return APPNAME_LOWER;}
const char * emulator_info::get_configname() { return CONFIGNAME;}
-const char * emulator_info::get_capgamenoun() { return CAPGAMENOUN;}
-const char * emulator_info::get_capstartgamenoun() { return CAPSTARTGAMENOUN;}
-const char * emulator_info::get_gamenoun() { return GAMENOUN;}
-const char * emulator_info::get_gamesnoun() { return GAMESNOUN;}
const char * emulator_info::get_copyright() { return COPYRIGHT;}
const char * emulator_info::get_copyright_info() { return COPYRIGHT_INFO;}
-const char * emulator_info::get_disclaimer() { return DISCLAIMER;}
-const char * emulator_info::get_usage() { return USAGE;}
-const char * emulator_info::get_xml_root() { return XML_ROOT;}
-const char * emulator_info::get_xml_top() { return XML_TOP;}
-const char * emulator_info::get_state_magic_num() { return STATE_MAGIC_NUM;}
-void emulator_info::printf_usage(const char *par1, const char *par2) { osd_printf_info(USAGE, par1, par2); }
/*************************************
*
diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp
index 90918c06673..a448128070b 100644
--- a/src/lib/util/aviio.cpp
+++ b/src/lib/util/aviio.cpp
@@ -1297,7 +1297,7 @@ avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample
UINT32 bytes_per_sample;
file_error filerr;
avi_stream *stream;
- int offset;
+ int offset = 0;
/* get the audio stream */
stream = get_audio_stream(file, channel, &offset);
diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst
index e3e49058ee2..76a780960b3 100644
--- a/src/mame/arcade.lst
+++ b/src/mame/arcade.lst
@@ -1107,6 +1107,7 @@ tekken4
tekken4a
tekken4b
tekken4c
+wanganmr
prdgp03
timecrs3
timecrs3e
@@ -4185,9 +4186,10 @@ marukin // 17/10/1990 (c) 1990 Yuga (Japan)
qtono1 // 25/12/1990 (QUIZ 3) (c) 1991 Capcom (Japan)
// 4/1991 Ashita Tenki ni Naare (golf)
qsangoku // 07/06/1991 (QUIZ 4) (c) 1991 Capcom (Japan)
-block // 10/09/1991 (c) 1991 Capcom (World)
+block // 19/12/1991 (c) 1991 Capcom (World) (Joystick version)
+blockr1 // 06/11/1991 (c) 1991 Capcom (World) (Joystick version)
+blockr2 // 10/09/1991 (c) 1991 Capcom (World)
blockj // 10/09/1991 (c) 1991 Capcom (Japan)
-blockjoy // 06/11/1991 (c) 1991 Capcom (World) (Joystick version, bad dump?)
blockbl // bootleg
// Incredible Technologies games
@@ -10937,7 +10939,7 @@ stuntair // (c) 1983 Nuova Videotron
// Success
tonton // (c) 199? Success / Taiyo Jidoki.
-kurukuru // (c) 199? Success / Taiyo Jidoki.
+kurukuru // (c) 1990 Success / Taiyo Jidoki.
ppj // (c) 199? Success / Taiyo Jidoki.
othello // (c) 1984 Success.
sothello // (c) 1986 Success / Fujiwara.
@@ -12430,10 +12432,12 @@ excitbj // (c) 1992 Wing Co. Ltd
carb2002 // bootleg
carb2003 // bootleg
nfm // bootleg
+scmaster // 1994, unknown
unkch1 // bootleg
unkch2 // bootleg
unkch3 // bootleg
unkch4 // bootleg
+cherry96 // bootleg
ns8lines // unknown
ns8linew // unknown
ladylinr // (c) 198? TAB Austria
@@ -12453,6 +12457,7 @@ schery97a // (c) 1998 Amcoe
roypok96 // (c) 1996 Amcoe
roypok96a // (c) 1996 Amcoe
roypok96b // (c) 1996 Amcoe
+roypok96c // (c) 1996 Amcoe
pokonl97 // (c) 1997 Amcoe
nc96 // (c) 1996 Amcoe
nc96a // (c) 1996 Amcoe
diff --git a/src/mame/drivers/1943.cpp b/src/mame/drivers/1943.cpp
index 3dc4c5aa98c..4b64f9dae53 100644
--- a/src/mame/drivers/1943.cpp
+++ b/src/mame/drivers/1943.cpp
@@ -825,4 +825,4 @@ GAME( 1987, 1943j, 1943, 1943, 1943, _1943_state, 1943, ROT270, "Capcom"
GAME( 1987, 1943ja, 1943, 1943, 1943, _1943_state, 1943, ROT270, "Capcom", "1943: Midway Kaisen (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, 1943b, 1943, 1943, 1943, _1943_state, 1943b,ROT270, "bootleg", "1943: Battle of Midway (bootleg, hack of Japan set)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, 1943bj, 1943, 1943, 1943, _1943_state, 1943b,ROT270, "bootleg", "1943: Midway Kaisen (bootleg)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, 1943kai, 0, 1943, 1943, _1943_state, 1943, ROT270, "Capcom", "1943 Kai: Midway Kaisen (Japan)", MACHINE_SUPPORTS_SAVE ) \ No newline at end of file
+GAME( 1987, 1943kai, 0, 1943, 1943, _1943_state, 1943, ROT270, "Capcom", "1943 Kai: Midway Kaisen (Japan)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp
index 4dfeab5b92c..4df457ce129 100644
--- a/src/mame/drivers/8080bw.cpp
+++ b/src/mame/drivers/8080bw.cpp
@@ -4793,7 +4793,7 @@ GAME( 1979, moonbasea, invadpt2, invadpt2, invadpt2, driver_device, 0, ROT270
GAME( 1980, spclaser, 0, invadpt2, spclaser, driver_device, 0, ROT270, "Taito", "Space Laser", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1980, intruder, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "Taito (Game Plan license)", "Intruder", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
-GAME( 1980, laser, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "bootleg (Leisure Time Electronics Inc.)", "Astro Laser (bootleg of Space Laser)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE )
+GAME( 1980, laser, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "bootleg (Leisure Time Electronics)", "Astro Laser (bootleg of Space Laser)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1979, spcewarl, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "Leijac Corporation", "Space War (Leijac Corporation)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // Taito's version is actually a spin-off of this?
GAME( 1979, lrescue, 0, lrescue, lrescue, driver_device, 0, ROT270, "Taito", "Lunar Rescue", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp
index f8a2519700e..4ac472fe0c1 100644
--- a/src/mame/drivers/at.cpp
+++ b/src/mame/drivers/at.cpp
@@ -17,6 +17,7 @@
#include "softlist.h"
static ADDRESS_MAP_START( at16_map, AS_PROGRAM, 16, at_state )
+ ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10")
AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM
AM_RANGE(0x0c8000, 0x0cffff) AM_ROM
@@ -26,7 +27,7 @@ static ADDRESS_MAP_START( at16_map, AS_PROGRAM, 16, at_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( ps2m30286_map, AS_PROGRAM, 16, at_state)
- AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10")
+ AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10")
AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM
AM_RANGE(0x0c8000, 0x0cffff) AM_ROM
AM_RANGE(0x0d0000, 0x0dffff) AM_RAM
@@ -42,6 +43,7 @@ static ADDRESS_MAP_START( ps1_286_map, AS_PROGRAM, 16, at_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( at386_map, AS_PROGRAM, 32, at_state )
+ ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000000, 0x0009ffff) AM_RAMBANK("bank10")
AM_RANGE(0x000a0000, 0x000bffff) AM_NOP
AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM
@@ -1175,10 +1177,10 @@ AMI 8921MBK 90X8551 1987 --> 72X7560
*/
ROM_START( i8580071 )
ROM_REGION(0x1000000,"maincpu", 0)
- ROM_LOAD( "90x8548.bin", 0xe0000, 0x8000, CRC(1f13eea5) SHA1(0bf53ad86f47db3825a713ea2e4ef23715cc4f79))
- ROM_LOAD( "90x8549.bin", 0xe0001, 0x8000, CRC(9e0f4a99) SHA1(b8600f04159ed281a57416274390ba9302be541b))
- ROM_LOAD( "90x8550.bin", 0xf0000, 0x8000, CRC(cb21df96) SHA1(0c2765f6becfa3f9171c4f13f7b74d19c4c9acc2))
- ROM_LOAD( "90x8551.bin", 0xf0001, 0x8000, CRC(3d7e9868) SHA1(2928fe0e48a573cc2c0c41bd7f7188a54a908229))
+ ROM_LOAD32_BYTE( "90x8548.bin", 0xe0000, 0x8000, CRC(1f13eea5) SHA1(0bf53ad86f47db3825a713ea2e4ef23715cc4f79))
+ ROM_LOAD32_BYTE( "90x8549.bin", 0xe0001, 0x8000, CRC(9e0f4a99) SHA1(b8600f04159ed281a57416274390ba9302be541b))
+ ROM_LOAD32_BYTE( "90x8550.bin", 0xe0002, 0x8000, CRC(cb21df96) SHA1(0c2765f6becfa3f9171c4f13f7b74d19c4c9acc2))
+ ROM_LOAD32_BYTE( "90x8551.bin", 0xe0003, 0x8000, CRC(3d7e9868) SHA1(2928fe0e48a573cc2c0c41bd7f7188a54a908229))
ROM_END
/*
@@ -1596,7 +1598,8 @@ ROM_END
ROM_START( aprpand )
ROM_REGION(0x1000000,"maincpu", 0)
- ROM_LOAD( "pf10226.std", 0xe0000, 0x20000, CRC(7396fb87) SHA1(a109cbad2179eec55f86c0297a59bb015461da21))
+ ROM_LOAD16_BYTE( "pf10226.std", 0xe0000, 0x10000, CRC(7396fb87) SHA1(a109cbad2179eec55f86c0297a59bb015461da21))
+ ROM_CONTINUE( 0xe0001, 0x10000 )
ROM_END
ROM_START( aprfte )
diff --git a/src/mame/drivers/avigo.cpp b/src/mame/drivers/avigo.cpp
index f8d23276a8b..e7b301eea5c 100644
--- a/src/mame/drivers/avigo.cpp
+++ b/src/mame/drivers/avigo.cpp
@@ -77,43 +77,6 @@
#define LOG(x) do { if (AVIGO_LOG) logerror x; } while (0)
-/* memory 0x0000-0x03fff */
-READ8_MEMBER(avigo_state::flash_0x0000_read_handler)
-{
- return m_flashes[0]->read(offset);
-}
-
-/* memory 0x0000-0x03fff */
-WRITE8_MEMBER(avigo_state::flash_0x0000_write_handler)
-{
- m_flashes[0]->write(offset, data);
-}
-
-/* memory 0x04000-0x07fff */
-READ8_MEMBER(avigo_state::flash_0x4000_read_handler)
-{
- return m_flashes[m_flash_at_0x4000]->read((m_bank1_l<<14) | offset);
-}
-
-/* memory 0x04000-0x07fff */
-WRITE8_MEMBER(avigo_state::flash_0x4000_write_handler)
-{
- m_flashes[m_flash_at_0x4000]->write((m_bank1_l<<14) | offset, data);
-}
-
-/* memory 0x08000-0x0bfff */
-READ8_MEMBER(avigo_state::flash_0x8000_read_handler)
-{
- return m_flashes[m_flash_at_0x8000]->read((m_bank2_l<<14) | offset);
-}
-
-/* memory 0x08000-0x0bfff */
-WRITE8_MEMBER(avigo_state::flash_0x8000_write_handler)
-{
- m_flashes[m_flash_at_0x8000]->write((m_bank2_l<<14) | offset, data);
-}
-
-
/*
IRQ bits (port 3) ordered by priority:
@@ -150,58 +113,6 @@ WRITE_LINE_MEMBER( avigo_state::tc8521_alarm_int )
//#endif
}
-void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
-{
- address_space& space = m_maincpu->space(AS_PROGRAM);
- int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000);
- char bank_tag[6];
-
- LOG(("Chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff));
-
- switch (chip_select)
- {
- case 0x06: // videoram
- space.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, read8_delegate(FUNC(avigo_state::vid_memory_r), this), write8_delegate(FUNC(avigo_state::vid_memory_w), this));
- active_flash = -1;
- break;
-
- case 0x01: // banked RAM
- sprintf(bank_tag,"bank%d", bank);
- membank(bank_tag)->set_base(m_ram_base + (((bank == 1 ? m_bank1_l : m_bank2_l) & 0x07)<<14));
- space.install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag);
- active_flash = -1;
- break;
-
- case 0x00: // flash 0
- case 0x03: // flash 1
- case 0x05: // flash 2
- case 0x07: // flash 0
- if (active_flash < 0) // to avoid useless calls to install_readwrite_handler that cause slowdowns
- {
- if (bank == 1)
- space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(avigo_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x4000_write_handler), this));
- else
- space.install_readwrite_handler(0x8000, 0xbfff, read8_delegate(FUNC(avigo_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x8000_write_handler), this));
- }
-
- switch (chip_select)
- {
- case 0x00:
- case 0x07: active_flash = 0; break;
- case 0x03: active_flash = 1; break;
- case 0x05: active_flash = 2; break;
- }
- break;
-
- default:
- logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff);
- space.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
- active_flash = -1;
- break;
- }
-}
-
-
WRITE_LINE_MEMBER( avigo_state::com_interrupt )
{
LOG(("com int\r\n"));
@@ -218,38 +129,21 @@ WRITE_LINE_MEMBER( avigo_state::com_interrupt )
void avigo_state::machine_reset()
{
- /* if is a cold start initialize flash contents */
- if (!m_warm_start)
- {
- memcpy(m_flashes[0]->space().get_read_ptr(0), memregion("bios")->base() + 0x000000, 0x100000);
- memcpy(m_flashes[1]->space().get_read_ptr(0), memregion("bios")->base() + 0x100000, 0x100000);
- }
-
m_irq = 0;
m_bank1_l = 0;
m_bank1_h = 0;
m_bank2_l = 0;
m_bank2_h = 0;
- m_flash_at_0x4000 = -1;
- m_flash_at_0x8000 = -1;
- refresh_memory(1, m_bank1_h & 0x07);
- refresh_memory(2, m_bank2_h & 0x07);
+ m_bankdev1->set_bank(0);
+ m_bankdev2->set_bank(0);
}
void avigo_state::machine_start()
{
- m_ram_base = (UINT8*)m_ram->pointer();
-
// bank3 always first ram bank
- membank("bank3")->set_base(m_ram_base);
-
- /* keep machine pointers to flash devices */
- m_flashes[0] = machine().device<intelfsh8_device>("flash0");
- m_flashes[1] = machine().device<intelfsh8_device>("flash1");
- m_flashes[2] = machine().device<intelfsh8_device>("flash2");
+ membank("bank2")->set_base(m_nvram);
- machine().device<nvram_device>("nvram")->set_base(m_ram_base, m_ram->size());
m_warm_start = 1;
// register for state saving
@@ -261,33 +155,27 @@ void avigo_state::machine_start()
save_item(NAME(m_bank1_l));
save_item(NAME(m_bank1_h));
save_item(NAME(m_ad_control_status));
- save_item(NAME(m_flash_at_0x4000));
- save_item(NAME(m_flash_at_0x8000));
save_item(NAME(m_ad_value));
save_item(NAME(m_screen_column));
save_item(NAME(m_warm_start));
+}
- // save all flash contents
- save_pointer(NAME((UINT8*)m_flashes[0]->space().get_read_ptr(0)), 0x100000);
- save_pointer(NAME((UINT8*)m_flashes[1]->space().get_read_ptr(0)), 0x100000);
- save_pointer(NAME((UINT8*)m_flashes[2]->space().get_read_ptr(0)), 0x100000);
+static ADDRESS_MAP_START(avigo_banked_map, AS_PROGRAM, 8, avigo_state)
+ AM_RANGE(0x0000000, 0x00fffff) AM_MIRROR(0x0300000) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
+ AM_RANGE(0x0400000, 0x041ffff) AM_MIRROR(0x03e0000) AM_RAM AM_SHARE("nvram")
- // register postload callback
- machine().save().register_postload(save_prepost_delegate(FUNC(avigo_state::postload), this));
-}
+ AM_RANGE(0x0c00000, 0x0cfffff) AM_MIRROR(0x0300000) AM_DEVREADWRITE("flash1", intelfsh8_device, read, write)
+ AM_RANGE(0x1400000, 0x14fffff) AM_MIRROR(0x0300000) AM_DEVREADWRITE("flash2", intelfsh8_device, read, write)
+ AM_RANGE(0x1c00000, 0x1cfffff) AM_MIRROR(0x0300000) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
-void avigo_state::postload()
-{
- // refresh the bankswitch
- refresh_memory(1, m_bank1_h & 0x07);
- refresh_memory(2, m_bank2_h & 0x07);
-}
+ AM_RANGE(0x1800000, 0x1803fff) AM_MIRROR(0x03fc000) AM_READWRITE(vid_memory_r, vid_memory_w)
+ADDRESS_MAP_END
static ADDRESS_MAP_START( avigo_mem , AS_PROGRAM, 8, avigo_state)
- AM_RANGE(0x0000, 0x3fff) AM_READWRITE(flash_0x0000_read_handler, flash_0x0000_write_handler)
- AM_RANGE(0x4000, 0x7fff) AM_READWRITE_BANK("bank1")
- AM_RANGE(0x8000, 0xbfff) AM_READWRITE_BANK("bank2")
- AM_RANGE(0xc000, 0xffff) AM_READWRITE_BANK("bank3")
+ AM_RANGE(0x0000, 0x3fff) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
+ AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("bank0", address_map_bank_device, read8, write8)
+ AM_RANGE(0x8000, 0xbfff) AM_DEVREADWRITE("bank1", address_map_bank_device, read8, write8)
+ AM_RANGE(0xc000, 0xffff) AM_RAMBANK("bank2")
ADDRESS_MAP_END
@@ -378,7 +266,7 @@ WRITE8_MEMBER(avigo_state::bank1_w)
m_bank1_l = data & 0x3f;
}
- refresh_memory(1, m_bank1_h & 0x07);
+ m_bankdev1->set_bank(((m_bank1_h & 0x07) << 8) | m_bank1_l);
}
WRITE8_MEMBER(avigo_state::bank2_w)
@@ -394,7 +282,7 @@ WRITE8_MEMBER(avigo_state::bank2_w)
m_bank2_l = data & 0x3f;
}
- refresh_memory(2, m_bank2_h & 0x07);
+ m_bankdev2->set_bank(((m_bank2_h & 0x07) << 8) | m_bank2_l);
}
READ8_MEMBER(avigo_state::ad_control_status_r)
@@ -775,12 +663,12 @@ static const gfx_layout avigo_6_by_8 =
};
static GFXDECODE_START( avigo )
- GFXDECODE_ENTRY( "bios", 0x08992, avigo_charlayout, 0, 1 )
- GFXDECODE_ENTRY( "bios", 0x0c020, avigo_8_by_14, 0, 1 )
- GFXDECODE_ENTRY( "bios", 0x0c020, avigo_16_by_15, 0, 1 )
- GFXDECODE_ENTRY( "bios", 0x14020, avigo_15_by_16, 0, 1 )
- GFXDECODE_ENTRY( "bios", 0x1c020, avigo_8_by_8, 0, 1 )
- GFXDECODE_ENTRY( "bios", 0x1e020, avigo_6_by_8, 0, 1 )
+ GFXDECODE_ENTRY( "flash0", 0x08992, avigo_charlayout, 0, 1 )
+ GFXDECODE_ENTRY( "flash0", 0x0c020, avigo_8_by_14, 0, 1 )
+ GFXDECODE_ENTRY( "flash0", 0x0c020, avigo_16_by_15, 0, 1 )
+ GFXDECODE_ENTRY( "flash0", 0x14020, avigo_15_by_16, 0, 1 )
+ GFXDECODE_ENTRY( "flash0", 0x1c020, avigo_8_by_8, 0, 1 )
+ GFXDECODE_ENTRY( "flash0", 0x1e020, avigo_6_by_8, 0, 1 )
GFXDECODE_END
@@ -800,7 +688,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(avigo_state::avigo_1hz_timer)
QUICKLOAD_LOAD_MEMBER( avigo_state,avigo)
{
- address_space& flash1 = m_flashes[1]->space(0);
+ address_space& flash1 = m_flash1->space(0);
const char *systemname = machine().system().name;
UINT32 first_app_page = (0x50000>>14);
int app_page;
@@ -833,7 +721,7 @@ QUICKLOAD_LOAD_MEMBER( avigo_state,avigo)
logerror("Application loaded at 0x%05x-0x%05x\n", app_page<<14, (app_page<<14) + (UINT32)image.length());
// copy app file into flash memory
- image.fread((UINT8*)m_flashes[1]->space().get_read_ptr(app_page<<14), image.length());
+ image.fread((UINT8*)flash1.get_read_ptr(app_page<<14), image.length());
// update the application ID
flash1.write_byte((app_page<<14) + 0x1a5, 0x80 + (app_page - (first_app_page>>14)));
@@ -907,6 +795,18 @@ static MACHINE_CONFIG_START( avigo, avigo_state )
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("128K")
+ MCFG_DEVICE_ADD("bank0", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(avigo_banked_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
+
+ MCFG_DEVICE_ADD("bank1", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(avigo_banked_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
+
MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", avigo_state, nvram_init)
// IRQ 1 is used for scan the pen and for cursor blinking
@@ -926,87 +826,78 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START(avigo)
- ROM_REGION(0x200000, "bios", ROMREGION_ERASEFF)
-
+ ROM_REGION(0x100000, "flash0", ROMREGION_ERASEFF)
ROM_SYSTEM_BIOS( 0, "v1004", "v1.004" )
ROMX_LOAD("os_1004.rom", 0x000000, 0x0100000, CRC(62acd55c) SHA1(b2be12f5cc1053b6026bff2a265146ba831a7ffa), ROM_BIOS(1))
- ROMX_LOAD("english_1004.rom", 0x100000, 0x050000, CRC(c9c3a225) SHA1(7939993a5615ca59ff2047e69b6d85122d437dca), ROM_BIOS(1))
-
ROM_SYSTEM_BIOS( 1, "v1002", "v1.002" )
ROMX_LOAD("os_1002.rom", 0x000000, 0x0100000, CRC(484bb95c) SHA1(ddc28f22f8cbc99f60f91c58ee0e2d15170024fb), ROM_BIOS(2))
- ROMX_LOAD("english_1002.rom", 0x100000, 0x050000, CRC(31cab0ac) SHA1(87d337830506a12514a4beb9a8502a0de94816f2), ROM_BIOS(2))
-
ROM_SYSTEM_BIOS( 2, "v100", "v1.00" )
ROMX_LOAD("os_100.rom", 0x000000, 0x0100000, CRC(13ea7b38) SHA1(85566ff142d86d504ac72613f169d8758e2daa09), ROM_BIOS(3))
- ROMX_LOAD("english_100.rom", 0x100000, 0x050000, CRC(e2824b44) SHA1(3252454b05c3d3a4d7df1cb48dc3441ae82f2b1c), ROM_BIOS(3))
+ ROM_REGION(0x100000, "flash1", ROMREGION_ERASEFF)
+ ROMX_LOAD("english_1004.rom", 0x000000, 0x050000, CRC(c9c3a225) SHA1(7939993a5615ca59ff2047e69b6d85122d437dca), ROM_BIOS(1))
+ ROMX_LOAD("english_1002.rom", 0x000000, 0x050000, CRC(31cab0ac) SHA1(87d337830506a12514a4beb9a8502a0de94816f2), ROM_BIOS(2))
+ ROMX_LOAD("english_100.rom", 0x000000, 0x050000, CRC(e2824b44) SHA1(3252454b05c3d3a4d7df1cb48dc3441ae82f2b1c), ROM_BIOS(3))
ROM_END
ROM_START(avigo_de)
- ROM_REGION(0x200000, "bios", ROMREGION_ERASEFF)
-
+ ROM_REGION(0x100000, "flash0", ROMREGION_ERASEFF)
ROM_SYSTEM_BIOS( 0, "v1004", "v1.004" )
ROMX_LOAD("os_1004.rom", 0x000000, 0x0100000, CRC(62acd55c) SHA1(b2be12f5cc1053b6026bff2a265146ba831a7ffa), ROM_BIOS(1))
- ROMX_LOAD("german_1004.rom", 0x100000, 0x060000, CRC(0fa437b3) SHA1(e9352aa8fee6d93b898412bd129452b82baa9a21), ROM_BIOS(1))
-
ROM_SYSTEM_BIOS( 1, "v1002", "v1.002" )
ROMX_LOAD("os_1002.rom", 0x000000, 0x0100000, CRC(484bb95c) SHA1(ddc28f22f8cbc99f60f91c58ee0e2d15170024fb), ROM_BIOS(2))
- ROMX_LOAD("german_1002.rom", 0x100000, 0x060000, CRC(c6bf07ba) SHA1(d3185687aa510f6c3b3ab3baaabe7e8ce1a79e3b), ROM_BIOS(2))
-
ROM_SYSTEM_BIOS( 2, "v100", "v1.00" )
ROMX_LOAD("os_100.rom", 0x000000, 0x0100000, CRC(13ea7b38) SHA1(85566ff142d86d504ac72613f169d8758e2daa09), ROM_BIOS(3))
- ROMX_LOAD("german_100.rom", 0x100000, 0x060000, CRC(117d9189) SHA1(7e959ab1381ba831821fcf87973b25d87f12d34e), ROM_BIOS(3))
+ ROM_REGION(0x100000, "flash1", ROMREGION_ERASEFF)
+ ROMX_LOAD("german_1004.rom", 0x000000, 0x060000, CRC(0fa437b3) SHA1(e9352aa8fee6d93b898412bd129452b82baa9a21), ROM_BIOS(1))
+ ROMX_LOAD("german_1002.rom", 0x000000, 0x060000, CRC(c6bf07ba) SHA1(d3185687aa510f6c3b3ab3baaabe7e8ce1a79e3b), ROM_BIOS(2))
+ ROMX_LOAD("german_100.rom", 0x000000, 0x060000, CRC(117d9189) SHA1(7e959ab1381ba831821fcf87973b25d87f12d34e), ROM_BIOS(3))
ROM_END
ROM_START(avigo_fr)
- ROM_REGION(0x200000, "bios", ROMREGION_ERASEFF)
-
+ ROM_REGION(0x100000, "flash0", ROMREGION_ERASEFF)
ROM_SYSTEM_BIOS( 0, "v1004", "v1.004" )
ROMX_LOAD("os_1004.rom", 0x000000, 0x0100000, CRC(62acd55c) SHA1(b2be12f5cc1053b6026bff2a265146ba831a7ffa), ROM_BIOS(1))
- ROMX_LOAD("french_1004.rom", 0x100000, 0x050000, CRC(5e4d90f7) SHA1(07df3af8a431ba65e079d6c987fb5d544f6541d8), ROM_BIOS(1))
-
ROM_SYSTEM_BIOS( 1, "v1002", "v1.002" )
ROMX_LOAD("os_1002.rom", 0x000000, 0x0100000, CRC(484bb95c) SHA1(ddc28f22f8cbc99f60f91c58ee0e2d15170024fb), ROM_BIOS(2))
- ROMX_LOAD("french_1002.rom", 0x100000, 0x050000,CRC(caa3eb91) SHA1(ab199986de301d933f069a5e1f5150967e1d7f59), ROM_BIOS(2))
-
ROM_SYSTEM_BIOS( 2, "v100", "v1.00" )
ROMX_LOAD("os_100.rom", 0x000000, 0x0100000, CRC(13ea7b38) SHA1(85566ff142d86d504ac72613f169d8758e2daa09), ROM_BIOS(3))
- ROMX_LOAD("french_100.rom", 0x100000, 0x050000, CRC(fffa2345) SHA1(399447cede3cdd0be768952cb24f7e4431147e3d), ROM_BIOS(3))
+ ROM_REGION(0x100000, "flash1", ROMREGION_ERASEFF)
+ ROMX_LOAD("french_1004.rom", 0x000000, 0x050000, CRC(5e4d90f7) SHA1(07df3af8a431ba65e079d6c987fb5d544f6541d8), ROM_BIOS(1))
+ ROMX_LOAD("french_1002.rom", 0x000000, 0x050000,CRC(caa3eb91) SHA1(ab199986de301d933f069a5e1f5150967e1d7f59), ROM_BIOS(2))
+ ROMX_LOAD("french_100.rom", 0x000000, 0x050000, CRC(fffa2345) SHA1(399447cede3cdd0be768952cb24f7e4431147e3d), ROM_BIOS(3))
ROM_END
ROM_START(avigo_es)
- ROM_REGION(0x200000, "bios", ROMREGION_ERASEFF)
-
+ ROM_REGION(0x100000, "flash0", ROMREGION_ERASEFF)
ROM_SYSTEM_BIOS( 0, "v1004", "v1.004" )
ROMX_LOAD("os_1004.rom", 0x000000, 0x0100000, CRC(62acd55c) SHA1(b2be12f5cc1053b6026bff2a265146ba831a7ffa), ROM_BIOS(1))
- ROMX_LOAD("spanish_1004.rom", 0x100000, 0x060000, CRC(235a7f8d) SHA1(94da4ecafb54dcd5d80bc5063cb4024e66e6a21f), ROM_BIOS(1))
-
ROM_SYSTEM_BIOS( 1, "v1002", "v1.002" )
ROMX_LOAD("os_1002.rom", 0x000000, 0x0100000, CRC(484bb95c) SHA1(ddc28f22f8cbc99f60f91c58ee0e2d15170024fb), ROM_BIOS(2))
- ROMX_LOAD("spanish_1002.rom", 0x100000, 0x060000, CRC(a6e80cc4) SHA1(e741657558c11f7bce646ba3d7b5f845bfa275b7), ROM_BIOS(2))
-
ROM_SYSTEM_BIOS( 2, "v100", "v1.00" )
ROMX_LOAD("os_100.rom", 0x000000, 0x0100000, CRC(13ea7b38) SHA1(85566ff142d86d504ac72613f169d8758e2daa09), ROM_BIOS(3))
- ROMX_LOAD("spanish_100.rom", 0x100000, 0x060000, CRC(953a5276) SHA1(b9ba1dbdc2127b1ef419c911ef66313024a7351a), ROM_BIOS(3))
+ ROM_REGION(0x100000, "flash1", ROMREGION_ERASEFF)
+ ROMX_LOAD("spanish_1004.rom", 0x000000, 0x060000, CRC(235a7f8d) SHA1(94da4ecafb54dcd5d80bc5063cb4024e66e6a21f), ROM_BIOS(1))
+ ROMX_LOAD("spanish_1002.rom", 0x000000, 0x060000, CRC(a6e80cc4) SHA1(e741657558c11f7bce646ba3d7b5f845bfa275b7), ROM_BIOS(2))
+ ROMX_LOAD("spanish_100.rom", 0x000000, 0x060000, CRC(953a5276) SHA1(b9ba1dbdc2127b1ef419c911ef66313024a7351a), ROM_BIOS(3))
ROM_END
ROM_START(avigo_it)
- ROM_REGION(0x200000, "bios", ROMREGION_ERASEFF)
-
+ ROM_REGION(0x100000, "flash0", ROMREGION_ERASEFF)
ROM_SYSTEM_BIOS( 0, "v1004", "v1.004" )
ROMX_LOAD("os_1004.rom", 0x000000, 0x0100000, CRC(62acd55c) SHA1(b2be12f5cc1053b6026bff2a265146ba831a7ffa), ROM_BIOS(1))
- ROMX_LOAD("italian_1004.rom", 0x100000, 0x050000, CRC(fb7941ec) SHA1(230e8346a3b0da1ee24568ec090ce6860ebfe995), ROM_BIOS(1))
-
ROM_SYSTEM_BIOS( 1, "v1002", "v1.002" )
ROMX_LOAD("os_1002.rom", 0x000000, 0x0100000, CRC(484bb95c) SHA1(ddc28f22f8cbc99f60f91c58ee0e2d15170024fb), ROM_BIOS(2))
- ROMX_LOAD("italian_1002.rom", 0x100000, 0x050000, CRC(093bc032) SHA1(2c75d950d356a7fd1d058808e5f0be8e15b8ea2a), ROM_BIOS(2))
-
ROM_SYSTEM_BIOS( 2, "v100", "v1.00" )
ROMX_LOAD("os_100.rom", 0x000000, 0x0100000, CRC(13ea7b38) SHA1(85566ff142d86d504ac72613f169d8758e2daa09), ROM_BIOS(3))
- ROMX_LOAD("italian_100.rom", 0x100000, 0x050000, CRC(de359218) SHA1(6185727aba8ffc98723f2df74dda388fd0d70cc9), ROM_BIOS(3))
+
+ ROM_REGION(0x100000, "flash1", ROMREGION_ERASEFF)
+ ROMX_LOAD("italian_1004.rom", 0x000000, 0x050000, CRC(fb7941ec) SHA1(230e8346a3b0da1ee24568ec090ce6860ebfe995), ROM_BIOS(1))
+ ROMX_LOAD("italian_1002.rom", 0x000000, 0x050000, CRC(093bc032) SHA1(2c75d950d356a7fd1d058808e5f0be8e15b8ea2a), ROM_BIOS(2))
+ ROMX_LOAD("italian_100.rom", 0x000000, 0x050000, CRC(de359218) SHA1(6185727aba8ffc98723f2df74dda388fd0d70cc9), ROM_BIOS(3))
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
diff --git a/src/mame/drivers/blmbycar.cpp b/src/mame/drivers/blmbycar.cpp
index 9c04c73df6f..b3bef4ec1c6 100644
--- a/src/mame/drivers/blmbycar.cpp
+++ b/src/mame/drivers/blmbycar.cpp
@@ -41,12 +41,11 @@ Check game speed, it depends on a bit we toggle..
/* The top 64k of samples are banked (16 banks total) */
-WRITE16_MEMBER(blmbycar_state::blmbycar_okibank_w)
+WRITE16_MEMBER(blmbycar_state::okibank_w)
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = memregion("oki")->base();
- memcpy(&RAM[0x30000], &RAM[0x40000 + 0x10000 * (data & 0xf)], 0x10000);
+ membank("okibank")->set_entry(data & 0x0f);
}
}
@@ -98,12 +97,12 @@ READ16_MEMBER(blmbycar_state::blmbycar_opt_wheel_r)
***************************************************************************/
-static ADDRESS_MAP_START( blmbycar_map, AS_PROGRAM, 16, blmbycar_state )
+static ADDRESS_MAP_START( common_map, AS_PROGRAM, 16, blmbycar_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0xfec000, 0xfeffff) AM_RAM
AM_RANGE(0x100000, 0x103fff) AM_WRITEONLY // ???
- AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_SHARE("vram_1") // Layer 1
- AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_SHARE("vram_0") // Layer 0
+ AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Layer 1
+ AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Layer 0
AM_RANGE(0x108000, 0x10bfff) AM_WRITEONLY // ???
AM_RANGE(0x10c000, 0x10c003) AM_WRITEONLY AM_SHARE("scroll_1") // Scroll 1
AM_RANGE(0x10c004, 0x10c007) AM_WRITEONLY AM_SHARE("scroll_0") // Scroll 0
@@ -113,12 +112,17 @@ static ADDRESS_MAP_START( blmbycar_map, AS_PROGRAM, 16, blmbycar_state )
AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_SHARE("spriteram")// Sprites (size?)
AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW")
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2")
+ AM_RANGE(0x70000c, 0x70000d) AM_WRITE(okibank_w) // Sound
+ AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( blmbycar_map, AS_PROGRAM, 16, blmbycar_state )
+ AM_IMPORT_FROM(common_map)
+
AM_RANGE(0x700004, 0x700005) AM_READ(blmbycar_opt_wheel_r) // Wheel (optical)
AM_RANGE(0x700006, 0x700007) AM_READ_PORT("UNK")
AM_RANGE(0x700008, 0x700009) AM_READ(blmbycar_pot_wheel_r) // Wheel (potentiometer)
AM_RANGE(0x70000a, 0x70000b) AM_WRITENOP // ? Wheel
- AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w) // Sound
- AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound
AM_RANGE(0x70006a, 0x70006b) AM_WRITE(blmbycar_pot_wheel_reset_w) // Wheel (potentiometer)
AM_RANGE(0x70007a, 0x70007b) AM_WRITE(blmbycar_pot_wheel_shift_w) //
ADDRESS_MAP_END
@@ -130,25 +134,16 @@ READ16_MEMBER(blmbycar_state::waterball_unk_r)
}
static ADDRESS_MAP_START( watrball_map, AS_PROGRAM, 16, blmbycar_state )
- AM_RANGE(0x000000, 0x0fffff) AM_ROM
- AM_RANGE(0xfec000, 0xfeffff) AM_RAM
- AM_RANGE(0x100000, 0x103fff) AM_WRITEONLY // ???
- AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_SHARE("vram_1") // Layer 1
- AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_SHARE("vram_0") // Layer 0
- AM_RANGE(0x108000, 0x10bfff) AM_WRITEONLY // ???
- AM_RANGE(0x10c000, 0x10c003) AM_WRITEONLY AM_SHARE("scroll_1") // Scroll 1
- AM_RANGE(0x10c004, 0x10c007) AM_WRITEONLY AM_SHARE("scroll_0") // Scroll 0
- AM_RANGE(0x200000, 0x2005ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_MIRROR(0x4000) // Palette
- AM_RANGE(0x200600, 0x203fff) AM_RAM AM_MIRROR(0x4000)
- AM_RANGE(0x440000, 0x441fff) AM_RAM
- AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_SHARE("spriteram")// Sprites (size?)
- AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW")
- AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2")
+ AM_IMPORT_FROM(common_map)
+
AM_RANGE(0x700006, 0x700007) AM_READNOP // read
AM_RANGE(0x700008, 0x700009) AM_READ(waterball_unk_r) // 0x0008 must toggle
AM_RANGE(0x70000a, 0x70000b) AM_WRITEONLY // ?? busy
- AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w) // Sound
- AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) //
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( blmbycar_oki_map, AS_0, 8, blmbycar_state )
+ AM_RANGE(0x00000, 0x2ffff) AM_ROM
+ AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank")
ADDRESS_MAP_END
/***************************************************************************
@@ -334,6 +329,8 @@ MACHINE_START_MEMBER(blmbycar_state,blmbycar)
{
save_item(NAME(m_pot_wheel));
save_item(NAME(m_old_val));
+
+ membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000);
}
MACHINE_RESET_MEMBER(blmbycar_state,blmbycar)
@@ -359,7 +356,7 @@ static MACHINE_CONFIG_START( blmbycar, blmbycar_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(0x180, 0x100)
MCFG_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0x100-1)
- MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update_blmbycar)
+ MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", blmbycar)
@@ -371,6 +368,7 @@ static MACHINE_CONFIG_START( blmbycar, blmbycar_state )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, blmbycar_oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -379,6 +377,8 @@ MACHINE_CONFIG_END
MACHINE_START_MEMBER(blmbycar_state,watrball)
{
save_item(NAME(m_retvalue));
+
+ membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000);
}
MACHINE_RESET_MEMBER(blmbycar_state,watrball)
@@ -386,35 +386,19 @@ MACHINE_RESET_MEMBER(blmbycar_state,watrball)
m_retvalue = 0;
}
-static MACHINE_CONFIG_START( watrball, blmbycar_state )
+static MACHINE_CONFIG_DERIVED( watrball, blmbycar )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* 12MHz */
+ MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(watrball_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", blmbycar_state, irq1_line_hold)
MCFG_MACHINE_START_OVERRIDE(blmbycar_state,watrball)
MCFG_MACHINE_RESET_OVERRIDE(blmbycar_state,watrball)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(0x180, 0x100)
MCFG_SCREEN_VISIBLE_AREA(0, 0x180-1, 16, 0x100-1)
- MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update_blmbycar)
- MCFG_SCREEN_PALETTE("palette")
-
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", blmbycar)
- MCFG_PALETTE_ADD("palette", 0x300)
- MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG)
-
- /* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
-
- MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
@@ -450,10 +434,9 @@ ROM_START( blmbycar )
ROM_LOAD( "bc_rom9", 0x100000, 0x080000, CRC(0337ab3d) SHA1(18c72cd640c7b599390dffaeb670f5832202bf06) )
ROM_LOAD( "bc_rom10", 0x180000, 0x080000, CRC(5458917e) SHA1(c8dd5a391cc20a573e27a140b185893a8c04859e) )
- ROM_REGION( 0x140000, "oki", 0 ) /* 8 bit adpcm (banked) */
- ROM_LOAD( "bc_rom1", 0x040000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) )
- ROM_LOAD( "bc_rom2", 0x0c0000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) )
- ROM_COPY( "oki", 0x040000, 0x000000, 0x040000 )
+ ROM_REGION( 0x100000, "oki", 0 ) /* 8 bit adpcm (banked) */
+ ROM_LOAD( "bc_rom1", 0x000000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) )
+ ROM_LOAD( "bc_rom2", 0x080000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) )
ROM_END
ROM_START( blmbycaru )
@@ -467,10 +450,9 @@ ROM_START( blmbycaru )
ROM_LOAD( "bc_rom9", 0x100000, 0x080000, CRC(0337ab3d) SHA1(18c72cd640c7b599390dffaeb670f5832202bf06) )
ROM_LOAD( "bc_rom10", 0x180000, 0x080000, CRC(5458917e) SHA1(c8dd5a391cc20a573e27a140b185893a8c04859e) )
- ROM_REGION( 0x140000, "oki", 0 ) /* 8 bit adpcm (banked) */
- ROM_LOAD( "bc_rom1", 0x040000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) )
- ROM_LOAD( "bc_rom2", 0x0c0000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) )
- ROM_COPY( "oki", 0x040000, 0x000000, 0x040000 )
+ ROM_REGION( 0x100000, "oki", 0 ) /* 8 bit adpcm (banked) */
+ ROM_LOAD( "bc_rom1", 0x000000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) )
+ ROM_LOAD( "bc_rom2", 0x080000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) )
ROM_END
/*
@@ -478,7 +460,7 @@ ROM_END
Waterball by ABM (sticker on the pcb 12-3-96)
The pcb has some empty sockets, maybe it was used for other games since it has no markings.
-The game has fonts identical to World rally and obiviously Blomby car ;)
+The game has fonts identical to World Rally and obviously Blomby Car ;)
1x 68k
1x oki 6295
@@ -500,10 +482,9 @@ ROM_START( watrball )
ROM_LOAD( "rom9.bin", 0x100000, 0x080000, CRC(122cc0ad) SHA1(27cdb19fa082089e47c5cdb44742cfd93aa23a00) )
ROM_LOAD( "rom10.bin", 0x180000, 0x080000, CRC(22a2a706) SHA1(c7350a94a857e0007d7fc0076b44a3d62693cb6c) )
- ROM_REGION( 0x140000, "oki", 0 ) /* 8 bit adpcm (banked) */
- ROM_LOAD( "rom1.bin", 0x040000, 0x080000, CRC(7f88dee7) SHA1(d493b961fa4631185a33faee7f61786430707209))
-// ROM_LOAD( "rom2.bin", 0x0c0000, 0x080000, /* not populated for this game */ )
- ROM_COPY( "oki", 0x040000, 0x000000, 0x040000 )
+ ROM_REGION( 0x100000, "oki", 0 ) /* 8 bit adpcm (banked) */
+ ROM_LOAD( "rom1.bin", 0x000000, 0x080000, CRC(7f88dee7) SHA1(d493b961fa4631185a33faee7f61786430707209))
+// ROM_LOAD( "rom2.bin", 0x080000, 0x080000, /* not populated for this game */ )
ROM_END
diff --git a/src/mame/drivers/elecbowl.cpp b/src/mame/drivers/elecbowl.cpp
index 65a2070bc5c..297288fcbde 100644
--- a/src/mame/drivers/elecbowl.cpp
+++ b/src/mame/drivers/elecbowl.cpp
@@ -6,7 +6,7 @@
Marx Series 300 Electronic Bowling Game
Main board:
- * TMS1100NLL MP3403 DBS 7836 SINGAPORE
+ * TMS1100NLL MP3403 DBS 7836 SINGAPORE (no decap)
* 4*SN75492 quad segment driver, 2*SN74259 8-line demultiplexer,
2*CD4043 quad r/s input latch
* 5 7seg LEDs, 15 lamps(10 lamps projected to bowling pins reflection),
@@ -161,7 +161,7 @@ INPUT_PORTS_END
***************************************************************************/
-// output PLA is not dumped
+// output PLA is not decapped
static const UINT16 elecbowl_output_pla[0x20] =
{
lA+lB+lC+lD+lE+lF, // 0
@@ -183,7 +183,7 @@ static const UINT16 elecbowl_output_pla[0x20] =
static MACHINE_CONFIG_START( elecbowl, elecbowl_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K, C=100pf -> ~350kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 350000) // approximation - RC osc. R=33K, C=100pf
MCFG_TMS1XXX_OUTPUT_PLA(elecbowl_output_pla)
MCFG_TMS1XXX_READ_K_CB(READ8(elecbowl_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(elecbowl_state, write_r))
@@ -211,7 +211,7 @@ ROM_START( elecbowl )
ROM_LOAD( "mp3403.u9", 0x0000, 0x0800, CRC(9eabaa7d) SHA1(b1f54587ed7f2bbf3a5d49075c807296384c2b06) )
ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, BAD_DUMP CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) // not verified
+ ROM_LOAD( "tms1100_common3_micro.pla", 0, 867, BAD_DUMP CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) ) // not verified
ROM_REGION( 365, "maincpu:opla", 0 )
ROM_LOAD( "tms1100_elecbowl_output.pla", 0, 365, NO_DUMP )
ROM_END
diff --git a/src/mame/drivers/esq5505.cpp b/src/mame/drivers/esq5505.cpp
index 9b3e2493894..928ccee913c 100644
--- a/src/mame/drivers/esq5505.cpp
+++ b/src/mame/drivers/esq5505.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:R. Belmont
+// copyright-holders:R. Belmont, Parduz
/***************************************************************************
esq5505.c - Ensoniq ES5505 + ES5510 based synthesizers and samplers
@@ -10,7 +10,7 @@
The Taito sound system in taito_en.c is directly derived from the 32-voice version
of the SD-1.
- Driver by R. Belmont with thanks to Parduz, Christian Brunschen, and Phil Bennett
+ Driver by R. Belmont and Parduz with thanks to Christian Brunschen, and Phil Bennett
Memory map:
@@ -138,6 +138,7 @@
#include "machine/hd63450.h" // compatible with MC68450, which is what these really have
#include "formats/esq16_dsk.h"
#include "machine/esqvfd.h"
+#include "machine/esqlcd.h"
#include "machine/esqpanel.h"
#define GENERIC (0)
@@ -259,7 +260,7 @@ IRQ_CALLBACK_MEMBER(esq5505_state::maincpu_irq_acknowledge_callback)
vector = duart_irq_vector;
break;
default:
- printf("\nUnexpected IRQ ACK Callback: IRQ %d\n", irqline);
+ logerror("\nUnexpected IRQ ACK Callback: IRQ %d\n", irqline);
return 0;
}
update_irq_to_maincpu();
@@ -516,7 +517,7 @@ WRITE8_MEMBER(esq5505_state::dma_end)
{
if (data != 0)
{
- printf("DMAC IRQ, vector = %x\n", m_dmac->get_vector(offset));
+ //printf("DMAC IRQ, vector = %x\n", m_dmac->get_vector(offset));
dmac_irq_state = 1;
dmac_irq_vector = m_dmac->get_vector(offset);
}
@@ -532,7 +533,7 @@ WRITE8_MEMBER(esq5505_state::dma_error)
{
if(data != 0)
{
- printf("DMAC error, vector = %x\n", m_dmac->get_error_vector(offset));
+ logerror("DMAC error, vector = %x\n", m_dmac->get_error_vector(offset));
dmac_irq_state = 1;
dmac_irq_vector = m_dmac->get_vector(offset);
}
@@ -558,8 +559,14 @@ WRITE8_MEMBER(esq5505_state::fdc_write_byte)
INPUT_CHANGED_MEMBER(esq5505_state::key_stroke)
{
int val = (UINT8)(FPTR)param;
+ int cmp = 0x60;
- if (val < 0x60)
+ if (m_system_type == SQ1)
+ {
+ cmp = 10;
+ }
+
+ if (val < cmp)
{
if (oldval == 0 && newval == 1)
{
@@ -575,7 +582,7 @@ INPUT_CHANGED_MEMBER(esq5505_state::key_stroke)
}
else if (val == 0x02)
{
- printf("Analog tests!\n");
+// printf("Analog tests!\n");
m_panel->xmit_char(54 | 0x80); m_panel->xmit_char(0); // Preset down
m_panel->xmit_char(8 | 0x80); m_panel->xmit_char(0); // Compare down
m_panel->xmit_char(8); m_panel->xmit_char(0); // Compare up
@@ -585,10 +592,10 @@ INPUT_CHANGED_MEMBER(esq5505_state::key_stroke)
}
else
{
- val += shift;
+ if (val < 20) val += shift;
if (oldval == 0 && newval == 1)
{
- printf("key pressed %d\n", val&0x7f);
+ // printf("key pressed %d\n", val);
m_panel->xmit_char(val);
m_panel->xmit_char(0x00);
}
@@ -733,7 +740,7 @@ static MACHINE_CONFIG_DERIVED(sq1, vfx)
MCFG_CPU_PROGRAM_MAP(sq1_map)
MCFG_ESQPANEL_2x40_REMOVE("panel")
- MCFG_ESQPANEL2x40_SQ1_ADD("panel")
+ MCFG_ESQPANEL2x16_SQ1_ADD("panel")
MCFG_ESQPANEL_TX_CALLBACK(DEVWRITELINE("duart", mc68681_device, rx_b_w))
MCFG_ESQPANEL_ANALOG_CALLBACK(WRITE16(esq5505_state, analog_w))
MACHINE_CONFIG_END
@@ -784,6 +791,53 @@ static INPUT_PORTS_START( vfx )
#endif
INPUT_PORTS_END
+static INPUT_PORTS_START( sq1 )
+#if KEYBOARD_HACK
+ PORT_START("KEY0")
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 148) PORT_NAME("PITCH") // 148=PITCH (lo 1)
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 149) PORT_NAME("CONTROL") // 149=CONTROL (hi 1)
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 132) PORT_NAME("ENV1") // 132=ENV1 (lo 2)
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 133) PORT_NAME("CLICK") // 133=CLICK (hi 2)
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 182) PORT_NAME("LFO") // 182=LFO (lo 3)
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 183) PORT_NAME("SONG") // 183=SONG (hi 3)
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 134) PORT_NAME("FILTER") // 134=FILTER (lo 4)
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 135) PORT_NAME("SEQ") // 135=SEQ (hi 4)
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 142) PORT_NAME("ENV2") // 142=ENV2 (lo 5)
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 143) PORT_NAME("EVENT") // 143=EVENT (hi 5)
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 150) PORT_NAME("AMP") // 150=AMP (lo 6)
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 151) PORT_NAME("PARAM") // 151=PARAM (hi 6)
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 166) PORT_NAME("OUTPUT") // 166=OUTPUT (lo 7)
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 167) PORT_NAME("MIX") // 167=MIX (hi 7)
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 158) PORT_NAME("P. EFFECT") // 158=P.EFFECT (lo 8)
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 159) PORT_NAME("S. EFFECT") // 159=S.EFFECT (hi 8)
+ PORT_START("KEY1")
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 174) PORT_NAME("MIDI") // 174=MIDI (lo 9)
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 175) PORT_NAME("SYSTEM") // 175=SYSTEM (hi 9)
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 164) PORT_NAME("WAVE") // 164=WAVE (lo 0)
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 165) PORT_NAME("LOCATE") // 165=LOCATE (hi 0)
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 144) PORT_NAME("TRACK 1") // 144=Track 1
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 160) PORT_NAME("TRACK 2") // 160=Track 2
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 152) PORT_NAME("TRACK 3") // 152=Track 3
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 168) PORT_NAME("TRACK 4") // 168=Track 4
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 145) PORT_NAME("TRACK 5") // 145=Track 5
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 161) PORT_NAME("TRACK 6") // 161=Track 6
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 136) PORT_NAME("TRACK 7") // 136=Track 7
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 176) PORT_NAME("TRACK 8") // 176=Track 8
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 172) PORT_NAME("ENTER") // 172=ENTER
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 173) PORT_NAME("COMPARE") // 173=COMPARE
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 140) PORT_NAME("PROG DN") // 140=ProgDn
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 141) PORT_NAME("PROG UP") // 141=ProgUp
+ PORT_START("KEY2")
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 156) PORT_NAME("ROM/INT SELECT +") // 156=ROM/INT Select 189=track +
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 157) PORT_NAME("ROM/INT SELECT -") // 157=ROM/INT Select 190=track -
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 180) PORT_NAME("SOUND SELECT") // 180=SOUND Select
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 181) PORT_NAME("SOUND EDIT") // 181=SOUND Edit
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 184) PORT_NAME("SEQ EDIT") // 184=SEQ Edit
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 153) PORT_NAME("SEQ SELECT") // 153=SEQ Select
+ PORT_START("KEY3")
+#endif
+INPUT_PORTS_END
+
#define ROM_LOAD16_BYTE_BIOS(bios,name,offset,length,hash) \
ROMX_LOAD(name, offset, length, hash, ROM_SKIP(1) | ROM_BIOS(bios+1)) /* Note '+1' */
@@ -923,6 +977,7 @@ DRIVER_INIT_MEMBER(esq5505_state,sq1)
{
DRIVER_INIT_CALL(common);
m_system_type = SQ1;
+ shift = 60;
}
DRIVER_INIT_MEMBER(esq5505_state,denib)
@@ -950,6 +1005,6 @@ CONS( 1989, vfx, 0, 0, vfx, vfx, esq5505_state, denib, "Ensoniq", "VFX",
CONS( 1989, vfxsd, 0, 0, vfxsd, vfx, esq5505_state, denib, "Ensoniq", "VFX-SD", MACHINE_NOT_WORKING ) // 2x40 VFD
CONS( 1990, eps16p,eps, 0, eps, vfx, esq5505_state, eps, "Ensoniq", "EPS-16 Plus", MACHINE_NOT_WORKING ) // custom VFD: one alphanumeric 22-char row, one graphics-capable row (alpha row can also do bar graphs)
CONS( 1990, sd1, 0, 0, vfxsd, vfx, esq5505_state, denib, "Ensoniq", "SD-1 (21 voice)", MACHINE_NOT_WORKING ) // 2x40 VFD
-CONS( 1990, sq1, 0, 0, sq1, vfx, esq5505_state, sq1, "Ensoniq", "SQ-1", MACHINE_NOT_WORKING ) // 2x16 LCD
-CONS( 1990, sqrack,sq1, 0, sq1, vfx, esq5505_state, sq1, "Ensoniq", "SQ-Rack", MACHINE_NOT_WORKING ) // 2x16 LCD
+CONS( 1990, sq1, 0, 0, sq1, sq1, esq5505_state, sq1, "Ensoniq", "SQ-1", MACHINE_NOT_WORKING ) // 2x16 LCD
+CONS( 1990, sqrack,sq1, 0, sq1, sq1, esq5505_state, sq1, "Ensoniq", "SQ-Rack", MACHINE_NOT_WORKING ) // 2x16 LCD
CONS( 1991, sd132, sd1,0, vfx32, vfx, esq5505_state, denib, "Ensoniq", "SD-1 (32 voice)", MACHINE_NOT_WORKING ) // 2x40 VFD
diff --git a/src/mame/drivers/esqkt.cpp b/src/mame/drivers/esqkt.cpp
index b1a40fbb732..a541f74ad67 100644
--- a/src/mame/drivers/esqkt.cpp
+++ b/src/mame/drivers/esqkt.cpp
@@ -110,7 +110,7 @@ public:
required_device<m68ec020_device> m_maincpu;
required_device<es5510_device> m_esp;
required_device<mc68681_device> m_duart;
- required_device<esqpanel2x40_sq1_device> m_sq1panel;
+ required_device<esqpanel2x16_sq1_device> m_sq1panel;
required_device<midi_port_device> m_mdout;
virtual void machine_reset() override;
@@ -203,7 +203,7 @@ static MACHINE_CONFIG_START( kt, esqkt_state )
MCFG_CPU_ADD("esp", ES5510, XTAL_10MHz)
MCFG_DEVICE_DISABLE()
- MCFG_ESQPANEL2x40_SQ1_ADD("sq1panel")
+ MCFG_ESQPANEL2x16_SQ1_ADD("sq1panel")
MCFG_ESQPANEL_TX_CALLBACK(DEVWRITELINE("duart", mc68681_device, rx_b_w))
MCFG_MC68681_ADD("duart", 4000000)
diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp
index c331937fab4..43bdd8337c8 100644
--- a/src/mame/drivers/fidel6502.cpp
+++ b/src/mame/drivers/fidel6502.cpp
@@ -265,9 +265,6 @@ Z80 D6 to W: (model 6092, tied to VCC otherwise)
#include "cpu/m6502/r65c02.h"
#include "cpu/m6502/m65sc02.h"
#include "machine/6821pia.h"
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
-#include "softlist.h"
#include "includes/fidelz80.h"
@@ -309,10 +306,9 @@ public:
DECLARE_READ_LINE_MEMBER(csc_pia1_cb1_r);
// SC12/6086
- DECLARE_MACHINE_START(sc12);
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER(scc_cartridge);
DECLARE_WRITE8_MEMBER(sc12_control_w);
DECLARE_READ8_MEMBER(sc12_input_r);
+ DECLARE_READ8_MEMBER(sc12_cart_r);
// 6080/6092/6093 (Excellence)
DECLARE_INPUT_CHANGED_MEMBER(fexcelv_bankswitch);
@@ -459,35 +455,9 @@ WRITE_LINE_MEMBER(fidel6502_state::csc_pia1_ca2_w)
SC12/6086
******************************************************************************/
-// cartridge
-DEVICE_IMAGE_LOAD_MEMBER(fidel6502_state, scc_cartridge)
-{
- UINT32 size = m_cart->common_get_size("rom");
-
- // max size is 16KB
- if (size > 0x4000)
- {
- image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size");
- return IMAGE_INIT_FAIL;
- }
-
- m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
- return IMAGE_INIT_PASS;
-}
-
-MACHINE_START_MEMBER(fidel6502_state, sc12)
-{
- if (m_cart->exists())
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x2000, 0x5fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart));
-
- fidelz80base_state::machine_start();
-}
-
-
-// TTL
+// TTL/generic
WRITE8_MEMBER(fidel6502_state::sc12_control_w)
{
@@ -512,6 +482,14 @@ READ8_MEMBER(fidel6502_state::sc12_input_r)
return (read_inputs(9) >> offset & 1) ? 0 : 0x80;
}
+READ8_MEMBER(fidel6502_state::sc12_cart_r)
+{
+ if (m_cart->exists())
+ return m_cart->read_rom(space, offset);
+ else
+ return 0;
+}
+
/******************************************************************************
@@ -617,6 +595,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sc12_map, AS_PROGRAM, 8, fidel6502_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x0fff) AM_RAM
+ AM_RANGE(0x2000, 0x5fff) AM_READ(sc12_cart_r)
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x1fff) AM_WRITE(sc12_control_w)
AM_RANGE(0x8000, 0x9fff) AM_ROM
AM_RANGE(0xa000, 0xa007) AM_MIRROR(0x1ff8) AM_READ(sc12_input_r)
@@ -721,28 +700,28 @@ static INPUT_PORTS_START( sc12 )
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square h8")
PORT_START("IN.8")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RV / Pawn") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM / Knight") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TB / Bishop") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LV / Rook") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PV / Queen") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB / King") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("RV/Pawn")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("DM/Knight")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("TB/Bishop")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("LV/Rook")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("PV/Queen")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("PB/King")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_NAME("CL")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("RE")
INPUT_PORTS_END
static INPUT_PORTS_START( fexcel )
PORT_INCLUDE( sc12 )
PORT_MODIFY("IN.8")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Clear") PORT_CODE(KEYCODE_DEL)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Move / Pawn") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Hint / Knight") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Take Back / Bishop") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Level / Rook") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Options / Queen") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Verify / King") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("New Game") PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_N)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Move/Pawn")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Hint/Knight")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Take Back/Bishop")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Level/Rook")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Options/Queen")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Verify/King")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_N) PORT_NAME("New Game")
INPUT_PORTS_END
static INPUT_PORTS_START( fexcelv )
@@ -763,30 +742,30 @@ static INPUT_PORTS_START( csc )
PORT_INCLUDE( sc12 )
PORT_MODIFY("IN.0")
- PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Speak") PORT_CODE(KEYCODE_SPACE)
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Speaker")
PORT_MODIFY("IN.1")
- PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RV") PORT_CODE(KEYCODE_V)
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("RV")
PORT_MODIFY("IN.2")
- PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TM") PORT_CODE(KEYCODE_T)
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("TM")
PORT_MODIFY("IN.3")
- PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LV") PORT_CODE(KEYCODE_L)
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LV")
PORT_MODIFY("IN.4")
- PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_M)
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("DM")
PORT_MODIFY("IN.5")
- PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ST") PORT_CODE(KEYCODE_S)
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("ST")
PORT_MODIFY("IN.8")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Pawn") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Rook") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Knight") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Bishop") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Queen") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("King") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Pawn")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Rook")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Knight")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Queen")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("King")
PORT_START("IN.9") // hardwired
PORT_CONFNAME( 0x01, 0x00, "Language" )
@@ -859,8 +838,6 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_sc12)
- MCFG_MACHINE_START_OVERRIDE(fidel6502_state, sc12)
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
@@ -869,7 +846,7 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state )
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
MCFG_GENERIC_EXTENSIONS("bin,dat")
- MCFG_GENERIC_LOAD(fidel6502_state, scc_cartridge)
+ MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/fidel68k.cpp b/src/mame/drivers/fidel68k.cpp
index bb2231e78af..56cd651bb90 100644
--- a/src/mame/drivers/fidel68k.cpp
+++ b/src/mame/drivers/fidel68k.cpp
@@ -3,34 +3,143 @@
/******************************************************************************
Fidelity Electronics 68000 based board driver
+
+ TODO:
+ - how does dual-CPU work?
+ - IRQ level/timing is unknown
+ - USART is not emulated
+ - V11 CPU should be M68EC060, not yet emulated
******************************************************************************
-Elite Avant Garde (EAG)
------------------------
+Elite Avant Garde (EAG, model 6114)
+-----------------------------------
+There are 5 versions of model 6114(V1 to V5). The one emulated here came from a V2,
+but is practically emulated as a V4.
+
+V1: 128KB DRAM, no EEPROM
+V2: 128KB DRAM
+V3: 512KB DRAM
+V4: 1MB DRAM
+V5: 128KB+64KB DRAM, dual-CPU! (2*68K @ 16MHz)
+
+V6-V11 are on model 6117. Older 1986 model 6081 uses a 6502 CPU.
+
+Hardware info:
+--------------
- MC68HC000P12F 16MHz CPU, 16MHz XTAL
-- MB1422A DRAM Controller, 25MHz XTAL near, 4 DRAM slots(this model: slot 1 and 2 64KB)
-- 2*27C512 EPROM, 2*KM6264AL-10 SRAM, 2*AT28C64X EEPROM(parallel)
-- OKI M82C51A-2 USART, 4.9152MHz XTAL, assume it's used for factory test/debug
-- other special: Chessboard squares are magnet sensors
+- MB1422A DRAM Controller, 25MHz XTAL near, 4 DRAM slots(V2: slot 1 and 2 64KB)
+- 2*27C512 64KB EPROM, 2*KM6264AL-10 8KB SRAM, 2*AT28C64X 8KB EEPROM
+- OKI M82C51A-2 USART, 4.9152MHz XTAL
+- other special: magnet sensors, external module slot, serial port
+
+IRQ source is unknown. Several possibilities:
+- NE555 timer IC
+- MM/SN74HC4060 binary counter IC (near the M82C51A)
+- one of the XTALs, plus divider of course
+The module slot pinout is different from SCC series. The data on those appears
+to be compatible with EAG though and will load fine with an adapter.
-Memory map:
+The USART allows for a serial connection between the chess computer and another
+device, for example a PC. Fidelity released a DOS tool called EAGLINK which
+featured PC printer support, complete I/O control, detailed information while
+the program is 'thinking', etc.
+
+Memory map: (of what is known)
-----------
000000-01FFFF: 128KB ROM
104000-107FFF: 16KB SRAM
+200000-2FFFFF: hashtable DRAM (max. 1MB)
+300000-30000F W hi d0: NE591: 7seg data
+300000-30000F W lo d0: NE591: LED data
+300000-30000F R lo d7: 74259: keypad rows 0-7
+400000-400001 W lo d0-d3: 74145/7442: led/keypad mux, buzzer out
+400000-4????? R hi: external module slot
+700002-700003 R lo d7: 74251: keypad row 8
+604000-607FFF: 16KB EEPROM
+
+
+******************************************************************************
+
+Elite Avant Garde (EAG, model 6117)
+-----------------------------------
+
+There are 6 versions of model 6114(V6 to V11). From a programmer's point of view,
+the hardware is very similar to model 6114.
+
+V6: 68020, 512KB hashtable RAM
+V7: 68020, 1MB h.RAM
+V8: 2*68020, 512KB+128KB h.RAM
+V9: 68030, 1MB h.RAM
+V10: 68040, 1MB h.RAM
+V11: 68060, 2MB h.RAM, high speed
+
+V7 Hardware info:
+-----------------
+- MC68020RC25E CPU, 25MHz XTAL
+- 4*AS7C164-20PC 8KB SRAM, 2*KM684000ALG-7L 512KB CMOS SRAM
+- 2*27C512? 64KB EPROM, 2*HM6264LP-15 8KB SRAM, 2*AT28C64B 8KB EEPROM, 2*GAL16V8C
+- same as 6114: M82C51A, NE555, SN74HC4060, module slot, chessboard, ..
+
+V7 Memory map:
+--------------
+000000-01FFFF: 128KB ROM
+104000-107FFF: 16KB SRAM (unused?)
+200000-2FFFFF: hashtable SRAM
+300000-30000x: see model 6114
+400000-40000x: see model 6114
+700000-70000x: see model 6114
604000-607FFF: 16KB EEPROM
+800000-807FFF: 32KB SRAM
+
+V10 Hardware info:
+------------------
+- 68040 CPU, 25MHz
+- other: assume same or very similar to V11(see below)
+
+The ROM dump came from the V11(see below). Built-in factory test proves
+that this program is a V10. Hold TB button immediately after power-on and
+press it for a sequence of tests:
+1) all LEDs on
+2) F40C: V10 program version
+3) 38b9: V10 ROM checksum
+4) xxxx: external module ROM checksum (0000 if no module present)
+5) xxxx: user settings (stored in EEPROM)
+6) xxxx: "
+7) 1024: hashtable RAM size
+8) return to game
+
+V11 Hardware info:
+------------------
+- MC68EC060RC75 CPU, 36MHz XTAL(36MHz bus, 72MHz CPU), CPU cooler required
+- 4*CXK5863AP-20 8KB SRAM, 4*K6X4008C1F-DF55 512KB CMOS SRAM
+- 4*M27C256B 32KB EPROM, 2*AT28C64 8KB EEPROM, 5*GAL16V8D
+- NEC D71051C USART, assume 8MHz, on quick glance it's same as the OKI USART
+- same as 6114: NE555, SN74HC4060, module slot, chessboard, ..
+
+This is a custom overclocked V10, manufactured by Wilfried Bucke. PCB is marked:
+"CHESS HW DESIGN COPYRIGHT 22-10-2002: REVA03 510.1136A01/510.1144B01 COMPONENT SIDE"
+There are two versions of this, one with a 66MHz CPU, one with a 72MHz CPU.
+Maybe other differences too?
+
+V1x Memory map:
+---------------
+000000-01FFFF: 128KB ROM
+200000-3FFFFF: hashtable SRAM (less on V10?)
+B0000x-xxxxxx: see V7, -800000
******************************************************************************/
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "machine/nvram.h"
#include "includes/fidelz80.h"
// internal artwork
-#include "fidel_eag.lh"
+#include "fidel_eag.lh" // clickable
class fidel68k_state : public fidelz80base_state
@@ -40,8 +149,16 @@ public:
: fidelz80base_state(mconfig, type, tag)
{ }
- // EAG
- //..
+ // devices/pointers
+
+ // EAG(6114/6117)
+ void eag_prepare_display();
+ DECLARE_READ8_MEMBER(eag_input1_r);
+ DECLARE_WRITE8_MEMBER(eag_leds_w);
+ DECLARE_WRITE8_MEMBER(eag_7seg_w);
+ DECLARE_WRITE8_MEMBER(eag_mux_w);
+ DECLARE_READ8_MEMBER(eag_input2_r);
+ DECLARE_READ8_MEMBER(eag_cart_r);
};
@@ -52,6 +169,64 @@ public:
EAG
******************************************************************************/
+// misc handlers
+
+void fidel68k_state::eag_prepare_display()
+{
+ // 8*7seg leds, (8+1)*8 chessboard leds
+ UINT8 seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4);
+ set_display_segmask(0x1ef, 0x7f);
+ display_matrix(16, 9, m_led_data << 8 | seg_data, m_inp_mux);
+}
+
+
+// TTL/generic
+
+READ8_MEMBER(fidel68k_state::eag_input1_r)
+{
+ // a1-a3,d7: multiplexed inputs (active low)
+ return (read_inputs(9) >> offset & 1) ? 0 : 0x80;
+}
+
+READ8_MEMBER(fidel68k_state::eag_input2_r)
+{
+ // d7: multiplexed inputs highest bit
+ return (read_inputs(9) & 0x100) ? 0x80 : 0;
+}
+
+WRITE8_MEMBER(fidel68k_state::eag_leds_w)
+{
+ // a1-a3,d0: led data
+ m_led_data = (m_led_data & ~(1 << offset)) | ((data & 1) << offset);
+ eag_prepare_display();
+}
+
+WRITE8_MEMBER(fidel68k_state::eag_7seg_w)
+{
+ // a1-a3,d0(d8): digit segment data
+ m_7seg_data = (m_7seg_data & ~(1 << offset)) | ((data & 1) << offset);
+ eag_prepare_display();
+}
+
+WRITE8_MEMBER(fidel68k_state::eag_mux_w)
+{
+ // d0-d3: 74145 A-D
+ // 74145 0-8: input mux, digit/led select
+ // 74145 9: speaker out
+ UINT16 sel = 1 << (data & 0xf);
+ m_speaker->level_w(sel >> 9 & 1);
+ m_inp_mux = sel & 0x1ff;
+ eag_prepare_display();
+}
+
+READ8_MEMBER(fidel68k_state::eag_cart_r)
+{
+ if (m_cart->exists())
+ return m_cart->read_rom(space, offset);
+ else
+ return 0;
+}
+
/******************************************************************************
@@ -61,11 +236,43 @@ public:
// EAG
static ADDRESS_MAP_START( eag_map, AS_PROGRAM, 16, fidel68k_state )
- ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x01ffff) AM_ROM
AM_RANGE(0x104000, 0x107fff) AM_RAM
- AM_RANGE(0x200000, 0x20ffff) AM_RAM
- AM_RANGE(0x604000, 0x607fff) AM_RAM
+ AM_RANGE(0x200000, 0x2fffff) AM_RAM // DRAM slots
+ AM_RANGE(0x300000, 0x30000f) AM_MIRROR(0x000010) AM_READWRITE8(eag_input1_r, eag_leds_w, 0x00ff)
+ AM_RANGE(0x300000, 0x30000f) AM_MIRROR(0x000010) AM_WRITE8(eag_7seg_w, 0xff00) AM_READNOP
+ AM_RANGE(0x400000, 0x407fff) AM_READ8(eag_cart_r, 0xff00)
+ AM_RANGE(0x400000, 0x400001) AM_WRITE8(eag_mux_w, 0x00ff)
+ AM_RANGE(0x400002, 0x400007) AM_WRITENOP // ?
+ AM_RANGE(0x604000, 0x607fff) AM_RAM AM_SHARE("nvram")
+ AM_RANGE(0x700002, 0x700003) AM_READ8(eag_input2_r, 0x00ff)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( eagv7_map, AS_PROGRAM, 32, fidel68k_state )
+ AM_RANGE(0x000000, 0x01ffff) AM_ROM
+ AM_RANGE(0x104000, 0x107fff) AM_RAM
+ AM_RANGE(0x200000, 0x2fffff) AM_RAM
+ AM_RANGE(0x300000, 0x30000f) AM_MIRROR(0x000010) AM_READWRITE8(eag_input1_r, eag_leds_w, 0x00ff00ff)
+ AM_RANGE(0x300000, 0x30000f) AM_MIRROR(0x000010) AM_WRITE8(eag_7seg_w, 0xff00ff00) AM_READNOP
+ AM_RANGE(0x400000, 0x407fff) AM_READ8(eag_cart_r, 0xff00ff00)
+ AM_RANGE(0x400000, 0x400003) AM_WRITE8(eag_mux_w, 0x00ff0000)
+ AM_RANGE(0x400004, 0x400007) AM_WRITENOP // ?
+ AM_RANGE(0x604000, 0x607fff) AM_RAM AM_SHARE("nvram")
+ AM_RANGE(0x700000, 0x700003) AM_READ8(eag_input2_r, 0x000000ff)
+ AM_RANGE(0x800000, 0x807fff) AM_RAM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( eagv11_map, AS_PROGRAM, 32, fidel68k_state )
+ AM_RANGE(0x00000000, 0x0001ffff) AM_ROM
+ AM_RANGE(0x00200000, 0x003fffff) AM_RAM
+ AM_RANGE(0x00b00000, 0x00b0000f) AM_MIRROR(0x00000010) AM_READWRITE8(eag_input1_r, eag_leds_w, 0x00ff00ff)
+ AM_RANGE(0x00b00000, 0x00b0000f) AM_MIRROR(0x00000010) AM_WRITE8(eag_7seg_w, 0xff00ff00) AM_READNOP
+ AM_RANGE(0x00c00000, 0x00c07fff) AM_READ8(eag_cart_r, 0xff00ff00)
+ AM_RANGE(0x00c00000, 0x00c00003) AM_WRITE8(eag_mux_w, 0x00ff0000)
+ AM_RANGE(0x00c00004, 0x00c00007) AM_WRITENOP // ?
+ AM_RANGE(0x00e04000, 0x00e07fff) AM_RAM AM_SHARE("nvram")
+ AM_RANGE(0x00f00000, 0x00f00003) AM_READ8(eag_input2_r, 0x000000ff)
+ AM_RANGE(0x01000000, 0x0101ffff) AM_RAM
ADDRESS_MAP_END
@@ -75,7 +282,98 @@ ADDRESS_MAP_END
******************************************************************************/
static INPUT_PORTS_START( eag )
-
+ PORT_START("IN.0")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h1")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g1")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f1")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e1")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d1")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c1")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b1")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a1")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_NAME("CL")
+
+ PORT_START("IN.1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h2")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g2")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f2")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e2")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d2")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c2")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b2")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a2")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("DM")
+
+ PORT_START("IN.2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h3")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g3")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f3")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e3")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d3")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c3")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b3")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a3")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_N) PORT_NAME("New Game")
+
+ PORT_START("IN.3")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h4")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g4")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f4")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e4")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d4")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c4")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b4")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a4")
+
+ PORT_START("IN.4")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h5")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g5")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f5")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e5")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d5")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c5")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b5")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a5")
+
+ PORT_START("IN.5")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h6")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g6")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f6")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e6")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d6")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c6")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b6")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a6")
+
+ PORT_START("IN.6")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h7")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g7")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f7")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e7")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d7")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c7")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b7")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a7")
+
+ PORT_START("IN.7")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square h8")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square g8")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square f8")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square e8")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square d8")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square c8")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square b8")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Square a8")
+
+ PORT_START("IN.8")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("PB/King")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("PV/Queen")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("TM/Rook")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("ST/Bishop")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("TB/Knight")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("LV/Pawn")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Option")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("RV")
INPUT_PORTS_END
@@ -89,6 +387,9 @@ static MACHINE_CONFIG_START( eag, fidel68k_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
MCFG_CPU_PROGRAM_MAP(eag_map)
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel68k_state, irq2_line_hold, 600) // complete guess
+
+ MCFG_NVRAM_ADD_1FILL("nvram")
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_eag)
@@ -97,6 +398,36 @@ static MACHINE_CONFIG_START( eag, fidel68k_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+
+ /* cartridge */
+ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
+ MCFG_GENERIC_EXTENSIONS("bin,dat")
+ MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge)
+ MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( eagv7, eag )
+
+ /* basic machine hardware */
+ MCFG_CPU_REPLACE("maincpu", M68020, XTAL_25MHz)
+ MCFG_CPU_PROGRAM_MAP(eagv7_map)
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel68k_state, irq2_line_hold, 600) // complete guess
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( eagv10, eag )
+
+ /* basic machine hardware */
+ MCFG_CPU_REPLACE("maincpu", M68040, XTAL_25MHz)
+ MCFG_CPU_PROGRAM_MAP(eagv11_map)
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel68k_state, irq2_line_hold, 600) // complete guess
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( eagv11, eag )
+
+ /* basic machine hardware */
+ MCFG_CPU_REPLACE("maincpu", M68EC040, XTAL_36MHz*2) // wrong! should be M68EC060
+ MCFG_CPU_PROGRAM_MAP(eagv11_map)
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel68k_state, irq2_line_hold, 600) // complete guess
MACHINE_CONFIG_END
@@ -108,13 +439,35 @@ MACHINE_CONFIG_END
ROM_START( feagv2 )
ROM_REGION16_BE( 0x20000, "maincpu", 0 )
ROM_LOAD16_BYTE("6114_e5.u18", 0x00000, 0x10000, CRC(f9c7bada) SHA1(60e545f829121b9a4f1100d9e85ac83797715e80) ) // 27c512
- ROM_LOAD16_BYTE("6114_o5.u19", 0x00001, 0x10000, CRC(04f97b22) SHA1(8b2845dd115498f7b385e8948eca6a5893c223d1) ) // 27c512
+ ROM_LOAD16_BYTE("6114_o5.u19", 0x00001, 0x10000, CRC(04f97b22) SHA1(8b2845dd115498f7b385e8948eca6a5893c223d1) ) // "
ROM_END
+ROM_START( feagv7 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD16_BYTE("eag-v7b", 0x00000, 0x10000, CRC(f2f68b63) SHA1(621e5073e9c5083ac9a9b467f3ef8aa29beac5ac) )
+ ROM_LOAD16_BYTE("eag-v7a", 0x00001, 0x10000, CRC(506b688f) SHA1(0a091c35d0f01166b57f964b111cde51c5720d58) )
+ROM_END
+
+
+ROM_START( feagv11 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD32_BYTE("16", 0x00000, 0x08000, CRC(8375d61f) SHA1(e042f6f01480c59ee09a458cf34f135664479824) ) // 27c256
+ ROM_LOAD32_BYTE("18", 0x00002, 0x08000, CRC(9341dcaf) SHA1(686bd4799e89ffaf11a813d4cf5a2aedd4c2d97a) ) // "
+ ROM_LOAD32_BYTE("19", 0x00003, 0x08000, CRC(a70c5468) SHA1(7f6b4f46577d5cfdaa84d387c7ce35d941e5bbc7) ) // "
+ ROM_LOAD32_BYTE("17", 0x00001, 0x08000, CRC(bfd14916) SHA1(115af6dfd29ddd8ad6d2ce390f8ecc4d60de6fce) ) // "
+ROM_END
+
+#define rom_feagv10 rom_feagv11
+
+
+
/******************************************************************************
Drivers
******************************************************************************/
-/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
-COMP( 1989, feagv2, 0, 0, eag, eag, driver_device, 0, "Fidelity Electronics", "Elite Avant Garde V2", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
+COMP( 1989, feagv2, 0, 0, eag, eag, driver_device, 0, "Fidelity Electronics", "Elite Avant Garde (model 6114-2/3/4)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+COMP( 1990, feagv7, 0, 0, eagv7, eag, driver_device, 0, "Fidelity Electronics", "Elite Avant Garde (model 6117-7)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+COMP( 1990, feagv10, 0, 0, eagv10, eag, driver_device, 0, "Fidelity Electronics", "Elite Avant Garde (model 6117-10)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+COMP( 2002, feagv11, feagv10, 0, eagv11, eag, driver_device, 0, "hack (Wilfried Bucke)", "Elite Avant Garde (model 6117-11)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index 0b89945fd0a..fd14411bfef 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -691,7 +691,7 @@ void fidelz80base_state::set_display_segmask(UINT32 digits, UINT32 mask)
}
}
-void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
+void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -700,7 +700,8 @@ void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
@@ -728,6 +729,26 @@ INPUT_CHANGED_MEMBER(fidelz80_state::reset_button)
}
+// cartridge
+
+DEVICE_IMAGE_LOAD_MEMBER(fidelz80base_state, scc_cartridge)
+{
+ UINT32 size = m_cart->common_get_size("rom");
+
+ // max size is 16KB?
+ if (size > 0x4000)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size");
+ return IMAGE_INIT_FAIL;
+ }
+
+ m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
+ return IMAGE_INIT_PASS;
+}
+
+
// Devices, I/O
@@ -1112,7 +1133,7 @@ static INPUT_PORTS_START( vcc_base )
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("E5") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CODE(KEYCODE_E)
PORT_START("IN.1")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Speak") PORT_CODE(KEYCODE_SPACE)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Speaker") PORT_CODE(KEYCODE_SPACE)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_M)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("B2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_B)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("F6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_F)
@@ -1300,22 +1321,22 @@ static INPUT_PORTS_START( vsc )
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square h8")
PORT_START("IN.8") // buttons on the right
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Pawn") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Rook") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Knight") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Bishop") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Queen") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("King") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Pawn")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Rook")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Knight")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Queen")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("King")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_NAME("CL")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("RE")
PORT_START("IN.9") // buttons beside the display
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TM") PORT_CODE(KEYCODE_T)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RV") PORT_CODE(KEYCODE_V)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Speak") PORT_CODE(KEYCODE_SPACE)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LV") PORT_CODE(KEYCODE_L)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_M)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ST") PORT_CODE(KEYCODE_S)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("TM")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("RV")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Speaker")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LV")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("DM")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("ST")
PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("IN.10") // hardwired (2 diodes)
@@ -1339,55 +1360,55 @@ INPUT_PORTS_END
static INPUT_PORTS_START( vbrc )
PORT_START("IN.0")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("10") PORT_CODE(KEYCODE_0)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("A")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("10")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("6")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("2")
PORT_START("IN.1")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("5") PORT_CODE(KEYCODE_5)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("K")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("9")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("5")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("1")
PORT_START("IN.2")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_Z)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Q")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("8")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("4")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("P")
PORT_START("IN.3")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("3") PORT_CODE(KEYCODE_3)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("NT") PORT_CODE(KEYCODE_N)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("J")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("7")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("3")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("NT")
PORT_START("IN.4")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("EN") PORT_CODE(KEYCODE_E)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("SC") PORT_CODE(KEYCODE_S)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PL") PORT_CODE(KEYCODE_X)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Spades") PORT_CODE(KEYCODE_1_PAD)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("EN")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("SC")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("PL")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Spades")
PORT_START("IN.5")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_C)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DB") PORT_CODE(KEYCODE_D)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("VL") PORT_CODE(KEYCODE_V)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Hearts") PORT_CODE(KEYCODE_2_PAD)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("CL")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("DB")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("VL")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Hearts")
PORT_START("IN.6")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Beep on/off") PORT_CODE(KEYCODE_SPACE)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_B)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CV") PORT_CODE(KEYCODE_G)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Diamonds") PORT_CODE(KEYCODE_3_PAD)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Speaker")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("PB")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("CV")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Diamonds")
PORT_START("IN.7")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BR") PORT_CODE(KEYCODE_T)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DL") PORT_CODE(KEYCODE_L)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Clubs") PORT_CODE(KEYCODE_4_PAD)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("BR")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("DL")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Clubs")
PORT_START("RESET") // is not on matrix IN.7 d0
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, fidelz80_state, reset_button, 0)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, fidelz80_state, reset_button, 0) PORT_NAME("RE")
INPUT_PORTS_END
diff --git a/src/mame/drivers/galaxy.cpp b/src/mame/drivers/galaxy.cpp
index 886e9716df5..7104b6f3bf9 100644
--- a/src/mame/drivers/galaxy.cpp
+++ b/src/mame/drivers/galaxy.cpp
@@ -255,7 +255,7 @@ MACHINE_CONFIG_END
ROM_START (galaxy)
ROM_REGION (0x10000, "maincpu", ROMREGION_ERASEFF)
- ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC(365f3e24) SHA1(ffc6bf2ec09eabdad76604a63f5dd697c30c4358))
+ ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC(dc970a32) SHA1(dfc92163654a756b70f5a446daf49d7534f4c739))
ROM_LOAD_OPTIONAL ("galrom2.bin", 0x1000, 0x1000, CRC(5dc5a100) SHA1(5d5ab4313a2d0effe7572bb129193b64cab002c1))
ROM_REGION(0x0800, "gfx1",0)
ROM_LOAD ("galchr.bin", 0x0000, 0x0800, CRC(5c3b5bb5) SHA1(19429a61dc5e55ddec3242a8f695e06dd7961f88))
@@ -263,7 +263,7 @@ ROM_END
ROM_START (galaxyp)
ROM_REGION (0x10000, "maincpu", ROMREGION_ERASEFF)
- ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC(365f3e24) SHA1(ffc6bf2ec09eabdad76604a63f5dd697c30c4358))
+ ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC(dc970a32) SHA1(dfc92163654a756b70f5a446daf49d7534f4c739))
ROM_LOAD ("galrom2.bin", 0x1000, 0x1000, CRC(5dc5a100) SHA1(5d5ab4313a2d0effe7572bb129193b64cab002c1))
ROM_LOAD ("galplus.bin", 0xe000, 0x1000, CRC(d4cfab14) SHA1(b507b9026844eeb757547679907394aa42055eee))
ROM_REGION(0x0800, "gfx1",0)
@@ -271,5 +271,5 @@ ROM_START (galaxyp)
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
-COMP(1983, galaxy, 0, 0, galaxy, galaxy, galaxy_state, galaxy, "Elektronika inzenjering", "Galaksija", 0)
-COMP(1985, galaxyp, galaxy, 0, galaxyp,galaxyp, galaxy_state,galaxyp,"Elektronika inzenjering", "Galaksija plus", 0)
+COMP(1983, galaxy, 0, 0, galaxy, galaxy, galaxy_state, galaxy, "Voja Antonic / Elektronika inzenjering", "Galaksija", 0)
+COMP(1985, galaxyp, galaxy, 0, galaxyp,galaxyp, galaxy_state,galaxyp,"Nenad Dunjic", "Galaksija plus", 0)
diff --git a/src/mame/drivers/glass.cpp b/src/mame/drivers/glass.cpp
index 54304712b71..5711341018f 100644
--- a/src/mame/drivers/glass.cpp
+++ b/src/mame/drivers/glass.cpp
@@ -6,7 +6,8 @@ Glass (c) 1993 Gaelco (Developed by OMK. Produced by Gaelco)
Driver by Manuel Abadia <emumanu+mame@gmail.com>
-The DS5002FP has up to 128KB undumped gameplay code making the game unplayable :_(
+The DS5002FP has up to 128KB undumped gameplay code making the game unplayable,
+except for the Promat licensed Korean version which is unprotected.
***************************************************************************/
@@ -20,7 +21,7 @@ WRITE16_MEMBER(glass_state::clr_int_w)
m_cause_interrupt = 1;
}
-INTERRUPT_GEN_MEMBER(glass_state::glass_interrupt)
+INTERRUPT_GEN_MEMBER(glass_state::interrupt)
{
if (m_cause_interrupt)
{
@@ -54,13 +55,11 @@ GFXDECODE_END
WRITE16_MEMBER(glass_state::OKIM6295_bankswitch_w)
{
- UINT8 *RAM = memregion("oki")->base();
-
if (ACCESSING_BITS_0_7)
- memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f) * 0x10000], 0x10000);
+ membank("okibank")->set_entry(data & 0x0f);
}
-WRITE16_MEMBER(glass_state::glass_coin_w)
+WRITE16_MEMBER(glass_state::coin_w)
{
switch (offset >> 3)
{
@@ -79,7 +78,7 @@ WRITE16_MEMBER(glass_state::glass_coin_w)
static ADDRESS_MAP_START( glass_map, AS_PROGRAM, 16, glass_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
- AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(glass_vram_w) AM_SHARE("videoram") /* Video RAM */
+ AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(vram_w) AM_SHARE("videoram") /* Video RAM */
AM_RANGE(0x102000, 0x102fff) AM_RAM /* Extra Video RAM */
AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */
AM_RANGE(0x108008, 0x108009) AM_WRITE(clr_int_w) /* CLR INT Video */
@@ -89,14 +88,20 @@ static ADDRESS_MAP_START( glass_map, AS_PROGRAM, 16, glass_state )
AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1")
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("P1")
AM_RANGE(0x700006, 0x700007) AM_READ_PORT("P2")
- AM_RANGE(0x700008, 0x700009) AM_WRITE(glass_blitter_w) /* serial blitter */
+ AM_RANGE(0x700008, 0x700009) AM_WRITE(blitter_w) /* serial blitter */
AM_RANGE(0x70000c, 0x70000d) AM_WRITE(OKIM6295_bankswitch_w) /* OKI6295 bankswitch */
AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) /* OKI6295 status register */
- AM_RANGE(0x70000a, 0x70004b) AM_WRITE(glass_coin_w) /* Coin Counters/Lockout */
+ AM_RANGE(0x70000a, 0x70004b) AM_WRITE(coin_w) /* Coin Counters/Lockout */
AM_RANGE(0xfec000, 0xfeffff) AM_RAM AM_SHARE("mainram") /* Work RAM (partially shared with DS5002FP) */
ADDRESS_MAP_END
+static ADDRESS_MAP_START( oki_map, AS_0, 8, glass_state )
+ AM_RANGE(0x00000, 0x2ffff) AM_ROM
+ AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank")
+ADDRESS_MAP_END
+
+
static INPUT_PORTS_START( glass )
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:6,7,8")
@@ -172,6 +177,8 @@ INPUT_PORTS_END
void glass_state::machine_start()
{
+ membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000);
+
save_item(NAME(m_cause_interrupt));
save_item(NAME(m_current_bit));
save_item(NAME(m_current_command));
@@ -180,13 +187,11 @@ void glass_state::machine_start()
void glass_state::machine_reset()
{
- int i;
-
m_cause_interrupt = 1;
m_current_bit = 0;
m_current_command = 0;
- for (i = 0; i < 5; i++)
+ for (int i = 0; i < 5; i++)
m_blitter_serial_buffer[i] = 0;
}
@@ -195,7 +200,7 @@ static MACHINE_CONFIG_START( glass, glass_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* 12 MHz verified on PCB */
MCFG_CPU_PROGRAM_MAP(glass_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", glass_state, glass_interrupt)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", glass_state, interrupt)
/* video hardware */
@@ -204,7 +209,7 @@ static MACHINE_CONFIG_START( glass, glass_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(32*16, 32*16)
MCFG_SCREEN_VISIBLE_AREA(0, 368-1, 16, 256-1)
- MCFG_SCREEN_UPDATE_DRIVER(glass_state, screen_update_glass)
+ MCFG_SCREEN_UPDATE_DRIVER(glass_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", glass)
@@ -215,6 +220,7 @@ static MACHINE_CONFIG_START( glass, glass_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) /* 1MHz Resonator & pin 7 high verified on PCB */
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -236,10 +242,9 @@ ROM_START( glass ) /* Version 1.1 */
ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */
ROM_LOAD( "h9.bin", 0x000000, 0x100000, CRC(b9492557) SHA1(3f5c0d696d65e1cd492763dfa749c813dd56a9bf) )
- ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
+ ROM_REGION( 0x100000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) )
/* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */
- ROM_RELOAD( 0x040000, 0x100000 )
ROM_END
ROM_START( glass10 ) /* Version 1.0 */
@@ -260,10 +265,9 @@ ROM_START( glass10 ) /* Version 1.0 */
ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */
ROM_LOAD( "h9.bin", 0x000000, 0x100000, CRC(b9492557) SHA1(3f5c0d696d65e1cd492763dfa749c813dd56a9bf) )
- ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
+ ROM_REGION( 0x100000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) )
/* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */
- ROM_RELOAD( 0x040000, 0x100000 )
ROM_END
ROM_START( glass10a ) /* Title screen shows "GLASS" and under that "Break Edition" on a real PCB */
@@ -284,10 +288,9 @@ ROM_START( glass10a ) /* Title screen shows "GLASS" and under that "Break Editio
ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */
ROM_LOAD( "h9.bin", 0x000000, 0x100000, CRC(b9492557) SHA1(3f5c0d696d65e1cd492763dfa749c813dd56a9bf) )
- ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
+ ROM_REGION( 0x100000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) )
/* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */
- ROM_RELOAD( 0x040000, 0x100000 )
ROM_END
ROM_START( glasskr )
@@ -305,10 +308,9 @@ ROM_START( glasskr )
ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */
ROM_LOAD( "glassk.h9", 0x000000, 0x100000, CRC(d499be4c) SHA1(204f754813be687e8dc00bfe7b5dbc4857ac8738) )
- ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
+ ROM_REGION( 0x100000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */
ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) )
/* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */
- ROM_RELOAD( 0x040000, 0x100000 )
ROM_END
/***************************************************************************
@@ -317,7 +319,7 @@ ROM_END
***************************************************************************/
-void glass_state::glass_ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
+void glass_state::ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
{
int i;
@@ -342,14 +344,14 @@ void glass_state::glass_ROM16_split_gfx( const char *src_reg, const char *dst_re
*/
-READ16_MEMBER( glass_state::glass_mainram_r )
+READ16_MEMBER( glass_state::mainram_r )
{
UINT16 ret = m_mainram[offset];
int pc = space.device().safe_pc();
if (offset == (0xfede96 - 0xfec000)>>1)
{
- // this address seems important, the game will abort with 'power failure' depending on some reads, presumably refering to the power to the battery
+ // this address seems important, the game will abort with 'power failure' depending on some reads, presumably referring to the power to the battery
// there are also various code segments like the one below
/*
@@ -376,7 +378,7 @@ READ16_MEMBER( glass_state::glass_mainram_r )
return ret;
}
-WRITE16_MEMBER( glass_state::glass_mainram_w )
+WRITE16_MEMBER( glass_state::mainram_w )
{
int pc = space.device().safe_pc();
@@ -436,10 +438,10 @@ DRIVER_INIT_MEMBER(glass_state, glass)
*/
/* split ROM H13 */
- glass_ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0200000, 0x0000000, 0x0100000);
+ ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0200000, 0x0000000, 0x0100000);
/* split ROM H11 */
- glass_ROM16_split_gfx("gfx2", "gfx1", 0x0200000, 0x0200000, 0x0200000, 0x0300000);
+ ROM16_split_gfx("gfx2", "gfx1", 0x0200000, 0x0200000, 0x0200000, 0x0300000);
}
@@ -449,7 +451,7 @@ DRIVER_INIT_MEMBER(glass_state,glassp)
DRIVER_INIT_CALL(glass);
/* install custom handler over RAM for protection */
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfec000, 0xfeffff, read16_delegate(FUNC(glass_state::glass_mainram_r), this), write16_delegate(FUNC(glass_state::glass_mainram_w),this));
+ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfec000, 0xfeffff, read16_delegate(FUNC(glass_state::mainram_r), this), write16_delegate(FUNC(glass_state::mainram_w),this));
}
diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp
index a5b49c515b0..570b990c5fd 100644
--- a/src/mame/drivers/goldstar.cpp
+++ b/src/mame/drivers/goldstar.cpp
@@ -6752,6 +6752,31 @@ static const gfx_layout sangho_tilelayout =
128*8 /* every char takes 128 consecutive bytes */
};
+static const gfx_layout super9_charlayout =
+{
+ 8,8, /* 8*8 characters */
+ 4096, /* 4096 characters */
+ 3, /* 3 bits per pixel */
+ { 2, 4, 6 }, /* the bitplanes are packed in one byte */
+ { 0*8+0, 0*8+1, 1*8+0, 1*8+1, 2*8+0, 2*8+1, 3*8+0, 3*8+1 },
+ { 0*32, 4*32, 2*32, 6*32, 1*32, 5*32, 3*32, 7*32 },
+ 32*8 /* every char takes 32 consecutive bytes */
+};
+
+static const gfx_layout super9_tilelayout = // Green is OK. Red needs normal goldstar order...
+{
+ 8,32, /* 8*32 characters */
+ 256, /* 256 tiles */
+ 4, /* 4 bits per pixel */
+ { 0, 2, 4, 6 },
+ { 1, 0, 1*8+1, 1*8+0, 2*8+1, 2*8+0, 3*8+1, 3*8+0 },
+ { 0*8, 4*8, 8*8, 12*8, 16*8, 20*8, 24*8, 28*8,
+ 32*8, 36*8, 40*8, 44*8, 48*8, 52*8, 56*8, 60*8,
+ 64*8, 68*8, 72*8, 76*8, 80*8, 84*8, 88*8, 92*8,
+ 96*8, 100*8, 104*8, 108*8, 112*8, 116*8, 120*8, 124*8 },
+ 128*8 /* every char takes 128 consecutive bytes */
+};
+
static GFXDECODE_START( goldstar )
@@ -6852,6 +6877,11 @@ static GFXDECODE_START( sangho )
*/
GFXDECODE_END
+static GFXDECODE_START( super9 )
+ GFXDECODE_ENTRY( "gfx1", 0, super9_charlayout, 0, 16 )
+ GFXDECODE_ENTRY( "gfx2", 0, super9_tilelayout, 128, 8 )
+GFXDECODE_END
+
static const gfx_layout tiles8x32_4bpp_layout =
{
@@ -7153,12 +7183,12 @@ static MACHINE_CONFIG_START( super9, goldstar_state )
MCFG_SCREEN_UPDATE_DRIVER(goldstar_state, screen_update_goldstar)
MCFG_SCREEN_PALETTE("palette")
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", goldstar)
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", super9)
MCFG_PALETTE_ADD("palette", 256)
MCFG_PALETTE_FORMAT(BBGGGRRR)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_VIDEO_START_OVERRIDE(goldstar_state,goldstar)
+ MCFG_VIDEO_START_OVERRIDE(goldstar_state, goldstar)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -10969,6 +10999,47 @@ ROM_START( roypok96b )
ROM_END
+ROM_START( roypok96c )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "subboard.bin", 0x0000, 0x1000, CRC(5ce4bed1) SHA1(bd888fec4531157668d4b14a9439a3051e52b3ec) )
+ ROM_CONTINUE(0x4000,0x1000)
+ ROM_CONTINUE(0x3000,0x1000)
+ ROM_CONTINUE(0x7000,0x1000)
+ ROM_CONTINUE(0x1000,0x1000)
+ ROM_CONTINUE(0x6000,0x1000)
+ ROM_CONTINUE(0x2000,0x1000)
+ ROM_CONTINUE(0x5000,0x1000)
+ ROM_CONTINUE(0x8000,0x8000)
+
+ ROM_REGION( 0x20000, "graphics", 0 )
+ ROM_LOAD( "rp35h.bin", 0x00000, 0x10000, CRC(664649ea) SHA1(7915ab31afd2a1bbb8f817f961e0e522d76f5c05) )
+ ROM_LOAD( "rp35l.bin", 0x10000, 0x10000, CRC(ef416c4e) SHA1(5aac157ba15c66f79a7a68935095bef9a2636f7b) )
+
+ ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x18000, "gfx1", 0 )
+ ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2
+
+ ROM_REGION( 0x8000, "gfx2", 0 )
+ ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 )
+ ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 )
+ ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
+ ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
+
+ ROM_REGION( 0x200, "proms", 0 ) // palette
+ ROM_LOAD( "rpu19.bin", 0x0000, 0x0100, CRC(deb9ae3c) SHA1(056ce4947244ade1ff70f167a998140745b5cffa) )
+ ROM_LOAD( "rpu20.bin", 0x0100, 0x0100, CRC(b3e0a328) SHA1(f8990fcd1e90d3e9205ee81f1d7dd105dbdcfcd6) )
+
+ ROM_REGION( 0x100, "proms2", 0 ) // colours again?
+ ROM_LOAD( "rpu1920.bin", 0x0000, 0x0100, CRC(e204e8f3) SHA1(9005fe9c72055af690701cd239f4b3665b2fae21) )
+ROM_END
+
+
ROM_START( pokonl97 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "po33.bin", 0x00000, 0x1000, CRC(55bdd5cf) SHA1(7fd9e5c63ab2439db33710d7684f5df5e7324325) )
@@ -11988,9 +12059,27 @@ ROM_START( nfm )
ROM_END
+/* Super Cherry Master.
+ Lacks of Dyna copyright. Maybe bootleg.
+
+ Not reels stop options.
+ Tried any input on the real hardware without luck.
+*/
+ROM_START( scmaster ) // all roms unique
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "27c512.u6", 0x00000, 0x10000, CRC(4eef290a) SHA1(27cca383de49d5f0072ecdda11591b78727469c6) )
+
+ ROM_REGION( 0x20000, "gfx1", 0 )
+ ROM_LOAD( "27c010.u29", 0x00000, 0x20000, CRC(98bd34b6) SHA1(e3ff6536eb421ed2e2f5d4354099078ba4ae5671) )
+
+ ROM_REGION( 0x40000, "gfx2", 0 )
+ ROM_LOAD( "27c020.u41", 0x00000, 0x40000, CRC(ece34be2) SHA1(fdfaaffb12a7f6de6bf21b46ad50e845abc00734) )
+ROM_END
+
+
ROM_START( unkch1 )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "u6.bin", 0x0000, 0x10000, CRC(30309996) SHA1(290f35f587fdf78dcb4f09403c510deec533c9c2) )
+ ROM_LOAD( "u6.bin", 0x00000, 0x10000, CRC(30309996) SHA1(290f35f587fdf78dcb4f09403c510deec533c9c2) )
ROM_REGION( 0x20000, "gfx1", 0 )
ROM_LOAD( "u29.bin", 0x00000, 0x20000, CRC(6db245a1) SHA1(e9f85ba29b0af483eae6f999f49f1e431d9d2e27) )
@@ -12002,7 +12091,7 @@ ROM_END
ROM_START( unkch2 ) // only gfx2 differs from unkch1
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "u6.bin", 0x0000, 0x10000, CRC(30309996) SHA1(290f35f587fdf78dcb4f09403c510deec533c9c2) )
+ ROM_LOAD( "u6.bin", 0x00000, 0x10000, CRC(30309996) SHA1(290f35f587fdf78dcb4f09403c510deec533c9c2) )
ROM_REGION( 0x20000, "gfx1", 0 )
ROM_LOAD( "u29.bin", 0x00000, 0x20000, CRC(6db245a1) SHA1(e9f85ba29b0af483eae6f999f49f1e431d9d2e27) )
@@ -12014,7 +12103,7 @@ ROM_END
ROM_START( unkch3 ) // gfx2 is the same as unkch1, others differ
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "u6.3", 0x0000, 0x10000, CRC(902f9e42) SHA1(ac5843089748d457f70ea52d15285a0ccda705ad) )
+ ROM_LOAD( "u6.3", 0x00000, 0x10000, CRC(902f9e42) SHA1(ac5843089748d457f70ea52d15285a0ccda705ad) )
ROM_REGION( 0x20000, "gfx1", 0 )
ROM_LOAD( "u29.3", 0x00000, 0x20000, CRC(546929e6) SHA1(f97fe5687f8776f0abe68962a0246c9bbeb6acd1) )
@@ -12026,7 +12115,7 @@ ROM_END
ROM_START( unkch4 ) // all roms unique
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "u6.4", 0x0000, 0x10000, CRC(eb191efa) SHA1(3004f26f9af7633df572f609647716cc4ac75990) )
+ ROM_LOAD( "u6.4", 0x00000, 0x10000, CRC(eb191efa) SHA1(3004f26f9af7633df572f609647716cc4ac75990) )
ROM_REGION( 0x20000, "gfx1", 0 )
ROM_LOAD( "u29.4", 0x00000, 0x20000, CRC(eaec0034) SHA1(6b2d3922873979eafcd4c71c52017263482b82ab) )
@@ -12036,6 +12125,18 @@ ROM_START( unkch4 ) // all roms unique
ROM_END
+ROM_START( cherry96 ) // all roms unique
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "new_96-16-3.u6", 0x00000, 0x10000, CRC(84d5f2fc) SHA1(e3ed0670350920c661c5a40581966671b8a8c7df) )
+
+ ROM_REGION( 0x20000, "gfx1", 0 )
+ ROM_LOAD( "new_96-16-2.u29", 0x00000, 0x20000, CRC(dd8f7450) SHA1(c897e5151809d4e0a0b1e46609f07bb0156b489a) )
+
+ ROM_REGION( 0x40000, "gfx2", 0 )
+ ROM_LOAD( "new_96-16-1.u41", 0x00000, 0x20000, CRC(9ab19bdc) SHA1(2f34789729b5d12f6fa098a29253d5a80aef5b39) )
+ROM_END
+
+
/*
Cherry Master '97
@@ -12158,7 +12259,7 @@ ROM_END
and Eagle & Fun World stickers (serial numbers).
- For custom IC's 06B49P, and 06B53P, see the reverse-engineering notes in lucky74.c.
+ For custom IC's 06B49P, and 06B53P, see the reverse-engineering notes in lucky74.cpp.
------------------------
@@ -13386,6 +13487,28 @@ DRIVER_INIT_MEMBER(cmaster_state, rp36c3)
m_maincpu->space(AS_IO).install_read_handler(0x17, 0x17, read8_delegate(FUNC(cmaster_state::fixedval48_r),this));
}
+DRIVER_INIT_MEMBER(cmaster_state, rp96sub) // 95 33 95 33 70 6C 70 6C... XORs seem ok. need bitswap and handler.
+{
+ int i;
+ UINT8 *ROM = memregion("maincpu")->base();
+ for (i = 0;i < 0x10000;i++)
+ {
+ UINT8 x = ROM[i];
+
+ switch(i & 5)
+ {
+ case 0: x = BITSWAP8(x^0x6a, 7,6,5,4,3,2,1,0); break;
+ case 1: x = BITSWAP8(x^0xcc, 7,6,5,4,3,2,1,0); break;
+ case 4: x = BITSWAP8(x^0x8f, 7,6,5,4,3,2,1,0); break;
+ case 5: x = BITSWAP8(x^0x93, 7,6,5,4,3,2,1,0); break;
+ }
+
+ ROM[i] = x;
+ }
+
+// m_maincpu->space(AS_IO).install_read_handler(0x34, 0x34, read8_delegate(FUNC(cmaster_state::fixedvalb2_r),this));
+}
+
DRIVER_INIT_MEMBER(cmaster_state, po33)
{
@@ -13712,6 +13835,7 @@ GAME( 2009, fb2010, 0, amcoe2, nfb96tx, cmaster_state, fb2010,
GAMEL( 1996, roypok96, 0, amcoe2, roypok96, cmaster_state, rp35, ROT0, "Amcoe", "Royal Poker '96 (set 1, v97-3.5)", 0, layout_roypok96 )
GAMEL( 1996, roypok96a, roypok96, amcoe2, roypok96a, cmaster_state, rp36, ROT0, "Amcoe", "Royal Poker '96 (set 2, v98-3.6)", 0, layout_roypok96 )
GAMEL( 1996, roypok96b, roypok96, amcoe2, roypok96a, cmaster_state, rp36c3, ROT0, "Amcoe", "Royal Poker '96 (set 3, v98-3.6?)", 0, layout_roypok96 )
+GAME( 1996, roypok96c, roypok96, amcoe2, roypok96a, cmaster_state, rp96sub, ROT0, "Amcoe", "Royal Poker '96 (set 4, C3 board)", MACHINE_NOT_WORKING )
/* these all appear to be graphic hacks of 'New Fruit Bonus '96', they can run with the same program rom
@@ -13726,11 +13850,17 @@ GAME( 2003, carb2003, nfb96, amcoe2, nfb96bl, driver_device, 0,
GAME( 2003, nfm, 0, nfm, nfm, driver_device, 0, ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic)", MACHINE_NOT_WORKING ) // vFB02-07A "Copyright By Ms. Liu Orchis 2003/03/06"
-// these have 'cherry 1994' in the program roms, but also "Super Cherry / New Cherry Gold '99" probably hacks of a 1994 version of Cherry Bonus / Cherry Master (Super Cherry Master?)
-GAMEL(1999, unkch1, 0, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", 0, layout_unkch )
-GAMEL(1999, unkch2, unkch1, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "Super Cherry Gold (bootleg of Super Cherry Master)", 0, layout_unkch )
-GAMEL(1999, unkch3, unkch1, unkch, unkch3, unkch_state, unkch3, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", 0, layout_unkch ) // cards have been hacked to look like barrels, girl removed?
-GAMEL(1999, unkch4, unkch1, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Grand Cherry Master (bootleg of Super Cherry Master)", 0, layout_unkch ) // by 'Toy System' Hungary
+
+// super cherry master sets...
+GAMEL(1994, scmaster, 0, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Super Cherry Master (v1.0)", 0, layout_unkch )
+
+// these have 'cherry 1994' in the program roms, but also "Super Cherry / New Cherry Gold '99". probably hacks of a 1994 version of Super Cherry Master.
+GAMEL(1999, unkch1, scmaster, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", 0, layout_unkch )
+GAMEL(1999, unkch2, scmaster, unkch, unkch, unkch_state, unkch1, ROT0, "bootleg", "Super Cherry Gold (bootleg of Super Cherry Master)", 0, layout_unkch )
+GAMEL(1999, unkch3, scmaster, unkch, unkch3, unkch_state, unkch3, ROT0, "bootleg", "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", 0, layout_unkch ) // cards have been hacked to look like barrels, girl removed?
+GAMEL(1999, unkch4, scmaster, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "Grand Cherry Master (bootleg of Super Cherry Master)", 0, layout_unkch ) // by 'Toy System' Hungary
+
+GAME( 1996, cherry96, scmaster, unkch, unkch4, unkch_state, unkch4, ROT0, "bootleg", "New Cherry '96 (bootleg of New Fruit Bonus?)", MACHINE_NOT_WORKING ) // need to be moved to another machine...
/* Stealth sets.
diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp
index a4605bbace2..a032acec210 100644
--- a/src/mame/drivers/hh_cop400.cpp
+++ b/src/mame/drivers/hh_cop400.cpp
@@ -66,7 +66,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -194,7 +194,7 @@ void hh_cop400_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
+void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -203,10 +203,13 @@ void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 set
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
+// generic input handlers
+
UINT8 hh_cop400_state::read_inputs(int columns)
{
// active low
@@ -232,7 +235,7 @@ UINT8 hh_cop400_state::read_inputs(int columns)
Castle Toy Einstein
* COP421 MCU labeled ~/927 COP421-NEZ/N
- * 4 lamps, 1bit sound
+ * 4 lamps, 1-bit sound
***************************************************************************/
@@ -275,9 +278,54 @@ MACHINE_CONFIG_END
/***************************************************************************
+ Coleco Head to Head Basketball
+ * COP420 MCU labeled COP420L-NEZ/N
+ * 2-digit 7seg display, 41 other leds, 1-bit sound
+
+***************************************************************************/
+
+class h2hbaskb_state : public hh_cop400_state
+{
+public:
+ h2hbaskb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_cop400_state(mconfig, type, tag)
+ { }
+};
+
+// handlers
+
+//..
+
+
+// config
+
+static INPUT_PORTS_START( h2hbaskb )
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( h2hbaskb, h2hbaskb_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", COP420, 1000000) // approximation - RC osc. R=43K to +9V, C=101pf to GND
+ MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, COP400_MICROBUS_DISABLED) // guessed
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1))
+// MCFG_DEFAULT_LAYOUT(layout_h2hbaskb)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
Entex Space Invader
* COP444L MCU labeled /B138 COPL444-HRZ/N INV II (die labeled HRZ COP 444L/A)
- * 3 7seg LEDs, LED matrix and overlay mask, 1bit sound
+ * 3 7seg LEDs, LED matrix and overlay mask, 1-bit sound
The first version was on TMS1100 (see hh_tms1k.c), this is the reprogrammed
second release with a gray case instead of black.
@@ -393,7 +441,7 @@ MACHINE_CONFIG_END
Mattel Funtronics Jacks
* COP410L MCU bonded directly to PCB (die labeled COP410L/B NGS)
- * 8 LEDs, 1bit sound
+ * 8 LEDs, 1-bit sound
***************************************************************************/
@@ -500,7 +548,7 @@ MACHINE_CONFIG_END
Mattel Funtronics Red Light Green Light
* COP410L MCU bonded directly to PCB (die labeled COP410L/B NHZ)
- * 14 LEDs, 1bit sound
+ * 14 LEDs, 1-bit sound
known releases:
- USA: Funtronics Red Light Green Light
@@ -595,7 +643,7 @@ MACHINE_CONFIG_END
Milton Bradley Plus One
* COP410L MCU in 8-pin DIP, labeled ~/029 MM 57405 (die labeled COP410L/B NNE)
- * 4 sensors(1 on each die side), 1bit sound
+ * 4 sensors(1 on each die side), 1-bit sound
***************************************************************************/
@@ -639,7 +687,7 @@ MACHINE_CONFIG_END
Milton Bradley (Electronic) Lightfight
* COP421L MCU labeled /B119 COP421L-HLA/N
- * LED matrix, 1bit sound
+ * LED matrix, 1-bit sound
Xbox-shaped electronic game for 2 or more players, with long diagonal buttons
next to each outer LED. The main object of the game is to pinpoint a light
@@ -784,6 +832,12 @@ ROM_START( ctstein )
ROM_END
+ROM_START( h2hbaskb )
+ ROM_REGION( 0x0400, "maincpu", 0 )
+ ROM_LOAD( "cop420l-nmy", 0x0000, 0x0400, CRC(87152509) SHA1(acdb869b65d49b3b9855a557ed671cbbb0f61e2c) )
+ROM_END
+
+
ROM_START( einvaderc )
ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD( "copl444-hrz_n_inv_ii", 0x0000, 0x0800, CRC(76400f38) SHA1(0e92ab0517f7b7687293b189d30d57110df20fe0) )
@@ -818,6 +872,8 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
CONS( 1979, ctstein, 0, 0, ctstein, ctstein, driver_device, 0, "Castle Toy", "Einstein (Castle Toy)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
+CONS( 1979, h2hbaskb, 0, 0, h2hbaskb, h2hbaskb, driver_device, 0, "Coleco", "Head to Head Basketball (COP420L)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
+
CONS( 1981, einvaderc, einvader, 0, einvaderc, einvaderc, driver_device, 0, "Entex", "Space Invader (Entex, COP444)", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING )
CONS( 1979, funjacks, 0, 0, funjacks, funjacks, driver_device, 0, "Mattel", "Funtronics Jacks", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index b511780824a..36bfd7a52ab 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -138,7 +138,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety);
+ void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -267,7 +267,7 @@ void hh_hmcs40_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety)
+void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -276,10 +276,13 @@ void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 set
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (U64(1) << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
+// generic input handlers
+
UINT16 hh_hmcs40_state::read_inputs(int columns)
{
UINT16 ret = 0;
diff --git a/src/mame/drivers/hh_melps4.cpp b/src/mame/drivers/hh_melps4.cpp
index 541352078d7..c16715427be 100644
--- a/src/mame/drivers/hh_melps4.cpp
+++ b/src/mame/drivers/hh_melps4.cpp
@@ -54,7 +54,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -176,7 +176,7 @@ void hh_melps4_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
+void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -185,7 +185,8 @@ void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 set
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp
index bb65a69265e..50bcd9c9e91 100644
--- a/src/mame/drivers/hh_pic16.cpp
+++ b/src/mame/drivers/hh_pic16.cpp
@@ -66,7 +66,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -186,7 +186,7 @@ void hh_pic16_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
+void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -195,7 +195,8 @@ void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp
index 68e14d4514b..a201672c98f 100644
--- a/src/mame/drivers/hh_tms1k.cpp
+++ b/src/mame/drivers/hh_tms1k.cpp
@@ -22,7 +22,7 @@
@MP1030 TMS1100 1980, APF Mathemagician
@MP1133 TMS1470 1979, Kosmos Astro
@MP1180 TMS1100 1980, Tomy Power House Pinball
- *MP1181 TMS1100 1979, Conic Football 2
+ @MP1181 TMS1100 1979, Conic Football 2
@MP1204 TMS1100 1980, Entex Baseball 3 (6007)
@MP1211 TMS1100 1980, Entex Space Invader
@MP1218 TMS1100 1980, Entex Basketball 2 (6010)
@@ -47,7 +47,8 @@
MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.cpp
@MP3404 TMS1100 1978, Parker Brothers Merlin
@MP3405 TMS1100 1979, Coleco Amaze-A-Tron
- *MP3415 TMS1100 1978, Coleco Electronic Quarterback
+ @MP3415 TMS1100 1978, Coleco Electronic Quarterback
+ @MP3435 TMS1100 1979, Coleco Zodiac
@MP3438A TMS1100 1979, Kenner Star Wars Electronic Battle Command
MP3450A TMS1100 1979, MicroVision cartridge: Blockbuster
MP3454 TMS1100 1979, MicroVision cartridge: Star Trek Phaser Strike
@@ -65,7 +66,7 @@
@M34012 TMS1100 1980, Mattel Dungeons & Dragons - Computer Labyrinth Game
*M34014 TMS1100 1981, Coleco Bowlatronic
M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter
- *M34038 TMS1100 1982, Parker Brothers Lost Treasure
+ @M34038 TMS1100 1982, Parker Brothers Lost Treasure
M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster
*M34078A TMS1100 1983, Milton Bradley Arcade Mania
@MP6100A TMS0980 1979, Ideal Electronic Detective
@@ -77,7 +78,7 @@
MP7324 TMS1400 1985, Tiger K28/Coleco Talking Teacher -> tispeak.cpp
MP7332 TMS1400 1981, Milton Bradley Dark Tower -> mbdtower.cpp
@MP7334 TMS1400 1981, Coleco Total Control 4
- @MP7351 TMS1400CR 1982, Parker Brothers Master Merlin
+ @MP7351 TMS1400 1982, Parker Brothers Master Merlin
@MP7551 TMS1670 1980, Entex Color Football 4 (6009)
@MPF553 TMS1670 1980, Gakken Jackpot: Gin Rummy & Black Jack (note: assume F to be a misprint)
*MP7573 TMS1670? 1981, Entex Select-a-Game cartridge: Football 4 (? note: 40-pin, VFD-capable)
@@ -109,12 +110,14 @@
#include "sound/beep.h"
// internal artwork
-#include "amaztron.lh"
+#include "amaztron.lh" // clickable
#include "astro.lh"
#include "bankshot.lh"
#include "bigtrak.lh"
+#include "cnfball2.lh"
#include "cnsector.lh"
#include "comp4.lh"
+#include "cqback.lh"
#include "ebball.lh"
#include "ebball2.lh"
#include "ebball3.lh"
@@ -126,7 +129,9 @@
#include "gpoker.lh"
#include "h2hbaseb.lh"
#include "h2hfootb.lh"
+#include "lostreas.lh"
#include "mathmagi.lh"
+#include "mdndclab.lh" // clickable
#include "merlin.lh" // clickable
#include "mmerlin.lh" // clickable
#include "simon.lh" // clickable
@@ -137,6 +142,7 @@
#include "tandy12.lh" // clickable
#include "tbreakup.lh"
#include "tc4.lh"
+#include "zodiac.lh"
#include "hh_tms1k_test.lh" // common test-layout - use external artwork
@@ -282,7 +288,7 @@ void hh_tms1k_state::set_display_segmask(UINT32 digits, UINT32 mask)
}
}
-void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
+void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -291,18 +297,12 @@ void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
-void hh_tms1k_state::display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask)
-{
- // expects m_display_segmask to be not-0
- for (int y = 0; y < maxy; y++)
- m_display_segmask[y] &= segmask;
-
- display_matrix(maxx, maxy, setx, sety);
-}
+// generic input handlers
UINT8 hh_tms1k_state::read_inputs(int columns)
{
@@ -316,6 +316,19 @@ UINT8 hh_tms1k_state::read_inputs(int columns)
return ret;
}
+UINT8 hh_tms1k_state::read_rotated_inputs(int columns, UINT8 rowmask)
+{
+ UINT8 ret = 0;
+ UINT16 colmask = (1 << columns) - 1;
+
+ // read selected input columns
+ for (int i = 0; i < 8; i++)
+ if (1 << i & rowmask && m_inp_matrix[i]->read() & m_inp_mux & colmask)
+ ret |= 1 << i;
+
+ return ret;
+}
+
// devices with a TMS0980 can auto power-off
@@ -345,7 +358,7 @@ INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button)
/***************************************************************************
APF Mathemagician
- * TMS1100 MCU, labeled MP1030
+ * TMS1100 MCU, labeled MP1030 (no decap)
* 2 x DS8870N - Hex LED Digit Driver
* 2 x DS8861N - MOS-to-LED 5-Segment Driver
* 10-digit 7seg LED display(2 custom ones) + 4 LEDs, no sound
@@ -382,21 +395,8 @@ public:
void mathmagi_state::prepare_display()
{
- // R0-R7: 7seg leds
- for (int y = 0; y < 8; y++)
- {
- m_display_segmask[y] = 0x7f;
- m_display_state[y] = (m_r >> y & 1) ? (m_o >> 1) : 0;
- }
-
- // R8: custom math symbols digit
- // R9: custom equals digit
- // R10: misc lamps
- for (int y = 8; y < 11; y++)
- m_display_state[y] = (m_r >> y & 1) ? m_o : 0;
-
- set_display_size(8, 11);
- display_update();
+ set_display_segmask(0xff, 0x7f);
+ display_matrix(7, 11, m_o, m_r);
}
WRITE16_MEMBER(mathmagi_state::write_r)
@@ -404,17 +404,20 @@ WRITE16_MEMBER(mathmagi_state::write_r)
// R3,R5-R7,R9,R10: input mux
m_inp_mux = (data >> 3 & 1) | (data >> 4 & 0xe) | (data >> 5 & 0x30);
- // +others:
+ // R0-R7: 7seg leds
+ // R8: custom math symbols digit
+ // R9: custom equals digit
+ // R10: misc lamps
m_r = data;
prepare_display();
}
WRITE16_MEMBER(mathmagi_state::write_o)
{
- // O1-O7: digit segments A-G
+ // O1-O7: led/digit segment data
// O0: N/C
- data = (data << 1 & 0xfe) | (data >> 7 & 1); // because opla is unknown
m_o = data;
+ prepare_display();
}
READ8_MEMBER(mathmagi_state::read_k)
@@ -474,7 +477,7 @@ static INPUT_PORTS_START( mathmagi )
INPUT_PORTS_END
-// output PLA is not dumped
+// output PLA is not decapped
static const UINT16 mathmagi_output_pla[0x20] =
{
lA+lB+lC+lD+lE+lF, // 0
@@ -514,7 +517,7 @@ static const UINT16 mathmagi_output_pla[0x20] =
static MACHINE_CONFIG_START( mathmagi, mathmagi_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 175000) // RC osc. R=68K, C=82pf -> ~175kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 175000) // approximation - RC osc. R=68K, C=82pf
MCFG_TMS1XXX_OUTPUT_PLA(mathmagi_output_pla)
MCFG_TMS1XXX_READ_K_CB(READ8(mathmagi_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mathmagi_state, write_r))
@@ -534,12 +537,11 @@ MACHINE_CONFIG_END
Coleco Amaze-A-Tron, by Ralph Baer
* TMS1100 MCU, labeled MP3405(die label too)
- * 2-digit 7seg LED display + 2 LEDs(one red, one green), 1bit sound
- * 5x5 pressure-sensitive playing board
+ * 2-digit 7seg LED display + 2 LEDs(one red, one green), 1-bit sound
+ * 5*5 pressure-sensitive playing board(buttons), 4 game pieces
This is an electronic board game with a selection of 8 maze games,
- most of them for 2 players. A 5x5 playing grid and four markers are
- required to play. Refer to the official manual for more information.
+ most of them for 2 players.
***************************************************************************/
@@ -560,18 +562,8 @@ public:
void amaztron_state::prepare_display()
{
- // R8,R9: select digit
- for (int y = 0; y < 2; y++)
- {
- m_display_segmask[y] = 0x7f;
- m_display_state[y] = (m_r >> (y + 8) & 1) ? m_o : 0;
- }
-
- // R6,R7: lamps (-> lamp20,21)
- m_display_state[2] = m_r >> 6 & 3;
-
- set_display_size(8, 3);
- display_update();
+ set_display_segmask(0xc, 0x7f);
+ display_matrix(7, 4, m_o, m_r);
}
WRITE16_MEMBER(amaztron_state::write_r)
@@ -582,8 +574,9 @@ WRITE16_MEMBER(amaztron_state::write_r)
// R10: speaker out
m_speaker->level_w(data >> 10 & 1);
- // other bits:
- m_r = data;
+ // R6,R7: leds
+ // R8,R9: select digit
+ m_r = data >> 6 & 0xf;
prepare_display();
}
@@ -610,50 +603,50 @@ READ8_MEMBER(amaztron_state::read_k)
static INPUT_PORTS_START( amaztron )
PORT_START("IN.0") // R0
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Grid 1")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Grid 6")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Grid 11")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Grid 16")
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Grid 21")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 1")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 6")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 11")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 16")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 21")
PORT_START("IN.1") // R1
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Grid 2")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Grid 7")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Grid 12")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Grid 17")
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Grid 22")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 2")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 7")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 12")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 17")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 22")
PORT_START("IN.2") // R2
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Grid 3")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Grid 8")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Grid 13")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Grid 18")
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Grid 23")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 3")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 8")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 13")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 18")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 23")
PORT_START("IN.3") // R3
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Grid 4")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("Grid 9")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Grid 14")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Grid 19")
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Grid 24")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 4")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 9")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 14")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 19")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 24")
PORT_START("IN.4") // R4
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Grid 5")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("Grid 10")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Grid 15")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Grid 20")
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Grid 25")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 5")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 10")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 15")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 20")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Square 25")
PORT_START("IN.5") // R5
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Game Select")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("Game Start")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SELECT) PORT_NAME("Game Select")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START) PORT_NAME("Game Start")
PORT_BIT(0x1c, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static MACHINE_CONFIG_START( amaztron, amaztron_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K?, C=100pf -> ~350kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 300000) // approximation - RC osc. R=33K?, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(amaztron_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(amaztron_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(amaztron_state, write_o))
@@ -673,21 +666,19 @@ MACHINE_CONFIG_END
/***************************************************************************
- Coleco Head to Head Baseball
- * PCB labels Coleco rev C 73891/2
- * TMS1170NLN MP1525-N2 (die labeled MP1525)
- * 9-digit cyan VFD display, and other LEDs behind bezel, 1bit sound
-
- known releases:
- - USA: Head to Head Baseball
- - Japan: Computer Baseball, published by Tsukuda
+ Coleco Zodiac - The Astrology Computer
+ * TMS1100 MP3435 (no decap)
+ * 8-digit 7seg display, 12 other LEDs, 1-bit sound
+
+ As the name suggests, this is an astrologic calculator. Refer to the
+ (very extensive) manual on how to use it.
***************************************************************************/
-class h2hbaseb_state : public hh_tms1k_state
+class zodiac_state : public hh_tms1k_state
{
public:
- h2hbaseb_state(const machine_config &mconfig, device_type type, const char *tag)
+ zodiac_state(const machine_config &mconfig, device_type type, const char *tag)
: hh_tms1k_state(mconfig, type, tag)
{ }
@@ -695,111 +686,245 @@ public:
DECLARE_WRITE16_MEMBER(write_r);
DECLARE_WRITE16_MEMBER(write_o);
DECLARE_READ8_MEMBER(read_k);
-
- void set_clock();
- DECLARE_INPUT_CHANGED_MEMBER(skill_switch);
-
-protected:
- virtual void machine_reset() override;
};
// handlers
-void h2hbaseb_state::prepare_display()
+void zodiac_state::prepare_display()
{
- memset(m_display_segmask, ~0, sizeof(m_display_segmask));
- display_matrix_seg(9, 9, (m_r & 0x100) | m_o, (m_r & 0xff) | (m_r >> 1 & 0x100), 0x7f);
+ set_display_segmask(0xff, 0x7f);
+ display_matrix(8, 10, m_o, m_r);
}
-WRITE16_MEMBER(h2hbaseb_state::write_r)
+WRITE16_MEMBER(zodiac_state::write_r)
{
// R10: speaker out
m_speaker->level_w(data >> 10 & 1);
- // R4-R7: input mux
- m_inp_mux = data >> 4 & 0xf;
+ // R0-R4,R8: input mux
+ m_inp_mux = (data & 0x1f) | (data >> 3 & 0x20);
- // R0-R7,R9: select vfd digit/led
- // R8: led state
- m_r = data;
+ // R0-R7: digit select
+ // R8,R9: led select
+ m_r = data & 0x3ff;
prepare_display();
}
-WRITE16_MEMBER(h2hbaseb_state::write_o)
+WRITE16_MEMBER(zodiac_state::write_o)
{
- // O0-O6: digit segments A-G
- // O7: N/C
+ // O0-O7: digit segment/led data
m_o = data;
prepare_display();
}
-READ8_MEMBER(h2hbaseb_state::read_k)
+READ8_MEMBER(zodiac_state::read_k)
{
- // K: multiplexed inputs (note: K8(Vss row) is always on)
- return m_inp_matrix[4]->read() | read_inputs(4);
+ // K: multiplexed inputs
+ return read_inputs(6);
}
// config
-static INPUT_PORTS_START( h2hbaseb )
- PORT_START("IN.0") // R4
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("N")
- PORT_BIT( 0x0b, IP_ACTIVE_HIGH, IPT_UNUSED )
+static INPUT_PORTS_START( zodiac )
+ PORT_START("IN.0") // R0
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0")
- PORT_START("IN.1") // R5
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("B")
- PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_START("IN.1") // R1
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
- PORT_START("IN.2") // R6
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("S")
- PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_START("IN.2") // R2
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("D")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("A")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8")
- PORT_START("IN.3") // R7
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Curve") // these two buttons appear twice on the board
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Fast Pitch")
- PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_START("IN.3") // R3
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("P")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("L")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("J")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("E")
- PORT_START("IN.4") // Vss!
- PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Swing")
+ PORT_START("IN.4") // R4
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear")
- PORT_START("IN.5") // fake
- PORT_CONFNAME( 0x01, 0x00, "Skill Level" ) PORT_CHANGED_MEMBER(DEVICE_SELF, h2hbaseb_state, skill_switch, NULL)
- PORT_CONFSETTING( 0x00, "1" )
- PORT_CONFSETTING( 0x01, "2" )
+ PORT_START("IN.5") // R8
+ PORT_CONFNAME( 0x03, 0x01, "Mode")
+ PORT_CONFSETTING( 0x01, "H" ) // Horoscope
+ PORT_CONFSETTING( 0x02, "P" ) // Preview
+ PORT_CONFSETTING( 0x00, "A" ) // Answer
+ PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
-INPUT_CHANGED_MEMBER(h2hbaseb_state::skill_switch)
+
+// output PLA is not decapped
+static const UINT16 zodiac_output_pla[0x20] =
{
- set_clock();
+ 0x80, // empty/led 1/7
+ lC, // i/led 2/8
+ lE+lG, // r/led 3/9
+ lC+lE+lG, // n
+ lF, // seg F/led 4/10
+ 0, // ?
+ 0, // ?
+ lC+lE+lF+lG, // h
+ lB, // seg B/led 5/11
+ lD, // seg D/led 6/12
+ 0, // ?
+ 0, // ?
+ 0, // ?
+ 0, // ?
+ lA+lB+lE+lF+lG, // P
+ 0, // ?
+ lA+lB+lC+lD+lE+lF, // 0
+ lB+lC, // 1
+ lA+lB+lD+lE+lG, // 2
+ lA+lB+lC+lD+lG, // 3
+ lB+lC+lF+lG, // 4
+ lA+lC+lD+lF+lG, // 5
+ lA+lC+lD+lE+lF+lG, // 6
+ lA+lB+lC, // 7
+ lA+lB+lC+lD+lE+lF+lG, // 8
+ lA+lB+lC+lD+lF+lG, // 9
+ lA+lB+lC+lE+lF+lG, // A
+ lB+lC+lD+lE+lG, // d
+ lA+lD+lE+lF+lG, // E
+ lB+lC+lD+lE, // J
+ lD+lE+lF, // L
+ lB+lC+lD+lE+lF // U
+};
+
+static MACHINE_CONFIG_START( zodiac, zodiac_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", TMS1100, 500000) // approximation - RC osc. R=18K, C=100pf
+ MCFG_TMS1XXX_OUTPUT_PLA(zodiac_output_pla)
+ MCFG_TMS1XXX_READ_K_CB(READ8(zodiac_state, read_k))
+ MCFG_TMS1XXX_WRITE_R_CB(WRITE16(zodiac_state, write_r))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(zodiac_state, write_o))
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_zodiac)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
+ Coleco Electronic Quarterback
+ * TMS1100NLL MP3415 (die labeled MP3415)
+ * 9-digit LED grid, 1-bit sound
+
+ known releases:
+ - USA(1): Electronic Quarterback
+ - USA(2): Electronic Touchdown, distributed by Sears
+
+***************************************************************************/
+
+class cqback_state : public hh_tms1k_state
+{
+public:
+ cqback_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_tms1k_state(mconfig, type, tag)
+ { }
+
+ void prepare_display();
+ DECLARE_WRITE16_MEMBER(write_r);
+ DECLARE_WRITE16_MEMBER(write_o);
+ DECLARE_READ8_MEMBER(read_k);
+};
+
+// handlers
+
+void cqback_state::prepare_display()
+{
+ // R9 selects between segments B/C or A'/D'
+ UINT16 seg = m_o;
+ if (m_r & 0x200)
+ seg = (m_o << 7 & 0x300) | (m_o & 0xf9);
+
+ set_display_segmask(0x1ff, 0xff);
+ display_matrix(11, 9, seg, m_r & 0x1ff);
}
+WRITE16_MEMBER(cqback_state::write_r)
+{
+ // R10: speaker out
+ m_speaker->level_w(data >> 10 & 1);
-void h2hbaseb_state::set_clock()
+ // R0-R4: input mux
+ m_inp_mux = data & 0x1f;
+
+ // R0-R9: select digit/segment
+ m_r = data;
+ prepare_display();
+}
+
+WRITE16_MEMBER(cqback_state::write_o)
{
- // MCU clock is from an RC circuit with C=47pf, and R value is depending on
- // skill switch: R=51K(1) or 43K(2)
- m_maincpu->set_unscaled_clock((m_inp_matrix[5]->read() & 1) ? 400000 : 350000);
+ // O0-O7: digit segments
+ m_o = data;
+ prepare_display();
}
-void h2hbaseb_state::machine_reset()
+READ8_MEMBER(cqback_state::read_k)
{
- hh_tms1k_state::machine_reset();
- set_clock();
+ // K: multiplexed inputs, rotated matrix
+ return read_rotated_inputs(5);
}
-static MACHINE_CONFIG_START( h2hbaseb, h2hbaseb_state )
+
+// config
+
+static INPUT_PORTS_START( cqback )
+ PORT_START("IN.0") // K1
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_NAME("P1 Left/Right")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Kick/Pass")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Display")
+
+ PORT_START("IN.1") // K2
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_TOGGLE PORT_NAME("Play Selector") // pass
+ PORT_BIT( 0x02, 0x02, IPT_SPECIAL ) PORT_CONDITION("IN.1", 0x01, EQUALS, 0x00) // run/kick
+
+ PORT_START("IN.2") // K4
+ PORT_CONFNAME( 0x03, 0x02, "Skill Level" )
+ PORT_CONFSETTING( 0x02, "1" )
+ PORT_CONFSETTING( 0x01, "2" )
+
+ PORT_START("IN.3") // K8
+ PORT_CONFNAME( 0x01, 0x00, "Factory Test" )
+ PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
+ PORT_CONFSETTING( 0x01, DEF_STR( On ) ) // TP1-TP2
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( cqback, cqback_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1170, 350000) // see set_clock
- MCFG_TMS1XXX_READ_K_CB(READ8(h2hbaseb_state, read_k))
- MCFG_TMS1XXX_WRITE_R_CB(WRITE16(h2hbaseb_state, write_r))
- MCFG_TMS1XXX_WRITE_O_CB(WRITE16(h2hbaseb_state, write_o))
+ MCFG_CPU_ADD("maincpu", TMS1100, 310000) // approximation - RC osc. R=33K, C=100pf
+ MCFG_TMS1XXX_READ_K_CB(READ8(cqback_state, read_k))
+ MCFG_TMS1XXX_WRITE_R_CB(WRITE16(cqback_state, write_r))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(cqback_state, write_o))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
- MCFG_DEFAULT_LAYOUT(layout_h2hbaseb)
+ MCFG_DEFAULT_LAYOUT(layout_cqback)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -815,10 +940,14 @@ MACHINE_CONFIG_END
Coleco Head to Head Football
* TMS1100NLLE (rev. E!) MP3460 (die labeled MP3460)
- * 2*SN75492N LED display drivers, 9-digit LED grid, 1bit sound
+ * 2*SN75492N LED display drivers, 9-digit LED grid, 1-bit sound
+
+ known releases:
+ - USA(1): Head to Head Football
+ - USA(2): Team Play Football, distributed by Sears
LED electronic football game. To distinguish between offense and defense,
- offense blips (should) appear brighter.
+ offense blips (should) appear brighter. The hardware is similar to cqback.
***************************************************************************/
@@ -839,8 +968,8 @@ public:
void h2hfootb_state::prepare_display()
{
- memset(m_display_segmask, ~0, sizeof(m_display_segmask));
- display_matrix_seg(9, 9, m_o | (m_r >> 1 & 0x100), (m_r & 0x1ff), 0x7f);
+ set_display_segmask(0x1ff, 0x7f);
+ display_matrix(9, 9, m_o | (m_r >> 1 & 0x100), m_r & 0x1ff);
}
WRITE16_MEMBER(h2hfootb_state::write_r)
@@ -866,15 +995,8 @@ WRITE16_MEMBER(h2hfootb_state::write_o)
READ8_MEMBER(h2hfootb_state::read_k)
{
- // K: multiplexed inputs
- UINT8 k = 0;
-
- // compared to the usual setup, the button matrix is rotated
- for (int i = 0; i < 4; i++)
- if (m_inp_matrix[i]->read() & m_inp_mux)
- k |= 1 << i;
-
- return k;
+ // K: multiplexed inputs, rotated matrix
+ return read_rotated_inputs(9);
}
@@ -910,7 +1032,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( h2hfootb, h2hfootb_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 325000) // approximation - RC osc. R=39K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1100, 310000) // approximation - RC osc. R=39K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(h2hfootb_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(h2hfootb_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(h2hfootb_state, write_o))
@@ -930,9 +1052,149 @@ MACHINE_CONFIG_END
/***************************************************************************
+ Coleco Head to Head Baseball
+ * PCB labels Coleco rev C 73891/2
+ * TMS1170NLN MP1525-N2 (die labeled MP1525)
+ * 9-digit cyan VFD display, and other LEDs behind bezel, 1-bit sound
+
+ known releases:
+ - USA: Head to Head Baseball
+ - Japan: Computer Baseball, published by Tsukuda
+
+***************************************************************************/
+
+class h2hbaseb_state : public hh_tms1k_state
+{
+public:
+ h2hbaseb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_tms1k_state(mconfig, type, tag)
+ { }
+
+ void prepare_display();
+ DECLARE_WRITE16_MEMBER(write_r);
+ DECLARE_WRITE16_MEMBER(write_o);
+ DECLARE_READ8_MEMBER(read_k);
+
+ void set_clock();
+ DECLARE_INPUT_CHANGED_MEMBER(skill_switch);
+
+protected:
+ virtual void machine_reset() override;
+};
+
+// handlers
+
+void h2hbaseb_state::prepare_display()
+{
+ set_display_segmask(0x1ff, 0x7f);
+ display_matrix(9, 9, (m_r & 0x100) | m_o, (m_r & 0xff) | (m_r >> 1 & 0x100));
+}
+
+WRITE16_MEMBER(h2hbaseb_state::write_r)
+{
+ // R10: speaker out
+ m_speaker->level_w(data >> 10 & 1);
+
+ // R4-R7: input mux
+ m_inp_mux = data >> 4 & 0xf;
+
+ // R0-R7,R9: select vfd digit/led
+ // R8: led state
+ m_r = data;
+ prepare_display();
+}
+
+WRITE16_MEMBER(h2hbaseb_state::write_o)
+{
+ // O0-O6: digit segments A-G
+ // O7: N/C
+ m_o = data;
+ prepare_display();
+}
+
+READ8_MEMBER(h2hbaseb_state::read_k)
+{
+ // K: multiplexed inputs (note: K8(Vss row) is always on)
+ return m_inp_matrix[4]->read() | read_inputs(4);
+}
+
+
+// config
+
+static INPUT_PORTS_START( h2hbaseb )
+ PORT_START("IN.0") // R4
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("N")
+ PORT_BIT( 0x0b, IP_ACTIVE_HIGH, IPT_UNUSED )
+
+ PORT_START("IN.1") // R5
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("B")
+ PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
+
+ PORT_START("IN.2") // R6
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("S")
+ PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
+
+ PORT_START("IN.3") // R7
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Curve") // these two buttons appear twice on the board
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Fast Pitch") // "
+ PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
+
+ PORT_START("IN.4") // Vss!
+ PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Swing")
+
+ PORT_START("IN.5") // fake
+ PORT_CONFNAME( 0x01, 0x00, "Skill Level" ) PORT_CHANGED_MEMBER(DEVICE_SELF, h2hbaseb_state, skill_switch, NULL)
+ PORT_CONFSETTING( 0x00, "1" )
+ PORT_CONFSETTING( 0x01, "2" )
+INPUT_PORTS_END
+
+INPUT_CHANGED_MEMBER(h2hbaseb_state::skill_switch)
+{
+ set_clock();
+}
+
+
+void h2hbaseb_state::set_clock()
+{
+ // MCU clock is from an RC circuit with C=47pf, and R value is depending on
+ // skill switch: R=51K(1) or 43K(2)
+ m_maincpu->set_unscaled_clock((m_inp_matrix[5]->read() & 1) ? 400000 : 350000);
+}
+
+void h2hbaseb_state::machine_reset()
+{
+ hh_tms1k_state::machine_reset();
+ set_clock();
+}
+
+static MACHINE_CONFIG_START( h2hbaseb, h2hbaseb_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", TMS1170, 350000) // see set_clock
+ MCFG_TMS1XXX_READ_K_CB(READ8(h2hbaseb_state, read_k))
+ MCFG_TMS1XXX_WRITE_R_CB(WRITE16(h2hbaseb_state, write_r))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(h2hbaseb_state, write_o))
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_h2hbaseb)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
Coleco Total Control 4
* TMS1400NLL MP7334-N2 (die labeled MP7334)
- * 2x2-digit 7seg LED display + 4 LEDs, LED grid display, 1bit sound
+ * 2x2-digit 7seg LED display + 4 LEDs, LED grid display, 1-bit sound
This is a head to head electronic tabletop LED-display sports console.
One cartridge(Football) was included with the console, the other three were
@@ -1066,7 +1328,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( tc4, tc4_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1400, 450000) // approximation - RC osc. R=27.3K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1400, 450000) // approximation - RC osc. R=27.3K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(tc4_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tc4_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tc4_state, write_o))
@@ -1086,9 +1348,133 @@ MACHINE_CONFIG_END
/***************************************************************************
+ Conic Electronic Football II
+ * TMS1100 MP1181 (no decap)
+ * 9-digit LED grid, 1-bit sound
+
+ This is a clone of Coleco's Quarterback, similar at hardware-level too.
+ It was also sold by Tandy under the same title.
+
+***************************************************************************/
+
+class cnfball2_state : public hh_tms1k_state
+{
+public:
+ cnfball2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_tms1k_state(mconfig, type, tag)
+ { }
+
+ void prepare_display();
+ DECLARE_WRITE16_MEMBER(write_r);
+ DECLARE_WRITE16_MEMBER(write_o);
+ DECLARE_READ8_MEMBER(read_k);
+};
+
+// handlers
+
+void cnfball2_state::prepare_display()
+{
+ // R1 selects between segments B/C or A'/D'
+ UINT16 seg = m_o;
+ if (~m_r & 2)
+ seg = (m_o << 7 & 0x300) | (m_o & 0xf9);
+
+ set_display_segmask(0x1ff, 0xff);
+ display_matrix(11, 9, seg, m_r >> 1 & 0x1ff);
+}
+
+WRITE16_MEMBER(cnfball2_state::write_r)
+{
+ // R0: speaker out
+ m_speaker->level_w(data & 1);
+
+ // R8-R10: input mux
+ m_inp_mux = data >> 8 & 7;
+
+ // R1-R10: select digit/segment
+ m_r = data;
+ prepare_display();
+}
+
+WRITE16_MEMBER(cnfball2_state::write_o)
+{
+ // O0-O7: digit segments
+ m_o = data;
+ prepare_display();
+}
+
+READ8_MEMBER(cnfball2_state::read_k)
+{
+ // K: multiplexed inputs
+ return read_inputs(3);
+}
+
+
+// config
+
+static INPUT_PORTS_START( cnfball2 )
+ PORT_START("IN.0") // R8
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_CONFNAME( 0x02, 0x00, "Factory Test" )
+ PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
+ PORT_CONFSETTING( 0x02, DEF_STR( On ) )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_TOGGLE PORT_NAME("Play Selector") // pass/run
+ PORT_CONFNAME( 0x08, 0x00, "Skill Level" )
+ PORT_CONFSETTING( 0x00, "1" ) // college
+ PORT_CONFSETTING( 0x08, "2" ) // professional
+
+ PORT_START("IN.1") // R9
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY
+
+ PORT_START("IN.2") // R10
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Kick/Pass")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Score")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Status")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
+INPUT_PORTS_END
+
+
+// output PLA is not decapped
+static const UINT16 cnfball2_output_pla[0x20] =
+{
+ // first half was dumped electronically
+ 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x40, 0x01, 0x08, 0x02, 0x04, 0x00,
+
+ // rest is unknown
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+static MACHINE_CONFIG_START( cnfball2, cnfball2_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", TMS1100, 375000) // approximation - RC osc. R=47K, C=47pf
+ MCFG_TMS1XXX_OUTPUT_PLA(cnfball2_output_pla)
+ MCFG_TMS1XXX_READ_K_CB(READ8(cnfball2_state, read_k))
+ MCFG_TMS1XXX_WRITE_R_CB(WRITE16(cnfball2_state, write_r))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(cnfball2_state, write_o))
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_cnfball2)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
Entex (Electronic) Baseball (1)
* TMS1000NLP MP0914 (die labeled MP0914A)
- * 1 7seg LED, and other LEDs behind bezel, 1bit sound
+ * 1 7seg LED, and other LEDs behind bezel, 1-bit sound
This is a handheld LED baseball game. One player controls the batter, the CPU
or other player controls the pitcher. Pitcher throw buttons are on a 'joypad'
@@ -1201,7 +1587,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( ebball, ebball_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1000, 375000) // RC osc. R=43K, C=47pf -> ~375kHz
+ MCFG_CPU_ADD("maincpu", TMS1000, 375000) // approximation - RC osc. R=43K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(ebball_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ebball_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebball_state, write_o))
@@ -1224,7 +1610,7 @@ MACHINE_CONFIG_END
Entex (Electronic) Baseball 2
* PCBs are labeled: ZENY
* TMS1000 MCU, MP0923 (die labeled MP0923)
- * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound
+ * 3 7seg LEDs, and other LEDs behind bezel, 1-bit sound
The Japanese version was published by Gakken, black casing instead of white.
@@ -1326,7 +1712,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( ebball2, ebball2_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=47K, C=47pf -> ~350kHz
+ MCFG_CPU_ADD("maincpu", TMS1000, 350000) // approximation - RC osc. R=47K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(ebball2_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ebball2_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebball2_state, write_o))
@@ -1350,7 +1736,7 @@ MACHINE_CONFIG_END
* PCBs are labeled: ZENY
* TMS1100NLL 6007 MP1204 (rev. E!) (die labeled MP1204)
* 2*SN75492N LED display driver
- * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound
+ * 4 7seg LEDs, and other LEDs behind bezel, 1-bit sound
This is another improvement over Entex Baseball, where gameplay is a bit more
varied. Like the others, the pitcher controls are on a separate joypad.
@@ -1529,7 +1915,7 @@ MACHINE_CONFIG_END
Entex Space Invader
* TMS1100 MP1211 (die labeled MP1211)
- * 3 7seg LEDs, LED matrix and overlay mask, 1bit sound
+ * 3 7seg LEDs, LED matrix and overlay mask, 1-bit sound
There are two versions of this game: the first release(this one) is on
TMS1100, the second more widespread release runs on a COP400. There are
@@ -1643,7 +2029,7 @@ MACHINE_CONFIG_END
Entex Color Football 4
* TMS1670 6009 MP7551 (die also labeled MP7551)
- * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1bit sound
+ * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1-bit sound
***************************************************************************/
@@ -1738,7 +2124,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( efootb4, efootb4_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1670, 475000) // approximation - RC osc. R=42K, C=47pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1670, 475000) // approximation - RC osc. R=42K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(efootb4_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(efootb4_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(efootb4_state, write_o))
@@ -1760,7 +2146,7 @@ MACHINE_CONFIG_END
Entex (Electronic) Basketball 2
* TMS1100 6010 MP1218 (die also labeled MP1218)
- * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound
+ * 4 7seg LEDs, and other LEDs behind bezel, 1-bit sound
lamp translation table: led zz from game PCB = MAME lampyx:
@@ -1861,7 +2247,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( ebaskb2, ebaskb2_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 360000) // RC osc. R=33K, C=82pf -> ~360kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 360000) // approximation - RC osc. R=33K, C=82pf
MCFG_TMS1XXX_READ_K_CB(READ8(ebaskb2_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ebaskb2_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebaskb2_state, write_o))
@@ -1883,7 +2269,7 @@ MACHINE_CONFIG_END
Entex Raise The Devil
* TMS1100 MP1221 (die labeled MP1221)
- * 4 7seg LEDs(rightmost one unused), and other LEDs behind bezel, 1bit sound
+ * 4 7seg LEDs(rightmost one unused), and other LEDs behind bezel, 1-bit sound
lamp translation table: led zz from game PCB = MAME lampyx:
@@ -2057,8 +2443,8 @@ protected:
void gpoker_state::prepare_display()
{
- memset(m_display_segmask, ~0, sizeof(m_display_segmask));
- display_matrix_seg(12, 11, m_o | (m_r >> 3 & 0xf00), m_r & 0x7ff, 0x7f);
+ set_display_segmask(0x7ff, 0x7f);
+ display_matrix(12, 11, m_o | (m_r >> 3 & 0xf00), m_r & 0x7ff);
}
WRITE16_MEMBER(gpoker_state::write_r)
@@ -2148,7 +2534,7 @@ void gpoker_state::machine_reset()
static MACHINE_CONFIG_START( gpoker, gpoker_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1370, 350000) // RC osc. R=47K, C=47pf -> ~350kHz
+ MCFG_CPU_ADD("maincpu", TMS1370, 350000) // approximation - RC osc. R=47K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(gpoker_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(gpoker_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(gpoker_state, write_o))
@@ -2261,7 +2647,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( gjackpot, gjackpot_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1670, 450000) // approximation - RC osc. R=47K, C=47pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1670, 450000) // approximation - RC osc. R=47K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(gpoker_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(gjackpot_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(gpoker_state, write_o))
@@ -2283,9 +2669,9 @@ MACHINE_CONFIG_END
Ideal Electronic Detective
* TMS0980NLL MP6100A (die labeled 0980B-00)
- * 10-digit 7seg LED display, 1bit sound
+ * 10-digit 7seg LED display, 2-level sound
- hardware (and concept) is very similar to Parker Bros Stop Thief
+ hardware (and concept) is very similar to Parker Brothers Stop Thief
This is an electronic board game. It requires game cards with suspect info,
and good old pen and paper to record game progress. To start the game, enter
@@ -2310,12 +2696,12 @@ public:
WRITE16_MEMBER(elecdet_state::write_r)
{
- // R7,R8: speaker on
- m_speaker->level_w((data & 0x180 && m_o & 0x80) ? 1 : 0);
+ // R7,R8: speaker out
+ m_speaker->level_w((m_o & 0x80) ? (data >> 7 & 3) : 0);
// R0-R6: select digit
- memset(m_display_segmask, ~0, sizeof(m_display_segmask));
- display_matrix_seg(7, 7, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data, 0x7f);
+ set_display_segmask(0x7f, 0x7f);
+ display_matrix(7, 7, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data);
}
WRITE16_MEMBER(elecdet_state::write_o)
@@ -2324,7 +2710,7 @@ WRITE16_MEMBER(elecdet_state::write_o)
m_inp_mux = (data & 3) | (data >> 2 & 4) | (data >> 3 & 8);
// O0-O6: digit segments A-G
- // O7: speaker out -> write_r
+ // O7: speaker on -> write_r
m_o = data;
}
@@ -2384,6 +2770,9 @@ static INPUT_PORTS_START( elecdet )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false)
INPUT_PORTS_END
+
+static const INT16 elecdet_speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff };
+
static MACHINE_CONFIG_START( elecdet, elecdet_state )
/* basic machine hardware */
@@ -2399,6 +2788,7 @@ static MACHINE_CONFIG_START( elecdet, elecdet_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SPEAKER_LEVELS(4, elecdet_speaker_levels)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
@@ -2410,7 +2800,7 @@ MACHINE_CONFIG_END
Kenner Star Wars - Electronic Battle Command
* TMS1100 MCU, labeled MP3438A
- * 4x4 LED grid display + 2 separate LEDs and 2-digit 7segs, 1bit sound
+ * 4x4 LED grid display + 2 separate LEDs and 2-digit 7segs, 1-bit sound
This is a small tabletop space-dogfighting game. To start the game,
press BASIC/INTER/ADV and enter P#(number of players), then
@@ -2514,7 +2904,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( starwbc, starwbc_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 325000) // RC osc. R=51K, C=47pf -> ~325kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 325000) // approximation - RC osc. R=51K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(starwbc_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(starwbc_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(starwbc_state, write_o))
@@ -2560,8 +2950,8 @@ public:
void astro_state::prepare_display()
{
- memset(m_display_segmask, ~0, sizeof(m_display_segmask));
- display_matrix_seg(8, 10, m_o, m_r, 0xff);
+ set_display_segmask(0x3ff, 0xff);
+ display_matrix(8, 10, m_o, m_r);
}
WRITE16_MEMBER(astro_state::write_r)
@@ -2641,7 +3031,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( astro, astro_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1470, 450000) // approximation - RC osc. R=4.7K, C=33pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1470, 450000) // approximation - RC osc. R=4.7K, C=33pf
MCFG_TMS1XXX_READ_K_CB(READ8(astro_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(astro_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(astro_state, write_o))
@@ -2660,7 +3050,7 @@ MACHINE_CONFIG_END
Mattel Dungeons & Dragons - Computer Labyrinth Game
* TMS1100 M34012-N2LL (die labeled M34012)
- * 72 buttons, no LEDs, 1bit sound
+ * 72 buttons, no LEDs, 1-bit sound
This is an electronic board game. It requires markers and wall pieces to play.
Refer to the official manual for more information.
@@ -2705,64 +3095,54 @@ READ8_MEMBER(mdndclab_state::read_k)
// config
-/* physical button layout and labels is like this:
-
- 8 buttons on the left, top-to-bottom: (lower 6 are just for sound-preview)
- [Switch Key] [Next Turn / Level 1/2] [Dragon Flying / Defeat Tune] [Dragon Attacks / Dragon Wakes]
- [Wall / Door] [Illegal Move / Warrior Moves] [Warrior 1 / Winner] [Warrior 2 / Treasure]
-
- 8*8 buttons to the right of that, making the gameboard
-
-*/
-
static INPUT_PORTS_START( mdndclab )
PORT_START("IN.0") // O0
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a1")
PORT_START("IN.1") // O1
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b1")
PORT_START("IN.2") // O2
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c1")
PORT_START("IN.3") // O3
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d1")
PORT_START("IN.4") // O4
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e1")
PORT_START("IN.5") // O5
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f1")
PORT_START("IN.6") // O6
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g1")
PORT_START("IN.7") // O7
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h4")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h3")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h2")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h4")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h2")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h1")
PORT_START("IN.8") // R0
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Wall / Door")
@@ -2771,52 +3151,52 @@ static INPUT_PORTS_START( mdndclab )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Warrior 2 / Treasure")
PORT_START("IN.9") // R1
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid a5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square a5")
PORT_START("IN.10") // R2
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid b5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square b5")
PORT_START("IN.11") // R3
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid c5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square c5")
PORT_START("IN.12") // R4
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid d5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square d5")
PORT_START("IN.13") // R5
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid e5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square e5")
PORT_START("IN.14") // R6
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid f5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square f5")
PORT_START("IN.15") // R7
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid g5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square g5")
PORT_START("IN.16") // R8
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h8")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h7")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h6")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Grid h5")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h8")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h6")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square h5")
PORT_START("IN.17") // R9
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Switch Key")
@@ -2829,12 +3209,13 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( mdndclab, mdndclab_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 500000) // approximation - RC osc. R=27K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1100, 475000) // approximation - RC osc. R=27K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(mdndclab_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mdndclab_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mdndclab_state, write_o))
/* no visual feedback! */
+ MCFG_DEFAULT_LAYOUT(layout_mdndclab) // playing board
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -2954,7 +3335,7 @@ MACHINE_CONFIG_END
Revision A hardware:
* TMS1000 (die labeled MP3226)
- * DS75494 Hex digit LED driver, 4 big lamps, 1bit sound
+ * DS75494 Hex digit LED driver, 4 big lamps, 1-bit sound
Newer revisions (also Pocket Simon) have a smaller 16-pin MB4850 chip
instead of the TMS1000. This one has been decapped too, but we couldn't
@@ -3034,7 +3415,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( simon, simon_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=33K, C=100pf -> ~350kHz
+ MCFG_CPU_ADD("maincpu", TMS1000, 350000) // approximation - RC osc. R=33K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(simon_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(simon_state, write_r))
@@ -3055,7 +3436,7 @@ MACHINE_CONFIG_END
Milton Bradley Super Simon
* TMS1100 MP3476NLL (die labeled MP3476)
- * 8 big lamps(2 turn on at same time), 1bit sound
+ * 8 big lamps(2 turn on at same time), 1-bit sound
The semi-squel to Simon, not as popular. It includes more game variations
and a 2-player head-to-head mode.
@@ -3352,12 +3733,12 @@ void bigtrak_state::machine_start()
save_item(NAME(m_gearbox_pos));
}
-static const INT16 bigtrak_speaker_levels[] = { 0, 32767/3, 32767/3, 32767/3*2, 32767/3, 32767/3*2, 32767/3*2, 32767 };
+static const INT16 bigtrak_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
static MACHINE_CONFIG_START( bigtrak, bigtrak_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1000, 200000) // approximation - RC osc. R=83K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1000, 200000) // approximation - RC osc. R=83K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(bigtrak_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(bigtrak_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(bigtrak_state, write_o))
@@ -3405,18 +3786,10 @@ public:
WRITE16_MEMBER(cnsector_state::write_r)
{
- // R0-R5: select digit (right-to-left)
- for (int y = 0; y < 6; y++)
- {
- m_display_segmask[y] = 0xff;
- m_display_state[y] = (data >> y & 1) ? m_o : 0;
- }
-
- // R6-R9: direction leds (-> lamp60-63)
- m_display_state[6] = data >> 6 & 0xf;
-
- set_display_size(8, 7);
- display_update();
+ // R0-R5: select digit
+ // R6-R9: direction leds
+ set_display_segmask(0x3f, 0xff);
+ display_matrix(8, 10, m_o, data);
}
WRITE16_MEMBER(cnsector_state::write_o)
@@ -3502,7 +3875,7 @@ MACHINE_CONFIG_END
/***************************************************************************
- Parker Bros Merlin handheld game, by Bob Doyle
+ Parker Brothers Merlin handheld game, by Bob Doyle
* TMS1100NLL MP3404A-N2
* 11 LEDs behind buttons, 3-level sound
@@ -3595,12 +3968,12 @@ static INPUT_PORTS_START( merlin )
INPUT_PORTS_END
-static const INT16 merlin_speaker_levels[] = { 0, 32767/3, 32767/3, 32767/3*2, 32767/3, 32767/3*2, 32767/3*2, 32767 };
+static const INT16 merlin_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
static MACHINE_CONFIG_START( merlin, merlin_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K, C=100pf -> ~350kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 350000) // approximation - RC osc. R=33K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(merlin_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(merlin_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(merlin_state, write_o))
@@ -3664,7 +4037,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( mmerlin, mmerlin_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=30K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=30K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(mmerlin_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mmerlin_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mmerlin_state, write_o))
@@ -3687,7 +4060,7 @@ MACHINE_CONFIG_END
Parker Brothers Stop Thief, by Bob Doyle
* TMS0980NLL MP6101B (die labeled 0980B-01A)
- * 3-digit 7seg LED display, 1bit sound
+ * 3-digit 7seg LED display, 6-level sound
Stop Thief is actually a board game, the electronic device emulated here
(called Electronic Crime Scanner) is an accessory. To start a game, press
@@ -3712,18 +4085,14 @@ public:
WRITE16_MEMBER(stopthief_state::write_r)
{
// R0-R2: select digit
- UINT8 o = BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f;
- for (int y = 0; y < 3; y++)
- {
- m_display_segmask[y] = 0x7f;
- m_display_state[y] = (data >> y & 1) ? o : 0;
- }
-
- set_display_size(7, 3);
- display_update();
+ set_display_segmask(7, 0x7f);
+ display_matrix(7, 3, BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f, data & 7);
- // R3-R8: speaker on
- m_speaker->level_w((data & 0x1f8 && m_o & 8) ? 1 : 0);
+ // R3-R8(tied together): speaker out
+ int level = 0;
+ for (int i = 0; m_o & 8 && i < 6; i++)
+ level += (data >> (i+3) & 1);
+ m_speaker->level_w(level);
}
WRITE16_MEMBER(stopthief_state::write_o)
@@ -3731,7 +4100,7 @@ WRITE16_MEMBER(stopthief_state::write_o)
// O0,O6: input mux
m_inp_mux = (data & 1) | (data >> 5 & 2);
- // O3: speaker out
+ // O3: speaker on
// O0-O2,O4-O7: led segments A-G
m_o = data;
}
@@ -3778,6 +4147,9 @@ static INPUT_PORTS_START( stopthief )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false)
INPUT_PORTS_END
+
+static const INT16 stopthief_speaker_levels[7] = { 0, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff };
+
static MACHINE_CONFIG_START( stopthief, stopthief_state )
/* basic machine hardware */
@@ -3793,6 +4165,7 @@ static MACHINE_CONFIG_START( stopthief, stopthief_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SPEAKER_LEVELS(7, stopthief_speaker_levels)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
@@ -3804,7 +4177,7 @@ MACHINE_CONFIG_END
Parker Brothers Bank Shot (known as Cue Ball in the UK), by Garry Kitchen
* TMS1400NLL MP7313-N2 (die labeled MP7313)
- * LED grid display, 1bit sound
+ * LED grid display, 1-bit sound
Bank Shot is an electronic pool game. To select a game, repeatedly press
the [SELECT] button, then press [CUE UP] to start. Refer to the official
@@ -3889,7 +4262,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( bankshot, bankshot_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(bankshot_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(bankshot_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(bankshot_state, write_o))
@@ -3911,7 +4284,7 @@ MACHINE_CONFIG_END
Parker Brothers Split Second
* TMS1400NLL MP7314-N2 (die labeled MP7314)
- * LED grid display(default round LEDs, and rectangular shape ones), 1bit sound
+ * LED grid display(default round LEDs, and rectangular shape ones), 1-bit sound
This is an electronic handheld reflex gaming device, it's straightforward
to use. The included mini-games are:
@@ -4000,7 +4373,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( splitsec, splitsec_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf
MCFG_TMS1XXX_READ_K_CB(READ8(splitsec_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(splitsec_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(splitsec_state, write_o))
@@ -4020,9 +4393,125 @@ MACHINE_CONFIG_END
/***************************************************************************
+ Parker Brothers Lost Treasure - The Electronic Deep-Sea Diving Game,
+ Featuring The Electronic Dive-Control Center
+ * TMS1100 M34038-NLL (die labeled 1100E, M34038)
+ * 11 LEDs, 4-bit sound
+
+ This is a board game. The electronic accessory is the emulated part here.
+
+***************************************************************************/
+
+class lostreas_state : public hh_tms1k_state
+{
+public:
+ lostreas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_tms1k_state(mconfig, type, tag)
+ { }
+
+ DECLARE_WRITE16_MEMBER(write_r);
+ DECLARE_WRITE16_MEMBER(write_o);
+ DECLARE_READ8_MEMBER(read_k);
+};
+
+// handlers
+
+WRITE16_MEMBER(lostreas_state::write_r)
+{
+ // R0-R10: leds
+ display_matrix(11, 1, data, 1);
+}
+
+WRITE16_MEMBER(lostreas_state::write_o)
+{
+ // O0-O3: input mux
+ m_inp_mux = data & 0xf;
+
+ // O4: 330 ohm resistor - speaker out
+ // O5: 220 ohm resistor - speaker out
+ // O6: 180 ohm resistor - speaker out
+ // O7: 68 ohm resistor - speaker out
+ m_speaker->level_w(data >> 4 & 0xf);
+}
+
+READ8_MEMBER(lostreas_state::read_k)
+{
+ // K: multiplexed inputs
+ return read_inputs(4);
+}
+
+
+// config
+
+/* physical button layout and labels is like this:
+ (note: Canadian version differs slightly to accomodoate dual-language)
+
+ [N-S(gold)] [1] [2] [3] [AIR]
+ [E-W(gold)] [4] [5] [6] [UP]
+ [N-S(silv)] [7] [8] [9] [$ VALUE]
+ [E-W(silv)] [CLEAR]
+*/
+
+static INPUT_PORTS_START( lostreas )
+ PORT_START("IN.0") // O0
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
+
+ PORT_START("IN.1") // O1
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8")
+
+ PORT_START("IN.2") // O2
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_U) PORT_NAME("Air/Up")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("$ Value")
+
+ PORT_START("IN.3") // O3
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("E-W (silver)")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("N-S (silver)")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("E-W (gold)")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("N-S (gold)")
+INPUT_PORTS_END
+
+
+static const INT16 lostreas_speaker_levels[16] =
+{
+ 0, 0x7fff/15, 0x7fff/14, 0x7fff/13, 0x7fff/12, 0x7fff/11, 0x7fff/10, 0x7fff/9,
+ 0x7fff/8, 0x7fff/7, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff/1
+};
+
+static MACHINE_CONFIG_START( lostreas, lostreas_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", TMS1100, 425000) // approximation - RC osc. R=39K, C=47pf
+ MCFG_TMS1XXX_READ_K_CB(READ8(lostreas_state, read_k))
+ MCFG_TMS1XXX_WRITE_R_CB(WRITE16(lostreas_state, write_r))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(lostreas_state, write_o))
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_lostreas)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SPEAKER_LEVELS(16, lostreas_speaker_levels)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
Tandy Radio Shack Computerized Arcade (1981, 1982, 1995)
* TMS1100 MCU, labeled CD7282SL
- * 12 lamps behind buttons, 1bit sound
+ * 12 lamps behind buttons, 1-bit sound
This handheld contains 12 minigames. It looks and plays like "Fabulous Fred"
by the Japanese company Mego Corp. in 1980, which in turn is a mix of Merlin
@@ -4143,6 +4632,7 @@ static INPUT_PORTS_START( tandy12 )
INPUT_PORTS_END
+// output PLA is not decapped
static const UINT16 tandy12_output_pla[0x20] =
{
// these are certain
@@ -4158,7 +4648,7 @@ static const UINT16 tandy12_output_pla[0x20] =
static MACHINE_CONFIG_START( tandy12, tandy12_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 400000) // RC osc. R=39K, C=47pf -> ~400kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 400000) // approximation - RC osc. R=39K, C=47pf
MCFG_TMS1XXX_OUTPUT_PLA(tandy12_output_pla)
MCFG_TMS1XXX_READ_K_CB(READ8(tandy12_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tandy12_state, write_r))
@@ -4183,7 +4673,7 @@ MACHINE_CONFIG_END
* PCB label TOMY B.O.
* TMS1040 MP2726 TOMY WIPE (die labeled MP2726A)
* TMS1025N2LL I/O expander
- * 2-digit 7seg display, 46 other leds, 1bit sound
+ * 2-digit 7seg display, 46 other leds, 1-bit sound
known releases:
- USA: Break Up
@@ -4384,7 +4874,7 @@ MACHINE_CONFIG_END
Tomy Power House Pinball
* PCB label TOMY P-B
* TMS1100 MP1180 TOMY PINB (die labeled MP1180)
- * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound
+ * 3 7seg LEDs, and other LEDs behind bezel, 1-bit sound
known releases:
- USA: Power House Pinball
@@ -4427,10 +4917,7 @@ public:
void phpball_state::prepare_display()
{
- // R0-R2 are 7segs
- for (int y = 0; y < 3; y++)
- m_display_segmask[y] = 0x7f;
-
+ set_display_segmask(7, 0x7f);
display_matrix(7, 9, m_o, m_r);
}
@@ -4442,6 +4929,7 @@ WRITE16_MEMBER(phpball_state::write_r)
// R9: input mux
m_inp_mux = data >> 9 & 1;
+ // R0-R2: digit select
// R0-R8: led select
m_r = data;
prepare_display();
@@ -4449,7 +4937,7 @@ WRITE16_MEMBER(phpball_state::write_r)
WRITE16_MEMBER(phpball_state::write_o)
{
- // O0-O6: led state
+ // O0-O6: digit segment/led data
// O7: N/C
m_o = data & 0x7f;
prepare_display();
@@ -4486,7 +4974,7 @@ INPUT_CHANGED_MEMBER(phpball_state::flipper_button)
static MACHINE_CONFIG_START( phpball, phpball_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1100, 375000) // RC osc. R=47K, C=47pf -> ~375kHz
+ MCFG_CPU_ADD("maincpu", TMS1100, 375000) // approximation - RC osc. R=47K, C=47pf
MCFG_TMS1XXX_READ_K_CB(READ8(phpball_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(phpball_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(phpball_state, write_o))
@@ -4515,7 +5003,7 @@ ROM_START( mathmagi )
ROM_LOAD( "mp1030", 0x0000, 0x0800, CRC(a81d7ccb) SHA1(4756ce42f1ea28ce5fe6498312f8306f10370969) )
ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, BAD_DUMP CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) // not verified
+ ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, BAD_DUMP CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) // not verified
ROM_REGION( 365, "maincpu:opla", 0 )
ROM_LOAD( "tms1100_mathmagi_output.pla", 0, 365, NO_DUMP )
ROM_END
@@ -4532,14 +5020,25 @@ ROM_START( amaztron )
ROM_END
-ROM_START( h2hbaseb )
+ROM_START( zodiac )
ROM_REGION( 0x0800, "maincpu", 0 )
- ROM_LOAD( "mp1525", 0x0000, 0x0800, CRC(b5d6bf9b) SHA1(2cc9f35f077c1209c46d16ec853af87e4725c2fd) )
+ ROM_LOAD( "mp3435", 0x0000, 0x0800, CRC(ecdc3160) SHA1(a7e82d66314a039fcffeddf99919d9f9ad42d61d) )
ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
+ ROM_LOAD( "tms1100_common3_micro.pla", 0, 867, BAD_DUMP CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) ) // not verified
ROM_REGION( 365, "maincpu:opla", 0 )
- ROM_LOAD( "tms1100_h2hbaseb_output.pla", 0, 365, CRC(cb3d7e38) SHA1(6ab4a7c52e6010b7c7158463cb499973e52ff556) )
+ ROM_LOAD( "tms1100_zodiac_output.pla", 0, 365, NO_DUMP )
+ROM_END
+
+
+ROM_START( cqback )
+ ROM_REGION( 0x0800, "maincpu", 0 )
+ ROM_LOAD( "mp3415.u4", 0x0000, 0x0800, CRC(65ebdabf) SHA1(9b5cf5adaf9132ced87f611ae8c3148b9b62ba89) )
+
+ ROM_REGION( 867, "maincpu:mpla", 0 )
+ ROM_LOAD( "tms1100_common3_micro.pla", 0, 867, CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) )
+ ROM_REGION( 365, "maincpu:opla", 0 )
+ ROM_LOAD( "tms1100_cqback_output.pla", 0, 365, CRC(c6dcbfd0) SHA1(593b6b7de981a28d1b4a33336b39df92d02ed4f4) )
ROM_END
@@ -4554,6 +5053,17 @@ ROM_START( h2hfootb )
ROM_END
+ROM_START( h2hbaseb )
+ ROM_REGION( 0x0800, "maincpu", 0 )
+ ROM_LOAD( "mp1525", 0x0000, 0x0800, CRC(b5d6bf9b) SHA1(2cc9f35f077c1209c46d16ec853af87e4725c2fd) )
+
+ ROM_REGION( 867, "maincpu:mpla", 0 )
+ ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
+ ROM_REGION( 365, "maincpu:opla", 0 )
+ ROM_LOAD( "tms1100_h2hbaseb_output.pla", 0, 365, CRC(cb3d7e38) SHA1(6ab4a7c52e6010b7c7158463cb499973e52ff556) )
+ROM_END
+
+
ROM_START( tc4 )
ROM_REGION( 0x1000, "maincpu", 0 )
ROM_LOAD( "mp7334", 0x0000, 0x1000, CRC(923f3821) SHA1(a9ae342d7ff8dae1dedcd1e4984bcfae68586581) )
@@ -4565,6 +5075,17 @@ ROM_START( tc4 )
ROM_END
+ROM_START( cnfball2 )
+ ROM_REGION( 0x0800, "maincpu", 0 )
+ ROM_LOAD( "mp1181", 0x0000, 0x0800, CRC(4553a840) SHA1(2e1132c9bc51641f77ba7f2430b5a3b2766b3a3d) )
+
+ ROM_REGION( 867, "maincpu:mpla", 0 )
+ ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, BAD_DUMP CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) // not verified
+ ROM_REGION( 365, "maincpu:opla", 0 )
+ ROM_LOAD( "tms1100_cnfball2_output.pla", 0, 365, NO_DUMP )
+ROM_END
+
+
ROM_START( ebball )
ROM_REGION( 0x0400, "maincpu", 0 )
ROM_LOAD( "mp0914", 0x0000, 0x0400, CRC(3c6fb05b) SHA1(b2fe4b3ca72d6b4c9bfa84d67f64afdc215e7178) )
@@ -4858,6 +5379,17 @@ ROM_START( splitsec )
ROM_END
+ROM_START( lostreas )
+ ROM_REGION( 0x0800, "maincpu", 0 )
+ ROM_LOAD( "m34038", 0x0000, 0x0800, CRC(4c996f63) SHA1(ebbaa8b2f909f4300887aa2dbdb7185eedc75d3f) )
+
+ ROM_REGION( 867, "maincpu:mpla", 0 )
+ ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
+ ROM_REGION( 365, "maincpu:opla", 0 )
+ ROM_LOAD( "tms1100_lostreas_output.pla", 0, 365, CRC(c62d850f) SHA1(d25974e6901eb10c52cdda12e6d4a13e26745e6f) )
+ROM_END
+
+
ROM_START( tandy12 )
ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD( "cd7282sl", 0x0000, 0x0800, CRC(a10013dd) SHA1(42ebd3de3449f371b99937f9df39c240d15ac686) )
@@ -4895,11 +5427,15 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
-CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", MACHINE_SUPPORTS_SAVE )
-CONS( 1980, h2hbaseb, 0, 0, h2hbaseb, h2hbaseb, driver_device, 0, "Coleco", "Head to Head Baseball", MACHINE_SUPPORTS_SAVE )
+CONS( 1978, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // ***
+COMP( 1979, zodiac, 0, 0, zodiac, zodiac, driver_device, 0, "Coleco", "Zodiac - The Astrology Computer", MACHINE_SUPPORTS_SAVE )
+CONS( 1978, cqback, 0, 0, cqback, cqback, driver_device, 0, "Coleco", "Electronic Quarterback", MACHINE_SUPPORTS_SAVE )
CONS( 1980, h2hfootb, 0, 0, h2hfootb, h2hfootb, driver_device, 0, "Coleco", "Head to Head Football", MACHINE_SUPPORTS_SAVE )
+CONS( 1980, h2hbaseb, 0, 0, h2hbaseb, h2hbaseb, driver_device, 0, "Coleco", "Head to Head Baseball", MACHINE_SUPPORTS_SAVE )
CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", MACHINE_SUPPORTS_SAVE )
+CONS( 1979, cnfball2, 0, 0, cnfball2, cnfball2, driver_device, 0, "Conic", "Electronic Football II (Conic)", MACHINE_SUPPORTS_SAVE )
+
CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Electronic Baseball (Entex)", MACHINE_SUPPORTS_SAVE )
CONS( 1979, ebball2, 0, 0, ebball2, ebball2, driver_device, 0, "Entex", "Electronic Baseball 2 (Entex)", MACHINE_SUPPORTS_SAVE )
CONS( 1980, ebball3, 0, 0, ebball3, ebball3, driver_device, 0, "Entex", "Electronic Baseball 3 (Entex)", MACHINE_SUPPORTS_SAVE )
@@ -4918,7 +5454,7 @@ CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Ken
COMP( 1979, astro, 0, 0, astro, astro, driver_device, 0, "Kosmos", "Astro", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
-CONS( 1980, mdndclab, 0, 0, mdndclab, mdndclab, driver_device, 0, "Mattel", "Dungeons & Dragons - Computer Labyrinth Game", MACHINE_SUPPORTS_SAVE ) // ***
+CONS( 1980, mdndclab, 0, 0, mdndclab, mdndclab, driver_device, 0, "Mattel", "Dungeons & Dragons - Computer Labyrinth Game", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // ***
CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
@@ -4932,6 +5468,7 @@ CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Par
CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", MACHINE_SUPPORTS_SAVE )
CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", MACHINE_SUPPORTS_SAVE )
CONS( 1982, mmerlin, 0, 0, mmerlin, mmerlin, driver_device, 0, "Parker Brothers", "Master Merlin", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+CONS( 1982, lostreas, 0, 0, lostreas, lostreas, driver_device, 0, "Parker Brothers", "Lost Treasure - The Electronic Deep-Sea Diving Game (Electronic Dive-Control Center)", MACHINE_SUPPORTS_SAVE ) // ***
CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // some of the minigames: ***
diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp
index b410de7cf55..9eaf283d33f 100644
--- a/src/mame/drivers/hh_ucom4.cpp
+++ b/src/mame/drivers/hh_ucom4.cpp
@@ -188,7 +188,7 @@ void hh_ucom4_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
+void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update)
{
set_display_size(maxx, maxy);
@@ -197,10 +197,13 @@ void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
- display_update();
+ if (update)
+ display_update();
}
+// generic input handlers
+
UINT8 hh_ucom4_state::read_inputs(int columns)
{
UINT8 ret = 0;
diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp
index 2936cae3228..7f83f001fe3 100644
--- a/src/mame/drivers/hp9845.cpp
+++ b/src/mame/drivers/hp9845.cpp
@@ -16,12 +16,12 @@
// - LPU & PPU ROMs
// - LPU & PPU RAMs
// - Text mode screen
-// - Keyboard (most of keys)
+// - Keyboard
+// - T15 tape drive
// What's not yet in:
// - Beeper
-// - Rest of keyboard
// - Graphic screen
-// - Tape drive (this needs some heavy RE of the TACO chip)
+// - Better naming of tape drive image (it's now "magt", should be "t15")
// - Better documentation of this file
// - Software list to load optional ROMs
// What's wrong:
@@ -33,6 +33,7 @@
#include "cpu/z80/z80.h"
#include "softlist.h"
#include "cpu/hphybrid/hphybrid.h"
+#include "machine/hp_taco.h"
#define BIT_MASK(n) (1U << (n))
@@ -77,7 +78,8 @@ public:
m_io_key0(*this , "KEY0"),
m_io_key1(*this , "KEY1"),
m_io_key2(*this , "KEY2"),
- m_io_key3(*this , "KEY3")
+ m_io_key3(*this , "KEY3"),
+ m_t15(*this , "t15")
{ }
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -90,7 +92,7 @@ public:
void vblank_w(screen_device &screen, bool state);
IRQ_CALLBACK_MEMBER(irq_callback);
- void update_irl(void);
+ void update_irq(void);
TIMER_DEVICE_CALLBACK_MEMBER(kb_scan);
DECLARE_READ16_MEMBER(kb_scancode_r);
@@ -99,6 +101,10 @@ public:
DECLARE_WRITE8_MEMBER(pa_w);
+ DECLARE_WRITE_LINE_MEMBER(t15_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(t15_flg_w);
+ DECLARE_WRITE_LINE_MEMBER(t15_sts_w);
+
private:
required_device<hp_5061_3001_cpu_device> m_lpu;
required_device<hp_5061_3001_cpu_device> m_ppu;
@@ -107,6 +113,7 @@ private:
required_ioport m_io_key1;
required_ioport m_io_key2;
required_ioport m_io_key3;
+ required_device<hp_taco_device> m_t15;
void set_video_mar(UINT16 mar);
void video_fill_buff(bool buff_idx);
@@ -136,12 +143,15 @@ private:
// Interrupt handling
UINT8 m_irl_pending;
+ UINT8 m_irh_pending;
// State of keyboard
ioport_value m_kb_state[ 4 ];
UINT8 m_kb_scancode;
UINT16 m_kb_status;
+ // State of PPU I/O
+ UINT8 m_ppu_pa;
};
static INPUT_PORTS_START(hp9845b)
@@ -322,10 +332,13 @@ void hp9845b_state::machine_reset()
m_video_frame = 0;
m_irl_pending = 0;
+ m_irh_pending = 0;
memset(&m_kb_state[ 0 ] , 0 , sizeof(m_kb_state));
m_kb_scancode = 0x7f;
m_kb_status = 0;
+
+ m_ppu_pa = 0;
}
void hp9845b_state::set_video_mar(UINT16 mar)
@@ -479,13 +492,14 @@ IRQ_CALLBACK_MEMBER(hp9845b_state::irq_callback)
if (irqline == HPHYBRID_IRL) {
return m_irl_pending;
} else {
- return 0;
+ return m_irh_pending;
}
}
-void hp9845b_state::update_irl(void)
+void hp9845b_state::update_irq(void)
{
m_ppu->set_input_line(HPHYBRID_IRL , m_irl_pending != 0);
+ m_ppu->set_input_line(HPHYBRID_IRH , m_irh_pending != 0);
}
TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::kb_scan)
@@ -546,7 +560,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::kb_scan)
m_kb_scancode = i;
BIT_SET(m_irl_pending , 0);
BIT_SET(m_kb_status, 0);
- update_irl();
+ update_irq();
// Special case: pressing stop key sets LPU "status" flag
if (i == 0x47) {
@@ -572,24 +586,50 @@ WRITE16_MEMBER(hp9845b_state::kb_irq_clear_w)
{
BIT_CLR(m_irl_pending , 0);
BIT_CLR(m_kb_status, 0);
- update_irl();
+ update_irq();
m_lpu->status_w(0);
// TODO: beeper start
}
WRITE8_MEMBER(hp9845b_state::pa_w)
{
+ m_ppu_pa = data;
+
// TODO: handle sts & flg
- if (data == 0xf) {
- // RHS tape drive (T15)
- m_ppu->status_w(1);
- m_ppu->flag_w(1);
+ if (data == 15) {
+ // RHS tape drive (T15)
+ m_ppu->status_w(m_t15->sts_r());
+ m_ppu->flag_w(m_t15->flg_r());
} else {
m_ppu->status_w(0);
m_ppu->flag_w(0);
}
}
+WRITE_LINE_MEMBER(hp9845b_state::t15_irq_w)
+{
+ if (state) {
+ BIT_SET(m_irh_pending , 7);
+ } else {
+ BIT_CLR(m_irh_pending , 7);
+ }
+ update_irq();
+}
+
+WRITE_LINE_MEMBER(hp9845b_state::t15_flg_w)
+{
+ if (m_ppu_pa == 15) {
+ m_ppu->flag_w(state);
+ }
+}
+
+WRITE_LINE_MEMBER(hp9845b_state::t15_sts_w)
+{
+ if (m_ppu_pa == 15) {
+ m_ppu->status_w(state);
+ }
+}
+
static MACHINE_CONFIG_START( hp9845a, hp9845_state )
//MCFG_CPU_ADD("lpu", HP_5061_3010, XTAL_11_4MHz)
//MCFG_CPU_ADD("ppu", HP_5061_3011, XTAL_11_4MHz)
@@ -638,6 +678,9 @@ static ADDRESS_MAP_START(ppu_io_map , AS_IO , 16 , hp9845b_state)
// PA = 0, IC = 3
// Keyboard status input & keyboard interrupt clear
AM_RANGE(HP_MAKE_IOADDR(0 , 3) , HP_MAKE_IOADDR(0 , 3)) AM_READWRITE(kb_status_r , kb_irq_clear_w)
+ // PA = 15, IC = 0..3
+ // Right-hand side tape drive (T15)
+ AM_RANGE(HP_MAKE_IOADDR(15 , 0) , HP_MAKE_IOADDR(15 , 3)) AM_DEVREADWRITE("t15" , hp_taco_device , reg_r , reg_w)
ADDRESS_MAP_END
static MACHINE_CONFIG_START( hp9845b, hp9845b_state )
@@ -663,6 +706,12 @@ static MACHINE_CONFIG_START( hp9845b, hp9845b_state )
// Actual keyboard refresh rate should be KEY_SCAN_OSCILLATOR / 128 (2560 Hz)
MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp9845b_state , kb_scan , attotime::from_hz(100))
+ // Tape controller
+ MCFG_DEVICE_ADD("t15" , HP_TACO , 4000000)
+ MCFG_TACO_IRQ_HANDLER(WRITELINE(hp9845b_state , t15_irq_w))
+ MCFG_TACO_FLG_HANDLER(WRITELINE(hp9845b_state , t15_flg_w))
+ MCFG_TACO_STS_HANDLER(WRITELINE(hp9845b_state , t15_sts_w))
+
MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9845b_rom")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/k28.cpp b/src/mame/drivers/k28.cpp
index 71c6b2389f4..0dddfd432c8 100644
--- a/src/mame/drivers/k28.cpp
+++ b/src/mame/drivers/k28.cpp
@@ -63,8 +63,8 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
+ void set_display_segmask(UINT32 digits, UINT32 mask);
void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
- void display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask);
bool m_power_on;
UINT8 m_inp_mux;
@@ -101,7 +101,7 @@ void k28_state::machine_start()
memset(m_display_state, 0, sizeof(m_display_state));
memset(m_display_cache, ~0, sizeof(m_display_cache));
memset(m_display_decay, 0, sizeof(m_display_decay));
- memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // !
+ memset(m_display_segmask, 0, sizeof(m_display_segmask));
m_power_on = false;
m_inp_mux = 0;
@@ -237,6 +237,17 @@ void k28_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
+void k28_state::set_display_segmask(UINT32 digits, UINT32 mask)
+{
+ // set a segment mask per selected digit, but leave unselected ones alone
+ for (int i = 0; i < 0x20; i++)
+ {
+ if (digits & 1)
+ m_display_segmask[i] = mask;
+ digits >>= 1;
+ }
+}
+
void k28_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
{
set_display_size(maxx, maxy);
@@ -249,15 +260,6 @@ void k28_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
display_update();
}
-void k28_state::display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask)
-{
- // expects m_display_segmask to be not-0
- for (int y = 0; y < maxy; y++)
- m_display_segmask[y] &= segmask;
-
- display_matrix(maxx, maxy, setx, sety);
-}
-
/***************************************************************************
@@ -356,7 +358,8 @@ WRITE8_MEMBER(k28_state::mcu_prog_w)
// output 16-24: digit select
UINT16 digit_sel = (UINT16)(m_vfd_shiftreg >> 10) & 0x1ff;
- display_matrix_seg(16, 9, seg_data, digit_sel, 0x3fff);
+ set_display_segmask(0x1ff, 0x3fff);
+ display_matrix(16, 9, seg_data, digit_sel);
// output 25: power-off request on falling edge
if (~m_vfd_shiftreg & m_vfd_shiftreg_out & 0x200)
diff --git a/src/mame/drivers/kurukuru.cpp b/src/mame/drivers/kurukuru.cpp
index edb288cb4e1..1bbce2e5bb4 100644
--- a/src/mame/drivers/kurukuru.cpp
+++ b/src/mame/drivers/kurukuru.cpp
@@ -1,10 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Roberto Fresca, hap
-/******************************************************************************
+/***********************************************************************************
KURU KURU PYON PYON
- Taiyo Jidoki / Success
-
+ Success / Taiyo Jidoki
Driver by Roberto Fresca & hap.
@@ -16,7 +15,7 @@
ports, descriptions and a lot of things... :)
-*******************************************************************************
+************************************************************************************
Technical Notes....
@@ -114,12 +113,16 @@
AB = NEC C1663C 8926B.
-*******************************************************************************
+************************************************************************************
General Notes....
- The game name could be translated as "Croak Croak Hop Hop"
- Kuru is the frog sound, and Pyon is the sound of jumps.
+ There are at least 4 games in the Pyon Pyon series...
+
+ 1) Pyon Pyon (a marathon game with froggy characters).
+ 2) Kuru Kuru Pyon Pyon (a kind of slots game with the same froggy characters).
+ 3) Pyon Pyon Jyanpu (a contents where the same characters try to cross the river jumping on pads).
+ 4) Sui Sui Pyon Pyon (a swimming competition where the same characters swim with different styles, even walking).
Coin 1 (key 5) could be set either as Coin 1 or as Payout button, through
a DIP switch.
@@ -129,12 +132,19 @@
will be cleared).
-*******************************************************************************
+************************************************************************************
- * How to play...
+ Games Notes:
+ ------------
- Insert tokens (medals)...
+ * Kuru Kuru Pyon Pyon:
+ The game name could be translated as "Croak Croak Hop Hop"
+ Kuru is the frog sound, and Pyon is the sound of jumps.
+
+ How to play...
+
+ Insert tokens (medals).
You can bet to any (or all) of the following 5 characters: Bote, Oume, Pyoko,
Kunio, and Pyon Pyon. Press start, and the reels start to roll. You'll win if
you can get 3 of the choosen character(s) in a row, column or diagonal.
@@ -146,8 +156,7 @@
Red tadpoles are a bonus. Once you get one, it will go to the right panel,
revealing a number. This number represents the extra credits you won.
-
- * Bookkeeping...
+ Bookkeeping...
Pressing Bookkeeping key (key 9), you enter the Bookkeeping Mode. There are
2 screens with all the game information like DIP switches and statistics...
@@ -168,30 +177,73 @@
Pressing the Bookkeeping key once more, you exit the mode and go back to the game.
+ ----------------------------------------------------------------------------------
+
+ * Pyon Pyon Jyanpu:
+
+ The game name could be translated as "Hop Hop Jump"
+ Pyon is the sound of jumps. Jyanpu means jump.
-*******************************************************************************
+ How to play...
+
+ Insert tokens (medals).
+ You can bet to any (or all) of the following 5 characters: Boketa, Kunio, Pyon-Pyon,
+ Pyokorin and Botechin. Press start, and the river's pads start to roll. You'll win
+ if your character gets the three pads to jump to the other side of the river.
+
+ There is also a bonus game with a black tadpole rounding some pads with extra credits.
+ you'll get the extra credits marked in the pad where the tadpole stopped.
+
+ Bookkeeping...
+
+ Pressing Bookkeeping key (key 9), you enter the Bookkeeping Mode. There are
+ 2 screens with all the game information like DIP switches and statistics...
+
+ 1st screen...
+
+ - [Left panel]: All the DIP switches parameters.
+
+ - [Right panel]: Bet and Win totals, 100Y/10Y/medal IN/OUT, total of games,
+ won, loss, won by paid range, and 'omake' (extra/bonus).
+
+ 2nd screen (press Bookkeeping key again)...
+
+ - Win distribution by character
+ (Boketa, Kunio, Pyon-Pyon, Pyokorin and Botechin).
+
+ - Bet distribution (1, 2, 3, 4, 5~10)
+
+ - Omake (bonus) distribution (games total, win games, loss games)
+
+ Pressing the Bookkeeping key once more, you exit the mode and go back to the game.
+
+
+************************************************************************************
ADPCM Samples....
- There are 14 samples in the system.
+ There are 14 samples in Kuru Kuru Pyon Pyon.
- 00: "Boterin"
+ 00: "Botechin"
01:
- 02: "Hakase" ("professor")
+ 02: "Hakase" (professor)
03: "Pyokorin"
04: "Kunio"
- 05: "Pyon Pyon"
- 06:
+ 05: "Pyon-Pyon"
+ 06: "Boketa"
07:
08: "Oume"
- 09: "Haipaa" ("hyper")
- 10: "Ichi ni tsuite" ("on your marks")
- 11: "Youi" ("get ready")
- 12: Bang sound for the tadpoles landing in the right panel.
+ 09: "Haipaa" (hyper)
+ 10: "Ichi ni tsuite" (on your marks)
+ 11: "Youi" (get ready)
+ 12: "Bang" (sound for the tadpoles landing in the right panel).
13: Sound effect for reels when running.
+ The fact that there are samples for "on your marks", "get ready", and "bang",
+ make me think that these sounds could be shared with the other unemulated marathon
+ game of the series called just "Pyon Pyon".
-******************************************************************************/
+***********************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
@@ -491,11 +543,11 @@ static INPUT_PORTS_START( kurukuru )
/* bits d0-d3 are JAMMA top side pins 20,21,22,23, bits d4-d7 are JAMMA bottom side pins 20,21,22,23
so that's player 1 left/right/button1/button2 then player 2 left/right/button1/button2
*/
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("1st (Bote)")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("1st (Bote/Botechin)")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("2nd (Oume)")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("3rd (Pyoko)")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("3rd (Pyoko/Pyokorin)")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_V) PORT_NAME("4th (Kunio)")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("5th (Pyon Pyon)")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("5th (Pyon-Pyon)")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("Unknown A0h - bit5")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("Unknown A0h - bit6")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
@@ -729,13 +781,12 @@ static MACHINE_CONFIG_START( ppj, kurukuru_state )
MACHINE_CONFIG_END
-/***************************************************************************
-
- Game driver(s)
-
-***************************************************************************/
+/*************************************************
+* ROMs Loading *
+*************************************************/
/* Kuru Kuru Pyon Pyon.
+ 1990, Success / Taiyo Jidoki.
*/
ROM_START( kurukuru )
ROM_REGION( 0x08000, "maincpu", 0 )
@@ -757,8 +808,9 @@ ROM_START( kurukuru )
ROM_LOAD( "7908b-4.ic32", 0x0600, 0x0034, CRC(bddf925e) SHA1(861cf5966444d0c0392241e5cfa08db475fb439a) )
ROM_END
-/* Pyon Pyon Jump.
+/* Pyon Pyon Jyanpu.
Ver 1.40.
+ 199?, Success / Taiyo Jidoki.
*/
ROM_START( ppj )
ROM_REGION( 0x08000, "maincpu", 0 )
@@ -781,6 +833,15 @@ ROM_START( ppj )
ROM_END
-/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */
-GAME( 199?, kurukuru, 0, kurukuru, kurukuru, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Kuru Kuru Pyon Pyon (Japan)", 0 )
-GAME( 199?, ppj, 0, ppj, ppj, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Pyon Pyon Jump (V1.40, Japan)", 0 )
+/***************************************************************************
+* Game Drivers *
+***************************************************************************/
+
+/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */
+GAME( 1990, kurukuru, 0, kurukuru, kurukuru, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Kuru Kuru Pyon Pyon (Japan)", 0 )
+GAME( 199?, ppj, 0, ppj, ppj, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Pyon Pyon Jyanpu (V1.40, Japan)", 0 )
+
+// unemulated....
+
+// 199?, Success / Taiyo Jidoki, Pyon Pyon
+// 1990, Success / Taiyo Jidoki, Sui Sui Pyon Pyon
diff --git a/src/mame/drivers/m5.cpp b/src/mame/drivers/m5.cpp
index 6c48e8786d0..08ae31888d9 100644
--- a/src/mame/drivers/m5.cpp
+++ b/src/mame/drivers/m5.cpp
@@ -2,12 +2,12 @@
// copyright-holders:Curt Coder, Ales Dlabac
/***************************************************************************
- Sord m.5
+ Sord m.5
- http://www.retropc.net/mm/m5/
- http://www.museo8bits.es/wiki/index.php/Sord_M5 not working
- http://k5.web.klfree.net/content/view/10/11/ not working
- http://k5.web.klfree.net/images/stories/sord/m5heap.htm not working
+ http://www.retropc.net/mm/m5/
+ http://www.museo8bits.es/wiki/index.php/Sord_M5 not working
+ http://k5.web.klfree.net/content/view/10/11/ not working
+ http://k5.web.klfree.net/images/stories/sord/m5heap.htm not working
http://k5.klfree.net/index.php?option=com_content&task=view&id=5&Itemid=3
http://k5.klfree.net/index.php?option=com_content&task=view&id=10&Itemid=11
http://k5.klfree.net/index.php?option=com_content&task=view&id=14&Itemid=3
@@ -19,21 +19,32 @@
/***************************************************************************
- TODO:
+TODO:
- - fd5 floppy
- - SI-5 serial interface (8251, ROM)
- - ramdisk for KRX Memory expansion
- - add to brno mod support for lzr floppy disc format
- - move dipswitch declaration to sofwarelist file?
- - in brno mod include basic-i
+ - fd5 floppy
+ - SI-5 serial interface (8251, ROM)
+ - ramdisk for KRX Memory expansion
+ - rewrite fd5 floppy as unpluggable device
+ - move dipswitch declaration to softwarelist file?
- 64krx: get windows ROM version with cpm & ramdisk support (Stuchlik S.E.I. version)
+ - brno mod: make the dsk image writeable
+ - brno mod: in console version lost data on RAMDISK after soft reset
+ - brno mod: add support for lzr floppy disc format
+ - brno mod: include basic-i
- CHANGELOG:
-5.2.2016
+CHANGELOG:
+
+10.02.2016
+ - fixed bug: crash if rom card was only cart
+ - fixed bug: when em-5 selected monitor rom wasn't paged in
+ - brno mod: spin motor on upon restart
+ - brno mod: windowed boot as default rom
+ - brno mod: fixed bug: tape command in menu now works
+
+05.02.2016
- added BRNO modification - 1024kB Ramdisk + CP/M support
- 32/64KB RAM expansions EM-5, 64KBI, 64KBF, 64KRX
- since now own version of rom and slot handlers
@@ -144,7 +155,7 @@ M5 |\\\\\\\|\\\\\\\|\\\\\\\|\\\|XXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|
+-------+-------+-------+---+---+-------+-------+-------+-------+
M6 |\\\\\\\|\\\\\\\|\\\\\\\|\\\|XXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|
+-------+-------+-------+---+---+-------+-------+-------+-------+
- |///////|///////|///|
+ |///////|///////|///|
+-------+-------+---+
+-------+-------------------+
@@ -209,19 +220,19 @@ using OUT (7FH),A, where each bit of A means 8KB memory chunk ( state: 0=RAM,
*************************************************************
* BRNO MOD *
*************************************************************
-HW and SW was originaly created by Pavel Brychta with help of Jiri Kubin and L. Novak
+HW and SW was originally created by Pavel Brychta with help of Jiri Kubin and L. Novak
This driver mod was implemented by Ales Dlabac with great help of Pavel Brychta. Without him this would never happen
This mod exists in two versions. First one is "windows"(brno_rom12.rom) version and was created by Ladislav Novak.
-Second version vesion is "pure text" and was created by Pavel Brychta and Jiri Kubin
+Second version version is "pure text" and was created by Pavel Brychta and Jiri Kubin
Function:
Whole Sord's address area (0000-FFFF) is divided to 16 4kB banks. To this 16 banks
you can map any of possible 256 ramdisc blocks what allows user to have 1024kB large ramdisc.
-Ofcourse to be able to realise this is necessary page out all roms
+Of course to be able to realise this is necessary page out all roms
As pagination port MMU(page select) is used.
For RAM write protection port CASEN is used. 0=access to ramdisk enabled, 0xff=ramdisk access disabled(data protection), &80=ROM2+48k RAM, &81=ROM2+4k RAM(this is not implemented)
-For ROM detaching port RAMEN is used. 0=rom enable; 0xff=rom+sord ram disabled (ramdisk visible)
+For ROM page out port RAMEN is used. 0=rom enable; 0xff=rom+sord ram disabled (ramdisk visible)
SORD M5 RAM memory map in address area 7000H-7FFFH
7000H 7300H 7800H 7E00H 7FFFH
@@ -234,10 +245,11 @@ d. Reserved for memory tests and ramdisk mapping(pagination). After boot is used
type of floppy and so on. Area consists of:
7FFFH .... bootloader version
-7FFEH .... identification byte of floppy - is transfered from EPROM, it might be changed by SETUP
-7FFDH .... namber of last Ramdisk segment of RAM
+7FFEH .... identification byte of floppy - is transferred from EPROM, it might be changed by SETUP
+7FFDH .... number of last Ramdisk segment of RAM
7FFBH .... address of cursor in VRAM in 40 columns CRT. For 80 columns CRT both bytes are zero
7FF9H .... X,Y cursor actual position for 40 columns CRTs. In case of 80 columns CRT both bytes are zero
+7203H .... Actual memory bank buffer
System floppy disk header on track 00 of 1st sector
byte 0-1 ... system disk identification SY
@@ -249,8 +261,7 @@ System floppy disk header on track 00 of 1st sector
In case of HOOK, bytes 8 and 9 contains characters 'H' and 'O' for HOOK testing
Few other notes:
- Ramdisc warm boot is provided by pressing Ctrl+C
- Against real HW/SW is possible to store ramdisc dump to file by pressing Ctrl+S which could be loaded back in as snapshot
+ Ramdisc warm boot is provided by pressing Ctrl+C
Floppy formats as follows:
@@ -513,8 +524,8 @@ WRITE8_MEMBER( m5_state::mem64KBI_w ) //out 0x6c
//if AUTOSTART is on don't load any ROM cart
if (m_cart && (m_DIPS->read() & 2) != 2)
{
- program.install_read_handler(0x2000, 0x6fff, read8_delegate(FUNC(m5_cart_slot_device::read_rom), (m5_cart_slot_device*)m_cart)); //m_cart pointer to rom cart
- program.unmap_write(0x2000, 0x3fff);
+ program.install_read_handler(0x2000, 0x6fff, read8_delegate(FUNC(m5_cart_slot_device::read_rom), (m5_cart_slot_device*)m_cart)); //m_cart pointer to rom cart
+ program.unmap_write(0x2000, 0x3fff);
}
else
program.unmap_readwrite(0x2000, 0x3fff);
@@ -545,13 +556,13 @@ WRITE8_MEMBER( m5_state::mem64KBF_w ) //out 0x30
switch(m_ram_mode)
{
case 0:
- program.unmap_write(0x0000, 0x6fff);
- membank("bank1r")->set_base(memregion(Z80_TAG)->base());
+ program.unmap_write(0x0000, 0x6fff);
+ membank("bank1r")->set_base(memregion(Z80_TAG)->base());
membank("bank2r")->set_base(m_cart_rom->base());
- membank("bank3r")->set_base(m_cart_rom->base()+0x2000);
- membank("bank4r")->set_base(m_cart_rom->base()+0x4000);
- membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
- membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
+ membank("bank3r")->set_base(m_cart_rom->base()+0x2000);
+ membank("bank4r")->set_base(m_cart_rom->base()+0x4000);
+ membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
+ membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 1:
program.install_write_bank(0x0000,0x1fff,"bank1w");
@@ -560,10 +571,10 @@ WRITE8_MEMBER( m5_state::mem64KBF_w ) //out 0x30
program.install_write_bank(0x6000,0x6fff,"bank4w");
membank("bank1r")->set_base(ram_region->base()+0x0000); membank("bank1w")->set_base(ram_region->base()+0x0000);
membank("bank2r")->set_base(ram_region->base()+0x2000); membank("bank2w")->set_base(ram_region->base()+0x2000);
- membank("bank3r")->set_base(ram_region->base()+0x4000); membank("bank3w")->set_base(ram_region->base()+0x4000);
- membank("bank4r")->set_base(ram_region->base()+0x6000); membank("bank4w")->set_base(ram_region->base()+0x6000);
- membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
- membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
+ membank("bank3r")->set_base(ram_region->base()+0x4000); membank("bank3w")->set_base(ram_region->base()+0x4000);
+ membank("bank4r")->set_base(ram_region->base()+0x6000); membank("bank4w")->set_base(ram_region->base()+0x6000);
+ membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
+ membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 2:
program.install_write_bank(0x0000,0x1fff,"bank1w");
@@ -572,19 +583,19 @@ WRITE8_MEMBER( m5_state::mem64KBF_w ) //out 0x30
program.install_write_bank(0x6000,0x6fff,"bank4w");
membank("bank1r")->set_base(memregion(Z80_TAG)->base()); membank("bank1w")->set_base(ram_region->base()+0x0000);
membank("bank2r")->set_base(ram_region->base()+0x2000); membank("bank2w")->set_base(ram_region->base()+0x2000);
- membank("bank3r")->set_base(ram_region->base()+0x4000); membank("bank3w")->set_base(ram_region->base()+0x4000);
- membank("bank4r")->set_base(ram_region->base()+0x6000); membank("bank4w")->set_base(ram_region->base()+0x6000);
- membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
- membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
+ membank("bank3r")->set_base(ram_region->base()+0x4000); membank("bank3w")->set_base(ram_region->base()+0x4000);
+ membank("bank4r")->set_base(ram_region->base()+0x6000); membank("bank4w")->set_base(ram_region->base()+0x6000);
+ membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
+ membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 3:
program.unmap_write(0x0000, 0x6fff);
membank("bank1r")->set_base(ram_region->base()+0x0000);
membank("bank2r")->set_base(ram_region->base()+0x2000);
- membank("bank3r")->set_base(ram_region->base()+0x4000);
- membank("bank4r")->set_base(ram_region->base()+0x6000);
- membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
- membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
+ membank("bank3r")->set_base(ram_region->base()+0x4000);
+ membank("bank4r")->set_base(ram_region->base()+0x6000);
+ membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
+ membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 4:
program.unmap_write(0x0000, 0x3fff);
@@ -593,44 +604,44 @@ WRITE8_MEMBER( m5_state::mem64KBF_w ) //out 0x30
membank("bank1r")->set_base(ram_region->base()+0x0000);
membank("bank2r")->set_base(ram_region->base()+0x2000);
membank("bank3r")->set_base(ram_region->base()+0x4000); membank("bank3w")->set_base(ram_region->base()+0x4000);
- membank("bank4r")->set_base(ram_region->base()+0x6000); membank("bank4w")->set_base(ram_region->base()+0x6000);
- membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
- membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
+ membank("bank4r")->set_base(ram_region->base()+0x6000); membank("bank4w")->set_base(ram_region->base()+0x6000);
+ membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
+ membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 5:
- program.install_write_bank(0x0000,0x1fff,"bank1w");
- program.install_write_bank(0x2000,0x3fff,"bank2w");
- program.install_write_bank(0x4000,0x5fff,"bank3w");
- program.install_write_bank(0x6000,0x6fff,"bank4w");
+ program.install_write_bank(0x0000,0x1fff,"bank1w");
+ program.install_write_bank(0x2000,0x3fff,"bank2w");
+ program.install_write_bank(0x4000,0x5fff,"bank3w");
+ program.install_write_bank(0x6000,0x6fff,"bank4w");
membank("bank1r")->set_base(memregion(Z80_TAG)->base()); membank("bank1w")->set_base(ram_region->base()+0x0000);
membank("bank2r")->set_base(m_cart_rom->base()); membank("bank2w")->set_base(ram_region->base()+0x2000);
- membank("bank3r")->set_base(m_cart_rom->base()+0x2000); membank("bank3w")->set_base(ram_region->base()+0x4000);
- membank("bank4r")->set_base(m_cart_rom->base()+0x4000); membank("bank4w")->set_base(ram_region->base()+0x6000);
+ membank("bank3r")->set_base(m_cart_rom->base()+0x2000); membank("bank3w")->set_base(ram_region->base()+0x4000);
+ membank("bank4r")->set_base(m_cart_rom->base()+0x4000); membank("bank4w")->set_base(ram_region->base()+0x6000);
membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 6:
- program.install_write_bank(0x0000,0x1fff,"bank1w");
- program.install_write_bank(0x2000,0x3fff,"bank2w");
- program.install_write_bank(0x4000,0x5fff,"bank3w");
- program.install_write_bank(0x6000,0x6fff,"bank4w");
+ program.install_write_bank(0x0000,0x1fff,"bank1w");
+ program.install_write_bank(0x2000,0x3fff,"bank2w");
+ program.install_write_bank(0x4000,0x5fff,"bank3w");
+ program.install_write_bank(0x6000,0x6fff,"bank4w");
membank("bank1r")->set_base(memregion(Z80_TAG)->base()); membank("bank1w")->set_base(ram_region->base()+0x0000);
membank("bank2r")->set_base(rom_region->base()+0x0000); membank("bank2w")->set_base(ram_region->base()+0x2000);
- membank("bank3r")->set_base(rom_region->base()+0x2000); membank("bank3w")->set_base(ram_region->base()+0x4000);
- membank("bank4r")->set_base(rom_region->base()+0x4000); membank("bank4w")->set_base(ram_region->base()+0x6000);
+ membank("bank3r")->set_base(rom_region->base()+0x2000); membank("bank3w")->set_base(ram_region->base()+0x4000);
+ membank("bank4r")->set_base(rom_region->base()+0x4000); membank("bank4w")->set_base(ram_region->base()+0x6000);
membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
case 7: //probably this won't work - it should redirect rw to another ram module
- program.install_write_bank(0x0000,0x1fff,"bank1w");
- program.install_write_bank(0x2000,0x3fff,"bank2w");
- program.install_write_bank(0x4000,0x5fff,"bank3w");
+ program.install_write_bank(0x0000,0x1fff,"bank1w");
+ program.install_write_bank(0x2000,0x3fff,"bank2w");
+ program.install_write_bank(0x4000,0x5fff,"bank3w");
program.install_write_bank(0x6000,0x6fff,"bank4w");
program.install_readwrite_bank(0x7000,0x7fff,"sram");
membank("bank1r")->set_base(rom_region->base()+0x0000); membank("bank1w")->set_base(rom_region->base()+0x0000);
membank("bank2r")->set_base(rom_region->base()+0x2000); membank("bank2w")->set_base(rom_region->base()+0x2000);
- membank("bank3r")->set_base(rom_region->base()+0x4000); membank("bank3w")->set_base(rom_region->base()+0x4000);
- membank("bank4r")->set_base(rom_region->base()+0x6000); membank("bank4w")->set_base(rom_region->base()+0x6000);
+ membank("bank3r")->set_base(rom_region->base()+0x4000); membank("bank3w")->set_base(rom_region->base()+0x4000);
+ membank("bank4r")->set_base(rom_region->base()+0x6000); membank("bank4w")->set_base(rom_region->base()+0x6000);
membank("sram")->set_base(rom_region->base()+0x7000);
membank("bank5r")->set_base(rom_region->base()+0x8000); membank("bank5w")->set_base(rom_region->base()+0x8000);
membank("bank6r")->set_base(rom_region->base()+0xc000); membank("bank6w")->set_base(rom_region->base()+0xc000);
@@ -656,11 +667,11 @@ WRITE8_MEMBER( m5_state::mem64KRX_w ) //out 0x7f
memory_region *ram_region=memregion(region_tag.assign(m_cart_ram->tag()).append(":ram").c_str());
m_ram_mode = data;
-
+
BIT(m_ram_mode, 0) ? membank("bank1r")->set_base(memregion(Z80_TAG)->base()) : membank("bank1r")->set_base(ram_region->base());
BIT(m_ram_mode, 1) ? membank("bank2r")->set_base(m_cart_rom->base()) : membank("bank2r")->set_base(ram_region->base()+0x2000);
BIT(m_ram_mode, 2) ? membank("bank3r")->set_base(m_cart_rom->base()+0x2000) : membank("bank3r")->set_base(ram_region->base()+0x4000);
-
+
if ((m_DIPS->read() & 0x01))
{
BIT(m_ram_mode, 4) ? membank("bank5r")->set_base(m_cart_rom->base()+0x6000) : membank("bank5r")->set_base(ram_region->base()+0x8000);
@@ -671,7 +682,7 @@ WRITE8_MEMBER( m5_state::mem64KRX_w ) //out 0x7f
BIT(m_ram_mode, 6) ? membank("bank5r")->set_base(m_cart_rom->base()+0xe000) : membank("bank5r")->set_base(ram_region->base()+0x8000);
BIT(m_ram_mode, 7) ? membank("bank6r")->set_base(m_cart_rom->base()+0x12000): membank("bank6r")->set_base(ram_region->base()+0xc000);
}
-
+
//if KRX ROM is paged out page in cart ROM if any
if (m_cart && BIT(m_ram_mode, 1) == 0 )
{
@@ -1118,8 +1129,8 @@ WRITE8_MEMBER( brno_state::romsel_w ) //out 6c
if (!data)
{
- program.install_rom(0x0000, 0x6fff, memregion(Z80_TAG)->base());
- program.unmap_write(0x0000, 0x6fff);
+ program.install_rom(0x0000, 0x3fff, memregion(Z80_TAG)->base());
+ program.unmap_write(0x0000, 0x3fff);
m_romen=true;
}
@@ -1205,45 +1216,6 @@ static SLOT_INTERFACE_START( brno_floppies )
SLOT_INTERFACE_END
-//-------------------------------------------------
-// SNAPSHOT LOADER - BRNO
-//-------------------------------------------------
-
-SNAPSHOT_LOAD_MEMBER( brno_state, brno )
-{
-
-
- UINT8* rmd = memregion(RAMDISK)->base();
-
-
- popmessage("Loading file %s\r\n", image.filename());
- //image.message(" aaaaa:%s",image.basename_noext());
-
-
-
- if (strcmp(image.basename_noext(), "ramdump") == 0)
- {
- logerror("Dumping ramdisk to file.\r\n");
- }
-
- if (strcmp(image.filetype(), "rmd") == 0)
- {
-
-
- image.fread( rmd+0x10000, snapshot_size-0x10000);
-
-
- // image.seterror(IMAGE_ERROR_INVALIDIMAGE, "Not a Z1013 image");
- // image.message(" Not a Z1013 image");
- }
- else
- return IMAGE_INIT_FAIL;
-
-
-
- return IMAGE_INIT_PASS;
-}
-
//**************************************************************************
// MACHINE INITIALIZATION
//**************************************************************************
@@ -1287,13 +1259,13 @@ void m5_state::machine_reset()
{
membank("bank1r")->set_base(memregion(Z80_TAG)->base());
program.unmap_write(0x0000, 0x1fff);
- // program.unmap_readwrite(0x2000, 0x6fff); //if you uncomment this line Sord starts cassete loading but it is not correct on real hw
+ // program.unmap_readwrite(0x2000, 0x6fff); //if you uncomment this line Sord starts cassette loading but it is not correct on real hw
program.unmap_readwrite(0x8000, 0xffff);
return;
}
//cart is ram module
- if (m_cart_ram->exists())
+ if (m_cart_ram)
{
m_ram_type=m_cart_ram->get_type();
@@ -1302,7 +1274,9 @@ void m5_state::machine_reset()
switch (m_ram_type)
{
- case EM_5:
+ case EM_5:
+ program.install_rom(0x0000, 0x1fff, memregion(Z80_TAG)->base());
+ program.unmap_write(0x0000, 0x1fff);
program.install_readwrite_handler(0x8000, 0xffff, read8_delegate(FUNC(m5_cart_slot_device::read_ram),(m5_cart_slot_device*)m_cart_ram), write8_delegate(FUNC(m5_cart_slot_device::write_ram),(m5_cart_slot_device*)m_cart_ram));
if (m_cart)
{
@@ -1334,7 +1308,7 @@ void m5_state::machine_reset()
membank("bank5r")->set_base(ram_region->base()+0x8000); membank("bank5w")->set_base(ram_region->base()+0x8000);
membank("bank6r")->set_base(ram_region->base()+0xc000); membank("bank6w")->set_base(ram_region->base()+0xc000);
break;
- case MEM64KRX:
+ case MEM64KRX:
membank("bank1r")->set_base(memregion(Z80_TAG)->base()); membank("bank1w")->set_base(ram_region->base());
membank("bank2r")->set_base(m_cart_rom->base()); membank("bank2w")->set_base(ram_region->base()+0x2000);
membank("bank3r")->set_base(m_cart_rom->base()+0x2000); membank("bank3w")->set_base(ram_region->base()+0x4000);
@@ -1358,7 +1332,15 @@ void m5_state::machine_reset()
//I don't have idea what to do with savestates, please someone take care of it
//m_cart_ram->save_ram();
}
-
+ else
+ //ram cart wasn't found so if rom cart present install it
+ if (m_cart)
+ {
+ program.install_rom(0x0000, 0x1fff, memregion(Z80_TAG)->base());
+ program.unmap_write(0x0000, 0x1fff);
+ program.install_read_handler(0x2000, 0x6fff, read8_delegate(FUNC(m5_cart_slot_device::read_rom),(m5_cart_slot_device*)m_cart));
+ program.unmap_write(0x2000, 0x6fff);
+ }
m_ram_mode=0;
}
@@ -1374,8 +1356,9 @@ void brno_state::machine_reset()
/* enable ROM1+ROM2 */
address_space &program = m_maincpu->space(AS_PROGRAM);
- program.install_rom(0x0000, 0x5fff, memregion(Z80_TAG)->base());
- program.unmap_write(0x0000, 0x5fff);
+ program.install_rom(0x0000, 0x3fff, memregion(Z80_TAG)->base());
+ program.unmap_write(0x0000, 0x3fff);
+
//is ram/rom cart plugged in?
if (m_cart1->exists())
@@ -1395,12 +1378,17 @@ void brno_state::machine_reset()
if (m_cart)
{
- program.install_read_handler(0x2000, 0x5fff, read8_delegate(FUNC(m5_cart_slot_device::read_rom),(m5_cart_slot_device*)m_cart));
- program.unmap_write(0x2000, 0x5fff);
+ program.install_read_handler(0x2000, 0x6fff, read8_delegate(FUNC(m5_cart_slot_device::read_rom),(m5_cart_slot_device*)m_cart));
+ program.unmap_write(0x2000, 0x6fff);
}
m_romen=true;
- m_ramen=false;
+ m_ramen=false;
+
+ floppy_image_device *floppy = NULL;
+ floppy = m_floppy0->get_device();
+ m_fdc->set_floppy(floppy);
+ floppy->mon_w(0);
}
//**************************************************************************
@@ -1533,7 +1521,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( brno, m5, brno_state )
// only one floppy drive
//MCFG_DEVICE_REMOVE(WD2797_TAG":1")
- MCFG_SNAPSHOT_ADD("snapshot", brno_state, brno, "rmd", 0)
+ //MCFG_SNAPSHOT_ADD("snapshot", brno_state, brno, "rmd", 0)
// software list
MCFG_SOFTWARE_LIST_ADD("flop_list","m5_flop")
@@ -1577,9 +1565,9 @@ ROM_END
ROM_START( m5p_brno )
ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASEFF )
ROM_LOAD( "sordint.ic21", 0x0000, 0x2000, CRC(78848d39) SHA1(ac042c4ae8272ad6abe09ae83492ef9a0026d0b2)) // monitor rom
- //ROM_LOAD( "brno_rom1.rom", 0x2000, 0x2000, CRC(f4cfb2ee) SHA1(23f41d2d9ac915545409dd0163f3dc298f04eea2)) //windows
+ ROM_LOAD( "brno_win.rom", 0x2000, 0x2000, CRC(f4cfb2ee) SHA1(23f41d2d9ac915545409dd0163f3dc298f04eea2)) //windows
//ROM_LOAD( "brno_rom12.rom", 0x2000, 0x4000, CRC(cac52406) SHA1(91f6ba97e85a2b3a317689635d425ee97413bbe3)) //windows+BI
- ROM_LOAD( "brno_boot.rom", 0x2000, 0xd80, CRC(60008729) SHA1(FB26E2AE9F74B0AE0D723B417A038A8EF3D72782))
+ //ROM_LOAD( "brno_boot.rom", 0x2000, 0xd80, CRC(60008729) SHA1(FB26E2AE9F74B0AE0D723B417A038A8EF3D72782))
//Ramdisc area (maximum is 1024kB 256x 4kB banks)
ROM_REGION(1024*1024,RAMDISK,0)
diff --git a/src/mame/drivers/mbdtower.cpp b/src/mame/drivers/mbdtower.cpp
index f20f805fb5f..d5a1d589604 100644
--- a/src/mame/drivers/mbdtower.cpp
+++ b/src/mame/drivers/mbdtower.cpp
@@ -62,7 +62,7 @@ void mbdtower_state::prepare_display()
{
// declare display matrix size and the 2 7segs
set_display_size(7, 3);
- m_display_segmask[1] = m_display_segmask[2] = 0x7f;
+ set_display_segmask(6, 0x7f);
// update current state
if (~m_r & 0x10)
@@ -246,7 +246,7 @@ void mbdtower_state::machine_start()
static MACHINE_CONFIG_START( mbdtower, mbdtower_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=43K, C=56pf, but unknown RC curve
+ MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=43K, C=56pf
MCFG_TMS1XXX_READ_K_CB(READ8(mbdtower_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mbdtower_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mbdtower_state, write_o))
diff --git a/src/mame/drivers/mitchell.cpp b/src/mame/drivers/mitchell.cpp
index df82f162383..d564c6e9ead 100644
--- a/src/mame/drivers/mitchell.cpp
+++ b/src/mame/drivers/mitchell.cpp
@@ -2045,75 +2045,91 @@ ROM_END
ROM_START( block )
ROM_REGION( 0x50000, "maincpu", 0 )
- ROM_LOAD( "ble_05.rom", 0x00000, 0x08000, CRC(c12e7f4c) SHA1(335f4eab2323b942d5feeb3bab6f7286fabfffb4) )
- ROM_LOAD( "ble_06.rom", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) )
- ROM_LOAD( "ble_07.rom", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) )
+ ROM_LOAD( "ble_05b.14f", 0x00000, 0x08000, CRC(fcdb7885) SHA1(500ee4b8344181e9ad348bd22344a1a942fe9fdc) )
+ ROM_LOAD( "ble_06b.15f", 0x10000, 0x20000, CRC(e114ebde) SHA1(12362e809443644b43fbc72e7eead5f376fe11d3) )
+ ROM_LOAD( "ble_07b.16f", 0x30000, 0x20000, CRC(61bef077) SHA1(92792f26305df1e5e66607bed391b84b4964ba3e) )
ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF )
- ROM_LOAD( "bl_08.rom", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
- ROM_LOAD( "bl_09.rom", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
+ ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
+ ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
/* 40000-7ffff empty */
- ROM_LOAD( "bl_18.rom", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
- ROM_LOAD( "bl_19.rom", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
+ ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
+ ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
/* c0000-fffff empty */
ROM_REGION( 0x040000, "gfx2", 0 )
- ROM_LOAD( "bl_16.rom", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
- ROM_LOAD( "bl_17.rom", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
+ ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
+ ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */
- ROM_LOAD( "bl_01.rom", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
+ ROM_LOAD( "bl_01.2d", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
ROM_END
-ROM_START( blockj )
+ROM_START( blockr1 )
ROM_REGION( 0x50000, "maincpu", 0 )
- ROM_LOAD( "blj_05.rom", 0x00000, 0x08000, CRC(3b55969a) SHA1(86de2f1f5878de380a8b1e3935cffa146863f07f) )
- ROM_LOAD( "ble_06.rom", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) )
- ROM_LOAD( "blj_07.rom", 0x30000, 0x20000, CRC(1723883c) SHA1(e6b7575a55c045b90fb41290a60306713121acfb) )
+ ROM_LOAD( "ble_05a.14f", 0x00000, 0x08000, CRC(fa2a4536) SHA1(8f584745116bd0ced4d66719cd80c0372b797134) )
+ ROM_LOAD( "ble_06a.15f", 0x10000, 0x20000, CRC(e114ebde) SHA1(12362e809443644b43fbc72e7eead5f376fe11d3) )
+ ROM_LOAD( "ble_07.16f", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) )
+ /* the highscore table specifies an unused tile number, so we need ROMREGION_ERASEFF to ensure it is blank */
ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF )
- ROM_LOAD( "bl_08.rom", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
- ROM_LOAD( "bl_09.rom", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
+ ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
+ ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
/* 40000-7ffff empty */
- ROM_LOAD( "bl_18.rom", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
- ROM_LOAD( "bl_19.rom", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
+ ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
+ ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
/* c0000-fffff empty */
ROM_REGION( 0x040000, "gfx2", 0 )
- ROM_LOAD( "bl_16.rom", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
- ROM_LOAD( "bl_17.rom", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
+ ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
+ ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */
- ROM_LOAD( "bl_01.rom", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
+ ROM_LOAD( "bl_01.2d", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
ROM_END
-ROM_START( blockjoy )
+ROM_START( blockr2 )
ROM_REGION( 0x50000, "maincpu", 0 )
- ROM_LOAD( "ble_05.bin", 0x00000, 0x08000, CRC(fa2a4536) SHA1(8f584745116bd0ced4d66719cd80c0372b797134) )
- ROM_LOAD( "blf_06.bin", 0x10000, 0x20000, CRC(e114ebde) SHA1(12362e809443644b43fbc72e7eead5f376fe11d3) )
-// a ble_06a labeled rom has been dumped and verified identical to blf_06.bin.
+ ROM_LOAD( "ble_05.14f", 0x00000, 0x08000, CRC(c12e7f4c) SHA1(335f4eab2323b942d5feeb3bab6f7286fabfffb4) )
+ ROM_LOAD( "ble_06.15f", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) )
+ ROM_LOAD( "ble_07.16f", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) )
+
+ ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF )
+ ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
+ ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
+ /* 40000-7ffff empty */
+ ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
+ ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
+ /* c0000-fffff empty */
-// this seems to be a bad version of the above rom, although the rom code is different it is 99% the same, and level 6
-// is impossible to finish due to a missing block. Probably bitrot
-// ROM_LOAD( "ble_06.bin", 0x10000, 0x20000, BAD_DUMP CRC(58a77402) SHA1(cb24b1edd53a0965c3a9a34fe764b5c1f8dd9733) )
+ ROM_REGION( 0x040000, "gfx2", 0 )
+ ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
+ ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
- ROM_LOAD( "ble_07.rom", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) )
+ ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */
+ ROM_LOAD( "bl_01.2d", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
+ROM_END
+
+ROM_START( blockj )
+ ROM_REGION( 0x50000, "maincpu", 0 )
+ ROM_LOAD( "blj_05.14f", 0x00000, 0x08000, CRC(3b55969a) SHA1(86de2f1f5878de380a8b1e3935cffa146863f07f) )
+ ROM_LOAD( "ble_06.15f", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) )
+ ROM_LOAD( "blj_07.16f", 0x30000, 0x20000, CRC(1723883c) SHA1(e6b7575a55c045b90fb41290a60306713121acfb) )
- /* the highscore table specifies an unused tile number, so we need ROMREGION_ERASEFF to ensure it is blank */
ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF )
- ROM_LOAD( "bl_08.rom", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
- ROM_LOAD( "bl_09.rom", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
+ ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */
+ ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) )
/* 40000-7ffff empty */
- ROM_LOAD( "bl_18.rom", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
- ROM_LOAD( "bl_19.rom", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
+ ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) )
+ ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) )
/* c0000-fffff empty */
ROM_REGION( 0x040000, "gfx2", 0 )
- ROM_LOAD( "bl_16.rom", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
- ROM_LOAD( "bl_17.rom", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
+ ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */
+ ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) )
ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */
- ROM_LOAD( "bl_01.rom", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
+ ROM_LOAD( "bl_01.2d", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) )
ROM_END
ROM_START( blockbl )
@@ -2325,32 +2341,33 @@ DRIVER_INIT_MEMBER(mitchell_state,mstworld)
*
*************************************/
-GAME( 1988, mgakuen, 0, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Mahjong Gakuen", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, 7toitsu, mgakuen, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Chi-Toitsu", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, mgakuen2, 0, marukin, marukin, mitchell_state, mgakuen2, ROT0, "Face", "Mahjong Gakuen 2 Gakuen-chou no Fukushuu", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pkladies, 0, marukin, pkladies, mitchell_state, pkladies, ROT0, "Mitchell", "Poker Ladies", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pkladiesl, pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 510)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pkladiesla,pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 401)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pkladiesbl,pkladies, pkladiesbl,pkladies, mitchell_state,pkladiesbl,ROT0, "bootleg", "Poker Ladies (Censored bootleg)", MACHINE_NOT_WORKING ) // by Playmark? need to figure out CPU 'decryption' / ordering
-GAME( 1989, dokaben, 0, pang, pang, mitchell_state, dokaben, ROT0, "Capcom", "Dokaben (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pang, 0, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pang (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, bbros, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell (Capcom license)", "Buster Bros. (USA)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pompingw, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pomping World (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pangb, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pangbold, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pangba, pang, spangbl, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 3)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1989, pangb2, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 4)", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, cworld, 0, pang, qtono1, mitchell_state, cworld, ROT0, "Capcom", "Capcom World (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, hatena, 0, pang, qtono1, mitchell_state, hatena, ROT0, "Capcom", "Adventure Quiz 2 - Hatena? no Daibouken (Japan 900228)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, spang, 0, pangnv, pang, mitchell_state, spang, ROT0, "Mitchell", "Super Pang (World 900914)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, sbbros, spang, pangnv, pang, mitchell_state, sbbros, ROT0, "Mitchell (Capcom license)", "Super Buster Bros. (USA 901001)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, spangj, spang, pangnv, pang, mitchell_state, spangj, ROT0, "Mitchell", "Super Pang (Japan 901023)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, spangbl, spang, spangbl, spangbl, mitchell_state, spangbl, ROT0, "bootleg", "Super Pang (World 900914, bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // different sound hardware
-GAME( 1994, mstworld, 0, mstworld,mstworld, mitchell_state, mstworld, ROT0, "bootleg (TCH)", "Monsters World (bootleg of Super Pang)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
-GAME( 1990, marukin, 0, marukin, marukin, mitchell_state, marukin, ROT0, "Yuga", "Super Marukin-Ban (Japan 901017)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, qtono1, 0, pang, qtono1, mitchell_state, qtono1, ROT0, "Capcom", "Quiz Tonosama no Yabou (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, qsangoku, 0, pang, qtono1, mitchell_state, qsangoku, ROT0, "Capcom", "Quiz Sangokushi (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, block, 0, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (World 910910)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, blockj, block, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (Japan 910910)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, blockjoy, block, pangnv, blockjoy, mitchell_state, block, ROT270, "Capcom", "Block Block (World 911106 Joystick)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, blockbl, block, pangnv, block, mitchell_state, blockbl, ROT270, "bootleg", "Block Block (bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, mgakuen, 0, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Mahjong Gakuen", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, 7toitsu, mgakuen, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Chi-Toitsu", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, mgakuen2, 0, marukin, marukin, mitchell_state, mgakuen2, ROT0, "Face", "Mahjong Gakuen 2 Gakuen-chou no Fukushuu", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pkladies, 0, marukin, pkladies, mitchell_state, pkladies, ROT0, "Mitchell", "Poker Ladies", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pkladiesl, pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 510)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pkladiesla,pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 401)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pkladiesbl,pkladies, pkladiesbl,pkladies, mitchell_state, pkladiesbl,ROT0, "bootleg", "Poker Ladies (Censored bootleg)", MACHINE_NOT_WORKING ) // by Playmark? need to figure out CPU 'decryption' / ordering
+GAME( 1989, dokaben, 0, pang, pang, mitchell_state, dokaben, ROT0, "Capcom", "Dokaben (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pang, 0, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pang (World)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, bbros, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell (Capcom license)", "Buster Bros. (USA)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pompingw, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pomping World (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pangb, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pangbold, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pangba, pang, spangbl, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 3)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, pangb2, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 4)", MACHINE_SUPPORTS_SAVE )
+GAME( 1989, cworld, 0, pang, qtono1, mitchell_state, cworld, ROT0, "Capcom", "Capcom World (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, hatena, 0, pang, qtono1, mitchell_state, hatena, ROT0, "Capcom", "Adventure Quiz 2 - Hatena? no Daibouken (Japan 900228)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, spang, 0, pangnv, pang, mitchell_state, spang, ROT0, "Mitchell", "Super Pang (World 900914)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, sbbros, spang, pangnv, pang, mitchell_state, sbbros, ROT0, "Mitchell (Capcom license)", "Super Buster Bros. (USA 901001)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, spangj, spang, pangnv, pang, mitchell_state, spangj, ROT0, "Mitchell", "Super Pang (Japan 901023)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, spangbl, spang, spangbl, spangbl, mitchell_state, spangbl, ROT0, "bootleg", "Super Pang (World 900914, bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // different sound hardware
+GAME( 1994, mstworld, 0, mstworld, mstworld, mitchell_state, mstworld, ROT0, "bootleg (TCH)", "Monsters World (bootleg of Super Pang)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAME( 1990, marukin, 0, marukin, marukin, mitchell_state, marukin, ROT0, "Yuga", "Super Marukin-Ban (Japan 901017)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, qtono1, 0, pang, qtono1, mitchell_state, qtono1, ROT0, "Capcom", "Quiz Tonosama no Yabou (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, qsangoku, 0, pang, qtono1, mitchell_state, qsangoku, ROT0, "Capcom", "Quiz Sangokushi (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, block, 0, pangnv, blockjoy, mitchell_state, block, ROT270, "Capcom", "Block Block (World 911219 Joystick)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, blockr1, block, pangnv, blockjoy, mitchell_state, block, ROT270, "Capcom", "Block Block (World 911106 Joystick)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, blockr2, block, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (World 910910)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, blockj, block, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (Japan 910910)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, blockbl, block, pangnv, block, mitchell_state, blockbl, ROT270, "bootleg", "Block Block (bootleg)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/mstation.cpp b/src/mame/drivers/mstation.cpp
index f1aa281aeb2..b7c1ac7af09 100644
--- a/src/mame/drivers/mstation.cpp
+++ b/src/mame/drivers/mstation.cpp
@@ -28,6 +28,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/bankdev.h"
#include "machine/intelfsh.h"
#include "machine/rp5c01.h"
#include "machine/ram.h"
@@ -39,30 +40,28 @@ public:
mstation_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_ram(*this, RAM_TAG)
+ m_ram(*this, RAM_TAG),
+ m_bankdev1(*this, "bank0"),
+ m_bankdev2(*this, "bank1"),
+ m_keyboard(*this, "LINE"),
+ m_nvram(*this, "nvram")
{ }
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
+ required_device<address_map_bank_device> m_bankdev1;
+ required_device<address_map_bank_device> m_bankdev2;
+ required_ioport_array<10> m_keyboard;
+ required_shared_ptr<UINT8> m_nvram;
- intelfsh8_device *m_flashes[2];
UINT8 m_bank1[2];
UINT8 m_bank2[2];
- UINT8 *m_ram_base;
- int m_flash_at_0x4000;
- int m_flash_at_0x8000;
UINT8 *m_vram;
UINT8 m_screen_column;
UINT8 m_port2;
UINT8 m_irq;
UINT16 m_kb_matrix;
- DECLARE_READ8_MEMBER( flash_0x0000_read_handler );
- DECLARE_WRITE8_MEMBER( flash_0x0000_write_handler );
- DECLARE_READ8_MEMBER( flash_0x4000_read_handler );
- DECLARE_WRITE8_MEMBER( flash_0x4000_write_handler );
- DECLARE_READ8_MEMBER( flash_0x8000_read_handler );
- DECLARE_WRITE8_MEMBER( flash_0x8000_write_handler );
DECLARE_READ8_MEMBER( modem_r );
DECLARE_WRITE8_MEMBER( modem_w );
@@ -73,7 +72,6 @@ public:
DECLARE_READ8_MEMBER( lcd_left_r );
DECLARE_WRITE8_MEMBER( lcd_left_w );
- void refresh_memory(UINT8 bank, UINT8 chip_select);
DECLARE_READ8_MEMBER( bank1_r );
DECLARE_WRITE8_MEMBER( bank1_w );
DECLARE_READ8_MEMBER( bank2_r );
@@ -97,35 +95,6 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(mstation_kb_timer);
};
-READ8_MEMBER( mstation_state::flash_0x0000_read_handler )
-{
- return m_flashes[0]->read(offset);
-}
-
-WRITE8_MEMBER( mstation_state::flash_0x0000_write_handler )
-{
- m_flashes[0]->write(offset, data);
-}
-
-READ8_MEMBER( mstation_state::flash_0x4000_read_handler )
-{
- return m_flashes[m_flash_at_0x4000]->read(((m_bank1[0] & 0x3f)<<14) | offset);
-}
-
-WRITE8_MEMBER( mstation_state::flash_0x4000_write_handler )
-{
- m_flashes[m_flash_at_0x4000]->write(((m_bank1[0] & 0x3f)<<14) | offset, data);
-}
-
-READ8_MEMBER( mstation_state::flash_0x8000_read_handler )
-{
- return m_flashes[m_flash_at_0x8000]->read(((m_bank2[0] & 0x3f)<<14) | offset);
-}
-
-WRITE8_MEMBER( mstation_state::flash_0x8000_write_handler )
-{
- m_flashes[m_flash_at_0x8000]->write(((m_bank2[0] & 0x3f)<<14) | offset, data);
-}
READ8_MEMBER( mstation_state::modem_r )
{
@@ -185,53 +154,6 @@ UINT32 mstation_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
// Bankswitch
//***************************************************************************/
-void mstation_state::refresh_memory(UINT8 bank, UINT8 chip_select)
-{
- address_space& program = m_maincpu->space(AS_PROGRAM);
- int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000);
- char bank_tag[6];
-
- switch (chip_select)
- {
- case 0: // flash 0
- case 3: // flash 1
- if (active_flash < 0)
- {
- if (bank == 1)
- program.install_readwrite_handler(0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(mstation_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(mstation_state::flash_0x4000_write_handler), this));
- else
- program.install_readwrite_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(mstation_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(mstation_state::flash_0x8000_write_handler), this));
- }
-
- active_flash = chip_select ? 1 : 0;
- break;
- case 1: // banked RAM
- sprintf(bank_tag,"bank%d", bank);
- membank(bank_tag)->set_base(m_ram_base + (((bank == 1 ? m_bank1[0] : m_bank2[0]) & 0x07)<<14));
- program.install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag);
- active_flash = -1;
- break;
- case 2: // left LCD panel
- program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0, 0, read8_delegate(FUNC(mstation_state::lcd_left_r), this), write8_delegate(FUNC(mstation_state::lcd_left_w), this));
- active_flash = -1;
- break;
- case 4: // right LCD panel
- program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0, 0, read8_delegate(FUNC(mstation_state::lcd_right_r), this), write8_delegate(FUNC(mstation_state::lcd_right_w), this));
- active_flash = -1;
- break;
- case 5: // modem
- program.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, 0x07, 0, read8_delegate(FUNC(mstation_state::modem_r), this), write8_delegate(FUNC(mstation_state::modem_w), this));
- active_flash = -1;
- break;
-
- default:
- logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff);
- program.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
- active_flash = -1;
- break;
- }
-}
-
READ8_MEMBER( mstation_state::bank1_r )
{
return m_bank1[offset];
@@ -246,14 +168,14 @@ WRITE8_MEMBER( mstation_state::bank1_w )
{
m_bank1[offset] = data;
- refresh_memory(1, m_bank1[1] & 0x07);
+ m_bankdev1->set_bank(((m_bank1[1] & 0x07) << 8) | m_bank1[0]);
}
WRITE8_MEMBER( mstation_state::bank2_w )
{
m_bank2[offset] = data;
- refresh_memory(2, m_bank2[1] & 0x07);
+ m_bankdev2->set_bank(((m_bank2[1] & 0x07) << 8) | m_bank2[0]);
}
@@ -314,25 +236,32 @@ WRITE8_MEMBER( mstation_state::kb_w )
READ8_MEMBER( mstation_state::kb_r )
{
- static const char *const bitnames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
- "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
UINT8 data = 0xff;
for (int i=0; i<10; i++)
{
if (!(m_kb_matrix & (1<<i)))
- data &= ioport(bitnames[i])->read();
+ data &= m_keyboard[i]->read();
}
return data;
}
+static ADDRESS_MAP_START(mstation_banked_map, AS_PROGRAM, 8, mstation_state)
+ AM_RANGE(0x0000000, 0x00fffff) AM_MIRROR(0x0300000) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
+ AM_RANGE(0x0400000, 0x041ffff) AM_MIRROR(0x03e0000) AM_RAM AM_SHARE("nvram")
+ AM_RANGE(0x0c00000, 0x0c7ffff) AM_MIRROR(0x0380000) AM_DEVREADWRITE("flash1", intelfsh8_device, read, write)
+ AM_RANGE(0x0800000, 0x0803fff) AM_MIRROR(0x03fc000) AM_READWRITE(lcd_left_r, lcd_left_w)
+ AM_RANGE(0x1000000, 0x1003fff) AM_MIRROR(0x03fc000) AM_READWRITE(lcd_right_r, lcd_right_w)
+ AM_RANGE(0x1400000, 0x1403fff) AM_MIRROR(0x03fc000) AM_READWRITE(modem_r, modem_w)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START(mstation_mem, AS_PROGRAM, 8, mstation_state)
- AM_RANGE(0x0000, 0x3fff) AM_READWRITE(flash_0x0000_read_handler, flash_0x0000_write_handler)
- AM_RANGE(0x4000, 0x7fff) AM_READWRITE_BANK("bank1") // bank 1
- AM_RANGE(0x8000, 0xbfff) AM_READWRITE_BANK("bank2") // bank 2
- AM_RANGE(0xc000, 0xffff) AM_READWRITE_BANK("sysram") // system ram always first RAM bank
+ AM_RANGE(0x0000, 0x3fff) AM_DEVREADWRITE("flash0", intelfsh8_device, read, write)
+ AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("bank0", address_map_bank_device, read8, write8)
+ AM_RANGE(0x8000, 0xbfff) AM_DEVREADWRITE("bank1", address_map_bank_device, read8, write8)
+ AM_RANGE(0xc000, 0xffff) AM_RAMBANK("sysram") // system ram always first RAM bank
ADDRESS_MAP_END
static ADDRESS_MAP_START(mstation_io , AS_IO, 8, mstation_state)
@@ -350,7 +279,7 @@ ADDRESS_MAP_END
/* Input ports */
static INPUT_PORTS_START( mstation )
- PORT_START( "LINE0" )
+ PORT_START( "LINE.0" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Main Menu") PORT_CODE( KEYCODE_HOME ) PORT_CHAR(UCHAR_MAMEKEY(HOME))
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Back") PORT_CODE( KEYCODE_DEL ) PORT_CHAR(UCHAR_MAMEKEY(END))
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Print") PORT_CODE( KEYCODE_F6 )
@@ -360,7 +289,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F4") PORT_CODE( KEYCODE_F4 ) PORT_CHAR(UCHAR_MAMEKEY(F4))
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F5") PORT_CODE( KEYCODE_F5 ) PORT_CHAR(UCHAR_MAMEKEY(F5))
- PORT_START( "LINE1" )
+ PORT_START( "LINE.1" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -370,7 +299,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Get E-Mail") PORT_CODE( KEYCODE_F9 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PG Up") PORT_CODE( KEYCODE_PGUP ) PORT_CHAR(UCHAR_MAMEKEY(PGUP))
- PORT_START( "LINE2" )
+ PORT_START( "LINE.2" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xc2\xb4") PORT_CODE( KEYCODE_0_PAD )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_1 ) PORT_CHAR('1') PORT_CHAR('!')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_2 ) PORT_CHAR('2') PORT_CHAR('@')
@@ -380,7 +309,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_6 ) PORT_CHAR('6') PORT_CHAR('^')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_7 ) PORT_CHAR('7') PORT_CHAR('&')
- PORT_START( "LINE3" )
+ PORT_START( "LINE.3" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_8 ) PORT_CHAR('8') PORT_CHAR('*')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_9 ) PORT_CHAR('9') PORT_CHAR('(')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_0 ) PORT_CHAR('0') PORT_CHAR(')')
@@ -390,7 +319,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_BACKSLASH ) PORT_CHAR('\\') PORT_CHAR('|')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PG Down") PORT_CODE( KEYCODE_PGDN ) PORT_CHAR(UCHAR_MAMEKEY(PGDN))
- PORT_START( "LINE4" )
+ PORT_START( "LINE.4" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE( KEYCODE_TAB ) PORT_CHAR(9)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_Q ) PORT_CHAR('q') PORT_CHAR('Q')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_W ) PORT_CHAR('w') PORT_CHAR('W')
@@ -400,7 +329,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_Y ) PORT_CHAR('y') PORT_CHAR('Y')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_U ) PORT_CHAR('u') PORT_CHAR('U')
- PORT_START( "LINE5" )
+ PORT_START( "LINE.5" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_I ) PORT_CHAR('i') PORT_CHAR('I')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_O ) PORT_CHAR('o') PORT_CHAR('O')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_P ) PORT_CHAR('p') PORT_CHAR('P')
@@ -410,7 +339,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_QUOTE ) PORT_CHAR('\'') PORT_CHAR('\"')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Enter") PORT_CODE( KEYCODE_ENTER ) PORT_CHAR(UCHAR_MAMEKEY(ENTER))
- PORT_START( "LINE6" )
+ PORT_START( "LINE.6" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CapsLock") PORT_CODE( KEYCODE_CAPSLOCK ) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_A ) PORT_CHAR('a') PORT_CHAR('A')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_S ) PORT_CHAR('s') PORT_CHAR('S')
@@ -420,7 +349,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_H ) PORT_CHAR('h') PORT_CHAR('H')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_J ) PORT_CHAR('j') PORT_CHAR('J')
- PORT_START( "LINE7" )
+ PORT_START( "LINE.7" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_K ) PORT_CHAR('K') PORT_CHAR('K')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_L ) PORT_CHAR('l') PORT_CHAR('L')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_COMMA ) PORT_CHAR(',') PORT_CHAR('<')
@@ -430,7 +359,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Down") PORT_CODE( KEYCODE_DOWN ) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Right") PORT_CODE( KEYCODE_RIGHT ) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
- PORT_START( "LINE8" )
+ PORT_START( "LINE.8" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left Shift") PORT_CODE( KEYCODE_LSHIFT ) PORT_CHAR(UCHAR_MAMEKEY(LSHIFT))
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_Z ) PORT_CHAR('z') PORT_CHAR('Z')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_X ) PORT_CHAR('x') PORT_CHAR('X')
@@ -440,7 +369,7 @@ static INPUT_PORTS_START( mstation )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_N ) PORT_CHAR('n') PORT_CHAR('N')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE( KEYCODE_M ) PORT_CHAR('m') PORT_CHAR('M')
- PORT_START( "LINE9" )
+ PORT_START( "LINE.9" )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Function") PORT_CODE( KEYCODE_LCONTROL ) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -453,29 +382,23 @@ INPUT_PORTS_END
void mstation_state::machine_start()
{
- m_flashes[0] = machine().device<intelfsh8_device>("flash0");
- m_flashes[1] = machine().device<intelfsh8_device>("flash1");
-
// allocate the videoram
m_vram = (UINT8*)machine().memory().region_alloc( "vram", 9600, 1, ENDIANNESS_LITTLE )->base();
- m_ram_base = (UINT8*)m_ram->pointer();
// map firsh RAM bank at 0xc000-0xffff
- membank("sysram")->set_base(m_ram_base);
+ membank("sysram")->set_base(m_nvram);
}
void mstation_state::machine_reset()
{
- m_flash_at_0x4000 = 0;
- m_flash_at_0x8000 = 0;
m_bank1[0] = m_bank1[1] = 0;
m_bank2[0] = m_bank2[1] = 0;
memset(m_vram, 0, 9600);
// reset banks
- refresh_memory(1, m_bank1[1]);
- refresh_memory(2, m_bank2[1]);
+ m_bankdev1->set_bank(0);
+ m_bankdev2->set_bank(0);
}
WRITE_LINE_MEMBER( mstation_state::rtc_irq )
@@ -540,6 +463,18 @@ static MACHINE_CONFIG_START( mstation, mstation_state )
MCFG_DEVICE_ADD("rtc", RP5C01, XTAL_32_768kHz)
MCFG_RP5C01_OUT_ALARM_CB(WRITELINE(mstation_state, rtc_irq))
+ MCFG_DEVICE_ADD("bank0", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(mstation_banked_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
+
+ MCFG_DEVICE_ADD("bank1", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(mstation_banked_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
+
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("128K")
diff --git a/src/mame/drivers/namcops2.cpp b/src/mame/drivers/namcops2.cpp
index a0eec46f766..d53c83c3085 100644
--- a/src/mame/drivers/namcops2.cpp
+++ b/src/mame/drivers/namcops2.cpp
@@ -1461,6 +1461,18 @@ ROM_START( wanganmd )
DISK_IMAGE_READONLY( "wmn1-a", 0, SHA1(4254e987e71d0d4038a87f11dc1a304396b3dffc) )
ROM_END
+ROM_START( wanganmr )
+ ROM_REGION(0x200000, "bios", 0)
+ SYSTEM246_BIOS
+
+ ROM_REGION(0x840000, "key", ROMREGION_ERASE00)
+ ROM_LOAD( "wmr1vera.ic002", 0x000000, 0x800000, CRC(b431936b) SHA1(e2c543936cb5689a432662a69d0042c6179a3728) )
+ ROM_LOAD( "wmr1vera_spr.ic002", 0x800000, 0x040000, CRC(b8b7539c) SHA1(f415bdc8e3ebf3b0c3d0d7607b894440e89b0fe7) )
+
+ DISK_REGION("dvd") // actually single-track CD-ROM
+ DISK_IMAGE_READONLY( "wmr1-a", 0, SHA1(02feab4380dcc2dd95c85b209192f858bafc721e) )
+ROM_END
+
ROM_START( vnight )
ROM_REGION(0x200000, "bios", 0)
SYSTEM246_BIOS
@@ -1585,6 +1597,7 @@ GAME(2002, tekken4, sys246, system246, system246, driver_device, 0, ROT0, "Na
GAME(2002, tekken4a, tekken4, system246, system246, driver_device, 0, ROT0, "Namco", "Tekken 4 (TEF2 Ver. A)", MACHINE_IS_SKELETON)
GAME(2002, tekken4b, tekken4, system246, system246, driver_device, 0, ROT0, "Namco", "Tekken 4 (TEF1 Ver. A)", MACHINE_IS_SKELETON)
GAME(2002, tekken4c, tekken4, system246, system246, driver_device, 0, ROT0, "Namco", "Tekken 4 (TEF1 Ver. C)", MACHINE_IS_SKELETON)
+GAME(2002, wanganmr, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Wangan Midnight R (WMR1 Ver. A)", MACHINE_IS_SKELETON)
GAME(2003, prdgp03, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Pride GP 2003 (PR21 Ver. A)", MACHINE_IS_SKELETON)
GAME(2003, timecrs3, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Time Crisis 3 (TST1)", MACHINE_IS_SKELETON)
GAME(2003, timecrs3e,timecrs3, system246, system246, driver_device, 0, ROT0, "Namco", "Time Crisis 3 (TST2 Ver. A)", MACHINE_IS_SKELETON)
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index 7185014c285..0ea049f807a 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -398,6 +398,7 @@ Keyboard TX commands:
#include "machine/upd765.h"
#include "machine/upd1990a.h"
#include "machine/i8251.h"
+#include "machine/bankdev.h"
#include "bus/scsi/pc9801_sasi.h"
#include "bus/scsi/scsi.h"
@@ -465,6 +466,7 @@ public:
m_ext_gvram(*this, "ext_gvram"),
m_beeper(*this, "beeper"),
m_ram(*this, RAM_TAG),
+ m_ipl(*this, "ipl_bank"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_screen(*this, "screen")
@@ -494,6 +496,7 @@ public:
optional_shared_ptr<UINT32> m_ext_gvram;
required_device<beep_device> m_beeper;
optional_device<ram_device> m_ram;
+ optional_device<address_map_bank_device> m_ipl;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
@@ -508,11 +511,11 @@ public:
};
emu_timer *m_vbirq;
- UINT8 *m_ipl_rom;
UINT8 *m_char_rom;
UINT8 *m_kanji_rom;
UINT8 m_dma_offset[4];
+ UINT8 m_dma_autoinc[4];
int m_dack;
UINT8 m_video_ff[8],m_gfx_ff;
@@ -525,8 +528,6 @@ public:
UINT8 m_font_line;
UINT16 m_font_lr;
- UINT8 m_keyb_press;
-
UINT8 m_fdc_2dd_ctrl,m_fdc_2hd_ctrl;
UINT8 m_nmi_ff;
@@ -535,9 +536,7 @@ public:
/* PC9801RS specific */
UINT8 m_gate_a20; //A20 line
- UINT8 m_nmi_enable;
UINT8 m_access_ctrl; // DMA related
- UINT8 m_rom_bank;
UINT8 m_fdc_ctrl;
UINT8 m_ex_video_ff[128];
struct {
@@ -570,7 +569,9 @@ public:
UINT8 m_sys_type;
DECLARE_WRITE_LINE_MEMBER( write_uart_clock );
- DECLARE_WRITE8_MEMBER(rtc_dmapg_w);
+ DECLARE_WRITE8_MEMBER(rtc_w);
+ DECLARE_WRITE8_MEMBER(dmapg4_w);
+ DECLARE_WRITE8_MEMBER(dmapg8_w);
DECLARE_WRITE8_MEMBER(nmi_ctrl_w);
DECLARE_WRITE8_MEMBER(vrtc_clear_w);
DECLARE_WRITE8_MEMBER(pc9801_video_ff_w);
@@ -581,10 +582,10 @@ public:
DECLARE_WRITE16_MEMBER(egc_w);
DECLARE_READ8_MEMBER(pc9801_a0_r);
DECLARE_WRITE8_MEMBER(pc9801_a0_w);
- DECLARE_READ8_MEMBER(pc9801_fdc_2hd_r);
- DECLARE_WRITE8_MEMBER(pc9801_fdc_2hd_w);
- DECLARE_READ8_MEMBER(pc9801_fdc_2dd_r);
- DECLARE_WRITE8_MEMBER(pc9801_fdc_2dd_w);
+ DECLARE_READ8_MEMBER(fdc_2hd_ctrl_r);
+ DECLARE_WRITE8_MEMBER(fdc_2hd_ctrl_w);
+ DECLARE_READ8_MEMBER(fdc_2dd_ctrl_r);
+ DECLARE_WRITE8_MEMBER(fdc_2dd_ctrl_w);
DECLARE_READ16_MEMBER(tvram_r);
DECLARE_WRITE16_MEMBER(tvram_w);
DECLARE_READ8_MEMBER(gvram_r);
@@ -599,7 +600,7 @@ public:
DECLARE_WRITE16_MEMBER(upd7220_grcg_w);
void egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask);
UINT16 egc_blit_r(UINT32 offset, UINT16 mem_mask);
- UINT32 pc9801_286_a20(bool state);
+ UINT32 a20_286(bool state);
DECLARE_READ8_MEMBER(ide_ctrl_r);
DECLARE_WRITE8_MEMBER(ide_ctrl_w);
@@ -624,16 +625,13 @@ public:
int m_sasi_data_enable;
UINT8 m_sasi_ctrl;
- DECLARE_READ8_MEMBER(pc9801rs_ipl_r);
DECLARE_READ8_MEMBER(pc9801rs_knjram_r);
DECLARE_WRITE8_MEMBER(pc9801rs_knjram_w);
DECLARE_WRITE8_MEMBER(pc9801rs_bank_w);
DECLARE_READ8_MEMBER(a20_ctrl_r);
DECLARE_WRITE8_MEMBER(a20_ctrl_w);
- DECLARE_READ8_MEMBER(pc9810rs_fdc_ctrl_r);
- DECLARE_WRITE8_MEMBER(pc9810rs_fdc_ctrl_w);
- DECLARE_READ8_MEMBER(pc9801rs_2hd_r);
- DECLARE_WRITE8_MEMBER(pc9801rs_2hd_w);
+ DECLARE_READ8_MEMBER(fdc_mode_ctrl_r);
+ DECLARE_WRITE8_MEMBER(fdc_mode_ctrl_w);
// DECLARE_READ8_MEMBER(pc9801rs_2dd_r);
// DECLARE_WRITE8_MEMBER(pc9801rs_2dd_w);
DECLARE_WRITE8_MEMBER(pc9801rs_video_ff_w);
@@ -641,14 +639,11 @@ public:
DECLARE_WRITE8_MEMBER(pc9821_video_ff_w);
DECLARE_READ8_MEMBER(pc9821_a0_r);
DECLARE_WRITE8_MEMBER(pc9821_a0_w);
- DECLARE_READ8_MEMBER(pc9801rs_access_ctrl_r);
- DECLARE_WRITE8_MEMBER(pc9801rs_access_ctrl_w);
- DECLARE_WRITE8_MEMBER(pc9801rs_nmi_w);
- DECLARE_READ8_MEMBER(pc9801rs_midi_r);
+ DECLARE_READ8_MEMBER(access_ctrl_r);
+ DECLARE_WRITE8_MEMBER(access_ctrl_w);
+ DECLARE_READ8_MEMBER(midi_r);
// DECLARE_READ8_MEMBER(winram_r);
// DECLARE_WRITE8_MEMBER(winram_w);
-// DECLARE_READ8_MEMBER(pc9801_ext_opna_r);
-// DECLARE_WRITE8_MEMBER(pc9801_ext_opna_w);
DECLARE_READ8_MEMBER(pic_r);
DECLARE_WRITE8_MEMBER(pic_w);
@@ -678,11 +673,11 @@ public:
DECLARE_WRITE8_MEMBER(sdip_a_w);
DECLARE_WRITE8_MEMBER(sdip_b_w);
- DECLARE_READ8_MEMBER(pc9821_window_bank_r);
- DECLARE_WRITE8_MEMBER(pc9821_window_bank_w);
- DECLARE_READ16_MEMBER(pc9821_timestamp_r);
- DECLARE_READ8_MEMBER(pc9821_ext2_video_ff_r);
- DECLARE_WRITE8_MEMBER(pc9821_ext2_video_ff_w);
+ DECLARE_READ8_MEMBER(window_bank_r);
+ DECLARE_WRITE8_MEMBER(window_bank_w);
+ DECLARE_READ16_MEMBER(timestamp_r);
+ DECLARE_READ8_MEMBER(ext2_video_ff_r);
+ DECLARE_WRITE8_MEMBER(ext2_video_ff_w);
DECLARE_FLOPPY_FORMATS( floppy_formats );
UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels );
@@ -706,7 +701,7 @@ public:
DECLARE_MACHINE_RESET(pc9821);
DECLARE_PALETTE_INIT(pc9801);
- INTERRUPT_GEN_MEMBER(pc9801_vrtc_irq);
+ INTERRUPT_GEN_MEMBER(vrtc_irq);
DECLARE_READ8_MEMBER(get_slave_ack);
DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
DECLARE_WRITE_LINE_MEMBER(tc_w);
@@ -975,34 +970,34 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( pc9801_state::hgdc_draw_text )
}
-WRITE8_MEMBER(pc9801_state::rtc_dmapg_w)
+WRITE8_MEMBER(pc9801_state::rtc_w)
{
- if((offset & 1) == 0)
- {
- if(offset == 0)
- {
- m_rtc->c0_w((data & 0x01) >> 0);
- m_rtc->c1_w((data & 0x02) >> 1);
- m_rtc->c2_w((data & 0x04) >> 2);
- m_rtc->stb_w((data & 0x08) >> 3);
- m_rtc->clk_w((data & 0x10) >> 4);
- m_rtc->data_in_w(((data & 0x20) >> 5));
- if(data & 0xc0)
- logerror("RTC write to undefined bits %02x\n",data & 0xc0);
- }
- else
- logerror("Write to undefined port [%02x] <- %02x\n",offset+0x20,data);
- }
- else // odd
- {
-// logerror("Write to DMA bank register %d %02x\n",((offset >> 1)+1) & 3,data);
- m_dma_offset[((offset >> 1)+1) & 3] = data & 0x0f;
- }
+ m_rtc->c0_w((data & 0x01) >> 0);
+ m_rtc->c1_w((data & 0x02) >> 1);
+ m_rtc->c2_w((data & 0x04) >> 2);
+ m_rtc->stb_w((data & 0x08) >> 3);
+ m_rtc->clk_w((data & 0x10) >> 4);
+ m_rtc->data_in_w(((data & 0x20) >> 5));
+ if(data & 0xc0)
+ logerror("RTC write to undefined bits %02x\n",data & 0xc0);
+}
+
+WRITE8_MEMBER(pc9801_state::dmapg4_w)
+{
+ m_dma_offset[(offset+1) & 3] = data & 0x0f;
+}
+
+WRITE8_MEMBER(pc9801_state::dmapg8_w)
+{
+ if(offset == 4)
+ m_dma_autoinc[data & 3] = (data >> 2) & 3;
+ else if(offset < 4)
+ m_dma_offset[(offset+1) & 3] = data;
}
WRITE8_MEMBER(pc9801_state::nmi_ctrl_w)
{
- m_nmi_ff = (offset & 2) >> 1;
+ m_nmi_ff = offset;
}
WRITE8_MEMBER(pc9801_state::vrtc_clear_w)
@@ -1197,120 +1192,56 @@ DECLARE_WRITE_LINE_MEMBER(pc9801_state::write_uart_clock)
m_sio->write_rxc(state);
}
-READ8_MEMBER(pc9801_state::pc9801_fdc_2hd_r)
+READ8_MEMBER(pc9801_state::fdc_2hd_ctrl_r)
{
- if((offset & 1) == 0)
- {
- switch(offset & 6)
- {
- case 0: return m_fdc_2hd->msr_r(space, 0, 0xff);
- case 2: return m_fdc_2hd->fifo_r(space, 0, 0xff);
- case 4: return 0x5f; //unknown port meaning
- }
- }
- else
- {
- switch((offset & 6) + 1)
- {
- case 1: return m_sio->data_r(space, 0);
- case 3: return m_sio->status_r(space, 0);
- }
- logerror("Read to undefined port [%02x]\n",offset+0x90);
- return 0xff;
- }
-
- return 0xff;
+ return 0x44; //unknown port meaning 2hd flag?
}
-WRITE8_MEMBER(pc9801_state::pc9801_fdc_2hd_w)
+WRITE8_MEMBER(pc9801_state::fdc_2hd_ctrl_w)
{
- if((offset & 1) == 0)
- {
- switch(offset & 6)
- {
- case 0: logerror("Write to undefined port [%02x] <- %02x\n",offset+0x90,data); return;
- case 2: m_fdc_2hd->fifo_w(space, 0, data, 0xff); return;
- case 4:
- //logerror("%02x ctrl\n",data);
- if(((m_fdc_2hd_ctrl & 0x80) == 0) && (data & 0x80))
- m_fdc_2hd->soft_reset();
-
- m_fdc_2hd_ctrl = data;
+ //logerror("%02x ctrl\n",data);
+ if(((m_fdc_2hd_ctrl & 0x80) == 0) && (data & 0x80))
+ m_fdc_2hd->soft_reset();
- if(data & 0x40)
- {
- m_fdc_2hd->set_ready_line_connected(0);
- m_fdc_2hd->ready_w(0);
- }
- else
- m_fdc_2hd->set_ready_line_connected(1);
+ m_fdc_2hd_ctrl = data;
- // TODO: is the motor control bit really inverted relative to the other fdcs?
- m_fdc_2hd->subdevice<floppy_connector>("0")->get_device()->mon_w(data & 8 ? ASSERT_LINE : CLEAR_LINE);
- m_fdc_2hd->subdevice<floppy_connector>("1")->get_device()->mon_w(data & 8 ? ASSERT_LINE : CLEAR_LINE);
- break;
- }
- }
- else
+ if(data & 0x40)
{
- switch((offset & 6) + 1)
- {
- case 1: m_sio->data_w(space, 0, data); return;
- case 3: m_sio->control_w(space, 0, data); return;
- }
- logerror("Write to undefined port [%02x] <- %02x\n",offset+0x90,data);
+ m_fdc_2hd->set_ready_line_connected(0);
+ m_fdc_2hd->ready_w(0);
}
-}
-
+ else
+ m_fdc_2hd->set_ready_line_connected(1);
-READ8_MEMBER(pc9801_state::pc9801_fdc_2dd_r)
-{
- if((offset & 1) == 0)
+ if(!m_sys_type) // required for 9801f 2hd adapter bios
{
- switch(offset & 6)
- {
- case 0: return m_fdc_2dd->msr_r(space, 0, 0xff);
- case 2: return m_fdc_2dd->fifo_r(space, 0, 0xff);
- case 4:
- {
- int ret = (!m_fdc_2dd->subdevice<floppy_connector>("0")->get_device()->ready_r()) ? 0x10 : 0;
- ret |= (m_fdc_2dd->subdevice<floppy_connector>("1")->get_device()->ready_r()) ? 0x10 : 0;
- return ret | 0x40; //unknown port meaning, might be 0x70
- }
- }
+ m_fdc_2hd->subdevice<floppy_connector>("0")->get_device()->mon_w(data & 8 ? ASSERT_LINE : CLEAR_LINE);
+ m_fdc_2hd->subdevice<floppy_connector>("1")->get_device()->mon_w(data & 8 ? ASSERT_LINE : CLEAR_LINE);
}
- else
+ else if(!(m_fdc_ctrl & 4)) // required for 9821
{
- logerror("Read to undefined port [%02x]\n",offset+0xc8);
- return 0xff;
+ m_fdc_2hd->subdevice<floppy_connector>("0")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
+ m_fdc_2hd->subdevice<floppy_connector>("1")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
}
+}
- return 0xff;
+
+READ8_MEMBER(pc9801_state::fdc_2dd_ctrl_r)
+{
+ int ret = (!m_fdc_2dd->subdevice<floppy_connector>("0")->get_device()->ready_r()) ? 0x10 : 0;
+ ret |= (m_fdc_2dd->subdevice<floppy_connector>("1")->get_device()->ready_r()) ? 0x10 : 0;
+ return ret | 0x40; //unknown port meaning, might be 0x70
}
-WRITE8_MEMBER(pc9801_state::pc9801_fdc_2dd_w)
+WRITE8_MEMBER(pc9801_state::fdc_2dd_ctrl_w)
{
- if((offset & 1) == 0)
- {
- switch(offset & 6)
- {
- case 0: logerror("Write to undefined port [%02x] <- %02x\n",offset+0xc8,data); return;
- case 2: m_fdc_2dd->fifo_w(space, 0, data, 0xff); return;
- case 4:
- logerror("%02x ctrl\n",data);
- if(((m_fdc_2dd_ctrl & 0x80) == 0) && (data & 0x80))
- m_fdc_2dd->soft_reset();
-
- m_fdc_2dd_ctrl = data;
- m_fdc_2dd->subdevice<floppy_connector>("0")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
- m_fdc_2dd->subdevice<floppy_connector>("1")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
- break;
- }
- }
- else
- {
- logerror("Write to undefined port [%02x] <- %02x\n",offset+0xc8,data);
- }
+ logerror("%02x ctrl\n",data);
+ if(((m_fdc_2dd_ctrl & 0x80) == 0) && (data & 0x80))
+ m_fdc_2dd->soft_reset();
+
+ m_fdc_2dd_ctrl = data;
+ m_fdc_2dd->subdevice<floppy_connector>("0")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
+ m_fdc_2dd->subdevice<floppy_connector>("1")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
}
@@ -1427,23 +1358,10 @@ void pc9801_state::egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask)
}
// mask off the bits past the end of the blit
- if((m_egc.count < 8) && (mem_mask != 0xffff))
- {
- UINT16 end_mask = dir ? ((1 << m_egc.count) - 1) : ~((1 << (8 - m_egc.count)) - 1);
- // if the blit is less than 8 bits, adjust the masks
- if(m_egc.first)
- {
- if(dir)
- end_mask <<= dst_off & 7;
- else
- end_mask >>= dst_off & 7;
- }
- mask &= end_mask;
- }
- else if((m_egc.count < 16) && (mem_mask == 0xffff))
+ if(((m_egc.count < 8) && (mem_mask != 0xffff)) || ((m_egc.count < 16) && (mem_mask == 0xffff)))
{
UINT16 end_mask = dir ? ((1 << m_egc.count) - 1) : ~((1 << (16 - m_egc.count)) - 1);
- // if the blit is less than 16 bits, adjust the masks
+ // if the blit is less than the write size, adjust the masks
if(m_egc.first)
{
if(dir)
@@ -1458,7 +1376,7 @@ void pc9801_state::egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask)
{
if(!BIT(m_egc.regs[0], i))
{
- UINT16 src = m_egc.src[i] & mem_mask, pat = m_egc.pat[i];
+ UINT16 src = m_egc.src[i], pat = m_egc.pat[i];
if(BIT(m_egc.regs[2], 10))
src = egc_shift(i, data);
@@ -1779,11 +1697,11 @@ static ADDRESS_MAP_START( pc9801_map, AS_PROGRAM, 16, pc9801_state )
ADDRESS_MAP_END
/* first device is even offsets, second one is odd offsets */
-static ADDRESS_MAP_START( pc9801_io, AS_IO, 16, pc9801_state )
+static ADDRESS_MAP_START( pc9801_common_io, AS_IO, 16, pc9801_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("i8237", am9517a_device, read, write, 0xff00)
AM_RANGE(0x0000, 0x000f) AM_READWRITE8(pic_r, pic_w, 0x00ff) // i8259 PIC (bit 3 ON slave / master) / i8237 DMA
- AM_RANGE(0x0020, 0x0027) AM_WRITE8(rtc_dmapg_w,0xffff) // RTC / DMA registers (LS244)
+ AM_RANGE(0x0020, 0x0021) AM_WRITE8(rtc_w,0x00ff)
AM_RANGE(0x0030, 0x0037) AM_DEVREADWRITE8("ppi8255_sys", i8255_device, read, write, 0xff00) //i8251 RS232c / i8255 system port
AM_RANGE(0x0040, 0x0047) AM_DEVREADWRITE8("ppi8255_prn", i8255_device, read, write, 0x00ff)
AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("keyb", pc9801_kbd_device, rx_r, tx_w, 0xff00) //i8255 printer port / i8251 keyboard
@@ -1791,27 +1709,34 @@ static ADDRESS_MAP_START( pc9801_io, AS_IO, 16, pc9801_state )
AM_RANGE(0x0050, 0x0053) AM_WRITE8(nmi_ctrl_w,0x00ff) // NMI FF / i8255 floppy port (2d?)
AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE8("upd7220_chr", upd7220_device, read, write, 0x00ff) //upd7220 character ports / <undefined>
AM_RANGE(0x0064, 0x0065) AM_WRITE8(vrtc_clear_w,0x00ff)
- AM_RANGE(0x0068, 0x0069) AM_WRITE8(pc9801_video_ff_w,0x00ff) //mode FF / <undefined>
// AM_RANGE(0x006c, 0x006f) border color / <undefined>
AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("pit8253", pit8253_device, read, write, 0xff00)
AM_RANGE(0x0070, 0x007b) AM_READWRITE8(txt_scrl_r,txt_scrl_w,0x00ff) //display registers / i8253 pit
AM_RANGE(0x0080, 0x0081) AM_READWRITE8(sasi_data_r, sasi_data_w, 0x00ff)
AM_RANGE(0x0082, 0x0083) AM_READWRITE8(sasi_status_r, sasi_ctrl_w,0x00ff)
- AM_RANGE(0x0090, 0x0097) AM_READWRITE8(pc9801_fdc_2hd_r,pc9801_fdc_2hd_w,0xffff) //upd765a 2hd / cmt
- AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r,pc9801_a0_w,0xffff) //upd7220 bitmap ports / display registers
- AM_RANGE(0x00c8, 0x00cd) AM_READWRITE8(pc9801_fdc_2dd_r,pc9801_fdc_2dd_w,0xffff) //upd765a 2dd / <undefined>
-// AM_RANGE(0x0188, 0x018b) AM_READWRITE8(pc9801_opn_r,pc9801_opn_w,0xffff) //ym2203 opn / <undefined>
+ AM_RANGE(0x0090, 0x0091) AM_DEVREAD8("upd765_2hd", upd765a_device, msr_r, 0x00ff)
+ AM_RANGE(0x0092, 0x0093) AM_DEVREADWRITE8("upd765_2hd", upd765a_device, fifo_r, fifo_w, 0x00ff)
+ AM_RANGE(0x0094, 0x0095) AM_READWRITE8(fdc_2hd_ctrl_r, fdc_2hd_ctrl_w, 0x00ff)
+ AM_RANGE(0x0090, 0x0091) AM_DEVREADWRITE8(UPD8251_TAG, i8251_device, data_r, data_w, 0xff00)
+ AM_RANGE(0x0092, 0x0093) AM_DEVREADWRITE8(UPD8251_TAG, i8251_device, status_r, control_w, 0xff00)
AM_RANGE(0x7fd8, 0x7fdf) AM_DEVREADWRITE8("ppi8255_mouse", i8255_device, read, write, 0xff00)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( pc9801_io, AS_IO, 16, pc9801_state )
+ AM_RANGE(0x0020, 0x0027) AM_WRITE8(dmapg4_w,0xff00)
+ AM_RANGE(0x0068, 0x0069) AM_WRITE8(pc9801_video_ff_w,0x00ff) //mode FF / <undefined>
+ AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r,pc9801_a0_w,0xffff) //upd7220 bitmap ports / display registers
+ AM_RANGE(0x00c8, 0x00cb) AM_DEVICE8("upd765_2dd", upd765a_device, map, 0x00ff)
+ AM_RANGE(0x00cc, 0x00cd) AM_READWRITE8(fdc_2dd_ctrl_r, fdc_2dd_ctrl_w, 0x00ff) //upd765a 2dd / <undefined>
+ AM_IMPORT_FROM(pc9801_common_io)
+ADDRESS_MAP_END
+
/*************************************
*
* PC-9801RS specific handlers (IA-32)
*
************************************/
-READ8_MEMBER(pc9801_state::pc9801rs_ipl_r) { return m_ipl_rom[(offset & 0x1ffff)+(m_rom_bank*0x20000)]; }
-
/* TODO: it's possible that the offset calculation is actually linear. */
/* TODO: having this non-linear makes the system to boot in BASIC for PC-9821. Perhaps it stores settings? How to change these? */
READ8_MEMBER(pc9801_state::pc9801rs_knjram_r)
@@ -1863,7 +1788,7 @@ WRITE8_MEMBER(pc9801_state::pc9801rs_bank_w)
{
if((data & 0xed) == 0x00)
{
- m_rom_bank = (data & 2) >> 1;
+ m_ipl->set_bank((data & 2) >> 1);
return;
}
}
@@ -1886,7 +1811,7 @@ READ8_MEMBER(pc9801_state::a20_ctrl_r)
if(offset == 0x01)
return (m_gate_a20 ^ 1) | 0xfe;
else if(offset == 0x03)
- return (m_gate_a20 ^ 1) | (m_nmi_enable << 1);
+ return (m_gate_a20 ^ 1) | (m_nmi_ff << 1);
return 0x00;
}
@@ -1995,12 +1920,12 @@ WRITE16_MEMBER(pc9801_state::egc_w)
}
}
-READ8_MEMBER(pc9801_state::pc9810rs_fdc_ctrl_r)
+READ8_MEMBER(pc9801_state::fdc_mode_ctrl_r)
{
return (m_fdc_ctrl & 3) | 0xf0 | 8 | 4;
}
-WRITE8_MEMBER(pc9801_state::pc9810rs_fdc_ctrl_w)
+WRITE8_MEMBER(pc9801_state::fdc_mode_ctrl_w)
{
/*
---- x--- ready line?
@@ -2018,55 +1943,6 @@ WRITE8_MEMBER(pc9801_state::pc9810rs_fdc_ctrl_w)
// logerror("FDC ctrl called with %02x\n",data);
}
-READ8_MEMBER(pc9801_state::pc9801rs_2hd_r)
-{
- if((offset & 1) == 0)
- {
- switch(offset & 6)
- {
- case 0: return m_fdc_2hd->msr_r(space, 0, 0xff);
- case 2: return m_fdc_2hd->fifo_r(space, 0, 0xff);
- case 4: return 0x44; //2hd flag
- }
- }
-
- logerror("Read to undefined port [%02x]\n",offset+0x90);
-
- return 0xff;
-}
-
-WRITE8_MEMBER(pc9801_state::pc9801rs_2hd_w)
-{
- if((offset & 1) == 0)
- {
- switch(offset & 6)
- {
- case 2: m_fdc_2hd->fifo_w(space, 0, data, 0xff); return;
- case 4:
- if(data & 0x80)
- m_fdc_2hd->soft_reset();
-
- if(data & 0x40)
- {
- m_fdc_2hd->set_ready_line_connected(0);
- m_fdc_2hd->ready_w(0);
- }
- else
- m_fdc_2hd->set_ready_line_connected(1);
-
- //TODO: verify
- if(!(m_fdc_ctrl & 4))
- {
- m_fdc_2hd->subdevice<floppy_connector>("0")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
- m_fdc_2hd->subdevice<floppy_connector>("1")->get_device()->mon_w(data & 8 ? CLEAR_LINE : ASSERT_LINE);
- }
- return;
- }
- }
-
- logerror("Write to undefined port [%02x] %02x\n",offset+0x90,data);
-}
-
#if 0
READ8_MEMBER(pc9801_state::pc9801rs_2dd_r)
{
@@ -2156,7 +2032,7 @@ WRITE8_MEMBER(pc9801_state::pc9801rs_a0_w)
pc9801_a0_w(space,offset,data);
}
-READ8_MEMBER( pc9801_state::pc9801rs_access_ctrl_r )
+READ8_MEMBER( pc9801_state::access_ctrl_r )
{
if(offset == 1)
return m_access_ctrl;
@@ -2164,7 +2040,7 @@ READ8_MEMBER( pc9801_state::pc9801rs_access_ctrl_r )
return 0xff;
}
-WRITE8_MEMBER( pc9801_state::pc9801rs_access_ctrl_w )
+WRITE8_MEMBER( pc9801_state::access_ctrl_w )
{
if(offset == 1)
m_access_ctrl = data;
@@ -2180,17 +2056,7 @@ WRITE8_MEMBER( pc9801_state::pc9801rs_mouse_freq_w )
}
}
-
-WRITE8_MEMBER( pc9801_state::pc9801rs_nmi_w )
-{
- if(offset == 0)
- m_nmi_enable = 0;
-
- if(offset == 2)
- m_nmi_enable = 1;
-}
-
-READ8_MEMBER( pc9801_state::pc9801rs_midi_r )
+READ8_MEMBER( pc9801_state::midi_r )
{
/* unconnect, needed by Amaranth KH to boot */
return 0xff;
@@ -2230,51 +2096,54 @@ WRITE16_MEMBER(pc9801_state::grcg_gvram0_w)
upd7220_grcg_w(space, offset | (m_vram_bank << 16), data, mem_mask);
}
+static ADDRESS_MAP_START( ipl_bank, AS_0, 16, pc9801_state )
+ AM_RANGE(0x00000, 0x2ffff) AM_ROM AM_REGION("ipl", 0)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( pc9801ux_map, AS_PROGRAM, 16, pc9801_state )
AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("wram")
AM_RANGE(0x0a0000, 0x0a3fff) AM_READWRITE(tvram_r, tvram_w)
AM_RANGE(0x0a4000, 0x0a4fff) AM_READWRITE8(pc9801rs_knjram_r, pc9801rs_knjram_w, 0xffff)
AM_RANGE(0x0a8000, 0x0bffff) AM_READWRITE(grcg_gvram_r, grcg_gvram_w)
AM_RANGE(0x0e0000, 0x0e7fff) AM_READWRITE(grcg_gvram0_r,grcg_gvram0_w)
- AM_RANGE(0x0e0000, 0x0fffff) AM_READ8(pc9801rs_ipl_r, 0xffff)
+ AM_RANGE(0x0e8000, 0x0fffff) AM_DEVICE("ipl_bank", address_map_bank_device, amap16)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pc9801ux_io, AS_IO, 16, pc9801_state )
ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x0020, 0x002f) AM_WRITE8(dmapg8_w,0xff00)
AM_RANGE(0x0050, 0x0057) AM_NOP // 2dd ppi?
- AM_RANGE(0x005c, 0x005f) AM_READ(pc9821_timestamp_r) AM_WRITENOP // artic
+ AM_RANGE(0x005c, 0x005f) AM_READ(timestamp_r) AM_WRITENOP // artic
AM_RANGE(0x0068, 0x006b) AM_WRITE8(pc9801rs_video_ff_w,0x00ff) //mode FF / <undefined>
AM_RANGE(0x0070, 0x007f) AM_READWRITE8(grcg_r, grcg_w, 0x00ff) //display registers "GRCG" / i8253 pit
- AM_RANGE(0x0090, 0x0097) AM_READWRITE8(pc9801rs_2hd_r, pc9801rs_2hd_w, 0xffff)
AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r, pc9801rs_a0_w, 0xffff) //upd7220 bitmap ports / display registers
- AM_RANGE(0x00bc, 0x00bf) AM_READWRITE8(pc9810rs_fdc_ctrl_r,pc9810rs_fdc_ctrl_w,0xffff)
- AM_RANGE(0x00c8, 0x00cf) AM_READWRITE8(pc9801rs_2hd_r, pc9801rs_2hd_w, 0xffff)
+ AM_RANGE(0x00bc, 0x00bf) AM_READWRITE8(fdc_mode_ctrl_r,fdc_mode_ctrl_w,0xffff)
+ AM_RANGE(0x00c8, 0x00cb) AM_DEVICE8("upd765_2hd", upd765a_device, map, 0x00ff)
+ AM_RANGE(0x00cc, 0x00cd) AM_READWRITE8(fdc_2hd_ctrl_r, fdc_2hd_ctrl_w, 0x00ff)
AM_RANGE(0x00f0, 0x00ff) AM_READWRITE8(a20_ctrl_r, a20_ctrl_w, 0x00ff)
- AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffff)
- AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w, 0xffff) //ROM/RAM bank
+ AM_RANGE(0x0438, 0x043b) AM_READWRITE8(access_ctrl_r,access_ctrl_w,0xffff)
+ AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w, 0xffff) //ROM/RAM bank
AM_RANGE(0x04a0, 0x04af) AM_WRITE(egc_w)
AM_RANGE(0x3fd8, 0x3fdf) AM_DEVREADWRITE8("pit8253", pit8253_device, read, write, 0xff00)
-// AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffff)
- AM_IMPORT_FROM(pc9801_io)
+ AM_IMPORT_FROM(pc9801_common_io)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pc9801rs_map, AS_PROGRAM, 16, pc9801_state )
// AM_RANGE(0x0d8000, 0x0d9fff) AM_ROM AM_REGION("ide",0)
AM_RANGE(0x0da000, 0x0dbfff) AM_RAM // ide ram
- AM_RANGE(0xee0000, 0xefffff) AM_READ8(pc9801rs_ipl_r, 0xffff)
- AM_RANGE(0xfe0000, 0xffffff) AM_READ8(pc9801rs_ipl_r, 0xffff)
+ AM_RANGE(0xee8000, 0xefffff) AM_DEVICE("ipl_bank", address_map_bank_device, amap16)
+ AM_RANGE(0xfe8000, 0xffffff) AM_DEVICE("ipl_bank", address_map_bank_device, amap16)
AM_IMPORT_FROM(pc9801ux_map)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pc9801rs_io, AS_IO, 16, pc9801_state )
ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0050, 0x0053) AM_WRITE8(pc9801rs_nmi_w, 0xffff)
AM_RANGE(0x0430, 0x0433) AM_READWRITE8(ide_ctrl_r, ide_ctrl_w, 0x00ff)
AM_RANGE(0x0640, 0x064f) AM_READWRITE(ide_cs0_r, ide_cs0_w)
AM_RANGE(0x0740, 0x074f) AM_READWRITE(ide_cs1_r, ide_cs1_w)
AM_RANGE(0x1e8c, 0x1e8f) AM_NOP // temp
AM_RANGE(0xbfd8, 0xbfdf) AM_WRITE8(pc9801rs_mouse_freq_w, 0xffff)
- AM_RANGE(0xe0d0, 0xe0d3) AM_READ8(pc9801rs_midi_r, 0xffff)
+ AM_RANGE(0xe0d0, 0xe0d3) AM_READ8(midi_r, 0xffff)
AM_IMPORT_FROM(pc9801ux_io)
ADDRESS_MAP_END
@@ -2288,6 +2157,8 @@ WRITE8_MEMBER(pc9801_state::pc9821_video_ff_w)
{
if(offset == 1)
{
+ if(((data & 0xfe) == 4) && !m_ex_video_ff[3]) // TODO: many other settings are protected
+ return;
m_ex_video_ff[(data & 0xfe) >> 1] = data & 1;
//if((data & 0xfe) == 0x20)
@@ -2348,7 +2219,7 @@ WRITE8_MEMBER(pc9801_state::pc9821_a0_w)
pc9801rs_a0_w(space,offset,data);
}
-READ8_MEMBER(pc9801_state::pc9821_window_bank_r)
+READ8_MEMBER(pc9801_state::window_bank_r)
{
if(offset == 1)
return m_pc9821_window_bank & 0xfe;
@@ -2356,7 +2227,7 @@ READ8_MEMBER(pc9801_state::pc9821_window_bank_r)
return 0xff;
}
-WRITE8_MEMBER(pc9801_state::pc9821_window_bank_w)
+WRITE8_MEMBER(pc9801_state::window_bank_w)
{
if(offset == 1)
m_pc9821_window_bank = data & 0xfe;
@@ -2420,13 +2291,13 @@ WRITE8_MEMBER(pc9801_state::sdip_b_w)
logerror("SDIP area B write %02x %02x\n",offset,data);
}
-READ16_MEMBER(pc9801_state::pc9821_timestamp_r)
+READ16_MEMBER(pc9801_state::timestamp_r)
{
return (m_maincpu->total_cycles() >> (16 * offset));
}
/* basically a read-back of various registers */
-READ8_MEMBER(pc9801_state::pc9821_ext2_video_ff_r)
+READ8_MEMBER(pc9801_state::ext2_video_ff_r)
{
UINT8 res;
@@ -2442,7 +2313,7 @@ READ8_MEMBER(pc9801_state::pc9821_ext2_video_ff_r)
return res;
}
-WRITE8_MEMBER(pc9801_state::pc9821_ext2_video_ff_w)
+WRITE8_MEMBER(pc9801_state::ext2_video_ff_w)
{
m_ext2_ff = data;
}
@@ -2469,50 +2340,53 @@ static ADDRESS_MAP_START( pc9821_map, AS_PROGRAM, 32, pc9801_state )
// AM_RANGE(0x000d8000, 0x000d9fff) AM_ROM AM_REGION("ide",0)
AM_RANGE(0x000da000, 0x000dbfff) AM_RAM // ide ram
AM_RANGE(0x000e0000, 0x000e7fff) AM_READWRITE16(grcg_gvram0_r,grcg_gvram0_w, 0xffffffff)
- AM_RANGE(0x000e0000, 0x000fffff) AM_READ8(pc9801rs_ipl_r, 0xffffffff)
+ AM_RANGE(0x000e8000, 0x000fffff) AM_DEVICE16("ipl_bank", address_map_bank_device, amap16, 0xffffffff)
AM_RANGE(0x00f00000, 0x00f9ffff) AM_RAM AM_SHARE("ext_gvram")
- AM_RANGE(0xffee0000, 0xffefffff) AM_READ8(pc9801rs_ipl_r, 0xffffffff)
- AM_RANGE(0xfffe0000, 0xffffffff) AM_READ8(pc9801rs_ipl_r, 0xffffffff)
+ AM_RANGE(0xffee8000, 0xffefffff) AM_DEVICE16("ipl_bank", address_map_bank_device, amap16, 0xffffffff)
+ AM_RANGE(0xfffe8000, 0xffffffff) AM_DEVICE16("ipl_bank", address_map_bank_device, amap16, 0xffffffff)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pc9821_io, AS_IO, 32, pc9801_state )
// ADDRESS_MAP_UNMAP_HIGH // TODO: a read to somewhere makes this to fail at POST
AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("i8237", am9517a_device, read, write, 0xff00ff00)
AM_RANGE(0x0000, 0x000f) AM_READWRITE8(pic_r, pic_w, 0x00ff00ff) // i8259 PIC (bit 3 ON slave / master) / i8237 DMA
- AM_RANGE(0x0020, 0x0027) AM_WRITE8(rtc_dmapg_w, 0xffffffff) // RTC / DMA registers (LS244)
+ AM_RANGE(0x0020, 0x0023) AM_WRITE8(rtc_w,0x000000ff)
+ AM_RANGE(0x0020, 0x002f) AM_WRITE8(dmapg8_w,0xff00ff00)
AM_RANGE(0x0030, 0x0037) AM_DEVREADWRITE8("ppi8255_sys", i8255_device, read, write, 0xff00ff00) //i8251 RS232c / i8255 system port
AM_RANGE(0x0040, 0x0047) AM_DEVREADWRITE8("ppi8255_prn", i8255_device, read, write, 0x00ff00ff)
AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("keyb", pc9801_kbd_device, rx_r, tx_w, 0xff00ff00) //i8255 printer port / i8251 keyboard
- AM_RANGE(0x0050, 0x0053) AM_WRITE8(pc9801rs_nmi_w, 0xffffffff)
- AM_RANGE(0x005c, 0x005f) AM_READ16(pc9821_timestamp_r,0xffffffff) AM_WRITENOP // artic
+ AM_RANGE(0x0050, 0x0053) AM_WRITE8(nmi_ctrl_w, 0x00ff00ff)
+ AM_RANGE(0x005c, 0x005f) AM_READ16(timestamp_r,0xffffffff) AM_WRITENOP // artic
AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE8("upd7220_chr", upd7220_device, read, write, 0x00ff00ff) //upd7220 character ports / <undefined>
AM_RANGE(0x0060, 0x0063) AM_READ8(unk_r, 0xff00ff00) // mouse related (unmapped checking for AT keyb controller\PS/2 mouse?)
AM_RANGE(0x0064, 0x0067) AM_WRITE8(vrtc_clear_w, 0x000000ff)
AM_RANGE(0x0068, 0x006b) AM_WRITE8(pc9821_video_ff_w, 0x00ff00ff) //mode FF / <undefined>
AM_RANGE(0x0070, 0x007f) AM_DEVREADWRITE8("pit8253", pit8253_device, read, write, 0xff00ff00)
AM_RANGE(0x0070, 0x007f) AM_READWRITE8(grcg_r, grcg_w, 0x00ff00ff) //display registers "GRCG" / i8253 pit
- AM_RANGE(0x0090, 0x0097) AM_READWRITE8(pc9801rs_2hd_r, pc9801rs_2hd_w, 0xffffffff)
+ AM_RANGE(0x0090, 0x0093) AM_DEVICE8("upd765_2hd", upd765a_device, map, 0x00ff00ff)
+ AM_RANGE(0x0094, 0x0097) AM_READWRITE8(fdc_2hd_ctrl_r, fdc_2hd_ctrl_w, 0x000000ff)
AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9821_a0_r, pc9821_a0_w, 0xffffffff) //upd7220 bitmap ports / display registers
// AM_RANGE(0x00b0, 0x00b3) PC9861k (serial port?)
// AM_RANGE(0x00b9, 0x00b9) PC9861k
// AM_RANGE(0x00bb, 0x00bb) PC9861k
- AM_RANGE(0x00bc, 0x00bf) AM_READWRITE8(pc9810rs_fdc_ctrl_r,pc9810rs_fdc_ctrl_w,0xffffffff)
- AM_RANGE(0x00c8, 0x00cf) AM_READWRITE8(pc9801rs_2hd_r, pc9801rs_2hd_w, 0xffffffff)
-// AM_RANGE(0x00d8, 0x00df) AMD98 (sound?) board
+ AM_RANGE(0x00bc, 0x00bf) AM_READWRITE8(fdc_mode_ctrl_r,fdc_mode_ctrl_w,0xffffffff)
+ AM_RANGE(0x00c8, 0x00cb) AM_DEVICE8("upd765_2hd", upd765a_device, map, 0x00ff00ff)
+ AM_RANGE(0x00cc, 0x00cf) AM_READWRITE8(fdc_2hd_ctrl_r, fdc_2hd_ctrl_w, 0x000000ff)
+ // AM_RANGE(0x00d8, 0x00df) AMD98 (sound?) board
AM_RANGE(0x00f0, 0x00ff) AM_READWRITE8(a20_ctrl_r, a20_ctrl_w, 0x00ff00ff)
// AM_RANGE(0x0188, 0x018f) AM_READWRITE8(pc9801_opn_r, pc9801_opn_w, 0xffffffff) //ym2203 opn / <undefined>
// AM_RANGE(0x018c, 0x018f) YM2203 OPN extended ports / <undefined>
AM_RANGE(0x0430, 0x0433) AM_READWRITE8(ide_ctrl_r, ide_ctrl_w, 0x00ff00ff)
- AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff)
+ AM_RANGE(0x0438, 0x043b) AM_READWRITE8(access_ctrl_r,access_ctrl_w,0xffffffff)
// AM_RANGE(0x043d, 0x043d) ROM/RAM bank (NEC)
AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w, 0xffffffff) //ROM/RAM bank (EPSON)
- AM_RANGE(0x0460, 0x0463) AM_READWRITE8(pc9821_window_bank_r,pc9821_window_bank_w, 0xffffffff)
+ AM_RANGE(0x0460, 0x0463) AM_READWRITE8(window_bank_r,window_bank_w, 0xffffffff)
AM_RANGE(0x04a0, 0x04af) AM_WRITE16(egc_w, 0xffffffff)
// AM_RANGE(0x04be, 0x04be) FDC "RPM" register
AM_RANGE(0x0640, 0x064f) AM_READWRITE16(ide_cs0_r, ide_cs0_w, 0xffffffff)
AM_RANGE(0x0740, 0x074f) AM_READWRITE16(ide_cs1_r, ide_cs1_w, 0xffffffff)
// AM_RANGE(0x08e0, 0x08ea) <undefined> / EMM SIO registers
- AM_RANGE(0x09a0, 0x09a3) AM_READWRITE8(pc9821_ext2_video_ff_r, pc9821_ext2_video_ff_w, 0x000000ff) // GDC extended register r/w
+ AM_RANGE(0x09a0, 0x09a3) AM_READWRITE8(ext2_video_ff_r, ext2_video_ff_w, 0x000000ff) // GDC extended register r/w
// AM_RANGE(0x09a8, 0x09a8) GDC 31KHz register r/w
// AM_RANGE(0x0c07, 0x0c07) EPSON register w
// AM_RANGE(0x0c03, 0x0c03) EPSON register 0 r
@@ -2537,7 +2411,6 @@ static ADDRESS_MAP_START( pc9821_io, AS_IO, 32, pc9801_state )
AM_RANGE(0x8d1c, 0x8d1f) AM_READWRITE8(sdip_9_r,sdip_9_w,0xffffffff)
AM_RANGE(0x8e1c, 0x8e1f) AM_READWRITE8(sdip_a_r,sdip_a_w,0xffffffff)
AM_RANGE(0x8f1c, 0x8f1f) AM_READWRITE8(sdip_b_r,sdip_b_w,0xffffffff)
-// AM_RANGE(0xa460, 0xa463) AM_READWRITE8(pc9801_ext_opna_r, pc9801_ext_opna_w, 0xffffffff)
// AM_RANGE(0xa460, 0xa46f) cs4231 PCM extended port / <undefined>
// AM_RANGE(0xbfdb, 0xbfdb) mouse timing port
// AM_RANGE(0xc0d0, 0xc0d3) MIDI port, option 0 / <undefined>
@@ -2548,7 +2421,7 @@ static ADDRESS_MAP_START( pc9821_io, AS_IO, 32, pc9801_state )
// AM_RANGE(0xd4d0, 0xd4d3) MIDI port, option 5 / <undefined>
// AM_RANGE(0xd8d0, 0xd8d3) MIDI port, option 6 / <undefined>
// AM_RANGE(0xdcd0, 0xdcd3) MIDI port, option 7 / <undefined>
- AM_RANGE(0xe0d0, 0xe0d3) AM_READ8(pc9801rs_midi_r, 0xffffffff) // MIDI port, option 8 / <undefined>
+ AM_RANGE(0xe0d0, 0xe0d3) AM_READ8(midi_r, 0xffffffff) // MIDI port, option 8 / <undefined>
// AM_RANGE(0xe4d0, 0xe4d3) MIDI port, option 9 / <undefined>
// AM_RANGE(0xe8d0, 0xe8d3) MIDI port, option A / <undefined>
// AM_RANGE(0xecd0, 0xecd3) MIDI port, option B / <undefined>
@@ -2559,7 +2432,7 @@ static ADDRESS_MAP_START( pc9821_io, AS_IO, 32, pc9801_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( upd7220_1_map, AS_0, 16, pc9801_state )
- AM_RANGE(0x00000, 0x3ffff) AM_RAM AM_SHARE("video_ram_1")
+ AM_RANGE(0x00000, 0x03fff) AM_RAM AM_SHARE("video_ram_1")
ADDRESS_MAP_END
static ADDRESS_MAP_START( upd7220_2_map, AS_0, 16, pc9801_state )
@@ -2883,6 +2756,21 @@ READ8_MEMBER(pc9801_state::dma_read_byte)
{
address_space &program = m_maincpu->space(AS_PROGRAM);
offs_t addr = (m_dma_offset[m_dack] << 16) | offset;
+ if(offset == 0xffff)
+ {
+ switch(m_dma_autoinc[m_dack])
+ {
+ case 1:
+ {
+ UINT8 page = m_dma_offset[m_dack];
+ m_dma_offset[m_dack] = ((page + 1) & 0xf) | (page & 0xf0);
+ break;
+ }
+ case 3:
+ m_dma_offset[m_dack]++;
+ break;
+ }
+ }
// logerror("%08x\n",addr);
@@ -2894,7 +2782,21 @@ WRITE8_MEMBER(pc9801_state::dma_write_byte)
{
address_space &program = m_maincpu->space(AS_PROGRAM);
offs_t addr = (m_dma_offset[m_dack] << 16) | offset;
-
+ if(offset == 0xffff)
+ {
+ switch(m_dma_autoinc[m_dack])
+ {
+ case 1:
+ {
+ UINT8 page = m_dma_offset[m_dack];
+ m_dma_offset[m_dack] = ((page + 1) & 0xf) | (page & 0xf0);
+ break;
+ }
+ case 3:
+ m_dma_offset[m_dack]++;
+ break;
+ }
+ }
// logerror("%08x %02x\n",addr,data);
program.write_byte(addr, data);
@@ -3033,7 +2935,7 @@ WRITE_LINE_MEMBER( pc9801_state::pc9801rs_fdc_drq )
m_dmac->dreq3_w(state ^ 1);
}
-UINT32 pc9801_state::pc9801_286_a20(bool state)
+UINT32 pc9801_state::a20_286(bool state)
{
return (state ? 0xffffff : 0x0fffff);
}
@@ -3060,7 +2962,6 @@ MACHINE_START_MEMBER(pc9801_state,pc9801_common)
m_rtc->cs_w(1);
m_rtc->oe_w(1);
- m_ipl_rom = memregion("ipl")->base();
m_vbirq = timer_alloc(TIMER_VBIRQ);
save_item(NAME(m_sasi_data));
@@ -3139,6 +3040,7 @@ MACHINE_RESET_MEMBER(pc9801_state,pc9801_common)
m_mouse.control = 0xff;
m_mouse.freq_reg = 0;
m_mouse.freq_index = 0;
+ m_dma_autoinc[0] = m_dma_autoinc[1] = m_dma_autoinc[2] = m_dma_autoinc[3] = 0;
memset(&m_egc, 0, sizeof(m_egc));
}
@@ -3169,13 +3071,10 @@ MACHINE_RESET_MEMBER(pc9801_state,pc9801rs)
MACHINE_RESET_CALL_MEMBER(pc9801_common);
m_gate_a20 = 0;
- m_rom_bank = 0;
m_fdc_ctrl = 3;
m_access_ctrl = 0;
m_ide_sel = 0;
m_ide1_irq = m_ide2_irq = false;
- m_keyb_press = 0xff; // temp kludge, for PC-9821 booting
-// m_has_opna = ioport("SOUND_CONFIG")->read() & 1;
m_maincpu->set_input_line(INPUT_LINE_A20, m_gate_a20);
if(memregion("ide"))
@@ -3202,7 +3101,7 @@ void pc9801_state::device_reset_after_children()
ide0->identify_device_buffer()[47] = 0;
}
-INTERRUPT_GEN_MEMBER(pc9801_state::pc9801_vrtc_irq)
+INTERRUPT_GEN_MEMBER(pc9801_state::vrtc_irq)
{
m_pic1->ir2_w(1);
m_vbirq->adjust(m_screen->time_until_vblank_end());
@@ -3370,7 +3269,7 @@ static MACHINE_CONFIG_START( pc9801, pc9801_state )
MCFG_CPU_ADD("maincpu", I8086, 5000000) //unknown clock
MCFG_CPU_PROGRAM_MAP(pc9801_map)
MCFG_CPU_IO_MAP(pc9801_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
MCFG_FRAGMENT_ADD(pc9801_common)
@@ -3400,25 +3299,23 @@ static MACHINE_CONFIG_START( pc9801, pc9801_state )
MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( pc9801vm, pc9801 )
- MCFG_CPU_REPLACE("maincpu",V30,10000000)
- MCFG_CPU_PROGRAM_MAP(pc9801ux_map)
- MCFG_CPU_IO_MAP(pc9801ux_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
-
- MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801_common)
- MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801_common)
-MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc9801rs, pc9801_state )
MCFG_CPU_ADD("maincpu", I386SX, MAIN_CLOCK_X1*8) // unknown clock.
MCFG_CPU_PROGRAM_MAP(pc9801rs_map)
MCFG_CPU_IO_MAP(pc9801rs_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
MCFG_FRAGMENT_ADD(pc9801_common)
+ MCFG_DEVICE_ADD("ipl_bank", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(ipl_bank)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(16)
+ MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(18)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x18000)
+
MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801rs)
MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801rs)
@@ -3430,7 +3327,7 @@ static MACHINE_CONFIG_START( pc9801rs, pc9801_state )
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("1664K")
- MCFG_RAM_EXTRA_OPTIONS("640K,3712K,7808K")
+ MCFG_RAM_EXTRA_OPTIONS("640K,3712K,7808K,14M")
MCFG_DEVICE_MODIFY("upd7220_btm")
MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_grcg_2_map)
@@ -3439,12 +3336,26 @@ static MACHINE_CONFIG_START( pc9801rs, pc9801_state )
MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( pc9801vm, pc9801rs )
+ MCFG_CPU_REPLACE("maincpu",V30,10000000)
+ MCFG_CPU_PROGRAM_MAP(pc9801ux_map)
+ MCFG_CPU_IO_MAP(pc9801ux_io)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
+
+ MCFG_DEVICE_MODIFY(RAM_TAG)
+ MCFG_RAM_DEFAULT_SIZE("640K")
+ MCFG_RAM_EXTRA_OPTIONS("640K")
+
+ MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801_common)
+ MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801_common)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( pc9801ux, pc9801rs )
MCFG_CPU_REPLACE("maincpu",I80286,10000000)
MCFG_CPU_PROGRAM_MAP(pc9801ux_map)
MCFG_CPU_IO_MAP(pc9801ux_io)
- MCFG_80286_A20(pc9801_state, pc9801_286_a20)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_80286_A20(pc9801_state, a20_286)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
// MCFG_DEVICE_MODIFY("i8237", AM9157A, 10000000) // unknown clock
MACHINE_CONFIG_END
@@ -3453,7 +3364,7 @@ static MACHINE_CONFIG_DERIVED( pc9801bx2, pc9801rs )
MCFG_CPU_REPLACE("maincpu",I486,25000000)
MCFG_CPU_PROGRAM_MAP(pc9821_map)
MCFG_CPU_IO_MAP(pc9821_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801bx2)
@@ -3463,7 +3374,7 @@ static MACHINE_CONFIG_DERIVED( pc9821, pc9801rs )
MCFG_CPU_REPLACE("maincpu", I486, 16000000) // unknown clock
MCFG_CPU_PROGRAM_MAP(pc9821_map)
MCFG_CPU_IO_MAP(pc9821_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
MCFG_DEVICE_MODIFY("pit8253")
@@ -3486,7 +3397,7 @@ static MACHINE_CONFIG_DERIVED( pc9821ap2, pc9821)
MCFG_CPU_REPLACE("maincpu", I486, 66666667) // unknown clock
MCFG_CPU_PROGRAM_MAP(pc9821_map)
MCFG_CPU_IO_MAP(pc9821_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9821ap2)
@@ -3496,7 +3407,7 @@ static MACHINE_CONFIG_DERIVED( pc9821v20, pc9821 )
MCFG_CPU_REPLACE("maincpu",PENTIUM,32000000) /* TODO: clock */
MCFG_CPU_PROGRAM_MAP(pc9821_map)
MCFG_CPU_IO_MAP(pc9821_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, vrtc_irq)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_master", pic8259_device, inta_cb)
MACHINE_CONFIG_END
@@ -3562,9 +3473,9 @@ UX - 80286 10 + V30 8
*/
ROM_START( pc9801ux )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf_ux.rom", 0x18000, 0x08000, CRC(c7942563) SHA1(61bb210d64c7264be939b11df1e9cd14ffeee3c9) )
- ROM_LOAD( "bios_ux.rom", 0x28000, 0x18000, BAD_DUMP CRC(97375ca2) SHA1(bfe458f671d90692104d0640730972ca8dc0a100) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf_ux.rom", 0x10000, 0x08000, CRC(c7942563) SHA1(61bb210d64c7264be939b11df1e9cd14ffeee3c9) )
+ ROM_LOAD( "bios_ux.rom", 0x18000, 0x18000, BAD_DUMP CRC(97375ca2) SHA1(bfe458f671d90692104d0640730972ca8dc0a100) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_ux.rom", 0x0000, 0x4000, CRC(80eabfde) SHA1(e09c54152c8093e1724842c711aed6417169db23) )
@@ -3583,11 +3494,11 @@ The bios is from a 386 model not an RX
*/
ROM_START( pc9801rx )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf_rs.rom", 0x18000, 0x08000, BAD_DUMP CRC(c1815325) SHA1(a2fb11c000ed7c976520622cfb7940ed6ddc904e) )
- ROM_LOAD( "bios_rx.rom", 0x28000, 0x018000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf_rs.rom", 0x10000, 0x08000, BAD_DUMP CRC(c1815325) SHA1(a2fb11c000ed7c976520622cfb7940ed6ddc904e) )
+ ROM_LOAD( "bios_rx.rom", 0x18000, 0x18000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
// fix csum
- ROM_FILL(0x3fffe, 1, 0x0d)
+ ROM_FILL(0x2fffe, 1, 0x0d)
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_rx.rom", 0x000000, 0x004000, CRC(fe9f57f2) SHA1(d5dbc4fea3b8367024d363f5351baecd6adcd8ef) )
@@ -3606,9 +3517,9 @@ RS - 386SX 16
*/
ROM_START( pc9801rs )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf_rs.rom", 0x18000, 0x08000, CRC(c1815325) SHA1(a2fb11c000ed7c976520622cfb7940ed6ddc904e) )
- ROM_LOAD( "bios_rs.rom", 0x28000, 0x18000, BAD_DUMP CRC(315d2703) SHA1(4f208d1dbb68373080d23bff5636bb6b71eb7565) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf_rs.rom", 0x10000, 0x08000, CRC(c1815325) SHA1(a2fb11c000ed7c976520622cfb7940ed6ddc904e) )
+ ROM_LOAD( "bios_rs.rom", 0x18000, 0x18000, BAD_DUMP CRC(315d2703) SHA1(4f208d1dbb68373080d23bff5636bb6b71eb7565) )
/* following is an emulator memory dump, should be checked and nuked */
ROM_REGION( 0x100000, "memory", 0 )
@@ -3638,12 +3549,12 @@ Yet another franken-dump done with a lame program, shrug
*/
ROM_START( pc9801bx2 )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
ROM_LOAD( "pc98bank0.bin", 0x00000, 0x08000, BAD_DUMP CRC(bfd100cc) SHA1(cf8e6a5679cca7761481abef0ba4b35ead39efdb) )
ROM_LOAD( "pc98bank1.bin", 0x00000, 0x08000, BAD_DUMP CRC(d0562af8) SHA1(2c4fd27eb598f4b8a00f3e86941ba27007d58e47) )
ROM_LOAD( "pc98bank2.bin", 0x00000, 0x08000, BAD_DUMP CRC(12818a14) SHA1(9c31e8ac85d78fa779d6bbc2095557065294ec09) )
ROM_LOAD( "pc98bank3.bin", 0x00000, 0x08000, BAD_DUMP CRC(d0bda44e) SHA1(c1022a3b2be4d2a1e43914df9e4605254e5f99d5) )
- ROM_LOAD( "pc98bank4.bin", 0x18000, 0x08000, BAD_DUMP CRC(be8092f4) SHA1(12c8a166b8c6ebbef85568b67e1f098562883365) )
+ ROM_LOAD( "pc98bank4.bin", 0x10000, 0x08000, BAD_DUMP CRC(be8092f4) SHA1(12c8a166b8c6ebbef85568b67e1f098562883365) )
ROM_LOAD( "pc98bank5.bin", 0x00000, 0x08000, BAD_DUMP CRC(4e32081e) SHA1(e23571273b7cad01aa116cb7414c5115a1093f85) )
ROM_LOAD( "pc98bank6.bin", 0x00000, 0x08000, BAD_DUMP CRC(f878c160) SHA1(cad47f09075ffe4f7b51bb937c9f716c709d4596) )
ROM_LOAD( "pc98bank7.bin", 0x00000, 0x08000, BAD_DUMP CRC(1bd6537b) SHA1(ff9ee1c976a12b87851635ce8991ac4ad607675b) )
@@ -3665,9 +3576,9 @@ TODO: this ISN'T a real VM model!
*/
ROM_START( pc9801vm )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf_ux.rom", 0x18000, 0x08000, BAD_DUMP CRC(c7942563) SHA1(61bb210d64c7264be939b11df1e9cd14ffeee3c9) )
- ROM_LOAD( "bios_vm.rom", 0x28000, 0x018000, CRC(2e2d7cee) SHA1(159549f845dc70bf61955f9469d2281a0131b47f) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf_ux.rom", 0x10000, 0x08000, BAD_DUMP CRC(c7942563) SHA1(61bb210d64c7264be939b11df1e9cd14ffeee3c9) )
+ ROM_LOAD( "bios_vm.rom", 0x18000, 0x18000, CRC(2e2d7cee) SHA1(159549f845dc70bf61955f9469d2281a0131b47f) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_vm.rom", 0x000000, 0x004000, CRC(fe9f57f2) SHA1(d5dbc4fea3b8367024d363f5351baecd6adcd8ef) )
@@ -3686,9 +3597,13 @@ ROM_END
*/
ROM_START( pc9821 )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf.rom", 0x18000, 0x08000, CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
- ROM_LOAD( "bios.rom", 0x28000, 0x18000, BAD_DUMP CRC(34a19a59) SHA1(2e92346727b0355bc1ec9a7ded1b444a4917f2b9) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf.rom", 0x10000, 0x08000, CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
+ ROM_LOAD( "bios.rom", 0x18000, 0x18000, BAD_DUMP CRC(34a19a59) SHA1(2e92346727b0355bc1ec9a7ded1b444a4917f2b9) )
+ ROM_FILL(0x24c40, 4, 0) // hide the _32_ marker until we have a 32-bit clean IDE bios otherwise windows tries to
+ // make a 32-bit call into 16-bit code
+ ROM_FILL(0x27ffe, 1, 0x92)
+ ROM_FILL(0x27fff, 1, 0xd7)
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound.rom", 0x0000, 0x4000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) )
@@ -3705,9 +3620,9 @@ As - 80486DX 33
*/
ROM_START( pc9821as )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf.rom", 0x18000, 0x08000, BAD_DUMP CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
- ROM_LOAD( "bios_as.rom", 0x28000, 0x018000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf.rom", 0x10000, 0x08000, BAD_DUMP CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
+ ROM_LOAD( "bios_as.rom", 0x18000, 0x18000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_as.rom", 0x000000, 0x004000, CRC(fe9f57f2) SHA1(d5dbc4fea3b8367024d363f5351baecd6adcd8ef) )
@@ -3737,9 +3652,9 @@ ROM_START( pc9821ap2 )
ROM_SYSTEM_BIOS(1, "phd0102", "PHD0102")
ROMX_LOAD( "phd0102.rom", 0x000000, 0x80000, CRC(3036774c) SHA1(59856a348f156adf5eca06326f967aca54ff871c), ROM_BIOS(2) )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF ) // TODO: identify ROM banks
- ROM_COPY( "biosrom", 0x20000, 0x18000, 0x08000 )
- ROM_COPY( "biosrom", 0x30000, 0x28000, 0x18000 )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF ) // TODO: identify ROM banks
+ ROM_COPY( "biosrom", 0x20000, 0x10000, 0x08000 )
+ ROM_COPY( "biosrom", 0x30000, 0x18000, 0x18000 )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound.rom", 0x0000, 0x4000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) )
@@ -3757,9 +3672,9 @@ ROM_END
*/
ROM_START( pc9821ne )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf.rom", 0x18000, 0x08000, CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
- ROM_LOAD( "bios_ne.rom", 0x28000, 0x18000, BAD_DUMP CRC(2ae070c4) SHA1(d7963942042bfd84ed5fc9b7ba8f1c327c094172) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf.rom", 0x10000, 0x08000, CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
+ ROM_LOAD( "bios_ne.rom", 0x18000, 0x18000, BAD_DUMP CRC(2ae070c4) SHA1(d7963942042bfd84ed5fc9b7ba8f1c327c094172) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_ne.rom", 0x0000, 0x4000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) )
@@ -3776,9 +3691,9 @@ Epson PC-486MU - 486 based, unknown clock
*/
ROM_START( pc486mu )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "bios_486mu.rom", 0x08000, 0x18000, BAD_DUMP CRC(57b5d701) SHA1(15029800842e93e07615b0fd91fb9f2bfe3e3c24))
- ROM_RELOAD( 0x28000, 0x18000 ) // missing rom?
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "bios_486mu.rom", 0x00000, 0x18000, BAD_DUMP CRC(57b5d701) SHA1(15029800842e93e07615b0fd91fb9f2bfe3e3c24))
+ ROM_RELOAD( 0x18000, 0x18000 ) // missing rom?
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_486mu.rom", 0x0000, 0x4000, CRC(6cdfa793) SHA1(4b8250f9b9db66548b79f961d61010558d6d6e1c))
@@ -3795,9 +3710,9 @@ ROM_END
*/
ROM_START( pc9821ce2 )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf_ce2.rom", 0x18000, 0x08000, CRC(273e9e88) SHA1(9bca7d5116788776ed0f297bccb4dfc485379b41) )
- ROM_LOAD( "bios_ce2.rom", 0x28000, 0x018000, BAD_DUMP CRC(76affd90) SHA1(910fae6763c0cd59b3957b6cde479c72e21f33c1) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf_ce2.rom", 0x10000, 0x08000, CRC(273e9e88) SHA1(9bca7d5116788776ed0f297bccb4dfc485379b41) )
+ ROM_LOAD( "bios_ce2.rom", 0x18000, 0x018000, BAD_DUMP CRC(76affd90) SHA1(910fae6763c0cd59b3957b6cde479c72e21f33c1) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_ce2.rom", 0x000000, 0x004000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) )
@@ -3814,9 +3729,9 @@ ROM_END
*/
ROM_START( pc9821xs )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf.rom", 0x18000, 0x08000, BAD_DUMP CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
- ROM_LOAD( "bios_xs.rom", 0x28000, 0x018000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf.rom", 0x10000, 0x08000, BAD_DUMP CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
+ ROM_LOAD( "bios_xs.rom", 0x18000, 0x018000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_xs.rom", 0x000000, 0x004000, CRC(80eabfde) SHA1(e09c54152c8093e1724842c711aed6417169db23) )
@@ -3834,9 +3749,9 @@ ROM_END
*/
ROM_START( pc9821v13 )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf.rom", 0x18000, 0x08000, CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
- ROM_LOAD( "bios_v13.rom", 0x28000, 0x18000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf.rom", 0x10000, 0x08000, CRC(dd4c7bb8) SHA1(cf3aa193df2722899066246bccbed03f2e79a74a) )
+ ROM_LOAD( "bios_v13.rom", 0x18000, 0x18000, BAD_DUMP CRC(0a682b93) SHA1(76a7360502fa0296ea93b4c537174610a834d367) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_v13.rom", 0x0000, 0x4000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) )
@@ -3853,9 +3768,9 @@ ROM_END
*/
ROM_START( pc9821v20 )
- ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF )
- ROM_LOAD( "itf_v20.rom", 0x38000, 0x08000, CRC(10e52302) SHA1(f95b8648e3f5a23e507a9fbda8ab2e317d8e5151) )
- ROM_LOAD( "bios_v20.rom", 0x08000, 0x018000, BAD_DUMP CRC(d5d1f13b) SHA1(bf44b5f4e138e036f1b848d6616fbd41b5549764) )
+ ROM_REGION( 0x30000, "ipl", ROMREGION_ERASEFF )
+ ROM_LOAD( "itf_v20.rom", 0x10000, 0x08000, CRC(10e52302) SHA1(f95b8648e3f5a23e507a9fbda8ab2e317d8e5151) )
+ ROM_LOAD( "bios_v20.rom", 0x18000, 0x18000, BAD_DUMP CRC(d5d1f13b) SHA1(bf44b5f4e138e036f1b848d6616fbd41b5549764) )
ROM_REGION( 0x10000, "sound_bios", 0 )
ROM_LOAD( "sound_v20.rom", 0x000000, 0x004000, CRC(80eabfde) SHA1(e09c54152c8093e1724842c711aed6417169db23) )
diff --git a/src/mame/drivers/rex6000.cpp b/src/mame/drivers/rex6000.cpp
index 8709a578991..711571ea3c8 100644
--- a/src/mame/drivers/rex6000.cpp
+++ b/src/mame/drivers/rex6000.cpp
@@ -29,6 +29,7 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/rp5c01.h"
+#include "machine/bankdev.h"
#include "machine/ram.h"
#include "machine/intelfsh.h"
#include "imagedev/snapquik.h"
@@ -46,14 +47,6 @@
#define IRQ_FLAG_IRQ1 0x40
#define IRQ_FLAG_EVENT 0x80
-//memory bank types
-#define BANK_FLASH0_B0 0x00
-#define BANK_FLASH0_B1 0x01
-#define BANK_FLASH1_B0 0x02
-#define BANK_FLASH1_B1 0x03
-#define BANK_RAM 0x10
-#define BANK_UNKNOWN 0xff
-
#define TC8521_TAG "rtc"
class rex6000_state : public driver_device
@@ -63,13 +56,20 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_ram(*this, RAM_TAG),
- m_beep(*this, "beeper")
+ m_beep(*this, "beeper"),
+ m_bankdev0(*this, "bank0"),
+ m_bankdev1(*this, "bank1"),
+ m_flash0b(*this, "flash0b"),
+ m_nvram(*this, "nvram")
{ }
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
required_device<beep_device> m_beep;
- fujitsu_29dl16x_device *m_flash[4];
+ required_device<address_map_bank_device> m_bankdev0;
+ required_device<address_map_bank_device> m_bankdev1;
+ optional_device<intelfsh8_device> m_flash0b;
+ required_shared_ptr<UINT8> m_nvram;
UINT8 m_bank[4];
UINT8 m_beep_io[5];
@@ -77,19 +77,12 @@ public:
UINT8 m_touchscreen[0x10];
UINT8 m_lcd_enabled;
UINT8 m_lcd_cmd;
- UINT8 *m_ram_base;
UINT8 m_irq_mask;
UINT8 m_irq_flag;
UINT8 m_port6;
UINT8 m_beep_mode;
- struct
- {
- UINT8 type;
- UINT16 page;
- } m_banks[2];
-
virtual void machine_start() override;
virtual void machine_reset() override;
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -108,14 +101,6 @@ public:
DECLARE_WRITE8_MEMBER( touchscreen_w );
DECLARE_WRITE_LINE_MEMBER( alarm_irq );
- DECLARE_READ8_MEMBER( flash_0x0000_r );
- DECLARE_WRITE8_MEMBER( flash_0x0000_w );
- DECLARE_READ8_MEMBER( flash_0x8000_r );
- DECLARE_WRITE8_MEMBER( flash_0x8000_w );
- DECLARE_READ8_MEMBER( flash_0xa000_r );
- DECLARE_WRITE8_MEMBER( flash_0xa000_w );
-
- UINT8 identify_bank_type(UINT32 bank);
DECLARE_PALETTE_INIT(rex6000);
DECLARE_INPUT_CHANGED_MEMBER(trigger_irq);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer1);
@@ -125,34 +110,6 @@ public:
};
-UINT8 rex6000_state::identify_bank_type(UINT32 bank)
-{
- if (bank < 0x080)
- {
- return BANK_FLASH0_B0;
- }
- else if (bank >= 0x080 && bank < 0x100)
- {
- return BANK_FLASH0_B1;
- }
- else if ((bank >= 0xb00 && bank < 0xb80) || (bank >= 0x600 && bank < 0x680))
- {
- return BANK_FLASH1_B0;
- }
- else if ((bank >= 0xb80 && bank < 0xc00) || (bank >= 0x680 && bank < 0x700))
- {
- return BANK_FLASH1_B1;
- }
- else if (bank >= 0x1000 && bank < 0x1004)
- {
- return BANK_RAM;
- }
- else
- {
- //logerror("%04x: unkonwn memory bank %x\n", m_maincpu->pc(), bank);
- return BANK_UNKNOWN;
- }
-}
READ8_MEMBER( rex6000_state::bankswitch_r )
{
@@ -161,8 +118,6 @@ READ8_MEMBER( rex6000_state::bankswitch_r )
WRITE8_MEMBER( rex6000_state::bankswitch_w )
{
- address_space& program = m_maincpu->space(AS_PROGRAM);
-
m_bank[offset&3] = data;
switch (offset)
@@ -171,39 +126,13 @@ WRITE8_MEMBER( rex6000_state::bankswitch_w )
case 1: //bank 1 high
{
//bank 1 start at 0x8000
- m_banks[0].page = (MAKE_BANK(m_bank[0], m_bank[1]&0x0f) + 4);
- m_banks[0].type = identify_bank_type(m_banks[0].page);
-
- if (m_banks[0].type != BANK_UNKNOWN)
- {
- program.install_readwrite_handler(0x8000, 0x9fff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0x8000_r), this), write8_delegate(FUNC(rex6000_state::flash_0x8000_w), this));
- }
- else
- {
- program.unmap_readwrite(0x8000, 0x9fff);
- }
-
+ m_bankdev0->set_bank(MAKE_BANK(m_bank[0], m_bank[1]) + 4);
break;
}
case 2: //bank 2 low
case 3: //bank 2 high
{
- m_banks[1].page = MAKE_BANK(m_bank[2], m_bank[3]&0x1f);
- m_banks[1].type = identify_bank_type(m_banks[1].page);
-
- if (m_banks[1].type == BANK_RAM)
- {
- program.install_ram(0xa000, 0xbfff, m_ram_base + ((m_banks[1].page & 0x03)<<13));
- }
- else if (m_banks[1].type != BANK_UNKNOWN)
- {
- program.install_readwrite_handler(0xa000, 0xbfff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0xa000_r), this), write8_delegate(FUNC(rex6000_state::flash_0xa000_w), this));
- }
- else
- {
- program.unmap_readwrite(0xa000, 0xbfff);
- }
-
+ m_bankdev1->set_bank(MAKE_BANK(m_bank[2], m_bank[3]));
break;
}
}
@@ -362,42 +291,24 @@ WRITE8_MEMBER( rex6000_state::touchscreen_w )
m_touchscreen[offset&0x0f] = data;
}
-READ8_MEMBER( rex6000_state::flash_0x0000_r )
-{
- return m_flash[0]->read(offset);
-}
-
-WRITE8_MEMBER( rex6000_state::flash_0x0000_w )
-{
- m_flash[0]->write(offset, data);
-}
-
-READ8_MEMBER( rex6000_state::flash_0x8000_r )
-{
- return m_flash[m_banks[0].type]->read(((m_banks[0].page & 0x7f)<<13) | offset);
-}
-
-WRITE8_MEMBER( rex6000_state::flash_0x8000_w )
-{
- m_flash[m_banks[0].type]->write(((m_banks[0].page & 0x7f)<<13) | offset, data);
-}
-READ8_MEMBER( rex6000_state::flash_0xa000_r )
-{
- return m_flash[m_banks[1].type]->read(((m_banks[1].page & 0x7f)<<13) | offset);
-}
+static ADDRESS_MAP_START(rex6000_banked_map, AS_PROGRAM, 8, rex6000_state)
+ AM_RANGE( 0x0000000, 0x00fffff ) AM_DEVREADWRITE("flash0a", intelfsh8_device, read, write)
+ AM_RANGE( 0x0100000, 0x01fffff ) AM_DEVREADWRITE("flash0b", intelfsh8_device, read, write)
+ AM_RANGE( 0x0c00000, 0x0cfffff ) AM_DEVREADWRITE("flash1a", intelfsh8_device, read, write)
+ AM_RANGE( 0x0d00000, 0x0dfffff ) AM_DEVREADWRITE("flash1b", intelfsh8_device, read, write)
+ AM_RANGE( 0x1600000, 0x16fffff ) AM_DEVREADWRITE("flash1a", intelfsh8_device, read, write)
+ AM_RANGE( 0x1700000, 0x17fffff ) AM_DEVREADWRITE("flash1b", intelfsh8_device, read, write)
+ AM_RANGE( 0x2000000, 0x2007fff ) AM_RAM AM_SHARE("nvram")
+ADDRESS_MAP_END
-WRITE8_MEMBER( rex6000_state::flash_0xa000_w )
-{
- m_flash[m_banks[1].type]->write(((m_banks[1].page & 0x7f)<<13) | offset, data);
-}
static ADDRESS_MAP_START(rex6000_mem, AS_PROGRAM, 8, rex6000_state)
ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE( 0x0000, 0x7fff ) AM_READWRITE(flash_0x0000_r, flash_0x0000_w)
- AM_RANGE( 0x8000, 0x9fff ) AM_READWRITE(flash_0x8000_r, flash_0x8000_w)
- AM_RANGE( 0xa000, 0xbfff ) AM_READWRITE(flash_0xa000_r, flash_0xa000_w)
+ AM_RANGE( 0x0000, 0x7fff ) AM_DEVREADWRITE("flash0a", intelfsh8_device, read, write)
+ AM_RANGE( 0x8000, 0x9fff ) AM_DEVREADWRITE("bank0", address_map_bank_device, read8, write8)
+ AM_RANGE( 0xa000, 0xbfff ) AM_DEVREADWRITE("bank1", address_map_bank_device, read8, write8)
AM_RANGE( 0xc000, 0xffff ) AM_RAMBANK("ram") //system RAM
ADDRESS_MAP_END
@@ -450,27 +361,11 @@ INPUT_PORTS_END
void rex6000_state::machine_start()
{
- m_flash[0] = machine().device<fujitsu_29dl16x_device>("flash0a");
- m_flash[1] = machine().device<fujitsu_29dl16x_device>("flash0b");
- m_flash[2] = machine().device<fujitsu_29dl16x_device>("flash1a");
- m_flash[3] = machine().device<fujitsu_29dl16x_device>("flash1b");
-
- m_ram_base = m_ram->pointer();
- membank("ram")->set_base(m_ram_base + 0x4000);
+ membank("ram")->set_base((UINT8*)m_nvram + 0x4000);
}
+
void rex6000_state::machine_reset()
{
- address_space& program = m_maincpu->space(AS_PROGRAM);
-
- program.install_readwrite_handler(0x8000, 0x9fff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0x8000_r), this), write8_delegate(FUNC(rex6000_state::flash_0x8000_w), this));
- program.install_readwrite_handler(0xa000, 0xbfff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0xa000_r), this), write8_delegate(FUNC(rex6000_state::flash_0xa000_w), this));
-
- m_banks[0].type = 0x04;
- m_banks[0].type = 0;
- m_banks[1].type = 0x00;
- m_banks[1].type = 0;
-
- memset(m_ram_base, 0, m_ram->size());
memset(m_bank, 0, sizeof(m_bank));
memset(m_beep_io, 0, sizeof(m_beep_io));
memset(m_lcd_base, 0, sizeof(m_lcd_base));
@@ -485,25 +380,14 @@ void rex6000_state::machine_reset()
UINT32 rex6000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT16 lcd_bank = MAKE_BANK(m_lcd_base[0], m_lcd_base[1]&0x1f);
- UINT8 mem_type = identify_bank_type(lcd_bank);
+ UINT16 lcd_bank = MAKE_BANK(m_lcd_base[0], m_lcd_base[1]);
- if (m_lcd_enabled && mem_type != BANK_UNKNOWN)
+ if (m_lcd_enabled)
{
for (int y=0; y<120; y++)
for (int x=0; x<30; x++)
{
- UINT8 data = 0;
-
- if (mem_type == BANK_RAM)
- {
- data = (m_ram_base + ((lcd_bank & 0x03)<<13))[y*30 + x];
- }
- else
- {
- data = m_flash[mem_type]->space(0).read_byte(((lcd_bank & 0x7f)<<13) | (y*30 + x));
- }
-
+ UINT8 data = m_bankdev0->space(AS_PROGRAM).read_byte((lcd_bank << 13) + y*30 + x);
for (int b=0; b<8; b++)
{
@@ -570,7 +454,7 @@ PALETTE_INIT_MEMBER(rex6000_state, rex6000)
QUICKLOAD_LOAD_MEMBER( rex6000_state,rex6000)
{
static const char magic[] = "ApplicationName:Addin";
- address_space& flash = machine().device("flash0b")->memory().space(0);
+ address_space& flash = m_flash0b->space(0);
UINT32 img_start = 0;
dynamic_buffer data(image.length());
@@ -661,6 +545,18 @@ static MACHINE_CONFIG_START( rex6000, rex6000_state )
MCFG_PALETTE_INIT_OWNER(rex6000_state, rex6000)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rex6000)
+ MCFG_DEVICE_ADD("bank0", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(rex6000_banked_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x2000)
+
+ MCFG_DEVICE_ADD("bank1", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(rex6000_banked_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x2000)
+
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", rex6000_state, rex6000, "rex,ds2", 0)
diff --git a/src/mame/drivers/sigmab52.cpp b/src/mame/drivers/sigmab52.cpp
index 75299bfd274..38b535774ea 100644
--- a/src/mame/drivers/sigmab52.cpp
+++ b/src/mame/drivers/sigmab52.cpp
@@ -10,9 +10,10 @@
Games running on this hardware:
- * Joker's Wild (B52 system, set 1), 199?, Sigma.
- * Joker's Wild (B52 system, set 2), 199?, Sigma.
- * Joker's Wild (B52 system, Harrah's GFX), 199?, Sigma.
+ * Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV), 199?, Sigma.
+ * Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV, Harrah's GFX), 199?, Sigma.
+ * Joker's Wild (B52 system, WP02001-054, Ver.031WM), 199?, Sigma.
+ * Super 8 Ways FC (DB98103-011, Fruit combination), 1989, Sigma.
The HD63484 ACRTC support is a bit hacky and incomplete,
@@ -618,8 +619,12 @@ MACHINE_CONFIG_END
* Rom Load *
*************************/
+/* Joker's Wild
+ BP55114-V1104, Ver.054NMV
+ Modern cards set. Normal cardsback.
+*/
ROM_START( jwildb52 )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x10000, "maincpu", 0 ) // BP55114-V1104, Ver.054NMV
ROM_LOAD( "poker.ic95", 0x00000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) )
ROM_REGION16_BE( 0x40000, "gfx1", 0 )
@@ -636,44 +641,56 @@ ROM_START( jwildb52 )
ROM_END
-ROM_START( jwildb52a )
+/* Joker's Wild
+ BP55114-V1104, Ver.054NMV
+ Modern cards set. Harrah's cardsback.
+*/
+ROM_START( jwildb52h )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "sigm_wrk.bin", 0x00000, 0x10000, CRC(15c83c6c) SHA1(7a05bd94ea8b1ad051fbe6580a6550d4bb47dd15) )
+ ROM_LOAD( "jokers_wild_ver_xxx.ic95", 0x00000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) )
ROM_REGION16_BE( 0x40000, "gfx1", 0 )
- ROM_LOAD32_BYTE( "c-1416-1.ic45", 0x00003, 0x10000, CRC(02a0b517) SHA1(5a0818a174683f791ca885bfdfd7555616c80758) )
- ROM_LOAD32_BYTE( "c-1416-2.ic46", 0x00001, 0x10000, CRC(3196e486) SHA1(2d264e518083ff05d1a1eb7f8e1649feb70349e7) )
- ROM_LOAD32_BYTE( "c-1416-3.ic47", 0x00000, 0x10000, CRC(1c9a2939) SHA1(e18fdf9a656687db47ac00700e7721c3d8e800c5) )
- ROM_LOAD32_BYTE( "c-1416-4.ic48", 0x00002, 0x10000, CRC(7bd8bf78) SHA1(ddacbb75df14a343e69949dcaa14ce1a7ec8407a) )
-
- /* No sound dumps. Using the ones from parent set for now... */
+ ROM_LOAD32_BYTE( "2006-1_harrahs.ic45", 0x00003, 0x10000, CRC(6e6871dc) SHA1(5dfc99c808c06ec34838324181988d4550c1ed1a) )
+ ROM_LOAD32_BYTE( "2006-2_harrahs.ic46", 0x00001, 0x10000, CRC(1039c62d) SHA1(11f0dbcbbff5f6e9028a0305f7e16a0654be40d4) )
+ ROM_LOAD32_BYTE( "2006-3_harrahs.ic47", 0x00000, 0x10000, CRC(d66af95a) SHA1(70bba1aeea9221541b82642045ce8ecf26e1d08c) )
+ ROM_LOAD32_BYTE( "2006-4_harrahs.ic48", 0x00002, 0x10000, CRC(2bf196cb) SHA1(686ca0dd84c48f51efee5349ea3db65531dd4a52) )
ROM_REGION( 0x8000, "audiocpu", 0 )
- ROM_LOAD( "sound-01-00.43", 0x0000, 0x8000, BAD_DUMP CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
+ ROM_LOAD( "poker-01-00.43", 0x0000, 0x8000, CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
ROM_REGION( 0x0100, "proms", 0 )
- ROM_LOAD( "mb7118.41", 0x0000, 0x0100, BAD_DUMP CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
+ ROM_LOAD( "mb7118.41", 0x0000, 0x0100, CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
ROM_END
-ROM_START( jwildb52h )
+/* Joker's Wild
+ WP02001-054, Ver.031WM
+ Classic cards set. Normal cardsback.
+*/
+ROM_START( jwildb52a )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "jokers_wild_ver_xxx.ic95", 0x00000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) )
+ ROM_LOAD( "sigm_wrk.bin", 0x00000, 0x10000, CRC(15c83c6c) SHA1(7a05bd94ea8b1ad051fbe6580a6550d4bb47dd15) )
ROM_REGION16_BE( 0x40000, "gfx1", 0 )
- ROM_LOAD32_BYTE( "2006-1_harrahs.ic45", 0x00003, 0x10000, CRC(6e6871dc) SHA1(5dfc99c808c06ec34838324181988d4550c1ed1a) )
- ROM_LOAD32_BYTE( "2006-2_harrahs.ic46", 0x00001, 0x10000, CRC(1039c62d) SHA1(11f0dbcbbff5f6e9028a0305f7e16a0654be40d4) )
- ROM_LOAD32_BYTE( "2006-3_harrahs.ic47", 0x00000, 0x10000, CRC(d66af95a) SHA1(70bba1aeea9221541b82642045ce8ecf26e1d08c) )
- ROM_LOAD32_BYTE( "2006-4_harrahs.ic48", 0x00002, 0x10000, CRC(2bf196cb) SHA1(686ca0dd84c48f51efee5349ea3db65531dd4a52) )
+ ROM_LOAD32_BYTE( "c-1416-1.ic45", 0x00003, 0x10000, CRC(02a0b517) SHA1(5a0818a174683f791ca885bfdfd7555616c80758) )
+ ROM_LOAD32_BYTE( "c-1416-2.ic46", 0x00001, 0x10000, CRC(3196e486) SHA1(2d264e518083ff05d1a1eb7f8e1649feb70349e7) )
+ ROM_LOAD32_BYTE( "c-1416-3.ic47", 0x00000, 0x10000, CRC(1c9a2939) SHA1(e18fdf9a656687db47ac00700e7721c3d8e800c5) )
+ ROM_LOAD32_BYTE( "c-1416-4.ic48", 0x00002, 0x10000, CRC(7bd8bf78) SHA1(ddacbb75df14a343e69949dcaa14ce1a7ec8407a) )
+
+ /* No sound dumps. Using the ones from parent set for now... */
ROM_REGION( 0x8000, "audiocpu", 0 )
- ROM_LOAD( "poker-01-00.43", 0x0000, 0x8000, CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
+ ROM_LOAD( "sound-01-00.43", 0x0000, 0x8000, BAD_DUMP CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) )
ROM_REGION( 0x0100, "proms", 0 )
- ROM_LOAD( "mb7118.41", 0x0000, 0x0100, CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
+ ROM_LOAD( "mb7118.41", 0x0000, 0x0100, BAD_DUMP CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) )
ROM_END
+/* Super 8 Ways FC
+ Fruit combination.
+ DB98103-011.
+*/
ROM_START( s8waysfc )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "dv98103.011", 0x00000, 0x10000, CRC(416190a1) SHA1(e2738644efc6c2adcea2470b482f3f818ed9af8d) )
@@ -698,7 +715,7 @@ ROM_END
* Driver Init *
*************************/
-DRIVER_INIT_MEMBER(sigmab52_state,jwildb52)
+DRIVER_INIT_MEMBER(sigmab52_state, jwildb52)
{
}
@@ -707,8 +724,8 @@ DRIVER_INIT_MEMBER(sigmab52_state,jwildb52)
* Game Drivers *
*************************/
-/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */
-GAMEL( 199?, jwildb52, 0, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, set 1)", MACHINE_NOT_WORKING, layout_sigmab52 )
-GAMEL( 199?, jwildb52a, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, set 2)", MACHINE_NOT_WORKING, layout_sigmab52 )
-GAMEL( 199?, jwildb52h, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, Harrah's GFX)", MACHINE_NOT_WORKING, layout_sigmab52 )
-GAME ( 199?, s8waysfc, 0, jwildb52, s8waysfc, sigmab52_state, jwildb52, ROT0, "Sigma", "Super 8 Ways FC (Fruit combination)", MACHINE_NOT_WORKING )
+/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */
+GAMEL( 199?, jwildb52, 0, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV)", MACHINE_NOT_WORKING, layout_sigmab52 )
+GAMEL( 199?, jwildb52h, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV, Harrah's GFX)", MACHINE_NOT_WORKING, layout_sigmab52 )
+GAMEL( 199?, jwildb52a, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, WP02001-054, Ver.031WM)", MACHINE_NOT_WORKING, layout_sigmab52 )
+GAME ( 1989, s8waysfc, 0, jwildb52, s8waysfc, sigmab52_state, jwildb52, ROT0, "Sigma", "Super 8 Ways FC (DB98103-011, Fruit combination)", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/ticalc1x.cpp b/src/mame/drivers/ticalc1x.cpp
index dcdea37827c..74d97ffeffb 100644
--- a/src/mame/drivers/ticalc1x.cpp
+++ b/src/mame/drivers/ticalc1x.cpp
@@ -35,19 +35,9 @@ public:
ticalc1x_state(const machine_config &mconfig, device_type type, const char *tag)
: hh_tms1k_state(mconfig, type, tag)
{ }
-
-protected:
- virtual void machine_start() override;
};
-void ticalc1x_state::machine_start()
-{
- hh_tms1k_state::machine_start();
- memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // !
-}
-
-
/***************************************************************************
@@ -85,21 +75,18 @@ public:
void tisr16_state::prepare_display()
{
// update leds state
- for (int y = 0; y < 11; y++)
- m_display_state[y] = (m_r >> y & 1) ? m_o : 0;
+ set_display_segmask(0xfff, 0xff);
+ display_matrix(8, 12, m_o, m_r, false);
// exponent sign is from R10 O1, and R10 itself only uses segment G
m_display_state[11] = m_display_state[10] << 5 & 0x40;
m_display_state[10] &= 0x40;
-
- set_display_size(8, 12);
display_update();
}
WRITE16_MEMBER(tisr16_state::write_r)
{
- // R0-R10: input mux
- // R0-R10: select digit (right-to-left)
+ // R0-R10: input mux, select digit
m_r = m_inp_mux = data;
prepare_display();
}
@@ -259,7 +246,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( tisr16, tisr16_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1000, 300000) // RC osc. R=43K, C=68pf -> ~300kHz (note: tisr16ii MCU RC osc. is different: R=30K, C=100pf -> also ~300kHz)
+ MCFG_CPU_ADD("maincpu", TMS1000, 300000) // approximation - RC osc. R=43K, C=68pf (note: tisr16ii MCU RC osc. is different: R=30K, C=100pf, same freq)
MCFG_TMS1XXX_READ_K_CB(READ8(tisr16_state, read_k))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tisr16_state, write_o))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tisr16_state, write_r))
@@ -315,11 +302,10 @@ public:
WRITE16_MEMBER(ti1250_state::write_r)
{
- // R8 only has segment G connected
- m_display_segmask[8] = 0x40;
-
- // R0-R7(,R8): select digit (right-to-left)
- display_matrix_seg(8, 9, m_o, data, 0xff);
+ // R0-R8: select digit
+ set_display_segmask(0xff, 0xff);
+ set_display_segmask(0x100, 0x40); // R8 only has segment G connected
+ display_matrix(8, 9, m_o, data);
}
WRITE16_MEMBER(ti1250_state::write_o)
@@ -398,7 +384,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( ti1250, ti1250_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS0950, 200000) // RC osc. R=68K, C=68pf -> ~200kHz
+ MCFG_CPU_ADD("maincpu", TMS0950, 200000) // approximation - RC osc. R=68K, C=68pf
MCFG_TMS1XXX_READ_K_CB(READ8(ti1250_state, read_k))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ti1250_state, write_o))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ti1250_state, write_r))
@@ -451,9 +437,9 @@ public:
WRITE16_MEMBER(ti1000_state::write_r)
{
- // R0-R7: select digit (right-to-left)
- UINT8 o = BITSWAP8(m_o,7,4,3,2,1,0,6,5);
- display_matrix_seg(8, 8, o, data, 0xff);
+ // R0-R7: select digit
+ set_display_segmask(0xff, 0xff);
+ display_matrix(8, 8, m_o, data);
}
WRITE16_MEMBER(ti1000_state::write_o)
@@ -461,7 +447,7 @@ WRITE16_MEMBER(ti1000_state::write_o)
// O0-O3,O5(?): input mux
// O0-O7: digit segments
m_inp_mux = (data & 0xf) | (data >> 1 & 0x10);
- m_o = data;
+ m_o = BITSWAP8(data,7,4,3,2,1,0,6,5);
}
READ8_MEMBER(ti1000_state::read_k)
@@ -555,10 +541,11 @@ WRITE16_MEMBER(wizatron_state::write_r)
// 3rd digit only has A and G for =, though some newer hardware revisions
// (goes for both wizatron and lilprof) use a custom equals-sign digit here
- m_display_segmask[3] = 0x41;
+ set_display_segmask(8, 0x41);
- // R0-R8: select digit (right-to-left)
- display_matrix_seg(7, 9, m_o, data, 0x7f);
+ // R0-R8: select digit
+ set_display_segmask(0x1ff^8, 0x7f);
+ display_matrix(7, 9, m_o, data);
}
WRITE16_MEMBER(wizatron_state::write_o)
@@ -725,19 +712,16 @@ public:
WRITE16_MEMBER(lilprof78_state::write_r)
{
// update leds state
- UINT8 o = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f;
+ UINT8 seg = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f;
UINT16 r = (data & 7) | (data << 1 & 0x1f0);
-
- for (int y = 0; y < 9; y++)
- m_display_state[y] = (r >> y & 1) ? o : 0;
-
+ set_display_segmask(0x1ff, 0x7f);
+ display_matrix(7, 9, seg, r, false);
+
// 3rd digit A/G(equals sign) is from O7
- m_display_state[3] = (r && m_o & 0x80) ? 0x41 : 0;
+ m_display_state[3] = (r != 0 && m_o & 0x80) ? 0x41 : 0;
// 6th digit is a custom 7seg for math symbols (see wizatron_state write_r)
m_display_state[6] = BITSWAP8(m_display_state[6],7,6,1,4,2,3,5,0);
-
- set_display_size(7, 9);
display_update();
}
@@ -836,7 +820,8 @@ public:
void dataman_state::prepare_display()
{
// note the extra segment on R9
- display_matrix_seg(8, 9, m_o | (m_r >> 2 & 0x80), m_r & 0x1ff, 0x7f);
+ set_display_segmask(0x1ff, 0x7f);
+ display_matrix(8, 9, m_o | (m_r >> 2 & 0x80), m_r & 0x1ff);
}
WRITE16_MEMBER(dataman_state::write_r)
@@ -959,12 +944,10 @@ public:
WRITE16_MEMBER(ti30_state::write_r)
{
- // 1st digit only has segments B,F,G,DP
- m_display_segmask[0] = 0xe2;
-
// R0-R8: select digit
- UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3);
- display_matrix_seg(8, 9, o, data, 0xff);
+ set_display_segmask(0x1fe, 0xff);
+ set_display_segmask(0x001, 0xe2); // 1st digit only has segments B,F,G,DP
+ display_matrix(8, 9, m_o, data);
}
WRITE16_MEMBER(ti30_state::write_o)
@@ -972,7 +955,7 @@ WRITE16_MEMBER(ti30_state::write_o)
// O0-O2,O4-O7: input mux
// O0-O7: digit segments
m_inp_mux = (data & 7) | (data >> 1 & 0x78);
- m_o = data;
+ m_o = BITSWAP8(data,7,5,2,1,4,0,6,3);
}
READ8_MEMBER(ti30_state::read_k)
@@ -1384,6 +1367,6 @@ COMP( 1978, lilprof78, lilprof, 0, lilprof78, lilprof78, driver_device, 0, "Tex
COMP( 1977, dataman, 0, 0, dataman, dataman, driver_device, 0, "Texas Instruments", "DataMan", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
-COMP( 1976, ti30, 0, 0, ti30, ti30, driver_device, 0, "Texas Instruments", "TI-30", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
-COMP( 1976, tibusan, 0, 0, ti30, tibusan, driver_device, 0, "Texas Instruments", "TI Business Analyst", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
-COMP( 1977, tiprog, 0, 0, ti30, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
+COMP( 1976, ti30, 0, 0, ti30, ti30, driver_device, 0, "Texas Instruments", "TI-30", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
+COMP( 1976, tibusan, 0, 0, ti30, tibusan, driver_device, 0, "Texas Instruments", "TI Business Analyst", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
+COMP( 1977, tiprog, 0, 0, ti30, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp
index dac42ee4d65..cafc46a7cbc 100644
--- a/src/mame/drivers/tispeak.cpp
+++ b/src/mame/drivers/tispeak.cpp
@@ -468,7 +468,6 @@ protected:
void tispeak_state::machine_start()
{
hh_tms1k_state::machine_start();
- memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // !
init_cartridge();
}
@@ -541,8 +540,9 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor)
void tispeak_state::prepare_display()
{
- UINT16 gridmask = (m_display_decay[15][16] != 0) ? 0xffff : 0x8000;
- display_matrix_seg(16+1, 16, m_plate | 0x10000, m_grid & gridmask, 0x3fff);
+ UINT16 gridmask = (m_display_decay[15][16] != 0) ? 0xffff : 0x8000; // vfd filament on/off
+ set_display_segmask(0x21ff, 0x3fff);
+ display_matrix(16+1, 16, m_plate | 1<<16, m_grid & gridmask);
}
WRITE16_MEMBER(tispeak_state::snspell_write_r)
diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp
index 0afe81d0a49..fcb7b072260 100644
--- a/src/mame/drivers/tispellb.cpp
+++ b/src/mame/drivers/tispellb.cpp
@@ -26,6 +26,7 @@
- TMC0355 4KB VSM ROM CD2602*
- 8-digit cyan VFD display
- 1-bit sound (indicated by a music note symbol on the top-right of the casing)
+ - note: much rarer than the 1978 version, not much luck finding one on eBay
Spelling ABC (UK), 1979: exact same hardware as US version
@@ -104,7 +105,6 @@ protected:
void tispellb_state::machine_start()
{
hh_tms1k_state::machine_start();
- memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // !
// zerofill
m_rev1_ctl = 0;
@@ -138,9 +138,10 @@ void tispellb_state::power_off()
void tispellb_state::prepare_display()
{
- // same as snspell
- UINT16 gridmask = (m_display_decay[15][16] != 0) ? 0xffff : 0x8000;
- display_matrix_seg(16+1, 16, m_plate | 0x10000, m_grid & gridmask, 0x3fff);
+ // almost same as snspell
+ UINT16 gridmask = (m_display_decay[15][16] != 0) ? 0xffff : 0x8000; // vfd filament on/off
+ set_display_segmask(0xff, 0x3fff);
+ display_matrix(16+1, 16, m_plate | 1<<16, m_grid & gridmask);
}
WRITE16_MEMBER(tispellb_state::main_write_o)
diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp
index e71413b1f1d..a58abe22af5 100644
--- a/src/mame/drivers/viper.cpp
+++ b/src/mame/drivers/viper.cpp
@@ -2684,9 +2684,10 @@ ROM_START(wcombatu) //*
DISK_REGION( "ata:0:hdd:image" )
// CHD image provided had evidence of being altered by Windows, probably was put in a Windows machine without write protection hardware (bad idea)
// label was the same as this, so this should be a clean and correct version.
- DISK_IMAGE( "c22d02", 0, SHA1(69a24c9e36b073021d55bec27d89fcc0254a60cc) ) // chs 978,8,3
+ DISK_IMAGE( "c22d02", 0, SHA1(69a24c9e36b073021d55bec27d89fcc0254a60cc) ) // chs 978,8,32
ROM_END
+/* This CF card has sticker C22A02 */
ROM_START(wcombatj) //*
VIPER_BIOS
@@ -2697,7 +2698,7 @@ ROM_START(wcombatj) //*
ROM_LOAD("wcombatj_nvram.u39", 0x00000, 0x2000, CRC(bd8a6640) SHA1(2d409197ef3fb07d984d27fa943f29c7a711d715))
DISK_REGION( "ata:0:hdd:image" )
- DISK_IMAGE( "c22a02", 0, BAD_DUMP SHA1(b607fb2ddfd0bd552b7a736cea4ac1aa3ea021bd) )
+ DISK_IMAGE( "c22a02", 0, SHA1(7200c7c436491fd8027d6d7139a80ee3b984697b) ) // chs 978,8,32
ROM_END
ROM_START(xtrial) //*
@@ -2718,7 +2719,7 @@ ROM_END
/*
Mahjong Fight Club (Konami Viper h/w)
Konami, 2002
-
+78,8,3)
PCB number - GM941-PWB(A)C Copyright 1999 Konami Made In Japan
Mahjong Fight Club is a multi player Mahjong battle game for up to 8 players. A
diff --git a/src/mame/includes/avigo.h b/src/mame/includes/avigo.h
index 6ef813906b6..b7556bb23d4 100644
--- a/src/mame/includes/avigo.h
+++ b/src/mame/includes/avigo.h
@@ -14,6 +14,7 @@
#include "machine/rp5c01.h"
#include "machine/ins8250.h"
#include "machine/intelfsh.h"
+#include "machine/bankdev.h"
#include "machine/nvram.h"
#include "sound/speaker.h"
#include "machine/ram.h"
@@ -36,7 +37,11 @@ public:
m_speaker(*this, "speaker"),
m_uart(*this, "ns16550"),
m_serport(*this, "serport"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_bankdev1(*this, "bank0"),
+ m_bankdev2(*this, "bank1"),
+ m_flash1(*this, "flash1"),
+ m_nvram(*this, "nvram")
{ }
required_device<cpu_device> m_maincpu;
@@ -45,25 +50,20 @@ public:
required_device<ns16550_device> m_uart;
required_device<rs232_port_device> m_serport;
required_device<palette_device> m_palette;
+ required_device<address_map_bank_device> m_bankdev1;
+ required_device<address_map_bank_device> m_bankdev2;
+ required_device<intelfsh8_device> m_flash1;
+ required_shared_ptr<UINT8> m_nvram;
// defined in drivers/avigo.c
virtual void machine_start() override;
virtual void machine_reset() override;
- void postload();
- void refresh_memory(UINT8 bank, UINT8 chip_select);
void refresh_ints();
void nvram_init(nvram_device &nvram, void *base, size_t size);
DECLARE_WRITE_LINE_MEMBER( tc8521_alarm_int );
DECLARE_WRITE_LINE_MEMBER( com_interrupt );
- DECLARE_READ8_MEMBER(flash_0x0000_read_handler);
- DECLARE_WRITE8_MEMBER(flash_0x0000_write_handler);
- DECLARE_READ8_MEMBER(flash_0x4000_read_handler);
- DECLARE_WRITE8_MEMBER(flash_0x4000_write_handler);
- DECLARE_READ8_MEMBER(flash_0x8000_read_handler);
- DECLARE_WRITE8_MEMBER(flash_0x8000_write_handler);
-
DECLARE_READ8_MEMBER(key_data_read_r);
DECLARE_WRITE8_MEMBER(set_key_line_w);
DECLARE_WRITE8_MEMBER(port2_w);
@@ -99,14 +99,10 @@ public:
UINT8 m_bank1_l;
UINT8 m_bank1_h;
UINT8 m_ad_control_status;
- intelfsh8_device * m_flashes[3];
- int m_flash_at_0x4000;
- int m_flash_at_0x8000;
UINT16 m_ad_value;
UINT8 * m_video_memory;
UINT8 m_screen_column;
UINT8 m_warm_start;
- UINT8 * m_ram_base;
DECLARE_PALETTE_INIT(avigo);
TIMER_DEVICE_CALLBACK_MEMBER(avigo_scan_timer);
TIMER_DEVICE_CALLBACK_MEMBER(avigo_1hz_timer);
diff --git a/src/mame/includes/blmbycar.h b/src/mame/includes/blmbycar.h
index 2fbc5390e01..af7b6f120f4 100644
--- a/src/mame/includes/blmbycar.h
+++ b/src/mame/includes/blmbycar.h
@@ -11,14 +11,19 @@ class blmbycar_state : public driver_device
public:
blmbycar_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_vram_1(*this, "vram_1"),
m_vram_0(*this, "vram_0"),
m_scroll_1(*this, "scroll_1"),
m_scroll_0(*this, "scroll_0"),
- m_spriteram(*this, "spriteram"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_spriteram(*this, "spriteram") { }
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
/* memory pointers */
required_shared_ptr<UINT16> m_vram_1;
@@ -35,25 +40,31 @@ public:
UINT8 m_pot_wheel; // blmbycar
int m_old_val; // blmbycar
int m_retvalue; // waterball
- DECLARE_WRITE16_MEMBER(blmbycar_okibank_w);
+
+ // common
+ DECLARE_WRITE16_MEMBER(okibank_w);
+ DECLARE_WRITE16_MEMBER(vram_0_w);
+ DECLARE_WRITE16_MEMBER(vram_1_w);
+
+ // blmbycar
DECLARE_WRITE16_MEMBER(blmbycar_pot_wheel_reset_w);
DECLARE_WRITE16_MEMBER(blmbycar_pot_wheel_shift_w);
DECLARE_READ16_MEMBER(blmbycar_pot_wheel_r);
DECLARE_READ16_MEMBER(blmbycar_opt_wheel_r);
+
+ // waterball
DECLARE_READ16_MEMBER(waterball_unk_r);
- DECLARE_WRITE16_MEMBER(blmbycar_vram_0_w);
- DECLARE_WRITE16_MEMBER(blmbycar_vram_1_w);
- DECLARE_DRIVER_INIT(blmbycar);
+
TILE_GET_INFO_MEMBER(get_tile_info_0);
TILE_GET_INFO_MEMBER(get_tile_info_1);
+
+ DECLARE_DRIVER_INIT(blmbycar);
virtual void video_start() override;
DECLARE_MACHINE_START(blmbycar);
DECLARE_MACHINE_RESET(blmbycar);
DECLARE_MACHINE_START(watrball);
DECLARE_MACHINE_RESET(watrball);
- UINT32 screen_update_blmbycar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/fidelz80.h b/src/mame/includes/fidelz80.h
index 6598cc76ec0..3f57cc38ec6 100644
--- a/src/mame/includes/fidelz80.h
+++ b/src/mame/includes/fidelz80.h
@@ -9,6 +9,9 @@
#include "emu.h"
#include "sound/speaker.h"
#include "sound/s14001a.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
+#include "softlist.h"
class fidelz80base_state : public driver_device
{
@@ -20,6 +23,7 @@ public:
m_speech(*this, "speech"),
m_speech_rom(*this, "speech"),
m_speaker(*this, "speaker"),
+ m_cart(*this, "cartslot"),
m_display_wait(33),
m_display_maxy(1),
m_display_maxx(0)
@@ -31,6 +35,7 @@ public:
optional_device<s14001a_device> m_speech;
optional_region_ptr<UINT8> m_speech_rom;
optional_device<speaker_sound_device> m_speaker;
+ optional_device<generic_slot_device> m_cart;
// misc common
UINT16 m_inp_mux; // multiplexed keypad/leds mask
@@ -41,6 +46,7 @@ public:
UINT8 m_speech_bank; // speech rom higher address bits
UINT16 read_inputs(int columns);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(scc_cartridge);
// display common
int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
@@ -56,7 +62,7 @@ public:
void display_update();
void set_display_size(int maxx, int maxy);
void set_display_segmask(UINT32 digits, UINT32 mask);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/glass.h b/src/mame/includes/glass.h
index 4fc0cbe59ee..a3ae64203f5 100644
--- a/src/mame/includes/glass.h
+++ b/src/mame/includes/glass.h
@@ -11,13 +11,19 @@ class glass_state : public driver_device
public:
glass_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_vregs(*this, "vregs"),
m_spriteram(*this, "spriteram"),
- m_mainram(*this, "mainram"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_mainram(*this, "mainram") { }
+
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
/* memory pointers */
required_shared_ptr<UINT16> m_videoram;
@@ -34,27 +40,25 @@ public:
int m_current_command;
int m_cause_interrupt;
int m_blitter_serial_buffer[5];
+
DECLARE_WRITE16_MEMBER(clr_int_w);
DECLARE_WRITE16_MEMBER(OKIM6295_bankswitch_w);
- DECLARE_WRITE16_MEMBER(glass_coin_w);
- DECLARE_WRITE16_MEMBER(glass_blitter_w);
- DECLARE_WRITE16_MEMBER(glass_vram_w);
-
- DECLARE_READ16_MEMBER( glass_mainram_r );
- DECLARE_WRITE16_MEMBER( glass_mainram_w );
+ DECLARE_WRITE16_MEMBER(coin_w);
+ DECLARE_WRITE16_MEMBER(blitter_w);
+ DECLARE_WRITE16_MEMBER(vram_w);
+ DECLARE_READ16_MEMBER(mainram_r);
+ DECLARE_WRITE16_MEMBER(mainram_w);
DECLARE_DRIVER_INIT(glass);
DECLARE_DRIVER_INIT(glassp);
- TILE_GET_INFO_MEMBER(get_tile_info_glass_screen0);
- TILE_GET_INFO_MEMBER(get_tile_info_glass_screen1);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
- UINT32 screen_update_glass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(glass_interrupt);
+
+ TILE_GET_INFO_MEMBER(get_tile_info_screen0);
+ TILE_GET_INFO_MEMBER(get_tile_info_screen1);
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(interrupt);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- void glass_ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+ void ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 );
};
diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h
index 2eb7e47df05..55c51ab406e 100644
--- a/src/mame/includes/goldstar.h
+++ b/src/mame/includes/goldstar.h
@@ -122,6 +122,7 @@ public:
DECLARE_DRIVER_INIT(rp35);
DECLARE_DRIVER_INIT(rp36);
DECLARE_DRIVER_INIT(rp36c3);
+ DECLARE_DRIVER_INIT(rp96sub);
UINT32 screen_update_amcoe1a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h
index 0551bc8e17f..fc05dc3baf9 100644
--- a/src/mame/includes/hh_tms1k.h
+++ b/src/mame/includes/hh_tms1k.h
@@ -41,6 +41,7 @@ public:
bool m_power_led;
UINT8 read_inputs(int columns);
+ UINT8 read_rotated_inputs(int columns, UINT8 rowmask = 0xf);
virtual DECLARE_INPUT_CHANGED_MEMBER(power_button);
virtual DECLARE_WRITE_LINE_MEMBER(auto_power_off);
@@ -61,8 +62,7 @@ public:
void display_update();
void set_display_size(int maxx, int maxy);
void set_display_segmask(UINT32 digits, UINT32 mask);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
- void display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/hh_ucom4.h b/src/mame/includes/hh_ucom4.h
index 76b3a5d7a02..36a525254b6 100644
--- a/src/mame/includes/hh_ucom4.h
+++ b/src/mame/includes/hh_ucom4.h
@@ -55,7 +55,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/xbox.h b/src/mame/includes/xbox.h
index 58d7588fc62..8094ac33100 100644
--- a/src/mame/includes/xbox.h
+++ b/src/mame/includes/xbox.h
@@ -188,6 +188,29 @@ enum USBDescriptorType {
ENDPOINT=5
};
+enum USBRequestType
+{
+ StandardType=0,
+ ClassType,
+ VendorType,
+ ReservedType
+};
+
+enum USBRequestRecipient
+{
+ DeviceRecipient=0,
+ InterfaceRecipient,
+ EndpointRecipient,
+ OtherRecipient
+};
+
+enum USBDeviceState
+{
+ DefaultState,
+ AddressState,
+ ConfiguredState
+};
+
class ohci_function_device {
public:
ohci_function_device(running_machine &machine);
@@ -198,11 +221,14 @@ private:
void add_configuration_descriptor(USBStandardConfigurationDescriptor &descriptor);
void add_interface_descriptor(USBStandardInterfaceDescriptor &descriptor);
void add_endpoint_descriptor(USBStandardEndpointDescriptor &descriptor);
+ int handle_nonstandard_request(USBSetupPacket *setup);
+ int state;
int address;
int newaddress;
int controldirection;
int controltype;
int controlrecipient;
+ int configurationvalue;
bool settingaddress;
int remain;
UINT8 *position;
diff --git a/src/mame/layout/amaztron.lay b/src/mame/layout/amaztron.lay
index 8b31f239489..947ff563f7f 100644
--- a/src/mame/layout/amaztron.lay
+++ b/src/mame/layout/amaztron.lay
@@ -3,31 +3,252 @@
<!-- define elements -->
+ <element name="static_black"><rect><color red="0" green="0" blue="0" /></rect></element>
+ <element name="static_blue"><rect><color red="0.2" green="0.5" blue="0.8" /></rect></element>
+ <element name="static_green"><rect><color red="0.2" green="0.8" blue="0.5" /></rect></element>
+ <element name="static_white"><rect><color red="0.88" green="0.88" blue="0.88" /></rect></element>
+
+ <element name="hl" defstate="0">
+ <text string=" ">
+ <bounds x="0.0" y="0.0" width="1.0" height="1.0" />
+ <color red="0.0" green="0.0" blue="0.0" />
+ </text>
+ <disk state="1">
+ <bounds x="0.07" y="0.07" width="0.86" height="0.86" />
+ <color red="1.0" green="1.0" blue="1.0" />
+ </disk>
+ </element>
+
<element name="digit" defstate="0">
<led7seg><color red="1.0" green="0.2" blue="0.2" /></led7seg>
</element>
- <element name="lamp_red" defstate="0">
+ <element name="ledr" defstate="0">
<disk state="0"><color red="0.2" green="0.04" blue="0.04" /></disk>
<disk state="1"><color red="1.0" green="0.2" blue="0.2" /></disk>
</element>
- <element name="lamp_green" defstate="0">
+ <element name="ledg" defstate="0">
<disk state="0"><color red="0.04" green="0.2" blue="0.04" /></disk>
<disk state="1"><color red="0.2" green="1.0" blue="0.2" /></disk>
</element>
+ <!-- note: some boards have blue text, the US/Canada one has black text -->
+ <element name="text_1">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="1"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_2">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="2"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_3">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="3"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_4">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="4"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_5">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="5"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_6">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="6"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_7">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="7"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_8">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="8"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_9">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="9"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_10">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="10"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_11">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="11"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_12">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="12"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_13">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="13"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_14">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="14"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_15">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="15"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_16">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="16"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_17">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="17"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_18">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="18"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_19">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="19"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_20">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="20"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_21">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="21"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_22">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="22"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_23">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="23"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_24">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="24"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+ <element name="text_25">
+ <rect><color red="0.88" green="0.88" blue="0.88" /></rect>
+ <text string="25"><color red="0.03" green="0.03" blue="0.03" /></text>
+ </element>
+
+ <element name="text_game"><text string="GAME"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_select"><text string="SELECT"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_start"><text string="START"><color red="0.9" green="0.9" blue="0.9" /></text></element>
<!-- build screen -->
<view name="Internal Layout">
- <bounds left="0" right="50" top="0" bottom="15" />
+ <bounds left="1" right="57" top="1" bottom="93" />
+ <bezel element="static_blue">
+ <bounds left="0" right="58" top="0" bottom="58" />
+ </bezel>
+
+ <!-- playing board buttons -->
+
+ <bezel element="static_white"><bounds x="5" y="5" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="15" y="5" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="25" y="5" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="35" y="5" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="45" y="5" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="5" y="15" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="15" y="15" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="25" y="15" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="35" y="15" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="45" y="15" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="5" y="25" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="15" y="25" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="25" y="25" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="35" y="25" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="45" y="25" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="5" y="35" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="15" y="35" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="25" y="35" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="35" y="35" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="45" y="35" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="5" y="45" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="15" y="45" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="25" y="45" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="35" y="45" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="45" y="45" width="8" height="8" /></bezel>
+
+ <bezel element="text_1"><bounds x="5.1" y="6" width="7.8" height="6" /></bezel>
+ <bezel element="text_2"><bounds x="15.1" y="6" width="7.8" height="6" /></bezel>
+ <bezel element="text_3"><bounds x="25.1" y="6" width="7.8" height="6" /></bezel>
+ <bezel element="text_4"><bounds x="35.1" y="6" width="7.8" height="6" /></bezel>
+ <bezel element="text_5"><bounds x="45.1" y="6" width="7.8" height="6" /></bezel>
+ <bezel element="text_6"><bounds x="5.1" y="16" width="7.8" height="6" /></bezel>
+ <bezel element="text_7"><bounds x="15.1" y="16" width="7.8" height="6" /></bezel>
+ <bezel element="text_8"><bounds x="25.1" y="16" width="7.8" height="6" /></bezel>
+ <bezel element="text_9"><bounds x="35.1" y="16" width="7.8" height="6" /></bezel>
+ <bezel element="text_10"><bounds x="45.1" y="16" width="7.8" height="6" /></bezel>
+ <bezel element="text_11"><bounds x="5.1" y="26" width="7.8" height="6" /></bezel>
+ <bezel element="text_12"><bounds x="15.1" y="26" width="7.8" height="6" /></bezel>
+ <bezel element="text_13"><bounds x="25.1" y="26" width="7.8" height="6" /></bezel>
+ <bezel element="text_14"><bounds x="35.1" y="26" width="7.8" height="6" /></bezel>
+ <bezel element="text_15"><bounds x="45.1" y="26" width="7.8" height="6" /></bezel>
+ <bezel element="text_16"><bounds x="5.1" y="36" width="7.8" height="6" /></bezel>
+ <bezel element="text_17"><bounds x="15.1" y="36" width="7.8" height="6" /></bezel>
+ <bezel element="text_18"><bounds x="25.1" y="36" width="7.8" height="6" /></bezel>
+ <bezel element="text_19"><bounds x="35.1" y="36" width="7.8" height="6" /></bezel>
+ <bezel element="text_20"><bounds x="45.1" y="36" width="7.8" height="6" /></bezel>
+ <bezel element="text_21"><bounds x="5.1" y="46" width="7.8" height="6" /></bezel>
+ <bezel element="text_22"><bounds x="15.1" y="46" width="7.8" height="6" /></bezel>
+ <bezel element="text_23"><bounds x="25.1" y="46" width="7.8" height="6" /></bezel>
+ <bezel element="text_24"><bounds x="35.1" y="46" width="7.8" height="6" /></bezel>
+ <bezel element="text_25"><bounds x="45.1" y="46" width="7.8" height="6" /></bezel>
+
+ <bezel element="hl" inputtag="IN.0" inputmask="0x01"><bounds x="5" y="5" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x01"><bounds x="15" y="5" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x01"><bounds x="25" y="5" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x01"><bounds x="35" y="5" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x01"><bounds x="45" y="5" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x02"><bounds x="5" y="15" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x02"><bounds x="15" y="15" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x02"><bounds x="25" y="15" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x02"><bounds x="35" y="15" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x02"><bounds x="45" y="15" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x04"><bounds x="5" y="25" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x04"><bounds x="15" y="25" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x04"><bounds x="25" y="25" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x04"><bounds x="35" y="25" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x04"><bounds x="45" y="25" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x08"><bounds x="5" y="35" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x08"><bounds x="15" y="35" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x08"><bounds x="25" y="35" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x08"><bounds x="35" y="35" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x08"><bounds x="45" y="35" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x10"><bounds x="5" y="45" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x10"><bounds x="15" y="45" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x10"><bounds x="25" y="45" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x10"><bounds x="35" y="45" width="8" height="8" /><color alpha="0.5" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x10"><bounds x="45" y="45" width="8" height="8" /><color alpha="0.5" /></bezel>
+
+ <!-- bottom side -->
+
+ <bezel element="static_white"><bounds x="0" y="57" width="58" height="60" /></bezel>
+ <bezel element="static_black"><bounds x="3" y="59" width="52" height="14" /></bezel>
+ <bezel element="static_black"><bounds x="3" y="75" width="52" height="24" /></bezel>
+
+ <bezel name="0.a" element="ledr"><bounds x="8.75" y="64.75" width="2.5" height="2.5" /></bezel>
+ <bezel name="1.a" element="ledg"><bounds x="18.75" y="64.75" width="2.5" height="2.5" /></bezel>
+
+ <bezel name="digit3" element="digit"><bounds x="40" y="62" width="5.33" height="8" /></bezel>
+ <bezel name="digit2" element="digit"><bounds x="45.33" y="62" width="5.33" height="8" /></bezel>
+
+ <bezel element="static_blue"><bounds x="5" y="78" width="8" height="8" /></bezel>
+ <bezel element="static_green"><bounds x="15" y="78" width="8" height="8" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x02"><bounds x="5.5" y="78.5" width="7" height="7" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x01"><bounds x="15.5" y="78.5" width="7" height="7" /><color alpha="0.3" /></bezel>
- <bezel name="lamp20" element="lamp_red"><bounds x="3.5" y="6" width="3" height="3" /></bezel>
- <bezel name="lamp21" element="lamp_green"><bounds x="13.5" y="6" width="3" height="3" /></bezel>
+ <bezel element="text_game"><bounds x="4" y="86.5" width="10" height="2" /></bezel>
+ <bezel element="text_start"><bounds x="4" y="88.5" width="10" height="2" /></bezel>
+ <bezel element="text_game"><bounds x="14" y="86.5" width="10" height="2" /></bezel>
+ <bezel element="text_select"><bounds x="14" y="88.5" width="10" height="2" /></bezel>
- <bezel name="digit1" element="digit"><bounds x="30" y="0" width="10" height="15" /></bezel>
- <bezel name="digit0" element="digit"><bounds x="40" y="0" width="10" height="15" /></bezel>
</view>
</mamelayout>
diff --git a/src/mame/layout/cnfball2.lay b/src/mame/layout/cnfball2.lay
new file mode 100644
index 00000000000..6f643de070b
--- /dev/null
+++ b/src/mame/layout/cnfball2.lay
@@ -0,0 +1,185 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_white"><rect><color red="0.8" green="0.8" blue="0.8" /></rect></element>
+ <element name="static_green"><rect><color red="0.1" green="0.5" blue="0.2" /></rect></element>
+
+ <element name="text_down">
+ <rect><color red="0.1" green="0.5" blue="0.2" /></rect>
+ <text string="DOWN"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+ <element name="text_home">
+ <rect><color red="0.1" green="0.5" blue="0.2" /></rect>
+ <text string="HOME"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+ <element name="text_yards">
+ <rect><color red="0.1" green="0.5" blue="0.2" /></rect>
+ <text string="YARDS TO GO"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+ <element name="text_time">
+ <rect><color red="0.1" green="0.5" blue="0.2" /></rect>
+ <text string="TIME REMAINING"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+ <element name="text_field">
+ <rect><color red="0.1" green="0.5" blue="0.2" /></rect>
+ <text string="FIELD POSITION"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+ <element name="text_visitor">
+ <rect><color red="0.1" green="0.5" blue="0.2" /></rect>
+ <text string="VISITOR"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+
+ <element name="text_p1">
+ <rect><color red="0.06" green="0.3" blue="0.12" /></rect>
+ <text string="PL SEL:">
+ <bounds x="0.0" y="0.17" width="1.0" height="0.6" />
+ <color red="0.7" green="0.7" blue="0.8" />
+ </text>
+ </element>
+ <element name="text_p2" defstate="0">
+ <rect><color red="0.06" green="0.3" blue="0.12" /></rect>
+ <text state="0" string="RUN">
+ <bounds x="0.0" y="0.17" width="1.0" height="0.6" />
+ <color red="0.82" green="0.82" blue="0.82" />
+ </text>
+ <text state="1" string="PASS">
+ <bounds x="0.0" y="0.17" width="1.0" height="0.6" />
+ <color red="0.82" green="0.82" blue="0.82" />
+ </text>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.25" blue="0.26" /></led7seg>
+ </element>
+ <element name="seg" defstate="0">
+ <rect state="0"><color red="0.13" green="0.0325" blue="0.0338" /></rect>
+ <rect state="1"><color red="1.0" green="0.25" blue="0.26" /></rect>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-9" right="393" top="-104" bottom="186" />
+ <bezel element="static_black">
+ <bounds left="-9" right="393" top="-104" bottom="186" />
+ </bezel>
+
+ <!-- bezel -->
+
+ <bezel element="static_green"><bounds left="-9" right="393" top="-110" bottom="-60" /></bezel>
+ <bezel element="static_green"><bounds left="-9" right="393" top="111" bottom="200" /></bezel>
+
+ <bezel element="static_white"><bounds x="-10" y="-84" width="404" height="3" /></bezel>
+ <bezel element="text_down"><bounds x="5" y="-92" width="66" height="19" /></bezel>
+ <bezel element="text_field"><bounds x="122" y="-92" width="140" height="19" /></bezel>
+ <bezel element="text_yards"><bounds x="286" y="-92" width="111" height="19" /></bezel>
+
+ <bezel element="static_white"><bounds x="-10" y="141" width="404" height="3" /></bezel>
+ <bezel element="text_home"><bounds x="5" y="133" width="66" height="19" /></bezel>
+ <bezel element="text_time"><bounds x="122" y="133" width="140" height="19" /></bezel>
+ <bezel element="text_visitor"><bounds x="306" y="133" width="80" height="19" /></bezel>
+
+ <bezel element="text_p1"><bounds x="316" y="161" width="40" height="16" /></bezel>
+ <bezel element="text_p2" inputtag="IN.0" inputmask="0x04">
+ <bounds x="354" y="161" width="35" height="16" />
+ </bezel>
+
+ <bezel element="static_white"><bounds left="-9" right="393" top="-61" bottom="-51" /></bezel>
+ <bezel element="static_white"><bounds left="-9" right="393" top="110" bottom="120" /></bezel>
+
+ <bezel element="static_white"><bounds x="-9" y="-52" width="4" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="37" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="81" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="125" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="169" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="213" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="257" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="301" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="345" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="389" y="-52" width="4" height="163" /></bezel>
+
+ <bezel element="static_white"><bounds x="-8" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="-8" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="-8" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="36" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="36" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="36" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="80" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="80" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="80" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="124" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="124" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="124" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="168" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="168" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="168" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="212" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="212" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="212" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="256" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="256" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="256" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="300" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="300" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="300" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="344" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="344" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="344" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="388" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="388" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="388" y="56" width="4" height="1" /></bezel>
+
+ <!-- leds -->
+
+ <bezel name="digit8" element="digit"><bounds x="3" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="8.8" element="seg"><bounds x="7" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="8.9" element="seg"><bounds x="7" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit7" element="digit"><bounds x="47" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="7.8" element="seg"><bounds x="51" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="7.9" element="seg"><bounds x="51" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit6" element="digit"><bounds x="91" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="6.8" element="seg"><bounds x="95" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="6.9" element="seg"><bounds x="95" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit5" element="digit"><bounds x="135" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="5.8" element="seg"><bounds x="139" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="5.9" element="seg"><bounds x="139" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit4" element="digit"><bounds x="179" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="4.8" element="seg"><bounds x="183" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="4.9" element="seg"><bounds x="183" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit3" element="digit"><bounds x="223" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="3.8" element="seg"><bounds x="227" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="3.9" element="seg"><bounds x="227" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit2" element="digit"><bounds x="267" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="2.8" element="seg"><bounds x="271" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="2.9" element="seg"><bounds x="271" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit1" element="digit"><bounds x="311" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="1.8" element="seg"><bounds x="315" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="1.9" element="seg"><bounds x="315" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit0" element="digit"><bounds x="355" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="0.8" element="seg"><bounds x="359" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="0.9" element="seg"><bounds x="359" y="71.5" width="15" height="3" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/cnsector.lay b/src/mame/layout/cnsector.lay
index 5bd9aaa0d48..730e02c3d06 100644
--- a/src/mame/layout/cnsector.lay
+++ b/src/mame/layout/cnsector.lay
@@ -12,7 +12,7 @@
<led7seg><color red="1.0" green="0.25" blue="0.20" /></led7seg>
</element>
- <element name="lamp" defstate="0">
+ <element name="led" defstate="0">
<disk state="1"><color red="1.0" green="0.25" blue="0.20" /></disk>
<disk state="0"><color red="0.2" green="0.0" blue="0.0" /></disk>
</element>
@@ -56,7 +56,6 @@
</element>
-
<!-- build screen -->
<view name="Internal Layout">
@@ -87,7 +86,6 @@
<bezel element="text_depth"><bounds x="21" y="37" width="20" height="7" /></bezel>
<bezel element="text_range"><bounds x="57" y="37" width="20" height="7" /></bezel>
-
<bezel name="digit5" element="digit">
<bounds x="5" y="17" width="10" height="15" />
</bezel>
@@ -109,35 +107,26 @@
<bounds x="77" y="17" width="10" height="15" />
</bezel>
-
<!-- compass -->
<bezel element="static_gray"><bounds x="0" y="50" width="100" height="100" /></bezel>
<bezel element="static_red"><bounds x="0" y="55" width="100" height="86" /></bezel>
- <bezel name="lamp60" element="lamp">
- <bounds x="42" y="62" width="8" height="8" />
- </bezel>
- <bezel name="lamp61" element="lamp">
- <bounds x="42" y="126" width="8" height="8" />
- </bezel>
- <bezel name="lamp62" element="lamp">
- <bounds x="74" y="94" width="8" height="8" />
- </bezel>
- <bezel name="lamp63" element="lamp">
- <bounds x="10" y="94" width="8" height="8" />
- </bezel>
+ <bezel name="6.a" element="led"><bounds x="42" y="62" width="8" height="8" /></bezel>
+ <bezel name="7.a" element="led"><bounds x="42" y="126" width="8" height="8" /></bezel>
+ <bezel name="8.a" element="led"><bounds x="74" y="94" width="8" height="8" /></bezel>
+ <bezel name="9.a" element="led"><bounds x="10" y="94" width="8" height="8" /></bezel>
<bezel element="text_n"><bounds x="41" y="72" width="10" height="10" /></bezel>
<bezel element="text_s"><bounds x="41" y="114" width="10" height="10" /></bezel>
<bezel element="text_e"><bounds x="63" y="93" width="10" height="10" /></bezel>
<bezel element="text_w"><bounds x="21" y="93" width="10" height="10" /></bezel>
-
<!-- crop borders -->
<bezel element="static_black"><bounds x="92" y="0" width="10" height="160" /></bezel>
<bezel element="static_black"><bounds x="0" y="146" width="100" height="10" /></bezel>
+
</view>
</mamelayout>
diff --git a/src/mame/layout/cqback.lay b/src/mame/layout/cqback.lay
new file mode 100644
index 00000000000..ebdfa1feaf8
--- /dev/null
+++ b/src/mame/layout/cqback.lay
@@ -0,0 +1,178 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_white"><rect><color red="0.8" green="0.8" blue="0.8" /></rect></element>
+ <element name="static_green"><rect><color red="0.1" green="0.5" blue="0.2" /></rect></element>
+ <element name="static_orange"><rect><color red="0.8" green="0.25" blue="0.1" /></rect></element>
+
+ <element name="text_down">
+ <rect><color red="0.8" green="0.8" blue="0.8" /></rect>
+ <text string="DOWN"><color red="0.8" green="0.25" blue="0.1" /></text>
+ </element>
+ <element name="text_home">
+ <rect><color red="0.8" green="0.8" blue="0.8" /></rect>
+ <text string="HOME"><color red="0.8" green="0.25" blue="0.1" /></text>
+ </element>
+ <element name="text_yards">
+ <rect><color red="0.8" green="0.8" blue="0.8" /></rect>
+ <text string="YARDS TO GO"><color red="0.8" green="0.25" blue="0.1" /></text>
+ </element>
+ <element name="text_time">
+ <rect><color red="0.8" green="0.8" blue="0.8" /></rect>
+ <text string="TIME REMAINING"><color red="0.8" green="0.25" blue="0.1" /></text>
+ </element>
+ <element name="text_field">
+ <rect><color red="0.8" green="0.8" blue="0.8" /></rect>
+ <text string="FIELD POS."><color red="0.8" green="0.25" blue="0.1" /></text>
+ </element>
+ <element name="text_visitor">
+ <rect><color red="0.8" green="0.8" blue="0.8" /></rect>
+ <text string="VISITOR"><color red="0.8" green="0.25" blue="0.1" /></text>
+ </element>
+
+ <element name="text_p1">
+ <rect><color red="0.06" green="0.3" blue="0.12" /></rect>
+ <text string="PL SEL:">
+ <bounds x="0.0" y="0.17" width="1.0" height="0.6" />
+ <color red="0.7" green="0.7" blue="0.8" />
+ </text>
+ </element>
+ <element name="text_p2" defstate="0">
+ <rect><color red="0.06" green="0.3" blue="0.12" /></rect>
+ <text state="0" string="RUN/KICK">
+ <bounds x="0.0" y="0.17" width="1.0" height="0.6" />
+ <color red="0.82" green="0.82" blue="0.82" />
+ </text>
+ <text state="1" string="PASS">
+ <bounds x="0.0" y="0.17" width="1.0" height="0.6" />
+ <color red="0.82" green="0.82" blue="0.82" />
+ </text>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.25" blue="0.26" /></led7seg>
+ </element>
+ <element name="seg" defstate="0">
+ <rect state="0"><color red="0.13" green="0.0325" blue="0.0338" /></rect>
+ <rect state="1"><color red="1.0" green="0.25" blue="0.26" /></rect>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-9" right="393" top="-130" bottom="156" />
+ <bezel element="static_black">
+ <bounds left="-9" right="393" top="-130" bottom="156" />
+ </bezel>
+
+ <!-- bezel -->
+
+ <bezel element="static_white"><bounds left="-9" right="393" top="-130" bottom="-60" /></bezel>
+ <bezel element="static_green"><bounds left="-9" right="393" top="111" bottom="156" /></bezel>
+
+ <bezel element="text_down"><bounds x="-5" y="-126" width="86" height="19" /></bezel>
+ <bezel element="text_yards"><bounds x="107" y="-126" width="170" height="19" /></bezel>
+ <bezel element="text_field"><bounds x="301" y="-126" width="90" height="19" /></bezel>
+
+ <bezel element="text_home"><bounds x="-5" y="-92" width="86" height="19" /></bezel>
+ <bezel element="text_time"><bounds x="107" y="-92" width="170" height="19" /></bezel>
+ <bezel element="text_visitor"><bounds x="301" y="-92" width="90" height="19" /></bezel>
+
+ <bezel element="text_p1"><bounds x="301" y="130" width="40" height="16" /></bezel>
+ <bezel element="text_p2" inputtag="IN.1" inputmask="0x01">
+ <bounds x="339" y="130" width="50" height="16" />
+ </bezel>
+
+ <bezel element="static_orange"><bounds left="-9" right="393" top="-102" bottom="-96" /></bezel>
+ <bezel element="static_white"><bounds left="-9" right="393" top="-61" bottom="-51" /></bezel>
+ <bezel element="static_green"><bounds left="-9" right="393" top="-67" bottom="-61" /></bezel>
+ <bezel element="static_white"><bounds left="-9" right="393" top="110" bottom="120" /></bezel>
+
+ <bezel element="static_white"><bounds x="-9" y="-52" width="4" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="37" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="81" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="125" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="169" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="213" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="257" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="301" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="345" y="-52" width="2" height="163" /></bezel>
+ <bezel element="static_white"><bounds x="389" y="-52" width="4" height="163" /></bezel>
+
+ <bezel element="static_white"><bounds x="36" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="36" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="36" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="80" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="80" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="80" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="124" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="124" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="124" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="168" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="168" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="168" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="212" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="212" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="212" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="256" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="256" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="256" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="300" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="300" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="300" y="56" width="4" height="1" /></bezel>
+
+ <bezel element="static_white"><bounds x="344" y="2" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="344" y="29" width="4" height="1" /></bezel>
+ <bezel element="static_white"><bounds x="344" y="56" width="4" height="1" /></bezel>
+
+ <!-- leds -->
+
+ <bezel name="digit0" element="digit"><bounds x="3" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="0.8" element="seg"><bounds x="7" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="0.9" element="seg"><bounds x="7" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit1" element="digit"><bounds x="47" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="1.8" element="seg"><bounds x="51" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="1.9" element="seg"><bounds x="51" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit2" element="digit"><bounds x="91" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="2.8" element="seg"><bounds x="95" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="2.9" element="seg"><bounds x="95" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit3" element="digit"><bounds x="135" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="3.8" element="seg"><bounds x="139" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="3.9" element="seg"><bounds x="139" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit4" element="digit"><bounds x="179" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="4.8" element="seg"><bounds x="183" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="4.9" element="seg"><bounds x="183" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit5" element="digit"><bounds x="223" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="5.8" element="seg"><bounds x="227" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="5.9" element="seg"><bounds x="227" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit6" element="digit"><bounds x="267" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="6.8" element="seg"><bounds x="271" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="6.9" element="seg"><bounds x="271" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit7" element="digit"><bounds x="311" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="7.8" element="seg"><bounds x="315" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="7.9" element="seg"><bounds x="315" y="71.5" width="15" height="3" /></bezel>
+
+ <bezel name="digit8" element="digit"><bounds x="355" y="-15.5" width="24" height="32" /></bezel>
+ <bezel name="8.8" element="seg"><bounds x="359" y="42.5" width="15" height="3" /></bezel>
+ <bezel name="8.9" element="seg"><bounds x="359" y="71.5" width="15" height="3" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/esq2by16.lay b/src/mame/layout/esq2by16.lay
new file mode 100644
index 00000000000..1861b335476
--- /dev/null
+++ b/src/mame/layout/esq2by16.lay
@@ -0,0 +1,980 @@
+<?xml version="1.0"?>
+<!-- esq2by16.lay -->
+<!-- 2016-01-30: Initial version. [Parduz from R. Belmont / VFDGen 0.1] -->
+
+<mamelayout version="2">
+
+ <element name="rLeds">
+ <rect state ="0">
+ <bounds x="0" y="0" width="5" height="2" />
+ <color red="0.2" green="0.2" blue="0.0" />
+ </rect>
+ <rect state ="1">
+ <bounds x="0" y="0" width="5" height="2" />
+ <color red="1.0" green="1.0" blue="0.0" />
+ </rect>
+ <rect state ="2">
+ <bounds x="0" y="0" width="5" height="2" />
+ <color red="0.5" green="0.5" blue="0.0" />
+ </rect>
+ <rect state ="3">
+ <bounds x="0" y="0" width="5" height="2" />
+ <color red="0.0" green="1.0" blue="1.0" />
+ </rect>
+ </element>
+
+ <element name="background">
+ <rect>
+ <bounds left="0" top="0" right="1" bottom="1" />
+ <color red="0.3" green="0.3" blue="0.5" />
+ </rect>
+ </element>
+
+
+ <element name="Page1">
+ <dotmatrix5dot>
+ <color red="0.0" green="1.0" blue="1.0" />
+ </dotmatrix5dot>
+ </element>
+
+ <element name="Page2">
+ <dotmatrix5dot>
+ <color red="0.0" green="1.0" blue="0.0" />
+ </dotmatrix5dot>
+ </element>
+
+ <element name="Page3">
+ <dotmatrix5dot>
+ <color red="1.0" green="1.0" blue="0.0" />
+ </dotmatrix5dot>
+ </element>
+
+ <element name="Page4">
+ <dotmatrix5dot>
+ <color red="0.0" green="0.0" blue="1.0" />
+ </dotmatrix5dot>
+ </element>
+
+ <view name="Default Layout">
+ <!-- Background -->
+ <backdrop element="background">
+ <bounds left="0" top="0" right="300" bottom="120" />
+ </backdrop>
+ <bezel name="rLed_0" element="rLeds"> <bounds x="200" y="0" width="5" height="3" /> </bezel>
+ <bezel name="rLed_8" element="rLeds"> <bounds x="200" y="20" width="5" height="3" /> </bezel>
+ <bezel name="rLed_9" element="rLeds"> <bounds x="240" y="0" width="5" height="3" /> </bezel>
+ <bezel name="rLed_1" element="rLeds"> <bounds x="240" y="20" width="5" height="3" /> </bezel>
+ <bezel name="rLed_2" element="rLeds"> <bounds x="260" y="00" width="5" height="3" /> </bezel>
+ <bezel name="rLed_3" element="rLeds"> <bounds x="270" y="00" width="5" height="3" /> </bezel>
+ <bezel name="rLed_4" element="rLeds"> <bounds x="280" y="00" width="5" height="3" /> </bezel>
+ <bezel name="rLed_5" element="rLeds"> <bounds x="290" y="00" width="5" height="3" /> </bezel>
+ <bezel name="rLed_10" element="rLeds"> <bounds x="260" y="10" width="5" height="3" /> </bezel>
+ <bezel name="rLed_11" element="rLeds"> <bounds x="270" y="10" width="5" height="3" /> </bezel>
+ <bezel name="rLed_12" element="rLeds"> <bounds x="280" y="10" width="5" height="3" /> </bezel>
+ <bezel name="rLed_13" element="rLeds"> <bounds x="290" y="10" width="5" height="3" /> </bezel>
+
+ <bezel name="rLed_6" element="rLeds"> <bounds x="260" y="20" width="5" height="3" /> </bezel>
+ <bezel name="rLed_7" element="rLeds"> <bounds x="270" y="20" width="5" height="3" /> </bezel>
+ <bezel name="rLed_14" element="rLeds"> <bounds x="280" y="20" width="5" height="3" /> </bezel>
+ <bezel name="rLed_15" element="rLeds"> <bounds x="290" y="20" width="5" height="3" /> </bezel>
+ <bezel name="pg_3000" element="Page3" state="0"> <bounds x=" 0" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3001" element="Page3" state="0"> <bounds x=" 0" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3002" element="Page3" state="0"> <bounds x=" 0" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3003" element="Page3" state="0"> <bounds x=" 0" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3004" element="Page3" state="0"> <bounds x=" 0" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3005" element="Page3" state="0"> <bounds x=" 0" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3006" element="Page3" state="0"> <bounds x=" 0" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3007" element="Page3" state="0"> <bounds x=" 6" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3008" element="Page3" state="0"> <bounds x=" 6" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3009" element="Page3" state="0"> <bounds x=" 6" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3010" element="Page3" state="0"> <bounds x=" 6" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3011" element="Page3" state="0"> <bounds x=" 6" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3012" element="Page3" state="0"> <bounds x=" 6" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3013" element="Page3" state="0"> <bounds x=" 6" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3014" element="Page3" state="0"> <bounds x=" 12" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3015" element="Page3" state="0"> <bounds x=" 12" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3016" element="Page3" state="0"> <bounds x=" 12" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3017" element="Page3" state="0"> <bounds x=" 12" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3018" element="Page3" state="0"> <bounds x=" 12" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3019" element="Page3" state="0"> <bounds x=" 12" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3020" element="Page3" state="0"> <bounds x=" 12" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3021" element="Page3" state="0"> <bounds x=" 18" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3022" element="Page3" state="0"> <bounds x=" 18" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3023" element="Page3" state="0"> <bounds x=" 18" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3024" element="Page3" state="0"> <bounds x=" 18" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3025" element="Page3" state="0"> <bounds x=" 18" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3026" element="Page3" state="0"> <bounds x=" 18" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3027" element="Page3" state="0"> <bounds x=" 18" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3028" element="Page3" state="0"> <bounds x=" 24" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3029" element="Page3" state="0"> <bounds x=" 24" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3030" element="Page3" state="0"> <bounds x=" 24" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3031" element="Page3" state="0"> <bounds x=" 24" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3032" element="Page3" state="0"> <bounds x=" 24" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3033" element="Page3" state="0"> <bounds x=" 24" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3034" element="Page3" state="0"> <bounds x=" 24" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3035" element="Page3" state="0"> <bounds x=" 30" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3036" element="Page3" state="0"> <bounds x=" 30" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3037" element="Page3" state="0"> <bounds x=" 30" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3038" element="Page3" state="0"> <bounds x=" 30" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3039" element="Page3" state="0"> <bounds x=" 30" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3040" element="Page3" state="0"> <bounds x=" 30" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3041" element="Page3" state="0"> <bounds x=" 30" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3042" element="Page3" state="0"> <bounds x=" 36" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3043" element="Page3" state="0"> <bounds x=" 36" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3044" element="Page3" state="0"> <bounds x=" 36" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3045" element="Page3" state="0"> <bounds x=" 36" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3046" element="Page3" state="0"> <bounds x=" 36" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3047" element="Page3" state="0"> <bounds x=" 36" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3048" element="Page3" state="0"> <bounds x=" 36" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3049" element="Page3" state="0"> <bounds x=" 42" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3050" element="Page3" state="0"> <bounds x=" 42" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3051" element="Page3" state="0"> <bounds x=" 42" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3052" element="Page3" state="0"> <bounds x=" 42" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3053" element="Page3" state="0"> <bounds x=" 42" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3054" element="Page3" state="0"> <bounds x=" 42" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3055" element="Page3" state="0"> <bounds x=" 42" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3056" element="Page3" state="0"> <bounds x=" 48" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3057" element="Page3" state="0"> <bounds x=" 48" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3058" element="Page3" state="0"> <bounds x=" 48" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3059" element="Page3" state="0"> <bounds x=" 48" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3060" element="Page3" state="0"> <bounds x=" 48" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3061" element="Page3" state="0"> <bounds x=" 48" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3062" element="Page3" state="0"> <bounds x=" 48" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3063" element="Page3" state="0"> <bounds x=" 54" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3064" element="Page3" state="0"> <bounds x=" 54" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3065" element="Page3" state="0"> <bounds x=" 54" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3066" element="Page3" state="0"> <bounds x=" 54" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3067" element="Page3" state="0"> <bounds x=" 54" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3068" element="Page3" state="0"> <bounds x=" 54" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3069" element="Page3" state="0"> <bounds x=" 54" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3070" element="Page3" state="0"> <bounds x=" 60" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3071" element="Page3" state="0"> <bounds x=" 60" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3072" element="Page3" state="0"> <bounds x=" 60" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3073" element="Page3" state="0"> <bounds x=" 60" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3074" element="Page3" state="0"> <bounds x=" 60" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3075" element="Page3" state="0"> <bounds x=" 60" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3076" element="Page3" state="0"> <bounds x=" 60" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3077" element="Page3" state="0"> <bounds x=" 66" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3078" element="Page3" state="0"> <bounds x=" 66" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3079" element="Page3" state="0"> <bounds x=" 66" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3080" element="Page3" state="0"> <bounds x=" 66" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3081" element="Page3" state="0"> <bounds x=" 66" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3082" element="Page3" state="0"> <bounds x=" 66" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3083" element="Page3" state="0"> <bounds x=" 66" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3084" element="Page3" state="0"> <bounds x=" 72" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3085" element="Page3" state="0"> <bounds x=" 72" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3086" element="Page3" state="0"> <bounds x=" 72" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3087" element="Page3" state="0"> <bounds x=" 72" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3088" element="Page3" state="0"> <bounds x=" 72" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3089" element="Page3" state="0"> <bounds x=" 72" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3090" element="Page3" state="0"> <bounds x=" 72" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3091" element="Page3" state="0"> <bounds x=" 78" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3092" element="Page3" state="0"> <bounds x=" 78" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3093" element="Page3" state="0"> <bounds x=" 78" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3094" element="Page3" state="0"> <bounds x=" 78" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3095" element="Page3" state="0"> <bounds x=" 78" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3096" element="Page3" state="0"> <bounds x=" 78" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3097" element="Page3" state="0"> <bounds x=" 78" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3098" element="Page3" state="0"> <bounds x=" 84" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3099" element="Page3" state="0"> <bounds x=" 84" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3100" element="Page3" state="0"> <bounds x=" 84" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3101" element="Page3" state="0"> <bounds x=" 84" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3102" element="Page3" state="0"> <bounds x=" 84" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3103" element="Page3" state="0"> <bounds x=" 84" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3104" element="Page3" state="0"> <bounds x=" 84" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3105" element="Page3" state="0"> <bounds x=" 90" y=" 0" width="5" height="1" /> </bezel>
+ <bezel name="pg_3106" element="Page3" state="0"> <bounds x=" 90" y=" 1" width="5" height="1" /> </bezel>
+ <bezel name="pg_3107" element="Page3" state="0"> <bounds x=" 90" y=" 2" width="5" height="1" /> </bezel>
+ <bezel name="pg_3108" element="Page3" state="0"> <bounds x=" 90" y=" 3" width="5" height="1" /> </bezel>
+ <bezel name="pg_3109" element="Page3" state="0"> <bounds x=" 90" y=" 4" width="5" height="1" /> </bezel>
+ <bezel name="pg_3110" element="Page3" state="0"> <bounds x=" 90" y=" 5" width="5" height="1" /> </bezel>
+ <bezel name="pg_3111" element="Page3" state="0"> <bounds x=" 90" y=" 6" width="5" height="1" /> </bezel>
+ <bezel name="pg_3112" element="Page3" state="0"> <bounds x=" 0" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3113" element="Page3" state="0"> <bounds x=" 0" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3114" element="Page3" state="0"> <bounds x=" 0" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3115" element="Page3" state="0"> <bounds x=" 0" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3116" element="Page3" state="0"> <bounds x=" 0" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3117" element="Page3" state="0"> <bounds x=" 0" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3118" element="Page3" state="0"> <bounds x=" 0" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3119" element="Page3" state="0"> <bounds x=" 6" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3120" element="Page3" state="0"> <bounds x=" 6" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3121" element="Page3" state="0"> <bounds x=" 6" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3122" element="Page3" state="0"> <bounds x=" 6" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3123" element="Page3" state="0"> <bounds x=" 6" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3124" element="Page3" state="0"> <bounds x=" 6" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3125" element="Page3" state="0"> <bounds x=" 6" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3126" element="Page3" state="0"> <bounds x=" 12" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3127" element="Page3" state="0"> <bounds x=" 12" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3128" element="Page3" state="0"> <bounds x=" 12" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3129" element="Page3" state="0"> <bounds x=" 12" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3130" element="Page3" state="0"> <bounds x=" 12" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3131" element="Page3" state="0"> <bounds x=" 12" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3132" element="Page3" state="0"> <bounds x=" 12" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3133" element="Page3" state="0"> <bounds x=" 18" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3134" element="Page3" state="0"> <bounds x=" 18" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3135" element="Page3" state="0"> <bounds x=" 18" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3136" element="Page3" state="0"> <bounds x=" 18" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3137" element="Page3" state="0"> <bounds x=" 18" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3138" element="Page3" state="0"> <bounds x=" 18" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3139" element="Page3" state="0"> <bounds x=" 18" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3140" element="Page3" state="0"> <bounds x=" 24" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3141" element="Page3" state="0"> <bounds x=" 24" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3142" element="Page3" state="0"> <bounds x=" 24" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3143" element="Page3" state="0"> <bounds x=" 24" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3144" element="Page3" state="0"> <bounds x=" 24" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3145" element="Page3" state="0"> <bounds x=" 24" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3146" element="Page3" state="0"> <bounds x=" 24" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3147" element="Page3" state="0"> <bounds x=" 30" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3148" element="Page3" state="0"> <bounds x=" 30" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3149" element="Page3" state="0"> <bounds x=" 30" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3150" element="Page3" state="0"> <bounds x=" 30" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3151" element="Page3" state="0"> <bounds x=" 30" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3152" element="Page3" state="0"> <bounds x=" 30" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3153" element="Page3" state="0"> <bounds x=" 30" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3154" element="Page3" state="0"> <bounds x=" 36" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3155" element="Page3" state="0"> <bounds x=" 36" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3156" element="Page3" state="0"> <bounds x=" 36" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3157" element="Page3" state="0"> <bounds x=" 36" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3158" element="Page3" state="0"> <bounds x=" 36" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3159" element="Page3" state="0"> <bounds x=" 36" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3160" element="Page3" state="0"> <bounds x=" 36" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3161" element="Page3" state="0"> <bounds x=" 42" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3162" element="Page3" state="0"> <bounds x=" 42" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3163" element="Page3" state="0"> <bounds x=" 42" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3164" element="Page3" state="0"> <bounds x=" 42" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3165" element="Page3" state="0"> <bounds x=" 42" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3166" element="Page3" state="0"> <bounds x=" 42" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3167" element="Page3" state="0"> <bounds x=" 42" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3168" element="Page3" state="0"> <bounds x=" 48" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3169" element="Page3" state="0"> <bounds x=" 48" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3170" element="Page3" state="0"> <bounds x=" 48" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3171" element="Page3" state="0"> <bounds x=" 48" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3172" element="Page3" state="0"> <bounds x=" 48" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3173" element="Page3" state="0"> <bounds x=" 48" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3174" element="Page3" state="0"> <bounds x=" 48" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3175" element="Page3" state="0"> <bounds x=" 54" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3176" element="Page3" state="0"> <bounds x=" 54" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3177" element="Page3" state="0"> <bounds x=" 54" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3178" element="Page3" state="0"> <bounds x=" 54" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3179" element="Page3" state="0"> <bounds x=" 54" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3180" element="Page3" state="0"> <bounds x=" 54" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3181" element="Page3" state="0"> <bounds x=" 54" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3182" element="Page3" state="0"> <bounds x=" 60" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3183" element="Page3" state="0"> <bounds x=" 60" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3184" element="Page3" state="0"> <bounds x=" 60" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3185" element="Page3" state="0"> <bounds x=" 60" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3186" element="Page3" state="0"> <bounds x=" 60" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3187" element="Page3" state="0"> <bounds x=" 60" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3188" element="Page3" state="0"> <bounds x=" 60" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3189" element="Page3" state="0"> <bounds x=" 66" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3190" element="Page3" state="0"> <bounds x=" 66" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3191" element="Page3" state="0"> <bounds x=" 66" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3192" element="Page3" state="0"> <bounds x=" 66" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3193" element="Page3" state="0"> <bounds x=" 66" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3194" element="Page3" state="0"> <bounds x=" 66" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3195" element="Page3" state="0"> <bounds x=" 66" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3196" element="Page3" state="0"> <bounds x=" 72" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3197" element="Page3" state="0"> <bounds x=" 72" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3198" element="Page3" state="0"> <bounds x=" 72" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3199" element="Page3" state="0"> <bounds x=" 72" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3200" element="Page3" state="0"> <bounds x=" 72" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3201" element="Page3" state="0"> <bounds x=" 72" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3202" element="Page3" state="0"> <bounds x=" 72" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3203" element="Page3" state="0"> <bounds x=" 78" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3204" element="Page3" state="0"> <bounds x=" 78" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3205" element="Page3" state="0"> <bounds x=" 78" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3206" element="Page3" state="0"> <bounds x=" 78" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3207" element="Page3" state="0"> <bounds x=" 78" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3208" element="Page3" state="0"> <bounds x=" 78" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3209" element="Page3" state="0"> <bounds x=" 78" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3210" element="Page3" state="0"> <bounds x=" 84" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3211" element="Page3" state="0"> <bounds x=" 84" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3212" element="Page3" state="0"> <bounds x=" 84" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3213" element="Page3" state="0"> <bounds x=" 84" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3214" element="Page3" state="0"> <bounds x=" 84" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3215" element="Page3" state="0"> <bounds x=" 84" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3216" element="Page3" state="0"> <bounds x=" 84" y=" 16" width="5" height="1" /> </bezel>
+ <bezel name="pg_3217" element="Page3" state="0"> <bounds x=" 90" y=" 10" width="5" height="1" /> </bezel>
+ <bezel name="pg_3218" element="Page3" state="0"> <bounds x=" 90" y=" 11" width="5" height="1" /> </bezel>
+ <bezel name="pg_3219" element="Page3" state="0"> <bounds x=" 90" y=" 12" width="5" height="1" /> </bezel>
+ <bezel name="pg_3220" element="Page3" state="0"> <bounds x=" 90" y=" 13" width="5" height="1" /> </bezel>
+ <bezel name="pg_3221" element="Page3" state="0"> <bounds x=" 90" y=" 14" width="5" height="1" /> </bezel>
+ <bezel name="pg_3222" element="Page3" state="0"> <bounds x=" 90" y=" 15" width="5" height="1" /> </bezel>
+ <bezel name="pg_3223" element="Page3" state="0"> <bounds x=" 90" y=" 16" width="5" height="1" /> </bezel>
+
+ <bezel name="pg_2000" element="Page2" state="0"> <bounds x=" 0" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2001" element="Page2" state="0"> <bounds x=" 0" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2002" element="Page2" state="0"> <bounds x=" 0" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2003" element="Page2" state="0"> <bounds x=" 0" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2004" element="Page2" state="0"> <bounds x=" 0" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2005" element="Page2" state="0"> <bounds x=" 0" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2006" element="Page2" state="0"> <bounds x=" 0" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2007" element="Page2" state="0"> <bounds x=" 6" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2008" element="Page2" state="0"> <bounds x=" 6" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2009" element="Page2" state="0"> <bounds x=" 6" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2010" element="Page2" state="0"> <bounds x=" 6" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2011" element="Page2" state="0"> <bounds x=" 6" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2012" element="Page2" state="0"> <bounds x=" 6" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2013" element="Page2" state="0"> <bounds x=" 6" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2014" element="Page2" state="0"> <bounds x=" 12" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2015" element="Page2" state="0"> <bounds x=" 12" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2016" element="Page2" state="0"> <bounds x=" 12" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2017" element="Page2" state="0"> <bounds x=" 12" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2018" element="Page2" state="0"> <bounds x=" 12" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2019" element="Page2" state="0"> <bounds x=" 12" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2020" element="Page2" state="0"> <bounds x=" 12" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2021" element="Page2" state="0"> <bounds x=" 18" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2022" element="Page2" state="0"> <bounds x=" 18" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2023" element="Page2" state="0"> <bounds x=" 18" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2024" element="Page2" state="0"> <bounds x=" 18" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2025" element="Page2" state="0"> <bounds x=" 18" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2026" element="Page2" state="0"> <bounds x=" 18" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2027" element="Page2" state="0"> <bounds x=" 18" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2028" element="Page2" state="0"> <bounds x=" 24" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2029" element="Page2" state="0"> <bounds x=" 24" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2030" element="Page2" state="0"> <bounds x=" 24" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2031" element="Page2" state="0"> <bounds x=" 24" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2032" element="Page2" state="0"> <bounds x=" 24" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2033" element="Page2" state="0"> <bounds x=" 24" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2034" element="Page2" state="0"> <bounds x=" 24" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2035" element="Page2" state="0"> <bounds x=" 30" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2036" element="Page2" state="0"> <bounds x=" 30" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2037" element="Page2" state="0"> <bounds x=" 30" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2038" element="Page2" state="0"> <bounds x=" 30" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2039" element="Page2" state="0"> <bounds x=" 30" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2040" element="Page2" state="0"> <bounds x=" 30" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2041" element="Page2" state="0"> <bounds x=" 30" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2042" element="Page2" state="0"> <bounds x=" 36" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2043" element="Page2" state="0"> <bounds x=" 36" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2044" element="Page2" state="0"> <bounds x=" 36" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2045" element="Page2" state="0"> <bounds x=" 36" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2046" element="Page2" state="0"> <bounds x=" 36" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2047" element="Page2" state="0"> <bounds x=" 36" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2048" element="Page2" state="0"> <bounds x=" 36" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2049" element="Page2" state="0"> <bounds x=" 42" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2050" element="Page2" state="0"> <bounds x=" 42" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2051" element="Page2" state="0"> <bounds x=" 42" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2052" element="Page2" state="0"> <bounds x=" 42" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2053" element="Page2" state="0"> <bounds x=" 42" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2054" element="Page2" state="0"> <bounds x=" 42" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2055" element="Page2" state="0"> <bounds x=" 42" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2056" element="Page2" state="0"> <bounds x=" 48" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2057" element="Page2" state="0"> <bounds x=" 48" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2058" element="Page2" state="0"> <bounds x=" 48" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2059" element="Page2" state="0"> <bounds x=" 48" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2060" element="Page2" state="0"> <bounds x=" 48" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2061" element="Page2" state="0"> <bounds x=" 48" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2062" element="Page2" state="0"> <bounds x=" 48" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2063" element="Page2" state="0"> <bounds x=" 54" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2064" element="Page2" state="0"> <bounds x=" 54" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2065" element="Page2" state="0"> <bounds x=" 54" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2066" element="Page2" state="0"> <bounds x=" 54" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2067" element="Page2" state="0"> <bounds x=" 54" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2068" element="Page2" state="0"> <bounds x=" 54" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2069" element="Page2" state="0"> <bounds x=" 54" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2070" element="Page2" state="0"> <bounds x=" 60" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2071" element="Page2" state="0"> <bounds x=" 60" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2072" element="Page2" state="0"> <bounds x=" 60" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2073" element="Page2" state="0"> <bounds x=" 60" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2074" element="Page2" state="0"> <bounds x=" 60" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2075" element="Page2" state="0"> <bounds x=" 60" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2076" element="Page2" state="0"> <bounds x=" 60" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2077" element="Page2" state="0"> <bounds x=" 66" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2078" element="Page2" state="0"> <bounds x=" 66" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2079" element="Page2" state="0"> <bounds x=" 66" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2080" element="Page2" state="0"> <bounds x=" 66" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2081" element="Page2" state="0"> <bounds x=" 66" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2082" element="Page2" state="0"> <bounds x=" 66" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2083" element="Page2" state="0"> <bounds x=" 66" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2084" element="Page2" state="0"> <bounds x=" 72" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2085" element="Page2" state="0"> <bounds x=" 72" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2086" element="Page2" state="0"> <bounds x=" 72" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2087" element="Page2" state="0"> <bounds x=" 72" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2088" element="Page2" state="0"> <bounds x=" 72" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2089" element="Page2" state="0"> <bounds x=" 72" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2090" element="Page2" state="0"> <bounds x=" 72" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2091" element="Page2" state="0"> <bounds x=" 78" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2092" element="Page2" state="0"> <bounds x=" 78" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2093" element="Page2" state="0"> <bounds x=" 78" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2094" element="Page2" state="0"> <bounds x=" 78" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2095" element="Page2" state="0"> <bounds x=" 78" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2096" element="Page2" state="0"> <bounds x=" 78" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2097" element="Page2" state="0"> <bounds x=" 78" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2098" element="Page2" state="0"> <bounds x=" 84" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2099" element="Page2" state="0"> <bounds x=" 84" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2100" element="Page2" state="0"> <bounds x=" 84" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2101" element="Page2" state="0"> <bounds x=" 84" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2102" element="Page2" state="0"> <bounds x=" 84" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2103" element="Page2" state="0"> <bounds x=" 84" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2104" element="Page2" state="0"> <bounds x=" 84" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2105" element="Page2" state="0"> <bounds x=" 90" y=" 20" width="5" height="1" /> </bezel>
+ <bezel name="pg_2106" element="Page2" state="0"> <bounds x=" 90" y=" 21" width="5" height="1" /> </bezel>
+ <bezel name="pg_2107" element="Page2" state="0"> <bounds x=" 90" y=" 22" width="5" height="1" /> </bezel>
+ <bezel name="pg_2108" element="Page2" state="0"> <bounds x=" 90" y=" 23" width="5" height="1" /> </bezel>
+ <bezel name="pg_2109" element="Page2" state="0"> <bounds x=" 90" y=" 24" width="5" height="1" /> </bezel>
+ <bezel name="pg_2110" element="Page2" state="0"> <bounds x=" 90" y=" 25" width="5" height="1" /> </bezel>
+ <bezel name="pg_2111" element="Page2" state="0"> <bounds x=" 90" y=" 26" width="5" height="1" /> </bezel>
+ <bezel name="pg_2112" element="Page2" state="0"> <bounds x=" 0" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2113" element="Page2" state="0"> <bounds x=" 0" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2114" element="Page2" state="0"> <bounds x=" 0" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2115" element="Page2" state="0"> <bounds x=" 0" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2116" element="Page2" state="0"> <bounds x=" 0" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2117" element="Page2" state="0"> <bounds x=" 0" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2118" element="Page2" state="0"> <bounds x=" 0" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2119" element="Page2" state="0"> <bounds x=" 6" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2120" element="Page2" state="0"> <bounds x=" 6" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2121" element="Page2" state="0"> <bounds x=" 6" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2122" element="Page2" state="0"> <bounds x=" 6" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2123" element="Page2" state="0"> <bounds x=" 6" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2124" element="Page2" state="0"> <bounds x=" 6" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2125" element="Page2" state="0"> <bounds x=" 6" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2126" element="Page2" state="0"> <bounds x=" 12" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2127" element="Page2" state="0"> <bounds x=" 12" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2128" element="Page2" state="0"> <bounds x=" 12" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2129" element="Page2" state="0"> <bounds x=" 12" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2130" element="Page2" state="0"> <bounds x=" 12" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2131" element="Page2" state="0"> <bounds x=" 12" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2132" element="Page2" state="0"> <bounds x=" 12" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2133" element="Page2" state="0"> <bounds x=" 18" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2134" element="Page2" state="0"> <bounds x=" 18" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2135" element="Page2" state="0"> <bounds x=" 18" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2136" element="Page2" state="0"> <bounds x=" 18" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2137" element="Page2" state="0"> <bounds x=" 18" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2138" element="Page2" state="0"> <bounds x=" 18" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2139" element="Page2" state="0"> <bounds x=" 18" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2140" element="Page2" state="0"> <bounds x=" 24" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2141" element="Page2" state="0"> <bounds x=" 24" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2142" element="Page2" state="0"> <bounds x=" 24" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2143" element="Page2" state="0"> <bounds x=" 24" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2144" element="Page2" state="0"> <bounds x=" 24" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2145" element="Page2" state="0"> <bounds x=" 24" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2146" element="Page2" state="0"> <bounds x=" 24" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2147" element="Page2" state="0"> <bounds x=" 30" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2148" element="Page2" state="0"> <bounds x=" 30" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2149" element="Page2" state="0"> <bounds x=" 30" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2150" element="Page2" state="0"> <bounds x=" 30" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2151" element="Page2" state="0"> <bounds x=" 30" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2152" element="Page2" state="0"> <bounds x=" 30" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2153" element="Page2" state="0"> <bounds x=" 30" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2154" element="Page2" state="0"> <bounds x=" 36" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2155" element="Page2" state="0"> <bounds x=" 36" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2156" element="Page2" state="0"> <bounds x=" 36" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2157" element="Page2" state="0"> <bounds x=" 36" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2158" element="Page2" state="0"> <bounds x=" 36" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2159" element="Page2" state="0"> <bounds x=" 36" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2160" element="Page2" state="0"> <bounds x=" 36" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2161" element="Page2" state="0"> <bounds x=" 42" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2162" element="Page2" state="0"> <bounds x=" 42" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2163" element="Page2" state="0"> <bounds x=" 42" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2164" element="Page2" state="0"> <bounds x=" 42" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2165" element="Page2" state="0"> <bounds x=" 42" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2166" element="Page2" state="0"> <bounds x=" 42" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2167" element="Page2" state="0"> <bounds x=" 42" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2168" element="Page2" state="0"> <bounds x=" 48" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2169" element="Page2" state="0"> <bounds x=" 48" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2170" element="Page2" state="0"> <bounds x=" 48" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2171" element="Page2" state="0"> <bounds x=" 48" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2172" element="Page2" state="0"> <bounds x=" 48" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2173" element="Page2" state="0"> <bounds x=" 48" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2174" element="Page2" state="0"> <bounds x=" 48" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2175" element="Page2" state="0"> <bounds x=" 54" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2176" element="Page2" state="0"> <bounds x=" 54" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2177" element="Page2" state="0"> <bounds x=" 54" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2178" element="Page2" state="0"> <bounds x=" 54" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2179" element="Page2" state="0"> <bounds x=" 54" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2180" element="Page2" state="0"> <bounds x=" 54" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2181" element="Page2" state="0"> <bounds x=" 54" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2182" element="Page2" state="0"> <bounds x=" 60" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2183" element="Page2" state="0"> <bounds x=" 60" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2184" element="Page2" state="0"> <bounds x=" 60" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2185" element="Page2" state="0"> <bounds x=" 60" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2186" element="Page2" state="0"> <bounds x=" 60" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2187" element="Page2" state="0"> <bounds x=" 60" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2188" element="Page2" state="0"> <bounds x=" 60" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2189" element="Page2" state="0"> <bounds x=" 66" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2190" element="Page2" state="0"> <bounds x=" 66" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2191" element="Page2" state="0"> <bounds x=" 66" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2192" element="Page2" state="0"> <bounds x=" 66" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2193" element="Page2" state="0"> <bounds x=" 66" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2194" element="Page2" state="0"> <bounds x=" 66" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2195" element="Page2" state="0"> <bounds x=" 66" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2196" element="Page2" state="0"> <bounds x=" 72" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2197" element="Page2" state="0"> <bounds x=" 72" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2198" element="Page2" state="0"> <bounds x=" 72" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2199" element="Page2" state="0"> <bounds x=" 72" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2200" element="Page2" state="0"> <bounds x=" 72" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2201" element="Page2" state="0"> <bounds x=" 72" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2202" element="Page2" state="0"> <bounds x=" 72" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2203" element="Page2" state="0"> <bounds x=" 78" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2204" element="Page2" state="0"> <bounds x=" 78" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2205" element="Page2" state="0"> <bounds x=" 78" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2206" element="Page2" state="0"> <bounds x=" 78" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2207" element="Page2" state="0"> <bounds x=" 78" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2208" element="Page2" state="0"> <bounds x=" 78" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2209" element="Page2" state="0"> <bounds x=" 78" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2210" element="Page2" state="0"> <bounds x=" 84" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2211" element="Page2" state="0"> <bounds x=" 84" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2212" element="Page2" state="0"> <bounds x=" 84" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2213" element="Page2" state="0"> <bounds x=" 84" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2214" element="Page2" state="0"> <bounds x=" 84" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2215" element="Page2" state="0"> <bounds x=" 84" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2216" element="Page2" state="0"> <bounds x=" 84" y=" 36" width="5" height="1" /> </bezel>
+ <bezel name="pg_2217" element="Page2" state="0"> <bounds x=" 90" y=" 30" width="5" height="1" /> </bezel>
+ <bezel name="pg_2218" element="Page2" state="0"> <bounds x=" 90" y=" 31" width="5" height="1" /> </bezel>
+ <bezel name="pg_2219" element="Page2" state="0"> <bounds x=" 90" y=" 32" width="5" height="1" /> </bezel>
+ <bezel name="pg_2220" element="Page2" state="0"> <bounds x=" 90" y=" 33" width="5" height="1" /> </bezel>
+ <bezel name="pg_2221" element="Page2" state="0"> <bounds x=" 90" y=" 34" width="5" height="1" /> </bezel>
+ <bezel name="pg_2222" element="Page2" state="0"> <bounds x=" 90" y=" 35" width="5" height="1" /> </bezel>
+ <bezel name="pg_2223" element="Page2" state="0"> <bounds x=" 90" y=" 36" width="5" height="1" /> </bezel>
+
+ <bezel name="pg_1000" element="Page1" state="0"> <bounds x=" 0" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1001" element="Page1" state="0"> <bounds x=" 0" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1002" element="Page1" state="0"> <bounds x=" 0" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1003" element="Page1" state="0"> <bounds x=" 0" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1004" element="Page1" state="0"> <bounds x=" 0" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1005" element="Page1" state="0"> <bounds x=" 0" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1006" element="Page1" state="0"> <bounds x=" 0" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1007" element="Page1" state="0"> <bounds x=" 6" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1008" element="Page1" state="0"> <bounds x=" 6" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1009" element="Page1" state="0"> <bounds x=" 6" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1010" element="Page1" state="0"> <bounds x=" 6" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1011" element="Page1" state="0"> <bounds x=" 6" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1012" element="Page1" state="0"> <bounds x=" 6" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1013" element="Page1" state="0"> <bounds x=" 6" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1014" element="Page1" state="0"> <bounds x=" 12" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1015" element="Page1" state="0"> <bounds x=" 12" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1016" element="Page1" state="0"> <bounds x=" 12" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1017" element="Page1" state="0"> <bounds x=" 12" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1018" element="Page1" state="0"> <bounds x=" 12" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1019" element="Page1" state="0"> <bounds x=" 12" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1020" element="Page1" state="0"> <bounds x=" 12" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1021" element="Page1" state="0"> <bounds x=" 18" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1022" element="Page1" state="0"> <bounds x=" 18" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1023" element="Page1" state="0"> <bounds x=" 18" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1024" element="Page1" state="0"> <bounds x=" 18" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1025" element="Page1" state="0"> <bounds x=" 18" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1026" element="Page1" state="0"> <bounds x=" 18" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1027" element="Page1" state="0"> <bounds x=" 18" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1028" element="Page1" state="0"> <bounds x=" 24" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1029" element="Page1" state="0"> <bounds x=" 24" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1030" element="Page1" state="0"> <bounds x=" 24" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1031" element="Page1" state="0"> <bounds x=" 24" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1032" element="Page1" state="0"> <bounds x=" 24" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1033" element="Page1" state="0"> <bounds x=" 24" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1034" element="Page1" state="0"> <bounds x=" 24" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1035" element="Page1" state="0"> <bounds x=" 30" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1036" element="Page1" state="0"> <bounds x=" 30" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1037" element="Page1" state="0"> <bounds x=" 30" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1038" element="Page1" state="0"> <bounds x=" 30" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1039" element="Page1" state="0"> <bounds x=" 30" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1040" element="Page1" state="0"> <bounds x=" 30" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1041" element="Page1" state="0"> <bounds x=" 30" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1042" element="Page1" state="0"> <bounds x=" 36" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1043" element="Page1" state="0"> <bounds x=" 36" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1044" element="Page1" state="0"> <bounds x=" 36" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1045" element="Page1" state="0"> <bounds x=" 36" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1046" element="Page1" state="0"> <bounds x=" 36" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1047" element="Page1" state="0"> <bounds x=" 36" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1048" element="Page1" state="0"> <bounds x=" 36" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1049" element="Page1" state="0"> <bounds x=" 42" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1050" element="Page1" state="0"> <bounds x=" 42" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1051" element="Page1" state="0"> <bounds x=" 42" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1052" element="Page1" state="0"> <bounds x=" 42" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1053" element="Page1" state="0"> <bounds x=" 42" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1054" element="Page1" state="0"> <bounds x=" 42" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1055" element="Page1" state="0"> <bounds x=" 42" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1056" element="Page1" state="0"> <bounds x=" 48" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1057" element="Page1" state="0"> <bounds x=" 48" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1058" element="Page1" state="0"> <bounds x=" 48" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1059" element="Page1" state="0"> <bounds x=" 48" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1060" element="Page1" state="0"> <bounds x=" 48" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1061" element="Page1" state="0"> <bounds x=" 48" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1062" element="Page1" state="0"> <bounds x=" 48" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1063" element="Page1" state="0"> <bounds x=" 54" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1064" element="Page1" state="0"> <bounds x=" 54" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1065" element="Page1" state="0"> <bounds x=" 54" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1066" element="Page1" state="0"> <bounds x=" 54" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1067" element="Page1" state="0"> <bounds x=" 54" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1068" element="Page1" state="0"> <bounds x=" 54" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1069" element="Page1" state="0"> <bounds x=" 54" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1070" element="Page1" state="0"> <bounds x=" 60" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1071" element="Page1" state="0"> <bounds x=" 60" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1072" element="Page1" state="0"> <bounds x=" 60" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1073" element="Page1" state="0"> <bounds x=" 60" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1074" element="Page1" state="0"> <bounds x=" 60" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1075" element="Page1" state="0"> <bounds x=" 60" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1076" element="Page1" state="0"> <bounds x=" 60" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1077" element="Page1" state="0"> <bounds x=" 66" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1078" element="Page1" state="0"> <bounds x=" 66" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1079" element="Page1" state="0"> <bounds x=" 66" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1080" element="Page1" state="0"> <bounds x=" 66" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1081" element="Page1" state="0"> <bounds x=" 66" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1082" element="Page1" state="0"> <bounds x=" 66" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1083" element="Page1" state="0"> <bounds x=" 66" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1084" element="Page1" state="0"> <bounds x=" 72" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1085" element="Page1" state="0"> <bounds x=" 72" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1086" element="Page1" state="0"> <bounds x=" 72" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1087" element="Page1" state="0"> <bounds x=" 72" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1088" element="Page1" state="0"> <bounds x=" 72" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1089" element="Page1" state="0"> <bounds x=" 72" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1090" element="Page1" state="0"> <bounds x=" 72" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1091" element="Page1" state="0"> <bounds x=" 78" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1092" element="Page1" state="0"> <bounds x=" 78" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1093" element="Page1" state="0"> <bounds x=" 78" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1094" element="Page1" state="0"> <bounds x=" 78" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1095" element="Page1" state="0"> <bounds x=" 78" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1096" element="Page1" state="0"> <bounds x=" 78" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1097" element="Page1" state="0"> <bounds x=" 78" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1098" element="Page1" state="0"> <bounds x=" 84" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1099" element="Page1" state="0"> <bounds x=" 84" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1100" element="Page1" state="0"> <bounds x=" 84" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1101" element="Page1" state="0"> <bounds x=" 84" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1102" element="Page1" state="0"> <bounds x=" 84" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1103" element="Page1" state="0"> <bounds x=" 84" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1104" element="Page1" state="0"> <bounds x=" 84" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1105" element="Page1" state="0"> <bounds x=" 90" y=" 40" width="5" height="1" /> </bezel>
+ <bezel name="pg_1106" element="Page1" state="0"> <bounds x=" 90" y=" 41" width="5" height="1" /> </bezel>
+ <bezel name="pg_1107" element="Page1" state="0"> <bounds x=" 90" y=" 42" width="5" height="1" /> </bezel>
+ <bezel name="pg_1108" element="Page1" state="0"> <bounds x=" 90" y=" 43" width="5" height="1" /> </bezel>
+ <bezel name="pg_1109" element="Page1" state="0"> <bounds x=" 90" y=" 44" width="5" height="1" /> </bezel>
+ <bezel name="pg_1110" element="Page1" state="0"> <bounds x=" 90" y=" 45" width="5" height="1" /> </bezel>
+ <bezel name="pg_1111" element="Page1" state="0"> <bounds x=" 90" y=" 46" width="5" height="1" /> </bezel>
+ <bezel name="pg_1112" element="Page1" state="0"> <bounds x=" 0" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1113" element="Page1" state="0"> <bounds x=" 0" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1114" element="Page1" state="0"> <bounds x=" 0" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1115" element="Page1" state="0"> <bounds x=" 0" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1116" element="Page1" state="0"> <bounds x=" 0" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1117" element="Page1" state="0"> <bounds x=" 0" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1118" element="Page1" state="0"> <bounds x=" 0" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1119" element="Page1" state="0"> <bounds x=" 6" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1120" element="Page1" state="0"> <bounds x=" 6" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1121" element="Page1" state="0"> <bounds x=" 6" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1122" element="Page1" state="0"> <bounds x=" 6" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1123" element="Page1" state="0"> <bounds x=" 6" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1124" element="Page1" state="0"> <bounds x=" 6" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1125" element="Page1" state="0"> <bounds x=" 6" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1126" element="Page1" state="0"> <bounds x=" 12" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1127" element="Page1" state="0"> <bounds x=" 12" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1128" element="Page1" state="0"> <bounds x=" 12" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1129" element="Page1" state="0"> <bounds x=" 12" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1130" element="Page1" state="0"> <bounds x=" 12" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1131" element="Page1" state="0"> <bounds x=" 12" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1132" element="Page1" state="0"> <bounds x=" 12" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1133" element="Page1" state="0"> <bounds x=" 18" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1134" element="Page1" state="0"> <bounds x=" 18" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1135" element="Page1" state="0"> <bounds x=" 18" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1136" element="Page1" state="0"> <bounds x=" 18" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1137" element="Page1" state="0"> <bounds x=" 18" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1138" element="Page1" state="0"> <bounds x=" 18" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1139" element="Page1" state="0"> <bounds x=" 18" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1140" element="Page1" state="0"> <bounds x=" 24" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1141" element="Page1" state="0"> <bounds x=" 24" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1142" element="Page1" state="0"> <bounds x=" 24" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1143" element="Page1" state="0"> <bounds x=" 24" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1144" element="Page1" state="0"> <bounds x=" 24" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1145" element="Page1" state="0"> <bounds x=" 24" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1146" element="Page1" state="0"> <bounds x=" 24" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1147" element="Page1" state="0"> <bounds x=" 30" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1148" element="Page1" state="0"> <bounds x=" 30" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1149" element="Page1" state="0"> <bounds x=" 30" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1150" element="Page1" state="0"> <bounds x=" 30" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1151" element="Page1" state="0"> <bounds x=" 30" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1152" element="Page1" state="0"> <bounds x=" 30" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1153" element="Page1" state="0"> <bounds x=" 30" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1154" element="Page1" state="0"> <bounds x=" 36" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1155" element="Page1" state="0"> <bounds x=" 36" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1156" element="Page1" state="0"> <bounds x=" 36" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1157" element="Page1" state="0"> <bounds x=" 36" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1158" element="Page1" state="0"> <bounds x=" 36" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1159" element="Page1" state="0"> <bounds x=" 36" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1160" element="Page1" state="0"> <bounds x=" 36" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1161" element="Page1" state="0"> <bounds x=" 42" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1162" element="Page1" state="0"> <bounds x=" 42" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1163" element="Page1" state="0"> <bounds x=" 42" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1164" element="Page1" state="0"> <bounds x=" 42" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1165" element="Page1" state="0"> <bounds x=" 42" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1166" element="Page1" state="0"> <bounds x=" 42" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1167" element="Page1" state="0"> <bounds x=" 42" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1168" element="Page1" state="0"> <bounds x=" 48" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1169" element="Page1" state="0"> <bounds x=" 48" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1170" element="Page1" state="0"> <bounds x=" 48" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1171" element="Page1" state="0"> <bounds x=" 48" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1172" element="Page1" state="0"> <bounds x=" 48" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1173" element="Page1" state="0"> <bounds x=" 48" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1174" element="Page1" state="0"> <bounds x=" 48" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1175" element="Page1" state="0"> <bounds x=" 54" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1176" element="Page1" state="0"> <bounds x=" 54" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1177" element="Page1" state="0"> <bounds x=" 54" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1178" element="Page1" state="0"> <bounds x=" 54" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1179" element="Page1" state="0"> <bounds x=" 54" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1180" element="Page1" state="0"> <bounds x=" 54" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1181" element="Page1" state="0"> <bounds x=" 54" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1182" element="Page1" state="0"> <bounds x=" 60" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1183" element="Page1" state="0"> <bounds x=" 60" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1184" element="Page1" state="0"> <bounds x=" 60" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1185" element="Page1" state="0"> <bounds x=" 60" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1186" element="Page1" state="0"> <bounds x=" 60" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1187" element="Page1" state="0"> <bounds x=" 60" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1188" element="Page1" state="0"> <bounds x=" 60" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1189" element="Page1" state="0"> <bounds x=" 66" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1190" element="Page1" state="0"> <bounds x=" 66" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1191" element="Page1" state="0"> <bounds x=" 66" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1192" element="Page1" state="0"> <bounds x=" 66" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1193" element="Page1" state="0"> <bounds x=" 66" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1194" element="Page1" state="0"> <bounds x=" 66" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1195" element="Page1" state="0"> <bounds x=" 66" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1196" element="Page1" state="0"> <bounds x=" 72" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1197" element="Page1" state="0"> <bounds x=" 72" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1198" element="Page1" state="0"> <bounds x=" 72" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1199" element="Page1" state="0"> <bounds x=" 72" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1200" element="Page1" state="0"> <bounds x=" 72" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1201" element="Page1" state="0"> <bounds x=" 72" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1202" element="Page1" state="0"> <bounds x=" 72" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1203" element="Page1" state="0"> <bounds x=" 78" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1204" element="Page1" state="0"> <bounds x=" 78" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1205" element="Page1" state="0"> <bounds x=" 78" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1206" element="Page1" state="0"> <bounds x=" 78" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1207" element="Page1" state="0"> <bounds x=" 78" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1208" element="Page1" state="0"> <bounds x=" 78" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1209" element="Page1" state="0"> <bounds x=" 78" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1210" element="Page1" state="0"> <bounds x=" 84" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1211" element="Page1" state="0"> <bounds x=" 84" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1212" element="Page1" state="0"> <bounds x=" 84" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1213" element="Page1" state="0"> <bounds x=" 84" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1214" element="Page1" state="0"> <bounds x=" 84" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1215" element="Page1" state="0"> <bounds x=" 84" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1216" element="Page1" state="0"> <bounds x=" 84" y=" 56" width="5" height="1" /> </bezel>
+ <bezel name="pg_1217" element="Page1" state="0"> <bounds x=" 90" y=" 50" width="5" height="1" /> </bezel>
+ <bezel name="pg_1218" element="Page1" state="0"> <bounds x=" 90" y=" 51" width="5" height="1" /> </bezel>
+ <bezel name="pg_1219" element="Page1" state="0"> <bounds x=" 90" y=" 52" width="5" height="1" /> </bezel>
+ <bezel name="pg_1220" element="Page1" state="0"> <bounds x=" 90" y=" 53" width="5" height="1" /> </bezel>
+ <bezel name="pg_1221" element="Page1" state="0"> <bounds x=" 90" y=" 54" width="5" height="1" /> </bezel>
+ <bezel name="pg_1222" element="Page1" state="0"> <bounds x=" 90" y=" 55" width="5" height="1" /> </bezel>
+ <bezel name="pg_1223" element="Page1" state="0"> <bounds x=" 90" y=" 56" width="5" height="1" /> </bezel>
+
+ <bezel name="pg_4000" element="Page4" state="0"> <bounds x=" 0" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4001" element="Page4" state="0"> <bounds x=" 0" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4002" element="Page4" state="0"> <bounds x=" 0" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4003" element="Page4" state="0"> <bounds x=" 0" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4004" element="Page4" state="0"> <bounds x=" 0" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4005" element="Page4" state="0"> <bounds x=" 0" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4006" element="Page4" state="0"> <bounds x=" 0" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4007" element="Page4" state="0"> <bounds x=" 6" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4008" element="Page4" state="0"> <bounds x=" 6" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4009" element="Page4" state="0"> <bounds x=" 6" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4010" element="Page4" state="0"> <bounds x=" 6" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4011" element="Page4" state="0"> <bounds x=" 6" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4012" element="Page4" state="0"> <bounds x=" 6" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4013" element="Page4" state="0"> <bounds x=" 6" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4014" element="Page4" state="0"> <bounds x=" 12" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4015" element="Page4" state="0"> <bounds x=" 12" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4016" element="Page4" state="0"> <bounds x=" 12" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4017" element="Page4" state="0"> <bounds x=" 12" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4018" element="Page4" state="0"> <bounds x=" 12" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4019" element="Page4" state="0"> <bounds x=" 12" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4020" element="Page4" state="0"> <bounds x=" 12" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4021" element="Page4" state="0"> <bounds x=" 18" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4022" element="Page4" state="0"> <bounds x=" 18" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4023" element="Page4" state="0"> <bounds x=" 18" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4024" element="Page4" state="0"> <bounds x=" 18" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4025" element="Page4" state="0"> <bounds x=" 18" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4026" element="Page4" state="0"> <bounds x=" 18" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4027" element="Page4" state="0"> <bounds x=" 18" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4028" element="Page4" state="0"> <bounds x=" 24" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4029" element="Page4" state="0"> <bounds x=" 24" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4030" element="Page4" state="0"> <bounds x=" 24" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4031" element="Page4" state="0"> <bounds x=" 24" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4032" element="Page4" state="0"> <bounds x=" 24" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4033" element="Page4" state="0"> <bounds x=" 24" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4034" element="Page4" state="0"> <bounds x=" 24" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4035" element="Page4" state="0"> <bounds x=" 30" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4036" element="Page4" state="0"> <bounds x=" 30" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4037" element="Page4" state="0"> <bounds x=" 30" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4038" element="Page4" state="0"> <bounds x=" 30" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4039" element="Page4" state="0"> <bounds x=" 30" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4040" element="Page4" state="0"> <bounds x=" 30" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4041" element="Page4" state="0"> <bounds x=" 30" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4042" element="Page4" state="0"> <bounds x=" 36" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4043" element="Page4" state="0"> <bounds x=" 36" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4044" element="Page4" state="0"> <bounds x=" 36" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4045" element="Page4" state="0"> <bounds x=" 36" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4046" element="Page4" state="0"> <bounds x=" 36" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4047" element="Page4" state="0"> <bounds x=" 36" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4048" element="Page4" state="0"> <bounds x=" 36" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4049" element="Page4" state="0"> <bounds x=" 42" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4050" element="Page4" state="0"> <bounds x=" 42" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4051" element="Page4" state="0"> <bounds x=" 42" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4052" element="Page4" state="0"> <bounds x=" 42" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4053" element="Page4" state="0"> <bounds x=" 42" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4054" element="Page4" state="0"> <bounds x=" 42" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4055" element="Page4" state="0"> <bounds x=" 42" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4056" element="Page4" state="0"> <bounds x=" 48" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4057" element="Page4" state="0"> <bounds x=" 48" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4058" element="Page4" state="0"> <bounds x=" 48" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4059" element="Page4" state="0"> <bounds x=" 48" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4060" element="Page4" state="0"> <bounds x=" 48" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4061" element="Page4" state="0"> <bounds x=" 48" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4062" element="Page4" state="0"> <bounds x=" 48" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4063" element="Page4" state="0"> <bounds x=" 54" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4064" element="Page4" state="0"> <bounds x=" 54" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4065" element="Page4" state="0"> <bounds x=" 54" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4066" element="Page4" state="0"> <bounds x=" 54" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4067" element="Page4" state="0"> <bounds x=" 54" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4068" element="Page4" state="0"> <bounds x=" 54" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4069" element="Page4" state="0"> <bounds x=" 54" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4070" element="Page4" state="0"> <bounds x=" 60" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4071" element="Page4" state="0"> <bounds x=" 60" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4072" element="Page4" state="0"> <bounds x=" 60" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4073" element="Page4" state="0"> <bounds x=" 60" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4074" element="Page4" state="0"> <bounds x=" 60" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4075" element="Page4" state="0"> <bounds x=" 60" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4076" element="Page4" state="0"> <bounds x=" 60" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4077" element="Page4" state="0"> <bounds x=" 66" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4078" element="Page4" state="0"> <bounds x=" 66" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4079" element="Page4" state="0"> <bounds x=" 66" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4080" element="Page4" state="0"> <bounds x=" 66" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4081" element="Page4" state="0"> <bounds x=" 66" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4082" element="Page4" state="0"> <bounds x=" 66" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4083" element="Page4" state="0"> <bounds x=" 66" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4084" element="Page4" state="0"> <bounds x=" 72" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4085" element="Page4" state="0"> <bounds x=" 72" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4086" element="Page4" state="0"> <bounds x=" 72" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4087" element="Page4" state="0"> <bounds x=" 72" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4088" element="Page4" state="0"> <bounds x=" 72" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4089" element="Page4" state="0"> <bounds x=" 72" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4090" element="Page4" state="0"> <bounds x=" 72" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4091" element="Page4" state="0"> <bounds x=" 78" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4092" element="Page4" state="0"> <bounds x=" 78" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4093" element="Page4" state="0"> <bounds x=" 78" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4094" element="Page4" state="0"> <bounds x=" 78" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4095" element="Page4" state="0"> <bounds x=" 78" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4096" element="Page4" state="0"> <bounds x=" 78" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4097" element="Page4" state="0"> <bounds x=" 78" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4098" element="Page4" state="0"> <bounds x=" 84" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4099" element="Page4" state="0"> <bounds x=" 84" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4100" element="Page4" state="0"> <bounds x=" 84" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4101" element="Page4" state="0"> <bounds x=" 84" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4102" element="Page4" state="0"> <bounds x=" 84" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4103" element="Page4" state="0"> <bounds x=" 84" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4104" element="Page4" state="0"> <bounds x=" 84" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4105" element="Page4" state="0"> <bounds x=" 90" y=" 80" width="5" height="1" /> </bezel>
+ <bezel name="pg_4106" element="Page4" state="0"> <bounds x=" 90" y=" 81" width="5" height="1" /> </bezel>
+ <bezel name="pg_4107" element="Page4" state="0"> <bounds x=" 90" y=" 82" width="5" height="1" /> </bezel>
+ <bezel name="pg_4108" element="Page4" state="0"> <bounds x=" 90" y=" 83" width="5" height="1" /> </bezel>
+ <bezel name="pg_4109" element="Page4" state="0"> <bounds x=" 90" y=" 84" width="5" height="1" /> </bezel>
+ <bezel name="pg_4110" element="Page4" state="0"> <bounds x=" 90" y=" 85" width="5" height="1" /> </bezel>
+ <bezel name="pg_4111" element="Page4" state="0"> <bounds x=" 90" y=" 86" width="5" height="1" /> </bezel>
+ <bezel name="pg_4112" element="Page4" state="0"> <bounds x=" 0" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4113" element="Page4" state="0"> <bounds x=" 0" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4114" element="Page4" state="0"> <bounds x=" 0" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4115" element="Page4" state="0"> <bounds x=" 0" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4116" element="Page4" state="0"> <bounds x=" 0" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4117" element="Page4" state="0"> <bounds x=" 0" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4118" element="Page4" state="0"> <bounds x=" 0" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4119" element="Page4" state="0"> <bounds x=" 6" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4120" element="Page4" state="0"> <bounds x=" 6" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4121" element="Page4" state="0"> <bounds x=" 6" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4122" element="Page4" state="0"> <bounds x=" 6" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4123" element="Page4" state="0"> <bounds x=" 6" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4124" element="Page4" state="0"> <bounds x=" 6" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4125" element="Page4" state="0"> <bounds x=" 6" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4126" element="Page4" state="0"> <bounds x=" 12" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4127" element="Page4" state="0"> <bounds x=" 12" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4128" element="Page4" state="0"> <bounds x=" 12" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4129" element="Page4" state="0"> <bounds x=" 12" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4130" element="Page4" state="0"> <bounds x=" 12" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4131" element="Page4" state="0"> <bounds x=" 12" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4132" element="Page4" state="0"> <bounds x=" 12" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4133" element="Page4" state="0"> <bounds x=" 18" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4134" element="Page4" state="0"> <bounds x=" 18" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4135" element="Page4" state="0"> <bounds x=" 18" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4136" element="Page4" state="0"> <bounds x=" 18" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4137" element="Page4" state="0"> <bounds x=" 18" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4138" element="Page4" state="0"> <bounds x=" 18" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4139" element="Page4" state="0"> <bounds x=" 18" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4140" element="Page4" state="0"> <bounds x=" 24" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4141" element="Page4" state="0"> <bounds x=" 24" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4142" element="Page4" state="0"> <bounds x=" 24" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4143" element="Page4" state="0"> <bounds x=" 24" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4144" element="Page4" state="0"> <bounds x=" 24" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4145" element="Page4" state="0"> <bounds x=" 24" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4146" element="Page4" state="0"> <bounds x=" 24" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4147" element="Page4" state="0"> <bounds x=" 30" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4148" element="Page4" state="0"> <bounds x=" 30" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4149" element="Page4" state="0"> <bounds x=" 30" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4150" element="Page4" state="0"> <bounds x=" 30" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4151" element="Page4" state="0"> <bounds x=" 30" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4152" element="Page4" state="0"> <bounds x=" 30" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4153" element="Page4" state="0"> <bounds x=" 30" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4154" element="Page4" state="0"> <bounds x=" 36" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4155" element="Page4" state="0"> <bounds x=" 36" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4156" element="Page4" state="0"> <bounds x=" 36" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4157" element="Page4" state="0"> <bounds x=" 36" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4158" element="Page4" state="0"> <bounds x=" 36" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4159" element="Page4" state="0"> <bounds x=" 36" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4160" element="Page4" state="0"> <bounds x=" 36" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4161" element="Page4" state="0"> <bounds x=" 42" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4162" element="Page4" state="0"> <bounds x=" 42" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4163" element="Page4" state="0"> <bounds x=" 42" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4164" element="Page4" state="0"> <bounds x=" 42" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4165" element="Page4" state="0"> <bounds x=" 42" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4166" element="Page4" state="0"> <bounds x=" 42" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4167" element="Page4" state="0"> <bounds x=" 42" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4168" element="Page4" state="0"> <bounds x=" 48" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4169" element="Page4" state="0"> <bounds x=" 48" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4170" element="Page4" state="0"> <bounds x=" 48" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4171" element="Page4" state="0"> <bounds x=" 48" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4172" element="Page4" state="0"> <bounds x=" 48" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4173" element="Page4" state="0"> <bounds x=" 48" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4174" element="Page4" state="0"> <bounds x=" 48" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4175" element="Page4" state="0"> <bounds x=" 54" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4176" element="Page4" state="0"> <bounds x=" 54" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4177" element="Page4" state="0"> <bounds x=" 54" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4178" element="Page4" state="0"> <bounds x=" 54" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4179" element="Page4" state="0"> <bounds x=" 54" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4180" element="Page4" state="0"> <bounds x=" 54" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4181" element="Page4" state="0"> <bounds x=" 54" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4182" element="Page4" state="0"> <bounds x=" 60" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4183" element="Page4" state="0"> <bounds x=" 60" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4184" element="Page4" state="0"> <bounds x=" 60" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4185" element="Page4" state="0"> <bounds x=" 60" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4186" element="Page4" state="0"> <bounds x=" 60" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4187" element="Page4" state="0"> <bounds x=" 60" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4188" element="Page4" state="0"> <bounds x=" 60" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4189" element="Page4" state="0"> <bounds x=" 66" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4190" element="Page4" state="0"> <bounds x=" 66" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4191" element="Page4" state="0"> <bounds x=" 66" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4192" element="Page4" state="0"> <bounds x=" 66" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4193" element="Page4" state="0"> <bounds x=" 66" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4194" element="Page4" state="0"> <bounds x=" 66" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4195" element="Page4" state="0"> <bounds x=" 66" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4196" element="Page4" state="0"> <bounds x=" 72" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4197" element="Page4" state="0"> <bounds x=" 72" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4198" element="Page4" state="0"> <bounds x=" 72" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4199" element="Page4" state="0"> <bounds x=" 72" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4200" element="Page4" state="0"> <bounds x=" 72" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4201" element="Page4" state="0"> <bounds x=" 72" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4202" element="Page4" state="0"> <bounds x=" 72" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4203" element="Page4" state="0"> <bounds x=" 78" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4204" element="Page4" state="0"> <bounds x=" 78" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4205" element="Page4" state="0"> <bounds x=" 78" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4206" element="Page4" state="0"> <bounds x=" 78" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4207" element="Page4" state="0"> <bounds x=" 78" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4208" element="Page4" state="0"> <bounds x=" 78" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4209" element="Page4" state="0"> <bounds x=" 78" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4210" element="Page4" state="0"> <bounds x=" 84" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4211" element="Page4" state="0"> <bounds x=" 84" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4212" element="Page4" state="0"> <bounds x=" 84" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4213" element="Page4" state="0"> <bounds x=" 84" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4214" element="Page4" state="0"> <bounds x=" 84" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4215" element="Page4" state="0"> <bounds x=" 84" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4216" element="Page4" state="0"> <bounds x=" 84" y=" 96" width="5" height="1" /> </bezel>
+ <bezel name="pg_4217" element="Page4" state="0"> <bounds x=" 90" y=" 90" width="5" height="1" /> </bezel>
+ <bezel name="pg_4218" element="Page4" state="0"> <bounds x=" 90" y=" 91" width="5" height="1" /> </bezel>
+ <bezel name="pg_4219" element="Page4" state="0"> <bounds x=" 90" y=" 92" width="5" height="1" /> </bezel>
+ <bezel name="pg_4220" element="Page4" state="0"> <bounds x=" 90" y=" 93" width="5" height="1" /> </bezel>
+ <bezel name="pg_4221" element="Page4" state="0"> <bounds x=" 90" y=" 94" width="5" height="1" /> </bezel>
+ <bezel name="pg_4222" element="Page4" state="0"> <bounds x=" 90" y=" 95" width="5" height="1" /> </bezel>
+ <bezel name="pg_4223" element="Page4" state="0"> <bounds x=" 90" y=" 96" width="5" height="1" /> </bezel>
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/fidel_eag.lay b/src/mame/layout/fidel_eag.lay
index 9d3e4d2766a..f321527a168 100644
--- a/src/mame/layout/fidel_eag.lay
+++ b/src/mame/layout/fidel_eag.lay
@@ -3,18 +3,430 @@
<!-- define elements -->
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.1" blue="0.15" /></led7seg>
+ </element>
+
<element name="led" defstate="0">
- <disk state="0"><color red="0.2" green="0.04" blue="0.046" /></disk>
- <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk>
+ <disk state="1"><color red="1.0" green="0.1" blue="0.15" /></disk>
+ <disk state="0"><color red="0.1" green="0.01" blue="0.015" /></disk>
+ </element>
+
+ <element name="led2" defstate="0">
+ <disk state="1"><color red="1.0" green="0.1" blue="0.15" /></disk>
+ <disk state="0"><color red="0.14" green="0.014" blue="0.02" /></disk>
+ </element>
+ <element name="led2g" defstate="0">
+ <disk state="1"><color red="0.1" green="1.0" blue="0.15" /></disk>
+ <disk state="0"><color red="0.014" green="0.14" blue="0.02" /></disk>
+ </element>
+ <element name="led2y" defstate="0">
+ <disk state="1"><color red="1.0" green="0.85" blue="0.15" /></disk>
+ <disk state="0"><color red="0.18" green="0.14" blue="0.02" /></disk>
+ </element>
+
+ <element name="bt" defstate="0">
+ <disk state="0"><color red="0.17" green="0.15" blue="0.15" /></disk>
+ <disk state="1"><color red="0.4" green="0.41" blue="0.45" /></disk>
+ </element>
+
+ <element name="hl" defstate="0">
+ <text string=" ">
+ <bounds x="0.0" y="0.0" width="1.0" height="1.0" />
+ <color red="0.0" green="0.0" blue="0.0" />
+ </text>
+ <disk state="1">
+ <bounds x="0.12" y="0.12" width="0.76" height="0.76" />
+ <color red="1.0" green="1.0" blue="1.0" />
+ </disk>
+ </element>
+
+ <element name="black"><rect><color red="0.17" green="0.15" blue="0.15" /></rect></element>
+ <element name="white"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element>
+ <element name="disk_black"><disk><color red="0.17" green="0.15" blue="0.15" /></disk></element>
+
+ <element name="text_1">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="1"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_2">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="2"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_3">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="3"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_4">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="4"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_5">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="5"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_6">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="6"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_7">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="7"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_8">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="8"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+
+ <element name="text_a">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="A"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_b">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="B"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_c">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="C"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_d">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="D"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_e">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="E"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_f">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="F"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_g">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="G"><color red="0.01" green="0.01" blue="0.01" /></text>
+ </element>
+ <element name="text_h">
+ <rect><color red="0.81" green="0.8" blue="0.79" /></rect>
+ <text string="H"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
+ <element name="text_r11"><text string="K"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r21"><text string="Q"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r31"><text string="R"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r41"><text string="B"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r51"><text string="N"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r61"><text string="P"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+
+ <element name="text_r12"><text string="PB" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r22"><text string="PV" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r32"><text string="TM" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r42"><text string="ST" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r52"><text string="TB" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r62"><text string="LV" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r72"><text string="OPTION" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r82"><text string="RV" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r92"><text string="NEW" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_r93"><text string="GAME" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+
+ <element name="text_rx1"><text string="YOUR MOVE"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_ry1"><text string="CHECK"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_rx2"><text string="CL" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+ <element name="text_ry2"><text string="DM" align="1"><color red="0.81" green="0.8" blue="0.79" /></text></element>
+
<!-- build screen -->
<view name="Internal Layout">
- <bounds left="0" right="100" top="0" bottom="100" />
+ <bounds left="-2" right="102" top="-2" bottom="88" />
+ <bezel element="static_black">
+ <bounds left="-2" right="102" top="-2" bottom="88" />
+ </bezel>
+
+ <bezel element="white"><bounds x="-2.5" y="-2.5" width="90.5" height="91" /></bezel>
+
+ <!-- chessboard coords -->
+
+ <bezel element="text_8"><bounds x="-0.8" y="7" width="2" height="2" /></bezel>
+ <bezel element="text_7"><bounds x="-0.8" y="17" width="2" height="2" /></bezel>
+ <bezel element="text_6"><bounds x="-0.8" y="27" width="2" height="2" /></bezel>
+ <bezel element="text_5"><bounds x="-0.8" y="37" width="2" height="2" /></bezel>
+ <bezel element="text_4"><bounds x="-0.8" y="47" width="2" height="2" /></bezel>
+ <bezel element="text_3"><bounds x="-0.8" y="57" width="2" height="2" /></bezel>
+ <bezel element="text_2"><bounds x="-0.8" y="67" width="2" height="2" /></bezel>
+ <bezel element="text_1"><bounds x="-0.8" y="77" width="2" height="2" /></bezel>
+
+ <bezel element="text_a"><bounds x="7" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_b"><bounds x="17" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_c"><bounds x="27" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_d"><bounds x="37" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_e"><bounds x="47" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_f"><bounds x="57" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_g"><bounds x="67" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_h"><bounds x="77" y="85" width="2" height="2" /></bezel>
+
+ <!-- chessboard bezel -->
+
+ <bezel element="black"><bounds x="2" y="2" width="82" height="82" /></bezel>
+ <bezel element="white"><bounds x="3" y="3" width="80" height="80" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="2.5" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="33" y="2.5" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="53" y="2.5" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="73" y="2.5" width="10.5" height="10.5" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="13" width="10.5" height="10" /></bezel>
+ <bezel element="black"><bounds x="23" y="13" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="43" y="13" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="63" y="13" width="10" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="23" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="33" y="23" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="53" y="23" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="73" y="23" width="10.5" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="33" width="10.5" height="10" /></bezel>
+ <bezel element="black"><bounds x="23" y="33" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="43" y="33" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="63" y="33" width="10" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="43" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="33" y="43" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="53" y="43" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="73" y="43" width="10.5" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="53" width="10.5" height="10" /></bezel>
+ <bezel element="black"><bounds x="23" y="53" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="43" y="53" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="63" y="53" width="10" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="63" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="33" y="63" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="53" y="63" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="73" y="63" width="10.5" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="73" width="10.5" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="23" y="73" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="43" y="73" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="63" y="73" width="10" height="10.5" /></bezel>
+
+ <!-- chessboard leds -->
+
+ <bezel name="7.15" element="led"><bounds x="11.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.14" element="led"><bounds x="21.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.13" element="led"><bounds x="31.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.12" element="led"><bounds x="41.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.11" element="led"><bounds x="51.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.10" element="led"><bounds x="61.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.9" element="led"><bounds x="71.3" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.8" element="led"><bounds x="81.3" y="11.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="6.15" element="led"><bounds x="11.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.14" element="led"><bounds x="21.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.13" element="led"><bounds x="31.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.12" element="led"><bounds x="41.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.11" element="led"><bounds x="51.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.10" element="led"><bounds x="61.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.9" element="led"><bounds x="71.3" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.8" element="led"><bounds x="81.3" y="21.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="5.15" element="led"><bounds x="11.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.14" element="led"><bounds x="21.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.13" element="led"><bounds x="31.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.12" element="led"><bounds x="41.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.11" element="led"><bounds x="51.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.10" element="led"><bounds x="61.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.9" element="led"><bounds x="71.3" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.8" element="led"><bounds x="81.3" y="31.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="4.15" element="led"><bounds x="11.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.14" element="led"><bounds x="21.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.13" element="led"><bounds x="31.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.12" element="led"><bounds x="41.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.11" element="led"><bounds x="51.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.10" element="led"><bounds x="61.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.9" element="led"><bounds x="71.3" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.8" element="led"><bounds x="81.3" y="41.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="3.15" element="led"><bounds x="11.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.14" element="led"><bounds x="21.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.13" element="led"><bounds x="31.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.12" element="led"><bounds x="41.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.11" element="led"><bounds x="51.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.10" element="led"><bounds x="61.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.9" element="led"><bounds x="71.3" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.8" element="led"><bounds x="81.3" y="51.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="2.15" element="led"><bounds x="11.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.14" element="led"><bounds x="21.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.13" element="led"><bounds x="31.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.12" element="led"><bounds x="41.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.11" element="led"><bounds x="51.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.10" element="led"><bounds x="61.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.9" element="led"><bounds x="71.3" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.8" element="led"><bounds x="81.3" y="61.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="1.15" element="led"><bounds x="11.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.14" element="led"><bounds x="21.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.13" element="led"><bounds x="31.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.12" element="led"><bounds x="41.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.11" element="led"><bounds x="51.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.10" element="led"><bounds x="61.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.9" element="led"><bounds x="71.3" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.8" element="led"><bounds x="81.3" y="71.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="0.15" element="led"><bounds x="11.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.14" element="led"><bounds x="21.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.13" element="led"><bounds x="31.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.12" element="led"><bounds x="41.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.11" element="led"><bounds x="51.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.10" element="led"><bounds x="61.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.9" element="led"><bounds x="71.3" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.8" element="led"><bounds x="81.3" y="81.3" width="1.5" height="1.5" /></bezel>
+
+ <!-- chessboard sensors -->
+
+ <bezel element="hl" inputtag="IN.7" inputmask="0x80"><bounds x="3" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x40"><bounds x="13" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x20"><bounds x="23" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x10"><bounds x="33" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x08"><bounds x="43" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x04"><bounds x="53" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x02"><bounds x="63" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x01"><bounds x="73" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.6" inputmask="0x80"><bounds x="3" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x40"><bounds x="13" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x20"><bounds x="23" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x10"><bounds x="33" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x08"><bounds x="43" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x04"><bounds x="53" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x02"><bounds x="63" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x01"><bounds x="73" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <bezel element="hl" inputtag="IN.5" inputmask="0x80"><bounds x="3" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x40"><bounds x="13" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x20"><bounds x="23" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x10"><bounds x="33" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x08"><bounds x="43" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x04"><bounds x="53" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x02"><bounds x="63" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x01"><bounds x="73" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.4" inputmask="0x80"><bounds x="3" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x40"><bounds x="13" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x20"><bounds x="23" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x10"><bounds x="33" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x08"><bounds x="43" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x04"><bounds x="53" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x02"><bounds x="63" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x01"><bounds x="73" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <bezel element="hl" inputtag="IN.3" inputmask="0x80"><bounds x="3" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x40"><bounds x="13" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x20"><bounds x="23" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x10"><bounds x="33" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x08"><bounds x="43" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x04"><bounds x="53" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x02"><bounds x="63" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x01"><bounds x="73" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.2" inputmask="0x80"><bounds x="3" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x40"><bounds x="13" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x20"><bounds x="23" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x10"><bounds x="33" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x08"><bounds x="43" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x04"><bounds x="53" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x02"><bounds x="63" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x01"><bounds x="73" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <bezel element="hl" inputtag="IN.1" inputmask="0x80"><bounds x="3" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x40"><bounds x="13" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x20"><bounds x="23" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x10"><bounds x="33" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x08"><bounds x="43" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x04"><bounds x="53" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x02"><bounds x="63" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x01"><bounds x="73" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.0" inputmask="0x80"><bounds x="3" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x40"><bounds x="13" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x20"><bounds x="23" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x10"><bounds x="33" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x08"><bounds x="43" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x04"><bounds x="53" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x02"><bounds x="63" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x01"><bounds x="73" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <!-- panel 7seg leds -->
+
+ <bezel name="digit6" element="digit"><bounds x="90" y="3" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+ <bezel name="digit5" element="digit"><bounds x="90" y="8.66" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+ <bezel name="digit7" element="digit"><bounds x="90" y="17.16" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+ <bezel name="digit8" element="digit"><bounds x="90" y="22.82" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+
+ <bezel name="5.7" element="led"><bounds x="96.15" y="15.58" width="0.85" height="0.85" /></bezel>
+ <bezel name="6.7" element="led"><bounds x="91.5" y="15.13" width="0.85" height="0.85" /></bezel>
+
+ <bezel name="digit1" element="digit"><bounds x="90" y="53" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+ <bezel name="digit0" element="digit"><bounds x="90" y="58.66" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+ <bezel name="digit2" element="digit"><bounds x="90" y="67.16" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+ <bezel name="digit3" element="digit"><bounds x="90" y="72.82" width="8.5" height="5.66" /><orientation rotate="90" /></bezel>
+
+ <bezel name="0.7" element="led"><bounds x="96.15" y="65.58" width="0.85" height="0.85" /></bezel>
+ <bezel name="1.7" element="led"><bounds x="91.5" y="65.13" width="0.85" height="0.85" /></bezel>
+
+ <!-- right side -->
+
+ <bezel element="text_r11"><bounds x="91.5" y="29.75" width="2.5" height="1.5" /></bezel>
+ <bezel element="text_r21"><bounds x="91.5" y="32.25" width="2.5" height="1.5" /></bezel>
+ <bezel element="text_r31"><bounds x="91.5" y="34.75" width="2.5" height="1.5" /></bezel>
+ <bezel element="text_r41"><bounds x="91.5" y="37.25" width="2.5" height="1.5" /></bezel>
+ <bezel element="text_r51"><bounds x="91.5" y="39.75" width="2.5" height="1.5" /></bezel>
+ <bezel element="text_r61"><bounds x="91.5" y="42.25" width="2.5" height="1.5" /></bezel>
+
+ <bezel element="text_r12"><bounds x="96.8" y="29.75" width="10" height="1.5" /></bezel>
+ <bezel element="text_r22"><bounds x="96.8" y="32.25" width="10" height="1.5" /></bezel>
+ <bezel element="text_r32"><bounds x="96.8" y="34.75" width="10" height="1.5" /></bezel>
+ <bezel element="text_r42"><bounds x="96.8" y="37.25" width="10" height="1.5" /></bezel>
+ <bezel element="text_r52"><bounds x="96.8" y="39.75" width="10" height="1.5" /></bezel>
+ <bezel element="text_r62"><bounds x="96.8" y="42.25" width="10" height="1.5" /></bezel>
+ <bezel element="text_r72"><bounds x="96.8" y="44.75" width="10" height="1.5" /></bezel>
+ <bezel element="text_r82"><bounds x="96.8" y="47.25" width="10" height="1.5" /></bezel>
+
+ <bezel element="text_r92"><bounds x="96.8" y="49.5" width="10" height="1.5" /></bezel>
+ <bezel element="text_r93"><bounds x="96.8" y="51" width="10" height="1.5" /></bezel>
+
+ <bezel name="8.10" element="led2"><bounds x="90" y="29.75" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.11" element="led2"><bounds x="90" y="32.25" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.12" element="led2"><bounds x="90" y="34.75" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.13" element="led2"><bounds x="90" y="37.25" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.14" element="led2"><bounds x="90" y="39.75" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.15" element="led2"><bounds x="90" y="42.25" width="1.5" height="1.5" /></bezel>
+
+ <bezel element="bt" inputtag="IN.8" inputmask="0x01"><bounds x="94" y="29.5" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x02"><bounds x="94" y="32" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x04"><bounds x="94" y="34.5" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x08"><bounds x="94" y="37" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x10"><bounds x="94" y="39.5" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x20"><bounds x="94" y="42" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x40"><bounds x="94" y="44.5" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.8" inputmask="0x80"><bounds x="94" y="47" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.2" inputmask="0x100"><bounds x="94" y="49.5" width="2" height="2" /></bezel>
+
+ <bezel element="text_rx2"><bounds x="96.8" y="79.75" width="10" height="1.5" /></bezel>
+ <bezel element="text_ry2"><bounds x="96.8" y="82.25" width="10" height="1.5" /></bezel>
+ <bezel element="text_rx1"><bounds x="88" y="78.75" width="6" height="1" /></bezel>
+ <bezel element="text_ry1"><bounds x="88" y="81.25" width="5.5" height="1" /></bezel>
+
+ <bezel name="8.9" element="led2y"><bounds x="90" y="79.75" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.8" element="led2g"><bounds x="90" y="82.25" width="1.5" height="1.5" /></bezel>
+
+ <bezel element="bt" inputtag="IN.0" inputmask="0x100"><bounds x="94" y="79.5" width="2" height="2" /></bezel>
+ <bezel element="bt" inputtag="IN.1" inputmask="0x100"><bounds x="94" y="82" width="2" height="2" /></bezel>
- <bezel name="0.0" element="led"><bounds x="1" y="1" width="1" height="1" /></bezel>
</view>
</mamelayout>
diff --git a/src/mame/layout/fidel_fev.lay b/src/mame/layout/fidel_fev.lay
index 1ecc3e9bcc7..93d4abaf163 100644
--- a/src/mame/layout/fidel_fev.lay
+++ b/src/mame/layout/fidel_fev.lay
@@ -221,6 +221,7 @@
<text string="pion"><color red="0.65" green="0.15" blue="0.14" /></text>
</element>
+
<!-- build screen -->
<view name="Internal Layout">
@@ -412,7 +413,7 @@
<bezel name="digit2" element="digit">
<bounds x="64.18" y="-12.5" width="5.66" height="8.5" />
</bezel>
- <bezel name="digit3" element="digit">
+ <bezel name="digit3" element="digit">
<bounds x="69.84" y="-12.5" width="5.66" height="8.5" />
</bezel>
<bezel name="digit4" element="digit">
diff --git a/src/mame/layout/h2hfootb.lay b/src/mame/layout/h2hfootb.lay
index 1bf59a074c9..9a31d4f72bb 100644
--- a/src/mame/layout/h2hfootb.lay
+++ b/src/mame/layout/h2hfootb.lay
@@ -34,7 +34,7 @@
<element name="text_p1">
<rect><color red="0.24" green="0.4" blue="0.24" /></rect>
- <text string="P1 SEL:">
+ <text string="PL SEL:">
<bounds x="0.0" y="0.17" width="1.0" height="0.6" />
<color red="0.7" green="0.7" blue="0.8" />
</text>
@@ -139,7 +139,6 @@
<bezel element="static_white"><bounds x="344" y="29" width="4" height="1" /></bezel>
<bezel element="static_white"><bounds x="344" y="56" width="4" height="1" /></bezel>
-
<!-- leds -->
<bezel name="0.5" element="seg"><bounds x="0" y="0" width="5" height="20" /></bezel>
diff --git a/src/mame/layout/lostreas.lay b/src/mame/layout/lostreas.lay
new file mode 100644
index 00000000000..ac967ce00f2
--- /dev/null
+++ b/src/mame/layout/lostreas.lay
@@ -0,0 +1,181 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_blue"><rect><color red="0.1" green="0.25" blue="0.5" /></rect></element>
+ <element name="static_blue2"><rect><color red="0.04" green="0.1" blue="0.2" /></rect></element>
+ <element name="disk_cyan"><disk><color red="0.0" green="0.75" blue="1.0" /></disk></element>
+ <element name="disk_white"><disk><color red="0.8" green="0.9" blue="1.0" /></disk></element>
+
+ <element name="led" defstate="0">
+ <disk state="0"><color red="0.2" green="0.04" blue="0.046" /></disk>
+ <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk>
+ </element>
+
+ <element name="text_1">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="1"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_2">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="2"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_3">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="3"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_4">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="4"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_5">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="5"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_6">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="6"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_7">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="7"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_8">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="8"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_9">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="9"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_10">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="10"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_11">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="11"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_12">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="12"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+
+ <element name="text_100">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="100"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_150">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="150"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_200">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="200"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_250">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="250"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_300">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="300"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_350">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="350"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+
+ <element name="text_air">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="AIR"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+ <element name="text_ss">
+ <rect><color red="0.1" green="0.25" blue="0.5" /></rect>
+ <text string="$$"><color red="0.04" green="0.1" blue="0.2" /></text>
+ </element>
+
+ <element name="text_n">
+ <rect><color red="0.0" green="0.75" blue="1.0" /></rect>
+ <text string="N"><color red="1" green="1" blue="1" /></text>
+ </element>
+ <element name="text_s">
+ <rect><color red="0.0" green="0.75" blue="1.0" /></rect>
+ <text string="S"><color red="1" green="1" blue="1" /></text>
+ </element>
+ <element name="text_w">
+ <rect><color red="0.0" green="0.75" blue="1.0" /></rect>
+ <text string="W"><color red="1" green="1" blue="1" /></text>
+ </element>
+ <element name="text_e">
+ <rect><color red="0.0" green="0.75" blue="1.0" /></rect>
+ <text string="E"><color red="1" green="1" blue="1" /></text>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="2.2" right="18.5" top="1" bottom="17.3" />
+ <bezel element="static_blue">
+ <bounds left="0" right="20" top="0" bottom="20" />
+ </bezel>
+
+ <!-- left side -->
+
+ <bezel element="text_12"><bounds x="2.5" y="4" width="2" height="0.5" /></bezel>
+ <bezel element="text_11"><bounds x="2.5" y="4.7" width="2" height="0.5" /></bezel>
+ <bezel element="text_10"><bounds x="2.5" y="6" width="2" height="0.5" /></bezel>
+ <bezel element="text_9"><bounds x="2.5" y="6.7" width="2" height="0.5" /></bezel>
+ <bezel element="text_8"><bounds x="2.5" y="8" width="2" height="0.5" /></bezel>
+ <bezel element="text_7"><bounds x="2.5" y="8.7" width="2" height="0.5" /></bezel>
+ <bezel element="text_6"><bounds x="2.5" y="10" width="2" height="0.5" /></bezel>
+ <bezel element="text_5"><bounds x="2.5" y="10.7" width="2" height="0.5" /></bezel>
+ <bezel element="text_4"><bounds x="2.5" y="12" width="2" height="0.5" /></bezel>
+ <bezel element="text_3"><bounds x="2.5" y="12.7" width="2" height="0.5" /></bezel>
+ <bezel element="text_2"><bounds x="2.5" y="14" width="2" height="0.5" /></bezel>
+ <bezel element="text_1"><bounds x="2.5" y="14.7" width="2" height="0.5" /></bezel>
+ <bezel element="text_air"><bounds x="1.5" y="15.7" width="4" height="0.5" /></bezel>
+
+ <bezel element="text_350"><bounds x="4.4" y="4.35" width="3" height="0.5" /></bezel>
+ <bezel element="text_300"><bounds x="4.4" y="6.35" width="3" height="0.5" /></bezel>
+ <bezel element="text_250"><bounds x="4.4" y="8.35" width="3" height="0.5" /></bezel>
+ <bezel element="text_200"><bounds x="4.4" y="10.35" width="3" height="0.5" /></bezel>
+ <bezel element="text_150"><bounds x="4.4" y="12.35" width="3" height="0.5" /></bezel>
+ <bezel element="text_100"><bounds x="4.4" y="14.35" width="3" height="0.5" /></bezel>
+ <bezel element="text_ss"><bounds x="4.4" y="15.7" width="3" height="0.5" /></bezel>
+
+ <bezel element="static_blue2"><bounds x="3.1" y="4.57" width="0.77" height="0.06" /></bezel>
+ <bezel element="static_blue2"><bounds x="3.1" y="6.57" width="0.77" height="0.06" /></bezel>
+ <bezel element="static_blue2"><bounds x="3.1" y="8.57" width="0.77" height="0.06" /></bezel>
+ <bezel element="static_blue2"><bounds x="3.1" y="10.57" width="0.77" height="0.06" /></bezel>
+ <bezel element="static_blue2"><bounds x="3.1" y="12.57" width="0.77" height="0.06" /></bezel>
+ <bezel element="static_blue2"><bounds x="3.1" y="14.57" width="0.77" height="0.06" /></bezel>
+ <bezel element="static_blue2"><bounds x="7" y="0" width="0.3" height="20" /></bezel>
+
+ <bezel name="0.5" element="led"><bounds x="4" y="4" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.4" element="led"><bounds x="4" y="6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.3" element="led"><bounds x="4" y="8" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.2" element="led"><bounds x="4" y="10" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.1" element="led"><bounds x="4" y="12" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.0" element="led"><bounds x="4" y="14" width="1.2" height="1.2" /></bezel>
+
+ <!-- compass -->
+
+ <bezel element="disk_white"><bounds x="8.1" y="2.1" width="9" height="9" /></bezel>
+ <bezel element="disk_cyan"><bounds x="8.5" y="2.5" width="8.2" height="8.2" /></bezel>
+
+ <bezel element="text_n"><bounds x="12" y="2.7" width="1.2" height="1.2" /></bezel>
+ <bezel element="text_s"><bounds x="12" y="9.3" width="1.2" height="1.2" /></bezel>
+ <bezel element="text_w"><bounds x="8.8" y="6" width="1.2" height="1.2" /></bezel>
+ <bezel element="text_e"><bounds x="15.2" y="6" width="1.2" height="1.2" /></bezel>
+
+ <bezel name="0.6" element="led"><bounds x="12" y="4" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.7" element="led"><bounds x="12" y="8" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.8" element="led"><bounds x="10" y="6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.9" element="led"><bounds x="14" y="6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.10" element="led"><bounds x="12" y="6" width="1.2" height="1.2" /></bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/mathmagi.lay b/src/mame/layout/mathmagi.lay
index eb4e745c77b..b75ac74e178 100644
--- a/src/mame/layout/mathmagi.lay
+++ b/src/mame/layout/mathmagi.lay
@@ -27,7 +27,6 @@
</element>
-
<!-- build screen -->
<view name="Internal Layout">
@@ -62,28 +61,28 @@
<!-- math symbols custom digit -->
- <bezel name="lamp87" element="lamp_dash"><bounds x="21.5" y="17.25" width="7" height="0.5" /></bezel>
+ <bezel name="8.6" element="lamp_dash"><bounds x="21.5" y="17.25" width="7" height="0.5" /></bezel>
- <bezel name="lamp82" element="lamp_slash"><bounds x="24" y="9.5" width="5" height="7.5" /></bezel>
- <bezel name="lamp82" element="lamp_slash"><bounds x="21" y="17" width="5" height="7.5" /></bezel>
+ <bezel name="8.1" element="lamp_slash"><bounds x="24" y="9.5" width="5" height="7.5" /></bezel>
+ <bezel name="8.1" element="lamp_slash"><bounds x="21" y="17" width="5" height="7.5" /></bezel>
- <bezel name="lamp83" element="lamp_backslash"><bounds x="21" y="9.5" width="5" height="7.5" /></bezel>
- <bezel name="lamp83" element="lamp_backslash"><bounds x="24" y="17" width="5" height="7.5" /></bezel>
+ <bezel name="8.2" element="lamp_backslash"><bounds x="21" y="9.5" width="5" height="7.5" /></bezel>
+ <bezel name="8.2" element="lamp_backslash"><bounds x="24" y="17" width="5" height="7.5" /></bezel>
- <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="12.25" width="1.5" height="1.5" /></bezel>
- <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="21.75" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.0" element="lamp_dot"><bounds x="24.25" y="12.25" width="1.5" height="1.5" /></bezel>
+ <bezel name="8.0" element="lamp_dot"><bounds x="24.25" y="21.75" width="1.5" height="1.5" /></bezel>
<!-- equals sign custom digit -->
- <bezel name="lamp91" element="lamp_dash"><bounds x="51.5" y="14.5" width="7" height="0.5" /></bezel>
- <bezel name="lamp94" element="lamp_dash"><bounds x="51.5" y="20.0" width="7" height="0.5" /></bezel>
+ <bezel name="9.0" element="lamp_dash"><bounds x="51.5" y="14.5" width="7" height="0.5" /></bezel>
+ <bezel name="9.3" element="lamp_dash"><bounds x="51.5" y="20.0" width="7" height="0.5" /></bezel>
<!-- other lamps -->
- <bezel name="lamp101" element="lamp_dot"><bounds x="1" y="1" width="4" height="4" /></bezel>
- <bezel name="lamp102" element="lamp_dot"><bounds x="26" y="1" width="4" height="4" /></bezel>
- <bezel name="lamp104" element="lamp_dot"><bounds x="51" y="1" width="4" height="4" /></bezel>
- <bezel name="lamp107" element="lamp_dot"><bounds x="76" y="1" width="4" height="4" /></bezel>
+ <bezel name="10.0" element="lamp_dot"><bounds x="1" y="1" width="4" height="4" /></bezel>
+ <bezel name="10.1" element="lamp_dot"><bounds x="26" y="1" width="4" height="4" /></bezel>
+ <bezel name="10.3" element="lamp_dot"><bounds x="51" y="1" width="4" height="4" /></bezel>
+ <bezel name="10.6" element="lamp_dot"><bounds x="76" y="1" width="4" height="4" /></bezel>
</view>
diff --git a/src/mame/layout/mdndclab.lay b/src/mame/layout/mdndclab.lay
new file mode 100644
index 00000000000..365f2dc8fec
--- /dev/null
+++ b/src/mame/layout/mdndclab.lay
@@ -0,0 +1,271 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0.07" green="0.07" blue="0.06" /></rect></element>
+ <element name="static_red"><rect><color red="0.55" green="0.1" blue="0.05" /></rect></element>
+ <element name="static_white"><rect><color red="0.8" green="0.75" blue="0.7" /></rect></element>
+
+ <element name="hl" defstate="0">
+ <text string=" ">
+ <bounds x="0.0" y="0.0" width="1.0" height="1.0" />
+ <color red="0.0" green="0.0" blue="0.0" />
+ </text>
+ <disk state="1">
+ <bounds x="0.12" y="0.12" width="0.76" height="0.76" />
+ <color red="1.0" green="1.0" blue="1.0" />
+ </disk>
+ </element>
+
+ <element name="hlr" defstate="0">
+ <rect><color red="0.4" green="0.07" blue="0.02" /></rect>
+ <disk state="1">
+ <bounds x="0.12" y="0.12" width="0.76" height="0.76" />
+ <color red="0.5" green="0.1" blue="0.03" />
+ </disk>
+ </element>
+
+ <element name="text_l01">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Switch"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l02">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Key"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l11">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Next Turn"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l12">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Level 1/2"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l21">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Dragon"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l22">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Flying"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l23">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Defeat"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l24">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Tune"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l31">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Dragon"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l32">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Attacks"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l33">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Dragon"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l34">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Waits"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l41">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Wall"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l42">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Door"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l51">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Illegal"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l52">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Move"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l53">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Warrior"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l54">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Moves"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l61">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Warrior 1"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l62">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Winner"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+ <element name="text_l71">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Warrior 2"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+ <element name="text_l72">
+ <rect><color red="0.55" green="0.1" blue="0.05" /></rect>
+ <text string="Treasure"><color red="0.8" green="0.75" blue="0.7" /></text>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-15" right="80" top="-2.5" bottom="80" />
+ <bezel element="static_black">
+ <bounds left="-16" right="81" top="-3" bottom="81" />
+ </bezel>
+
+ <!-- 8*8 buttons -->
+
+ <bezel element="hlr" inputtag="IN.9" inputmask="0x01"><bounds x="0" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.10" inputmask="0x01"><bounds x="10" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.11" inputmask="0x01"><bounds x="20" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.12" inputmask="0x01"><bounds x="30" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.13" inputmask="0x01"><bounds x="40" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.14" inputmask="0x01"><bounds x="50" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.15" inputmask="0x01"><bounds x="60" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.16" inputmask="0x01"><bounds x="70" y="0" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.9" inputmask="0x02"><bounds x="0" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.10" inputmask="0x02"><bounds x="10" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.11" inputmask="0x02"><bounds x="20" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.12" inputmask="0x02"><bounds x="30" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.13" inputmask="0x02"><bounds x="40" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.14" inputmask="0x02"><bounds x="50" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.15" inputmask="0x02"><bounds x="60" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.16" inputmask="0x02"><bounds x="70" y="10" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.9" inputmask="0x04"><bounds x="0" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.10" inputmask="0x04"><bounds x="10" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.11" inputmask="0x04"><bounds x="20" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.12" inputmask="0x04"><bounds x="30" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.13" inputmask="0x04"><bounds x="40" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.14" inputmask="0x04"><bounds x="50" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.15" inputmask="0x04"><bounds x="60" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.16" inputmask="0x04"><bounds x="70" y="20" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.9" inputmask="0x08"><bounds x="0" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.10" inputmask="0x08"><bounds x="10" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.11" inputmask="0x08"><bounds x="20" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.12" inputmask="0x08"><bounds x="30" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.13" inputmask="0x08"><bounds x="40" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.14" inputmask="0x08"><bounds x="50" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.15" inputmask="0x08"><bounds x="60" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.16" inputmask="0x08"><bounds x="70" y="30" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.0" inputmask="0x01"><bounds x="0" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.1" inputmask="0x01"><bounds x="10" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.2" inputmask="0x01"><bounds x="20" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.3" inputmask="0x01"><bounds x="30" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.4" inputmask="0x01"><bounds x="40" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.5" inputmask="0x01"><bounds x="50" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.6" inputmask="0x01"><bounds x="60" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.7" inputmask="0x01"><bounds x="70" y="40" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.0" inputmask="0x02"><bounds x="0" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.1" inputmask="0x02"><bounds x="10" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.2" inputmask="0x02"><bounds x="20" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.3" inputmask="0x02"><bounds x="30" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.4" inputmask="0x02"><bounds x="40" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.5" inputmask="0x02"><bounds x="50" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.6" inputmask="0x02"><bounds x="60" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.7" inputmask="0x02"><bounds x="70" y="50" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.0" inputmask="0x04"><bounds x="0" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.1" inputmask="0x04"><bounds x="10" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.2" inputmask="0x04"><bounds x="20" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.3" inputmask="0x04"><bounds x="30" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.4" inputmask="0x04"><bounds x="40" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.5" inputmask="0x04"><bounds x="50" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.6" inputmask="0x04"><bounds x="60" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.7" inputmask="0x04"><bounds x="70" y="60" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="hlr" inputtag="IN.0" inputmask="0x08"><bounds x="0" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.1" inputmask="0x08"><bounds x="10" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.2" inputmask="0x08"><bounds x="20" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.3" inputmask="0x08"><bounds x="30" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.4" inputmask="0x08"><bounds x="40" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.5" inputmask="0x08"><bounds x="50" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.6" inputmask="0x08"><bounds x="60" y="70" width="7.5" height="7.5" /></bezel>
+ <bezel element="hlr" inputtag="IN.7" inputmask="0x08"><bounds x="70" y="70" width="7.5" height="7.5" /></bezel>
+
+ <!-- left side -->
+
+ <bezel element="static_red"><bounds x="-12.5" y="0" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="10" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="20" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="30" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="40" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="50" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="60" width="7.5" height="7.5" /></bezel>
+ <bezel element="static_red"><bounds x="-12.5" y="70" width="7.5" height="7.5" /></bezel>
+
+ <bezel element="text_l01"><bounds x="-12.5" y="2" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l02"><bounds x="-12.5" y="4" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l11"><bounds x="-12.5" y="11.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l12"><bounds x="-12.5" y="14.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l21"><bounds x="-12.5" y="20.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l22"><bounds x="-12.5" y="22" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l23"><bounds x="-12.5" y="24" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l24"><bounds x="-12.5" y="25.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l31"><bounds x="-12.5" y="30.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l32"><bounds x="-12.5" y="32" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l33"><bounds x="-12.5" y="34" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l34"><bounds x="-12.5" y="35.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l41"><bounds x="-12.5" y="41.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l42"><bounds x="-12.5" y="44.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l51"><bounds x="-12.5" y="50.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l52"><bounds x="-12.5" y="52" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l53"><bounds x="-12.5" y="54" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l54"><bounds x="-12.5" y="55.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l61"><bounds x="-12.5" y="61.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l62"><bounds x="-12.5" y="64.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="text_l71"><bounds x="-12.5" y="71.5" width="7.5" height="1.5" /></bezel>
+ <bezel element="text_l72"><bounds x="-12.5" y="74.5" width="7.5" height="1.5" /></bezel>
+
+ <bezel element="static_white"><bounds x="-12.6" y="13.65" width="7.7" height="0.2" /></bezel>
+ <bezel element="static_white"><bounds x="-12.6" y="23.65" width="7.7" height="0.2" /></bezel>
+ <bezel element="static_white"><bounds x="-12.6" y="33.65" width="7.7" height="0.2" /></bezel>
+ <bezel element="static_white"><bounds x="-12.6" y="43.65" width="7.7" height="0.2" /></bezel>
+ <bezel element="static_white"><bounds x="-12.6" y="53.65" width="7.7" height="0.2" /></bezel>
+ <bezel element="static_white"><bounds x="-12.6" y="63.65" width="7.7" height="0.2" /></bezel>
+ <bezel element="static_white"><bounds x="-12.6" y="73.65" width="7.7" height="0.2" /></bezel>
+
+ <bezel element="static_black"><bounds x="-5" y="-1" width="1" height="80" /></bezel>
+ <bezel element="static_black"><bounds x="-13.5" y="-1" width="1" height="80" /></bezel>
+
+ <bezel element="hl" inputtag="IN.17" inputmask="0x01"><bounds x="-12.5" y="0" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.17" inputmask="0x02"><bounds x="-12.5" y="10" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.17" inputmask="0x04"><bounds x="-12.5" y="20" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.17" inputmask="0x08"><bounds x="-12.5" y="30" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.8" inputmask="0x01"><bounds x="-12.5" y="40" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.8" inputmask="0x02"><bounds x="-12.5" y="50" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.8" inputmask="0x04"><bounds x="-12.5" y="60" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+ <bezel element="hl" inputtag="IN.8" inputmask="0x08"><bounds x="-12.5" y="70" width="7.5" height="7.5" /><color alpha="0.13" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/zodiac.lay b/src/mame/layout/zodiac.lay
new file mode 100644
index 00000000000..0101e8b6c7f
--- /dev/null
+++ b/src/mame/layout/zodiac.lay
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0" green="0" blue="0" /></rect></element>
+ <element name="disk_black"><disk><color red="0" green="0" blue="0" /></disk></element>
+ <element name="disk_red"><disk><color red="0.25" green="0.05" blue="0.02" /></disk></element>
+
+ <element name="led" defstate="0">
+ <disk state="0"><color red="0.2" green="0.04" blue="0.046" /></disk>
+ <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.15" blue="0.08" /></led7seg>
+ </element>
+
+ <element name="text_1"><text string="1"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_2"><text string="2"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_3"><text string="3"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_4"><text string="4"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_5"><text string="5"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_6"><text string="6"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_7"><text string="7"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_8"><text string="8"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_9"><text string="9"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_10"><text string="10"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_11"><text string="11"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_12"><text string="12"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-35" right="158" top="5" bottom="198" />
+ <bezel element="static_black">
+ <bounds left="-35" right="158" top="5" bottom="198" />
+ </bezel>
+
+ <bezel element="disk_red"><bounds x="-40" y="0" width="203" height="203" /></bezel>
+ <bezel element="disk_black"><bounds x="-15" y="25" width="153" height="153" /></bezel>
+
+ <bezel name="digit7" element="digit"><bounds x="20" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit6" element="digit"><bounds x="30" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit5" element="digit"><bounds x="40" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit4" element="digit"><bounds x="50" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit3" element="digit"><bounds x="60" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit2" element="digit"><bounds x="70" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit1" element="digit"><bounds x="80" y="70" width="10" height="15" /></bezel>
+ <bezel name="digit0" element="digit"><bounds x="90" y="70" width="10" height="15" /></bezel>
+
+ <bezel name="9.7" element="led"><bounds x="15" y="145" width="3" height="3" /></bezel>
+ <bezel name="9.2" element="led"><bounds x="40" y="160" width="3" height="3" /></bezel>
+ <bezel name="9.4" element="led"><bounds x="80" y="160" width="3" height="3" /></bezel>
+ <bezel name="9.5" element="led"><bounds x="105" y="145" width="3" height="3" /></bezel>
+ <bezel name="9.1" element="led"><bounds x="120" y="120" width="3" height="3" /></bezel>
+ <bezel name="9.3" element="led"><bounds x="120" y="80" width="3" height="3" /></bezel>
+
+ <bezel name="8.7" element="led"><bounds x="105" y="55" width="3" height="3" /></bezel>
+ <bezel name="8.2" element="led"><bounds x="80" y="40" width="3" height="3" /></bezel>
+ <bezel name="8.4" element="led"><bounds x="40" y="40" width="3" height="3" /></bezel>
+ <bezel name="8.5" element="led"><bounds x="15" y="55" width="3" height="3" /></bezel>
+ <bezel name="8.1" element="led"><bounds x="0" y="80" width="3" height="3" /></bezel>
+ <bezel name="8.3" element="led"><bounds x="0" y="120" width="3" height="3" /></bezel>
+
+ <bezel element="text_1"><bounds x="17" y="143" width="12" height="7" /></bezel>
+ <bezel element="text_2"><bounds x="42" y="158" width="12" height="7" /></bezel>
+ <bezel element="text_3"><bounds x="82" y="158" width="12" height="7" /></bezel>
+ <bezel element="text_4"><bounds x="107" y="143" width="12" height="7" /></bezel>
+ <bezel element="text_5"><bounds x="122" y="118" width="12" height="7" /></bezel>
+ <bezel element="text_6"><bounds x="122" y="78" width="12" height="7" /></bezel>
+
+ <bezel element="text_7"><bounds x="107" y="53" width="12" height="7" /></bezel>
+ <bezel element="text_8"><bounds x="82" y="38" width="12" height="7" /></bezel>
+ <bezel element="text_9"><bounds x="42" y="38" width="12" height="7" /></bezel>
+ <bezel element="text_10"><bounds x="17" y="53" width="12" height="7" /></bezel>
+ <bezel element="text_11"><bounds x="2" y="78" width="12" height="7" /></bezel>
+ <bezel element="text_12"><bounds x="2" y="118" width="12" height="7" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mame/machine/esqlcd.cpp b/src/mame/machine/esqlcd.cpp
new file mode 100644
index 00000000000..e9b23fa2685
--- /dev/null
+++ b/src/mame/machine/esqlcd.cpp
@@ -0,0 +1,403 @@
+// license:BSD-3-Clause
+// copyright-holders:Parduz
+/*
+ Ensoniq LCD dotmatrix Displays
+ derived by Parduz from the VFD Emulation by R. Belmont
+*/
+#include "esqlcd.h"
+#include "esq2by16.lh"
+
+//#define VERBOSE
+
+const device_type ESQ2x16_SQ1 = &device_creator<esq2x16_sq1_t>;
+
+// --- SQ1 - Parduz --------------------------------------------------------------------------------------------------------------------------
+static MACHINE_CONFIG_FRAGMENT(esq2x16)
+ MCFG_DEFAULT_LAYOUT(layout_esq2by16)
+MACHINE_CONFIG_END
+
+/*! \file font5x7.h \brief Graphic LCD Font (Ascii Characters). */
+//*****************************************************************************
+//
+// File Name : 'font5x7.h'
+// Title : Graphic LCD Font (Ascii Charaters)
+// Author : Pascal Stang
+// Date : 10/19/2001
+// Revised : 10/19/2001
+// Version : 0.1
+// Target MCU : Atmel AVR
+// Editor Tabs : 4
+//
+//*****************************************************************************
+// standard ascii 5x7 font
+// defines ascii characters 0x20-0x7F (32-127)
+static unsigned char Font5x7[][5] = {
+ {0x00, 0x00, 0x08, 0x00, 0x00}, // _Undef_ 0x00 - dots for debug purposes
+ {0x01, 0x00, 0x00, 0x00, 0x40}, // _Undef_ 0x01 - dots for debug purposes
+ {0x02, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x02
+ {0x03, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x03
+ {0x04, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x04
+ {0x05, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x05
+ {0x06, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x06
+ {0x07, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x07
+ {0x20, 0x70, 0x3F, 0x00, 0x00}, // Croma 0x08
+ {0x20, 0x70, 0x3F, 0x02, 0x0C}, // Croma 0x09
+ {0x20, 0x70, 0x3F, 0x05, 0x0A}, // Croma 0x0A
+ {0x20, 0x70, 0x3F, 0x15, 0x2A}, // Croma 0x0B
+ {0x20, 0x50, 0x50, 0x3F, 0x00}, // Croma 0x0C
+ {0x0D, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x0D
+ {0x0E, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x0E
+ {0x0F, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x0F
+ {0x10, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x10
+ {0x11, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x11
+ {0x12, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x12
+ {0x13, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x13
+ {0x14, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x14
+ {0x15, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x15
+ {0x16, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x16
+ {0x17, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x17
+ {0x18, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x18
+ {0x19, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x19
+ {0x1A, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x1A
+ {0x1B, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x1B
+ {0x1C, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x1C
+ {0x1D, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x1D
+ {0x1E, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x1E
+ {0x1F, 0x00, 0x00, 0x00, 0x00}, // _Undef_ 0x1F
+ {0x00, 0x00, 0x00, 0x00, 0x00}, // (space) 0x20
+ {0x00, 0x00, 0x5F, 0x00, 0x00}, // ! 0x21
+ {0x00, 0x07, 0x00, 0x07, 0x00}, // " 0x22
+ {0x14, 0x7F, 0x14, 0x7F, 0x14}, // # 0x23
+ {0x24, 0x2A, 0x7F, 0x2A, 0x12}, // $ 0x24
+ {0x23, 0x13, 0x08, 0x64, 0x62}, // % 0x25
+ {0x36, 0x49, 0x55, 0x22, 0x50}, // & 0x26
+ {0x00, 0x05, 0x03, 0x00, 0x00}, // ' 0x27
+ {0x00, 0x1C, 0x22, 0x41, 0x00}, // ( 0x28
+ {0x00, 0x41, 0x22, 0x1C, 0x00}, // ) 0x29
+ {0x08, 0x2A, 0x1C, 0x2A, 0x08}, // * 0x2A
+ {0x08, 0x08, 0x3E, 0x08, 0x08}, // + 0x2B
+ {0x00, 0x50, 0x30, 0x00, 0x00}, // , 0x2C
+ {0x08, 0x08, 0x08, 0x08, 0x08}, // - 0x2D
+ {0x00, 0x60, 0x60, 0x00, 0x00}, // . 0x2E
+ {0x20, 0x10, 0x08, 0x04, 0x02}, // / 0x2F
+ {0x3E, 0x51, 0x49, 0x45, 0x3E}, // 0 0x30
+ {0x00, 0x42, 0x7F, 0x40, 0x00}, // 1 0x31
+ {0x42, 0x61, 0x51, 0x49, 0x46}, // 2 0x32
+ {0x21, 0x41, 0x45, 0x4B, 0x31}, // 3 0x33
+ {0x18, 0x14, 0x12, 0x7F, 0x10}, // 4 0x34
+ {0x27, 0x45, 0x45, 0x45, 0x39}, // 5 0x35
+ {0x3C, 0x4A, 0x49, 0x49, 0x30}, // 6 0x36
+ {0x01, 0x71, 0x09, 0x05, 0x03}, // 7 0x37
+ {0x36, 0x49, 0x49, 0x49, 0x36}, // 8 0x38
+ {0x06, 0x49, 0x49, 0x29, 0x1E}, // 9 0x39
+ {0x00, 0x36, 0x36, 0x00, 0x00}, // : 0x3A
+ {0x00, 0x56, 0x36, 0x00, 0x00}, // ; 0x3B
+ {0x00, 0x08, 0x14, 0x22, 0x41}, // < 0x3C
+ {0x14, 0x14, 0x14, 0x14, 0x14}, // = 0x3D
+ {0x41, 0x22, 0x14, 0x08, 0x00}, // > 0x3E
+ {0x02, 0x01, 0x51, 0x09, 0x06}, // ? 0x3F
+ {0x32, 0x49, 0x79, 0x41, 0x3E}, // @ 0x40
+ {0x7E, 0x11, 0x11, 0x11, 0x7E}, // A 0x41
+ {0x7F, 0x49, 0x49, 0x49, 0x36}, // B 0x42
+ {0x3E, 0x41, 0x41, 0x41, 0x22}, // C 0x43
+ {0x7F, 0x41, 0x41, 0x22, 0x1C}, // D 0x44
+ {0x7F, 0x49, 0x49, 0x49, 0x41}, // E 0x45
+ {0x7F, 0x09, 0x09, 0x01, 0x01}, // F 0x46
+ {0x3E, 0x41, 0x41, 0x51, 0x32}, // G 0x47
+ {0x7F, 0x08, 0x08, 0x08, 0x7F}, // H 0x48
+ {0x00, 0x41, 0x7F, 0x41, 0x00}, // I 0x49
+ {0x20, 0x40, 0x41, 0x3F, 0x01}, // J 0x4A
+ {0x7F, 0x08, 0x14, 0x22, 0x41}, // K 0x4B
+ {0x7F, 0x40, 0x40, 0x40, 0x40}, // L 0x4C
+ {0x7F, 0x02, 0x04, 0x02, 0x7F}, // M 0x4D
+ {0x7F, 0x04, 0x08, 0x10, 0x7F}, // N 0x4E
+ {0x3E, 0x41, 0x41, 0x41, 0x3E}, // O 0x4F
+ {0x7F, 0x09, 0x09, 0x09, 0x06}, // P 0x50
+ {0x3E, 0x41, 0x51, 0x21, 0x5E}, // Q 0x51
+ {0x7F, 0x09, 0x19, 0x29, 0x46}, // R 0x52
+ {0x46, 0x49, 0x49, 0x49, 0x31}, // S 0x53
+ {0x01, 0x01, 0x7F, 0x01, 0x01}, // T 0x54
+ {0x3F, 0x40, 0x40, 0x40, 0x3F}, // U 0x55
+ {0x1F, 0x20, 0x40, 0x20, 0x1F}, // V 0x56
+ {0x7F, 0x20, 0x18, 0x20, 0x7F}, // W 0x57
+ {0x63, 0x14, 0x08, 0x14, 0x63}, // X 0x58
+ {0x03, 0x04, 0x78, 0x04, 0x03}, // Y 0x59
+ {0x61, 0x51, 0x49, 0x45, 0x43}, // Z 0x5A
+ {0x00, 0x00, 0x7F, 0x41, 0x41}, // [ 0x5B
+ {0x02, 0x04, 0x08, 0x10, 0x20}, // \ 0x5C
+ {0x41, 0x41, 0x7F, 0x00, 0x00}, // ] 0x5D
+ {0x04, 0x02, 0x01, 0x02, 0x04}, // ^ 0x5E
+ {0x40, 0x40, 0x40, 0x40, 0x40}, // _ 0x5F
+ {0x00, 0x01, 0x02, 0x04, 0x00}, // ` 0x60
+ {0x20, 0x54, 0x54, 0x54, 0x78}, // a 0x61
+ {0x7F, 0x48, 0x44, 0x44, 0x38}, // b 0x62
+ {0x38, 0x44, 0x44, 0x44, 0x20}, // c 0x63
+ {0x38, 0x44, 0x44, 0x48, 0x7F}, // d 0x64
+ {0x38, 0x54, 0x54, 0x54, 0x18}, // e 0x65
+ {0x08, 0x7E, 0x09, 0x01, 0x02}, // f 0x66
+ {0x08, 0x14, 0x54, 0x54, 0x3C}, // g 0x67
+ {0x7F, 0x08, 0x04, 0x04, 0x78}, // h 0x68
+ {0x00, 0x44, 0x7D, 0x40, 0x00}, // i 0x69
+ {0x20, 0x40, 0x44, 0x3D, 0x00}, // j 0x6A
+ {0x00, 0x7F, 0x10, 0x28, 0x44}, // k 0x6B
+ {0x00, 0x41, 0x7F, 0x40, 0x00}, // l 0x6C
+ {0x7C, 0x04, 0x18, 0x04, 0x78}, // m 0x6D
+ {0x7C, 0x08, 0x04, 0x04, 0x78}, // n 0x6E
+ {0x38, 0x44, 0x44, 0x44, 0x38}, // o 0x6F
+ {0x7C, 0x14, 0x14, 0x14, 0x08}, // p 0x70
+ {0x08, 0x14, 0x14, 0x18, 0x7C}, // q 0x71
+ {0x7C, 0x08, 0x04, 0x04, 0x08}, // r 0x72
+ {0x48, 0x54, 0x54, 0x54, 0x20}, // s 0x73
+ {0x04, 0x3F, 0x44, 0x40, 0x20}, // t 0x74
+ {0x3C, 0x40, 0x40, 0x20, 0x7C}, // u 0x75
+ {0x1C, 0x20, 0x40, 0x20, 0x1C}, // v 0x76
+ {0x3C, 0x40, 0x30, 0x40, 0x3C}, // w 0x77
+ {0x44, 0x28, 0x10, 0x28, 0x44}, // x 0x78
+ {0x0C, 0x50, 0x50, 0x50, 0x3C}, // y 0x79
+ {0x44, 0x64, 0x54, 0x4C, 0x44}, // z 0x7A
+ {0x00, 0x08, 0x36, 0x41, 0x00}, // { 0x7B
+ {0x00, 0x00, 0x7F, 0x00, 0x00}, // | 0x7C
+ {0x00, 0x41, 0x36, 0x08, 0x00}, // } 0x7D
+ {0x08, 0x08, 0x2A, 0x1C, 0x08}, // -> 0x7E
+ {0x08, 0x1C, 0x2A, 0x08, 0x08} // <- 0x7F
+};
+//--------------------------------------------------------------------------------------------------------------------------------------------
+machine_config_constructor esq2x16_sq1_t::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( esq2x16 );
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+void esq2x16_sq1_t::write_char(int data)
+{
+ int DisplayCode = data;
+ int LedState;
+
+ // Non-ASCII codes that needs to be treated as ASCII characters
+ if (
+ data == 0x08 ||
+ data == 0x09 ||
+ data == 0x0A ||
+ data == 0x0B ||
+ data == 0x0C
+ ) data = '^'; // musical notes
+
+ // Resolve here 2-Bytes commands: the command was saved previously
+ switch (m_LcdCommand) {
+ case 0:
+ // No current command.
+ break;
+
+ case 0x87:
+ // Go To
+ #ifdef VERBOSE
+ printf("LCD %02X: Go To %02X - pos=%02X (%d)\n", m_LcdCommand, DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ m_lcdPos = DisplayCode;
+ m_LcdCommand = 0;
+ return;
+ break;
+
+ case 0x88:
+ // Save Cursor position - What the second byte (00 or 01) means?
+ #ifdef VERBOSE
+ printf("LCD %02X: Save Pos. (%02X) - pos=%02X (%d)\n", m_LcdCommand, DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ m_lcdSavedPos = m_lcdPos;
+ m_LcdCommand = 0;
+ return;
+ break;
+
+ case 0x89:
+ // Restore Cursor position - What the second byte (00 or 01) means?
+ #ifdef VERBOSE
+ printf("LCD %02X: Restore Pos. (%02X) - pos=%02X (%d)\n", m_LcdCommand, DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ m_lcdPos = m_lcdSavedPos;
+ m_LcdCommand = 0;
+ return;
+ break;
+
+ case 0x8D:
+ case 0x8E:
+ case 0x8F:
+ // LED OFF, ON, BLINK
+ LedState = m_LcdCommand & 0x03;
+ if (
+ DisplayCode >= 16 || // Out of bounds
+ DisplayCode == 6 || // non-existent
+ DisplayCode == 7 || // non-existent
+ DisplayCode == 14 || // non-existent
+ DisplayCode == 15 // non-existent
+ )
+ {
+ #ifdef VERBOSE
+ printf("LCD %02X: Led %02d does'nt exist - pos=%02X (%d)\n", m_LcdCommand, DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ }
+ else
+ {
+ if (m_leds[DisplayCode] != LedState)
+ {
+ m_leds[DisplayCode] = LedState;
+ m_ledsDirty[DisplayCode] = 1;
+ }
+ update_display();
+ }
+ m_LcdCommand = 0;
+ return;
+ break;
+
+ default:
+ #ifdef VERBOSE
+ printf("LCD: Unknown 2-Bytes Command:%02X-%02X - pos=%02X (%d)\n", m_LcdCommand, DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ m_LcdCommand = 0;
+ return;
+ break;
+ }
+
+ if ((data >= 0x20) && (data <= 0x7f))
+ {
+ #ifdef VERBOSE
+ printf("LCD %02X: \"%c\" - pos=%02X (%d)\n", DisplayCode, data, m_lcdPos, m_lcdPage);
+ #endif
+ m_lcdpg[m_lcdPage][m_lcdPos++] = DisplayCode;
+ if (m_lcdPos > 31) m_lcdPos = 31;
+
+ update_display();
+ return;
+ }
+
+ if (DisplayCode >= 0x80)
+ {
+ switch (DisplayCode) {
+ // Known 2-bytes command
+ case 0x87: // Go To
+ case 0x88: // Save Cursor Position
+ case 0x89: // Restore Cursor Position
+ // Save the command for the next byte
+ m_LcdCommand = DisplayCode;
+ return;
+ break;
+
+ // Unknown 2-bytes command
+ case 0x85:
+ case 0x86:
+ case 0x95:
+ // ??? - related to blinking chars? - 2 bytes command
+ m_LcdCommand = DisplayCode;
+ return;
+ break;
+
+ case 0x8D:
+ case 0x8E:
+ case 0x8F:
+ // LEDs OFF,ON and BLINK - 2 bytes command
+ m_LcdCommand = DisplayCode;
+ return;
+ break;
+
+ // "Page" selectors (?)
+ case 0x90: // Blink
+ case 0x91: // ??
+ case 0x92: // Normal
+ m_lcdPage = DisplayCode & 0x03;
+ #ifdef VERBOSE
+ printf("LCD %02X: Page Change ? - pos=%02X (%d)\n", DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ m_LcdCommand = 0;
+ return;
+ break;
+
+ case 0x8C:
+ #ifdef VERBOSE
+ printf("LCD %02X: Lcd Clear - pos=%02X (%d)\n", DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ lcd_reset();
+ return;
+ break;
+ case 0x98:
+ #ifdef VERBOSE
+ printf("LCD %02X: Page Clear ? - pos=%02X (%d)\n", DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ page_reset();
+ return;
+ break;
+
+ default:
+ #ifdef VERBOSE
+ printf("LCD %02X: Unknown Command - pos=%02X (%d)\n", DisplayCode, m_lcdPos, m_lcdPage);
+ #endif
+ m_LcdCommand = 0;
+ return;
+ break;
+ }
+ }
+ #ifdef VERBOSE
+ else
+ {
+ printf("LCD: Unknown LCD Code: %04X - pos=%02X (%d)\n", data, m_lcdPos, m_lcdPage);
+ }
+ #endif
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+esq2x16_sq1_t::esq2x16_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : esqvfd_t(mconfig, ESQ2x16_SQ1, "Ensoniq 2x16 VFD (SQ-1 variant)", tag, owner, clock, "esq2x16_sq1", __FILE__)
+{
+ m_rows = 2;
+ m_cols = 16;
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+void esq2x16_sq1_t::update_display()
+{
+ char lcdCharRow;
+
+ for (int led = 0; led < 16; led++)
+ {
+ if (m_ledsDirty[led]) {
+ machine().output().set_indexed_value("rLed_", led, m_leds[led]);
+ m_ledsDirty[led] = 0;
+ }
+ }
+
+ for (int page = 0; page < 4; page++)
+ {
+ for (int pos = 0; pos < 32; pos++)
+ {
+ // stealed from tecnbras.cpp and modified
+ for (int rr=0; rr<7; rr++) {
+ lcdCharRow = RotateLcdChar(m_lcdpg[page][pos],rr);
+ machine().output().set_indexed_value("pg_", (page+1)*1000 + pos*7 + rr, 0x1F & lcdCharRow);
+ }
+ }
+ }
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+void esq2x16_sq1_t::device_reset()
+{
+ //lcd_reset();
+ m_lcdPage = m_lcdSavedPos = m_lcdPos = m_LcdCommand = 0;
+ memset(m_leds, 0, sizeof(m_leds));
+ memset(m_lcdpg, 1, sizeof(m_lcdpg)); // Set to 1 for debug: to see what "pages" are set to 0 from the firmware
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+void esq2x16_sq1_t::lcd_reset()
+{
+ m_lcdPage = m_lcdSavedPos = m_lcdPos = m_LcdCommand = 0;
+ memset(m_leds, 0, sizeof(m_leds));
+ memset(m_lcdpg, 0, sizeof(m_lcdpg));
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+void esq2x16_sq1_t::page_reset()
+{
+ memset(m_lcdpg[m_lcdPage], 0, 32);
+ m_lcdPos = m_LcdCommand = 0;
+}
+//--------------------------------------------------------------------------------------------------------------------------------------------
+char esq2x16_sq1_t::RotateLcdChar(UINT8 lcdChar, int charRow)
+{
+ char lcdCharRow = 0;
+ for (int cc=0; cc<5; cc++){
+ lcdCharRow |= BIT(Font5x7[lcdChar][cc], charRow) ? (1 << (cc)) : 0;
+ }
+ return lcdCharRow;
+}
diff --git a/src/mame/machine/esqlcd.h b/src/mame/machine/esqlcd.h
new file mode 100644
index 00000000000..0fa306f5161
--- /dev/null
+++ b/src/mame/machine/esqlcd.h
@@ -0,0 +1,45 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont, Parduz
+#ifndef ESQLCD_H
+#define ESQLCD_H
+
+#include "emu.h"
+#include "esqvfd.h"
+
+
+// --- SQ1 - Parduz --------------------------------------------------------------------------------------------------------------------------
+
+#define MCFG_ESQ2x16_SQ1_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, ESQ2x16_SQ1, 60)
+
+#define MCFG_ESQ2x16_SQ1_REMOVE(_tag) \
+ MCFG_DEVICE_REMOVE(_tag)
+
+class esq2x16_sq1_t : public esqvfd_t {
+public:
+ esq2x16_sq1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual void write_char(int data) override;
+ virtual void update_display() override;
+ virtual void device_reset() override;
+
+
+ void lcd_reset();
+ void page_reset();
+ char RotateLcdChar(UINT8 lcdChar, int charRow);
+protected:
+ virtual machine_config_constructor device_mconfig_additions() const override;
+ UINT8 m_lcdpg[4][32];
+ int m_lcdPage;
+ int m_lcdPos,m_lcdSavedPos;
+
+ UINT8 m_leds[16];
+ UINT8 m_ledsDirty[16];
+
+private:
+ int m_LcdCommand;
+};
+
+extern const device_type ESQ2x16_SQ1;
+
+#endif
diff --git a/src/mame/machine/esqpanel.cpp b/src/mame/machine/esqpanel.cpp
index 1c4dee54248..4c084a6d5c5 100644
--- a/src/mame/machine/esqpanel.cpp
+++ b/src/mame/machine/esqpanel.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:R. Belmont
+// copyright-holders:R. Belmont, Parduz
/*
Ensoniq panel/display device
*/
@@ -16,7 +16,7 @@
const device_type ESQPANEL1x22 = &device_creator<esqpanel1x22_device>;
const device_type ESQPANEL2x40 = &device_creator<esqpanel2x40_device>;
-const device_type ESQPANEL2x40_SQ1 = &device_creator<esqpanel2x40_sq1_device>;
+const device_type ESQPANEL2x16_SQ1 = &device_creator<esqpanel2x16_sq1_device>;
//**************************************************************************
// LIVE DEVICE
@@ -234,19 +234,18 @@ esqpanel2x40_device::esqpanel2x40_device(const machine_config &mconfig, const ch
m_eps_mode = false;
}
-/* panel with 2x16? LCD display used in the SQ and MR series, plus probably more */
-
-static MACHINE_CONFIG_FRAGMENT(esqpanel2x40_sq1)
- MCFG_ESQ2x40_SQ1_ADD("vfd")
+// --- SQ1 - Parduz --------------------------------------------------------------------------------------------------------------------------
+static MACHINE_CONFIG_FRAGMENT(esqpanel2x16_sq1)
+ MCFG_ESQ2x16_SQ1_ADD("vfd")
MACHINE_CONFIG_END
-
-machine_config_constructor esqpanel2x40_sq1_device::device_mconfig_additions() const
+// --- SQ1 - Parduz --------------------------------------------------------------------------------------------------------------------------
+machine_config_constructor esqpanel2x16_sq1_device::device_mconfig_additions() const
{
- return MACHINE_CONFIG_NAME( esqpanel2x40_sq1 );
+ return MACHINE_CONFIG_NAME( esqpanel2x16_sq1 );
}
-
-esqpanel2x40_sq1_device::esqpanel2x40_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- esqpanel_device(mconfig, ESQPANEL2x40, "Ensoniq front panel with 2x16 LCD", tag, owner, clock, "esqpanel240_sq1", __FILE__),
+// --- SQ1 - Parduz --------------------------------------------------------------------------------------------------------------------------
+esqpanel2x16_sq1_device::esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ esqpanel_device(mconfig, ESQPANEL2x16_SQ1, "Ensoniq front panel with 2x16 LCD", tag, owner, clock, "esqpanel216_sq1", __FILE__),
m_vfd(*this, "vfd")
{
m_eps_mode = false;
diff --git a/src/mame/machine/esqpanel.h b/src/mame/machine/esqpanel.h
index 5de704f1375..46f9f07ec03 100644
--- a/src/mame/machine/esqpanel.h
+++ b/src/mame/machine/esqpanel.h
@@ -7,6 +7,7 @@
#include "emu.h"
#include "machine/esqvfd.h"
+#include "machine/esqlcd.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
@@ -30,13 +31,13 @@
#define MCFG_ESQPANEL_2x40_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
-#define MCFG_ESQPANEL2x40_SQ1_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, ESQPANEL2x40_SQ1, 0)
+#define MCFG_ESQPANEL2x16_SQ1_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, ESQPANEL2x16_SQ1, 0)
-#define MCFG_ESQPANEL2x40_SQ1_REPLACE(_tag) \
- MCFG_DEVICE_REPLACE(_tag, ESQPANEL2x40_SQ1, 0)
+#define MCFG_ESQPANEL2x16_SQ1_REPLACE(_tag) \
+ MCFG_DEVICE_REPLACE(_tag, ESQPANEL2x16_SQ1, 0)
-#define MCFG_ESQPANEL2x40_SQ1_REMOVE(_tag) \
+#define MCFG_ESQPANEL2x16_SQ1_REMOVE(_tag) \
MCFG_DEVICE_REMOVE(_tag)
#define MCFG_ESQPANEL_TX_CALLBACK(_write) \
@@ -133,8 +134,23 @@ protected:
private:
};
+// --- SQ1 - Parduz --------------------------------------------------------------------------------------------------------------------------
+class esqpanel2x16_sq1_device : public esqpanel_device {
+public:
+ esqpanel2x16_sq1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ required_device<esq2x16_sq1_t> m_vfd;
+
+ virtual void send_to_display(UINT8 data) override { m_vfd->write_char(data); }
+
+protected:
+ virtual machine_config_constructor device_mconfig_additions() const override;
+
+private:
+};
+
extern const device_type ESQPANEL1x22;
extern const device_type ESQPANEL2x40;
-extern const device_type ESQPANEL2x40_SQ1;
+extern const device_type ESQPANEL2x16_SQ1;
#endif
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index bed1f2b01d9..b006c9d83b5 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -841,6 +841,7 @@ static USBStandardEndpointDescriptor enddesc02 = {7,5,0x02,3,0x20,4};
ohci_function_device::ohci_function_device(running_machine &machine)
{
+ state = DefaultState;
descriptors = auto_alloc_array(machine, UINT8, 1024);
descriptors_pos = 0;
address = 0;
@@ -848,6 +849,7 @@ ohci_function_device::ohci_function_device(running_machine &machine)
controldirection = 0;
controltype = 0;
controlrecipient = 0;
+ configurationvalue = 0;
remain = 0;
position = nullptr;
settingaddress = false;
@@ -861,25 +863,25 @@ ohci_function_device::ohci_function_device(running_machine &machine)
void ohci_function_device::add_device_descriptor(USBStandardDeviceDescriptor &descriptor)
{
memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor));
- descriptors_pos += sizeof(descriptor);
+ descriptors_pos += descriptor.bLength;
}
void ohci_function_device::add_configuration_descriptor(USBStandardConfigurationDescriptor &descriptor)
{
memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor));
- descriptors_pos += sizeof(descriptor);
+ descriptors_pos += descriptor.bLength;
}
void ohci_function_device::add_interface_descriptor(USBStandardInterfaceDescriptor &descriptor)
{
memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor));
- descriptors_pos += sizeof(descriptor);
+ descriptors_pos += descriptor.bLength;
}
void ohci_function_device::add_endpoint_descriptor(USBStandardEndpointDescriptor &descriptor)
{
memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor));
- descriptors_pos += sizeof(descriptor);
+ descriptors_pos += descriptor.bLength;
}
void ohci_function_device::execute_reset()
@@ -890,9 +892,11 @@ void ohci_function_device::execute_reset()
int ohci_function_device::execute_transfer(int address, int endpoint, int pid, UINT8 *buffer, int size)
{
+ int descriptortype;// descriptorindex;
+
if (endpoint == 0) {
if (pid == SetupPid) {
- struct USBSetupPacket *p=(struct USBSetupPacket *)buffer;
+ USBSetupPacket *p=(USBSetupPacket *)buffer;
// define direction 0:host->device 1:device->host
controldirection = (p->bmRequestType & 128) >> 7;
// case ==1, IN data stage and OUT status stage
@@ -901,9 +905,10 @@ int ohci_function_device::execute_transfer(int address, int endpoint, int pid, U
controltype = (p->bmRequestType & 0x60) >> 5;
controlrecipient = p->bmRequestType & 0x1f;
position = nullptr;
+ // number of byte to transfer in data stage (0 no data stage)
remain = p->wLength;
- // if standard
- if (controltype == 0) {
+ // if standard device request
+ if ((controltype == StandardType) && (controlrecipient == DeviceRecipient)) {
switch (p->bRequest) {
case GET_STATUS:
case CLEAR_FEATURE:
@@ -914,29 +919,39 @@ int ohci_function_device::execute_transfer(int address, int endpoint, int pid, U
settingaddress = true;
break;
case GET_DESCRIPTOR:
- if ((p->wValue >> 8) == DEVICE) { // device descriptor
- //p->wValue & 255;
+ descriptortype = p->wValue >> 8;
+ //descriptorindex = p->wValue & 255;
+ if (descriptortype == DEVICE) { // device descriptor
position = descriptors;
remain = descriptors[0];
}
- else if ((p->wValue >> 8) == CONFIGURATION) { // configuration descriptor
+ else if (descriptortype == CONFIGURATION) { // configuration descriptor
position = descriptors + 18;
remain = descriptors[18+2];
}
- else if ((p->wValue >> 8) == INTERFACE) { // interface descriptor
+ else if (descriptortype == INTERFACE) { // interface descriptor
position = descriptors + 18 + 9;
remain = descriptors[18 + 9];
}
- else if ((p->wValue >> 8) == ENDPOINT) { // endpoint descriptor
+ else if (descriptortype == ENDPOINT) { // endpoint descriptor
position = descriptors + 18 + 9 + 9;
remain = descriptors[18 + 9 + 9];
}
+ else
+ remain = 0;
if (remain > p->wLength)
remain = p->wLength;
break;
+ case SET_CONFIGURATION:
+ if (p->wValue == 0)
+ state = AddressState;
+ else {
+ configurationvalue = p->wValue;
+ state = ConfiguredState;
+ }
+ break;
case SET_DESCRIPTOR:
case GET_CONFIGURATION:
- case SET_CONFIGURATION:
case GET_INTERFACE:
case SET_INTERFACE:
case SYNCH_FRAME:
@@ -944,18 +959,21 @@ int ohci_function_device::execute_transfer(int address, int endpoint, int pid, U
break;
}
}
+ else
+ return handle_nonstandard_request(p);
size = 0;
}
else if (pid == InPid) {
// if no data has been transferred (except for the setup stage)
// and the lenght of this IN transaction is 0
// assume this is the status stage
- if (size == 0) {
+ if ((size == 0) && (remain == 0)) {
if (settingaddress == true)
{
// set of address is active at end of status stage
address = newaddress;
settingaddress = false;
+ state = AddressState;
}
return 0;
}
@@ -987,9 +1005,30 @@ int ohci_function_device::execute_transfer(int address, int endpoint, int pid, U
}
}
}
+ else
+ return -1;
return size;
}
+int ohci_function_device::handle_nonstandard_request(USBSetupPacket *setup)
+{
+ // >=8 ==42 !=0 !=0 1,3 2<20 <=20
+ static UINT8 mytestdata[16] = { 0x10,0x42 ,0x32,0x43,1 ,0x65,0x18,0x20,0x98,0xa9,0xba,0xcb,0xdc,0xed,0xfe };
+
+ if ((controltype == VendorType) && (controlrecipient == InterfaceRecipient))
+ {
+ if (setup->bRequest == GET_DESCRIPTOR)
+ {
+ if (setup->wValue == 0x4200)
+ {
+ position = mytestdata;
+ remain = 16;
+ }
+ }
+ }
+ return 0;
+}
+
void xbox_base_state::usb_ohci_interrupts()
{
if (((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != 0) && ((ohcist.hc_regs[HcInterruptEnable] & MasterInterruptEnable) != 0))
@@ -1389,11 +1428,7 @@ READ8_MEMBER(xbox_base_state::get_slave_ack)
IRQ_CALLBACK_MEMBER(xbox_base_state::irq_callback)
{
int r = 0;
- r = xbox_base_devs.pic8259_2->acknowledge();
- if (r == 0)
- {
- r = xbox_base_devs.pic8259_1->acknowledge();
- }
+ r = xbox_base_devs.pic8259_1->acknowledge();
if (debug_irq_active)
debug_generate_irq(debug_irq_number, false);
return r;
diff --git a/src/mame/mame.cpp b/src/mame/mame.cpp
index 1acc02060ab..9dc8d96c382 100644
--- a/src/mame/mame.cpp
+++ b/src/mame/mame.cpp
@@ -13,32 +13,11 @@
#define APPNAME "MAME"
#define APPNAME_LOWER "mame"
#define CONFIGNAME "mame"
-#define CAPGAMENOUN "MACHINE"
-#define CAPSTARTGAMENOUN "Machine"
-#define GAMENOUN "machine"
-#define GAMESNOUN "machines"
#define COPYRIGHT "Copyright Nicola Salmoria\nand the MAME team\nhttp://mamedev.org"
#define COPYRIGHT_INFO "Copyright Nicola Salmoria and the MAME team"
-#define DISCLAIMER "This software reproduces, more or less faithfully, the behaviour of a wide range\n" \
- "of machines. But hardware is useless without software, so images of the ROMs and\n" \
- "other media which run on that hardware are also required.\n"
-#define USAGE "Usage: %s [%s] [media] [software] [options]"
-#define XML_ROOT "mame"
-#define XML_TOP "machine"
-#define STATE_MAGIC_NUM "MAMESAVE"
const char * emulator_info::get_appname() { return APPNAME;}
const char * emulator_info::get_appname_lower() { return APPNAME_LOWER;}
const char * emulator_info::get_configname() { return CONFIGNAME;}
-const char * emulator_info::get_capgamenoun() { return CAPGAMENOUN;}
-const char * emulator_info::get_capstartgamenoun() { return CAPSTARTGAMENOUN;}
-const char * emulator_info::get_gamenoun() { return GAMENOUN;}
-const char * emulator_info::get_gamesnoun() { return GAMESNOUN;}
const char * emulator_info::get_copyright() { return COPYRIGHT;}
const char * emulator_info::get_copyright_info() { return COPYRIGHT_INFO;}
-const char * emulator_info::get_disclaimer() { return DISCLAIMER;}
-const char * emulator_info::get_usage() { return USAGE;}
-const char * emulator_info::get_xml_root() { return XML_ROOT;}
-const char * emulator_info::get_xml_top() { return XML_TOP;}
-const char * emulator_info::get_state_magic_num() { return STATE_MAGIC_NUM;}
-void emulator_info::printf_usage(const char *par1, const char *par2) { osd_printf_info(USAGE, par1, par2); }
diff --git a/src/mame/mess.cpp b/src/mame/mess.cpp
index 985aeaa19e7..160f777c044 100644
--- a/src/mame/mess.cpp
+++ b/src/mame/mess.cpp
@@ -13,32 +13,11 @@
#define APPNAME "MESS"
#define APPNAME_LOWER "mess"
#define CONFIGNAME "mess"
-#define CAPGAMENOUN "MACHINE"
-#define CAPSTARTGAMENOUN "Machine"
-#define GAMENOUN "machine"
-#define GAMESNOUN "machines"
#define COPYRIGHT "Copyright Nicola Salmoria\nand the MAME team\nhttp://mamedev.org"
#define COPYRIGHT_INFO "Copyright Nicola Salmoria and the MAME team"
-#define DISCLAIMER "This software reproduces, more or less faithfully, the behaviour of a wide range\n" \
- "of machines. But hardware is useless without software, so images of the ROMs and\n" \
- "other media which run on that hardware are also required.\n"
-#define USAGE "Usage: %s [%s] [media] [software] [options]"
-#define XML_ROOT "mame"
-#define XML_TOP "machine"
-#define STATE_MAGIC_NUM "MAMESAVE"
const char * emulator_info::get_appname() { return APPNAME;}
const char * emulator_info::get_appname_lower() { return APPNAME_LOWER;}
const char * emulator_info::get_configname() { return CONFIGNAME;}
-const char * emulator_info::get_capgamenoun() { return CAPGAMENOUN;}
-const char * emulator_info::get_capstartgamenoun() { return CAPSTARTGAMENOUN;}
-const char * emulator_info::get_gamenoun() { return GAMENOUN;}
-const char * emulator_info::get_gamesnoun() { return GAMESNOUN;}
const char * emulator_info::get_copyright() { return COPYRIGHT;}
const char * emulator_info::get_copyright_info() { return COPYRIGHT_INFO;}
-const char * emulator_info::get_disclaimer() { return DISCLAIMER;}
-const char * emulator_info::get_usage() { return USAGE;}
-const char * emulator_info::get_xml_root() { return XML_ROOT;}
-const char * emulator_info::get_xml_top() { return XML_TOP;}
-const char * emulator_info::get_state_magic_num() { return STATE_MAGIC_NUM;}
-void emulator_info::printf_usage(const char *par1, const char *par2) { osd_printf_info(USAGE, par1, par2); }
diff --git a/src/mame/mess.lst b/src/mame/mess.lst
index fca9f76e047..0d6cdc46abb 100644
--- a/src/mame/mess.lst
+++ b/src/mame/mess.lst
@@ -2168,6 +2168,9 @@ fexcel
fexcelv
feagv2
+feagv7
+feagv10
+feagv11
// Hegener & Glaser Munich
//mephisto // Mephisto 1 - roms needed - not in driver
@@ -2229,6 +2232,7 @@ ngenb38 // 1991
// hh_cop400
ctstein // Castle Toy
+h2hbaskb // Coleco
einvaderc // Entex
funjacks // Mattel
funrlgl // Mattel
@@ -2283,9 +2287,12 @@ gnwmndon // Nintendo
// hh_tms1k
mathmagi // APF
amaztron // Coleco
+zodiac // Coleco
+cqback // Coleco
h2hbaseb // Coleco
h2hfootb // Coleco
tc4 // Coleco
+cnfball2 // Conic
ebball // Entex
ebball2 // Entex
ebball3 // Entex
@@ -2311,6 +2318,7 @@ stopthiep // Parker Bros (patent)
bankshot // Parker Bros
splitsec // Parker Bros
mmerlin // Parker Bros
+lostreas // Parker Bros
tandy12 // Tandy Radio Shack
tbreakup // Tomy
phpball // Tomy
diff --git a/src/mame/video/apollo.cpp b/src/mame/video/apollo.cpp
index 7d6cc7099ef..9735f0e334a 100644
--- a/src/mame/video/apollo.cpp
+++ b/src/mame/video/apollo.cpp
@@ -1711,7 +1711,7 @@ MACHINE_CONFIG_FRAGMENT( apollo_graphics )
MCFG_SCREEN_ADD(VIDEO_SCREEN_TAG, RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
MCFG_SCREEN_REFRESH_RATE(76)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(657))
+ MCFG_SCREEN_RAW_PARAMS(68000000, 1343, 0, 1024, 841, 0, 800)
MCFG_SCREEN_SIZE(1024, 800)
MCFG_SCREEN_VISIBLE_AREA(0, 1023, 0, 799)
MCFG_SCREEN_UPDATE_DEVICE(APOLLO_SCREEN_TAG, apollo_graphics_15i, screen_update)
@@ -1895,7 +1895,7 @@ MACHINE_CONFIG_FRAGMENT( apollo_mono19i )
MCFG_SCREEN_ADD(VIDEO_SCREEN_TAG, RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
MCFG_SCREEN_REFRESH_RATE(64)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(616))
+ MCFG_SCREEN_RAW_PARAMS(120000000, 1728, 0, 1280, 1066, 0, 1024)
MCFG_SCREEN_SIZE(1280, 1024)
MCFG_SCREEN_VISIBLE_AREA(0, 1279, 0, 1023)
MCFG_SCREEN_UPDATE_DEVICE(APOLLO_SCREEN_TAG, apollo_graphics_19i, screen_update)
diff --git a/src/mame/video/blmbycar.cpp b/src/mame/video/blmbycar.cpp
index b438f01eafa..6086cd9e9b6 100644
--- a/src/mame/video/blmbycar.cpp
+++ b/src/mame/video/blmbycar.cpp
@@ -78,13 +78,13 @@ TILE_GET_INFO_MEMBER(blmbycar_state::get_tile_info_1)
}
-WRITE16_MEMBER(blmbycar_state::blmbycar_vram_0_w)
+WRITE16_MEMBER(blmbycar_state::vram_0_w)
{
COMBINE_DATA(&m_vram_0[offset]);
m_tilemap_0->mark_tile_dirty(offset / 2);
}
-WRITE16_MEMBER(blmbycar_state::blmbycar_vram_1_w)
+WRITE16_MEMBER(blmbycar_state::vram_1_w)
{
COMBINE_DATA(&m_vram_1[offset]);
m_tilemap_1->mark_tile_dirty(offset / 2);
@@ -192,7 +192,7 @@ void blmbycar_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,
***************************************************************************/
-UINT32 blmbycar_state::screen_update_blmbycar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 blmbycar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int i, layers_ctrl = -1;
diff --git a/src/mame/video/chihiro.cpp b/src/mame/video/chihiro.cpp
index d1fab8ff46d..f5d413e814e 100644
--- a/src/mame/video/chihiro.cpp
+++ b/src/mame/video/chihiro.cpp
@@ -2593,12 +2593,12 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
printf("A:%08X MTHD:%08X D:%08X\n\r",address,maddress,data);
#endif
if (maddress == 0x17fc) {
-#if 1 // useful while debugging to see what coordinates have been used
+#if 0 // useful while debugging to see what coordinates have been used
static int debugvc = 0;
if (debugvc)
if (data == 0)
{
- //printf("%d %d\n\r", primitive_type, vertex_first);
+ printf("%d %d\n\r", (int)primitive_type, vertex_first);
for (int n = 0; n < vertex_first; n++)
printf("%d X:%f Y:%f Z:%f W:%f x:%f y:%f\n\r", n, vertex_software[n].attribute[0].fv[0], vertex_software[n].attribute[0].fv[1], vertex_software[n].attribute[0].fv[2], vertex_software[n].attribute[0].fv[3], vertex_xy[n].x, vertex_xy[n].y);
}
diff --git a/src/mame/video/glass.cpp b/src/mame/video/glass.cpp
index a661ce578a2..c301a1527f1 100644
--- a/src/mame/video/glass.cpp
+++ b/src/mame/video/glass.cpp
@@ -33,7 +33,7 @@
1 | xxxxxxxx -------- | not used
*/
-TILE_GET_INFO_MEMBER(glass_state::get_tile_info_glass_screen0)
+TILE_GET_INFO_MEMBER(glass_state::get_tile_info_screen0)
{
int data = m_videoram[tile_index << 1];
int data2 = m_videoram[(tile_index << 1) + 1];
@@ -43,7 +43,7 @@ TILE_GET_INFO_MEMBER(glass_state::get_tile_info_glass_screen0)
}
-TILE_GET_INFO_MEMBER(glass_state::get_tile_info_glass_screen1)
+TILE_GET_INFO_MEMBER(glass_state::get_tile_info_screen1)
{
int data = m_videoram[(0x1000 / 2) + (tile_index << 1)];
int data2 = m_videoram[(0x1000 / 2) + (tile_index << 1) + 1];
@@ -67,7 +67,7 @@ TILE_GET_INFO_MEMBER(glass_state::get_tile_info_glass_screen1)
B2B1B0 selects the picture (there are 8 pictures in each half of the ROM)
*/
-WRITE16_MEMBER(glass_state::glass_blitter_w)
+WRITE16_MEMBER(glass_state::blitter_w)
{
m_blitter_serial_buffer[m_current_bit] = data & 0x01;
m_current_bit++;
@@ -112,7 +112,7 @@ WRITE16_MEMBER(glass_state::glass_blitter_w)
***************************************************************************/
-WRITE16_MEMBER(glass_state::glass_vram_w)
+WRITE16_MEMBER(glass_state::vram_w)
{
COMBINE_DATA(&m_videoram[offset]);
m_pant[offset >> 11]->mark_tile_dirty(((offset << 1) & 0x0fff) >> 2);
@@ -127,8 +127,8 @@ WRITE16_MEMBER(glass_state::glass_vram_w)
void glass_state::video_start()
{
- m_pant[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
- m_pant[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_pant[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
+ m_pant[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_screen_bitmap = std::make_unique<bitmap_ind16>(320, 200);
save_item(NAME(*m_screen_bitmap));
@@ -191,7 +191,7 @@ void glass_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect
****************************************************************************/
-UINT32 glass_state::screen_update_glass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 glass_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* set scroll registers */
m_pant[0]->set_scrolly(0, m_vregs[0]);
diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp
index 1474bd61ec4..ad5d1699e3b 100644
--- a/src/osd/modules/font/font_sdl.cpp
+++ b/src/osd/modules/font/font_sdl.cpp
@@ -10,11 +10,7 @@
#if defined(SDLMAME_UNIX) && (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_SOLARIS)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN))
-#if (SDLMAME_SDL2)
#include <SDL2/SDL_ttf.h>
-#else
-#include <SDL/SDL_ttf.h>
-#endif
#ifndef SDLMAME_HAIKU
#include <fontconfig/fontconfig.h>
#endif
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index b36bbf60df3..7317876eaca 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -15,32 +15,32 @@
const options_entry osd_options::s_option_entries[] =
{
- { NULL, NULL, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
#ifdef SDLMAME_MACOSX
{ OSDOPTION_UIMODEKEY, "DEL", OPTION_STRING, "Key to toggle keyboard mode" },
#else
{ OSDOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "Key to toggle keyboard mode" },
#endif // SDLMAME_MACOSX
- { NULL, NULL, OPTION_HEADER, "OSD FONT OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD FONT OPTIONS" },
{ OSD_FONT_PROVIDER, OSDOPTVAL_AUTO, OPTION_STRING, "provider for ui font: " },
- { NULL, NULL, OPTION_HEADER, "OSD CLI OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD CLI OPTIONS" },
{ OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" },
{ OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", OPTION_COMMAND, "list available network adapters" },
- { NULL, NULL, OPTION_HEADER, "OSD DEBUGGING OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD DEBUGGING OPTIONS" },
{ OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, OPTION_STRING, "debugger used: " },
{ OSDOPTION_DEBUGGER_FONT ";dfont", OSDOPTVAL_AUTO, OPTION_STRING, "specifies the font to use for debugging" },
{ OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", OPTION_FLOAT, "specifies the font size to use for debugging" },
{ OSDOPTION_WATCHDOG ";wdog", "0", OPTION_INTEGER, "force the program to terminate if no updates within specified number of seconds" },
- { NULL, NULL, OPTION_HEADER, "OSD PERFORMANCE OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD PERFORMANCE OPTIONS" },
{ OSDOPTION_MULTITHREADING ";mt", "0", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" },
{ OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, OPTION_STRING, "number of processors; this overrides the number the system reports" },
{ OSDOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" },
- { NULL, NULL, OPTION_HEADER, "OSD VIDEO OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD VIDEO OPTIONS" },
// OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience
{ OSDOPTION_VIDEO, OSDOPTVAL_AUTO, OPTION_STRING, "video output method: " },
{ OSDOPTION_NUMSCREENS "(1-4)", "1", OPTION_INTEGER, "number of screens to create; usually, you want just one" },
@@ -52,7 +52,7 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_SYNCREFRESH ";srf", "0", OPTION_BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" },
// per-window options
- { NULL, NULL, OPTION_HEADER, "OSD PER-WINDOW VIDEO OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD PER-WINDOW VIDEO OPTIONS" },
{ OSDOPTION_SCREEN, OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
{ OSDOPTION_ASPECT ";screen_aspect", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio for all screens; 'auto' here will try to make a best guess" },
{ OSDOPTION_RESOLUTION ";r", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" },
@@ -79,15 +79,15 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_VIEW "3", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the fourth screen" },
// full screen options
- { NULL, NULL, OPTION_HEADER, "OSD FULL SCREEN OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD FULL SCREEN OPTIONS" },
{ OSDOPTION_SWITCHRES, "0", OPTION_BOOLEAN, "enable resolution switching" },
- { NULL, NULL, OPTION_HEADER, "OSD ACCELERATED VIDEO OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD ACCELERATED VIDEO OPTIONS" },
{ OSDOPTION_FILTER ";glfilter;flt", "1", OPTION_BOOLEAN, "enable bilinear filtering on screen output" },
{ OSDOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" },
#if USE_OPENGL
- { NULL, NULL, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" },
{ OSDOPTION_GL_FORCEPOW2TEXTURE, "0", OPTION_BOOLEAN, "force power of two textures (default no)" },
{ OSDOPTION_GL_NOTEXTURERECT, "0", OPTION_BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
{ OSDOPTION_GL_VBO, "1", OPTION_BOOLEAN, "enable OpenGL VBO, if available (default on)" },
@@ -116,12 +116,12 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_SHADER_SCREEN "9", OSDOPTVAL_NONE, OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 9" },
#endif
- { NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "OSD SOUND OPTIONS" },
{ OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " },
{ OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" },
#ifdef SDLMAME_MACOSX
- { NULL, NULL, OPTION_HEADER, "CoreAudio-SPECIFIC OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "CoreAudio-SPECIFIC OPTIONS" },
{ OSDOPTION_AUDIO_OUTPUT, OSDOPTVAL_AUTO, OPTION_STRING, "Audio output device" },
{ OSDOPTION_AUDIO_EFFECT "0", OSDOPTVAL_NONE, OPTION_STRING, "AudioUnit effect 0" },
{ OSDOPTION_AUDIO_EFFECT "1", OSDOPTVAL_NONE, OPTION_STRING, "AudioUnit effect 1" },
@@ -136,7 +136,7 @@ const options_entry osd_options::s_option_entries[] =
#endif
// End of list
- { NULL }
+ { nullptr }
};
osd_options::osd_options()
@@ -151,11 +151,11 @@ osd_options::osd_options()
//-------------------------------------------------
osd_common_t::osd_common_t(osd_options &options)
- : osd_output(), m_machine(NULL),
+ : osd_output(), m_machine(nullptr),
m_options(options),
m_print_verbose(false),
- m_sound(NULL),
- m_debugger(NULL)
+ m_sound(nullptr),
+ m_debugger(nullptr)
{
osd_output::push(this);
}
@@ -240,7 +240,7 @@ void osd_common_t::register_options()
update_option(OSD_DEBUG_PROVIDER, dnames);
// Register video options and update options
- video_options_add("none", NULL);
+ video_options_add("none", nullptr);
video_register();
update_option(OSDOPTION_VIDEO, m_video_names);
}
@@ -426,7 +426,7 @@ void osd_common_t::set_mastervolume(int attenuation)
// while (attenuation++ < 0)
// volume /= 1.122018454; // = (10 ^ (1/20)) = 1dB
//
- if (m_sound != NULL)
+ if (m_sound != nullptr)
m_sound->set_mastervolume(attenuation);
}
@@ -458,7 +458,7 @@ void osd_common_t::customize_input_type_list(simple_list<input_type_entry> &type
osd_font *osd_common_t::font_open(const char *name, int &height)
{
- return NULL;
+ return nullptr;
}
@@ -490,9 +490,10 @@ bool osd_common_t::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_ar
// list of OS-dependent slider values.
//-------------------------------------------------
-void *osd_common_t::get_slider_list()
+slider_state* osd_common_t::get_slider_list()
{
- return NULL;
+ printf("Core get_slider_list\n");
+ return nullptr;
}
//-------------------------------------------------
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h
index a73931f3fa1..d4fba565964 100644
--- a/src/osd/modules/lib/osdobj_common.h
+++ b/src/osd/modules/lib/osdobj_common.h
@@ -187,7 +187,7 @@ public:
virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
// video overridables
- virtual void *get_slider_list() override;
+ virtual slider_state *get_slider_list() override;
// command option overrides
virtual bool execute_command(const char *command) override;
diff --git a/src/osd/modules/opengl/SDL1211_opengl.h b/src/osd/modules/opengl/SDL1211_opengl.h
deleted file mode 100644
index 2a5db6f3199..00000000000
--- a/src/osd/modules/opengl/SDL1211_opengl.h
+++ /dev/null
@@ -1,6553 +0,0 @@
-// license:LGPL-2.1+
-// copyright-holders:Sam Lantinga
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This is a simple file to encapsulate the OpenGL API headers */
-
-//#include <SDL/SDL_config.h>
-
-#ifdef __WIN32__
-#define WIN32_LEAN_AND_MEAN
-#ifndef NOMINMAX
-#define NOMINMAX /* Don't defined min() and max() */
-#endif
-#include <windows.h>
-#endif
-#ifndef NO_SDL_GLEXT
-#define __glext_h_ /* Don't let gl.h include glext.h */
-#endif
-#if defined(__MACOSX__)
-#include <OpenGL/gl.h> /* Header File For The OpenGL Library */
-#include <OpenGL/glu.h> /* Header File For The GLU Library */
-#elif defined(__MACOS__)
-#include <gl.h> /* Header File For The OpenGL Library */
-#include <glu.h> /* Header File For The GLU Library */
-#else
-#include <GL/gl.h> /* Header File For The OpenGL Library */
-#include <GL/glu.h> /* Header File For The GLU Library */
-#endif
-#ifndef NO_SDL_GLEXT
-#undef __glext_h_
-#endif
-
-/* This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.
- It is included here because glext.h is not available on some systems.
- If you don't want this version included, simply define "NO_SDL_GLEXT"
- */
-#ifndef NO_SDL_GLEXT
-#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY)
-#define __glext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/*************************************************************/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated 2005/06/20 */
-/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
-#define GL_GLEXT_VERSION 29
-
-#ifndef GL_VERSION_1_2
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#endif
-
-#ifndef GL_ARB_imaging
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_MULTISAMPLE_BIT 0x20000000
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL 0x8500
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_DEPTH_TEXTURE_MODE 0x884B
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_COMPARE_R_TO_TEXTURE 0x884E
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
-#define GL_FOG_COORD GL_FOG_COORDINATE
-#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
-#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
-#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
-#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
-#define GL_SRC0_RGB GL_SOURCE0_RGB
-#define GL_SRC1_RGB GL_SOURCE1_RGB
-#define GL_SRC2_RGB GL_SOURCE2_RGB
-#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
-#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
-#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_POINT_SPRITE 0x8861
-#define GL_COORD_REPLACE 0x8862
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_COORDS 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-#endif
-
-#ifndef GL_ARB_window_pos
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_HALF_FLOAT_ARB 0x140B
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_ABGR_EXT 0x8000
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_FILTER4_SGIS 0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
-#endif
-
-#ifndef GL_EXT_subtexture
-#endif
-
-#ifndef GL_EXT_copy_texture
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-#define GL_TABLE_TOO_LARGE_EXT 0x8031
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_PIXEL_TEXTURE_SGIS 0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_PIXEL_TEX_GEN_SGIX 0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
-#define GL_TEXTURE_4D_SGIS 0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
-#define GL_TEXTURE_4DSIZE_SGIS 0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS 0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_LINEAR_SHARPEN_SGIS 0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_RESCALE_NORMAL_EXT 0x803A
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_BLEND_EQUATION_EXT 0x8009
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_INTERLACE_SGIX 0x8094
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
-#endif
-
-#ifndef GL_SGIS_texture_select
-#define GL_DUAL_ALPHA4_SGIS 0x8110
-#define GL_DUAL_ALPHA8_SGIS 0x8111
-#define GL_DUAL_ALPHA12_SGIS 0x8112
-#define GL_DUAL_ALPHA16_SGIS 0x8113
-#define GL_DUAL_LUMINANCE4_SGIS 0x8114
-#define GL_DUAL_LUMINANCE8_SGIS 0x8115
-#define GL_DUAL_LUMINANCE12_SGIS 0x8116
-#define GL_DUAL_LUMINANCE16_SGIS 0x8117
-#define GL_DUAL_INTENSITY4_SGIS 0x8118
-#define GL_DUAL_INTENSITY8_SGIS 0x8119
-#define GL_DUAL_INTENSITY12_SGIS 0x811A
-#define GL_DUAL_INTENSITY16_SGIS 0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
-#define GL_QUAD_ALPHA4_SGIS 0x811E
-#define GL_QUAD_ALPHA8_SGIS 0x811F
-#define GL_QUAD_LUMINANCE4_SGIS 0x8120
-#define GL_QUAD_LUMINANCE8_SGIS 0x8121
-#define GL_QUAD_INTENSITY4_SGIS 0x8122
-#define GL_QUAD_INTENSITY8_SGIS 0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SPRITE_SGIX 0x8148
-#define GL_SPRITE_MODE_SGIX 0x8149
-#define GL_SPRITE_AXIS_SGIX 0x814A
-#define GL_SPRITE_TRANSLATION_SGIX 0x814B
-#define GL_SPRITE_AXIAL_SGIX 0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_POINT_SIZE_MIN_SGIS 0x8126
-#define GL_POINT_SIZE_MAX_SGIS 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_FRAMEZOOM_SGIX 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#endif
-
-#ifndef GL_FfdMaskSGIX
-#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
-#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
-#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
-#define GL_DEFORMATIONS_MASK_SGIX 0x8196
-#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_REFERENCE_PLANE_SGIX 0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_FOG_FUNC_SGIS 0x812A
-#define GL_FOG_FUNC_POINTS_SGIS 0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_IMAGE_SCALE_X_HP 0x8155
-#define GL_IMAGE_SCALE_Y_HP 0x8156
-#define GL_IMAGE_TRANSLATE_X_HP 0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
-#define GL_IMAGE_MAG_FILTER_HP 0x815C
-#define GL_IMAGE_MIN_FILTER_HP 0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
-#define GL_CUBIC_HP 0x815F
-#define GL_AVERAGE_HP 0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_IGNORE_BORDER_HP 0x8150
-#define GL_CONSTANT_BORDER_HP 0x8151
-#define GL_REPLICATE_BORDER_HP 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
-#endif
-
-#ifndef GL_INGR_palette_buffer
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
-#endif
-
-#ifndef GL_EXT_color_subtable
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
-#define GL_CLIP_NEAR_HINT_PGI 0x1A220
-#define GL_CLIP_FAR_HINT_PGI 0x1A221
-#define GL_WIDE_LINE_HINT_PGI 0x1A222
-#define GL_BACK_NORMALS_HINT_PGI 0x1A223
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_LIST_PRIORITY_SGIX 0x8182
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_IR_INSTRUMENT1_SGIX 0x817F
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-#endif
-
-#ifndef GL_EXT_index_texture
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_INDEX_MATERIAL_EXT 0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_INDEX_TEST_EXT 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT 0x81B6
-#define GL_INDEX_TEST_REF_EXT 0x81B7
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_IUI_V2F_EXT 0x81AD
-#define GL_IUI_V3F_EXT 0x81AE
-#define GL_IUI_N3F_V2F_EXT 0x81AF
-#define GL_IUI_N3F_V3F_EXT 0x81B0
-#define GL_T2F_IUI_V2F_EXT 0x81B1
-#define GL_T2F_IUI_V3F_EXT 0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_YCRCB_422_SGIX 0x81BB
-#define GL_YCRCB_444_SGIX 0x81BC
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
-#define GL_LIGHT_ENV_MODE_SGIX 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-/* reuse GL_FRAGMENT_DEPTH_EXT */
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-#endif
-
-#ifndef GL_SGIX_impact_pixel_texture
-#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
-#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
-#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
-#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
-#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
-#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
-#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_ASYNC_MARKER_SGIX 0x8329
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-#endif
-
-#ifndef GL_INTEL_texture_scissor
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_FOG_SCALE_SGIX 0x81FC
-#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_RESTART_SUN 0x0001
-#define GL_REPLACE_MIDDLE_SUN 0x0002
-#define GL_REPLACE_OLDEST_SUN 0x0003
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-#endif
-
-#ifndef GL_SUN_vertex
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INTERLACE_READ_INGR 0x8568
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
-#endif
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_WRAP_BORDER_SUN 0x81D4
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW0_EXT GL_MODELVIEW
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-/* reuse GL_TEXTURE0_ARB */
-/* reuse GL_TEXTURE1_ARB */
-/* reuse GL_ZERO */
-/* reuse GL_NONE */
-/* reuse GL_FOG */
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-/* reuse GL_EYE_PLANE */
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-#endif
-
-#ifndef GL_NV_blend_square
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#endif
-
-#ifndef GL_MESA_window_pos
-#endif
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_CULL_VERTEX_IBM 103050
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_YCRCB_SGIX 0x8318
-#define GL_YCRCBA_SGIX 0x8319
-#endif
-
-#ifndef GL_SGI_depth_pass_instrument
-#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
-#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
-#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_PACK_RESAMPLE_SGIX 0x842C
-#define GL_UNPACK_RESAMPLE_SGIX 0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
-#endif
-
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SCALEBIAS_HINT_SGIX 0x8322
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
-#endif
-
-#ifndef GL_OML_resample
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_BUMP_ROT_MATRIX_ATI 0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#define GL_DU8DV8_ATI 0x877A
-#define GL_BUMP_ENVMAP_ATI 0x877B
-#define GL_BUMP_TARGET_ATI 0x877C
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_FRAGMENT_SHADER_ATI 0x8920
-#define GL_REG_0_ATI 0x8921
-#define GL_REG_1_ATI 0x8922
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_REG_6_ATI 0x8927
-#define GL_REG_7_ATI 0x8928
-#define GL_REG_8_ATI 0x8929
-#define GL_REG_9_ATI 0x892A
-#define GL_REG_10_ATI 0x892B
-#define GL_REG_11_ATI 0x892C
-#define GL_REG_12_ATI 0x892D
-#define GL_REG_13_ATI 0x892E
-#define GL_REG_14_ATI 0x892F
-#define GL_REG_15_ATI 0x8930
-#define GL_REG_16_ATI 0x8931
-#define GL_REG_17_ATI 0x8932
-#define GL_REG_18_ATI 0x8933
-#define GL_REG_19_ATI 0x8934
-#define GL_REG_20_ATI 0x8935
-#define GL_REG_21_ATI 0x8936
-#define GL_REG_22_ATI 0x8937
-#define GL_REG_23_ATI 0x8938
-#define GL_REG_24_ATI 0x8939
-#define GL_REG_25_ATI 0x893A
-#define GL_REG_26_ATI 0x893B
-#define GL_REG_27_ATI 0x893C
-#define GL_REG_28_ATI 0x893D
-#define GL_REG_29_ATI 0x893E
-#define GL_REG_30_ATI 0x893F
-#define GL_REG_31_ATI 0x8940
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_CON_8_ATI 0x8949
-#define GL_CON_9_ATI 0x894A
-#define GL_CON_10_ATI 0x894B
-#define GL_CON_11_ATI 0x894C
-#define GL_CON_12_ATI 0x894D
-#define GL_CON_13_ATI 0x894E
-#define GL_CON_14_ATI 0x894F
-#define GL_CON_15_ATI 0x8950
-#define GL_CON_16_ATI 0x8951
-#define GL_CON_17_ATI 0x8952
-#define GL_CON_18_ATI 0x8953
-#define GL_CON_19_ATI 0x8954
-#define GL_CON_20_ATI 0x8955
-#define GL_CON_21_ATI 0x8956
-#define GL_CON_22_ATI 0x8957
-#define GL_CON_23_ATI 0x8958
-#define GL_CON_24_ATI 0x8959
-#define GL_CON_25_ATI 0x895A
-#define GL_CON_26_ATI 0x895B
-#define GL_CON_27_ATI 0x895C
-#define GL_CON_28_ATI 0x895D
-#define GL_CON_29_ATI 0x895E
-#define GL_CON_30_ATI 0x895F
-#define GL_CON_31_ATI 0x8960
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#define GL_COMP_BIT_ATI 0x00000002
-#define GL_NEGATE_BIT_ATI 0x00000004
-#define GL_BIAS_BIT_ATI 0x00000008
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_PN_TRIANGLES_ATI 0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_STATIC_ATI 0x8760
-#define GL_DYNAMIC_ATI 0x8761
-#define GL_PRESERVE_ATI 0x8762
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
-#define GL_VERTEX_STREAM0_ATI 0x876C
-#define GL_VERTEX_STREAM1_ATI 0x876D
-#define GL_VERTEX_STREAM2_ATI 0x876E
-#define GL_VERTEX_STREAM3_ATI 0x876F
-#define GL_VERTEX_STREAM4_ATI 0x8770
-#define GL_VERTEX_STREAM5_ATI 0x8771
-#define GL_VERTEX_STREAM6_ATI 0x8772
-#define GL_VERTEX_STREAM7_ATI 0x8773
-#define GL_VERTEX_SOURCE_ATI 0x8774
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SLICE_ACCUM_SUN 0x85CC
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_DEPTH_CLAMP_NV 0x864F
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_ELEMENT_ARRAY_APPLE 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_YCBCR_422_APPLE 0x85B9
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_HALF_FLOAT_NV 0x140B
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-#endif
-
-#ifndef GL_NV_vertex_program2
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
-#define GL_DEPTH_BOUNDS_EXT 0x8891
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_PACK_INVERT_MESA 0x8758
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
-/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
-#endif
-
-#ifndef GL_NV_vertex_program3
-/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#endif
-
-
-/*************************************************************/
-
-#include <stddef.h>
-#ifndef GL_VERSION_2_0
-/* GL type for program/shader text */
-typedef char GLchar; /* native character */
-#endif
-
-#ifndef GL_VERSION_1_5
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_ARB_shader_objects
-/* GL types for handling shader object handles and program/shader text */
-typedef char GLcharARB; /* native character */
-typedef unsigned int GLhandleARB; /* shader object handle */
-#endif
-
-/* GL types for "half" precision (s10e5) float data in host memory */
-#ifndef GL_ARB_half_float_pixel
-typedef unsigned short GLhalfARB;
-#endif
-
-#ifndef GL_NV_half_float
-typedef unsigned short GLhalfNV;
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
-GLAPI void APIENTRY glBlendEquation (GLenum);
-GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
-GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
-GLAPI void APIENTRY glResetHistogram (GLenum);
-GLAPI void APIENTRY glResetMinmax (GLenum);
-GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum);
-GLAPI void APIENTRY glClientActiveTexture (GLenum);
-GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
-GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
-GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
-GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
-GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
-GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
-GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glFogCoordf (GLfloat);
-GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
-GLAPI void APIENTRY glFogCoordd (GLdouble);
-GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
-GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
-GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
-GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
-GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
-GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
-GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
-GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
-GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
-GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
-GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
-GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
-GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
-GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2iv (const GLint *);
-GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
-GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3iv (const GLint *);
-GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint);
-GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
-GLAPI void APIENTRY glEndQuery (GLenum);
-GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
-GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
-GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
-GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
-GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
-GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
-GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
-GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
-GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
-GLAPI void APIENTRY glCompileShader (GLuint);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum);
-GLAPI void APIENTRY glDeleteProgram (GLuint);
-GLAPI void APIENTRY glDeleteShader (GLuint);
-GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
-GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint);
-GLAPI GLboolean APIENTRY glIsShader (GLuint);
-GLAPI void APIENTRY glLinkProgram (GLuint);
-GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
-GLAPI void APIENTRY glUseProgram (GLuint);
-GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
-GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform1i (GLint, GLint);
-GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glValidateProgram (GLuint);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTextureARB (GLenum);
-GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
-GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
-GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
-GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
-GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
-GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
-GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
-GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
-GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
-GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
-GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
-GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
-GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
-GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
-GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexBlendARB (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
-GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
-GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
-GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
-GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-#endif
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
-GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
-GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
-GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
-GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
-GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
-GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
-GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
-GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
-GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
-GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
-GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
-GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
-GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
-GLAPI void APIENTRY glEndQueryARB (GLenum);
-GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
-GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
-GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
-GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
-GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
-GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
-GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
-GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
-GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
-GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
-GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
-GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
-GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
-GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
-GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
-GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
-GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
-GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
-GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
-GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
-GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
-GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
-GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
-GLAPI void APIENTRY glResetHistogramEXT (GLenum);
-GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif
-
-#ifndef GL_EXT_color_matrix
-#define GL_EXT_color_matrix 1
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
-GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
-GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
-GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
-GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
-GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
-GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glArrayElementEXT (GLint);
-GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
-GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
-GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
-GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#endif
-
-#ifndef GL_SGIX_texture_select
-#define GL_SGIX_texture_select 1
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
-GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
-GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
-GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_SGIS_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
-GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
-GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
-GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
-GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_SGIX_polynomial_ffd 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
-GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
-GLAPI void APIENTRY glDeformSGIX (GLbitfield);
-GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#endif
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
-GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
-GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
-GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#endif
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
-GLAPI void APIENTRY glUnlockArraysEXT (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
-GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
-GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
-GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
-GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glApplyTextureEXT (GLenum);
-GLAPI void APIENTRY glTextureLightEXT (GLenum);
-GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
-GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
-GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
-GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
-GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
-GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
-typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
-typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
-GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
-GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
-GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
-GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
-GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
-GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
-GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
-GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
-GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
-GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
-GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
-GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
-GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
-GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
-GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
-GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
-GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_SGIX_fog_scale 1
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFinishTextureSUNX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
-GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
-GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
-GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
-GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
-GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
-GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
-GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
-GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
-GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
-GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
-GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
-GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
-GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_blend_func_separate
-#define GL_INGR_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
-GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
-GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
-GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
-GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
-GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
-GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
-GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#endif
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glResizeBuffersMESA (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
-#endif
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
-GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
-GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
-GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
-GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-
-#ifndef GL_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-#endif
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
-GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
-GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glFinishFenceNV (GLuint);
-GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
-GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
-GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
-GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
-GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
-GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
-GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
-GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
-GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
-GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-#endif
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
-GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
-GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
-GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
-GLAPI void APIENTRY glBeginFragmentShaderATI (void);
-GLAPI void APIENTRY glEndFragmentShaderATI (void);
-GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
-GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
-GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
-GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
-GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
-GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
-GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
-GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
-typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVertexShaderEXT (void);
-GLAPI void APIENTRY glEndVertexShaderEXT (void);
-GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
-GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
-GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
-GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
-GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
-GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
-GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
-GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
-GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
-GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
-GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
-GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
-GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
-GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
-GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
-typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
-typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
-typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
-typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
-typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
-typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
-GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
-GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
-GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
-GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
-GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
-GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
-GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
-GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
-GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
-GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
-GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
-GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
-GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
-GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
-GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
-GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
-GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
-GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
-typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
-GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
-GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_ATI_pixel_format_float 1
-/* This is really a WGL extension, but defines some associated GL enums.
- * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
- */
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
-GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
-GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
-GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
-GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
-GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
-GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
-typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
-typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
-GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-#endif
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
-GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-#endif
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
-GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
-GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
-GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
-GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
-GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-#endif /* NO_SDL_GLEXT */
diff --git a/src/osd/modules/opengl/osd_opengl.h b/src/osd/modules/opengl/osd_opengl.h
index 5e843543f46..26f577f343e 100644
--- a/src/osd/modules/opengl/osd_opengl.h
+++ b/src/osd/modules/opengl/osd_opengl.h
@@ -20,7 +20,11 @@
#ifdef OSD_WINDOWS
#ifdef _MSC_VER
#include <windows.h>
- #include "SDL1211_opengl.h"
+ #include "GL/GL.h"
+ #include "bgfx/3rdparty/khronos/gl/glext.h "
+ #ifndef USE_DISPATCH_GL
+ #include "bgfx/3rdparty/khronos/wgl/wglext.h"
+ #endif
#else
#include "GL/gl.h"
#include "GL/glext.h"
@@ -29,28 +33,14 @@
#endif
#endif
#else
- #if (SDLMAME_SDL2)
#include <SDL2/SDL_version.h>
- #else
- #include <SDL/SDL_version.h>
- #endif
#if (SDL_VERSION_ATLEAST(1,2,10))
#if defined(SDLMAME_WIN32)
// Avoid that winnt.h (included via sdl_opengl.h, windows.h, windef.h includes intrin.h
#define __INTRIN_H_
#endif
- #if (SDLMAME_SDL2)
#include <SDL2/SDL_opengl.h>
- #else
- #include <SDL/SDL_opengl.h>
- #endif
- #else
- /*
- * SDL 1.2.9 does not provide everything we need
- * We therefore distribute it ourselves
- */
- #include "SDL1211_opengl.h"
#endif
#endif
diff --git a/src/osd/modules/osdwindow.cpp b/src/osd/modules/osdwindow.cpp
new file mode 100644
index 00000000000..29b77cd52e5
--- /dev/null
+++ b/src/osd/modules/osdwindow.cpp
@@ -0,0 +1,63 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont, Couriersud
+//============================================================
+//
+// osdwindow.cpp - SDL window handling
+//
+//============================================================
+
+// standard windows headers
+#ifdef OSD_WINDOWS
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <windowsx.h>
+#include <mmsystem.h>
+#endif
+
+#include "osdwindow.h"
+
+#include "render/drawnone.h"
+#include "render/drawbgfx.h"
+#if (USE_OPENGL)
+#include "render/drawogl.h"
+#endif
+#ifdef OSD_WINDOWS
+#include "render/drawgdi.h"
+#include "render/drawd3d.h"
+#else
+#include "render/draw13.h"
+#include "render/drawsdl.h"
+#endif
+
+osd_renderer* osd_renderer::make_for_type(int mode, osd_window* window, int extra_flags)
+{
+ switch(mode)
+ {
+#ifdef OSD_WINDOWS
+ case VIDEO_MODE_NONE:
+ return new renderer_none(window);
+#endif
+ case VIDEO_MODE_BGFX:
+ return new renderer_bgfx(window);
+#if (USE_OPENGL)
+ case VIDEO_MODE_OPENGL:
+ return new renderer_ogl(window);
+#endif
+#ifdef OSD_WINDOWS
+ case VIDEO_MODE_GDI:
+ return new renderer_gdi(window);
+ case VIDEO_MODE_D3D:
+ {
+ osd_renderer *renderer = new renderer_d3d9(window);
+ return renderer;
+ }
+#else
+ case VIDEO_MODE_SDL2ACCEL:
+ return new renderer_sdl2(window, extra_flags);
+ case VIDEO_MODE_SOFT:
+ return new renderer_sdl1(window, extra_flags);
+#endif
+ default:
+ return nullptr;
+ }
+} \ No newline at end of file
diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h
index 3145a784c42..5d9d7977968 100644
--- a/src/osd/modules/osdwindow.h
+++ b/src/osd/modules/osdwindow.h
@@ -9,13 +9,130 @@
#ifndef __OSDWINDOW__
#define __OSDWINDOW__
-#include "video.h"
-#include "render.h"
+#include "emu.h"
+#include "ui/ui.h"
+
+#ifdef OSD_SDL
+// standard SDL headers
+#include "sdlinc.h"
+#endif
//============================================================
// TYPE DEFINITIONS
//============================================================
+class osd_options;
+class render_primitive_list;
+
+enum
+{
+ VIDEO_MODE_NONE = 0,
+ VIDEO_MODE_GDI,
+ VIDEO_MODE_BGFX,
+#if (USE_OPENGL)
+ VIDEO_MODE_OPENGL,
+#endif
+ VIDEO_MODE_SDL2ACCEL,
+ VIDEO_MODE_D3D,
+ VIDEO_MODE_SOFT,
+
+ VIDEO_MODE_COUNT
+};
+
+class osd_dim
+{
+public:
+ osd_dim(const int &w, const int &h)
+ : m_w(w), m_h(h)
+ {
+ }
+ int width() const { return m_w; }
+ int height() const { return m_h; }
+
+ bool operator!=(const osd_dim &other) { return (m_w != other.width()) || (m_h != other.height()); }
+ bool operator==(const osd_dim &other) { return (m_w == other.width()) && (m_h == other.height()); }
+private:
+ int m_w;
+ int m_h;
+};
+
+class osd_rect
+{
+public:
+ osd_rect()
+ : m_x(0), m_y(0), m_d(0,0)
+ {
+ }
+ osd_rect(const int x, const int y, const int &w, const int &h)
+ : m_x(x), m_y(y), m_d(w,h)
+ {
+ }
+ osd_rect(const int x, const int y, const osd_dim &d)
+ : m_x(x), m_y(y), m_d(d)
+ {
+ }
+ int top() const { return m_y; }
+ int left() const { return m_x; }
+ int width() const { return m_d.width(); }
+ int height() const { return m_d.height(); }
+
+ osd_dim dim() const { return m_d; }
+
+ int bottom() const { return m_y + m_d.height(); }
+ int right() const { return m_x + m_d.width(); }
+
+ osd_rect move_by(int dx, int dy) const { return osd_rect(m_x + dx, m_y + dy, m_d); }
+ osd_rect resize(int w, int h) const { return osd_rect(m_x, m_y, w, h); }
+
+private:
+ int m_x;
+ int m_y;
+ osd_dim m_d;
+};
+
+class osd_monitor_info
+{
+public:
+ osd_monitor_info(void *handle, const char *monitor_device, float aspect)
+ : m_next(NULL), m_handle(handle), m_aspect(aspect)
+ {
+ strncpy(m_name, monitor_device, ARRAY_LENGTH(m_name) - 1);
+ }
+
+ virtual ~osd_monitor_info() { }
+
+ virtual void refresh() = 0;
+
+ const void *oshandle() { return m_handle; }
+
+ const osd_rect &position_size() { return m_pos_size; }
+ const osd_rect &usuable_position_size() { return m_usuable_pos_size; }
+
+ const char *devicename() { return m_name[0] ? m_name : "UNKNOWN"; }
+
+ float aspect();
+
+ void set_aspect(const float a) { m_aspect = a; }
+ bool is_primary() { return m_is_primary; }
+
+ osd_monitor_info * next() { return m_next; } // pointer to next monitor in list
+
+ static osd_monitor_info *pick_monitor(osd_options &options, int index);
+ static osd_monitor_info *list;
+
+ // FIXME: should be private!
+ osd_monitor_info *m_next; // pointer to next monitor in list
+protected:
+ osd_rect m_pos_size;
+ osd_rect m_usuable_pos_size;
+ bool m_is_primary;
+ char m_name[64];
+private:
+
+ void * m_handle; // handle to the monitor
+ float m_aspect; // computed/configured aspect ratio of the physical device
+};
+
class osd_window_config
{
public:
@@ -33,8 +150,7 @@ class osd_window
public:
osd_window()
:
-#ifdef OSD_SDL
-#else
+#ifndef OSD_SDL
m_hwnd(0), m_dc(0), m_focus_hwnd(0), m_resize_state(0),
#endif
m_primlist(nullptr),
@@ -57,12 +173,8 @@ public:
#ifdef OSD_SDL
virtual osd_dim blit_surface_size() = 0;
virtual osd_monitor_info *monitor() const = 0;
-#if (SDLMAME_SDL2)
virtual SDL_Window *sdl_window() = 0;
#else
- virtual SDL_Surface *sdl_surface() = 0;
-#endif
-#else
virtual osd_monitor_info *monitor() const = 0;
virtual bool win_has_menu() = 0;
// FIXME: cann we replace winwindow_video_window_monitor(NULL) with monitor() ?
@@ -100,7 +212,7 @@ public:
static const int FLAG_NEEDS_ASYNCBLIT = 0x0200;
osd_renderer(osd_window *window, const int flags)
- : m_window(window), m_flags(flags) { }
+ : m_sliders_dirty(false), m_window(window), m_flags(flags) { }
virtual ~osd_renderer() { }
@@ -116,25 +228,24 @@ public:
virtual int create() = 0;
virtual render_primitive_list *get_primitives() = 0;
+ virtual slider_state* get_slider_list() { return nullptr; }
virtual int draw(const int update) = 0;
-#ifdef OSD_SDL
- virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0;
-#else
- virtual void save() = 0;
- virtual void record() = 0;
- virtual void toggle_fsfx() = 0;
-#endif
+ virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) { return 0; };
+ virtual void save() { };
+ virtual void record() { };
+ virtual void toggle_fsfx() { };
+ virtual bool sliders_dirty() { return m_sliders_dirty; }
- virtual void destroy() = 0;
+ static osd_renderer* make_for_type(int mode, osd_window *window, int extra_flags = FLAG_NONE);
protected:
/* Internal flags */
static const int FI_CHANGED = 0x010000;
+ bool m_sliders_dirty;
private:
-
- osd_window *m_window;
- int m_flags;
+ osd_window *m_window;
+ int m_flags;
};
diff --git a/src/osd/modules/render/bgfx/blendreader.cpp b/src/osd/modules/render/bgfx/blendreader.cpp
new file mode 100644
index 00000000000..45020a08027
--- /dev/null
+++ b/src/osd/modules/render/bgfx/blendreader.cpp
@@ -0,0 +1,51 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// blendreader.cpp - BGFX blend state JSON reader
+//
+//============================================================
+
+#include <bgfx/bgfx.h>
+
+#include "blendreader.h"
+
+const blend_reader::string_to_enum blend_reader::EQUATION_NAMES[blend_reader::EQUATION_COUNT] = {
+ { "add", BGFX_STATE_BLEND_EQUATION_ADD },
+ { "sub", BGFX_STATE_BLEND_EQUATION_SUB },
+ { "subtract", BGFX_STATE_BLEND_EQUATION_SUB },
+ { "revSub", BGFX_STATE_BLEND_EQUATION_REVSUB },
+ { "revSubtract", BGFX_STATE_BLEND_EQUATION_REVSUB },
+ { "min", BGFX_STATE_BLEND_EQUATION_MIN },
+ { "max", BGFX_STATE_BLEND_EQUATION_MAX }
+};
+
+const blend_reader::string_to_enum blend_reader::FUNCTION_NAMES[blend_reader::FUNCTION_COUNT] = {
+ { "0", BGFX_STATE_BLEND_ZERO },
+ { "zero", BGFX_STATE_BLEND_ZERO },
+ { "1", BGFX_STATE_BLEND_ONE },
+ { "one", BGFX_STATE_BLEND_ONE },
+ { "srcColor", BGFX_STATE_BLEND_SRC_COLOR },
+ { "1-srcColor", BGFX_STATE_BLEND_INV_SRC_COLOR },
+ { "invSrcColor", BGFX_STATE_BLEND_INV_SRC_COLOR },
+ { "dstColor", BGFX_STATE_BLEND_DST_COLOR },
+ { "1-dstColor", BGFX_STATE_BLEND_INV_DST_COLOR },
+ { "invDstColor", BGFX_STATE_BLEND_INV_DST_COLOR },
+ { "srcAlpha", BGFX_STATE_BLEND_SRC_ALPHA },
+ { "1-srcAlpha", BGFX_STATE_BLEND_INV_SRC_ALPHA },
+ { "invSrcAlpha", BGFX_STATE_BLEND_INV_SRC_ALPHA },
+ { "dstAlpha", BGFX_STATE_BLEND_DST_ALPHA },
+ { "1-dstAlpha", BGFX_STATE_BLEND_INV_DST_ALPHA },
+ { "invDstAlpha", BGFX_STATE_BLEND_INV_DST_ALPHA }
+};
+
+uint64_t blend_reader::read_from_value(const Value& value)
+{
+ uint64_t equation = get_enum_from_value(value, "equation", BGFX_STATE_BLEND_EQUATION_ADD, EQUATION_NAMES, EQUATION_COUNT);
+ uint64_t srccolor = get_enum_from_value(value, "srcColor", BGFX_STATE_BLEND_ONE, FUNCTION_NAMES, FUNCTION_COUNT);
+ uint64_t dstcolor = get_enum_from_value(value, "dstColor", BGFX_STATE_BLEND_ZERO, FUNCTION_NAMES, FUNCTION_COUNT);
+ uint64_t srcalpha = get_enum_from_value(value, "srcAlpha", BGFX_STATE_BLEND_ONE, FUNCTION_NAMES, FUNCTION_COUNT);
+ uint64_t dstalpha = get_enum_from_value(value, "dstAlpha", BGFX_STATE_BLEND_ZERO, FUNCTION_NAMES, FUNCTION_COUNT);
+
+ return BGFX_STATE_BLEND_EQUATION(equation) | BGFX_STATE_BLEND_FUNC_SEPARATE(srccolor, dstcolor, srcalpha, dstalpha);
+}
diff --git a/src/osd/modules/render/bgfx/blendreader.h b/src/osd/modules/render/bgfx/blendreader.h
new file mode 100644
index 00000000000..6dd16ae5d88
--- /dev/null
+++ b/src/osd/modules/render/bgfx/blendreader.h
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// blendreader.h - BGFX blend state JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_BLEND_READER__
+#define __DRAWBGFX_BLEND_READER__
+
+#include <bgfx/bgfx.h>
+
+#include "statereader.h"
+
+using namespace rapidjson;
+
+class blend_reader : public state_reader {
+public:
+ static uint64_t read_from_value(const Value& value);
+
+private:
+ static const int EQUATION_COUNT = 7;
+ static const string_to_enum EQUATION_NAMES[EQUATION_COUNT];
+ static const int FUNCTION_COUNT = 16;
+ static const string_to_enum FUNCTION_NAMES[FUNCTION_COUNT];
+};
+
+#endif // __DRAWBGFX_BLEND_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/chain.cpp b/src/osd/modules/render/bgfx/chain.cpp
new file mode 100644
index 00000000000..271695b56a1
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chain.cpp
@@ -0,0 +1,33 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chain.cpp - BGFX screen-space post-effect chain
+//
+//============================================================
+
+#include "slider.h"
+#include "parameter.h"
+#include "chainentry.h"
+
+#include "chain.h"
+
+bgfx_chain::bgfx_chain(std::string name, std::string author, std::vector<bgfx_slider*> sliders, std::vector<bgfx_parameter*> params, std::vector<bgfx_chain_entry*> entries)
+ : m_name(name)
+ , m_author(author)
+ , m_sliders(sliders)
+ , m_params(params)
+ , m_entries(entries)
+{
+}
+
+bgfx_chain::~bgfx_chain()
+{
+}
+
+void bgfx_chain::submit(render_primitive* prim, int view)
+{
+ //for (bgfx_chain_entry* entry : m_entries)
+ //{
+ //}
+}
diff --git a/src/osd/modules/render/bgfx/chain.h b/src/osd/modules/render/bgfx/chain.h
new file mode 100644
index 00000000000..c34b1830681
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chain.h
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chain.h - BGFX screen-space post-effect chain
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_CHAIN__
+#define __DRAWBGFX_CHAIN__
+
+#include <string>
+#include <vector>
+
+class bgfx_slider;
+class bgfx_parameter;
+class bgfx_chain_entry;
+class render_primitive;
+
+class bgfx_chain
+{
+public:
+ bgfx_chain(std::string name, std::string author, std::vector<bgfx_slider*> sliders, std::vector<bgfx_parameter*> params, std::vector<bgfx_chain_entry*> entries);
+ ~bgfx_chain();
+
+ void submit(render_primitive* prim, int view);
+
+private:
+ std::string m_name;
+ std::string m_author;
+ std::vector<bgfx_slider*> m_sliders;
+ std::vector<bgfx_parameter*> m_params;
+ std::vector<bgfx_chain_entry*> m_entries;
+};
+
+#endif // __DRAWBGFX_CHAIN__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp
new file mode 100644
index 00000000000..c0b8845cdd3
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainentry.cpp
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainentry.cpp - BGFX shader post-processing node
+//
+// Represents a single entry in a list of post-processing
+// passes to be applied to a screen quad or buffer.
+//
+//============================================================
+
+#include "emu.h"
+
+#include <bgfx/bgfx.h>
+
+#include "effect.h"
+#include "texture.h"
+#include "target.h"
+#include "chainentry.h"
+
+bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_input_pair>& inputs, bgfx_target* output)
+ : m_name(name)
+ , m_effect(effect)
+ , m_output(output)
+{
+ for (bgfx_input_pair input : inputs)
+ {
+ m_inputs.push_back(input);
+ }
+}
+
+bgfx_chain_entry::~bgfx_chain_entry()
+{
+}
+
+void bgfx_chain_entry::submit(render_primitive* prim, int view)
+{
+ for (bgfx_input_pair input : m_inputs)
+ {
+ input.bind(m_effect);
+ }
+ bgfx::setViewFrameBuffer(view, m_output->target());
+ m_effect->submit(view);
+}
diff --git a/src/osd/modules/render/bgfx/chainentry.h b/src/osd/modules/render/bgfx/chainentry.h
new file mode 100644
index 00000000000..d607dd4ec7d
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainentry.h
@@ -0,0 +1,45 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainentry.h - BGFX shader post-processing node
+//
+// Represents a single entry in a list of post-processing
+// passes to be applied to a screen quad or buffer.
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_CHAIN_ENTRY__
+#define __DRAWBGFX_CHAIN_ENTRY__
+
+#include <string>
+#include <vector>
+
+#include "inputpair.h"
+
+class render_primitive;
+class bgfx_effect;
+class bgfx_texture;
+class bgfx_target;
+
+class bgfx_chain_entry
+{
+public:
+ bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_input_pair>& inputs, bgfx_target* output);
+ ~bgfx_chain_entry();
+
+ void submit(render_primitive* prim, int view);
+
+ // Getters
+ std::string name() const { return m_name; }
+
+private:
+ std::string m_name;
+ bgfx_effect* m_effect;
+ std::vector<bgfx_input_pair> m_inputs;
+ bgfx_target* m_output;
+};
+
+#endif // __DRAWBGFX_CHAIN_ENTRY__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/chainentryreader.cpp b/src/osd/modules/render/bgfx/chainentryreader.cpp
new file mode 100644
index 00000000000..39338359e81
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainentryreader.cpp
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainentryreader.cpp - BGFX chain entry JSON reader
+//
+//============================================================
+
+#include <string>
+
+#include "emu.h"
+
+#include "chainentryreader.h"
+
+#include "texturemanager.h"
+#include "targetmanager.h"
+#include "effectmanager.h"
+#include "chainentry.h"
+#include "inputpair.h"
+
+bgfx_chain_entry* chain_entry_reader::read_from_value(const Value& value, texture_manager& textures, target_manager& targets, effect_manager& effects)
+{
+ validate_parameters(value);
+
+ bgfx_effect* effect = effects.effect(value["effect"].GetString());
+
+ std::vector<bgfx_input_pair> inputs;
+ if (value.HasMember("input"))
+ {
+ const Value& input_array = value["input"];
+ for (UINT32 i = 0; i < input_array.Size(); i++)
+ {
+ std::string sampler = input_array[i]["sampler"].GetString();
+ std::string texture = input_array[i]["texture"].GetString();
+ inputs.push_back(bgfx_input_pair(i, sampler, textures.texture(texture)));
+ }
+ }
+
+ bgfx_target* output = targets.target(value["output"].GetString());
+
+ return new bgfx_chain_entry(value["name"].GetString(), effect, inputs, output);
+}
+
+void chain_entry_reader::validate_parameters(const Value& value)
+{
+ assert(value.HasMember("effect"));
+ assert(value["effect"].IsString());
+ if (value.HasMember("name"))
+ {
+ assert(value["name"].IsString());
+ }
+ assert(value.HasMember("shader"));
+ assert(value["shader"].IsString());
+ assert(value.HasMember("output"));
+ assert(value["output"].IsString());
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/chainentryreader.h b/src/osd/modules/render/bgfx/chainentryreader.h
new file mode 100644
index 00000000000..8aeb1b402de
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainentryreader.h
@@ -0,0 +1,30 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainentryreader.h - BGFX chain entry JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_CHAIN_ENTRY_READER__
+#define __DRAWBGFX_CHAIN_ENTRY_READER__
+
+#include "statereader.h"
+
+class bgfx_chain_entry;
+class texture_manager;
+class target_manager;
+class effect_manager;
+
+class chain_entry_reader : public state_reader
+{
+public:
+ static bgfx_chain_entry* read_from_value(const Value& value, texture_manager& textures, target_manager& targets, effect_manager& effects);
+
+private:
+ static void validate_parameters(const Value& value);
+};
+
+#endif // __DRAWBGFX_CHAIN_ENTRY_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/chainreader.cpp b/src/osd/modules/render/bgfx/chainreader.cpp
new file mode 100644
index 00000000000..8a69e007872
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainreader.cpp
@@ -0,0 +1,95 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainreader.cpp - BGFX chain JSON reader
+//
+//============================================================
+
+#include <string>
+#include <vector>
+
+#include "emu.h"
+
+#include "chain.h"
+#include "sliderreader.h"
+#include "paramreader.h"
+#include "chainentryreader.h"
+#include "targetmanager.h"
+#include "chainreader.h"
+
+bgfx_chain* chain_reader::read_from_value(const Value& value, texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t screen_width, uint32_t screen_height)
+{
+ validate_parameters(value);
+
+ std::string name = value["name"].GetString();
+ std::string author = value["author"].GetString();
+
+ std::vector<bgfx_slider*> sliders;
+ if (value.HasMember("sliders"))
+ {
+ const Value& slider_array = value["sliders"];
+ for (UINT32 i = 0; i < slider_array.Size(); i++)
+ {
+ sliders.push_back(slider_reader::read_from_value(slider_array[i]));
+ }
+ }
+
+ std::vector<bgfx_parameter*> parameters;
+ if (value.HasMember("parameters"))
+ {
+ const Value& param_array = value["parameters"];
+ for (UINT32 i = 0; i < param_array.Size(); i++)
+ {
+ parameters.push_back(parameter_reader::read_from_value(param_array[i]));
+ }
+ }
+
+ std::vector<bgfx_chain_entry*> entries;
+ if (value.HasMember("passes"))
+ {
+ const Value& entry_array = value["passes"];
+ for (UINT32 i = 0; i < entry_array.Size(); i++)
+ {
+ entries.push_back(chain_entry_reader::read_from_value(entry_array[i], textures, targets, effects));
+ }
+ }
+
+ if (value.HasMember("targets"))
+ {
+ const Value& target_array = value["targets"];
+ for (UINT32 i = 0; i < target_array.Size(); i++)
+ {
+ assert(target_array[i].HasMember("name"));
+ assert(target_array[i]["name"].IsString());
+ uint32_t width = 0;
+ uint32_t height = 0;
+ if (target_array[i].HasMember("screen") && target_array[i]["screen"].IsBool())
+ {
+ width = screen_width;
+ height = screen_height;
+ }
+ else
+ {
+ assert(target_array[i].HasMember("width"));
+ assert(target_array[i]["width"].IsDouble());
+ assert(target_array[i].HasMember("height"));
+ assert(target_array[i]["height"].IsDouble());
+ width = uint32_t(target_array[i]["width"].GetDouble());
+ height = uint32_t(target_array[i]["height"].GetDouble());
+ }
+ targets.create_target(target_array[i]["name"].GetString(), bgfx::TextureFormat::RGBA8, width, height);
+ }
+ }
+
+ return new bgfx_chain(name, author, sliders, parameters, entries);
+}
+
+void chain_reader::validate_parameters(const Value& value)
+{
+ assert(value.HasMember("name"));
+ assert(value["name"].IsString());
+ assert(value.HasMember("author"));
+ assert(value["author"].IsString());
+ assert(value.HasMember("passes"));
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/chainreader.h b/src/osd/modules/render/bgfx/chainreader.h
new file mode 100644
index 00000000000..6e803516189
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainreader.h
@@ -0,0 +1,30 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainreader.h - BGFX chain JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_CHAIN_READER__
+#define __DRAWBGFX_CHAIN_READER__
+
+#include "statereader.h"
+
+class bgfx_chain;
+class texture_manager;
+class target_manager;
+class effect_manager;
+
+class chain_reader : public state_reader
+{
+public:
+ static bgfx_chain* read_from_value(const Value& value, texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t screen_width, uint32_t screen_height);
+
+private:
+ static void validate_parameters(const Value& value);
+};
+
+#endif // __DRAWBGFX_CHAIN_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/cullreader.cpp b/src/osd/modules/render/bgfx/cullreader.cpp
new file mode 100644
index 00000000000..0890d731583
--- /dev/null
+++ b/src/osd/modules/render/bgfx/cullreader.cpp
@@ -0,0 +1,22 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// cullreader.cpp - BGFX cull state JSON reader
+//
+//============================================================
+
+#include <bgfx/bgfx.h>
+
+#include "cullreader.h"
+
+const cull_reader::string_to_enum cull_reader::MODE_NAMES[cull_reader::MODE_COUNT] = {
+ { "none", 0 },
+ { "cw", BGFX_STATE_CULL_CW },
+ { "ccw", BGFX_STATE_CULL_CCW }
+};
+
+uint64_t cull_reader::read_from_value(const Value& value)
+{
+ return get_enum_from_value(value, "mode", BGFX_STATE_CULL_CCW, MODE_NAMES, MODE_COUNT);
+}
diff --git a/src/osd/modules/render/bgfx/cullreader.h b/src/osd/modules/render/bgfx/cullreader.h
new file mode 100644
index 00000000000..432ed494cf2
--- /dev/null
+++ b/src/osd/modules/render/bgfx/cullreader.h
@@ -0,0 +1,25 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// cullreader.h - BGFX cull state JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_CULL_READER__
+#define __DRAWBGFX_CULL_READER__
+
+#include "statereader.h"
+
+class cull_reader : public state_reader {
+public:
+ static uint64_t read_from_value(const Value& value);
+
+private:
+ static const int MODE_COUNT = 3;
+ static const string_to_enum MODE_NAMES[MODE_COUNT];
+};
+
+#endif // __DRAWBGFX_CULL_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/depthreader.cpp b/src/osd/modules/render/bgfx/depthreader.cpp
new file mode 100644
index 00000000000..077137159fe
--- /dev/null
+++ b/src/osd/modules/render/bgfx/depthreader.cpp
@@ -0,0 +1,36 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// depthreader.cpp - BGFX depth state JSON reader
+//
+//============================================================
+
+#include <bgfx/bgfx.h>
+
+#include "depthreader.h"
+
+const depth_reader::string_to_enum depth_reader::FUNCTION_NAMES[depth_reader::FUNCTION_COUNT] = {
+ { "never", BGFX_STATE_DEPTH_TEST_NEVER },
+ { "less", BGFX_STATE_DEPTH_TEST_LESS },
+ { "equal", BGFX_STATE_DEPTH_TEST_EQUAL },
+ { "lequal", BGFX_STATE_DEPTH_TEST_LEQUAL },
+ { "greater", BGFX_STATE_DEPTH_TEST_GREATER },
+ { "notequal", BGFX_STATE_DEPTH_TEST_NOTEQUAL },
+ { "gequal", BGFX_STATE_DEPTH_TEST_GEQUAL },
+ { "always", BGFX_STATE_DEPTH_TEST_ALWAYS }
+};
+
+uint64_t depth_reader::read_from_value(const Value& value)
+{
+ uint64_t write_enable = 0;
+ if (value.HasMember("writeEnable"))
+ {
+ assert(value["writeEnable"].IsBool());
+ write_enable = value["writeEnable"].GetBool() ? BGFX_STATE_DEPTH_WRITE: 0;
+ }
+
+ uint64_t function = get_enum_from_value(value, "function", BGFX_STATE_DEPTH_TEST_ALWAYS, FUNCTION_NAMES, FUNCTION_COUNT);
+
+ return write_enable | function;
+}
diff --git a/src/osd/modules/render/bgfx/depthreader.h b/src/osd/modules/render/bgfx/depthreader.h
new file mode 100644
index 00000000000..5b2fc4e374c
--- /dev/null
+++ b/src/osd/modules/render/bgfx/depthreader.h
@@ -0,0 +1,25 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// depthreader.h - BGFX depth state JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_DEPTH_READER__
+#define __DRAWBGFX_DEPTH_READER__
+
+#include "statereader.h"
+
+class depth_reader : public state_reader {
+public:
+ static uint64_t read_from_value(const Value& value);
+
+private:
+ static const int FUNCTION_COUNT = 8;
+ static const string_to_enum FUNCTION_NAMES[FUNCTION_COUNT];
+};
+
+#endif // __DRAWBGFX_DEPTH_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/effect.cpp b/src/osd/modules/render/bgfx/effect.cpp
new file mode 100644
index 00000000000..bf6ccb963c5
--- /dev/null
+++ b/src/osd/modules/render/bgfx/effect.cpp
@@ -0,0 +1,52 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// effect.cpp - BGFX shader material to be applied to a mesh
+//
+//============================================================
+
+#include "effect.h"
+
+bgfx_effect::bgfx_effect(uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx::ShaderHandle fragment_shader, std::vector<bgfx_uniform*> uniforms)
+ : m_state(state)
+{
+ m_program_handle = bgfx::createProgram(vertex_shader, fragment_shader, false);
+
+ for (int i = 0; i < uniforms.size(); i++)
+ {
+ m_uniforms[uniforms[i]->name()] = uniforms[i];
+ }
+}
+
+bgfx_effect::~bgfx_effect()
+{
+ for (std::pair<std::string, bgfx_uniform*> uniform : m_uniforms)
+ {
+ delete uniform.second;
+ }
+ m_uniforms.clear();
+ bgfx::destroyProgram(m_program_handle);
+}
+
+void bgfx_effect::submit(int view)
+{
+ for (std::pair<std::string, bgfx_uniform*> uniform_pair : m_uniforms)
+ {
+ (uniform_pair.second)->upload();
+ }
+ bgfx::setState(m_state);
+ bgfx::submit(view, m_program_handle);
+}
+
+bgfx_uniform* bgfx_effect::uniform(std::string name)
+{
+ std::map<std::string, bgfx_uniform*>::iterator iter = m_uniforms.find(name);
+
+ if (iter != m_uniforms.end())
+ {
+ return iter->second;
+ }
+
+ return nullptr;
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/effect.h b/src/osd/modules/render/bgfx/effect.h
new file mode 100644
index 00000000000..e87f418022e
--- /dev/null
+++ b/src/osd/modules/render/bgfx/effect.h
@@ -0,0 +1,40 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// effect.h - BGFX shader material to be applied to a mesh
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_EFFECT__
+#define __DRAWBGFX_EFFECT__
+
+#include <bgfx/bgfx.h>
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "uniform.h"
+
+class bgfx_effect
+{
+public:
+ bgfx_effect(uint64_t state, bgfx::ShaderHandle vertexShader, bgfx::ShaderHandle fragmentShader, std::vector<bgfx_uniform*> uniforms);
+ ~bgfx_effect();
+
+ void submit(int view);
+
+ // Getters
+ bgfx_uniform* uniform(std::string name);
+ bgfx::ProgramHandle get_program() const { return m_program_handle; }
+
+private:
+ uint64_t m_state;
+ bgfx::ProgramHandle m_program_handle;
+ std::map<std::string, bgfx_uniform*> m_uniforms;
+};
+
+#endif // __DRAWBGFX_EFFECT__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/effectmanager.cpp b/src/osd/modules/render/bgfx/effectmanager.cpp
new file mode 100644
index 00000000000..ea35020ad85
--- /dev/null
+++ b/src/osd/modules/render/bgfx/effectmanager.cpp
@@ -0,0 +1,66 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// effectmanager.cpp - BGFX shader effect manager
+//
+// Maintains a string-to-entry lookup of BGFX shader
+// effects, defined by effect.h and read by effectreader.h
+//
+//============================================================
+
+#include "emu.h"
+
+#include <rapidjson/document.h>
+
+#include <bgfx/bgfxplatform.h>
+#include <bgfx/bgfx.h>
+#include <bx/readerwriter.h>
+
+#include "effectmanager.h"
+#include "effectreader.h"
+#include "effect.h"
+
+using namespace rapidjson;
+
+effect_manager::~effect_manager()
+{
+ for (std::pair<std::string, bgfx_effect*> effect : m_effects)
+ {
+ delete effect.second;
+ }
+ m_effects.clear();
+}
+
+bgfx_effect* effect_manager::effect(std::string name)
+{
+ std::map<std::string, bgfx_effect*>::iterator iter = m_effects.find(name);
+ if (iter != m_effects.end())
+ {
+ return iter->second;
+ }
+
+ return load_effect(name);
+}
+
+bgfx_effect* effect_manager::load_effect(std::string name) {
+ std::string path = "bgfx/effects/" + name + ".json";
+
+ bx::CrtFileReader reader;
+ bx::open(&reader, path.c_str());
+
+ int32_t size = (uint32_t)bx::getSize(&reader);
+
+ char* data = new char[size + 1];
+ bx::read(&reader, reinterpret_cast<void*>(data), size);
+ bx::close(&reader);
+ data[size] = 0;
+
+ Document document;
+ document.Parse<0>(data);
+ bgfx_effect* effect = effect_reader::read_from_value(m_shaders, document);
+
+ m_effects[name] = effect;
+
+ return effect;
+}
diff --git a/src/osd/modules/render/bgfx/effectmanager.h b/src/osd/modules/render/bgfx/effectmanager.h
new file mode 100644
index 00000000000..e86b24669ad
--- /dev/null
+++ b/src/osd/modules/render/bgfx/effectmanager.h
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// effectmanager.h - BGFX shader effect manager
+//
+// Maintains a string-to-entry lookup of BGFX shader
+// effects, defined by effect.h and read by effectreader.h
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_EFFECT_MANAGER__
+#define __DRAWBGFX_EFFECT_MANAGER__
+
+#include <map>
+#include <string>
+
+#include <bgfx/bgfx.h>
+
+#include "shadermanager.h"
+
+class bgfx_effect;
+
+class effect_manager {
+public:
+ effect_manager(shader_manager& shaders) : m_shaders(shaders) { }
+ ~effect_manager();
+
+ // Getters
+ bgfx_effect* effect(std::string name);
+
+private:
+ bgfx_effect* load_effect(std::string name);
+
+ shader_manager& m_shaders;
+ std::map<std::string, bgfx_effect*> m_effects;
+};
+
+#endif // __DRAWBGFX_EFFECT_MANAGER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/effectreader.cpp b/src/osd/modules/render/bgfx/effectreader.cpp
new file mode 100644
index 00000000000..978c004337f
--- /dev/null
+++ b/src/osd/modules/render/bgfx/effectreader.cpp
@@ -0,0 +1,77 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// effectreader.cpp - BGFX effect JSON reader
+//
+//============================================================
+
+#include <string>
+
+#include <bgfx/bgfx.h>
+
+#include "emu.h"
+
+#include "effect.h"
+#include "blendreader.h"
+#include "depthreader.h"
+#include "cullreader.h"
+#include "writereader.h"
+#include "shadermanager.h"
+#include "uniformreader.h"
+
+#include "effectreader.h"
+
+bgfx_effect* effect_reader::read_from_value(shader_manager& shaders, const Value& value)
+{
+ validate_parameters(value);
+
+ uint64_t blend = blend_reader::read_from_value(value["blend"]);
+ uint64_t depth = depth_reader::read_from_value(value["depth"]);
+ uint64_t cull = cull_reader::read_from_value(value["cull"]);
+ uint64_t write = write_reader::read_from_value(value["write"]);
+
+ std::vector<bgfx_uniform*> uniforms;
+ const Value& uniform_array = value["uniforms"];
+ for (UINT32 i = 0; i < uniform_array.Size(); i++)
+ {
+ uniforms.push_back(uniform_reader::read_from_value(uniform_array[i]));
+ }
+
+ std::string vertex_name(value["vertex"].GetString());
+ bgfx::ShaderHandle vertex_shader = shaders.shader(vertex_name);
+
+ std::string fragment_name("");
+ if (value.HasMember("fragment"))
+ {
+ fragment_name = value["fragment"].GetString();
+ }
+ else if (value.HasMember("pixel"))
+ {
+ fragment_name = value["pixel"].GetString();
+ }
+ bgfx::ShaderHandle fragment_shader = shaders.shader(fragment_name);
+
+ return new bgfx_effect(blend | depth | cull | write, vertex_shader, fragment_shader, uniforms);
+}
+
+void effect_reader::validate_parameters(const Value& value)
+{
+ assert(value.HasMember("blend"));
+ assert(value.HasMember("depth"));
+ assert(value.HasMember("cull"));
+ assert(value.HasMember("write"));
+ assert(value.HasMember("vertex"));
+ assert(value["vertex"].IsString());
+ assert(value.HasMember("fragment") || value.HasMember("pixel"));
+ if (value.HasMember("fragment"))
+ {
+ assert(value["fragment"].IsString());
+ }
+ if (value.HasMember("pixel"))
+ {
+ assert(value["pixel"].IsString());
+ }
+ assert(value.HasMember("uniforms"));
+ assert(value["uniforms"].IsArray());
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/effectreader.h b/src/osd/modules/render/bgfx/effectreader.h
new file mode 100644
index 00000000000..cc0c3ea69e5
--- /dev/null
+++ b/src/osd/modules/render/bgfx/effectreader.h
@@ -0,0 +1,28 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// effectreader.h - BGFX effect JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_EFFECT_READER__
+#define __DRAWBGFX_EFFECT_READER__
+
+#include "statereader.h"
+
+class bgfx_effect;
+class shader_manager;
+
+class effect_reader : public state_reader
+{
+public:
+ static bgfx_effect* read_from_value(shader_manager& shaders, const Value& value);
+
+private:
+ static void validate_parameters(const Value& value);
+};
+
+#endif // __DRAWBGFX_EFFECT_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/fs_quad_texture.sc b/src/osd/modules/render/bgfx/fs_gui.sc
index 5a45a056171..28a1438d189 100644
--- a/src/osd/modules/render/bgfx/fs_quad_texture.sc
+++ b/src/osd/modules/render/bgfx/fs_gui.sc
@@ -5,7 +5,7 @@ $input v_color0, v_texcoord0
#include "../../../../../3rdparty/bgfx/examples/common/common.sh"
-SAMPLER2D(s_tex, 0);
+SAMPLER2D(s_tex, 0);
void main()
{
diff --git a/src/osd/modules/render/bgfx/fs_line.sc b/src/osd/modules/render/bgfx/fs_line.sc
deleted file mode 100644
index 1fcd3b27284..00000000000
--- a/src/osd/modules/render/bgfx/fs_line.sc
+++ /dev/null
@@ -1,11 +0,0 @@
-$input v_color0
-
-// license:BSD-3-Clause
-// copyright-holders:Dario Manesku
-
-#include "../../../../../3rdparty/bgfx/examples/common/common.sh"
-
-void main()
-{
- gl_FragColor = v_color0;
-}
diff --git a/src/osd/modules/render/bgfx/fs_quad.sc b/src/osd/modules/render/bgfx/fs_quad.sc
deleted file mode 100644
index 1fcd3b27284..00000000000
--- a/src/osd/modules/render/bgfx/fs_quad.sc
+++ /dev/null
@@ -1,11 +0,0 @@
-$input v_color0
-
-// license:BSD-3-Clause
-// copyright-holders:Dario Manesku
-
-#include "../../../../../3rdparty/bgfx/examples/common/common.sh"
-
-void main()
-{
- gl_FragColor = v_color0;
-}
diff --git a/src/osd/modules/render/bgfx/fs_screen.sc b/src/osd/modules/render/bgfx/fs_screen.sc
new file mode 100644
index 00000000000..59c2916039e
--- /dev/null
+++ b/src/osd/modules/render/bgfx/fs_screen.sc
@@ -0,0 +1,16 @@
+$input v_color0, v_texcoord0
+
+// license:BSD-3-Clause
+// copyright-holders:Dario Manesku
+
+#include "../../../../../3rdparty/bgfx/examples/common/common.sh"
+
+SAMPLER2D(s_tex, 0);
+
+uniform vec4 u_tint;
+
+void main()
+{
+ vec4 texel = texture2D(s_tex, v_texcoord0);
+ gl_FragColor = texel * v_color0 * u_tint;
+}
diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp
new file mode 100644
index 00000000000..bcebb755ab6
--- /dev/null
+++ b/src/osd/modules/render/bgfx/inputpair.cpp
@@ -0,0 +1,26 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// inputpair.h - BGFX sampler-and-texture pair
+//
+// Keeps track of the texture which is bound to the sampler
+// which is bound to the specified stage index.
+//
+//============================================================
+
+#include "inputpair.h"
+#include "texture.h"
+#include "effect.h"
+
+bgfx_input_pair::bgfx_input_pair(int index, std::string sampler, bgfx_texture* texture)
+ : m_index(index)
+ , m_sampler(sampler)
+ , m_texture(texture)
+{
+}
+
+void bgfx_input_pair::bind(bgfx_effect *effect)
+{
+ bgfx::setTexture(m_index, effect->uniform(m_sampler)->handle(), m_texture->handle());
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/inputpair.h b/src/osd/modules/render/bgfx/inputpair.h
new file mode 100644
index 00000000000..2cab7ff2363
--- /dev/null
+++ b/src/osd/modules/render/bgfx/inputpair.h
@@ -0,0 +1,37 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// inputpair.h - BGFX sampler-and-texture pair
+//
+// Keeps track of the texture which is bound to the sampler
+// which is bound to the specified stage index.
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_INPUT_PAIR__
+#define __DRAWBGFX_INPUT_PAIR__
+
+#include <bgfx/bgfx.h>
+
+#include <string>
+
+class bgfx_effect;
+class bgfx_texture;
+
+class bgfx_input_pair
+{
+public:
+ bgfx_input_pair(int index, std::string sampler, bgfx_texture* texture);
+
+ void bind(bgfx_effect *effect);
+
+private:
+ int m_index;
+ std::string m_sampler;
+ bgfx_texture* m_texture;
+};
+
+#endif // __DRAWBGFX_INPUT_PAIR__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/parameter.cpp b/src/osd/modules/render/bgfx/parameter.cpp
new file mode 100644
index 00000000000..004d5fd17f8
--- /dev/null
+++ b/src/osd/modules/render/bgfx/parameter.cpp
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// parameter.cpp - BGFX shader parameter
+//
+// A value that represents some form of parametric
+// operation, which can be fed to the input of a BGFX
+// shader uniform.
+//
+//============================================================
+
+#include "emu.h"
+
+// NB: NOT FINISHED!
+
+#include "parameter.h"
+
+bgfx_parameter::bgfx_parameter(std::string name, parameter_type type, int period)
+ : m_name(name)
+ , m_type(type)
+ , m_period(period)
+ , m_frame(0)
+{
+}
+
+bgfx_parameter::~bgfx_parameter()
+{
+}
+
+void bgfx_parameter::frame()
+{
+ switch(m_type)
+ {
+ case PARAM_FRAME_MASK:
+ m_frame++;
+ if (m_frame == m_period)
+ {
+ m_frame = 0;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+bool bgfx_parameter::active()
+{
+ switch (m_type)
+ {
+ case PARAM_FRAME_MASK:
+ return (m_frame % m_period == 0);
+ default:
+ return false;
+ }
+}
diff --git a/src/osd/modules/render/bgfx/parameter.h b/src/osd/modules/render/bgfx/parameter.h
new file mode 100644
index 00000000000..76defb439c4
--- /dev/null
+++ b/src/osd/modules/render/bgfx/parameter.h
@@ -0,0 +1,43 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// parameter.h - BGFX shader parameter
+//
+// A value that represents some form of parametric
+// operation, which can be fed to the input of a BGFX
+// shader uniform.
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_PARAMETER__
+#define __DRAWBGFX_PARAMETER__
+
+#include <string>
+
+#include "emu.h"
+
+class bgfx_parameter
+{
+public:
+ enum parameter_type
+ {
+ PARAM_FRAME_MASK
+ };
+
+ bgfx_parameter(std::string name, parameter_type type, int period);
+ ~bgfx_parameter();
+
+ void frame();
+ bool active();
+
+private:
+ std::string m_name;
+ parameter_type m_type;
+ UINT32 m_period;
+ UINT32 m_frame;
+};
+
+#endif // __DRAWBGFX_PARAMETER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/paramreader.cpp b/src/osd/modules/render/bgfx/paramreader.cpp
new file mode 100644
index 00000000000..f1391ec761e
--- /dev/null
+++ b/src/osd/modules/render/bgfx/paramreader.cpp
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// paramreader.cpp - BGFX shader parameter JSON reader
+//
+//============================================================
+
+#include <string>
+
+#include "paramreader.h"
+
+#include "parameter.h"
+
+const parameter_reader::string_to_enum parameter_reader::TYPE_NAMES[parameter_reader::TYPE_COUNT] = {
+ { "frame_mask", uint64_t(bgfx_parameter::parameter_type::PARAM_FRAME_MASK) }
+};
+
+bgfx_parameter* parameter_reader::read_from_value(const Value& value)
+{
+ validate_parameters(value);
+
+ std::string name = value["name"].GetString();
+ bgfx_parameter::parameter_type type = bgfx_parameter::parameter_type(get_enum_from_value(value, "type", uint64_t(bgfx_parameter::parameter_type::PARAM_FRAME_MASK), TYPE_NAMES, TYPE_COUNT));
+ int period = int(value["period"].GetDouble());
+
+ return new bgfx_parameter(name, type, period);
+}
+
+void parameter_reader::validate_parameters(const Value& value)
+{
+ assert(value.HasMember("name"));
+ assert(value["name"].IsString());
+ assert(value.HasMember("type"));
+ assert(value["type"].IsString());
+ assert(value.HasMember("period"));
+ assert(value["period"].IsDouble());
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/paramreader.h b/src/osd/modules/render/bgfx/paramreader.h
new file mode 100644
index 00000000000..12df9185dfc
--- /dev/null
+++ b/src/osd/modules/render/bgfx/paramreader.h
@@ -0,0 +1,30 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// paramreader.h - BGFX shader parameter JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_PARAM_READER__
+#define __DRAWBGFX_PARAM_READER__
+
+#include "statereader.h"
+
+class bgfx_parameter;
+
+class parameter_reader : public state_reader
+{
+public:
+ static bgfx_parameter* read_from_value(const Value& value);
+
+private:
+ static void validate_parameters(const Value& value);
+
+ static const int TYPE_COUNT = 1;
+ static const string_to_enum TYPE_NAMES[TYPE_COUNT];
+};
+
+#endif // __DRAWBGFX_PARAM_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/shadermanager.cpp b/src/osd/modules/render/bgfx/shadermanager.cpp
new file mode 100644
index 00000000000..20821721ea8
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shadermanager.cpp
@@ -0,0 +1,84 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// shadermanager.cpp - BGFX shader manager
+//
+// Maintains a mapping between strings and BGFX shaders,
+// either vertex or pixel/fragment.
+//
+//============================================================
+
+#include "emu.h"
+
+#include <bgfx/bgfxplatform.h>
+#include <bgfx/bgfx.h>
+#include <bx/fpumath.h>
+#include <bx/readerwriter.h>
+
+#include "shadermanager.h"
+
+shader_manager::~shader_manager()
+{
+ for (std::pair<std::string, bgfx::ShaderHandle> shader : m_shaders)
+ {
+ bgfx::destroyShader(shader.second);
+ }
+ m_shaders.clear();
+}
+
+bgfx::ShaderHandle shader_manager::shader(std::string name)
+{
+ std::map<std::string, bgfx::ShaderHandle>::iterator iter = m_shaders.find(name);
+ if (iter != m_shaders.end())
+ {
+ return iter->second;
+ }
+
+ return load_shader(name);
+}
+
+bgfx::ShaderHandle shader_manager::load_shader(std::string name) {
+ std::string shader_path = "shaders/dx9/";
+ switch (bgfx::getRendererType())
+ {
+ case bgfx::RendererType::Direct3D11:
+ case bgfx::RendererType::Direct3D12:
+ shader_path = "shaders/dx11/";
+ break;
+
+ case bgfx::RendererType::OpenGL:
+ shader_path = "shaders/glsl/";
+ break;
+
+ case bgfx::RendererType::Metal:
+ shader_path = "shaders/metal/";
+ break;
+
+ case bgfx::RendererType::OpenGLES:
+ shader_path = "shaders/gles/";
+ break;
+
+ default:
+ break;
+ }
+
+ bgfx::ShaderHandle handle = bgfx::createShader(load_mem(shader_path + name + ".bin"));
+
+ m_shaders[name] = handle;
+
+ return handle;
+}
+
+const bgfx::Memory* shader_manager::load_mem(std::string name) {
+ bx::CrtFileReader reader;
+ bx::open(&reader, name.c_str());
+
+ uint32_t size = (uint32_t)bx::getSize(&reader);
+ const bgfx::Memory* mem = bgfx::alloc(size + 1);
+ bx::read(&reader, mem->data, size);
+ bx::close(&reader);
+
+ mem->data[mem->size - 1] = '\0';
+ return mem;
+}
diff --git a/src/osd/modules/render/bgfx/shadermanager.h b/src/osd/modules/render/bgfx/shadermanager.h
new file mode 100644
index 00000000000..a3dbb425088
--- /dev/null
+++ b/src/osd/modules/render/bgfx/shadermanager.h
@@ -0,0 +1,37 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// shadermanager.h - BGFX shader manager
+//
+// Maintains a mapping between strings and BGFX shaders,
+// either vertex or pixel/fragment.
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_SHADER_MANAGER__
+#define __DRAWBGFX_SHADER_MANAGER__
+
+#include <map>
+#include <string>
+
+#include <bgfx/bgfx.h>
+
+class shader_manager {
+public:
+ shader_manager() {}
+ ~shader_manager();
+
+ // Getters
+ bgfx::ShaderHandle shader(std::string name);
+
+private:
+ bgfx::ShaderHandle load_shader(std::string name);
+ static const bgfx::Memory* load_mem(std::string name);
+
+ std::map<std::string, bgfx::ShaderHandle> m_shaders;
+};
+
+#endif // __DRAWBGFX_SHADER_MANAGER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/slider.cpp b/src/osd/modules/render/bgfx/slider.cpp
new file mode 100644
index 00000000000..76f093580bd
--- /dev/null
+++ b/src/osd/modules/render/bgfx/slider.cpp
@@ -0,0 +1,65 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// slider.cpp - BGFX shader parameter slider
+//
+//============================================================
+
+#include "emu.h"
+
+#include "slider.h"
+
+bgfx_slider::bgfx_slider(slider_type type, std::string name, std::string description, void *defaults, void *min, void *max)
+ : m_type(type)
+ , m_name(name)
+ , m_description(description)
+{
+ m_data = global_alloc_array_clear<char>(storage_size(type));
+ m_min = global_alloc_array_clear<char>(storage_size(type));
+ m_max = global_alloc_array_clear<char>(storage_size(type));
+ memcpy(m_data, defaults, size(type));
+ memcpy(m_min, min, size(type));
+ memcpy(m_max, max, size(type));
+}
+
+bgfx_slider::~bgfx_slider()
+{
+ global_free(m_data);
+ global_free(m_min);
+ global_free(m_max);
+}
+
+size_t bgfx_slider::storage_size(slider_type type)
+{
+ switch(type)
+ {
+ case SLIDER_INT:
+ return 1 * sizeof(int);
+ case SLIDER_BOOL:
+ case SLIDER_FLOAT:
+ case SLIDER_COLOR:
+ case SLIDER_VEC2:
+ return 4 * sizeof(float);
+ default:
+ return 0;
+ }
+}
+
+size_t bgfx_slider::size(slider_type type)
+{
+ switch(type)
+ {
+ case SLIDER_INT:
+ return sizeof(int);
+ case SLIDER_BOOL:
+ case SLIDER_FLOAT:
+ return sizeof(float);
+ case SLIDER_COLOR:
+ return sizeof(float) * 3;
+ case SLIDER_VEC2:
+ return sizeof(float) * 2;
+ default:
+ return 0;
+ }
+}
diff --git a/src/osd/modules/render/bgfx/slider.h b/src/osd/modules/render/bgfx/slider.h
new file mode 100644
index 00000000000..6c3054d7cc2
--- /dev/null
+++ b/src/osd/modules/render/bgfx/slider.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// slider.h - BGFX shader parameter slider
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_SLIDER__
+#define __DRAWBGFX_SLIDER__
+
+#include <bgfx/bgfx.h>
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "uniform.h"
+
+class bgfx_slider
+{
+public:
+ enum slider_type
+ {
+ SLIDER_BOOL,
+ SLIDER_FLOAT,
+ SLIDER_INT,
+ SLIDER_COLOR,
+ SLIDER_VEC2
+ };
+
+ bgfx_slider(slider_type type, std::string name, std::string description, void *defaults, void *min, void *max);
+ ~bgfx_slider();
+
+ static size_t size(slider_type type);
+ static size_t storage_size(slider_type type);
+protected:
+
+ slider_type m_type;
+ std::string m_name;
+ std::string m_description;
+ char* m_data;
+ char* m_min;
+ char* m_max;
+};
+
+#endif // __DRAWBGFX_SLIDER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/sliderreader.cpp b/src/osd/modules/render/bgfx/sliderreader.cpp
new file mode 100644
index 00000000000..7bd2d8c59fa
--- /dev/null
+++ b/src/osd/modules/render/bgfx/sliderreader.cpp
@@ -0,0 +1,74 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//==============================================================
+//
+// sliderreader.cpp - BGFX shader parameter slider JSON reader
+//
+//==============================================================
+
+#include "emu.h"
+
+#include "sliderreader.h"
+
+#include "slider.h"
+
+const slider_reader::string_to_enum slider_reader::TYPE_NAMES[slider_reader::TYPE_COUNT] = {
+ { "bool", uint64_t(bgfx_slider::slider_type::SLIDER_BOOL) },
+ { "float", uint64_t(bgfx_slider::slider_type::SLIDER_FLOAT) },
+ { "int", uint64_t(bgfx_slider::slider_type::SLIDER_INT) },
+ { "color", uint64_t(bgfx_slider::slider_type::SLIDER_COLOR) },
+ { "vec2", uint64_t(bgfx_slider::slider_type::SLIDER_VEC2) }
+};
+
+bgfx_slider* slider_reader::read_from_value(const Value& value)
+{
+ validate_parameters(value);
+
+ bgfx_slider::slider_type type = bgfx_slider::slider_type(get_enum_from_value(value, "type", uint64_t(bgfx_slider::slider_type::SLIDER_FLOAT), TYPE_NAMES, TYPE_COUNT));
+ std::string name = value["name"].GetString();
+ std::string description = value["text"].GetString();
+
+ float defaults[4];
+ float min[4];
+ float max[4];
+ get_values(value, "default", defaults);
+ get_values(value, "min", min);
+ get_values(value, "max", max);
+
+ return new bgfx_slider(type, name, description, defaults, min, max);
+}
+
+void slider_reader::get_values(const Value& value, std::string name, float* values)
+{
+ const char* name_str = name.c_str();
+ if (value.HasMember(name_str))
+ {
+ if (value[name_str].IsBool())
+ {
+ values[0] = value[name_str].GetBool() ? 1.0f : 0.0f;
+ }
+ else if (value[name_str].IsDouble())
+ {
+ values[0] = float(value[name_str].GetDouble());
+ }
+ else
+ {
+ const Value& value_array = value[name_str];
+ for (UINT32 i = 0; i < value_array.Size() && i < 4; i++)
+ {
+ values[i] = float(value_array[i].GetDouble());
+ }
+ }
+ }
+}
+
+void slider_reader::validate_parameters(const Value& value)
+{
+ assert(value.HasMember("type"));
+ assert(value["type"].IsString());
+ assert(value.HasMember("name"));
+ assert(value["name"].IsString());
+ assert(value.HasMember("text"));
+ assert(value["text"].IsString());
+ assert(value.HasMember("default"));
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/sliderreader.h b/src/osd/modules/render/bgfx/sliderreader.h
new file mode 100644
index 00000000000..9253b9b9130
--- /dev/null
+++ b/src/osd/modules/render/bgfx/sliderreader.h
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// sliderreader.h - BGFX shader parameter slider JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_SLIDER_READER__
+#define __DRAWBGFX_SLIDER_READER__
+
+#include "statereader.h"
+
+class bgfx_slider;
+
+class slider_reader : public state_reader
+{
+public:
+ static bgfx_slider* read_from_value(const Value& value);
+
+private:
+ static void get_values(const Value& value, std::string name, float* values);
+ static void validate_parameters(const Value& value);
+
+ static const int TYPE_COUNT = 5;
+ static const string_to_enum TYPE_NAMES[TYPE_COUNT];
+};
+
+#endif // __DRAWBGFX_SLIDER_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/statereader.cpp b/src/osd/modules/render/bgfx/statereader.cpp
new file mode 100644
index 00000000000..2f222b19bdf
--- /dev/null
+++ b/src/osd/modules/render/bgfx/statereader.cpp
@@ -0,0 +1,107 @@
+#include "statereader.h"
+
+uint64_t state_reader::get_enum_from_value(const Value& value, std::string name, const uint64_t default_value, const string_to_enum* enums, const int count)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ assert(value[name.c_str()].IsString());
+ return get_param_from_string(value[name.c_str()].GetString(), enums, count);
+ }
+ else
+ {
+ return default_value;
+ }
+}
+
+uint64_t state_reader::get_param_from_string(std::string value, const string_to_enum* enums, const int count)
+{
+ for (int i = 0; i < count; i++)
+ {
+ if (value == enums[i].m_string)
+ {
+ return enums[i].m_enum;
+ }
+ }
+ assert(false);
+ return 0;
+}
+
+void state_reader::validate_array_parameter(const Value& value, std::string typeName, std::string paramName, const int count)
+{
+ const char* name = paramName.c_str();
+ if (value.HasMember(name))
+ {
+ assert(value[name].IsArray());
+ assert(value[name].Size() == count);
+ }
+}
+
+void state_reader::validate_double_parameter(const Value& value, std::string typeName, std::string name)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ assert(value[name.c_str()].IsDouble());
+ }
+}
+
+void state_reader::validate_string_parameter(const Value& value, std::string typeName, std::string name)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ assert(value[name.c_str()].IsString());
+ }
+}
+
+void state_reader::validate_boolean_parameter(const Value& value, std::string typeName, std::string name)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ assert(value[name.c_str()].IsBool());
+ }
+}
+
+bool state_reader::get_bool(const Value& value, const std::string name, const bool default_value)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ return value[name.c_str()].GetBool();
+ }
+ return default_value;
+}
+
+void state_reader::get_float(const Value& value, const std::string name, float* out, float* default_value, int count)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ if (count == 1)
+ {
+ *out = (float) value[name.c_str()].GetDouble();
+ return;
+ }
+ else
+ {
+ get_vec_values(value[name.c_str()], out, count);
+ }
+ }
+ for (int def = 0; def < count; def++)
+ {
+ out[def] = default_value[def];
+ }
+}
+
+void state_reader::get_vec_values(const Value& value_array, float* data, const unsigned int count)
+{
+ for (unsigned int i = 0; i < count && i < value_array.Size(); i++)
+ {
+ data[i] = (float) value_array[i].GetDouble();
+ }
+}
+
+std::string state_reader::get_string(const Value& value, const std::string name, const std::string default_value)
+{
+ if (value.HasMember(name.c_str()))
+ {
+ return std::string(value[name.c_str()].GetString());
+ }
+ return default_value;
+}
diff --git a/src/osd/modules/render/bgfx/statereader.h b/src/osd/modules/render/bgfx/statereader.h
new file mode 100644
index 00000000000..57edea1d28e
--- /dev/null
+++ b/src/osd/modules/render/bgfx/statereader.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#ifndef __DRAWBGFX_STATE_READER__
+#define __DRAWBGFX_STATE_READER__
+
+#include "emu.h"
+
+#include <string>
+#include "rapidjson/document.h"
+
+using namespace rapidjson;
+
+class state_reader
+{
+protected:
+ struct string_to_enum
+ {
+ std::string m_string;
+ const UINT64 m_enum;
+ };
+
+ static void validate_array_parameter(const Value& value, std::string type_name, std::string name, const int count);
+ static void validate_double_parameter(const Value& value, std::string type_name, std::string name);
+ static void validate_string_parameter(const Value& value, std::string type_name, std::string name);
+ static void validate_boolean_parameter(const Value& value, std::string type_name, std::string name);
+
+ static bool get_bool(const Value& value, const std::string name, const bool default_value);
+ static void get_float(const Value& value, const std::string name, float* out, float* default_value, const int count = 1);
+ static std::string get_string(const Value& value, const std::string name, const std::string default_value);
+
+ static uint64_t get_enum_from_value(const Value& value, std::string name, const uint64_t default_value, const string_to_enum* enums, const int count);
+ static uint64_t get_param_from_string(std::string value, const string_to_enum* enums, const int count);
+
+private:
+ static void get_vec_values(const Value& value_array, float* data, const unsigned int count);
+};
+
+#endif // __DRAWBGFX_STATE_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/target.cpp b/src/osd/modules/render/bgfx/target.cpp
new file mode 100644
index 00000000000..b8026060b04
--- /dev/null
+++ b/src/osd/modules/render/bgfx/target.cpp
@@ -0,0 +1,26 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// target.cpp - Render target abstraction for BGFX layer
+//
+//============================================================
+
+#include "target.h"
+
+bgfx_target::bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, bool filter)
+ : bgfx_texture(name, format, width, height, nullptr, BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP | (filter ? 0 : (BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT)))
+{
+ m_target = bgfx::createFrameBuffer(1, &m_handle, false);
+}
+
+bgfx_target::bgfx_target(std::string name, void *handle, uint32_t width, uint32_t height)
+ : bgfx_texture(name, bgfx::TextureFormat::RGBA8, width, height, nullptr, BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP | BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT)
+{
+ m_target = bgfx::createFrameBuffer(handle, width, height);
+}
+
+bgfx_target::~bgfx_target()
+{
+ bgfx::destroyFrameBuffer(m_target);
+}
diff --git a/src/osd/modules/render/bgfx/target.h b/src/osd/modules/render/bgfx/target.h
new file mode 100644
index 00000000000..099288cbec1
--- /dev/null
+++ b/src/osd/modules/render/bgfx/target.h
@@ -0,0 +1,30 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// target.h - Render target abstraction for BGFX layer
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_TARGET__
+#define __DRAWBGFX_TARGET__
+
+#include "texture.h"
+
+class bgfx_target : public bgfx_texture
+{
+public:
+ bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, bool filter = false);
+ bgfx_target(std::string name, void *handle, uint32_t width, uint32_t height);
+ virtual ~bgfx_target();
+
+ // Getters
+ bgfx::FrameBufferHandle target() const { return m_target; }
+
+private:
+ bgfx::FrameBufferHandle m_target;
+};
+
+#endif // __DRAWBGFX_TARGET__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp
new file mode 100644
index 00000000000..88bf6a9d96f
--- /dev/null
+++ b/src/osd/modules/render/bgfx/targetmanager.cpp
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// targetmanager.cpp - BGFX render target manager
+//
+// Maintains a string-to-entry mapping for any registered
+// render targets.
+//
+//============================================================
+
+#include <bgfx/bgfx.h>
+
+#include "targetmanager.h"
+#include "target.h"
+
+target_manager::~target_manager()
+{
+ for (std::pair<std::string, bgfx_target*> target : m_targets)
+ {
+ delete target.second;
+ }
+ m_targets.clear();
+}
+
+bgfx_target* target_manager::create_target(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, bool filter)
+{
+ printf("Creating %s\n", name.c_str());
+ bgfx_target* target = new bgfx_target(name, format, width, height, filter);
+ m_targets[name] = target;
+
+ m_textures.add_texture(name, target);
+ return target;
+}
+
+bgfx_target* target_manager::create_target(std::string name, void *handle, uint32_t width, uint32_t height)
+{
+ printf("Creating %s\n", name.c_str());
+ bgfx_target* target = new bgfx_target(name, handle, width, height);
+ m_targets[name] = target;
+
+ m_textures.add_texture(name, target);
+ return target;
+}
+
+bgfx_target* target_manager::target(std::string name)
+{
+ std::map<std::string, bgfx_target*>::iterator iter = m_targets.find(name);
+ if (iter != m_targets.end())
+ {
+ return iter->second;
+ }
+
+ return nullptr;
+}
diff --git a/src/osd/modules/render/bgfx/targetmanager.h b/src/osd/modules/render/bgfx/targetmanager.h
new file mode 100644
index 00000000000..9cc957d1c38
--- /dev/null
+++ b/src/osd/modules/render/bgfx/targetmanager.h
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// targetmanager.h - BGFX render target manager
+//
+// Maintains a string-to-entry mapping for any registered
+// render targets.
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_TARGET_MANAGER__
+#define __DRAWBGFX_TARGET_MANAGER__
+
+#include <map>
+#include <string>
+
+#include <bgfx/bgfx.h>
+
+#include "texturemanager.h"
+
+class bgfx_target;
+
+class target_manager {
+public:
+ target_manager(texture_manager& textures) : m_textures(textures) { }
+ ~target_manager();
+
+ bgfx_target* create_target(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, bool filter = false);
+ bgfx_target* create_target(std::string name, void *handle, uint32_t width, uint32_t height);
+
+ // Getters
+ bgfx_target* target(std::string name);
+
+private:
+ bgfx_target* create_target(std::string name);
+
+ std::map<std::string, bgfx_target*> m_targets;
+ texture_manager& m_textures;
+};
+
+#endif // __DRAWBGFX_TARGET_MANAGER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/texture.cpp b/src/osd/modules/render/bgfx/texture.cpp
new file mode 100644
index 00000000000..c588fa63b20
--- /dev/null
+++ b/src/osd/modules/render/bgfx/texture.cpp
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// texture.cpp - Texture abstraction for BGFX layer
+//
+//============================================================
+
+#include "emu.h"
+
+#include "texture.h"
+
+bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags)
+ : m_name(name)
+ , m_format(format)
+ , m_width(width)
+ , m_height(height)
+{
+ bgfx::TextureInfo info;
+ bgfx::calcTextureSize(info, width, height, 1, false, 1, format);
+ if (data != nullptr)
+ {
+ m_handle = bgfx::createTexture2D(width, height, 1, format, flags, bgfx::copy(data, info.storageSize));
+ }
+ else
+ {
+ m_handle = bgfx::createTexture2D(width, height, 1, format, flags);
+
+ const bgfx::Memory* memory = bgfx::alloc(info.storageSize);
+ memset(memory->data, 0, info.storageSize);
+ bgfx::updateTexture2D(m_handle, 0, 0, 0, width, height, memory, info.storageSize / height);
+ }
+}
+
+bgfx_texture::~bgfx_texture()
+{
+ bgfx::destroyTexture(m_handle);
+}
diff --git a/src/osd/modules/render/bgfx/texture.h b/src/osd/modules/render/bgfx/texture.h
new file mode 100644
index 00000000000..833ab230917
--- /dev/null
+++ b/src/osd/modules/render/bgfx/texture.h
@@ -0,0 +1,39 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// texture.h - Texture abstraction for BGFX layer
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_TEXTURE__
+#define __DRAWBGFX_TEXTURE__
+
+#include <bgfx/bgfx.h>
+
+#include <string>
+
+class bgfx_texture
+{
+public:
+ bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data = nullptr, uint32_t flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP);
+ virtual ~bgfx_texture();
+
+ // Getters
+ std::string name() const { return m_name; }
+ bgfx::TextureFormat::Enum format() const { return m_format; }
+ uint32_t width() const { return m_width; }
+ uint32_t height() const { return m_height; }
+ bgfx::TextureHandle handle() const { return m_handle; }
+
+protected:
+ std::string m_name;
+ bgfx::TextureFormat::Enum m_format;
+ uint32_t m_width;
+ uint32_t m_height;
+ bgfx::TextureHandle m_handle;
+};
+
+#endif // __DRAWBGFX_TEXTURE__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp
new file mode 100644
index 00000000000..bb8f49494da
--- /dev/null
+++ b/src/osd/modules/render/bgfx/texturemanager.cpp
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// texturemanager.cpp - BGFX texture manager
+//
+// Maintains a string-to-entry mapping for any registered
+// textures.
+//
+//============================================================
+
+#include <bgfx/bgfx.h>
+
+#include "texturemanager.h"
+#include "texture.h"
+
+texture_manager::~texture_manager()
+{
+ for (std::pair<std::string, bgfx_texture*> texture : m_textures)
+ {
+ delete texture.second;
+ }
+ m_textures.clear();
+}
+
+void texture_manager::add_texture(std::string name, bgfx_texture* texture)
+{
+ m_textures[name] = texture;
+}
+
+bgfx_texture* texture_manager::create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags)
+{
+ bgfx_texture* texture = new bgfx_texture(name, format, width, height, data, flags);
+ m_textures[name] = texture;
+ return texture;
+}
+
+bgfx_texture* texture_manager::texture(std::string name)
+{
+ std::map<std::string, bgfx_texture*>::iterator iter = m_textures.find(name);
+ if (iter != m_textures.end())
+ {
+ return iter->second;
+ }
+
+ return nullptr;
+}
diff --git a/src/osd/modules/render/bgfx/texturemanager.h b/src/osd/modules/render/bgfx/texturemanager.h
new file mode 100644
index 00000000000..627e6689fa9
--- /dev/null
+++ b/src/osd/modules/render/bgfx/texturemanager.h
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// texturemanager.h - BGFX texture manager
+//
+// Maintains a string-to-entry mapping for any registered
+// textures.
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_TEXTURE_MANAGER__
+#define __DRAWBGFX_TEXTURE_MANAGER__
+
+#include <map>
+#include <string>
+
+#include <bgfx/bgfx.h>
+
+class bgfx_texture;
+
+class texture_manager {
+public:
+ texture_manager() { }
+ ~texture_manager();
+
+ bgfx_texture* create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data = nullptr, uint32_t flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP);
+ void add_texture(std::string name, bgfx_texture* texture);
+
+ // Getters
+ bgfx_texture* texture(std::string name);
+
+private:
+ bgfx_texture* create_texture(std::string name);
+
+ std::map<std::string, bgfx_texture*> m_textures;
+};
+
+#endif // __DRAWBGFX_TEXTURE_MANAGER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/uniform.cpp b/src/osd/modules/render/bgfx/uniform.cpp
new file mode 100644
index 00000000000..bfc00d800e1
--- /dev/null
+++ b/src/osd/modules/render/bgfx/uniform.cpp
@@ -0,0 +1,81 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// uniform.cpp - Shader uniform abstraction for BGFX layer
+//
+//============================================================
+
+#include "uniform.h"
+#include <cstring>
+
+bgfx_uniform::bgfx_uniform(std::string name, bgfx::UniformType::Enum type)
+ : m_name(name)
+ , m_type(type)
+{
+ m_handle = bgfx::createUniform(m_name.c_str(), m_type);
+ m_data_size = get_size_for_type(type);
+ if (m_data_size > 0)
+ {
+ m_data = new uint8_t[m_data_size];
+ }
+}
+
+bgfx_uniform::~bgfx_uniform()
+{
+ bgfx::destroyUniform(m_handle);
+ delete [] m_data;
+}
+
+void bgfx_uniform::upload()
+{
+ bgfx::setUniform(m_handle, m_data);
+}
+
+bgfx_uniform* bgfx_uniform::set(float* value)
+{
+ return set(value, get_size_for_type(bgfx::UniformType::Vec4));
+}
+
+bgfx_uniform* bgfx_uniform::set_int(int value)
+{
+ return set(&value, get_size_for_type(bgfx::UniformType::Int1));
+}
+
+bgfx_uniform* bgfx_uniform::set_mat3(float* value)
+{
+ return set(value, get_size_for_type(bgfx::UniformType::Mat3));
+}
+
+bgfx_uniform* bgfx_uniform::set_mat4(float* value)
+{
+ return set(value, get_size_for_type(bgfx::UniformType::Mat4));
+}
+
+bgfx_uniform* bgfx_uniform::set(void* data, size_t size)
+{
+ int min_size = (size < m_data_size) ? size : m_data_size;
+ memcpy(m_data, data, min_size);
+ return this;
+}
+
+size_t bgfx_uniform::get_size_for_type(bgfx::UniformType::Enum type)
+{
+ switch (type)
+ {
+ case bgfx::UniformType::Vec4:
+ return sizeof(float) * 4;
+
+ case bgfx::UniformType::Int1:
+ return sizeof(int);
+
+ case bgfx::UniformType::Mat3:
+ return sizeof(float) * 3 * 3;
+
+ case bgfx::UniformType::Mat4:
+ return sizeof(float) * 4 * 4;
+
+ default:
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/uniform.h b/src/osd/modules/render/bgfx/uniform.h
new file mode 100644
index 00000000000..6bb45f50d06
--- /dev/null
+++ b/src/osd/modules/render/bgfx/uniform.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// uniform.h - Shader uniform abstraction for BGFX layer
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_UNIFORM__
+#define __DRAWBGFX_UNIFORM__
+
+#include <bgfx/bgfx.h>
+
+#include <string>
+
+class bgfx_uniform
+{
+public:
+ bgfx_uniform(std::string name, bgfx::UniformType::Enum type);
+ virtual ~bgfx_uniform();
+
+ virtual void upload();
+
+ // Getters
+ std::string name() { return m_name; }
+ bgfx::UniformType::Enum type() const { return m_type; }
+ bgfx::UniformHandle handle() const { return m_handle; }
+
+ // Setters
+ bgfx_uniform* set(float* value);
+ bgfx_uniform* set_int(int value);
+ bgfx_uniform* set_mat3(float* value);
+ bgfx_uniform* set_mat4(float* value);
+ bgfx_uniform* set(void* data, size_t size);
+
+ static size_t get_size_for_type(bgfx::UniformType::Enum type);
+
+protected:
+ bgfx::UniformHandle m_handle;
+ std::string m_name;
+ bgfx::UniformType::Enum m_type;
+ uint8_t* m_data;
+ size_t m_data_size;
+};
+
+#endif // __DRAWBGFX_UNIFORM__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/uniformreader.cpp b/src/osd/modules/render/bgfx/uniformreader.cpp
new file mode 100644
index 00000000000..863c20e6e4f
--- /dev/null
+++ b/src/osd/modules/render/bgfx/uniformreader.cpp
@@ -0,0 +1,53 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// uniformreader.cpp - BGFX shader uniform JSON reader
+//
+//============================================================
+
+#include "uniformreader.h"
+#include "uniform.h"
+
+const uniform_reader::string_to_enum uniform_reader::TYPE_NAMES[uniform_reader::TYPE_COUNT] = {
+ { "int", bgfx::UniformType::Int1 },
+ { "vec4", bgfx::UniformType::Vec4 },
+ { "mat3", bgfx::UniformType::Mat3 },
+ { "mat4", bgfx::UniformType::Mat4 },
+ { "camera", bgfx::UniformType::Mat4 }
+};
+
+bgfx_uniform* uniform_reader::read_from_value(const Value& value)
+{
+ assert(value.HasMember("name"));
+ assert(value["name"].IsString());
+ const char* name = value["name"].GetString();
+
+ assert(value.HasMember("type"));
+ bgfx::UniformType::Enum type = bgfx::UniformType::Enum(get_enum_from_value(value, "type", bgfx::UniformType::Vec4, TYPE_NAMES, TYPE_COUNT));
+ const size_t type_size = bgfx_uniform::get_size_for_type(type);
+
+ assert(value.HasMember("values"));
+ assert(value["values"].IsArray());
+ const Value& value_array = value["values"];
+ const size_t array_size = value_array.Size() * sizeof(float);
+
+ const size_t alloc_size = (type_size > array_size) ? type_size : array_size;
+ float* data = reinterpret_cast<float*>(new char[alloc_size]);
+
+ unsigned int index = 0;
+ for (; index < type_size / 4 && index < value_array.Size(); index++)
+ {
+ data[index] = (float)value_array[index].GetDouble();
+ }
+
+ for (; index < type_size / 4; index++) {
+ data[index] = 0.0f;
+ }
+
+ bgfx_uniform* uniform = new bgfx_uniform(name, type);
+ uniform->set((void*)data, type_size);
+ delete [] data;
+
+ return uniform;
+}
diff --git a/src/osd/modules/render/bgfx/uniformreader.h b/src/osd/modules/render/bgfx/uniformreader.h
new file mode 100644
index 00000000000..ead4bb0cefe
--- /dev/null
+++ b/src/osd/modules/render/bgfx/uniformreader.h
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// uniformreader.h - BGFX shader uniform JSON reader
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWBGFX_UNIFORM_READER__
+#define __DRAWBGFX_UNIFORM_READER__
+
+#include <bgfx/bgfx.h>
+
+#include "statereader.h"
+
+class bgfx_uniform;
+
+enum uniform_type
+{
+ TYPE_INT1 = bgfx::UniformType::Int1,
+ TYPE_VEC4 = bgfx::UniformType::Vec4,
+ TYPE_MAT3 = bgfx::UniformType::Mat3,
+ TYPE_MAT4 = bgfx::UniformType::Mat4,
+ TYPE_CAMERA, // Alias for the current ortho camera, used to auto-bind on material load
+
+ TYPE_COUNT = 5
+};
+
+class uniform_reader : public state_reader
+{
+public:
+ static bgfx_uniform* read_from_value(const Value& value);
+
+private:
+ static const int TYPE_COUNT = uniform_type::TYPE_COUNT;
+ static const string_to_enum TYPE_NAMES[TYPE_COUNT];
+};
+
+#endif // __DRAWBGFX_UNIFORM_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/vs_quad_texture.sc b/src/osd/modules/render/bgfx/vs_gui.sc
index c3699f6fbd9..c3699f6fbd9 100644
--- a/src/osd/modules/render/bgfx/vs_quad_texture.sc
+++ b/src/osd/modules/render/bgfx/vs_gui.sc
diff --git a/src/osd/modules/render/bgfx/vs_quad.sc b/src/osd/modules/render/bgfx/vs_quad.sc
deleted file mode 100644
index 84e23c5a09b..00000000000
--- a/src/osd/modules/render/bgfx/vs_quad.sc
+++ /dev/null
@@ -1,13 +0,0 @@
-$input a_position, a_color0
-$output v_color0
-
-// license:BSD-3-Clause
-// copyright-holders:Dario Manesku
-
-#include "../../../../../3rdparty/bgfx/examples/common/common.sh"
-
-void main()
-{
- gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
- v_color0 = a_color0;
-}
diff --git a/src/osd/modules/render/bgfx/vs_line.sc b/src/osd/modules/render/bgfx/vs_screen.sc
index 874ffcf46ac..c3699f6fbd9 100644
--- a/src/osd/modules/render/bgfx/vs_line.sc
+++ b/src/osd/modules/render/bgfx/vs_screen.sc
@@ -1,5 +1,5 @@
-$input a_position, a_color0
-$output v_color0
+$input a_position, a_texcoord0, a_color0
+$output v_texcoord0, v_color0
// license:BSD-3-Clause
// copyright-holders:Dario Manesku
@@ -9,5 +9,6 @@ $output v_color0
void main()
{
gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0));
+ v_texcoord0 = a_texcoord0;
v_color0 = a_color0;
}
diff --git a/src/osd/modules/render/bgfx/writereader.cpp b/src/osd/modules/render/bgfx/writereader.cpp
new file mode 100644
index 00000000000..b10220908c8
--- /dev/null
+++ b/src/osd/modules/render/bgfx/writereader.cpp
@@ -0,0 +1,24 @@
+#include <bgfx/bgfx.h>
+
+#include "writereader.h"
+
+const write_reader::string_to_enum write_reader::RGB_NAMES[write_reader::RGB_COUNT] = {
+ { "true", BGFX_STATE_RGB_WRITE },
+ { "false", 0 },
+ { "1", BGFX_STATE_RGB_WRITE },
+ { "0", 0 }
+};
+
+const write_reader::string_to_enum write_reader::ALPHA_NAMES[write_reader::ALPHA_COUNT] = {
+ { "true", BGFX_STATE_ALPHA_WRITE },
+ { "false", 0 },
+ { "1", BGFX_STATE_ALPHA_WRITE },
+ { "0", 0 }
+};
+
+uint64_t write_reader::read_from_value(const Value& value)
+{
+ uint64_t rgb = get_enum_from_value(value, "rgb", 0, RGB_NAMES, RGB_COUNT);
+ uint64_t alpha = get_enum_from_value(value, "alpha", 0, ALPHA_NAMES, ALPHA_COUNT);
+ return rgb | alpha;
+}
diff --git a/src/osd/modules/render/bgfx/writereader.h b/src/osd/modules/render/bgfx/writereader.h
new file mode 100644
index 00000000000..854505bc9cf
--- /dev/null
+++ b/src/osd/modules/render/bgfx/writereader.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#ifndef __DRAWBGFX_WRITE_READER__
+#define __DRAWBGFX_WRITE_READER__
+
+#include "statereader.h"
+
+class write_reader : public state_reader {
+public:
+ static uint64_t read_from_value(const Value& value);
+
+private:
+ static const int RGB_COUNT = 4;
+ static const int ALPHA_COUNT = 4;
+ static const string_to_enum RGB_NAMES[RGB_COUNT];
+ static const string_to_enum ALPHA_NAMES[ALPHA_COUNT];
+};
+
+#endif // __DRAWBGFX_WRITE_READER__ \ No newline at end of file
diff --git a/src/osd/modules/render/binpacker.cpp b/src/osd/modules/render/binpacker.cpp
new file mode 100644
index 00000000000..2054dfa54cf
--- /dev/null
+++ b/src/osd/modules/render/binpacker.cpp
@@ -0,0 +1,195 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// binpacker.cpp - Simple texture packer for dynamic atlasing
+//
+//============================================================
+
+#include "binpacker.h"
+#include <algorithm>
+
+bool rectangle_packer::pack(const std::vector<packable_rectangle>& rects, std::vector<std::vector<packed_rectangle>>& packs, int pack_size)
+{
+ clear();
+
+ m_pack_size = pack_size;
+
+ // Add rects to member array, and check to make sure none is too big
+ for (size_t rect = 0; rect < rects.size(); rect++)
+ {
+ m_rects.push_back(rectangle(0, 0, rects[rect].width(), rects[rect].height(), rects[rect].hash(), rects[rect].format(), rects[rect].rowpixels(), rects[rect].palette(), rects[rect].base()));
+ }
+
+ // Sort from greatest to least area
+ std::sort(m_rects.rbegin(), m_rects.rend());
+
+ // Pack
+ while (m_num_packed < (int)m_rects.size())
+ {
+ int i = m_packs.size();
+ m_packs.push_back(rectangle(m_pack_size));
+ m_roots.push_back(i);
+ if (!fill(i))
+ {
+ return false;
+ }
+ }
+
+ // Write out
+ packs.resize(m_roots.size());
+ for (size_t i = 0; i < m_roots.size(); ++i)
+ {
+ packs[i].clear();
+ add_pack_to_array(m_roots[i], packs[i]);
+ }
+
+ return true;
+}
+
+void rectangle_packer::clear()
+{
+ m_pack_size = 0;
+ m_num_packed = 0;
+ m_rects.clear();
+ m_packs.clear();
+ m_roots.clear();
+}
+
+bool rectangle_packer::fill(int pack)
+{
+ // For each rect
+ for (size_t rect = 0; rect < m_rects.size(); ++rect)
+ {
+ // If it's not already packed
+ if (!m_rects[rect].packed)
+ {
+ // If it fits in the current working area
+ if (fits(m_rects[rect], m_packs[pack]))
+ {
+ // Store in lower-left of working area, split, and recurse
+ m_num_packed++;
+ split(pack, rect);
+ fill(m_packs[pack].children[0]);
+ fill(m_packs[pack].children[1]);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+void rectangle_packer::split(int pack, int rect)
+{
+ // Split the working area either horizontally or vertically with respect
+ // to the rect we're storing, such that we get the largest possible child
+ // area.
+
+ rectangle left = m_packs[pack];
+ rectangle right = m_packs[pack];
+ rectangle bottom = m_packs[pack];
+ rectangle top = m_packs[pack];
+
+ left.y += m_rects[rect].h;
+ left.w = m_rects[rect].w;
+ left.h -= m_rects[rect].h;
+
+ right.x += m_rects[rect].w;
+ right.w -= m_rects[rect].w;
+
+ bottom.x += m_rects[rect].w;
+ bottom.h = m_rects[rect].h;
+ bottom.w -= m_rects[rect].w;
+
+ top.y += m_rects[rect].h;
+ top.h -= m_rects[rect].h;
+
+ int max_lr_area = left.get_area();
+ if (right.get_area() > max_lr_area)
+ {
+ max_lr_area = right.get_area();
+ }
+
+ int max_bt_area = bottom.get_area();
+ if (top.get_area() > max_bt_area)
+ {
+ max_bt_area = top.get_area();
+ }
+
+ if (max_lr_area > max_bt_area)
+ {
+ if (left.get_area() > right.get_area())
+ {
+ m_packs.push_back(left);
+ m_packs.push_back(right);
+ }
+ else
+ {
+ m_packs.push_back(right);
+ m_packs.push_back(left);
+ }
+ }
+ else
+ {
+ if (bottom.get_area() > top.get_area())
+ {
+ m_packs.push_back(bottom);
+ m_packs.push_back(top);
+ }
+ else
+ {
+ m_packs.push_back(top);
+ m_packs.push_back(bottom);
+ }
+ }
+
+ // This pack area now represents the rect we've just stored, so save the
+ // relevant info to it, and assign children.
+ m_packs[pack].w = m_rects[rect].w;
+ m_packs[pack].h = m_rects[rect].h;
+ m_packs[pack].hash = m_rects[rect].hash;
+ m_packs[pack].format = m_rects[rect].format;
+ m_packs[pack].rowpixels = m_rects[rect].rowpixels;
+ m_packs[pack].palette = m_rects[rect].palette;
+ m_packs[pack].base = m_rects[rect].base;
+ m_packs[pack].children[0] = m_packs.size() - 2;
+ m_packs[pack].children[1] = m_packs.size() - 1;
+
+ // Done with the rect
+ m_rects[rect].packed = true;
+
+}
+
+bool rectangle_packer::fits(rectangle& rect1, const rectangle& rect2)
+{
+ // Check to see if rect1 fits in rect2
+
+ if (rect1.w <= rect2.w && rect1.h <= rect2.h)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+void rectangle_packer::add_pack_to_array(int pack, std::vector<packed_rectangle>& array) const
+{
+ if (m_packs[pack].hash != 0)
+ {
+ array.push_back(packed_rectangle(m_packs[pack].hash, m_packs[pack].format,
+ m_packs[pack].w, m_packs[pack].h, m_packs[pack].x, m_packs[pack].y,
+ m_packs[pack].rowpixels, m_packs[pack].palette, m_packs[pack].base));
+
+ if (m_packs[pack].children[0] != -1)
+ {
+ add_pack_to_array(m_packs[pack].children[0], array);
+ }
+
+ if (m_packs[pack].children[1] != -1)
+ {
+ add_pack_to_array(m_packs[pack].children[1], array);
+ }
+ }
+}
diff --git a/src/osd/modules/render/binpacker.h b/src/osd/modules/render/binpacker.h
new file mode 100644
index 00000000000..677083b5c09
--- /dev/null
+++ b/src/osd/modules/render/binpacker.h
@@ -0,0 +1,183 @@
+#pragma once
+
+#ifndef __RECTPACKER_H__
+#define __RECTPACKER_H__
+
+#include "emu.h"
+
+#include <vector>
+
+class rectangle_packer
+{
+public:
+ // The input and output are in terms of vectors of ints to avoid
+ // dependencies (although I suppose a public member struct could have been
+ // used). The parameters are:
+
+ // packs : After packing, the outer array contains the packs (therefore
+ // the number of packs is packs.size()). Each inner array contains a
+ // sequence of sets of 3 ints. Each set represents a rectangle in the
+ // pack. The elements in the set are 1) the rect ID, 2) the x position
+ // of the rect with respect to the pack, and 3) the y position of the rect
+ // with respect to the pack. The widths and heights of the rects are not
+ // included, as it's assumed they are stored on the caller's side (they
+ // were after all the input to the function).
+
+ class packable_rectangle
+ {
+ public:
+ packable_rectangle() : m_hash(0), m_width(-1), m_height(-1) { }
+ packable_rectangle(UINT32 hash, UINT32 format, int width, int height, int rowpixels, const rgb_t *palette, void *base)
+ : m_hash(hash)
+ , m_format(format)
+ , m_width(width)
+ , m_height(height)
+ , m_rowpixels(rowpixels)
+ , m_palette(palette)
+ , m_base(base)
+ {
+ }
+
+ UINT32 hash() const { return m_hash; }
+ UINT32 format() const { return m_format; }
+ int width() const { return m_width; }
+ int height() const { return m_height; }
+ int rowpixels() const { return m_rowpixels; }
+ const rgb_t* palette() const { return m_palette; }
+ void* base() const { return m_base; }
+
+ private:
+ UINT32 m_hash;
+ UINT32 m_format;
+ int m_width;
+ int m_height;
+ int m_rowpixels;
+ const rgb_t* m_palette;
+ void* m_base;
+ };
+
+ class packed_rectangle
+ {
+ public:
+ packed_rectangle() : m_hash(0), m_format(0), m_width(-1), m_height(-1), m_x(-1), m_y(-1), m_rowpixels(0), m_palette(nullptr), m_base(nullptr) { }
+ packed_rectangle(const packed_rectangle& rect)
+ : m_hash(rect.m_hash)
+ , m_format(rect.m_format)
+ , m_width(rect.m_width)
+ , m_height(rect.m_height)
+ , m_x(rect.m_x)
+ , m_y(rect.m_y)
+ , m_rowpixels(rect.m_rowpixels)
+ , m_palette(rect.m_palette)
+ , m_base(rect.m_base)
+ {
+ }
+ packed_rectangle(UINT32 hash, UINT32 format, int width, int height, int x, int y, int rowpixels, const rgb_t *palette, void *base)
+ : m_hash(hash)
+ , m_format(format)
+ , m_width(width)
+ , m_height(height)
+ , m_x(x)
+ , m_y(y)
+ , m_rowpixels(rowpixels)
+ , m_palette(palette)
+ , m_base(base)
+ {
+ }
+
+ UINT32 hash() const { return m_hash; }
+ UINT32 format() const { return m_format; }
+ int width() const { return m_width; }
+ int height() const { return m_height; }
+ int x() const { return m_x; }
+ int y() const { return m_y; }
+ int rowpixels() const { return m_rowpixels; }
+ const rgb_t* palette() const { return m_palette; }
+ void* base() const { return m_base; }
+
+ private:
+ UINT32 m_hash;
+ UINT32 m_format;
+ int m_width;
+ int m_height;
+ int m_x;
+ int m_y;
+ int m_rowpixels;
+ const rgb_t* m_palette;
+ void* m_base;
+ };
+
+ bool pack(const std::vector<packable_rectangle>& rects, std::vector<std::vector<packed_rectangle>>& packs, int pack_size);
+
+private:
+ struct rectangle
+ {
+ rectangle(int size)
+ : x(0)
+ , y(0)
+ , w(size)
+ , h(size)
+ , hash(-1)
+ , format(0)
+ , rowpixels(0)
+ , palette(nullptr)
+ , base(nullptr)
+ , packed(false)
+ {
+ children[0] = -1;
+ children[1] = -1;
+ }
+
+ rectangle(int x, int y, int w, int h, int hash, UINT32 format, int rowpixels, const rgb_t *palette, void *base)
+ : x(x)
+ , y(y)
+ , w(w)
+ , h(h)
+ , hash(hash)
+ , format(format)
+ , rowpixels(rowpixels)
+ , palette(palette)
+ , base(base)
+ , packed(false)
+ {
+ children[0] = -1;
+ children[1] = -1;
+ }
+
+ int get_area() const
+ {
+ return w * h;
+ }
+
+ bool operator<(const rectangle& rect) const
+ {
+ return get_area() < rect.get_area();
+ }
+
+ int x;
+ int y;
+ int w;
+ int h;
+ int hash;
+ UINT32 format;
+ int rowpixels;
+ const rgb_t* palette;
+ void* base;
+ int children[2];
+ bool packed;
+ };
+
+ void clear();
+ bool fill(int pack);
+ void split(int pack, int rect);
+ bool fits(rectangle& rect1, const rectangle& rect2);
+ void add_pack_to_array(int pack, std::vector<packed_rectangle>& array) const;
+
+ int m_pack_size;
+ int m_num_packed;
+ std::vector<rectangle> m_rects;
+ std::vector<rectangle> m_packs;
+ std::vector<int> m_roots;
+};
+
+#endif // __RECTPACKER_H__ \ No newline at end of file
diff --git a/src/osd/modules/render/d3d/d3d9intf.cpp b/src/osd/modules/render/d3d/d3d9intf.cpp
index e4f5e08db3b..435ec7ef64c 100644
--- a/src/osd/modules/render/d3d/d3d9intf.cpp
+++ b/src/osd/modules/render/d3d/d3d9intf.cpp
@@ -27,13 +27,11 @@
typedef IDirect3D9 *(WINAPI *direct3dcreate9_ptr)(UINT SDKVersion);
-namespace d3d
-{
//============================================================
// PROTOTYPES
//============================================================
-static void set_interfaces(base *d3dptr);
+static void set_interfaces(d3d_base *d3dptr);
//============================================================
// INLINES
@@ -64,7 +62,7 @@ static inline void convert_present_params(const present_parameters *params, D3DP
// drawd3d9_init
//============================================================
-base *drawd3d9_init(void)
+d3d_base *drawd3d9_init(void)
{
bool post_available = true;
@@ -119,7 +117,7 @@ base *drawd3d9_init(void)
}
// allocate an object to hold our data
- auto d3dptr = global_alloc(base);
+ auto d3dptr = global_alloc(d3d_base);
d3dptr->version = 9;
d3dptr->d3dobj = d3d9;
d3dptr->dllhandle = dllhandle;
@@ -137,20 +135,20 @@ base *drawd3d9_init(void)
// Direct3D interfaces
//============================================================
-static HRESULT check_device_format(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT adapterformat, DWORD usage, D3DRESOURCETYPE restype, D3DFORMAT format)
+static HRESULT check_device_format(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT adapterformat, DWORD usage, D3DRESOURCETYPE restype, D3DFORMAT format)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_CheckDeviceFormat(d3d9, adapter, devtype, adapterformat, usage, restype, format);
}
-static HRESULT check_device_type(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT format, D3DFORMAT backformat, BOOL windowed)
+static HRESULT check_device_type(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT format, D3DFORMAT backformat, BOOL windowed)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_CheckDeviceType(d3d9, adapter, devtype, format, backformat, windowed);
}
-static HRESULT create_device(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, HWND focus, DWORD behavior, present_parameters *params, device **dev)
+static HRESULT create_device(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, HWND focus, DWORD behavior, present_parameters *params, device **dev)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
D3DPRESENT_PARAMETERS d3d9params;
@@ -158,28 +156,28 @@ static HRESULT create_device(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, HWN
return IDirect3D9_CreateDevice(d3d9, adapter, devtype, focus, behavior, &d3d9params, (IDirect3DDevice9 **)dev);
}
-static HRESULT enum_adapter_modes(base *d3dptr, UINT adapter, D3DFORMAT format, UINT index, D3DDISPLAYMODE *mode)
+static HRESULT enum_adapter_modes(d3d_base *d3dptr, UINT adapter, D3DFORMAT format, UINT index, D3DDISPLAYMODE *mode)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_EnumAdapterModes(d3d9, adapter, format, index, mode);
}
-static UINT get_adapter_count(base *d3dptr)
+static UINT get_adapter_count(d3d_base *d3dptr)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_GetAdapterCount(d3d9);
}
-static HRESULT get_adapter_display_mode(base *d3dptr, UINT adapter, D3DDISPLAYMODE *mode)
+static HRESULT get_adapter_display_mode(d3d_base *d3dptr, UINT adapter, D3DDISPLAYMODE *mode)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_GetAdapterDisplayMode(d3d9, adapter, mode);
}
-static HRESULT get_adapter_identifier(base *d3dptr, UINT adapter, DWORD flags, adapter_identifier *identifier)
+static HRESULT get_adapter_identifier(d3d_base *d3dptr, UINT adapter, DWORD flags, adapter_identifier *identifier)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
D3DADAPTER_IDENTIFIER9 id;
@@ -197,21 +195,21 @@ static HRESULT get_adapter_identifier(base *d3dptr, UINT adapter, DWORD flags, a
}
-static UINT get_adapter_mode_count(base *d3dptr, UINT adapter, D3DFORMAT format)
+static UINT get_adapter_mode_count(d3d_base *d3dptr, UINT adapter, D3DFORMAT format)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_GetAdapterModeCount(d3d9, adapter, format);
}
-static HMONITOR get_adapter_monitor(base *d3dptr, UINT adapter)
+static HMONITOR get_adapter_monitor(d3d_base *d3dptr, UINT adapter)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
return IDirect3D9_GetAdapterMonitor(d3d9, adapter);
}
-static HRESULT get_caps_dword(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, caps_index which, DWORD *value)
+static HRESULT get_caps_dword(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, caps_index which, DWORD *value)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
D3DCAPS9 caps;
@@ -237,7 +235,7 @@ static HRESULT get_caps_dword(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, ca
}
-static ULONG release(base *d3dptr)
+static ULONG release(d3d_base *d3dptr)
{
IDirect3D9 *d3d9 = (IDirect3D9 *)d3dptr->d3dobj;
ULONG result = IDirect3D9_Release(d3d9);
@@ -469,7 +467,7 @@ static HRESULT device_test_cooperative_level(device *dev)
}
-static const device_interface d3d9_device_interface =
+static const d3d_device_interface d3d9_device_interface =
{
device_begin_scene,
device_clear,
@@ -611,7 +609,7 @@ static const vertex_buffer_interface d3d9_vertex_buffer_interface =
// set_interfaces
//============================================================
-static void set_interfaces(base *d3dptr)
+static void set_interfaces(d3d_base *d3dptr)
{
d3dptr->d3d = d3d9_interface;
d3dptr->device = d3d9_device_interface;
@@ -619,5 +617,3 @@ static void set_interfaces(base *d3dptr)
d3dptr->texture = d3d9_texture_interface;
d3dptr->vertexbuf = d3d9_vertex_buffer_interface;
}
-
-}
diff --git a/src/osd/modules/render/d3d/d3dcomm.h b/src/osd/modules/render/d3d/d3dcomm.h
index 58a51eaf1cf..95934f0098a 100644
--- a/src/osd/modules/render/d3d/d3dcomm.h
+++ b/src/osd/modules/render/d3d/d3dcomm.h
@@ -13,10 +13,9 @@
// FORWARD DECLARATIONS
//============================================================
-namespace d3d
-{
class texture_info;
-class renderer;
+class renderer_d3d9;
+struct d3d_base;
//============================================================
// TYPE DEFINITIONS
@@ -51,12 +50,12 @@ public:
} c;
};
-class texture_manager
+class d3d_texture_manager
{
public:
- texture_manager() { }
- texture_manager(renderer *d3d);
- ~texture_manager();
+ d3d_texture_manager() { }
+ d3d_texture_manager(renderer_d3d9 *d3d);
+ ~d3d_texture_manager();
void update_textures();
@@ -81,10 +80,10 @@ public:
texture_info * get_default_texture() { return m_default_texture; }
texture_info * get_vector_texture() { return m_vector_texture; }
- renderer * get_d3d() { return m_renderer; }
+ renderer_d3d9 * get_d3d() { return m_renderer; }
private:
- renderer * m_renderer;
+ renderer_d3d9 * m_renderer;
texture_info * m_texlist; // list of active textures
int m_dynamic_supported; // are dynamic textures supported?
@@ -108,7 +107,7 @@ private:
class texture_info
{
public:
- texture_info(texture_manager *manager, const render_texinfo *texsource, int prescale, UINT32 flags);
+ texture_info(d3d_texture_manager *manager, const render_texinfo *texsource, int prescale, UINT32 flags);
~texture_info();
render_texinfo & get_texinfo() { return m_texinfo; }
@@ -151,9 +150,9 @@ private:
void compute_size(int texwidth, int texheight);
void compute_size_subroutine(int texwidth, int texheight, int* p_width, int* p_height);
- texture_manager * m_texture_manager; // texture manager pointer
+ d3d_texture_manager * m_texture_manager; // texture manager pointer
- renderer * m_renderer; // renderer pointer
+ renderer_d3d9 * m_renderer; // renderer pointer
texture_info * m_next; // next texture in the list
texture_info * m_prev; // prev texture in the list
@@ -174,17 +173,17 @@ private:
texture * m_d3dfinaltex; // Direct3D final (post-scaled) texture
};
-/* d3d::poly_info holds information about a single polygon/d3d primitive */
+/* poly_info holds information about a single polygon/d3d primitive */
class poly_info
{
public:
poly_info() { }
void init(D3DPRIMITIVETYPE type, UINT32 count, UINT32 numverts,
- UINT32 flags, d3d::texture_info *texture, UINT32 modmode,
+ UINT32 flags, texture_info *texture, UINT32 modmode,
float prim_width, float prim_height);
void init(D3DPRIMITIVETYPE type, UINT32 count, UINT32 numverts,
- UINT32 flags, d3d::texture_info *texture, UINT32 modmode,
+ UINT32 flags, texture_info *texture, UINT32 modmode,
float line_time, float line_length,
float prim_width, float prim_height);
@@ -193,7 +192,7 @@ public:
UINT32 get_vertcount() { return m_numverts; }
UINT32 get_flags() { return m_flags; }
- d3d::texture_info * get_texture() { return m_texture; }
+ texture_info * get_texture() { return m_texture; }
DWORD get_modmode() { return m_modmode; }
float get_line_time() { return m_line_time; }
@@ -219,16 +218,14 @@ private:
float m_prim_height; // used by quads
};
-} // d3d
-
/* vertex describes a single vertex */
struct vertex
{
- float x, y, z; // X,Y,Z coordinates
- float rhw; // RHW when no HLSL, padding when HLSL
- D3DCOLOR color; // diffuse color
- float u0, v0; // texture stage 0 coordinates
- float u1, v1; // additional info for vector data
+ float x, y, z; // X,Y,Z coordinates
+ float rhw; // RHW when no HLSL, padding when HLSL
+ D3DCOLOR color; // diffuse color
+ float u0, v0; // texture stage 0 coordinates
+ float u1, v1; // additional info for vector data
};
@@ -239,5 +236,64 @@ struct line_aa_step
float weight; // weight contribution
};
+/* cache_target is a simple linked list containing only a rednerable target and texture, used for phosphor effects */
+class cache_target
+{
+public:
+ // construction/destruction
+ cache_target() { }
+ ~cache_target();
+
+ bool init(renderer_d3d9 *d3d, d3d_base *d3dintf, int width, int height, int prescale_x, int prescale_y);
+
+ surface *last_target;
+ texture *last_texture;
+
+ int target_width;
+ int target_height;
+
+ int width;
+ int height;
+
+ int screen_index;
+
+ cache_target *next;
+ cache_target *prev;
+};
+
+/* render_target is the information about a Direct3D render target chain */
+class d3d_render_target
+{
+public:
+ // construction/destruction
+ d3d_render_target() { }
+ ~d3d_render_target();
+
+ bool init(renderer_d3d9 *d3d, d3d_base *d3dintf, int width, int height, int prescale_x, int prescale_y);
+ int next_index(int index) { return ++index > 1 ? 0 : index; }
+
+ int target_width;
+ int target_height;
+
+ int prescale_x;
+ int prescale_y;
+
+ int width;
+ int height;
+
+ int screen_index;
+ int page_index;
+
+ surface *prescale_target[2];
+ texture *prescale_texture[2];
+ surface *native_target[2];
+ texture *native_texture[2];
+
+ d3d_render_target *next;
+ d3d_render_target *prev;
+
+ surface *bloom_target[11];
+ texture *bloom_texture[11];
+};
#endif
diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp
index 43d6ec9bc48..776820b801f 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.cpp
+++ b/src/osd/modules/render/d3d/d3dhlsl.cpp
@@ -14,16 +14,6 @@
// Windows NT shipped with DirectX 3.0a
// Windows 95 shipped with DirectX 2
-// standard windows headers
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <tchar.h>
-#include <mmsystem.h>
-#include <d3d9.h>
-#include <d3dx9.h>
-#include <math.h>
-#undef interface
-
// MAME headers
#include "emu.h"
#include "render.h"
@@ -35,12 +25,12 @@
#include "screen.h"
// MAMEOS headers
-#include "d3dintf.h"
#include "winmain.h"
#include "window.h"
-#include "d3dcomm.h"
#include "modules/render/drawd3d.h"
+#include "d3dcomm.h"
#include "strconv.h"
+#include "d3dhlsl.h"
//============================================================
@@ -48,10 +38,8 @@
//============================================================
static slider_state *g_slider_list;
-static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *templ, const char *extension, int idx);
+static file_error open_next(renderer_d3d9 *d3d, emu_file &file, const char *templ, const char *extension, int idx);
-namespace d3d
-{
//============================================================
// PROTOTYPES
//============================================================
@@ -108,7 +96,7 @@ shaders::~shaders()
currcache = cachehead;
}
- render_target *currtarget = targethead;
+ d3d_render_target *currtarget = targethead;
while(targethead != NULL)
{
targethead = currtarget->next;
@@ -565,14 +553,14 @@ void shaders::remove_render_target(texture_info *texture)
void shaders::remove_render_target(int width, int height, UINT32 screen_index, UINT32 page_index)
{
- render_target *target = find_render_target(width, height, screen_index, page_index);
+ d3d_render_target *target = find_render_target(width, height, screen_index, page_index);
if (target != NULL)
{
remove_render_target(target);
}
}
-void shaders::remove_render_target(render_target *rt)
+void shaders::remove_render_target(d3d_render_target *rt)
{
if (rt != NULL)
{
@@ -645,7 +633,7 @@ void shaders::set_texture(texture_info *texture)
// shaders::init
//============================================================
-void shaders::init(base *d3dintf, running_machine *machine, d3d::renderer *renderer)
+void shaders::init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *renderer)
{
if (!d3dintf->post_fx_available)
{
@@ -1165,13 +1153,13 @@ void shaders::init_effect_info(poly_info *poly)
// shaders::find_render_target
//============================================================
-render_target* shaders::find_render_target(texture_info *info)
+d3d_render_target* shaders::find_render_target(texture_info *info)
{
UINT32 screen_index_data = (UINT32)info->get_texinfo().osddata;
UINT32 screen_index = screen_index_data >> 1;
UINT32 page_index = screen_index_data & 1;
- render_target *curr = targethead;
+ d3d_render_target *curr = targethead;
while (curr != NULL && (
curr->screen_index != screen_index ||
curr->page_index != page_index ||
@@ -1189,9 +1177,9 @@ render_target* shaders::find_render_target(texture_info *info)
// shaders::find_render_target
//============================================================
-render_target* shaders::find_render_target(int width, int height, UINT32 screen_index, UINT32 page_index)
+d3d_render_target* shaders::find_render_target(int width, int height, UINT32 screen_index, UINT32 page_index)
{
- render_target *curr = targethead;
+ d3d_render_target *curr = targethead;
while (curr != NULL && (
curr->width != width ||
curr->height != height ||
@@ -1223,7 +1211,7 @@ cache_target* shaders::find_cache_target(UINT32 screen_index, int width, int hei
return curr;
}
-int shaders::ntsc_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::ntsc_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1290,7 +1278,7 @@ rgb_t shaders::apply_color_convolution(rgb_t color)
MAX(0, MIN(255, static_cast<int>(b * 255.0f))));
}
-int shaders::color_convolution_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::color_convolution_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1305,7 +1293,7 @@ int shaders::color_convolution_pass(render_target *rt, int source_index, poly_in
return next_index;
}
-int shaders::prescale_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::prescale_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1319,7 +1307,7 @@ int shaders::prescale_pass(render_target *rt, int source_index, poly_info *poly,
return next_index;
}
-int shaders::deconverge_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::deconverge_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1342,7 +1330,7 @@ int shaders::deconverge_pass(render_target *rt, int source_index, poly_info *pol
return next_index;
}
-int shaders::defocus_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::defocus_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1362,7 +1350,7 @@ int shaders::defocus_pass(render_target *rt, int source_index, poly_info *poly,
return next_index;
}
-int shaders::phosphor_pass(render_target *rt, cache_target *ct, int source_index, poly_info *poly, int vertnum)
+int shaders::phosphor_pass(d3d_render_target *rt, cache_target *ct, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1393,7 +1381,7 @@ int shaders::phosphor_pass(render_target *rt, cache_target *ct, int source_index
return next_index;
}
-int shaders::post_pass(render_target *rt, int source_index, poly_info *poly, int vertnum, bool prepare_bloom)
+int shaders::post_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum, bool prepare_bloom)
{
int next_index = source_index;
@@ -1416,14 +1404,9 @@ int shaders::post_pass(render_target *rt, int source_index, poly_info *poly, int
float screen_scale[2] = { xscale, yscale };
float screen_offset[2] = { xoffset, yoffset };
- rgb_t back_color_rgb = !machine->first_screen()->has_palette()
- ? rgb_t(0, 0, 0)
- : machine->first_screen()->palette().palette()->entry_color(0);
+ rgb_t back_color_rgb = !machine->first_screen()->has_palette() ? rgb_t(0, 0, 0) : machine->first_screen()->palette().palette()->entry_color(0);
back_color_rgb = apply_color_convolution(back_color_rgb);
- float back_color[3] = {
- static_cast<float>(back_color_rgb.r()) / 255.0f,
- static_cast<float>(back_color_rgb.g()) / 255.0f,
- static_cast<float>(back_color_rgb.b()) / 255.0f };
+ float back_color[3] = { static_cast<float>(back_color_rgb.r()) / 255.0f, static_cast<float>(back_color_rgb.g()) / 255.0f, static_cast<float>(back_color_rgb.b()) / 255.0f };
curr_effect = post_effect;
curr_effect->update_uniforms();
@@ -1445,7 +1428,7 @@ int shaders::post_pass(render_target *rt, int source_index, poly_info *poly, int
return next_index;
}
-int shaders::downsample_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::downsample_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1463,9 +1446,9 @@ int shaders::downsample_pass(render_target *rt, int source_index, poly_info *pol
curr_effect->set_bool("PrepareVector", prepare_vector);
int bloom_index = 0;
- float bloom_size = (d3d->get_width() < d3d->get_height()) ? d3d->get_width() : d3d->get_height();
float bloom_width = prepare_vector ? rt->target_width : rt->target_width / hlsl_prescale_x;
float bloom_height = prepare_vector ? rt->target_height : rt->target_height / hlsl_prescale_y;
+ float bloom_size = (bloom_width < bloom_height) ? bloom_width : bloom_height;
for (; bloom_size >= 2.0f && bloom_index < 11; bloom_size *= 0.5f)
{
bloom_dims[bloom_index][0] = (float)(int)bloom_width;
@@ -1490,7 +1473,7 @@ int shaders::downsample_pass(render_target *rt, int source_index, poly_info *pol
return next_index;
}
-int shaders::bloom_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::bloom_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1562,7 +1545,7 @@ int shaders::bloom_pass(render_target *rt, int source_index, poly_info *poly, in
return next_index;
}
-int shaders::distortion_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::distortion_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1606,7 +1589,7 @@ int shaders::distortion_pass(render_target *rt, int source_index, poly_info *pol
return next_index;
}
-int shaders::vector_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::vector_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1623,7 +1606,7 @@ int shaders::vector_pass(render_target *rt, int source_index, poly_info *poly, i
return next_index;
}
-int shaders::vector_buffer_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::vector_buffer_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1640,7 +1623,7 @@ int shaders::vector_buffer_pass(render_target *rt, int source_index, poly_info *
return next_index;
}
-int shaders::screen_pass(render_target *rt, int source_index, poly_info *poly, int vertnum)
+int shaders::screen_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum)
{
int next_index = source_index;
@@ -1703,7 +1686,7 @@ void shaders::render_quad(poly_info *poly, int vertnum)
curr_render_target = find_render_target(curr_texture);
- render_target *rt = curr_render_target;
+ d3d_render_target *rt = curr_render_target;
if (rt == NULL)
{
return;
@@ -1749,7 +1732,7 @@ void shaders::render_quad(poly_info *poly, int vertnum)
{
curr_render_target = find_render_target(d3d->get_width(), d3d->get_height(), 0, 0);
- render_target *rt = curr_render_target;
+ d3d_render_target *rt = curr_render_target;
if (rt == NULL)
{
return;
@@ -1771,7 +1754,7 @@ void shaders::render_quad(poly_info *poly, int vertnum)
{
curr_render_target = find_render_target(d3d->get_width(), d3d->get_height(), 0, 0);
- render_target *rt = curr_render_target;
+ d3d_render_target *rt = curr_render_target;
if (rt == NULL)
{
return;
@@ -1849,7 +1832,7 @@ bool shaders::register_prescaled_texture(texture_info *texture)
//============================================================
// shaders::add_cache_target - register a cache target
//============================================================
-bool shaders::add_cache_target(renderer* d3d, texture_info* info, int width, int height, int xprescale, int yprescale, int screen_index)
+bool shaders::add_cache_target(renderer_d3d9* d3d, texture_info* info, int width, int height, int xprescale, int yprescale, int screen_index)
{
cache_target* target = (cache_target*)global_alloc_clear<cache_target>();
@@ -1884,7 +1867,7 @@ bool shaders::add_cache_target(renderer* d3d, texture_info* info, int width, int
return true;
}
-render_target* shaders::get_vector_target()
+d3d_render_target* shaders::get_vector_target()
{
if (!vector_enable)
{
@@ -1907,13 +1890,13 @@ void shaders::create_vector_target(render_primitive *prim)
// shaders::add_render_target - register a render target
//============================================================
-bool shaders::add_render_target(renderer* d3d, texture_info* info, int width, int height, int xprescale, int yprescale)
+bool shaders::add_render_target(renderer_d3d9* d3d, texture_info* info, int width, int height, int xprescale, int yprescale)
{
UINT32 screen_index = 0;
UINT32 page_index = 0;
if (info != NULL)
{
- render_target *existing_target = find_render_target(info);
+ d3d_render_target *existing_target = find_render_target(info);
if (existing_target != NULL)
{
remove_render_target(existing_target);
@@ -1925,14 +1908,14 @@ bool shaders::add_render_target(renderer* d3d, texture_info* info, int width, in
}
else
{
- render_target *existing_target = find_render_target(d3d->get_width(), d3d->get_height(), 0, 0);
+ d3d_render_target *existing_target = find_render_target(d3d->get_width(), d3d->get_height(), 0, 0);
if (existing_target != NULL)
{
remove_render_target(existing_target);
}
}
- render_target* target = (render_target*)global_alloc_clear<render_target>();
+ d3d_render_target* target = (d3d_render_target*)global_alloc_clear<d3d_render_target>();
if (!target->init(d3d, d3dintf, width, height, xprescale, yprescale))
{
@@ -2074,7 +2057,7 @@ void shaders::delete_resources(bool reset)
currcache = cachehead;
}
- render_target *currtarget = targethead;
+ d3d_render_target *currtarget = targethead;
while(targethead != NULL)
{
targethead = currtarget->next;
@@ -2223,7 +2206,7 @@ static void get_vector(const char *data, int count, float *out, bool report_erro
// be done in a more ideal way.
//============================================================
-static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
+static slider_state *slider_alloc(running_machine &machine, int id, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
{
int size = sizeof(slider_state) + strlen(title);
slider_state *state = (slider_state *)auto_alloc_array_clear(machine, UINT8, size);
@@ -2234,6 +2217,8 @@ static slider_state *slider_alloc(running_machine &machine, const char *title, I
state->incval = incval;
state->update = update;
state->arg = arg;
+ state->hidden = false;
+ state->id = id;
strcpy(state->description, title);
return state;
@@ -2861,99 +2846,191 @@ static INT32 slider_ntsc_scan_time(running_machine &machine, void *arg, std::str
hlsl_options shaders::last_options = { false };
+enum slider_option
+{
+ SLIDER_VECTOR_ATTENUATION = 0,
+ SLIDER_VECTOR_LENGTH_MAX,
+ SLIDER_SHADOW_MASK_TILE_MODE,
+ SLIDER_SHADOW_MASK_ALPHA,
+ SLIDER_SHADOW_MASK_X_COUNT,
+ SLIDER_SHADOW_MASK_Y_COUNT,
+ SLIDER_SHADOW_MASK_U_SIZE,
+ SLIDER_SHADOW_MASK_V_SIZE,
+ SLIDER_SHADOW_MASK_U_OFFSET,
+ SLIDER_SHADOW_MASK_V_OFFSET,
+ SLIDER_CURVATURE,
+ SLIDER_ROUND_CORNER,
+ SLIDER_SMOOTH_BORDER,
+ SLIDER_REFLECTION,
+ SLIDER_VIGNETTING,
+ SLIDER_SCANLINE_ALPHA,
+ SLIDER_SCANLINE_SCALE,
+ SLIDER_SCANLINE_HEIGHT,
+ SLIDER_SCANLINE_BRIGHT_SCALE,
+ SLIDER_SCANLINE_BRIGHT_OFFSET,
+ SLIDER_SCANLINE_JITTER,
+ SLIDER_HUM_BAR_ALPHA,
+ SLIDER_DEFOCUS_X,
+ SLIDER_DEFOCUS_Y,
+ SLIDER_RED_CONVERGE_X,
+ SLIDER_RED_CONVERGE_Y,
+ SLIDER_GREEN_CONVERGE_X,
+ SLIDER_GREEN_CONVERGE_Y,
+ SLIDER_BLUE_CONVERGE_X,
+ SLIDER_BLUE_CONVERGE_Y,
+ SLIDER_RED_RADIAL_CONVERGE_X,
+ SLIDER_RED_RADIAL_CONVERGE_Y,
+ SLIDER_GREEN_RADIAL_CONVERGE_X,
+ SLIDER_GREEN_RADIAL_CONVERGE_Y,
+ SLIDER_BLUE_RADIAL_CONVERGE_X,
+ SLIDER_BLUE_RADIAL_CONVERGE_Y,
+ SLIDER_RED_FROM_R,
+ SLIDER_RED_FROM_G,
+ SLIDER_RED_FROM_B,
+ SLIDER_GREEN_FROM_R,
+ SLIDER_GREEN_FROM_G,
+ SLIDER_GREEN_FROM_B,
+ SLIDER_BLUE_FROM_R,
+ SLIDER_BLUE_FROM_G,
+ SLIDER_BLUE_FROM_B,
+ SLIDER_SATURATION,
+ SLIDER_RED_OFFSET,
+ SLIDER_GREEN_OFFSET,
+ SLIDER_BLUE_OFFSET,
+ SLIDER_RED_SCALE,
+ SLIDER_GREEN_SCALE,
+ SLIDER_BLUE_SCALE,
+ SLIDER_RED_POWER,
+ SLIDER_GREEN_POWER,
+ SLIDER_BLUE_POWER,
+ SLIDER_RED_FLOOR,
+ SLIDER_GREEN_FLOOR,
+ SLIDER_BLUE_FLOOR,
+ SLIDER_RED_PHOSPHOR,
+ SLIDER_GREEN_PHOSPHOR,
+ SLIDER_BLUE_PHOSPHOR,
+ SLIDER_BLOOM_BLEND_MODE,
+ SLIDER_BLOOM_SCALE,
+ SLIDER_BLOOM_RED_OVERDRIVE,
+ SLIDER_BLOOM_GREEN_OVERDRIVE,
+ SLIDER_BLOOM_BLUE_OVERDRIVE,
+ SLIDER_BLOOM_LVL0_SCALE,
+ SLIDER_BLOOM_LVL1_SCALE,
+ SLIDER_BLOOM_LVL2_SCALE,
+ SLIDER_BLOOM_LVL3_SCALE,
+ SLIDER_BLOOM_LVL4_SCALE,
+ SLIDER_BLOOM_LVL5_SCALE,
+ SLIDER_BLOOM_LVL6_SCALE,
+ SLIDER_BLOOM_LVL7_SCALE,
+ SLIDER_BLOOM_LVL8_SCALE,
+ SLIDER_BLOOM_LVL9_SCALE,
+ SLIDER_BLOOM_LVL10_SCALE,
+ SLIDER_NTSC_ENABLE,
+ SLIDER_NTSC_JITTER,
+ SLIDER_NTSC_A_VALUE,
+ SLIDER_NTSC_B_VALUE,
+ SLIDER_NTSC_P_VALUE,
+ SLIDER_NTSC_O_VALUE,
+ SLIDER_NTSC_CC_VALUE,
+ SLIDER_NTSC_N_VALUE,
+ SLIDER_NTSC_Y_VALUE,
+ SLIDER_NTSC_I_VALUE,
+ SLIDER_NTSC_Q_VALUE,
+ SLIDER_NTSC_SCAN_TIME
+};
+
shaders::slider_desc shaders::s_sliders[] =
{
- { "Vector Length Attenuation", 0, 50, 100, 1, 2, slider_vector_attenuation },
- { "Vector Attenuation Length Limit", 1, 500, 1000, 1, 2, slider_vector_length_max },
- { "Shadow Mask Tile Mode", 0, 0, 1, 1, 7, slider_shadow_mask_tile_mode },
- { "Shadow Mask Darkness", 0, 0, 100, 1, 7, slider_shadow_mask_alpha },
- { "Shadow Mask X Count", 1, 1, 1024, 1, 7, slider_shadow_mask_x_count },
- { "Shadow Mask Y Count", 1, 1, 1024, 1, 7, slider_shadow_mask_y_count },
- { "Shadow Mask Pixel Count X", 1, 1, 64, 1, 7, slider_shadow_mask_usize },
- { "Shadow Mask Pixel Count Y", 1, 1, 64, 1, 7, slider_shadow_mask_vsize },
- { "Shadow Mask Offset X", -100, 0, 100, 1, 7, slider_shadow_mask_uoffset },
- { "Shadow Mask Offset Y", -100, 0, 100, 1, 7, slider_shadow_mask_voffset },
- { "Screen Curvature", 0, 0, 100, 1, 7, slider_curvature },
- { "Screen Round Corner", 0, 0, 100, 1, 7, slider_round_corner },
- { "Screen Smooth Border", 0, 0, 100, 1, 7, slider_smooth_border },
- { "Screen Reflection", 0, 0, 100, 1, 7, slider_reflection },
- { "Image Vignetting", 0, 0, 100, 1, 7, slider_vignetting },
- { "Scanline Darkness", 0, 0, 100, 1, 5, slider_scanline_alpha },
- { "Scanline Screen Height", 1, 20, 80, 1, 5, slider_scanline_scale },
- { "Scanline Indiv. Height", 1, 20, 80, 1, 5, slider_scanline_height },
- { "Scanline Brightness", 0, 20, 40, 1, 5, slider_scanline_bright_scale },
- { "Scanline Brightness Overdrive", 0, 0, 20, 1, 5, slider_scanline_bright_offset },
- { "Scanline Jitter", 0, 0, 100, 1, 5, slider_scanline_jitter },
- { "Hum Bar Darkness", 0, 0, 100, 1, 5, slider_hum_bar_alpha },
- { "Defocus X", 0, 0, 100, 1, 7, slider_defocus_x },
- { "Defocus Y", 0, 0, 100, 1, 7, slider_defocus_y },
- { "Red Position Offset X", -100, 0, 100, 1, 7, slider_red_converge_x },
- { "Red Position Offset Y", -100, 0, 100, 1, 7, slider_red_converge_y },
- { "Green Position Offset X", -100, 0, 100, 1, 7, slider_green_converge_x },
- { "Green Position Offset Y", -100, 0, 100, 1, 7, slider_green_converge_y },
- { "Blue Position Offset X", -100, 0, 100, 1, 7, slider_blue_converge_x },
- { "Blue Position Offset Y", -100, 0, 100, 1, 7, slider_blue_converge_y },
- { "Red Convergence X", -100, 0, 100, 1, 7, slider_red_radial_converge_x },
- { "Red Convergence Y", -100, 0, 100, 1, 7, slider_red_radial_converge_y },
- { "Green Convergence X", -100, 0, 100, 1, 7, slider_green_radial_converge_x },
- { "Green Convergence Y", -100, 0, 100, 1, 7, slider_green_radial_converge_y },
- { "Blue Convergence X", -100, 0, 100, 1, 7, slider_blue_radial_converge_x },
- { "Blue Convergence Y", -100, 0, 100, 1, 7, slider_blue_radial_converge_y },
- { "Red Output from Red Input", -400, 0, 400, 5, 7, slider_red_from_r },
- { "Red Output from Green Input", -400, 0, 400, 5, 7, slider_red_from_g },
- { "Red Output from Blue Input", -400, 0, 400, 5, 7, slider_red_from_b },
- { "Green Output from Red Input", -400, 0, 400, 5, 7, slider_green_from_r },
- { "Green Output from Green Input", -400, 0, 400, 5, 7, slider_green_from_g },
- { "Green Output from Blue Input", -400, 0, 400, 5, 7, slider_green_from_b },
- { "Blue Output from Red Input", -400, 0, 400, 5, 7, slider_blue_from_r },
- { "Blue Output from Green Input", -400, 0, 400, 5, 7, slider_blue_from_g },
- { "Blue Output from Blue Input", -400, 0, 400, 5, 7, slider_blue_from_b },
- { "Saturation", 0, 100, 400, 1, 7, slider_saturation },
- { "Red DC Offset", -100, 0, 100, 1, 7, slider_red_offset },
- { "Green DC Offset", -100, 0, 100, 1, 7, slider_green_offset },
- { "Blue DC Offset", -100, 0, 100, 1, 7, slider_blue_offset },
- { "Red Scale", -200, 100, 200, 1, 7, slider_red_scale },
- { "Green Scale", -200, 100, 200, 1, 7, slider_green_scale },
- { "Blue Scale", -200, 100, 200, 1, 7, slider_blue_scale },
- { "Red Gamma", -80, 0, 80, 1, 7, slider_red_power },
- { "Green Gamma", -80, 0, 80, 1, 7, slider_green_power },
- { "Blue Gamma", -80, 0, 80, 1, 7, slider_blue_power },
- { "Red Floor", 0, 0, 100, 1, 7, slider_red_floor },
- { "Green Floor", 0, 0, 100, 1, 7, slider_green_floor },
- { "Blue Floor", 0, 0, 100, 1, 7, slider_blue_floor },
- { "Red Phosphor Life", 0, 0, 100, 1, 7, slider_red_phosphor_life },
- { "Green Phosphor Life", 0, 0, 100, 1, 7, slider_green_phosphor_life },
- { "Blue Phosphor Life", 0, 0, 100, 1, 7, slider_blue_phosphor_life },
- { "Bloom Blend Mode", 0, 0, 1, 1, 7, slider_bloom_blend_mode },
- { "Bloom Scale", 0, 0, 2000, 5, 7, slider_bloom_scale },
- { "Bloom Red Overdrive", 0, 0, 2000, 5, 7, slider_bloom_red_overdrive },
- { "Bloom Green Overdrive", 0, 0, 2000, 5, 7, slider_bloom_green_overdrive },
- { "Bloom Blue Overdrive", 0, 0, 2000, 5, 7, slider_bloom_blue_overdrive },
- { "Bloom Level 0 Scale", 0, 100, 100, 1, 7, slider_bloom_lvl0_scale },
- { "Bloom Level 1 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl1_scale },
- { "Bloom Level 2 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl2_scale },
- { "Bloom Level 3 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl3_scale },
- { "Bloom Level 4 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl4_scale },
- { "Bloom Level 5 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl5_scale },
- { "Bloom Level 6 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl6_scale },
- { "Bloom Level 7 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl7_scale },
- { "Bloom Level 8 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl8_scale },
- { "Bloom Level 9 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl9_scale },
- { "Bloom Level 10 Scale", 0, 0, 100, 1, 7, slider_bloom_lvl10_scale },
- { "NTSC processing", 0, 0, 1, 1, 5, slider_ntsc_enable },
- { "Signal Jitter", 0, 0, 100, 1, 5, slider_ntsc_jitter },
- { "A Value", -100, 50, 100, 1, 5, slider_ntsc_a_value },
- { "B Value", -100, 50, 100, 1, 5, slider_ntsc_b_value },
- { "Incoming Pixel Clock Scaling", -300, 100, 300, 1, 5, slider_ntsc_p_value },
- { "Outgoing Color Carrier Phase", -300, 0, 300, 1, 5, slider_ntsc_o_value },
- { "Color Carrier Frequency", 0, 35795, 60000, 5, 5, slider_ntsc_cc_value },
- { "Y Notch", 0, 100, 600, 5, 5, slider_ntsc_n_value },
- { "Y Frequency", 0, 600, 600, 5, 5, slider_ntsc_y_value },
- { "I Frequency", 0, 120, 600, 5, 5, slider_ntsc_i_value },
- { "Q Frequency", 0, 60, 600, 5, 5, slider_ntsc_q_value },
- { "Scanline Duration", 0, 5260, 10000, 1, 5, slider_ntsc_scan_time },
- // { "Phase Count", 1, 2, 3, 1, 5, slider_ntsc_phase_count },
- { NULL, 0, 0, 0, 0, 0, NULL },
+ { "Vector Length Attenuation", 0, 50, 100, 1, SLIDER_SCREEN_TYPE_VECTOR, slider_vector_attenuation, SLIDER_VECTOR_ATTENUATION },
+ { "Vector Attenuation Length Limit", 1, 500, 1000, 1, SLIDER_SCREEN_TYPE_VECTOR, slider_vector_length_max, SLIDER_VECTOR_LENGTH_MAX },
+ { "Shadow Mask Tile Mode", 0, 0, 1, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_tile_mode, SLIDER_SHADOW_MASK_TILE_MODE },
+ { "Shadow Mask Darkness", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_alpha, SLIDER_SHADOW_MASK_ALPHA },
+ { "Shadow Mask X Count", 1, 1, 1024, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_x_count, SLIDER_SHADOW_MASK_X_COUNT },
+ { "Shadow Mask Y Count", 1, 1, 1024, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_y_count, SLIDER_SHADOW_MASK_Y_COUNT },
+ { "Shadow Mask Pixel Count X", 1, 1, 64, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_usize, SLIDER_SHADOW_MASK_U_SIZE },
+ { "Shadow Mask Pixel Count Y", 1, 1, 64, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_vsize, SLIDER_SHADOW_MASK_V_SIZE },
+ { "Shadow Mask Offset X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_uoffset, SLIDER_SHADOW_MASK_U_OFFSET },
+ { "Shadow Mask Offset Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_shadow_mask_voffset, SLIDER_SHADOW_MASK_V_OFFSET },
+ { "Screen Curvature", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_curvature, SLIDER_CURVATURE },
+ { "Screen Round Corner", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_round_corner, SLIDER_ROUND_CORNER },
+ { "Screen Smooth Border", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_smooth_border, SLIDER_SMOOTH_BORDER },
+ { "Screen Reflection", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_reflection, SLIDER_REFLECTION },
+ { "Image Vignetting", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_vignetting, SLIDER_VIGNETTING },
+ { "Scanline Darkness", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_alpha, SLIDER_SCANLINE_ALPHA },
+ { "Scanline Screen Height", 1, 20, 80, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_scale, SLIDER_SCANLINE_SCALE },
+ { "Scanline Indiv. Height", 1, 20, 80, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_height, SLIDER_SCANLINE_HEIGHT },
+ { "Scanline Brightness", 0, 20, 40, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_bright_scale, SLIDER_SCANLINE_BRIGHT_SCALE },
+ { "Scanline Brightness Overdrive", 0, 0, 20, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_bright_offset, SLIDER_SCANLINE_BRIGHT_OFFSET },
+ { "Scanline Jitter", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_scanline_jitter, SLIDER_SCANLINE_JITTER },
+ { "Hum Bar Darkness", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_hum_bar_alpha, SLIDER_HUM_BAR_ALPHA },
+ { "Defocus X", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_defocus_x, SLIDER_DEFOCUS_X },
+ { "Defocus Y", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_defocus_y, SLIDER_DEFOCUS_Y },
+ { "Red Position Offset X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_converge_x, SLIDER_RED_CONVERGE_X },
+ { "Red Position Offset Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_converge_y, SLIDER_RED_CONVERGE_Y },
+ { "Green Position Offset X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_converge_x, SLIDER_GREEN_CONVERGE_X },
+ { "Green Position Offset Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_converge_y, SLIDER_GREEN_CONVERGE_Y },
+ { "Blue Position Offset X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_converge_x, SLIDER_BLUE_CONVERGE_X },
+ { "Blue Position Offset Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_converge_y, SLIDER_BLUE_CONVERGE_Y },
+ { "Red Convergence X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_radial_converge_x, SLIDER_RED_RADIAL_CONVERGE_X },
+ { "Red Convergence Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_radial_converge_y, SLIDER_RED_RADIAL_CONVERGE_Y },
+ { "Green Convergence X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_radial_converge_x, SLIDER_GREEN_RADIAL_CONVERGE_X },
+ { "Green Convergence Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_radial_converge_y, SLIDER_GREEN_RADIAL_CONVERGE_Y },
+ { "Blue Convergence X", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_radial_converge_x, SLIDER_BLUE_RADIAL_CONVERGE_X },
+ { "Blue Convergence Y", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_radial_converge_y, SLIDER_BLUE_RADIAL_CONVERGE_Y },
+ { "Red Output from Red Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_red_from_r, SLIDER_RED_FROM_R },
+ { "Red Output from Green Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_red_from_g, SLIDER_RED_FROM_G },
+ { "Red Output from Blue Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_red_from_b, SLIDER_RED_FROM_B },
+ { "Green Output from Red Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_green_from_r, SLIDER_GREEN_FROM_R },
+ { "Green Output from Green Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_green_from_g, SLIDER_GREEN_FROM_G },
+ { "Green Output from Blue Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_green_from_b, SLIDER_GREEN_FROM_B },
+ { "Blue Output from Red Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_blue_from_r, SLIDER_BLUE_FROM_R },
+ { "Blue Output from Green Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_blue_from_g, SLIDER_BLUE_FROM_G },
+ { "Blue Output from Blue Input", -400, 0, 400, 5, SLIDER_SCREEN_TYPE_ANY, slider_blue_from_b, SLIDER_BLUE_FROM_B },
+ { "Saturation", 0, 100, 400, 1, SLIDER_SCREEN_TYPE_ANY, slider_saturation, SLIDER_SATURATION },
+ { "Red DC Offset", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_offset, SLIDER_RED_OFFSET },
+ { "Green DC Offset", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_offset, SLIDER_GREEN_OFFSET },
+ { "Blue DC Offset", -100, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_offset, SLIDER_BLUE_OFFSET },
+ { "Red Scale", -200, 100, 200, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_scale, SLIDER_RED_SCALE },
+ { "Green Scale", -200, 100, 200, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_scale, SLIDER_GREEN_SCALE },
+ { "Blue Scale", -200, 100, 200, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_scale, SLIDER_BLUE_SCALE },
+ { "Red Gamma", -80, 0, 80, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_power, SLIDER_RED_POWER },
+ { "Green Gamma", -80, 0, 80, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_power, SLIDER_GREEN_POWER },
+ { "Blue Gamma", -80, 0, 80, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_power, SLIDER_BLUE_POWER },
+ { "Red Floor", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_floor, SLIDER_RED_FLOOR },
+ { "Green Floor", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_floor, SLIDER_GREEN_FLOOR },
+ { "Blue Floor", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_floor, SLIDER_BLUE_FLOOR },
+ { "Red Phosphor Life", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_red_phosphor_life, SLIDER_RED_PHOSPHOR },
+ { "Green Phosphor Life", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_green_phosphor_life, SLIDER_GREEN_PHOSPHOR },
+ { "Blue Phosphor Life", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_blue_phosphor_life, SLIDER_BLUE_PHOSPHOR },
+ { "Bloom Blend Mode", 0, 0, 1, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_blend_mode, SLIDER_BLOOM_BLEND_MODE },
+ { "Bloom Scale", 0, 0, 2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_scale, SLIDER_BLOOM_SCALE },
+ { "Bloom Red Overdrive", 0, 0, 2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_red_overdrive, SLIDER_BLOOM_RED_OVERDRIVE },
+ { "Bloom Green Overdrive", 0, 0, 2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_green_overdrive, SLIDER_BLOOM_GREEN_OVERDRIVE },
+ { "Bloom Blue Overdrive", 0, 0, 2000, 5, SLIDER_SCREEN_TYPE_ANY, slider_bloom_blue_overdrive, SLIDER_BLOOM_BLUE_OVERDRIVE },
+ { "Bloom Level 0 Scale", 0, 100, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl0_scale, SLIDER_BLOOM_LVL0_SCALE },
+ { "Bloom Level 1 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl1_scale, SLIDER_BLOOM_LVL1_SCALE },
+ { "Bloom Level 2 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl2_scale, SLIDER_BLOOM_LVL2_SCALE },
+ { "Bloom Level 3 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl3_scale, SLIDER_BLOOM_LVL3_SCALE },
+ { "Bloom Level 4 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl4_scale, SLIDER_BLOOM_LVL4_SCALE },
+ { "Bloom Level 5 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl5_scale, SLIDER_BLOOM_LVL5_SCALE },
+ { "Bloom Level 6 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl6_scale, SLIDER_BLOOM_LVL6_SCALE },
+ { "Bloom Level 7 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl7_scale, SLIDER_BLOOM_LVL7_SCALE },
+ { "Bloom Level 8 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl8_scale, SLIDER_BLOOM_LVL8_SCALE },
+ { "Bloom Level 9 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl9_scale, SLIDER_BLOOM_LVL9_SCALE },
+ { "Bloom Level 10 Scale", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_ANY, slider_bloom_lvl10_scale, SLIDER_BLOOM_LVL10_SCALE },
+ { "NTSC processing", 0, 0, 1, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_enable, SLIDER_NTSC_ENABLE },
+ { "Signal Jitter", 0, 0, 100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_jitter, SLIDER_NTSC_JITTER },
+ { "A Value", -100, 50, 100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_a_value, SLIDER_NTSC_A_VALUE },
+ { "B Value", -100, 50, 100, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_b_value, SLIDER_NTSC_B_VALUE },
+ { "Incoming Pixel Clock Scaling", -300, 100, 300, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_p_value, SLIDER_NTSC_P_VALUE },
+ { "Outgoing Color Carrier Phase", -300, 0, 300, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_o_value, SLIDER_NTSC_O_VALUE },
+ { "Color Carrier Frequency", 0, 35795, 60000, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_cc_value, SLIDER_NTSC_CC_VALUE },
+ { "Y Notch", 0, 100, 600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_n_value, SLIDER_NTSC_N_VALUE },
+ { "Y Frequency", 0, 600, 600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_y_value, SLIDER_NTSC_Y_VALUE },
+ { "I Frequency", 0, 120, 600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_i_value, SLIDER_NTSC_I_VALUE },
+ { "Q Frequency", 0, 60, 600, 5, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_q_value, SLIDER_NTSC_Q_VALUE },
+ { "Scanline Duration", 0, 5260, 10000, 1, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, slider_ntsc_scan_time, SLIDER_NTSC_SCAN_TIME },
+ { NULL, 0, 0, 0, 0, 0, NULL, -1 },
};
@@ -2981,7 +3058,7 @@ slider_state *shaders::init_slider_list()
(screen_type == SCREEN_TYPE_RASTER && (slider->screen_type & SLIDER_SCREEN_TYPE_RASTER) == SLIDER_SCREEN_TYPE_RASTER) ||
(screen_type == SCREEN_TYPE_LCD && (slider->screen_type & SLIDER_SCREEN_TYPE_LCD) == SLIDER_SCREEN_TYPE_LCD))
{
- *tailptr = slider_alloc(*machine, slider->name, slider->minval, slider->defval, slider->maxval, slider->step, slider->adjustor, (void*)options);
+ *tailptr = slider_alloc(*machine, slider->id, slider->name, slider->minval, slider->defval, slider->maxval, slider->step, slider->adjustor, (void*)options);
tailptr = &(*tailptr)->next;
}
}
@@ -3045,7 +3122,7 @@ void uniform::update()
shaders *shadersys = m_shader->m_shaders;
hlsl_options *options = shadersys->options;
- renderer *d3d = shadersys->d3d;
+ renderer_d3d9 *d3d = shadersys->d3d;
switch (m_id)
{
@@ -3536,16 +3613,14 @@ ULONG effect::release()
return m_effect->Release();
}
-}
-
//============================================================
// get_slider_list
//============================================================
-void *windows_osd_interface::get_slider_list()
+slider_state *renderer_d3d9::get_slider_list()
{
- return (void*)g_slider_list;
+ return g_slider_list;
}
@@ -3556,7 +3631,7 @@ void *windows_osd_interface::get_slider_list()
// scheme
//-------------------------------------------------
-static file_error open_next(d3d::renderer *d3d, emu_file &file, const char *templ, const char *extension, int idx)
+static file_error open_next(renderer_d3d9 *d3d, emu_file &file, const char *templ, const char *extension, int idx)
{
UINT32 origflags = file.openflags();
diff --git a/src/osd/modules/render/d3d/d3dhlsl.h b/src/osd/modules/render/d3d/d3dhlsl.h
index d949c1417c8..a42e9995767 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.h
+++ b/src/osd/modules/render/d3d/d3dhlsl.h
@@ -22,8 +22,6 @@
struct slider_state;
-namespace d3d
-{
class effect;
class shaders;
@@ -181,9 +179,9 @@ private:
bool m_valid;
};
-class render_target;
+class d3d_render_target;
class cache_target;
-class renderer;
+class renderer_d3d9;
/* hlsl_options is the information about runtime-mutable Direct3D HLSL options */
/* in the future this will be moved into an OSD/emu shared buffer */
@@ -273,13 +271,13 @@ public:
shaders();
~shaders();
- void init(base *d3dintf, running_machine *machine, d3d::renderer *renderer);
+ void init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *renderer);
bool enabled() { return master_enable; }
void toggle();
bool vector_enabled() { return master_enable && vector_enable; }
- render_target* get_vector_target();
+ d3d_render_target* get_vector_target();
void create_vector_target(render_primitive *prim);
void begin_frame();
@@ -293,8 +291,8 @@ public:
bool register_texture(texture_info *texture);
bool register_prescaled_texture(texture_info *texture);
- bool add_render_target(renderer* d3d, texture_info* info, int width, int height, int xprescale, int yprescale);
- bool add_cache_target(renderer* d3d, texture_info* info, int width, int height, int xprescale, int yprescale, int screen_index);
+ bool add_render_target(renderer_d3d9* d3d, texture_info* info, int width, int height, int xprescale, int yprescale);
+ bool add_cache_target(renderer_d3d9* d3d, texture_info* info, int width, int height, int xprescale, int yprescale, int screen_index);
void window_save();
void window_record();
@@ -306,10 +304,10 @@ public:
void init_fsfx_quad(void *vertbuf);
void set_texture(texture_info *texture);
- render_target * find_render_target(texture_info *info);
+ d3d_render_target * find_render_target(texture_info *info);
void remove_render_target(texture_info *texture);
void remove_render_target(int width, int height, UINT32 screen_index, UINT32 page_index);
- void remove_render_target(render_target *rt);
+ void remove_render_target(d3d_render_target *rt);
int create_resources(bool reset);
void delete_resources(bool reset);
@@ -322,7 +320,9 @@ public:
SLIDER_SCREEN_TYPE_NONE = 0,
SLIDER_SCREEN_TYPE_RASTER = 1,
SLIDER_SCREEN_TYPE_VECTOR = 2,
- SLIDER_SCREEN_TYPE_LCD = 4
+ SLIDER_SCREEN_TYPE_LCD = 4,
+ SLIDER_SCREEN_TYPE_LCD_OR_RASTER = SLIDER_SCREEN_TYPE_RASTER | SLIDER_SCREEN_TYPE_LCD,
+ SLIDER_SCREEN_TYPE_ANY = SLIDER_SCREEN_TYPE_RASTER | SLIDER_SCREEN_TYPE_VECTOR | SLIDER_SCREEN_TYPE_LCD
};
struct slider_desc
@@ -334,6 +334,7 @@ public:
int step;
int screen_type;
INT32(*adjustor)(running_machine &, void *, std::string *, INT32);
+ int id;
};
private:
@@ -345,32 +346,32 @@ private:
bool register_texture(texture_info *texture, int width, int height, int xscale, int yscale);
- render_target* find_render_target(int width, int height, UINT32 screen_index, UINT32 page_index);
+ d3d_render_target* find_render_target(int width, int height, UINT32 screen_index, UINT32 page_index);
cache_target * find_cache_target(UINT32 screen_index, int width, int height);
void remove_cache_target(cache_target *cache);
rgb_t apply_color_convolution(rgb_t color);
// Shader passes
- int ntsc_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int color_convolution_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int prescale_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int deconverge_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int defocus_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int phosphor_pass(render_target *rt, cache_target *ct, int source_index, poly_info *poly, int vertnum);
- int post_pass(render_target *rt, int source_index, poly_info *poly, int vertnum, bool prepare_bloom);
- int downsample_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int bloom_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int distortion_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int vector_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int vector_buffer_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
- int screen_pass(render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int ntsc_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int color_convolution_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int prescale_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int deconverge_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int defocus_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int phosphor_pass(d3d_render_target *rt, cache_target *ct, int source_index, poly_info *poly, int vertnum);
+ int post_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum, bool prepare_bloom);
+ int downsample_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int bloom_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int distortion_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int vector_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int vector_buffer_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
+ int screen_pass(d3d_render_target *rt, int source_index, poly_info *poly, int vertnum);
void menu_pass(poly_info *poly, int vertnum);
- base * d3dintf; // D3D interface
+ d3d_base * d3dintf; // D3D interface
running_machine * machine;
- d3d::renderer * d3d; // D3D renderer
+ renderer_d3d9 * d3d; // D3D renderer
bool master_enable; // overall enable flag
bool vector_enable; // vector post-processing enable flag
@@ -436,15 +437,13 @@ private:
vertex * fsfx_vertices; // pointer to our full-screen-quad object
texture_info * curr_texture;
- render_target * curr_render_target;
+ d3d_render_target * curr_render_target;
poly_info * curr_poly;
- render_target * targethead;
+ d3d_render_target * targethead;
cache_target * cachehead;
static slider_desc s_sliders[];
static hlsl_options last_options; // last used options
};
-}
-
#endif
diff --git a/src/osd/modules/render/d3d/d3dintf.h b/src/osd/modules/render/d3d/d3dintf.h
index 9155f620545..3e0a90a46f5 100644
--- a/src/osd/modules/render/d3d/d3dintf.h
+++ b/src/osd/modules/render/d3d/d3dintf.h
@@ -9,6 +9,15 @@
#ifndef __WIN_D3DINTF__
#define __WIN_D3DINTF__
+// standard windows headers
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <tchar.h>
+#include <mmsystem.h>
+#include <d3d9.h>
+#include <d3dx9.h>
+#include <math.h>
+#undef interface
//============================================================
// CONSTANTS
@@ -33,13 +42,11 @@
#define D3DTSS_MAXMIPLEVEL 20
#define D3DTSS_MAXANISOTROPY 21
-namespace d3d
-{
//============================================================
// TYPE DEFINITIONS
//============================================================
-struct base;
+struct d3d_base;
struct device;
struct surface;
struct texture;
@@ -118,17 +125,17 @@ enum caps_index
struct interface
{
- HRESULT (*check_device_format)(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT adapterformat, DWORD usage, D3DRESOURCETYPE restype, D3DFORMAT format);
- HRESULT (*check_device_type)(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT format, D3DFORMAT backformat, BOOL windowed);
- HRESULT (*create_device)(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, HWND focus, DWORD behavior, present_parameters *params, device **dev);
- HRESULT (*enum_adapter_modes)(base *d3dptr, UINT adapter, D3DFORMAT format, UINT index, D3DDISPLAYMODE *mode);
- UINT (*get_adapter_count)(base *d3dptr);
- HRESULT (*get_adapter_display_mode)(base *d3dptr, UINT adapter, D3DDISPLAYMODE *mode);
- HRESULT (*get_adapter_identifier)(base *d3dptr, UINT adapter, DWORD flags, adapter_identifier *identifier);
- UINT (*get_adapter_mode_count)(base *d3dptr, UINT adapter, D3DFORMAT format);
- HMONITOR (*get_adapter_monitor)(base *d3dptr, UINT adapter);
- HRESULT (*get_caps_dword)(base *d3dptr, UINT adapter, D3DDEVTYPE devtype, caps_index which, DWORD *value);
- ULONG (*release)(base *d3dptr);
+ HRESULT (*check_device_format)(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT adapterformat, DWORD usage, D3DRESOURCETYPE restype, D3DFORMAT format);
+ HRESULT (*check_device_type)(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, D3DFORMAT format, D3DFORMAT backformat, BOOL windowed);
+ HRESULT (*create_device)(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, HWND focus, DWORD behavior, present_parameters *params, device **dev);
+ HRESULT (*enum_adapter_modes)(d3d_base *d3dptr, UINT adapter, D3DFORMAT format, UINT index, D3DDISPLAYMODE *mode);
+ UINT (*get_adapter_count)(d3d_base *d3dptr);
+ HRESULT (*get_adapter_display_mode)(d3d_base *d3dptr, UINT adapter, D3DDISPLAYMODE *mode);
+ HRESULT (*get_adapter_identifier)(d3d_base *d3dptr, UINT adapter, DWORD flags, adapter_identifier *identifier);
+ UINT (*get_adapter_mode_count)(d3d_base *d3dptr, UINT adapter, D3DFORMAT format);
+ HMONITOR (*get_adapter_monitor)(d3d_base *d3dptr, UINT adapter);
+ HRESULT (*get_caps_dword)(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE devtype, caps_index which, DWORD *value);
+ ULONG (*release)(d3d_base *d3dptr);
};
@@ -136,7 +143,7 @@ struct interface
// Direct3DDevice interfaces
//============================================================
-struct device_interface
+struct d3d_device_interface
{
HRESULT (*begin_scene)(device *dev);
HRESULT (*clear)(device *dev, DWORD count, const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil);
@@ -205,7 +212,7 @@ struct vertex_buffer_interface
// Core D3D object
//============================================================
-struct base
+struct d3d_base
{
// internal objects
int version;
@@ -216,7 +223,7 @@ struct base
// interface pointers
interface d3d;
- device_interface device;
+ d3d_device_interface device;
surface_interface surface;
texture_interface texture;
vertex_buffer_interface vertexbuf;
@@ -227,8 +234,6 @@ struct base
// PROTOTYPES
//============================================================
-base *drawd3d9_init(void);
-
-}
+d3d_base *drawd3d9_init(void);
#endif
diff --git a/src/osd/modules/render/d3dtarget.h b/src/osd/modules/render/d3dtarget.h
new file mode 100644
index 00000000000..9179b2d43ba
--- /dev/null
+++ b/src/osd/modules/render/d3dtarget.h
@@ -0,0 +1,14 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// d3dtarget.h - Direct3D HLSL targets
+//
+//============================================================
+
+#pragma once
+
+#ifndef __D3DTARGET__
+#define __D3DTARGET__
+
+#endif // __D3DTARGET__ \ No newline at end of file
diff --git a/src/osd/modules/render/draw13.cpp b/src/osd/modules/render/draw13.cpp
index f357d567e71..7874cd16ea1 100644
--- a/src/osd/modules/render/draw13.cpp
+++ b/src/osd/modules/render/draw13.cpp
@@ -18,13 +18,11 @@
#include "emu.h"
#include "options.h"
-// standard SDL headers
-#include "sdlinc.h"
-
// OSD headers
#include "osdsdl.h"
#include "window.h"
+#include "draw13.h"
//============================================================
// DEBUGGING
@@ -59,202 +57,38 @@ static inline bool is_transparent(const float &a)
}
//============================================================
-// TYPES
-//============================================================
-
-
-struct quad_setup_data
-{
- quad_setup_data()
- : dudx(0), dvdx(0), dudy(0), dvdy(0), startu(0), startv(0),
- rotwidth(0), rotheight(0)
- {}
- void compute(const render_primitive &prim, const int prescale);
-
- INT32 dudx, dvdx, dudy, dvdy;
- INT32 startu, startv;
- INT32 rotwidth, rotheight;
-};
-
-//============================================================
-// Textures
-//============================================================
-
-class sdl_info13;
-struct copy_info_t;
-
-/* texture_info holds information about a texture */
-class texture_info
-{
- friend class simple_list<texture_info>;
-public:
- texture_info(sdl_info13 *renderer, const render_texinfo &texsource, const quad_setup_data &setup, const UINT32 flags);
- ~texture_info();
-
- void set_data(const render_texinfo &texsource, const UINT32 flags);
- void render_quad(const render_primitive *prim, const int x, const int y);
- bool matches(const render_primitive &prim, const quad_setup_data &setup);
-
- copy_info_t *compute_size_type();
-
- void *m_pixels; // pixels for the texture
- int m_pitch;
-
- copy_info_t *m_copyinfo;
- quad_setup_data m_setup;
-
- osd_ticks_t m_last_access;
-
- int raw_width() const { return m_texinfo.width; }
- int raw_height() const { return m_texinfo.height; }
-
- texture_info *next() { return m_next; }
- const render_texinfo &texinfo() const { return m_texinfo; }
- render_texinfo &texinfo() { return m_texinfo; }
-
- HashT hash() const { return m_hash; }
- UINT32 flags() const { return m_flags; }
- // FIXME:
- bool is_pixels_owned() const;
-
-private:
- Uint32 m_sdl_access;
- sdl_info13 * m_renderer;
- render_texinfo m_texinfo; // copy of the texture info
- HashT m_hash; // hash value for the texture (must be >= pointer size)
- UINT32 m_flags; // rendering flags
-
- SDL_Texture * m_texture_id;
- bool m_is_rotated;
-
- int m_format; // texture format
- SDL_BlendMode m_sdl_blendmode;
-
- texture_info * m_next; // next texture in the list
-};
-
-//============================================================
-// TEXCOPY FUNCS
+// CONSTRUCTOR & DESTRUCTOR
//============================================================
-enum SDL_TEXFORMAT_E
+renderer_sdl1::renderer_sdl1(osd_window *window, int extra_flags)
+ : osd_renderer(window, extra_flags)
+ , m_sdl_renderer(nullptr)
+ , m_blittimer(0)
+ , m_last_hofs(0)
+ , m_last_vofs(0)
+ , m_width(0)
+ , m_height(0)
+ , m_blit_dim(0, 0)
+ , m_last_blit_time(0)
+ , m_last_blit_pixels(0)
{
- SDL_TEXFORMAT_ARGB32 = 0,
- SDL_TEXFORMAT_RGB32,
- SDL_TEXFORMAT_RGB32_PALETTED,
- SDL_TEXFORMAT_YUY16,
- SDL_TEXFORMAT_YUY16_PALETTED,
- SDL_TEXFORMAT_PALETTE16,
- SDL_TEXFORMAT_RGB15,
- SDL_TEXFORMAT_RGB15_PALETTED,
- SDL_TEXFORMAT_PALETTE16A,
- SDL_TEXFORMAT_PALETTE16_ARGB1555,
- SDL_TEXFORMAT_RGB15_ARGB1555,
- SDL_TEXFORMAT_RGB15_PALETTED_ARGB1555,
- SDL_TEXFORMAT_LAST = SDL_TEXFORMAT_RGB15_PALETTED_ARGB1555
-};
-
-#include "blit13.h"
-
-/* sdl_info is the information about SDL for the current screen */
-class sdl_info13 : public osd_renderer
-{
-public:
- sdl_info13(osd_window *w, int extra_flags)
- : osd_renderer(w, extra_flags), m_sdl_renderer(NULL), m_blittimer(0),
- m_last_hofs(0), m_last_vofs(0),
- m_width(0), m_height(0),
- m_blit_dim(0,0),
- m_last_blit_time(0), m_last_blit_pixels(0)
+ for (int i = 0; i < 30; i++)
{
- for (int i=0; i < 30; i++)
- {
- fmt_support[i].format = 0;
- fmt_support[i].status = 0;
- }
+ fmt_support[i].format = 0;
+ fmt_support[i].status = 0;
}
- /* virtual */ int create() override;
- /* virtual */ int draw(const int update) override;
- /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
- /* virtual */ void destroy() override;
- /* virtual */ render_primitive_list *get_primitives() override
+ if (!s_blit_info_initialized)
{
- osd_dim nd = window().blit_surface_size();
- if (nd != m_blit_dim)
- {
- m_blit_dim = nd;
- notify_changed();
- }
- window().target()->set_bounds(m_blit_dim.width(), m_blit_dim.height(), window().aspect());
- return &window().target()->get_primitives();
+ /* On OSX, calling this from drawsdl2_init will
+ * prohibit fullscreen toggling. It is than not possible
+ * to toggle from fullscreen to window mode.
+ */
+ expand_copy_info(s_blit_info_default);
+ s_blit_info_initialized = true;
}
- int RendererSupportsFormat(Uint32 format, Uint32 access, const char *sformat);
-
- SDL_Renderer * m_sdl_renderer;
-
-private:
- void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y);
-
- texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup);
- texture_info *texture_update(const render_primitive &prim);
-
- void destroy_all_textures();
-
- INT32 m_blittimer;
-
-#if (SDLMAME_SDL2)
- //SDL_GLContext m_gl_context_id;
-#else
- // SDL surface
- SDL_Surface *m_sdlsurf;
-#endif
-
- simple_list<texture_info> m_texlist; // list of active textures
-
- float m_last_hofs;
- float m_last_vofs;
-
- int m_width;
- int m_height;
-
- osd_dim m_blit_dim;
-
- struct
- {
- Uint32 format;
- int status;
- } fmt_support[30];
-
- // Stats
- INT64 m_last_blit_time;
- INT64 m_last_blit_pixels;
-};
-
-struct copy_info_t {
- int src_fmt;
- Uint32 dst_fmt;
- const blit_base *blitter;
- Uint32 bm_mask;
- const char *srcname;
- const char *dstname;
- /* Statistics */
- UINT64 pixel_count;
- INT64 time;
- int samples;
- int perf;
- /* list */
- copy_info_t *next;
-};
-
-
-//============================================================
-// PROTOTYPES
-//============================================================
-
-// core functions
+}
-static void drawsdl2_exit(void);
//============================================================
// STATIC VARIABLES
@@ -267,7 +101,7 @@ static void drawsdl2_exit(void);
#define ENTRY_BM(a,b,f,bm) { SDL_TEXFORMAT_ ## a, SDL_PIXELFORMAT_ ## b, &texcopy_ ## f, bm, #a, #b, 0, 0, 0, 0}
#define ENTRY_LR(a,b,f) { SDL_TEXFORMAT_ ## a, SDL_PIXELFORMAT_ ## b, &texcopy_ ## f, BM_ALL, #a, #b, 0, 0, 0, -1}
-static copy_info_t blit_info_default[] =
+const copy_info_t renderer_sdl1::s_blit_info_default[] =
{
/* no rotation */
ENTRY(ARGB32, ARGB8888, argb32_argb32),
@@ -346,8 +180,8 @@ static copy_info_t blit_info_default[] =
{ -1 },
};
-static copy_info_t *blit_info[SDL_TEXFORMAT_LAST+1] = { NULL };
-static bool blit_info_initialized = false;
+copy_info_t* renderer_sdl1::s_blit_info[SDL_TEXFORMAT_LAST+1] = { nullptr };
+bool renderer_sdl1::s_blit_info_initialized = false;
//============================================================
// INLINES
@@ -382,7 +216,7 @@ static inline SDL_BlendMode map_blendmode(const int blendmode)
return SDL_BLENDMODE_NONE;
}
-static inline void set_coloralphamode(SDL_Texture *texture_id, const render_color *color)
+void texture_info::set_coloralphamode(SDL_Texture *texture_id, const render_color *color)
{
UINT32 sr = (UINT32)(255.0f * color->r);
UINT32 sg = (UINT32)(255.0f * color->g);
@@ -427,12 +261,12 @@ void texture_info::render_quad(const render_primitive *prim, const int x, const
set_coloralphamode(m_texture_id, &prim->color);
//printf("%d %d %d %d\n", target_rect.x, target_rect.y, target_rect.w, target_rect.h);
// Arghhh .. Just another bug. SDL_RenderCopy has severe issues with scaling ...
- SDL_RenderCopy(m_renderer->m_sdl_renderer, m_texture_id, NULL, &target_rect);
- //SDL_RenderCopyEx(m_renderer->m_sdl_renderer, m_texture_id, NULL, &target_rect, 0, NULL, SDL_FLIP_NONE);
- //SDL_RenderCopyEx(m_renderer->m_sdl_renderer, m_texture_id, NULL, NULL, 0, NULL, SDL_FLIP_NONE);
+ SDL_RenderCopy(m_renderer->m_sdl_renderer, m_texture_id, nullptr, &target_rect);
+ //SDL_RenderCopyEx(m_renderer->m_sdl_renderer, m_texture_id, nullptr, &target_rect, 0, nullptr, SDL_FLIP_NONE);
+ //SDL_RenderCopyEx(m_renderer->m_sdl_renderer, m_texture_id, nullptr, nullptr, 0, nullptr, SDL_FLIP_NONE);
}
-void sdl_info13::render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y)
+void renderer_sdl1::render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y)
{
SDL_Rect target_rect;
@@ -469,11 +303,10 @@ void sdl_info13::render_quad(texture_info *texture, const render_primitive *prim
}
}
-int sdl_info13::RendererSupportsFormat(Uint32 format, Uint32 access, const char *sformat)
+int renderer_sdl1::RendererSupportsFormat(Uint32 format, Uint32 access, const char *sformat)
{
int i;
- SDL_Texture *texid;
- for (i=0; fmt_support[i].format != 0; i++)
+ for (i = 0; fmt_support[i].format != 0; i++)
{
if (format == fmt_support[i].format)
{
@@ -483,7 +316,7 @@ int sdl_info13::RendererSupportsFormat(Uint32 format, Uint32 access, const char
/* not tested yet */
fmt_support[i].format = format;
fmt_support[i + 1].format = 0;
- texid = SDL_CreateTexture(m_sdl_renderer, format, access, 16, 16);
+ SDL_Texture *texid = SDL_CreateTexture(m_sdl_renderer, format, access, 16, 16);
if (texid)
{
fmt_support[i].status = 1;
@@ -500,7 +333,7 @@ int sdl_info13::RendererSupportsFormat(Uint32 format, Uint32 access, const char
// drawsdl_init
//============================================================
-static void add_list(copy_info_t **head, copy_info_t *element, Uint32 bm)
+void renderer_sdl1::add_list(copy_info_t **head, const copy_info_t *element, Uint32 bm)
{
copy_info_t *newci = global_alloc(copy_info_t);
*newci = *element;
@@ -510,123 +343,50 @@ static void add_list(copy_info_t **head, copy_info_t *element, Uint32 bm)
*head = newci;
}
-static void expand_copy_info(copy_info_t *list)
+void renderer_sdl1::expand_copy_info(const copy_info_t *list)
{
- copy_info_t *bi;
-
- for (bi = list; bi->src_fmt != -1; bi++)
+ for (const copy_info_t *bi = list; bi->src_fmt != -1; bi++)
{
if (bi->bm_mask == BM_ALL)
{
- add_list(&blit_info[bi->src_fmt], bi, SDL_BLENDMODE_NONE);
- add_list(&blit_info[bi->src_fmt], bi, SDL_BLENDMODE_ADD);
- add_list(&blit_info[bi->src_fmt], bi, SDL_BLENDMODE_MOD);
- add_list(&blit_info[bi->src_fmt], bi, SDL_BLENDMODE_BLEND);
+ add_list(&s_blit_info[bi->src_fmt], bi, SDL_BLENDMODE_NONE);
+ add_list(&s_blit_info[bi->src_fmt], bi, SDL_BLENDMODE_ADD);
+ add_list(&s_blit_info[bi->src_fmt], bi, SDL_BLENDMODE_MOD);
+ add_list(&s_blit_info[bi->src_fmt], bi, SDL_BLENDMODE_BLEND);
}
else
- add_list(&blit_info[bi->src_fmt], bi, bi->bm_mask);
- }
-}
-
-static osd_renderer *drawsdl2_create(osd_window *window)
-{
- if (!blit_info_initialized)
- {
- /* On OSX, calling this from drawsdl2_init will
- * prohibit fullscreen toggling. It is than not possible
- * to toggle from fullscreen to window mode.
- */
- expand_copy_info(blit_info_default);
- blit_info_initialized = true;
-
+ {
+ add_list(&s_blit_info[bi->src_fmt], bi, bi->bm_mask);
+ }
}
- return global_alloc(sdl_info13(window, osd_renderer::FLAG_NONE));
}
// FIXME: machine only used to access options.
-int drawsdl2_init(running_machine &machine, osd_draw_callbacks *callbacks)
+bool renderer_sdl1::init(running_machine &machine)
{
- // fill in the callbacks
- callbacks->exit = drawsdl2_exit;
- callbacks->create = drawsdl2_create;
-
osd_printf_verbose("Using SDL native texturing driver (SDL 2.0+)\n");
#if USE_OPENGL
// Load the GL library now - else MT will fail
const char *stemp = downcast<sdl_options &>(machine.options()).gl_lib();
#else
- const char *stemp = NULL;
+ const char *stemp = nullptr;
#endif
- if (stemp != NULL && strcmp(stemp, OSDOPTVAL_AUTO) == 0)
- stemp = NULL;
+ if (stemp != nullptr && strcmp(stemp, OSDOPTVAL_AUTO) == 0)
+ stemp = nullptr;
// No fatalerror here since not all video drivers support GL !
- if (SDL_GL_LoadLibrary(stemp) != 0) // Load library (default for e==NULL
+ if (SDL_GL_LoadLibrary(stemp) != 0) // Load library (default for e==nullptr
osd_printf_warning("Warning: Unable to load opengl library: %s\n", stemp ? stemp : "<default>");
else
osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
- return 0;
+ return false;
}
//============================================================
-// drawsdl_exit
-//============================================================
-
-static void drawsdl2_exit(void)
-{
- int i;
- copy_info_t *bi, *freeme;
- if (blit_info_initialized)
- {
- for (i = 0; i <= SDL_TEXFORMAT_LAST; i++)
- {
- for (bi = blit_info[i]; bi != NULL; )
- {
- if (bi->pixel_count)
- osd_printf_verbose("%s -> %s %s blendmode 0x%02x, %d samples: %d KPixel/sec\n", bi->srcname, bi->dstname,
- bi->blitter->m_is_rot ? "rot" : "norot", bi->bm_mask, bi->samples,
- (int) bi->perf);
- freeme = bi;
- bi = bi->next;
- global_free(freeme);
- }
- blit_info[i] = NULL;
- }
- blit_info_initialized = false;
- }
-}
-
-//============================================================
// sdl_info::create
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
//============================================================
static void drawsdl_show_info(struct SDL_RendererInfo *render_info)
@@ -648,20 +408,19 @@ static void drawsdl_show_info(struct SDL_RendererInfo *render_info)
RF_ENTRY(SDL_RENDERER_PRESENTVSYNC),
RF_ENTRY(SDL_RENDERER_ACCELERATED),
RF_ENTRY(SDL_RENDERER_TARGETTEXTURE),
- {-1, NULL}
+ {-1, nullptr}
};
int i;
osd_printf_verbose("window: using renderer %s\n", render_info->name ? render_info->name : "<unknown>");
- for (i = 0; rflist[i].name != NULL; i++)
+ for (i = 0; rflist[i].name != nullptr; i++)
if (render_info->flags & rflist[i].flag)
osd_printf_verbose("renderer: flag %s\n", rflist[i].name);
}
-int sdl_info13::create()
+int renderer_sdl1::create()
{
-#if (SDLMAME_SDL2)
// create renderer
/* Enable bilinear filtering in case it is supported.
@@ -692,37 +451,22 @@ int sdl_info13::create()
m_blittimer = 3;
//SDL_RenderPresent(m_sdl_renderer);
- osd_printf_verbose("Leave sdl_info13::create\n");
+ osd_printf_verbose("Leave renderer_sdl1::create\n");
struct SDL_RendererInfo render_info;
SDL_GetRendererInfo(m_sdl_renderer, &render_info);
drawsdl_show_info(&render_info);
-#else
-
-#endif
return 0;
}
//============================================================
-// sdl_info::destroy
-//============================================================
-
-void sdl_info13::destroy()
-{
- destroy_all_textures();
- SDL_DestroyRenderer(m_sdl_renderer);
- m_sdl_renderer = NULL;
-}
-
-
-//============================================================
// drawsdl_xy_to_render_target
//============================================================
-int sdl_info13::xy_to_render_target(int x, int y, int *xt, int *yt)
+int renderer_sdl1::xy_to_render_target(int x, int y, int *xt, int *yt)
{
*xt = x - m_last_hofs;
*yt = y - m_last_vofs;
@@ -737,7 +481,7 @@ int sdl_info13::xy_to_render_target(int x, int y, int *xt, int *yt)
// drawsdl_destroy_all_textures
//============================================================
-void sdl_info13::destroy_all_textures()
+void renderer_sdl1::destroy_all_textures()
{
if(window().m_primlist)
{
@@ -753,10 +497,10 @@ void sdl_info13::destroy_all_textures()
// sdl_info::draw
//============================================================
-int sdl_info13::draw(int update)
+int renderer_sdl1::draw(int update)
{
render_primitive *prim;
- texture_info *texture=NULL;
+ texture_info *texture=nullptr;
float vofs, hofs;
int blit_pixels = 0;
@@ -772,7 +516,7 @@ int sdl_info13::draw(int update)
destroy_all_textures();
m_width = wdim.width();
m_height = wdim.height();
- SDL_RenderSetViewport(m_sdl_renderer, NULL);
+ SDL_RenderSetViewport(m_sdl_renderer, nullptr);
m_blittimer = 3;
clear_flags(FI_CHANGED);
}
@@ -785,7 +529,7 @@ int sdl_info13::draw(int update)
SDL_SetRenderDrawBlendMode(m_sdl_renderer, SDL_BLENDMODE_NONE);
//SDL_SetRenderDrawColor(0,0,0,255);
SDL_SetRenderDrawColor(m_sdl_renderer, 0,0,0,0);
- SDL_RenderFillRect(m_sdl_renderer, NULL);
+ SDL_RenderFillRect(m_sdl_renderer, nullptr);
m_blittimer--;
}
@@ -815,7 +559,7 @@ int sdl_info13::draw(int update)
window().m_primlist->acquire_lock();
// now draw
- for (prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
{
Uint8 sr, sg, sb, sa;
@@ -866,11 +610,10 @@ int sdl_info13::draw(int update)
copy_info_t *texture_info::compute_size_type()
{
- copy_info_t *bi;
- copy_info_t *result = NULL;
+ copy_info_t *result = nullptr;
int maxperf = 0;
- for (bi = blit_info[m_format]; bi != NULL; bi = bi->next)
+ for (copy_info_t *bi = renderer_sdl1::s_blit_info[m_format]; bi != nullptr; bi = bi->next)
{
if ((m_is_rotated == bi->blitter->m_is_rot)
&& (m_sdl_blendmode == bi->bm_mask))
@@ -888,10 +631,12 @@ copy_info_t *texture_info::compute_size_type()
}
}
}
+
if (result)
return result;
+
/* try last resort handlers */
- for (bi = blit_info[m_format]; bi != NULL; bi = bi->next)
+ for (copy_info_t *bi = renderer_sdl1::s_blit_info[m_format]; bi != nullptr; bi = bi->next)
{
if ((m_is_rotated == bi->blitter->m_is_rot)
&& (m_sdl_blendmode == bi->bm_mask))
@@ -899,7 +644,7 @@ copy_info_t *texture_info::compute_size_type()
return bi;
}
//FIXME: crash implement a -do nothing handler */
- return NULL;
+ return nullptr;
}
// FIXME:
@@ -932,7 +677,7 @@ bool texture_info::matches(const render_primitive &prim, const quad_setup_data &
// texture_create
//============================================================
-texture_info::texture_info(sdl_info13 *renderer, const render_texinfo &texsource, const quad_setup_data &setup, UINT32 flags)
+texture_info::texture_info(renderer_sdl1 *renderer, const render_texinfo &texsource, const quad_setup_data &setup, UINT32 flags)
{
// fill in the core data
m_renderer = renderer;
@@ -994,7 +739,7 @@ texture_info::texture_info(sdl_info13 *renderer, const render_texinfo &texsource
if (m_sdl_access == SDL_TEXTUREACCESS_STATIC)
{
if (m_copyinfo->blitter->m_is_passthrough)
- m_pixels = NULL;
+ m_pixels = nullptr;
else
m_pixels = malloc(m_setup.rotwidth * m_setup.rotheight * m_copyinfo->blitter->m_dest_bpp);
}
@@ -1004,7 +749,7 @@ texture_info::texture_info(sdl_info13 *renderer, const render_texinfo &texsource
texture_info::~texture_info()
{
- if ( is_pixels_owned() && (m_pixels != NULL) )
+ if ( is_pixels_owned() && (m_pixels != nullptr) )
free(m_pixels);
SDL_DestroyTexture(m_texture_id);
}
@@ -1028,11 +773,11 @@ void texture_info::set_data(const render_texinfo &texsource, const UINT32 flags)
m_pitch = m_setup.rotwidth * m_copyinfo->blitter->m_dest_bpp;
m_copyinfo->blitter->texop(this, &texsource);
}
- SDL_UpdateTexture(m_texture_id, NULL, m_pixels, m_pitch);
+ SDL_UpdateTexture(m_texture_id, nullptr, m_pixels, m_pitch);
}
else
{
- SDL_LockTexture(m_texture_id, NULL, (void **) &m_pixels, &m_pitch);
+ SDL_LockTexture(m_texture_id, nullptr, (void **) &m_pixels, &m_pitch);
if ( m_copyinfo->blitter->m_is_passthrough )
{
UINT8 *src = (UINT8 *) texsource.base;
@@ -1120,14 +865,14 @@ void quad_setup_data::compute(const render_primitive &prim, const int prescale)
// texture_find
//============================================================
-texture_info *sdl_info13::texture_find(const render_primitive &prim, const quad_setup_data &setup)
+texture_info *renderer_sdl1::texture_find(const render_primitive &prim, const quad_setup_data &setup)
{
HashT texhash = texture_compute_hash(prim.texture, prim.flags);
texture_info *texture;
osd_ticks_t now = osd_ticks();
// find a match
- for (texture = m_texlist.first(); texture != NULL; )
+ for (texture = m_texlist.first(); texture != nullptr; )
if (texture->hash() == texhash &&
texture->matches(prim, setup))
{
@@ -1135,7 +880,7 @@ texture_info *sdl_info13::texture_find(const render_primitive &prim, const quad_
if ((texture->m_copyinfo->samples & 0x7f) == 0x7f)
{
if (texture->m_copyinfo != texture->compute_size_type())
- return NULL;
+ return nullptr;
}
texture->m_last_access = now;
return texture;
@@ -1150,14 +895,14 @@ texture_info *sdl_info13::texture_find(const render_primitive &prim, const quad_
}
// nothing found
- return NULL;
+ return nullptr;
}
//============================================================
// texture_update
//============================================================
-texture_info * sdl_info13::texture_update(const render_primitive &prim)
+texture_info * renderer_sdl1::texture_update(const render_primitive &prim)
{
quad_setup_data setup;
texture_info *texture;
@@ -1167,16 +912,16 @@ texture_info * sdl_info13::texture_update(const render_primitive &prim)
texture = texture_find(prim, setup);
// if we didn't find one, create a new texture
- if (texture == NULL && prim.texture.base != NULL)
+ if (texture == nullptr && prim.texture.base != nullptr)
{
texture = global_alloc(texture_info(this, prim.texture, setup, prim.flags));
/* add us to the texture list */
m_texlist.prepend(*texture);
}
- if (texture != NULL)
+ if (texture != nullptr)
{
- if (prim.texture.base != NULL && texture->texinfo().seqid != prim.texture.seqid)
+ if (prim.texture.base != nullptr && texture->texinfo().seqid != prim.texture.seqid)
{
texture->texinfo().seqid = prim.texture.seqid;
// if we found it, but with a different seqid, copy the data
@@ -1186,3 +931,15 @@ texture_info * sdl_info13::texture_update(const render_primitive &prim)
}
return texture;
}
+
+render_primitive_list *renderer_sdl1::get_primitives()
+{
+ osd_dim nd = window().blit_surface_size();
+ if (nd != m_blit_dim)
+ {
+ m_blit_dim = nd;
+ notify_changed();
+ }
+ window().target()->set_bounds(m_blit_dim.width(), m_blit_dim.height(), window().aspect());
+ return &window().target()->get_primitives();
+}
diff --git a/src/osd/modules/render/draw13.h b/src/osd/modules/render/draw13.h
new file mode 100644
index 00000000000..7335bd5be81
--- /dev/null
+++ b/src/osd/modules/render/draw13.h
@@ -0,0 +1,229 @@
+// license:BSD-3-Clause
+// copyright-holders:Couriersud, Olivier Galibert, R. Belmont
+//============================================================
+//
+// draw13.h - SDL 2.0 drawing implementation
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAW13__
+#define __DRAW13__
+
+// OSD headers
+#ifndef OSD_WINDOWS
+#include "osdsdl.h"
+#include "window.h"
+#else
+#include "../windows/window.h"
+typedef UINT64 HashT;
+#endif
+
+// standard SDL headers
+#include "sdl/sdlinc.h"
+
+struct quad_setup_data
+{
+ quad_setup_data()
+ : dudx(0)
+ , dvdx(0)
+ , dudy(0)
+ , dvdy(0)
+ , startu(0)
+ , startv(0)
+ , rotwidth(0)
+ , rotheight(0)
+ {
+ }
+
+ void compute(const render_primitive &prim, const int prescale);
+
+ INT32 dudx, dvdx, dudy, dvdy;
+ INT32 startu, startv;
+ INT32 rotwidth, rotheight;
+};
+
+//============================================================
+// Textures
+//============================================================
+
+class renderer_sdl1;
+struct copy_info_t;
+
+/* texture_info holds information about a texture */
+class texture_info
+{
+ friend class simple_list<texture_info>;
+public:
+ texture_info(renderer_sdl1 *renderer, const render_texinfo &texsource, const quad_setup_data &setup, const UINT32 flags);
+ ~texture_info();
+
+ void set_data(const render_texinfo &texsource, const UINT32 flags);
+ void render_quad(const render_primitive *prim, const int x, const int y);
+ bool matches(const render_primitive &prim, const quad_setup_data &setup);
+
+ copy_info_t *compute_size_type();
+
+ void *m_pixels; // pixels for the texture
+ int m_pitch;
+
+ copy_info_t *m_copyinfo;
+ quad_setup_data m_setup;
+
+ osd_ticks_t m_last_access;
+
+ int raw_width() const { return m_texinfo.width; }
+ int raw_height() const { return m_texinfo.height; }
+
+ texture_info *next() { return m_next; }
+ const render_texinfo &texinfo() const { return m_texinfo; }
+ render_texinfo &texinfo() { return m_texinfo; }
+
+ HashT hash() const { return m_hash; }
+ UINT32 flags() const { return m_flags; }
+ // FIXME:
+ bool is_pixels_owned() const;
+
+private:
+ void set_coloralphamode(SDL_Texture *texture_id, const render_color *color);
+
+ Uint32 m_sdl_access;
+ renderer_sdl1 * m_renderer;
+ render_texinfo m_texinfo; // copy of the texture info
+ HashT m_hash; // hash value for the texture (must be >= pointer size)
+ UINT32 m_flags; // rendering flags
+
+ SDL_Texture * m_texture_id;
+ bool m_is_rotated;
+
+ int m_format; // texture format
+ SDL_BlendMode m_sdl_blendmode;
+
+ texture_info * m_next; // next texture in the list
+};
+
+//============================================================
+// TEXCOPY FUNCS
+//============================================================
+
+enum SDL_TEXFORMAT_E
+{
+ SDL_TEXFORMAT_ARGB32 = 0,
+ SDL_TEXFORMAT_RGB32,
+ SDL_TEXFORMAT_RGB32_PALETTED,
+ SDL_TEXFORMAT_YUY16,
+ SDL_TEXFORMAT_YUY16_PALETTED,
+ SDL_TEXFORMAT_PALETTE16,
+ SDL_TEXFORMAT_RGB15,
+ SDL_TEXFORMAT_RGB15_PALETTED,
+ SDL_TEXFORMAT_PALETTE16A,
+ SDL_TEXFORMAT_PALETTE16_ARGB1555,
+ SDL_TEXFORMAT_RGB15_ARGB1555,
+ SDL_TEXFORMAT_RGB15_PALETTED_ARGB1555,
+ SDL_TEXFORMAT_LAST = SDL_TEXFORMAT_RGB15_PALETTED_ARGB1555
+};
+
+#include "blit13.h"
+
+struct copy_info_t
+{
+ int src_fmt;
+ Uint32 dst_fmt;
+ const blit_base *blitter;
+ Uint32 bm_mask;
+ const char *srcname;
+ const char *dstname;
+ /* Statistics */
+ UINT64 pixel_count;
+ INT64 time;
+ int samples;
+ int perf;
+ /* list */
+ copy_info_t *next;
+};
+
+/* sdl_info is the information about SDL for the current screen */
+class renderer_sdl1 : public osd_renderer
+{
+public:
+ renderer_sdl1(osd_window *window, int extra_flags);
+
+ virtual ~renderer_sdl1()
+ {
+ destroy_all_textures();
+ SDL_DestroyRenderer(m_sdl_renderer);
+ m_sdl_renderer = nullptr;
+
+ if (s_blit_info_initialized)
+ {
+ for (int i = 0; i <= SDL_TEXFORMAT_LAST; i++)
+ {
+ for (copy_info_t *bi = s_blit_info[i]; bi != nullptr; )
+ {
+ if (bi->pixel_count)
+ osd_printf_verbose("%s -> %s %s blendmode 0x%02x, %d samples: %d KPixel/sec\n", bi->srcname, bi->dstname,
+ bi->blitter->m_is_rot ? "rot" : "norot", bi->bm_mask, bi->samples,
+ (int) bi->perf);
+ copy_info_t *freeme = bi;
+ bi = bi->next;
+ global_free(freeme);
+ }
+ s_blit_info[i] = nullptr;
+ }
+ s_blit_info_initialized = false;
+ }
+ }
+
+ virtual int create() override;
+ static bool init(running_machine &machine);
+ virtual int draw(const int update) override;
+ virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
+ virtual render_primitive_list *get_primitives() override;
+ int RendererSupportsFormat(Uint32 format, Uint32 access, const char *sformat);
+
+ SDL_Renderer * m_sdl_renderer;
+
+ static copy_info_t* s_blit_info[SDL_TEXFORMAT_LAST+1];
+
+private:
+ void expand_copy_info(const copy_info_t *list);
+ void add_list(copy_info_t **head, const copy_info_t *element, Uint32 bm);
+
+ void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y);
+
+ texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup);
+ texture_info *texture_update(const render_primitive &prim);
+
+ void destroy_all_textures();
+
+ INT32 m_blittimer;
+
+
+ simple_list<texture_info> m_texlist; // list of active textures
+
+ float m_last_hofs;
+ float m_last_vofs;
+
+ int m_width;
+ int m_height;
+
+ osd_dim m_blit_dim;
+
+ struct
+ {
+ Uint32 format;
+ int status;
+ } fmt_support[30];
+
+ // Stats
+ INT64 m_last_blit_time;
+ INT64 m_last_blit_pixels;
+
+ static bool s_blit_info_initialized;
+ static const copy_info_t s_blit_info_default[];
+};
+
+#endif // __DRAW13__ \ No newline at end of file
diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp
index 35a50609cf4..f2d58f4e4d5 100644
--- a/src/osd/modules/render/drawbgfx.cpp
+++ b/src/osd/modules/render/drawbgfx.cpp
@@ -1,8 +1,8 @@
// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic,Dario Manesku,Branimir Karadzic,Aaron Giles
+// copyright-holders:Miodrag Milanovic,Ryan Holtz,Dario Manesku,Branimir Karadzic,Aaron Giles
//============================================================
//
-// drawbgfx.c - BGFX drawer
+// drawbgfx.cpp - BGFX renderer
//
//============================================================
#define __STDC_LIMIT_MACROS
@@ -14,11 +14,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if defined(SDLMAME_WIN32)
-#if (SDLMAME_SDL2)
#include <SDL2/SDL_syswm.h>
-#else
-#include <SDL/SDL_syswm.h>
-#endif
#endif
#else
#include "sdlinc.h"
@@ -32,6 +28,16 @@
#include <bgfx/bgfx.h>
#include <bx/fpumath.h>
#include <bx/readerwriter.h>
+#include <algorithm>
+
+#include "drawbgfx.h"
+#include "bgfx/texturemanager.h"
+#include "bgfx/targetmanager.h"
+#include "bgfx/shadermanager.h"
+#include "bgfx/effectmanager.h"
+#include "bgfx/effect.h"
+#include "bgfx/texture.h"
+#include "bgfx/target.h"
//============================================================
// DEBUGGING
@@ -45,6 +51,8 @@
// MACROS
//============================================================
+#define GIBBERISH (0)
+
//============================================================
// INLINES
//============================================================
@@ -55,87 +63,9 @@
//============================================================
-/* sdl_info is the information about SDL for the current screen */
-class renderer_bgfx : public osd_renderer
-{
-public:
- renderer_bgfx(osd_window *w)
- : osd_renderer(w, FLAG_NONE),
- m_dimensions(0,0)
- {}
-
- virtual int create() override;
- virtual int draw(const int update) override;
-#ifdef OSD_SDL
- virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
-#else
- virtual void save() override { }
- virtual void record() override { }
- virtual void toggle_fsfx() override { }
-#endif
- virtual void destroy() override;
- virtual render_primitive_list *get_primitives() override
- {
- osd_dim wdim = window().get_size();
- window().target()->set_bounds(wdim.width(), wdim.height(), window().aspect());
- return &window().target()->get_primitives();
- }
-
- bgfx::ProgramHandle m_progQuad;
- bgfx::ProgramHandle m_progQuadTexture;
- bgfx::ProgramHandle m_progLine;
- bgfx::UniformHandle m_s_texColor;
- bgfx::FrameBufferHandle fbh;
- // Original display_mode
- osd_dim m_dimensions;
-};
-
-
-//============================================================
-// PROTOTYPES
-//============================================================
-
-// core functions
-static void drawbgfx_exit(void);
-
-//============================================================
-// drawnone_create
-//============================================================
-
-static osd_renderer *drawbgfx_create(osd_window *window)
-{
- return global_alloc(renderer_bgfx(window));
-}
-
-//============================================================
-// drawbgfx_init
-//============================================================
-
-int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks)
-{
- // fill in the callbacks
- //memset(callbacks, 0, sizeof(*callbacks));
- callbacks->exit = drawbgfx_exit;
- callbacks->create = drawbgfx_create;
-
- return 0;
-}
-
-//============================================================
-// drawbgfx_exit
-//============================================================
-
-static void drawbgfx_exit(void)
-{
- // Shutdown bgfx.
- bgfx::shutdown();
-}
-
//============================================================
// renderer_bgfx::create
//============================================================
-bgfx::ProgramHandle loadProgram(const char* _vsName, const char* _fsName);
-
#ifdef OSD_SDL
static void* sdlNativeWindowHandle(SDL_Window* _window)
@@ -144,7 +74,7 @@ static void* sdlNativeWindowHandle(SDL_Window* _window)
SDL_VERSION(&wmi.version);
if (!SDL_GetWindowWMInfo(_window, &wmi))
{
- return NULL;
+ return nullptr;
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
@@ -153,6 +83,10 @@ static void* sdlNativeWindowHandle(SDL_Window* _window)
return wmi.info.cocoa.window;
# elif BX_PLATFORM_WINDOWS
return wmi.info.win.window;
+# elif BX_PLATFORM_STEAMLINK
+ return wmi.info.vivante.window;
+# elif BX_PLATFORM_EMSCRIPTEN
+ return nullptr;
# endif // BX_PLATFORM_
}
#endif
@@ -162,6 +96,8 @@ int renderer_bgfx::create()
// create renderer
osd_dim wdim = window().get_size();
+ m_width[window().m_index] = wdim.width();
+ m_height[window().m_index] = wdim.height();
if (window().m_index == 0)
{
#ifdef OSD_WINDOWS
@@ -170,43 +106,62 @@ int renderer_bgfx::create()
bgfx::sdlSetWindow(window().sdl_window());
#endif
bgfx::init();
- bgfx::reset(wdim.width(), wdim.height(), video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE);
+ bgfx::reset(m_width[window().m_index], m_height[window().m_index], video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE);
// Enable debug text.
bgfx::setDebug(BGFX_DEBUG_TEXT); //BGFX_DEBUG_STATS
- m_dimensions = osd_dim(wdim.width(), wdim.height());
+ m_dimensions = osd_dim(m_width[0], m_height[0]);
+
+ ScreenVertex::init();
}
- else {
+
+ m_textures = new texture_manager();
+ m_targets = new target_manager(*m_textures);
+ m_shaders = new shader_manager();
+ m_effects = new effect_manager(*m_shaders);
+
+ if (window().m_index != 0)
+ {
#ifdef OSD_WINDOWS
- fbh = bgfx::createFrameBuffer(window().m_hwnd, wdim.width(), wdim.height());
+ m_framebuffer = m_targets->create_target("backbuffer", window().m_hwnd, m_width[window().m_index], m_height[window().m_index]);
#else
- fbh = bgfx::createFrameBuffer(sdlNativeWindowHandle(window().sdl_window()), wdim.width(), wdim.height());
+ m_framebuffer = m_targets->create_target("backbuffer", sdlNativeWindowHandle(window().sdl_window()), m_width[window().m_index], m_height[window().m_index]);
#endif
- bgfx::touch(window().m_index);
- }
+ bgfx::touch(window().m_index);
+ }
+
// Create program from shaders.
- m_progQuad = loadProgram("vs_quad", "fs_quad");
- m_progQuadTexture = loadProgram("vs_quad_texture", "fs_quad_texture");
- m_progLine = loadProgram("vs_line", "fs_line");
- m_s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
+ m_gui_effect[0] = m_effects->effect("gui_opaque");
+ m_gui_effect[1] = m_effects->effect("gui_blend");
+ m_gui_effect[2] = m_effects->effect("gui_multiply");
+ m_gui_effect[3] = m_effects->effect("gui_add");
+
+ m_screen_effect[0] = m_effects->effect("screen_opaque");
+ m_screen_effect[1] = m_effects->effect("screen_blend");
+ m_screen_effect[2] = m_effects->effect("screen_multiply");
+ m_screen_effect[3] = m_effects->effect("screen_add");
+
+ uint32_t flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP | BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT;
+ m_texture_cache = m_textures->create_texture("#cache", bgfx::TextureFormat::RGBA8, CACHE_SIZE, CACHE_SIZE, nullptr, flags);
+
+ memset(m_white, 0xff, sizeof(uint32_t) * 16 * 16);
+ m_texinfo.push_back(rectangle_packer::packable_rectangle(WHITE_HASH, PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32), 16, 16, 16, nullptr, m_white));
return 0;
}
//============================================================
-// drawbgfx_window_destroy
+// destructor
//============================================================
-void renderer_bgfx::destroy()
+renderer_bgfx::~renderer_bgfx()
{
- if (window().m_index > 0)
- {
- bgfx::destroyFrameBuffer(fbh);
- }
- bgfx::destroyUniform(m_s_texColor);
// Cleanup.
- bgfx::destroyProgram(m_progQuad);
- bgfx::destroyProgram(m_progQuadTexture);
- bgfx::destroyProgram(m_progLine);
+ delete m_targets;
+ delete m_textures;
+ delete m_effects;
+ delete m_shaders;
+
+ bgfx::shutdown();
}
@@ -227,198 +182,180 @@ int renderer_bgfx::xy_to_render_target(int x, int y, int *xt, int *yt)
}
#endif
-static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePath)
+//============================================================
+// drawbgfx_window_draw
+//============================================================
+
+bgfx::VertexDecl renderer_bgfx::ScreenVertex::ms_decl;
+
+void renderer_bgfx::put_packed_quad(render_primitive *prim, UINT32 hash, ScreenVertex* vertex)
{
- if (bx::open(_reader, _filePath))
+ rectangle_packer::packed_rectangle& rect = m_hash_to_entry[hash];
+ float u0 = float(rect.x()) / float(CACHE_SIZE);
+ float v0 = float(rect.y()) / float(CACHE_SIZE);
+ float u1 = u0 + float(rect.width()) / float(CACHE_SIZE);
+ float v1 = v0 + float(rect.height()) / float(CACHE_SIZE);
+ u1 -= 0.5f / float(CACHE_SIZE);
+ v1 -= 0.5f / float(CACHE_SIZE);
+ u0 += 0.5f / float(CACHE_SIZE);
+ v0 += 0.5f / float(CACHE_SIZE);
+ UINT32 rgba = u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255);
+
+ float x[4] = { prim->bounds.x0, prim->bounds.x1, prim->bounds.x0, prim->bounds.x1 };
+ float y[4] = { prim->bounds.y0, prim->bounds.y0, prim->bounds.y1, prim->bounds.y1 };
+ float u[4] = { u0, u1, u0, u1 };
+ float v[4] = { v0, v0, v1, v1 };
+
+ if (PRIMFLAG_GET_TEXORIENT(prim->flags) & ORIENTATION_SWAP_XY)
{
- uint32_t size = (uint32_t)bx::getSize(_reader);
- const bgfx::Memory* mem = bgfx::alloc(size + 1);
- bx::read(_reader, mem->data, size);
- bx::close(_reader);
- mem->data[mem->size - 1] = '\0';
- return mem;
+ std::swap(u[1], u[2]);
+ std::swap(v[1], v[2]);
}
- return NULL;
-}
-static bgfx::ShaderHandle loadShader(bx::FileReaderI* _reader, const char* _name)
-{
- char filePath[512];
-
- const char* shaderPath = "shaders/dx9/";
-
- switch (bgfx::getRendererType())
+ if (PRIMFLAG_GET_TEXORIENT(prim->flags) & ORIENTATION_FLIP_X)
{
- case bgfx::RendererType::Direct3D11:
- case bgfx::RendererType::Direct3D12:
- shaderPath = "shaders/dx11/";
- break;
-
- case bgfx::RendererType::OpenGL:
- shaderPath = "shaders/glsl/";
- break;
-
- case bgfx::RendererType::Metal:
- shaderPath = "shaders/metal/";
- break;
-
- case bgfx::RendererType::OpenGLES:
- shaderPath = "shaders/gles/";
- break;
-
- default:
- break;
+ std::swap(u[0], u[1]);
+ std::swap(v[0], v[1]);
+ std::swap(u[2], u[3]);
+ std::swap(v[2], v[3]);
}
- strcpy(filePath, shaderPath);
- strcat(filePath, _name);
- strcat(filePath, ".bin");
-
- return bgfx::createShader(loadMem(_reader, filePath));
-}
-
-bgfx::ProgramHandle loadProgram(bx::FileReaderI* _reader, const char* _vsName, const char* _fsName)
-{
- bgfx::ShaderHandle vsh = loadShader(_reader, _vsName);
- bgfx::ShaderHandle fsh = BGFX_INVALID_HANDLE;
- if (NULL != _fsName)
+ if (PRIMFLAG_GET_TEXORIENT(prim->flags) & ORIENTATION_FLIP_Y)
{
- fsh = loadShader(_reader, _fsName);
+ std::swap(u[0], u[2]);
+ std::swap(v[0], v[2]);
+ std::swap(u[1], u[3]);
+ std::swap(v[1], v[3]);
}
- return bgfx::createProgram(vsh, fsh, true /* destroy shaders when program is destroyed */);
+ vertex[0].m_x = x[0]; // 0
+ vertex[0].m_y = y[0];
+ vertex[0].m_z = 0;
+ vertex[0].m_rgba = rgba;
+ vertex[0].m_u = u[0];
+ vertex[0].m_v = v[0];
+
+ vertex[1].m_x = x[1]; // 1
+ vertex[1].m_y = y[1];
+ vertex[1].m_z = 0;
+ vertex[1].m_rgba = rgba;
+ vertex[1].m_u = u[1];
+ vertex[1].m_v = v[1];
+
+ vertex[2].m_x = x[3]; // 3
+ vertex[2].m_y = y[3];
+ vertex[2].m_z = 0;
+ vertex[2].m_rgba = rgba;
+ vertex[2].m_u = u[3];
+ vertex[2].m_v = v[3];
+
+ vertex[3].m_x = x[3]; // 3
+ vertex[3].m_y = y[3];
+ vertex[3].m_z = 0;
+ vertex[3].m_rgba = rgba;
+ vertex[3].m_u = u[3];
+ vertex[3].m_v = v[3];
+
+ vertex[4].m_x = x[2]; // 2
+ vertex[4].m_y = y[2];
+ vertex[4].m_z = 0;
+ vertex[4].m_rgba = rgba;
+ vertex[4].m_u = u[2];
+ vertex[4].m_v = v[2];
+
+ vertex[5].m_x = x[0]; // 0
+ vertex[5].m_y = y[0];
+ vertex[5].m_z = 0;
+ vertex[5].m_rgba = rgba;
+ vertex[5].m_u = u[0];
+ vertex[5].m_v = v[0];
}
-static auto s_fileReader = new bx::CrtFileReader;
-bgfx::ProgramHandle loadProgram(const char* _vsName, const char* _fsName)
+void renderer_bgfx::render_textured_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer)
{
-
- return loadProgram(s_fileReader, _vsName, _fsName);
-}
-//============================================================
-// drawbgfx_window_draw
-//============================================================
+ ScreenVertex* vertex = (ScreenVertex*)buffer->data;
+
+ UINT32 rgba = u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255);
+
+ vertex[0].m_x = prim->bounds.x0;
+ vertex[0].m_y = prim->bounds.y0;
+ vertex[0].m_z = 0;
+ vertex[0].m_rgba = rgba;
+ vertex[0].m_u = prim->texcoords.tl.u;
+ vertex[0].m_v = prim->texcoords.tl.v;
+
+ vertex[1].m_x = prim->bounds.x1;
+ vertex[1].m_y = prim->bounds.y0;
+ vertex[1].m_z = 0;
+ vertex[1].m_rgba = rgba;
+ vertex[1].m_u = prim->texcoords.tr.u;
+ vertex[1].m_v = prim->texcoords.tr.v;
+
+ vertex[2].m_x = prim->bounds.x1;
+ vertex[2].m_y = prim->bounds.y1;
+ vertex[2].m_z = 0;
+ vertex[2].m_rgba = rgba;
+ vertex[2].m_u = prim->texcoords.br.u;
+ vertex[2].m_v = prim->texcoords.br.v;
+
+ vertex[3].m_x = prim->bounds.x1;
+ vertex[3].m_y = prim->bounds.y1;
+ vertex[3].m_z = 0;
+ vertex[3].m_rgba = rgba;
+ vertex[3].m_u = prim->texcoords.br.u;
+ vertex[3].m_v = prim->texcoords.br.v;
+
+ vertex[4].m_x = prim->bounds.x0;
+ vertex[4].m_y = prim->bounds.y1;
+ vertex[4].m_z = 0;
+ vertex[4].m_rgba = rgba;
+ vertex[4].m_u = prim->texcoords.bl.u;
+ vertex[4].m_v = prim->texcoords.bl.v;
+
+ vertex[5].m_x = prim->bounds.x0;
+ vertex[5].m_y = prim->bounds.y0;
+ vertex[5].m_z = 0;
+ vertex[5].m_rgba = rgba;
+ vertex[5].m_u = prim->texcoords.tl.u;
+ vertex[5].m_v = prim->texcoords.tl.v;
+ bgfx::setVertexBuffer(buffer);
-struct PosColorTexCoord0Vertex
-{
- float m_x;
- float m_y;
- float m_z;
- uint32_t m_rgba;
- float m_u;
- float m_v;
-
- static void init()
- {
- ms_decl.begin()
- .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
- .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
- .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
- .end();
- }
-
- static bgfx::VertexDecl ms_decl;
-};
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
-
-void screenQuad(float _x1
- , float _y1
- , float _x2
- , float _y2
- , uint32_t _abgr
- , render_quad_texuv uv
- )
-{
- if (bgfx::checkAvailTransientVertexBuffer(6, PosColorTexCoord0Vertex::ms_decl))
- {
- bgfx::TransientVertexBuffer vb;
- bgfx::allocTransientVertexBuffer(&vb, 6, PosColorTexCoord0Vertex::ms_decl);
- PosColorTexCoord0Vertex* vertex = (PosColorTexCoord0Vertex*)vb.data;
-
- const float minx = _x1;
- const float miny = _y1;
- const float maxx = _x2;
- const float maxy = _y2;
- const float zz = 0.0f;
-
- vertex[0].m_x = minx;
- vertex[0].m_y = miny;
- vertex[0].m_z = zz;
- vertex[0].m_rgba = _abgr;
- vertex[0].m_u = uv.tl.u;
- vertex[0].m_v = uv.tl.v;
-
- vertex[1].m_x = maxx;
- vertex[1].m_y = miny;
- vertex[1].m_z = zz;
- vertex[1].m_rgba = _abgr;
- vertex[1].m_u = uv.tr.u;
- vertex[1].m_v = uv.tr.v;
-
- vertex[2].m_x = maxx;
- vertex[2].m_y = maxy;
- vertex[2].m_z = zz;
- vertex[2].m_rgba = _abgr;
- vertex[2].m_u = uv.br.u;
- vertex[2].m_v = uv.br.v;
-
- vertex[3].m_x = maxx;
- vertex[3].m_y = maxy;
- vertex[3].m_z = zz;
- vertex[3].m_rgba = _abgr;
- vertex[3].m_u = uv.br.u;
- vertex[3].m_v = uv.br.v;
-
- vertex[4].m_x = minx;
- vertex[4].m_y = maxy;
- vertex[4].m_z = zz;
- vertex[4].m_rgba = _abgr;
- vertex[4].m_u = uv.bl.u;
- vertex[4].m_v = uv.bl.v;
-
- vertex[5].m_x = minx;
- vertex[5].m_y = miny;
- vertex[5].m_z = zz;
- vertex[5].m_rgba = _abgr;
- vertex[5].m_u = uv.tl.u;
- vertex[5].m_v = uv.tl.v;
- bgfx::setVertexBuffer(&vb);
+ uint32_t texture_flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP;
+ if (video_config.filter == 0)
+ {
+ texture_flags |= BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT;
}
-}
+ const bgfx::Memory* mem = mame_texture_data_to_bgfx_texture_data(prim->flags & PRIMFLAG_TEXFORMAT_MASK,
+ prim->texture.width, prim->texture.height, prim->texture.rowpixels, prim->texture.palette, prim->texture.base);
-struct PosColorVertex
-{
- float m_x;
- float m_y;
- uint32_t m_abgr;
+ bgfx::TextureHandle texture = bgfx::createTexture2D((uint16_t)prim->texture.width, (uint16_t)prim->texture.height, 1, bgfx::TextureFormat::RGBA8, texture_flags, mem);
- static void init()
- {
- ms_decl
- .begin()
- .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
- .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
- .end();
- }
+ bgfx_effect** effects = PRIMFLAG_GET_SCREENTEX(prim->flags) ? m_screen_effect : m_gui_effect;
+ UINT32 blend = PRIMFLAG_GET_BLENDMODE(prim->flags);
+ bgfx::setTexture(0, effects[blend]->uniform("s_tex")->handle(), texture);
+ effects[blend]->submit(view);
- static bgfx::VertexDecl ms_decl;
-};
-bgfx::VertexDecl PosColorVertex::ms_decl;
+ bgfx::destroyTexture(texture);
+}
#define MAX_TEMP_COORDS 100
-void drawPolygon(const float* _coords, uint32_t _numCoords, float _r, uint32_t _abgr)
+void renderer_bgfx::put_polygon(const float* coords, UINT32 num_coords, float r, UINT32 rgba, ScreenVertex* vertex)
{
- float tempCoords[MAX_TEMP_COORDS * 2];
+ float tempCoords[MAX_TEMP_COORDS * 3];
float tempNormals[MAX_TEMP_COORDS * 2];
- _numCoords = _numCoords < MAX_TEMP_COORDS ? _numCoords : MAX_TEMP_COORDS;
+ rectangle_packer::packed_rectangle& rect = m_hash_to_entry[WHITE_HASH];
+ float u0 = float(rect.x()) / float(CACHE_SIZE);
+ float v0 = float(rect.y()) / float(CACHE_SIZE);
- for (uint32_t ii = 0, jj = _numCoords - 1; ii < _numCoords; jj = ii++)
+ num_coords = num_coords < MAX_TEMP_COORDS ? num_coords : MAX_TEMP_COORDS;
+
+ for (uint32_t ii = 0, jj = num_coords - 1; ii < num_coords; jj = ii++)
{
- const float* v0 = &_coords[jj * 2];
- const float* v1 = &_coords[ii * 2];
+ const float* v0 = &coords[jj * 3];
+ const float* v1 = &coords[ii * 3];
float dx = v1[0] - v0[0];
float dy = v1[1] - v0[1];
float d = sqrtf(dx * dx + dy * dy);
@@ -433,7 +370,7 @@ void drawPolygon(const float* _coords, uint32_t _numCoords, float _r, uint32_t _
tempNormals[jj * 2 + 1] = -dx;
}
- for (uint32_t ii = 0, jj = _numCoords - 1; ii < _numCoords; jj = ii++)
+ for (uint32_t ii = 0, jj = num_coords - 1; ii < num_coords; jj = ii++)
{
float dlx0 = tempNormals[jj * 2 + 0];
float dly0 = tempNormals[jj * 2 + 1];
@@ -454,77 +391,96 @@ void drawPolygon(const float* _coords, uint32_t _numCoords, float _r, uint32_t _
dmy *= scale;
}
- tempCoords[ii * 2 + 0] = _coords[ii * 2 + 0] + dmx * _r;
- tempCoords[ii * 2 + 1] = _coords[ii * 2 + 1] + dmy * _r;
+ tempCoords[ii * 3 + 0] = coords[ii * 3 + 0] + dmx * r;
+ tempCoords[ii * 3 + 1] = coords[ii * 3 + 1] + dmy * r;
+ tempCoords[ii * 3 + 2] = coords[ii * 3 + 2];
}
- uint32_t numVertices = _numCoords * 6 + (_numCoords - 2) * 3;
- if (bgfx::checkAvailTransientVertexBuffer(numVertices, PosColorVertex::ms_decl))
+ int vertIndex = 0;
+ UINT32 trans = rgba & 0x00ffffff;
+ for (uint32_t ii = 0, jj = num_coords - 1; ii < num_coords; jj = ii++)
{
- bgfx::TransientVertexBuffer tvb;
- bgfx::allocTransientVertexBuffer(&tvb, numVertices, PosColorVertex::ms_decl);
- uint32_t trans = _abgr & 0xffffff;
-
- PosColorVertex* vertex = (PosColorVertex*)tvb.data;
- for (uint32_t ii = 0, jj = _numCoords - 1; ii < _numCoords; jj = ii++)
- {
- vertex->m_x = _coords[ii * 2 + 0];
- vertex->m_y = _coords[ii * 2 + 1];
- vertex->m_abgr = _abgr;
- ++vertex;
-
- vertex->m_x = _coords[jj * 2 + 0];
- vertex->m_y = _coords[jj * 2 + 1];
- vertex->m_abgr = _abgr;
- ++vertex;
-
- vertex->m_x = tempCoords[jj * 2 + 0];
- vertex->m_y = tempCoords[jj * 2 + 1];
- vertex->m_abgr = trans;
- ++vertex;
-
- vertex->m_x = tempCoords[jj * 2 + 0];
- vertex->m_y = tempCoords[jj * 2 + 1];
- vertex->m_abgr = trans;
- ++vertex;
-
- vertex->m_x = tempCoords[ii * 2 + 0];
- vertex->m_y = tempCoords[ii * 2 + 1];
- vertex->m_abgr = trans;
- ++vertex;
-
- vertex->m_x = _coords[ii * 2 + 0];
- vertex->m_y = _coords[ii * 2 + 1];
- vertex->m_abgr = _abgr;
- ++vertex;
- }
-
- for (uint32_t ii = 2; ii < _numCoords; ++ii)
- {
- vertex->m_x = _coords[0];
- vertex->m_y = _coords[1];
- vertex->m_abgr = _abgr;
- ++vertex;
-
- vertex->m_x = _coords[(ii - 1) * 2 + 0];
- vertex->m_y = _coords[(ii - 1) * 2 + 1];
- vertex->m_abgr = _abgr;
- ++vertex;
-
- vertex->m_x = _coords[ii * 2 + 0];
- vertex->m_y = _coords[ii * 2 + 1];
- vertex->m_abgr = _abgr;
- ++vertex;
- }
+ vertex[vertIndex].m_x = coords[ii * 3 + 0];
+ vertex[vertIndex].m_y = coords[ii * 3 + 1];
+ vertex[vertIndex].m_z = coords[ii * 3 + 2];
+ vertex[vertIndex].m_rgba = rgba;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = coords[jj * 3 + 0];
+ vertex[vertIndex].m_y = coords[jj * 3 + 1];
+ vertex[vertIndex].m_z = coords[jj * 3 + 2];
+ vertex[vertIndex].m_rgba = rgba;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = tempCoords[jj * 3 + 0];
+ vertex[vertIndex].m_y = tempCoords[jj * 3 + 1];
+ vertex[vertIndex].m_z = tempCoords[jj * 3 + 2];
+ vertex[vertIndex].m_rgba = trans;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = tempCoords[jj * 3 + 0];
+ vertex[vertIndex].m_y = tempCoords[jj * 3 + 1];
+ vertex[vertIndex].m_z = tempCoords[jj * 3 + 2];
+ vertex[vertIndex].m_rgba = trans;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = tempCoords[ii * 3 + 0];
+ vertex[vertIndex].m_y = tempCoords[ii * 3 + 1];
+ vertex[vertIndex].m_z = tempCoords[ii * 3 + 2];
+ vertex[vertIndex].m_rgba = trans;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = coords[ii * 3 + 0];
+ vertex[vertIndex].m_y = coords[ii * 3 + 1];
+ vertex[vertIndex].m_z = coords[ii * 3 + 2];
+ vertex[vertIndex].m_rgba = rgba;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+ }
- bgfx::setVertexBuffer(&tvb);
+ for (uint32_t ii = 2; ii < num_coords; ++ii)
+ {
+ vertex[vertIndex].m_x = coords[0];
+ vertex[vertIndex].m_y = coords[1];
+ vertex[vertIndex].m_z = coords[2];
+ vertex[vertIndex].m_rgba = rgba;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = coords[(ii - 1) * 3 + 0];
+ vertex[vertIndex].m_y = coords[(ii - 1) * 3 + 1];
+ vertex[vertIndex].m_z = coords[(ii - 1) * 3 + 2];
+ vertex[vertIndex].m_rgba = rgba;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
+
+ vertex[vertIndex].m_x = coords[ii * 3 + 0];
+ vertex[vertIndex].m_y = coords[ii * 3 + 1];
+ vertex[vertIndex].m_z = coords[ii * 3 + 2];
+ vertex[vertIndex].m_rgba = rgba;
+ vertex[vertIndex].m_u = u0;
+ vertex[vertIndex].m_v = v0;
+ vertIndex++;
}
}
-void drawLine(float _x0, float _y0, float _x1, float _y1, float _r, uint32_t _abgr, float _fth = 1.0f)
+void renderer_bgfx::put_line(float x0, float y0, float x1, float y1, float r, UINT32 rgba, ScreenVertex* vertex, float fth)
{
- float dx = _x1 - _x0;
- float dy = _y1 - _y0;
+ float dx = x1 - x0;
+ float dy = y1 - y0;
float d = sqrtf(dx * dx + dy * dy);
if (d > 0.0001f)
{
@@ -535,49 +491,41 @@ void drawLine(float _x0, float _y0, float _x1, float _y1, float _r, uint32_t _ab
float nx = dy;
float ny = -dx;
- float verts[4 * 2];
- _r -= _fth;
- _r *= 0.5f;
- if (_r < 0.01f)
+ float verts[4 * 3];
+ r -= fth;
+ r *= 0.5f;
+ if (r < 0.01f)
{
- _r = 0.01f;
+ r = 0.01f;
}
- dx *= _r;
- dy *= _r;
- nx *= _r;
- ny *= _r;
-
- verts[0] = _x0 - dx - nx;
- verts[1] = _y0 - dy - ny;
+ dx *= r;
+ dy *= r;
+ nx *= r;
+ ny *= r;
- verts[2] = _x0 - dx + nx;
- verts[3] = _y0 - dy + ny;
+ verts[0] = x0 - dx - nx;
+ verts[1] = y0 - dy - ny;
+ verts[2] = 0;
- verts[4] = _x1 + dx + nx;
- verts[5] = _y1 + dy + ny;
+ verts[3] = x0 - dx + nx;
+ verts[4] = y0 - dy + ny;
+ verts[5] = 0;
- verts[6] = _x1 + dx - nx;
- verts[7] = _y1 + dy - ny;
+ verts[6] = x1 + dx + nx;
+ verts[7] = y1 + dy + ny;
+ verts[8] = 0;
- drawPolygon(verts, 4, _fth, _abgr);
-}
+ verts[9] = x1 + dx - nx;
+ verts[10] = y1 + dy - ny;
+ verts[11] = 0;
-void initVertexDecls()
-{
- PosColorTexCoord0Vertex::init();
- PosColorVertex::init();
+ put_polygon(verts, 4, fth, rgba, vertex);
}
-static inline
-uint32_t u32Color(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a = 255)
+uint32_t renderer_bgfx::u32Color(uint32_t r, uint32_t g, uint32_t b, uint32_t a = 255)
{
- return 0
- | (uint32_t(_r) << 0)
- | (uint32_t(_g) << 8)
- | (uint32_t(_b) << 16)
- | (uint32_t(_a) << 24)
- ;
+ return (a << 24) | (b << 16) | (g << 8) | r;
}
//============================================================
@@ -587,7 +535,10 @@ uint32_t u32Color(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a = 255)
static inline void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette)
{
for (int x = 0; x < width; x++)
- *dst++ = 0xff000000 | palette[*src++];
+ {
+ rgb_t srcpixel = palette[*src++];
+ *dst++ = 0xff000000 | (srcpixel.b() << 16) | (srcpixel.g() << 8) | srcpixel.r();
+ }
}
@@ -598,7 +549,10 @@ static inline void copyline_palette16(UINT32 *dst, const UINT16 *src, int width,
static inline void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette)
{
for (int x = 0; x < width; x++)
- *dst++ = palette[*src++];
+ {
+ rgb_t srcpixel = palette[*src++];
+ *dst++ = (srcpixel.a() << 24) | (srcpixel.b() << 16) | (srcpixel.g() << 8) | srcpixel.r();
+ }
}
@@ -609,14 +563,14 @@ static inline void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width
static inline void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette)
{
int x;
-
+
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
for (x = 0; x < width; x++)
{
rgb_t srcpix = *src++;
- *dst++ = 0xff000000 | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ *dst++ = 0xff000000 | palette[0x200 + srcpix.b()] | palette[0x100 + srcpix.g()] | palette[srcpix.r()];
}
}
@@ -624,7 +578,10 @@ static inline void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, con
else
{
for (x = 0; x < width; x++)
- *dst++ = 0xff000000 | *src++;
+ {
+ rgb_t srcpix = *src++;
+ *dst++ = 0xff000000 | (srcpix.b() << 16) | (srcpix.g() << 8) | srcpix.r();
+ }
}
}
@@ -637,12 +594,12 @@ static inline void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, co
{
int x;
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
for (x = 0; x < width; x++)
{
rgb_t srcpix = *src++;
- *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()];
+ *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix.b()] | palette[0x100 + srcpix.g()] | palette[srcpix.r()];
}
}
@@ -650,7 +607,10 @@ static inline void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, co
else
{
for (x = 0; x < width; x++)
- *dst++ = *src++;
+ {
+ rgb_t srcpix = *src++;
+ *dst++ = (srcpix.a() << 24) | (srcpix.b() << 16) | (srcpix.g() << 8) | srcpix.r();
+ }
}
}
@@ -692,7 +652,7 @@ static inline UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr)
if (b < 0) b = 0;
else if (b > 255) b = 255;
- return rgb_t(0xff, r, g, b);
+ return 0xff000000 | (b << 16) | (g << 8) | r;
}
//============================================================
@@ -706,7 +666,7 @@ static inline void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int wi
assert(width % 2 == 0);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
for (x = 0; x < width / 2; x++)
{
@@ -737,35 +697,64 @@ static inline void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int wi
}
}
}
+
+const bgfx::Memory* renderer_bgfx::mame_texture_data_to_bgfx_texture_data(UINT32 format, int width, int height, int rowpixels, const rgb_t *palette, void *base)
+{
+ const bgfx::Memory* mem = bgfx::alloc(width * height * 4);
+ for (int y = 0; y < height; y++)
+ {
+ switch (format)
+ {
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTE16):
+ copyline_palette16((UINT32*)mem->data + y * width, (UINT16*)base + y * rowpixels, width, palette);
+ break;
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTEA16):
+ copyline_palettea16((UINT32*)mem->data + y * width, (UINT16*)base + y * rowpixels, width, palette);
+ break;
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16):
+ copyline_yuy16_to_argb((UINT32*)mem->data + y * width, (UINT16*)base + y * rowpixels, width, palette, 1);
+ break;
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32):
+ copyline_argb32((UINT32*)mem->data + y * width, (UINT32*)base + y * rowpixels, width, palette);
+ break;
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_RGB32):
+ copyline_rgb32((UINT32*)mem->data + y * width, (UINT32*)base + y * rowpixels, width, palette);
+ break;
+ default:
+ break;
+ }
+ }
+ return mem;
+}
+
int renderer_bgfx::draw(int update)
{
- initVertexDecls();
int index = window().m_index;
// Set view 0 default viewport.
osd_dim wdim = window().get_size();
- int width = wdim.width();
- int height = wdim.height();
+ m_width[index] = wdim.width();
+ m_height[index] = wdim.height();
if (index == 0)
{
- if ((m_dimensions != osd_dim(width, height))) {
- bgfx::reset(width, height, video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE);
- m_dimensions = osd_dim(width, height);
+ if ((m_dimensions != osd_dim(m_width[index], m_height[index])))
+ {
+ bgfx::reset(m_width[index], m_height[index], video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE);
+ m_dimensions = osd_dim(m_width[index], m_height[index]);
}
}
- else {
- if ((m_dimensions != osd_dim(width, height))) {
+ else
+ {
+ if ((m_dimensions != osd_dim(m_width[index], m_height[index])))
+ {
bgfx::reset(window().m_main->get_size().width(), window().m_main->get_size().height(), video_config.waitvsync ? BGFX_RESET_VSYNC : BGFX_RESET_NONE);
- if (bgfx::isValid(fbh))
- {
- bgfx::destroyFrameBuffer(fbh);
- }
+ delete m_framebuffer;
#ifdef OSD_WINDOWS
- fbh = bgfx::createFrameBuffer(window().m_hwnd, width, height);
+ m_framebuffer = m_targets->create_target("backbuffer", window().m_hwnd, m_width[index], m_height[index]);
#else
- fbh = bgfx::createFrameBuffer(sdlNativeWindowHandle(window().sdl_window()), width, height);
+ m_framebuffer = m_targets->create_target("backbuffer", sdlNativeWindowHandle(window().sdl_window()), m_width[index], m_height[index]);
#endif
- bgfx::setViewFrameBuffer(index, fbh);
- m_dimensions = osd_dim(width, height);
+ bgfx::setViewFrameBuffer(index, m_framebuffer->target());
+ m_dimensions = osd_dim(m_width[index], m_height[index]);
bgfx::setViewClear(index
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x000000ff
@@ -777,9 +766,13 @@ int renderer_bgfx::draw(int update)
return 0;
}
}
- if (index != 0) bgfx::setViewFrameBuffer(index, fbh);
- bgfx::setViewSeq(index, true);
- bgfx::setViewRect(index, 0, 0, width, height);
+
+ if (index != 0)
+ {
+ bgfx::setViewFrameBuffer(index, m_framebuffer->target());
+ }
+ bgfx::setViewSeq(index, true);
+ bgfx::setViewRect(index, 0, 0, m_width[index], m_height[index]);
// Setup view transform.
{
@@ -788,8 +781,8 @@ int renderer_bgfx::draw(int update)
float left = 0.0f;
float top = 0.0f;
- float right = width;
- float bottom = height;
+ float right = m_width[index];
+ float bottom = m_height[index];
float proj[16];
bx::mtxOrtho(proj, left, right, bottom, top, 0.0f, 100.0f);
bgfx::setViewTransform(index, view, proj);
@@ -801,171 +794,292 @@ int renderer_bgfx::draw(int update)
, 0
);
+ window().m_primlist->acquire_lock();
+
+ // Mark our texture atlas as dirty if we need to do so
+ bool atlas_valid = update_atlas();
+
+ render_primitive *prim = window().m_primlist->first();
+ while (prim != nullptr)
+ {
+ UINT32 blend = PRIMFLAG_GET_BLENDMODE(prim->flags);
+
+ bgfx::TransientVertexBuffer buffer;
+ allocate_buffer(prim, blend, &buffer);
+
+ buffer_status status = buffer_primitives(index, atlas_valid, &prim, &buffer);
+
+ if (status != BUFFER_EMPTY)
+ {
+ bgfx::setVertexBuffer(&buffer);
+ bgfx::setTexture(0, m_gui_effect[blend]->uniform("s_tex")->handle(), m_texture_cache->handle());
+ m_gui_effect[blend]->submit(index);
+ }
+
+ if (status != BUFFER_DONE && status != BUFFER_PRE_FLUSH)
+ {
+ prim = prim->next();
+ }
+ }
+
+ window().m_primlist->release_lock();
+
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
bgfx::touch(index);
- window().m_primlist->acquire_lock();
- // Draw quad.
- // now draw
- uint32_t texture_flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP;
- if (video_config.filter==0) texture_flags |= BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT;
-
- for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ if (index==0) bgfx::frame();
+
+ return 0;
+}
+
+renderer_bgfx::buffer_status renderer_bgfx::buffer_primitives(int view, bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer)
+{
+ int vertices = 0;
+
+ UINT32 blend = PRIMFLAG_GET_BLENDMODE((*prim)->flags);
+ while (*prim != nullptr)
{
- uint64_t flags = BGFX_STATE_RGB_WRITE;
- switch (prim->flags & PRIMFLAG_BLENDMODE_MASK)
+ switch ((*prim)->type)
+ {
+ case render_primitive::LINE:
+ put_line((*prim)->bounds.x0, (*prim)->bounds.y0, (*prim)->bounds.x1, (*prim)->bounds.y1, 1.0f, u32Color((*prim)->color.r * 255, (*prim)->color.g * 255, (*prim)->color.b * 255, (*prim)->color.a * 255), (ScreenVertex*)buffer->data + vertices, 1.0f);
+ vertices += 30;
+ break;
+
+ case render_primitive::QUAD:
+ if ((*prim)->texture.base == nullptr)
+ {
+ put_packed_quad(*prim, WHITE_HASH, (ScreenVertex*)buffer->data + vertices);
+ vertices += 6;
+ }
+ else
+ {
+ const UINT32 hash = get_texture_hash(*prim);
+ if (atlas_valid && (*prim)->packable(PACKABLE_SIZE) && hash != 0 && m_hash_to_entry[hash].hash())
+ {
+ put_packed_quad(*prim, hash, (ScreenVertex*)buffer->data + vertices);
+ vertices += 6;
+ }
+ else
+ {
+ if (vertices > 0)
+ {
+ return BUFFER_PRE_FLUSH;
+ }
+ render_textured_quad(view, *prim, buffer);
+ return BUFFER_EMPTY;
+ }
+ }
+ break;
+
+ default:
+ // Unhandled
+ break;
+ }
+
+ if ((*prim)->next() != nullptr && PRIMFLAG_GET_BLENDMODE((*prim)->next()->flags) != blend)
{
- case PRIMFLAG_BLENDMODE(BLENDMODE_NONE):
break;
- case PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA):
- flags |= BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA);
+ }
+
+ *prim = (*prim)->next();
+ }
+
+ if (*prim == nullptr)
+ {
+ return BUFFER_DONE;
+ }
+ if (vertices == 0)
+ {
+ return BUFFER_EMPTY;
+ }
+ return BUFFER_FLUSH;
+}
+
+void renderer_bgfx::set_bgfx_state(UINT32 blend)
+{
+ uint64_t flags = BGFX_STATE_RGB_WRITE | BGFX_STATE_ALPHA_WRITE | BGFX_STATE_DEPTH_TEST_ALWAYS;
+
+ switch (blend)
+ {
+ case BLENDMODE_NONE:
+ bgfx::setState(flags);
+ break;
+ case BLENDMODE_ALPHA:
+ bgfx::setState(flags | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA));
break;
- case PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY):
- flags |= BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_ZERO);
+ case BLENDMODE_RGB_MULTIPLY:
+ bgfx::setState(flags | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_ZERO));
break;
- case PRIMFLAG_BLENDMODE(BLENDMODE_ADD):
- flags |= BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_ONE);
+ case BLENDMODE_ADD:
+ bgfx::setState(flags | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_ONE));
+ break;
+ }
+}
+
+bool renderer_bgfx::update_atlas()
+{
+ bool atlas_dirty = check_for_dirty_atlas();
+
+ if (atlas_dirty)
+ {
+ m_hash_to_entry.clear();
+
+ std::vector<std::vector<rectangle_packer::packed_rectangle>> packed;
+ if (m_packer.pack(m_texinfo, packed, CACHE_SIZE))
+ {
+ process_atlas_packs(packed);
}
- bool alpha = false;
- switch (prim->type)
+ else
{
- /**
- * Try to stay in one Begin/End block as long as possible,
- * since entering and leaving one is most expensive..
- */
- case render_primitive::LINE:
-
- drawLine(prim->bounds.x0, prim->bounds.y0, prim->bounds.x1, prim->bounds.y1,
- 1.0f,
- u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255),
- 1.0f);
- bgfx::setState(flags);
- bgfx::submit(index, m_progLine);
- break;
+ packed.clear();
+
+ m_texinfo.clear();
+ m_texinfo.push_back(rectangle_packer::packable_rectangle(WHITE_HASH, PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32), 16, 16, 16, nullptr, m_white));
+
+ m_packer.pack(m_texinfo, packed, CACHE_SIZE);
+ process_atlas_packs(packed);
+
+ return false;
+ }
+ }
+ return true;
+}
+
+void renderer_bgfx::process_atlas_packs(std::vector<std::vector<rectangle_packer::packed_rectangle>>& packed)
+{
+ for (std::vector<rectangle_packer::packed_rectangle> pack : packed)
+ {
+ for (rectangle_packer::packed_rectangle rect : pack)
+ {
+ if (rect.hash() == 0xffffffff)
+ {
+ continue;
+ }
+ m_hash_to_entry[rect.hash()] = rect;
+ const bgfx::Memory* mem = mame_texture_data_to_bgfx_texture_data(rect.format(), rect.width(), rect.height(), rect.rowpixels(), rect.palette(), rect.base());
+ bgfx::updateTexture2D(m_texture_cache->handle(), 0, rect.x(), rect.y(), rect.width(), rect.height(), mem);
+ }
+ }
+}
+
+UINT32 renderer_bgfx::get_texture_hash(render_primitive *prim)
+{
+#if GIBBERISH
+ UINT32 xor_value = 0x87;
+ UINT32 hash = 0xdabeefed;
- case render_primitive::QUAD:
- if (prim->texture.base == nullptr) {
- render_quad_texuv uv;
- uv.tl.u = uv.tl.v = uv.tr.u = uv.tr.v = 0;
- uv.bl.u = uv.bl.v = uv.br.u = uv.br.v = 0;
- screenQuad(prim->bounds.x0, prim->bounds.y0, prim->bounds.x1, prim->bounds.y1,
- u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255), uv);
- bgfx::setState(flags);
- bgfx::submit(index, m_progQuad);
+ int bpp = 2;
+ UINT32 format = PRIMFLAG_GET_TEXFORMAT(prim->flags);
+ if (format == TEXFORMAT_ARGB32 || format == TEXFORMAT_RGB32)
+ {
+ bpp = 4;
+ }
+
+ for (int y = 0; y < prim->texture.height; y++)
+ {
+ UINT8 *base = reinterpret_cast<UINT8*>(prim->texture.base) + prim->texture.rowpixels * y;
+ for (int x = 0; x < prim->texture.width * bpp; x++)
+ {
+ hash += base[x] ^ xor_value;
+ }
+ }
+ return hash;
+#else
+ return (reinterpret_cast<size_t>(prim->texture.base)) & 0xffffffff;
+#endif
+}
+
+bool renderer_bgfx::check_for_dirty_atlas()
+{
+ bool atlas_dirty = false;
+
+ std::map<UINT32, rectangle_packer::packable_rectangle> acquired_infos;
+ for (render_primitive *prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
+ {
+ bool pack = prim->packable(PACKABLE_SIZE);
+ if (prim->type == render_primitive::QUAD && prim->texture.base != nullptr && pack)
+ {
+ const UINT32 hash = get_texture_hash(prim);
+ // If this texture is packable and not currently in the atlas, prepare the texture for putting in the atlas
+ if ((hash != 0 && m_hash_to_entry[hash].hash() == 0 && acquired_infos[hash].hash() == 0)
+ || (hash != 0 && m_hash_to_entry[hash].hash() != hash && acquired_infos[hash].hash() == 0))
+ { // Create create the texture and mark the atlas dirty
+ atlas_dirty = true;
+
+ m_texinfo.push_back(rectangle_packer::packable_rectangle(hash, prim->flags & PRIMFLAG_TEXFORMAT_MASK,
+ prim->texture.width, prim->texture.height,
+ prim->texture.rowpixels, prim->texture.palette, prim->texture.base));
+ acquired_infos[hash] = m_texinfo[m_texinfo.size() - 1];
}
- else {
- screenQuad(prim->bounds.x0, prim->bounds.y0, prim->bounds.x1, prim->bounds.y1,
- u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255), prim->texcoords);
- bgfx::TextureHandle m_texture;
- // render based on the texture coordinates
- switch (prim->flags & PRIMFLAG_TEXFORMAT_MASK)
- {
- case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTEA16):
- alpha = true;
- case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTE16):
- {
- auto mem = bgfx::alloc(prim->texture.width*prim->texture.height * 4);
- if (alpha)
- {
- for (int y = 0; y < prim->texture.height; y++)
- {
- copyline_palettea16((UINT32*)mem->data + y*prim->texture.width, (UINT16*)prim->texture.base + y*prim->texture.rowpixels, prim->texture.width, prim->texture.palette);
- }
- }
- else
- {
- for (int y = 0; y < prim->texture.height; y++)
- {
- copyline_palette16((UINT32*)mem->data + y*prim->texture.width, (UINT16*)prim->texture.base + y*prim->texture.rowpixels, prim->texture.width, prim->texture.palette);
- }
- }
+ }
+ }
- m_texture = bgfx::createTexture2D((uint16_t)prim->texture.width
- , (uint16_t)prim->texture.height
- , 1
- , bgfx::TextureFormat::BGRA8
- , texture_flags
- , mem
- );
- }
- break;
- case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16):
+ if (m_texinfo.size() == 1)
+ {
+ atlas_dirty = true;
+ }
+
+ return atlas_dirty;
+}
+
+void renderer_bgfx::allocate_buffer(render_primitive *prim, UINT32 blend, bgfx::TransientVertexBuffer *buffer)
+{
+ int vertices = 0;
+
+ bool mode_switched = false;
+ while (prim != nullptr && !mode_switched)
+ {
+ switch (prim->type)
+ {
+ case render_primitive::LINE:
+ vertices += 30;
+ break;
+
+ case render_primitive::QUAD:
+ if (!prim->packable(PACKABLE_SIZE))
+ {
+ if (prim->texture.base == nullptr)
{
- auto mem = bgfx::alloc(prim->texture.width*prim->texture.height * 4);
- for (int y = 0; y < prim->texture.height; y++)
- {
- copyline_yuy16_to_argb((UINT32*)mem->data + y*prim->texture.width, (UINT16*)prim->texture.base + y*prim->texture.rowpixels, prim->texture.width, prim->texture.palette, 1);
- }
- m_texture = bgfx::createTexture2D((uint16_t)prim->texture.width
- , (uint16_t)prim->texture.height
- , 1
- , bgfx::TextureFormat::BGRA8
- , texture_flags
- , mem
- );
+ vertices += 6;
}
- break;
- case PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32):
- alpha = true;
- case PRIMFLAG_TEXFORMAT(TEXFORMAT_RGB32):
+ else
{
- if (prim->texture.rowpixels!=prim->texture.width)
+ mode_switched = true;
+ if (vertices == 0)
{
- auto mem = bgfx::alloc(prim->texture.width*prim->texture.height * 4);
- if (alpha)
- {
- for (int y = 0; y < prim->texture.height; y++)
- {
- copyline_argb32((UINT32*)mem->data + y*prim->texture.width, (UINT32*)prim->texture.base + y*prim->texture.rowpixels, prim->texture.width, prim->texture.palette);
- }
- }
- else
- {
- for (int y = 0; y < prim->texture.height; y++)
- {
- copyline_rgb32((UINT32*)mem->data + y*prim->texture.width, (UINT32*)prim->texture.base + y*prim->texture.rowpixels, prim->texture.width, prim->texture.palette);
- }
- }
-
- m_texture = bgfx::createTexture2D((uint16_t)prim->texture.width
- , (uint16_t)prim->texture.height
- , 1
- , bgfx::TextureFormat::BGRA8
- , texture_flags
- , mem
- );
- } else {
- m_texture = bgfx::createTexture2D((uint16_t)prim->texture.width
- , (uint16_t)prim->texture.height
- , 1
- , bgfx::TextureFormat::BGRA8
- , texture_flags
- , bgfx::copy(prim->texture.base, prim->texture.width*prim->texture.height*4)
- );
+ vertices += 6;
}
}
- break;
-
- default:
- break;
}
- bgfx::setTexture(0, m_s_texColor, m_texture);
- bgfx::setState(flags);
- bgfx::submit(index, m_progQuadTexture);
- bgfx::destroyTexture(m_texture);
- }
- break;
+ else
+ {
+ vertices += 6;
+ }
+ break;
+ default:
+ // Do nothing
+ break;
+ }
- default:
- throw emu_fatalerror("Unexpected render_primitive type");
+ prim = prim->next();
+
+ if (prim != nullptr && PRIMFLAG_GET_BLENDMODE(prim->flags) != blend)
+ {
+ mode_switched = true;
}
}
- window().m_primlist->release_lock();
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- if (index==0) bgfx::frame();
-
- return 0;
+ if (vertices > 0 && bgfx::checkAvailTransientVertexBuffer(vertices, ScreenVertex::ms_decl))
+ {
+ bgfx::allocTransientVertexBuffer(buffer, vertices, ScreenVertex::ms_decl);
+ }
}
+
+slider_state* renderer_bgfx::get_slider_list()
+{
+ return nullptr;
+} \ No newline at end of file
diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h
new file mode 100644
index 00000000000..7ce7c75a1de
--- /dev/null
+++ b/src/osd/modules/render/drawbgfx.h
@@ -0,0 +1,123 @@
+#pragma once
+
+#ifndef __RENDER_BGFX__
+#define __RENDER_BGFX__
+
+#include <bgfx/bgfx.h>
+
+#include <map>
+#include <vector>
+
+#include "binpacker.h"
+
+class texture_manager;
+class target_manager;
+class shader_manager;
+class effect_manager;
+class bgfx_texture;
+class bgfx_effect;
+class bgfx_target;
+
+/* sdl_info is the information about SDL for the current screen */
+class renderer_bgfx : public osd_renderer
+{
+public:
+ renderer_bgfx(osd_window *w)
+ : osd_renderer(w, FLAG_NONE)
+ , m_dimensions(0, 0)
+ {
+ }
+ virtual ~renderer_bgfx();
+
+ virtual int create() override;
+ virtual slider_state* get_slider_list() override;
+ static bool init(running_machine &machine) { return false; }
+ virtual int draw(const int update) override;
+#ifdef OSD_SDL
+ virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
+#else
+ virtual void save() override { }
+ virtual void record() override { }
+ virtual void toggle_fsfx() override { }
+#endif
+ virtual render_primitive_list *get_primitives() override
+ {
+ osd_dim wdim = window().get_size();
+ window().target()->set_bounds(wdim.width(), wdim.height(), window().aspect());
+ return &window().target()->get_primitives();
+ }
+
+private:
+ struct ScreenVertex
+ {
+ float m_x;
+ float m_y;
+ float m_z;
+ UINT32 m_rgba;
+ float m_u;
+ float m_v;
+
+ static void init()
+ {
+ ms_decl.begin()
+ .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
+ .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
+ .end();
+ }
+
+ static bgfx::VertexDecl ms_decl;
+ };
+
+ void allocate_buffer(render_primitive *prim, UINT32 blend, bgfx::TransientVertexBuffer *buffer);
+ enum buffer_status
+ {
+ BUFFER_PRE_FLUSH,
+ BUFFER_FLUSH,
+ BUFFER_EMPTY,
+ BUFFER_DONE
+ };
+ buffer_status buffer_primitives(int view, bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer);
+
+ void render_textured_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer);
+
+ void put_packed_quad(render_primitive *prim, UINT32 hash, ScreenVertex* vertex);
+ void put_polygon(const float* coords, UINT32 num_coords, float r, UINT32 rgba, ScreenVertex* vertex);
+ void put_line(float x0, float y0, float x1, float y1, float r, UINT32 rgba, ScreenVertex* vertex, float fth = 1.0f);
+
+ void set_bgfx_state(UINT32 blend);
+
+ uint32_t u32Color(uint32_t r, uint32_t g, uint32_t b, uint32_t a);
+
+ bool check_for_dirty_atlas();
+ bool update_atlas();
+ void process_atlas_packs(std::vector<std::vector<rectangle_packer::packed_rectangle>>& packed);
+ const bgfx::Memory* mame_texture_data_to_bgfx_texture_data(UINT32 format, int width, int height, int rowpixels, const rgb_t *palette, void *base);
+ UINT32 get_texture_hash(render_primitive *prim);
+
+ bgfx_target* m_framebuffer;
+ bgfx_texture* m_texture_cache;
+
+ // Original display_mode
+ osd_dim m_dimensions;
+
+ texture_manager* m_textures;
+ target_manager* m_targets;
+ shader_manager* m_shaders;
+ effect_manager* m_effects;
+ bgfx_effect* m_gui_effect[4];
+ bgfx_effect* m_screen_effect[4];
+
+ std::map<UINT32, rectangle_packer::packed_rectangle> m_hash_to_entry;
+ std::vector<rectangle_packer::packable_rectangle> m_texinfo;
+ rectangle_packer m_packer;
+
+ uint32_t m_width[16];
+ uint32_t m_height[16];
+ uint32_t m_white[16*16];
+ enum : uint16_t { CACHE_SIZE = 1024 };
+ enum : uint32_t { PACKABLE_SIZE = 128 };
+ enum : UINT32 { WHITE_HASH = 0x87654321 };
+};
+
+#endif
diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp
index b8730696a54..3873e6fbcea 100644
--- a/src/osd/modules/render/drawd3d.cpp
+++ b/src/osd/modules/render/drawd3d.cpp
@@ -14,16 +14,6 @@
// Windows NT shipped with DirectX 3.0a
// Windows 95 shipped with DirectX 2
-// standard windows headers
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <tchar.h>
-#include <mmsystem.h>
-#include <d3d9.h>
-#include <d3dx9.h>
-#include <math.h>
-#undef interface
-
// MAME headers
#include "emu.h"
#include "render.h"
@@ -33,11 +23,11 @@
#include "aviio.h"
// MAMEOS headers
-#include "modules/render/d3d/d3dintf.h"
#include "winmain.h"
#include "window.h"
-#include "modules/render/d3d/d3dcomm.h"
#include "drawd3d.h"
+#include "modules/render/d3d/d3dhlsl.h"
+#include "d3dtarget.h"
//============================================================
@@ -109,7 +99,7 @@ static inline BOOL GetClientRectExceptMenu(HWND hWnd, PRECT pRect, BOOL fullscre
last_menu = menu;
last_rect = *pRect;
- SetMenu(hWnd, NULL);
+ SetMenu(hWnd, nullptr);
result = GetClientRect(hWnd, &cached_rect);
SetMenu(hWnd, menu);
}
@@ -165,26 +155,21 @@ static inline UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr)
// drawd3d_init
//============================================================
-static d3d::base * d3dintf; // FIX ME
+static d3d_base * d3dintf; // FIX ME
//============================================================
// PROTOTYPES
//============================================================
-// core functions
-static void drawd3d_exit(void);
-
-
//============================================================
// drawd3d_window_init
//============================================================
-int d3d::renderer::create()
+int renderer_d3d9::create()
{
if (!initialize())
{
- destroy();
osd_printf_error("Unable to initialize Direct3D.\n");
return 1;
}
@@ -192,50 +177,27 @@ int d3d::renderer::create()
return 0;
}
-
-//============================================================
-// drawd3d_exit
-//============================================================
-
-static void drawd3d_exit(void)
-{
- if (d3dintf != NULL)
- (*d3dintf->d3d.release)(d3dintf);
-}
-
-void d3d::renderer::toggle_fsfx()
+void renderer_d3d9::toggle_fsfx()
{
set_restarting(true);
}
-void d3d::renderer::record()
+void renderer_d3d9::record()
{
get_shaders()->window_record();
}
-void d3d::renderer::save()
+void renderer_d3d9::save()
{
get_shaders()->window_save();
}
//============================================================
-// drawd3d_window_destroy
-//============================================================
-
-void d3d::renderer::destroy()
-{
- if (get_shaders() != NULL && get_shaders()->recording())
- get_shaders()->window_record();
-
-}
-
-
-//============================================================
// drawd3d_window_get_primitives
//============================================================
-render_primitive_list *d3d::renderer::get_primitives()
+render_primitive_list *renderer_d3d9::get_primitives()
{
RECT client;
@@ -245,7 +207,7 @@ render_primitive_list *d3d::renderer::get_primitives()
window().target()->set_bounds(rect_width(&client), rect_height(&client), window().aspect());
window().target()->set_max_update_rate((get_refresh() == 0) ? get_origmode().RefreshRate : get_refresh());
}
- if (m_shaders != NULL)
+ if (m_shaders != nullptr)
{
window().target()->set_transform_primitives(!m_shaders->enabled());
}
@@ -257,30 +219,19 @@ render_primitive_list *d3d::renderer::get_primitives()
// drawnone_create
//============================================================
-static osd_renderer *drawd3d_create(osd_window *window)
+bool renderer_d3d9::init(running_machine &machine)
{
- return global_alloc(d3d::renderer(window));
-}
-
-int drawd3d_init(running_machine &machine, osd_draw_callbacks *callbacks)
-{
- d3dintf = NULL;
-
// Use Direct3D9
- d3dintf = d3d::drawd3d9_init();
+ d3dintf = drawd3d9_init();
// if we failed, note the error
- if (d3dintf == NULL)
+ if (d3dintf == nullptr)
{
osd_printf_error("Unable to initialize Direct3D.\n");
- return 1;
+ return true;
}
- // fill in the callbacks
- memset(callbacks, 0, sizeof(*callbacks));
- callbacks->exit = drawd3d_exit;
- callbacks->create = drawd3d_create;
- return 0;
+ return false;
}
@@ -288,7 +239,7 @@ int drawd3d_init(running_machine &machine, osd_draw_callbacks *callbacks)
// drawd3d_window_draw
//============================================================
-int d3d::renderer::draw(const int update)
+int renderer_d3d9::draw(const int update)
{
int check = pre_window_draw_check();
if (check >= 0)
@@ -301,21 +252,19 @@ int d3d::renderer::draw(const int update)
return 0;
}
-namespace d3d
-{
-void renderer::set_texture(texture_info *texture)
+void renderer_d3d9::set_texture(texture_info *texture)
{
if (texture != m_last_texture)
{
m_last_texture = texture;
- m_last_texture_flags = (texture == NULL ? 0 : texture->get_flags());
- HRESULT result = (*d3dintf->device.set_texture)(m_device, 0, (texture == NULL) ? get_default_texture()->get_finaltex() : texture->get_finaltex());
+ m_last_texture_flags = (texture == nullptr ? 0 : texture->get_flags());
+ HRESULT result = (*d3dintf->device.set_texture)(m_device, 0, (texture == nullptr) ? get_default_texture()->get_finaltex() : texture->get_finaltex());
m_shaders->set_texture(texture);
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during device set_texture call\n", (int)result);
}
}
-void renderer::set_filter(int filter)
+void renderer_d3d9::set_filter(int filter)
{
if (filter != m_last_filter)
{
@@ -331,7 +280,7 @@ void renderer::set_filter(int filter)
}
}
-void renderer::set_wrap(D3DTEXTUREADDRESS wrap)
+void renderer_d3d9::set_wrap(unsigned int wrap)
{
if (wrap != m_last_wrap)
{
@@ -347,7 +296,7 @@ void renderer::set_wrap(D3DTEXTUREADDRESS wrap)
}
}
-void renderer::set_modmode(DWORD modmode)
+void renderer_d3d9::set_modmode(int modmode)
{
if (modmode != m_last_modmode)
{
@@ -359,7 +308,7 @@ void renderer::set_modmode(DWORD modmode)
}
}
-void renderer::set_blendmode(int blendmode)
+void renderer_d3d9::set_blendmode(int blendmode)
{
int blendenable;
int blendop;
@@ -406,7 +355,7 @@ void renderer::set_blendmode(int blendmode)
}
}
-void renderer::reset_render_states()
+void renderer_d3d9::reset_render_states()
{
// this ensures subsequent calls to the above setters will force-update the data
m_last_texture = (texture_info *)~0;
@@ -418,13 +367,13 @@ void renderer::reset_render_states()
m_last_wrap = (D3DTEXTUREADDRESS)-1;
}
-texture_manager::texture_manager(renderer *d3d)
+d3d_texture_manager::d3d_texture_manager(renderer_d3d9 *d3d)
{
m_renderer = d3d;
- m_texlist = NULL;
- m_vector_texture = NULL;
- m_default_texture = NULL;
+ m_texlist = nullptr;
+ m_vector_texture = nullptr;
+ m_default_texture = nullptr;
// check for dynamic texture support
DWORD tempcaps;
@@ -466,20 +415,20 @@ texture_manager::texture_manager(renderer *d3d)
osd_printf_verbose("Direct3D: Max texture size = %dx%d\n", (int)m_texture_max_width, (int)m_texture_max_height);
}
-texture_manager::~texture_manager()
+d3d_texture_manager::~d3d_texture_manager()
{
}
-void texture_manager::create_resources()
+void d3d_texture_manager::create_resources()
{
// experimental: load a PNG to use for vector rendering; it is treated
// as a brightness map
emu_file file(m_renderer->window().machine().options().art_path(), OPEN_FLAG_READ);
- render_load_png(m_vector_bitmap, file, NULL, "vector.png");
+ render_load_png(m_vector_bitmap, file, nullptr, "vector.png");
if (m_vector_bitmap.valid())
{
m_vector_bitmap.fill(rgb_t(0xff,0xff,0xff,0xff));
- render_load_png(m_vector_bitmap, file, NULL, "vector.png", true);
+ render_load_png(m_vector_bitmap, file, nullptr, "vector.png", true);
}
m_default_bitmap.allocate(8, 8);
@@ -494,7 +443,7 @@ void texture_manager::create_resources()
texture.rowpixels = m_default_bitmap.rowpixels();
texture.width = m_default_bitmap.width();
texture.height = m_default_bitmap.height();
- texture.palette = NULL;
+ texture.palette = nullptr;
texture.seqid = 0;
// now create it
@@ -511,7 +460,7 @@ void texture_manager::create_resources()
texture.rowpixels = m_vector_bitmap.rowpixels();
texture.width = m_vector_bitmap.width();
texture.height = m_vector_bitmap.height();
- texture.palette = NULL;
+ texture.palette = nullptr;
texture.seqid = 0;
// now create it
@@ -519,17 +468,17 @@ void texture_manager::create_resources()
}
}
-void texture_manager::delete_resources()
+void d3d_texture_manager::delete_resources()
{
// is part of m_texlist and will be free'd there
//global_free(m_default_texture);
- m_default_texture = NULL;
+ m_default_texture = nullptr;
//global_free(m_vector_texture);
- m_vector_texture = NULL;
+ m_vector_texture = nullptr;
// free all textures
- while (m_texlist != NULL)
+ while (m_texlist != nullptr)
{
texture_info *tex = m_texlist;
m_texlist = tex->get_next();
@@ -537,18 +486,18 @@ void texture_manager::delete_resources()
}
}
-UINT32 texture_manager::texture_compute_hash(const render_texinfo *texture, UINT32 flags)
+UINT32 d3d_texture_manager::texture_compute_hash(const render_texinfo *texture, UINT32 flags)
{
return (FPTR)texture->base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK));
}
-texture_info *texture_manager::find_texinfo(const render_texinfo *texinfo, UINT32 flags)
+texture_info *d3d_texture_manager::find_texinfo(const render_texinfo *texinfo, UINT32 flags)
{
UINT32 hash = texture_compute_hash(texinfo, flags);
texture_info *texture;
// find a match
- for (texture = m_renderer->get_texture_manager()->get_texlist(); texture != NULL; texture = texture->get_next())
+ for (texture = m_renderer->get_texture_manager()->get_texlist(); texture != nullptr; texture = texture->get_next())
{
UINT32 test_screen = (UINT32)texture->get_texinfo().osddata >> 1;
UINT32 test_page = (UINT32)texture->get_texinfo().osddata & 1;
@@ -568,7 +517,7 @@ texture_info *texture_manager::find_texinfo(const render_texinfo *texinfo, UINT3
// Reject a texture if it belongs to an out-of-date render target, so as to cause the HLSL system to re-cache
if (m_renderer->get_shaders()->enabled() && texinfo->width != 0 && texinfo->height != 0 && (flags & PRIMFLAG_SCREENTEX_MASK) != 0)
{
- if (m_renderer->get_shaders()->find_render_target(texture) != NULL)
+ if (m_renderer->get_shaders()->find_render_target(texture) != nullptr)
{
return texture;
}
@@ -585,13 +534,13 @@ texture_info *texture_manager::find_texinfo(const render_texinfo *texinfo, UINT3
{
if (texinfo->width == 0 || texinfo->height == 0)
{
- return NULL;
+ return nullptr;
}
UINT32 prim_screen = texinfo->osddata >> 1;
UINT32 prim_page = texinfo->osddata & 1;
- for (texture = m_renderer->get_texture_manager()->get_texlist(); texture != NULL; texture = texture->get_next())
+ for (texture = m_renderer->get_texture_manager()->get_texlist(); texture != nullptr; texture = texture->get_next())
{
UINT32 test_screen = texture->get_texinfo().osddata >> 1;
UINT32 test_page = texture->get_texinfo().osddata & 1;
@@ -612,31 +561,35 @@ texture_info *texture_manager::find_texinfo(const render_texinfo *texinfo, UINT3
}
}
- return NULL;
+ return nullptr;
}
-renderer::renderer(osd_window *window)
- : osd_renderer(window, FLAG_NONE), m_adapter(0), m_width(0), m_height(0), m_refresh(0), m_create_error_count(0), m_device(NULL), m_gamma_supported(0), m_pixformat(),
- m_vertexbuf(NULL), m_lockedbuf(NULL), m_numverts(0), m_vectorbatch(NULL), m_batchindex(0), m_numpolys(0), m_restarting(false), m_mod2x_supported(0), m_mod4x_supported(0),
- m_screen_format(), m_last_texture(NULL), m_last_texture_flags(0), m_last_blendenable(0), m_last_blendop(0), m_last_blendsrc(0), m_last_blenddst(0), m_last_filter(0),
- m_last_wrap(), m_last_modmode(0), m_hlsl_buf(NULL), m_shaders(NULL), m_shaders_options(NULL), m_texture_manager(NULL), m_line_count(0)
+renderer_d3d9::renderer_d3d9(osd_window *window)
+ : osd_renderer(window, FLAG_NONE), m_adapter(0), m_width(0), m_height(0), m_refresh(0), m_create_error_count(0), m_device(nullptr), m_gamma_supported(0), m_pixformat(),
+ m_vertexbuf(nullptr), m_lockedbuf(nullptr), m_numverts(0), m_vectorbatch(nullptr), m_batchindex(0), m_numpolys(0), m_restarting(false), m_mod2x_supported(0), m_mod4x_supported(0),
+ m_screen_format(), m_last_texture(nullptr), m_last_texture_flags(0), m_last_blendenable(0), m_last_blendop(0), m_last_blendsrc(0), m_last_blenddst(0), m_last_filter(0),
+ m_last_wrap(), m_last_modmode(0), m_hlsl_buf(nullptr), m_shaders(nullptr), m_shaders_options(nullptr), m_texture_manager(nullptr), m_line_count(0)
{
}
-int renderer::initialize()
+int renderer_d3d9::initialize()
{
// configure the adapter for the mode we want
if (config_adapter_mode())
+ {
return false;
+ }
// create the device immediately for the full screen case (defer for window mode)
if (window().fullscreen() && device_create(window().m_focus_hwnd))
+ {
return false;
+ }
return true;
}
-int renderer::pre_window_draw_check()
+int renderer_d3d9::pre_window_draw_check()
{
// if we're in the middle of resizing, leave things alone
if (window().m_resize_state == RESIZE_STATE_RESIZING)
@@ -651,7 +604,7 @@ int renderer::pre_window_draw_check()
}
// if we have a device, check the cooperative level
- if (m_device != NULL)
+ if (m_device != nullptr)
{
if (device_test_cooperative())
{
@@ -660,28 +613,28 @@ int renderer::pre_window_draw_check()
}
// in window mode, we need to track the window size
- if (!window().fullscreen() || m_device == NULL)
+ if (!window().fullscreen() || m_device == nullptr)
{
// if the size changes, skip this update since the render target will be out of date
if (update_window_size())
return 0;
// if we have no device, after updating the size, return an error so GDI can try
- if (m_device == NULL)
+ if (m_device == nullptr)
return 1;
}
return -1;
}
-void texture_manager::update_textures()
+void d3d_texture_manager::update_textures()
{
- for (render_primitive *prim = m_renderer->window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (render_primitive *prim = m_renderer->window().m_primlist->first(); prim != nullptr; prim = prim->next())
{
- if (prim->texture.base != NULL)
+ if (prim->texture.base != nullptr)
{
texture_info *texture = find_texinfo(&prim->texture, prim->flags);
- if (texture == NULL)
+ if (texture == nullptr)
{
// if there isn't one, create a new texture
global_alloc(texture_info(this, &prim->texture, m_renderer->window().prescale(), prim->flags));
@@ -706,9 +659,9 @@ void texture_manager::update_textures()
}
}
-void renderer::begin_frame()
+void renderer_d3d9::begin_frame()
{
- HRESULT result = (*d3dintf->device.clear)(m_device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ HRESULT result = (*d3dintf->device.clear)(m_device, 0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
m_shaders->begin_frame();
@@ -723,7 +676,7 @@ void renderer::begin_frame()
result = (*d3dintf->device.begin_scene)(m_device);
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during device begin_scene call\n", (int)result);
- m_lockedbuf = NULL;
+ m_lockedbuf = nullptr;
if(m_shaders->enabled())
{
@@ -734,15 +687,15 @@ void renderer::begin_frame()
m_line_count = 0;
// loop over primitives
- for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (render_primitive *prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
if (prim->type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim->flags))
m_line_count++;
}
-void renderer::process_primitives()
+void renderer_d3d9::process_primitives()
{
// Rotating index for vector time offsets
- for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (render_primitive *prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
{
switch (prim->type)
{
@@ -770,7 +723,7 @@ void renderer::process_primitives()
}
}
-void renderer::end_frame()
+void renderer_d3d9::end_frame()
{
window().m_primlist->release_lock();
@@ -784,7 +737,7 @@ void renderer::end_frame()
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during device end_scene call\n", (int)result);
// present the current buffers
- result = (*d3dintf->device.present)(m_device, NULL, NULL, NULL, NULL, 0);
+ result = (*d3dintf->device.present)(m_device, nullptr, nullptr, nullptr, nullptr, 0);
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during device present call\n", (int)result);
}
@@ -792,10 +745,10 @@ void renderer::end_frame()
// device_create
//============================================================
-int renderer::device_create(HWND device_hwnd)
+int renderer_d3d9::device_create(HWND device_hwnd)
{
// if a device exists, free it
- if (m_device != NULL)
+ if (m_device != nullptr)
{
device_delete();
}
@@ -820,7 +773,7 @@ int renderer::device_create(HWND device_hwnd)
return 1;
}
- m_texture_manager = global_alloc(texture_manager(this));
+ m_texture_manager = global_alloc(d3d_texture_manager(this));
try_again:
// try for XRGB first
@@ -913,7 +866,7 @@ try_again:
}
// create shader options only once
- if (m_shaders_options == NULL)
+ if (m_shaders_options == nullptr)
{
m_shaders_options = (hlsl_options*)global_alloc_clear<hlsl_options>();
m_shaders_options->params_init = false;
@@ -921,6 +874,7 @@ try_again:
m_shaders = (shaders*)global_alloc_clear<shaders>();
m_shaders->init(d3dintf, &window().machine(), this);
+ m_sliders_dirty = true;
int failed = m_shaders->create_resources(false);
if (failed)
@@ -936,7 +890,7 @@ try_again:
// device_create_resources
//============================================================
-int renderer::device_create_resources()
+int renderer_d3d9::device_create_resources()
{
// allocate a vertex buffer to use
HRESULT result = (*d3dintf->device.create_vertex_buffer)(m_device,
@@ -988,8 +942,8 @@ int renderer::device_create_resources()
reset_render_states();
// clear the buffer
- result = (*d3dintf->device.clear)(m_device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- result = (*d3dintf->device.present)(m_device, NULL, NULL, NULL, NULL, 0);
+ result = (*d3dintf->device.clear)(m_device, 0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ result = (*d3dintf->device.present)(m_device, nullptr, nullptr, nullptr, nullptr, 0);
m_texture_manager->create_resources();
@@ -1001,20 +955,26 @@ int renderer::device_create_resources()
// device_delete
//============================================================
-renderer::~renderer()
+renderer_d3d9::~renderer_d3d9()
{
+ if (get_shaders() != nullptr && get_shaders()->recording())
+ get_shaders()->window_record();
+
+ if (d3dintf != nullptr)
+ (*d3dintf->d3d.release)(d3dintf);
+
device_delete();
- if (m_shaders_options != NULL)
+ if (m_shaders_options != nullptr)
{
global_free(m_shaders_options);
- m_shaders_options = NULL;
+ m_shaders_options = nullptr;
}
}
-void renderer::device_delete()
+void renderer_d3d9::device_delete()
{
- if (m_shaders != NULL)
+ if (m_shaders != nullptr)
{
// free our effects
m_shaders->delete_resources(false);
@@ -1026,18 +986,18 @@ void renderer::device_delete()
// free our base resources
device_delete_resources();
- if (m_texture_manager != NULL)
+ if (m_texture_manager != nullptr)
{
global_free(m_texture_manager);
- m_texture_manager = NULL;
+ m_texture_manager = nullptr;
}
// free the device itself
- if (m_device != NULL)
+ if (m_device != nullptr)
{
(*d3dintf->device.reset)(m_device, &m_presentation);
(*d3dintf->device.release)(m_device);
- m_device = NULL;
+ m_device = nullptr;
}
}
@@ -1046,18 +1006,18 @@ void renderer::device_delete()
// device_delete_resources
//============================================================
-void renderer::device_delete_resources()
+void renderer_d3d9::device_delete_resources()
{
- if (m_texture_manager != NULL)
+ if (m_texture_manager != nullptr)
{
m_texture_manager->delete_resources();
}
// free the vertex buffer
- if (m_vertexbuf != NULL)
+ if (m_vertexbuf != nullptr)
{
(*d3dintf->vertexbuf.release)(m_vertexbuf);
- m_vertexbuf = NULL;
+ m_vertexbuf = nullptr;
}
}
@@ -1066,7 +1026,7 @@ void renderer::device_delete_resources()
// device_verify_caps
//============================================================
-int renderer::device_verify_caps()
+int renderer_d3d9::device_verify_caps()
{
int retval = 0;
@@ -1132,7 +1092,7 @@ int renderer::device_verify_caps()
// device_test_cooperative
//============================================================
-int renderer::device_test_cooperative()
+int renderer_d3d9::device_test_cooperative()
{
// check our current status; if we lost the device, punt to GDI
HRESULT result = (*d3dintf->device.test_cooperative_level)(m_device);
@@ -1179,7 +1139,7 @@ int renderer::device_test_cooperative()
// config_adapter_mode
//============================================================
-int renderer::config_adapter_mode()
+int renderer_d3d9::config_adapter_mode()
{
adapter_identifier identifier;
@@ -1254,7 +1214,7 @@ int renderer::config_adapter_mode()
// get_adapter_for_monitor
//============================================================
-int renderer::get_adapter_for_monitor()
+int renderer_d3d9::get_adapter_for_monitor()
{
int maxadapter = (*d3dintf->d3d.get_adapter_count)(d3dintf);
@@ -1280,7 +1240,7 @@ int renderer::get_adapter_for_monitor()
// pick_best_mode
//============================================================
-void renderer::pick_best_mode()
+void renderer_d3d9::pick_best_mode()
{
double target_refresh = 60.0;
INT32 minwidth, minheight;
@@ -1288,7 +1248,7 @@ void renderer::pick_best_mode()
// determine the refresh rate of the primary screen
const screen_device *primary_screen = window().machine().config().first_screen();
- if (primary_screen != NULL)
+ if (primary_screen != nullptr)
{
target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh_attoseconds());
}
@@ -1368,14 +1328,14 @@ void renderer::pick_best_mode()
// update_window_size
//============================================================
-int renderer::update_window_size()
+int renderer_d3d9::update_window_size()
{
// get the current window bounds
RECT client;
GetClientRectExceptMenu(window().m_hwnd, &client, window().fullscreen());
// if we have a device and matching width/height, nothing to do
- if (m_device != NULL && rect_width(&client) == m_width && rect_height(&client) == m_height)
+ if (m_device != nullptr && rect_width(&client) == m_width && rect_height(&client) == m_height)
{
// clear out any pending resizing if the area didn't change
if (window().m_resize_state == RESIZE_STATE_PENDING)
@@ -1403,7 +1363,7 @@ int renderer::update_window_size()
// batch_vectors
//============================================================
-void renderer::batch_vectors()
+void renderer_d3d9::batch_vectors()
{
windows_options &options = downcast<windows_options &>(window().machine().options());
@@ -1415,7 +1375,7 @@ void renderer::batch_vectors()
int line_index = 0;
float period = options.screen_vector_time_period();
UINT32 cached_flags = 0;
- for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (render_primitive *prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
{
switch (prim->type)
{
@@ -1455,7 +1415,7 @@ void renderer::batch_vectors()
m_line_count = 0;
}
-void renderer::batch_vector(const render_primitive *prim, float line_time)
+void renderer_d3d9::batch_vector(const render_primitive *prim, float line_time)
{
// compute the effective width based on the direction of the line
float effwidth = prim->width;
@@ -1473,7 +1433,7 @@ void renderer::batch_vector(const render_primitive *prim, float line_time)
step->weight != 0; step++)
{
// get a pointer to the vertex buffer
- if (m_vectorbatch == NULL)
+ if (m_vectorbatch == nullptr)
return;
m_vectorbatch[m_batchindex + 0].x = b0.x0 + step->xoffs;
@@ -1557,7 +1517,7 @@ void renderer::batch_vector(const render_primitive *prim, float line_time)
// draw_line
//============================================================
-void renderer::draw_line(const render_primitive *prim)
+void renderer_d3d9::draw_line(const render_primitive *prim)
{
// compute the effective width based on the direction of the line
float effwidth = prim->width;
@@ -1576,7 +1536,7 @@ void renderer::draw_line(const render_primitive *prim)
{
// get a pointer to the vertex buffer
vertex *vertex = mesh_alloc(4);
- if (vertex == NULL)
+ if (vertex == nullptr)
return;
// rotate the unit vector by 135 degrees and add to point 0
@@ -1641,18 +1601,18 @@ void renderer::draw_line(const render_primitive *prim)
// draw_quad
//============================================================
-void renderer::draw_quad(const render_primitive *prim)
+void renderer_d3d9::draw_quad(const render_primitive *prim)
{
texture_info *texture = m_texture_manager->find_texinfo(&prim->texture, prim->flags);
- if (texture == NULL)
+ if (texture == nullptr)
{
texture = get_default_texture();
}
// get a pointer to the vertex buffer
vertex *vertex = mesh_alloc(4);
- if (vertex == NULL)
+ if (vertex == nullptr)
return;
// fill in the vertexes clockwise
@@ -1668,7 +1628,7 @@ void renderer::draw_quad(const render_primitive *prim)
float height = prim->bounds.y1 - prim->bounds.y0;
// set the texture coordinates
- if(texture != NULL)
+ if(texture != nullptr)
{
vec2f& start = texture->get_uvstart();
vec2f& stop = texture->get_uvstop();
@@ -1689,7 +1649,7 @@ void renderer::draw_quad(const render_primitive *prim)
INT32 b = (INT32)(prim->color.b * 255.0f);
INT32 a = (INT32)(prim->color.a * 255.0f);
DWORD modmode = D3DTOP_MODULATE;
- if (texture != NULL)
+ if (texture != nullptr)
{
if (m_mod2x_supported && (r > 255 || g > 255 || b > 255))
{
@@ -1755,12 +1715,12 @@ void poly_info::init(D3DPRIMITIVETYPE type, UINT32 count, UINT32 numverts,
// primitive_alloc
//============================================================
-vertex *renderer::mesh_alloc(int numverts)
+vertex *renderer_d3d9::mesh_alloc(int numverts)
{
HRESULT result;
// if we're going to overflow, flush
- if (m_lockedbuf != NULL && m_numverts + numverts >= VERTEX_BUFFER_SIZE)
+ if (m_lockedbuf != nullptr && m_numverts + numverts >= VERTEX_BUFFER_SIZE)
{
primitive_flush_pending();
@@ -1772,21 +1732,21 @@ vertex *renderer::mesh_alloc(int numverts)
}
// if we don't have a lock, grab it now
- if (m_lockedbuf == NULL)
+ if (m_lockedbuf == nullptr)
{
result = (*d3dintf->vertexbuf.lock)(m_vertexbuf, 0, 0, (VOID **)&m_lockedbuf, D3DLOCK_DISCARD);
if (result != D3D_OK)
- return NULL;
+ return nullptr;
}
// if we already have the lock and enough room, just return a pointer
- if (m_lockedbuf != NULL && m_numverts + numverts < VERTEX_BUFFER_SIZE)
+ if (m_lockedbuf != nullptr && m_numverts + numverts < VERTEX_BUFFER_SIZE)
{
int oldverts = m_numverts;
m_numverts += numverts;
return &m_lockedbuf[oldverts];
}
- return NULL;
+ return nullptr;
}
@@ -1794,10 +1754,10 @@ vertex *renderer::mesh_alloc(int numverts)
// primitive_flush_pending
//============================================================
-void renderer::primitive_flush_pending()
+void renderer_d3d9::primitive_flush_pending()
{
// ignore if we're not locked
- if (m_lockedbuf == NULL)
+ if (m_lockedbuf == nullptr)
{
return;
}
@@ -1805,7 +1765,7 @@ void renderer::primitive_flush_pending()
// unlock the buffer
HRESULT result = (*d3dintf->vertexbuf.unlock)(m_vertexbuf);
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during vertex buffer unlock call\n", (int)result);
- m_lockedbuf = NULL;
+ m_lockedbuf = nullptr;
// set the stream
result = (*d3dintf->device.set_stream_source)(m_device, 0, m_vertexbuf, sizeof(vertex));
@@ -1830,7 +1790,7 @@ void renderer::primitive_flush_pending()
set_texture(texture);
// set filtering if different
- if (texture != NULL)
+ if (texture != nullptr)
{
newfilter = FALSE;
if (PRIMFLAG_GET_SCREENTEX(flags))
@@ -1882,24 +1842,24 @@ void renderer::primitive_flush_pending()
texture_info::~texture_info()
{
- if (m_d3dfinaltex != NULL)
+ if (m_d3dfinaltex != nullptr)
{
if (m_d3dtex == m_d3dfinaltex)
{
- m_d3dtex = NULL;
+ m_d3dtex = nullptr;
}
(*d3dintf->texture.release)(m_d3dfinaltex);
- m_d3dfinaltex = NULL;
+ m_d3dfinaltex = nullptr;
}
- if (m_d3dtex != NULL)
+ if (m_d3dtex != nullptr)
{
(*d3dintf->texture.release)(m_d3dtex);
- m_d3dtex = NULL;
+ m_d3dtex = nullptr;
}
- if (m_d3dsurface != NULL)
+ if (m_d3dsurface != nullptr)
{
(*d3dintf->surface.release)(m_d3dsurface);
- m_d3dsurface = NULL;
+ m_d3dsurface = nullptr;
}
}
@@ -1908,7 +1868,7 @@ texture_info::~texture_info()
// texture_info constructor
//============================================================
-texture_info::texture_info(texture_manager *manager, const render_texinfo* texsource, int prescale, UINT32 flags)
+texture_info::texture_info(d3d_texture_manager *manager, const render_texinfo* texsource, int prescale, UINT32 flags)
{
HRESULT result;
@@ -1921,9 +1881,9 @@ texture_info::texture_info(texture_manager *manager, const render_texinfo* texso
m_xprescale = prescale;
m_yprescale = prescale;
- m_d3dtex = NULL;
- m_d3dsurface = NULL;
- m_d3dfinaltex = NULL;
+ m_d3dtex = nullptr;
+ m_d3dsurface = nullptr;
+ m_d3dfinaltex = nullptr;
// compute the size
compute_size(texsource->width, texsource->height);
@@ -2053,7 +2013,7 @@ texture_info::texture_info(texture_manager *manager, const render_texinfo* texso
break;
}
(*d3dintf->texture.release)(m_d3dtex);
- m_d3dtex = NULL;
+ m_d3dtex = nullptr;
}
}
}
@@ -2063,9 +2023,9 @@ texture_info::texture_info(texture_manager *manager, const render_texinfo* texso
//texsource->osdhandle = (void*)this;
// add us to the texture list
- if(m_texture_manager->get_texlist() != NULL)
+ if(m_texture_manager->get_texlist() != nullptr)
m_texture_manager->get_texlist()->m_prev = this;
- m_prev = NULL;
+ m_prev = nullptr;
m_next = m_texture_manager->get_texlist();
m_texture_manager->set_texlist(this);
return;
@@ -2073,9 +2033,9 @@ texture_info::texture_info(texture_manager *manager, const render_texinfo* texso
error:
d3dintf->post_fx_available = false;
osd_printf_error("Direct3D: Critical warning: A texture failed to allocate. Expect things to get bad quickly.\n");
- if (m_d3dsurface != NULL)
+ if (m_d3dsurface != nullptr)
(*d3dintf->surface.release)(m_d3dsurface);
- if (m_d3dtex != NULL)
+ if (m_d3dtex != nullptr)
(*d3dintf->texture.release)(m_d3dtex);
}
@@ -2242,7 +2202,7 @@ static inline void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, con
assert(xborderpix == 0 || xborderpix == 1);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2285,7 +2245,7 @@ static inline void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, co
assert(xborderpix == 0 || xborderpix == 1);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2329,7 +2289,7 @@ static inline void copyline_yuy16_to_yuy2(UINT16 *dst, const UINT16 *src, int wi
assert(width % 2 == 0);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2394,7 +2354,7 @@ static inline void copyline_yuy16_to_uyvy(UINT16 *dst, const UINT16 *src, int wi
assert(width % 2 == 0);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2457,7 +2417,7 @@ static inline void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int wi
assert(width % 2 == 0);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2535,9 +2495,9 @@ void texture_info::set_data(const render_texinfo *texsource, UINT32 flags)
switch (m_type)
{
default:
- case TEXTURE_TYPE_PLAIN: result = (*d3dintf->texture.lock_rect)(m_d3dtex, 0, &rect, NULL, 0); break;
- case TEXTURE_TYPE_DYNAMIC: result = (*d3dintf->texture.lock_rect)(m_d3dtex, 0, &rect, NULL, D3DLOCK_DISCARD); break;
- case TEXTURE_TYPE_SURFACE: result = (*d3dintf->surface.lock_rect)(m_d3dsurface, &rect, NULL, D3DLOCK_DISCARD); break;
+ case TEXTURE_TYPE_PLAIN: result = (*d3dintf->texture.lock_rect)(m_d3dtex, 0, &rect, nullptr, 0); break;
+ case TEXTURE_TYPE_DYNAMIC: result = (*d3dintf->texture.lock_rect)(m_d3dtex, 0, &rect, nullptr, D3DLOCK_DISCARD); break;
+ case TEXTURE_TYPE_SURFACE: result = (*d3dintf->surface.lock_rect)(m_d3dsurface, &rect, nullptr, D3DLOCK_DISCARD); break;
}
if (result != D3D_OK)
{
@@ -2625,7 +2585,7 @@ void texture_info::prescale()
// if we have an offscreen plain surface, we can just StretchRect to it
if (m_type == TEXTURE_TYPE_SURFACE)
{
- assert(m_d3dsurface != NULL);
+ assert(m_d3dsurface != nullptr);
// set the source bounds
RECT source;
@@ -2649,7 +2609,7 @@ void texture_info::prescale()
{
surface *backbuffer;
- assert(m_d3dtex != NULL);
+ assert(m_d3dtex != nullptr);
// first remember the original render target and set the new one
result = (*d3dintf->device.get_render_target)(m_renderer->get_device(), 0, &backbuffer);
@@ -2704,7 +2664,7 @@ void texture_info::prescale()
// unlock the vertex buffer
result = (*d3dintf->vertexbuf.unlock)(m_renderer->get_vertex_buffer());
if (result != D3D_OK) osd_printf_verbose("Direct3D: Error %08X during vertex buffer unlock call\n", (int)result);
- m_renderer->set_locked_buffer(NULL);
+ m_renderer->set_locked_buffer(nullptr);
// set the stream and draw the triangle strip
result = (*d3dintf->device.set_stream_source)(m_renderer->get_device(), 0, m_renderer->get_vertex_buffer(), sizeof(vertex));
@@ -2734,15 +2694,15 @@ void texture_info::prescale()
cache_target::~cache_target()
{
- if (last_texture != NULL)
+ if (last_texture != nullptr)
{
(*d3dintf->texture.release)(last_texture);
- last_texture = NULL;
+ last_texture = nullptr;
}
- if (last_target != NULL)
+ if (last_target != nullptr)
{
(*d3dintf->surface.release)(last_target);
- last_target = NULL;
+ last_target = nullptr;
}
}
@@ -2751,7 +2711,7 @@ cache_target::~cache_target()
// cache_target::init - initializes a target cache
//============================================================
-bool cache_target::init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y)
+bool cache_target::init(renderer_d3d9 *d3d, d3d_base *d3dintf, int width, int height, int prescale_x, int prescale_y)
{
HRESULT result = (*d3dintf->device.create_texture)(d3d->get_device(), width * prescale_x, height * prescale_y, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &last_texture);
if (result != D3D_OK)
@@ -2768,56 +2728,56 @@ bool cache_target::init(renderer *d3d, base *d3dintf, int width, int height, int
//============================================================
-// render_target::~render_target
+// d3d_render_target::~d3d_render_target
//============================================================
-render_target::~render_target()
+d3d_render_target::~d3d_render_target()
{
for (int index = 0; index < 11; index++)
{
- if (bloom_texture[index] != NULL)
+ if (bloom_texture[index] != nullptr)
{
(*d3dintf->texture.release)(bloom_texture[index]);
- bloom_texture[index] = NULL;
+ bloom_texture[index] = nullptr;
}
- if (bloom_target[index] != NULL)
+ if (bloom_target[index] != nullptr)
{
(*d3dintf->surface.release)(bloom_target[index]);
- bloom_target[index] = NULL;
+ bloom_target[index] = nullptr;
}
}
for (int index = 0; index < 2; index++)
{
- if (native_texture[index] != NULL)
+ if (native_texture[index] != nullptr)
{
(*d3dintf->texture.release)(native_texture[index]);
- native_texture[index] = NULL;
+ native_texture[index] = nullptr;
}
- if (native_target[index] != NULL)
+ if (native_target[index] != nullptr)
{
(*d3dintf->surface.release)(native_target[index]);
- native_target[index] = NULL;
+ native_target[index] = nullptr;
}
- if (prescale_texture[index] != NULL)
+ if (prescale_texture[index] != nullptr)
{
(*d3dintf->texture.release)(prescale_texture[index]);
- prescale_texture[index] = NULL;
+ prescale_texture[index] = nullptr;
}
- if (prescale_target[index] != NULL)
+ if (prescale_target[index] != nullptr)
{
(*d3dintf->surface.release)(prescale_target[index]);
- prescale_target[index] = NULL;
+ prescale_target[index] = nullptr;
}
}
}
//============================================================
-// render_target::init - initializes a render target
+// d3d_render_target::init - initializes a render target
//============================================================
-bool render_target::init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y)
+bool d3d_render_target::init(renderer_d3d9 *d3d, d3d_base *d3dintf, int width, int height, int prescale_x, int prescale_y)
{
HRESULT result;
@@ -2866,4 +2826,12 @@ bool render_target::init(renderer *d3d, base *d3dintf, int width, int height, in
return true;
}
+texture_info *renderer_d3d9::get_default_texture()
+{
+ return m_texture_manager->get_default_texture();
+}
+
+texture_info *renderer_d3d9::get_vector_texture()
+{
+ return m_texture_manager->get_vector_texture();
}
diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h
index 906bd7711b8..31246f5baf8 100644
--- a/src/osd/modules/render/drawd3d.h
+++ b/src/osd/modules/render/drawd3d.h
@@ -9,9 +9,10 @@
#ifndef __WIN_DRAWD3D__
#define __WIN_DRAWD3D__
+#ifdef OSD_WINDOWS
-#include "modules/render/d3d/d3dhlsl.h"
-
+#include "d3d/d3dintf.h"
+#include "d3d/d3dcomm.h"
//============================================================
// CONSTANTS
@@ -24,87 +25,30 @@
// TYPE DEFINITIONS
//============================================================
-namespace d3d
-{
-class cache_target;
-class render_target;
-class renderer;
-
-/* cache_target is a simple linked list containing only a rednerable target and texture, used for phosphor effects */
-class cache_target
-{
-public:
- // construction/destruction
- cache_target() { }
- ~cache_target();
-
- bool init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y);
-
- surface *last_target;
- texture *last_texture;
-
- int target_width;
- int target_height;
-
- int width;
- int height;
-
- int screen_index;
-
- cache_target *next;
- cache_target *prev;
-};
-
-/* render_target is the information about a Direct3D render target chain */
-class render_target
-{
-public:
- // construction/destruction
- render_target() { }
- ~render_target();
-
- bool init(renderer *d3d, base *d3dintf, int width, int height, int prescale_x, int prescale_y);
- int next_index(int index) { return ++index > 1 ? 0 : index; }
-
- int target_width;
- int target_height;
-
- int prescale_x;
- int prescale_y;
-
- int width;
- int height;
-
- int screen_index;
- int page_index;
-
- surface *prescale_target[2];
- texture *prescale_texture[2];
- surface *native_target[2];
- texture *native_texture[2];
-
- render_target *next;
- render_target *prev;
-
- surface *bloom_target[11];
- texture *bloom_texture[11];
-};
+struct vertex;
+class texture_info;
+class texture_manager;
+struct device;
+struct vertex_buffer;
+class shaders;
+struct hlsl_options;
+class poly_info;
/* renderer is the information about Direct3D for the current screen */
-class renderer : public osd_renderer
+class renderer_d3d9 : public osd_renderer
{
public:
- //renderer() { }
- renderer(osd_window *window);
- virtual ~renderer();
+ renderer_d3d9(osd_window *window);
+ virtual ~renderer_d3d9();
virtual int create() override;
+ virtual slider_state* get_slider_list() override;
+ static bool init(running_machine &machine);
virtual render_primitive_list *get_primitives() override;
virtual int draw(const int update) override;
virtual void save() override;
virtual void record() override;
virtual void toggle_fsfx() override;
- virtual void destroy() override;
int initialize();
@@ -140,8 +84,8 @@ public:
void set_texture(texture_info *texture);
void set_filter(int filter);
- void set_wrap(D3DTEXTUREADDRESS wrap);
- void set_modmode(DWORD modmode);
+ void set_wrap(unsigned int wrap);
+ void set_modmode(int modmode);
void set_blendmode(int blendmode);
void reset_render_states();
@@ -164,15 +108,15 @@ public:
bool is_mod2x_supported() { return (bool)m_mod2x_supported; }
bool is_mod4x_supported() { return (bool)m_mod4x_supported; }
- D3DFORMAT get_screen_format() { return m_screen_format; }
- D3DFORMAT get_pixel_format() { return m_pixformat; }
- D3DDISPLAYMODE get_origmode() { return m_origmode; }
+ D3DFORMAT get_screen_format() { return m_screen_format; }
+ D3DFORMAT get_pixel_format() { return m_pixformat; }
+ D3DDISPLAYMODE get_origmode() { return m_origmode; }
UINT32 get_last_texture_flags() { return m_last_texture_flags; }
- texture_manager * get_texture_manager() { return m_texture_manager; }
- texture_info * get_default_texture() { return m_texture_manager->get_default_texture(); }
- texture_info * get_vector_texture() { return m_texture_manager->get_vector_texture(); }
+ d3d_texture_manager * get_texture_manager() { return m_texture_manager; }
+ texture_info * get_default_texture();
+ texture_info * get_vector_texture();
shaders * get_shaders() { return m_shaders; }
hlsl_options * get_shaders_options() { return m_shaders_options; }
@@ -186,9 +130,9 @@ private:
device * m_device; // pointer to the Direct3DDevice object
int m_gamma_supported; // is full screen gamma supported?
- present_parameters m_presentation; // set of presentation parameters
- D3DDISPLAYMODE m_origmode; // original display mode for the adapter
- D3DFORMAT m_pixformat; // pixel format we are using
+ present_parameters m_presentation; // set of presentation parameters
+ D3DDISPLAYMODE m_origmode; // original display mode for the adapter
+ D3DFORMAT m_pixformat; // pixel format we are using
vertex_buffer * m_vertexbuf; // pointer to the vertex buffer object
vertex * m_lockedbuf; // pointer to the locked vertex buffer
@@ -197,14 +141,14 @@ private:
vertex * m_vectorbatch; // pointer to the vector batch buffer
int m_batchindex; // current index into the vector batch
- poly_info m_poly[VERTEX_BUFFER_SIZE/3];// array to hold polygons as they are created
+ poly_info m_poly[VERTEX_BUFFER_SIZE/3];// array to hold polygons as they are created
int m_numpolys; // number of accumulated polygons
bool m_restarting; // if we're restarting
int m_mod2x_supported; // is D3DTOP_MODULATE2X supported?
int m_mod4x_supported; // is D3DTOP_MODULATE4X supported?
- D3DFORMAT m_screen_format; // format to use for screen textures
+ D3DFORMAT m_screen_format; // format to use for screen textures
texture_info * m_last_texture; // previous texture
UINT32 m_last_texture_flags; // previous texture flags
@@ -213,18 +157,18 @@ private:
int m_last_blendsrc; // previous blendmode
int m_last_blenddst; // previous blendmode
int m_last_filter; // previous texture filter
- D3DTEXTUREADDRESS m_last_wrap; // previous wrap state
- DWORD m_last_modmode; // previous texture modulation
+ UINT32 m_last_wrap; // previous wrap state
+ int m_last_modmode; // previous texture modulation
void * m_hlsl_buf; // HLSL vertex data
shaders * m_shaders; // HLSL interface
hlsl_options * m_shaders_options; // HLSL options
- texture_manager * m_texture_manager; // texture manager
+ d3d_texture_manager * m_texture_manager; // texture manager
int m_line_count;
};
-}
+#endif // OSD_WINDOWS
-#endif
+#endif // __WIN_DRAWD3D__ \ No newline at end of file
diff --git a/src/osd/modules/render/drawdd.cpp b/src/osd/modules/render/drawdd.cpp
deleted file mode 100644
index f15b70691c2..00000000000
--- a/src/osd/modules/render/drawdd.cpp
+++ /dev/null
@@ -1,1317 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
-//============================================================
-//
-// drawdd.c - Win32 DirectDraw implementation
-//
-//============================================================
-
-// standard windows headers
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-#include <ddraw.h>
-#undef interface
-
-// MAME headers
-#include "emu.h"
-#include "render.h"
-#include "rendutil.h"
-#include "rendersw.inc"
-
-// MAMEOS headers
-#include "winmain.h"
-#include "window.h"
-
-
-
-//============================================================
-// TYPE DEFINITIONS
-//============================================================
-
-typedef HRESULT (WINAPI *directdrawcreateex_ptr)(GUID FAR *lpGuid, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter);
-typedef HRESULT (WINAPI *directdrawenumerateex_ptr)(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
-
-
-/* dd_info is the information about DirectDraw for the current screen */
-class renderer_dd : public osd_renderer
-{
-public:
- renderer_dd(osd_window *window)
- : osd_renderer(window, FLAG_NONE),
- width(0),
- height(0),
- refresh(0),
- //adapter(0),
- adapter_ptr(NULL),
- clearouter(0),
- blitwidth(0), blitheight(0),
- //lastdest
- ddraw(NULL),
- primary(NULL),
- back(NULL),
- blit(NULL),
- clipper(NULL),
- gamma(NULL),
- //DDSURFACEDESC2 primarydesc;
- //DDSURFACEDESC2 blitdesc;
- //DDSURFACEDESC2 origmode;
- //ddcaps(0),
- //helcaps(0),
- membuffer(NULL),
- membuffersize(0)
- { }
-
- virtual ~renderer_dd() { }
-
- virtual int create() override;
- virtual render_primitive_list *get_primitives() override;
- virtual int draw(const int update) override;
- virtual void save() override {};
- virtual void record() override {};
- virtual void toggle_fsfx() override {};
- virtual void destroy() override;
-
- int width, height; // current width, height
- int refresh; // current refresh rate
-
-private:
-
- inline void update_outer_rects();
-
- // surface management
- int ddraw_create();
- int ddraw_create_surfaces();
- void ddraw_delete();
- void ddraw_delete_surfaces();
- int ddraw_verify_caps();
- int ddraw_test_cooperative();
- HRESULT create_surface(DDSURFACEDESC2 *desc, IDirectDrawSurface7 **surface, const char *type);
- int create_clipper();
-
- // drawing helpers
- void compute_blit_surface_size();
- void blit_to_primary(int srcwidth, int srcheight);
-
- // video modes
- int config_adapter_mode();
- void get_adapter_for_monitor(osd_monitor_info *monitor);
- void pick_best_mode();
-
- // various
- void calc_fullscreen_margins(DWORD desc_width, DWORD desc_height, RECT *margins);
-
-
- GUID adapter; // current display adapter
- GUID * adapter_ptr; // pointer to current display adapter
- int clearouter; // clear the outer areas?
-
- INT32 blitwidth, blitheight; // current blit width/height values
- RECT lastdest; // last destination rectangle
-
- IDirectDraw7 * ddraw; // pointer to the DirectDraw object
- IDirectDrawSurface7 * primary; // pointer to the primary surface object
- IDirectDrawSurface7 * back; // pointer to the back buffer surface object
- IDirectDrawSurface7 * blit; // pointer to the blit surface object
- IDirectDrawClipper * clipper; // pointer to the clipper object
- IDirectDrawGammaControl *gamma; // pointer to the gamma control object
-
- DDSURFACEDESC2 primarydesc; // description of the primary surface
- DDSURFACEDESC2 blitdesc; // description of the blitting surface
- DDSURFACEDESC2 origmode; // original video mode
-
- DDCAPS ddcaps; // capabilities of the device
- DDCAPS helcaps; // capabilities of the hardware
-
- UINT8 * membuffer; // memory buffer for complex rendering
- UINT32 membuffersize; // current size of the memory buffer
-};
-
-
-/* monitor_enum_info holds information during a monitor enumeration */
-struct monitor_enum_info
-{
- osd_monitor_info * monitor; // pointer to monitor we want
- GUID guid; // GUID of the one we found
- GUID * guid_ptr; // pointer to our GUID
- int foundit; // TRUE if we found what we wanted
-};
-
-
-/* mode_enum_info holds information during a display mode enumeration */
-struct mode_enum_info
-{
- renderer_dd * renderer;
- osd_window * window;
- INT32 minimum_width, minimum_height;
- INT32 target_width, target_height;
- double target_refresh;
- float best_score;
-};
-
-
-
-//============================================================
-// GLOBALS
-//============================================================
-
-static HINSTANCE dllhandle;
-static directdrawcreateex_ptr directdrawcreateex;
-static directdrawenumerateex_ptr directdrawenumerateex;
-
-
-
-//============================================================
-// INLINES
-//============================================================
-
-inline void renderer_dd::update_outer_rects()
-{
- clearouter = (back != NULL) ? 3 : 1;
-}
-
-
-static inline int better_mode(int width0, int height0, int width1, int height1, float desired_aspect)
-{
- float aspect0 = (float)width0 / (float)height0;
- float aspect1 = (float)width1 / (float)height1;
- return (fabs(desired_aspect - aspect0) < fabs(desired_aspect - aspect1)) ? 0 : 1;
-}
-
-
-
-//============================================================
-// PROTOTYPES
-//============================================================
-
-// core functions
-static void drawdd_exit(void);
-
-
-
-//============================================================
-// drawnone_create
-//============================================================
-
-static osd_renderer *drawdd_create(osd_window *window)
-{
- return global_alloc(renderer_dd(window));
-}
-
-
-//============================================================
-// drawdd_init
-//============================================================
-
-int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks)
-{
- // dynamically grab the create function from ddraw.dll
- dllhandle = LoadLibrary(TEXT("ddraw.dll"));
- if (dllhandle == NULL)
- {
- osd_printf_verbose("DirectDraw: Unable to access ddraw.dll\n");
- return 1;
- }
-
- // import the create function
- directdrawcreateex = (directdrawcreateex_ptr)GetProcAddress(dllhandle, "DirectDrawCreateEx");
- if (directdrawcreateex == NULL)
- {
- osd_printf_verbose("DirectDraw: Unable to find DirectDrawCreateEx\n");
- FreeLibrary(dllhandle);
- dllhandle = NULL;
- return 1;
- }
-
- // import the enumerate function
- directdrawenumerateex = (directdrawenumerateex_ptr)GetProcAddress(dllhandle, "DirectDrawEnumerateExA");
- if (directdrawenumerateex == NULL)
- {
- osd_printf_verbose("DirectDraw: Unable to find DirectDrawEnumerateExA\n");
- FreeLibrary(dllhandle);
- dllhandle = NULL;
- return 1;
- }
-
- // fill in the callbacks
- memset(callbacks, 0, sizeof(*callbacks));
- callbacks->exit = drawdd_exit;
- callbacks->create = drawdd_create;
-
- osd_printf_verbose("DirectDraw: Using DirectDraw 7\n");
- return 0;
-}
-
-
-
-//============================================================
-// drawdd_exit
-//============================================================
-
-static void drawdd_exit(void)
-{
- if (dllhandle != NULL)
- FreeLibrary(dllhandle);
-}
-
-
-
-//============================================================
-// drawdd_window_init
-//============================================================
-
-int renderer_dd::create()
-{
- // configure the adapter for the mode we want
- if (config_adapter_mode())
- {
- osd_printf_error("Unable to configure adapter.\n");
- goto error;
- }
-
- // create the ddraw object
- if (ddraw_create())
- {
- osd_printf_error("Unable to create ddraw object.\n");
- goto error;
- }
-
- return 0;
-
-error:
- destroy();
- osd_printf_error("Unable to initialize DirectDraw.\n");
- return 1;
-}
-
-
-
-//============================================================
-// drawdd_window_destroy
-//============================================================
-
-void renderer_dd::destroy()
-{
- // delete the ddraw object
- ddraw_delete();
-}
-
-
-
-//============================================================
-// drawdd_window_get_primitives
-//============================================================
-
-render_primitive_list *renderer_dd::get_primitives()
-{
- compute_blit_surface_size();
- window().target()->set_bounds(blitwidth, blitheight, 0);
- window().target()->set_max_update_rate((refresh == 0) ? origmode.dwRefreshRate : refresh);
-
- return &window().target()->get_primitives();
-}
-
-
-
-//============================================================
-// drawdd_window_draw
-//============================================================
-
-int renderer_dd::draw(const int update)
-{
- render_primitive *prim;
- int usemembuffer = FALSE;
- HRESULT result;
-
- // if we're updating, remember to erase the outer stuff
- if (update)
- update_outer_rects();
-
- // if we have a ddraw object, check the cooperative level
- if (ddraw_test_cooperative())
- return 1;
-
- // get the size; if we're too small, delete the existing surfaces
- if (blitwidth > blitdesc.dwWidth || blitheight > blitdesc.dwHeight)
- ddraw_delete_surfaces();
-
- // if we need to create surfaces, do it now
- if (blit == NULL && ddraw_create_surfaces() != 0)
- return 1;
-
- // select our surface and lock it
- result = IDirectDrawSurface7_Lock(blit, NULL, &blitdesc, DDLOCK_WAIT, NULL);
- if (result == DDERR_SURFACELOST)
- {
- osd_printf_verbose("DirectDraw: Lost surfaces; deleting and retrying next frame\n");
- ddraw_delete_surfaces();
- return 1;
- }
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X locking blit surface\n", (int)result);
- return 1;
- }
-
- // render to it
- window().m_primlist->acquire_lock();
-
- // scan the list of primitives for tricky stuff
- for (prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
- if (PRIMFLAG_GET_BLENDMODE(prim->flags) != BLENDMODE_NONE ||
- (prim->texture.base != NULL && PRIMFLAG_GET_TEXFORMAT(prim->flags) == TEXFORMAT_ARGB32))
- {
- usemembuffer = TRUE;
- break;
- }
-
- // if we're using the memory buffer, draw offscreen first and then copy
- if (usemembuffer)
- {
- int x, y;
-
- // based on the target format, use one of our standard renderers
- switch (blitdesc.ddpfPixelFormat.dwRBitMask)
- {
- case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break;
- case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break;
- case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break;
- case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break;
- default:
- osd_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)blitdesc.ddpfPixelFormat.dwRBitMask, (int)blitdesc.ddpfPixelFormat.dwGBitMask, (int)blitdesc.ddpfPixelFormat.dwBBitMask);
- break;
- }
-
- // handle copying to both 16bpp and 32bpp destinations
- for (y = 0; y < blitheight; y++)
- {
- if (blitdesc.ddpfPixelFormat.dwRGBBitCount == 32)
- {
- UINT32 *src = (UINT32 *)membuffer + y * blitwidth;
- UINT32 *dst = (UINT32 *)((UINT8 *)blitdesc.lpSurface + y * blitdesc.lPitch);
- for (x = 0; x < blitwidth; x++)
- *dst++ = *src++;
- }
- else if (blitdesc.ddpfPixelFormat.dwRGBBitCount == 16)
- {
- UINT16 *src = (UINT16 *)membuffer + y * blitwidth;
- UINT16 *dst = (UINT16 *)((UINT8 *)blitdesc.lpSurface + y * blitdesc.lPitch);
- for (x = 0; x < blitwidth; x++)
- *dst++ = *src++;
- }
- }
-
- }
-
- // otherwise, draw directly
- else
- {
- // based on the target format, use one of our standard renderers
- switch (blitdesc.ddpfPixelFormat.dwRBitMask)
- {
- case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 4); break;
- case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 4); break;
- case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 2); break;
- case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 2); break;
- default:
- osd_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)blitdesc.ddpfPixelFormat.dwRBitMask, (int)blitdesc.ddpfPixelFormat.dwGBitMask, (int)blitdesc.ddpfPixelFormat.dwBBitMask);
- break;
- }
- }
- window().m_primlist->release_lock();
-
- // unlock and blit
- result = IDirectDrawSurface7_Unlock(blit, NULL);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X unlocking blit surface\n", (int)result);
-
- // sync to VBLANK
- if ((video_config.waitvsync || video_config.syncrefresh) && window().machine().video().throttled() && (!window().fullscreen() || back == NULL))
- {
- result = IDirectDraw7_WaitForVerticalBlank(ddraw, DDWAITVB_BLOCKBEGIN, NULL);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X waiting for VBLANK\n", (int)result);
- }
-
- // complete the blitting
- blit_to_primary(blitwidth, blitheight);
- return 0;
-}
-
-
-
-//============================================================
-// ddraw_create
-//============================================================
-
-int renderer_dd::ddraw_create()
-{
- HRESULT result;
- int verify;
-
- // if a device exists, free it
- if (ddraw != NULL)
- ddraw_delete();
-
- // create the DirectDraw object
- result = (*directdrawcreateex)(adapter_ptr, (LPVOID *)&ddraw, WRAP_REFIID(IID_IDirectDraw7), NULL);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X during DirectDrawCreateEx call\n", (int)result);
- goto error;
- }
-
- // verify the caps
- verify = ddraw_verify_caps();
- if (verify == 2)
- {
- osd_printf_error("DirectDraw: Error - Device does not meet minimum requirements for DirectDraw rendering\n");
- goto error;
- }
- if (verify == 1)
- osd_printf_verbose("DirectDraw: Warning - Device may not perform well for DirectDraw rendering\n");
-
- // set the cooperative level
- // for non-window modes, we will use full screen here
- result = IDirectDraw7_SetCooperativeLevel(ddraw, win_window_list->m_hwnd, DDSCL_SETFOCUSWINDOW);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_SetCooperativeLevel(FOCUSWINDOW) call\n", (int)result);
- goto error;
- }
- result = IDirectDraw7_SetCooperativeLevel(ddraw, window().m_hwnd, DDSCL_SETDEVICEWINDOW | (window().fullscreen() ? DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE : DDSCL_NORMAL));
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_SetCooperativeLevel(DEVICEWINDOW) call\n", (int)result);
- goto error;
- }
-
- // full screen mode: set the resolution
- if (window().fullscreen() && video_config.switchres)
- {
- result = IDirectDraw7_SetDisplayMode(ddraw, width, height, 32, refresh, 0);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X attempting to set video mode %dx%d@%d call\n", (int)result, width, height, refresh);
- goto error;
- }
- }
-
- return ddraw_create_surfaces();
-
-error:
- ddraw_delete();
- return 1;
-}
-
-
-
-//============================================================
-// ddraw_create_surfaces
-//============================================================
-
-int renderer_dd::ddraw_create_surfaces()
-{
- HRESULT result;
-
- // make a description of the primary surface
- memset(&primarydesc, 0, sizeof(primarydesc));
- primarydesc.dwSize = sizeof(primarydesc);
- primarydesc.dwFlags = DDSD_CAPS;
- primarydesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
-
- // for triple-buffered full screen mode, allocate flipping surfaces
- if (window().fullscreen() && video_config.triplebuf)
- {
- primarydesc.dwFlags |= DDSD_BACKBUFFERCOUNT;
- primarydesc.ddsCaps.dwCaps |= DDSCAPS_FLIP | DDSCAPS_COMPLEX;
- primarydesc.dwBackBufferCount = 2;
- }
-
- // create the primary surface and report errors
- result = create_surface(&primarydesc, &primary, "primary");
- if (result != DD_OK) goto error;
-
- // full screen mode: get the back surface
- back = NULL;
- if (window().fullscreen() && video_config.triplebuf)
- {
- DDSCAPS2 caps = { DDSCAPS_BACKBUFFER };
- result = IDirectDrawSurface7_GetAttachedSurface(primary, &caps, &back);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X getting attached back surface\n", (int)result);
- goto error;
- }
- }
-
- // now make a description of our blit surface, based on the primary surface
- if (blitwidth == 0 || blitheight == 0)
- compute_blit_surface_size();
- blitdesc = primarydesc;
- blitdesc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
- blitdesc.dwWidth = blitwidth;
- blitdesc.dwHeight = blitheight;
- blitdesc.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
-
- // then create the blit surface, fall back to system memory if video mem doesn't work
- result = create_surface(&blitdesc, &blit, "blit");
- if (result != DD_OK)
- {
- blitdesc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY;
- result = create_surface(&blitdesc, &blit, "blit");
- }
- if (result != DD_OK) goto error;
-
- // create a memory buffer for offscreen drawing
- if (membuffersize < blitwidth * blitheight * 4)
- {
- membuffersize = blitwidth * blitheight * 4;
- global_free_array(membuffer);
- membuffer = global_alloc_array_nothrow(UINT8, membuffersize);
- }
- if (membuffer == NULL)
- goto error;
-
- // create a clipper for windowed mode
- if (!window().fullscreen() && create_clipper())
- goto error;
-
- // full screen mode: set the gamma
- if (window().fullscreen())
- {
- // only set the gamma if it's not 1.0f
- windows_options &options = downcast<windows_options &>(window().machine().options());
- float brightness = options.full_screen_brightness();
- float contrast = options.full_screen_contrast();
- float fgamma = options.full_screen_gamma();
- if (brightness != 1.0f || contrast != 1.0f || fgamma != 1.0f)
- {
- // see if we can get a GammaControl object
- result = IDirectDrawSurface_QueryInterface(primary, WRAP_REFIID(IID_IDirectDrawGammaControl), (void **)&gamma);
- if (result != DD_OK)
- {
- osd_printf_warning("DirectDraw: Warning - device does not support full screen gamma correction.\n");
- this->gamma = NULL;
- }
-
- // proceed if we can
- if (this->gamma != NULL)
- {
- DDGAMMARAMP ramp;
- int i;
-
- // create a standard ramp and set it
- for (i = 0; i < 256; i++)
- ramp.red[i] = ramp.green[i] = ramp.blue[i] = apply_brightness_contrast_gamma(i, brightness, contrast, fgamma) << 8;
-
- // attempt to set it
- result = IDirectDrawGammaControl_SetGammaRamp(this->gamma, 0, &ramp);
- if (result != DD_OK)
- osd_printf_verbose("DirectDraw: Error %08X attempting to set gamma correction.\n", (int)result);
- }
- }
- }
-
- // force some updates
- update_outer_rects();
- return 0;
-
-error:
- ddraw_delete_surfaces();
- return 1;
-}
-
-
-
-//============================================================
-// ddraw_delete
-//============================================================
-
-void renderer_dd::ddraw_delete()
-{
- // free surfaces
- ddraw_delete_surfaces();
-
- // restore resolutions
- if (ddraw != NULL)
- IDirectDraw7_RestoreDisplayMode(ddraw);
-
- // reset cooperative level
- if (ddraw != NULL && window().m_hwnd != NULL)
- IDirectDraw7_SetCooperativeLevel(ddraw, window().m_hwnd, DDSCL_NORMAL);
-
- // release the DirectDraw object itself
- if (ddraw != NULL)
- IDirectDraw7_Release(ddraw);
- ddraw = NULL;
-}
-
-
-
-//============================================================
-// ddraw_delete_surfaces
-//============================================================
-
-void renderer_dd::ddraw_delete_surfaces()
-{
- // release the gamma control
- if (gamma != NULL)
- IDirectDrawGammaControl_Release(gamma);
- gamma = NULL;
-
- // release the clipper
- if (clipper != NULL)
- IDirectDrawClipper_Release(clipper);
- clipper = NULL;
-
- // free the memory buffer
- global_free_array(membuffer);
- membuffer = NULL;
- membuffersize = 0;
-
- // release the blit surface
- if (blit != NULL)
- IDirectDrawSurface7_Release(blit);
- blit = NULL;
-
- // release the back surface
- if (back != NULL)
- IDirectDrawSurface7_Release(back);
- back = NULL;
-
- // release the primary surface
- if (primary != NULL)
- IDirectDrawSurface7_Release(primary);
- primary = NULL;
-}
-
-
-
-//============================================================
-// ddraw_verify_caps
-//============================================================
-
-int renderer_dd::ddraw_verify_caps()
-{
- int retval = 0;
- HRESULT result;
-
- // get the capabilities
- ddcaps.dwSize = sizeof(ddcaps);
- helcaps.dwSize = sizeof(helcaps);
- result = IDirectDraw7_GetCaps(ddraw, &ddcaps, &helcaps);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_GetCaps call\n", (int)result);
- return 1;
- }
-
- // determine if hardware stretching is available
- if ((ddcaps.dwCaps & DDCAPS_BLTSTRETCH) == 0)
- {
- osd_printf_verbose("DirectDraw: Warning - Device does not support hardware stretching\n");
- retval = 1;
- }
-
- return retval;
-}
-
-
-
-//============================================================
-// ddraw_test_cooperative
-//============================================================
-
-int renderer_dd::ddraw_test_cooperative()
-{
- HRESULT result;
-
- // check our current status; if we lost the device, punt to GDI
- result = IDirectDraw7_TestCooperativeLevel(ddraw);
- switch (result)
- {
- // punt to GDI if someone else has exclusive mode
- case DDERR_NOEXCLUSIVEMODE:
- case DDERR_EXCLUSIVEMODEALREADYSET:
- ddraw_delete_surfaces();
- return 1;
-
- // if we're ok, but we don't have a primary surface, create one
- default:
- case DD_OK:
- if (primary == NULL)
- return ddraw_create_surfaces();
- return 0;
- }
-}
-
-
-
-//============================================================
-// create_surface
-//============================================================
-
-HRESULT renderer_dd::create_surface(DDSURFACEDESC2 *desc, IDirectDrawSurface7 **surface, const char *type)
-{
- HRESULT result;
-
- // create the surface as requested
- result = IDirectDraw7_CreateSurface(ddraw, desc, surface, NULL);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X creating %s surface\n", (int)result, type);
- return result;
- }
-
- // get a description of the primary surface
- result = IDirectDrawSurface7_GetSurfaceDesc(*surface, desc);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X getting %s surface desciption\n", (int)result, type);
- IDirectDrawSurface7_Release(*surface);
- *surface = NULL;
- return result;
- }
-
- // print out the good stuff
- osd_printf_verbose("DirectDraw: %s surface created: %dx%dx%d (R=%08X G=%08X B=%08X)\n",
- type,
- (int)desc->dwWidth,
- (int)desc->dwHeight,
- (int)desc->ddpfPixelFormat.dwRGBBitCount,
- (UINT32)desc->ddpfPixelFormat.dwRBitMask,
- (UINT32)desc->ddpfPixelFormat.dwGBitMask,
- (UINT32)desc->ddpfPixelFormat.dwBBitMask);
- return result;
-}
-
-
-
-//============================================================
-// create_clipper
-//============================================================
-
-int renderer_dd::create_clipper()
-{
- HRESULT result;
-
- // create a clipper for the primary surface
- result = IDirectDraw7_CreateClipper(ddraw, 0, &clipper, NULL);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X creating clipper\n", (int)result);
- return 1;
- }
-
- // set the clipper's hwnd
- result = IDirectDrawClipper_SetHWnd(clipper, 0, window().m_hwnd);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X setting clipper hwnd\n", (int)result);
- return 1;
- }
-
- // set the clipper on the primary surface
- result = IDirectDrawSurface7_SetClipper(primary, clipper);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X setting clipper on primary surface\n", (int)result);
- return 1;
- }
- return 0;
-}
-
-
-
-//============================================================
-// compute_blit_surface_size
-//============================================================
-
-void renderer_dd::compute_blit_surface_size()
-{
- INT32 newwidth, newheight;
- int xscale, yscale;
- RECT client;
-
- // start with the minimum size
- window().target()->compute_minimum_size(newwidth, newheight);
-
- // get the window's client rectangle
- GetClientRect(window().m_hwnd, &client);
-
- // hardware stretch case: apply prescale
- if (video_config.hwstretch)
- {
- int prescale = (window().prescale() < 1) ? 1 : window().prescale();
-
- // clamp the prescale to something smaller than the target bounds
- xscale = prescale;
- while (xscale > 1 && newwidth * xscale > rect_width(&client))
- xscale--;
- yscale = prescale;
- while (yscale > 1 && newheight * yscale > rect_height(&client))
- yscale--;
- }
-
- // non stretch case
- else
- {
- INT32 target_width = rect_width(&client);
- INT32 target_height = rect_height(&client);
- float desired_aspect = 1.0f;
-
- // compute the appropriate visible area if we're trying to keepaspect
- if (video_config.keepaspect)
- {
- osd_monitor_info *monitor = window().winwindow_video_window_monitor(NULL);
- window().target()->compute_visible_area(target_width, target_height, monitor->aspect(), window().target()->orientation(), target_width, target_height);
- desired_aspect = (float)target_width / (float)target_height;
- }
-
- // compute maximum integral scaling to fit the window
- xscale = (target_width + 2) / newwidth;
- yscale = (target_height + 2) / newheight;
-
- // try a little harder to keep the aspect ratio if desired
- if (video_config.keepaspect)
- {
- // if we could stretch more in the X direction, and that makes a better fit, bump the xscale
- while (newwidth * (xscale + 1) <= rect_width(&client) &&
- better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale + 1), newheight * yscale, desired_aspect))
- xscale++;
-
- // if we could stretch more in the Y direction, and that makes a better fit, bump the yscale
- while (newheight * (yscale + 1) <= rect_height(&client) &&
- better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale + 1), desired_aspect))
- yscale++;
-
- // now that we've maxed out, see if backing off the maximally stretched one makes a better fit
- if (rect_width(&client) - newwidth * xscale < rect_height(&client) - newheight * yscale)
- {
- while (xscale > 1 && better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale - 1), newheight * yscale, desired_aspect))
- xscale--;
- }
- else
- {
- while (yscale > 1 && better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale - 1), desired_aspect))
- yscale--;
- }
- }
- }
-
- // ensure at least a scale factor of 1
- if (xscale == 0) xscale = 1;
- if (yscale == 0) yscale = 1;
-
- // apply the final scale
- newwidth *= xscale;
- newheight *= yscale;
- if (newwidth != blitwidth || newheight != blitheight)
- {
- // force some updates
- update_outer_rects();
- osd_printf_verbose("DirectDraw: New blit size = %dx%d\n", newwidth, newheight);
- }
- blitwidth = newwidth;
- blitheight = newheight;
-}
-
-
-
-//============================================================
-// calc_fullscreen_margins
-//============================================================
-
-void renderer_dd::calc_fullscreen_margins(DWORD desc_width, DWORD desc_height, RECT *margins)
-{
- margins->left = 0;
- margins->top = 0;
- margins->right = desc_width;
- margins->bottom = desc_height;
-
- if (window().win_has_menu())
- {
- static int height_with_menubar = 0;
- if (height_with_menubar == 0)
- {
- RECT with_menu = { 100, 100, 200, 200 };
- RECT without_menu = { 100, 100, 200, 200 };
- AdjustWindowRect(&with_menu, WS_OVERLAPPED, TRUE);
- AdjustWindowRect(&without_menu, WS_OVERLAPPED, FALSE);
- height_with_menubar = (with_menu.bottom - with_menu.top) - (without_menu.bottom - without_menu.top);
- }
- margins->top = height_with_menubar;
- }
-}
-
-
-
-//============================================================
-// blit_to_primary
-//============================================================
-
-void renderer_dd::blit_to_primary(int srcwidth, int srcheight)
-{
- IDirectDrawSurface7 *target = (back != NULL) ? back : primary;
- osd_monitor_info *monitor = window().winwindow_video_window_monitor(NULL);
- DDBLTFX blitfx = { sizeof(DDBLTFX) };
- RECT clear, outer, dest, source;
- INT32 dstwidth, dstheight;
- HRESULT result;
-
- // compute source rect
- source.left = source.top = 0;
- source.right = srcwidth;
- source.bottom = srcheight;
-
- // compute outer rect -- windowed version
- if (!window().fullscreen())
- {
- GetClientRect(window().m_hwnd, &outer);
- ClientToScreen(window().m_hwnd, &((LPPOINT)&outer)[0]);
- ClientToScreen(window().m_hwnd, &((LPPOINT)&outer)[1]);
-
- // adjust to be relative to the monitor
- osd_rect pos = monitor->position_size();
- outer.left -= pos.left();
- outer.right -= pos.left();
- outer.top -= pos.top();
- outer.bottom -= pos.top();
- }
-
- // compute outer rect -- full screen version
- else
- {
- calc_fullscreen_margins(primarydesc.dwWidth, primarydesc.dwHeight, &outer);
- }
-
- // if we're respecting the aspect ratio, we need to adjust to fit
- dstwidth = rect_width(&outer);
- dstheight = rect_height(&outer);
- if (!video_config.hwstretch)
- {
- // trim the source if necessary
- if (rect_width(&outer) < srcwidth)
- {
- source.left += (srcwidth - rect_width(&outer)) / 2;
- source.right = source.left + rect_width(&outer);
- }
- if (rect_height(&outer) < srcheight)
- {
- source.top += (srcheight - rect_height(&outer)) / 2;
- source.bottom = source.top + rect_height(&outer);
- }
-
- // match the destination and source sizes
- dstwidth = srcwidth = source.right - source.left;
- dstheight = srcheight = source.bottom - source.top;
- }
- else if (video_config.keepaspect)
- {
- // compute the appropriate visible area
- window().target()->compute_visible_area(rect_width(&outer), rect_height(&outer), monitor->aspect(), window().target()->orientation(), dstwidth, dstheight);
- }
-
- // center within
- dest.left = outer.left + (rect_width(&outer) - dstwidth) / 2;
- dest.right = dest.left + dstwidth;
- dest.top = outer.top + (rect_height(&outer) - dstheight) / 2;
- dest.bottom = dest.top + dstheight;
-
- // compare against last destination; if different, force a redraw
- if (dest.left != lastdest.left || dest.right != lastdest.right || dest.top != lastdest.top || dest.bottom != lastdest.bottom)
- {
- lastdest = dest;
- update_outer_rects();
- }
-
- // clear outer rects if we need to
- if (clearouter != 0)
- {
- clearouter--;
-
- // clear the left edge
- if (dest.left > outer.left)
- {
- clear = outer;
- clear.right = dest.left;
- result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result);
- }
-
- // clear the right edge
- if (dest.right < outer.right)
- {
- clear = outer;
- clear.left = dest.right;
- result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result);
- }
-
- // clear the top edge
- if (dest.top > outer.top)
- {
- clear = outer;
- clear.bottom = dest.top;
- result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result);
- }
-
- // clear the bottom edge
- if (dest.bottom < outer.bottom)
- {
- clear = outer;
- clear.top = dest.bottom;
- result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result);
- }
- }
-
- // do the blit
- result = IDirectDrawSurface7_Blt(target, &dest, blit, &source, DDBLT_WAIT, NULL);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X blitting to the screen\n", (int)result);
-
- // page flip if triple buffered
- if (window().fullscreen() && back != NULL)
- {
- result = IDirectDrawSurface7_Flip(primary, NULL, DDFLIP_WAIT);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X waiting for VBLANK\n", (int)result);
- }
-}
-
-
-
-//============================================================
-// config_adapter_mode
-//============================================================
-
-int renderer_dd::config_adapter_mode()
-{
- DDDEVICEIDENTIFIER2 identifier;
- HRESULT result;
-
- // choose the monitor number
- get_adapter_for_monitor(window().monitor());
-
- // create a temporary DirectDraw object
- result = (*directdrawcreateex)(adapter_ptr, (LPVOID *)&ddraw, WRAP_REFIID(IID_IDirectDraw7), NULL);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X during DirectDrawCreateEx call\n", (int)result);
- return 1;
- }
-
- // get the identifier
- result = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0);
- if (result != DD_OK)
- {
- osd_printf_error("Error getting identifier for device\n");
- return 1;
- }
- osd_printf_verbose("DirectDraw: Configuring device %s\n", identifier.szDescription);
-
- // get the current display mode
- memset(&origmode, 0, sizeof(origmode));
- origmode.dwSize = sizeof(origmode);
- result = IDirectDraw7_GetDisplayMode(ddraw, &origmode);
- if (result != DD_OK)
- {
- osd_printf_verbose("DirectDraw: Error %08X getting current display mode\n", (int)result);
- IDirectDraw7_Release(ddraw);
- return 1;
- }
-
- // choose a resolution: full screen mode case
- if (window().fullscreen())
- {
- // default to the current mode exactly
- width = origmode.dwWidth;
- height = origmode.dwHeight;
- refresh = origmode.dwRefreshRate;
-
- // if we're allowed to switch resolutions, override with something better
- if (video_config.switchres)
- pick_best_mode();
- }
-
- // release the DirectDraw object
- IDirectDraw7_Release(ddraw);
- ddraw = NULL;
-
- // if we're not changing resolutions, make sure we have a resolution we can handle
- if (!window().fullscreen() || !video_config.switchres)
- {
- switch (origmode.ddpfPixelFormat.dwRBitMask)
- {
- case 0x00ff0000:
- case 0x000000ff:
- case 0xf800:
- case 0x7c00:
- break;
-
- default:
- osd_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)origmode.ddpfPixelFormat.dwRBitMask, (int)origmode.ddpfPixelFormat.dwGBitMask, (int)origmode.ddpfPixelFormat.dwBBitMask);
- return 1;
- }
- }
-
- return 0;
-}
-
-
-
-//============================================================
-// monitor_enum_callback
-//============================================================
-
-static BOOL WINAPI monitor_enum_callback(GUID FAR *guid, LPSTR description, LPSTR name, LPVOID context, HMONITOR hmonitor)
-{
- monitor_enum_info *einfo = (monitor_enum_info *)context;
-
- // do we match the desired monitor?
- if (hmonitor == *((HMONITOR *)einfo->monitor->oshandle()) || (hmonitor == NULL && einfo->monitor->is_primary()))
- {
- einfo->guid_ptr = (guid != NULL) ? &einfo->guid : NULL;
- if (guid != NULL)
- einfo->guid = *guid;
- einfo->foundit = TRUE;
- }
- return 1;
-}
-
-
-
-//============================================================
-// get_adapter_for_monitor
-//============================================================
-
-void renderer_dd::get_adapter_for_monitor(osd_monitor_info *monitor)
-{
- monitor_enum_info einfo;
- HRESULT result;
-
- // try to find our monitor
- memset(&einfo, 0, sizeof(einfo));
- einfo.monitor = monitor;
- result = (*directdrawenumerateex)(monitor_enum_callback, &einfo, DDENUM_ATTACHEDSECONDARYDEVICES);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X during DirectDrawEnumerateEx call\n", (int)result);
-
- // set up the adapter
- if (einfo.foundit && einfo.guid_ptr != NULL)
- {
- adapter = einfo.guid;
- adapter_ptr = &adapter;
- }
- else
- adapter_ptr = NULL;
-}
-
-
-
-//============================================================
-// enum_modes_callback
-//============================================================
-
-static HRESULT WINAPI enum_modes_callback(LPDDSURFACEDESC2 desc, LPVOID context)
-{
- float size_score, refresh_score, final_score;
- mode_enum_info *einfo = (mode_enum_info *)context;
- renderer_dd *dd = einfo->renderer;
-
- // skip non-32 bit modes
- if (desc->ddpfPixelFormat.dwRGBBitCount != 32)
- return DDENUMRET_OK;
-
- // compute initial score based on difference between target and current
- size_score = 1.0f / (1.0f + fabs((float)((INT32)desc->dwWidth - einfo->target_width)) + fabs((float)((INT32)desc->dwHeight - einfo->target_height)));
-
- // if the mode is too small, give a big penalty
- if (desc->dwWidth < einfo->minimum_width || desc->dwHeight < einfo->minimum_height)
- size_score *= 0.01f;
-
- // if mode is smaller than we'd like, it only scores up to 0.1
- if (desc->dwWidth < einfo->target_width || desc->dwHeight < einfo->target_height)
- size_score *= 0.1f;
-
- // if we're looking for a particular mode, that's a winner
- if (desc->dwWidth == einfo->window->m_win_config.width && desc->dwHeight == einfo->window->m_win_config.height)
- size_score = 2.0f;
-
- // compute refresh score
- refresh_score = 1.0f / (1.0f + fabs((double)desc->dwRefreshRate - einfo->target_refresh));
-
- // if refresh is smaller than we'd like, it only scores up to 0.1
- if ((double)desc->dwRefreshRate < einfo->target_refresh)
- refresh_score *= 0.1f;
-
- // if we're looking for a particular refresh, make sure it matches
- if (desc->dwRefreshRate == einfo->window->m_win_config.refresh)
- refresh_score = 2.0f;
-
- // weight size and refresh equally
- final_score = size_score + refresh_score;
-
- // best so far?
- osd_printf_verbose(" %4dx%4d@%3dHz -> %f\n", (int)desc->dwWidth, (int)desc->dwHeight, (int)desc->dwRefreshRate, final_score * 1000.0f);
- if (final_score > einfo->best_score)
- {
- einfo->best_score = final_score;
- dd->width = desc->dwWidth;
- dd->height = desc->dwHeight;
- dd->refresh = desc->dwRefreshRate;
- }
- return DDENUMRET_OK;
-}
-
-
-
-//============================================================
-// pick_best_mode
-//============================================================
-
-void renderer_dd::pick_best_mode()
-{
- mode_enum_info einfo;
- HRESULT result;
-
- // determine the minimum width/height for the selected target
- // note: technically we should not be calling this from an alternate window
- // thread; however, it is only done during init time, and the init code on
- // the main thread is waiting for us to finish, so it is safe to do so here
- window().target()->compute_minimum_size(einfo.minimum_width, einfo.minimum_height);
-
- // use those as the target for now
- einfo.target_width = einfo.minimum_width * MAX(1, window().prescale());
- einfo.target_height = einfo.minimum_height * MAX(1, window().prescale());
-
- // determine the refresh rate of the primary screen
- einfo.target_refresh = 60.0;
- const screen_device *primary_screen = window().machine().config().first_screen();
- if (primary_screen != NULL)
- einfo.target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh_attoseconds());
- printf("Target refresh = %f\n", einfo.target_refresh);
-
- // if we're not stretching, allow some slop on the minimum since we can handle it
- if (!video_config.hwstretch)
- {
- einfo.minimum_width -= 4;
- einfo.minimum_height -= 4;
- }
-
- // if we are stretching, aim for a mode approximately 2x the game's resolution
- else if (window().prescale() <= 1)
- {
- einfo.target_width *= 2;
- einfo.target_height *= 2;
- }
-
- // fill in the rest of the data
- einfo.window = &window();
- einfo.renderer = this;
- einfo.best_score = 0.0f;
-
- // enumerate the modes
- osd_printf_verbose("DirectDraw: Selecting video mode...\n");
- result = IDirectDraw7_EnumDisplayModes(ddraw, DDEDM_REFRESHRATES, NULL, &einfo, enum_modes_callback);
- if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X during EnumDisplayModes call\n", (int)result);
- osd_printf_verbose("DirectDraw: Mode selected = %4dx%4d@%3dHz\n", width, height, refresh);
-}
diff --git a/src/osd/modules/render/drawgdi.cpp b/src/osd/modules/render/drawgdi.cpp
index 11e61a28407..354d6950e30 100644
--- a/src/osd/modules/render/drawgdi.cpp
+++ b/src/osd/modules/render/drawgdi.cpp
@@ -6,125 +6,41 @@
//
//============================================================
-// standard windows headers
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-// MAME headers
-#include "emu.h"
+#include "drawgdi.h"
#include "rendersw.inc"
-// MAMEOS headers
-#include "window.h"
-
-
-//============================================================
-// TYPE DEFINITIONS
-//============================================================
-
-class renderer_gdi : public osd_renderer
-{
-public:
- renderer_gdi(osd_window *window)
- : osd_renderer(window, FLAG_NONE), bmdata(NULL), bmsize(0) { }
-
- virtual ~renderer_gdi() { }
-
- virtual int create() override;
- virtual render_primitive_list *get_primitives() override;
- virtual int draw(const int update) override;
- virtual void save() override {};
- virtual void record() override {};
- virtual void toggle_fsfx() override {};
- virtual void destroy() override;
-
-private:
- /* gdi_info is the information for the current screen */
- BITMAPINFO bminfo;
- UINT8 * bmdata;
- size_t bmsize;
-};
-
-
-//============================================================
-// PROTOTYPES
-//============================================================
-
-// core functions
-static void drawgdi_exit(void);
-
-//============================================================
-// drawnone_create
-//============================================================
-
-static osd_renderer *drawgdi_create(osd_window *window)
-{
- return global_alloc(renderer_gdi(window));
-}
-
-
-//============================================================
-// drawgdi_init
-//============================================================
-
-int drawgdi_init(running_machine &machine, osd_draw_callbacks *callbacks)
-{
- // fill in the callbacks
- memset(callbacks, 0, sizeof(*callbacks));
- callbacks->exit = drawgdi_exit;
- callbacks->create = drawgdi_create;
- return 0;
-}
-
-
-
//============================================================
-// drawgdi_exit
+// destructor
//============================================================
-static void drawgdi_exit(void)
+renderer_gdi::~renderer_gdi()
{
+ // free the bitmap memory
+ if (m_bmdata != nullptr)
+ global_free_array(m_bmdata);
}
-
-
//============================================================
-// drawgdi_window_init
+// renderer_gdi::create
//============================================================
int renderer_gdi::create()
{
// fill in the bitmap info header
- bminfo.bmiHeader.biSize = sizeof(bminfo.bmiHeader);
- bminfo.bmiHeader.biPlanes = 1;
- bminfo.bmiHeader.biBitCount = 32;
- bminfo.bmiHeader.biCompression = BI_RGB;
- bminfo.bmiHeader.biSizeImage = 0;
- bminfo.bmiHeader.biXPelsPerMeter = 0;
- bminfo.bmiHeader.biYPelsPerMeter = 0;
- bminfo.bmiHeader.biClrUsed = 0;
- bminfo.bmiHeader.biClrImportant = 0;
-
+ m_bminfo.bmiHeader.biSize = sizeof(m_bminfo.bmiHeader);
+ m_bminfo.bmiHeader.biPlanes = 1;
+ m_bminfo.bmiHeader.biBitCount = 32;
+ m_bminfo.bmiHeader.biCompression = BI_RGB;
+ m_bminfo.bmiHeader.biSizeImage = 0;
+ m_bminfo.bmiHeader.biXPelsPerMeter = 0;
+ m_bminfo.bmiHeader.biYPelsPerMeter = 0;
+ m_bminfo.bmiHeader.biClrUsed = 0;
+ m_bminfo.bmiHeader.biClrImportant = 0;
return 0;
}
-
-
-//============================================================
-// drawgdi_window_destroy
-//============================================================
-
-void renderer_gdi::destroy()
-{
- // free the bitmap memory
- if (bmdata != NULL)
- global_free_array(bmdata);
-}
-
-
-
//============================================================
-// drawgdi_window_get_primitives
+// renderer_gdi::get_primitives
//============================================================
render_primitive_list *renderer_gdi::get_primitives()
@@ -135,49 +51,45 @@ render_primitive_list *renderer_gdi::get_primitives()
return &window().target()->get_primitives();
}
-
-
//============================================================
-// drawgdi_window_draw
+// renderer_gdi::draw
//============================================================
int renderer_gdi::draw(const int update)
{
- int width, height, pitch;
- RECT bounds;
-
// we don't have any special resize behaviors
if (window().m_resize_state == RESIZE_STATE_PENDING)
window().m_resize_state = RESIZE_STATE_NORMAL;
// get the target bounds
+ RECT bounds;
GetClientRect(window().m_hwnd, &bounds);
// compute width/height/pitch of target
- width = rect_width(&bounds);
- height = rect_height(&bounds);
- pitch = (width + 3) & ~3;
+ int width = rect_width(&bounds);
+ int height = rect_height(&bounds);
+ int pitch = (width + 3) & ~3;
// make sure our temporary bitmap is big enough
- if (pitch * height * 4 > bmsize)
+ if (pitch * height * 4 > m_bmsize)
{
- bmsize = pitch * height * 4 * 2;
- global_free_array(bmdata);
- bmdata = global_alloc_array(UINT8, bmsize);
+ m_bmsize = pitch * height * 4 * 2;
+ global_free_array(m_bmdata);
+ m_bmdata = global_alloc_array(UINT8, m_bmsize);
}
// draw the primitives to the bitmap
window().m_primlist->acquire_lock();
- software_renderer<UINT32, 0,0,0, 16,8,0>::draw_primitives(*window().m_primlist, bmdata, width, height, pitch);
+ software_renderer<UINT32, 0,0,0, 16,8,0>::draw_primitives(*window().m_primlist, m_bmdata, width, height, pitch);
window().m_primlist->release_lock();
// fill in bitmap-specific info
- bminfo.bmiHeader.biWidth = pitch;
- bminfo.bmiHeader.biHeight = -height;
+ m_bminfo.bmiHeader.biWidth = pitch;
+ m_bminfo.bmiHeader.biHeight = -height;
// blit to the screen
StretchDIBits(window().m_dc, 0, 0, width, height,
0, 0, width, height,
- bmdata, &bminfo, DIB_RGB_COLORS, SRCCOPY);
+ m_bmdata, &m_bminfo, DIB_RGB_COLORS, SRCCOPY);
return 0;
}
diff --git a/src/osd/modules/render/drawgdi.h b/src/osd/modules/render/drawgdi.h
new file mode 100644
index 00000000000..af52eac1e77
--- /dev/null
+++ b/src/osd/modules/render/drawgdi.h
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+//============================================================
+//
+// drawgdi.h - Win32 GDI drawing
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWGDI__
+#define __DRAWGDI__
+
+// standard windows headers
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+// MAME headers
+#include "emu.h"
+
+// MAMEOS headers
+#include "window.h"
+
+
+//============================================================
+// TYPE DEFINITIONS
+//============================================================
+
+class renderer_gdi : public osd_renderer
+{
+public:
+ renderer_gdi(osd_window *window)
+ : osd_renderer(window, FLAG_NONE)
+ , m_bmdata(nullptr)
+ , m_bmsize(0)
+ {
+ }
+ virtual ~renderer_gdi();
+
+ virtual int create() override;
+ static bool init(running_machine &machine) { return false; }
+ virtual render_primitive_list *get_primitives() override;
+ virtual int draw(const int update) override;
+ virtual void save() override {};
+ virtual void record() override {};
+ virtual void toggle_fsfx() override {};
+
+private:
+ /* gdi_info is the information for the current screen */
+ BITMAPINFO m_bminfo;
+ UINT8 * m_bmdata;
+ size_t m_bmsize;
+};
+
+#endif // __DRAWGDI__ \ No newline at end of file
diff --git a/src/osd/modules/render/drawnone.cpp b/src/osd/modules/render/drawnone.cpp
index 9f45683e6da..5e1b4aa05dd 100644
--- a/src/osd/modules/render/drawnone.cpp
+++ b/src/osd/modules/render/drawnone.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles
//============================================================
//
-// drawnone.c - stub "nothing" drawer
+// drawnone.cpp - stub "nothing" drawer
//
//============================================================
@@ -13,88 +13,7 @@
// MAME headers
#include "emu.h"
-// MAMEOS headers
-#include "window.h"
-
-
-class renderer_none : public osd_renderer
-{
-public:
- renderer_none(osd_window *window)
- : osd_renderer(window, FLAG_NONE) { }
-
- virtual ~renderer_none() { }
-
- virtual int create() override;
- virtual render_primitive_list *get_primitives() override;
- virtual int draw(const int update) override;
- virtual void save() override { };
- virtual void record() override { };
- virtual void toggle_fsfx() override { };
- virtual void destroy() override;
-};
-
-//============================================================
-// PROTOTYPES
-//============================================================
-
-// core functions
-static void drawnone_exit(void);
-
-//============================================================
-// drawnone_create
-//============================================================
-
-osd_renderer *drawnone_create(osd_window *window)
-{
- return global_alloc(renderer_none(window));
-}
-
-//============================================================
-// drawnone_init
-//============================================================
-
-int drawnone_init(running_machine &machine, osd_draw_callbacks *callbacks)
-{
- // fill in the callbacks
- memset(callbacks, 0, sizeof(*callbacks));
- callbacks->exit = drawnone_exit;
- callbacks->create = drawnone_create;
- return 0;
-}
-
-
-
-//============================================================
-// drawnone_exit
-//============================================================
-
-static void drawnone_exit(void)
-{
-}
-
-
-
-//============================================================
-// drawnone_window_init
-//============================================================
-
-int renderer_none::create()
-{
- return 0;
-}
-
-
-
-//============================================================
-// drawnone_window_destroy
-//============================================================
-
-void renderer_none::destroy()
-{
-}
-
-
+#include "drawnone.h"
//============================================================
// drawnone_window_get_primitives
@@ -107,14 +26,3 @@ render_primitive_list *renderer_none::get_primitives()
window().target()->set_bounds(rect_width(&client), rect_height(&client), window().aspect());
return &window().target()->get_primitives();
}
-
-
-
-//============================================================
-// drawnone_window_draw
-//============================================================
-
-int renderer_none::draw(const int update)
-{
- return 0;
-}
diff --git a/src/osd/modules/render/drawnone.h b/src/osd/modules/render/drawnone.h
new file mode 100644
index 00000000000..e6f49aa1727
--- /dev/null
+++ b/src/osd/modules/render/drawnone.h
@@ -0,0 +1,34 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+//============================================================
+//
+// drawnone.h - stub "nothing" drawer
+//
+//============================================================
+
+// MAMEOS headers
+#include "window.h"
+
+#pragma once
+
+#ifndef __DRAWNONE__
+#define __DRAWNONE__
+
+class renderer_none : public osd_renderer
+{
+public:
+ renderer_none(osd_window *window)
+ : osd_renderer(window, FLAG_NONE) { }
+
+ virtual ~renderer_none() { }
+
+ virtual int create() override { return 0; }
+ static bool init(running_machine &machine) { return false; }
+ virtual render_primitive_list *get_primitives() override;
+ virtual int draw(const int update) override { return 0; }
+ virtual void save() override { }
+ virtual void record() override { }
+ virtual void toggle_fsfx() override { }
+};
+
+#endif // __DRAWNONE__ \ No newline at end of file
diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp
index 4a2744e4068..e90d74a40e6 100644
--- a/src/osd/modules/render/drawogl.cpp
+++ b/src/osd/modules/render/drawogl.cpp
@@ -30,10 +30,6 @@
#include "modules/lib/osdlib.h"
#include "modules/lib/osdobj_common.h"
-#if defined(OSD_WINDOWS) && !defined(SDLMAME_SDL2)
-#define SDLMAME_SDL2 0
-#endif
-
// OpenGL headers
#include "modules/opengl/osd_opengl.h"
@@ -123,17 +119,7 @@ typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuin
#define GL_DEPTH_COMPONENT32 0x81A7
#endif
-#define HASH_SIZE ((1<<10)+1)
-#define OVERFLOW_SIZE (1<<10)
-
-// OSD headers
-#ifndef OSD_WINDOWS
-#include "osdsdl.h"
-#include "window.h"
-#else
-#include "../windows/window.h"
-typedef UINT64 HashT;
-#endif
+#include "drawogl.h"
//============================================================
// DEBUGGING
@@ -183,450 +169,6 @@ enum
#define FSWAP(var1, var2) do { float temp = var1; var1 = var2; var2 = temp; } while (0)
#define GL_NO_PRIMITIVE -1
-//============================================================
-// TYPES
-//============================================================
-
-#if defined(OSD_WINDOWS)
-
-class win_gl_context : public osd_gl_context
-{
-public:
- win_gl_context(HWND window) : osd_gl_context(), m_context(0), m_window(NULL), m_hdc(0)
- {
- m_error[0] = 0;
-
- this->pfn_wglGetProcAddress = (PROC (WINAPI *)(LPCSTR lpszProc)) GetProcAddress(m_module, "wglGetProcAddress");
- this->pfn_wglCreateContext = (HGLRC (WINAPI *)(HDC hdc)) GetProcAddress(m_module, "wglCreateContext");
- this->pfn_wglDeleteContext = (BOOL (WINAPI *)(HGLRC hglrc)) GetProcAddress(m_module, "wglDeleteContext");
- this->pfn_wglMakeCurrent = (BOOL (WINAPI *)(HDC hdc, HGLRC hglrc)) GetProcAddress(m_module, "wglMakeCurrent");
-
- this->pfn_wglGetExtensionsStringEXT = (const char *(WINAPI *) (void)) pfn_wglGetProcAddress("wglGetExtensionsStringEXT");
-
- if (WGLExtensionSupported("WGL_EXT_swap_control"))
- {
- this->pfn_wglSwapIntervalEXT = (BOOL (WINAPI *) (int)) getProcAddress("wglSwapIntervalEXT");
- this->pfn_wglGetSwapIntervalEXT = (int (WINAPI *) (void)) getProcAddress("wglGetSwapIntervalEXT");
- }
- else
- {
- pfn_wglSwapIntervalEXT = NULL;
- pfn_wglGetSwapIntervalEXT = NULL;
- }
-
- m_hdc = GetDC(window);
- if (!setupPixelFormat(m_hdc))
- {
- m_context = this->pfn_wglCreateContext(m_hdc);
- if (!m_context)
- {
- FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), 0, m_error, 255, NULL);
- return;
- }
- this->pfn_wglMakeCurrent(m_hdc, m_context);
- }
- }
-
- virtual ~win_gl_context()
- {
- this->pfn_wglDeleteContext(m_context);
- ReleaseDC(m_window, m_hdc);
- }
-
- virtual void MakeCurrent() override
- {
- this->pfn_wglMakeCurrent(m_hdc, m_context);
- }
-
- virtual const char *LastErrorMsg() override
- {
- if (m_error[0] == 0)
- return NULL;
- else
- return m_error;
- }
-
- virtual void *getProcAddress(const char *proc) override
- {
- void *ret = (void *) GetProcAddress(m_module, proc);
- if (ret == NULL)
- ret = (void *) this->pfn_wglGetProcAddress(proc);
- return ret;
- }
-
- virtual int SetSwapInterval(const int swap) override
- {
- if (this->pfn_wglSwapIntervalEXT != NULL)
- {
- this->pfn_wglSwapIntervalEXT(swap ? 1 : 0);
- }
- return 0;
- }
-
- virtual void SwapBuffer() override
- {
- SwapBuffers(m_hdc);
- //wglSwapLayerBuffers(GetDC(window().m_hwnd), WGL_SWAP_MAIN_PLANE);
- }
-
- static void load_library()
- {
- m_module = LoadLibraryA("opengl32.dll");
- }
-
-private:
-
- int setupPixelFormat(HDC hDC)
- {
- PIXELFORMATDESCRIPTOR pfd = {
- sizeof(PIXELFORMATDESCRIPTOR), /* size */
- 1, /* version */
- PFD_SUPPORT_OPENGL |
- PFD_DRAW_TO_WINDOW |
- PFD_DOUBLEBUFFER, /* support double-buffering */
- PFD_TYPE_RGBA, /* color type */
- 32, /* prefered color depth */
- 0, 0, 0, 0, 0, 0, /* color bits (ignored) */
- 0, /* no alpha buffer */
- 0, /* alpha bits (ignored) */
- 0, /* no accumulation buffer */
- 0, 0, 0, 0, /* accum bits (ignored) */
- 16, /* depth buffer */
- 0, /* no stencil buffer */
- 0, /* no auxiliary buffers */
- PFD_MAIN_PLANE, /* main layer */
- 0, /* reserved */
- 0, 0, 0, /* no layer, visible, damage masks */
- };
- int pixelFormat;
-
- pixelFormat = ChoosePixelFormat(hDC, &pfd);
- if (pixelFormat == 0) {
- strcpy(m_error, "ChoosePixelFormat failed");
- return 1;
- }
-
- if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) {
- strcpy(m_error, "SetPixelFormat failed.");
- return 1;
- }
- return 0;
- }
-
- bool WGLExtensionSupported(const char *extension_name)
- {
- //if (pfn_wglGetExtensionsStringEXT != NULL)
- // printf("%s\n", this->pfn_wglGetExtensionsStringEXT());
-
- if (pfn_wglGetExtensionsStringEXT != NULL && strstr(pfn_wglGetExtensionsStringEXT(), extension_name) != NULL)
- return true;
- else
- return false;
- }
-
- HGLRC m_context;
- HWND m_window;
- HDC m_hdc;
- char m_error[256];
-
- PROC (WINAPI *pfn_wglGetProcAddress)(LPCSTR lpszProc);
- HGLRC (WINAPI *pfn_wglCreateContext)(HDC hdc);
- BOOL (WINAPI *pfn_wglDeleteContext)(HGLRC hglrc);
- BOOL (WINAPI *pfn_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
-
- const char *(WINAPI *pfn_wglGetExtensionsStringEXT) (void);
- BOOL (WINAPI *pfn_wglSwapIntervalEXT) (int interval);
- int (WINAPI * pfn_wglGetSwapIntervalEXT) (void);
-
- static HMODULE m_module;
-};
-
-HMODULE win_gl_context::m_module;
-
-
-#elif SDLMAME_SDL2
-
-class sdl_gl_context : public osd_gl_context
-{
-public:
- sdl_gl_context(SDL_Window *window) : osd_gl_context(), m_context(0), m_window(window)
- {
- m_error[0] = 0;
- m_context = SDL_GL_CreateContext(window);
- if (!m_context)
- {
- snprintf(m_error,255, "OpenGL not supported on this driver: %s", SDL_GetError());
- }
- }
- virtual ~sdl_gl_context()
- {
- SDL_GL_DeleteContext(m_context);
- }
- virtual void MakeCurrent() override
- {
- SDL_GL_MakeCurrent(m_window, m_context);
- }
-
- virtual int SetSwapInterval(const int swap) override
- {
- return SDL_GL_SetSwapInterval(swap);
- }
-
- virtual const char *LastErrorMsg() override
- {
- if (m_error[0] == 0)
- return NULL;
- else
- return m_error;
- }
- virtual void *getProcAddress(const char *proc) override
- {
- return SDL_GL_GetProcAddress(proc);
- }
-
- virtual void SwapBuffer() override
- {
- SDL_GL_SwapWindow(m_window);
- }
-
-private:
- SDL_GLContext m_context;
- SDL_Window *m_window;
- char m_error[256];
-};
-
-#else
-// SDL 1.2
-class sdl12_gl_context : public osd_gl_context
-{
-public:
- sdl12_gl_context(SDL_Surface *window) : osd_gl_context(), m_window(window)
- {
- m_error[0] = 0;
- }
- virtual ~sdl12_gl_context()
- {
- }
- virtual void MakeCurrent()
- {
- }
-
- virtual int SetSwapInterval(const int swap)
- {
- // Not supported on 1.2
- return 0;
- }
-
- virtual const char *LastErrorMsg()
- {
- if (m_error[0] == 0)
- return NULL;
- else
- return m_error;
- }
-
- virtual void *getProcAddress(const char *proc)
- {
- return SDL_GL_GetProcAddress(proc);
- }
-
- virtual void SwapBuffer()
- {
- SDL_GL_SwapBuffers();
- }
-
-private:
- SDL_Surface *m_window;
- char m_error[256];
-};
-
-#endif
-
-//============================================================
-// Textures
-//============================================================
-
-/* ogl_texture_info holds information about a texture */
-class ogl_texture_info
-{
-public:
- ogl_texture_info()
- : hash(0), flags(0), rawwidth(0), rawheight(0),
- rawwidth_create(0), rawheight_create(0),
- type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0),
- texture(0), texTarget(0), texpow2(0), mpass_dest_idx(0), pbo(0), data(NULL),
- data_own(0), texCoordBufferName(0)
- {
- for (int i=0; i<2; i++)
- {
- mpass_textureunit[i] = 0;
- mpass_texture_mamebm[i] = 0;
- mpass_fbo_mamebm[i] = 0;
- mpass_texture_scrn[i] = 0;
- mpass_fbo_scrn[i] = 0;
- }
- for (int i=0; i<8; i++)
- texCoord[i] = 0.0f;
- }
-
- HashT hash; // hash value for the texture (must be >= pointer size)
- UINT32 flags; // rendering flags
- render_texinfo texinfo; // copy of the texture info
- int rawwidth, rawheight; // raw width/height of the texture
- int rawwidth_create; // raw width/height, pow2 compatible, if needed
- int rawheight_create; // (create and initial set the texture, not for copy!)
- int type; // what type of texture are we?
- int format; // texture format
- int borderpix; // do we have a 1 pixel border?
- int xprescale; // what is our X prescale factor?
- int yprescale; // what is our Y prescale factor?
- int nocopy; // must the texture date be copied?
-
- UINT32 texture; // OpenGL texture "name"/ID
-
- GLenum texTarget; // OpenGL texture target
- int texpow2; // Is this texture pow2
-
- UINT32 mpass_dest_idx; // Multipass dest idx [0..1]
- UINT32 mpass_textureunit[2]; // texture unit names for GLSL
-
- UINT32 mpass_texture_mamebm[2];// Multipass OpenGL texture "name"/ID for the shader
- UINT32 mpass_fbo_mamebm[2]; // framebuffer object for this texture, multipass
- UINT32 mpass_texture_scrn[2]; // Multipass OpenGL texture "name"/ID for the shader
- UINT32 mpass_fbo_scrn[2]; // framebuffer object for this texture, multipass
-
- UINT32 pbo; // pixel buffer object for this texture (DYNAMIC only!)
- UINT32 *data; // pixels for the texture
- int data_own; // do we own / allocated it ?
- GLfloat texCoord[8];
- GLuint texCoordBufferName;
-
-};
-
-/* sdl_info is the information about SDL for the current screen */
-class sdl_info_ogl : public osd_renderer
-{
-public:
- sdl_info_ogl(osd_window *window)
- : osd_renderer(window, FLAG_NEEDS_OPENGL), m_blittimer(0),
- m_width(0), m_height(0),
- m_blit_dim(0, 0),
- m_gl_context(NULL),
- m_initialized(0),
- m_last_blendmode(0),
- m_texture_max_width(0),
- m_texture_max_height(0),
- m_texpoweroftwo(0),
- m_usevbo(0), m_usepbo(0), m_usefbo(0), m_useglsl(0), m_glsl(NULL),
- m_glsl_program_num(0),
- m_glsl_program_mb2sc(0),
- m_usetexturerect(0),
- m_init_context(0),
- m_last_hofs(0.0f),
- m_last_vofs(0.0f),
- m_surf_w(0),
- m_surf_h(0)
- {
- for (int i=0; i < HASH_SIZE + OVERFLOW_SIZE; i++)
- m_texhash[i] = NULL;
- for (int i=0; i < 2*GLSL_SHADER_MAX; i++)
- m_glsl_program[i] = 0;
- for (int i=0; i < 8; i++)
- m_texVerticex[i] = 0.0f;
- }
-
- virtual int create() override;
- virtual int draw(const int update) override;
-
-#ifndef OSD_WINDOWS
- virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
-#endif
- virtual void destroy() override;
- virtual render_primitive_list *get_primitives() override
- {
-#ifdef OSD_WINDOWS
- osd_dim nd = window().get_size();
-#else
- osd_dim nd = window().blit_surface_size();
-#endif
- if (nd != m_blit_dim)
- {
- m_blit_dim = nd;
- notify_changed();
- }
- window().target()->set_bounds(m_blit_dim.width(), m_blit_dim.height(), window().aspect());
- return &window().target()->get_primitives();
- }
-
-#ifdef OSD_WINDOWS
- virtual void save() override { }
- virtual void record() override { }
- virtual void toggle_fsfx() override { }
-#endif
-
-private:
- void destroy_all_textures();
-
- void loadGLExtensions();
- void initialize_gl();
- void set_blendmode(int blendmode);
- void texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
- void texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
- UINT32 width, UINT32 height,
- int* p_width, int* p_height, int* p_width_create, int* p_height_create);
- void texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
- ogl_texture_info *texture_create(const render_texinfo *texsource, UINT32 flags);
- int texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
- ogl_texture_info *texture_find(const render_primitive *prim);
- void texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx);
- void texture_mpass_flip(ogl_texture_info *texture, int shaderIdx);
- void texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx);
- ogl_texture_info * texture_update(const render_primitive *prim, int shaderIdx);
- void texture_disable(ogl_texture_info * texture);
- void texture_all_disable();
-
- INT32 m_blittimer;
- int m_width;
- int m_height;
- osd_dim m_blit_dim;
-
- osd_gl_context *m_gl_context;
-
- int m_initialized; // is everything well initialized, i.e. all GL stuff etc.
- // 3D info (GL mode only)
- ogl_texture_info * m_texhash[HASH_SIZE + OVERFLOW_SIZE];
- int m_last_blendmode; // previous blendmode
- INT32 m_texture_max_width; // texture maximum width
- INT32 m_texture_max_height; // texture maximum height
- int m_texpoweroftwo; // must textures be power-of-2 sized?
- int m_usevbo; // runtime check if VBO is available
- int m_usepbo; // runtime check if PBO is available
- int m_usefbo; // runtime check if FBO is available
- int m_useglsl; // runtime check if GLSL is available
-
- glsl_shader_info *m_glsl; // glsl_shader_info
-
- GLhandleARB m_glsl_program[2*GLSL_SHADER_MAX]; // GLSL programs, or 0
- int m_glsl_program_num; // number of GLSL programs
- int m_glsl_program_mb2sc; // GLSL program idx, which transforms
- // the mame-bitmap. screen-bitmap (size/rotation/..)
- // All progs <= glsl_program_mb2sc using the mame bitmap
- // as input, otherwise the screen bitmap.
- // All progs >= glsl_program_mb2sc using the screen bitmap
- // as output, otherwise the mame bitmap.
- int m_usetexturerect; // use ARB_texture_rectangle for non-power-of-2, general use
-
- int m_init_context; // initialize context before next draw
-
- float m_last_hofs;
- float m_last_vofs;
-
- // Static vars from draogl_window_dra
- INT32 m_surf_w;
- INT32 m_surf_h;
- GLfloat m_texVerticex[8];
-};
-
/* line_aa_step is used for drawing antialiased lines */
struct line_aa_step
{
@@ -655,14 +197,14 @@ static const line_aa_step line_aa_4step[] =
// INLINES
//============================================================
-static inline HashT texture_compute_hash(const render_texinfo *texture, UINT32 flags)
+HashT renderer_ogl::texture_compute_hash(const render_texinfo *texture, UINT32 flags)
{
HashT h = (HashT)texture->base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK));
//printf("hash %d\n", (int) h % HASH_SIZE);
return (h >> 8) % HASH_SIZE;
}
-void sdl_info_ogl::set_blendmode(int blendmode)
+void renderer_ogl::set_blendmode(int blendmode)
{
// try to minimize texture state changes
if (blendmode != m_last_blendmode)
@@ -691,45 +233,34 @@ void sdl_info_ogl::set_blendmode(int blendmode)
}
//============================================================
-// PROTOTYPES
-//============================================================
-
-// core functions
-
-//============================================================
// STATIC VARIABLES
//============================================================
-static void drawogl_exit(void);
-static void load_gl_lib(running_machine &machine);
-
-
-
// OGL 1.3
#ifdef GL_ARB_multitexture
-static PFNGLACTIVETEXTUREARBPROC pfn_glActiveTexture = NULL;
+static PFNGLACTIVETEXTUREARBPROC pfn_glActiveTexture = nullptr;
#else
-static PFNGLACTIVETEXTUREPROC pfn_glActiveTexture = NULL;
+static PFNGLACTIVETEXTUREPROC pfn_glActiveTexture = nullptr;
#endif
// VBO
-static PFNGLGENBUFFERSPROC pfn_glGenBuffers = NULL;
-static PFNGLDELETEBUFFERSPROC pfn_glDeleteBuffers = NULL;
-static PFNGLBINDBUFFERPROC pfn_glBindBuffer = NULL;
-static PFNGLBUFFERDATAPROC pfn_glBufferData = NULL;
-static PFNGLBUFFERSUBDATAPROC pfn_glBufferSubData = NULL;
+static PFNGLGENBUFFERSPROC pfn_glGenBuffers = nullptr;
+static PFNGLDELETEBUFFERSPROC pfn_glDeleteBuffers = nullptr;
+static PFNGLBINDBUFFERPROC pfn_glBindBuffer = nullptr;
+static PFNGLBUFFERDATAPROC pfn_glBufferData = nullptr;
+static PFNGLBUFFERSUBDATAPROC pfn_glBufferSubData = nullptr;
// PBO
-static PFNGLMAPBUFFERPROC pfn_glMapBuffer = NULL;
-static PFNGLUNMAPBUFFERPROC pfn_glUnmapBuffer = NULL;
+static PFNGLMAPBUFFERPROC pfn_glMapBuffer = nullptr;
+static PFNGLUNMAPBUFFERPROC pfn_glUnmapBuffer = nullptr;
// FBO
-static PFNGLISFRAMEBUFFEREXTPROC pfn_glIsFramebuffer = NULL;
-static PFNGLBINDFRAMEBUFFEREXTPROC pfn_glBindFramebuffer = NULL;
-static PFNGLDELETEFRAMEBUFFERSEXTPROC pfn_glDeleteFramebuffers = NULL;
-static PFNGLGENFRAMEBUFFERSEXTPROC pfn_glGenFramebuffers = NULL;
-static PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pfn_glCheckFramebufferStatus = NULL;
-static PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pfn_glFramebufferTexture2D = NULL;
+static PFNGLISFRAMEBUFFEREXTPROC pfn_glIsFramebuffer = nullptr;
+static PFNGLBINDFRAMEBUFFEREXTPROC pfn_glBindFramebuffer = nullptr;
+static PFNGLDELETEFRAMEBUFFERSEXTPROC pfn_glDeleteFramebuffers = nullptr;
+static PFNGLGENFRAMEBUFFERSEXTPROC pfn_glGenFramebuffers = nullptr;
+static PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pfn_glCheckFramebufferStatus = nullptr;
+static PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pfn_glFramebufferTexture2D = nullptr;
static int glsl_shader_feature = GLSL_SHADER_FEAT_PLAIN;
@@ -743,36 +274,51 @@ static void texture_set_data(ogl_texture_info *texture, const render_texinfo *te
// Static Variables
//============================================================
-static int shown_video_info = 0;
-static int dll_loaded = 0;
+bool renderer_ogl::s_shown_video_info = false;
+bool renderer_ogl::s_dll_loaded = false;
-//============================================================
-// drawsdl_init
-//============================================================
-
-static osd_renderer *drawogl_create(osd_window *window)
-{
- return global_alloc(sdl_info_ogl(window));
-}
-
-int drawogl_init(running_machine &machine, osd_draw_callbacks *callbacks)
+bool renderer_ogl::init(running_machine &machine)
{
- // fill in the callbacks
- callbacks->exit = drawogl_exit;
- callbacks->create = drawogl_create;
-
- dll_loaded = 0;
+ s_dll_loaded = false;
load_gl_lib(machine);
#if defined(OSD_WINDOWS)
osd_printf_verbose("Using Windows OpenGL driver\n");
-#elif SDLMAME_SDL2
- osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n");
#else
- osd_printf_verbose("Using SDL single-window OpenGL driver (SDL 1.2)\n");
+ osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n");
#endif
- return 0;
+ return false;
+}
+
+//============================================================
+// CONSTRUCTOR & DESTRUCTOR
+//============================================================
+
+renderer_ogl::~renderer_ogl()
+{
+ // free the memory in the window
+ destroy_all_textures();
+
+ global_free(m_gl_context);
+ m_gl_context = nullptr;
+
+ for (int i = 0; i < video_config.glsl_shader_mamebm_num; i++)
+ {
+ if (nullptr != video_config.glsl_shader_mamebm[i])
+ {
+ free(video_config.glsl_shader_mamebm[i]);
+ video_config.glsl_shader_mamebm[i] = nullptr;
+ }
+ }
+ for (int i =0; i < video_config.glsl_shader_scrn_num; i++)
+ {
+ if (nullptr != video_config.glsl_shader_scrn[i])
+ {
+ free(video_config.glsl_shader_scrn[i]);
+ video_config.glsl_shader_scrn[i] = nullptr;
+ }
+ }
}
//============================================================
@@ -813,9 +359,13 @@ static void loadgl_functions(osd_gl_context *context)
osd_gl_dispatch *gl_dispatch;
#endif
-static void load_gl_lib(running_machine &machine)
+#ifdef OSD_WINDOWS
+HMODULE win_gl_context::m_module;
+#endif
+
+void renderer_ogl::load_gl_lib(running_machine &machine)
{
- if (!dll_loaded)
+ if (!s_dll_loaded)
{
#ifdef OSD_WINDOWS
win_gl_context::load_library();
@@ -828,10 +378,10 @@ static void load_gl_lib(running_machine &machine)
const char *stemp;
stemp = downcast<sdl_options &>(machine.options()).gl_lib();
- if (stemp != NULL && strcmp(stemp, OSDOPTVAL_AUTO) == 0)
- stemp = NULL;
+ if (stemp != nullptr && strcmp(stemp, OSDOPTVAL_AUTO) == 0)
+ stemp = nullptrnullptr;
- if (SDL_GL_LoadLibrary(stemp) != 0) // Load library (default for e==NULL
+ if (SDL_GL_LoadLibrary(stemp) != 0) // Load library (default for e==nullptr
{
fatalerror("Unable to load opengl library: %s\n", stemp ? stemp : "<default>");
}
@@ -842,11 +392,11 @@ static void load_gl_lib(running_machine &machine)
#ifdef USE_DISPATCH_GL
gl_dispatch = (osd_gl_dispatch *) osd_malloc(sizeof(osd_gl_dispatch));
#endif
- dll_loaded=1;
+ s_dll_loaded = true;
}
}
-void sdl_info_ogl::initialize_gl()
+void renderer_ogl::initialize_gl()
{
int has_and_allow_texturerect = 0;
@@ -859,7 +409,7 @@ void sdl_info_ogl::initialize_gl()
extstr = (char *)"";
#endif
// print out the driver info for debugging
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: %s\nOpenGL: %s\nOpenGL: %s\n", vendor, (char *)glGetString(GL_RENDERER), (char *)glGetString(GL_VERSION));
}
@@ -871,21 +421,19 @@ void sdl_info_ogl::initialize_gl()
m_usefbo = 0;
m_useglsl = 0;
- if ( video_config.allowtexturerect &&
- ( strstr(extstr, "GL_ARB_texture_rectangle") || strstr(extstr, "GL_EXT_texture_rectangle") )
- )
+ if (video_config.allowtexturerect && (strstr(extstr, "GL_ARB_texture_rectangle") || strstr(extstr, "GL_EXT_texture_rectangle")))
{
has_and_allow_texturerect = 1;
- if (!shown_video_info)
- {
- osd_printf_verbose("OpenGL: texture rectangle supported\n");
- }
+ if (!s_shown_video_info)
+ {
+ osd_printf_verbose("OpenGL: texture rectangle supported\n");
+ }
}
// does this card support non-power-of-two sized textures? (they're faster, so use them if possible)
if ( !video_config.forcepow2texture && strstr(extstr, "GL_ARB_texture_non_power_of_two"))
{
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: non-power-of-2 textures supported (new method)\n");
}
@@ -896,7 +444,7 @@ void sdl_info_ogl::initialize_gl()
// second chance: GL_ARB_texture_rectangle or GL_EXT_texture_rectangle (old version)
if (has_and_allow_texturerect)
{
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: non-power-of-2 textures supported (old method)\n");
}
@@ -904,7 +452,7 @@ void sdl_info_ogl::initialize_gl()
}
else
{
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: forcing power-of-2 textures (creation, not copy)\n");
}
@@ -913,8 +461,8 @@ void sdl_info_ogl::initialize_gl()
if (strstr(extstr, "GL_ARB_vertex_buffer_object"))
{
- m_usevbo = video_config.vbo;
- if (!shown_video_info)
+ m_usevbo = video_config.vbo;
+ if (!s_shown_video_info)
{
if(m_usevbo)
osd_printf_verbose("OpenGL: vertex buffer supported\n");
@@ -928,15 +476,17 @@ void sdl_info_ogl::initialize_gl()
if( m_usevbo )
{
m_usepbo = video_config.pbo;
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
if(m_usepbo)
osd_printf_verbose("OpenGL: pixel buffers supported\n");
else
osd_printf_verbose("OpenGL: pixel buffers supported, but disabled\n");
}
- } else {
- if (!shown_video_info)
+ }
+ else
+ {
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: pixel buffers supported, but disabled due to disabled vbo\n");
}
@@ -944,7 +494,7 @@ void sdl_info_ogl::initialize_gl()
}
else
{
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: pixel buffers not supported\n");
}
@@ -953,7 +503,7 @@ void sdl_info_ogl::initialize_gl()
if (strstr(extstr, "GL_EXT_framebuffer_object"))
{
m_usefbo = 1;
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
if(m_usefbo)
osd_printf_verbose("OpenGL: framebuffer object supported\n");
@@ -969,22 +519,24 @@ void sdl_info_ogl::initialize_gl()
)
{
m_useglsl = video_config.glsl;
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
if(m_useglsl)
osd_printf_verbose("OpenGL: GLSL supported\n");
else
osd_printf_verbose("OpenGL: GLSL supported, but disabled\n");
}
- } else {
- if (!shown_video_info)
+ }
+ else
+ {
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: GLSL not supported\n");
}
}
#ifdef TOBEMIGRATED
- if (osd_getenv(SDLENV_VMWARE) != NULL)
+ if (osd_getenv(SDLENV_VMWARE) != nullptr)
{
m_usetexturerect = 1;
m_texpoweroftwo = 1;
@@ -992,55 +544,27 @@ void sdl_info_ogl::initialize_gl()
#endif
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&m_texture_max_width);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&m_texture_max_height);
- if (!shown_video_info)
+ if (!s_shown_video_info)
{
osd_printf_verbose("OpenGL: max texture size %d x %d\n", m_texture_max_width, m_texture_max_height);
}
- shown_video_info = 1;
+ s_shown_video_info = true;
}
//============================================================
// sdl_info::create
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
//============================================================
-int sdl_info_ogl::create()
+int renderer_ogl::create()
{
// create renderer
#if defined(OSD_WINDOWS)
m_gl_context = global_alloc(win_gl_context(window().m_hwnd));
-#elif SDLMAME_SDL2
- m_gl_context = global_alloc(sdl_gl_context(window().sdl_window()));
#else
- m_gl_context = global_alloc(sdl12_gl_context(window().sdl_surface()));
+ m_gl_context = global_alloc(sdl_gl_context(window().sdl_window()));
#endif
- if (m_gl_context->LastErrorMsg() != NULL)
+ if (m_gl_context->LastErrorMsg() != nullptr)
{
osd_printf_error("%s\n", m_gl_context->LastErrorMsg());
return 1;
@@ -1068,31 +592,16 @@ int sdl_info_ogl::create()
m_init_context = 0;
- osd_printf_verbose("Leave sdl_info_ogl::create\n");
+ osd_printf_verbose("Leave renderer_ogl::create\n");
return 0;
}
//============================================================
-// sdl_info::destroy
-//============================================================
-
-void sdl_info_ogl::destroy()
-{
- // free the memory in the window
-
- destroy_all_textures();
-
- global_free(m_gl_context);
- m_gl_context = NULL;
-}
-
-
-//============================================================
// drawsdl_xy_to_render_target
//============================================================
#ifndef OSD_WINDOWS
-int sdl_info_ogl::xy_to_render_target(int x, int y, int *xt, int *yt)
+int renderer_ogl::xy_to_render_target(int x, int y, int *xt, int *yt)
{
*xt = x - m_last_hofs;
*yt = y - m_last_vofs;
@@ -1103,13 +612,14 @@ int sdl_info_ogl::xy_to_render_target(int x, int y, int *xt, int *yt)
return 1;
}
#endif
+
//============================================================
-// drawsdl_destroy_all_textures
+// renderer_ogl::destroy_all_textures
//============================================================
-void sdl_info_ogl::destroy_all_textures()
+void renderer_ogl::destroy_all_textures()
{
- ogl_texture_info *texture = NULL;
+ ogl_texture_info *texture = nullptr;
int lock=FALSE;
int i;
@@ -1134,8 +644,8 @@ void sdl_info_ogl::destroy_all_textures()
while (i<HASH_SIZE+OVERFLOW_SIZE)
{
texture = m_texhash[i];
- m_texhash[i] = NULL;
- if (texture != NULL)
+ m_texhash[i] = nullptr;
+ if (texture != nullptr)
{
if(m_usevbo)
{
@@ -1167,7 +677,7 @@ void sdl_info_ogl::destroy_all_textures()
if ( texture->data_own )
{
free(texture->data);
- texture->data=NULL;
+ texture->data=nullptr;
texture->data_own=FALSE;
}
global_free(texture);
@@ -1177,7 +687,7 @@ void sdl_info_ogl::destroy_all_textures()
if ( m_useglsl )
{
glsl_shader_free(m_glsl);
- m_glsl = NULL;
+ m_glsl = nullptr;
}
m_initialized = 0;
@@ -1189,7 +699,7 @@ void sdl_info_ogl::destroy_all_textures()
// loadGLExtensions
//============================================================
-void sdl_info_ogl::loadGLExtensions()
+void renderer_ogl::loadGLExtensions()
{
static int _once = 1;
@@ -1390,7 +900,7 @@ void sdl_info_ogl::loadGLExtensions()
if ( m_useglsl )
{
m_glsl = glsl_shader_init(m_gl_context);
- m_useglsl = (m_glsl != NULL ? 1 : 0);
+ m_useglsl = (m_glsl != nullptr ? 1 : 0);
if ( ! m_useglsl )
{
@@ -1499,10 +1009,10 @@ void sdl_info_ogl::loadGLExtensions()
// sdl_info::draw
//============================================================
-int sdl_info_ogl::draw(const int update)
+int renderer_ogl::draw(const int update)
{
render_primitive *prim;
- ogl_texture_info *texture=NULL;
+ ogl_texture_info *texture=nullptr;
float vofs, hofs;
int pendingPrimitive=GL_NO_PRIMITIVE, curPrimitive=GL_NO_PRIMITIVE;
@@ -1530,11 +1040,9 @@ int sdl_info_ogl::draw(const int update)
if (m_init_context)
{
// do some one-time OpenGL setup
-#if SDLMAME_SDL2
// FIXME: SRGB conversion is working on SDL2, may be of use
// when we eventually target gamma and monitor profiles.
//glEnable(GL_FRAMEBUFFER_SRGB);
-#endif
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
@@ -1560,11 +1068,6 @@ int sdl_info_ogl::draw(const int update)
loadGLExtensions();
}
-#if !defined(OSD_WINDOWS) && !SDLMAME_SDL2
- // force all textures to be regenerated
- destroy_all_textures();
-#endif
-
m_surf_w = m_width;
m_surf_h = m_height;
@@ -1654,7 +1157,7 @@ int sdl_info_ogl::draw(const int update)
window().m_primlist->acquire_lock();
// now draw
- for (prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
{
int i;
@@ -1770,7 +1273,7 @@ int sdl_info_ogl::draw(const int update)
// if we have a texture to use for the vectors, use it here
#if 0
- if (d3d->vector_texture != NULL)
+ if (d3d->vector_texture != nullptr)
{
printf("SDL: textured lines unsupported\n");
vertex[0].u0 = d3d->vector_texture->ustart;
@@ -1855,7 +1358,7 @@ int sdl_info_ogl::draw(const int update)
if ( texture )
{
texture_disable(texture);
- texture=NULL;
+ texture=nullptr;
}
break;
@@ -1913,32 +1416,6 @@ static const GLint texture_copy_properties[9][2] = {
};
//============================================================
-// drawogl_exit
-//============================================================
-
-static void drawogl_exit(void)
-{
- int i;
-
- for(i=0; i<video_config.glsl_shader_mamebm_num; i++)
- {
- if ( NULL!=video_config.glsl_shader_mamebm[i])
- {
- free(video_config.glsl_shader_mamebm[i]);
- video_config.glsl_shader_mamebm[i] = NULL;
- }
- }
- for(i=0; i<video_config.glsl_shader_scrn_num; i++)
- {
- if ( NULL!=video_config.glsl_shader_scrn[i])
- {
- free(video_config.glsl_shader_scrn[i]);
- video_config.glsl_shader_scrn[i] = NULL;
- }
- }
-}
-
-//============================================================
// texture_compute_size and type
//============================================================
@@ -1949,7 +1426,7 @@ static void drawogl_exit(void)
// we also don't want to use PBO's in the case of nocopy==TRUE,
// since we now might have GLSL shaders - this decision simplifies out life ;-)
//
-void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
+void renderer_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
{
texture->type = TEXTURE_TYPE_NONE;
texture->nocopy = FALSE;
@@ -2003,7 +1480,7 @@ static inline int get_valid_pow2_value(int v, int needPow2)
return (needPow2)?gl_round_to_pow2(v):v;
}
-void sdl_info_ogl::texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
+void renderer_ogl::texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
UINT32 width, UINT32 height,
int* p_width, int* p_height, int* p_width_create, int* p_height_create)
{
@@ -2054,7 +1531,7 @@ void sdl_info_ogl::texture_compute_size_subroutine(ogl_texture_info *texture, UI
*p_height_create=height_create;
}
-void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
+void renderer_ogl::texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
{
int finalheight, finalwidth;
int finalheight_create, finalwidth_create;
@@ -2186,7 +1663,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height,
- 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL );
+ 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr );
}
// non-screen textures will never be filtered
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
@@ -2207,7 +1684,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
return 0;
}
-int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
+int renderer_ogl::texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
{
int uniform_location;
int i;
@@ -2326,7 +1803,7 @@ int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, ogl_tex
glPixelStorei(GL_UNPACK_ROW_LENGTH, texture->rawwidth_create);
- UINT32 * dummy = NULL;
+ UINT32 * dummy = nullptr;
GLint _width, _height;
if ( gl_texture_check_size(GL_TEXTURE_2D, 0, GL_RGBA8,
texture->rawwidth_create, texture->rawheight_create,
@@ -2380,7 +1857,7 @@ int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, ogl_tex
return 0;
}
-ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags)
+ogl_texture_info *renderer_ogl::texture_create(const render_texinfo *texsource, UINT32 flags)
{
ogl_texture_info *texture;
@@ -2423,7 +1900,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
texture->format = SDL_TEXFORMAT_ARGB32;
break;
case TEXFORMAT_RGB32:
- if (texsource->palette != NULL)
+ if (texsource->palette != nullptr)
texture->format = SDL_TEXFORMAT_RGB32_PALETTED;
else
texture->format = SDL_TEXFORMAT_RGB32;
@@ -2435,7 +1912,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
texture->format = SDL_TEXFORMAT_PALETTE16A;
break;
case TEXFORMAT_YUY16:
- if (texsource->palette != NULL)
+ if (texsource->palette != nullptr)
texture->format = SDL_TEXFORMAT_YUY16_PALETTED;
else
texture->format = SDL_TEXFORMAT_YUY16;
@@ -2460,7 +1937,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
if ( texture_shader_create(texsource, texture, flags) )
{
global_free(texture);
- return NULL;
+ return nullptr;
}
}
else
@@ -2477,7 +1954,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
glTexImage2D(texture->texTarget, 0, GL_RGBA8,
texture->rawwidth_create, texture->rawheight_create,
texture->borderpix ? 1 : 0,
- GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
+ GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr);
if ((PRIMFLAG_GET_SCREENTEX(flags)) && video_config.filter)
{
@@ -2524,7 +2001,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
// set up the PBO dimension, ..
pfn_glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB,
texture->rawwidth * texture->rawheight * sizeof(UINT32),
- NULL, GL_STREAM_DRAW);
+ nullptr, GL_STREAM_DRAW);
}
if ( !texture->nocopy && texture->type!=TEXTURE_TYPE_DYNAMIC )
@@ -2534,13 +2011,13 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
}
// add us to the texture list
- if (m_texhash[texture->hash] == NULL)
+ if (m_texhash[texture->hash] == nullptr)
m_texhash[texture->hash] = texture;
else
{
int i;
for (i = HASH_SIZE; i < HASH_SIZE + OVERFLOW_SIZE; i++)
- if (m_texhash[i] == NULL)
+ if (m_texhash[i] == nullptr)
{
m_texhash[i] = texture;
break;
@@ -2555,7 +2032,7 @@ ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource,
pfn_glBindBuffer( GL_ARRAY_BUFFER_ARB, texture->texCoordBufferName );
// Load The Data
pfn_glBufferData( GL_ARRAY_BUFFER_ARB, 4*2*sizeof(GLfloat), texture->texCoord, GL_STREAM_DRAW );
- glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL ); // we are using ARB VBO buffers
+ glTexCoordPointer( 2, GL_FLOAT, 0, (char *) nullptr ); // we are using ARB VBO buffers
}
else
{
@@ -2622,7 +2099,7 @@ static inline void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, con
assert(xborderpix == 0 || xborderpix == 1);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2674,7 +2151,7 @@ static inline void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, co
assert(xborderpix == 0 || xborderpix == 1);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2763,7 +2240,7 @@ static inline void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int wi
assert(width % 2 == 0);
// palette (really RGB map) case
- if (palette != NULL)
+ if (palette != nullptr)
{
if (xborderpix)
{
@@ -2936,7 +2413,7 @@ static void texture_set_data(ogl_texture_info *texture, const render_texinfo *te
// kick off the DMA
glTexSubImage2D(texture->texTarget, 0, 0, 0, texture->rawwidth, texture->rawheight,
- GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
+ GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, nullptr);
}
else
{
@@ -2971,13 +2448,13 @@ static int compare_texture_primitive(const ogl_texture_info *texture, const rend
return 0;
}
-ogl_texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
+ogl_texture_info *renderer_ogl::texture_find(const render_primitive *prim)
{
HashT texhash = texture_compute_hash(&prim->texture, prim->flags);
ogl_texture_info *texture;
texture = m_texhash[texhash];
- if (texture != NULL)
+ if (texture != nullptr)
{
int i;
if (compare_texture_primitive(texture, prim))
@@ -2985,18 +2462,18 @@ ogl_texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
for (i=HASH_SIZE; i<HASH_SIZE + OVERFLOW_SIZE; i++)
{
texture = m_texhash[i];
- if (texture != NULL && compare_texture_primitive(texture, prim))
+ if (texture != nullptr && compare_texture_primitive(texture, prim))
return texture;
}
}
- return NULL;
+ return nullptr;
}
//============================================================
// texture_update
//============================================================
-void sdl_info_ogl::texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx)
+void renderer_ogl::texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx)
{
float ustart = 0.0f, ustop = 0.0f; // beginning/ending U coordinates
float vstart = 0.0f, vstop = 0.0f; // beginning/ending V coordinates
@@ -3073,7 +2550,7 @@ void sdl_info_ogl::texture_coord_update(ogl_texture_info *texture, const render_
}
}
-void sdl_info_ogl::texture_mpass_flip(ogl_texture_info *texture, int shaderIdx)
+void renderer_ogl::texture_mpass_flip(ogl_texture_info *texture, int shaderIdx)
{
UINT32 mpass_src_idx = texture->mpass_dest_idx;
@@ -3145,12 +2622,12 @@ void sdl_info_ogl::texture_mpass_flip(ogl_texture_info *texture, int shaderIdx)
}
}
-void sdl_info_ogl::texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx)
+void renderer_ogl::texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx)
{
int uniform_location;
GLfloat vid_attributes[4];
- if (container!=NULL)
+ if (container!=nullptr)
{
render_container::user_settings settings;
container->get_user_settings(settings);
@@ -3170,17 +2647,17 @@ void sdl_info_ogl::texture_shader_update(ogl_texture_info *texture, render_conta
}
}
-ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx)
+ogl_texture_info * renderer_ogl::texture_update(const render_primitive *prim, int shaderIdx)
{
ogl_texture_info *texture = texture_find(prim);
int texBound = 0;
// if we didn't find one, create a new texture
- if (texture == NULL && prim->texture.base != NULL)
+ if (texture == nullptr && prim->texture.base != nullptr)
{
texture = texture_create(&prim->texture, prim->flags);
}
- else if (texture != NULL)
+ else if (texture != nullptr)
{
if ( texture->type == TEXTURE_TYPE_SHADER )
{
@@ -3198,7 +2675,7 @@ ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, in
}
}
- if (texture != NULL)
+ if (texture != nullptr)
{
if ( texture->type == TEXTURE_TYPE_SHADER )
{
@@ -3211,7 +2688,7 @@ ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, in
if ( shaderIdx==0 ) // redundant for subsequent multipass shader
{
- if (prim->texture.base != NULL && texture->texinfo.seqid != prim->texture.seqid)
+ if (prim->texture.base != nullptr && texture->texinfo.seqid != prim->texture.seqid)
{
texture->texinfo.seqid = prim->texture.seqid;
@@ -3232,7 +2709,7 @@ ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, in
pfn_glBindBuffer( GL_ARRAY_BUFFER_ARB, texture->texCoordBufferName );
// Load The Data
pfn_glBufferSubData( GL_ARRAY_BUFFER_ARB, 0, 4*2*sizeof(GLfloat), texture->texCoord );
- glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL ); // we are using ARB VBO buffers
+ glTexCoordPointer( 2, GL_FLOAT, 0, (char *) nullptr ); // we are using ARB VBO buffers
}
else
{
@@ -3243,7 +2720,7 @@ ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, in
return texture;
}
-void sdl_info_ogl::texture_disable(ogl_texture_info * texture)
+void renderer_ogl::texture_disable(ogl_texture_info * texture)
{
if ( texture->type == TEXTURE_TYPE_SHADER )
{
@@ -3258,7 +2735,7 @@ void sdl_info_ogl::texture_disable(ogl_texture_info * texture)
}
}
-void sdl_info_ogl::texture_all_disable()
+void renderer_ogl::texture_all_disable()
{
if ( m_useglsl )
{
diff --git a/src/osd/modules/render/drawogl.h b/src/osd/modules/render/drawogl.h
new file mode 100644
index 00000000000..5c96277f247
--- /dev/null
+++ b/src/osd/modules/render/drawogl.h
@@ -0,0 +1,233 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+//============================================================
+//
+// drawogl.h - SDL software and OpenGL implementation
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWOGL__
+#define __DRAWOGL__
+
+// OSD headers
+#ifndef OSD_WINDOWS
+#include "osdsdl.h"
+#include "window.h"
+#else
+#include "../windows/window.h"
+typedef UINT64 HashT;
+#endif
+
+#if defined(OSD_WINDOWS)
+#include "winglcontext.h"
+#else
+#include "sdlglcontext.h"
+#endif
+
+#include "modules/opengl/gl_shader_mgr.h"
+
+//============================================================
+// Textures
+//============================================================
+
+/* ogl_texture_info holds information about a texture */
+class ogl_texture_info
+{
+public:
+ ogl_texture_info()
+ : hash(0), flags(0), rawwidth(0), rawheight(0),
+ rawwidth_create(0), rawheight_create(0),
+ type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0),
+ texture(0), texTarget(0), texpow2(0), mpass_dest_idx(0), pbo(0), data(NULL),
+ data_own(0), texCoordBufferName(0)
+ {
+ for (int i=0; i<2; i++)
+ {
+ mpass_textureunit[i] = 0;
+ mpass_texture_mamebm[i] = 0;
+ mpass_fbo_mamebm[i] = 0;
+ mpass_texture_scrn[i] = 0;
+ mpass_fbo_scrn[i] = 0;
+ }
+ for (int i=0; i<8; i++)
+ texCoord[i] = 0.0f;
+ }
+
+ HashT hash; // hash value for the texture (must be >= pointer size)
+ UINT32 flags; // rendering flags
+ render_texinfo texinfo; // copy of the texture info
+ int rawwidth, rawheight; // raw width/height of the texture
+ int rawwidth_create; // raw width/height, pow2 compatible, if needed
+ int rawheight_create; // (create and initial set the texture, not for copy!)
+ int type; // what type of texture are we?
+ int format; // texture format
+ int borderpix; // do we have a 1 pixel border?
+ int xprescale; // what is our X prescale factor?
+ int yprescale; // what is our Y prescale factor?
+ int nocopy; // must the texture date be copied?
+
+ UINT32 texture; // OpenGL texture "name"/ID
+
+ GLenum texTarget; // OpenGL texture target
+ int texpow2; // Is this texture pow2
+
+ UINT32 mpass_dest_idx; // Multipass dest idx [0..1]
+ UINT32 mpass_textureunit[2]; // texture unit names for GLSL
+
+ UINT32 mpass_texture_mamebm[2];// Multipass OpenGL texture "name"/ID for the shader
+ UINT32 mpass_fbo_mamebm[2]; // framebuffer object for this texture, multipass
+ UINT32 mpass_texture_scrn[2]; // Multipass OpenGL texture "name"/ID for the shader
+ UINT32 mpass_fbo_scrn[2]; // framebuffer object for this texture, multipass
+
+ UINT32 pbo; // pixel buffer object for this texture (DYNAMIC only!)
+ UINT32 *data; // pixels for the texture
+ int data_own; // do we own / allocated it ?
+ GLfloat texCoord[8];
+ GLuint texCoordBufferName;
+
+};
+
+/* sdl_info is the information about SDL for the current screen */
+class renderer_ogl : public osd_renderer
+{
+public:
+ renderer_ogl(osd_window *window)
+ : osd_renderer(window, FLAG_NEEDS_OPENGL)
+ , m_blittimer(0)
+ , m_width(0)
+ , m_height(0)
+ , m_blit_dim(0, 0)
+ , m_gl_context(NULL)
+ , m_initialized(0)
+ , m_last_blendmode(0)
+ , m_texture_max_width(0)
+ , m_texture_max_height(0)
+ , m_texpoweroftwo(0)
+ , m_usevbo(0)
+ , m_usepbo(0)
+ , m_usefbo(0)
+ , m_useglsl(0)
+ , m_glsl(nullptr)
+ , m_glsl_program_num(0)
+ , m_glsl_program_mb2sc(0)
+ , m_usetexturerect(0)
+ , m_init_context(0)
+ , m_last_hofs(0.0f)
+ , m_last_vofs(0.0f)
+ , m_surf_w(0)
+ , m_surf_h(0)
+ {
+ for (int i=0; i < HASH_SIZE + OVERFLOW_SIZE; i++)
+ m_texhash[i] = NULL;
+ for (int i=0; i < 2*GLSL_SHADER_MAX; i++)
+ m_glsl_program[i] = 0;
+ for (int i=0; i < 8; i++)
+ m_texVerticex[i] = 0.0f;
+ }
+ virtual ~renderer_ogl();
+
+ virtual int create() override;
+ static bool init(running_machine &machine);
+ virtual int draw(const int update) override;
+
+#ifndef OSD_WINDOWS
+ virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
+#endif
+ virtual render_primitive_list *get_primitives() override
+ {
+#ifdef OSD_WINDOWS
+ osd_dim nd = window().get_size();
+#else
+ osd_dim nd = window().blit_surface_size();
+#endif
+ if (nd != m_blit_dim)
+ {
+ m_blit_dim = nd;
+ notify_changed();
+ }
+ window().target()->set_bounds(m_blit_dim.width(), m_blit_dim.height(), window().aspect());
+ return &window().target()->get_primitives();
+ }
+
+#ifdef OSD_WINDOWS
+ virtual void save() override { }
+ virtual void record() override { }
+ virtual void toggle_fsfx() override { }
+#endif
+
+private:
+ static const UINT32 HASH_SIZE = ((1 << 10) + 1);
+ static const UINT32 OVERFLOW_SIZE = (1 << 10);
+
+ void destroy_all_textures();
+
+ static void load_gl_lib(running_machine &machine);
+ void loadGLExtensions();
+ void initialize_gl();
+ void set_blendmode(int blendmode);
+ HashT texture_compute_hash(const render_texinfo *texture, UINT32 flags);
+ void texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
+ void texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
+ UINT32 width, UINT32 height,
+ int* p_width, int* p_height, int* p_width_create, int* p_height_create);
+ void texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
+ ogl_texture_info *texture_create(const render_texinfo *texsource, UINT32 flags);
+ int texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
+ ogl_texture_info *texture_find(const render_primitive *prim);
+ void texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx);
+ void texture_mpass_flip(ogl_texture_info *texture, int shaderIdx);
+ void texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx);
+ ogl_texture_info * texture_update(const render_primitive *prim, int shaderIdx);
+ void texture_disable(ogl_texture_info * texture);
+ void texture_all_disable();
+
+ INT32 m_blittimer;
+ int m_width;
+ int m_height;
+ osd_dim m_blit_dim;
+
+ osd_gl_context *m_gl_context;
+
+ int m_initialized; // is everything well initialized, i.e. all GL stuff etc.
+ // 3D info (GL mode only)
+ ogl_texture_info * m_texhash[HASH_SIZE + OVERFLOW_SIZE];
+ int m_last_blendmode; // previous blendmode
+ INT32 m_texture_max_width; // texture maximum width
+ INT32 m_texture_max_height; // texture maximum height
+ int m_texpoweroftwo; // must textures be power-of-2 sized?
+ int m_usevbo; // runtime check if VBO is available
+ int m_usepbo; // runtime check if PBO is available
+ int m_usefbo; // runtime check if FBO is available
+ int m_useglsl; // runtime check if GLSL is available
+
+ glsl_shader_info *m_glsl; // glsl_shader_info
+
+ GLhandleARB m_glsl_program[2*GLSL_SHADER_MAX]; // GLSL programs, or 0
+ int m_glsl_program_num; // number of GLSL programs
+ int m_glsl_program_mb2sc; // GLSL program idx, which transforms
+ // the mame-bitmap. screen-bitmap (size/rotation/..)
+ // All progs <= glsl_program_mb2sc using the mame bitmap
+ // as input, otherwise the screen bitmap.
+ // All progs >= glsl_program_mb2sc using the screen bitmap
+ // as output, otherwise the mame bitmap.
+ int m_usetexturerect; // use ARB_texture_rectangle for non-power-of-2, general use
+
+ int m_init_context; // initialize context before next draw
+
+ float m_last_hofs;
+ float m_last_vofs;
+
+ // Static vars from draogl_window_dra
+ INT32 m_surf_w;
+ INT32 m_surf_h;
+ GLfloat m_texVerticex[8];
+
+ static bool s_shown_video_info;
+ static bool s_dll_loaded;
+};
+
+#endif // __DRAWOGL__ \ No newline at end of file
diff --git a/src/osd/modules/render/drawsdl.cpp b/src/osd/modules/render/drawsdl.cpp
index 221ac79ef4d..005d523cf9a 100644
--- a/src/osd/modules/render/drawsdl.cpp
+++ b/src/osd/modules/render/drawsdl.cpp
@@ -26,6 +26,8 @@
#include "osdsdl.h"
#include "window.h"
+#include "drawsdl.h"
+
//============================================================
// DEBUGGING
//============================================================
@@ -34,119 +36,14 @@
// CONSTANTS
//============================================================
-//============================================================
-// TYPES
-//============================================================
-
-struct sdl_scale_mode;
-
-#if (SDLMAME_SDL2)
#define DRAW2_SCALEMODE_NEAREST "0"
#define DRAW2_SCALEMODE_LINEAR "1"
#define DRAW2_SCALEMODE_BEST "2"
-#endif
-
-/* sdl_info is the information about SDL for the current screen */
-class sdl_info : public osd_renderer
-{
-public:
-
- sdl_info(osd_window *w, int extra_flags)
- : osd_renderer(w, extra_flags),
- #if (SDLMAME_SDL2)
- m_sdl_renderer(NULL),
- m_texture_id(NULL),
- #else
- m_yuvsurf(NULL),
- #endif
- m_yuv_lookup(NULL),
- m_yuv_bitmap(NULL),
- //m_hw_scale_width(0),
- //m_hw_scale_height(0),
- m_last_hofs(0),
- m_last_vofs(0),
- m_blit_dim(0, 0),
- m_last_dim(0, 0)
- { }
-
- /* virtual */ int create() override;
- /* virtual */ int draw(const int update) override;
- /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
- /* virtual */ void destroy() override;
- /* virtual */ render_primitive_list *get_primitives() override
- {
- osd_dim nd = window().blit_surface_size();
- if (nd != m_blit_dim)
- {
- m_blit_dim = nd;
- notify_changed();
- }
- window().target()->set_bounds(m_blit_dim.width(), m_blit_dim.height(), window().aspect());
- return &window().target()->get_primitives();
- }
-
-private:
- void destroy_all_textures();
- void yuv_init();
-#if (SDLMAME_SDL2)
- void setup_texture(const osd_dim &size);
-#endif
- void yuv_lookup_set(unsigned int pen, unsigned char red,
- unsigned char green, unsigned char blue);
-
-#if (!SDLMAME_SDL2)
- void yuv_overlay_init();
-#endif
-
- INT32 m_blittimer;
-
-#if (SDLMAME_SDL2)
- SDL_Renderer *m_sdl_renderer;
- SDL_Texture *m_texture_id;
-#else
- SDL_Overlay *m_yuvsurf;
-#endif
-
- // YUV overlay
- UINT32 *m_yuv_lookup;
- UINT16 *m_yuv_bitmap;
-
- // if we leave scaling to SDL and the underlying driver, this
- // is the render_target_width/height to use
-
- int m_last_hofs;
- int m_last_vofs;
- osd_dim m_blit_dim;
- osd_dim m_last_dim;
-};
-
-struct sdl_scale_mode
-{
- const char *name;
- int is_scale; /* Scale mode? */
- int is_yuv; /* Yuv mode? */
- int mult_w; /* Width multiplier */
- int mult_h; /* Height multiplier */
-#if (!SDLMAME_SDL2)
- int m_extra_flags; /* Texture/surface flags */
-#else
- const char *sdl_scale_mode_hint; /* what to use as a hint ? */
-#endif
- int pixel_format; /* Pixel/Overlay format */
- void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height);
-};
-
-//============================================================
-// INLINES
-//============================================================
//============================================================
// PROTOTYPES
//============================================================
-// core functions
-static void drawsdl_exit(void);
-
// YUV overlays
static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \
@@ -160,20 +57,6 @@ static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch,
// Static declarations
-#if (!SDLMAME_SDL2)
-static int shown_video_info = 0;
-
-static const sdl_scale_mode scale_modes[] =
-{
- { "none", 0, 0, 1, 1, osd_renderer::FLAG_NEEDS_DOUBLEBUF, 0, 0 },
- { "async", 0, 0, 1, 1, osd_renderer::FLAG_NEEDS_DOUBLEBUF | osd_renderer::FLAG_NEEDS_ASYNCBLIT, 0, 0 },
- { "yv12", 1, 1, 1, 1, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12 },
- { "yv12x2", 1, 1, 2, 2, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12X2 },
- { "yuy2", 1, 1, 1, 1, 0, SDL_YUY2_OVERLAY, yuv_RGB_to_YUY2 },
- { "yuy2x2", 1, 1, 2, 1, 0, SDL_YUY2_OVERLAY, yuv_RGB_to_YUY2X2 },
- { NULL }
-};
-#else
static const sdl_scale_mode scale_modes[] =
{
{ "none", 0, 0, 1, 1, DRAW2_SCALEMODE_NEAREST, 0, 0 },
@@ -184,26 +67,7 @@ static const sdl_scale_mode scale_modes[] =
{ "yv12x2", 1, 1, 2, 2, DRAW2_SCALEMODE_BEST, SDL_PIXELFORMAT_YV12, yuv_RGB_to_YV12X2 },
{ "yuy2", 1, 1, 1, 1, DRAW2_SCALEMODE_BEST, SDL_PIXELFORMAT_YUY2, yuv_RGB_to_YUY2 },
{ "yuy2x2", 1, 1, 2, 1, DRAW2_SCALEMODE_BEST, SDL_PIXELFORMAT_YUY2, yuv_RGB_to_YUY2X2 },
- { NULL }
-};
-#endif
-
-//============================================================
-// drawsdl_scale_mode
-//============================================================
-
-const char *drawsdl_scale_mode_str(int index)
-{
- const sdl_scale_mode *sm = scale_modes;
-
- while (index>0)
- {
- if (sm->name == NULL)
- return NULL;
- index--;
- sm++;
- }
- return sm->name;
+ { nullptr }
};
int drawsdl_scale_mode(const char *s)
@@ -212,7 +76,7 @@ int drawsdl_scale_mode(const char *s)
int index;
index = 0;
- while (sm->name != NULL)
+ while (sm->name != nullptr)
{
if (strcmp(sm->name, s) == 0)
return index;
@@ -222,50 +86,21 @@ int drawsdl_scale_mode(const char *s)
return -1;
}
-
-static osd_renderer *drawsdl_create(osd_window *window)
-{
- // FIXME: QUALITY HINTS
-#if (SDLMAME_SDL2)
- return global_alloc(sdl_info(window, osd_renderer::FLAG_NONE));
-#else
- const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
- return global_alloc(sdl_info(window, sm->m_extra_flags));
-#endif
-}
-
//============================================================
// drawsdl_init
//============================================================
-int drawsdl_init(osd_draw_callbacks *callbacks)
-{
- // fill in the callbacks
- callbacks->create = drawsdl_create;
- callbacks->exit = drawsdl_exit;
-
- if (SDLMAME_SDL2)
- osd_printf_verbose("Using SDL multi-window soft driver (SDL 2.0+)\n");
- else
- osd_printf_verbose("Using SDL single-window soft driver (SDL 1.2)\n");
-
- return 0;
-}
-
-//============================================================
-// drawsdl_exit
-//============================================================
-
-static void drawsdl_exit(void)
+bool renderer_sdl2::init(running_machine &machine)
{
+ osd_printf_verbose("Using SDL multi-window soft driver (SDL 2.0+)\n");
+ return false;
}
//============================================================
// setup_texture for window
//============================================================
-#if (SDLMAME_SDL2)
-void sdl_info::setup_texture(const osd_dim &size)
+void renderer_sdl2::setup_texture(const osd_dim &size)
{
const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode];
SDL_DisplayMode mode;
@@ -277,7 +112,7 @@ void sdl_info::setup_texture(const osd_dim &size)
if (m_yuv_bitmap)
{
global_free_array(m_yuv_bitmap);
- m_yuv_bitmap = NULL;
+ m_yuv_bitmap = nullptr;
}
fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format);
@@ -311,68 +146,16 @@ void sdl_info::setup_texture(const osd_dim &size)
size.width(), size.height());
}
}
-#endif
-
-//============================================================
-// yuv_overlay_init
-//============================================================
-
-#if (!SDLMAME_SDL2)
-void sdl_info::yuv_overlay_init()
-{
- const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode];
- int minimum_width, minimum_height;
-
- window().target()->compute_minimum_size(minimum_width, minimum_height);
-
- if (window().prescale())
- {
- minimum_width *= window().prescale();
- minimum_height *= window().prescale();
- }
-
- if (m_yuvsurf != NULL)
- {
- SDL_FreeYUVOverlay(m_yuvsurf);
- m_yuvsurf = NULL;
- }
-
- if (m_yuv_bitmap != NULL)
- {
- global_free_array(m_yuv_bitmap);
- }
-
- osd_printf_verbose("SDL: Creating %d x %d YUV-Overlay ...\n", minimum_width, minimum_height);
-
- m_yuv_bitmap = global_alloc_array(UINT16, minimum_width*minimum_height);
-
- m_yuvsurf = SDL_CreateYUVOverlay(minimum_width * sdl_sm->mult_w, minimum_height * sdl_sm->mult_h,
- sdl_sm->pixel_format, window().sdl_surface());
-
- if ( m_yuvsurf == NULL ) {
- osd_printf_error("SDL: Couldn't create SDL_yuv_overlay: %s\n", SDL_GetError());
- //return 1;
- }
-
- if (!shown_video_info)
- {
- osd_printf_verbose("YUV Mode : %s\n", sdl_sm->name);
- osd_printf_verbose("YUV Overlay Size : %d x %d\n", minimum_width, minimum_height);
- osd_printf_verbose("YUV Acceleration : %s\n", m_yuvsurf->hw_overlay ? "Hardware" : "Software");
- shown_video_info = 1;
- }
-}
-#endif
//============================================================
// drawsdl_show_info
//============================================================
-#if (SDLMAME_SDL2)
-static void drawsdl_show_info(struct SDL_RendererInfo *render_info)
+void renderer_sdl2::show_info(struct SDL_RendererInfo *render_info)
{
#define RF_ENTRY(x) {x, #x }
- static struct {
+ static struct
+ {
int flag;
const char *name;
} rflist[] =
@@ -386,51 +169,21 @@ static void drawsdl_show_info(struct SDL_RendererInfo *render_info)
#endif
RF_ENTRY(SDL_RENDERER_PRESENTVSYNC),
RF_ENTRY(SDL_RENDERER_ACCELERATED),
- {-1, NULL}
+ {-1, nullptr}
};
- int i;
osd_printf_verbose("window: using renderer %s\n", render_info->name ? render_info->name : "<unknown>");
- for (i = 0; rflist[i].name != NULL; i++)
+ for (int i = 0; rflist[i].name != nullptr; i++)
if (render_info->flags & rflist[i].flag)
osd_printf_verbose("renderer: flag %s\n", rflist[i].name);
}
-#endif
//============================================================
-// sdl_info::create
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
-// a
+// renderer_sdl2::create
//============================================================
-
-int sdl_info::create()
+int renderer_sdl2::create()
{
-#if (SDLMAME_SDL2)
const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
// create renderer
@@ -457,27 +210,25 @@ int sdl_info::create()
fatalerror("Error on creating renderer: %s\n", SDL_GetError());
}
- {
- struct SDL_RendererInfo render_info;
+ struct SDL_RendererInfo render_info;
- SDL_GetRendererInfo(m_sdl_renderer, &render_info);
- drawsdl_show_info(&render_info);
+ SDL_GetRendererInfo(m_sdl_renderer, &render_info);
+ show_info(&render_info);
- // Check scale mode
+ // Check scale mode
- if (sm->pixel_format)
- {
- int i;
- int found = 0;
+ if (sm->pixel_format)
+ {
+ int i;
+ int found = 0;
- for (i=0; i < render_info.num_texture_formats; i++)
- if (sm->pixel_format == render_info.texture_formats[i])
- found = 1;
+ for (i=0; i < render_info.num_texture_formats; i++)
+ if (sm->pixel_format == render_info.texture_formats[i])
+ found = 1;
- if (!found)
- {
- fatalerror("window: Scale mode %s not supported!", sm->name);
- }
+ if (!found)
+ {
+ fatalerror("window: Scale mode %s not supported!", sm->name);
}
}
@@ -486,47 +237,41 @@ int sdl_info::create()
window().get_size(w, h);
setup_texture(w, h);
#endif
-#else
-#endif
- m_yuv_lookup = NULL;
+ m_yuv_lookup = nullptr;
m_blittimer = 0;
yuv_init();
- osd_printf_verbose("Leave sdl_info::create\n");
+ osd_printf_verbose("Leave renderer_sdl2::create\n");
return 0;
}
//============================================================
-// sdl_info::destroy
+// DESTRUCTOR
//============================================================
-void sdl_info::destroy()
+renderer_sdl2::~renderer_sdl2()
{
- // free the memory in the window
-
destroy_all_textures();
- if (m_yuv_lookup != NULL)
+ if (m_yuv_lookup != nullptr)
{
global_free_array(m_yuv_lookup);
- m_yuv_lookup = NULL;
+ m_yuv_lookup = nullptr;
}
- if (m_yuv_bitmap != NULL)
+ if (m_yuv_bitmap != nullptr)
{
global_free_array(m_yuv_bitmap);
- m_yuv_bitmap = NULL;
+ m_yuv_bitmap = nullptr;
}
-#if (SDLMAME_SDL2)
SDL_DestroyRenderer(m_sdl_renderer);
-#endif
}
//============================================================
// drawsdl_xy_to_render_target
//============================================================
-int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt)
+int renderer_sdl2::xy_to_render_target(int x, int y, int *xt, int *yt)
{
*xt = x - m_last_hofs;
*yt = y - m_last_vofs;
@@ -541,34 +286,24 @@ int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt)
// drawsdl_destroy_all_textures
//============================================================
-void sdl_info::destroy_all_textures()
+void renderer_sdl2::destroy_all_textures()
{
-#if (SDLMAME_SDL2)
SDL_DestroyTexture(m_texture_id);
- m_texture_id = NULL;
-#else
- if (m_yuvsurf != NULL)
- {
- SDL_FreeYUVOverlay(m_yuvsurf);
- m_yuvsurf = NULL;
- }
-#endif
+ m_texture_id = nullptr;
}
//============================================================
-// sdl_info::draw
+// renderer_sdl2::draw
//============================================================
-int sdl_info::draw(int update)
+int renderer_sdl2::draw(int update)
{
const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
UINT8 *surfptr;
INT32 pitch;
Uint32 rmask, gmask, bmask;
-#if (SDLMAME_SDL2)
Uint32 amask;
-#endif
INT32 vofs, hofs, blitwidth, blitheight, ch, cw;
int bpp;
@@ -584,68 +319,14 @@ int sdl_info::draw(int update)
clear_flags(FI_CHANGED);
m_blittimer = 3;
m_last_dim = wdim;
-#if (SDLMAME_SDL2)
- SDL_RenderSetViewport(m_sdl_renderer, NULL);
- if (m_texture_id != NULL)
+ SDL_RenderSetViewport(m_sdl_renderer, nullptr);
+ if (m_texture_id != nullptr)
SDL_DestroyTexture(m_texture_id);
setup_texture(m_blit_dim);
m_blittimer = 3;
-#else
- const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode];
- if (sdl_sm->is_yuv)
- {
- yuv_overlay_init();
- }
-#endif
}
// lock it if we need it
-#if (!SDLMAME_SDL2)
-
- pitch = window().sdl_surface()->pitch;
- bpp = window().sdl_surface()->format->BytesPerPixel;
- rmask = window().sdl_surface()->format->Rmask;
- gmask = window().sdl_surface()->format->Gmask;
- bmask = window().sdl_surface()->format->Bmask;
-// amask = sdlsurf->format->Amask;
-#if 0
- if (window().blitwidth() != m_old_blitwidth || window().blitheight() != m_old_blitheight)
- {
- if (sm->is_yuv)
- yuv_overlay_init();
- m_old_blitwidth = window().blitwidth();
- m_old_blitheight = window().blitheight();
- m_blittimer = 3;
- }
-#endif
- if (SDL_MUSTLOCK(window().sdl_surface()))
- SDL_LockSurface(window().sdl_surface());
-
- // Clear if necessary
- if (m_blittimer > 0)
- {
- memset(window().sdl_surface()->pixels, 0, wdim.height() * window().sdl_surface()->pitch);
- m_blittimer--;
- }
-
-
- if (sm->is_yuv)
- {
- SDL_LockYUVOverlay(m_yuvsurf);
- surfptr = m_yuvsurf->pixels[0]; // (UINT8 *) m_yuv_bitmap;
- pitch = m_yuvsurf->pitches[0]; // (UINT8 *) m_yuv_bitmap;
-#if 0
- printf("abcd %d\n", m_yuvsurf->h);
- printf("abcd %d %d %d\n", m_yuvsurf->pitches[0], m_yuvsurf->pitches[1], m_yuvsurf->pitches[2]);
- printf("abcd %p %p %p\n", m_yuvsurf->pixels[0], m_yuvsurf->pixels[1], m_yuvsurf->pixels[2]);
- printf("abcd %ld %ld\n", m_yuvsurf->pixels[1] - m_yuvsurf->pixels[0], m_yuvsurf->pixels[2] - m_yuvsurf->pixels[1]);
-#endif
- }
- else
- surfptr = (UINT8 *)window().sdl_surface()->pixels;
-#else
- //SDL_SelectRenderer(window().sdl_window);
-
{
Uint32 format;
@@ -661,14 +342,13 @@ int sdl_info::draw(int update)
{
/* SDL Underlays need alpha = 0 ! */
SDL_SetRenderDrawColor(m_sdl_renderer,0,0,0,0);
- SDL_RenderFillRect(m_sdl_renderer,NULL);
- //SDL_RenderFill(0,0,0,0 /*255*/,NULL);
+ SDL_RenderFillRect(m_sdl_renderer,nullptr);
+ //SDL_RenderFill(0,0,0,0 /*255*/,nullptr);
m_blittimer--;
}
- SDL_LockTexture(m_texture_id, NULL, (void **) &surfptr, &pitch);
+ SDL_LockTexture(m_texture_id, nullptr, (void **) &surfptr, &pitch);
-#endif
// get ready to center the image
vofs = hofs = 0;
blitwidth = m_blit_dim.width();
@@ -703,25 +383,11 @@ int sdl_info::draw(int update)
int mamewidth, mameheight;
-#if !SDLMAME_SDL2
- if (!sm->is_yuv)
- {
- surfptr += ((vofs * pitch) + (hofs * bpp));
- mamewidth = blitwidth; //sdl_surface()->w;
- mameheight = blitheight; //sdl_surface()->h;
- }
- else
- {
- mamewidth = m_yuvsurf->w / sm->mult_w;
- mameheight = m_yuvsurf->h / sm->mult_h;
- }
-#else
Uint32 fmt = 0;
int access = 0;
SDL_QueryTexture(m_texture_id, &fmt, &access, &mamewidth, &mameheight);
mamewidth /= sm->mult_w;
mameheight /= sm->mult_h;
-#endif
//printf("w h %d %d %d %d\n", mamewidth, mameheight, blitwidth, blitheight);
// rescale bounds
@@ -731,7 +397,7 @@ int sdl_info::draw(int update)
// FIXME: this could be a lot easier if we get the primlist here!
// Bounds would be set fit for purpose and done!
- for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next())
+ for (render_primitive *prim = window().m_primlist->first(); prim != nullptr; prim = prim->next())
{
prim->bounds.x0 = floor(fw * prim->bounds.x0 + 0.5f);
prim->bounds.x1 = floor(fw * prim->bounds.x1 + 0.5f);
@@ -771,8 +437,8 @@ int sdl_info::draw(int update)
}
else
{
- assert (m_yuv_bitmap != NULL);
- assert (surfptr != NULL);
+ assert (m_yuv_bitmap != nullptr);
+ assert (surfptr != nullptr);
software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window().m_primlist, m_yuv_bitmap, mamewidth, mameheight, mamewidth);
sm->yuv_blit((UINT16 *)m_yuv_bitmap, surfptr, pitch, m_yuv_lookup, mamewidth, mameheight);
}
@@ -780,24 +446,6 @@ int sdl_info::draw(int update)
window().m_primlist->release_lock();
// unlock and flip
-#if (!SDLMAME_SDL2)
- if (SDL_MUSTLOCK(window().sdl_surface())) SDL_UnlockSurface(window().sdl_surface());
- if (!sm->is_yuv)
- {
- SDL_Flip(window().sdl_surface());
- }
- else
- {
- SDL_Rect r;
-
- SDL_UnlockYUVOverlay(m_yuvsurf);
- r.x = hofs;
- r.y = vofs;
- r.w = blitwidth;
- r.h = blitheight;
- SDL_DisplayYUVOverlay(m_yuvsurf, &r);
- }
-#else
SDL_UnlockTexture(m_texture_id);
{
SDL_Rect r;
@@ -807,11 +455,10 @@ int sdl_info::draw(int update)
r.w=blitwidth;
r.h=blitheight;
//printf("blitwidth %d %d - %d %d\n", blitwidth, blitheight, window().width, window().height);
- //SDL_UpdateTexture(sdltex, NULL, sdlsurf->pixels, pitch);
- SDL_RenderCopy(m_sdl_renderer,m_texture_id, NULL, &r);
+ //SDL_UpdateTexture(sdltex, nullptr, sdlsurf->pixels, pitch);
+ SDL_RenderCopy(m_sdl_renderer,m_texture_id, nullptr, &r);
SDL_RenderPresent(m_sdl_renderer);
}
-#endif
return 0;
}
//============================================================
@@ -855,7 +502,7 @@ int sdl_info::draw(int update)
#define YMASK (Y1MASK|Y2MASK)
#define UVMASK (UMASK|VMASK)
-void sdl_info::yuv_lookup_set(unsigned int pen, unsigned char red,
+void renderer_sdl2::yuv_lookup_set(unsigned int pen, unsigned char red,
unsigned char green, unsigned char blue)
{
UINT32 y,u,v;
@@ -867,10 +514,10 @@ void sdl_info::yuv_lookup_set(unsigned int pen, unsigned char red,
m_yuv_lookup[pen]=(y<<Y1SHIFT)|(u<<USHIFT)|(y<<Y2SHIFT)|(v<<VSHIFT);
}
-void sdl_info::yuv_init()
+void renderer_sdl2::yuv_init()
{
unsigned char r,g,b;
- if (m_yuv_lookup == NULL)
+ if (m_yuv_lookup == nullptr)
m_yuv_lookup = global_alloc_array(UINT32, 65536);
for (r = 0; r < 32; r++)
for (g = 0; g < 32; g++)
@@ -950,12 +597,7 @@ static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch,
pixels[0] = ptr;
pixels[1] = ptr + pitch * height * 2;
-#if (SDLMAME_SDL2)
int p2 = (pitch >> 1);
-#else
- int p2 = (pitch + 7) & ~ 7;;
- p2 = (p2 >> 1);
-#endif
pixels[2] = pixels[1] + p2 * height;
for(y=0;y<height;y++)
@@ -1027,3 +669,15 @@ static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch,
}
}
}
+
+render_primitive_list *renderer_sdl2::get_primitives()
+{
+ osd_dim nd = window().blit_surface_size();
+ if (nd != m_blit_dim)
+ {
+ m_blit_dim = nd;
+ notify_changed();
+ }
+ window().target()->set_bounds(m_blit_dim.width(), m_blit_dim.height(), window().aspect());
+ return &window().target()->get_primitives();
+}
diff --git a/src/osd/modules/render/drawsdl.h b/src/osd/modules/render/drawsdl.h
new file mode 100644
index 00000000000..28ddd7ebc36
--- /dev/null
+++ b/src/osd/modules/render/drawsdl.h
@@ -0,0 +1,85 @@
+// license:BSD-3-Clause
+// copyright-holders:Couriersud, Olivier Galibert, R. Belmont
+//============================================================
+//
+// drawsdl.h - SDL software and OpenGL implementation
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+// yuvmodes by Couriersud
+//
+//============================================================
+
+#pragma once
+
+#ifndef __DRAWSDL2__
+#define __DRAWSDL2__
+
+/* renderer_sdl2 is the information about SDL for the current screen */
+class renderer_sdl2 : public osd_renderer
+{
+public:
+
+ renderer_sdl2(osd_window *w, int extra_flags)
+ : osd_renderer(w, extra_flags)
+ , m_sdl_renderer(nullptr)
+ , m_texture_id(nullptr)
+ , m_yuv_lookup(nullptr)
+ , m_yuv_bitmap(nullptr)
+ //, m_hw_scale_width(0)
+ //, m_hw_scale_height(0)
+ , m_last_hofs(0)
+ , m_last_vofs(0)
+ , m_blit_dim(0, 0)
+ , m_last_dim(0, 0)
+ {
+ }
+ virtual ~renderer_sdl2();
+
+ virtual int create() override;
+ virtual int draw(const int update) override;
+ virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) override;
+ virtual render_primitive_list *get_primitives() override;
+
+ static bool init(running_machine &machine);
+
+private:
+ void show_info(struct SDL_RendererInfo *render_info);
+
+ void destroy_all_textures();
+ void yuv_init();
+ void setup_texture(const osd_dim &size);
+ void yuv_lookup_set(unsigned int pen, unsigned char red,
+ unsigned char green, unsigned char blue);
+
+ INT32 m_blittimer;
+
+ SDL_Renderer *m_sdl_renderer;
+ SDL_Texture *m_texture_id;
+
+ // YUV overlay
+ UINT32 *m_yuv_lookup;
+ UINT16 *m_yuv_bitmap;
+
+ // if we leave scaling to SDL and the underlying driver, this
+ // is the render_target_width/height to use
+
+ int m_last_hofs;
+ int m_last_vofs;
+ osd_dim m_blit_dim;
+ osd_dim m_last_dim;
+};
+
+struct sdl_scale_mode
+{
+ const char *name;
+ int is_scale; /* Scale mode? */
+ int is_yuv; /* Yuv mode? */
+ int mult_w; /* Width multiplier */
+ int mult_h; /* Height multiplier */
+ const char *sdl_scale_mode_hint; /* what to use as a hint ? */
+ int pixel_format; /* Pixel/Overlay format */
+ void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height);
+};
+
+#endif // __DRAWSDL2__ \ No newline at end of file
diff --git a/src/osd/modules/render/sdlglcontext.h b/src/osd/modules/render/sdlglcontext.h
new file mode 100644
index 00000000000..27c0bbe68a6
--- /dev/null
+++ b/src/osd/modules/render/sdlglcontext.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+//============================================================
+//
+// sdlglcontext.h - SDL-specific GL context
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+//============================================================
+
+#pragma once
+
+#ifndef __SDL_GL_CONTEXT__
+#define __SDL_GL_CONTEXT__
+
+#include "modules/opengl/osd_opengl.h"
+
+class sdl_gl_context : public osd_gl_context
+{
+public:
+ sdl_gl_context(SDL_Window *window) : osd_gl_context(), m_context(0), m_window(window)
+ {
+ m_error[0] = 0;
+ m_context = SDL_GL_CreateContext(window);
+ if (!m_context)
+ {
+ snprintf(m_error,255, "OpenGL not supported on this driver: %s", SDL_GetError());
+ }
+ }
+ virtual ~sdl_gl_context()
+ {
+ SDL_GL_DeleteContext(m_context);
+ }
+ virtual void MakeCurrent() override
+ {
+ SDL_GL_MakeCurrent(m_window, m_context);
+ }
+
+ virtual int SetSwapInterval(const int swap) override
+ {
+ return SDL_GL_SetSwapInterval(swap);
+ }
+
+ virtual const char *LastErrorMsg() override
+ {
+ if (m_error[0] == 0)
+ return NULL;
+ else
+ return m_error;
+ }
+ virtual void *getProcAddress(const char *proc) override
+ {
+ return SDL_GL_GetProcAddress(proc);
+ }
+
+ virtual void SwapBuffer() override
+ {
+ SDL_GL_SwapWindow(m_window);
+ }
+
+private:
+ SDL_GLContext m_context;
+ SDL_Window *m_window;
+ char m_error[256];
+};
+
+#endif // __SDL_GL_CONTEXT__ \ No newline at end of file
diff --git a/src/osd/modules/render/winglcontext.h b/src/osd/modules/render/winglcontext.h
new file mode 100644
index 00000000000..44a30888fa5
--- /dev/null
+++ b/src/osd/modules/render/winglcontext.h
@@ -0,0 +1,170 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert, R. Belmont
+//============================================================
+//
+// winglcontext.h - Windows-specific GL context
+//
+// SDLMAME by Olivier Galibert and R. Belmont
+//
+//============================================================
+
+#pragma once
+
+#ifndef __WIN_GL_CONTEXT__
+#define __WIN_GL_CONTEXT__
+
+#include "modules/opengl/osd_opengl.h"
+
+class win_gl_context : public osd_gl_context
+{
+public:
+ win_gl_context(HWND window) : osd_gl_context(), m_context(0), m_window(NULL), m_hdc(0)
+ {
+ m_error[0] = 0;
+
+ this->pfn_wglGetProcAddress = (PROC (WINAPI *)(LPCSTR lpszProc)) GetProcAddress(m_module, "wglGetProcAddress");
+ this->pfn_wglCreateContext = (HGLRC (WINAPI *)(HDC hdc)) GetProcAddress(m_module, "wglCreateContext");
+ this->pfn_wglDeleteContext = (BOOL (WINAPI *)(HGLRC hglrc)) GetProcAddress(m_module, "wglDeleteContext");
+ this->pfn_wglMakeCurrent = (BOOL (WINAPI *)(HDC hdc, HGLRC hglrc)) GetProcAddress(m_module, "wglMakeCurrent");
+
+ this->pfn_wglGetExtensionsStringEXT = (const char *(WINAPI *) (void)) pfn_wglGetProcAddress("wglGetExtensionsStringEXT");
+
+ if (WGLExtensionSupported("WGL_EXT_swap_control"))
+ {
+ this->pfn_wglSwapIntervalEXT = (BOOL (WINAPI *) (int)) getProcAddress("wglSwapIntervalEXT");
+ this->pfn_wglGetSwapIntervalEXT = (int (WINAPI *) (void)) getProcAddress("wglGetSwapIntervalEXT");
+ }
+ else
+ {
+ pfn_wglSwapIntervalEXT = NULL;
+ pfn_wglGetSwapIntervalEXT = NULL;
+ }
+
+ m_hdc = GetDC(window);
+ if (!setupPixelFormat(m_hdc))
+ {
+ m_context = this->pfn_wglCreateContext(m_hdc);
+ if (!m_context)
+ {
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), 0, m_error, 255, NULL);
+ return;
+ }
+ this->pfn_wglMakeCurrent(m_hdc, m_context);
+ }
+ }
+
+ virtual ~win_gl_context()
+ {
+ this->pfn_wglDeleteContext(m_context);
+ ReleaseDC(m_window, m_hdc);
+ }
+
+ virtual void MakeCurrent() override
+ {
+ this->pfn_wglMakeCurrent(m_hdc, m_context);
+ }
+
+ virtual const char *LastErrorMsg() override
+ {
+ if (m_error[0] == 0)
+ return NULL;
+ else
+ return m_error;
+ }
+
+ virtual void *getProcAddress(const char *proc) override
+ {
+ void *ret = (void *) GetProcAddress(m_module, proc);
+ if (ret == NULL)
+ ret = (void *) this->pfn_wglGetProcAddress(proc);
+ return ret;
+ }
+
+ virtual int SetSwapInterval(const int swap) override
+ {
+ if (this->pfn_wglSwapIntervalEXT != NULL)
+ {
+ this->pfn_wglSwapIntervalEXT(swap ? 1 : 0);
+ }
+ return 0;
+ }
+
+ virtual void SwapBuffer() override
+ {
+ SwapBuffers(m_hdc);
+ //wglSwapLayerBuffers(GetDC(window().m_hwnd), WGL_SWAP_MAIN_PLANE);
+ }
+
+ static void load_library()
+ {
+ m_module = LoadLibraryA("opengl32.dll");
+ }
+
+private:
+
+ int setupPixelFormat(HDC hDC)
+ {
+ PIXELFORMATDESCRIPTOR pfd = {
+ sizeof(PIXELFORMATDESCRIPTOR), /* size */
+ 1, /* version */
+ PFD_SUPPORT_OPENGL |
+ PFD_DRAW_TO_WINDOW |
+ PFD_DOUBLEBUFFER, /* support double-buffering */
+ PFD_TYPE_RGBA, /* color type */
+ 32, /* prefered color depth */
+ 0, 0, 0, 0, 0, 0, /* color bits (ignored) */
+ 0, /* no alpha buffer */
+ 0, /* alpha bits (ignored) */
+ 0, /* no accumulation buffer */
+ 0, 0, 0, 0, /* accum bits (ignored) */
+ 16, /* depth buffer */
+ 0, /* no stencil buffer */
+ 0, /* no auxiliary buffers */
+ PFD_MAIN_PLANE, /* main layer */
+ 0, /* reserved */
+ 0, 0, 0, /* no layer, visible, damage masks */
+ };
+ int pixelFormat;
+
+ pixelFormat = ChoosePixelFormat(hDC, &pfd);
+ if (pixelFormat == 0) {
+ strcpy(m_error, "ChoosePixelFormat failed");
+ return 1;
+ }
+
+ if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) {
+ strcpy(m_error, "SetPixelFormat failed.");
+ return 1;
+ }
+ return 0;
+ }
+
+ bool WGLExtensionSupported(const char *extension_name)
+ {
+ //if (pfn_wglGetExtensionsStringEXT != NULL)
+ // printf("%s\n", this->pfn_wglGetExtensionsStringEXT());
+
+ if (pfn_wglGetExtensionsStringEXT != NULL && strstr(pfn_wglGetExtensionsStringEXT(), extension_name) != NULL)
+ return true;
+ else
+ return false;
+ }
+
+ HGLRC m_context;
+ HWND m_window;
+ HDC m_hdc;
+ char m_error[256];
+
+ PROC (WINAPI *pfn_wglGetProcAddress)(LPCSTR lpszProc);
+ HGLRC (WINAPI *pfn_wglCreateContext)(HDC hdc);
+ BOOL (WINAPI *pfn_wglDeleteContext)(HGLRC hglrc);
+ BOOL (WINAPI *pfn_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
+
+ const char *(WINAPI *pfn_wglGetExtensionsStringEXT) (void);
+ BOOL (WINAPI *pfn_wglSwapIntervalEXT) (int interval);
+ int (WINAPI * pfn_wglGetSwapIntervalEXT) (void);
+
+ static HMODULE m_module;
+};
+
+#endif // __WIN_GL_CONTEXT__ \ No newline at end of file
diff --git a/src/osd/modules/sound/direct_sound.cpp b/src/osd/modules/sound/direct_sound.cpp
index 78996093e77..0ec810578a3 100644
--- a/src/osd/modules/sound/direct_sound.cpp
+++ b/src/osd/modules/sound/direct_sound.cpp
@@ -28,11 +28,7 @@
#ifdef SDLMAME_WIN32
#include "../../sdl/osdsdl.h"
-#if (SDLMAME_SDL2)
#include <SDL2/SDL_syswm.h>
-#else
-#include <SDL/SDL_syswm.h>
-#endif
#include "../../sdl/window.h"
#else
#include "winmain.h"
@@ -408,13 +404,8 @@ HRESULT sound_direct_sound::dsound_init()
#ifdef SDLMAME_WIN32
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version);
-#if SDLMAME_SDL2
SDL_GetWindowWMInfo(sdl_window_list->sdl_window(), &wminfo);
HWND const window = wminfo.info.win.window;
-#else // SDLMAME_SDL2
- SDL_GetWMInfo(&wminfo);
- HWND const window = wminfo.window;
-#endif // SDLMAME_SDL2
#else // SDLMAME_WIN32
HWND const window = win_window_list->m_hwnd;
#endif // SDLMAME_WIN32
diff --git a/src/osd/modules/sound/js_sound.js b/src/osd/modules/sound/js_sound.js
index b06cbb44365..90756018a05 100644
--- a/src/osd/modules/sound/js_sound.js
+++ b/src/osd/modules/sound/js_sound.js
@@ -185,18 +185,18 @@ function get_context() {
};
function sample_count() {
- //TODO get someone to call this from the emulator,
- //so the emulator can do proper audio buffering by
- //knowing how many samples are left:
- if (!context) {
- //Use impossible value as an error code:
- return -1;
- }
- var count = rear - start;
- if (start > rear) {
- count += bufferSize;
- }
- return count;
+ //TODO get someone to call this from the emulator,
+ //so the emulator can do proper audio buffering by
+ //knowing how many samples are left:
+ if (!context) {
+ //Use impossible value as an error code:
+ return -1;
+ }
+ var count = rear - start;
+ if (start > rear) {
+ count += bufferSize;
+ }
+ return count;
}
return {
diff --git a/src/osd/modules/sound/sdl_sound.cpp b/src/osd/modules/sound/sdl_sound.cpp
index de8d57af11c..c1e3e3dff2b 100644
--- a/src/osd/modules/sound/sdl_sound.cpp
+++ b/src/osd/modules/sound/sdl_sound.cpp
@@ -421,11 +421,7 @@ int sound_sdl::init(const osd_options &options)
}
osd_printf_verbose("Audio: Start initialization\n");
- #if (SDLMAME_SDL2)
strncpy(audio_driver, SDL_GetCurrentAudioDriver(), sizeof(audio_driver));
- #else
- SDL_AudioDriverName(audio_driver, sizeof(audio_driver));
- #endif
osd_printf_verbose("Audio: Driver is %s\n", audio_driver);
sdl_xfer_samples = SDL_XFER_SAMPLES;
diff --git a/src/osd/modules/sync/sync_sdl.cpp b/src/osd/modules/sync/sync_sdl.cpp
index 8a525723a45..73b735fefb3 100644
--- a/src/osd/modules/sync/sync_sdl.cpp
+++ b/src/osd/modules/sync/sync_sdl.cpp
@@ -191,11 +191,7 @@ osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam)
return NULL;
thread->callback = callback;
thread->param = cbparam;
-#ifdef SDLMAME_SDL2
thread->thread = SDL_CreateThread(worker_thread_entry, "Thread", thread);
-#else
- thread->thread = SDL_CreateThread(worker_thread_entry, thread);
-#endif
if ( thread->thread == NULL )
{
free(thread);
diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h
index 5b57f55881c..3e5b7d91e8f 100644
--- a/src/osd/osdepend.h
+++ b/src/osd/osdepend.h
@@ -41,6 +41,8 @@ public:
// ======================> osd_interface
+struct slider_state;
+
// description of the currently-running machine
class osd_interface
{
@@ -63,7 +65,7 @@ public:
virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) = 0;
// video overridables
- virtual void *get_slider_list() = 0; // FIXME: returns slider_state *
+ virtual slider_state *get_slider_list() = 0;
// font interface
virtual osd_font *font_alloc() = 0;
diff --git a/src/osd/sdl/SDLMain_tmpl.h b/src/osd/sdl/SDLMain_tmpl.h
deleted file mode 100644
index c5ad2a346dd..00000000000
--- a/src/osd/sdl/SDLMain_tmpl.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// license:Zlib|LGPL-2.1+
-// copyright-holders:http://libsdl.org/
-/* SDLMain.m - main entry point for our Cocoa-ized SDL app
- Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
- Non-NIB-Code & other changes: Max Horn <max@quendi.de>
-
- Feel free to customize this file to suit your needs
-*/
-
-#import <Cocoa/Cocoa.h>
-
-@interface SDLMain : NSObject
-@end
diff --git a/src/osd/sdl/SDLMain_tmpl.mm b/src/osd/sdl/SDLMain_tmpl.mm
deleted file mode 100644
index 78b5d7f4937..00000000000
--- a/src/osd/sdl/SDLMain_tmpl.mm
+++ /dev/null
@@ -1,386 +0,0 @@
-// license:Zlib|LGPL-2.1+
-// copyright-holders:http://libsdl.org/
-/* SDLMain.m - main entry point for our Cocoa-ized SDL app
- Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
- Non-NIB-Code & other changes: Max Horn <max@quendi.de>
-
- Feel free to customize this file to suit your needs
-*/
-
-#import "sdlinc.h"
-#import "SDLMain_tmpl.h"
-#import <sys/param.h> /* for MAXPATHLEN */
-#import <unistd.h>
-
-/* For some reason, Apple removed setAppleMenu from the headers in 10.4,
- but the method still is there and works. To avoid warnings, we declare
- it ourselves here. */
-@interface NSApplication(SDL_Missing_Methods)
-- (void)setAppleMenu:(NSMenu *)menu;
-@end
-
-/* Use this flag to determine whether we use SDLMain.nib or not */
-#define SDL_USE_NIB_FILE 0
-
-/* Use this flag to determine whether we use CPS (docking) or not */
-#define SDL_USE_CPS 0
-#ifdef SDL_USE_CPS
-/* Portions of CPS.h */
-typedef struct CPSProcessSerNum
-{
- UInt32 lo;
- UInt32 hi;
-} CPSProcessSerNum;
-
-extern "C" OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
-extern "C" OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
-extern "C" OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
-
-#endif /* SDL_USE_CPS */
-
-static int gArgc;
-static char **gArgv;
-static BOOL gFinderLaunch;
-static BOOL gCalledAppMainline = FALSE;
-
-static NSString *getApplicationName(void)
-{
- NSDictionary *dict;
- NSString *appName = 0;
-
- /* Determine the application name */
- dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
- if (dict)
- appName = [dict objectForKey: @"CFBundleName"];
-
- if (![appName length])
- appName = [[NSProcessInfo processInfo] processName];
-
- return appName;
-}
-
-#if SDL_USE_NIB_FILE
-/* A helper category for NSString */
-@interface NSString (ReplaceSubString)
-- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
-@end
-#endif
-
-@interface SDLApplication : NSApplication
-@end
-
-@implementation SDLApplication
-/* Invoked from the Quit menu item */
-- (void)terminate:(id)sender
-{
- /* Post a SDL_QUIT event */
- SDL_Event event;
- event.type = SDL_QUIT;
- SDL_PushEvent(&event);
-}
-@end
-
-/* The main class of the application, the application's delegate */
-@implementation SDLMain
-
-/* Set the working directory to the .app's parent directory */
-- (void) setupWorkingDirectory:(BOOL)shouldChdir
-{
- if (shouldChdir)
- {
- char parentdir[MAXPATHLEN];
- CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
- CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
- if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) {
- assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
- }
- CFRelease(url);
- CFRelease(url2);
- }
-
-}
-
-#if SDL_USE_NIB_FILE
-
-/* Fix menu to contain the real app name instead of "SDL App" */
-- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
-{
- NSRange aRange;
- NSEnumerator *enumerator;
- NSMenuItem *menuItem;
-
- aRange = [[aMenu title] rangeOfString:@"SDL App"];
- if (aRange.length != 0)
- [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
-
- enumerator = [[aMenu itemArray] objectEnumerator];
- while ((menuItem = [enumerator nextObject]))
- {
- aRange = [[menuItem title] rangeOfString:@"SDL App"];
- if (aRange.length != 0)
- [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
- if ([menuItem hasSubmenu])
- [self fixMenu:[menuItem submenu] withAppName:appName];
- }
- [ aMenu sizeToFit ];
-}
-
-#else
-
-static void setApplicationMenu(void)
-{
- /* warning: this code is very odd */
- NSMenu *appleMenu;
- NSMenuItem *menuItem;
- NSString *title;
- NSString *appName;
-
- appName = getApplicationName();
- appleMenu = [[NSMenu alloc] initWithTitle:@""];
-
- /* Add menu items */
- title = [@"About " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
-
- [appleMenu addItem:[NSMenuItem separatorItem]];
-
- title = [@"Hide " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
-
- menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
- [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
-
- [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
-
- [appleMenu addItem:[NSMenuItem separatorItem]];
-
- title = [@"Quit " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
-
-
- /* Put menu into the menubar */
- menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
- [menuItem setSubmenu:appleMenu];
- [[NSApp mainMenu] addItem:menuItem];
-
- /* Tell the application object that this is now the application menu */
- [NSApp setAppleMenu:appleMenu];
-
- /* Finally give up our references to the objects */
- [appleMenu release];
- [menuItem release];
-}
-
-/* Create a window menu */
-static void setupWindowMenu(void)
-{
- NSMenu *windowMenu;
- NSMenuItem *windowMenuItem;
- NSMenuItem *menuItem;
-
- windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
-
- /* "Minimize" item */
- menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
- [windowMenu addItem:menuItem];
- [menuItem release];
-
- /* Put menu into the menubar */
- windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
- [windowMenuItem setSubmenu:windowMenu];
- [[NSApp mainMenu] addItem:windowMenuItem];
-
- /* Tell the application object that this is now the window menu */
- [NSApp setWindowsMenu:windowMenu];
-
- /* Finally give up our references to the objects */
- [windowMenu release];
- [windowMenuItem release];
-}
-
-/* Replacement for NSApplicationMain */
-static void CustomApplicationMain (int argc, char **argv)
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- SDLMain *sdlMain;
-
- /* Ensure the application object is initialised */
- [SDLApplication sharedApplication];
-
-#ifdef SDL_USE_CPS
- {
- CPSProcessSerNum PSN;
- /* Tell the dock about us */
- if (!CPSGetCurrentProcess(&PSN))
- if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
- if (!CPSSetFrontProcess(&PSN))
- [SDLApplication sharedApplication];
- }
-#endif /* SDL_USE_CPS */
-
- /* Set up the menubar */
- [NSApp setMainMenu:[[NSMenu alloc] init]];
- setApplicationMenu();
- setupWindowMenu();
-
- /* Create SDLMain and make it the app delegate */
- sdlMain = [[SDLMain alloc] init];
- [NSApp setDelegate:sdlMain];
-
- /* Start the main event loop */
- [NSApp run];
-
- [sdlMain release];
- [pool release];
-}
-
-#endif
-
-
-/*
- * Catch document open requests...this lets us notice files when the app
- * was launched by double-clicking a document, or when a document was
- * dragged/dropped on the app's icon. You need to have a
- * CFBundleDocumentsType section in your Info.plist to get this message,
- * apparently.
- *
- * Files are added to gArgv, so to the app, they'll look like command line
- * arguments. Previously, apps launched from the finder had nothing but
- * an argv[0].
- *
- * This message may be received multiple times to open several docs on launch.
- *
- * This message is ignored once the app's mainline has been called.
- */
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
-{
- const char *temparg;
- size_t arglen;
- char *arg;
- char **newargv;
-
- if (!gFinderLaunch) /* MacOS is passing command line args. */
- return FALSE;
-
- if (gCalledAppMainline) /* app has started, ignore this document. */
- return FALSE;
-
- temparg = [filename UTF8String];
- arglen = SDL_strlen(temparg) + 1;
- arg = (char *) SDL_malloc(arglen);
- if (arg == NULL)
- return FALSE;
-
- newargv = (char **) SDL_realloc(gArgv, sizeof (char *) * (gArgc + 2));
- if (newargv == NULL)
- {
- SDL_free(arg);
- return FALSE;
- }
- gArgv = newargv;
-
- SDL_strlcpy(arg, temparg, arglen);
- gArgv[gArgc++] = arg;
- gArgv[gArgc] = NULL;
- return TRUE;
-}
-
-
-/* Called when the internal event loop has just started running */
-- (void) applicationDidFinishLaunching: (NSNotification *) note
-{
- int status;
-
- /* Set the working directory to the .app's parent directory */
- [self setupWorkingDirectory:gFinderLaunch];
-
-#if SDL_USE_NIB_FILE
- /* Set the main menu to contain the real app name instead of "SDL App" */
- [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
-#endif
-
- /* Hand off to main application code */
- gCalledAppMainline = TRUE;
- status = SDL_main (gArgc, gArgv);
-
- /* We're done, thank you for playing */
- exit(status);
-}
-@end
-
-
-@implementation NSString (ReplaceSubString)
-
-- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
-{
- unsigned int bufferSize;
- unsigned int selfLen = [self length];
- unsigned int aStringLen = [aString length];
- unichar *buffer;
- NSRange localRange;
- NSString *result;
-
- bufferSize = selfLen + aStringLen - aRange.length;
- buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
-
- /* Get first part into buffer */
- localRange.location = 0;
- localRange.length = aRange.location;
- [self getCharacters:buffer range:localRange];
-
- /* Get middle part into buffer */
- localRange.location = 0;
- localRange.length = aStringLen;
- [aString getCharacters:(buffer+aRange.location) range:localRange];
-
- /* Get last part into buffer */
- localRange.location = aRange.location + aRange.length;
- localRange.length = selfLen - localRange.location;
- [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
-
- /* Build output string */
- result = [NSString stringWithCharacters:buffer length:bufferSize];
-
- NSDeallocateMemoryPages(buffer, bufferSize);
-
- return result;
-}
-
-@end
-
-
-
-#ifdef main
-# undef main
-#endif
-
-
-/* Main entry point to executable - should *not* be SDL_main! */
-int main (int argc, char **argv)
-{
- /* Copy the arguments into a global variable */
- /* This is passed if we are launched by double-clicking */
- if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
- gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
- gArgv[0] = argv[0];
- gArgv[1] = NULL;
- gArgc = 1;
- gFinderLaunch = YES;
- } else {
- int i;
- gArgc = argc;
- gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
- for (i = 0; i <= argc; i++)
- gArgv[i] = argv[i];
- gFinderLaunch = NO;
- }
-
-#if SDL_USE_NIB_FILE
- [SDLApplication poseAsClass:[NSApplication class]];
- NSApplicationMain (argc, argv);
-#else
- CustomApplicationMain (argc, argv);
-#endif
- return 0;
-}
-
diff --git a/src/osd/sdl/input.cpp b/src/osd/sdl/input.cpp
index a050cbf024b..9cfcdb1cf16 100644
--- a/src/osd/sdl/input.cpp
+++ b/src/osd/sdl/input.cpp
@@ -235,7 +235,6 @@ struct kt_table {
char * ui_name;
};
-#if (SDLMAME_SDL2)
#define OSD_SDL_INDEX(x) (x)
#define OSD_SDL_INDEX_KEYSYM(keysym) ((keysym)->scancode)
@@ -365,132 +364,6 @@ static kt_table sdl_key_trans_table[] =
KTT_ENTRY0( BACKSLASH2, NONUSBACKSLASH, 0xdc, '\\', "BACKSLASH2" ),
{ ITEM_ID_INVALID }
};
-#else
-
-#define OSD_SDL_INDEX(x) (SDLK_INDEX(x)-SDLK_FIRST)
-#define OSD_SDL_INDEX_KEYSYM(keysym) (OSD_SDL_INDEX((keysym)->sym))
-#define GET_WINDOW(ev) sdl_window_list
-#define GET_FOCUS_WINDOW(ev) sdl_window_list
-
-#define KTT_ENTRY0(MAME, SDL, VK, AS, UI) { ITEM_ID_ ## MAME, SDLK_ ## SDL, "ITEM_ID_" #MAME, (char *) UI }
-#define KTT_ENTRY1(MAME, SDL) KTT_ENTRY0(MAME, SDL, MAME, MAME, #MAME)
-// only for reference ...
-#define KTT_ENTRY2(MAME, SDL) KTT_ENTRY0(MAME, SDL, 0, 0, #MAME)
-
-
-static kt_table sdl_key_trans_table[] =
-{
- // MAME key SDL key vkey ascii
- KTT_ENTRY0( ESC, ESCAPE, 0x1b, 0x1b, "ESC" ),
- KTT_ENTRY1( 1, 1 ),
- KTT_ENTRY1( 2, 2 ),
- KTT_ENTRY1( 3, 3 ),
- KTT_ENTRY1( 4, 4 ),
- KTT_ENTRY1( 5, 5 ),
- KTT_ENTRY1( 6, 6 ),
- KTT_ENTRY1( 7, 7 ),
- KTT_ENTRY1( 8, 8 ),
- KTT_ENTRY1( 9, 9 ),
- KTT_ENTRY1( 0, 0 ),
- KTT_ENTRY0( MINUS, MINUS, 0xbd, '-', "MINUS" ),
- KTT_ENTRY0( EQUALS, EQUALS, 0xbb, '=', "EQUALS" ),
- KTT_ENTRY0( BACKSPACE, BACKSPACE, 0x08, 0x08, "BACKSPACE" ),
- KTT_ENTRY0( TAB, TAB, 0x09, 0x09, "TAB" ),
- KTT_ENTRY1( Q, q ),
- KTT_ENTRY1( W, w ),
- KTT_ENTRY1( E, e ),
- KTT_ENTRY1( R, r ),
- KTT_ENTRY1( T, t ),
- KTT_ENTRY1( Y, y ),
- KTT_ENTRY1( U, u ),
- KTT_ENTRY1( I, i ),
- KTT_ENTRY1( O, o ),
- KTT_ENTRY1( P, p ),
- KTT_ENTRY0( OPENBRACE, LEFTBRACKET, 0xdb, '[', "OPENBRACE" ),
- KTT_ENTRY0( CLOSEBRACE,RIGHTBRACKET, 0xdd, ']', "CLOSEBRACE" ),
- KTT_ENTRY0( ENTER, RETURN, 0x0d, 0x0d, "RETURN" ),
- KTT_ENTRY2( LCONTROL, LCTRL ),
- KTT_ENTRY1( A, a ),
- KTT_ENTRY1( S, s ),
- KTT_ENTRY1( D, d ),
- KTT_ENTRY1( F, f ),
- KTT_ENTRY1( G, g ),
- KTT_ENTRY1( H, h ),
- KTT_ENTRY1( J, j ),
- KTT_ENTRY1( K, k ),
- KTT_ENTRY1( L, l ),
- KTT_ENTRY0( COLON, SEMICOLON, 0xba, ';', "COLON" ),
- KTT_ENTRY0( QUOTE, QUOTE, 0xde, '\'', "QUOTE" ),
- KTT_ENTRY2( LSHIFT, LSHIFT ),
- KTT_ENTRY0( BACKSLASH, BACKSLASH, 0xdc, '\\', "BACKSLASH" ),
- KTT_ENTRY1( Z, z ),
- KTT_ENTRY1( X, x ),
- KTT_ENTRY1( C, c ),
- KTT_ENTRY1( V, v ),
- KTT_ENTRY1( B, b ),
- KTT_ENTRY1( N, n ),
- KTT_ENTRY1( M, m ),
- KTT_ENTRY0( COMMA, COMMA, 0xbc, ',', "COMMA" ),
- KTT_ENTRY0( STOP, PERIOD, 0xbe, '.', "STOP" ),
- KTT_ENTRY0( SLASH, SLASH, 0xbf, '/', "SLASH" ),
- KTT_ENTRY2( RSHIFT, RSHIFT ),
- KTT_ENTRY0( ASTERISK, KP_MULTIPLY, '*', '*', "ASTERIX" ),
- KTT_ENTRY2( LALT, LALT ),
- KTT_ENTRY0( SPACE, SPACE, ' ', ' ', "SPACE" ),
- KTT_ENTRY2( CAPSLOCK, CAPSLOCK ),
- KTT_ENTRY2( F1, F1 ),
- KTT_ENTRY2( F2, F2 ),
- KTT_ENTRY2( F3, F3 ),
- KTT_ENTRY2( F4, F4 ),
- KTT_ENTRY2( F5, F5 ),
- KTT_ENTRY2( F6, F6 ),
- KTT_ENTRY2( F7, F7 ),
- KTT_ENTRY2( F8, F8 ),
- KTT_ENTRY2( F9, F9 ),
- KTT_ENTRY2( F10, F10 ),
- KTT_ENTRY2( NUMLOCK, NUMLOCK ),
- KTT_ENTRY2( SCRLOCK, SCROLLOCK ),
- KTT_ENTRY2( 7_PAD, KP7 ),
- KTT_ENTRY2( 8_PAD, KP8 ),
- KTT_ENTRY2( 9_PAD, KP9 ),
- KTT_ENTRY2( MINUS_PAD, KP_MINUS ),
- KTT_ENTRY2( 4_PAD, KP4 ),
- KTT_ENTRY2( 5_PAD, KP5 ),
- KTT_ENTRY2( 6_PAD, KP6 ),
- KTT_ENTRY2( PLUS_PAD, KP_PLUS ),
- KTT_ENTRY2( 1_PAD, KP1 ),
- KTT_ENTRY2( 2_PAD, KP2 ),
- KTT_ENTRY2( 3_PAD, KP3 ),
- KTT_ENTRY2( 0_PAD, KP0 ),
- KTT_ENTRY2( DEL_PAD, KP_PERIOD ),
- KTT_ENTRY2( F11, F11 ),
- KTT_ENTRY2( F12, F12 ),
- KTT_ENTRY2( F13, F13 ),
- KTT_ENTRY2( F14, F14 ),
- KTT_ENTRY2( F15, F15 ),
- KTT_ENTRY2( ENTER_PAD, KP_ENTER ),
- KTT_ENTRY2( RCONTROL, RCTRL ),
- KTT_ENTRY2( SLASH_PAD, KP_DIVIDE ),
- KTT_ENTRY2( PRTSCR, PRINT ),
- KTT_ENTRY2( RALT, RALT ),
- KTT_ENTRY2( HOME, HOME ),
- KTT_ENTRY2( UP, UP ),
- KTT_ENTRY2( PGUP, PAGEUP ),
- KTT_ENTRY2( LEFT, LEFT ),
- KTT_ENTRY2( RIGHT, RIGHT ),
- KTT_ENTRY2( END, END ),
- KTT_ENTRY2( DOWN, DOWN ),
- KTT_ENTRY2( PGDN, PAGEDOWN ),
- KTT_ENTRY2( INSERT, INSERT ),
- { ITEM_ID_DEL, SDLK_DELETE, "ITEM_ID_DEL", (char *)"DELETE" },
- KTT_ENTRY2( LWIN, LSUPER ),
- KTT_ENTRY2( RWIN, RSUPER ),
- KTT_ENTRY2( MENU, MENU ),
- KTT_ENTRY0( TILDE, BACKQUOTE, 0xc0, '`', "TILDE" ),
- KTT_ENTRY0( BACKSLASH2, HASH, 0xdc, '\\', "BACKSLASH2" ),
- { ITEM_ID_INVALID }
-};
-#endif
struct key_lookup_table
{
@@ -498,7 +371,6 @@ struct key_lookup_table
const char *name;
};
-#if (SDLMAME_SDL2)
#define KE(x) { SDL_SCANCODE_ ## x, "SDL_SCANCODE_" #x },
#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
#define KE7(A, B, C, D, E, F, G) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G)
@@ -527,46 +399,6 @@ static key_lookup_table sdl_lookup_table[] =
KE(UNDO)
{-1, ""}
};
-#else
-#define KE(x) { SDLK_ ## x, "SDLK_" #x },
-#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
-
-static key_lookup_table sdl_lookup_table[] =
-{
- KE8(UNKNOWN, FIRST, BACKSPACE, TAB, CLEAR, RETURN, PAUSE, ESCAPE )
- KE8(SPACE, EXCLAIM, QUOTEDBL, HASH, DOLLAR, AMPERSAND, QUOTE, LEFTPAREN )
- KE8(RIGHTPAREN, ASTERISK, PLUS, COMMA, MINUS, PERIOD, SLASH, 0 )
- KE8(1, 2, 3, 4, 5, 6, 7, 8 )
- KE8(9, COLON, SEMICOLON, LESS, EQUALS, GREATER, QUESTION, AT )
- KE8(LEFTBRACKET,BACKSLASH, RIGHTBRACKET, CARET, UNDERSCORE, BACKQUOTE, a, b )
- KE8(c, d, e, f, g, h, i, j )
- KE8(k, l, m, n, o, p, q, r )
- KE8(s, t, u, v, w, x, y, z )
- KE8(DELETE, WORLD_0, WORLD_1, WORLD_2, WORLD_3, WORLD_4, WORLD_5, WORLD_6 )
- KE8(WORLD_7, WORLD_8, WORLD_9, WORLD_10, WORLD_11, WORLD_12, WORLD_13, WORLD_14 )
- KE8(WORLD_15, WORLD_16, WORLD_17, WORLD_18, WORLD_19, WORLD_20, WORLD_21, WORLD_22 )
- KE8(WORLD_23, WORLD_24, WORLD_25, WORLD_26, WORLD_27, WORLD_28, WORLD_29, WORLD_30 )
- KE8(WORLD_31, WORLD_32, WORLD_33, WORLD_34, WORLD_35, WORLD_36, WORLD_37, WORLD_38 )
- KE8(WORLD_39, WORLD_40, WORLD_41, WORLD_42, WORLD_43, WORLD_44, WORLD_45, WORLD_46 )
- KE8(WORLD_47, WORLD_48, WORLD_49, WORLD_50, WORLD_51, WORLD_52, WORLD_53, WORLD_54 )
- KE8(WORLD_55, WORLD_56, WORLD_57, WORLD_58, WORLD_59, WORLD_60, WORLD_61, WORLD_62 )
- KE8(WORLD_63, WORLD_64, WORLD_65, WORLD_66, WORLD_67, WORLD_68, WORLD_69, WORLD_70 )
- KE8(WORLD_71, WORLD_72, WORLD_73, WORLD_74, WORLD_75, WORLD_76, WORLD_77, WORLD_78 )
- KE8(WORLD_79, WORLD_80, WORLD_81, WORLD_82, WORLD_83, WORLD_84, WORLD_85, WORLD_86 )
- KE8(WORLD_87, WORLD_88, WORLD_89, WORLD_90, WORLD_91, WORLD_92, WORLD_93, WORLD_94 )
- KE8(WORLD_95, KP0, KP1, KP2, KP3, KP4, KP5, KP6 )
- KE8(KP7, KP8, KP9, KP_PERIOD, KP_DIVIDE, KP_MULTIPLY,KP_MINUS, KP_PLUS )
- KE8(KP_ENTER, KP_EQUALS, UP, DOWN, RIGHT, LEFT, INSERT, HOME )
- KE8(END, PAGEUP, PAGEDOWN, F1, F2, F3, F4, F5 )
- KE8(F6, F7, F8, F9, F10, F11, F12, F13 )
- KE8(F14, F15, NUMLOCK, CAPSLOCK, SCROLLOCK, RSHIFT, LSHIFT, RCTRL )
- KE8(LCTRL, RALT, LALT, RMETA, LMETA, LSUPER, RSUPER, MODE )
- KE8(COMPOSE, HELP, PRINT, SYSREQ, BREAK, MENU, POWER, EURO )
- KE(UNDO)
- KE(LAST)
- {-1, ""}
-};
-#endif
//============================================================
// INLINE FUNCTIONS
@@ -718,14 +550,9 @@ static void sdlinput_register_joysticks(running_machine &machine)
{
char *joy_name;
-#if (SDLMAME_SDL2)
joy = SDL_JoystickOpen(physical_stick);
joy_name = remove_spaces(machine, SDL_JoystickName(joy));
SDL_JoystickClose(joy);
-#else
- joy_name = remove_spaces(machine, SDL_JoystickName(physical_stick));
-#endif
-
devmap_register(&joy_map, physical_stick, joy_name);
}
@@ -1241,7 +1068,7 @@ static kt_table * sdlinput_read_keymap(running_machine &machine)
{
sdl2section = 1;
}
- else if (((SDLMAME_SDL2) ^ sdl2section) == 0)
+ else if (((1) ^ sdl2section) == 0)
{
mks[0]=0;
sks[0]=0;
@@ -1518,7 +1345,6 @@ INT32 normalize_absolute_axis(INT32 raw, INT32 rawmin, INT32 rawmax)
// sdlinput_poll
//============================================================
-#if (SDLMAME_SDL2)
static inline sdl_window_info * window_from_id(Uint32 windowID)
{
sdl_window_info *w;
@@ -1554,8 +1380,6 @@ static inline void resize_all_windows(void)
}
}
-#endif
-
void sdlinput_process_events_buf()
{
SDL_Event event;
@@ -1563,10 +1387,8 @@ void sdlinput_process_events_buf()
if (SDLMAME_EVENTS_IN_WORKER_THREAD)
{
std::lock_guard<std::mutex> lock(input_lock);
- #if (SDLMAME_SDL2)
/* Make sure we get all pending events */
SDL_PumpEvents();
- #endif
while(SDL_PollEvent(&event))
{
if (event_buf_count < MAX_BUF_EVENTS)
@@ -1731,12 +1553,8 @@ void sdlinput_poll(running_machine &machine)
devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]);
#endif
devinfo->keyboard.state[OSD_SDL_INDEX_KEYSYM(&event.key.keysym)] = 0x80;
-#if (SDLMAME_SDL2)
if (event.key.keysym.sym < 0x20)
machine.ui_input().push_char_event(sdl_window_list->target(), event.key.keysym.sym);
-#else
- ui_input_push_char_event(machine, sdl_window_list->target(), (unicode_char) event.key.keysym.unicode);
-#endif
break;
case SDL_KEYUP:
#ifdef SDL2_MULTIAPI
@@ -1854,29 +1672,7 @@ void sdlinput_poll(running_machine &machine)
}
}
}
-#if (!SDLMAME_SDL2)
- else if (event.button.button == 4) // SDL_BUTTON_WHEELUP
- {
- int cx, cy;
- sdl_window_info *window = GET_FOCUS_WINDOW(&event.button);
- if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) )
- {
- machine.ui_input().push_mouse_wheel_event(window->target(), cx, cy, 120, 3);
- }
- }
-
- else if (event.button.button == 5) // SDL_BUTTON_WHEELDOWN
- {
- int cx, cy;
- sdl_window_info *window = GET_FOCUS_WINDOW(&event.button);
- if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) )
- {
- machine.ui_input().push_mouse_wheel_event(window->target(), cx, cy, -120, 3);
- }
- }
-#endif
break;
-#if (SDLMAME_SDL2)
case SDL_MOUSEWHEEL:
#ifdef SDL2_MULTIAPI
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[event.wheel.which]);
@@ -1890,7 +1686,6 @@ void sdlinput_poll(running_machine &machine)
machine.ui_input().push_mouse_wheel_event(window->target(), 0, 0, event.wheel.y, 3);
}
break;
-#endif
case SDL_MOUSEBUTTONUP:
#ifdef SDL2_MULTIAPI
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[event.button.which]);
@@ -1917,15 +1712,10 @@ void sdlinput_poll(running_machine &machine)
#else
devinfo = generic_device_find_index(mouse_list, mouse_map.logical[0]);
#endif
-#if (SDLMAME_SDL2)
// FIXME: may apply to 1.2 as well ...
//printf("Motion %d %d %d %s\n", event.motion.which, event.motion.x, event.motion.y, devinfo->name.c_str());
devinfo->mouse.lX += event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
devinfo->mouse.lY += event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
-#else
- devinfo->mouse.lX = event.motion.xrel * INPUT_RELATIVE_PER_PIXEL;
- devinfo->mouse.lY = event.motion.yrel * INPUT_RELATIVE_PER_PIXEL;
-#endif
{
int cx=-1, cy=-1;
sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion);
@@ -1940,22 +1730,6 @@ void sdlinput_poll(running_machine &machine)
devinfo->joystick.balls[event.jball.ball * 2] = event.jball.xrel * INPUT_RELATIVE_PER_PIXEL;
devinfo->joystick.balls[event.jball.ball * 2 + 1] = event.jball.yrel * INPUT_RELATIVE_PER_PIXEL;
break;
-#if (!SDLMAME_SDL2)
- case SDL_APPMOUSEFOCUS:
- app_has_mouse_focus = event.active.gain;
- if (!event.active.gain)
- {
- sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion);
- ui_input_push_mouse_leave_event(machine, window->target());
- }
- break;
- case SDL_QUIT:
- machine.schedule_exit();
- break;
- case SDL_VIDEORESIZE:
- sdl_window_list->resize(event.resize.w, event.resize.h);
- break;
-#else
case SDL_TEXTINPUT:
if (*event.text.text)
{
@@ -2023,12 +1797,9 @@ void sdlinput_poll(running_machine &machine)
}
break;
}
-#endif
}
}
-#if (SDLMAME_SDL2)
resize_all_windows();
-#endif
}
@@ -2039,10 +1810,6 @@ void sdlinput_poll(running_machine &machine)
void sdlinput_release_keys()
{
- // FIXME: SDL >= 1.3 will nuke the window event buffer when
- // a window is closed. This will leave keys in a pressed
- // state when a window is destroyed and recreated.
-#if (SDLMAME_SDL2)
device_info *devinfo;
int index;
@@ -2053,7 +1820,6 @@ void sdlinput_release_keys()
break;
memset(&devinfo->keyboard.state, 0, sizeof(devinfo->keyboard.state));
}
-#endif
}
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index e82c75406cc..bca299eb49d 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -17,15 +17,9 @@
#if defined(SDLMAME_WIN32)
- #if (SDLMAME_SDL2)
#define SDLMAME_EVENTS_IN_WORKER_THREAD (0)
#define SDLMAME_INIT_IN_WORKER_THREAD (0)
#define SDL13_COMBINE_RESIZE (0) //(1) no longer needed
- #else
- #define SDLMAME_EVENTS_IN_WORKER_THREAD (0)
- #define SDLMAME_INIT_IN_WORKER_THREAD (1)
- #define SDL13_COMBINE_RESIZE (0)
- #endif
#else
#define SDLMAME_EVENTS_IN_WORKER_THREAD (0)
#define SDLMAME_INIT_IN_WORKER_THREAD (0)
@@ -122,10 +116,8 @@ public:
const char *joy_index(int index) const { return value(strformat("%s%d", SDLOPTION_JOYINDEX, index).c_str()); }
bool sixaxis() const { return bool_value(SDLOPTION_SIXAXIS); }
-#if (SDLMAME_SDL2)
const char *mouse_index(int index) const { return value(strformat("%s%d", SDLOPTION_MOUSEINDEX, index).c_str()); }
const char *keyboard_index(int index) const { return value(strformat("%s%d", SDLOPTION_KEYBINDEX, index).c_str()); }
-#endif
const char *video_driver() const { return value(SDLOPTION_VIDEODRIVER); }
const char *render_driver() const { return value(SDLOPTION_RENDERDRIVER); }
diff --git a/src/osd/sdl/sdlinc.h b/src/osd/sdl/sdlinc.h
index 2bb5dfd0954..47ead42c0cf 100644
--- a/src/osd/sdl/sdlinc.h
+++ b/src/osd/sdl/sdlinc.h
@@ -3,20 +3,11 @@
#ifndef _sdlinc_h_
#define _sdlinc_h_
-#if (SDLMAME_SDL2)
#include <SDL2/SDL.h>
#include <SDL2/SDL_version.h>
// on win32 this includes windows.h by itself and breaks us!
#ifndef SDLMAME_WIN32
#include <SDL2/SDL_syswm.h>
#endif
-#else
-#include <SDL/SDL.h>
-#include <SDL/SDL_version.h>
-// on win32 this includes windows.h by itself and breaks us!
-#if !defined(SDLMAME_WIN32) && !defined(SDLMAME_DARWIN) && !defined(SDLMAME_MACOSX)
-#include <SDL/SDL_syswm.h>
-#endif
-#endif
#endif
diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp
index 2f382605cbb..530aa41c9d4 100644
--- a/src/osd/sdl/sdlmain.cpp
+++ b/src/osd/sdl/sdlmain.cpp
@@ -101,11 +101,7 @@ const options_entry sdl_options::s_option_entries[] =
// OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience
{ SDLOPTION_CENTERH, "1", OPTION_BOOLEAN, "center horizontally within the view area" },
{ SDLOPTION_CENTERV, "1", OPTION_BOOLEAN, "center vertically within the view area" },
-#if (SDLMAME_SDL2)
{ SDLOPTION_SCALEMODE ";sm", OSDOPTVAL_NONE, OPTION_STRING, "Scale mode: none, hwblit, hwbest, yv12, yuy2, yv12x2, yuy2x2 (-video soft only)" },
-#else
- { SDLOPTION_SCALEMODE ";sm", OSDOPTVAL_NONE, OPTION_STRING, "Scale mode: none, async, yv12, yuy2, yv12x2, yuy2x2 (-video soft only)" },
-#endif
// full screen options
#ifdef SDLMAME_X11
@@ -143,7 +139,6 @@ const options_entry sdl_options::s_option_entries[] =
{ SDLOPTION_LIGHTGUNINDEX "8", OSDOPTVAL_AUTO, OPTION_STRING, "name of lightgun mapped to lightgun #8" },
#endif
-#if (SDLMAME_SDL2)
{ NULL, NULL, OPTION_HEADER, "SDL MOUSE MAPPING" },
{ SDLOPTION_MOUSEINDEX "1", OSDOPTVAL_AUTO, OPTION_STRING, "name of mouse mapped to mouse #1" },
{ SDLOPTION_MOUSEINDEX "2", OSDOPTVAL_AUTO, OPTION_STRING, "name of mouse mapped to mouse #2" },
@@ -163,13 +158,11 @@ const options_entry sdl_options::s_option_entries[] =
{ SDLOPTION_KEYBINDEX "6", OSDOPTVAL_AUTO, OPTION_STRING, "name of keyboard mapped to keyboard #6" },
{ SDLOPTION_KEYBINDEX "7", OSDOPTVAL_AUTO, OPTION_STRING, "name of keyboard mapped to keyboard #7" },
{ SDLOPTION_KEYBINDEX "8", OSDOPTVAL_AUTO, OPTION_STRING, "name of keyboard mapped to keyboard #8" },
-#endif
+
// SDL low level driver options
{ NULL, NULL, OPTION_HEADER, "SDL LOWLEVEL DRIVER OPTIONS" },
{ SDLOPTION_VIDEODRIVER ";vd", OSDOPTVAL_AUTO, OPTION_STRING, "sdl video driver to use ('x11', 'directfb', ... or 'auto' for SDL default" },
-#if (SDLMAME_SDL2)
{ SDLOPTION_RENDERDRIVER ";rd", OSDOPTVAL_AUTO, OPTION_STRING, "sdl render driver to use ('software', 'opengl', 'directfb' ... or 'auto' for SDL default" },
-#endif
{ SDLOPTION_AUDIODRIVER ";ad", OSDOPTVAL_AUTO, OPTION_STRING, "sdl audio driver to use ('alsa', 'arts', ... or 'auto' for SDL default" },
#if USE_OPENGL
{ SDLOPTION_GL_LIB, SDLOPTVAL_GLLIB, OPTION_STRING, "alternative libGL.so to use; 'auto' for system default" },
@@ -225,21 +218,6 @@ int main(int argc, char *argv[])
{
int res = 0;
-#if defined(SDLMAME_X11) && !(SDLMAME_SDL2)
- XInitThreads();
-#endif
-
-#if defined(SDLMAME_WIN32)
-#if !(SDLMAME_SDL2)
- /* Load SDL dynamic link library */
- if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) {
- fprintf(stderr, "WinMain() error: %s", SDL_GetError());
- return(FALSE);
- }
- SDL_SetModuleHandle(GetModuleHandle(NULL));
-#endif
-#endif
-
// disable I/O buffering
setvbuf(stdout, (char *) NULL, _IONBF, 0);
setvbuf(stderr, (char *) NULL, _IONBF, 0);
@@ -257,25 +235,6 @@ int main(int argc, char *argv[])
MorphToPM();
#endif
-#if defined(SDLMAME_X11) && (SDL_MAJOR_VERSION == 1) && (SDL_MINOR_VERSION == 2)
- if (SDL_Linked_Version()->patch < 10)
- /* workaround for SDL choosing a 32-bit ARGB visual */
- {
- Display *display;
- if ((display = XOpenDisplay(NULL)) && (DefaultDepth(display, DefaultScreen(display)) >= 24))
- {
- XVisualInfo vi;
- char buf[130];
- if (XMatchVisualInfo(display, DefaultScreen(display), 24, TrueColor, &vi)) {
- snprintf(buf, sizeof(buf), "0x%lx", vi.visualid);
- osd_setenv(SDLENV_VISUALID, buf, 0);
- }
- }
- if (display)
- XCloseDisplay(display);
- }
-#endif
-
{
sdl_options options;
sdl_osd_interface osd(options);
@@ -340,11 +299,7 @@ void sdl_osd_interface::osd_exit()
if (!SDLMAME_INIT_IN_WORKER_THREAD)
{
/* FixMe: Bug in SDL2.0, Quitting joystick will cause SIGSEGV */
-#if SDLMAME_SDL2
SDL_QuitSubSystem(SDL_INIT_TIMER| SDL_INIT_VIDEO /*| SDL_INIT_JOYSTICK */);
-#else
- SDL_Quit();
-#endif
}
}
@@ -419,7 +374,6 @@ static void defines_verbose(void)
static void osd_sdl_info(void)
{
-#if SDLMAME_SDL2
int i, num = SDL_GetNumVideoDrivers();
osd_printf_verbose("Available videodrivers: ");
@@ -456,8 +410,6 @@ static void osd_sdl_info(void)
{
osd_printf_verbose("\t%-20s\n", SDL_GetAudioDriver(i));
}
-
-#endif
}
@@ -512,7 +464,6 @@ void sdl_osd_interface::init(running_machine &machine)
osd_setenv(SDLENV_VIDEODRIVER, stemp, 1);
}
-#if (SDLMAME_SDL2)
stemp = options().render_driver();
if (stemp != NULL)
{
@@ -532,7 +483,6 @@ void sdl_osd_interface::init(running_machine &machine)
#endif
}
}
-#endif
/* Set the SDL environment variable for drivers wanting to load the
* lib at startup.
@@ -567,16 +517,12 @@ void sdl_osd_interface::init(running_machine &machine)
if (!SDLMAME_INIT_IN_WORKER_THREAD)
{
-#if (SDLMAME_SDL2)
#ifdef SDLMAME_EMSCRIPTEN
// timer brings in threads which are not supported in Emscripten
if (SDL_InitSubSystem(SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) {
#else
if (SDL_InitSubSystem(SDL_INIT_TIMER| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) {
#endif
-#else
- if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) {
-#endif
osd_printf_error("Could not initialize SDL %s\n", SDL_GetError());
exit(-1);
}
@@ -600,13 +546,9 @@ void sdl_osd_interface::init(running_machine &machine)
m_watchdog->setTimeout(watchdog_timeout);
}
-#if (SDLMAME_SDL2)
#ifdef SDLMAME_EMSCRIPTEN
SDL_EventState(SDL_TEXTINPUT, SDL_FALSE);
#else
SDL_EventState(SDL_TEXTINPUT, SDL_TRUE);
#endif
-#else
- SDL_EnableUNICODE(SDL_TRUE);
-#endif
}
diff --git a/src/osd/sdl/sdlos_unix.cpp b/src/osd/sdl/sdlos_unix.cpp
index 5811e0c7dc5..23080512e91 100644
--- a/src/osd/sdl/sdlos_unix.cpp
+++ b/src/osd/sdl/sdlos_unix.cpp
@@ -23,11 +23,6 @@
// MAME headers
#include "osdcore.h"
-
-
-
-#if (SDLMAME_SDL2)
-
//============================================================
// osd_get_clipboard_text
//============================================================
@@ -45,104 +40,3 @@ char *osd_get_clipboard_text(void)
}
return result;
}
-
-#elif defined(SDL_VIDEO_DRIVER_X11) && defined(SDLMAME_X11)
-
-//============================================================
-// osd_get_clipboard_text
-//============================================================
-
-char *osd_get_clipboard_text(void)
-{
- SDL_SysWMinfo info;
- Display* display;
- Window our_win;
- Window selection_win;
- Atom data_type;
- int data_format;
- unsigned long nitems;
- unsigned long bytes_remaining;
- unsigned char* prop;
- char* result;
- XEvent event;
- Uint32 t0, t1;
- Atom types[2];
- int i;
-
- /* get & validate SDL sys-wm info */
- SDL_VERSION(&info.version);
- if ( ! SDL_GetWMInfo( &info ) )
- return NULL;
- if ( info.subsystem != SDL_SYSWM_X11 )
- return NULL;
- if ( (display = info.info.x11.display) == NULL )
- return NULL;
- if ( (our_win = info.info.x11.window) == None )
- return NULL;
-
- /* request data to owner */
- selection_win = XGetSelectionOwner( display, XA_PRIMARY );
- if ( selection_win == None )
- return NULL;
-
- /* first, try UTF-8, then latin-1 */
- types[0] = XInternAtom( display, "UTF8_STRING", False );
- types[1] = XA_STRING; /* latin-1 */
-
- for ( i = 0; i < ARRAY_LENGTH(types); i++ )
- {
- XConvertSelection( display, XA_PRIMARY, types[i], types[i], our_win, CurrentTime );
-
- /* wait for SelectionNotify, but no more than 100 ms */
- t0 = t1 = SDL_GetTicks();
- while ( 1 )
- {
- if ( XCheckTypedWindowEvent( display, our_win, SelectionNotify, &event ) ) break;
- SDL_Delay( 1 );
- t1 = SDL_GetTicks();
- if ( t1 - t0 > 100 )
- return NULL;
- }
- if ( event.xselection.property == None )
- continue;
-
- /* get property & check its type */
- if ( XGetWindowProperty( display, our_win, types[i], 0, 65536, False, types[i],
- &data_type, &data_format, &nitems, &bytes_remaining, &prop )
- != Success )
- continue;
- if ( ! prop )
- continue;
- if ( (data_format != 8) || (data_type != types[i]) )
- {
- XFree( prop );
- continue;
- }
-
- /* return a copy & free original */
- if (prop != NULL)
- {
- result = (char *) osd_malloc_array(strlen((char *)prop)+1);
- strcpy(result, (char *)prop);
- }
- else
- result = NULL;
- XFree( prop );
- return result;
- }
-
- return NULL;
-}
-
-#else
-//============================================================
-// osd_get_clipboard_text
-//============================================================
-
-char *osd_get_clipboard_text(void)
-{
- char *result = NULL;
-
- return result;
-}
-#endif
diff --git a/src/osd/sdl/testkeys.cpp b/src/osd/sdl/testkeys.cpp
index 444c1b9eeb2..850ec1ad506 100644
--- a/src/osd/sdl/testkeys.cpp
+++ b/src/osd/sdl/testkeys.cpp
@@ -24,7 +24,6 @@ struct key_lookup_table
const char *name;
};
-#if (SDLMAME_SDL2)
#define KE(x) { SDL_SCANCODE_ ## x, "SDL_SCANCODE_" #x },
#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
#define KE7(A, B, C, D, E, F, G) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G)
@@ -53,46 +52,6 @@ static key_lookup_table sdl_lookup[] =
KE5(MENU, NONUSBACKSLASH, UNDO, APOSTROPHE, GRAVE )
{-1, ""}
};
-#else
-#define KE(x) { SDLK_ ## x, "SDLK_" #x },
-#define KE8(A, B, C, D, E, F, G, H) KE(A) KE(B) KE(C) KE(D) KE(E) KE(F) KE(G) KE(H)
-
-static key_lookup_table sdl_lookup[] =
-{
- KE8(UNKNOWN, FIRST, BACKSPACE, TAB, CLEAR, RETURN, PAUSE, ESCAPE )
- KE8(SPACE, EXCLAIM, QUOTEDBL, HASH, DOLLAR, AMPERSAND, QUOTE, LEFTPAREN )
- KE8(RIGHTPAREN, ASTERISK, PLUS, COMMA, MINUS, PERIOD, SLASH, 0 )
- KE8(1, 2, 3, 4, 5, 6, 7, 8 )
- KE8(9, COLON, SEMICOLON, LESS, EQUALS, GREATER, QUESTION, AT )
- KE8(LEFTBRACKET,BACKSLASH, RIGHTBRACKET, CARET, UNDERSCORE, BACKQUOTE, a, b )
- KE8(c, d, e, f, g, h, i, j )
- KE8(k, l, m, n, o, p, q, r )
- KE8(s, t, u, v, w, x, y, z )
- KE8(DELETE, WORLD_0, WORLD_1, WORLD_2, WORLD_3, WORLD_4, WORLD_5, WORLD_6 )
- KE8(WORLD_7, WORLD_8, WORLD_9, WORLD_10, WORLD_11, WORLD_12, WORLD_13, WORLD_14 )
- KE8(WORLD_15, WORLD_16, WORLD_17, WORLD_18, WORLD_19, WORLD_20, WORLD_21, WORLD_22 )
- KE8(WORLD_23, WORLD_24, WORLD_25, WORLD_26, WORLD_27, WORLD_28, WORLD_29, WORLD_30 )
- KE8(WORLD_31, WORLD_32, WORLD_33, WORLD_34, WORLD_35, WORLD_36, WORLD_37, WORLD_38 )
- KE8(WORLD_39, WORLD_40, WORLD_41, WORLD_42, WORLD_43, WORLD_44, WORLD_45, WORLD_46 )
- KE8(WORLD_47, WORLD_48, WORLD_49, WORLD_50, WORLD_51, WORLD_52, WORLD_53, WORLD_54 )
- KE8(WORLD_55, WORLD_56, WORLD_57, WORLD_58, WORLD_59, WORLD_60, WORLD_61, WORLD_62 )
- KE8(WORLD_63, WORLD_64, WORLD_65, WORLD_66, WORLD_67, WORLD_68, WORLD_69, WORLD_70 )
- KE8(WORLD_71, WORLD_72, WORLD_73, WORLD_74, WORLD_75, WORLD_76, WORLD_77, WORLD_78 )
- KE8(WORLD_79, WORLD_80, WORLD_81, WORLD_82, WORLD_83, WORLD_84, WORLD_85, WORLD_86 )
- KE8(WORLD_87, WORLD_88, WORLD_89, WORLD_90, WORLD_91, WORLD_92, WORLD_93, WORLD_94 )
- KE8(WORLD_95, KP0, KP1, KP2, KP3, KP4, KP5, KP6 )
- KE8(KP7, KP8, KP9, KP_PERIOD, KP_DIVIDE, KP_MULTIPLY,KP_MINUS, KP_PLUS )
- KE8(KP_ENTER, KP_EQUALS, UP, DOWN, RIGHT, LEFT, INSERT, HOME )
- KE8(END, PAGEUP, PAGEDOWN, F1, F2, F3, F4, F5 )
- KE8(F6, F7, F8, F9, F10, F11, F12, F13 )
- KE8(F14, F15, NUMLOCK, CAPSLOCK, SCROLLOCK, RSHIFT, LSHIFT, RCTRL )
- KE8(LCTRL, RALT, LALT, RMETA, LMETA, LSUPER, RSUPER, MODE )
- KE8(COMPOSE, HELP, PRINT, SYSREQ, BREAK, MENU, POWER, EURO )
- KE(UNDO)
- KE(LAST)
- {-1, ""}
-};
-#endif
static const char * lookup_key_name(const key_lookup_table *kt, int kc)
{
@@ -114,23 +73,14 @@ int main(int argc, char *argv[])
{
SDL_Event event;
int quit = 0;
-#if (SDLMAME_SDL2)
char lasttext[20] = "";
-#else
- char buf[20];
-#endif
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",
SDL_GetError());
exit(1);
}
-#if (SDLMAME_SDL2)
SDL_CreateWindow("Input Test", 0, 0, 100, 100,0 );
-#else
- SDL_SetVideoMode(100, 50, 16, SDL_ANYFORMAT);
- SDL_EnableUNICODE(1);
-#endif
while(SDL_PollEvent(&event) || !quit) {
switch(event.type) {
case SDL_QUIT:
@@ -141,46 +91,24 @@ int main(int argc, char *argv[])
quit=1;
else
{
-#if (SDLMAME_SDL2)
printf("ITEM_ID_XY %s 0x%x 0x%x %s\n",
lookup_key_name(sdl_lookup, event.key.keysym.scancode),
(int) event.key.keysym.scancode,
(int) event.key.keysym.sym,
"");
lasttext[0] = 0;
-#else
- memset(buf, 0, 19);
- utf8_from_uchar(buf, sizeof(buf), event.key.keysym.unicode);
- printf("ITEM_ID_XY %s 0x%x 0x%x %s\n",
- lookup_key_name(sdl_lookup, event.key.keysym.sym),
- (int) event.key.keysym.scancode,
- (int) event.key.keysym.unicode,
- buf);
-#endif
}
break;
case SDL_KEYUP:
-#if (SDLMAME_SDL2)
printf("ITEM_ID_XY %s 0x%x 0x%x %s\n",
lookup_key_name(sdl_lookup, event.key.keysym.scancode),
(int) event.key.keysym.scancode,
(int) event.key.keysym.sym,
lasttext);
-#else
- memset(buf, 0, 19);
- utf8_from_uchar(buf, sizeof(buf), event.key.keysym.unicode);
- printf("ITEM_ID_XY %s 0x%x 0x%x %s\n",
- lookup_key_name(sdl_lookup, event.key.keysym.sym),
- (int) event.key.keysym.scancode,
- (int) event.key.keysym.unicode,
- buf);
-#endif
break;
-#if (SDLMAME_SDL2)
case SDL_TEXTINPUT:
strcpy(lasttext, event.text.text);
break;
-#endif
}
event.type = 0;
diff --git a/src/osd/sdl/video.cpp b/src/osd/sdl/video.cpp
index c5de6be41d9..b0d2e383c11 100644
--- a/src/osd/sdl/video.cpp
+++ b/src/osd/sdl/video.cpp
@@ -7,33 +7,6 @@
// SDLMAME by Olivier Galibert and R. Belmont
//
//============================================================
-
-#ifdef SDLMAME_X11
-#include <X11/extensions/Xinerama.h>
-#endif
-
-#ifdef SDLMAME_MACOSX
-#undef Status
-#include <Carbon/Carbon.h>
-#endif
-
-#ifdef SDLMAME_WIN32
-// for multimonitor
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x501
-#endif
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "strconv.h"
-#endif
-
-#ifdef SDLMAME_OS2
-#define INCL_WINSYS
-#include <os2.h>
-#endif
-
#include "sdlinc.h"
// MAME headers
@@ -110,7 +83,7 @@ bool sdl_osd_interface::video_init()
get_resolution(options().resolution(), options().resolution(index), &conf, TRUE);
// create window ...
- sdl_window_info *win = global_alloc(sdl_window_info(machine(), index, sdl_monitor_info::pick_monitor(options(), index), &conf));
+ sdl_window_info *win = global_alloc(sdl_window_info(machine(), index, osd_monitor_info::pick_monitor(reinterpret_cast<osd_options &>(options()), index), &conf));
if (win->window_init())
return false;
@@ -134,15 +107,9 @@ void sdl_osd_interface::video_exit()
//============================================================
// sdlvideo_monitor_refresh
//============================================================
-#if defined(SDLMAME_WIN32) // Win32 version
-inline osd_rect RECT_to_osd_rect(const RECT &r)
-{
- return osd_rect(r.left, r.top, r.right - r.left, r.bottom - r.top);
-}
-#endif
+
void sdl_monitor_info::refresh()
{
- #if (SDLMAME_SDL2)
SDL_DisplayMode dmode;
#if defined(SDLMAME_WIN32)
@@ -156,128 +123,8 @@ void sdl_monitor_info::refresh()
m_pos_size = SDL_Rect_to_osd_rect(dimensions);
m_usuable_pos_size = SDL_Rect_to_osd_rect(dimensions);
m_is_primary = (m_handle == 0);
-
- #else
- #if defined(SDLMAME_WIN32) // Win32 version
- MONITORINFOEX info;
- info.cbSize = sizeof(info);
- GetMonitorInfo((HMONITOR)m_handle, (LPMONITORINFO)&info);
- m_pos_size = RECT_to_osd_rect(info.rcMonitor);
- m_usuable_pos_size = RECT_to_osd_rect(info.rcWork);
- m_is_primary = ((info.dwFlags & MONITORINFOF_PRIMARY) != 0);
- char *temp = utf8_from_wstring(info.szDevice);
- strncpy(m_name, temp, ARRAY_LENGTH(m_name) - 1);
- osd_free(temp);
- #elif defined(SDLMAME_MACOSX) // Mac OS X Core Imaging version
- CGDirectDisplayID primary;
- CGRect dbounds;
-
- // get the main display
- primary = CGMainDisplayID();
- dbounds = CGDisplayBounds(primary);
-
- m_is_primary = (m_handle == 0);
- m_pos_size = osd_rect(0, 0, dbounds.size.width - dbounds.origin.x, dbounds.size.height - dbounds.origin.y);
- m_usuable_pos_size = m_pos_size;
- strncpy(m_name, "Mac OS X display", ARRAY_LENGTH(m_name) - 1);
- #elif defined(SDLMAME_X11) || defined(SDLMAME_NO_X11) // X11 version
- {
- #if defined(SDLMAME_X11)
- // X11 version
- int screen;
- SDL_SysWMinfo info;
- SDL_VERSION(&info.version);
-
- if ( SDL_GetWMInfo(&info) && (info.subsystem == SDL_SYSWM_X11) )
- {
- screen = DefaultScreen(info.info.x11.display);
- SDL_VideoDriverName(m_name, ARRAY_LENGTH(m_name) - 1);
- m_pos_size = osd_rect(0, 0,
- DisplayWidth(info.info.x11.display, screen),
- DisplayHeight(info.info.x11.display, screen));
-
- /* FIXME: If Xinerame is used we should compile a list of monitors
- * like we do for other targets and ignore SDL.
- */
- if ((XineramaIsActive(info.info.x11.display)) && video_config.restrictonemonitor)
- {
- XineramaScreenInfo *xineinfo;
- int numscreens;
-
- xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens);
-
- m_pos_size = osd_rect(0, 0, xineinfo[0].width, xineinfo[0].height);
-
- XFree(xineinfo);
- }
- m_usuable_pos_size = m_pos_size;
- m_is_primary = (m_handle == 0);
- }
- else
- #endif // defined(SDLMAME_X11)
- {
- static int first_call=0;
- static int cw = 0, ch = 0;
-
- SDL_VideoDriverName(m_name, ARRAY_LENGTH(m_name) - 1);
- if (first_call==0)
- {
- const char *dimstr = osd_getenv(SDLENV_DESKTOPDIM);
- const SDL_VideoInfo *sdl_vi;
-
- sdl_vi = SDL_GetVideoInfo();
- #if (SDL_VERSION_ATLEAST(1,2,10))
- cw = sdl_vi->current_w;
- ch = sdl_vi->current_h;
- #endif
- first_call=1;
- if ((cw==0) || (ch==0))
- {
- if (dimstr != NULL)
- {
- sscanf(dimstr, "%dx%d", &cw, &ch);
- }
- if ((cw==0) || (ch==0))
- {
- osd_printf_warning("WARNING: SDL_GetVideoInfo() for driver <%s> is broken.\n", m_name);
- osd_printf_warning(" You should set SDLMAME_DESKTOPDIM to your desktop size.\n");
- osd_printf_warning(" e.g. export SDLMAME_DESKTOPDIM=800x600\n");
- osd_printf_warning(" Assuming 1024x768 now!\n");
- cw=1024;
- ch=768;
- }
- }
- }
- m_pos_size = osd_rect(0, 0, cw, ch);
- m_usuable_pos_size = m_pos_size;
- m_is_primary = (m_handle == 0);
- }
- }
- #elif defined(SDLMAME_OS2) // OS2 version
- m_pos_size = osd_rect(0, 0,
- WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN ),
- WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN ) );
- m_usuable_pos_size = m_pos_size;
- m_is_primary = (m_handle == 0);
- strncpy(m_name, "OS/2 display", ARRAY_LENGTH(m_name) - 1);
- #else
- #error Unknown SDLMAME_xx OS type!
- #endif
-
- {
- static int info_shown=0;
- if (!info_shown)
- {
- osd_printf_verbose("SDL Device Driver : %s\n", m_name);
- osd_printf_verbose("SDL Monitor Dimensions: %d x %d\n", m_pos_size.width(), m_pos_size.height());
- info_shown = 1;
- }
- }
- #endif // (SDLMAME_SDL2)
}
-
-
//============================================================
// sdlvideo_monitor_get_aspect
//============================================================
@@ -325,68 +172,6 @@ void sdl_osd_interface::update(bool skip_redraw)
//============================================================
-// add_primary_monitor
-//============================================================
-
-#if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
-void sdl_monitor_info::add_primary_monitor(void *data)
-{
- // make a list of monitors
- osd_monitor_info::list = NULL;
- osd_monitor_info **tailptr = &sdl_monitor_info::list;
-
- // allocate a new monitor info
- osd_monitor_info *monitor = global_alloc_clear<sdl_monitor_info>(0, "", 1.0f);
-
- //monitor->refresh();
- // guess the aspect ratio assuming square pixels
- monitor->set_aspect((float)(monitor->position_size().width()) / (float)(monitor->position_size().height()));
-
- // hook us into the list
- *tailptr = monitor;
- //tailptr = &monitor->m_next;
-}
-#endif
-
-
-//============================================================
-// monitor_enum_callback
-//============================================================
-
-#if defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
-BOOL CALLBACK sdl_monitor_info::monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect, LPARAM data)
-{
- osd_monitor_info ***tailptr = (osd_monitor_info ***)data;
- osd_monitor_info *monitor;
- MONITORINFOEX info;
- BOOL result;
-
- // get the monitor info
- info.cbSize = sizeof(info);
- result = GetMonitorInfo(handle, (LPMONITORINFO)&info);
- assert(result);
- (void)result; // to silence gcc 4.6
-
- // guess the aspect ratio assuming square pixels
- float aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);
-
- // allocate a new monitor info
- char *temp = utf8_from_wstring(info.szDevice);
- // copy in the data
- monitor = global_alloc(sdl_monitor_info((UINT64) handle, temp, aspect));
- osd_free(temp);
-
- // hook us into the list
- **tailptr = monitor;
- *tailptr = &monitor->m_next;
-
- // enumerate all the available monitors so to list their names in verbose mode
- return TRUE;
-}
-#endif
-
-
-//============================================================
// init_monitors
//============================================================
@@ -398,7 +183,6 @@ void sdl_monitor_info::init()
osd_monitor_info::list = NULL;
tailptr = &osd_monitor_info::list;
- #if (SDLMAME_SDL2)
{
int i;
@@ -427,11 +211,6 @@ void sdl_monitor_info::init()
}
}
osd_printf_verbose("Leave init_monitors\n");
- #elif defined(SDLMAME_WIN32)
- EnumDisplayMonitors(NULL, NULL, monitor_enum_callback, (LPARAM)&tailptr);
- #else
- add_primary_monitor((void *)&tailptr);
- #endif
}
void sdl_monitor_info::exit()
@@ -450,8 +229,9 @@ void sdl_monitor_info::exit()
// pick_monitor
//============================================================
-osd_monitor_info *osd_monitor_info::pick_monitor(sdl_options &options, int index)
+osd_monitor_info *osd_monitor_info::pick_monitor(osd_options &generic_options, int index)
{
+ sdl_options &options = reinterpret_cast<sdl_options &>(generic_options);
osd_monitor_info *monitor;
const char *scrname, *scrname2;
int moncount = 0;
@@ -534,7 +314,7 @@ static void check_osd_inputs(running_machine &machine)
machine.ui().popup_time(1, "Keepaspect %s", video_config.keepaspect? "enabled":"disabled");
}
- #if (USE_OPENGL || SDLMAME_SDL2)
+ #if (USE_OPENGL)
//FIXME: on a per window basis
if (machine.ui_input().pressed(IPT_OSD_5))
{
@@ -600,16 +380,14 @@ void sdl_osd_interface::extract_video_config()
}
else if (USE_OPENGL && (strcmp(stemp, SDLOPTVAL_OPENGL) == 0))
video_config.mode = VIDEO_MODE_OPENGL;
- else if (SDLMAME_SDL2 && (strcmp(stemp, SDLOPTVAL_SDL2ACCEL) == 0))
+ else if ((strcmp(stemp, SDLOPTVAL_SDL2ACCEL) == 0))
{
video_config.mode = VIDEO_MODE_SDL2ACCEL;
}
-#ifdef USE_BGFX
else if (strcmp(stemp, SDLOPTVAL_BGFX) == 0)
{
video_config.mode = VIDEO_MODE_BGFX;
}
-#endif
else
{
osd_printf_warning("Invalid video value %s; reverting to software\n", stemp);
@@ -693,19 +471,11 @@ void sdl_osd_interface::extract_video_config()
// misc options: sanity check values
// global options: sanity check values
-#if (!SDLMAME_SDL2)
- if (video_config.numscreens < 1 || video_config.numscreens > 1) //MAX_VIDEO_WINDOWS)
- {
- osd_printf_warning("Invalid numscreens value %d; reverting to 1\n", video_config.numscreens);
- video_config.numscreens = 1;
- }
-#else
if (video_config.numscreens < 1 || video_config.numscreens > MAX_VIDEO_WINDOWS)
{
osd_printf_warning("Invalid numscreens value %d; reverting to 1\n", video_config.numscreens);
video_config.numscreens = 1;
}
-#endif
// yuv settings ...
stemp = options().scale_mode();
video_config.scale_mode = drawsdl_scale_mode(stemp);
diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h
index 699f98512d1..307f3a898c9 100644
--- a/src/osd/sdl/video.h
+++ b/src/osd/sdl/video.h
@@ -11,12 +11,8 @@
#ifndef __SDLVIDEO__
#define __SDLVIDEO__
-#if defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
#include "osdsdl.h"
+#include "modules/osdwindow.h"
//============================================================
// CONSTANTS
@@ -24,13 +20,6 @@
#define MAX_VIDEO_WINDOWS (4)
-enum {
- VIDEO_MODE_SOFT = 0,
- VIDEO_MODE_OPENGL,
- VIDEO_MODE_SDL2ACCEL,
- VIDEO_MODE_BGFX
-};
-
#define VIDEO_SCALE_MODE_NONE (0)
#define GLSL_SHADER_MAX 10
@@ -39,114 +28,11 @@ enum {
// TYPE DEFINITIONS
//============================================================
-class osd_dim
-{
-public:
- osd_dim(const int &w, const int &h)
- : m_w(w), m_h(h)
- {
- }
- int width() const { return m_w; }
- int height() const { return m_h; }
-
- bool operator!=(const osd_dim &other) { return (m_w != other.width()) || (m_h != other.height()); }
- bool operator==(const osd_dim &other) { return (m_w == other.width()) && (m_h == other.height()); }
-private:
- int m_w;
- int m_h;
-};
-
-class osd_rect
-{
-public:
- osd_rect()
- : m_x(0), m_y(0), m_d(0,0)
- {
- }
- osd_rect(const int x, const int y, const int &w, const int &h)
- : m_x(x), m_y(y), m_d(w,h)
- {
- }
- osd_rect(const int x, const int y, const osd_dim &d)
- : m_x(x), m_y(y), m_d(d)
- {
- }
- int top() const { return m_y; }
- int left() const { return m_x; }
- int width() const { return m_d.width(); }
- int height() const { return m_d.height(); }
-
- osd_dim dim() const { return m_d; }
-
- int bottom() const { return m_y + m_d.height(); }
- int right() const { return m_x + m_d.width(); }
-
- osd_rect move_by(int dx, int dy) const { return osd_rect(m_x + dx, m_y + dy, m_d); }
- osd_rect resize(int w, int h) const { return osd_rect(m_x, m_y, w, h); }
-
-private:
- int m_x;
- int m_y;
- osd_dim m_d;
-};
-
inline osd_rect SDL_Rect_to_osd_rect(const SDL_Rect &r)
{
return osd_rect(r.x, r.y, r.w, r.h);
}
-class osd_monitor_info
-{
-public:
-
-#if 0
- osd_monitor_info()
- : m_next(NULL), m_handle(NULL), m_aspect(0.0f)
- {
- strcpy(m_name, "");
- }
-#endif
- osd_monitor_info(void *handle, const char *monitor_device, float aspect)
- : m_next(NULL), m_handle(handle), m_aspect(aspect)
- {
- strncpy(m_name, monitor_device, ARRAY_LENGTH(m_name) - 1);
- }
-
- virtual ~osd_monitor_info() { }
-
- virtual void refresh() = 0;
-
- const void *oshandle() { return m_handle; }
-
- const osd_rect &position_size() { return m_pos_size; }
- const osd_rect &usuable_position_size() { return m_usuable_pos_size; }
-
- const char *devicename() { return m_name[0] ? m_name : "UNKNOWN"; }
-
- float aspect();
-
- void set_aspect(const float a) { m_aspect = a; }
- bool is_primary() { return m_is_primary; }
-
- osd_monitor_info * next() { return m_next; } // pointer to next monitor in list
-
- static osd_monitor_info *pick_monitor(sdl_options &options, int index);
- static osd_monitor_info *list;
-
- // FIXME: should be private!
- osd_monitor_info *m_next; // pointer to next monitor in list
-protected:
- osd_rect m_pos_size;
- osd_rect m_usuable_pos_size;
- bool m_is_primary;
- char m_name[64];
-private:
-
- void * m_handle; // handle to the monitor
- float m_aspect; // computed/configured aspect ratio of the physical device
-};
-
-
class sdl_monitor_info : public osd_monitor_info
{
public:
@@ -164,12 +50,6 @@ public:
// STATIC
static void init();
static void exit();
-#if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
- static void add_primary_monitor(void *data);
-#endif
-#if defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
- static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect, LPARAM data);
-#endif
private:
void virtual refresh() override;
@@ -192,9 +72,6 @@ struct osd_video_config
int fullstretch; // FXIME: implement in windows!
- // ddraw options
- int hwstretch; // stretch using the hardware
-
// d3d, accel, opengl
int filter; // enable filtering
//int filter; // enable filtering, disabled if glsl_filter>0
diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp
index 85f945874d9..49e8ed48477 100644
--- a/src/osd/sdl/window.cpp
+++ b/src/osd/sdl/window.cpp
@@ -16,11 +16,7 @@
// standard SDL headers
#include "sdlinc.h"
-#if (SDLMAME_SDL2)
#include <SDL2/SDL_thread.h>
-#else
-#include <SDL/SDL_thread.h>
-#endif
// standard C headers
#include <math.h>
@@ -40,6 +36,12 @@
#include "window.h"
#include "input.h"
#include "osdsdl.h"
+#include "modules/render/drawbgfx.h"
+#include "modules/render/drawsdl.h"
+#include "modules/render/draw13.h"
+#if (USE_OPENGL)
+#include "modules/render/drawogl.h"
+#endif
//============================================================
// PARAMETERS
@@ -92,21 +94,15 @@ static sdl_window_info **last_window_ptr;
static int multithreading_enabled;
static osd_work_queue *work_queue;
-#if !(SDLMAME_SDL2) && (!defined(SDLMAME_EMSCRIPTEN))
-typedef int SDL_threadID;
-#endif
-
static SDL_threadID main_threadid;
static SDL_threadID window_threadid;
// debugger
//static int in_background;
-static osd_draw_callbacks draw;
-
struct worker_param {
worker_param()
- : m_window(NULL), m_list(NULL), m_resize_new_width(0), m_resize_new_height(0)
+ : m_window(nullptr), m_list(nullptr), m_resize_new_width(0), m_resize_new_height(0)
{
}
worker_param(sdl_window_info *awindow, render_primitive_list &alist)
@@ -114,14 +110,14 @@ struct worker_param {
{
}
worker_param(sdl_window_info *awindow, int anew_width, int anew_height)
- : m_window(awindow), m_list(NULL), m_resize_new_width(anew_width), m_resize_new_height(anew_height)
+ : m_window(awindow), m_list(nullptr), m_resize_new_width(anew_width), m_resize_new_height(anew_height)
{
}
worker_param(sdl_window_info *awindow)
- : m_window(awindow), m_list(NULL), m_resize_new_width(0), m_resize_new_height(0)
+ : m_window(awindow), m_list(nullptr), m_resize_new_width(0), m_resize_new_height(0)
{
}
- sdl_window_info *window() const { assert(m_window != NULL); return m_window; }
+ sdl_window_info *window() const { assert(m_window != nullptr); return m_window; }
render_primitive_list *list() const { return m_list; }
int new_width() const { return m_resize_new_width; }
int new_height() const { return m_resize_new_height; }
@@ -189,17 +185,13 @@ static OSDWORK_CALLBACK(sdlwindow_thread_id)
if (SDLMAME_INIT_IN_WORKER_THREAD)
{
-#if (SDLMAME_SDL2)
if (SDL_InitSubSystem(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE))
-#else
- if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE))
-#endif
{
osd_printf_error("Could not initialize SDL: %s.\n", SDL_GetError());
exit(-1);
}
}
- return NULL;
+ return nullptr;
}
@@ -222,47 +214,52 @@ bool sdl_osd_interface::window_init()
{
// create a thread to run the windows from
work_queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_IO);
- if (work_queue == NULL)
+ if (work_queue == nullptr)
return false;
- osd_work_item_queue(work_queue, &sdlwindow_thread_id, NULL, WORK_ITEM_FLAG_AUTO_RELEASE);
+ osd_work_item_queue(work_queue, &sdlwindow_thread_id, nullptr, WORK_ITEM_FLAG_AUTO_RELEASE);
sdlwindow_sync();
}
else
{
// otherwise, treat the window thread as the main thread
//window_threadid = main_threadid;
- sdlwindow_thread_id(NULL, 0);
+ sdlwindow_thread_id(nullptr, 0);
}
// initialize the drawers
-#if USE_OPENGL
- if (video_config.mode == VIDEO_MODE_OPENGL)
+ if (video_config.mode == VIDEO_MODE_BGFX)
{
- if (drawogl_init(machine(), &draw))
- video_config.mode = VIDEO_MODE_SOFT;
+ if (renderer_bgfx::init(machine()))
+ {
+#if (USE_OPENGL)
+ video_config.mode = VIDEO_MODE_OPENGL;
+ }
}
-#endif
-#if SDLMAME_SDL2
- if (video_config.mode == VIDEO_MODE_SDL2ACCEL)
+ if (video_config.mode == VIDEO_MODE_OPENGL)
{
- if (drawsdl2_init(machine(), &draw))
+ if (renderer_ogl::init(machine()))
+ {
+ video_config.mode = VIDEO_MODE_SOFT;
+#else
video_config.mode = VIDEO_MODE_SOFT;
- }
#endif
-#ifdef USE_BGFX
- if (video_config.mode == VIDEO_MODE_BGFX)
+ }
+ }
+ if (video_config.mode == VIDEO_MODE_SDL2ACCEL)
{
- if (drawbgfx_init(machine(), &draw))
+ if (renderer_sdl2::init(machine()))
+ {
video_config.mode = VIDEO_MODE_SOFT;
+ }
}
-#endif
if (video_config.mode == VIDEO_MODE_SOFT)
{
- if (drawsdl_init(&draw))
+ if (renderer_sdl1::init(machine()))
+ {
return false;
+ }
}
-#if SDLMAME_SDL2
/* We may want to set a number of the hints SDL2 provides.
* The code below will document which hints were set.
*/
@@ -288,13 +285,12 @@ bool sdl_osd_interface::window_init()
SDL_HINT_WINRT_PRIVACY_POLICY_URL, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL,
SDL_HINT_WINRT_HANDLE_BACK_BUTTON,
#endif
- NULL
+ nullptr
};
osd_printf_verbose("\nHints:\n");
- for (int i = 0; hints[i] != NULL; i++)
+ for (int i = 0; hints[i] != nullptr; i++)
osd_printf_verbose("\t%-40s %s\n", hints[i], SDL_GetHint(hints[i]));
-#endif
// set up the window list
last_window_ptr = &sdl_window_list;
@@ -333,7 +329,7 @@ static OSDWORK_CALLBACK( sdlwindow_exit_wt )
if (param)
osd_free(param);
- return NULL;
+ return nullptr;
}
@@ -346,7 +342,7 @@ void sdl_osd_interface::window_exit()
osd_printf_verbose("Enter sdlwindow_exit\n");
// free all the windows
- while (sdl_window_list != NULL)
+ while (sdl_window_list != nullptr)
{
sdl_window_info *temp = sdl_window_list;
sdl_window_list = temp->m_next;
@@ -361,9 +357,6 @@ void sdl_osd_interface::window_exit()
sdlwindow_sync();
}
- // kill the drawers
- (*draw.exit)();
-
execute_async_wait(&sdlwindow_exit_wt, wp_dummy);
if (multithreading_enabled)
@@ -478,18 +471,11 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_resize_wt )
ASSERT_WINDOW_THREAD();
-#if (SDLMAME_SDL2)
SDL_SetWindowSize(window->sdl_window(), width, height);
-#else
- SDL_FreeSurface(window->m_sdlsurf);
-
- window->m_sdlsurf = SDL_SetVideoMode(width, height, 0,
- SDL_SWSURFACE | SDL_ANYFORMAT | window->m_extra_flags);
-#endif
window->renderer().notify_changed();
osd_free(wp);
- return NULL;
+ return nullptr;
}
void sdl_window_info::resize(INT32 width, INT32 height)
@@ -517,7 +503,7 @@ OSDWORK_CALLBACK( sdl_window_info::notify_changed_wt )
window->renderer().notify_changed();
osd_free(wp);
- return NULL;
+ return nullptr;
}
void sdl_window_info::notify_changed()
@@ -547,7 +533,7 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt )
// if we are in debug mode, never go full screen
if (window->machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)
- return NULL;
+ return nullptr;
// If we are going fullscreen (leaving windowed) remember our windowed size
if (!window->fullscreen())
@@ -555,11 +541,9 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt )
window->m_windowed_dim = window->get_size();
}
- window->renderer().destroy();
- global_free(window->m_renderer);
- window->m_renderer = NULL;
+ delete window->m_renderer;
+ window->m_renderer = nullptr;
-#if (SDLMAME_SDL2)
bool is_osx = false;
#ifdef SDLMAME_MACOSX
// FIXME: This is weird behaviour and certainly a bug in SDL
@@ -572,25 +556,16 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt )
SDL_SetWindowFullscreen(window->sdl_window(), SDL_WINDOW_FULLSCREEN); // Try to set mode
}
SDL_DestroyWindow(window->sdl_window());
-#else
- if (window->m_sdlsurf)
- {
- SDL_FreeSurface(window->m_sdlsurf);
- window->m_sdlsurf = NULL;
- }
-#endif
-
-
sdlinput_release_keys();
- window->set_renderer(draw.create(window));
+ window->set_renderer(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(window)));
// toggle the window mode
window->set_fullscreen(!window->fullscreen());
complete_create_wt(param, 0);
- return NULL;
+ return nullptr;
}
void sdl_window_info::toggle_full_screen()
@@ -647,7 +622,6 @@ void sdl_window_info::update_cursor_state()
c=SDL_CreateCursor(data, data, 8, 8, 0, 0);
SDL_SetCursor(c);
#else
-#if (SDLMAME_SDL2)
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
@@ -668,33 +642,9 @@ void sdl_window_info::update_cursor_state()
SDL_SetWindowGrab(sdl_window(), SDL_TRUE);
SDL_SetRelativeMouseMode(SDL_TRUE);
}
- SDL_SetCursor(NULL); // Force an update in case the underlying driver has changed visibility
- }
-
-#else
- // do not do mouse capture if the debugger's enabled to avoid
- // the possibility of losing control
- if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
- {
- if ( fullscreen() || sdlinput_should_hide_mouse() )
- {
- SDL_ShowCursor(SDL_DISABLE);
- if (!SDL_WM_GrabInput(SDL_GRAB_QUERY))
- {
- SDL_WM_GrabInput(SDL_GRAB_ON);
- }
- }
- else
- {
- SDL_ShowCursor(SDL_ENABLE);
- if (SDL_WM_GrabInput(SDL_GRAB_QUERY))
- {
- SDL_WM_GrabInput(SDL_GRAB_OFF);
- }
- }
+ SDL_SetCursor(nullptr); // Force an update in case the underlying driver has changed visibility
}
#endif
-#endif
}
OSDWORK_CALLBACK( sdl_window_info::update_cursor_state_wt )
@@ -705,7 +655,7 @@ OSDWORK_CALLBACK( sdl_window_info::update_cursor_state_wt )
window->update_cursor_state();
osd_free(wp);
- return NULL;
+ return nullptr;
}
int sdl_window_info::xy_to_render_target(int x, int y, int *xt, int *yt)
@@ -734,7 +684,7 @@ int sdl_window_info::window_init()
*last_window_ptr = this;
last_window_ptr = &this->m_next;
- set_renderer(draw.create(this));
+ set_renderer(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this)));
// create an event that we can use to skip blitting
m_rendered_event = osd_event_alloc(FALSE, TRUE);
@@ -791,9 +741,9 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_video_window_destroy_wt )
ASSERT_WINDOW_THREAD();
// free the textures etc
- window->renderer().destroy();
+ global_free(window->m_renderer);
+ window->m_renderer = nullptr;
-#if (SDLMAME_SDL2)
if (window->fullscreen() && video_config.switchres)
{
SDL_SetWindowFullscreen(window->sdl_window(), 0); // Try to set mode
@@ -801,20 +751,12 @@ OSDWORK_CALLBACK( sdl_window_info::sdlwindow_video_window_destroy_wt )
SDL_SetWindowFullscreen(window->sdl_window(), SDL_WINDOW_FULLSCREEN); // Try to set mode
}
SDL_DestroyWindow(window->sdl_window());
-#else
- if (window->m_sdlsurf)
- {
- SDL_FreeSurface(window->m_sdlsurf);
- window->m_sdlsurf = NULL;
- }
-#endif
-
// release all keys ...
sdlinput_release_keys();
osd_free(wp);
- return NULL;
+ return nullptr;
}
void sdl_window_info::destroy()
@@ -830,7 +772,7 @@ void sdl_window_info::destroy()
//osd_event_wait(window->rendered_event, osd_ticks_per_second()*10);
// remove us from the list
- for (prevptr = &sdl_window_list; *prevptr != NULL; prevptr = &(*prevptr)->m_next)
+ for (prevptr = &sdl_window_list; *prevptr != nullptr; prevptr = &(*prevptr)->m_next)
if (*prevptr == this)
{
*prevptr = this->m_next;
@@ -853,7 +795,6 @@ void sdl_window_info::destroy()
// pick_best_mode
//============================================================
-#if SDLMAME_SDL2
osd_dim sdl_window_info::pick_best_mode()
{
int minimum_width, minimum_height, target_width, target_height;
@@ -922,82 +863,6 @@ osd_dim sdl_window_info::pick_best_mode()
}
return ret;
}
-#else
-osd_dim sdl_window_info::pick_best_mode()
-{
- int minimum_width, minimum_height, target_width, target_height;
- int i;
- float size_score, best_score = 0.0f;
- int best_width = 0, best_height = 0;
- SDL_Rect **modes;
-
- // determine the minimum width/height for the selected target
- m_target->compute_minimum_size(minimum_width, minimum_height);
-
- // use those as the target for now
- target_width = minimum_width * MAX(1, prescale());
- target_height = minimum_height * MAX(1, prescale());
-
- // if we're not stretching, allow some slop on the minimum since we can handle it
- {
- minimum_width -= 4;
- minimum_height -= 4;
- }
-
-#if 1 // defined(SDLMAME_WIN32)
- /*
- * We need to do this here. If SDL_ListModes is
- * called in init_monitors, the call will crash
- * on win32
- */
- modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_DOUBLEBUF);
-#else
- modes = window->m_monitor->modes;
-#endif
-
- if (modes == (SDL_Rect **)0)
- {
- osd_printf_error("SDL: No modes available?!\n");
- exit(-1);
- }
- else if (modes == (SDL_Rect **)-1) // all modes are possible
- {
- return osd_dim(m_win_config.width, m_win_config.height);
- }
- else
- {
- for (i = 0; modes[i]; ++i)
- {
- // compute initial score based on difference between target and current
- size_score = 1.0f / (1.0f + fabsf((INT32)modes[i]->w - target_width) + fabsf((INT32)modes[i]->h - target_height));
-
- // if the mode is too small, give a big penalty
- if (modes[i]->w < minimum_width || modes[i]->h < minimum_height)
- size_score *= 0.01f;
-
- // if mode is smaller than we'd like, it only scores up to 0.1
- if (modes[i]->w < target_width || modes[i]->h < target_height)
- size_score *= 0.1f;
-
- // if we're looking for a particular mode, that's a winner
- if (modes[i]->w == m_win_config.width && modes[i]->h == m_win_config.height)
- size_score = 2.0f;
-
- osd_printf_verbose("%4dx%4d -> %f\n", (int)modes[i]->w, (int)modes[i]->h, size_score);
-
- // best so far?
- if (size_score > best_score)
- {
- best_score = size_score;
- best_width = modes[i]->w;
- best_height = modes[i]->h;
- }
-
- }
- }
- return osd_dim(best_width, best_height);
-}
-#endif
//============================================================
// sdlwindow_video_window_update
@@ -1015,7 +880,7 @@ void sdl_window_info::update()
execute_async(&update_cursor_state_wt, worker_param(this));
// if we're visible and running and not in the middle of a resize, draw
- if (m_target != NULL)
+ if (m_target != nullptr)
{
int tempwidth, tempheight;
@@ -1142,8 +1007,6 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt )
*/
osd_printf_verbose("Enter sdl_info::create\n");
-#if (SDLMAME_SDL2)
-
if (window->renderer().has_flags(osd_renderer::FLAG_NEEDS_OPENGL))
{
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
@@ -1181,7 +1044,7 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt )
//window().sdl_window() = SDL_CreateWindow(window().m_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
// width, height, m_extra_flags);
- if ( window->m_sdl_window == NULL )
+ if ( window->m_sdl_window == nullptr )
{
if (window->renderer().has_flags(osd_renderer::FLAG_NEEDS_OPENGL))
osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError());
@@ -1212,7 +1075,7 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt )
}
else
{
- //SDL_SetWindowDisplayMode(window().sdl_window(), NULL); // Use desktop
+ //SDL_SetWindowDisplayMode(window().sdl_window(), nullptr); // Use desktop
}
// show window
@@ -1227,52 +1090,10 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt )
SDL_SetWindowGrab(window->sdl_window(), SDL_TRUE);
#endif
-#else
- window->m_extra_flags = (window->fullscreen() ? SDL_FULLSCREEN : SDL_RESIZABLE);
-
- if (window->renderer().has_flags(osd_renderer::FLAG_NEEDS_DOUBLEBUF))
- window->m_extra_flags |= SDL_DOUBLEBUF;
- if (window->renderer().has_flags(osd_renderer::FLAG_NEEDS_ASYNCBLIT))
- window->m_extra_flags |= SDL_ASYNCBLIT;
-
- if (window->renderer().has_flags(osd_renderer::FLAG_NEEDS_OPENGL))
- {
- window->m_extra_flags |= SDL_DOUBLEBUF | SDL_OPENGL;
- SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
- #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN))
- SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
- #endif
- // load_gl_lib(window->machine());
- }
-
- // create the SDL surface (which creates the window in windowed mode)
-#if 0
- window->m_sdlsurf = SDL_SetVideoMode(tempwidth, tempheight,
- 0, SDL_OPENGL | SDL_FULLSCREEN);// | window->m_extra_flags);
- if (!window->m_sdlsurf)
- printf("completely failed\n");
-#endif
- window->m_sdlsurf = SDL_SetVideoMode(temp.width(), temp.height(),
- 0, SDL_SWSURFACE | SDL_ANYFORMAT | window->m_extra_flags);
-
- if (!window->m_sdlsurf)
- {
- osd_printf_error("SDL Error: %s\n", SDL_GetError());
- return (void *) &result[1];
- }
- if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(window->m_sdlsurf->flags & SDL_OPENGL) )
- {
- osd_printf_error("OpenGL not supported on this driver!\n");
- return (void *) &result[1];
- }
- // set the window title
- SDL_WM_SetCaption(window->m_title, "SDLMAME");
-#endif
-
- // set main window
+ // set main window
if (window->m_index > 0)
{
- for (auto w = sdl_window_list; w != NULL; w = w->m_next)
+ for (auto w = sdl_window_list; w != nullptr; w = w->m_next)
{
if (w->m_index == 0)
{
@@ -1359,7 +1180,7 @@ OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt )
int scrnum = 0;
int is_vector = 0;
screen_device_iterator iter(window->machine().root_device());
- for (const screen_device *screen = iter.first(); screen != NULL; screen = iter.next())
+ for (const screen_device *screen = iter.first(); screen != nullptr; screen = iter.next())
{
if (scrnum == window->m_index)
{
@@ -1382,7 +1203,7 @@ OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt )
window->m_primlist = wp->list();
// if no bitmap, just fill
- if (window->m_primlist == NULL)
+ if (window->m_primlist == nullptr)
{
}
// otherwise, render with our drawing system
@@ -1398,7 +1219,7 @@ OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt )
osd_event_set(window->m_rendered_event);
osd_free(wp);
- return NULL;
+ return nullptr;
}
int sdl_window_info::wnd_extra_width()
diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h
index c890b6c0ff2..f10bf6fbd92 100644
--- a/src/osd/sdl/window.h
+++ b/src/osd/sdl/window.h
@@ -38,20 +38,13 @@ public:
const osd_window_config *config)
: osd_window(), m_next(NULL),
// Following three are used by input code to defer resizes
-#if (SDLMAME_SDL2)
m_resize_width(0),
m_resize_height(0),
m_last_resize(0),
-#endif
m_minimum_dim(0,0),
m_windowed_dim(0,0),
m_rendered_event(0), m_target(0),
-#if (SDLMAME_SDL2)
m_sdl_window(NULL),
-
-#else
- m_sdlsurf(NULL),
-#endif
m_machine(a_machine), m_monitor(a_monitor), m_fullscreen(0)
{
m_win_config = *config;
@@ -81,13 +74,9 @@ public:
osd_dim get_size() override
{
-#if (SDLMAME_SDL2)
int w=0; int h=0;
SDL_GetWindowSize(m_sdl_window, &w, &h);
return osd_dim(w,h);
-#else
- return osd_dim(m_sdlsurf->w, m_sdlsurf->h);
-#endif
}
int xy_to_render_target(int x, int y, int *xt, int *yt);
@@ -97,11 +86,7 @@ public:
int fullscreen() const override { return m_fullscreen; }
render_target *target() override { return m_target; }
-#if (SDLMAME_SDL2)
SDL_Window *sdl_window() override { return m_sdl_window; }
-#else
- SDL_Surface *sdl_surface() { return m_sdlsurf; }
-#endif
osd_dim blit_surface_size() override;
int prescale() const { return m_prescale; }
@@ -109,12 +94,10 @@ public:
// Pointer to next window
sdl_window_info * m_next;
-#if (SDLMAME_SDL2)
// These are used in combine resizing events ... #if SDL13_COMBINE_RESIZE
int m_resize_width;
int m_resize_height;
osd_ticks_t m_last_resize;
-#endif
private:
// window handle and info
@@ -129,15 +112,10 @@ private:
osd_event * m_rendered_event;
render_target * m_target;
-#if (SDLMAME_SDL2)
// Needs to be here as well so we can identify window
SDL_Window *m_sdl_window;
// Original display_mode
SDL_DisplayMode m_original_mode;
-#else
- // SDL surface
- SDL_Surface *m_sdlsurf;
-#endif
int m_extra_flags;
@@ -183,7 +161,6 @@ private:
struct osd_draw_callbacks
{
osd_renderer *(*create)(osd_window *window);
- void (*exit)(void);
};
//============================================================
@@ -201,8 +178,6 @@ extern sdl_window_info *sdl_window_list;
// PROTOTYPES - drawsdl.c
//============================================================
-int drawsdl_init(osd_draw_callbacks *callbacks);
-const char *drawsdl_scale_mode_str(int index);
int drawsdl_scale_mode(const char *s);
//============================================================
diff --git a/src/osd/windows/video.cpp b/src/osd/windows/video.cpp
index b4f665a2135..6406221a471 100644
--- a/src/osd/windows/video.cpp
+++ b/src/osd/windows/video.cpp
@@ -12,6 +12,7 @@
// MAME headers
#include "emu.h"
+#include "ui/ui.h"
#include "emuopts.h"
#include "render.h"
#include "uiinput.h"
@@ -23,6 +24,8 @@
#include "input.h"
#include "strconv.h"
+#include "modules/osdwindow.h"
+
//============================================================
// CONSTANTS
//============================================================
@@ -64,8 +67,6 @@ static osd_window_config windows[MAX_WINDOWS]; // configuration data pe
bool windows_osd_interface::video_init()
{
- int index;
-
// extract data from the options
extract_video_config();
@@ -77,14 +78,25 @@ bool windows_osd_interface::video_init()
// create the windows
windows_options &options = downcast<windows_options &>(machine().options());
- for (index = 0; index < video_config.numscreens; index++)
+ for (int index = 0; index < video_config.numscreens; index++)
+ {
win_window_info::create(machine(), index, osd_monitor_info::pick_monitor(options, index), &windows[index]);
+ }
+
if (video_config.mode != VIDEO_MODE_NONE)
SetForegroundWindow(win_window_list->m_hwnd);
return true;
}
+//============================================================
+// get_slider_list
+//============================================================
+
+slider_state *windows_osd_interface::get_slider_list()
+{
+ return m_sliders;
+}
//============================================================
// video_exit
@@ -181,6 +193,8 @@ void windows_osd_interface::update(bool skip_redraw)
// ping the watchdog on each update
winmain_watchdog_ping();
+ update_slider_list();
+
// if we're not skipping this redraw, update all windows
if (!skip_redraw)
{
@@ -266,8 +280,9 @@ static void init_monitors(void)
// pick_monitor
//============================================================
-osd_monitor_info *osd_monitor_info::pick_monitor(windows_options &options, int index)
+osd_monitor_info *osd_monitor_info::pick_monitor(osd_options &osdopts, int index)
{
+ windows_options &options = reinterpret_cast<windows_options &>(osdopts);
osd_monitor_info *monitor;
const char *scrname, *scrname2;
int moncount = 0;
@@ -373,14 +388,10 @@ void windows_osd_interface::extract_video_config()
video_config.mode = VIDEO_MODE_D3D;
else if (strcmp(stemp, "auto") == 0)
video_config.mode = VIDEO_MODE_D3D;
- else if (strcmp(stemp, "ddraw") == 0)
- video_config.mode = VIDEO_MODE_DDRAW;
else if (strcmp(stemp, "gdi") == 0)
video_config.mode = VIDEO_MODE_GDI;
-#if defined (USE_BGFX)
else if (strcmp(stemp, "bgfx") == 0)
video_config.mode = VIDEO_MODE_BGFX;
-#endif
else if (strcmp(stemp, "none") == 0)
{
video_config.mode = VIDEO_MODE_NONE;
@@ -401,9 +412,6 @@ void windows_osd_interface::extract_video_config()
video_config.triplebuf = options().triple_buffer();
video_config.switchres = options().switch_res();
- // ddraw options: extract the data
- video_config.hwstretch = options().hwstretch();
-
if (video_config.prescale < 1 || video_config.prescale > 3)
{
osd_printf_warning("Invalid prescale option, reverting to '1'\n");
diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h
index 9215dc189bf..e3c895c1726 100644
--- a/src/osd/windows/video.h
+++ b/src/osd/windows/video.h
@@ -11,6 +11,7 @@
#include "render.h"
#include "winmain.h"
+#include "modules/osdwindow.h"
//============================================================
// CONSTANTS
@@ -18,132 +19,17 @@
#define MAX_WINDOWS 4
-enum {
- VIDEO_MODE_NONE,
- VIDEO_MODE_GDI,
- VIDEO_MODE_DDRAW,
-#if defined (USE_BGFX)
- VIDEO_MODE_BGFX,
-#endif
-#if (USE_OPENGL)
- VIDEO_MODE_OPENGL,
-#endif
- VIDEO_MODE_D3D
-};
-
#define GLSL_SHADER_MAX 10
//============================================================
// TYPE DEFINITIONS
//============================================================
-class osd_dim
-{
-public:
- osd_dim(const int &w, const int &h)
- : m_w(w), m_h(h)
- {
- }
- int width() const { return m_w; }
- int height() const { return m_h; }
-
- bool operator!=(const osd_dim &other) { return (m_w != other.width()) || (m_h != other.height()); }
- bool operator==(const osd_dim &other) { return (m_w == other.width()) && (m_h == other.height()); }
-private:
- int m_w;
- int m_h;
-};
-
-class osd_rect
-{
-public:
- osd_rect()
- : m_x(0), m_y(0), m_d(0,0)
- {
- }
- osd_rect(const int x, const int y, const int &w, const int &h)
- : m_x(x), m_y(y), m_d(w,h)
- {
- }
- osd_rect(const int x, const int y, const osd_dim &d)
- : m_x(x), m_y(y), m_d(d)
- {
- }
- int top() const { return m_y; }
- int left() const { return m_x; }
- int width() const { return m_d.width(); }
- int height() const { return m_d.height(); }
-
- osd_dim dim() const { return m_d; }
-
- int bottom() const { return m_y + m_d.height(); }
- int right() const { return m_x + m_d.width(); }
-
- osd_rect move_by(int dx, int dy) const { return osd_rect(m_x + dx, m_y + dy, m_d); }
- osd_rect resize(int w, int h) const { return osd_rect(m_x, m_y, w, h); }
-
-private:
- int m_x;
- int m_y;
- osd_dim m_d;
-};
-
inline osd_rect RECT_to_osd_rect(const RECT &r)
{
return osd_rect(r.left, r.top, r.right - r.left, r.bottom - r.top);
}
-class osd_monitor_info
-{
-public:
-
-#if 0
- osd_monitor_info()
- : m_next(NULL), m_handle(NULL), m_aspect(0.0f)
- {
- strcpy(m_name, "");
- }
-#endif
- osd_monitor_info(void *handle, const char *monitor_device, float aspect)
- : m_next(NULL), m_handle(handle), m_aspect(aspect)
- {
- strncpy(m_name, monitor_device, ARRAY_LENGTH(m_name) - 1);
- }
-
- virtual ~osd_monitor_info() { }
-
- virtual void refresh() = 0;
-
- const void *oshandle() { return m_handle; }
-
- const osd_rect &position_size() { return m_pos_size; }
- const osd_rect &usuable_position_size() { return m_usuable_pos_size; }
-
- const char *devicename() { return m_name[0] ? m_name : "UNKNOWN"; }
-
- float aspect();
-
- void set_aspect(const float a) { m_aspect = a; }
- bool is_primary() { return m_is_primary; }
-
- osd_monitor_info * next() { return m_next; } // pointer to next monitor in list
-
- static osd_monitor_info *pick_monitor(windows_options &options, int index);
- static osd_monitor_info *list;
-
- // FIXME: should be private!
- osd_monitor_info *m_next; // pointer to next monitor in list
-protected:
- osd_rect m_pos_size;
- osd_rect m_usuable_pos_size;
- bool m_is_primary;
- char m_name[64];
-private:
-
- void * m_handle; // handle to the monitor
- float m_aspect; // computed/configured aspect ratio of the physical device
-};
-
class win_monitor_info : public osd_monitor_info
{
public:
@@ -180,9 +66,6 @@ struct osd_video_config
int fullstretch; // FXIME: implement in windows!
- // ddraw options
- int hwstretch; // stretch using the hardware
-
// d3d, accel, opengl
int filter; // enable filtering
//int filter; // enable filtering, disabled if glsl_filter>0
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index f39199d7b50..ee78e574a67 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -12,12 +12,6 @@
// Needed for RAW Input
#define WM_INPUT 0x00FF
-// standard windows headers
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <windowsx.h>
-#include <mmsystem.h>
-
// standard C headers
#include <process.h>
@@ -34,15 +28,12 @@
#include "winutil.h"
-extern int drawnone_init(running_machine &machine, osd_draw_callbacks *callbacks);
-extern int drawgdi_init(running_machine &machine, osd_draw_callbacks *callbacks);
-extern int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks);
-extern int drawd3d_init(running_machine &machine, osd_draw_callbacks *callbacks);
-#if defined(USE_BGFX)
-extern int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks);
-#endif
+#include "modules/render/drawbgfx.h"
+#include "modules/render/drawnone.h"
+#include "modules/render/drawd3d.h"
+#include "modules/render/drawgdi.h"
#if (USE_OPENGL)
-extern int drawogl_init(running_machine &machine, osd_draw_callbacks *callbacks);
+#include "modules/render/drawogl.h"
#endif
//============================================================
@@ -110,8 +101,6 @@ static DWORD window_threadid;
static DWORD last_update_time;
-static osd_draw_callbacks draw;
-
static HANDLE ui_pause_event;
static HANDLE window_thread_ready_event;
@@ -186,7 +175,7 @@ bool windows_osd_interface::window_init()
create_window_class();
// create an event to signal UI pausing
- ui_pause_event = CreateEvent(NULL, TRUE, FALSE, NULL);
+ ui_pause_event = CreateEvent(nullptr, TRUE, FALSE, nullptr);
if (!ui_pause_event)
fatalerror("Failed to create pause event\n");
@@ -194,14 +183,14 @@ bool windows_osd_interface::window_init()
if (multithreading_enabled)
{
// create an event to signal when the window thread is ready
- window_thread_ready_event = CreateEvent(NULL, TRUE, FALSE, NULL);
+ window_thread_ready_event = CreateEvent(nullptr, TRUE, FALSE, nullptr);
if (!window_thread_ready_event)
fatalerror("Failed to create window thread ready event\n");
// create a thread to run the windows from
- temp = _beginthreadex(NULL, 0, win_window_info::thread_entry, NULL, 0, (unsigned *)&window_threadid);
+ temp = _beginthreadex(nullptr, 0, win_window_info::thread_entry, nullptr, 0, (unsigned *)&window_threadid);
window_thread = (HANDLE)temp;
- if (window_thread == NULL)
+ if (window_thread == nullptr)
fatalerror("Failed to create window thread\n");
// set the thread priority equal to the main MAME thread
@@ -215,36 +204,108 @@ bool windows_osd_interface::window_init()
window_threadid = main_threadid;
}
- // initialize the drawers
- if (video_config.mode == VIDEO_MODE_D3D)
- {
- if (drawd3d_init(machine(), &draw))
- video_config.mode = VIDEO_MODE_GDI;
- }
- if (video_config.mode == VIDEO_MODE_DDRAW)
- {
- if (drawdd_init(machine(), &draw))
- video_config.mode = VIDEO_MODE_GDI;
- }
- if (video_config.mode == VIDEO_MODE_GDI)
- drawgdi_init(machine(), &draw);
-#if defined(USE_BGFX)
- if (video_config.mode == VIDEO_MODE_BGFX)
- drawbgfx_init(machine(), &draw);
+ const int fallbacks[VIDEO_MODE_COUNT] = {
+ -1, // NONE -> no fallback
+ VIDEO_MODE_NONE, // GDI -> NONE
+ VIDEO_MODE_D3D, // BGFX -> D3D
+#if (USE_OPENGL)
+ VIDEO_MODE_GDI, // OPENGL -> GDI
#endif
- if (video_config.mode == VIDEO_MODE_NONE)
- drawnone_init(machine(), &draw);
+ -1, // No SDL2ACCEL on Windows OSD
#if (USE_OPENGL)
- if (video_config.mode == VIDEO_MODE_OPENGL)
- drawogl_init(machine(), &draw);
+ VIDEO_MODE_OPENGL, // D3D -> OPENGL
+#else
+ VIDEO_MODE_GDI, // D3D -> GDI
#endif
+ -1 // No SOFT on Windows OSD
+ };
+
+ int current_mode = video_config.mode;
+ while (current_mode != VIDEO_MODE_NONE)
+ {
+ bool error = false;
+ switch(current_mode)
+ {
+ case VIDEO_MODE_NONE:
+ error = renderer_none::init(machine());
+ break;
+ case VIDEO_MODE_GDI:
+ error = renderer_gdi::init(machine());
+ break;
+ case VIDEO_MODE_BGFX:
+ error = renderer_bgfx::init(machine());
+ break;
+#if (USE_OPENGL)
+ case VIDEO_MODE_OPENGL:
+ error = renderer_ogl::init(machine());
+ break;
+#endif
+ case VIDEO_MODE_SDL2ACCEL:
+ fatalerror("SDL2-Accel renderer unavailable on Windows OSD.");
+ break;
+ case VIDEO_MODE_D3D:
+ error = renderer_d3d9::init(machine());
+ break;
+ case VIDEO_MODE_SOFT:
+ fatalerror("SDL1 renderer unavailable on Windows OSD.");
+ break;
+ default:
+ fatalerror("Unknown video mode.");
+ break;
+ }
+ if (error)
+ {
+ current_mode = fallbacks[current_mode];
+ }
+ else
+ {
+ break;
+ }
+ }
+ video_config.mode = current_mode;
+
// set up the window list
last_window_ptr = &win_window_list;
return true;
}
+void windows_osd_interface::update_slider_list()
+{
+ for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next)
+ {
+ if (window->m_renderer && window->m_renderer->sliders_dirty())
+ {
+ build_slider_list();
+ return;
+ }
+ }
+}
+void windows_osd_interface::build_slider_list()
+{
+ m_sliders = nullptr;
+ slider_state *curr = m_sliders;
+ for (win_window_info *info = win_window_list; info != nullptr; info = info->m_next)
+ {
+ slider_state *window_sliders = info->m_renderer->get_slider_list();
+ if (window_sliders != nullptr)
+ {
+ if (m_sliders == nullptr)
+ {
+ m_sliders = curr = window_sliders;
+ }
+ else
+ {
+ while (curr->next != nullptr)
+ {
+ curr = curr->next;
+ }
+ curr->next = window_sliders;
+ }
+ }
+ }
+}
//============================================================
// winwindow_exit
@@ -256,7 +317,7 @@ void windows_osd_interface::window_exit()
assert(GetCurrentThreadId() == main_threadid);
// free all the windows
- while (win_window_list != NULL)
+ while (win_window_list != nullptr)
{
win_window_info *temp = win_window_list;
win_window_list = temp->m_next;
@@ -264,9 +325,6 @@ void windows_osd_interface::window_exit()
global_free(temp);
}
- // kill the drawers
- (*draw.exit)();
-
// if we're multithreaded, clean up the window thread
if (multithreading_enabled)
{
@@ -288,24 +346,23 @@ void windows_osd_interface::window_exit()
while (ShowCursor(TRUE) < 0) ;
}
-
win_window_info::win_window_info(running_machine &machine)
- : osd_window(), m_next(NULL),
+ : osd_window(), m_next(nullptr),
m_init_state(0),
m_startmaximized(0),
m_isminimized(0),
m_ismaximized(0),
- m_monitor(NULL),
+ m_monitor(nullptr),
m_fullscreen(0),
m_fullscreen_safe(0),
m_aspect(0),
- m_target(NULL),
+ m_target(nullptr),
m_targetview(0),
m_targetorient(0),
m_lastclicktime(0),
m_lastclickx(0),
m_lastclicky(0),
- m_renderer(NULL),
+ m_renderer(nullptr),
m_machine(machine)
{
memset(m_title,0,sizeof(m_title));
@@ -346,9 +403,7 @@ void winwindow_process_events_periodic(running_machine &machine)
static BOOL is_mame_window(HWND hwnd)
{
- win_window_info *window;
-
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (win_window_info *window = win_window_list; window != nullptr; window = window->m_next)
if (window->m_hwnd == hwnd)
return TRUE;
@@ -378,12 +433,12 @@ void winwindow_process_events(running_machine &machine, int ingame, bool nodispa
WaitMessage();
// loop over all messages in the queue
- while (PeekMessage(&message, NULL, 0, 0, PM_REMOVE))
+ while (PeekMessage(&message, nullptr, 0, 0, PM_REMOVE))
{
// prevent debugger windows from getting messages during reset
int dispatch = TRUE && !nodispatch;
- if (message.hwnd == NULL || is_mame_window(message.hwnd))
+ if (message.hwnd == nullptr || is_mame_window(message.hwnd))
{
dispatch = TRUE;
switch (message.message)
@@ -495,7 +550,7 @@ void winwindow_take_snap(void)
assert(GetCurrentThreadId() == main_threadid);
// iterate over windows and request a snap
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (window = win_window_list; window != nullptr; window = window->m_next)
{
window->m_renderer->save();
}
@@ -515,7 +570,7 @@ void winwindow_toggle_fsfx(void)
assert(GetCurrentThreadId() == main_threadid);
// iterate over windows and request a snap
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (window = win_window_list; window != nullptr; window = window->m_next)
{
window->m_renderer->toggle_fsfx();
}
@@ -535,7 +590,7 @@ void winwindow_take_video(void)
assert(GetCurrentThreadId() == main_threadid);
// iterate over windows and request a snap
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (window = win_window_list; window != nullptr; window = window->m_next)
{
window->m_renderer->record();
}
@@ -555,7 +610,7 @@ void winwindow_toggle_full_screen(void)
assert(GetCurrentThreadId() == main_threadid);
// if we are in debug mode, never go full screen
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (window = win_window_list; window != nullptr; window = window->m_next)
if (window->machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)
return;
@@ -563,7 +618,7 @@ void winwindow_toggle_full_screen(void)
video_config.windowed = !video_config.windowed;
// iterate over windows and toggle their fullscreen state
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (window = win_window_list; window != nullptr; window = window->m_next)
SendMessage(window->m_hwnd, WM_USER_SET_FULLSCREEN, !video_config.windowed, 0);
SetForegroundWindow(win_window_list->m_hwnd);
}
@@ -581,7 +636,7 @@ BOOL winwindow_has_focus(void)
win_window_info *window;
// see if one of the video windows has focus
- for (window = win_window_list; window != NULL; window = window->m_next)
+ for (window = win_window_list; window != nullptr; window = window->m_next)
if (focuswnd == window->m_hwnd)
return TRUE;
@@ -631,7 +686,7 @@ void winwindow_update_cursor_state(running_machine &machine)
ShowCursor(FALSE);
// allow cursor to move freely
- ClipCursor(NULL);
+ ClipCursor(nullptr);
if (saved_cursor_pos.x != -1 || saved_cursor_pos.y != -1)
{
SetCursorPos(saved_cursor_pos.x, saved_cursor_pos.y);
@@ -649,13 +704,12 @@ void winwindow_update_cursor_state(running_machine &machine)
void win_window_info::create(running_machine &machine, int index, osd_monitor_info *monitor, const osd_window_config *config)
{
- win_window_info *window, *win;
+ win_window_info *win;
assert(GetCurrentThreadId() == main_threadid);
// allocate a new window object
- window = global_alloc(win_window_info(machine));
- //printf("%d, %d\n", config->width, config->height);
+ win_window_info *window = global_alloc(win_window_info(machine));
window->m_win_config = *config;
window->m_monitor = monitor;
window->m_fullscreen = !video_config.windowed;
@@ -664,7 +718,7 @@ void win_window_info::create(running_machine &machine, int index, osd_monitor_in
// set main window
if (index > 0)
{
- for (auto w = win_window_list; w != NULL; w = w->m_next)
+ for (auto w = win_window_list; w != nullptr; w = w->m_next)
{
if (w->m_index == 0)
{
@@ -675,7 +729,7 @@ void win_window_info::create(running_machine &machine, int index, osd_monitor_in
}
// see if we are safe for fullscreen
window->m_fullscreen_safe = TRUE;
- for (win = win_window_list; win != NULL; win = win->m_next)
+ for (win = win_window_list; win != nullptr; win = win->m_next)
if (win->m_monitor == monitor)
window->m_fullscreen_safe = FALSE;
@@ -741,7 +795,7 @@ void win_window_info::destroy()
assert(GetCurrentThreadId() == main_threadid);
// remove us from the list
- for (prevptr = &win_window_list; *prevptr != NULL; prevptr = &(*prevptr)->m_next)
+ for (prevptr = &win_window_list; *prevptr != nullptr; prevptr = &(*prevptr)->m_next)
if (*prevptr == this)
{
*prevptr = this->m_next;
@@ -749,7 +803,7 @@ void win_window_info::destroy()
}
// destroy the window
- if (m_hwnd != NULL)
+ if (m_hwnd != nullptr)
SendMessage(m_hwnd, WM_USER_SELF_TERMINATE, 0, 0);
// free the render target
@@ -793,7 +847,7 @@ void win_window_info::update()
}
// if we're visible and running and not in the middle of a resize, draw
- if (m_hwnd != NULL && m_target != NULL && m_renderer != NULL)
+ if (m_hwnd != nullptr && m_target != nullptr && m_renderer != nullptr)
{
bool got_lock = true;
@@ -846,7 +900,7 @@ osd_monitor_info *win_window_info::winwindow_video_window_monitor(const osd_rect
// in window mode, find the nearest
if (!m_fullscreen)
{
- if (proposed != NULL)
+ if (proposed != nullptr)
{
RECT p;
p.top = proposed->top();
@@ -889,7 +943,7 @@ static void create_window_class(void)
wc.lpszClassName = TEXT("MAME");
wc.hInstance = GetModuleHandleUni();
wc.lpfnWndProc = winwindow_video_window_proc_ui;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2));
UnregisterClass(wc.lpszClassName, wc.hInstance);
@@ -1063,8 +1117,6 @@ int win_window_info::wnd_extra_height()
return rect_height(&temprect) - 100;
}
-
-
//============================================================
// thread_entry
// (window thread)
@@ -1075,7 +1127,7 @@ unsigned __stdcall win_window_info::thread_entry(void *param)
MSG message;
// make a bogus user call to make us a message thread
- PeekMessage(&message, NULL, 0, 0, PM_NOREMOVE);
+ PeekMessage(&message, nullptr, 0, 0, PM_NOREMOVE);
// attach our input to the main thread
AttachThreadInput(main_threadid, window_threadid, TRUE);
@@ -1084,11 +1136,11 @@ unsigned __stdcall win_window_info::thread_entry(void *param)
SetEvent(window_thread_ready_event);
// run the message pump
- while (GetMessage(&message, NULL, 0, 0))
+ while (GetMessage(&message, nullptr, 0, 0))
{
int dispatch = TRUE;
- if ((message.hwnd == NULL) || is_mame_window(message.hwnd))
+ if ((message.hwnd == nullptr) || is_mame_window(message.hwnd))
{
switch (message.message)
{
@@ -1170,7 +1222,7 @@ int win_window_info::complete_create()
{
RECT client;
int tempwidth, tempheight;
- HMENU menu = NULL;
+ HMENU menu = nullptr;
HDC dc;
assert(GetCurrentThreadId() == window_threadid);
@@ -1193,11 +1245,11 @@ int win_window_info::complete_create()
m_fullscreen ? FULLSCREEN_STYLE : WINDOW_STYLE,
monitorbounds.left() + 20, monitorbounds.top() + 20,
monitorbounds.left() + 100, monitorbounds.top() + 100,
- NULL,//(win_window_list != NULL) ? win_window_list->m_hwnd : NULL,
+ nullptr,//(win_window_list != nullptr) ? win_window_list->m_hwnd : nullptr,
menu,
GetModuleHandleUni(),
- NULL);
- if (m_hwnd == NULL)
+ nullptr);
+ if (m_hwnd == nullptr)
return 1;
// set window #0 as the focus window for all windows, required for D3D & multimonitor
@@ -1213,7 +1265,7 @@ int win_window_info::complete_create()
// adjust the window position to the initial width/height
tempwidth = (m_win_config.width != 0) ? m_win_config.width : 640;
tempheight = (m_win_config.height != 0) ? m_win_config.height : 480;
- SetWindowPos(m_hwnd, NULL, monitorbounds.left() + 20, monitorbounds.top() + 20,
+ SetWindowPos(m_hwnd, nullptr, monitorbounds.left() + 20, monitorbounds.top() + 20,
monitorbounds.left() + tempwidth + wnd_extra_width(),
monitorbounds.top() + tempheight + wnd_extra_height(),
SWP_NOZORDER);
@@ -1229,9 +1281,14 @@ int win_window_info::complete_create()
if (!m_fullscreen || m_fullscreen_safe)
{
// finish off by trying to initialize DirectX; if we fail, ignore it
- m_renderer = draw.create(this);
+ if (m_renderer != nullptr)
+ {
+ global_free(m_renderer);
+ }
+ m_renderer = osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this));
if (m_renderer->create())
return 1;
+
ShowWindow(m_hwnd, SW_SHOW);
}
@@ -1256,7 +1313,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
win_window_info *window = (win_window_info *)ptr;
// we may get called before SetWindowLongPtr is called
- if (window != NULL)
+ if (window != nullptr)
{
assert(GetCurrentThreadId() == window_threadid);
window->update_minmax_state();
@@ -1352,7 +1409,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
window->m_resize_state = RESIZE_STATE_PENDING;
case WM_EXITMENULOOP:
winwindow_ui_pause_from_window_thread(window->machine(), FALSE);
- InvalidateRect(wnd, NULL, FALSE);
+ InvalidateRect(wnd, nullptr, FALSE);
break;
// get min/max info: set the minimum window size
@@ -1376,7 +1433,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
rect->bottom = r.bottom();
rect->right = r.right();
}
- InvalidateRect(wnd, NULL, FALSE);
+ InvalidateRect(wnd, nullptr, FALSE);
break;
}
@@ -1390,7 +1447,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
return 1;
// most SYSCOMMANDs require us to invalidate the window
- InvalidateRect(wnd, NULL, FALSE);
+ InvalidateRect(wnd, nullptr, FALSE);
// handle maximize
if (cmd == SC_MAXIMIZE)
@@ -1418,15 +1475,11 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
window->machine().schedule_exit();
break;
- // destroy: clean up all attached rendering bits and NULL out our hwnd
+ // destroy: clean up all attached rendering bits and nullptr out our hwnd
case WM_DESTROY:
- if (!(window->m_renderer == NULL))
- {
- window->m_renderer->destroy();
global_free(window->m_renderer);
- window->m_renderer = NULL;
- }
- window->m_hwnd = NULL;
+ window->m_renderer = nullptr;
+ window->m_hwnd = nullptr;
return DefWindowProc(wnd, message, wparam, lparam);
// self redraw: draw ourself in a non-painty way
@@ -1477,7 +1530,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
// set focus: if we're not the primary window, switch back
// commented out ATM because this prevents us from resizing secondary windows
// case WM_SETFOCUS:
-// if (window != win_window_list && win_window_list != NULL)
+// if (window != win_window_list && win_window_list != nullptr)
// SetFocus(win_window_list->m_hwnd);
// break;
@@ -1507,10 +1560,10 @@ void win_window_info::draw_video_contents(HDC dc, int update)
mtlog_add("draw_video_contents: render lock acquired");
// if we're iconic, don't bother
- if (m_hwnd != NULL && !IsIconic(m_hwnd))
+ if (m_hwnd != nullptr && !IsIconic(m_hwnd))
{
// if no bitmap, just fill
- if (m_primlist == NULL)
+ if (m_primlist == nullptr)
{
RECT fill;
GetClientRect(m_hwnd, &fill);
@@ -1796,7 +1849,7 @@ void win_window_info::minimize_window()
osd_rect newrect(bounds.left, bounds.top, newsize );
- SetWindowPos(m_hwnd, NULL, newrect.left(), newrect.top(), newrect.width(), newrect.height(), SWP_NOZORDER);
+ SetWindowPos(m_hwnd, nullptr, newrect.left(), newrect.top(), newrect.width(), newrect.height(), SWP_NOZORDER);
}
@@ -1818,7 +1871,7 @@ void win_window_info::maximize_window()
work.top() + (work.height() - newsize.height()) / 2,
newsize);
- SetWindowPos(m_hwnd, NULL, newrect.left(), newrect.top(), newrect.width(), newrect.height(), SWP_NOZORDER);
+ SetWindowPos(m_hwnd, nullptr, newrect.left(), newrect.top(), newrect.width(), newrect.height(), SWP_NOZORDER);
}
@@ -1849,7 +1902,7 @@ void win_window_info::adjust_window_position_after_major_change()
// in full screen, make sure it covers the primary display
else
{
- osd_monitor_info *monitor = winwindow_video_window_monitor(NULL);
+ osd_monitor_info *monitor = winwindow_video_window_monitor(nullptr);
newrect = monitor->position_size();
}
@@ -1885,9 +1938,8 @@ void win_window_info::set_fullscreen(int fullscreen)
m_fullscreen = fullscreen;
// kill off the drawers
- m_renderer->destroy();
global_free(m_renderer);
- m_renderer = NULL;
+ m_renderer = nullptr;
// hide ourself
ShowWindow(m_hwnd, SW_HIDE);
@@ -1943,7 +1995,12 @@ void win_window_info::set_fullscreen(int fullscreen)
{
if (video_config.mode != VIDEO_MODE_NONE)
ShowWindow(m_hwnd, SW_SHOW);
- m_renderer = draw.create(this);
+
+ if (m_renderer != nullptr)
+ {
+ delete m_renderer;
+ }
+ m_renderer = reinterpret_cast<osd_renderer *>(osd_renderer::make_for_type(video_config.mode, reinterpret_cast<osd_window *>(this)));
if (m_renderer->create())
exit(1);
}
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index 6a925494f93..bc3544ba637 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -9,6 +9,12 @@
#ifndef __WIN_WINDOW__
#define __WIN_WINDOW__
+// standard windows headers
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <windowsx.h>
+#include <mmsystem.h>
+
#include <mutex>
#include "video.h"
#include "render.h"
diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp
index 2a14281f7fc..5a00fe13706 100644
--- a/src/osd/windows/winmain.cpp
+++ b/src/osd/windows/winmain.cpp
@@ -58,15 +58,15 @@ class dynamic_bind
public:
// constructor which looks up the function
dynamic_bind(const TCHAR *dll, const char *symbol)
- : m_function(NULL)
+ : m_function(nullptr)
{
HMODULE module = LoadLibrary(dll);
- if (module != NULL)
+ if (module != nullptr)
m_function = reinterpret_cast<_FunctionPtr>(GetProcAddress(module, symbol));
}
- // bool to test if the function is NULL or not
- operator bool() const { return (m_function != NULL); }
+ // bool to test if the function is nullptr or not
+ operator bool() const { return (m_function != nullptr); }
// dereference to get the underlying pointer
_FunctionPtr operator *() const { return m_function; }
@@ -132,14 +132,14 @@ private:
bool parse_sym_line(const char *line, FPTR &address, std::string &symbol);
bool parse_map_line(const char *line, FPTR &address, std::string &symbol);
void scan_cache_for_address(FPTR address);
- void format_symbol(const char *name, UINT32 displacement, const char *filename = NULL, int linenumber = 0);
+ void format_symbol(const char *name, UINT32 displacement, const char *filename = nullptr, int linenumber = 0);
static FPTR get_text_section_base();
struct cache_entry
{
cache_entry(FPTR address, const char *symbol) :
- m_next(NULL), m_address(address), m_name(symbol) { }
+ m_next(nullptr), m_address(address), m_name(symbol) { }
cache_entry *next() const { return m_next; }
cache_entry * m_next;
@@ -206,11 +206,11 @@ public:
char buffer[1024];
// if we are in fullscreen mode, go to windowed mode
- if ((video_config.windowed == 0) && (win_window_list != NULL))
+ if ((video_config.windowed == 0) && (win_window_list != nullptr))
winwindow_toggle_full_screen();
vsnprintf(buffer, ARRAY_LENGTH(buffer), msg, args);
- win_message_box_utf8(win_window_list ? win_window_list->m_hwnd : NULL, buffer, emulator_info::get_appname(), MB_OK);
+ win_message_box_utf8(win_window_list ? win_window_list->m_hwnd : nullptr, buffer, emulator_info::get_appname(), MB_OK);
}
else
chain_output(channel, msg, args);
@@ -242,8 +242,8 @@ static running_machine *g_current_machine;
static int timeresult = !TIMERR_NOERROR;
static TIMECAPS timecaps;
-static sampling_profiler *profiler = NULL;
-static symbol_manager *symbols = NULL;
+static sampling_profiler *profiler = nullptr;
+static symbol_manager *symbols = nullptr;
bool stack_walker::s_initialized = false;
@@ -267,25 +267,25 @@ static LONG WINAPI exception_filter(struct _EXCEPTION_POINTERS *info);
const options_entry windows_options::s_option_entries[] =
{
// performance options
- { NULL, NULL, OPTION_HEADER, "WINDOWS PERFORMANCE OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "WINDOWS PERFORMANCE OPTIONS" },
{ WINOPTION_PRIORITY "(-15-1)", "0", OPTION_INTEGER, "thread priority for the main game thread; range from -15 to 1" },
{ WINOPTION_PROFILE, "0", OPTION_INTEGER, "enables profiling, specifying the stack depth to track" },
// video options
- { NULL, NULL, OPTION_HEADER, "WINDOWS VIDEO OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "WINDOWS VIDEO OPTIONS" },
{ WINOPTION_MENU, "0", OPTION_BOOLEAN, "enables menu bar if available by UI implementation" },
// DirectDraw-specific options
- { NULL, NULL, OPTION_HEADER, "DIRECTDRAW-SPECIFIC OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "DIRECTDRAW-SPECIFIC OPTIONS" },
{ WINOPTION_HWSTRETCH ";hws", "1", OPTION_BOOLEAN, "enables hardware stretching" },
// post-processing options
- { NULL, NULL, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" },
- { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enables HLSL post-processing (PS3.0 required)" },
- { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" },
- { WINOPTION_HLSL_PRESCALE_X, "0", OPTION_INTEGER, "HLSL pre-scale override factor for X (0 for auto)" },
- { WINOPTION_HLSL_PRESCALE_Y, "0", OPTION_INTEGER, "HLSL pre-scale override factor for Y (0 for auto)" },
- { WINOPTION_HLSL_WRITE, NULL, OPTION_STRING, "enables HLSL AVI writing (huge disk bandwidth suggested)" },
+ { nullptr, nullptr, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" },
+ { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enables HLSL post-processing (PS3.0 required)" },
+ { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" },
+ { WINOPTION_HLSL_PRESCALE_X, "0", OPTION_INTEGER, "HLSL pre-scale override factor for X (0 for auto)" },
+ { WINOPTION_HLSL_PRESCALE_Y, "0", OPTION_INTEGER, "HLSL pre-scale override factor for Y (0 for auto)" },
+ { WINOPTION_HLSL_WRITE, nullptr, OPTION_STRING, "enables HLSL AVI writing (huge disk bandwidth suggested)" },
{ WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" },
{ WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" },
{ WINOPTION_SHADOW_MASK_TILE_MODE, "0", OPTION_INTEGER, "shadow mask tile mode (0 for screen based, 1 for source based)" },
@@ -326,7 +326,7 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_FLOOR";fs_floor", "0.05,0.05,0.05", OPTION_STRING, "signal floor level" },
{ WINOPTION_PHOSPHOR";fs_phosphor", "0.4,0.4,0.4", OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
/* NTSC simulation below this line */
- { NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
{ WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enables YIQ-space HLSL post-processing" },
{ WINOPTION_YIQ_JITTER";yiqj", "0.0", OPTION_FLOAT, "Jitter for the NTSC signal processing" },
{ WINOPTION_YIQ_CCVALUE";yiqcc", "3.57954545", OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" },
@@ -341,11 +341,11 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
/* Vector simulation below this line */
- { NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
{ WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.5", OPTION_FLOAT, "How much length affects vector fade" },
{ WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "500.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
/* Bloom below this line */
- { NULL, NULL, OPTION_HEADER, "BLOOM POST-PROCESSING OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "BLOOM POST-PROCESSING OPTIONS" },
{ WINOPTION_BLOOM_BLEND_MODE, "0", OPTION_INTEGER, "bloom blend mode (0 for addition, 1 for darken)" },
{ WINOPTION_BLOOM_SCALE, "0.25", OPTION_FLOAT, "Intensity factor for bloom" },
{ WINOPTION_BLOOM_OVERDRIVE, "1.0,1.0,1.0", OPTION_STRING, "Overdrive factor for bloom" },
@@ -362,18 +362,18 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_BLOOM_LEVEL10_WEIGHT, "0.01", OPTION_FLOAT, "Bloom level 10 (1x1 target) weight" },
// full screen options
- { NULL, NULL, OPTION_HEADER, "FULL SCREEN OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "FULL SCREEN OPTIONS" },
{ WINOPTION_TRIPLEBUFFER ";tb", "0", OPTION_BOOLEAN, "enables triple buffering" },
{ WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", OPTION_FLOAT, "brightness value in full screen mode" },
{ WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", OPTION_FLOAT, "contrast value in full screen mode" },
{ WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", OPTION_FLOAT, "gamma value in full screen mode" },
// input options
- { NULL, NULL, OPTION_HEADER, "INPUT DEVICE OPTIONS" },
+ { nullptr, nullptr, OPTION_HEADER, "INPUT DEVICE OPTIONS" },
{ WINOPTION_GLOBAL_INPUTS ";global_inputs", "0", OPTION_BOOLEAN, "enables global inputs" },
{ WINOPTION_DUAL_LIGHTGUN ";dual", "0", OPTION_BOOLEAN, "enables dual lightgun input" },
- { NULL }
+ { nullptr }
};
//**************************************************************************
@@ -389,9 +389,9 @@ int main(int argc, char *argv[])
{
// use small output buffers on non-TTYs (i.e. pipes)
if (!isatty(fileno(stdout)))
- setvbuf(stdout, (char *) NULL, _IOFBF, 64);
+ setvbuf(stdout, (char *) nullptr, _IOFBF, 64);
if (!isatty(fileno(stderr)))
- setvbuf(stderr, (char *) NULL, _IOFBF, 64);
+ setvbuf(stderr, (char *) nullptr, _IOFBF, 64);
// initialize common controls
InitCommonControls();
@@ -434,7 +434,7 @@ int main(int argc, char *argv[])
osd_output::pop(&winerror);
}
// free symbols
- symbols = NULL;
+ symbols = nullptr;
return result;
}
@@ -469,7 +469,7 @@ static BOOL WINAPI control_handler(DWORD type)
// if we don't have a machine yet, or if we are handling ctrl+c/ctrl+break,
// just terminate hard, without throwing or handling any atexit stuff
- if (g_current_machine == NULL || type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT)
+ if (g_current_machine == nullptr || type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT)
{
fprintf(stderr, ", exiting\n");
TerminateProcess(GetCurrentProcess(), MAMERR_FATALERROR);
@@ -505,7 +505,9 @@ static void output_oslog(const running_machine &machine, const char *buffer)
//============================================================
windows_osd_interface::windows_osd_interface(windows_options &options)
-: osd_common_t(options), m_options(options)
+ : osd_common_t(options)
+ , m_options(options)
+ , m_sliders(nullptr)
{
}
@@ -525,11 +527,10 @@ windows_osd_interface::~windows_osd_interface()
void windows_osd_interface::video_register()
{
- video_options_add("gdi", NULL);
- video_options_add("ddraw", NULL);
- video_options_add("d3d", NULL);
- video_options_add("bgfx", NULL);
- //video_options_add("auto", NULL); // making d3d video default one
+ video_options_add("gdi", nullptr);
+ video_options_add("d3d", nullptr);
+ video_options_add("bgfx", nullptr);
+ //video_options_add("auto", nullptr); // making d3d video default one
}
//============================================================
@@ -590,7 +591,7 @@ void windows_osd_interface::init(running_machine &machine)
// notify listeners of screen configuration
std::string tempstring;
- for (win_window_info *info = win_window_list; info != NULL; info = info->m_next)
+ for (win_window_info *info = win_window_list; info != nullptr; info = info->m_next)
{
strprintf(tempstring, "Orientation(%s)", info->m_monitor->devicename());
machine.output().set_value(tempstring.c_str(), info->m_targetorient);
@@ -610,12 +611,12 @@ void windows_osd_interface::init(running_machine &machine)
int watchdog = options.watchdog();
if (watchdog != 0)
{
- watchdog_reset_event = CreateEvent(NULL, FALSE, FALSE, NULL);
- assert_always(watchdog_reset_event != NULL, "Failed to create watchdog reset event");
- watchdog_exit_event = CreateEvent(NULL, TRUE, FALSE, NULL);
- assert_always(watchdog_exit_event != NULL, "Failed to create watchdog exit event");
- watchdog_thread = CreateThread(NULL, 0, watchdog_thread_entry, (LPVOID)(FPTR)watchdog, 0, NULL);
- assert_always(watchdog_thread != NULL, "Failed to create watchdog thread");
+ watchdog_reset_event = CreateEvent(nullptr, FALSE, FALSE, nullptr);
+ assert_always(watchdog_reset_event != nullptr, "Failed to create watchdog reset event");
+ watchdog_exit_event = CreateEvent(nullptr, TRUE, FALSE, nullptr);
+ assert_always(watchdog_exit_event != nullptr, "Failed to create watchdog exit event");
+ watchdog_thread = CreateThread(nullptr, 0, watchdog_thread_entry, (LPVOID)(FPTR)watchdog, 0, nullptr);
+ assert_always(watchdog_thread != nullptr, "Failed to create watchdog thread");
}
// create and start the profiler
@@ -640,7 +641,7 @@ void windows_osd_interface::init(running_machine &machine)
void windows_osd_interface::osd_exit()
{
// no longer have a machine
- g_current_machine = NULL;
+ g_current_machine = nullptr;
// cleanup sockets
win_cleanup_sockets();
@@ -648,20 +649,20 @@ void windows_osd_interface::osd_exit()
osd_common_t::osd_exit();
// take down the watchdog thread if it exists
- if (watchdog_thread != NULL)
+ if (watchdog_thread != nullptr)
{
SetEvent(watchdog_exit_event);
WaitForSingleObject(watchdog_thread, INFINITE);
CloseHandle(watchdog_reset_event);
CloseHandle(watchdog_exit_event);
CloseHandle(watchdog_thread);
- watchdog_reset_event = NULL;
- watchdog_exit_event = NULL;
- watchdog_thread = NULL;
+ watchdog_reset_event = nullptr;
+ watchdog_exit_event = nullptr;
+ watchdog_thread = nullptr;
}
// stop the profiler
- if (profiler != NULL)
+ if (profiler != nullptr)
{
profiler->stop();
profiler->print_results(*symbols);
@@ -689,7 +690,7 @@ void winmain_dump_stack()
// walk the stack
while (walker.unwind())
- fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == NULL) ? "" : symbols->symbol_for_address(walker.ip()));
+ fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == nullptr) ? "" : symbols->symbol_for_address(walker.ip()));
}
@@ -754,7 +755,7 @@ static DWORD WINAPI watchdog_thread_entry(LPVOID lpParameter)
void winmain_watchdog_ping(void)
{
// if we have a watchdog, reset it
- if (watchdog_reset_event != NULL)
+ if (watchdog_reset_event != nullptr)
SetEvent(watchdog_reset_event);
}
@@ -867,7 +868,7 @@ static LONG WINAPI exception_filter(struct _EXCEPTION_POINTERS *info)
// walk the stack
while (walker.unwind())
- fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == NULL) ? "" : symbols->symbol_for_address(walker.ip()));
+ fprintf(stderr, " %p: %p%s\n", (void *)walker.frame(), (void *)walker.ip(), (symbols == nullptr) ? "" : symbols->symbol_for_address(walker.ip()));
// flush stderr, so the data is actually written when output is being redirected
fflush(stderr);
@@ -902,7 +903,7 @@ stack_walker::stack_walker()
// initialize the symbols
if (!s_initialized && m_sym_initialize && m_stack_walk_64 && m_sym_function_table_access_64 && m_sym_get_module_base_64)
{
- (*m_sym_initialize)(m_process, NULL, TRUE);
+ (*m_sym_initialize)(m_process, nullptr, TRUE);
s_initialized = true;
}
}
@@ -976,9 +977,9 @@ bool stack_walker::unwind()
if (s_initialized)
{
#ifdef PTR64
- return (*m_stack_walk_64)(IMAGE_FILE_MACHINE_AMD64, m_process, m_thread, &m_stackframe, &m_context, NULL, *m_sym_function_table_access_64, *m_sym_get_module_base_64, NULL);
+ return (*m_stack_walk_64)(IMAGE_FILE_MACHINE_AMD64, m_process, m_thread, &m_stackframe, &m_context, nullptr, *m_sym_function_table_access_64, *m_sym_get_module_base_64, nullptr);
#else
- return (*m_stack_walk_64)(IMAGE_FILE_MACHINE_I386, m_process, m_thread, &m_stackframe, &m_context, NULL, *m_sym_function_table_access_64, *m_sym_get_module_base_64, NULL);
+ return (*m_stack_walk_64)(IMAGE_FILE_MACHINE_I386, m_process, m_thread, &m_stackframe, &m_context, nullptr, *m_sym_function_table_access_64, *m_sym_get_module_base_64, nullptr);
#endif
}
@@ -1057,7 +1058,7 @@ const char *symbol_manager::symbol_for_address(FPTR address)
if (!query_system_for_address(address))
{
// if that fails, scan the cache if we have one
- if (m_cache.first() != NULL)
+ if (m_cache.first() != nullptr)
scan_cache_for_address(address);
// or else try to open a sym/map file and find it there
@@ -1114,20 +1115,20 @@ bool symbol_manager::query_system_for_address(FPTR address)
void symbol_manager::scan_file_for_address(FPTR address, bool create_cache)
{
bool is_symfile = false;
- FILE *srcfile = NULL;
+ FILE *srcfile = nullptr;
#ifdef __GNUC__
// see if we have a symbol file (gcc only)
srcfile = fopen(m_symfile.c_str(), "r");
- is_symfile = (srcfile != NULL);
+ is_symfile = (srcfile != nullptr);
#endif
// if not, see if we have a map file
- if (srcfile == NULL)
+ if (srcfile == nullptr)
srcfile = fopen(m_mapfile.c_str(), "r");
// if not, fail
- if (srcfile == NULL)
+ if (srcfile == nullptr)
return;
// reset the best info
@@ -1180,7 +1181,7 @@ void symbol_manager::scan_cache_for_address(FPTR address)
FPTR best_addr = 0;
// walk the cache, looking for valid entries
- for (cache_entry *entry = m_cache.first(); entry != NULL; entry = entry->next())
+ for (cache_entry *entry = m_cache.first(); entry != nullptr; entry = entry->next())
// if this is the best one so far, remember it
if (entry->m_address <= address && entry->m_address > best_addr)
@@ -1213,7 +1214,7 @@ bool symbol_manager::parse_sym_line(const char *line, FPTR &address, std::string
// first look for a (ty) entry
const char *type = strstr(line, "(ty 20)");
- if (type == NULL)
+ if (type == nullptr)
return false;
// scan forward in the line to find the address
@@ -1300,7 +1301,7 @@ void symbol_manager::format_symbol(const char *name, UINT32 displacement, const
strcatprintf(m_buffer, "+0x%04x", (UINT32)displacement);
// append file/line if present
- if (filename != NULL)
+ if (filename != nullptr)
strcatprintf(m_buffer, ", %s:%d", filename, linenumber);
// close up the string
@@ -1320,18 +1321,18 @@ FPTR symbol_manager::get_text_section_base()
// start with the image base
PVOID base = reinterpret_cast<PVOID>(GetModuleHandleUni());
- assert(base != NULL);
+ assert(base != nullptr);
// make sure we have the functions we need
if (image_nt_header && image_rva_to_section)
{
// get the NT header
PIMAGE_NT_HEADERS headers = (*image_nt_header)(base);
- assert(headers != NULL);
+ assert(headers != nullptr);
// look ourself up (assuming we are in the .text section)
PIMAGE_SECTION_HEADER section = (*image_rva_to_section)(headers, base, reinterpret_cast<FPTR>(get_text_section_base) - reinterpret_cast<FPTR>(base));
- if (section != NULL)
+ if (section != nullptr)
return reinterpret_cast<FPTR>(base) + section->VirtualAddress;
}
@@ -1350,8 +1351,8 @@ FPTR symbol_manager::get_text_section_base()
//-------------------------------------------------
sampling_profiler::sampling_profiler(UINT32 max_seconds, UINT8 stack_depth = 0)
- : m_target_thread(NULL),
- m_thread(NULL),
+ : m_target_thread(nullptr),
+ m_thread(nullptr),
m_thread_id(0),
m_thread_exit(false),
m_stack_depth(stack_depth),
@@ -1387,8 +1388,8 @@ void sampling_profiler::start()
m_thread_exit = false;
// start the thread
- m_thread = CreateThread(NULL, 0, thread_entry, (LPVOID)this, 0, &m_thread_id);
- assert_always(m_thread != NULL, "Failed to create profiler thread\n");
+ m_thread = CreateThread(nullptr, 0, thread_entry, (LPVOID)this, 0, &m_thread_id);
+ assert_always(m_thread != nullptr, "Failed to create profiler thread\n");
// max out the priority
SetThreadPriority(m_thread, THREAD_PRIORITY_TIME_CRITICAL);
@@ -1556,7 +1557,7 @@ void sampling_profiler::thread_run()
*count += 1;
}
- // fill in any missing parts with NULLs
+ // fill in any missing parts with nulls
for (; frame <= m_stack_depth; frame++)
*m_buffer_ptr++ = 0;
diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h
index 7656ab4ee31..7ca02a92844 100644
--- a/src/osd/windows/winmain.h
+++ b/src/osd/windows/winmain.h
@@ -112,8 +112,6 @@
#define WINOPTION_GLOBAL_INPUTS "global_inputs"
#define WINOPTION_DUAL_LIGHTGUN "dual_lightgun"
-
-
//============================================================
// TYPE DEFINITIONS
//============================================================
@@ -252,7 +250,7 @@ public:
virtual void update(bool skip_redraw) override;
// video overridables
- virtual void *get_slider_list() override;
+ virtual slider_state *get_slider_list() override;
// input overridables
virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) override;
@@ -277,7 +275,11 @@ public:
private:
virtual void osd_exit() override;
- windows_options &m_options;
+ void build_slider_list();
+ void update_slider_list();
+
+ windows_options & m_options;
+ slider_state * m_sliders;
static const int DEFAULT_FONT_HEIGHT = 200;
};
diff --git a/src/tools/jedutil.cpp b/src/tools/jedutil.cpp
index 284b77ae217..a6cfc279e2a 100644
--- a/src/tools/jedutil.cpp
+++ b/src/tools/jedutil.cpp
@@ -57,11 +57,13 @@
18CV8 = QP20 QF2696
+ AMPAL18P8 = QP20 QF2600
+
EPL10P8 = QP20
EPL12P6 = QP20
EPL14P4 = QP20
EPL16P2 = QP20
- EPL16P8 = QP20
+ EPL16P8 = QP20 QF2072
EPL16RP8 = QP20
EPL16RP6 = QP20
EPL16RP4 = QP20
@@ -272,6 +274,7 @@ static void print_pal16r8_product_terms(const pal_data* pal, const jed_data* jed
static void print_palce16v8_product_terms(const pal_data* pal, const jed_data* jed);
static void print_gal16v8_product_terms(const pal_data* pal, const jed_data* jed);
static void print_peel18cv8_product_terms(const pal_data* pal, const jed_data* jed);
+static void print_ampal18p8_product_terms(const pal_data* pal, const jed_data* jed);
static void print_gal18v10_product_terms(const pal_data* pal, const jed_data* jed);
static void print_pal20l8_product_terms(const pal_data* pal, const jed_data* jed);
static void print_pal20l10_product_terms(const pal_data* pal, const jed_data* jed);
@@ -332,6 +335,7 @@ static void config_pal16r8_pins(const pal_data* pal, const jed_data* jed);
static void config_palce16v8_pins(const pal_data* pal, const jed_data* jed);
static void config_gal16v8_pins(const pal_data* pal, const jed_data* jed);
static void config_peel18cv8_pins(const pal_data* pal, const jed_data* jed);
+static void config_ampal18p8_pins(const pal_data* pal, const jed_data* jed);
static void config_gal18v10_pins(const pal_data* pal, const jed_data* jed);
static void config_pal20l8_pins(const pal_data* pal, const jed_data* jed);
static void config_pal20l10_pins(const pal_data* pal, const jed_data* jed);
@@ -530,6 +534,16 @@ static pin_fuse_rows peel18cv8pinfuserows[] = {
{18, 2340, 288, 540},
{19, 2304, 0, 252}};
+static pin_fuse_rows ampal18p8pinfuserows[] = {
+ {12, 2268, 2304, 2556},
+ {13, 1944, 1980, 2232},
+ {14, 1620, 1656, 1908},
+ {15, 1296, 1332, 1584},
+ {16, 972, 1008, 1260},
+ {17, 648, 684, 936},
+ {18, 324, 360, 612},
+ {19, 0, 36, 288}};
+
static pin_fuse_rows gal18v10pinfuserows[] = {
{9, 3096, 3132, 3384},
{11, 2772, 2808, 3060},
@@ -1172,6 +1186,26 @@ static pin_fuse_columns peel18cv8pinfusecolumns[] = {
{18, 11, 10},
{19, 7, 6}};
+static pin_fuse_columns ampal18p8pinfusecolumns[] = {
+ {1, 3, 2},
+ {2, 1, 0},
+ {3, 5, 4},
+ {4, 9, 8},
+ {5, 13, 12},
+ {6, 17, 16},
+ {7, 21, 20},
+ {8, 25, 24},
+ {9, 29, 28},
+ {11, 31, 30},
+ {12, 35, 34},
+ {13, 27, 26},
+ {14, 23, 22},
+ {15, 19, 18},
+ {16, 15, 14},
+ {17, 11, 10},
+ {18, 7, 6},
+ {19, 33, 32}};
+
static pin_fuse_columns gal18v10pinfusecolumns[] = {
{1, 1, 0},
{2, 5, 4},
@@ -1985,6 +2019,13 @@ static pal_data paldata[] = {
config_peel18cv8_pins,
nullptr,
get_peel18cv8_pin_fuse_state},
+ {"AMPAL18P8", 2600,
+ ampal18p8pinfuserows, ARRAY_LENGTH(ampal18p8pinfuserows),
+ ampal18p8pinfusecolumns, ARRAY_LENGTH(ampal18p8pinfusecolumns),
+ print_ampal18p8_product_terms,
+ config_ampal18p8_pins,
+ nullptr,
+ nullptr},
{"GAL18V10", 3540,
gal18v10pinfuserows, ARRAY_LENGTH(gal18v10pinfuserows),
gal18v10pinfusecolumns, ARRAY_LENGTH(gal18v10pinfusecolumns),
@@ -2079,57 +2120,57 @@ static pal_data paldata[] = {
epl10p8pinfusecolumns, ARRAY_LENGTH(epl10p8pinfusecolumns),
print_epl10p8_product_terms,
config_epl10p8_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL12P6", 786,
epl12p6pinfuserows, ARRAY_LENGTH(epl12p6pinfuserows),
epl12p6pinfusecolumns, ARRAY_LENGTH(epl12p6pinfusecolumns),
print_epl12p6_product_terms,
config_epl12p6_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL14P4", 908,
epl14p4pinfuserows, ARRAY_LENGTH(epl14p4pinfuserows),
epl14p4pinfusecolumns, ARRAY_LENGTH(epl14p4pinfusecolumns),
print_epl14p4_product_terms,
config_epl14p4_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL16P2", 1030,
epl16p2pinfuserows, ARRAY_LENGTH(epl16p2pinfuserows),
epl16p2pinfusecolumns, ARRAY_LENGTH(epl16p2pinfusecolumns),
print_epl16p2_product_terms,
config_epl16p2_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL16P8", 2072,
epl16p8pinfuserows, ARRAY_LENGTH(epl16p8pinfuserows),
epl16p8pinfusecolumns, ARRAY_LENGTH(epl16p8pinfusecolumns),
print_epl16p8_product_terms,
config_epl16p8_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL16RP8", 2072,
epl16rp8pinfuserows, ARRAY_LENGTH(epl16rp8pinfuserows),
epl16rp8pinfusecolumns, ARRAY_LENGTH(epl16rp8pinfusecolumns),
print_epl16rp8_product_terms,
config_epl16rp8_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL16RP6", 2072,
epl16rp6pinfuserows, ARRAY_LENGTH(epl16rp6pinfuserows),
epl16rp6pinfusecolumns, ARRAY_LENGTH(epl16rp6pinfusecolumns),
print_epl16rp6_product_terms,
config_epl16rp6_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
{"EPL16RP4", 2072,
epl16rp4pinfuserows, ARRAY_LENGTH(epl16rp4pinfuserows),
epl16rp4pinfusecolumns, ARRAY_LENGTH(epl16rp4pinfusecolumns),
print_epl16rp4_product_terms,
config_epl16rp4_pins,
- NULL,
- NULL},
+ nullptr,
+ nullptr},
#endif
{"PAL10P8", 328,
pal10p8pinfuserows, ARRAY_LENGTH(pal10p8pinfuserows),
@@ -3409,6 +3450,17 @@ static void print_peel18cv8_product_terms(const pal_data* pal, const jed_data* j
/*-------------------------------------------------
+ print_ampal18p8_product_terms - prints the product
+ terms for an AMPAL18P8
+-------------------------------------------------*/
+
+static void print_ampal18p8_product_terms(const pal_data* pal, const jed_data* jed)
+{
+ print_product_terms(pal, jed);
+}
+
+
+/*-------------------------------------------------
print_gal18v10_product_terms - prints the product
terms for a GAL18V10
-------------------------------------------------*/
@@ -5239,6 +5291,46 @@ static void config_peel18cv8_pins(const pal_data* pal, const jed_data* jed)
/*-------------------------------------------------
+ config_ampal18p8_pins - configures the pins
+ for an AMPAL18P8
+-------------------------------------------------*/
+
+static void config_ampal18p8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+ pin_output_config output_pins[8];
+ UINT16 index, output_pin_count;
+
+ set_input_pins(input_pins, ARRAY_LENGTH(input_pins));
+
+ output_pin_count = 0;
+
+ for (index = 0; index < pal->pinfuserowscount; ++index)
+ {
+ if (does_output_enable_fuse_row_allow_output(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ {
+ output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
+
+ if (jed_get_fuse(jed, 2591 + (8 - index)))
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
+ }
+ else
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
+ }
+
+ ++output_pin_count;
+ }
+ }
+
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
config_gal18v10_pins - configures the pins
for a GAL18V10
-------------------------------------------------*/