Previous 199869 Revisions Next

r36141 Saturday 28th February, 2015 at 11:20:26 UTC by Couriersud
Merge branch 'master' of https://github.com/mamedev/mame.git
[3rdparty/bgfx]README.md
[3rdparty/bgfx/3rdparty/ocornut-imgui]imgui.cpp
[3rdparty/bgfx/examples/23-vectordisplay]vectordisplay.cpp
[3rdparty/bgfx/examples/common/imgui]fs_imgui_latlong.bin.h fs_imgui_latlong.sc imgui.cpp imgui.h ocornut_imgui.cpp
[3rdparty/bgfx/include]bgfx.c99.h bgfx.h
[3rdparty/bgfx/scripts]bgfx.lua example-common.lua genie.lua geometryc.lua makedisttex.lua shaderc.lua texturec.lua
[3rdparty/bgfx/src]bgfx.cpp bgfx_compute.sh bgfx_p.h bgfx_shader.sh config.h glimports.h renderer_d3d11.cpp renderer_d3d9.cpp renderer_gl.cpp renderer_gl.h
[3rdparty/bx/scripts]genie.lua toolchain.lua
[3rdparty/genie]README.md
[3rdparty/genie/src/actions/make]make_cpp.lua
[3rdparty/genie/src/base]api.lua bake.lua
[3rdparty/genie/src/host]scripts.c
[3rdparty/mongoose]mongoose.c
[3rdparty/mongoose/docs]API.md LuaSqlite.md
[src/emu/bus]bus.mak
[src/emu/bus/a2bus]ezcgi.c* ezcgi.h*
[src/emu/video]tms34061.c
[src/mame/drivers]argus.c capbowl.c fgoal.c ssv.c tugboat.c
[src/mame/includes]argus.h capbowl.h fgoal.h ssv.h
[src/mame/video]argus.c capbowl.c fgoal.c ssv.c st0020.c
[src/mess]mess.mak
[src/mess/drivers]alnchase.c apple2.c apple2e.c edracula.c hh_tms1k.c hh_ucom4.c mbee.c tmtennis.c wildfire.c
[src/mess/includes]mbee.h
[src/mess/layout]ebball.lay edracula.lay tmpacman.lay wildfire.lay
[src/mess/machine]mbee.c
[src/mess/video]mbee.c

trunk/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
r244652r244653
18091809    g.CurrentWindowStack.resize(0);
18101810
18111811    // Create implicit window - we will only render it if the user has added something to it.
1812    ImGui::Begin("Debug", NULL, ImVec2(400,400));
1812    ImGui::Begin("Debug", NULL, ImVec2(400,400), -1.0f, ImGuiWindowFlags_NoSavedSettings);
18131813}
18141814
18151815// NB: behaviour of ImGui after Shutdown() is not tested/guaranteed at the moment. This function is merely here to free heap allocations.
trunk/3rdparty/bgfx/README.md
r244652r244653
6969how it currently looks. 
7070![mac_screenshot](https://raw.githubusercontent.com/emoon/ProDBG/master/data/screens/mac_screenshot.png)
7171
72
7372http://www.dogbytegames.com/ Dogbyte Games is an indie mobile developer studio
74focusing on racing games.
73focusing on racing games. 
74![ios](http://www.dogbytegames.com/bgfx/offroadlegends2_bgfx_ipad2.jpg)
7575
7676Examples
7777--------
trunk/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
r244652r244653
123123
124124void VectorDisplay::teardown()
125125{
126   for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
127   {
128      bgfx::destroyDynamicVertexBuffer(m_vertexBuffers[i]);
129   }
130
126131   teardownResDependent();
127132
128133   bgfx::destroyProgram(m_drawToScreenShader);
r244652r244653
728733   {
729734      for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
730735      {
731         destroyDynamicVertexBuffer(m_vertexBuffers[i]);
736         bgfx::destroyDynamicVertexBuffer(m_vertexBuffers[i]);
732737      }
733738
734739      m_vertexBuffers.clear();
trunk/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h
r244652r244653
1static const uint8_t fs_imgui_latlong_glsl[646] =
1static const uint8_t fs_imgui_latlong_glsl[649] =
22{
33   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x02, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
44   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x07, 0x01, 0x00, 0x00, // geLodEnabled....
55   0x01, 0x00, 0x0a, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x01, 0x00, // ...s_texColor...
6   0x00, 0x01, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...N...varying h
6   0x00, 0x01, 0x00, 0x51, 0x02, 0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, // ...Q...varying h
77   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ighp vec2 v_texc
88   0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // oord0;.uniform h
99   0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, // ighp vec4 u_imag
r244652r244653
2121   0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, //   tmpvar_3 = (v_
2222   0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x33, 0x2e, // texcoord0.y * 3.
2323   0x31, 0x34, 0x31, 0x35, 0x39, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // 14159);.  result
24   0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // _1.x = (sin(tmpv
25   0x61, 0x72, 0x5f, 0x33, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, // ar_3) * cos(tmpv
26   0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // ar_2));.  result
27   0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // _1.y = cos(tmpva
28   0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, // r_3);.  result_1
29   0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, 0x76, // .z = (-(sin(tmpv
30   0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, 0x70, // ar_3)) * sin(tmp
31   0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, // var_2));.  lowp
32   0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec4 tmpvar_4;.
33   0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, //  tmpvar_4.xyz =
34   0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, 0x64, 0x20, 0x20, // textureCubeLod
35   0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x72, //   (s_texColor, r
36   0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, // esult_1, u_image
37   0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, 0x2e, 0x78, 0x79, // LodEnabled.x).xy
38   0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, // z;.  tmpvar_4.w
39   0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, 0x20, 0x2a, 0x20, // = (0.2 + (0.8 *
40   0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, // u_imageLodEnable
41   0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // d.y));.  gl_Frag
42   0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // Color = tmpvar_4
43   0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                             // ;.}...
24   0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x6d, // _1.x = (-(sin(tm
25   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x69, 0x6e, 0x28, 0x74, // pvar_3)) * sin(t
26   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, // mpvar_2));.  res
27   0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x6d, // ult_1.y = cos(tm
28   0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // pvar_3);.  resul
29   0x74, 0x5f, 0x31, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x2d, 0x28, 0x73, 0x69, 0x6e, 0x28, 0x74, // t_1.z = (-(sin(t
30   0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6f, 0x73, 0x28, // mpvar_3)) * cos(
31   0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // tmpvar_2));.  lo
32   0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // wp vec4 tmpvar_4
33   0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x7a, // ;.  tmpvar_4.xyz
34   0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x4c, 0x6f, //  = textureCubeLo
35   0x64, 0x20, 0x20, 0x20, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // d    (s_texColor
36   0x2c, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x2c, 0x20, 0x75, 0x5f, 0x69, 0x6d, // , result_1, u_im
37   0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2e, 0x78, 0x29, // ageLodEnabled.x)
38   0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // .xyz;.  tmpvar_4
39   0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x30, 0x2e, 0x38, // .w = (0.2 + (0.8
40   0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, //  * u_imageLodEna
41   0x62, 0x6c, 0x65, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // bled.y));.  gl_F
42   0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ragColor = tmpva
43   0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                           // r_4;.}...
4444};
45static const uint8_t fs_imgui_latlong_dx9[553] =
45static const uint8_t fs_imgui_latlong_dx9[537] =
4646{
4747   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
4848   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x01, 0x00, 0x00, // geLodEnabled....
49   0x01, 0x00, 0x04, 0x02, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
49   0x01, 0x00, 0xf4, 0x01, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x30, 0x00, 0x43, 0x54, 0x41, 0x42, // ..........0.CTAB
5050   0x1c, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, // ................
5151   0x1c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, // ............D...
5252   0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........P.......
r244652r244653
7171   0x01, 0x00, 0x00, 0xa0, 0x13, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, // ................
7272   0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x55, 0xa0, // ..............U.
7373   0x01, 0x00, 0xaa, 0xa0, 0x25, 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x80, // ....%...........
74   0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x55, 0x80, // ..............U.
75   0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x80, 0x01, 0x00, 0x55, 0x80, 0x02, 0x00, 0x55, 0x81, // ..........U...U.
74   0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xc5, 0x80, 0x02, 0x00, 0x55, 0x81, // ..............U.
7675   0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x80, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, // ................
7776   0x00, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x5f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, // ........_.......
7877   0x00, 0x00, 0xe4, 0x80, 0x00, 0x08, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x07, 0x80, // ................
r244652r244653
8483{
8584   0x46, 0x53, 0x48, 0x03, 0x6f, 0x1e, 0x3e, 0x3c, 0x01, 0x00, 0x11, 0x75, 0x5f, 0x69, 0x6d, 0x61, // FSH.o.><...u_ima
8685   0x67, 0x65, 0x4c, 0x6f, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x15, 0x00, 0x30, 0x0a, // geLodEnabled..0.
87   0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0x89, 0x11, 0x25, 0xa6, 0xf5, 0x66, 0x12, 0x3f, // ..0.DXBC..%..f.?
88   0xc0, 0x1f, 0x67, 0x9b, 0x6e, 0x4e, 0xac, 0x03, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // ..g.nN......0...
86   0x01, 0x00, 0x30, 0x02, 0x44, 0x58, 0x42, 0x43, 0xbb, 0x3e, 0xd7, 0x3a, 0x63, 0xc9, 0x70, 0x0b, // ..0.DXBC.>.:c.p.
87   0xa5, 0x2c, 0x7d, 0xb2, 0x3c, 0x0c, 0x75, 0x44, 0x01, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, // .,}.<.uD....0...
8988   0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, // ....,...........
9089   0x49, 0x53, 0x47, 0x4e, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNP...........
9190   0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
r244652r244653
101100   0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x30, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, // .`......X0...p..
102101   0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // ....UU..b...2...
103102   0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....e.... ......
104   0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
105   0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // ....F........@..
106   0xdb, 0x0f, 0xc9, 0x40, 0xdb, 0x0f, 0x49, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...@..I@........
107   0x4d, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
108   0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, // ....A.......M...
109   0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x16, 0x05, 0x10, 0x00, // 2...............
103   0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, // h.......8...2...
104   0x00, 0x00, 0x00, 0x00, 0x16, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, // .............@..
105   0xdb, 0x0f, 0x49, 0x40, 0xdb, 0x0f, 0xc9, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..I@...@........
106   0x4d, 0x00, 0x00, 0x06, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, // M...B...........
107   0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, // ........M.......
108   0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // ............A...
110109   0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x62, 0x00, 0x10, 0x00, // ....M.......b...
111   0x02, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
112   0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
113   0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // ........8.......
114   0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, // ................
115   0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
116   0x86, 0x03, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F~......
110   0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8...
111   0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........*.......
112   0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, // :.......8.......
113   0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ....:.......*...
114   0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x0c, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...........
115   0x46, 0x03, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F~......
117116   0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .`........ .....
118117   0xa3, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6...r ......
119118   0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x20, 0x10, 0x00, // F.......2.... ..
trunk/3rdparty/bgfx/examples/common/imgui/fs_imgui_latlong.sc
r244652r244653
1818   float pi    = 3.14159265;
1919   float twoPi = 2.0*pi;
2020   float phi   = _uv.x * twoPi;
21   float theta = _uv.y *pi;
21   float theta = _uv.y * pi;
2222
2323   vec3 result;
24   result.x = sin(theta)*cos(phi);
24   result.x = -sin(theta)*sin(phi);
2525   result.y = cos(theta);
26   result.z = -sin(theta)*sin(phi);
26   result.z = -sin(theta)*cos(phi);
2727
2828   return result;
2929}
trunk/3rdparty/bgfx/examples/common/imgui/imgui.cpp
r244652r244653
387387      , m_textureHeight(512)
388388      , m_halfTexel(0.0f)
389389      , m_nvg(NULL)
390      , m_view(31)
390      , m_view(255)
391391      , m_viewWidth(0)
392392      , m_viewHeight(0)
393393      , m_currentFontIdx(0)
r244652r244653
20232023         xx = -borderSize;
20242024         yy = -1;
20252025         width = 2*borderSize+1;
2026         height = m_viewHeight;
2026         height = m_viewHeight+1;
20272027         triX = 0;
20282028         triY = (m_viewHeight-triSize)/2;
20292029         orientation = _checked ? TriangleOrientation::Left : TriangleOrientation::Right;
r244652r244653
20332033         xx = m_viewWidth - borderSize;
20342034         yy = -1;
20352035         width = 2*borderSize+1;
2036         height = m_viewHeight;
2036         height = m_viewHeight+1;
20372037         triX = m_viewWidth - triSize - 2;
20382038         triY = (m_viewHeight-width)/2;
20392039         orientation = _checked ? TriangleOrientation::Right : TriangleOrientation::Left;
trunk/3rdparty/bgfx/examples/common/imgui/imgui.h
r244652r244653
136136ImguiFontHandle imguiCreate(const void* _data = NULL, uint32_t _size = 0, float _fontSize = 15.0f);
137137void imguiDestroy();
138138
139void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 31);
139void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 255);
140140void imguiEndFrame();
141141
142142void imguiDrawText(int _x, int _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb);
trunk/3rdparty/bgfx/examples/common/imgui/ocornut_imgui.cpp
r244652r244653
8181
8282   void create(const void* _data, uint32_t _size, float _fontSize)
8383   {
84      m_viewId = 31;
84      m_viewId = 255;
8585
8686      ImGuiIO& io = ImGui::GetIO();
8787      io.DisplaySize = ImVec2(1280.0f, 720.0f);
trunk/3rdparty/bgfx/include/bgfx.c99.h
r244652r244653
287287    uint64_t supported;
288288
289289    uint16_t maxTextureSize;    /* < Maximum texture size.             */
290    uint16_t maxViews;          /* < Maximum views.                    */
290291    uint16_t maxDrawCalls;      /* < Maximum draw calls.               */
291292    uint8_t  maxFBAttachments;  /* < Maximum frame buffer attachments. */
292293
r244652r244653
13581359/**
13591360 *
13601361 */
1361BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_texture_format_t _format, bgfx_access_t _access);
1362BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
13621363
13631364/**
13641365 *
13651366 */
1366BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_texture_format_t _format, bgfx_access_t _access);
1367BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_access_t _access, bgfx_texture_format_t _format);
13671368
13681369/**
13691370 * Dispatch compute.
trunk/3rdparty/bgfx/include/bgfx.h
r244652r244653
310310      uint64_t supported;
311311
312312      uint16_t maxTextureSize;   ///< Maximum texture size.
313      uint16_t maxViews;         ///< Maximum views.
313314      uint16_t maxDrawCalls;     ///< Maximum draw calls.
314315      uint8_t  maxFBAttachments; ///< Maximum frame buffer attachments.
315316
r244652r244653
10981099   /// view will use these matrices.
10991100   void setViewTransform(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags = BGFX_VIEW_STEREO, const void* _projR = NULL);
11001101
1102   /// Post submit view reordering.
1103   ///
1104   /// @param _id First view id.
1105   /// @param _num Number of views to remap.
1106   /// @param _remap View remap id table. Passing `NULL` will reset view ids
1107   ///   to default state.
1108   ///
1109   void setViewRemap(uint8_t _id = 0, uint8_t _num = UINT8_MAX, const void* _remap = NULL);
1110
11011111   /// Sets debug marker.
11021112   void setMarker(const char* _marker);
11031113
r244652r244653
12731283   void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access);
12741284
12751285   ///
1276   void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access);
1286   void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count);
12771287
12781288   ///
1279   void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access);
1289   void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count);
12801290
12811291   /// Dispatch compute.
12821292   void dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX = 1, uint16_t _numY = 1, uint16_t _numZ = 1, uint8_t _flags = BGFX_SUBMIT_EYE_FIRST);
trunk/3rdparty/bgfx/scripts/bgfx.lua
r244652r244653
2929      end
3030
3131      includedirs {
32         BGFX_DIR .. "3rdparty",
33         BGFX_DIR .. "../bx/include",
32         path.join(BGFX_DIR, "3rdparty"),
33         path.join(BGFX_DIR, "../bx/include"),
3434      }
3535
3636      defines {
r244652r244653
6969
7070      configuration { "xcode4 or osx or ios*" }
7171         files {
72            BGFX_DIR .. "src/**.mm",
72            path.join(BGFX_DIR, "src/**.mm"),
7373         }
7474
7575      configuration { "osx" }
r244652r244653
8080      configuration { "not nacl" }
8181         includedirs {
8282            --nacl has GLES2 headers modified...
83            BGFX_DIR .. "3rdparty/khronos",
83            path.join(BGFX_DIR, "3rdparty/khronos"),
8484         }
8585
8686      configuration { "x64", "vs* or mingw*" }
r244652r244653
9191      configuration {}
9292
9393      includedirs {
94         BGFX_DIR .. "include",
94         path.join(BGFX_DIR, "include"),
9595      }
9696
9797      files {
98         BGFX_DIR .. "include/**.h",
99         BGFX_DIR .. "src/**.cpp",
100         BGFX_DIR .. "src/**.h",
98         path.join(BGFX_DIR, "include/**.h"),
99         path.join(BGFX_DIR, "src/**.cpp"),
100         path.join(BGFX_DIR, "src/**.h"),
101101      }
102102
103103      excludes {
104         BGFX_DIR .. "src/**.bin.h",
104         path.join(BGFX_DIR, "src/**.bin.h"),
105105      }
106106
107107      configuration {}
trunk/3rdparty/bgfx/scripts/example-common.lua
r244652r244653
88   kind "StaticLib"
99
1010   includedirs {
11      BX_DIR .. "include",
12      BGFX_DIR .. "include",
13      BGFX_DIR .. "3rdparty",
11      path.join(BX_DIR, "include"),
12      path.join(BGFX_DIR, "include"),
13      path.join(BGFX_DIR, "3rdparty"),
1414   }
1515
1616   files {
17      BGFX_DIR .. "3rdparty/ib-compress/**.cpp",
18      BGFX_DIR .. "3rdparty/ib-compress/**.h",
19      BGFX_DIR .. "3rdparty/ocornut-imgui/**.cpp",
20      BGFX_DIR .. "3rdparty/ocornut-imgui/**.h",
21      BGFX_DIR .. "examples/common/**.cpp",
22      BGFX_DIR .. "examples/common/**.h",
17      path.join(BGFX_DIR, "3rdparty/ib-compress/**.cpp"),
18      path.join(BGFX_DIR, "3rdparty/ib-compress/**.h"),
19      path.join(BGFX_DIR, "3rdparty/ocornut-imgui/**.cpp"),
20      path.join(BGFX_DIR, "3rdparty/ocornut-imgui/**.h"),
21      path.join(BGFX_DIR, "examples/common/**.cpp"),
22      path.join(BGFX_DIR, "examples/common/**.h"),
2323   }
2424
2525   if _OPTIONS["with-sdl"] then
trunk/3rdparty/bgfx/scripts/genie.lua
r244652r244653
4545   language "C++"
4646   startproject "example-00-helloworld"
4747
48BGFX_DIR = (path.getabsolute("..") .. "/")
49local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
50local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
51BX_DIR = (BGFX_DIR .. "../bx/")
48BGFX_DIR = path.getabsolute("..")
49local BGFX_BUILD_DIR = path.join(BGFX_DIR, ".build")
50local BGFX_THIRD_PARTY_DIR = path.join(BGFX_DIR, "3rdparty")
51BX_DIR = path.getabsolute(path.join(BGFX_DIR, "../bx"))
5252
5353defines {
5454   "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
5555}
5656
57dofile (BX_DIR .. "scripts/toolchain.lua")
57dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
5858if not toolchain(BGFX_BUILD_DIR, BGFX_THIRD_PARTY_DIR) then
5959   return -- no action specified
6060end
r244652r244653
8080
8181   -- don't output debugdir for winphone builds
8282   if "winphone81" ~= _OPTIONS["vs"] then
83      debugdir (BGFX_DIR .. "examples/runtime/")
83      debugdir (path.join(BGFX_DIR, "examples/runtime"))
8484   end
8585
8686   includedirs {
87      BX_DIR .. "include",
88      BGFX_DIR .. "include",
89      BGFX_DIR .. "3rdparty",
90      BGFX_DIR .. "examples/common",
87      path.join(BX_DIR, "include"),
88      path.join(BGFX_DIR, "include"),
89      path.join(BGFX_DIR, "3rdparty"),
90      path.join(BGFX_DIR, "examples/common"),
9191   }
9292
9393   files {
94      BGFX_DIR .. "examples/" .. _name .. "/**.cpp",
95      BGFX_DIR .. "examples/" .. _name .. "/**.h",
94      path.join(BGFX_DIR, "examples", _name, "**.cpp"),
95      path.join(BGFX_DIR, "examples", _name, "**.h"),
9696   }
9797
9898   links {
r244652r244653
120120      }
121121
122122      configuration { "x32" }
123         libdirs { "$(OVR_DIR)/LibOVR/Lib/Win32/" .. _ACTION }
123         libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Win32", _ACTION) }
124124
125125      configuration { "x64" }
126         libdirs { "$(OVR_DIR)/LibOVR/Lib/x64/" .. _ACTION }
126         libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/x64", _ACTION) }
127127
128128      configuration { "x32", "Debug" }
129129         links { "libovrd" }
r244652r244653
177177         "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
178178      }
179179      -- WinRT targets need their own output directories are build files stomp over each other
180      targetdir (BGFX_BUILD_DIR .. "arm_" .. _ACTION .. "/bin/" .. _name)
181      objdir (BGFX_BUILD_DIR .. "arm_" .. _ACTION .. "/obj/" .. _name)
180      targetdir (path.join(BGFX_BUILD_DIR, "arm_" .. _ACTION, "bin", _name))
181      objdir (path.join(BGFX_BUILD_DIR, "arm_" .. _ACTION, "obj", _name))
182182
183183   configuration { "mingw-clang" }
184184      kind "ConsoleApp"
r244652r244653
236236
237237   configuration { "osx" }
238238      files {
239         BGFX_DIR .. "examples/common/**.mm",
239         path.join(BGFX_DIR, "examples/common/**.mm"),
240240      }
241241      links {
242242         "Cocoa.framework",
r244652r244653
246246   configuration { "ios*" }
247247      kind "ConsoleApp"
248248      files {
249         BGFX_DIR .. "examples/common/**.mm",
249         path.join(BGFX_DIR, "examples/common/**.mm"),
250250      }
251251      linkoptions {
252252         "-framework CoreFoundation",
r244652r244653
259259   configuration { "xcode4", "ios" }
260260      kind "WindowedApp"
261261      files {
262         BGFX_DIR .. "examples/runtime/iOS-Info.plist"
262         path.join(BGFX_DIR, "examples/runtime/iOS-Info.plist"),
263263      }
264264
265265   configuration { "qnx*" }
trunk/3rdparty/bgfx/scripts/geometryc.lua
r244652r244653
88   kind "ConsoleApp"
99
1010   includedirs {
11      BX_DIR   .. "include",
12      BGFX_DIR .. "include",
13      BGFX_DIR .. "3rdparty",
14      BGFX_DIR .. "examples/common",
11      path.join(BX_DIR, "include"),
12      path.join(BGFX_DIR, "include"),
13      path.join(BGFX_DIR, "3rdparty"),
14      path.join(BGFX_DIR, "examples/common"),
1515   }
1616
1717   files {
18      BGFX_DIR .. "3rdparty/forsyth-too/**.cpp",
19      BGFX_DIR .. "3rdparty/forsyth-too/**.h",
20      BGFX_DIR .. "3rdparty/ib-compress/**.cpp",
21      BGFX_DIR .. "3rdparty/ib-compress/**.h",
22      BGFX_DIR .. "src/vertexdecl.**",
23      BGFX_DIR .. "tools/geometryc/**.cpp",
24      BGFX_DIR .. "tools/geometryc/**.h",
25      BGFX_DIR .. "examples/common/bounds.**",
18      path.join(BGFX_DIR, "3rdparty/forsyth-too/**.cpp"),
19      path.join(BGFX_DIR, "3rdparty/forsyth-too/**.h"),
20      path.join(BGFX_DIR, "3rdparty/ib-compress/**.cpp"),
21      path.join(BGFX_DIR, "3rdparty/ib-compress/**.h"),
22      path.join(BGFX_DIR, "src/vertexdecl.**"),
23      path.join(BGFX_DIR, "tools/geometryc/**.cpp"),
24      path.join(BGFX_DIR, "tools/geometryc/**.h"),
25      path.join(BGFX_DIR, "examples/common/bounds.**"),
2626   }
2727
2828   configuration { "osx" }
trunk/3rdparty/bgfx/scripts/makedisttex.lua
r244652r244653
88   kind "ConsoleApp"
99
1010   includedirs {
11      BX_DIR .. "include",
12      BGFX_DIR .. "3rdparty",
11      path.join(BX_DIR, "include"),
12      path.join(BGFX_DIR, "3rdparty"),
1313   }
1414
1515   files {
16      BGFX_DIR .. "3rdparty/edtaa3/**.cpp",
17      BGFX_DIR .. "3rdparty/edtaa3/**.h",
18      BGFX_DIR .. "tools/makedisttex.cpp",
16      path.join(BGFX_DIR, "3rdparty/edtaa3/**.cpp"),
17      path.join(BGFX_DIR, "3rdparty/edtaa3/**.h"),
18      path.join(BGFX_DIR, "tools/makedisttex.cpp"),
1919   }
trunk/3rdparty/bgfx/scripts/shaderc.lua
r244652r244653
77   uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
88   kind "ConsoleApp"
99
10   local GLSL_OPTIMIZER = (BGFX_DIR .. "3rdparty/glsl-optimizer/")
11   local FCPP_DIR = (BGFX_DIR .. "3rdparty/fcpp/")
10   local GLSL_OPTIMIZER = path.join(BGFX_DIR, "3rdparty/glsl-optimizer")
11   local FCPP_DIR = path.join(BGFX_DIR, "3rdparty/fcpp")
1212
1313   includedirs {
14      GLSL_OPTIMIZER .. "src",
14      path.join(GLSL_OPTIMIZER, "src"),
1515   }
1616
1717   configuration { "vs*" }
1818      includedirs {
19         GLSL_OPTIMIZER .. "src/glsl/msvc",
19         path.join(GLSL_OPTIMIZER, "src/glsl/msvc"),
2020      }
2121
2222      defines { -- glsl-optimizer
r244652r244653
4343
4444   configuration { "windows", "vs*" }
4545      includedirs {
46         GLSL_OPTIMIZER .. "include/c99",
46         path.join(GLSL_OPTIMIZER, "include/c99"),
4747      }
4848
4949   configuration { "windows" }
r244652r244653
6767   }
6868
6969   includedirs {
70      BX_DIR   .. "include",
71      BGFX_DIR .. "include",
70      path.join(BX_DIR, "include"),
71      path.join(BGFX_DIR, "include"),
7272
7373      FCPP_DIR,
7474
75      GLSL_OPTIMIZER .. "include",
76      GLSL_OPTIMIZER .. "src/mesa",
77      GLSL_OPTIMIZER .. "src/mapi",
78      GLSL_OPTIMIZER .. "src/glsl",
75      path.join(GLSL_OPTIMIZER, "include"),
76      path.join(GLSL_OPTIMIZER, "src/mesa"),
77      path.join(GLSL_OPTIMIZER, "src/mapi"),
78      path.join(GLSL_OPTIMIZER, "src/glsl"),
7979   }
8080
8181   files {
82      BGFX_DIR .. "tools/shaderc/**.cpp",
83      BGFX_DIR .. "tools/shaderc/**.h",
84      BGFX_DIR .. "src/vertexdecl.**",
82      path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
83      path.join(BGFX_DIR, "tools/shaderc/**.h"),
84      path.join(BGFX_DIR, "src/vertexdecl.**"),
8585
86      FCPP_DIR .. "**.h",
87      FCPP_DIR .. "cpp1.c",
88      FCPP_DIR .. "cpp2.c",
89      FCPP_DIR .. "cpp3.c",
90      FCPP_DIR .. "cpp4.c",
91      FCPP_DIR .. "cpp5.c",
92      FCPP_DIR .. "cpp6.c",
93      FCPP_DIR .. "cpp6.c",
86      path.join(FCPP_DIR, "**.h"),
87      path.join(FCPP_DIR, "cpp1.c"),
88      path.join(FCPP_DIR, "cpp2.c"),
89      path.join(FCPP_DIR, "cpp3.c"),
90      path.join(FCPP_DIR, "cpp4.c"),
91      path.join(FCPP_DIR, "cpp5.c"),
92      path.join(FCPP_DIR, "cpp6.c"),
93      path.join(FCPP_DIR, "cpp6.c"),
9494
95      GLSL_OPTIMIZER .. "src/mesa/**.c",
96      GLSL_OPTIMIZER .. "src/glsl/**.cpp",
97      GLSL_OPTIMIZER .. "src/mesa/**.h",
98      GLSL_OPTIMIZER .. "src/glsl/**.c",
99      GLSL_OPTIMIZER .. "src/glsl/**.cpp",
100      GLSL_OPTIMIZER .. "src/glsl/**.h",
101      GLSL_OPTIMIZER .. "src/util/**.c",
102      GLSL_OPTIMIZER .. "src/util/**.h",
95      path.join(GLSL_OPTIMIZER, "src/mesa/**.c"),
96      path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
97      path.join(GLSL_OPTIMIZER, "src/mesa/**.h"),
98      path.join(GLSL_OPTIMIZER, "src/glsl/**.c"),
99      path.join(GLSL_OPTIMIZER, "src/glsl/**.cpp"),
100      path.join(GLSL_OPTIMIZER, "src/glsl/**.h"),
101      path.join(GLSL_OPTIMIZER, "src/util/**.c"),
102      path.join(GLSL_OPTIMIZER, "src/util/**.h"),
103103   }
104104
105105   excludes {
106      GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
107      GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
108      GLSL_OPTIMIZER .. "src/glsl/glcpp/**.l",
109      GLSL_OPTIMIZER .. "src/glsl/glcpp/**.y",
110      GLSL_OPTIMIZER .. "src/glsl/ir_set_program_inouts.cpp",
111      GLSL_OPTIMIZER .. "src/glsl/main.cpp",
112      GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
106      path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/glcpp.c"),
107      path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/tests/**"),
108      path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.l"),
109      path.join(GLSL_OPTIMIZER, "src/glsl/glcpp/**.y"),
110      path.join(GLSL_OPTIMIZER, "src/glsl/ir_set_program_inouts.cpp"),
111      path.join(GLSL_OPTIMIZER, "src/glsl/main.cpp"),
112      path.join(GLSL_OPTIMIZER, "src/glsl/builtin_stubs.cpp"),
113113   }
114114
115115   strip()
trunk/3rdparty/bgfx/scripts/texturec.lua
r244652r244653
88   kind "ConsoleApp"
99
1010   includedirs {
11      BX_DIR .. "include",
12      BGFX_DIR .. "include",
13      BGFX_DIR .. "src",
11      path.join(BX_DIR, "include"),
12      path.join(BGFX_DIR, "include"),
13      path.join(BGFX_DIR, "src"),
1414   }
1515
1616   files {
17      BGFX_DIR .. "src/image.*",
18      BGFX_DIR .. "tools/texturec/**.cpp",
19      BGFX_DIR .. "tools/texturec/**.h",
17      path.join(BGFX_DIR, "src/image.*"),
18      path.join(BGFX_DIR, "tools/texturec/**.cpp"),
19      path.join(BGFX_DIR, "tools/texturec/**.h"),
2020   }
2121
2222   links {
trunk/3rdparty/bgfx/src/bgfx.cpp
r244652r244653
1919#   define BGFX_CHECK_RENDER_THREAD()
2020#endif // BGFX_CONFIG_MULTITHREADED && !BX_PLATFORM_OSX && !BX_PLATFORM_IOS
2121
22#define BGFX_CHECK_HANDLE(_handle, _max) \
23         BX_CHECK(isValid(_handle) \
24            && _handle.idx < _max \
25            , "Invalid handle. %d (< %d " #_max ")" \
26            , _handle.idx \
27            , _max \
28            );
29
2230#if BX_PLATFORM_ANDROID
2331   ::ANativeWindow* g_bgfxAndroidWindow = NULL;
2432
r244652r244653
797805
798806   void Frame::sort()
799807   {
808      for (uint32_t ii = 0, num = m_num; ii < num; ++ii)
809      {
810         m_sortKeys[ii] = SortKey::remapView(m_sortKeys[ii], m_viewRemap);
811      }
800812      bx::radixSort64(m_sortKeys, s_ctx->m_tempKeys, m_sortValues, s_ctx->m_tempValues, m_num);
801813   }
802814
r244652r244653
951963      BX_TRACE("Multithreaded renderer is disabled.");
952964#endif // BGFX_CONFIG_MULTITHREADED
953965
966      for (uint32_t ii = 0; ii < BX_COUNTOF(m_viewRemap); ++ii)
967      {
968         m_viewRemap[ii] = ii;
969      }
970
954971      memset(m_fb, 0xff, sizeof(m_fb) );
955972      memset(m_clear, 0, sizeof(m_clear) );
956973      memset(m_rect, 0, sizeof(m_rect) );
r244652r244653
11561173      freeDynamicBuffers();
11571174      m_submit->m_resolution = m_resolution;
11581175      m_submit->m_debug = m_debug;
1176
1177      memcpy(m_submit->m_viewRemap, m_viewRemap, sizeof(m_viewRemap) );
11591178      memcpy(m_submit->m_fb, m_fb, sizeof(m_fb) );
11601179      memcpy(m_submit->m_clear, m_clear, sizeof(m_clear) );
11611180      memcpy(m_submit->m_rect, m_rect, sizeof(m_rect) );
r244652r244653
19611980      g_caps.supported = 0
19621981         | (BGFX_CONFIG_MULTITHREADED ? BGFX_CAPS_RENDERER_MULTITHREADED : 0)
19631982         ;
1983      g_caps.maxViews     = BGFX_CONFIG_MAX_VIEWS;
19641984      g_caps.maxDrawCalls = BGFX_CONFIG_MAX_DRAW_CALLS;
19651985      g_caps.maxFBAttachments = 1;
19661986
r244652r244653
26172637      s_ctx->setClearColor(_index, _rgba);
26182638   }
26192639
2640   bool checkView(uint8_t _id)
2641   {
2642      // workaround GCC 4.9 type-limit check.
2643      const uint32_t id = _id;
2644      return id < BGFX_CONFIG_MAX_VIEWS;
2645   }
2646
26202647   void setViewName(uint8_t _id, const char* _name)
26212648   {
26222649      BGFX_CHECK_MAIN_THREAD();
2623      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2650      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26242651      s_ctx->setViewName(_id, _name);
26252652   }
26262653
26272654   void setViewRect(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
26282655   {
26292656      BGFX_CHECK_MAIN_THREAD();
2630      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2657      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26312658      s_ctx->setViewRect(_id, _x, _y, _width, _height);
26322659   }
26332660
26342661   void setViewScissor(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
26352662   {
26362663      BGFX_CHECK_MAIN_THREAD();
2637      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2664      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26382665      s_ctx->setViewScissor(_id, _x, _y, _width, _height);
26392666   }
26402667
26412668   void setViewClear(uint8_t _id, uint16_t _flags, uint32_t _rgba, float _depth, uint8_t _stencil)
26422669   {
26432670      BGFX_CHECK_MAIN_THREAD();
2644      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2671      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26452672      s_ctx->setViewClear(_id, _flags, _rgba, _depth, _stencil);
26462673   }
26472674
26482675   void setViewClear(uint8_t _id, uint16_t _flags, float _depth, uint8_t _stencil, uint8_t _0, uint8_t _1, uint8_t _2, uint8_t _3, uint8_t _4, uint8_t _5, uint8_t _6, uint8_t _7)
26492676   {
26502677      BGFX_CHECK_MAIN_THREAD();
2651      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2678      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26522679      s_ctx->setViewClear(_id, _flags, _depth, _stencil, _0, _1, _2, _3, _4, _5, _6, _7);
26532680   }
26542681
26552682   void setViewSeq(uint8_t _id, bool _enabled)
26562683   {
26572684      BGFX_CHECK_MAIN_THREAD();
2658      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2685      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26592686      s_ctx->setViewSeq(_id, _enabled);
26602687   }
26612688
26622689   void setViewFrameBuffer(uint8_t _id, FrameBufferHandle _handle)
26632690   {
26642691      BGFX_CHECK_MAIN_THREAD();
2665      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2692      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26662693      s_ctx->setViewFrameBuffer(_id, _handle);
26672694   }
26682695
26692696   void setViewTransform(uint8_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR)
26702697   {
26712698      BGFX_CHECK_MAIN_THREAD();
2672      BX_CHECK(_id < BGFX_CONFIG_MAX_VIEWS, "Invalid view id: %d", _id);
2699      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
26732700      s_ctx->setViewTransform(_id, _view, _projL, _flags, _projR);
26742701   }
26752702
2703   void setViewRemap(uint8_t _id, uint8_t _num, const void* _remap)
2704   {
2705      BGFX_CHECK_MAIN_THREAD();
2706      BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
2707      s_ctx->setViewRemap(_id, _num, _remap);
2708   }
2709
26762710   void setMarker(const char* _marker)
26772711   {
26782712      BGFX_CHECK_MAIN_THREAD();
r244652r244653
27242758   void setUniform(UniformHandle _handle, const void* _value, uint16_t _num)
27252759   {
27262760      BGFX_CHECK_MAIN_THREAD();
2761      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_UNIFORMS);
27272762      s_ctx->setUniform(_handle, _value, _num);
27282763   }
27292764
27302765   void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
27312766   {
27322767      BGFX_CHECK_MAIN_THREAD();
2768      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_INDEX_BUFFERS);
27332769      s_ctx->setIndexBuffer(_handle, _firstIndex, _numIndices);
27342770   }
27352771
27362772   void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
27372773   {
27382774      BGFX_CHECK_MAIN_THREAD();
2775      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS);
27392776      s_ctx->setIndexBuffer(_handle, _firstIndex, _numIndices);
27402777   }
27412778
r244652r244653
27602797   void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
27612798   {
27622799      BGFX_CHECK_MAIN_THREAD();
2800      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
27632801      s_ctx->setVertexBuffer(_handle, _startVertex, _numVertices);
27642802   }
27652803
27662804   void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _numVertices)
27672805   {
27682806      BGFX_CHECK_MAIN_THREAD();
2807      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS);
27692808      s_ctx->setVertexBuffer(_handle, _numVertices);
27702809   }
27712810
r244652r244653
27842823   void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint32_t _num)
27852824   {
27862825      BGFX_CHECK_MAIN_THREAD();
2826      BX_CHECK(NULL != _idb, "_idb can't be NULL");
27872827      s_ctx->setInstanceDataBuffer(_idb, _num);
27882828   }
27892829
27902830   void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num)
27912831   {
27922832      BGFX_CHECK_MAIN_THREAD();
2833      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
27932834      s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num);
27942835   }
27952836
27962837   void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num)
27972838   {
27982839      BGFX_CHECK_MAIN_THREAD();
2840      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS);
27992841      s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num);
28002842   }
28012843
28022844   void setProgram(ProgramHandle _handle)
28032845   {
28042846      BGFX_CHECK_MAIN_THREAD();
2847      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_PROGRAMS);
28052848      s_ctx->setProgram(_handle);
28062849   }
28072850
r244652r244653
28262869   void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
28272870   {
28282871      BGFX_CHECK_MAIN_THREAD();
2872      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_INDEX_BUFFERS);
28292873      s_ctx->setBuffer(_stage, _handle, _access);
28302874   }
28312875
28322876   void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
28332877   {
28342878      BGFX_CHECK_MAIN_THREAD();
2879      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
28352880      s_ctx->setBuffer(_stage, _handle, _access);
28362881   }
28372882
28382883   void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
28392884   {
28402885      BGFX_CHECK_MAIN_THREAD();
2886      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS);
28412887      s_ctx->setBuffer(_stage, _handle, _access);
28422888   }
28432889
28442890   void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
28452891   {
28462892      BGFX_CHECK_MAIN_THREAD();
2893      BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS);
28472894      s_ctx->setBuffer(_stage, _handle, _access);
28482895   }
28492896
2850   void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access)
2897   void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
28512898   {
28522899      BGFX_CHECK_MAIN_THREAD();
2853      s_ctx->setImage(_stage, _sampler, _handle, _mip, _format, _access);
2900      s_ctx->setImage(_stage, _sampler, _handle, _mip, _access, _format);
28542901   }
28552902
2856   void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access)
2903   void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format)
28572904   {
28582905      BGFX_CHECK_MAIN_THREAD();
2859      s_ctx->setImage(_stage, _sampler, _handle, _attachment, _format, _access);
2906      s_ctx->setImage(_stage, _sampler, _handle, _attachment, _access, _format);
28602907   }
28612908
28622909   void dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags)
r244652r244653
34663513   return bgfx::submit(_id, _depth);
34673514}
34683515
3469BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_texture_format_t _format, bgfx_access_t _access)
3516BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
34703517{
34713518   union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
34723519   union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle  = { _handle  };
3473   bgfx::setImage(_stage, sampler.cpp, handle.cpp, _mip, bgfx::TextureFormat::Enum(_format), bgfx::Access::Enum(_access) );
3520   bgfx::setImage(_stage, sampler.cpp, handle.cpp, _mip, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
34743521}
34753522
3476BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_texture_format_t _format, bgfx_access_t _access)
3523BGFX_C_API void bgfx_set_image_from_frame_buffer(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_frame_buffer_handle_t _handle, uint8_t _attachment, bgfx_access_t _access, bgfx_texture_format_t _format)
34773524{
34783525   union { bgfx_uniform_handle_t c;      bgfx::UniformHandle cpp;     } sampler = { _sampler };
34793526   union { bgfx_frame_buffer_handle_t c; bgfx::FrameBufferHandle cpp; } handle  = { _handle };
3480   bgfx::setImage(_stage, sampler.cpp, handle.cpp, _attachment, bgfx::TextureFormat::Enum(_format), bgfx::Access::Enum(_access) );
3527   bgfx::setImage(_stage, sampler.cpp, handle.cpp, _attachment, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
34813528}
34823529
34833530BGFX_C_API void bgfx_dispatch(uint8_t _id, bgfx_program_handle_t _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags)
trunk/3rdparty/bgfx/src/bgfx_compute.sh
r244652r244653
1616vec2  uintBitsToFloat(uint2 _x) { return asfloat(_x); }
1717vec3  uintBitsToFloat(uint3 _x) { return asfloat(_x); }
1818vec4  uintBitsToFloat(uint4 _x) { return asfloat(_x); }
19uint  floatBitsToUint(float _x) { return asuint(_x);  }
20uvec2 floatBitsToUint(vec2  _x) { return asuint(_x);  }
21uvec3 floatBitsToUint(vec3  _x) { return asuint(_x);  }
22uvec4 floatBitsToUint(vec4  _x) { return asuint(_x);  }
23int   floatBitsToInt(float _x)  { return asint(_x);   }
24ivec2 floatBitsToInt(vec2  _x)  { return asint(_x);   }
25ivec3 floatBitsToInt(vec3  _x)  { return asint(_x);   }
26ivec4 floatBitsToInt(vec4  _x)  { return asint(_x);   }
2719
20uint  floatBitsToUint(float _x) { return asuint(_x); }
21uvec2 floatBitsToUint(vec2  _x) { return asuint(_x); }
22uvec3 floatBitsToUint(vec3  _x) { return asuint(_x); }
23uvec4 floatBitsToUint(vec4  _x) { return asuint(_x); }
24
25int   floatBitsToInt(float _x) { return asint(_x); }
26ivec2 floatBitsToInt(vec2  _x) { return asint(_x); }
27ivec3 floatBitsToInt(vec3  _x) { return asint(_x); }
28ivec4 floatBitsToInt(vec4  _x) { return asint(_x); }
29
30uint  bitfieldReverse(uint  _x) { return reversebits(_x); }
31uint2 bitfieldReverse(uint2 _x) { return reversebits(_x); }
32uint3 bitfieldReverse(uint3 _x) { return reversebits(_x); }
33uint4 bitfieldReverse(uint4 _x) { return reversebits(_x); }
34
35uint packHalf2x16(vec2 _x)
36{
37   return (f32tof16(_x.x)<<16) | f32tof16(_x.y);
38}
39
40vec2 unpackHalf2x16(uint _x)
41{
42   return vec2(f16tof32(_x >> 16), f16tof32(_x) );
43}
44
2845#define SHARED groupshared
2946
3047#define IMAGE2D_RO(_name, _reg) Texture2D           _name : register(t[_reg])
r244652r244653
4259   return _image.Load(uint3(_uv.xy, 0) );
4360}
4461
45uint imageLoad(Texture2D<uint> _image, ivec2 _uv)
62uint4 imageLoad(Texture2D<uint> _image, ivec2 _uv)
4663{
47   return _image.Load(uint3(_uv.xy, 0) );
64   uint rr = _image.Load(uint3(_uv.xy, 0) );
65   return uint4(rr, rr, rr, rr);
4866}
4967
50uint imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
68uint4 imageLoad(RWTexture2D<uint> _image, ivec2 _uv)
5169{
52   return _image[_uv.xy];
70   uint rr = _image[_uv.xy];
71   return uint4(rr, rr, rr, rr);
5372}
5473
5574ivec2 imageSize(Texture2D _image)
trunk/3rdparty/bgfx/src/bgfx_p.h
r244652r244653
679679   };
680680
681681#define SORT_KEY_RENDER_DRAW (UINT64_C(1)<<0x2b)
682#define SORT_KEY_VIEW_SHIFT  UINT8_C(0x37)
683#define SORT_KEY_VIEW_MASK   ( (uint64_t(BGFX_CONFIG_MAX_VIEWS-1) )<<SORT_KEY_VIEW_SHIFT)
682684
683   BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS   <= 32);
685   BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS <= 256);
684686   BX_STATIC_ASSERT( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // must be power of 2
685687
686688   struct SortKey
r244652r244653
689691      {
690692         // |               3               2               1               0|
691693         // |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210|
692         // |    vvvvvsssssssssssdttpppppppppdddddddddddddddddddddddddddddddd|
694         // | vvvvvvvvsssssssssssdttpppppppppdddddddddddddddddddddddddddddddd|
693695         // |        ^          ^^ ^        ^                               ^|
694696         // |        |          || |        |                               ||
695697         // |   view-+      seq-+| +-trans  +-program                 depth-+|
r244652r244653
699701         const uint64_t program = uint64_t(m_program)<<0x20;
700702         const uint64_t trans   = uint64_t(m_trans  )<<0x29;
701703         const uint64_t seq     = uint64_t(m_seq    )<<0x2c;
702         const uint64_t view    = uint64_t(m_view   )<<0x37;
704         const uint64_t view    = uint64_t(m_view   )<<SORT_KEY_VIEW_SHIFT;
703705         const uint64_t key     = depth|program|trans|SORT_KEY_RENDER_DRAW|seq|view;
704706         return key;
705707      }
r244652r244653
708710      {
709711         // |               3               2               1               0|
710712         // |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210|
711         // |    vvvvvsssssssssssdppppppppp                                  |
713         // | vvvvvvvvsssssssssssdppppppppp                                  |
712714         // |        ^          ^^        ^                                  |
713715         // |        |          ||        |                                  |
714716         // |   view-+      seq-+|        +-program                          |
r244652r244653
716718
717719         const uint64_t program = uint64_t(m_program)<<0x22;
718720         const uint64_t seq     = uint64_t(m_seq    )<<0x2c;
719         const uint64_t view    = uint64_t(m_view   )<<0x37;
721         const uint64_t view    = uint64_t(m_view   )<<SORT_KEY_VIEW_SHIFT;
720722         const uint64_t key     = program|seq|view;
721723         return key;
722724      }
r244652r244653
725727      bool decode(uint64_t _key)
726728      {
727729         m_seq     = (_key>>0x2c)& 0x7ff;
728         m_view    = (_key>>0x37)&(BGFX_CONFIG_MAX_VIEWS-1);
730         m_view    = uint8_t( (_key&SORT_KEY_VIEW_MASK)>>SORT_KEY_VIEW_SHIFT);
729731         if (_key & SORT_KEY_RENDER_DRAW)
730732         {
731733            m_depth   =  _key       & 0xffffffff;
r244652r244653
738740         return true; // compute
739741      }
740742
743      bool decode(uint64_t _key, uint8_t _viewRemap[BGFX_CONFIG_MAX_VIEWS])
744      {
745         bool compute = decode(_key);
746         m_view = _viewRemap[m_view];
747         return compute;
748      }
749
750      static uint64_t remapView(uint64_t _key, uint8_t _viewRemap[BGFX_CONFIG_MAX_VIEWS])
751      {
752         const uint8_t  oldView  = uint8_t( (_key & SORT_KEY_VIEW_MASK) >> SORT_KEY_VIEW_SHIFT);
753         const uint64_t view     = uint64_t(_viewRemap[oldView])        << SORT_KEY_VIEW_SHIFT;
754         const uint64_t key      = (_key & ~SORT_KEY_VIEW_MASK) | view;
755         return key;
756      }
757
741758      void reset()
742759      {
743760         m_depth   = 0;
r244652r244653
13531370
13541371      void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices)
13551372      {
1356         BX_CHECK(_handle.idx < BGFX_CONFIG_MAX_VERTEX_BUFFERS, "Invalid vertex buffer handle. %d (< %d)", _handle.idx, BGFX_CONFIG_MAX_VERTEX_BUFFERS);
13571373         m_draw.m_startVertex  = _startVertex;
13581374         m_draw.m_numVertices  = _numVertices;
13591375         m_draw.m_vertexBuffer = _handle;
r244652r244653
13941410
13951411      void setProgram(ProgramHandle _handle)
13961412      {
1397         BX_CHECK(isValid(_handle), "Can't set program with invalid handle.");
13981413         m_key.m_program = _handle.idx;
13991414      }
14001415
r244652r244653
14321447         bind.m_un.m_compute.m_mip    = 0;
14331448      }
14341449
1435      void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access)
1450      void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
14361451      {
14371452         Binding& bind = m_compute.m_bind[_stage];
14381453         bind.m_idx    = _handle.idx;
r244652r244653
15641579
15651580      SortKey m_key;
15661581
1582      uint8_t m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
15671583      FrameBufferHandle m_fb[BGFX_CONFIG_MAX_VIEWS];
15681584      Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
15691585      float m_clearColor[BGFX_CONFIG_MAX_CLEAR_COLOR_PALETTE][4];
r244652r244653
17201736         m_free.push_back(Free(_ptr, _size) );
17211737      }
17221738
1739      uint64_t remove()
1740      {
1741         BX_CHECK(0 == m_used.size(), "");
1742
1743         if (0 < m_free.size() )
1744         {
1745            Free free = m_free.front();
1746            m_free.pop_front();
1747            return free.m_ptr;
1748         }
1749
1750         return 0;
1751      }
1752
17231753      uint64_t alloc(uint32_t _size)
17241754      {
17251755         for (FreeList::iterator it = m_free.begin(), itEnd = m_free.end(); it != itEnd; ++it)
r244652r244653
17581788         }
17591789      }
17601790
1761      void compact()
1791      bool compact()
17621792      {
17631793         m_free.sort();
17641794
r244652r244653
17751805               ++next;
17761806            }
17771807         }
1808
1809         return 0 == m_used.size();
17781810      }
17791811
17801812   private:
r244652r244653
21472179         else
21482180         {
21492181            m_dynIndexBufferAllocator.free(uint64_t(dib.m_handle.idx)<<32 | dib.m_offset);
2150            m_dynIndexBufferAllocator.compact();
2182            if (m_dynIndexBufferAllocator.compact() )
2183            {
2184               for (uint64_t ptr = m_dynIndexBufferAllocator.remove(); 0 != ptr; ptr = m_dynIndexBufferAllocator.remove() )
2185               {
2186                  IndexBufferHandle handle = { uint16_t(ptr>>32) };
2187                  destroyIndexBuffer(handle);
2188               }
2189            }
21512190         }
21522191
21532192         m_dynamicIndexBufferHandle.free(_handle.idx);
r244652r244653
22922331         else
22932332         {
22942333            m_dynVertexBufferAllocator.free(uint64_t(dvb.m_handle.idx)<<32 | dvb.m_offset);
2295            m_dynVertexBufferAllocator.compact();
2334            if (m_dynVertexBufferAllocator.compact() )
2335            {
2336               for (uint64_t ptr = m_dynVertexBufferAllocator.remove(); 0 != ptr; ptr = m_dynVertexBufferAllocator.remove() )
2337               {
2338                  VertexBufferHandle handle = { uint16_t(ptr>>32) };
2339                  destroyVertexBuffer(handle);
2340               }
2341            }
22962342         }
22972343
22982344         m_dynamicVertexBufferHandle.free(_handle.idx);
r244652r244653
26722718
26732719      BGFX_API_FUNC(TextureHandle createTexture(const Memory* _mem, uint32_t _flags, uint8_t _skip, TextureInfo* _info) )
26742720      {
2675         if (NULL != _info)
2721         TextureInfo ti;
2722         if (NULL == _info)
26762723         {
2677            ImageContainer imageContainer;
2678            if (imageParse(imageContainer, _mem->data, _mem->size) )
2679            {
2680               calcTextureSize(*_info
2681                  , (uint16_t)imageContainer.m_width
2682                  , (uint16_t)imageContainer.m_height
2683                  , (uint16_t)imageContainer.m_depth
2684                  , imageContainer.m_cubeMap
2685                  , imageContainer.m_numMips
2686                  , TextureFormat::Enum(imageContainer.m_format)
2687                  );
2688            }
2689            else
2690            {
2691               _info->format = TextureFormat::Unknown;
2692               _info->storageSize = 0;
2693               _info->width   = 0;
2694               _info->height  = 0;
2695               _info->depth   = 0;
2696               _info->numMips = 0;
2697               _info->bitsPerPixel = 0;
2698               _info->cubeMap = false;
2699            }
2724            _info = &ti;
27002725         }
27012726
2727         ImageContainer imageContainer;
2728         if (imageParse(imageContainer, _mem->data, _mem->size) )
2729         {
2730            calcTextureSize(*_info
2731               , (uint16_t)imageContainer.m_width
2732               , (uint16_t)imageContainer.m_height
2733               , (uint16_t)imageContainer.m_depth
2734               , imageContainer.m_cubeMap
2735               , imageContainer.m_numMips
2736               , TextureFormat::Enum(imageContainer.m_format)
2737               );
2738         }
2739         else
2740         {
2741            _info->format = TextureFormat::Unknown;
2742            _info->storageSize = 0;
2743            _info->width   = 0;
2744            _info->height  = 0;
2745            _info->depth   = 0;
2746            _info->numMips = 0;
2747            _info->bitsPerPixel = 0;
2748            _info->cubeMap = false;
2749         }
2750
27022751         TextureHandle handle = { m_textureHandle.alloc() };
27032752         BX_WARN(isValid(handle), "Failed to allocate texture handle.");
27042753         if (isValid(handle) )
27052754         {
27062755            TextureRef& ref = m_textureRef[handle.idx];
27072756            ref.m_refCount = 1;
2757            ref.m_format   = uint8_t(_info->format);
27082758
27092759            CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateTexture);
27102760            cmdbuf.write(handle);
r244652r244653
30383088         }
30393089      }
30403090
3091      BGFX_API_FUNC(void setViewRemap(uint8_t _id, uint8_t _num, const void* _remap) )
3092      {
3093         const uint32_t num = bx::uint32_min( (BGFX_CONFIG_MAX_VIEWS - _id) + _num, BGFX_CONFIG_MAX_VIEWS) - _id;
3094         if (NULL == _remap)
3095         {
3096            for (uint32_t ii = 0; ii < num; ++ii)
3097            {
3098               uint8_t id = uint8_t(ii+_id);
3099               m_viewRemap[id] = id;
3100            }
3101         }
3102         else
3103         {
3104            memcpy(&m_viewRemap[_id], _remap, num);
3105         }
3106      }
3107
30413108      BGFX_API_FUNC(void setMarker(const char* _marker) )
30423109      {
30433110         m_submit->setMarker(_marker);
r244652r244653
31903257         m_submit->setBuffer(_stage, dvb.m_handle, _access);
31913258      }
31923259
3193      BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, TextureFormat::Enum _format, Access::Enum _access) )
3260      BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format) )
31943261      {
3195         m_submit->setImage(_stage, _sampler, _handle, _mip, _format, _access);
3262         _format = TextureFormat::Count == _format ? TextureFormat::Enum(m_textureRef[_handle.idx].m_format) : _format;
3263         m_submit->setImage(_stage, _sampler, _handle, _mip, _access, _format);
31963264      }
31973265
3198      BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, TextureFormat::Enum _format, Access::Enum _access) )
3266      BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, Access::Enum _access, TextureFormat::Enum _format) )
31993267      {
32003268         BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment);
32013269         TextureHandle textureHandle = BGFX_INVALID_HANDLE;
r244652r244653
32073275            BX_CHECK(isValid(textureHandle), "Frame buffer texture %d is invalid.", _attachment);
32083276         }
32093277
3210         setImage(_stage, _sampler, textureHandle, 0, _format, _access);
3278         setImage(_stage, _sampler, textureHandle, 0, _access, _format);
32113279      }
32123280
32133281      BGFX_API_FUNC(uint32_t dispatch(uint8_t _id, ProgramHandle _handle, uint16_t _numX, uint16_t _numY, uint16_t _numZ, uint8_t _flags) )
r244652r244653
33373405      struct TextureRef
33383406      {
33393407         int16_t m_refCount;
3408         uint8_t m_format;
33403409      };
33413410
33423411      struct FrameBufferRef
r244652r244653
33583427      FrameBufferRef m_frameBufferRef[BGFX_CONFIG_MAX_FRAME_BUFFERS];
33593428      VertexDeclRef m_declRef;
33603429
3430      uint8_t m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
33613431      FrameBufferHandle m_fb[BGFX_CONFIG_MAX_VIEWS];
33623432      Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
33633433
trunk/3rdparty/bgfx/src/bgfx_shader.sh
r244652r244653
189189vec3 vec3_splat(float _x) { return vec3(_x, _x, _x); }
190190vec4 vec4_splat(float _x) { return vec4(_x, _x, _x, _x); }
191191
192uvec2 uvec2_splat(uint _x) { return uvec2(_x, _x); }
193uvec3 uvec3_splat(uint _x) { return uvec3(_x, _x, _x); }
194uvec4 uvec4_splat(uint _x) { return uvec4(_x, _x, _x, _x); }
195
192196vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_mtx, _vec); }
193197vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_vec, _mtx); }
194198vec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_mtx, _vec); }
r244652r244653
239243#   define vec2_splat(_x) vec2(_x)
240244#   define vec3_splat(_x) vec3(_x)
241245#   define vec4_splat(_x) vec4(_x)
246#   define uvec2_splat(_x) uvec2(_x)
247#   define uvec3_splat(_x) uvec3(_x)
248#   define uvec4_splat(_x) uvec4(_x)
242249
243250vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); }
244251vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_mtx, _vec); }
trunk/3rdparty/bgfx/src/config.h
r244652r244653
168168
169169#ifndef BGFX_CONFIG_MAX_VIEWS
170170// Do not change. Must be power of 2.
171#   define BGFX_CONFIG_MAX_VIEWS 32
171#   define BGFX_CONFIG_MAX_VIEWS 256
172172#endif // BGFX_CONFIG_MAX_VIEWS
173173
174174#define BGFX_CONFIG_MAX_VIEW_NAME_RESERVED 5
trunk/3rdparty/bgfx/src/glimports.h
r244652r244653
481481
482482GL_IMPORT      (true,  PFNGLINVALIDATEFRAMEBUFFERPROC,             glInvalidateFramebuffer, glDiscardFramebufferEXT);
483483
484#else
484#elif !BGFX_USE_GL_DYNAMIC_LIB
485485GL_IMPORT______(true,  PFNGLTEXIMAGE3DPROC,                        glTexImage3D);
486486GL_IMPORT______(true,  PFNGLTEXSUBIMAGE3DPROC,                     glTexSubImage3D);
487487GL_IMPORT______(true,  PFNGLCOMPRESSEDTEXIMAGE3DPROC,              glCompressedTexImage3D);
trunk/3rdparty/bgfx/src/renderer_d3d11.cpp
r244652r244653
665665#endif // BX_PLATFORM_WINRT
666666         BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
667667
668         DX_CHECK(m_factory->MakeWindowAssociation(g_bgfxHwnd, 0
669            | DXGI_MWA_NO_WINDOW_CHANGES
670            | DXGI_MWA_NO_ALT_ENTER
671            ) );
672
668673         m_numWindows = 1;
669674
670675         if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
r244652r244653
726731         }
727732
728733         // Init reserved part of view name.
729         for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
734         for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
730735         {
731736            char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1];
732737            bx::snprintf(name, sizeof(name), "%3d  ", ii);
r244652r244653
30513056         int32_t numItems = _render->m_num;
30523057         for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;)
30533058         {
3054            const bool isCompute = key.decode(_render->m_sortKeys[item]);
3059            const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
30553060            const bool viewChanged = 0
30563061               || key.m_view != view
30573062               || item == numItems
trunk/3rdparty/bgfx/src/renderer_d3d9.cpp
r244652r244653
570570         }
571571
572572         // Init reserved part of view name.
573         for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
573         for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
574574         {
575575            char name[BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1];
576576            bx::snprintf(name, sizeof(name), "%3d  ", ii);
r244652r244653
28642864      {
28652865         for (uint32_t item = 0, numItems = _render->m_num; item < numItems; ++item)
28662866         {
2867            const bool isCompute = key.decode(_render->m_sortKeys[item]);
2867            const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
28682868
28692869            if (isCompute)
28702870            {
trunk/3rdparty/bgfx/src/renderer_gl.cpp
r244652r244653
232232      { GL_DEPTH_COMPONENT32F,                       GL_DEPTH_COMPONENT,                          GL_FLOAT,                        false }, // D16F
233233      { GL_DEPTH_COMPONENT32F,                       GL_DEPTH_COMPONENT,                          GL_FLOAT,                        false }, // D24F
234234      { GL_DEPTH_COMPONENT32F,                       GL_DEPTH_COMPONENT,                          GL_FLOAT,                        false }, // D32F
235      { GL_STENCIL_INDEX8,                           GL_DEPTH_STENCIL,                            GL_UNSIGNED_BYTE,                false }, // D0S8
235      { GL_STENCIL_INDEX8,                           GL_STENCIL_INDEX,                            GL_UNSIGNED_BYTE,                false }, // D0S8
236236   };
237237   BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
238238
r244652r244653
430430         OES_texture_npot,
431431         OES_texture_half_float,
432432         OES_texture_half_float_linear,
433         OES_texture_stencil8,
433434         OES_vertex_array_object,
434435         OES_vertex_half_float,
435436         OES_vertex_type_10_10_10_2,
r244652r244653
590591      { "OES_texture_npot",                      false,                             true  },
591592      { "OES_texture_half_float",                false,                             true  },
592593      { "OES_texture_half_float_linear",         false,                             true  },
594      { "OES_texture_stencil8",                  false,                             true  },
593595      { "OES_vertex_array_object",               false,                             !BX_PLATFORM_IOS },
594596      { "OES_vertex_half_float",                 false,                             true  },
595597      { "OES_vertex_type_10_10_10_2",            false,                             true  },
r244652r244653
11651167            }
11661168         }
11671169
1168         if (!isTextureFormatValid(TextureFormat::R8) )
1170         if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
1171         ||  !isTextureFormatValid(TextureFormat::R8) )
11691172         {
11701173            // GL core has to use GL_R8 Issue#208, GLES2 has to use GL_LUMINANCE issue#226
11711174            s_textureFormat[TextureFormat::R8].m_internalFmt = GL_LUMINANCE;
r244652r244653
13851388         }
13861389
13871390         // Init reserved part of view name.
1388         for (uint8_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
1391         for (uint32_t ii = 0; ii < BGFX_CONFIG_MAX_VIEWS; ++ii)
13891392         {
13901393            bx::snprintf(s_viewName[ii], BGFX_CONFIG_MAX_VIEW_NAME_RESERVED+1, "%3d  ", ii);
13911394         }
r244652r244653
25542557         GLSL_TYPE(GL_IMAGE_2D);
25552558         GLSL_TYPE(GL_IMAGE_3D);
25562559         GLSL_TYPE(GL_IMAGE_CUBE);
2560         GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_1D);
2561         GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_2D);
2562         GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_3D);
2563         GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_CUBE);
25572564      }
25582565
25592566#undef GLSL_TYPE
r244652r244653
26362643      case GL_IMAGE_2D:
26372644      case GL_IMAGE_3D:
26382645      case GL_IMAGE_CUBE:
2646      case GL_UNSIGNED_INT_IMAGE_1D:
2647      case GL_UNSIGNED_INT_IMAGE_2D:
2648      case GL_UNSIGNED_INT_IMAGE_3D:
2649      case GL_UNSIGNED_INT_IMAGE_CUBE:
26392650         return UniformType::Uniform1iv;
26402651      };
26412652
r244652r244653
28332844         case GL_IMAGE_2D:
28342845         case GL_IMAGE_3D:
28352846         case GL_IMAGE_CUBE:
2847         case GL_UNSIGNED_INT_IMAGE_1D:
2848         case GL_UNSIGNED_INT_IMAGE_2D:
2849         case GL_UNSIGNED_INT_IMAGE_3D:
2850         case GL_UNSIGNED_INT_IMAGE_CUBE:
28362851            BX_TRACE("Sampler #%d at location %d.", m_numSamplers, loc);
28372852            m_sampler[m_numSamplers] = loc;
28382853            m_numSamplers++;
r244652r244653
42794294         int32_t numItems = _render->m_num;
42804295         for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;)
42814296         {
4282            const bool isCompute   = key.decode(_render->m_sortKeys[item]);
4297            const bool isCompute   = key.decode(_render->m_sortKeys[item], _render->m_viewRemap);
42834298            const bool viewChanged = 0
42844299               || key.m_view != view
42854300               || item == numItems
trunk/3rdparty/bgfx/src/renderer_gl.h
r244652r244653
167167#   define GL_RGBA32F 0x8814
168168#endif // GL_RGBA32F
169169
170#ifndef GL_STENCIL_INDEX
171#   define GL_STENCIL_INDEX 0x1901
172#endif // GL_STENCIL_INDEX
173
170174#ifndef GL_RED
171175#   define GL_RED 0x1903
172176#endif // GL_RED
r244652r244653
472476#   define GL_IMAGE_CUBE 0x9050
473477#endif // GL_IMAGE_CUBE
474478
479#ifndef GL_UNSIGNED_INT_IMAGE_1D
480#   define GL_UNSIGNED_INT_IMAGE_1D 0x9062
481#endif // GL_UNSIGNED_INT_IMAGE_1D
482
483#ifndef GL_UNSIGNED_INT_IMAGE_2D
484#   define GL_UNSIGNED_INT_IMAGE_2D 0x9063
485#endif // GL_UNSIGNED_INT_IMAGE_2D
486
487#ifndef GL_UNSIGNED_INT_IMAGE_3D
488#   define GL_UNSIGNED_INT_IMAGE_3D 0x9064
489#endif // GL_UNSIGNED_INT_IMAGE_3D
490
491#ifndef GL_UNSIGNED_INT_IMAGE_CUBE
492#   define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
493#endif // GL_UNSIGNED_INT_IMAGE_CUBE
494
475495#ifndef GL_PROGRAM_INPUT
476496#   define GL_PROGRAM_INPUT 0x92E3
477497#endif // GL_PROGRAM_INPUT
r244652r244653
892912      GLint m_attributes[Attrib::Count]; // sparse
893913      GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT];
894914
895       GLint m_sampler[BGFX_CONFIG_MAX_TEXTURES];
915       GLint m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
896916       uint8_t m_numSamplers;
897917
898918      ConstantBuffer* m_constantBuffer;
trunk/3rdparty/bx/scripts/genie.lua
r244652r244653
1717
1818   language "C++"
1919
20BX_DIR = (path.getabsolute("..") .. "/")
21local BX_BUILD_DIR = (BX_DIR .. ".build/")
22local BX_THIRD_PARTY_DIR = (BX_DIR .. "3rdparty/")
20BX_DIR = path.getabsolute("..")
21local BX_BUILD_DIR = path.join(BX_DIR, ".build")
22local BX_THIRD_PARTY_DIR = path.join(BX_DIR, "3rdparty")
2323
2424defines {
2525   "BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS=1"
r244652r244653
3939   uuid "8a653da8-23d6-11e3-acb4-887628d43830"
4040   kind "ConsoleApp"
4141
42   debugdir (BX_DIR .. "tests")
42   debugdir (path.join(BX_DIR, "tests"))
4343
4444   removeflags {
4545      "NoExceptions",
4646   }
4747
4848   includedirs {
49      BX_DIR .. "include",
50      BX_THIRD_PARTY_DIR .. "UnitTest++/src/",
49      path.join(BX_DIR, "include"),
50      path.join(BX_THIRD_PARTY_DIR, "UnitTest++/src"),
5151   }
5252
5353   links {
r244652r244653
5555   }
5656
5757   files {
58      BX_DIR .. "tests/**.cpp",
59      BX_DIR .. "tests/**.H",
58      path.join(BX_DIR, "tests/**.cpp"),
59      path.join(BX_DIR, "tests/**.H"),
6060   }
6161
6262   configuration { "vs*" }
trunk/3rdparty/bx/scripts/toolchain.lua
r244652r244653
33-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
44--
55
6local bxDir = (path.getabsolute("..") .. "/")
6local bxDir = path.getabsolute("..")
77local naclToolchain = ""
88
99function toolchain(_buildDir, _libDir)
r244652r244653
7171   -- Avoid error when invoking genie --help.
7272   if (_ACTION == nil) then return false end
7373
74   location (_buildDir .. "projects/" .. _ACTION)
74   location (path.join(_buildDir, "projects", _ACTION))
7575
7676   if _ACTION == "clean" then
7777      os.rmdir(BUILD_DIR)
r244652r244653
107107         premake.gcc.cc  = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
108108         premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
109109         premake.gcc.ar  = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
110         location (_buildDir .. "projects/" .. _ACTION .. "-android-arm")
110         location (path.join(_buildDir, "projects", _ACTION .. "-android-arm"))
111111      end
112112
113113      if "android-mips" == _OPTIONS["gcc"] then
r244652r244653
119119         premake.gcc.cc  = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-gcc"
120120         premake.gcc.cxx = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-g++"
121121         premake.gcc.ar  = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar"
122         location (_buildDir .. "projects/" .. _ACTION .. "-android-mips")
122         location (path.join(_buildDir, "projects", _ACTION .. "-android-mips"))
123123      end
124124
125125      if "android-x86" == _OPTIONS["gcc"] then
r244652r244653
131131         premake.gcc.cc  = "$(ANDROID_NDK_X86)/bin/i686-linux-android-gcc"
132132         premake.gcc.cxx = "$(ANDROID_NDK_X86)/bin/i686-linux-android-g++"
133133         premake.gcc.ar  = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar"
134         location (_buildDir .. "projects/" .. _ACTION .. "-android-x86")
134         location (path.join(_buildDir, "projects", _ACTION .. "-android-x86"))
135135      end
136136
137137      if "asmjs" == _OPTIONS["gcc"] then
r244652r244653
144144         premake.gcc.cxx  = "$(EMSCRIPTEN)/em++"
145145         premake.gcc.ar   = "$(EMSCRIPTEN)/emar"
146146         premake.gcc.llvm = true
147         location (_buildDir .. "projects/" .. _ACTION .. "-asmjs")
147         location (path.join(_buildDir, "projects", _ACTION .. "-asmjs"))
148148      end
149149
150150      if "freebsd" == _OPTIONS["gcc"] then
151         location (_buildDir .. "projects/" .. _ACTION .. "-freebsd")
151         location (path.join(_buildDir, "projects", _ACTION .. "-freebsd"))
152152      end
153153
154154      if "ios-arm" == _OPTIONS["gcc"] then
155155         premake.gcc.cc  = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
156156         premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
157157         premake.gcc.ar  = "ar"
158         location (_buildDir .. "projects/" .. _ACTION .. "-ios-arm")
158         location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm"))
159159      end
160160
161161      if "ios-simulator" == _OPTIONS["gcc"] then
162162         premake.gcc.cc  = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
163163         premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
164164         premake.gcc.ar  = "ar"
165         location (_buildDir .. "projects/" .. _ACTION .. "-ios-simulator")
165         location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator"))
166166      end
167167
168168      if "linux-gcc" == _OPTIONS["gcc"] then
169         location (_buildDir .. "projects/" .. _ACTION .. "-linux")
169         location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
170170      end
171171
172172      if "linux-clang" == _OPTIONS["gcc"] then
173173         premake.gcc.cc  = "clang"
174174         premake.gcc.cxx = "clang++"
175175         premake.gcc.ar  = "ar"
176         location (_buildDir .. "projects/" .. _ACTION .. "-linux-clang")
176         location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
177177      end
178178
179179      if "mingw-gcc" == _OPTIONS["gcc"] then
180180         premake.gcc.cc  = "$(MINGW)/bin/x86_64-w64-mingw32-gcc"
181181         premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++"
182182         premake.gcc.ar  = "$(MINGW)/bin/ar"
183         location (_buildDir .. "projects/" .. _ACTION .. "-mingw-gcc")
183         location (path.join(_buildDir, "projects", _ACTION .. "-mingw-gcc"))
184184      end
185185
186186      if "mingw-clang" == _OPTIONS["gcc"] then
r244652r244653
189189         premake.gcc.ar   = "$(MINGW)/bin/ar"
190190--         premake.gcc.ar   = "$(CLANG)/bin/llvm-ar"
191191--         premake.gcc.llvm = true
192         location (_buildDir .. "projects/" .. _ACTION .. "-mingw-clang")
192         location (path.join(_buildDir, "projects", _ACTION .. "-mingw-clang"))
193193      end
194194
195195      if "nacl" == _OPTIONS["gcc"] then
r244652r244653
208208         premake.gcc.cc  = naclToolchain .. "gcc"
209209         premake.gcc.cxx = naclToolchain .. "g++"
210210         premake.gcc.ar  = naclToolchain .. "ar"
211         location (_buildDir .. "projects/" .. _ACTION .. "-nacl")
211         location (path.join(_buildDir, "projects", _ACTION .. "-nacl"))
212212      end
213213
214214      if "nacl-arm" == _OPTIONS["gcc"] then
r244652r244653
227227         premake.gcc.cc  = naclToolchain .. "gcc"
228228         premake.gcc.cxx = naclToolchain .. "g++"
229229         premake.gcc.ar  = naclToolchain .. "ar"
230         location (_buildDir .. "projects/" .. _ACTION .. "-nacl-arm")
230         location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm"))
231231      end
232232
233233      if "osx" == _OPTIONS["gcc"] then
r244652r244653
237237            premake.gcc.cxx = osxToolchain .. "clang++"
238238            premake.gcc.ar  = osxToolchain .. "ar"
239239         end
240         location (_buildDir .. "projects/" .. _ACTION .. "-osx")
240         location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
241241      end
242242
243243      if "pnacl" == _OPTIONS["gcc"] then
r244652r244653
256256         premake.gcc.cc  = naclToolchain .. "clang"
257257         premake.gcc.cxx = naclToolchain .. "clang++"
258258         premake.gcc.ar  = naclToolchain .. "ar"
259         location (_buildDir .. "projects/" .. _ACTION .. "-pnacl")
259         location (path.join(_buildDir, "projects", _ACTION .. "-pnacl"))
260260      end
261261
262262      if "qnx-arm" == _OPTIONS["gcc"] then
r244652r244653
268268         premake.gcc.cc  = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc"
269269         premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++"
270270         premake.gcc.ar  = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar"
271         location (_buildDir .. "projects/" .. _ACTION .. "-qnx-arm")
271         location (path.join(_buildDir, "projects", _ACTION .. "-qnx-arm"))
272272      end
273273
274274      if "rpi" == _OPTIONS["gcc"] then
275         location (_buildDir .. "projects/" .. _ACTION .. "-rpi")
275         location (path.join(_buildDir, "projects", _ACTION .. "-rpi"))
276276      end
277277   elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then
278278
279279      if (_ACTION .. "-clang") == _OPTIONS["vs"] then
280280         premake.vstudio.toolset = ("LLVM-" .. _ACTION)
281         location (_buildDir .. "projects/" .. _ACTION .. "-clang")
281         location (path.join(_buildDir, "projects", _ACTION .. "-clang"))
282282      end
283283
284284      if "winphone8" == _OPTIONS["vs"] then
285285         premake.vstudio.toolset = "v110_wp80"
286         location (_buildDir .. "projects/" .. _ACTION .. "-winphone8")
286         location (path.join(_buildDir, "projects", _ACTION .. "-winphone8"))
287287      end
288288
289289      if "winphone81" == _OPTIONS["vs"] then
290290         premake.vstudio.toolset = "v120_wp81"
291291         platforms { "ARM" }
292         location (_buildDir .. "projects/" .. _ACTION .. "-winphone81")
292         location (path.join(_buildDir, "projects", _ACTION .. "-winphone81"))
293293      end
294294   elseif _ACTION == "xcode4" then
295295
296296      if "osx" == _OPTIONS["xcode"] then
297297         premake.xcode.toolset = "macosx"
298         location (_buildDir .. "projects/" .. _ACTION .. "-osx")
298         location (path.join(_buildDir, "projects", _ACTION .. "-osx"))
299299      end
300300      if "ios" == _OPTIONS["xcode"] then
301301         premake.xcode.toolset = "iphoneos"
302         location (_buildDir .. "projects/" .. _ACTION .. "-ios")
302         location (path.join(_buildDir, "projects", _ACTION .. "-ios"))
303303      end
304304   end
305305
r244652r244653
334334      }
335335
336336   configuration { "vs*" }
337      includedirs { bxDir .. "include/compat/msvc" }
337      includedirs { path.join(bxDir, "include/compat/msvc") }
338338      defines {
339339         "WIN32",
340340         "_WIN32",
r244652r244653
355355      }
356356
357357   configuration { "vs2008" }
358      includedirs { bxDir .. "include/compat/msvc/pre1600" }
358      includedirs { path.join(bxDir .. "include/compat/msvc/pre1600") }
359359
360360   configuration { "x32", "vs*" }
361      targetdir (_buildDir .. "win32_" .. _ACTION .. "/bin")
362      objdir (_buildDir .. "win32_" .. _ACTION .. "/obj")
361      targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin"))
362      objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
363363      libdirs {
364         _libDir .. "lib/win32_" .. _ACTION,
364         path.join(_libDir, "lib/win32_" .. _ACTION),
365365         "$(DXSDK_DIR)/lib/x86",
366366      }
367367
368368   configuration { "x64", "vs*" }
369369      defines { "_WIN64" }
370      targetdir (_buildDir .. "win64_" .. _ACTION .. "/bin")
371      objdir (_buildDir .. "win64_" .. _ACTION .. "/obj")
370      targetdir (path.join(_buildDir, "win64_" .. _ACTION, "bin"))
371      objdir (path.join(_buildDir, "win64_" .. _ACTION, "obj"))
372372      libdirs {
373         _libDir .. "lib/win64_" .. _ACTION,
373         path.join(_libDir, "lib/win64_" .. _ACTION),
374374         "$(DXSDK_DIR)/lib/x64",
375375      }
376376
377377   configuration { "ARM", "vs*" }
378      targetdir (_buildDir .. "arm_" .. _ACTION .. "/bin")
379      objdir (_buildDir .. "arm_" .. _ACTION .. "/obj")
378      targetdir (path.join(_buildDir, "arm_" .. _ACTION, "bin"))
379      objdir (path.join(_buildDir, "arm_" .. _ACTION, "obj"))
380380
381381   configuration { "vs*-clang" }
382382      buildoptions {
r244652r244653
384384      }
385385
386386   configuration { "x32", "vs*-clang" }
387      targetdir (_buildDir .. "win32_" .. _ACTION .. "-clang/bin")
388      objdir (_buildDir .. "win32_" .. _ACTION .. "-clang/obj")
387      targetdir (path.join(_buildDir, "win32_" .. _ACTION .. "-clang/bin"))
388      objdir (path.join(_buildDir, "win32_" .. _ACTION .. "-clang/obj"))
389389
390390   configuration { "x64", "vs*-clang" }
391      targetdir (_buildDir .. "win64_" .. _ACTION .. "-clang/bin")
392      objdir (_buildDir .. "win64_" .. _ACTION .. "-clang/obj")
391      targetdir (path.join(_buildDir, "win64_" .. _ACTION .. "-clang/bin"))
392      objdir (path.join(_buildDir, "win64_" .. _ACTION .. "-clang/obj"))
393393
394394   configuration { "winphone8*" }
395395      removeflags {
r244652r244653
399399
400400   configuration { "mingw-*" }
401401      defines { "WIN32" }
402      includedirs { bxDir .. "include/compat/mingw" }
402      includedirs { path.join(bxDir, "include/compat/mingw") }
403403      buildoptions {
404404         "-std=c++11",
405405         "-Wunused-value",
r244652r244653
416416      }
417417
418418   configuration { "x32", "mingw-gcc" }
419      targetdir (_buildDir .. "win32_mingw-gcc" .. "/bin")
420      objdir (_buildDir .. "win32_mingw-gcc" .. "/obj")
419      targetdir (path.join(_buildDir, "win32_mingw-gcc/bin"))
420      objdir (path.join(_buildDir, "win32_mingw-gcc/obj"))
421421      libdirs {
422         _libDir .. "lib/win32_mingw-gcc",
422         path.join(_libDir, "lib/win32_mingw-gcc"),
423423         "$(DXSDK_DIR)/lib/x86",
424424      }
425425      buildoptions { "-m32" }
426426
427427   configuration { "x64", "mingw-gcc" }
428      targetdir (_buildDir .. "win64_mingw-gcc" .. "/bin")
429      objdir (_buildDir .. "win64_mingw-gcc" .. "/obj")
428      targetdir (path.join(_buildDir, "win64_mingw-gcc/bin"))
429      objdir (path.join(_buildDir, "win64_mingw-gcc/obj"))
430430      libdirs {
431         _libDir .. "lib/win64_mingw-gcc",
431         path.join(_libDir, "lib/win64_mingw-gcc"),
432432         "$(DXSDK_DIR)/lib/x64",
433433         "$(GLES_X64_DIR)",
434434      }
r244652r244653
446446      }
447447
448448   configuration { "x32", "mingw-clang" }
449      targetdir (_buildDir .. "win32_mingw-clang" .. "/bin")
450      objdir (_buildDir .. "win32_mingw-clang" .. "/obj")
449      targetdir (path.join(_buildDir, "win32_mingw-clang/bin"))
450      objdir (path.join(_buildDir, "win32_mingw-clang/obj"))
451451      libdirs {
452         _libDir .. "lib/win32_mingw-clang",
452         path.join(_libDir, "lib/win32_mingw-clang"),
453453         "$(DXSDK_DIR)/lib/x86",
454454      }
455455      buildoptions { "-m32" }
456456
457457   configuration { "x64", "mingw-clang" }
458      targetdir (_buildDir .. "win64_mingw-clang" .. "/bin")
459      objdir (_buildDir .. "win64_mingw-clang" .. "/obj")
458      targetdir (path.join(_buildDir, "win64_mingw-clang/bin"))
459      objdir (path.join(_buildDir, "win64_mingw-clang/obj"))
460460      libdirs {
461         _libDir .. "lib/win64_mingw-clang",
461         path.join(_libDir, "lib/win64_mingw-clang"),
462462         "$(DXSDK_DIR)/lib/x64",
463463         "$(GLES_X64_DIR)",
464464      }
r244652r244653
487487      }
488488
489489   configuration { "linux-gcc", "x32" }
490      targetdir (_buildDir .. "linux32_gcc" .. "/bin")
491      objdir (_buildDir .. "linux32_gcc" .. "/obj")
492      libdirs { _libDir .. "lib/linux32_gcc" }
490      targetdir (path.join(_buildDir, "linux32_gcc/bin"))
491      objdir (path.join(_buildDir, "linux32_gcc/obj"))
492      libdirs { path.join(_libDir, "lib/linux32_gcc") }
493493      buildoptions {
494494         "-m32",
495495      }
496496
497497   configuration { "linux-gcc", "x64" }
498      targetdir (_buildDir .. "linux64_gcc" .. "/bin")
499      objdir (_buildDir .. "linux64_gcc" .. "/obj")
500      libdirs { _libDir .. "lib/linux64_gcc" }
498      targetdir (path.join(_buildDir, "linux64_gcc/bin"))
499      objdir (path.join(_buildDir, "linux64_gcc/obj"))
500      libdirs { path.join(_libDir, "lib/linux64_gcc") }
501501      buildoptions {
502502         "-m64",
503503      }
504504
505505   configuration { "linux-clang", "x32" }
506      targetdir (_buildDir .. "linux32_clang" .. "/bin")
507      objdir (_buildDir .. "linux32_clang" .. "/obj")
508      libdirs { _libDir .. "lib/linux32_clang" }
506      targetdir (path.join(_buildDir, "linux32_clang/bin"))
507      objdir (path.join(_buildDir, "linux32_clang/obj"))
508      libdirs { path.join(_libDir, "lib/linux32_clang") }
509509      buildoptions {
510510         "-m32",
511511      }
512512
513513   configuration { "linux-clang", "x64" }
514      targetdir (_buildDir .. "linux64_clang" .. "/bin")
515      objdir (_buildDir .. "linux64_clang" .. "/obj")
516      libdirs { _libDir .. "lib/linux64_clang" }
514      targetdir (path.join(_buildDir, "linux64_clang/bin"))
515      objdir (path.join(_buildDir, "linux64_clang/obj"))
516      libdirs { path.join(_libDir, "lib/linux64_clang") }
517517      buildoptions {
518518         "-m64",
519519      }
r244652r244653
559559      }
560560
561561   configuration { "android-arm" }
562      targetdir (_buildDir .. "android-arm" .. "/bin")
563      objdir (_buildDir .. "android-arm" .. "/obj")
562      targetdir (path.join(_buildDir, "android-arm/bin"))
563      objdir (path.join(_buildDir, "android-arm/obj"))
564564      libdirs {
565         _libDir .. "lib/android-arm",
565         path.join(_libDir, "lib/android-arm"),
566566         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
567567      }
568568      includedirs {
569569         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
570570      }
571571      buildoptions {
572         "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm",
572         "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
573573         "-mthumb",
574574         "-march=armv7-a",
575575         "-mfloat-abi=softfp",
r244652r244653
578578         "-Wundef",
579579      }
580580      linkoptions {
581         "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm",
582         "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm/usr/lib/crtbegin_so.o",
583         "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm/usr/lib/crtend_so.o",
581         "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
582         path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtbegin_so.o"),
583         path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtend_so.o"),
584584         "-march=armv7-a",
585585         "-Wl,--fix-cortex-a8",
586586      }
587587
588588   configuration { "android-mips" }
589      targetdir (_buildDir .. "android-mips" .. "/bin")
590      objdir (_buildDir .. "android-mips" .. "/obj")
589      targetdir (path.join(_buildDir, "android-mips/bin"))
590      objdir (path.join(_buildDir, "android-mips/obj"))
591591      libdirs {
592         _libDir .. "lib/android-mips",
592         path.join(_libDir, "lib/android-mips"),
593593         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips",
594594      }
595595      includedirs {
596596         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include",
597597      }
598598      buildoptions {
599         "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips",
599         "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
600600         "-Wunused-value",
601601         "-Wundef",
602602      }
603603      linkoptions {
604         "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips",
605         "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips/usr/lib/crtbegin_so.o",
606         "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips/usr/lib/crtend_so.o",
604         "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips"),
605         path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtbegin_so.o"),
606         path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-mips/usr/lib/crtend_so.o"),
607607      }
608608
609609   configuration { "android-x86" }
610      targetdir (_buildDir .. "android-x86" .. "/bin")
611      objdir (_buildDir .. "android-x86" .. "/obj")
610      targetdir (path.join(_buildDir, "android-x86/bin"))
611      objdir (path.join(_buildDir, "android-x86/obj"))
612612      libdirs {
613         _libDir .. "lib/android-x86",
613         path.join(_libDir, "lib/android-x86"),
614614         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86",
615615      }
616616      includedirs {
617617         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include",
618618      }
619619      buildoptions {
620         "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86",
620         "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
621621         "-march=i686",
622622         "-mtune=atom",
623623         "-mstackrealign",
r244652r244653
627627         "-Wundef",
628628      }
629629      linkoptions {
630         "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86",
631         "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86/usr/lib/crtbegin_so.o",
632         "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86/usr/lib/crtend_so.o",
630         "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
631         path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtbegin_so.o"),
632         path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "/arch-x86/usr/lib/crtend_so.o"),
633633      }
634634
635635   configuration { "asmjs" }
636      targetdir (_buildDir .. "asmjs" .. "/bin")
637      objdir (_buildDir .. "asmjs" .. "/obj")
638      libdirs { _libDir .. "lib/asmjs" }
636      targetdir (path.join(_buildDir, "asmjs/bin"))
637      objdir (path.join(_buildDir, "asmjs/obj"))
638      libdirs { path.join(_libDir, "lib/asmjs") }
639639      buildoptions {
640640         "-isystem$(EMSCRIPTEN)/system/include",
641641         "-isystem$(EMSCRIPTEN)/system/include/libc",
r244652r244653
644644      }
645645
646646   configuration { "freebsd" }
647      targetdir (_buildDir .. "freebsd" .. "/bin")
648      objdir (_buildDir .. "freebsd" .. "/obj")
649      libdirs { _libDir .. "lib/freebsd" }
647      targetdir (path.join(_buildDir, "freebsd/bin"))
648      objdir (path.join(_buildDir, "freebsd/obj"))
649      libdirs { path.join(_libDir, "lib/freebsd") }
650650      includedirs {
651         bxDir .. "include/compat/freebsd",
651         path.join(bxDir, "include/compat/freebsd"),
652652      }
653653
654654   configuration { "nacl or nacl-arm or pnacl" }
r244652r244653
664664      }
665665      includedirs {
666666         "$(NACL_SDK_ROOT)/include",
667         bxDir .. "include/compat/nacl",
667         path.join(bxDir, "include/compat/nacl"),
668668      }
669669
670670   configuration { "nacl" }
r244652r244653
678678      }
679679
680680   configuration { "x32", "nacl" }
681      targetdir (_buildDir .. "nacl-x86" .. "/bin")
682      objdir (_buildDir .. "nacl-x86" .. "/obj")
683      libdirs { _libDir .. "lib/nacl-x86" }
681      targetdir (path.join(_buildDir, "nacl-x86/bin"))
682      objdir (path.join(_buildDir, "nacl-x86/obj"))
683      libdirs { path.join(_libDir, "lib/nacl-x86") }
684684      linkoptions { "-melf32_nacl" }
685685
686686   configuration { "x32", "nacl", "Debug" }
r244652r244653
690690      libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Release" }
691691
692692   configuration { "x64", "nacl" }
693      targetdir (_buildDir .. "nacl-x64" .. "/bin")
694      objdir (_buildDir .. "nacl-x64" .. "/obj")
695      libdirs { _libDir .. "lib/nacl-x64" }
693      targetdir (path.join(_buildDir, "nacl-x64/bin"))
694      objdir (path.join(_buildDir, "nacl-x64/obj"))
695      libdirs { path.join(_libDir, "lib/nacl-x64") }
696696      linkoptions { "-melf64_nacl" }
697697
698698   configuration { "x64", "nacl", "Debug" }
r244652r244653
705705      buildoptions {
706706         "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
707707      }
708      targetdir (_buildDir .. "nacl-arm" .. "/bin")
709      objdir (_buildDir .. "nacl-arm" .. "/obj")
710      libdirs { _libDir .. "lib/nacl-arm" }
708      targetdir (path.join(_buildDir, "nacl-arm/bin"))
709      objdir (path.join(_buildDir, "nacl-arm/obj"))
710      libdirs { path.join(_libDir, "lib/nacl-arm") }
711711
712712   configuration { "nacl-arm", "Debug" }
713713      libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Debug" }
r244652r244653
716716      libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Release" }
717717
718718   configuration { "pnacl" }
719      targetdir (_buildDir .. "pnacl" .. "/bin")
720      objdir (_buildDir .. "pnacl" .. "/obj")
721      libdirs { _libDir .. "lib/pnacl" }
719      targetdir (path.join(_buildDir, "pnacl/bin"))
720      objdir (path.join(_buildDir, "pnacl/obj"))
721      libdirs { path.join(_libDir, "lib/pnacl") }
722722
723723   configuration { "pnacl", "Debug" }
724724      libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" }
r244652r244653
727727      libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" }
728728
729729   configuration { "Xbox360" }
730      targetdir (_buildDir .. "xbox360" .. "/bin")
731      objdir (_buildDir .. "xbox360" .. "/obj")
732      includedirs { bxDir .. "include/compat/msvc" }
733      libdirs { _libDir .. "lib/xbox360" }
730      targetdir (path.join(_buildDir, "xbox360/bin"))
731      objdir (path.join(_buildDir, "xbox360/obj"))
732      includedirs { path.join(bxDir, "include/compat/msvc") }
733      libdirs { path.join(_libDir, "lib/xbox360") }
734734      defines {
735735         "NOMINMAX",
736736         "_XBOX",
737737      }
738738
739739   configuration { "osx", "x32" }
740      targetdir (_buildDir .. "osx32_clang" .. "/bin")
741      objdir (_buildDir .. "osx32_clang" .. "/obj")
742      libdirs { _libDir .. "lib/osx32_clang" }
740      targetdir (path.join(_buildDir, "osx32_clang/bin"))
741      objdir (path.join(_buildDir, "osx32_clang/obj"))
742      libdirs { path.join(_libDir, "lib/osx32_clang") }
743743      buildoptions {
744744         "-m32",
745745      }
746746
747747   configuration { "osx", "x64" }
748      targetdir (_buildDir .. "osx64_clang" .. "/bin")
749      objdir (_buildDir .. "osx64_clang" .. "/obj")
750      libdirs { _libDir .. "lib/osx64_clang" }
748      targetdir (path.join(_buildDir, "osx64_clang/bin"))
749      objdir (path.join(_buildDir, "osx64_clang/obj"))
750      libdirs { path.join(_libDir, "lib/osx64_clang") }
751751      buildoptions {
752752         "-m64",
753753      }
r244652r244653
759759         "-Wunused-value",
760760         "-Wundef",
761761      }
762      includedirs { bxDir .. "include/compat/osx" }
762      includedirs { path.join(bxDir, "include/compat/osx") }
763763
764764   configuration { "ios*" }
765765      linkoptions {
r244652r244653
770770         "-Wunused-value",
771771         "-Wundef",
772772      }
773      includedirs { bxDir .. "include/compat/ios" }
773      includedirs { path.join(bxDir, "include/compat/ios") }
774774
775775   configuration { "ios-arm" }
776      targetdir (_buildDir .. "ios-arm" .. "/bin")
777      objdir (_buildDir .. "ios-arm" .. "/obj")
778      libdirs { _libDir .. "lib/ios-arm" }
776      targetdir (path.join(_buildDir, "ios-arm/bin"))
777      objdir (path.join(_buildDir, "ios-arm/obj"))
778      libdirs { path.join(_libDir, "lib/ios-arm") }
779779      linkoptions {
780780         "-miphoneos-version-min=7.0",
781781         "-arch armv7",
r244652r244653
791791      }
792792
793793   configuration { "ios-simulator" }
794      targetdir (_buildDir .. "ios-simulator" .. "/bin")
795      objdir (_buildDir .. "ios-simulator" .. "/obj")
796      libdirs { _libDir .. "lib/ios-simulator" }
794      targetdir (path.join(_buildDir, "ios-simulator/bin"))
795      objdir (path.join(_buildDir, "ios-simulator/obj"))
796      libdirs { path.join(_libDir, "lib/ios-simulator") }
797797      linkoptions {
798798         "-mios-simulator-version-min=7.0",
799799         "-arch i386",
r244652r244653
809809      }
810810
811811   configuration { "qnx-arm" }
812      targetdir (_buildDir .. "qnx-arm" .. "/bin")
813      objdir (_buildDir .. "qnx-arm" .. "/obj")
814      libdirs { _libDir .. "lib/qnx-arm" }
815--      includedirs { bxDir .. "include/compat/qnx" }
812      targetdir (path.join(_buildDir, "qnx-arm/bin"))
813      objdir (path.join(_buildDir, "qnx-arm/obj"))
814      libdirs { path.join(_libDir, "lib/qnx-arm") }
815--      includedirs { path.join(bxDir, "include/compat/qnx") }
816816      buildoptions {
817817         "-std=c++0x",
818818         "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0
r244652r244653
821821      }
822822
823823   configuration { "rpi" }
824      targetdir (_buildDir .. "rpi" .. "/bin")
825      objdir (_buildDir .. "rpi" .. "/obj")
824      targetdir (path.join(_buildDir, "rpi/bin"))
825      objdir (path.join(_buildDir, "rpi/obj"))
826826      libdirs {
827         _libDir .. "lib/rpi",
827         path.join(_libDir, "lib/rpi"),
828828         "/opt/vc/lib",
829829      }
830830      defines {
trunk/3rdparty/genie/README.md
r244652r244653
6161 - Added ability to configure Visual Studio toolset from GENie script.
6262 - Added `UnsignedChar` flag to force char to be unsigned.
6363 - Removed vs2002, vs2003, vs2005, Solaris, and Haiku support.
64 - Allow source files in the same project to have the same name.
64 - Allow source files in the same project to have the same name. Added
65   `SingleOutputDir` flag to use single output directory (original behaviour).
6566 - Added WinRT support.
6667 - Added `removeflags`, `removelinks`.
6768 - Added vs2015 support.
6869 - Added `targetsubdir`.
6970 - Added support for solution folders `group`.
70 - Added `options` section (and `ForceCpp` to enforce C++ compile even if extension is for C files)
71 - Added `msgcompile`, `msgresource`, `msglinking` and `msgarchiving` as overrides for make messages
72 - Added `messageskip` list to disable some of compiler messages
71 - Added `options` section (and `ForceCpp` to enforce C++ compile even if
72   extension is for C files)
73 - Added `msgcompile`, `msgresource`, `msglinking` and `msgarchiving` as
74   overrides for make messages.
75 - Added `messageskip` list to disable some of compiler messages.
7376
7477## Why fork?
7578
trunk/3rdparty/genie/src/actions/make/make_cpp.lua
r244652r244653
324324
325325      _p('  ALL_CPPFLAGS  += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " "))
326326
327      _p('  ALL_CFLAGS    += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions)))
328      _p('  ALL_CXXFLAGS  += $(CXXFLAGS) $(ALL_CFLAGS)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions_cpp)))
327      _p('  ALL_CFLAGS    += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))
328      _p('  ALL_CXXFLAGS  += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
329329
330330      _p('  ALL_RESFLAGS  += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',
331331              make.list(table.join(cc.getdefines(cfg.resdefines),
trunk/3rdparty/genie/src/base/api.lua
r244652r244653
4242         scope = "config",
4343      },
4444
45      buildoptions_c =
46      {
47         kind  = "list",
48         scope = "config",
49      },
50     
4551      buildoptions_cpp =
4652      {
4753         kind  = "list",
r244652r244653
130136               NoNativeWChar = 1,
131137               NoPCH = 1,
132138               NoRTTI = 1,
139               SingleOutputDir = 1,
133140               Optimize = 1,
134141               OptimizeSize = 1,
135142               OptimizeSpeed = 1,
trunk/3rdparty/genie/src/base/bake.lua
r244652r244653
380380                  dir = cfg_dirs[cfg][v]
381381                  if hit_counts[dir] == 1 then break end
382382               end
383               cfg.objectsdir = path.getrelative(cfg.location, dir)
383               if (cfg.flags.SingleOutputDir) then
384                  cfg.objectsdir = cfg.objdir or cfg.project.objdir or "obj"
385               else
386                  cfg.objectsdir = path.getrelative(cfg.location, dir)
387               end
384388            end
385389         end
386390      end     
trunk/3rdparty/genie/src/host/scripts.c
r244652r244653
6969   "m)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function removevalues(tbl, removes)\nfor i=#tbl,1,-1 do\n            for _, pattern in ipairs(removes) do\n                if pattern == tbl[i] then\n                    table.remove(tbl, i)\n                    break\n                end\n            end\n        end\nend\nlocal function mergeobject(dest, src)\nif not src then \nreturn \nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend"
7070   "\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then \nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then \ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name      = cfgname\ncfg.platform  = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nf"
7171   "or _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, "
72   "2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget  = premake.gettarget(cfg, \"link\",  pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n  local function getCfgKind(cfg)\n  if(cfg.kind) then\n  return cfg.kind;\n  end\n  \n  if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n  return cfg.project.__configs[\"\"].kind;\n  end\n  \n  return nil\n  end\n  \n  local function getprojrec(dstArray, foundList, cfg, cfgname, searc"
73   "hField, bLinkage)\n  if(not cfg) then return end\n  \n  local foundUsePrjs = {};\n  for _, useName in ipairs(cfg[searchField]) do\n  local testName = useName:lower();\n  if((not foundList[testName])) then\n  local theProj = nil;\n  local theUseProj = nil;\n  for _, prj in ipairs(cfg.project.solution.projects) do\n  if (prj.name:lower() == testName) then\n  if(prj.usage) then\n  theUseProj = prj;\n  else\n  theProj = prj;\n  end\n  end\n  end\n  \n  --Must connect to a usage project.\n  if(theUseProj) then\n  foundList[testName] = true;\n  local prjEntry = {\n  name = testName,\n  proj = theProj,\n  usageProj = theUseProj,\n  bLinkageOnly = bLinkage,\n  };\n  dstArray[testName] = prjEntry;\n  table.insert(foundUsePrjs, theUseProj);\n  end\n  end\n  end\n  \n  for _, usePrj in ipairs(foundUsePrjs) do\n  --Links can only recurse through static libraries.\n  if((searchField ~= \"links\") or\n  (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n  getprojrec(dstArray, foundList, usePrj.__configs[cfgname"
74   "],\n  cfgname, searchField, bLinkage);\n  end\n  end\n  end\n  \n  --\n  -- This function will recursively get all projects that the given configuration has in its \"uses\"\n  -- field. The return values are a list of tables. Each table in that list contains the following:\n  --name = The lowercase name of the project.\n  --proj = The project. Can be nil if it is usage-only.\n  --usageProj = The usage project. Can't be nil, as using a project that has no\n  -- usage project is not put into the list.\n  --bLinkageOnly = If this is true, then only the linkage information should be copied.\n  -- The recursion will only look at the \"uses\" field on *usage* projects.\n  -- This function will also add projects to the list that are mentioned in the \"links\"\n  -- field of usage projects. These will only copy linker information, but they will recurse.\n  -- through other \"links\" fields.\n  --\n  local function getprojectsconnections(cfg, cfgname)\n  local dstArray = {};\n  local foundList = {};\n  foundList[cfg.pr"
75   "oject.name:lower()] = true;\n  \n  --First, follow the uses recursively.\n  getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n  \n  --Next, go through all of the usage projects and recursively get their links.\n  --But only if they're not already there. Get the links as linkage-only.\n  local linkArray = {};\n  for prjName, prjEntry in pairs(dstArray) do\n  getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, \n  \"links\", true);\n  end\n  \n  --Copy from linkArray into dstArray.\n  for prjName, prjEntry in pairs(linkArray) do\n  dstArray[prjName] = prjEntry;\n  end\n  \n  return dstArray;\n  end\n  \n  \n  local function isnameofproj(cfg, strName)\n  local sln = cfg.project.solution;\n  local strTest = strName:lower();\n  for prjIx, prj in ipairs(sln.projects) do\n  if (prj.name:lower() == strTest) then\n  return true;\n  end\n  end\n  \n  return false;\n  end\n  --\n  -- Copies the field from dstCfg to srcCfg.\n  --\n  local function copydependentfield(srcCfg, dstC"
76   "fg, strSrcField)\n  local srcField = premake.fields[strSrcField];\n  local strDstField = strSrcField;\n  \n  if type(srcCfg[strSrcField]) == \"table\" then\n  --handle paths.\n  if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n  (not keeprelative[strSrcField]) then\n  for i,p in ipairs(srcCfg[strSrcField]) do\n  table.insert(dstCfg[strDstField],\n  path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n  end\n  else\n  if(strSrcField == \"links\") then\n  for i,p in ipairs(srcCfg[strSrcField]) do\n  if(not isnameofproj(dstCfg, p)) then\n  table.insert(dstCfg[strDstField], p)\n  else\n  printf(\"Failed to copy '%s' from proj '%s'.\",\n  p, srcCfg.project.name);\n  end\n  end\n  else\n  for i,p in ipairs(srcCfg[strSrcField]) do\n  table.insert(dstCfg[strDstField], p)\n  end\n  end\n  end\n  else\n  if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n  dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n  prj.location, dstCfg.project.location);\n  else\n "
77   " dstCfg[strDstField] = srcCfg[strSrcField];\n  end\n  end\n  end\n  \n  --\n  -- This function will take the list of project entries and apply their usage project data\n  -- to the given configuration. It will copy compiling information for the projects that are\n  -- not listed as linkage-only. It will copy the linking information for projects only if\n  -- the source project is not a static library. It won't copy linking information\n  -- if the project is in this solution; instead it will add that project to the configuration's\n  -- links field, expecting that Premake will handle the rest.\n  --\n  local function copyusagedata(cfg, cfgname, linkToProjs)\n  local myPrj = cfg.project;\n  local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n  \n  for prjName, prjEntry in pairs(linkToProjs) do\n  local srcPrj = prjEntry.usageProj;\n  local srcCfg = srcPrj.__configs[cfgname];\n  \n  for name, field in pairs(premake.fields) do\n  if(srcCfg[name]) then\n  if(field.usagecopy) then\n  if(not prjEntry.bLinkageO"
78   "nly) then\n  copydependentfield(srcCfg, cfg, name)\n  end\n  elseif(field.linkagecopy) then\n  --Copy the linkage data if we're building a non-static thing\n  --and this is a pure usage project. If it's not pure-usage, then\n  --we will simply put the project's name in the links field later.\n  if((not bIsStaticLib) and (not prjEntry.proj)) then\n  copydependentfield(srcCfg, cfg, name)\n  end\n  end\n  end\n  end\n  \n  if((not bIsStaticLib) and prjEntry.proj) then\n  table.insert(cfg.links, prjEntry.proj.name);\n  end\n  end\n  end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\nlocal basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor "
79   "_, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project   = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname  = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nels"
80   "e\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
72   "2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\nif (cfg.flags.SingleOutputDir) then\ncfg.objectsdir = cfg.objdir or cfg.project.objdir or \"obj\"\nelse\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget  = premake.gettarget(cfg, \"link\",  pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n  local function getCfgKind(cfg)\n  if(cfg.kind) then\n  return cfg.kind;\n  end\n  \n  if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n  return cfg.project.__configs[\"\"].k"
73   "ind;\n  end\n  \n  return nil\n  end\n  \n  local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n  if(not cfg) then return end\n  \n  local foundUsePrjs = {};\n  for _, useName in ipairs(cfg[searchField]) do\n  local testName = useName:lower();\n  if((not foundList[testName])) then\n  local theProj = nil;\n  local theUseProj = nil;\n  for _, prj in ipairs(cfg.project.solution.projects) do\n  if (prj.name:lower() == testName) then\n  if(prj.usage) then\n  theUseProj = prj;\n  else\n  theProj = prj;\n  end\n  end\n  end\n  \n  --Must connect to a usage project.\n  if(theUseProj) then\n  foundList[testName] = true;\n  local prjEntry = {\n  name = testName,\n  proj = theProj,\n  usageProj = theUseProj,\n  bLinkageOnly = bLinkage,\n  };\n  dstArray[testName] = prjEntry;\n  table.insert(foundUsePrjs, theUseProj);\n  end\n  end\n  end\n  \n  for _, usePrj in ipairs(foundUsePrjs) do\n  --Links can only recurse through static libraries.\n  if((searchField ~= \"links\") or\n  (getCfgKind("
74   "usePrj.__configs[cfgname]) == \"StaticLib\")) then\n  getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n  cfgname, searchField, bLinkage);\n  end\n  end\n  end\n  \n  --\n  -- This function will recursively get all projects that the given configuration has in its \"uses\"\n  -- field. The return values are a list of tables. Each table in that list contains the following:\n  --name = The lowercase name of the project.\n  --proj = The project. Can be nil if it is usage-only.\n  --usageProj = The usage project. Can't be nil, as using a project that has no\n  -- usage project is not put into the list.\n  --bLinkageOnly = If this is true, then only the linkage information should be copied.\n  -- The recursion will only look at the \"uses\" field on *usage* projects.\n  -- This function will also add projects to the list that are mentioned in the \"links\"\n  -- field of usage projects. These will only copy linker information, but they will recurse.\n  -- through other \"links\" fields.\n  --\n  local func"
75   "tion getprojectsconnections(cfg, cfgname)\n  local dstArray = {};\n  local foundList = {};\n  foundList[cfg.project.name:lower()] = true;\n  \n  --First, follow the uses recursively.\n  getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n  \n  --Next, go through all of the usage projects and recursively get their links.\n  --But only if they're not already there. Get the links as linkage-only.\n  local linkArray = {};\n  for prjName, prjEntry in pairs(dstArray) do\n  getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, \n  \"links\", true);\n  end\n  \n  --Copy from linkArray into dstArray.\n  for prjName, prjEntry in pairs(linkArray) do\n  dstArray[prjName] = prjEntry;\n  end\n  \n  return dstArray;\n  end\n  \n  \n  local function isnameofproj(cfg, strName)\n  local sln = cfg.project.solution;\n  local strTest = strName:lower();\n  for prjIx, prj in ipairs(sln.projects) do\n  if (prj.name:lower() == strTest) then\n  return true;\n  end\n  end\n  \n  return false;\n  e"
76   "nd\n  --\n  -- Copies the field from dstCfg to srcCfg.\n  --\n  local function copydependentfield(srcCfg, dstCfg, strSrcField)\n  local srcField = premake.fields[strSrcField];\n  local strDstField = strSrcField;\n  \n  if type(srcCfg[strSrcField]) == \"table\" then\n  --handle paths.\n  if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n  (not keeprelative[strSrcField]) then\n  for i,p in ipairs(srcCfg[strSrcField]) do\n  table.insert(dstCfg[strDstField],\n  path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n  end\n  else\n  if(strSrcField == \"links\") then\n  for i,p in ipairs(srcCfg[strSrcField]) do\n  if(not isnameofproj(dstCfg, p)) then\n  table.insert(dstCfg[strDstField], p)\n  else\n  printf(\"Failed to copy '%s' from proj '%s'.\",\n  p, srcCfg.project.name);\n  end\n  end\n  else\n  for i,p in ipairs(srcCfg[strSrcField]) do\n  table.insert(dstCfg[strDstField], p)\n  end\n  end\n  end\n  else\n  if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n"
77   "  dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n  prj.location, dstCfg.project.location);\n  else\n  dstCfg[strDstField] = srcCfg[strSrcField];\n  end\n  end\n  end\n  \n  --\n  -- This function will take the list of project entries and apply their usage project data\n  -- to the given configuration. It will copy compiling information for the projects that are\n  -- not listed as linkage-only. It will copy the linking information for projects only if\n  -- the source project is not a static library. It won't copy linking information\n  -- if the project is in this solution; instead it will add that project to the configuration's\n  -- links field, expecting that Premake will handle the rest.\n  --\n  local function copyusagedata(cfg, cfgname, linkToProjs)\n  local myPrj = cfg.project;\n  local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n  \n  for prjName, prjEntry in pairs(linkToProjs) do\n  local srcPrj = prjEntry.usageProj;\n  local srcCfg = srcPrj.__configs[cfgname];\n  \n  for name, field"
78   " in pairs(premake.fields) do\n  if(srcCfg[name]) then\n  if(field.usagecopy) then\n  if(not prjEntry.bLinkageOnly) then\n  copydependentfield(srcCfg, cfg, name)\n  end\n  elseif(field.linkagecopy) then\n  --Copy the linkage data if we're building a non-static thing\n  --and this is a pure usage project. If it's not pure-usage, then\n  --we will simply put the project's name in the links field later.\n  if((not bIsStaticLib) and (not prjEntry.proj)) then\n  copydependentfield(srcCfg, cfg, name)\n  end\n  end\n  end\n  end\n  \n  if((not bIsStaticLib) and prjEntry.proj) then\n  table.insert(cfg.links, prjEntry.proj.name);\n  end\n  end\n  end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\n"
79   "local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project   = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname  = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nloca"
80   "l platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
8181
8282   /* base/api.lua */
83   "premake.fields =\n{\narchivesplit_size =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind  = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind  = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind  = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs  =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind  = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind  = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind  = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind  = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind  = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = functi"
84   "on(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,"
85   "\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind  = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind  = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind  = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind  = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind  = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind "
86   " = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind  = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind  = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind  = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind  = \"string\",\ns"
87   "cope = \"config\",\n},\nmsglinking =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind  = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind  = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind  = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind  = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind  = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind  = \"dirlist\","
88   "\nscope = \"config\",\n},\nresoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind  = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind  = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind  = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\")   then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:s"
89   "ub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nel"
90   "seif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value), depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: exp"
91   "ected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) "
92   "then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind    = premake.fields[name].kind\nlocal scope   = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.s"
93   "etarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n   info.kind == \"dirlist\" or \n   info.kind == \"filelist\" or\n   info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords"
94   " = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function cre"
95   "ateproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution       = sln\nprj.name           = name\nprj.basedir        = os.getcwd()\nprj.uuid           = os.uuid(prj.name)\nprj.blocks         = { }\nprj.usage   = isUsage\nprj.group          = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \""
96   "solution\") then\nerror(\"no active solution\", 2)\nend\n  -- if this is a new project, or the project in that slot doesn't have a usage, create it\n  if((not sln.projects[name]) or\n  ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n  premake.CurrentContainer = createproject(name, sln, true)\n  else\n  premake.CurrentContainer = iff(sln.projects[name].usage,\n  sln.projects[name], sln.projects[name].usageProj)\n  end\n  -- add an empty, global configuration to the project\n  configuration { }\n  return premake.CurrentContainer\n  end\n  function project(name)\n  if (not name) then\n  --Only return non-usage projects\n  if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n  if(premake.CurrentContainer.usage) then return nil end\n  return premake.CurrentContainer\nend\n  -- identify the parent solution\n  local sln\n  if (type(premake.CurrentContainer) == \"project\") then\n  sln = premake.CurrentContainer.solution\n  else\n  sln = premake.CurrentContainer\n  end"
97   "\n  if (type(sln) ~= \"solution\") then\n  error(\"no active solution\", 2)\n  end\n  -- if this is a new project, or the old project is a usage project, create it\n  if((not sln.projects[name]) or sln.projects[name].usage) then\n  premake.CurrentContainer = createproject(name, sln)\n  else\n  premake.CurrentContainer = sln.projects[name];\n  end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npre"
98   "make.option.add(opt)\nend\n",
83   "premake.fields =\n{\narchivesplit_size =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind  = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind  = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nbuildoptions_c =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind  = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs  =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind  = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind  = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind  = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind  = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind  = \"list\",\nscope = "
84   "\"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\ni"
85   "f v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind  = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind  = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind  = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind  = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind  = \"string\",\nsco"
86   "pe = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind  = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind  = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind  = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind  = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\n"
87   "kind  = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind  = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind  = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind  = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind  = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind  = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind  = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\n"
88   "kind  = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind  = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind  = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind  = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind  = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind  = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\")   then ok = false end\nif (value:sub(14,14) ~= \"-\")"
89   " then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind  = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not conta"
90   "iner) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nmakeabsolute(matchfunc(value), depth + 1)\nelse\ntable.i"
91   "nsert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err"
92   " = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind    = premake.fields[name].kind\nlocal scope   = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn "
93   "premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n   info.kind == \"dirlist\" or \n   info.kind == \"filelist\" or\n   info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\n"
94   "table.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgr"
95   "oup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution       = sln\nprj.name           = name\nprj.basedir        = os.getcwd()\nprj.uuid           = os.uuid(prj.name)\nprj.blocks         = { }\nprj.usage   = isUsage\nprj.group          = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.Curr"
96   "entContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\n  -- if this is a new project, or the project in that slot doesn't have a usage, create it\n  if((not sln.projects[name]) or\n  ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n  premake.CurrentContainer = createproject(name, sln, true)\n  else\n  premake.CurrentContainer = iff(sln.projects[name].usage,\n  sln.projects[name], sln.projects[name].usageProj)\n  end\n  -- add an empty, global configuration to the project\n  configuration { }\n  return premake.CurrentContainer\n  end\n  function project(name)\n  if (not name) then\n  --Only return non-usage projects\n  if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n  if(premake.CurrentContainer.usage) then return nil end\n  return premake.CurrentContainer\nend\n  -- identify the parent solution\n  local sln\n  if (type(premake.CurrentContainer) == \"project\") then\n  sln "
97   "= premake.CurrentContainer.solution\n  else\n  sln = premake.CurrentContainer\n  end\n  if (type(sln) ~= \"solution\") then\n  error(\"no active solution\", 2)\n  end\n  -- if this is a new project, or the old project is a usage project, create it\n  if((not sln.projects[name]) or sln.projects[name].usage) then\n  premake.CurrentContainer = createproject(name, sln)\n  else\n  premake.CurrentContainer = sln.projects[name];\n  end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\n"
98   "end\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
9999
100100   /* base/cmdline.lua */
101101   "newoption \n{\ntrigger     = \"cc\",\nvalue       = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\",  \"OpenWatcom\"        },\n}\n}\nnewoption\n{\ntrigger     = \"dotnet\",\nvalue       = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\",   \"Microsoft .NET (csc)\" },\n{ \"mono\",    \"Novell Mono (mcs)\"    },\n{ \"pnet\",    \"Portable.NET (cscc)\"  },\n}\n}\nnewoption\n{\ntrigger     = \"file\",\nvalue       = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger     = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger     = \"os\",\nvalue       = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\",      \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\",    \"Linux\" },\n{ \"macosx\",   \"Apple Mac OS X\" },\n{ \"windows\",  \"Microsoft Windows\" },\n}\n}\nnewoption\n{"
r244652r244653
185185   "$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p('  -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p('  config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p('  SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('  MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p('  COPY  = $("
186186   "SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p('  MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('  COPY  = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC  = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR  = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p('  ifdef WINDRES')\n_p('    RESCOMP = $(WINDRES)')\n_p('  else')\n_p('    RESCOMP = windres')\n_p('  endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p('  OBJDIR     = %s', _MAKE.esc(cfg.objectsdir))\n_p('  TARGETDIR  = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p('  TARGET     = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p('  DEFINES   +=%s', make.list(cc.getdefines(cfg.defines)))\n_p('  INCLUDES  +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p('  OBJECTS := \\\\')\nfor _, fi"
187187   "le in ipairs(prj.files) do\nif path.iscppfile(file) then\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (exclude == file)\nif (excluded) then break end\nend\nif excluded == false then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p('  define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platfor"
188   "m = cc.platforms[cfg.platform]\nif platform.cc then\n_p('  CC         = %s', platform.cc)\nend\nif platform.cxx then\n_p('  CXX        = %s', platform.cxx)\nend\nif platform.ar then\n_p('  AR         = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p('  FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p('  FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p('  ALL_CPPFLAGS  += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p('  ALL_CFLAGS    += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions)))\n_p('  ALL_CXXFLAGS  += $(CXXFLAGS) $(ALL_CFLAGS)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions_cpp)))\n_p('  ALL_RESFLAGS  += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n        make.list(table.join(cc.getdefines(cfg.resdefines),\n                                cc.getincludedir"
189   "s(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p('  ALL_LDFLAGS   += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p('  LDDEPS    +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p('  LIBS      += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p('  LINKCMD    = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p('  LINKCMD    = $(AR) rcs $(TARGET)')\nelse\n_p('  LINKCMD    = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p('  LINKCMD    = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\n"
190   "local testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p('  PCH        = %s', _MAKE.esc(pch))\n_p('  GCH        = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OB"
191   "JDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
188   "m = cc.platforms[cfg.platform]\nif platform.cc then\n_p('  CC         = %s', platform.cc)\nend\nif platform.cxx then\n_p('  CXX        = %s', platform.cxx)\nend\nif platform.ar then\n_p('  AR         = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p('  FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p('  FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p('  ALL_CPPFLAGS  += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p('  ALL_CFLAGS    += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p('  ALL_CXXFLAGS  += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p('  ALL_RESFLAGS  += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n        make.list(table.join(cc.getdefines(cfg.resd"
189   "efines),\n                                cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p('  ALL_LDFLAGS   += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p('  LDDEPS    +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p('  LIBS      += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p('  LINKCMD    = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p('  LINKCMD    = $(AR) rcs $(TARGET)')\nelse\n_p('  LINKCMD    = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p('  LINKCMD    = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = p"
190   "ath.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p('  PCH        = %s', _MAKE.esc(pch))\n_p('  GCH        = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\n_p('')\n"
191   "elseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
192192
193193   /* actions/make/make_csharp.lua */
194194   "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n    local name = cfg.buildtarget.basename .. \".\"\n    local dir = path.getdirectory(fname)\n    if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"
trunk/3rdparty/mongoose/docs/API.md
r244652r244653
11# Mongoose API Reference
22
3    struct mg_server *mg_create_server(void *server_param);
3    struct mg_server *mg_create_server(void *server_param, mg_handler_t handler);
44
55Creates web server instance. Returns opaque instance pointer, or NULL if
66there is not enough memory. `server_param`: Could be any pointer, or NULL.
r244652r244653
173173     Mongoose will call a handler repeatedly after each socket write.
174174
175175<!-- -->
176     
176
177177     void mg_send_file(struct mg_connection *, const char *path);
178178
179179Tells Mongoose to serve given file. Mongoose handles file according to
r244652r244653
187187                           const char *data, size_t data_len);
188188
189189Similar to `mg_write()`, but wraps the data into a websocket frame with a
190given websocket `opcode`. 
190given websocket `opcode`.
191191
192192    const char *mg_get_header(const struct mg_connection *, const char *name);
193193
r244652r244653
219219                                 const char *user,
220220                                 const char *password);
221221
222Add, edit or delete the entry in the passwords file. 
222Add, edit or delete the entry in the passwords file.
223223This function allows an application to manipulate .htpasswd files on the
224224fly by adding, deleting and changing user records. This is one of the
225several ways of implementing authentication on the server side. 
225several ways of implementing authentication on the server side.
226226If password is not NULL, entry is added (or modified if already exists).
227If password is NULL, entry is deleted. 
227If password is NULL, entry is deleted.
228228Return: 1 on success, 0 on error.
229229
230   
230
231231    int mg_parse_multipart(const char *buf, int buf_len,
232232                           char *var_name, int var_name_len,
233233                           char *file_name, int file_name_len,
trunk/3rdparty/mongoose/docs/LuaSqlite.md
r244652r244653
1# Mongoose Lua Server Pages
2
3Pre-built Windows and Mac mongoose binaries support Lua Server Pages
4functionality.
5That means it is possible to write PHP-like scripts with mongoose
6using Lua programming language instead of PHP. Lua is known
7for it's speed and small size. Mongoose uses Lua version 5.2.3, the
8documentation for it can be found at
9[Lua 5.2 reference manual](http://www.lua.org/manual/5.2/).
10
11To create a Lua Page, make a file that is called `ANY_NAME.lp`. For example,
12`my_page.lp`. It is important to have a file
13name that ends up with `.lp`, cause this is the way mongoose recognises
14Lua Page file. The contents of the file, just like
15with PHP, is HTML with embedded Lua code. Lua code must be enclosed within
16`&lt;?  ?&gt;` blocks, and can appear anywhere on the page.
17
18Mongoose does not send HTTP headers for Lua pages. Therefore,
19every Lua Page must begin with HTTP status line and headers, like this:
20
21    <? mg.write('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n') ?>
22    <html><body>
23      <span>Today is:</span> <? mg.write(os.date("%A")) ?>
24    </body></html>
25
26Note that this example uses function `mg.write()`, which prints data to the
27web page. Using function `mg.write()` is the way to generate web content from
28inside Lua code. In addition to `mg.write()`, all standard library functions
29are accessible from the Lua code (please check reference manual for details).
30Information about the request is available via the `mg.request_info` object.
31I contains request method, all headers, etcetera. Please refer to
32`struct mg_request_info` definition in
33[mongoose.h](https://github.com/cesanta/mongoose/blob/master/mongoose.h)
34to see what is available via the `mg.request_info` object.
35Check out [prime_numbers.lp](https://github.com/cesanta/mongoose/blob/master/examples/lua/prime_numbers.lp) for some example.
36
37Mongoose exports the following to the Lua Server Page:
38
39    mg.write(str)     -- writes string to the client
40    mg.onerror(msg)   -- error handler, can be overridden
41    mg.request_info   -- a table with request information
42
43Using Lua scripting it is easy to emulate SSI functionality. For example,
44to include the content of another file, one can write:
45
46    <? mg.write(io.open('MY_FILE.TXT'):read('*all')) ?>
47
48To serve a Lua Page, mongoose creates Lua context. That context is used for
49all Lua blocks within the page. That means, all Lua blocks on the same page
50share the same context. If one block defines a variable, for example, that
51variable is visible in all following blocks.
trunk/3rdparty/mongoose/mongoose.c
r244652r244653
124124#include <sys/socket.h>
125125#include <sys/select.h>
126126#define closesocket(x) close(x)
127#ifndef __OS2__
128127#define __cdecl
129#else
130#include <sys/time.h>
131typedef int socklen_t;
132#endif
133128#define INVALID_SOCKET (-1)
134129#define to64(x) strtoll(x, NULL, 10)
135130typedef int sock_t;
r244652r244653
606601
607602// TODO(lsm): use non-blocking resolver
608603static int ns_resolve2(const char *host, struct in_addr *ina) {
604#ifdef NS_ENABLE_GETADDRINFO
605  int rv = 0;
606  struct addrinfo hints, *servinfo, *p;
607  struct sockaddr_in *h = NULL;
608  char *ip = NS_MALLOC(17);
609  memset(ip, '\0', 17);
610
611  memset(&hints, 0, sizeof hints);
612  hints.ai_family = AF_INET;
613  hints.ai_socktype = SOCK_STREAM;
614
615  if((rv = getaddrinfo(host, NULL , NULL, &servinfo)) != 0) {
616    DBG(("getaddrinfo(%s) failed: %s", host, strerror(errno)));
617    return 0;
618  }
619
620  for(p = servinfo; p != NULL; p = p->ai_next) {
621    memcpy(&h, &p->ai_addr, sizeof(struct sockaddr_in *));
622    memcpy(ina, &h->sin_addr, sizeof(ina));
623  }
624
625  freeaddrinfo(servinfo);
626  return 1;
627#else
609628  struct hostent *he;
610629  if ((he = gethostbyname(host)) == NULL) {
611630    DBG(("gethostbyname(%s) failed: %s", host, strerror(errno)));
r244652r244653
614633    return 1;
615634  }
616635  return 0;
636#endif
617637}
618638
619639// Resolve FDQN "host", store IP address in the "ip".
r244652r244653
15591579#define MAP_FAILED NULL
15601580#define MAP_PRIVATE 0
15611581#define PROT_READ 0
1562#elif defined(__OS2__)
1563static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
1564                  int offset) {
1565  void *p;
1566
1567  int pos = lseek( fd, 0, SEEK_CUR ); /* Get a current position */
1568
1569  if (pos == -1)
1570    return NULL;
1571
1572  /* Seek to offset offset */
1573  if (lseek( fd, offset, SEEK_SET) == -1)
1574    return NULL;
1575
1576  p = malloc(len);
1577
1578  /* Read in a file */
1579  if (!p || read(fd, p, len) == -1) {
1580    free(p);
1581    p = NULL;
1582  }
1583
1584  /* Restore the position */
1585  lseek(fd, pos, SEEK_SET);
1586
1587  return p;
1588}
1589#define munmap(x, y)  free(x)
1590#define MAP_FAILED NULL
1591#define MAP_PRIVATE 0
1592#define PROT_READ 0
15931582#else
15941583#include <sys/mman.h>
15951584#endif
r244652r244653
30092998      copy_len = 4 + data_len;
30102999    } else {
30113000      // 64-bit length field
3012      copy[1] = 127;
30133001      const uint32_t hi = htonl((uint32_t) ((uint64_t) data_len >> 32));
30143002      const uint32_t lo = htonl(data_len & 0xffffffff);
3003      copy[1] = 127;
30153004      memcpy(copy+2,&hi,sizeof(hi));
30163005      memcpy(copy+6,&lo,sizeof(lo));
30173006      memcpy(copy + 10, data, data_len);
trunk/src/emu/bus/a2bus/ezcgi.c
r0r244653
1/*********************************************************************
2
3    ezcgi.c
4
5    "E-Z Color Graphics Interface" by Steve Ciarcia
6    from BYTE Magazine, August, 1982
7    https://archive.org/details/byte-magazine-1982-08-rescan
8
9*********************************************************************/
10
11#include "emu.h"
12#include "ezcgi.h"
13
14
15/***************************************************************************
16    PARAMETERS
17***************************************************************************/
18
19#define TMS_TAG "ezcgi_tms"
20#define SCREEN_TAG "screen"
21
22//**************************************************************************
23//  GLOBAL VARIABLES
24//**************************************************************************
25
26const device_type A2BUS_EZCGI = &device_creator<a2bus_ezcgi_device>;
27const device_type A2BUS_EZCGI_9938 = &device_creator<a2bus_ezcgi_9938_device>;
28const device_type A2BUS_EZCGI_9958 = &device_creator<a2bus_ezcgi_9958_device>;
29
30MACHINE_CONFIG_FRAGMENT( ezcgi )
31   MCFG_DEVICE_ADD( TMS_TAG, TMS9918A, XTAL_10_738635MHz / 2 )
32   MCFG_TMS9928A_VRAM_SIZE(0x4000) // 16k of VRAM
33   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(a2bus_ezcgi_device, tms_irq_w))
34   MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
35   MCFG_SCREEN_UPDATE_DEVICE( TMS_TAG, tms9918a_device, screen_update )
36MACHINE_CONFIG_END
37
38#define MSX2_XBORDER_PIXELS     16
39#define MSX2_YBORDER_PIXELS     28
40#define MSX2_TOTAL_XRES_PIXELS      256 * 2 + (MSX2_XBORDER_PIXELS * 2)
41#define MSX2_TOTAL_YRES_PIXELS      212 * 2 + (MSX2_YBORDER_PIXELS * 2)
42#define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2
43#define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2
44
45MACHINE_CONFIG_FRAGMENT( ezcgi9938 )
46   MCFG_V9938_ADD(TMS_TAG, SCREEN_TAG, 0x30000)   // 192K of VRAM
47   MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(a2bus_ezcgi_9938_device, tms_irq_w))
48
49   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
50   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
51   MCFG_SCREEN_REFRESH_RATE(60)
52   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
53   MCFG_SCREEN_UPDATE_DEVICE(TMS_TAG, v9938_device, screen_update)
54   MCFG_SCREEN_SIZE(MSX2_TOTAL_XRES_PIXELS, 262*2)
55   MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1)
56   MCFG_SCREEN_PALETTE("ezcgi_tms:palette")
57MACHINE_CONFIG_END
58
59MACHINE_CONFIG_FRAGMENT( ezcgi9958 )
60   MCFG_V9958_ADD(TMS_TAG, SCREEN_TAG, 0x30000)   // 192K of VRAM
61   MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(a2bus_ezcgi_9958_device, tms_irq_w))
62
63   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
64   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
65   MCFG_SCREEN_REFRESH_RATE(60)
66   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
67   MCFG_SCREEN_UPDATE_DEVICE(TMS_TAG, v9938_device, screen_update)
68   MCFG_SCREEN_SIZE(MSX2_TOTAL_XRES_PIXELS, 262*2)
69   MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1)
70   MCFG_SCREEN_PALETTE("ezcgi_tms:palette")
71MACHINE_CONFIG_END
72
73//-------------------------------------------------
74//  machine_config_additions - device-specific
75//  machine configurations
76//-------------------------------------------------
77
78machine_config_constructor a2bus_ezcgi_device::device_mconfig_additions() const
79{
80   return MACHINE_CONFIG_NAME( ezcgi );
81}
82
83machine_config_constructor a2bus_ezcgi_9938_device::device_mconfig_additions() const
84{
85   return MACHINE_CONFIG_NAME( ezcgi9938 );
86}
87
88machine_config_constructor a2bus_ezcgi_9958_device::device_mconfig_additions() const
89{
90   return MACHINE_CONFIG_NAME( ezcgi9958 );
91}
92
93//**************************************************************************
94//  LIVE DEVICE
95//**************************************************************************
96
97a2bus_ezcgi_device::a2bus_ezcgi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
98   device_t(mconfig, A2BUS_EZCGI, "E-Z Color Graphics Interface", tag, owner, clock, "a2ezcgi", __FILE__),
99   device_a2bus_card_interface(mconfig, *this),
100   m_tms(*this, TMS_TAG)
101{
102}
103
104a2bus_ezcgi_device::a2bus_ezcgi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
105   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
106   device_a2bus_card_interface(mconfig, *this),
107   m_tms(*this, TMS_TAG)
108{
109}
110
111a2bus_ezcgi_9938_device::a2bus_ezcgi_9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
112   device_t(mconfig, A2BUS_EZCGI_9938, "E-Z Color Graphics Interface (TMS9938)", tag, owner, clock, "a2ezcgi3", __FILE__),
113   device_a2bus_card_interface(mconfig, *this),
114   m_tms(*this, TMS_TAG)
115{
116}
117
118a2bus_ezcgi_9938_device::a2bus_ezcgi_9938_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
119   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
120   device_a2bus_card_interface(mconfig, *this),
121   m_tms(*this, TMS_TAG)
122{
123}
124
125a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
126   device_t(mconfig, A2BUS_EZCGI_9958, "E-Z Color Graphics Interface (TMS9958)", tag, owner, clock, "a2ezcgi5", __FILE__),
127   device_a2bus_card_interface(mconfig, *this),
128   m_tms(*this, TMS_TAG)
129{
130}
131
132a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
133   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
134   device_a2bus_card_interface(mconfig, *this),
135   m_tms(*this, TMS_TAG)
136{
137}
138
139//-------------------------------------------------
140//  device_start - device-specific startup
141//-------------------------------------------------
142
143void a2bus_ezcgi_device::device_start()
144{
145   // set_a2bus_device makes m_slot valid
146   set_a2bus_device();
147}
148
149void a2bus_ezcgi_device::device_reset()
150{
151}
152
153void a2bus_ezcgi_9938_device::device_start()
154{
155   // set_a2bus_device makes m_slot valid
156   set_a2bus_device();
157}
158
159void a2bus_ezcgi_9938_device::device_reset()
160{
161}
162
163void a2bus_ezcgi_9958_device::device_start()
164{
165   // set_a2bus_device makes m_slot valid
166   set_a2bus_device();
167}
168
169void a2bus_ezcgi_9958_device::device_reset()
170{
171}
172
173/*
174    C0nx map:
175    0 - TMS read
176    1 - TMS write
177*/
178
179UINT8 a2bus_ezcgi_device::read_c0nx(address_space &space, UINT8 offset)
180{
181   switch (offset)
182   {
183      case 0:
184         return m_tms->vram_read(space, 0);
185
186      case 1:
187         return m_tms->register_read(space, 0);
188   }
189
190   return 0xff;
191}
192
193void a2bus_ezcgi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
194{
195   switch (offset)
196   {
197      case 0:
198         m_tms->vram_write(space, 0, data);
199         break;
200
201      case 1:
202         m_tms->register_write(space, 0, data);
203         break;
204   }
205}
206
207UINT8 a2bus_ezcgi_9938_device::read_c0nx(address_space &space, UINT8 offset)
208{
209   switch (offset)
210   {
211      case 0:
212         return m_tms->vram_r();
213
214      case 1:
215         return m_tms->status_r();
216   }
217
218   return 0xff;
219}
220
221void a2bus_ezcgi_9938_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
222{
223   switch (offset)
224   {
225      case 0:
226         m_tms->vram_w(data);
227         break;
228
229      case 1:
230         m_tms->command_w(data);
231         break;
232
233      case 2:
234         m_tms->palette_w(data);
235         break;
236
237      case 3:
238         m_tms->register_w(data);
239         break;
240   }
241}
242
243UINT8 a2bus_ezcgi_9958_device::read_c0nx(address_space &space, UINT8 offset)
244{
245   switch (offset)
246   {
247      case 0:
248         return m_tms->vram_r();
249
250      case 1:
251         return m_tms->status_r();
252   }
253
254   return 0xff;
255}
256
257void a2bus_ezcgi_9958_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
258{
259   switch (offset)
260   {
261      case 0:
262         m_tms->vram_w(data);
263         break;
264
265      case 1:
266         m_tms->command_w(data);
267         break;
268
269      case 2:
270         m_tms->palette_w(data);
271         break;
272
273      case 3:
274         m_tms->register_w(data);
275         break;
276   }
277}
278
279WRITE_LINE_MEMBER( a2bus_ezcgi_device::tms_irq_w )
280{
281   if (state)
282   {
283      raise_slot_irq();
284   }
285   else
286   {
287      lower_slot_irq();
288   }
289}
290
291WRITE_LINE_MEMBER( a2bus_ezcgi_9938_device::tms_irq_w )
292{
293   if (state)
294   {
295      raise_slot_irq();
296   }
297   else
298   {
299      lower_slot_irq();
300   }
301}
302
303WRITE_LINE_MEMBER( a2bus_ezcgi_9958_device::tms_irq_w )
304{
305   if (state)
306   {
307      raise_slot_irq();
308   }
309   else
310   {
311      lower_slot_irq();
312   }
313}
314
trunk/src/emu/bus/a2bus/ezcgi.h
r0r244653
1/*********************************************************************
2
3    ezcgi.h
4
5    "E-Z Color Graphics Interface" by Steve Ciarcia
6    from BYTE Magazine, August, 1982
7    https://archive.org/details/byte-magazine-1982-08-rescan
8
9*********************************************************************/
10
11#ifndef __A2BUS_EZCGI__
12#define __A2BUS_EZCGI__
13
14#include "emu.h"
15#include "a2bus.h"
16#include "video/tms9928a.h"
17#include "video/v9938.h"
18
19//**************************************************************************
20//  TYPE DEFINITIONS
21//**************************************************************************
22
23class a2bus_ezcgi_device:
24   public device_t,
25   public device_a2bus_card_interface
26{
27public:
28   // construction/destruction
29   a2bus_ezcgi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   a2bus_ezcgi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
31
32   // optional information overrides
33   virtual machine_config_constructor device_mconfig_additions() const;
34
35   DECLARE_WRITE_LINE_MEMBER( tms_irq_w );
36
37protected:
38   virtual void device_start();
39   virtual void device_reset();
40
41   // overrides of standard a2bus slot functions
42   virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
43   virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
44
45   required_device<tms9918a_device> m_tms;
46
47private:
48};
49
50class a2bus_ezcgi_9938_device:
51   public device_t,
52   public device_a2bus_card_interface
53{
54public:
55   // construction/destruction
56   a2bus_ezcgi_9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
57   a2bus_ezcgi_9938_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
58
59   // optional information overrides
60   virtual machine_config_constructor device_mconfig_additions() const;
61
62   DECLARE_WRITE_LINE_MEMBER( tms_irq_w );
63
64protected:
65   virtual void device_start();
66   virtual void device_reset();
67
68   // overrides of standard a2bus slot functions
69   virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
70   virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
71
72   required_device<v9938_device> m_tms;
73
74private:
75};
76
77class a2bus_ezcgi_9958_device:
78   public device_t,
79   public device_a2bus_card_interface
80{
81public:
82   // construction/destruction
83   a2bus_ezcgi_9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
84   a2bus_ezcgi_9958_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
85
86   // optional information overrides
87   virtual machine_config_constructor device_mconfig_additions() const;
88
89   DECLARE_WRITE_LINE_MEMBER( tms_irq_w );
90
91protected:
92   virtual void device_start();
93   virtual void device_reset();
94
95   // overrides of standard a2bus slot functions
96   virtual UINT8 read_c0nx(address_space &space, UINT8 offset);
97   virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data);
98
99   required_device<v9958_device> m_tms;
100
101private:
102};
103
104// device type definition
105extern const device_type A2BUS_EZCGI;
106extern const device_type A2BUS_EZCGI_9938;
107extern const device_type A2BUS_EZCGI_9958;
108
109#endif  /* __A2BUS_EZCGI__ */
trunk/src/emu/bus/bus.mak
r244652r244653
931931BUSOBJS += $(BUSOBJ)/a2bus/corvfdc02.o
932932BUSOBJS += $(BUSOBJ)/a2bus/ramcard16k.o
933933BUSOBJS += $(BUSOBJ)/a2bus/ramcard128k.o
934BUSOBJS += $(BUSOBJ)/a2bus/ezcgi.o
934935endif
935936
936937#-------------------------------------------------
trunk/src/emu/video/tms34061.c
r244652r244653
6060
6161   /* allocate memory for VRAM */
6262   m_vram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2);
63   /* not really a save state, just there for debugging purposes */
64   save_pointer(NAME(m_vram), m_vramsize);
65
63   
6664   /* allocate memory for latch RAM */
6765   m_latchram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2);
6866
r244652r244653
9593
9694   /* start vertical interrupt timer */
9795   m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tms34061_device::interrupt), this));
96   
97   save_item(NAME(m_regs));
98   save_item(NAME(m_xmask));
99   save_item(NAME(m_yshift));
100   save_pointer(NAME(m_vram), m_vramsize);
101   save_pointer(NAME(m_latchram), m_vramsize);
102   save_item(NAME(m_latchdata));
98103}
99104
100105//-------------------------------------------------
trunk/src/mame/drivers/argus.c
r244652r244653
107107===============
108108 - Half transparent color (50% alpha blending) is not emulated.
109109 - Sprite priority switch of Butasan is shown in test mode. What will be
110   happened when set it ? JFF is not implemented this mistery switch too.
110   happened when set it ? JFF is not implemented this mystery switch too.
111111 - Data proms of Butasan does exist. But I don't know what is used for.
112112 - Though clock speed of Argus is actually 4 MHz, major sprite problems
113113   are broken out in the middle of slowdown. So, it is set 5 MHz now.
r244652r244653
123123#include "includes/argus.h"
124124
125125
126void argus_state::machine_start()
127{
128   membank("mainbank")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
129}
130
126131/***************************************************************************
127132
128133  Interrupt(s)
129134
130135***************************************************************************/
131136
132TIMER_DEVICE_CALLBACK_MEMBER(argus_state::argus_scanline)
137TIMER_DEVICE_CALLBACK_MEMBER(argus_state::scanline)
133138{
134139   int scanline = param;
135140
r244652r244653
151156      m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
152157}
153158
154/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
155WRITE_LINE_MEMBER(argus_state::irqhandler)
156{
157   m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
158}
159159
160160/***************************************************************************
161161
r244652r244653
163163
164164***************************************************************************/
165165
166WRITE8_MEMBER(argus_state::argus_bankselect_w)
166WRITE8_MEMBER(argus_state::bankselect_w)
167167{
168   UINT8 *RAM = memregion("maincpu")->base();
169   int bankaddress;
170
171   bankaddress = 0x10000 + ((data & 7) * 0x4000);
172   membank("bank1")->set_base(&RAM[bankaddress]);   /* Select 8 banks of 16k */
168   membank("mainbank")->set_entry(data & 7);   /* Select 8 banks of 16k */
173169}
174170
175171
r244652r244653
181177
182178static ADDRESS_MAP_START( argus_map, AS_PROGRAM, 8, argus_state )
183179   AM_RANGE(0x0000, 0x7fff) AM_ROM
184   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
180   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("mainbank")
185181   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
186182   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P1")
187183   AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
188184   AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
189185   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
190186   AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w)
191   AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w)
192   AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
187   AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w)
188   AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w)
193189   AM_RANGE(0xc300, 0xc301) AM_RAM AM_SHARE("bg0_scrollx")
194190   AM_RANGE(0xc302, 0xc303) AM_RAM AM_SHARE("bg0_scrolly")
195191   AM_RANGE(0xc308, 0xc309) AM_RAM AM_SHARE("bg1_scrollx")
196192   AM_RANGE(0xc30a, 0xc30b) AM_RAM AM_SHARE("bg1_scrolly")
197193   AM_RANGE(0xc30c, 0xc30c) AM_WRITE(argus_bg_status_w)
198   AM_RANGE(0xc400, 0xcfff) AM_READWRITE(argus_paletteram_r, argus_paletteram_w) AM_SHARE("paletteram")
199   AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(argus_txram_r, argus_txram_w) AM_SHARE("txram")
200   AM_RANGE(0xd800, 0xdfff) AM_READWRITE(argus_bg1ram_r, argus_bg1ram_w) AM_SHARE("bg1ram")
194   AM_RANGE(0xc400, 0xcfff) AM_RAM_WRITE(argus_paletteram_w) AM_SHARE("paletteram")
195   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(txram_w) AM_SHARE("txram")
196   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(bg1ram_w) AM_SHARE("bg1ram")
201197   AM_RANGE(0xe000, 0xf1ff) AM_RAM
202198   AM_RANGE(0xf200, 0xf7ff) AM_RAM AM_SHARE("spriteram")
203199   AM_RANGE(0xf800, 0xffff) AM_RAM
r244652r244653
205201
206202static ADDRESS_MAP_START( valtric_map, AS_PROGRAM, 8, argus_state )
207203   AM_RANGE(0x0000, 0x7fff) AM_ROM
208   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
204   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("mainbank")
209205   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
210206   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P1")
211207   AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
212208   AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
213209   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
214210   AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w)
215   AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w)
216   AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
211   AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w)
212   AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w)
217213   AM_RANGE(0xc300, 0xc300) AM_WRITE(valtric_unknown_w)
218214   AM_RANGE(0xc308, 0xc309) AM_RAM AM_SHARE("bg1_scrollx")
219215   AM_RANGE(0xc30a, 0xc30b) AM_RAM AM_SHARE("bg1_scrolly")
220216   AM_RANGE(0xc30c, 0xc30c) AM_WRITE(valtric_bg_status_w)
221217   AM_RANGE(0xc30d, 0xc30d) AM_WRITE(valtric_mosaic_w)
222   AM_RANGE(0xc400, 0xcfff) AM_READWRITE(argus_paletteram_r, valtric_paletteram_w) AM_SHARE("paletteram")
223   AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(argus_txram_r, argus_txram_w) AM_SHARE("txram")
224   AM_RANGE(0xd800, 0xdfff) AM_READWRITE(argus_bg1ram_r, argus_bg1ram_w) AM_SHARE("bg1ram")
218   AM_RANGE(0xc400, 0xcfff) AM_RAM_WRITE(valtric_paletteram_w) AM_SHARE("paletteram")
219   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(txram_w) AM_SHARE("txram")
220   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(bg1ram_w) AM_SHARE("bg1ram")
225221   AM_RANGE(0xe000, 0xf1ff) AM_RAM
226222   AM_RANGE(0xf200, 0xf7ff) AM_RAM AM_SHARE("spriteram")
227223   AM_RANGE(0xf800, 0xffff) AM_RAM
r244652r244653
229225
230226static ADDRESS_MAP_START( butasan_map, AS_PROGRAM, 8, argus_state )
231227   AM_RANGE(0x0000, 0x7fff) AM_ROM
232   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
228   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("mainbank")
233229   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
234230   AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P1")
235231   AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
r244652r244653
237233   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
238234   AM_RANGE(0xc100, 0xc100) AM_WRITE(butasan_unknown_w)
239235   AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_byte_w)
240   AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w)
241   AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
236   AM_RANGE(0xc201, 0xc201) AM_WRITE(flipscreen_w)
237   AM_RANGE(0xc202, 0xc202) AM_WRITE(bankselect_w)
242238   AM_RANGE(0xc203, 0xc203) AM_WRITE(butasan_pageselect_w)
243239   AM_RANGE(0xc300, 0xc301) AM_RAM AM_SHARE("bg0_scrollx")
244240   AM_RANGE(0xc302, 0xc303) AM_RAM AM_SHARE("bg0_scrolly")
r244652r244653
246242   AM_RANGE(0xc308, 0xc309) AM_RAM AM_SHARE("bg1_scrollx")
247243   AM_RANGE(0xc30a, 0xc30b) AM_RAM AM_SHARE("bg1_scrolly")
248244   AM_RANGE(0xc30c, 0xc30c) AM_WRITE(butasan_bg1_status_w)
249   AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(butasan_bg1ram_r, butasan_bg1ram_w) AM_SHARE("butasan_bg1ram")
250   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(argus_paletteram_r, butasan_paletteram_w) AM_SHARE("paletteram")
245   AM_RANGE(0xc400, 0xc7ff) AM_RAM_WRITE(butasan_bg1ram_w) AM_SHARE("butasan_bg1ram")
246   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(butasan_paletteram_w) AM_SHARE("paletteram")
251247   AM_RANGE(0xd000, 0xdfff) AM_READWRITE(butasan_pagedram_r, butasan_pagedram_w)
252248   AM_RANGE(0xe000, 0xefff) AM_RAM
253249   AM_RANGE(0xf000, 0xf67f) AM_RAM AM_SHARE("spriteram")
r244652r244653
534530   /* basic machine hardware */
535531   MCFG_CPU_ADD("maincpu", Z80, 5000000)           /* 4 MHz */
536532   MCFG_CPU_PROGRAM_MAP(argus_map)
537   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, argus_scanline, "screen", 0, 1)
533   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, scanline, "screen", 0, 1)
538534
539535   MCFG_CPU_ADD("audiocpu", Z80, 5000000)
540536   MCFG_CPU_PROGRAM_MAP(sound_map_a)
r244652r244653
560556   MCFG_SPEAKER_STANDARD_MONO("mono")
561557
562558   MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4)
563   MCFG_YM2203_IRQ_HANDLER(WRITELINE(argus_state, irqhandler))
559   MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
564560   MCFG_SOUND_ROUTE(0, "mono", 0.15)
565561   MCFG_SOUND_ROUTE(1, "mono", 0.15)
566562   MCFG_SOUND_ROUTE(2, "mono", 0.15)
r244652r244653
578574   /* basic machine hardware */
579575   MCFG_CPU_ADD("maincpu", Z80, 5000000)           /* 5 MHz */
580576   MCFG_CPU_PROGRAM_MAP(valtric_map)
581   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, argus_scanline, "screen", 0, 1)
577   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, scanline, "screen", 0, 1)
582578
583579   MCFG_CPU_ADD("audiocpu", Z80, 5000000)
584580   MCFG_CPU_PROGRAM_MAP(sound_map_a)
r244652r244653
604600   MCFG_SPEAKER_STANDARD_MONO("mono")
605601
606602   MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4)
607   MCFG_YM2203_IRQ_HANDLER(WRITELINE(argus_state, irqhandler))
603   MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
608604   MCFG_SOUND_ROUTE(0, "mono", 0.15)
609605   MCFG_SOUND_ROUTE(1, "mono", 0.15)
610606   MCFG_SOUND_ROUTE(2, "mono", 0.15)
r244652r244653
648644   MCFG_SPEAKER_STANDARD_MONO("mono")
649645
650646   MCFG_SOUND_ADD("ym1", YM2203, 6000000 / 4)
651   MCFG_YM2203_IRQ_HANDLER(WRITELINE(argus_state, irqhandler))
647   MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
652648   MCFG_SOUND_ROUTE(0, "mono", 0.30)
653649   MCFG_SOUND_ROUTE(1, "mono", 0.30)
654650   MCFG_SOUND_ROUTE(2, "mono", 0.30)
r244652r244653
796792
797793
798794/*  ( YEAR   NAME     PARENT  MACHINE   INPUT     INIT  MONITOR  COMPANY                  FULLNAME ) */
799GAME( 1986, argus,    0,      argus,    argus, driver_device,    0,    ROT270,  "NMK (Jaleco license)", "Argus",                                       GAME_IMPERFECT_GRAPHICS )
800GAME( 1986, valtric,  0,      valtric,  valtric, driver_device,  0,    ROT270,  "NMK (Jaleco license)", "Valtric",                                     GAME_IMPERFECT_GRAPHICS )
801GAME( 1987, butasan,  0,      butasan,  butasan, driver_device,  0,    ROT0,    "NMK (Jaleco license)", "Butasan - Pig's & Bomber's (Japan, English)", GAME_IMPERFECT_GRAPHICS )
802GAME( 1987, butasanj, butasan,butasan,  butasan, driver_device,  0,    ROT0,    "NMK (Jaleco license)", "Butasan (Japan, Japanese)",                   GAME_IMPERFECT_GRAPHICS )
795GAME( 1986, argus,    0,      argus,    argus, driver_device,    0,    ROT270,  "NMK (Jaleco license)", "Argus",                                       GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
796GAME( 1986, valtric,  0,      valtric,  valtric, driver_device,  0,    ROT270,  "NMK (Jaleco license)", "Valtric",                                     GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
797GAME( 1987, butasan,  0,      butasan,  butasan, driver_device,  0,    ROT0,    "NMK (Jaleco license)", "Butasan - Pig's & Bomber's (Japan, English)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
798GAME( 1987, butasanj, butasan,butasan,  butasan, driver_device,  0,    ROT0,    "NMK (Jaleco license)", "Butasan (Japan, Japanese)",                   GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/capbowl.c
r244652r244653
103103 *
104104 *************************************/
105105
106INTERRUPT_GEN_MEMBER(capbowl_state::capbowl_interrupt)
106INTERRUPT_GEN_MEMBER(capbowl_state::interrupt)
107107{
108108   if (ioport("SERVICE")->read() & 1)                      /* get status of the F2 key */
109109      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);    /* trigger self test */
r244652r244653
121121{
122122   switch (id)
123123   {
124   case TIMER_CAPBOWL_UPDATE:
125      capbowl_update(ptr, param);
124   case TIMER_UPDATE:
125      update(ptr, param);
126126      break;
127127   default:
128128      assert_always(FALSE, "Unknown id in capbowl_state::device_timer");
r244652r244653
130130}
131131
132132
133TIMER_CALLBACK_MEMBER(capbowl_state::capbowl_update)
133TIMER_CALLBACK_MEMBER(capbowl_state::update)
134134{
135135   int scanline = param;
136136
137137   m_screen->update_partial(scanline - 1);
138138   scanline += 32;
139139   if (scanline > 240) scanline = 32;
140   timer_set(m_screen->time_until_pos(scanline), TIMER_CAPBOWL_UPDATE, scanline);
140   m_update_timer->adjust(m_screen->time_until_pos(scanline), scanline);
141141}
142142
143143
r244652r244653
190190 *
191191 *************************************/
192192
193WRITE8_MEMBER(capbowl_state::capbowl_sndcmd_w)
193WRITE8_MEMBER(capbowl_state::sndcmd_w)
194194{
195195   m_audiocpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE);
196196   soundlatch_byte_w(space, offset, data);
197197}
198198
199199
200
201200/*************************************
202201 *
203 *  Handler called by the 2203 emulator
204 *  when the internal timers cause an IRQ
205 *
206 *************************************/
207
208WRITE_LINE_MEMBER(capbowl_state::firqhandler)
209{
210   m_audiocpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
211}
212
213
214
215/*************************************
216 *
217202 *  Main CPU memory handlers
218203 *
219204 *************************************/
r244652r244653
223208   AM_RANGE(0x4000, 0x4000) AM_WRITEONLY AM_SHARE("rowaddress")
224209   AM_RANGE(0x4800, 0x4800) AM_WRITE(capbowl_rom_select_w)
225210   AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("nvram")
226   AM_RANGE(0x5800, 0x5fff) AM_READWRITE(capbowl_tms34061_r, capbowl_tms34061_w)
227   AM_RANGE(0x6000, 0x6000) AM_WRITE(capbowl_sndcmd_w)
211   AM_RANGE(0x5800, 0x5fff) AM_READWRITE(tms34061_r, tms34061_w)
212   AM_RANGE(0x6000, 0x6000) AM_WRITE(sndcmd_w)
228213   AM_RANGE(0x6800, 0x6800) AM_WRITE(track_reset_w) AM_READNOP   /* + watchdog */
229214   AM_RANGE(0x7000, 0x7000) AM_READ(track_0_r)         /* + other inputs */
230215   AM_RANGE(0x7800, 0x7800) AM_READ(track_1_r)         /* + other inputs */
r244652r244653
236221   AM_RANGE(0x0000, 0x001f) AM_READWRITE(bowlrama_blitter_r, bowlrama_blitter_w)
237222   AM_RANGE(0x4000, 0x4000) AM_WRITEONLY AM_SHARE("rowaddress")
238223   AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("nvram")
239   AM_RANGE(0x5800, 0x5fff) AM_READWRITE(capbowl_tms34061_r, capbowl_tms34061_w)
240   AM_RANGE(0x6000, 0x6000) AM_WRITE(capbowl_sndcmd_w)
224   AM_RANGE(0x5800, 0x5fff) AM_READWRITE(tms34061_r, tms34061_w)
225   AM_RANGE(0x6000, 0x6000) AM_WRITE(sndcmd_w)
241226   AM_RANGE(0x6800, 0x6800) AM_WRITE(track_reset_w) AM_READNOP    /* + watchdog */
242227   AM_RANGE(0x7000, 0x7000) AM_READ(track_0_r)         /* + other inputs */
243228   AM_RANGE(0x7800, 0x7800) AM_READ(track_1_r)         /* + other inputs */
r244652r244653
301286
302287/*************************************
303288 *
304 *  TMS34061 interfacing
305 *
306 *************************************/
307
308WRITE_LINE_MEMBER(capbowl_state::generate_tms34061_interrupt)
309{
310   m_maincpu->set_input_line(M6809_FIRQ_LINE, state);
311}
312
313/*************************************
314 *
315289 *  Machine driver
316290 *
317291 *************************************/
318292
319293void capbowl_state::machine_start()
320294{
295   m_update_timer = timer_alloc(TIMER_UPDATE);
296   
321297   save_item(NAME(m_blitter_addr));
322   save_item(NAME(m_last_trackball_val[0]));
323   save_item(NAME(m_last_trackball_val[1]));
298   save_item(NAME(m_last_trackball_val));
324299}
325300
326301void capbowl_state::machine_reset()
327302{
328   timer_set(m_screen->time_until_pos(32), TIMER_CAPBOWL_UPDATE, 32);
303   m_update_timer->adjust(m_screen->time_until_pos(32), 32);
329304
330305   m_blitter_addr = 0;
331306   m_last_trackball_val[0] = 0;
r244652r244653
338313   /* basic machine hardware */
339314   MCFG_CPU_ADD("maincpu", M6809E, MASTER_CLOCK)
340315   MCFG_CPU_PROGRAM_MAP(capbowl_map)
341   MCFG_CPU_VBLANK_INT_DRIVER("screen", capbowl_state,  capbowl_interrupt)
316   MCFG_CPU_VBLANK_INT_DRIVER("screen", capbowl_state,  interrupt)
342317   MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(100000.0, 100000.0, 0.1e-6) * 15.5) // ~0.3s
343318
344319   MCFG_CPU_ADD("audiocpu", M6809E, MASTER_CLOCK)
r244652r244653
354329   MCFG_SCREEN_SIZE(360, 256)
355330   MCFG_SCREEN_VISIBLE_AREA(0, 359, 0, 244)
356331   MCFG_SCREEN_REFRESH_RATE(57)
357   MCFG_SCREEN_UPDATE_DRIVER(capbowl_state, screen_update_capbowl)
332   MCFG_SCREEN_UPDATE_DRIVER(capbowl_state, screen_update)
358333
359334   MCFG_DEVICE_ADD("tms34061", TMS34061, 0)
360335   MCFG_TMS34061_ROWSHIFT(8)  /* VRAM address is (row << rowshift) | col */
361336   MCFG_TMS34061_VRAM_SIZE(0x10000) /* size of video RAM */
362   MCFG_TMS34061_INTERRUPT_CB(WRITELINE(capbowl_state, generate_tms34061_interrupt))      /* interrupt gen callback */
337   MCFG_TMS34061_INTERRUPT_CB(INPUTLINE("maincpu", M6809_FIRQ_LINE))      /* interrupt gen callback */
363338
364339   /* sound hardware */
365340   MCFG_SPEAKER_STANDARD_MONO("mono")
366341
367342   MCFG_SOUND_ADD("ymsnd", YM2203, MASTER_CLOCK/2)
368   MCFG_YM2203_IRQ_HANDLER(WRITELINE(capbowl_state, firqhandler))
343   MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", M6809_FIRQ_LINE))
369344   MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("ticket", ticket_dispenser_device, read))
370345   MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("ticket", ticket_dispenser_device, write))  /* Also a status LED. See memory map above */
371346   MCFG_SOUND_ROUTE(0, "mono", 0.07)
r244652r244653
492467 *
493468 *************************************/
494469
495GAME( 1988, capbowl,  0,       capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 1)", 0 )
496GAME( 1988, capbowl2, capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 2)", 0 )
497GAME( 1988, capbowl3, capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 3)", 0 )
498GAME( 1988, capbowl4, capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 4)", 0 )
499GAME( 1989, clbowl,   capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Coors Light Bowling", 0 )
500GAME( 1991, bowlrama, 0,       bowlrama, capbowl, driver_device, 0,        ROT270, "P&P Marketing", "Bowl-O-Rama", 0 )
470GAME( 1988, capbowl,  0,       capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 1)", GAME_SUPPORTS_SAVE )
471GAME( 1988, capbowl2, capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 2)", GAME_SUPPORTS_SAVE )
472GAME( 1988, capbowl3, capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 3)", GAME_SUPPORTS_SAVE )
473GAME( 1988, capbowl4, capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Capcom Bowling (set 4)", GAME_SUPPORTS_SAVE )
474GAME( 1989, clbowl,   capbowl, capbowl,  capbowl, capbowl_state, capbowl,  ROT270, "Incredible Technologies / Capcom", "Coors Light Bowling", GAME_SUPPORTS_SAVE )
475GAME( 1991, bowlrama, 0,       bowlrama, capbowl, driver_device, 0,        ROT270, "P&P Marketing", "Bowl-O-Rama", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/fgoal.c
r244652r244653
9898   if (scanline > 256)
9999      scanline = 0;
100100
101   timer_set(m_screen->time_until_pos(scanline), TIMER_INTERRUPT);
101   m_interrupt_timer->adjust(m_screen->time_until_pos(scanline));
102102}
103103
104104
105unsigned fgoal_state::video_ram_address( )
105unsigned fgoal_state::video_ram_address( )
106106{
107107   return 0x4000 | (m_row << 5) | (m_col >> 3);
108108}
109109
110110
111READ8_MEMBER(fgoal_state::fgoal_analog_r)
111READ8_MEMBER(fgoal_state::analog_r)
112112{
113   return ioport(m_fgoal_player ? "PADDLE1" : "PADDLE0")->read(); /* PCB can be jumpered to use a single dial */
113   return ioport(m_player ? "PADDLE1" : "PADDLE0")->read(); /* PCB can be jumpered to use a single dial */
114114}
115115
116116
117CUSTOM_INPUT_MEMBER(fgoal_state::fgoal_80_r)
117CUSTOM_INPUT_MEMBER(fgoal_state::_80_r)
118118{
119119   UINT8 ret = (m_screen->vpos() & 0x80) ? 1 : 0;
120120
121121   return ret;
122122}
123123
124READ8_MEMBER(fgoal_state::fgoal_nmi_reset_r)
124READ8_MEMBER(fgoal_state::nmi_reset_r)
125125{
126126   m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
127127
r244652r244653
129129}
130130
131131
132READ8_MEMBER(fgoal_state::fgoal_irq_reset_r)
132READ8_MEMBER(fgoal_state::irq_reset_r)
133133{
134134   m_maincpu->set_input_line(0, CLEAR_LINE);
135135
r244652r244653
137137}
138138
139139
140READ8_MEMBER(fgoal_state::fgoal_row_r)
140READ8_MEMBER(fgoal_state::row_r)
141141{
142142   return m_row;
143143}
144144
145145
146WRITE8_MEMBER(fgoal_state::fgoal_row_w)
146WRITE8_MEMBER(fgoal_state::row_w)
147147{
148148   m_row = data;
149149   m_mb14241->shift_data_w(space, 0, 0);
150150}
151151
152WRITE8_MEMBER(fgoal_state::fgoal_col_w)
152WRITE8_MEMBER(fgoal_state::col_w)
153153{
154154   m_col = data;
155155   m_mb14241->shift_count_w(space, 0, data);
156156}
157157
158READ8_MEMBER(fgoal_state::fgoal_address_hi_r)
158READ8_MEMBER(fgoal_state::address_hi_r)
159159{
160160   return video_ram_address() >> 8;
161161}
162162
163READ8_MEMBER(fgoal_state::fgoal_address_lo_r)
163READ8_MEMBER(fgoal_state::address_lo_r)
164164{
165165   return video_ram_address() & 0xff;
166166}
167167
168READ8_MEMBER(fgoal_state::fgoal_shifter_r)
168READ8_MEMBER(fgoal_state::shifter_r)
169169{
170170   UINT8 v = m_mb14241->shift_result_r(space, 0);
171171
172172   return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0);
173173}
174174
175READ8_MEMBER(fgoal_state::fgoal_shifter_reverse_r)
175READ8_MEMBER(fgoal_state::shifter_reverse_r)
176176{
177177   UINT8 v = m_mb14241->shift_result_r(space, 0);
178178
r244652r244653
180180}
181181
182182
183WRITE8_MEMBER(fgoal_state::fgoal_sound1_w)
183WRITE8_MEMBER(fgoal_state::sound1_w)
184184{
185185   /* BIT0 => SX2 */
186186   /* BIT1 => SX1 */
r244652r244653
193193}
194194
195195
196WRITE8_MEMBER(fgoal_state::fgoal_sound2_w)
196WRITE8_MEMBER(fgoal_state::sound2_w)
197197{
198198   /* BIT0 => CX0 */
199199   /* BIT1 => SX6 */
r244652r244653
201201   /* BIT3 => SX5 */
202202   /* BIT4 => SX4 */
203203   /* BIT5 => SX3 */
204   m_fgoal_player = data & 1;
204   m_player = data & 1;
205205}
206206
207207
r244652r244653
209209
210210   AM_RANGE(0x0000, 0x00ef) AM_RAM
211211
212   AM_RANGE(0x00f0, 0x00f0) AM_READ(fgoal_row_r)
213   AM_RANGE(0x00f1, 0x00f1) AM_READ(fgoal_analog_r)
212   AM_RANGE(0x00f0, 0x00f0) AM_READ(row_r)
213   AM_RANGE(0x00f1, 0x00f1) AM_READ(analog_r)
214214   AM_RANGE(0x00f2, 0x00f2) AM_READ_PORT("IN0")
215215   AM_RANGE(0x00f3, 0x00f3) AM_READ_PORT("IN1")
216   AM_RANGE(0x00f4, 0x00f4) AM_READ(fgoal_address_hi_r)
217   AM_RANGE(0x00f5, 0x00f5) AM_READ(fgoal_address_lo_r)
218   AM_RANGE(0x00f6, 0x00f6) AM_READ(fgoal_shifter_r)
219   AM_RANGE(0x00f7, 0x00f7) AM_READ(fgoal_shifter_reverse_r)
220   AM_RANGE(0x00f8, 0x00fb) AM_READ(fgoal_nmi_reset_r)
221   AM_RANGE(0x00fc, 0x00ff) AM_READ(fgoal_irq_reset_r)
216   AM_RANGE(0x00f4, 0x00f4) AM_READ(address_hi_r)
217   AM_RANGE(0x00f5, 0x00f5) AM_READ(address_lo_r)
218   AM_RANGE(0x00f6, 0x00f6) AM_READ(shifter_r)
219   AM_RANGE(0x00f7, 0x00f7) AM_READ(shifter_reverse_r)
220   AM_RANGE(0x00f8, 0x00fb) AM_READ(nmi_reset_r)
221   AM_RANGE(0x00fc, 0x00ff) AM_READ(irq_reset_r)
222222
223   AM_RANGE(0x00f0, 0x00f0) AM_WRITE(fgoal_row_w)
224   AM_RANGE(0x00f1, 0x00f1) AM_WRITE(fgoal_col_w)
225   AM_RANGE(0x00f2, 0x00f2) AM_WRITE(fgoal_row_w)
226   AM_RANGE(0x00f3, 0x00f3) AM_WRITE(fgoal_col_w)
223   AM_RANGE(0x00f0, 0x00f0) AM_WRITE(row_w)
224   AM_RANGE(0x00f1, 0x00f1) AM_WRITE(col_w)
225   AM_RANGE(0x00f2, 0x00f2) AM_WRITE(row_w)
226   AM_RANGE(0x00f3, 0x00f3) AM_WRITE(col_w)
227227   AM_RANGE(0x00f4, 0x00f7) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
228   AM_RANGE(0x00f8, 0x00fb) AM_WRITE(fgoal_sound1_w)
229   AM_RANGE(0x00fc, 0x00ff) AM_WRITE(fgoal_sound2_w)
228   AM_RANGE(0x00f8, 0x00fb) AM_WRITE(sound1_w)
229   AM_RANGE(0x00fc, 0x00ff) AM_WRITE(sound2_w)
230230
231231   AM_RANGE(0x0100, 0x03ff) AM_RAM
232232   AM_RANGE(0x4000, 0x7fff) AM_RAM AM_SHARE("video_ram")
233233
234   AM_RANGE(0x8000, 0x8000) AM_WRITE(fgoal_ypos_w)
235   AM_RANGE(0x8001, 0x8001) AM_WRITE(fgoal_xpos_w)
236   AM_RANGE(0x8002, 0x8002) AM_WRITE(fgoal_color_w)
234   AM_RANGE(0x8000, 0x8000) AM_WRITE(ypos_w)
235   AM_RANGE(0x8001, 0x8001) AM_WRITE(xpos_w)
236   AM_RANGE(0x8002, 0x8002) AM_WRITE(color_w)
237237
238238   AM_RANGE(0xa000, 0xbfff) AM_ROM
239239   AM_RANGE(0xd000, 0xffff) AM_ROM
r244652r244653
266266   /* extra credit score changes depending on player's performance */
267267
268268   PORT_START("IN1")
269   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fgoal_state,fgoal_80_r, NULL) /* 128V */
269   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, fgoal_state, _80_r, NULL) /* 128V */
270270   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ))
271271   PORT_DIPSETTING(    0x00, DEF_STR( Upright ))
272272   PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ))
r244652r244653
338338
339339void fgoal_state::machine_start()
340340{
341   m_interrupt_timer = timer_alloc(TIMER_INTERRUPT);
342   
341343   save_item(NAME(m_xpos));
342344   save_item(NAME(m_ypos));
343345   save_item(NAME(m_current_color));
344   save_item(NAME(m_fgoal_player));
346   save_item(NAME(m_player));
345347   save_item(NAME(m_row));
346348   save_item(NAME(m_col));
347349   save_item(NAME(m_prev_coin));
r244652r244653
349351
350352void fgoal_state::machine_reset()
351353{
352   timer_set(m_screen->time_until_pos(0), TIMER_INTERRUPT);
354   m_interrupt_timer->adjust(m_screen->time_until_pos(0));
353355
354356   m_xpos = 0;
355357   m_ypos = 0;
356358   m_current_color = 0;
357   m_fgoal_player = 0;
359   m_player = 0;
358360   m_row = 0;
359361   m_col = 0;
360362   m_prev_coin = 0;
r244652r244653
375377   MCFG_SCREEN_REFRESH_RATE(60)
376378   MCFG_SCREEN_SIZE(256, 263)
377379   MCFG_SCREEN_VISIBLE_AREA(0, 255, 16, 255)
378   MCFG_SCREEN_UPDATE_DRIVER(fgoal_state, screen_update_fgoal)
380   MCFG_SCREEN_UPDATE_DRIVER(fgoal_state, screen_update)
379381   MCFG_SCREEN_PALETTE("palette")
380382
381383   MCFG_GFXDECODE_ADD("gfxdecode", "palette", fgoal)
r244652r244653
433435ROM_END
434436
435437
436GAME( 1979, fgoal,  0,     fgoal, fgoal, driver_device, 0, ROT90, "Taito", "Field Goal (set 1)", GAME_NO_SOUND )
437GAME( 1979, fgoala, fgoal, fgoal, fgoal, driver_device, 0, ROT90, "Taito", "Field Goal (set 2)", GAME_NO_SOUND )
438GAME( 1979, fgoal,  0,     fgoal, fgoal, driver_device, 0, ROT90, "Taito", "Field Goal (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
439GAME( 1979, fgoala, fgoal, fgoal, fgoal, driver_device, 0, ROT90, "Taito", "Field Goal (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/ssv.c
r244652r244653
179179   m_maincpu->set_input_line(0, (m_requested_int & m_irq_enable)? ASSERT_LINE : CLEAR_LINE);
180180}
181181
182IRQ_CALLBACK_MEMBER(ssv_state::ssv_irq_callback)
182IRQ_CALLBACK_MEMBER(ssv_state::irq_callback)
183183{
184184   int i;
185185   for ( i = 0; i <= 7; i++ )
r244652r244653
193193   return 0;
194194}
195195
196WRITE16_MEMBER(ssv_state::ssv_irq_ack_w)
196WRITE16_MEMBER(ssv_state::irq_ack_w)
197197{
198198   int level = ((offset * 2) & 0x70) >> 4;
199199
r244652r244653
220220    ultrax:     40,00 at the start then 42,4a
221221    twineag2:   40,00 at the start then 42,4a
222222*/
223WRITE16_MEMBER(ssv_state::ssv_irq_enable_w)
223WRITE16_MEMBER(ssv_state::irq_enable_w)
224224{
225225   COMBINE_DATA(&m_irq_enable);
226226}
227227
228TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::ssv_interrupt)
228TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::interrupt)
229229{
230230   int scanline = param;
231231
r244652r244653
283283    survarts:   83
284284    sxyreact:   80
285285*/
286WRITE16_MEMBER(ssv_state::ssv_lockout_w)
286WRITE16_MEMBER(ssv_state::lockout_w)
287287{
288288//  popmessage("%02X",data & 0xff);
289289   if (ACCESSING_BITS_0_7)
r244652r244653
293293      coin_counter_w(machine(), 1, data & 0x04);
294294      coin_counter_w(machine(), 0, data & 0x08);
295295//                        data & 0x40?
296      ssv_enable_video(data & 0x80);
296      enable_video(data & 0x80);
297297   }
298298}
299299
300300/* Same as above but with inverted lockout lines */
301WRITE16_MEMBER(ssv_state::ssv_lockout_inv_w)
301WRITE16_MEMBER(ssv_state::lockout_inv_w)
302302{
303303//  popmessage("%02X",data & 0xff);
304304   if (ACCESSING_BITS_0_7)
r244652r244653
308308      coin_counter_w(machine(), 1, data & 0x04);
309309      coin_counter_w(machine(), 0, data & 0x08);
310310//                        data & 0x40?
311      ssv_enable_video(data & 0x80);
311      enable_video(data & 0x80);
312312   }
313313}
314314
r244652r244653
396396   AM_RANGE(0x100000, 0x13ffff) AM_RAM AM_SHARE("spriteram")                                       /*  Sprites */  \
397397   AM_RANGE(0x140000, 0x15ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") /* Palette */\
398398   AM_RANGE(0x160000, 0x17ffff) AM_RAM                                                             /*          */  \
399   AM_RANGE(0x1c0000, 0x1c0001) AM_READ(ssv_vblank_r           )                                   /*  Vblank? */  \
399   AM_RANGE(0x1c0000, 0x1c0001) AM_READ(vblank_r           )                                   /*  Vblank? */  \
400400/**/AM_RANGE(0x1c0002, 0x1c007f) AM_READONLY                                    /*  Scroll  */  \
401   AM_RANGE(0x1c0000, 0x1c007f) AM_WRITE(ssv_scroll_w) AM_SHARE("scroll")                  /*  Scroll  */  \
401   AM_RANGE(0x1c0000, 0x1c007f) AM_WRITE(scroll_w) AM_SHARE("scroll")                  /*  Scroll  */  \
402402   AM_RANGE(0x210002, 0x210003) AM_READ_PORT("DSW1")                                                               \
403403   AM_RANGE(0x210004, 0x210005) AM_READ_PORT("DSW2")                                                               \
404404   AM_RANGE(0x210008, 0x210009) AM_READ_PORT("P1")                                                                 \
405405   AM_RANGE(0x21000a, 0x21000b) AM_READ_PORT("P2")                                                                 \
406406   AM_RANGE(0x21000c, 0x21000d) AM_READ_PORT("SYSTEM")                                                             \
407   AM_RANGE(0x21000e, 0x21000f) AM_READNOP AM_WRITE(ssv_lockout_w)                             /*  Lockout */  \
407   AM_RANGE(0x21000e, 0x21000f) AM_READNOP AM_WRITE(lockout_w)                             /*  Lockout */  \
408408   AM_RANGE(0x210010, 0x210011) AM_WRITENOP                                                                        \
409409   AM_RANGE(0x230000, 0x230071) AM_WRITEONLY AM_SHARE("irq_vectors")                       /*  IRQ Vec */  \
410   AM_RANGE(0x240000, 0x240071) AM_WRITE(ssv_irq_ack_w )                                           /*  IRQ Ack */  \
411   AM_RANGE(0x260000, 0x260001) AM_WRITE(ssv_irq_enable_w)                                         /*  IRQ En  */  \
410   AM_RANGE(0x240000, 0x240071) AM_WRITE(irq_ack_w )                                           /*  IRQ Ack */  \
411   AM_RANGE(0x260000, 0x260001) AM_WRITE(irq_enable_w)                                         /*  IRQ En  */  \
412412   AM_RANGE(0x300000, 0x30007f) AM_DEVREADWRITE8("ensoniq", es5506_device, read, write, 0x00ff)    /*  Sound   */  \
413413   AM_RANGE(_ROM, 0xffffff) AM_ROM AM_REGION("maincpu", 0)                                         /*  ROM     */
414414/***************************************************************************
r244652r244653
513513static ADDRESS_MAP_START( hypreact_map, AS_PROGRAM, 16, ssv_state )
514514   AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r)            // Watchdog
515515//  AM_RANGE(0x210002, 0x210003) AM_WRITENOP                      // ? 5 at the start
516   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(ssv_lockout_inv_w)            // Inverted lockout lines
516   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w)            // Inverted lockout lines
517517//  AM_RANGE(0x280000, 0x280001) AM_READNOP                       // ? read at the start, value not used
518518   AM_RANGE(0xc00000, 0xc00001) AM_READ(hypreact_input_r)              // Inputs
519519   AM_RANGE(0xc00006, 0xc00007) AM_RAM AM_SHARE("input_sel")           //
r244652r244653
529529static ADDRESS_MAP_START( hypreac2_map, AS_PROGRAM, 16, ssv_state )
530530   AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r)                // Watchdog
531531//  AM_RANGE(0x210002, 0x210003) AM_WRITENOP                          // ? 5 at the start
532   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(ssv_lockout_inv_w)                // Inverted lockout lines
532   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w)                // Inverted lockout lines
533533//  AM_RANGE(0x280000, 0x280001) AM_READNOP                           // ? read at the start, value not used
534534   AM_RANGE(0x500000, 0x500001) AM_READ(hypreact_input_r)                  // Inputs
535535   AM_RANGE(0x500002, 0x500003) AM_READ(hypreact_input_r)                  // (again?)
r244652r244653
587587
588588/* Monster Slider needs the RAM mirrored for the gameplay logic to work correctly */
589589
590READ16_MEMBER(ssv_state::ssv_mainram_r)
590READ16_MEMBER(ssv_state::mainram_r)
591591{
592592   return m_mainram[offset];
593593}
594594
595WRITE16_MEMBER(ssv_state::ssv_mainram_w)
595WRITE16_MEMBER(ssv_state::mainram_w)
596596{
597597   COMBINE_DATA(&m_mainram[offset]);
598598}
599599
600600static ADDRESS_MAP_START( mslider_map, AS_PROGRAM, 16, ssv_state )
601   AM_RANGE(0x010000, 0x01ffff) AM_READWRITE(ssv_mainram_r, ssv_mainram_w) // RAM Mirror
601   AM_RANGE(0x010000, 0x01ffff) AM_READWRITE(mainram_r, mainram_w) // RAM Mirror
602602//  AM_RANGE(0x210002, 0x210003) AM_WRITENOP                          // ? 1 at the start
603603   AM_RANGE(0x400000, 0x47ffff) AM_WRITEONLY                           // ?
604604//  AM_RANGE(0x500000, 0x500001) AM_WRITENOP                          // ? ff at the start
r244652r244653
684684   AM_RANGE(0x010000, 0x050faf) AM_RAM                                     // More RAM
685685   AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r)                // Watchdog
686686//  AM_RANGE(0x210002, 0x210003) AM_WRITENOP                          // ? 0,4 at the start
687   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(ssv_lockout_inv_w)                // Coin Counters / Lockouts
687   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w)                // Coin Counters / Lockouts
688688   AM_RANGE(0x300076, 0x300077) AM_READ(srmp7_irqv_r)                      // Sound
689689//  0x540000, 0x540003, related to lev 5 irq?
690690   AM_RANGE(0x580000, 0x580001) AM_WRITE(srmp7_sound_bank_w)               // Sound Bank
r244652r244653
751751}
752752
753753static ADDRESS_MAP_START( sxyreact_map, AS_PROGRAM, 16, ssv_state )
754//  AM_RANGE(0x020000, 0x03ffff) AM_READWRITE(ssv_mainram_r, ssv_mainram_w)             // sxyreac2 reads / writes here, why?
754//  AM_RANGE(0x020000, 0x03ffff) AM_READWRITE(mainram_r, mainram_w)             // sxyreac2 reads / writes here, why?
755755   AM_RANGE(0x210000, 0x210001) AM_READ(watchdog_reset16_r)                            // Watchdog
756756//  AM_RANGE(0x210002, 0x210003) AM_WRITENOP                                      // ? 1 at the start
757   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(ssv_lockout_inv_w)                            // Inverted lockout lines
757   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w)                            // Inverted lockout lines
758758   AM_RANGE(0x500002, 0x500003) AM_READ(sxyreact_ballswitch_r)                         // ?
759759   AM_RANGE(0x500004, 0x500005) AM_READWRITE(sxyreact_dial_r, sxyreact_motor_w)        // Dial Value (serial)
760760   AM_RANGE(0x520000, 0x520001) AM_WRITE(sxyreact_dial_w)                              // Dial Value (advance 1 bit)
r244652r244653
828828}
829829
830830static ADDRESS_MAP_START( jsk_map, AS_PROGRAM, 16, ssv_state )
831   AM_RANGE(0x050000, 0x05ffff) AM_READWRITE(ssv_mainram_r, ssv_mainram_w) // RAM Mirror?
831   AM_RANGE(0x050000, 0x05ffff) AM_READWRITE(mainram_r, mainram_w) // RAM Mirror?
832832   AM_RANGE(0x210000, 0x210001) AM_WRITE(watchdog_reset16_w)               // Watchdog
833833   AM_RANGE(0x400000, 0x47ffff) AM_RAM                                     // RAM?
834834   AM_RANGE(0x900000, 0x900007) AM_READWRITE(latch16_r, latch16_w)
r244652r244653
898898   AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(eaglshot_gfxram_r, eaglshot_gfxram_w)
899899   AM_RANGE(0x210000, 0x210001) AM_READNOP /*AM_READ(watchdog_reset16_r)*/                 // Watchdog
900900//  AM_RANGE(0x210002, 0x210003) AM_WRITENOP                                      // ? 0,4 at the start
901   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(ssv_lockout_inv_w)                            // Inverted lockout lines
901   AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w)                            // Inverted lockout lines
902902   AM_RANGE(0x800000, 0x800001) AM_WRITE(eaglshot_gfxrom_bank_w)
903903   AM_RANGE(0x900000, 0x900001) AM_WRITE(eaglshot_trackball_w)
904904   AM_RANGE(0xa00000, 0xbfffff) AM_ROMBANK("gfxrom")
r244652r244653
24812481
24822482***************************************************************************/
24832483
2484void ssv_state::init_ssv(int interrupt_ultrax)
2484void ssv_state::init(int interrupt_ultrax)
24852485{
24862486   int i;
24872487   for (i = 0; i < 16; i++)
r244652r244653
24892489                        ( (i & 4) ? (2 << 16) : 0 ) +
24902490                        ( (i & 2) ? (4 << 16) : 0 ) +
24912491                        ( (i & 1) ? (8 << 16) : 0 ) ;
2492   ssv_enable_video(1);
2492   enable_video(1);
24932493   m_interrupt_ultrax = interrupt_ultrax;
2494   
2495   save_item(NAME(m_requested_int));
2496   save_item(NAME(m_irq_enable));
24942497}
24952498
24962499void ssv_state::init_hypreac2_common()
r244652r244653
25282531   }
25292532}
25302533
2531DRIVER_INIT_MEMBER(ssv_state,drifto94)     {    init_ssv(0); init_st010();  }
2532DRIVER_INIT_MEMBER(ssv_state,eaglshot)     {    init_ssv(0); init_eaglshot_banking();    }
2533DRIVER_INIT_MEMBER(ssv_state,gdfs)         {    init_ssv(0); }
2534DRIVER_INIT_MEMBER(ssv_state,hypreact)     {    init_ssv(0); }
2535DRIVER_INIT_MEMBER(ssv_state,hypreac2)     {    init_ssv(0); init_hypreac2_common();    }
2536DRIVER_INIT_MEMBER(ssv_state,janjans1)     {    init_ssv(0); }
2537DRIVER_INIT_MEMBER(ssv_state,keithlcy)     {    init_ssv(0); }
2538DRIVER_INIT_MEMBER(ssv_state,meosism)       {   init_ssv(0); }
2539DRIVER_INIT_MEMBER(ssv_state,mslider)       {   init_ssv(0); }
2540DRIVER_INIT_MEMBER(ssv_state,ryorioh)       {   init_ssv(0); }
2541DRIVER_INIT_MEMBER(ssv_state,srmp4)        {    init_ssv(0);
2534DRIVER_INIT_MEMBER(ssv_state,drifto94)     {    init(0); init_st010();  }
2535DRIVER_INIT_MEMBER(ssv_state,eaglshot)     {    init(0); init_eaglshot_banking(); save_item(NAME(m_trackball_select)); }
2536DRIVER_INIT_MEMBER(ssv_state,gdfs)         {    init(0); save_item(NAME(m_gdfs_lightgun_select)); save_item(NAME(m_gdfs_eeprom_old)); }
2537DRIVER_INIT_MEMBER(ssv_state,hypreact)     {    init(0); }
2538DRIVER_INIT_MEMBER(ssv_state,hypreac2)     {    init(0); init_hypreac2_common();    }
2539DRIVER_INIT_MEMBER(ssv_state,janjans1)     {    init(0); }
2540DRIVER_INIT_MEMBER(ssv_state,keithlcy)     {    init(0); }
2541DRIVER_INIT_MEMBER(ssv_state,meosism)       {   init(0); }
2542DRIVER_INIT_MEMBER(ssv_state,mslider)       {   init(0); }
2543DRIVER_INIT_MEMBER(ssv_state,ryorioh)       {   init(0); }
2544DRIVER_INIT_MEMBER(ssv_state,srmp4)        {    init(0);
25422545//  ((UINT16 *)memregion("maincpu")->base())[0x2b38/2] = 0x037a;   /* patch to see gal test mode */
25432546}
2544DRIVER_INIT_MEMBER(ssv_state,srmp7)        {    init_ssv(0); }
2545DRIVER_INIT_MEMBER(ssv_state,stmblade)     {    init_ssv(0); init_st010(); }
2546DRIVER_INIT_MEMBER(ssv_state,survarts)     {    init_ssv(0); }
2547DRIVER_INIT_MEMBER(ssv_state,dynagear)     {    init_ssv(0); }
2548DRIVER_INIT_MEMBER(ssv_state,sxyreact)     {    init_ssv(0); init_hypreac2_common();    }
2549DRIVER_INIT_MEMBER(ssv_state,cairblad)     {    init_ssv(0); init_hypreac2_common();    }
2550DRIVER_INIT_MEMBER(ssv_state,sxyreac2)     {    init_ssv(0); init_hypreac2_common();    }
2551DRIVER_INIT_MEMBER(ssv_state,twineag2)     {    init_ssv(1); init_st010();  }
2552DRIVER_INIT_MEMBER(ssv_state,ultrax)        {   init_ssv(1); }
2553DRIVER_INIT_MEMBER(ssv_state,vasara)        {   init_ssv(0); }
2554DRIVER_INIT_MEMBER(ssv_state,jsk)          {    init_ssv(0); }
2547DRIVER_INIT_MEMBER(ssv_state,srmp7)        {    init(0); }
2548DRIVER_INIT_MEMBER(ssv_state,stmblade)     {    init(0); init_st010(); }
2549DRIVER_INIT_MEMBER(ssv_state,survarts)     {    init(0); }
2550DRIVER_INIT_MEMBER(ssv_state,dynagear)     {    init(0); }
2551DRIVER_INIT_MEMBER(ssv_state,sxyreact)     {    init(0); init_hypreac2_common();  save_item(NAME(m_sxyreact_serial)); save_item(NAME(m_sxyreact_dial)); }
2552DRIVER_INIT_MEMBER(ssv_state,cairblad)     {    init(0); init_hypreac2_common();    }
2553DRIVER_INIT_MEMBER(ssv_state,sxyreac2)     {    init(0); init_hypreac2_common();  save_item(NAME(m_sxyreact_serial)); save_item(NAME(m_sxyreact_dial)); }
2554DRIVER_INIT_MEMBER(ssv_state,twineag2)     {    init(1); init_st010();  }
2555DRIVER_INIT_MEMBER(ssv_state,ultrax)        {   init(1); }
2556DRIVER_INIT_MEMBER(ssv_state,vasara)        {   init(0); }
2557DRIVER_INIT_MEMBER(ssv_state,jsk)          {    init(0); save_item(NAME(m_latches)); }
25552558
25562559#define SSV_MASTER_CLOCK XTAL_48MHz/3
25572560
r244652r244653
25672570
25682571   /* basic machine hardware */
25692572   MCFG_CPU_ADD("maincpu", V60, SSV_MASTER_CLOCK) /* Based on STA-0001 & STA-0001B System boards */
2570   MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(ssv_state,ssv_irq_callback)
2573   MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(ssv_state,irq_callback)
25712574
2572   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ssv_state, ssv_interrupt, "screen", 0, 1)
2575   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ssv_state, interrupt, "screen", 0, 1)
25732576
25742577   /* video hardware */
25752578   MCFG_SCREEN_ADD("screen", RASTER)
25762579   MCFG_SCREEN_RAW_PARAMS(SSV_PIXEL_CLOCK,SSV_HTOTAL,SSV_HBEND,SSV_HBSTART,SSV_VTOTAL,SSV_VBEND,SSV_VBSTART)
2577   MCFG_SCREEN_UPDATE_DRIVER(ssv_state, screen_update_ssv)
2580   MCFG_SCREEN_UPDATE_DRIVER(ssv_state, screen_update)
25782581   MCFG_SCREEN_PALETTE("palette")
25792582
25802583   MCFG_GFXDECODE_ADD("gfxdecode", "palette", ssv)
r244652r244653
47064709
47074710//     year   rom       clone     machine   inputs    init      monitor manufacturer          title                                               flags
47084711
4709GAME( 1993,  dynagear,  0,        dynagear, dynagear, ssv_state, dynagear, ROT0,   "Sammy",              "Dyna Gear",                                                              GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
4712GAME( 1993,  dynagear,  0,        dynagear, dynagear, ssv_state, dynagear, ROT0,   "Sammy",              "Dyna Gear",                                                              GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
47104713
4711GAME( 1993,  keithlcy,  0,        keithlcy, keithlcy, ssv_state, keithlcy, ROT0,   "Visco",              "Dramatic Adventure Quiz Keith & Lucy (Japan)",                           GAME_NO_COCKTAIL )
4714GAME( 1993,  keithlcy,  0,        keithlcy, keithlcy, ssv_state, keithlcy, ROT0,   "Visco",              "Dramatic Adventure Quiz Keith & Lucy (Japan)",                           GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47124715
4713GAME( 1993,  srmp4,     0,        srmp4,    srmp4,    ssv_state, srmp4,    ROT0,   "Seta",               "Super Real Mahjong PIV (Japan)",                                         GAME_NO_COCKTAIL )
4714GAME( 1993,  srmp4o,    srmp4,    srmp4,    srmp4,    ssv_state, srmp4,    ROT0,   "Seta",               "Super Real Mahjong PIV (Japan, older set)",                              GAME_NO_COCKTAIL ) // by the numbering of the program roms this should be older
4716GAME( 1993,  srmp4,     0,        srmp4,    srmp4,    ssv_state, srmp4,    ROT0,   "Seta",               "Super Real Mahjong PIV (Japan)",                                         GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4717GAME( 1993,  srmp4o,    srmp4,    srmp4,    srmp4,    ssv_state, srmp4,    ROT0,   "Seta",               "Super Real Mahjong PIV (Japan, older set)",                              GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // by the numbering of the program roms this should be older
47154718
4716GAME( 1993,  survarts,  0,        survarts, survarts, ssv_state, survarts, ROT0,   "Sammy",              "Survival Arts (World)",                                                  GAME_NO_COCKTAIL )
4717GAME( 1993,  survartsu, survarts, survarts, survarts, ssv_state, survarts, ROT0,   "American Sammy",     "Survival Arts (USA)",                                                    GAME_NO_COCKTAIL )
4718GAME( 1993,  survartsj, survarts, survarts, survarts, ssv_state, survarts, ROT0,   "Sammy",              "Survival Arts (Japan)",                                                  GAME_NO_COCKTAIL )
4719GAME( 1993,  survarts,  0,        survarts, survarts, ssv_state, survarts, ROT0,   "Sammy",              "Survival Arts (World)",                                                  GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4720GAME( 1993,  survartsu, survarts, survarts, survarts, ssv_state, survarts, ROT0,   "American Sammy",     "Survival Arts (USA)",                                                    GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4721GAME( 1993,  survartsj, survarts, survarts, survarts, ssv_state, survarts, ROT0,   "Sammy",              "Survival Arts (Japan)",                                                  GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47194722
4720GAME( 1994,  drifto94,  0,        drifto94, drifto94, ssv_state, drifto94, ROT0,   "Visco",              "Drift Out '94 - The Hard Order (Japan)",                                 GAME_NO_COCKTAIL )
4723GAME( 1994,  drifto94,  0,        drifto94, drifto94, ssv_state, drifto94, ROT0,   "Visco",              "Drift Out '94 - The Hard Order (Japan)",                                 GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47214724
4722GAME( 1994,  eaglshot,  0,        eaglshot, eaglshot, ssv_state, eaglshot, ROT0,   "Sammy",              "Eagle Shot Golf",                                                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
4725GAME( 1994,  eaglshot,  0,        eaglshot, eaglshot, ssv_state, eaglshot, ROT0,   "Sammy",              "Eagle Shot Golf",                                                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
47234726
4724GAME( 1995,  hypreact,  0,        hypreact, hypreact, ssv_state, hypreact, ROT0,   "Sammy",              "Mahjong Hyper Reaction (Japan)",                                         GAME_NO_COCKTAIL )
4727GAME( 1995,  hypreact,  0,        hypreact, hypreact, ssv_state, hypreact, ROT0,   "Sammy",              "Mahjong Hyper Reaction (Japan)",                                         GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47254728
4726GAME( 1994,  twineag2,  0,        twineag2, twineag2, ssv_state, twineag2, ROT270, "Seta",               "Twin Eagle II - The Rescue Mission",                                     GAME_NO_COCKTAIL )
4729GAME( 1994,  twineag2,  0,        twineag2, twineag2, ssv_state, twineag2, ROT270, "Seta",               "Twin Eagle II - The Rescue Mission",                                     GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47274730
4728GAME( 1995,  gdfs,      0,        gdfs,     gdfs,     ssv_state, gdfs,     ROT0,   "Banpresto",          "Mobil Suit Gundam Final Shooting (Japan)",                               GAME_NO_COCKTAIL )
4731GAME( 1995,  gdfs,      0,        gdfs,     gdfs,     ssv_state, gdfs,     ROT0,   "Banpresto",          "Mobil Suit Gundam Final Shooting (Japan)",                               GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47294732
4730GAME( 1995,  ultrax,    0,        ultrax,   ultrax,   ssv_state, ultrax,   ROT270, "Banpresto / Tsuburaya Productions", "Ultra X Weapons / Ultra Keibitai",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) // 95-01-30 13:27:15 on startup
4731GAME( 1995,  ultraxg,   ultrax,   ultrax,   ultrax,   ssv_state, ultrax,   ROT270, "Banpresto / Tsuburaya Productions", "Ultra X Weapons / Ultra Keibitai (GAMEST review build)",  GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) // 95-02-16 15:30:24 on startup (newer, but could have pause functionality due to being a review build so left as clone)
4733GAME( 1995,  ultrax,    0,        ultrax,   ultrax,   ssv_state, ultrax,   ROT270, "Banpresto / Tsuburaya Productions", "Ultra X Weapons / Ultra Keibitai",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 95-01-30 13:27:15 on startup
4734GAME( 1995,  ultraxg,   ultrax,   ultrax,   ultrax,   ssv_state, ultrax,   ROT270, "Banpresto / Tsuburaya Productions", "Ultra X Weapons / Ultra Keibitai (GAMEST review build)",  GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 95-02-16 15:30:24 on startup (newer, but could have pause functionality due to being a review build so left as clone)
47324735
4733GAME( 1996,  janjans1,  0,        janjans1, janjans1, ssv_state, janjans1, ROT0,   "Visco",              "Lovely Pop Mahjong JangJang Shimasho (Japan)",                           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
4736GAME( 1996,  janjans1,  0,        janjans1, janjans1, ssv_state, janjans1, ROT0,   "Visco",              "Lovely Pop Mahjong JangJang Shimasho (Japan)",                           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
47344737
4735GAME( 1996?, meosism,   0,        meosism,  meosism,  ssv_state, meosism,  ROT0,   "Sammy",              "Meosis Magic (Japan)",                                                   GAME_NO_COCKTAIL )
4738GAME( 1996?, meosism,   0,        meosism,  meosism,  ssv_state, meosism,  ROT0,   "Sammy",              "Meosis Magic (Japan)",                                                   GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47364739
4737GAME( 1996,  stmblade,  0,        stmblade, stmblade, ssv_state, stmblade, ROT270, "Visco",              "Storm Blade (US)",                                                       GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
4738GAME( 1996,  stmbladej, stmblade, stmblade, stmblade, ssv_state, stmblade, ROT270, "Visco",              "Storm Blade (Japan)",                                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
4740GAME( 1996,  stmblade,  0,        stmblade, stmblade, ssv_state, stmblade, ROT270, "Visco",              "Storm Blade (US)",                                                       GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
4741GAME( 1996,  stmbladej, stmblade, stmblade, stmblade, ssv_state, stmblade, ROT270, "Visco",              "Storm Blade (Japan)",                                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
47394742
4740GAME( 1997,  hypreac2,  0,        hypreac2, hypreac2, ssv_state, hypreac2, ROT0,   "Sammy",              "Mahjong Hyper Reaction 2 (Japan)",                                       GAME_NO_COCKTAIL )
4743GAME( 1997,  hypreac2,  0,        hypreac2, hypreac2, ssv_state, hypreac2, ROT0,   "Sammy",              "Mahjong Hyper Reaction 2 (Japan)",                                       GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47414744
4742GAME( 1997,  jsk,       0,        jsk,      jsk,      ssv_state, jsk,      ROT0,   "Visco",              "Joryuu Syougi Kyoushitsu (Japan)",                                       GAME_NO_COCKTAIL )
4745GAME( 1997,  jsk,       0,        jsk,      jsk,      ssv_state, jsk,      ROT0,   "Visco",              "Joryuu Syougi Kyoushitsu (Japan)",                                       GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47434746
4744GAME( 1997,  koikois2,  0,        janjans1, koikois2, ssv_state, janjans1, ROT0,   "Visco",              "Koi Koi Shimasho 2 - Super Real Hanafuda (Japan)",                       GAME_NO_COCKTAIL )
4747GAME( 1997,  koikois2,  0,        janjans1, koikois2, ssv_state, janjans1, ROT0,   "Visco",              "Koi Koi Shimasho 2 - Super Real Hanafuda (Japan)",                       GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47454748
4746GAME( 1997,  mslider,   0,        mslider,  mslider,  ssv_state, mslider,  ROT0,   "Visco / Datt Japan", "Monster Slider (Japan)",                                                 GAME_NO_COCKTAIL )
4749GAME( 1997,  mslider,   0,        mslider,  mslider,  ssv_state, mslider,  ROT0,   "Visco / Datt Japan", "Monster Slider (Japan)",                                                 GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47474750
4748GAME( 1997,  srmp7,     0,        srmp7,    srmp7,    ssv_state, srmp7,    ROT0,   "Seta",               "Super Real Mahjong P7 (Japan)",                                          GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
4751GAME( 1997,  srmp7,     0,        srmp7,    srmp7,    ssv_state, srmp7,    ROT0,   "Seta",               "Super Real Mahjong P7 (Japan)",                                          GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
47494752
4750GAME( 1998,  ryorioh,   0,        ryorioh,  ryorioh,  ssv_state, ryorioh,  ROT0,   "Visco",              "Gourmet Battle Quiz Ryohrioh CooKing (Japan)",                           GAME_NO_COCKTAIL )
4753GAME( 1998,  ryorioh,   0,        ryorioh,  ryorioh,  ssv_state, ryorioh,  ROT0,   "Visco",              "Gourmet Battle Quiz Ryohrioh CooKing (Japan)",                           GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47514754
4752GAME( 1998,  sxyreact,  0,        sxyreact, sxyreact, ssv_state, sxyreact, ROT0,   "Sammy",              "Pachinko Sexy Reaction (Japan)",                                         GAME_NO_COCKTAIL )
4755GAME( 1998,  sxyreact,  0,        sxyreact, sxyreact, ssv_state, sxyreact, ROT0,   "Sammy",              "Pachinko Sexy Reaction (Japan)",                                         GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47534756
4754GAME( 1999,  sxyreac2,  0,        sxyreac2, sxyreact, ssv_state, sxyreac2, ROT0,   "Sammy",              "Pachinko Sexy Reaction 2 (Japan)",                                       GAME_NO_COCKTAIL )
4757GAME( 1999,  sxyreac2,  0,        sxyreac2, sxyreact, ssv_state, sxyreac2, ROT0,   "Sammy",              "Pachinko Sexy Reaction 2 (Japan)",                                       GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47554758
4756GAME( 1999,  cairblad,  0,        cairblad, cairblad, ssv_state, cairblad, ROT270, "Sammy",              "Change Air Blade (Japan)",                                               GAME_NO_COCKTAIL )
4759GAME( 1999,  cairblad,  0,        cairblad, cairblad, ssv_state, cairblad, ROT270, "Sammy",              "Change Air Blade (Japan)",                                               GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47574760
4758GAME( 2000,  janjans2,  0,        janjans1, janjans2, ssv_state, janjans1, ROT0,   "Visco",              "Lovely Pop Mahjong JangJang Shimasho 2 (Japan)",                         GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
4761GAME( 2000,  janjans2,  0,        janjans1, janjans2, ssv_state, janjans1, ROT0,   "Visco",              "Lovely Pop Mahjong JangJang Shimasho 2 (Japan)",                         GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
47594762
4760GAME( 2000,  vasara,    0,        vasara,   vasara,   ssv_state, vasara,   ROT270, "Visco",              "Vasara",                                                                 GAME_NO_COCKTAIL )
4763GAME( 2000,  vasara,    0,        vasara,   vasara,   ssv_state, vasara,   ROT270, "Visco",              "Vasara",                                                                 GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
47614764
4762GAME( 2001,  vasara2,   0,        vasara,   vasara2,  ssv_state, vasara,   ROT270, "Visco",              "Vasara 2 (set 1)",                                                       GAME_NO_COCKTAIL )
4763GAME( 2001,  vasara2a,  vasara2,  vasara,   vasara2,  ssv_state, vasara,   ROT270, "Visco",              "Vasara 2 (set 2)",                                                       GAME_NO_COCKTAIL )
4765GAME( 2001,  vasara2,   0,        vasara,   vasara2,  ssv_state, vasara,   ROT270, "Visco",              "Vasara 2 (set 1)",                                                       GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4766GAME( 2001,  vasara2a,  vasara2,  vasara,   vasara2,  ssv_state, vasara,   ROT270, "Visco",              "Vasara 2 (set 2)",                                                       GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/tugboat.c
r244652r244653
1111  but the current implementation is a big kludge, and it still looks wrong.
1212- colors might not be entirely accurate
1313  Suspect berenstn is using the wrong color PROM.
14- convert to use the H46505 device.
1415
1516the problem which caused the controls not to work
1617---
r244652r244653
3940   tugboat_state(const machine_config &mconfig, device_type type, const char *tag)
4041      : driver_device(mconfig, type, tag),
4142      m_maincpu(*this, "maincpu"),
42      m_ram(*this, "ram"),
4343      m_gfxdecode(*this, "gfxdecode"),
4444      m_screen(*this, "screen"),
45      m_palette(*this, "palette") { }
45      m_palette(*this, "palette"),
46      m_ram(*this, "ram") { }
4647
4748   required_device<cpu_device> m_maincpu;
48   required_shared_ptr<UINT8> m_ram;
4949   required_device<gfxdecode_device> m_gfxdecode;
5050   required_device<screen_device> m_screen;
5151   required_device<palette_device> m_palette;
52   
53   required_shared_ptr<UINT8> m_ram;
5254
5355   UINT8 m_hd46505_0_reg[18];
5456   UINT8 m_hd46505_1_reg[18];
5557   int m_reg0;
5658   int m_reg1;
5759   int m_ctrl;
58   DECLARE_WRITE8_MEMBER(tugboat_hd46505_0_w);
59   DECLARE_WRITE8_MEMBER(tugboat_hd46505_1_w);
60   DECLARE_WRITE8_MEMBER(tugboat_score_w);
61   DECLARE_READ8_MEMBER(tugboat_input_r);
62   DECLARE_WRITE8_MEMBER(tugboat_ctrl_w);
60   emu_timer *m_interrupt_timer;
61   
62   DECLARE_WRITE8_MEMBER(hd46505_0_w);
63   DECLARE_WRITE8_MEMBER(hd46505_1_w);
64   DECLARE_WRITE8_MEMBER(score_w);
65   DECLARE_READ8_MEMBER(input_r);
66   DECLARE_WRITE8_MEMBER(ctrl_w);
67   
6368   virtual void machine_start();
6469   virtual void video_start();
6570   virtual void machine_reset();
6671   DECLARE_PALETTE_INIT(tugboat);
67   UINT32 screen_update_tugboat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
72   
73   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6874   void draw_tilemap(bitmap_ind16 &bitmap,const rectangle &cliprect,
6975      int addr,int gfx0,int gfx1,int transparency);
7076
r244652r244653
7581
7682void tugboat_state::machine_start()
7783{
78   /*save_item(NAME(m_hd46505_0_reg));
84   m_interrupt_timer = timer_alloc(TIMER_INTERRUPT);
85   
7986   save_item(NAME(m_hd46505_0_reg));
87   save_item(NAME(m_hd46505_1_reg));
8088   save_item(NAME(m_reg0));
8189   save_item(NAME(m_reg1));
82   save_item(NAME(m_ctrl));*/
90   save_item(NAME(m_ctrl));
8391}
8492
8593void tugboat_state::video_start()
r244652r244653
113121
114122/* see mc6845.c. That file is only a placeholder, I process the writes here
115123   because I need the start_addr register to handle scrolling */
116WRITE8_MEMBER(tugboat_state::tugboat_hd46505_0_w)
124WRITE8_MEMBER(tugboat_state::hd46505_0_w)
117125{
118126   if (offset == 0) m_reg0 = data & 0x0f;
119127   else if (m_reg0 < 18) m_hd46505_0_reg[m_reg0] = data;
120128}
121WRITE8_MEMBER(tugboat_state::tugboat_hd46505_1_w)
129WRITE8_MEMBER(tugboat_state::hd46505_1_w)
122130{
123131   if (offset == 0) m_reg1 = data & 0x0f;
124132   else if (m_reg1 < 18) m_hd46505_1_reg[m_reg1] = data;
125133}
126134
127135
128WRITE8_MEMBER(tugboat_state::tugboat_score_w)
136WRITE8_MEMBER(tugboat_state::score_w)
129137{
130138      if (offset>=0x8) m_ram[0x291d + 32*offset + 32*(1-8)] = data ^ 0x0f;
131139      if (offset<0x8 ) m_ram[0x291d + 32*offset + 32*9] = data ^ 0x0f;
r244652r244653
168176   }
169177}
170178
171UINT32 tugboat_state::screen_update_tugboat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
179UINT32 tugboat_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
172180{
173181   int startaddr0 = m_hd46505_0_reg[0x0c]*256 + m_hd46505_0_reg[0x0d];
174182   int startaddr1 = m_hd46505_1_reg[0x0c]*256 + m_hd46505_1_reg[0x0d];
r244652r244653
181189
182190
183191
184READ8_MEMBER(tugboat_state::tugboat_input_r)
192READ8_MEMBER(tugboat_state::input_r)
185193{
186194   if (~m_ctrl & 0x80)
187195      return ioport("IN0")->read();
r244652r244653
195203      return ioport("IN4")->read();
196204}
197205
198WRITE8_MEMBER(tugboat_state::tugboat_ctrl_w)
206WRITE8_MEMBER(tugboat_state::ctrl_w)
199207{
200208   m_ctrl = data;
201209}
r244652r244653
206214   {
207215   case TIMER_INTERRUPT:
208216      m_maincpu->set_input_line(0, HOLD_LINE);
209      timer_set(m_screen->frame_period(), TIMER_INTERRUPT);
217      m_interrupt_timer->adjust(m_screen->frame_period());
210218      break;
211219   default:
212220      assert_always(FALSE, "Unknown id in tugboat_state::device_timer");
r244652r244653
215223
216224void tugboat_state::machine_reset()
217225{
218   timer_set(m_screen->time_until_pos(0), TIMER_INTERRUPT);
226   m_interrupt_timer->adjust(m_screen->time_until_pos(0));
219227}
220228
221229
r244652r244653
223231   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
224232   AM_RANGE(0x0000, 0x01ff) AM_RAM AM_SHARE("ram")
225233   AM_RANGE(0x1060, 0x1061) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
226   AM_RANGE(0x10a0, 0x10a1) AM_WRITE(tugboat_hd46505_0_w)  /* scrolling is performed changing the start_addr register (0C/0D) */
227   AM_RANGE(0x10c0, 0x10c1) AM_WRITE(tugboat_hd46505_1_w)
234   AM_RANGE(0x10a0, 0x10a1) AM_WRITE(hd46505_0_w)  /* scrolling is performed changing the start_addr register (0C/0D) */
235   AM_RANGE(0x10c0, 0x10c1) AM_WRITE(hd46505_1_w)
228236   AM_RANGE(0x11e4, 0x11e7) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
229237   AM_RANGE(0x11e8, 0x11eb) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
230238   //AM_RANGE(0x1700, 0x1fff) AM_RAM
231   AM_RANGE(0x18e0, 0x18ef) AM_WRITE(tugboat_score_w)
239   AM_RANGE(0x18e0, 0x18ef) AM_WRITE(score_w)
232240   AM_RANGE(0x2000, 0x2fff) AM_RAM /* tilemap RAM */
233241   AM_RANGE(0x4000, 0x7fff) AM_ROM
234242ADDRESS_MAP_END
r244652r244653
352360   MCFG_CPU_VBLANK_INT_DRIVER("screen", tugboat_state,  nmi_line_pulse)
353361
354362   MCFG_DEVICE_ADD("pia0", PIA6821, 0)
355   MCFG_PIA_READPA_HANDLER(READ8(tugboat_state,tugboat_input_r))
363   MCFG_PIA_READPA_HANDLER(READ8(tugboat_state,input_r))
356364
357365   MCFG_DEVICE_ADD("pia1", PIA6821, 0)
358366   MCFG_PIA_READPA_HANDLER(IOPORT("DSW"))
359   MCFG_PIA_WRITEPB_HANDLER(WRITE8(tugboat_state, tugboat_ctrl_w))
367   MCFG_PIA_WRITEPB_HANDLER(WRITE8(tugboat_state, ctrl_w))
360368
361369   MCFG_SCREEN_ADD("screen", RASTER)
362370   MCFG_SCREEN_REFRESH_RATE(60)
363371   MCFG_SCREEN_SIZE(32*8,32*8)
364372   MCFG_SCREEN_VISIBLE_AREA(1*8,31*8-1,2*8,30*8-1)
365   MCFG_SCREEN_UPDATE_DRIVER(tugboat_state, screen_update_tugboat)
373   MCFG_SCREEN_UPDATE_DRIVER(tugboat_state, screen_update)
366374   MCFG_SCREEN_PALETTE("palette")
367375
368376   MCFG_GFXDECODE_ADD("gfxdecode", "palette", tugboat)
r244652r244653
460468ROM_END
461469
462470
463GAME( 1982, tugboat,  0, tugboat, tugboat, driver_device,  0, ROT90, "Enter-Tech, Ltd.", "Tugboat",    GAME_IMPERFECT_GRAPHICS )
464GAME( 1983, noahsark, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "Noah's Ark", GAME_IMPERFECT_GRAPHICS )
465GAME( 1984, berenstn, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "The Berenstain Bears in Big Paw's Cave", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS )
471GAME( 1982, tugboat,  0, tugboat, tugboat, driver_device,  0, ROT90, "Enter-Tech, Ltd.", "Tugboat",    GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
472GAME( 1983, noahsark, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "Noah's Ark", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
473GAME( 1984, berenstn, 0, tugboat, noahsark, driver_device, 0, ROT90, "Enter-Tech, Ltd.", "The Berenstain Bears in Big Paw's Cave", GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/argus.h
r244652r244653
33public:
44   argus_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu"),
7      m_audiocpu(*this, "audiocpu"),
8      m_gfxdecode(*this, "gfxdecode"),
9      m_screen(*this, "screen"),
10      m_palette(*this, "palette"),
611      m_bg0_scrollx(*this, "bg0_scrollx"),
712      m_bg0_scrolly(*this, "bg0_scrolly"),
813      m_bg1_scrollx(*this, "bg1_scrollx"),
r244652r244653
1116      m_txram(*this, "txram"),
1217      m_bg1ram(*this, "bg1ram"),
1318      m_spriteram(*this, "spriteram"),
14      m_butasan_bg1ram(*this, "butasan_bg1ram"),
15      m_maincpu(*this, "maincpu"),
16      m_audiocpu(*this, "audiocpu"),
17      m_gfxdecode(*this, "gfxdecode"),
18      m_screen(*this, "screen"),
19      m_palette(*this, "palette")  { }
19      m_butasan_bg1ram(*this, "butasan_bg1ram")  { }
2020
21   required_device<cpu_device> m_maincpu;
22   required_device<cpu_device> m_audiocpu;
23   required_device<gfxdecode_device> m_gfxdecode;
24   required_device<screen_device> m_screen;
25   required_device<palette_device> m_palette;
26
2127   optional_shared_ptr<UINT8> m_bg0_scrollx;
2228   optional_shared_ptr<UINT8> m_bg0_scrolly;
2329   required_shared_ptr<UINT8> m_bg1_scrollx;
r244652r244653
2834   required_shared_ptr<UINT8> m_spriteram;
2935   optional_shared_ptr<UINT8> m_butasan_bg1ram;
3036
37   // common
38   UINT8 m_bg_status;
39   UINT8 m_flipscreen;
40   UINT16 m_palette_intensity;
41   
42   // argus specific
3143   UINT8 *m_dummy_bg0ram;
44   int m_lowbitscroll;
45   int m_prvscrollx;
46   
47   // butasan specific
3248   UINT8 *m_butasan_txram;
3349   UINT8 *m_butasan_bg0ram;
3450   UINT8 *m_butasan_bg0backram;
3551   UINT8 *m_butasan_txbackram;
3652   UINT8 *m_butasan_pagedram[2];
3753   UINT8 m_butasan_page_latch;
38   tilemap_t *m_tx_tilemap;
39   tilemap_t *m_bg0_tilemap;
40   tilemap_t *m_bg1_tilemap;
41   UINT8 m_bg_status;
4254   UINT8 m_butasan_bg1_status;
43   UINT8 m_flipscreen;
44   UINT16 m_palette_intensity;
45   int m_lowbitscroll;
46   int m_prvscrollx;
55   UINT8 m_butasan_unknown;
56   
57   // valtric specific
4758   UINT8 m_valtric_mosaic;
4859   bitmap_rgb32 m_mosaicbitmap;
4960   UINT8 m_valtric_unknown;
50   UINT8 m_butasan_unknown;
5161   int m_mosaic;
52   DECLARE_WRITE8_MEMBER(argus_bankselect_w);
62   
63   tilemap_t *m_tx_tilemap;
64   tilemap_t *m_bg0_tilemap;
65   tilemap_t *m_bg1_tilemap;
66   
67   // common
68   DECLARE_WRITE8_MEMBER(bankselect_w);
5369   DECLARE_WRITE8_MEMBER(valtric_mosaic_w);
54   DECLARE_READ8_MEMBER(argus_txram_r);
55   DECLARE_WRITE8_MEMBER(argus_txram_w);
56   DECLARE_READ8_MEMBER(argus_bg1ram_r);
57   DECLARE_WRITE8_MEMBER(argus_bg1ram_w);
70   DECLARE_WRITE8_MEMBER(txram_w);
71   DECLARE_WRITE8_MEMBER(bg1ram_w);
72   DECLARE_WRITE8_MEMBER(flipscreen_w);
73
74   // argus specific
5875   DECLARE_WRITE8_MEMBER(argus_bg_status_w);
59   DECLARE_WRITE8_MEMBER(valtric_bg_status_w);
76   DECLARE_WRITE8_MEMBER(argus_paletteram_w);
77
78   // butasan specific
6079   DECLARE_WRITE8_MEMBER(butasan_bg0_status_w);
6180   DECLARE_WRITE8_MEMBER(butasan_bg1_status_w);
62   DECLARE_WRITE8_MEMBER(argus_flipscreen_w);
63   DECLARE_READ8_MEMBER(argus_paletteram_r);
64   DECLARE_WRITE8_MEMBER(argus_paletteram_w);
65   DECLARE_WRITE8_MEMBER(valtric_paletteram_w);
6681   DECLARE_WRITE8_MEMBER(butasan_paletteram_w);
6782   DECLARE_READ8_MEMBER(butasan_bg1ram_r);
6883   DECLARE_WRITE8_MEMBER(butasan_bg1ram_w);
6984   DECLARE_WRITE8_MEMBER(butasan_pageselect_w);
7085   DECLARE_READ8_MEMBER(butasan_pagedram_r);
7186   DECLARE_WRITE8_MEMBER(butasan_pagedram_w);
87   DECLARE_WRITE8_MEMBER(butasan_unknown_w);
88
89   // valtric specific
90   DECLARE_WRITE8_MEMBER(valtric_bg_status_w);
91   DECLARE_WRITE8_MEMBER(valtric_paletteram_w);
7292   DECLARE_WRITE8_MEMBER(valtric_unknown_w);
73   DECLARE_WRITE8_MEMBER(butasan_unknown_w);
93   
7494   TILE_GET_INFO_MEMBER(argus_get_tx_tile_info);
7595   TILE_GET_INFO_MEMBER(argus_get_bg0_tile_info);
7696   TILE_GET_INFO_MEMBER(argus_get_bg1_tile_info);
r244652r244653
7999   TILE_GET_INFO_MEMBER(butasan_get_tx_tile_info);
80100   TILE_GET_INFO_MEMBER(butasan_get_bg0_tile_info);
81101   TILE_GET_INFO_MEMBER(butasan_get_bg1_tile_info);
102   
103   virtual void machine_start();
82104   DECLARE_VIDEO_START(argus);
83105   DECLARE_VIDEO_RESET(argus);
84106   DECLARE_VIDEO_START(valtric);
85107   DECLARE_VIDEO_RESET(valtric);
86108   DECLARE_VIDEO_START(butasan);
87109   DECLARE_VIDEO_RESET(butasan);
110   
88111   UINT32 screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
89112   UINT32 screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
90113   UINT32 screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
91   TIMER_DEVICE_CALLBACK_MEMBER(argus_scanline);
114   
115   TIMER_DEVICE_CALLBACK_MEMBER(scanline);
92116   TIMER_DEVICE_CALLBACK_MEMBER(butasan_scanline);
117   
93118   void reset_common();
94   void argus_write_dummy_rams(int dramoffs, int vromoffs);
95   void argus_change_palette(int color, int lo_offs, int hi_offs);
96   void argus_change_bg_palette(int color, int lo_offs, int hi_offs);
119   void change_palette(int color, int lo_offs, int hi_offs);
120   void change_bg_palette(int color, int lo_offs, int hi_offs);
97121   void bg_setting();
122   
123   // argus specific
98124   void argus_bg0_scroll_handle();
125   void argus_write_dummy_rams(int dramoffs, int vromoffs);
99126   void argus_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority);
127   
128   // butasan specific
129   void butasan_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
130   void butasan_log_vram();
131   
132   // valtric specific
100133   void valtric_draw_mosaic(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
101134   void valtric_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
102   void butasan_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
103   void butasan_log_vram();
104   DECLARE_WRITE_LINE_MEMBER(irqhandler);
105   required_device<cpu_device> m_maincpu;
106   required_device<cpu_device> m_audiocpu;
107   required_device<gfxdecode_device> m_gfxdecode;
108   required_device<screen_device> m_screen;
109   required_device<palette_device> m_palette;
110135};
trunk/src/mame/includes/capbowl.h
r244652r244653
1212public:
1313   enum
1414   {
15      TIMER_CAPBOWL_UPDATE
15      TIMER_UPDATE
1616   };
1717
1818   capbowl_state(const machine_config &mconfig, device_type type, const char *tag)
1919      : driver_device(mconfig, type, tag),
20      m_rowaddress(*this, "rowaddress"),
2120      m_maincpu(*this, "maincpu"),
2221      m_audiocpu(*this, "audiocpu"),
2322      m_tms34061(*this, "tms34061"),
24      m_screen(*this, "screen") { }
23      m_screen(*this, "screen"),
24      m_rowaddress(*this, "rowaddress") { }
2525
26   /* devices */
27   required_device<cpu_device> m_maincpu;
28   required_device<cpu_device> m_audiocpu;
29   required_device<tms34061_device> m_tms34061;
30   required_device<screen_device> m_screen;
31
2632   /* memory pointers */
2733   required_shared_ptr<UINT8> m_rowaddress;
2834
r244652r244653
3137
3238   /* input-related */
3339   UINT8 m_last_trackball_val[2];
40   
41   emu_timer *m_update_timer;
3442
35   /* devices */
36   required_device<cpu_device> m_maincpu;
37   required_device<cpu_device> m_audiocpu;
38   required_device<tms34061_device> m_tms34061;
39   required_device<screen_device> m_screen;
40
41   DECLARE_WRITE8_MEMBER(capbowl_rom_select_w);
43   // common
4244   DECLARE_READ8_MEMBER(track_0_r);
4345   DECLARE_READ8_MEMBER(track_1_r);
4446   DECLARE_WRITE8_MEMBER(track_reset_w);
45   DECLARE_WRITE8_MEMBER(capbowl_sndcmd_w);
46   DECLARE_WRITE8_MEMBER(capbowl_tms34061_w);
47   DECLARE_READ8_MEMBER(capbowl_tms34061_r);
47   DECLARE_WRITE8_MEMBER(sndcmd_w);
48   DECLARE_WRITE8_MEMBER(tms34061_w);
49   DECLARE_READ8_MEMBER(tms34061_r);
50   
51   // capbowl specific
52   DECLARE_WRITE8_MEMBER(capbowl_rom_select_w);
53   
54   // bowlrama specific
4855   DECLARE_WRITE8_MEMBER(bowlrama_blitter_w);
4956   DECLARE_READ8_MEMBER(bowlrama_blitter_r);
57   
5058   DECLARE_DRIVER_INIT(capbowl);
5159   virtual void machine_start();
5260   virtual void machine_reset();
53   UINT32 screen_update_capbowl(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
54   INTERRUPT_GEN_MEMBER(capbowl_interrupt);
55   TIMER_CALLBACK_MEMBER(capbowl_update);
61   
62   INTERRUPT_GEN_MEMBER(interrupt);
63   TIMER_CALLBACK_MEMBER(update);
64   
65   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5666   inline rgb_t pen_for_pixel( UINT8 *src, UINT8 pix );
57   DECLARE_WRITE_LINE_MEMBER(firqhandler);
58   DECLARE_WRITE_LINE_MEMBER(generate_tms34061_interrupt);
5967
6068protected:
6169   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/fgoal.h
r244652r244653
1010
1111   fgoal_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
13      m_video_ram(*this, "video_ram"),
1413      m_maincpu(*this, "maincpu"),
1514      m_mb14241(*this, "mb14241"),
1615      m_gfxdecode(*this, "gfxdecode"),
1716      m_screen(*this, "screen"),
18      m_palette(*this, "palette")
19      { }
17      m_palette(*this, "palette"),
18      m_video_ram(*this, "video_ram")   { }
2019
20   /* devices */
21   required_device<cpu_device> m_maincpu;
22   required_device<mb14241_device> m_mb14241;
23   required_device<gfxdecode_device> m_gfxdecode;
24   required_device<screen_device> m_screen;
25   required_device<palette_device> m_palette;
26
2127   /* memory pointers */
2228   required_shared_ptr<UINT8> m_video_ram;
2329
r244652r244653
2935   int        m_current_color;
3036
3137   /* misc */
32   int        m_fgoal_player;
38   int        m_player;
3339   UINT8      m_row;
3440   UINT8      m_col;
3541   int        m_prev_coin;
42   emu_timer  *m_interrupt_timer;
3643
37   /* devices */
38   required_device<cpu_device> m_maincpu;
39   required_device<mb14241_device> m_mb14241;
40   required_device<gfxdecode_device> m_gfxdecode;
41   required_device<screen_device> m_screen;
42   required_device<palette_device> m_palette;
44   DECLARE_READ8_MEMBER(analog_r);
45   DECLARE_READ8_MEMBER(nmi_reset_r);
46   DECLARE_READ8_MEMBER(irq_reset_r);
47   DECLARE_READ8_MEMBER(row_r);
48   DECLARE_WRITE8_MEMBER(row_w);
49   DECLARE_WRITE8_MEMBER(col_w);
50   DECLARE_READ8_MEMBER(address_hi_r);
51   DECLARE_READ8_MEMBER(address_lo_r);
52   DECLARE_READ8_MEMBER(shifter_r);
53   DECLARE_READ8_MEMBER(shifter_reverse_r);
54   DECLARE_WRITE8_MEMBER(sound1_w);
55   DECLARE_WRITE8_MEMBER(sound2_w);
56   DECLARE_WRITE8_MEMBER(color_w);
57   DECLARE_WRITE8_MEMBER(ypos_w);
58   DECLARE_WRITE8_MEMBER(xpos_w);
4359
44   DECLARE_READ8_MEMBER(fgoal_analog_r);
45   DECLARE_READ8_MEMBER(fgoal_nmi_reset_r);
46   DECLARE_READ8_MEMBER(fgoal_irq_reset_r);
47   DECLARE_READ8_MEMBER(fgoal_row_r);
48   DECLARE_WRITE8_MEMBER(fgoal_row_w);
49   DECLARE_WRITE8_MEMBER(fgoal_col_w);
50   DECLARE_READ8_MEMBER(fgoal_address_hi_r);
51   DECLARE_READ8_MEMBER(fgoal_address_lo_r);
52   DECLARE_READ8_MEMBER(fgoal_shifter_r);
53   DECLARE_READ8_MEMBER(fgoal_shifter_reverse_r);
54   DECLARE_WRITE8_MEMBER(fgoal_sound1_w);
55   DECLARE_WRITE8_MEMBER(fgoal_sound2_w);
56   DECLARE_WRITE8_MEMBER(fgoal_color_w);
57   DECLARE_WRITE8_MEMBER(fgoal_ypos_w);
58   DECLARE_WRITE8_MEMBER(fgoal_xpos_w);
59   DECLARE_CUSTOM_INPUT_MEMBER(fgoal_80_r);
60   DECLARE_CUSTOM_INPUT_MEMBER(_80_r);
61   
62   TIMER_CALLBACK_MEMBER(interrupt_callback);
63
6064   virtual void machine_start();
6165   virtual void machine_reset();
6266   virtual void video_start();
6367   DECLARE_PALETTE_INIT(fgoal);
64   UINT32 screen_update_fgoal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
65   TIMER_CALLBACK_MEMBER(interrupt_callback);
68
69   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6670   int intensity(int bits);
67   unsigned video_ram_address( );
71   unsigned video_ram_address( );
6872
6973protected:
7074   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/ssv.h
r244652r244653
5252   optional_shared_ptr<UINT16> m_input_sel;
5353
5454   int m_tile_code[16];
55
5655   int m_enable_video;
5756   int m_shadow_pen_mask;
5857   int m_shadow_pen_shift;
59
6058   UINT8 m_requested_int;
6159   UINT16 m_irq_enable;
62
6360   UINT16 *m_eaglshot_gfxram;
64
6561   tilemap_t *m_gdfs_tmap;
66
6762   int m_interrupt_ultrax;
68
6963   int m_gdfs_lightgun_select;
70
7164   UINT16 m_sxyreact_serial;
7265   int m_sxyreact_dial;
7366   UINT16 m_gdfs_eeprom_old;
74
7567   UINT32 m_latches[8];
76
7768   UINT8 m_trackball_select;
78   DECLARE_WRITE16_MEMBER(ssv_irq_ack_w);
79   DECLARE_WRITE16_MEMBER(ssv_irq_enable_w);
80   DECLARE_WRITE16_MEMBER(ssv_lockout_w);
81   DECLARE_WRITE16_MEMBER(ssv_lockout_inv_w);
69
70   DECLARE_WRITE16_MEMBER(irq_ack_w);
71   DECLARE_WRITE16_MEMBER(irq_enable_w);
72   DECLARE_WRITE16_MEMBER(lockout_w);
73   DECLARE_WRITE16_MEMBER(lockout_inv_w);
8274   DECLARE_READ16_MEMBER(dsp_dr_r);
8375   DECLARE_WRITE16_MEMBER(dsp_dr_w);
8476   DECLARE_READ16_MEMBER(dsp_r);
r244652r244653
9082   DECLARE_READ16_MEMBER(gdfs_blitram_r);
9183   DECLARE_WRITE16_MEMBER(gdfs_blitram_w);
9284   DECLARE_READ16_MEMBER(hypreact_input_r);
93   DECLARE_READ16_MEMBER(ssv_mainram_r);
94   DECLARE_WRITE16_MEMBER(ssv_mainram_w);
85   DECLARE_READ16_MEMBER(mainram_r);
86   DECLARE_WRITE16_MEMBER(mainram_w);
9587   DECLARE_READ16_MEMBER(srmp4_input_r);
9688   DECLARE_READ16_MEMBER(srmp7_irqv_r);
9789   DECLARE_WRITE16_MEMBER(srmp7_sound_bank_w);
r244652r244653
110102   DECLARE_READ16_MEMBER(eaglshot_gfxram_r);
111103   DECLARE_WRITE16_MEMBER(eaglshot_gfxram_w);
112104   DECLARE_WRITE16_MEMBER(gdfs_tmapram_w);
113   DECLARE_READ16_MEMBER(ssv_vblank_r);
114   DECLARE_WRITE16_MEMBER(ssv_scroll_w);
105   DECLARE_READ16_MEMBER(vblank_r);
106   DECLARE_WRITE16_MEMBER(scroll_w);
115107   DECLARE_READ16_MEMBER(gdfs_eeprom_r);
116108   DECLARE_WRITE16_MEMBER(gdfs_eeprom_w);
109   
110   TILE_GET_INFO_MEMBER(get_tile_info_0);
111   
117112   DECLARE_DRIVER_INIT(gdfs);
118113   DECLARE_DRIVER_INIT(sxyreac2);
119114   DECLARE_DRIVER_INIT(hypreac2);
r244652r244653
136131   DECLARE_DRIVER_INIT(jsk);
137132   DECLARE_DRIVER_INIT(twineag2);
138133   DECLARE_DRIVER_INIT(mslider);
139   TILE_GET_INFO_MEMBER(get_tile_info_0);
140134   virtual void machine_reset();
141135   virtual void video_start();
142136   DECLARE_VIDEO_START(gdfs);
143137   DECLARE_VIDEO_START(eaglshot);
144   UINT32 screen_update_ssv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
138   
139   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
145140   UINT32 screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
146141   UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
147   TIMER_DEVICE_CALLBACK_MEMBER(ssv_interrupt);
142   
143   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
148144   TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt);
149145   void update_irq_state();
150   IRQ_CALLBACK_MEMBER(ssv_irq_callback);
151   void ssv_drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx,UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,int shadow);
146   IRQ_CALLBACK_MEMBER(irq_callback);
147   
148   void drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx,UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,int shadow);
152149   void draw_row(bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int sy, int scroll);
153150   void draw_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, int  nr);
154151   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
155   void ssv_enable_video(int enable);
156   void init_ssv(int interrupt_ultrax);
152   void enable_video(int enable);
153   void init(int interrupt_ultrax);
157154   void init_hypreac2_common();
158155   void init_eaglshot_banking();
159156   void init_st010();
trunk/src/mame/video/argus.c
r244652r244653
8989-----------------------------------------------------------------------------
9090 +0
9191 ---- ---x  = BG enable bit
92 ---- --x-  = gray scale effect or tile bank select.
92 ---- --x-  = grey scale effect or tile bank select.
9393
9494
9595Flip screen controller
r244652r244653
109109(*) Things which are not emulated.
110110 - Color $000 - 00f, $01e, $02e ... are half transparent color.
111111 - Sprite priority bit may be present in Butasan. But I don't know
112   what is happened when it is set.
112   what happens when it is set.
113113
114114***************************************************************************/
115115
r244652r244653
272272   m_dummy_bg0ram = auto_alloc_array(machine(), UINT8, 0x800);
273273
274274   jal_blend_init(machine(), 1);
275   
276   save_item(NAME(m_bg_status));
277   save_item(NAME(m_flipscreen));
278   save_item(NAME(m_palette_intensity));
279   save_pointer(NAME(m_dummy_bg0ram), 0x800);
280   save_item(NAME(m_lowbitscroll));
281   save_item(NAME(m_prvscrollx));
275282}
276283
277284VIDEO_RESET_MEMBER(argus_state,argus)
r244652r244653
295302   m_screen->register_screen_bitmap(m_mosaicbitmap);
296303
297304   jal_blend_init(machine(), 1);
305   
306   save_item(NAME(m_bg_status));
307   save_item(NAME(m_flipscreen));
308   save_item(NAME(m_palette_intensity));
309   save_item(NAME(m_valtric_mosaic));
310   save_item(NAME(m_valtric_unknown));
311   save_item(NAME(m_mosaic));
298312}
299313
300314VIDEO_RESET_MEMBER(argus_state,valtric)
r244652r244653
322336   m_butasan_txbackram  = &m_butasan_pagedram[1][0x800];
323337
324338   jal_blend_init(machine(), 1);
339   
340   save_item(NAME(m_bg_status));
341   save_item(NAME(m_flipscreen));
342   save_item(NAME(m_palette_intensity));
343   save_pointer(NAME(m_butasan_pagedram[0]), 0x1000);
344   save_pointer(NAME(m_butasan_pagedram[1]), 0x1000);
345   save_item(NAME(m_butasan_page_latch));
346   save_item(NAME(m_butasan_bg1_status));
347   save_item(NAME(m_butasan_unknown));
325348}
326349
327350VIDEO_RESET_MEMBER(argus_state,butasan)
r244652r244653
363386   }
364387}
365388
366void argus_state::argus_change_palette(int color, int lo_offs, int hi_offs)
389void argus_state::change_palette(int color, int lo_offs, int hi_offs)
367390{
368391   UINT8 lo = m_paletteram[lo_offs];
369392   UINT8 hi = m_paletteram[hi_offs];
r244652r244653
371394   m_palette->set_pen_color(color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
372395}
373396
374void argus_state::argus_change_bg_palette(int color, int lo_offs, int hi_offs)
397void argus_state::change_bg_palette(int color, int lo_offs, int hi_offs)
375398{
376399   UINT8 r,g,b,lo,hi,ir,ig,ib,ix;
377400   rgb_t rgb,irgb;
r244652r244653
418441   m_valtric_mosaic = data;
419442}
420443
421READ8_MEMBER(argus_state::argus_txram_r)
444WRITE8_MEMBER(argus_state::txram_w)
422445{
423   return m_txram[offset];
424}
425
426WRITE8_MEMBER(argus_state::argus_txram_w)
427{
428446   m_txram[offset] = data;
429447   m_tx_tilemap->mark_tile_dirty(offset >> 1);
430448}
431449
432READ8_MEMBER(argus_state::argus_bg1ram_r)
450WRITE8_MEMBER(argus_state::bg1ram_w)
433451{
434   return m_bg1ram[offset];
435}
436
437WRITE8_MEMBER(argus_state::argus_bg1ram_w)
438{
439452   m_bg1ram[offset] = data;
440453   m_bg1_tilemap->mark_tile_dirty(offset >> 1);
441454}
r244652r244653
453466
454467         for (offs = 0x400; offs < 0x500; offs++)
455468         {
456            argus_change_bg_palette((offs - 0x400) + 0x080, offs, offs + 0x400);
469            change_bg_palette((offs - 0x400) + 0x080, offs, offs + 0x400);
457470         }
458471      }
459472   }
r244652r244653
472485
473486         for (offs = 0x400; offs < 0x600; offs += 2)
474487         {
475            argus_change_bg_palette(((offs - 0x400) >> 1) + 0x100, offs & ~1, offs | 1);
488            change_bg_palette(((offs - 0x400) >> 1) + 0x100, offs & ~1, offs | 1);
476489         }
477490      }
478491   }
r244652r244653
494507   }
495508}
496509
497WRITE8_MEMBER(argus_state::argus_flipscreen_w)
510WRITE8_MEMBER(argus_state::flipscreen_w)
498511{
499512   m_flipscreen = data & 0x80;
500513}
501514
502READ8_MEMBER(argus_state::argus_paletteram_r)
503{
504   return m_paletteram[offset];
505}
506
507515WRITE8_MEMBER(argus_state::argus_paletteram_w)
508516{
509517   int offs;
r244652r244653
514522   {
515523      offset &= 0x07f;
516524
517      argus_change_palette(offset, offset, offset + 0x080);
525      change_palette(offset, offset, offset + 0x080);
518526
519527      if (offset == 0x07f || offset == 0x0ff)
520528      {
521529         m_palette_intensity = m_paletteram[0x0ff] | (m_paletteram[0x07f] << 8);
522530
523531         for (offs = 0x400; offs < 0x500; offs++)
524            argus_change_bg_palette((offs & 0xff) + 0x080, offs, offs + 0x400);
532            change_bg_palette((offs & 0xff) + 0x080, offs, offs + 0x400);
525533      }
526534   }
527535   else if ((offset >= 0x400 && offset <= 0x4ff) ||
r244652r244653
530538      offs = offset & 0xff;
531539      offset = offs | 0x400;
532540
533      argus_change_bg_palette(offs + 0x080, offset, offset + 0x400);
541      change_bg_palette(offs + 0x080, offset, offset + 0x400);
534542   }
535543   else if ((offset >= 0x500 && offset <= 0x5ff) ||
536544            (offset >= 0x900 && offset <= 0x9ff))       /* BG1 color */
r244652r244653
538546      offs = offset & 0xff;
539547      offset = offs | 0x500;
540548
541      argus_change_palette(offs + 0x180, offset, offset + 0x400);
549      change_palette(offs + 0x180, offset, offset + 0x400);
542550   }
543551   else if ((offset >= 0x700 && offset <= 0x7ff) ||
544552            (offset >= 0xb00 && offset <= 0xbff))       /* text color */
r244652r244653
546554      offs = offset & 0xff;
547555      offset = offs | 0x700;
548556
549      argus_change_palette(offs + 0x280, offset, offset + 0x400);
557      change_palette(offs + 0x280, offset, offset + 0x400);
550558   }
551559}
552560
r244652r244653
556564
557565   if (offset <= 0x1ff)                            /* Sprite color */
558566   {
559      argus_change_palette(offset >> 1, offset & ~1, offset | 1);
567      change_palette(offset >> 1, offset & ~1, offset | 1);
560568
561569      if (offset == 0x1fe || offset == 0x1ff)
562570      {
r244652r244653
565573         m_palette_intensity = m_paletteram[0x1ff] | (m_paletteram[0x1fe] << 8);
566574
567575         for (offs = 0x400; offs < 0x600; offs += 2)
568            argus_change_bg_palette(((offs & 0x1ff) >> 1) + 0x100, offs & ~1, offs | 1);
576            change_bg_palette(((offs & 0x1ff) >> 1) + 0x100, offs & ~1, offs | 1);
569577      }
570578   }
571579   else if (offset >= 0x400 && offset <= 0x5ff)        /* BG color */
572580   {
573      argus_change_bg_palette(((offset & 0x1ff) >> 1) + 0x100, offset & ~1, offset | 1);
581      change_bg_palette(((offset & 0x1ff) >> 1) + 0x100, offset & ~1, offset | 1);
574582   }
575583   else if (offset >= 0x600 && offset <= 0x7ff)        /* Text color */
576584   {
577      argus_change_palette(((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
585      change_palette(((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
578586   }
579587}
580588
r244652r244653
584592
585593   if (offset <= 0x1ff)                            /* BG0 color */
586594   {
587      argus_change_palette((offset >> 1) + 0x100, offset & ~1, offset | 1);
595      change_palette((offset >> 1) + 0x100, offset & ~1, offset | 1);
588596   }
589597   else if (offset <= 0x23f)                       /* BG1 color */
590598   {
591      argus_change_palette(((offset & 0x3f) >> 1) + 0x0c0, offset & ~1, offset | 1);
599      change_palette(((offset & 0x3f) >> 1) + 0x0c0, offset & ~1, offset | 1);
592600   }
593601   else if (offset >= 0x400 && offset <= 0x47f)    /* Sprite color */
594602   {                                               /* 16 colors */
595      argus_change_palette((offset & 0x7f) >> 1, offset & ~1, offset | 1);
603      change_palette((offset & 0x7f) >> 1, offset & ~1, offset | 1);
596604   }
597605   else if (offset >= 0x480 && offset <= 0x4ff)    /* Sprite color */
598606   {                                               /* 8  colors */
599607      int offs = (offset & 0x070) | ((offset & 0x00f) >> 1);
600608
601      argus_change_palette(offs + 0x040, offset & ~1, offset | 1);
602      argus_change_palette(offs + 0x048, offset & ~1, offset | 1);
609      change_palette(offs + 0x040, offset & ~1, offset | 1);
610      change_palette(offs + 0x048, offset & ~1, offset | 1);
603611   }
604612   else if (offset >= 0x600 && offset <= 0x7ff)    /* Text color */
605613   {
606      argus_change_palette(((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
614      change_palette(((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
607615   }
608616   else if (offset >= 0x240 && offset <= 0x25f)    // dummy
609      argus_change_palette(((offset & 0x1f) >> 1) + 0xe0, offset & ~1, offset | 1);
617      change_palette(((offset & 0x1f) >> 1) + 0xe0, offset & ~1, offset | 1);
610618   else if (offset >= 0x500 && offset <= 0x51f)    // dummy
611      argus_change_palette(((offset & 0x1f) >> 1) + 0xf0, offset & ~1, offset | 1);
619      change_palette(((offset & 0x1f) >> 1) + 0xf0, offset & ~1, offset | 1);
612620}
613621
614READ8_MEMBER(argus_state::butasan_bg1ram_r)
615{
616   return m_butasan_bg1ram[offset];
617}
618
619622WRITE8_MEMBER(argus_state::butasan_bg1ram_w)
620623{
621624   int idx;
r244652r244653
804807
805808void argus_state::argus_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority)
806809{
807   UINT8 *spriteram = m_spriteram;
808   int offs;
809
810810   /* Draw the sprites */
811   for (offs = 0; offs < m_spriteram.bytes(); offs += 16)
811   for (int offs = 0; offs < m_spriteram.bytes(); offs += 16)
812812   {
813      if (!(spriteram[offs+15] == 0 && spriteram[offs+11] == 0xf0))
813      if (!(m_spriteram[offs+15] == 0 && m_spriteram[offs+11] == 0xf0))
814814      {
815815         int sx, sy, tile, flipx, flipy, color, pri;
816816
817         sx = spriteram[offs+12]; if (spriteram[offs+13] & 0x01) sx -= 256;
818         sy = spriteram[offs+11]; if (!(spriteram[offs+13] & 0x02)) sy -= 256;
817         sx = m_spriteram[offs+12]; if (m_spriteram[offs+13] & 0x01) sx -= 256;
818         sy = m_spriteram[offs+11]; if (!(m_spriteram[offs+13] & 0x02)) sy -= 256;
819819
820         tile  = spriteram[offs+14] | ((spriteram[offs+13] & 0xc0) << 2);
821         flipx = spriteram[offs+13] & 0x10;
822         flipy = spriteram[offs+13] & 0x20;
823         color = spriteram[offs+15] & 0x07;
824         pri   = (spriteram[offs+15] & 0x08) >> 3;
820         tile  = m_spriteram[offs+14] | ((m_spriteram[offs+13] & 0xc0) << 2);
821         flipx = m_spriteram[offs+13] & 0x10;
822         flipy = m_spriteram[offs+13] & 0x20;
823         color = m_spriteram[offs+15] & 0x07;
824         pri   = (m_spriteram[offs+15] & 0x08) >> 3;
825825
826826         if (m_flipscreen)
827827         {
r244652r244653
933933
934934void argus_state::valtric_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
935935{
936   UINT8 *spriteram = m_spriteram;
937   int offs;
938
939936   /* Draw the sprites */
940   for (offs = 0; offs < m_spriteram.bytes(); offs += 16)
937   for (int offs = 0; offs < m_spriteram.bytes(); offs += 16)
941938   {
942      if (!(spriteram[offs+15] == 0 && spriteram[offs+11] == 0xf0))
939      if (!(m_spriteram[offs+15] == 0 && m_spriteram[offs+11] == 0xf0))
943940      {
944941         int sx, sy, tile, flipx, flipy, color;
945942
946         sx = spriteram[offs+12]; if (spriteram[offs+13] & 0x01) sx -= 256;
947         sy = spriteram[offs+11]; if (!(spriteram[offs+13] & 0x02)) sy -= 256;
943         sx = m_spriteram[offs+12]; if (m_spriteram[offs+13] & 0x01) sx -= 256;
944         sy = m_spriteram[offs+11]; if (!(m_spriteram[offs+13] & 0x02)) sy -= 256;
948945
949         tile  = spriteram[offs+14] | ((spriteram[offs+13] & 0xc0) << 2);
950         flipx = spriteram[offs+13] & 0x10;
951         flipy = spriteram[offs+13] & 0x20;
952         color = spriteram[offs+15] & 0x0f;
946         tile  = m_spriteram[offs+14] | ((m_spriteram[offs+13] & 0xc0) << 2);
947         flipx = m_spriteram[offs+13] & 0x10;
948         flipy = m_spriteram[offs+13] & 0x20;
949         color = m_spriteram[offs+15] & 0x0f;
953950
954951         if (m_flipscreen)
955952         {
r244652r244653
972969
973970void argus_state::butasan_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
974971{
975   UINT8 *spriteram = m_spriteram;
976   int offs;
977
978972   /* Draw the sprites */
979   for (offs = 0; offs < m_spriteram.bytes(); offs += 16)
973   for (int offs = 0; offs < m_spriteram.bytes(); offs += 16)
980974   {
981975      int sx, sy, tile, flipx, flipy, color;
982976      int fx, fy;
983977
984      tile  = spriteram[offs+14] | ((spriteram[offs+15] & 0x0f) << 8);
985      flipx = spriteram[offs+8] & 0x01;
986      flipy = spriteram[offs+8] & 0x04;
987      color = spriteram[offs+9] & 0x0f;
978      tile  = m_spriteram[offs+14] | ((m_spriteram[offs+15] & 0x0f) << 8);
979      flipx = m_spriteram[offs+8] & 0x01;
980      flipy = m_spriteram[offs+8] & 0x04;
981      color = m_spriteram[offs+9] & 0x0f;
988982
989      sx = spriteram[offs+10];
990      sy = spriteram[offs+12];
983      sx = m_spriteram[offs+10];
984      sy = m_spriteram[offs+12];
991985
992      if (spriteram[offs+11] & 0x01) sx-=256;
993      if (spriteram[offs+13] & 0x01) sy-=256;
986      if (m_spriteram[offs+11] & 0x01) sx-=256;
987      if (m_spriteram[offs+13] & 0x01) sy-=256;
994988
995989      sy = 240 - sy;
996990
trunk/src/mame/video/capbowl.c
r244652r244653
1515 *
1616 *************************************/
1717
18WRITE8_MEMBER(capbowl_state::capbowl_tms34061_w)
18WRITE8_MEMBER(capbowl_state::tms34061_w)
1919{
2020   int func = (offset >> 8) & 3;
2121   int col = offset & 0xff;
r244652r244653
3030}
3131
3232
33READ8_MEMBER(capbowl_state::capbowl_tms34061_r)
33READ8_MEMBER(capbowl_state::tms34061_r)
3434{
3535   int func = (offset >> 8) & 3;
3636   int col = offset & 0xff;
r244652r244653
123123}
124124
125125
126UINT32 capbowl_state::screen_update_capbowl(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
126UINT32 capbowl_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
127127{
128   int x, y;
129
130128   /* first get the current display state */
131129   m_tms34061->get_display_state();
132130
r244652r244653
138136   }
139137
140138   /* now regenerate the bitmap */
141   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
139   for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
142140   {
143141      UINT8 *src = &m_tms34061->m_display.vram[256 * y];
144142      UINT32 *dest = &bitmap.pix32(y);
145143
146      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
144      for (int x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
147145      {
148146         UINT8 pix = src[32 + (x / 2)];
149147         *dest++ = pen_for_pixel(src, pix >> 4);
trunk/src/mame/video/fgoal.c
r244652r244653
88#include "includes/fgoal.h"
99
1010
11WRITE8_MEMBER(fgoal_state::fgoal_color_w)
11WRITE8_MEMBER(fgoal_state::color_w)
1212{
1313   m_current_color = data & 3;
1414}
1515
1616
17WRITE8_MEMBER(fgoal_state::fgoal_ypos_w)
17WRITE8_MEMBER(fgoal_state::ypos_w)
1818{
1919   m_ypos = data;
2020}
2121
2222
23WRITE8_MEMBER(fgoal_state::fgoal_xpos_w)
23WRITE8_MEMBER(fgoal_state::xpos_w)
2424{
2525   m_xpos = data;
2626}
r244652r244653
3636}
3737
3838
39UINT32 fgoal_state::screen_update_fgoal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
39UINT32 fgoal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
4040{
4141   const UINT8* VRAM = m_video_ram;
4242
r244652r244653
4646
4747   /* draw color overlay foreground and background */
4848
49   if (m_fgoal_player == 1 && (ioport("IN1")->read() & 0x40))
49   if (m_player == 1 && (ioport("IN1")->read() & 0x40))
5050   {
5151      m_gfxdecode->gfx(0)->zoom_opaque(m_fgbitmap,cliprect,
52         0, (m_fgoal_player << 2) | m_current_color,
52         0, (m_player << 2) | m_current_color,
5353         1, 1,
5454         0, 16,
5555         0x40000,
r244652r244653
6565   else
6666   {
6767      m_gfxdecode->gfx(0)->zoom_opaque(m_fgbitmap,cliprect,
68         0, (m_fgoal_player << 2) | m_current_color,
68         0, (m_player << 2) | m_current_color,
6969         0, 0,
7070         0, 0,
7171         0x40000,
trunk/src/mame/video/ssv.c
r244652r244653
141141#endif
142142
143143
144void ssv_state::ssv_drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx,
144void ssv_state::drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx,
145145               UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,
146146               int shadow )
147147{
r244652r244653
194194void ssv_state::video_start()
195195{
196196   m_gfxdecode->gfx(0)->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */
197   
198   save_item(NAME(m_enable_video));
199   save_item(NAME(m_shadow_pen_mask));
200   save_item(NAME(m_shadow_pen_shift));
197201}
198202
199203VIDEO_START_MEMBER(ssv_state,eaglshot)
r244652r244653
204208
205209   m_gfxdecode->gfx(0)->set_source((UINT8 *)m_eaglshot_gfxram);
206210   m_gfxdecode->gfx(1)->set_source((UINT8 *)m_eaglshot_gfxram);
211   
212   save_pointer(NAME(m_eaglshot_gfxram), 16 * 0x40000 / 2);
207213}
208214
209215TILE_GET_INFO_MEMBER(ssv_state::get_tile_info_0)
r244652r244653
368374
369375***************************************************************************/
370376
371READ16_MEMBER(ssv_state::ssv_vblank_r)
377READ16_MEMBER(ssv_state::vblank_r)
372378{
373379   if (m_screen->vblank())
374380      return 0x2000 | 0x1000;
r244652r244653
376382      return 0x0000;
377383}
378384
379WRITE16_MEMBER(ssv_state::ssv_scroll_w)
385WRITE16_MEMBER(ssv_state::scroll_w)
380386{
381387   COMBINE_DATA(m_scroll + offset);
382388
r244652r244653
688694         {
689695            for (ty = ystart; ty != yend; ty += yinc)
690696            {
691               ssv_drawgfx( bitmap, clip, m_gfxdecode->gfx(gfx),
697               drawgfx( bitmap, clip, m_gfxdecode->gfx(gfx),
692698                                 code++,
693699                                 color,
694700                                 flipx, flipy,
r244652r244653
913919            {
914920               for (y = ystart; y != yend; y += yinc)
915921               {
916                  ssv_drawgfx( bitmap, cliprect, m_gfxdecode->gfx(gfx),
922                  drawgfx( bitmap, cliprect, m_gfxdecode->gfx(gfx),
917923                                    code++,
918924                                    color,
919925                                    flipx, flipy,
r244652r244653
948954
949955UINT32 ssv_state::screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
950956{
951   return screen_update_ssv(screen, bitmap, cliprect);
957   return screen_update(screen, bitmap, cliprect);
952958}
953959
954960UINT32 ssv_state::screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
955961{
956   screen_update_ssv(screen, bitmap, cliprect);
962   screen_update(screen, bitmap, cliprect);
957963
958964   // draw zooming sprites
959965   m_gdfs_st0020->st0020_draw_all(bitmap, cliprect);
r244652r244653
965971   return 0;
966972}
967973
968void ssv_state::ssv_enable_video(int enable)
974void ssv_state::enable_video(int enable)
969975{
970976   m_enable_video = enable;
971977}
972978
973UINT32 ssv_state::screen_update_ssv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
979UINT32 ssv_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
974980{
975981   rectangle clip;
976982
trunk/src/mame/video/st0020.c
r244652r244653
8585   save_pointer(NAME(m_st0020_gfxram), 4 * 0x100000/2);
8686   save_pointer(NAME(m_st0020_spriteram), 0x80000/2);
8787   save_pointer(NAME(m_st0020_blitram), 0x100/2);
88   save_item(NAME(m_st0020_gfxram_bank));
8889}
8990
9091void st0020_device::device_reset()
trunk/src/mess/drivers/alnchase.c
r244652r244653
1// license:BSD-3-Clause
2// copyright-holders:hap
3/***************************************************************************
4
5  Tomy Alien Chase (manufactured in Japan)
6  * boards are labeled TN-16
7  * NEC uCOM-43 MCU, labeled D553C 258
8  * red/green VFD display with color overlay, 2-sided*
9
10  *Player one views the VFD from the front (grid+filament side) while the
11  opposite player views it from the back side (through the conductive traces),
12  basically a mirror-image.
13
14  This is a space-themed tabletop VFD electronic game. To start, simply
15  press [UP]. Hold a joystick direction to move around.
16
17  NOTE!: MESS external artwork is required to be able to play
18
19
20  TODO:
21  - display should go off when sound is played, needs decay simulation?
22
23***************************************************************************/
24
25#include "emu.h"
26#include "cpu/ucom4/ucom4.h"
27#include "sound/speaker.h"
28
29#include "alnchase.lh" // this is a test layout, external artwork is necessary
30
31
32class alnchase_state : public driver_device
33{
34public:
35   alnchase_state(const machine_config &mconfig, device_type type, const char *tag)
36      : driver_device(mconfig, type, tag),
37      m_maincpu(*this, "maincpu"),
38      m_button_matrix(*this, "IN"),
39      m_speaker(*this, "speaker")
40   { }
41
42   required_device<cpu_device> m_maincpu;
43   required_ioport_array<2> m_button_matrix;
44   required_device<speaker_sound_device> m_speaker;
45
46   UINT8 m_input_mux;
47   UINT32 m_plate;
48   UINT16 m_grid;
49
50   DECLARE_READ8_MEMBER(input_r);
51   DECLARE_WRITE8_MEMBER(display_w);
52   DECLARE_WRITE8_MEMBER(port_e_w);
53
54   UINT32 m_vfd_state[0x10];
55   void update_vfd();
56
57   virtual void machine_start();
58};
59
60
61
62/***************************************************************************
63
64  Display
65
66***************************************************************************/
67
68void alnchase_state::update_vfd()
69{
70   for (int i = 0; i < 9; i++)
71      if (m_grid & (1 << i) && m_vfd_state[i] != m_plate)
72      {
73         // on difference, send to output
74         for (int j = 0; j < 17; j++)
75            output_set_lamp_value(i*100 + j, m_plate >> j & 1);
76
77         m_vfd_state[i] = m_plate;
78      }
79}
80
81
82
83/***************************************************************************
84
85  I/O
86
87***************************************************************************/
88
89READ8_MEMBER(alnchase_state::input_r)
90{
91   UINT8 inp = 0;
92
93   // read selected button rows
94   for (int i = 0; i < 2; i++)
95      if (m_input_mux >> i & 1)
96         inp |= m_button_matrix[i]->read();
97
98   return inp;
99}
100
101WRITE8_MEMBER(alnchase_state::display_w)
102{
103   int shift;
104
105   if (offset <= NEC_UCOM4_PORTE)
106   {
107      // C/D/E0: vfd matrix grid
108      shift = (offset - NEC_UCOM4_PORTC) * 4;
109      m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
110
111      // C0(grid 0): input enable PL1
112      // D0(grid 4): input enable PL2
113      m_input_mux = (m_grid & 1) | (m_grid >> 3 & 2);
114   }
115
116   if (offset >= NEC_UCOM4_PORTE)
117   {
118      // E23/F/G/H/I: vfd matrix plate
119      shift = (offset - NEC_UCOM4_PORTE) * 4;
120      m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2;
121   }
122
123   update_vfd();
124}
125
126WRITE8_MEMBER(alnchase_state::port_e_w)
127{
128   display_w(space, offset, data);
129
130   // E1: speaker out
131   m_speaker->level_w(data >> 1 & 1);
132}
133
134
135
136/***************************************************************************
137
138  Inputs
139
140***************************************************************************/
141
142/* physical button layout and labels is like this:
143
144    POWER SOUND LEVEL PLAYER
145     ON    ON    PRO   TWO        START
146      o     o     |     |
147      |     |     |     |       [joystick]
148      |     |     o     o
149     OFF   OFF   AMA   ONE     GAME 0,1,2,3
150
151    1 PLAYER SIDE
152
153    other player side only has a joystick
154*/
155
156static INPUT_PORTS_START( alnchase )
157   PORT_START("IN.0") // C0 port A
158   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
159   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
160   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
161   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
162
163   PORT_START("IN.1") // D0 port A
164   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right
165   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // "
166   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
167   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
168
169   PORT_START("SW") // port B
170   PORT_CONFNAME( 0x01, 0x01, "Players" )
171   PORT_CONFSETTING(    0x01, "1" )
172   PORT_CONFSETTING(    0x00, "2" )
173   PORT_CONFNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
174   PORT_CONFSETTING(    0x00, "Amateur" )
175   PORT_CONFSETTING(    0x02, "Professional" )
176   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
177INPUT_PORTS_END
178
179
180
181/***************************************************************************
182
183  Machine Config
184
185***************************************************************************/
186
187void alnchase_state::machine_start()
188{
189   // zerofill
190   memset(m_vfd_state, 0, sizeof(m_vfd_state));
191   m_input_mux = 0;
192   m_plate = 0;
193   m_grid = 0;
194
195   // register for savestates
196   save_item(NAME(m_vfd_state));
197   save_item(NAME(m_input_mux));
198   save_item(NAME(m_plate));
199   save_item(NAME(m_grid));
200}
201
202
203static MACHINE_CONFIG_START( alnchase, alnchase_state )
204
205   /* basic machine hardware */
206   MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
207   MCFG_UCOM4_READ_A_CB(READ8(alnchase_state, input_r))
208   MCFG_UCOM4_READ_B_CB(IOPORT("SW"))
209   MCFG_UCOM4_WRITE_C_CB(WRITE8(alnchase_state, display_w))
210   MCFG_UCOM4_WRITE_D_CB(WRITE8(alnchase_state, display_w))
211   MCFG_UCOM4_WRITE_E_CB(WRITE8(alnchase_state, port_e_w))
212   MCFG_UCOM4_WRITE_F_CB(WRITE8(alnchase_state, display_w))
213   MCFG_UCOM4_WRITE_G_CB(WRITE8(alnchase_state, display_w))
214   MCFG_UCOM4_WRITE_H_CB(WRITE8(alnchase_state, display_w))
215   MCFG_UCOM4_WRITE_I_CB(WRITE8(alnchase_state, display_w))
216
217   MCFG_DEFAULT_LAYOUT(layout_alnchase)
218
219   /* no video! */
220
221   /* sound hardware */
222   MCFG_SPEAKER_STANDARD_MONO("mono")
223   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
224   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
225MACHINE_CONFIG_END
226
227
228
229/***************************************************************************
230
231  Game driver(s)
232
233***************************************************************************/
234
235ROM_START( alnchase )
236   ROM_REGION( 0x0800, "maincpu", 0 )
237   ROM_LOAD( "d553c-258", 0x0000, 0x0800, CRC(c5284ff5) SHA1(6a20aaacc9748f0e0335958f3cea482e36153704) )
238ROM_END
239
240
241CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
trunk/src/mess/drivers/apple2.c
r244652r244653
7979#include "bus/a2bus/mouse.h"
8080#include "bus/a2bus/ramcard16k.h"
8181#include "bus/a2bus/ramcard128k.h"
82#include "bus/a2bus/ezcgi.h"
8283
8384#define A2_CPU_TAG "maincpu"
8485#define A2_KBDC_TAG "ay3600"
r244652r244653
12281229   SLOT_INTERFACE("dx1", A2BUS_DX1)    /* Decillonix DX-1 sampler card */
12291230   SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */
12301231   SLOT_INTERFACE("mouse", A2BUS_MOUSE)    /* Apple II Mouse Card */
1232   SLOT_INTERFACE("ezcgi", A2BUS_EZCGI)   /* E-Z Color Graphics Interface */
1233   SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938)   /* E-Z Color Graphics Interface (TMS9938) */
1234   SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958)   /* E-Z Color Graphics Interface (TMS9958) */
12311235//  SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN)    /* Magic Musician Card */
12321236SLOT_INTERFACE_END
12331237
trunk/src/mess/drivers/apple2e.c
r244652r244653
143143#include "bus/a2bus/a2dx1.h"
144144#include "bus/a2bus/timemasterho.h"
145145#include "bus/a2bus/mouse.h"
146#include "bus/a2bus/ezcgi.h"
146147#include "bus/a2bus/a2eauxslot.h"
147148#include "bus/a2bus/a2estd80col.h"
148149#include "bus/a2bus/a2eext80col.h"
r244652r244653
30353036   SLOT_INTERFACE("dx1", A2BUS_DX1)    /* Decillonix DX-1 sampler card */
30363037   SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */
30373038   SLOT_INTERFACE("mouse", A2BUS_MOUSE)    /* Apple II Mouse Card */
3039   SLOT_INTERFACE("ezcgi", A2BUS_EZCGI)   /* E-Z Color Graphics Interface */
3040   SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938)   /* E-Z Color Graphics Interface (TMS9938) */
3041   SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958)   /* E-Z Color Graphics Interface (TMS9958) */
30383042//  SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN)    /* Magic Musician Card */
30393043SLOT_INTERFACE_END
30403044
trunk/src/mess/drivers/edracula.c
r244652r244653
1// license:BSD-3-Clause
2// copyright-holders:hap
3/***************************************************************************
4
5  Epoch Dracula (manufactured in Japan)
6  * NEC uCOM-43 MCU, labeled D553C 206
7  * cyan/red/green VFD display NEC FIP8BM20T
8
9  known releases:
10  - Japan: Dracula House, yellow case
11  - USA: Dracula, red case
12  - Other: Dracula, yellow case, published by Hales
13
14  NOTE!: MESS external artwork is required to be able to play
15
16
17  TODO:
18  - display should go off when sound is played, needs decay simulation?
19
20***************************************************************************/
21
22#include "emu.h"
23#include "cpu/ucom4/ucom4.h"
24#include "sound/speaker.h"
25
26#include "edracula.lh" // this is a test layout, external artwork is necessary
27
28
29class edracula_state : public driver_device
30{
31public:
32   edracula_state(const machine_config &mconfig, device_type type, const char *tag)
33      : driver_device(mconfig, type, tag),
34      m_maincpu(*this, "maincpu"),
35      m_speaker(*this, "speaker")
36   { }
37
38   required_device<cpu_device> m_maincpu;
39   required_device<speaker_sound_device> m_speaker;
40
41   UINT32 m_plate;
42   UINT16 m_grid;
43
44   DECLARE_WRITE8_MEMBER(grid_w);
45   DECLARE_WRITE8_MEMBER(plate_w);
46   DECLARE_WRITE8_MEMBER(port_i_w);
47
48   UINT32 m_vfd_state[0x10];
49   void update_vfd();
50
51   virtual void machine_start();
52};
53
54
55
56/***************************************************************************
57
58  Display
59
60***************************************************************************/
61
62void edracula_state::update_vfd()
63{
64   for (int i = 0; i < 8; i++)
65      if (m_grid & (1 << i) && m_vfd_state[i] != m_plate)
66      {
67         // on difference, send to output
68         for (int j = 0; j < 18; j++)
69            output_set_lamp_value(i*100 + j, m_plate >> j & 1);
70
71         m_vfd_state[i] = m_plate;
72      }
73}
74
75
76
77/***************************************************************************
78
79  I/O
80
81***************************************************************************/
82
83WRITE8_MEMBER(edracula_state::grid_w)
84{
85   // port C/D: vfd matrix grid
86   int shift = (offset - NEC_UCOM4_PORTC) * 4;
87   m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
88
89   update_vfd();
90}
91
92WRITE8_MEMBER(edracula_state::plate_w)
93{
94   // port E/F/G/H/I01: vfd matrix plate
95   int shift = (offset - NEC_UCOM4_PORTE) * 4;
96   m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
97
98   update_vfd();
99}
100
101WRITE8_MEMBER(edracula_state::port_i_w)
102{
103   plate_w(space, offset, data & 3);
104
105   // I2: speaker out
106   m_speaker->level_w(data >> 2 & 1);
107}
108
109
110
111/***************************************************************************
112
113  Inputs
114
115***************************************************************************/
116
117static INPUT_PORTS_START( edracula )
118   PORT_START("IN0")
119   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT )
120   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START )
121   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
122   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
123
124   PORT_START("IN1")
125   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
126   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
127   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
128   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
129INPUT_PORTS_END
130
131
132
133/***************************************************************************
134
135  Machine Config
136
137***************************************************************************/
138
139void edracula_state::machine_start()
140{
141   // zerofill
142   memset(m_vfd_state, 0, sizeof(m_vfd_state));
143   m_plate = 0;
144   m_grid = 0;
145
146   // register for savestates
147   save_item(NAME(m_vfd_state));
148   save_item(NAME(m_plate));
149   save_item(NAME(m_grid));
150}
151
152
153static MACHINE_CONFIG_START( edracula, edracula_state )
154
155   /* basic machine hardware */
156   MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
157   MCFG_UCOM4_READ_A_CB(IOPORT("IN0"))
158   MCFG_UCOM4_READ_B_CB(IOPORT("IN1"))
159   MCFG_UCOM4_WRITE_C_CB(WRITE8(edracula_state, grid_w))
160   MCFG_UCOM4_WRITE_D_CB(WRITE8(edracula_state, grid_w))
161   MCFG_UCOM4_WRITE_E_CB(WRITE8(edracula_state, plate_w))
162   MCFG_UCOM4_WRITE_F_CB(WRITE8(edracula_state, plate_w))
163   MCFG_UCOM4_WRITE_G_CB(WRITE8(edracula_state, plate_w))
164   MCFG_UCOM4_WRITE_H_CB(WRITE8(edracula_state, plate_w))
165   MCFG_UCOM4_WRITE_I_CB(WRITE8(edracula_state, port_i_w))
166
167   MCFG_DEFAULT_LAYOUT(layout_edracula)
168
169   /* no video! */
170
171   /* sound hardware */
172   MCFG_SPEAKER_STANDARD_MONO("mono")
173   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
174   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
175MACHINE_CONFIG_END
176
177
178
179/***************************************************************************
180
181  Game driver(s)
182
183***************************************************************************/
184
185ROM_START( edracula )
186   ROM_REGION( 0x0800, "maincpu", 0 )
187   ROM_LOAD( "d553c-206", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) )
188ROM_END
189
190
191CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
trunk/src/mess/drivers/hh_tms1k.c
r244652r244653
55  This driver is a collection of simple dedicated handheld and tabletop
66  toys based around the TMS1000 MCU series. Anything more complex or clearly
77  part of a series is (or will be) in its own driver.
8 
9  Let's use this driver for a list of known devices and their serials,
10  excluding TI's own products (see for example ticalc1x.c, tispeak.c)
811
12  serial   device   etc.
13--------------------------------------------------------------------
14 @MP0904A  TMS0970  1977, Milton Bradley Comp IV
15 @MP0905B  TMS0970  1977, Parker Brothers Codename Sector
16 @MP0914   TMS1000  1979, Entex Baseball
17 @MP1030   TMS1100  1980, APF Mathemagician
18 @MP3226   TMS1000  1978, Milton Bradley Simon
19 @MP3403   TMS1100  1978, unknown
20 @MP3404   TMS1100  1978, Parker Brothers Merlin
21 @MP3405   TMS1100  1979, Coleco Amaze-A-Tron
22 @MP3438A  TMS1100  1979, Kenner Star Wars Electronic Battle Command
23  MP3450A  TMS1100  1979, MicroVision cartridge: Blockbuster
24  MP3454   TMS1100  1979, MicroVision cartridge: Star Trek Phaser Strike
25  MP3455   TMS1100  1980, MicroVision cartridge: Pinball
26  MP3457   TMS1100  1979, MicroVision cartridge: Mindbuster
27  MP3474   TMS1100  1979, MicroVision cartridge: Vegas Slots
28  MP3475   TMS1100  1979, MicroVision cartridge: Bowling
29  MP3479   TMS1100  1980, MicroVision cartridge: Baseball
30  MP3481   TMS1100  1979, MicroVision cartridge: Connect Four
31  MP3496   TMS1100  1980, MicroVision cartridge: Sea Duel
32 @MP6100A  TMS0980  1979, Ideal Electronic Detective
33 @MP6101B  TMS0980  1979, Parker Brothers Stop Thief
34 @MP7313   TMS1400  1980, Parker Brothers Bank Shot
35 @MP7314   TMS1400  1980, Parker Brothers Split Second
36 *MP7332   TMS1400  1981, Milton Bradley Dark Tower
37 @MP7334   TMS1400  1981, Coleco Total Control 4
938
39  inconsistent:
40 
41  M34009   TMS1100  1981, MicroVision cartridge: Alien Raiders
42  M34017   TMS1100  1981, MicroVision cartridge: Cosmic Hunter
43  M34047   TMS1100  1982, MicroVision cartridge: Super Blockbuster
44
45  CD7282SL TMS1100  1981, Tandy-12 (serial is similar to TI Speak & Spell series?)
46
47  (* denotes not yet emulated by MESS, @ denotes it's in this driver)
48
1049***************************************************************************/
1150
1251#include "emu.h"
1352#include "cpu/tms0980/tms0980.h"
1453#include "sound/speaker.h"
1554
55// internal artwork
1656#include "amaztron.lh"
1757#include "bankshot.lh"
1858#include "cnsector.lh"
19#include "ebball.lh"
2059#include "elecdet.lh"
2160#include "comp4.lh"
2261#include "mathmagi.lh"
23#include "merlin.lh"
24#include "simon.lh"
62#include "merlin.lh" // clickable
63#include "simon.lh" // clickable
2564#include "splitsec.lh"
2665#include "starwbc.lh"
2766#include "stopthie.lh"
28#include "tandy12.lh"
67#include "tandy12.lh" // clickable
2968#include "tc4.lh"
3069
70// test-layouts - use external artwork
71#include "ebball.lh"
3172
73
3274class hh_tms1k_state : public driver_device
3375{
3476public:
r244652r244653
72114
73115   TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
74116   void display_update();
117   void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
75118   
76119   // game-specific handlers
77120   void mathmagi_display();
r244652r244653
89132   DECLARE_WRITE16_MEMBER(tc4_write_r);
90133   DECLARE_WRITE16_MEMBER(tc4_write_o);
91134
135   void ebball_display();
136   DECLARE_READ8_MEMBER(ebball_read_k);
137   DECLARE_WRITE16_MEMBER(ebball_write_r);
138   DECLARE_WRITE16_MEMBER(ebball_write_o);
139
92140   DECLARE_READ8_MEMBER(elecdet_read_k);
93141   DECLARE_WRITE16_MEMBER(elecdet_write_r);
94142   DECLARE_WRITE16_MEMBER(elecdet_write_o);
r244652r244653
118166   DECLARE_WRITE16_MEMBER(stopthief_write_r);
119167   DECLARE_WRITE16_MEMBER(stopthief_write_o);
120168
121   void bankshot_display();
122169   DECLARE_READ8_MEMBER(bankshot_read_k);
123170   DECLARE_WRITE16_MEMBER(bankshot_write_r);
124171   DECLARE_WRITE16_MEMBER(bankshot_write_o);
125172
126   void splitsec_display();
127173   DECLARE_READ8_MEMBER(splitsec_read_k);
128174   DECLARE_WRITE16_MEMBER(splitsec_write_r);
129175   DECLARE_WRITE16_MEMBER(splitsec_write_o);
r244652r244653
139185};
140186
141187
188// machine_start/reset
189
142190void hh_tms1k_state::machine_start()
143191{
144192   // zerofill
r244652r244653
168216   save_item(NAME(m_power_on));
169217}
170218
171
172219void hh_tms1k_state::machine_reset()
173220{
174221   m_power_on = true;
175222}
176223
224
225
177226/***************************************************************************
178227
179228  Helper Functions
r244652r244653
243292   display_update();
244293}
245294
295void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
296{
297   m_display_maxx = maxx;
298   m_display_maxy = maxy;
246299
300   // update current state
301   for (int y = 0; y < maxy; y++)
302      m_display_state[y] = (sety >> y & 1) ? setx : 0;
303   
304   display_update();
305}
306
307
247308UINT8 hh_tms1k_state::read_inputs(int columns)
248309{
249   UINT8 k = 0;
310   UINT8 ret = 0;
250311
251312   // read selected input rows
252313   for (int i = 0; i < columns; i++)
253314      if (m_inp_mux >> i & 1)
254         k |= m_inp_matrix[i]->read();
315         ret |= m_inp_matrix[i]->read();
255316
256   return k;
317   return ret;
257318}
258319
259INPUT_CHANGED_MEMBER(hh_tms1k_state::tms0980_power_button)
260{
261   m_power_on = (bool)(FPTR)param;
262   m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE);
263}
264320
321// devices with a TMS0980 can auto power-off
322
265323WRITE_LINE_MEMBER(hh_tms1k_state::tms0980_auto_power_off)
266324{
267   // TMS0980 auto power-off opcode
268325   if (state)
269326   {
270327      m_power_on = false;
r244652r244653
272329   }
273330}
274331
332INPUT_CHANGED_MEMBER(hh_tms1k_state::tms0980_power_button)
333{
334   m_power_on = (bool)(FPTR)param;
335   m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE);
336}
337
338
339
275340/***************************************************************************
276341
277342  Minidrivers (I/O, Inputs, Machine Config)
r244652r244653
331396   return read_inputs(6);
332397}
333398
334
335399WRITE16_MEMBER(hh_tms1k_state::mathmagi_write_r)
336400{
337401   // R3,R5-R7,R9,R10: input mux
r244652r244653
350414   m_o = data;
351415}
352416
417
353418/* physical button layout and labels is like this:
354419
355420    ON     ONE       [SEL] [NXT] [?]   [/]
r244652r244653
399464   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
400465INPUT_PORTS_END
401466
467// output PLA is not dumped
402468static const UINT16 mathmagi_output_pla[0x20] =
403469{
404470   lA+lB+lC+lD+lE+lF,      // 0
r244652r244653
435501   lA+lF+lE+lD+lC          // G
436502};
437503
438
439504static MACHINE_CONFIG_START( mathmagi, hh_tms1k_state )
440505
441506   /* basic machine hardware */
r244652r244653
626691void hh_tms1k_state::tc4_display()
627692{
628693   m_display_wait = 50;
629   m_display_maxy = 10;
630   m_display_maxx = 9;
631694   
632695   // R5,7,8,9 are 7segs
633   for (int y = 0; y < m_display_maxy; y++)
696   for (int y = 0; y < 10; y++)
634697      if (y >= 5 && y <= 9 && y != 6)
635698         m_7seg_mask[y] = 0x7f;
636699   
637700   // update current state (note: R6 as extra column!)
638   for (int y = 0; y < m_display_maxy; y++)
639      m_display_state[y] = (m_r >> y & 1) ? (m_o | (m_r << 2 & 0x100)) : 0;
640   
641   display_update();
701   display_matrix(9, 10, (m_o | (m_r << 2 & 0x100)), m_r);
642702}
643703
644704READ8_MEMBER(hh_tms1k_state::tc4_read_k)
r244652r244653
662722   m_inp_mux = data & 0x23f;
663723   
664724   // R6: led column 8
665   // +other: select leds
725   // +other columns
666726   m_r = data;
667727   tc4_display();
668728}
669729
670730WRITE16_MEMBER(hh_tms1k_state::tc4_write_o)
671731{
672   // O0-O7: leds/7segment
732   // O0-O7: led row
673733   m_o = data;
674734   tc4_display();
675735}
r244652r244653
745805  Entex Baseball
746806  * TMS1000NLP MP0914 (die labeled MP0914A)
747807
808  NOTE!: MESS external artwork is recommended
809
810  lamp translation table: led LDzz from game PCB = MESS lampyx:
811
812    LD0  = -        LD10 = lamp12   LD20 = lamp42   LD30 = lamp60
813    LD1  = lamp23   LD11 = lamp4    LD21 = lamp41   LD31 = lamp61
814    LD2  = lamp0    LD12 = lamp15   LD22 = lamp40   LD32 = lamp62
815    LD3  = lamp1    LD13 = lamp22   LD23 = lamp43   LD33 = lamp70
816    LD4  = lamp2    LD14 = lamp33   LD24 = lamp53   LD34 = lamp71
817    LD5  = lamp10   LD15 = lamp32   LD25 = lamp52
818    LD6  = lamp13   LD16 = lamp21   LD26 = lamp51
819    LD7  = lamp11   LD17 = lamp31   LD27 = lamp50
820    LD8  = lamp3    LD18 = lamp30   LD28 = lamp72
821    LD9  = lamp14   LD19 = lamp20   LD29 = lamp73
822
748823***************************************************************************/
749824
750// inputs
825void hh_tms1k_state::ebball_display()
826{
827   // R8 is a 7seg
828   m_7seg_mask[8] = 0x7f;
829   
830   display_matrix(7, 9, m_o, m_r);
831}
832
833READ8_MEMBER(hh_tms1k_state::ebball_read_k)
834{
835   // note: K8(Vss row) is always on
836   return m_inp_matrix[5]->read() | read_inputs(5);
837}
838
839WRITE16_MEMBER(hh_tms1k_state::ebball_write_r)
840{
841   // R1-R5: input mux
842   m_inp_mux = data >> 1 & 0x1f;
843   
844   // R9: speaker out
845   m_speaker->level_w(data >> 9 & 1);
846   
847   // R0-R8: led columns
848   m_r = data;
849   ebball_display();
850}
851
852WRITE16_MEMBER(hh_tms1k_state::ebball_write_o)
853{
854   // O0-O6: led row
855   // O7: N/C
856   m_o = data;
857   ebball_display();
858}
859
751860static INPUT_PORTS_START( ebball )
861   PORT_START("IN.0") // R1
862   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
863   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
864   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 )
865   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
866
867   PORT_START("IN.1") // R2
868   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 )
869   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
870
871   PORT_START("IN.2") // R3
872   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 )
873   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
874
875   PORT_START("IN.3") // R4
876   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON6 )
877   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
878
879   PORT_START("IN.4") // R5
880   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON7 )
881   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
882
883   PORT_START("IN.5") // Vss!
884   PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED )
885   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 )
752886INPUT_PORTS_END
753887
754// machine config
755888static MACHINE_CONFIG_START( ebball, hh_tms1k_state )
756889
757890   /* basic machine hardware */
758891   MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=43K, C=47pf -> ~350kHz
892   MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ebball_read_k))
893   MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ebball_write_r))
894   MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ebball_write_o))
759895
896   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
760897   MCFG_DEFAULT_LAYOUT(layout_ebball)
761898
762899   /* no video! */
r244652r244653
795932
796933WRITE16_MEMBER(hh_tms1k_state::elecdet_write_r)
797934{
798   m_display_maxy = 7;
799   m_display_maxx = 7;
935   // R7,R8: speaker on
936   m_speaker->level_w((data & 0x180 && m_o & 0x80) ? 1 : 0);
800937
801938   // R0-R6: select digit
802   UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3);
803   for (int y = 0; y < m_display_maxy; y++)
804   {
939   for (int y = 0; y < 7; y++)
805940      m_7seg_mask[y] = 0x7f;
806      m_display_state[y] = (data >> y & 1) ? o : 0;
807   }
808941
809   display_update();
810
811   // R7,R8: speaker on
812   m_speaker->level_w((data & 0x180 && m_o & 0x80) ? 1 : 0);
942   display_matrix(7, 7, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data);
813943}
814944
815945WRITE16_MEMBER(hh_tms1k_state::elecdet_write_o)
r244652r244653
833963*/
834964
835965static INPUT_PORTS_START( elecdet )
836   PORT_START("IN.0") // O0 pin18
966   PORT_START("IN.0") // O0
837967   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
838968   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
839969   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
840970   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Private Question")
841971   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
842972
843   PORT_START("IN.1") // O1 pin17
973   PORT_START("IN.1") // O1
844974   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
845975   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
846976   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0")
847977   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter")
848978   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
849979
850   PORT_START("IN.2") // O4 pin14
980   PORT_START("IN.2") // O4
851981   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7")
852982   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
853983   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9")
854984   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("I Accuse")
855985   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8")
856986
857   PORT_START("IN.3") // O6 pin12
987   PORT_START("IN.3") // O6
858988   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
859989   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
860990   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
r244652r244653
9081038
9091039void hh_tms1k_state::starwbc_display()
9101040{
911   m_display_maxy = 10;
912   m_display_maxx = 8;
913
914   UINT8 o = (m_o << 4 & 0xf0) | (m_o >> 4 & 0x0f);
915   for (int y = 0; y < m_display_maxy; y+=2)
916   {
917      m_display_state[y] = (m_r >> y & 1) ? o : 0;
918     
919      // R6,R8 are 7segs
920      if (y == 6 || y == 8)
921         m_7seg_mask[y] = 0x7f;
922   }
923
924   display_update();
1041   // R6,R8 are 7segs
1042   m_7seg_mask[6] = m_7seg_mask[8] = 0x7f;
1043   
1044   display_matrix(8, 10, m_o, m_r);
9251045}
9261046
9271047READ8_MEMBER(hh_tms1k_state::starwbc_read_k)
r244652r244653
9341054   // R0,R1,R3,R5,R7: input mux
9351055   m_inp_mux = (data & 3) | (data >> 1 & 4) | (data >> 2 & 8) | (data >> 3 & 0x10);
9361056
937   // R9: piezo speaker
1057   // R9: speaker out
9381058   m_speaker->level_w(data >> 9 & 1);
9391059
940   // R0,R2,R4,R6,R8: leds
941   m_r = data;
1060   // R0,R2,R4,R6,R8: led columns
1061   m_r = data & 0x155;
9421062   starwbc_display();
9431063}
9441064
9451065WRITE16_MEMBER(hh_tms1k_state::starwbc_write_o)
9461066{
947   // O0-O7: leds state
948   m_o = data;
1067   // O0-O7: led row
1068   m_o = (data << 4 & 0xf0) | (data >> 4 & 0x0f);
9491069   starwbc_display();
9501070}
9511071
9521072
953
9541073/* physical button layout and labels is like this:
9551074
9561075    (reconnnaissance=yellow)        (tactical reaction=green)
r244652r244653
9961115static MACHINE_CONFIG_START( starwbc, hh_tms1k_state )
9971116
9981117   /* basic machine hardware */
999   MCFG_CPU_ADD("maincpu", TMS1100, 300000) // RC osc. R=51K, C=47pf -> ~300kHz
1118   MCFG_CPU_ADD("maincpu", TMS1100, 325000) // RC osc. R=51K, C=47pf -> ~325kHz
10001119   MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, starwbc_read_k))
10011120   MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, starwbc_write_r))
10021121   MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, starwbc_write_o))
r244652r244653
10291148  Refer to the official manual for more information.
10301149
10311150
1032  TODO:
1033  - MCU clock is unknown
1034
10351151***************************************************************************/
10361152
10371153READ8_MEMBER(hh_tms1k_state::comp4_read_k)
r244652r244653
10471163   // R2    R7
10481164   // R1    R6
10491165   // R0    R5
1050   m_display_maxx = 11;
1051   m_display_state[0] = data;
1052   display_update();
1166   m_r = data;
1167   display_matrix(11, 1, m_r, m_o);
10531168}
10541169
10551170WRITE16_MEMBER(hh_tms1k_state::comp4_write_o)
10561171{
1057   // O0: leds common (always writes 1)
10581172   // O1-O3: input mux
1173   m_inp_mux = data >> 1 & 7;
1174
1175   // O0: leds common
10591176   // other bits: N/C
1060   m_inp_mux = data >> 1 & 7;
1177   m_o = data;
1178   display_matrix(11, 1, m_r, m_o);
10611179}
10621180
10631181
r244652r244653
11051223  Milton Bradley Simon, created by Ralph Baer
11061224
11071225  Revision A hardware:
1108  * TMS1000 (has internal ROM), DS75494 lamp driver
1226  * TMS1000 (die labeled MP3226), DS75494 lamp driver
11091227
11101228  Newer revisions have a smaller 16-pin MB4850 chip instead of the TMS1000.
11111229  This one has been decapped too, but we couldn't find an internal ROM.
r244652r244653
11291247   // R5 -> 75494 IN3 -> red lamp
11301248   // R6 -> 75494 IN5 -> yellow lamp
11311249   // R7 -> 75494 IN2 -> blue lamp
1132   m_display_maxx = 4;
1133   m_display_state[0] = data >> 4 & 0xf;
1134   display_update();
1250   display_matrix(4, 1, data >> 4, 1);
11351251
11361252   // R8 -> 75494 IN0 -> speaker
11371253   m_speaker->level_w(data >> 8 & 1);
r244652r244653
13381454   R7   R8   R9
13391455        R10
13401456   */
1341   m_display_maxx = 11;
1342   m_display_state[0] = data;
1343   display_update();
1457   display_matrix(11, 1, data, 1);
13441458}
13451459
13461460WRITE16_MEMBER(hh_tms1k_state::merlin_write_o)
r244652r244653
15371651
15381652***************************************************************************/
15391653
1540void hh_tms1k_state::bankshot_display()
1541{
1542   m_display_maxy = 11;
1543   m_display_maxx = 7;
1544   
1545   // update current state
1546   for (int y = 0; y < m_display_maxy; y++)
1547      m_display_state[y] = (m_r >> y & 1) ? m_o : 0;
1548   
1549   display_update();
1550}
1551
15521654READ8_MEMBER(hh_tms1k_state::bankshot_read_k)
15531655{
15541656   return read_inputs(2);
15551657}
15561658
1557
15581659WRITE16_MEMBER(hh_tms1k_state::bankshot_write_r)
15591660{
15601661   // R0: speaker out
r244652r244653
15631664   // R2,R3: input mux
15641665   m_inp_mux = data >> 2 & 3;
15651666
1566   // R2-R10: led rows
1667   // R2-R10: led columns
15671668   m_r = data & ~3;
1568   bankshot_display();
1669   display_matrix(7, 11, m_o, m_r);
15691670}
15701671
15711672WRITE16_MEMBER(hh_tms1k_state::bankshot_write_o)
15721673{
1573   // O0-O6: led columns
1674   // O0-O6: led row
15741675   // O7: N/C
15751676   m_o = data;
1576   bankshot_display();
1677   display_matrix(7, 11, m_o, m_r);
15771678}
15781679
15791680
r244652r244653
16431744
16441745  *: higher number indicates higher difficulty
16451746
1646***************************************************************************/
1747  display layout, where number xy is lamp R(x),O(y)
16471748
1648
1649/* display layout, where number xy is lamp R(x),O(y)
1650
16511749       00    02    04
16521750    10 01 12 03 14 05 16
16531751       11    13    15
r244652r244653
16591757       71    73    75
16601758    50 60 52 62 54 64 56
16611759       70    72    74
1662*/
16631760
1664void hh_tms1k_state::splitsec_display()
1665{
1666   m_display_maxy = 8;
1667   m_display_maxx = 7;
1668   
1669   // update current state
1670   for (int y = 0; y < m_display_maxy; y++)
1671      m_display_state[y] = (m_r >> y & 1) ? m_o : 0;
1672   
1673   display_update();
1674}
1761***************************************************************************/
16751762
16761763READ8_MEMBER(hh_tms1k_state::splitsec_read_k)
16771764{
r244652r244653
16861773   // R9,R10: input mux
16871774   m_inp_mux = data >> 9 & 3;
16881775
1689   // R0-R7: led rows
1776   // R0-R7: led columns
16901777   m_r = data;
1691   display_update();
1778   display_matrix(7, 8, m_o, m_r);
16921779}
16931780
16941781WRITE16_MEMBER(hh_tms1k_state::splitsec_write_o)
16951782{
1696   // O0-O6: led columns
1783   // O0-O6: led row
16971784   // O7: N/C
16981785   m_o = data;
1699   splitsec_display();
1786   display_matrix(7, 8, m_o, m_r);
17001787}
17011788
17021789static INPUT_PORTS_START( splitsec )
r244652r244653
17081795
17091796   PORT_START("IN.1") // R10
17101797   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY
1711   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Select")
1712   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start")
1798   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SELECT )
1799   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START )
17131800   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
17141801INPUT_PORTS_END
17151802
r244652r244653
17661853
17671854void hh_tms1k_state::tandy12_display()
17681855{
1769   m_display_maxx = 13;
1770   
17711856   // O0-O7: button lamps 1-8, R0-R3: button lamps 9-12
1772   m_display_state[0] = (m_o << 1 & 0x1fe) | (m_r << 9 & 0x1e00);
1773   display_update();
1857   display_matrix(13, 1, (m_o << 1 & 0x1fe) | (m_r << 9 & 0x1e00), 1);
17741858}
17751859
17761860READ8_MEMBER(hh_tms1k_state::tandy12_read_k)
r244652r244653
19972081
19982082ROM_START( amaztron )
19992083   ROM_REGION( 0x0800, "maincpu", 0 )
2000   ROM_LOAD( "tms1100nll_mp3405", 0x0000, 0x0800, CRC(9cbc0009) SHA1(17772681271b59280687492f37fa0859998f041d) )
2084   ROM_LOAD( "mp3405", 0x0000, 0x0800, CRC(9cbc0009) SHA1(17772681271b59280687492f37fa0859998f041d) )
20012085
20022086   ROM_REGION( 867, "maincpu:mpla", 0 )
20032087   ROM_LOAD( "tms1100_amaztron_mpla.pla", 0, 867, CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) )
r244652r244653
20102094
20112095ROM_START( tc4 )
20122096   ROM_REGION( 0x1000, "maincpu", 0 )
2013   ROM_LOAD( "tms1400nll_mp7334", 0x0000, 0x1000, CRC(923f3821) SHA1(a9ae342d7ff8dae1dedcd1e4984bcfae68586581) )
2097   ROM_LOAD( "mp7334", 0x0000, 0x1000, CRC(923f3821) SHA1(a9ae342d7ff8dae1dedcd1e4984bcfae68586581) )
20142098
20152099   ROM_REGION( 867, "maincpu:mpla", 0 )
20162100   ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
r244652r244653
20322116
20332117ROM_START( elecdet )
20342118   ROM_REGION( 0x1000, "maincpu", 0 )
2035   ROM_LOAD( "tms0980nll_mp6100a", 0x0000, 0x1000, CRC(6f396bb8) SHA1(1f104d4ca9bee0d4572be4779b7551dfe20c4f04) )
2119   ROM_LOAD( "mp6100a", 0x0000, 0x1000, CRC(6f396bb8) SHA1(1f104d4ca9bee0d4572be4779b7551dfe20c4f04) )
20362120
20372121   ROM_REGION( 1246, "maincpu:ipla", 0 )
20382122   ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) )
r244652r244653
21202204
21212205ROM_START( stopthie )
21222206   ROM_REGION( 0x1000, "maincpu", 0 )
2123   ROM_LOAD( "tms0980nll_mp6101b", 0x0000, 0x1000, CRC(8bde5bb4) SHA1(8c318fcce67acc24c7ae361f575f28ec6f94665a) )
2207   ROM_LOAD( "mp6101b", 0x0000, 0x1000, CRC(8bde5bb4) SHA1(8c318fcce67acc24c7ae361f575f28ec6f94665a) )
21242208
21252209   ROM_REGION( 1246, "maincpu:ipla", 0 )
21262210   ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) )
r244652r244653
21482232
21492233ROM_START( bankshot )
21502234   ROM_REGION( 0x1000, "maincpu", 0 )
2151   ROM_LOAD( "tms1400nll_mp7313", 0x0000, 0x1000, CRC(7a5016a9) SHA1(a8730dc8a282ffaa3d89e675f371d43eb39f39b4) )
2235   ROM_LOAD( "mp7313", 0x0000, 0x1000, CRC(7a5016a9) SHA1(a8730dc8a282ffaa3d89e675f371d43eb39f39b4) )
21522236
21532237   ROM_REGION( 867, "maincpu:mpla", 0 )
21542238   ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
r244652r244653
21592243
21602244ROM_START( splitsec )
21612245   ROM_REGION( 0x1000, "maincpu", 0 )
2162   ROM_LOAD( "tms1400nll_mp7314", 0x0000, 0x1000, CRC(e94b2098) SHA1(f0fc1f56a829252185592a2508740354c50bedf8) )
2246   ROM_LOAD( "mp7314", 0x0000, 0x1000, CRC(e94b2098) SHA1(f0fc1f56a829252185592a2508740354c50bedf8) )
21632247
21642248   ROM_REGION( 867, "maincpu:mpla", 0 )
21652249   ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
r244652r244653
21802264
21812265ROM_START( unk3403 )
21822266   ROM_REGION( 0x0800, "maincpu", 0 )
2183   ROM_LOAD( "tms1100nll_mp3403", 0x0000, 0x0800, CRC(9eabaa7d) SHA1(b1f54587ed7f2bbf3a5d49075c807296384c2b06) )
2267   ROM_LOAD( "mp3403", 0x0000, 0x0800, CRC(9eabaa7d) SHA1(b1f54587ed7f2bbf3a5d49075c807296384c2b06) )
21842268
21852269   ROM_REGION( 867, "maincpu:mpla", 0 )
21862270   ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, BAD_DUMP CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) // not verified
trunk/src/mess/drivers/hh_ucom4.c
r244652r244653
55  NEC uCOM4 MCU handhelds
66
77
8
9  serial  device  etc
10------------------------------------------
11 @048     uPD552  1980, Tomy Tennis
12 *085     uPD650  1980, Roland TR-808
13  102     uPD553  1981, Bandai Block Out
14 *128     uPD650  1982, Roland TR-606
15  133     uPD650  1982, Roland TB-303
16 @160     uPD553  1982, Tomy Pac Man
17 @206     uPD553  1982, Epoch Dracula
18 @258     uPD553  1984, Tomy Alien Chase
19
20  (* denotes not yet emulated by MESS, @ denotes it's in this driver)
21
822***************************************************************************/
923
1024#include "emu.h"
1125#include "cpu/ucom4/ucom4.h"
1226#include "sound/speaker.h"
1327
28// test-layouts - use external artwork
29#include "alnchase.lh"
30#include "edracula.lh"
1431#include "tmpacman.lh"
32#include "tmtennis.lh"
1533
1634
1735class hh_ucom4_state : public driver_device
r244652r244653
2947
3048   // devices
3149   required_device<cpu_device> m_maincpu;
32   optional_ioport_array<4> m_inp_matrix; // max 4
50   optional_ioport_array<3> m_inp_matrix; // max 3
3351   optional_device<speaker_sound_device> m_speaker;
3452   
3553   // misc common
3654   UINT16 m_inp_mux;
3755
56   UINT8 read_inputs(int columns);
57
3858   virtual void machine_start();
39   virtual void machine_reset();
4059
4160   // display common
4261   int m_display_wait;
r244652r244653
5372
5473   TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
5574   void display_update();
75   void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
5676
5777   // game-specific handlers
78   DECLARE_WRITE8_MEMBER(edracula_grid_w);
79   DECLARE_WRITE8_MEMBER(edracula_plate_w);
80   DECLARE_WRITE8_MEMBER(edracula_port_i_w);
5881   
82   DECLARE_READ8_MEMBER(tmtennis_input_r);
83   DECLARE_WRITE8_MEMBER(tmtennis_grid_w);
84   DECLARE_WRITE8_MEMBER(tmtennis_plate_w);
85   DECLARE_WRITE8_MEMBER(tmtennis_port_e_w);
86   void tmtennis_set_clock();
87   DECLARE_INPUT_CHANGED_MEMBER(tmtennis_difficulty_switch);
88   DECLARE_MACHINE_RESET(tmtennis);
89   
90   DECLARE_READ8_MEMBER(alnchase_input_r);
91   DECLARE_WRITE8_MEMBER(alnchase_display_w);
92   DECLARE_WRITE8_MEMBER(alnchase_port_e_w);
5993};
6094
6195
r244652r244653
87121}
88122
89123
90void hh_ucom4_state::machine_reset()
91{
92}
93124
94125/***************************************************************************
95126
r244652r244653
97128
98129***************************************************************************/
99130
100// LED segments
101#if 0
102enum
103{
104   lA = 0x01,
105   lB = 0x02,
106   lC = 0x04,
107   lD = 0x08,
108   lE = 0x10,
109   lF = 0x20,
110   lG = 0x40,
111   lDP = 0x80
112};
113#endif
114131
132
115133// The device strobes the outputs very fast, it is unnoticeable to the user.
116134// To prevent flickering here, we need to simulate a decay.
117135
r244652r244653
162180   display_update();
163181}
164182
183void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
184{
185   m_display_maxx = maxx;
186   m_display_maxy = maxy;
165187
188   // update current state
189   for (int y = 0; y < maxy; y++)
190      m_display_state[y] = (sety >> y & 1) ? setx : 0;
191   
192   display_update();
193}
166194
195
196UINT8 hh_ucom4_state::read_inputs(int columns)
197{
198   UINT8 ret = 0;
199
200   // read selected input rows
201   for (int i = 0; i < columns; i++)
202      if (m_inp_mux >> i & 1)
203         ret |= m_inp_matrix[i]->read();
204
205   return ret;
206}
207
208
167209/***************************************************************************
168210
169211  Minidrivers (I/O, Inputs, Machine Config)
r244652r244653
172214
173215/***************************************************************************
174216
175  Tomytronic Pac-Man (manufactured in Japan)
217  Epoch Dracula (manufactured in Japan)
218  * PCB label 96121
219  * NEC uCOM-43 MCU, labeled D553C 206
220  * cyan/red/green VFD display NEC FIP8BM20T (FIP=fluorescent indicator panel)
221
222  known releases:
223  - Japan: Dracula House, yellow case
224  - USA: Dracula, red case
225  - Other: Dracula, yellow case, published by Hales
226
227  NOTE!: MESS external artwork is recommended
228
229
230***************************************************************************/
231
232WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w)
233{
234   // port C/D: vfd matrix grid
235   int shift = (offset - NEC_UCOM4_PORTC) * 4;
236   m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
237
238   display_matrix(18, 8, m_plate, m_grid);
239}
240
241WRITE8_MEMBER(hh_ucom4_state::edracula_plate_w)
242{
243   // port E/F/G/H/I01: vfd matrix plate
244   int shift = (offset - NEC_UCOM4_PORTE) * 4;
245   m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
246
247   display_matrix(18, 8, m_plate, m_grid);
248}
249
250WRITE8_MEMBER(hh_ucom4_state::edracula_port_i_w)
251{
252   edracula_plate_w(space, offset, data & 3);
253
254   // I2: speaker out
255   m_speaker->level_w(data >> 2 & 1);
256}
257
258
259static INPUT_PORTS_START( edracula )
260   PORT_START("IN.0")
261   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT )
262   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START )
263   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
264   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
265
266   PORT_START("IN.1")
267   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
268   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
269   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
270   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
271INPUT_PORTS_END
272
273
274static MACHINE_CONFIG_START( edracula, hh_ucom4_state )
275
276   /* basic machine hardware */
277   MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
278   MCFG_UCOM4_READ_A_CB(IOPORT("IN.0"))
279   MCFG_UCOM4_READ_B_CB(IOPORT("IN.1"))
280   MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, edracula_grid_w))
281   MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, edracula_grid_w))
282   MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
283   MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
284   MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
285   MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
286   MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, edracula_port_i_w))
287
288   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
289   MCFG_DEFAULT_LAYOUT(layout_edracula)
290
291   /* no video! */
292
293   /* sound hardware */
294   MCFG_SPEAKER_STANDARD_MONO("mono")
295   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
296   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
297MACHINE_CONFIG_END
298
299
300
301
302/***************************************************************************
303
304  Tomy(tronic) Tennis (manufactured in Japan)
305  * board labeled TOMY TN-04 TENNIS
306  * NEC uCOM-44 MCU, labeled D552C 048
307  * VFD display NEC FIP11AM15T
308
309  The initial release of this game was in 1979, known as Pro-Tennis,
310  it has a D553 instead of D552, with just a little over 50% ROM used.
311
312  This is an early VFD simple electronic tennis game. Player 1 is on the right
313  side, player 2 or CPU on the left. Each player has six possible positions
314  where to hit the ball. A backdrop behind the VFD shows a tennis court.
315
316  NOTE!: MESS external artwork is recommended
317
318***************************************************************************/
319
320
321READ8_MEMBER(hh_ucom4_state::tmtennis_input_r)
322{
323   // port A/B: buttons
324   return ~read_inputs(2) >> (offset*4);
325}
326
327WRITE8_MEMBER(hh_ucom4_state::tmtennis_port_e_w)
328{
329   // E0/E1: input mux
330   // E2: speaker out
331   // E3: N/C
332   m_inp_mux = data & 3;
333   m_speaker->level_w(data >> 2 & 1);
334}
335
336WRITE8_MEMBER(hh_ucom4_state::tmtennis_plate_w)
337{
338   // port C/D/F: vfd matrix plate
339   if (offset == NEC_UCOM4_PORTF) offset--;
340   int shift = (offset - NEC_UCOM4_PORTC) * 4;
341   m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
342
343   display_matrix(12, 12, m_plate, m_grid);
344}
345
346WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w)
347{
348   // port G/H/I: vfd matrix grid
349   int shift = (offset - NEC_UCOM4_PORTG) * 4;
350   m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
351
352   display_matrix(12, 12, m_plate, m_grid);
353}
354
355
356
357/* Pro-Tennis physical button layout and labels is like this:
358
359    [SERVE] [1] [2] [3]       [3] [2] [1] [SERVE]
360            [4] [5] [6]       [6] [5] [4]
361
362    PRACTICE<--PRO1-->PRO2    1PLAYER<--OFF-->2PLAYER
363*/
364
365static INPUT_PORTS_START( tmtennis )
366   PORT_START("IN.0") // E0 port A/B
367   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Serve")
368   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Serve")
369   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
370   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 )
371   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
372   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 )
373   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
374   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 )
375
376   PORT_START("IN.1") // E1 port A/B
377   PORT_CONFNAME( 0x101, 0x100, DEF_STR( Difficulty ) ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_ucom4_state, tmtennis_difficulty_switch, NULL)
378   PORT_CONFSETTING(     0x001, "Practice" )
379   PORT_CONFSETTING(     0x100, "Pro 1" ) // -> tmtennis_difficulty_switch
380   PORT_CONFSETTING(     0x000, "Pro 2" )
381   PORT_CONFNAME( 0x02, 0x00, "Players" )
382   PORT_CONFSETTING(    0x00, "1" )
383   PORT_CONFSETTING(    0x02, "2" )
384   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
385   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
386   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
387   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2)
388   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
389   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2)
390INPUT_PORTS_END
391
392void hh_ucom4_state::tmtennis_set_clock()
393{
394   // MCU clock is from an LC circuit oscillating by default at ~360kHz,
395   // but on PRO1, the difficulty switch puts a capacitor across the LC circuit
396   // to slow it down to ~260kHz.
397   m_maincpu->set_unscaled_clock(m_inp_matrix[1]->read() & 0x100 ? 260000 : 360000);
398}
399
400INPUT_CHANGED_MEMBER(hh_ucom4_state::tmtennis_difficulty_switch)
401{
402   tmtennis_set_clock();
403}
404
405MACHINE_RESET_MEMBER(hh_ucom4_state, tmtennis)
406{
407   tmtennis_set_clock();
408}
409
410
411static MACHINE_CONFIG_START( tmtennis, hh_ucom4_state )
412
413   /* basic machine hardware */
414   MCFG_CPU_ADD("maincpu", NEC_D552, 360000) // see tmtennis_set_clock
415   MCFG_UCOM4_READ_A_CB(READ8(hh_ucom4_state, tmtennis_input_r))
416   MCFG_UCOM4_READ_B_CB(READ8(hh_ucom4_state, tmtennis_input_r))
417   MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w))
418   MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w))
419   MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, tmtennis_port_e_w))
420   MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w))
421   MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w))
422   MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w))
423   MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w))
424
425   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
426   MCFG_DEFAULT_LAYOUT(layout_tmtennis)
427
428   MCFG_MACHINE_RESET_OVERRIDE(hh_ucom4_state, tmtennis)
429
430   /* no video! */
431
432   /* sound hardware */
433   MCFG_SPEAKER_STANDARD_MONO("mono")
434   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
435   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
436MACHINE_CONFIG_END
437
438/***************************************************************************
439
440  Tomy(tronic) Pac-Man (manufactured in Japan)
176441  * boards are labeled TN-08 2E108E01
177442  * NEC uCOM-43 MCU, labeled D553C 160
178443  * cyan/red/green VFD display NEC FIP8AM18T
r244652r244653
184449  - UK: Puckman (Tomy), and also as Munchman, published by Grandstand
185450  - Australia: Pac Man-1, published by Futuretronics
186451
452  NOTE!: MESS external artwork is recommended
453
187454***************************************************************************/
188455
189456static INPUT_PORTS_START( tmpacman )
r244652r244653
207474
208475
209476
477/***************************************************************************
210478
479  Tomy Alien Chase (manufactured in Japan)
480  * boards are labeled TN-16 2E121B01
481  * NEC uCOM-43 MCU, labeled D553C 258
482  * red/green VFD display NEC FIP9AM24T with color overlay, 2-sided*
211483
484  *Player one views the VFD from the front (grid+filament side) while the
485  opposite player views it from the back side (through the conductive traces),
486  basically a mirror-image.
212487
488  This is a space-themed tabletop VFD electronic game. To start, simply
489  press [UP]. Hold a joystick direction to move around.
213490
491  NOTE!: MESS external artwork is recommended
492
493***************************************************************************/
494
495
496
497READ8_MEMBER(hh_ucom4_state::alnchase_input_r)
498{
499   // port A: buttons
500   return read_inputs(2);
501}
502
503WRITE8_MEMBER(hh_ucom4_state::alnchase_display_w)
504{
505   if (offset <= NEC_UCOM4_PORTE)
506   {
507      // C/D/E0: vfd matrix grid
508      int shift = (offset - NEC_UCOM4_PORTC) * 4;
509      m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
510
511      // C0(grid 0): input enable PL1
512      // D0(grid 4): input enable PL2
513      m_inp_mux = (m_grid & 1) | (m_grid >> 3 & 2);
514   }
515
516   if (offset >= NEC_UCOM4_PORTE)
517   {
518      // E23/F/G/H/I: vfd matrix plate
519      int shift = (offset - NEC_UCOM4_PORTE) * 4;
520      m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2;
521   }
522
523   display_matrix(17, 9, m_plate, m_grid);
524}
525
526WRITE8_MEMBER(hh_ucom4_state::alnchase_port_e_w)
527{
528   alnchase_display_w(space, offset, data);
529
530   // E1: speaker out
531   m_speaker->level_w(data >> 1 & 1);
532}
533
534/* physical button layout and labels is like this:
535
536    POWER SOUND LEVEL PLAYER
537     ON    ON    PRO   TWO        START
538      o     o     |     |
539      |     |     |     |       [joystick]
540      |     |     o     o
541     OFF   OFF   AMA   ONE     GAME 0,1,2,3
542
543    1 PLAYER SIDE
544
545    other player side only has a joystick
546*/
547
548static INPUT_PORTS_START( alnchase )
549   PORT_START("IN.0") // C0 port A
550   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
551   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
552   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
553   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
554
555   PORT_START("IN.1") // D0 port A
556   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right
557   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // "
558   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
559   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
560
561   PORT_START("IN.2") // port B
562   PORT_CONFNAME( 0x01, 0x01, "Players" )
563   PORT_CONFSETTING(    0x01, "1" )
564   PORT_CONFSETTING(    0x00, "2" )
565   PORT_CONFNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
566   PORT_CONFSETTING(    0x00, "Amateur" )
567   PORT_CONFSETTING(    0x02, "Professional" )
568   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
569INPUT_PORTS_END
570
571static MACHINE_CONFIG_START( alnchase, hh_ucom4_state )
572
573   /* basic machine hardware */
574   MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
575   MCFG_UCOM4_READ_A_CB(READ8(hh_ucom4_state, alnchase_input_r))
576   MCFG_UCOM4_READ_B_CB(IOPORT("IN.2"))
577   MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
578   MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
579   MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, alnchase_port_e_w))
580   MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
581   MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
582   MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
583   MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
584
585   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
586   MCFG_DEFAULT_LAYOUT(layout_alnchase)
587
588   /* no video! */
589
590   /* sound hardware */
591   MCFG_SPEAKER_STANDARD_MONO("mono")
592   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
593   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
594MACHINE_CONFIG_END
595
596
597
598
599
214600/***************************************************************************
215601
216602  Game driver(s)
217603
218604***************************************************************************/
219605
606ROM_START( edracula )
607   ROM_REGION( 0x0800, "maincpu", 0 )
608   ROM_LOAD( "d553c-206", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) )
609ROM_END
610
611
612ROM_START( tmtennis )
613   ROM_REGION( 0x0400, "maincpu", 0 )
614   ROM_LOAD( "d552c-048", 0x0000, 0x0400, CRC(78702003) SHA1(4d427d4dbeed901770c682338867f58c7b54eee3) )
615ROM_END
616
617
618
220619ROM_START( tmpacman )
221620   ROM_REGION( 0x0800, "maincpu", 0 )
222621   ROM_LOAD( "d553c-160", 0x0000, 0x0800, CRC(b21a8af7) SHA1(e3122be1873ce76a4067386bf250802776f0c2f9) )
223622ROM_END
224623
225624
226CONS( 1981, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING )
625ROM_START( alnchase )
626   ROM_REGION( 0x0800, "maincpu", 0 )
627   ROM_LOAD( "d553c-258", 0x0000, 0x0800, CRC(c5284ff5) SHA1(6a20aaacc9748f0e0335958f3cea482e36153704) )
628ROM_END
629
630
631
632CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
633
634CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
635CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING )
636CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
trunk/src/mess/drivers/mbee.c
r244652r244653
8888    3. At the Basic prompt, type in EDASM press enter. At the memory size
8989       prompt press enter. Now, make sure the keyboard works properly.
9090
91    How to use the config switch for PIO B7:
92    - Teleterm: Must use RTC. Anything else makes teleterm go crazy.
93    - 256TC, 128, 128p: Doesn't seem to matter, leave at the default.
94    - Standard: Has no effect, best left at "Tied High"
95    - Other rom-based models: "VS" to make the Telcom clock work, or "Tied high".
96    - 56k: not sure yet, leave as "Tied high" until more is known.
97
98    How to use programs that need functions keys on models that use the old
99    keyboard (for example, to run Simply Write on a 128k model).
100    Press Ctrl+Shift+number, eg for F1 press hold down Ctrl Shift, press 1.
101
91102***************************************************************************
92103
93104    TODO/not working:
r244652r244653
108119      crashes due to a bug in z80pio emulation.
109120
110121    - 256tc: Keyboard ROM U60 needs to be dumped.
111    - 128k: GOLD PAL needs to be dumped for the bankswitching.
112    - 64k: RED PAL needs to be dumped for the bankswitching.
122    - 128k, 64k: PALs need to be dumped for the bankswitching.
113123
114    - Teleterm: keyboard has multiple severe problems. Also, the schematic shows
115                it using the old-style keyboard, however this must be wrong since
116                the computer has function keys, which are only available on the
117                new keyboard.
124    - Teleterm: keyboard has problems. The schematic shows it using the old-style keyboard,
125                however it actually uses the new keyboard with interrupts.
118126
119127    - Mouse: a few programs support the use of a serial mouse which interfaced
120128             directly to the Z80PIO. However there's little info to be found.
r244652r244653
135143
136144static ADDRESS_MAP_START(mbee_mem, AS_PROGRAM, 8, mbee_state)
137145   ADDRESS_MAP_UNMAP_HIGH
138   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
139   AM_RANGE(0x1000, 0x3fff) AM_RAM
140   AM_RANGE(0x4000, 0x7fff) AM_WRITENOP    // Needed because quickload to here will crash MESS
146   AM_RANGE(0x0000, 0x3fff) AM_RAM
141147   AM_RANGE(0x8000, 0xefff) AM_ROM
142   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
143   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbee_high_r, mbee_high_w)
148   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(video_low_r, video_low_w)
149   AM_RANGE(0xf800, 0xffff) AM_READWRITE(video_high_r, video_high_w)
144150ADDRESS_MAP_END
145151
146152static ADDRESS_MAP_START(mbeeic_mem, AS_PROGRAM, 8, mbee_state)
147   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
148   AM_RANGE(0x1000, 0x7fff) AM_RAM
153   AM_RANGE(0x0000, 0x7fff) AM_RAM
149154   AM_RANGE(0x8000, 0xbfff) AM_ROM
150155   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("pak")
151156   AM_RANGE(0xe000, 0xefff) AM_ROM
152   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
153   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeic_high_r, mbeeic_high_w)
157   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(video_low_r, video_low_w)
158   AM_RANGE(0xf800, 0xffff) AM_READWRITE(video_high_r, video_high_w)
154159ADDRESS_MAP_END
155160
156161static ADDRESS_MAP_START(mbeepc_mem, AS_PROGRAM, 8, mbee_state)
157   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
158   AM_RANGE(0x1000, 0x7fff) AM_RAM
162   AM_RANGE(0x0000, 0x7fff) AM_RAM
159163   AM_RANGE(0x8000, 0xbfff) AM_ROM
160164   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("pak")
161165   AM_RANGE(0xe000, 0xefff) AM_ROMBANK("telcom")
162   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
163   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeic_high_r, mbeeic_high_w)
166   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(video_low_r, video_low_w)
167   AM_RANGE(0xf800, 0xffff) AM_READWRITE(video_high_r, video_high_w)
164168ADDRESS_MAP_END
165169
166static ADDRESS_MAP_START(mbeepc85_mem, AS_PROGRAM, 8, mbee_state)
167   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
168   AM_RANGE(0x1000, 0x7fff) AM_RAM
169   AM_RANGE(0x8000, 0xbfff) AM_ROM
170   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("pak")
171   AM_RANGE(0xe000, 0xefff) AM_ROMBANK("telcom")
172   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
173   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeic_high_r, mbeeic_high_w)
174ADDRESS_MAP_END
175
176170static ADDRESS_MAP_START(mbeeppc_mem, AS_PROGRAM, 8, mbee_state)
177   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
178   AM_RANGE(0x1000, 0x7fff) AM_RAM
171   AM_RANGE(0x0000, 0x7fff) AM_RAM
179172   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("basic")
180173   AM_RANGE(0xa000, 0xbfff) AM_ROM
181174   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("pak")
182175   AM_RANGE(0xe000, 0xefff) AM_ROMBANK("telcom")
183   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbeeppc_low_r, mbeeppc_low_w)
184   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeppc_high_r, mbeeppc_high_w)
176   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(video_low_r, video_low_w)
177   AM_RANGE(0xf800, 0xffff) AM_READWRITE(video_high_r, video_high_w)
185178ADDRESS_MAP_END
186179
187180static ADDRESS_MAP_START(mbee56_mem, AS_PROGRAM, 8, mbee_state)
188   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
189   AM_RANGE(0x1000, 0xdfff) AM_RAM
181   AM_RANGE(0x0000, 0xdfff) AM_RAM
190182   AM_RANGE(0xe000, 0xefff) AM_ROM
191   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_low_r, mbee_low_w)
192   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeic_high_r, mbeeic_high_w)
183   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(video_low_r, video_low_w)
184   AM_RANGE(0xf800, 0xffff) AM_READWRITE(video_high_r, video_high_w)
193185ADDRESS_MAP_END
194186
195187static ADDRESS_MAP_START(mbee256_mem, AS_PROGRAM, 8, mbee_state)
r244652r244653
212204ADDRESS_MAP_END
213205
214206static ADDRESS_MAP_START(mbeett_mem, AS_PROGRAM, 8, mbee_state)
215   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
216   AM_RANGE(0x1000, 0x7fff) AM_RAM
207   AM_RANGE(0x0000, 0x7fff) AM_RAM
217208   AM_RANGE(0x8000, 0x9fff) AM_ROM
218209   AM_RANGE(0xa000, 0xbfff) AM_RAM
219210   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("pak")
220211   AM_RANGE(0xe000, 0xefff) AM_ROMBANK("telcom")
221   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbeeppc_low_r, mbeeppc_low_w)
222   AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbeeppc_high_r, mbeeppc_high_w)
212   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(video_low_r, video_low_w)
213   AM_RANGE(0xf800, 0xffff) AM_READWRITE(video_high_r, video_high_w)
223214ADDRESS_MAP_END
224215
225216static ADDRESS_MAP_START(mbee_io, AS_IO, 8, mbee_state)
226217   ADDRESS_MAP_GLOBAL_MASK(0xff)
227218   ADDRESS_MAP_UNMAP_HIGH
228219   AM_RANGE(0x00, 0x03) AM_MIRROR(0x10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
229   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
220   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_WRITE(port0b_w)
230221   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
231222   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
232223ADDRESS_MAP_END
r244652r244653
235226   ADDRESS_MAP_GLOBAL_MASK(0xff)
236227   ADDRESS_MAP_UNMAP_HIGH
237228   AM_RANGE(0x00, 0x03) AM_MIRROR(0x10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
238   AM_RANGE(0x08, 0x08) AM_MIRROR(0x10) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
239   AM_RANGE(0x09, 0x09) AM_MIRROR(0x10) AM_NOP /* Listed as "Colour Wait Off" or "USART 2651" but doesn't appear in the schematics */
240   AM_RANGE(0x0a, 0x0a) AM_MIRROR(0x10) AM_READWRITE(mbeeic_0a_r, mbeeic_0a_w)
241   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
229   AM_RANGE(0x08, 0x08) AM_MIRROR(0x10) AM_READWRITE(port08_r, port08_w)
230   AM_RANGE(0x09, 0x09) AM_WRITENOP /* Listed as "Colour Wait Off" or "USART 2651" but doesn't appear in the schematics */
231   AM_RANGE(0x0a, 0x0a) AM_MIRROR(0x10) AM_WRITE(port0a_w)
232   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_WRITE(port0b_w)
242233   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
243234   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
244235ADDRESS_MAP_END
r244652r244653
246237static ADDRESS_MAP_START(mbeepc_io, AS_IO, 8, mbee_state)
247238   ADDRESS_MAP_UNMAP_HIGH
248239   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
249   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
250   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_low_r, mbeeic_0a_w)
251   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
240   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(port08_r, port08_w)
241   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITENOP
242   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_WRITE(port0b_w)
252243   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff10) AM_READWRITE(m6545_status_r, m6545_index_w)
253244   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_READWRITE(m6545_data_r, m6545_data_w)
254   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_high_r, mbeeic_0a_w)
245   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_low_r, port0a_w)
246   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_high_r, port0a_w)
255247ADDRESS_MAP_END
256248
257static ADDRESS_MAP_START(mbeepc85_io, AS_IO, 8, mbee_state)
249static ADDRESS_MAP_START(mbeeppc_io, AS_IO, 8, mbee_state)
258250   ADDRESS_MAP_UNMAP_HIGH
259251   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
260   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
261   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_low_r, mbeeic_0a_w)
262   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
263   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff10) AM_READWRITE(m6545_status_r, m6545_index_w)
252   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(port08_r, port08_w)
253   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITENOP
254   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_WRITE(port0b_w)
255   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
264256   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_READWRITE(m6545_data_r, m6545_data_w)
265   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_high_r, mbeeic_0a_w)
257   AM_RANGE(0x001c, 0x001c) AM_MIRROR(0xff00) AM_READWRITE(port1c_r, port1c_w)
258   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_low_r, port0a_w)
259   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_high_r, port0a_w)
266260ADDRESS_MAP_END
267261
268static ADDRESS_MAP_START(mbeeppc_io, AS_IO, 8, mbee_state)
262static ADDRESS_MAP_START(mbeett_io, AS_IO, 8, mbee_state)
269263   ADDRESS_MAP_UNMAP_HIGH
270   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
271   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
272   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_low_r, mbeeic_0a_w)
273   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
264   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff00) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
265   AM_RANGE(0x0004, 0x0004) AM_MIRROR(0xff00) AM_WRITE(port04_w)
266   AM_RANGE(0x0006, 0x0006) AM_MIRROR(0xff00) AM_WRITE(port06_w)
267   AM_RANGE(0x0007, 0x0007) AM_MIRROR(0xff00) AM_READ(port07_r)
268   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(port08_r, port08_w)
269   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_WRITE(port0b_w)
274270   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
275   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_READWRITE(m6545_data_r, m6545_data_w)
276   AM_RANGE(0x001c, 0x001c) AM_MIRROR(0xff00) AM_READWRITE(mbeeppc_1c_r, mbeeppc_1c_w)
277   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_high_r, mbeeic_0a_w)
271   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_READWRITE(m6545_data_r, m6545_data_w)
272   AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(port18_r)
273   AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(port1c_r, port1c_w)
274   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xfe00) AM_READ(speed_low_r)
275   AM_RANGE(0x0109, 0x0109) AM_MIRROR(0xfe00) AM_READ(speed_high_r)
276   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe00) AM_READWRITE(telcom_low_r, port0a_w)
277   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe00) AM_READWRITE(telcom_high_r, port0a_w)
278   AM_RANGE(0x0068, 0x006f) AM_MIRROR(0xff00) AM_DEVREADWRITE("scc", scc8530_t, reg_r, reg_w)
278279ADDRESS_MAP_END
279280
280281static ADDRESS_MAP_START(mbee56_io, AS_IO, 8, mbee_state)
281282   ADDRESS_MAP_GLOBAL_MASK(0xff)
282283   ADDRESS_MAP_UNMAP_HIGH
283   AM_RANGE(0x00, 0x03) AM_MIRROR(0x10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
284   AM_RANGE(0x08, 0x08) AM_MIRROR(0x10) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
285   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_READWRITE(mbee_0b_r, mbee_0b_w)
286   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
287   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
284   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
285   AM_RANGE(0x08, 0x08) AM_READWRITE(port08_r, port08_w)
286   AM_RANGE(0x09, 0x09) AM_WRITENOP
287   AM_RANGE(0x0b, 0x0b) AM_WRITE(port0b_w)
288   AM_RANGE(0x0c, 0x0c) AM_READWRITE(m6545_status_r, m6545_index_w)
289   AM_RANGE(0x0d, 0x0d) AM_READWRITE(m6545_data_r, m6545_data_w)
288290   AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
289291   AM_RANGE(0x48, 0x4f) AM_READWRITE(fdc_status_r, fdc_motor_w)
290292ADDRESS_MAP_END
r244652r244653
293295   ADDRESS_MAP_GLOBAL_MASK(0xff)
294296   ADDRESS_MAP_UNMAP_HIGH
295297   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
296   AM_RANGE(0x04, 0x04) AM_WRITE(mbee_04_w)
297   AM_RANGE(0x06, 0x06) AM_WRITE(mbee_06_w)
298   AM_RANGE(0x07, 0x07) AM_READ(mbee_07_r)
299   AM_RANGE(0x08, 0x08) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
300   AM_RANGE(0x0b, 0x0b) AM_READWRITE(mbee_0b_r, mbee_0b_w)
298   AM_RANGE(0x04, 0x04) AM_WRITE(port04_w)
299   AM_RANGE(0x06, 0x06) AM_WRITE(port06_w)
300   AM_RANGE(0x07, 0x07) AM_READ(port07_r)
301   AM_RANGE(0x08, 0x08) AM_READWRITE(port08_r, port08_w)
302   AM_RANGE(0x09, 0x09) AM_WRITENOP
303   AM_RANGE(0x0b, 0x0b) AM_WRITE(port0b_w)
301304   AM_RANGE(0x0c, 0x0c) AM_READWRITE(m6545_status_r, m6545_index_w)
302305   AM_RANGE(0x0d, 0x0d) AM_READWRITE(m6545_data_r, m6545_data_w)
303   AM_RANGE(0x1c, 0x1f) AM_READWRITE(mbeeppc_1c_r, mbee256_1c_w)
306   AM_RANGE(0x1c, 0x1f) AM_READWRITE(port1c_r, port1c_w)
304307   AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
305308   AM_RANGE(0x48, 0x4f) AM_READWRITE(fdc_status_r, fdc_motor_w)
306309   AM_RANGE(0x50, 0x57) AM_WRITE(mbee128_50_w)
r244652r244653
309312static ADDRESS_MAP_START(mbee256_io, AS_IO, 8, mbee_state)
310313   ADDRESS_MAP_UNMAP_HIGH
311314   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff00) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
312   AM_RANGE(0x0004, 0x0004) AM_MIRROR(0xff00) AM_WRITE(mbee_04_w)
313   AM_RANGE(0x0006, 0x0006) AM_MIRROR(0xff00) AM_WRITE(mbee_06_w)
314   AM_RANGE(0x0007, 0x0007) AM_MIRROR(0xff00) AM_READ(mbee_07_r)
315   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
316   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xfd00) AM_READ(mbee256_speed_low_r)
317   AM_RANGE(0x0209, 0x0209) AM_MIRROR(0xfd00) AM_READ(mbee256_speed_high_r)
318   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_READWRITE(mbee_0b_r, mbee_0b_w)
315   AM_RANGE(0x0004, 0x0004) AM_MIRROR(0xff00) AM_WRITE(port04_w)
316   AM_RANGE(0x0006, 0x0006) AM_MIRROR(0xff00) AM_WRITE(port06_w)
317   AM_RANGE(0x0007, 0x0007) AM_MIRROR(0xff00) AM_READ(port07_r)
318   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(port08_r, port08_w)
319   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xfd00) AM_READ(speed_low_r)
320   AM_RANGE(0x0209, 0x0209) AM_MIRROR(0xfd00) AM_READ(speed_high_r)
321   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITENOP
322   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_WRITE(port0b_w)
319323   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
320324   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_READWRITE(m6545_data_r, m6545_data_w)
321325   // AM_RANGE(0x0010, 0x0013) AM_MIRROR(0xff00) Optional SN76489AN audio chip
322   AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(mbee256_18_r)
323   AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(mbeeppc_1c_r, mbee256_1c_w)
326   AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(port18_r)
327   AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(port1c_r, port1c_w)
324328   AM_RANGE(0x0044, 0x0047) AM_MIRROR(0xff00) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
325329   AM_RANGE(0x0048, 0x004f) AM_MIRROR(0xff00) AM_READWRITE(fdc_status_r, fdc_motor_w)
326330   AM_RANGE(0x0050, 0x0057) AM_MIRROR(0xff00) AM_WRITE(mbee256_50_w)
r244652r244653
329333   // AM_RANGE(0x0068, 0x006f) AM_MIRROR(0xff00) Reserved for 8530 SCC (unused)
330334ADDRESS_MAP_END
331335
332static ADDRESS_MAP_START(mbeett_io, AS_IO, 8, mbee_state)
333   ADDRESS_MAP_UNMAP_HIGH
334   AM_RANGE(0x0000, 0x0003) AM_MIRROR(0xff00) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
335   AM_RANGE(0x0004, 0x0004) AM_MIRROR(0xff00) AM_WRITE(mbee_04_w)
336   AM_RANGE(0x0006, 0x0006) AM_MIRROR(0xff00) AM_WRITE(mbee_06_w)
337   AM_RANGE(0x0007, 0x0007) AM_MIRROR(0xff00) AM_READ(mbee_07_r)
338   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(mbeeic_08_r, mbeeic_08_w)
339   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_READWRITE(mbee_0b_r, mbee_0b_w)
340   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
341   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_READWRITE(m6545_data_r, m6545_data_w)
342   AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(mbee256_18_r)
343   AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(mbeeppc_1c_r,mbee256_1c_w)
344   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_low_r, mbeeic_0a_w)
345   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(mbeepc_telcom_high_r, mbeeic_0a_w)
346   // AM_RANGE(0x0068, 0x006f) AM_MIRROR(0xff00) 8530 SCC
347ADDRESS_MAP_END
348
349336static INPUT_PORTS_START( mbee )
350337   PORT_START("X.0") /* IN0 KEY ROW 0 [000] */
351338   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("@") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') PORT_CHAR('`')
r244652r244653
419406
420407   PORT_START("X.7") /* IN7 KEY ROW 7 [380] */
421408   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Up)") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
422   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL)
409   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
423410   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Down)") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
424411   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Left)") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
425412   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
r244652r244653
444431   PORT_CONFNAME( 0xc0, 0x80, "PIO B7")
445432   PORT_CONFSETTING(    0x00, "VS") // sync pulse to enable telcom clock
446433   PORT_CONFSETTING(    0x40, "RTC") // optional board usually not fitted
447   PORT_CONFSETTING(    0x80, "Not used") // default resistor to vcc
448   PORT_CONFSETTING(    0xc0, "Centronics") // busy line
434   PORT_CONFSETTING(    0x80, "Tied high") // default resistor to vcc
435   PORT_CONFSETTING(    0xc0, "Reserved for net")
449436INPUT_PORTS_END
450437
451438static INPUT_PORTS_START( mbee256 )
r244652r244653
576563   PORT_CONFSETTING(    0x00, DEF_STR(No))
577564   PORT_CONFSETTING(    0x01, DEF_STR(Yes))
578565   // Wire links on motherboard
579   PORT_CONFNAME( 0xc0, 0x80, "PIO B7") // default - do nothing
566   PORT_CONFNAME( 0xc0, 0x40, "PIO B7")
580567   PORT_CONFSETTING(    0x00, "VS") // sync pulse to enable telcom clock
581   PORT_CONFSETTING(    0x40, "RTC") // optional board usually not fitted
582   PORT_CONFSETTING(    0x80, "Not used") // default resistor to vcc
583   PORT_CONFSETTING(    0xc0, "Centronics") // busy line
568   PORT_CONFSETTING(    0x40, "RTC") // RTC IRQ must be used on teleterm
569   PORT_CONFSETTING(    0x80, "Tied high") // default resistor to vcc
570   PORT_CONFSETTING(    0xc0, "Reserved for net")
584571INPUT_PORTS_END
585572
586573static const z80_daisy_config mbee_daisy_chain[] =
r244652r244653
744731   MCFG_CPU_IO_MAP(mbeepc_io)
745732MACHINE_CONFIG_END
746733
747static MACHINE_CONFIG_DERIVED( mbeepc85, mbeeic )
748   MCFG_CPU_MODIFY( "maincpu" )
749   MCFG_CPU_PROGRAM_MAP(mbeepc85_mem)
750   MCFG_CPU_IO_MAP(mbeepc85_io)
751MACHINE_CONFIG_END
752
753static MACHINE_CONFIG_DERIVED( mbeepc85b, mbeepc85 )
734static MACHINE_CONFIG_DERIVED( mbeepc85b, mbeepc )
754735   MCFG_PALETTE_MODIFY("palette")
755736   MCFG_PALETTE_INIT_OWNER(mbee_state, mbeepc85b)
756737MACHINE_CONFIG_END
r244652r244653
764745   MCFG_PALETTE_MODIFY("palette")
765746   MCFG_PALETTE_ENTRIES(16)
766747   MCFG_PALETTE_INIT_OWNER(mbee_state, premium)
748   MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
749   MCFG_MC146818_IRQ_HANDLER(WRITELINE(mbee_state, rtc_irq_w))
767750MACHINE_CONFIG_END
768751
769752static MACHINE_CONFIG_DERIVED( mbee56, mbeeic )
r244652r244653
784767   MCFG_CPU_IO_MAP(mbee128_io)
785768   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128)
786769   MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
770   MCFG_MC146818_IRQ_HANDLER(WRITELINE(mbee_state, rtc_irq_w))
787771MACHINE_CONFIG_END
788772
789773static MACHINE_CONFIG_DERIVED( mbee128p, mbeeppc )
r244652r244653
791775   MCFG_CPU_PROGRAM_MAP(mbee256_mem)
792776   MCFG_CPU_IO_MAP(mbee128_io)
793777   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128)
794   MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
795778   MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
796779   MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w))
797780   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
r244652r244653
816799   MCFG_CPU_PROGRAM_MAP(mbeett_mem)
817800   MCFG_CPU_IO_MAP(mbeett_io)
818801   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbeett)
819   MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
802   MCFG_DEVICE_REMOVE("quickload")
803   MCFG_DEVICE_REMOVE("quickload2")
804   MCFG_DEVICE_ADD("scc", SCC8530, 4000000) // clock unknown
820805MACHINE_CONFIG_END
821806
822807/* Unused roms:
r244652r244653
11521137COMP( 1982, mbee,     0,        0,      mbee,     mbee,     mbee_state,  mbee,       "Applied Technology",  "Microbee 16 Standard" , 0 )
11531138COMP( 1982, mbeeic,   mbee,     0,      mbeeic,   mbee,     mbee_state,  mbeeic,     "Applied Technology",  "Microbee 32 IC" , 0 )
11541139COMP( 1982, mbeepc,   mbee,     0,      mbeepc,   mbee,     mbee_state,  mbeepc,     "Applied Technology",  "Microbee Personal Communicator" , 0 )
1155COMP( 1985, mbeepc85, mbee,     0,      mbeepc85, mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85" , 0 )
1140COMP( 1985, mbeepc85, mbee,     0,      mbeepc,  mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85" , 0 )
11561141COMP( 1985, mbeepc85b,mbee,     0,      mbeepc85b,mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85 (New version)" , 0 )
1157COMP( 1985, mbeepc85s,mbee,     0,      mbeepc85, mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85 (Swedish)" , 0 )
1142COMP( 1985, mbeepc85s,mbee,     0,      mbeepc,  mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85 (Swedish)" , 0 )
11581143COMP( 1986, mbeeppc,  mbee,     0,      mbeeppc,  mbee,     mbee_state,  mbeeppc,    "Applied Technology",  "Microbee Premium PC85" , 0 )
11591144COMP( 1986, mbeett,   mbee,     0,      mbeett,   mbee256,  mbee_state,  mbeett,     "Applied Technology",  "Microbee Teleterm" , GAME_NOT_WORKING )
11601145COMP( 1986, mbee56,   mbee,     0,      mbee56,   mbee,     mbee_state,  mbee56,     "Applied Technology",  "Microbee 56k" , GAME_NOT_WORKING )
trunk/src/mess/drivers/tmtennis.c
r244652r244653
1// license:BSD-3-Clause
2// copyright-holders:hap
3/***************************************************************************
4
5  Tomy Tennis (manufactured in Japan)
6  * board labeled TOMY TN-04 TENNIS
7  * NEC uCOM-44 MCU, labeled D552C 048
8  * VFD display NEC FIP11AM15T (FIP=fluorescent indicator panel)
9
10  The initial release of this game was in 1979, known as Pro-Tennis,
11  it is unknown if the hardware and/or ROM contents differ.
12
13  This is an early VFD simple electronic tennis game. Player 1 is on the right
14  side, player 2 or CPU on the left. Each player has six possible positions
15  where to hit the ball. A backdrop behind the VFD shows a tennis court.
16
17  NOTE!: MESS external artwork is required to be able to play
18
19
20  TODO:
21  - display should go off when sound is played, needs decay simulation?
22
23***************************************************************************/
24
25#include "emu.h"
26#include "cpu/ucom4/ucom4.h"
27#include "sound/speaker.h"
28
29#include "tmtennis.lh" // this is a test layout, external artwork is necessary
30
31
32class tmtennis_state : public driver_device
33{
34public:
35   tmtennis_state(const machine_config &mconfig, device_type type, const char *tag)
36      : driver_device(mconfig, type, tag),
37      m_maincpu(*this, "maincpu"),
38      m_button_matrix(*this, "IN"),
39      m_speaker(*this, "speaker")
40   { }
41
42   required_device<cpu_device> m_maincpu;
43   required_ioport_array<2> m_button_matrix;
44   required_device<speaker_sound_device> m_speaker;
45
46   UINT8 m_input_mux;
47   UINT16 m_plate;
48   UINT16 m_grid;
49
50   DECLARE_READ8_MEMBER(input_r);
51   DECLARE_WRITE8_MEMBER(port_e_w);
52   DECLARE_WRITE8_MEMBER(plate_w);
53   DECLARE_WRITE8_MEMBER(grid_w);
54
55   DECLARE_INPUT_CHANGED_MEMBER(difficulty_switch);
56   void update_clock();
57
58   UINT16 m_vfd_state[0x10];
59   void update_vfd();
60
61   virtual void machine_reset();
62   virtual void machine_start();
63};
64
65// master clock is from an LC circuit oscillating by default at 360kHz, but...
66#define MASTER_CLOCK (360000)
67
68void tmtennis_state::update_clock()
69{
70   // ...on PRO1, the difficulty switch puts a capacitor across the LC circuit
71   // to slow it down to approx. 260kHz (28%)
72   m_maincpu->set_clock_scale(m_button_matrix[1]->read() & 0x100 ? 0.72 : 1);
73}
74
75
76
77/***************************************************************************
78
79  Display
80
81***************************************************************************/
82
83void tmtennis_state::update_vfd()
84{
85   for (int i = 0; i < 12; i++)
86      if (m_grid & (1 << i) && m_vfd_state[i] != m_plate)
87      {
88         // on difference, send to output
89         for (int j = 0; j < 12; j++)
90            output_set_lamp_value(i*100 + j, m_plate >> j & 1);
91
92         m_vfd_state[i] = m_plate;
93      }
94}
95
96
97
98/***************************************************************************
99
100  I/O
101
102***************************************************************************/
103
104READ8_MEMBER(tmtennis_state::input_r)
105{
106   // port A/B: buttons
107   UINT8 inp = 0xff;
108
109   // read selected button rows
110   for (int i = 0; i < 2; i++)
111      if (m_input_mux >> i & 1)
112         inp &= m_button_matrix[i]->read();
113
114   return inp >> (offset*4);
115}
116
117WRITE8_MEMBER(tmtennis_state::port_e_w)
118{
119   // E0/E1: input mux
120   // E2: speaker out
121   // E3: N/C
122   m_input_mux = data & 3;
123   m_speaker->level_w(data >> 2 & 1);
124}
125
126WRITE8_MEMBER(tmtennis_state::plate_w)
127{
128   // port C/D/F: vfd matrix plate
129   if (offset == NEC_UCOM4_PORTF) offset--;
130   int shift = (offset - NEC_UCOM4_PORTC) * 4;
131   m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
132
133   update_vfd();
134}
135
136WRITE8_MEMBER(tmtennis_state::grid_w)
137{
138   // port G/H/I: vfd matrix grid
139   int shift = (offset - NEC_UCOM4_PORTG) * 4;
140   m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
141
142   update_vfd();
143}
144
145
146
147/***************************************************************************
148
149  Inputs
150
151***************************************************************************/
152
153INPUT_CHANGED_MEMBER(tmtennis_state::difficulty_switch)
154{
155   update_clock();
156}
157
158/* Pro-Tennis physical button layout and labels is like this:
159
160    [SERVE] [1] [2] [3]       [3] [2] [1] [SERVE]
161            [4] [5] [6]       [6] [5] [4]
162
163    PRACTICE<--PRO1-->PRO2    1PLAYER<--OFF-->2PLAYER
164*/
165
166static INPUT_PORTS_START( tmtennis )
167   PORT_START("IN.0") // E0 port A/B
168   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Serve")
169   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Serve")
170   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
171   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
172   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
173   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 )
174   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
175   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 )
176
177   PORT_START("IN.1") // E1 port A/B
178   PORT_CONFNAME( 0x101, 0x101, DEF_STR( Difficulty ) ) PORT_CHANGED_MEMBER(DEVICE_SELF, tmtennis_state, difficulty_switch, NULL)
179   PORT_CONFSETTING(     0x000, "Practice" )
180   PORT_CONFSETTING(     0x101, "Pro 1" ) // -> difficulty_switch
181   PORT_CONFSETTING(     0x001, "Pro 2" )
182   PORT_CONFNAME( 0x02, 0x02, "Players" )
183   PORT_CONFSETTING(    0x02, "1" )
184   PORT_CONFSETTING(    0x00, "2" )
185   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
186   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
187   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
188   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
189   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
190   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
191INPUT_PORTS_END
192
193
194
195/***************************************************************************
196
197  Machine Config
198
199***************************************************************************/
200
201void tmtennis_state::machine_reset()
202{
203   update_clock();
204}
205
206void tmtennis_state::machine_start()
207{
208   // zerofill
209   memset(m_vfd_state, 0, sizeof(m_vfd_state));
210   m_input_mux = 0;
211   m_plate = 0;
212   m_grid = 0;
213
214   // register for savestates
215   save_item(NAME(m_vfd_state));
216   save_item(NAME(m_input_mux));
217   save_item(NAME(m_plate));
218   save_item(NAME(m_grid));
219}
220
221
222static MACHINE_CONFIG_START( tmtennis, tmtennis_state )
223
224   /* basic machine hardware */
225   MCFG_CPU_ADD("maincpu", NEC_D552, MASTER_CLOCK)
226   MCFG_UCOM4_READ_A_CB(READ8(tmtennis_state, input_r))
227   MCFG_UCOM4_READ_B_CB(READ8(tmtennis_state, input_r))
228   MCFG_UCOM4_WRITE_C_CB(WRITE8(tmtennis_state, plate_w))
229   MCFG_UCOM4_WRITE_D_CB(WRITE8(tmtennis_state, plate_w))
230   MCFG_UCOM4_WRITE_E_CB(WRITE8(tmtennis_state, port_e_w))
231   MCFG_UCOM4_WRITE_F_CB(WRITE8(tmtennis_state, plate_w))
232   MCFG_UCOM4_WRITE_G_CB(WRITE8(tmtennis_state, grid_w))
233   MCFG_UCOM4_WRITE_H_CB(WRITE8(tmtennis_state, grid_w))
234   MCFG_UCOM4_WRITE_I_CB(WRITE8(tmtennis_state, grid_w))
235
236   MCFG_DEFAULT_LAYOUT(layout_tmtennis)
237
238   /* no video! */
239
240   /* sound hardware */
241   MCFG_SPEAKER_STANDARD_MONO("mono")
242   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
243   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
244MACHINE_CONFIG_END
245
246
247
248/***************************************************************************
249
250  Game driver(s)
251
252***************************************************************************/
253
254ROM_START( tmtennis )
255   ROM_REGION( 0x0400, "maincpu", 0 )
256   ROM_LOAD( "d552c-048", 0x0000, 0x0400, CRC(78702003) SHA1(4d427d4dbeed901770c682338867f58c7b54eee3) )
257ROM_END
258
259
260CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
trunk/src/mess/drivers/wildfire.c
r244652r244653
99  to create the illusion of a moving ball, and even the flippers are leds.
1010  A drawing of a pinball table is added as overlay.
1111
12  NOTE!: MESS external artwork is required to be able to play
12  NOTE!: MESS external artwork is recommended
1313
1414
1515  TODO:
r244652r244653
2525#include "cpu/amis2000/amis2000.h"
2626#include "sound/speaker.h"
2727
28#include "wildfire.lh" // this is a test layout, external artwork is necessary
28#include "wildfire.lh" // this is a test layout, use external artwork
2929
3030// master clock is a single stage RC oscillator: R=?K, C=?pf,
3131// S2000 default frequency is 850kHz
trunk/src/mess/includes/mbee.h
r244652r244653
1010#include "emu.h"
1111#include "imagedev/snapquik.h"
1212#include "machine/z80pio.h"
13#include "machine/8530scc.h"
1314#include "imagedev/cassette.h"
1415#include "machine/buffer.h"
1516#include "bus/centronics/ctronics.h"
r244652r244653
2728public:
2829   enum
2930   {
30      TIMER_MBEE_NEWKB,
31      TIMER_MBEE_RTC_IRQ,
32      TIMER_MBEE_BOOT
31      TIMER_MBEE_NEWKB
3332   };
3433
3534   mbee_state(const machine_config &mconfig, device_type type, const char *tag)
r244652r244653
4746      , m_floppy0(*this, "fdc:0")
4847      , m_floppy1(*this, "fdc:1")
4948      , m_rtc(*this, "rtc")
50      , m_boot(*this, "boot")
5149      , m_pak(*this, "pak")
5250      , m_telcom(*this, "telcom")
5351      , m_basic(*this, "basic")
r244652r244653
5856      , m_screen(*this, "screen")
5957   { }
6058
61   DECLARE_WRITE8_MEMBER(mbee_04_w);
62   DECLARE_WRITE8_MEMBER(mbee_06_w);
63   DECLARE_READ8_MEMBER(mbee_07_r);
64   DECLARE_READ8_MEMBER(mbeeic_0a_r);
65   DECLARE_WRITE8_MEMBER(mbeeic_0a_w);
66   DECLARE_READ8_MEMBER(mbeepc_telcom_low_r);
67   DECLARE_READ8_MEMBER(mbeepc_telcom_high_r);
68   DECLARE_READ8_MEMBER(mbee256_speed_low_r);
69   DECLARE_READ8_MEMBER(mbee256_speed_high_r);
70   DECLARE_READ8_MEMBER(mbee256_18_r);
59   DECLARE_WRITE8_MEMBER(port04_w);
60   DECLARE_WRITE8_MEMBER(port06_w);
61   DECLARE_READ8_MEMBER(port07_r);
62   DECLARE_READ8_MEMBER(port08_r);
63   DECLARE_WRITE8_MEMBER(port08_w);
64   DECLARE_WRITE8_MEMBER(port0a_w);
65   DECLARE_WRITE8_MEMBER(port0b_w);
66   DECLARE_READ8_MEMBER(port18_r);
67   DECLARE_READ8_MEMBER(port1c_r);
68   DECLARE_WRITE8_MEMBER(port1c_w);
7169   DECLARE_WRITE8_MEMBER(mbee128_50_w);
7270   DECLARE_WRITE8_MEMBER(mbee256_50_w);
71   DECLARE_READ8_MEMBER(telcom_low_r);
72   DECLARE_READ8_MEMBER(telcom_high_r);
73   DECLARE_READ8_MEMBER(speed_low_r);
74   DECLARE_READ8_MEMBER(speed_high_r);
7375   DECLARE_READ8_MEMBER(m6545_status_r);
7476   DECLARE_WRITE8_MEMBER(m6545_index_w);
7577   DECLARE_READ8_MEMBER(m6545_data_r);
7678   DECLARE_WRITE8_MEMBER(m6545_data_w);
77   DECLARE_READ8_MEMBER(mbee_low_r);
78   DECLARE_READ8_MEMBER(mbee_high_r);
79   DECLARE_READ8_MEMBER(mbeeic_high_r);
80   DECLARE_WRITE8_MEMBER(mbeeic_high_w);
81   DECLARE_WRITE8_MEMBER(mbee_low_w);
82   DECLARE_WRITE8_MEMBER(mbee_high_w);
83   DECLARE_READ8_MEMBER(mbeeic_08_r);
84   DECLARE_WRITE8_MEMBER(mbeeic_08_w);
85   DECLARE_READ8_MEMBER(mbee_0b_r);
86   DECLARE_WRITE8_MEMBER(mbee_0b_w);
87   DECLARE_READ8_MEMBER(mbeeppc_1c_r);
88   DECLARE_WRITE8_MEMBER(mbeeppc_1c_w);
89   DECLARE_WRITE8_MEMBER(mbee256_1c_w);
90   DECLARE_READ8_MEMBER(mbeeppc_low_r);
91   DECLARE_READ8_MEMBER(mbeeppc_high_r);
92   DECLARE_WRITE8_MEMBER(mbeeppc_high_w);
93   DECLARE_WRITE8_MEMBER(mbeeppc_low_w);
79   DECLARE_READ8_MEMBER(video_low_r);
80   DECLARE_READ8_MEMBER(video_high_r);
81   DECLARE_WRITE8_MEMBER(video_low_w);
82   DECLARE_WRITE8_MEMBER(video_high_w);
9483   DECLARE_WRITE8_MEMBER(pio_port_b_w);
9584   DECLARE_READ8_MEMBER(pio_port_b_r);
9685   DECLARE_WRITE_LINE_MEMBER(pio_ardy);
r244652r244653
119108   DECLARE_MACHINE_RESET(mbeett);
120109   UINT32 screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
121110   TIMER_CALLBACK_MEMBER(timer_newkb);
122   TIMER_CALLBACK_MEMBER(timer_rtc_irq);
123111   TIMER_CALLBACK_MEMBER(timer_boot);
124112   DECLARE_QUICKLOAD_LOAD_MEMBER(mbee);
125113   DECLARE_QUICKLOAD_LOAD_MEMBER(mbee_z80bin);
114   WRITE_LINE_MEMBER(rtc_irq_w);
126115   WRITE_LINE_MEMBER(fdc_intrq_w);
127116   WRITE_LINE_MEMBER(fdc_drq_w);
128   UINT8 *m_p_videoram;
129   UINT8 *m_p_gfxram;
130   UINT8 *m_p_colorram;
131   UINT8 *m_p_attribram;
132   UINT8 m_framecnt;
133   UINT8 m_08;
134   UINT8 m_1c;
135   void mbee_video_kbd_scan(int param);
136   UINT8 m_sy6545_cursor[16];
137
138117   MC6845_UPDATE_ROW(mono_update_row);
139118   MC6845_UPDATE_ROW(colour_update_row);
140119   MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr);
141120
142121   required_device<palette_device> m_palette;
143122private:
123   UINT8 *m_p_videoram;
124   UINT8 *m_p_gfxram;
125   UINT8 *m_p_colorram;
126   UINT8 *m_p_attribram;
144127   bool m_is_premium;
145128   bool m_has_oldkb;
146129   size_t m_size;
r244652r244653
148131   bool m_b7_vs;
149132   bool m_b2;
150133   bool m_is_mbeett;
134   UINT8 m_framecnt;
135   UINT8 m_08;
136   UINT8 m_0a;
137   UINT8 m_0b;
138   UINT8 m_1c;
139   UINT8 m_sy6545_cursor[16];
151140   UINT8 m_mbee256_was_pressed[15];
152141   UINT8 m_mbee256_q[20];
153142   UINT8 m_mbee256_q_pos;
154   UINT8 m_0a;
155   UINT8 m_0b;
156143   UINT8 m_sy6545_status;
157144   UINT8 m_sy6545_reg[32];
158145   UINT8 m_sy6545_ind;
r244652r244653
160147   UINT8 m_bank_array[33];
161148   void setup_banks(UINT8 data, bool first_time, UINT8 b_mask);
162149   void sy6545_cursor_configure();
163   void keyboard_matrix_r(int offs);
164   void machine_reset_common_disk();
150   void oldkb_scan(UINT16 param);
151   void oldkb_matrix_r(UINT16 offs);
152   void machine_reset_common();
165153   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
166154   required_device<cpu_device> m_maincpu;
167155   required_device<z80pio_device> m_pio;
r244652r244653
175163   optional_device<floppy_connector> m_floppy0;
176164   optional_device<floppy_connector> m_floppy1;
177165   optional_device<mc146818_device> m_rtc;
178   optional_memory_bank m_boot;
179166   optional_memory_bank m_pak;
180167   optional_memory_bank m_telcom;
181168   optional_memory_bank m_basic;
trunk/src/mess/layout/ebball.lay
r244652r244653
1616
1717<!-- build screen -->
1818
19   <view name="Internal Layout">
19   <view name="Test Layout">
2020      <bounds left="0" right="64" top="0" bottom="64" />
2121      <bezel element="static_black">
2222         <bounds left="0" right="64" top="0" bottom="64" />
2323      </bezel>
2424
25      <bezel name="digit8" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel>
2526
27   <!-- 7*9 matrix -->
28
29      <bezel name="lamp0" element="led"><bounds x="0" y="20" width="1" height="1" /></bezel>
30      <bezel name="lamp1" element="led"><bounds x="2" y="20" width="1" height="1" /></bezel>
31      <bezel name="lamp2" element="led"><bounds x="4" y="20" width="1" height="1" /></bezel>
32      <bezel name="lamp3" element="led"><bounds x="6" y="20" width="1" height="1" /></bezel>
33      <bezel name="lamp4" element="led"><bounds x="8" y="20" width="1" height="1" /></bezel>
34      <bezel name="lamp5" element="led"><bounds x="10" y="20" width="1" height="1" /></bezel>
35      <bezel name="lamp6" element="led"><bounds x="12" y="20" width="1" height="1" /></bezel>
36
37      <bezel name="lamp10" element="led"><bounds x="0" y="22" width="1" height="1" /></bezel>
38      <bezel name="lamp11" element="led"><bounds x="2" y="22" width="1" height="1" /></bezel>
39      <bezel name="lamp12" element="led"><bounds x="4" y="22" width="1" height="1" /></bezel>
40      <bezel name="lamp13" element="led"><bounds x="6" y="22" width="1" height="1" /></bezel>
41      <bezel name="lamp14" element="led"><bounds x="8" y="22" width="1" height="1" /></bezel>
42      <bezel name="lamp15" element="led"><bounds x="10" y="22" width="1" height="1" /></bezel>
43      <bezel name="lamp16" element="led"><bounds x="12" y="22" width="1" height="1" /></bezel>
44
45      <bezel name="lamp20" element="led"><bounds x="0" y="24" width="1" height="1" /></bezel>
46      <bezel name="lamp21" element="led"><bounds x="2" y="24" width="1" height="1" /></bezel>
47      <bezel name="lamp22" element="led"><bounds x="4" y="24" width="1" height="1" /></bezel>
48      <bezel name="lamp23" element="led"><bounds x="6" y="24" width="1" height="1" /></bezel>
49      <bezel name="lamp24" element="led"><bounds x="8" y="24" width="1" height="1" /></bezel>
50      <bezel name="lamp25" element="led"><bounds x="10" y="24" width="1" height="1" /></bezel>
51      <bezel name="lamp26" element="led"><bounds x="12" y="24" width="1" height="1" /></bezel>
52
53      <bezel name="lamp30" element="led"><bounds x="0" y="26" width="1" height="1" /></bezel>
54      <bezel name="lamp31" element="led"><bounds x="2" y="26" width="1" height="1" /></bezel>
55      <bezel name="lamp32" element="led"><bounds x="4" y="26" width="1" height="1" /></bezel>
56      <bezel name="lamp33" element="led"><bounds x="6" y="26" width="1" height="1" /></bezel>
57      <bezel name="lamp34" element="led"><bounds x="8" y="26" width="1" height="1" /></bezel>
58      <bezel name="lamp35" element="led"><bounds x="10" y="26" width="1" height="1" /></bezel>
59      <bezel name="lamp36" element="led"><bounds x="12" y="26" width="1" height="1" /></bezel>
60
61      <bezel name="lamp40" element="led"><bounds x="0" y="28" width="1" height="1" /></bezel>
62      <bezel name="lamp41" element="led"><bounds x="2" y="28" width="1" height="1" /></bezel>
63      <bezel name="lamp42" element="led"><bounds x="4" y="28" width="1" height="1" /></bezel>
64      <bezel name="lamp43" element="led"><bounds x="6" y="28" width="1" height="1" /></bezel>
65      <bezel name="lamp44" element="led"><bounds x="8" y="28" width="1" height="1" /></bezel>
66      <bezel name="lamp45" element="led"><bounds x="10" y="28" width="1" height="1" /></bezel>
67      <bezel name="lamp46" element="led"><bounds x="12" y="28" width="1" height="1" /></bezel>
68
69      <bezel name="lamp50" element="led"><bounds x="0" y="30" width="1" height="1" /></bezel>
70      <bezel name="lamp51" element="led"><bounds x="2" y="30" width="1" height="1" /></bezel>
71      <bezel name="lamp52" element="led"><bounds x="4" y="30" width="1" height="1" /></bezel>
72      <bezel name="lamp53" element="led"><bounds x="6" y="30" width="1" height="1" /></bezel>
73      <bezel name="lamp54" element="led"><bounds x="8" y="30" width="1" height="1" /></bezel>
74      <bezel name="lamp55" element="led"><bounds x="10" y="30" width="1" height="1" /></bezel>
75      <bezel name="lamp56" element="led"><bounds x="12" y="30" width="1" height="1" /></bezel>
76
77      <bezel name="lamp60" element="led"><bounds x="0" y="32" width="1" height="1" /></bezel>
78      <bezel name="lamp61" element="led"><bounds x="2" y="32" width="1" height="1" /></bezel>
79      <bezel name="lamp62" element="led"><bounds x="4" y="32" width="1" height="1" /></bezel>
80      <bezel name="lamp63" element="led"><bounds x="6" y="32" width="1" height="1" /></bezel>
81      <bezel name="lamp64" element="led"><bounds x="8" y="32" width="1" height="1" /></bezel>
82      <bezel name="lamp65" element="led"><bounds x="10" y="32" width="1" height="1" /></bezel>
83      <bezel name="lamp66" element="led"><bounds x="12" y="32" width="1" height="1" /></bezel>
84
85      <bezel name="lamp70" element="led"><bounds x="0" y="34" width="1" height="1" /></bezel>
86      <bezel name="lamp71" element="led"><bounds x="2" y="34" width="1" height="1" /></bezel>
87      <bezel name="lamp72" element="led"><bounds x="4" y="34" width="1" height="1" /></bezel>
88      <bezel name="lamp73" element="led"><bounds x="6" y="34" width="1" height="1" /></bezel>
89      <bezel name="lamp74" element="led"><bounds x="8" y="34" width="1" height="1" /></bezel>
90      <bezel name="lamp75" element="led"><bounds x="10" y="34" width="1" height="1" /></bezel>
91      <bezel name="lamp76" element="led"><bounds x="12" y="34" width="1" height="1" /></bezel>
92
93      <bezel name="lamp80" element="led"><bounds x="0" y="36" width="1" height="1" /></bezel>
94      <bezel name="lamp81" element="led"><bounds x="2" y="36" width="1" height="1" /></bezel>
95      <bezel name="lamp82" element="led"><bounds x="4" y="36" width="1" height="1" /></bezel>
96      <bezel name="lamp83" element="led"><bounds x="6" y="36" width="1" height="1" /></bezel>
97      <bezel name="lamp84" element="led"><bounds x="8" y="36" width="1" height="1" /></bezel>
98      <bezel name="lamp85" element="led"><bounds x="10" y="36" width="1" height="1" /></bezel>
99      <bezel name="lamp86" element="led"><bounds x="12" y="36" width="1" height="1" /></bezel>
100
101      <bezel name="lamp90" element="led"><bounds x="0" y="38" width="1" height="1" /></bezel>
102      <bezel name="lamp91" element="led"><bounds x="2" y="38" width="1" height="1" /></bezel>
103      <bezel name="lamp92" element="led"><bounds x="4" y="38" width="1" height="1" /></bezel>
104      <bezel name="lamp93" element="led"><bounds x="6" y="38" width="1" height="1" /></bezel>
105      <bezel name="lamp94" element="led"><bounds x="8" y="38" width="1" height="1" /></bezel>
106      <bezel name="lamp95" element="led"><bounds x="10" y="38" width="1" height="1" /></bezel>
107      <bezel name="lamp96" element="led"><bounds x="12" y="38" width="1" height="1" /></bezel>
108
109
26110   </view>
27111</mamelayout>
trunk/src/mess/layout/edracula.lay
r244652r244653
1919         <bounds left="0" right="64" top="0" bottom="64" />
2020      </bezel>
2121
22   <!-- 8*18 matrix -->
22   <!-- 18*8 matrix -->
2323
2424      <bezel name="lamp700" element="led"><bounds x="0" y="0" width="1" height="1" /></bezel>
2525      <bezel name="lamp701" element="led"><bounds x="0" y="2" width="1" height="1" /></bezel>
trunk/src/mess/layout/tmpacman.lay
r244652r244653
1919         <bounds left="0" right="64" top="0" bottom="64" />
2020      </bezel>
2121
22   <!-- 8*19 matrix -->
22   <!-- 19*8 matrix -->
2323
2424      <bezel name="lamp0" element="led"><bounds x="0" y="0" width="1" height="1" /></bezel>
2525      <bezel name="lamp1" element="led"><bounds x="0" y="2" width="1" height="1" /></bezel>
trunk/src/mess/layout/wildfire.lay
r244652r244653
2626      <bezel name="digit1" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel>
2727      <bezel name="digit2" element="digit"><bounds x="20" y="0" width="10" height="15" /></bezel>
2828
29   <!-- 8*13 matrix (first 3 are the 7segs) -->
29   <!-- 13*8 matrix (first 3 are the 7segs) -->
3030
3131      <bezel name="lamp0" element="led"><bounds x="0" y="20" width="1" height="1" /></bezel>
3232      <bezel name="lamp1" element="led"><bounds x="2" y="20" width="1" height="1" /></bezel>
trunk/src/mess/machine/mbee.c
r244652r244653
2020   case TIMER_MBEE_NEWKB:
2121      timer_newkb(ptr, param);
2222      break;
23   case TIMER_MBEE_RTC_IRQ:
24      timer_rtc_irq(ptr, param);
25      break;
26   case TIMER_MBEE_BOOT:
27      timer_boot(ptr, param);
28      break;
2923   default:
3024      assert_always(FALSE, "Unknown id in mbee_state::device_timer");
3125   }
r244652r244653
4640WRITE8_MEMBER( mbee_state::pio_port_b_w )
4741{
4842/*  PIO port B - d5..d2 not emulated
49    d7 network interrupt (microbee network for classrooms)
43    d7 interrupt from network or rtc or vsync or not used (see config switch)
5044    d6 speaker
5145    d5 rs232 output (1=mark)
5246    d4 rs232 input (0=mark)
5347    d3 rs232 CTS (0=clear to send)
5448    d2 rs232 clock or DTR
55    d1 cass out and (on 256tc) keyboard irq
49    d1 cass out and (on new keyboard) keyboard irq
5650    d0 cass in */
5751
58   m_cassette->output((data & 0x02) ? -1.0 : +1.0);
59
52   m_cassette->output(BIT(data, 1) ? -1.0 : +1.0);
6053   m_speaker->level_w(BIT(data, 6));
6154};
6255
r244652r244653
6457{
6558   UINT8 data = 0;
6659
67   if (m_cassette->input() > 0.03) data |= 1;
60   if (m_cassette->input() > 0.03)
61      data |= 1;
6862
6963   data |= 8; // CTS held high via resistor. If low, the disk-based models think a mouse is plugged in.
7064
71   if (m_is_mbeett)
65   switch (m_io_config->read() & 0xc0)
7266   {
73      if (m_b2)
74         data |= 0x82;
75      else
67      case 0x00:
68         data |= (UINT8)m_b7_vs << 7;
69         break;
70      case 0x40:
71         data |= (UINT8)m_b7_rtc << 7;
72         break;
73      case 0x80:
7674         data |= 0x80;
75         break;
7776   }
78   else
79   {
80      switch (m_io_config->read() & 0xc0)
81      {
82         case 0x00:
83            data |= (UINT8)m_b7_vs << 7;
84            break;
85         case 0x40:
86            data |= (UINT8)m_b7_rtc << 7;
87            break;
88         case 0x80:
89            data |= 0x80;
90            break;
91         case 0xc0:
92            data |= 0x80; // centronics busy line - FIXME
93            break;
94      }
95      data |= (UINT8)m_b2 << 1; // key pressed on new keyboard
96   }
77   data |= (UINT8)m_b2 << 1; // key pressed on new keyboard
9778
9879   return data;
9980}
r244652r244653
194175
195176   // if anything queued, cause an interrupt
196177   if (m_mbee256_q_pos)
197   {
198178      m_b2 = 1; // set irq
199      //breaks keyboard m_pio->port_b_write(pio_port_b_r(generic_space(),0,0xff));
200   }
201179
202   timer_set(attotime::from_hz(25), TIMER_MBEE_NEWKB);
180   if (m_b2)
181      m_pio->port_b_write(pio_port_b_r(generic_space(),0,0xff));
182
183   timer_set(attotime::from_hz(10), TIMER_MBEE_NEWKB);
203184}
204185
205READ8_MEMBER( mbee_state::mbee256_18_r )
186READ8_MEMBER( mbee_state::port18_r )
206187{
207188   UINT8 i, data = m_mbee256_q[0]; // get oldest key
208189
r244652r244653
223204
224205************************************************************/
225206
226READ8_MEMBER( mbee_state::mbee256_speed_low_r )
207READ8_MEMBER( mbee_state::speed_low_r )
227208{
228209   m_maincpu->set_unscaled_clock(3375000);
229210   return 0xff;
230211}
231212
232READ8_MEMBER( mbee_state::mbee256_speed_high_r )
213READ8_MEMBER( mbee_state::speed_high_r )
233214{
234215   m_maincpu->set_unscaled_clock(6750000);
235216   return 0xff;
r244652r244653
243224
244225************************************************************/
245226
246WRITE8_MEMBER( mbee_state::mbee_04_w )  // address
227WRITE8_MEMBER( mbee_state::port04_w )  // address
247228{
248229   m_rtc->write(space, 0, data);
249230}
250231
251WRITE8_MEMBER( mbee_state::mbee_06_w )  // write
232WRITE8_MEMBER( mbee_state::port06_w )  // write
252233{
253234   m_rtc->write(space, 1, data);
254235}
255236
256READ8_MEMBER( mbee_state::mbee_07_r )   // read
237READ8_MEMBER( mbee_state::port07_r )   // read
257238{
258239   return m_rtc->read(space, 1);
259240}
260241
261// This doesn't seem to do anything; the time works without it.
262TIMER_CALLBACK_MEMBER( mbee_state::timer_rtc_irq )
242// See it work: Run mbeett, choose RTC in the config switches, run the F3 test, press Esc.
243WRITE_LINE_MEMBER( mbee_state::rtc_irq_w )
263244{
264   if (!m_rtc)
265      return;
245   m_b7_rtc = (state) ? 0 : 1; // inverted by IC15 (pins 8,9,10)
266246
267   UINT8 data = m_rtc->read(m_maincpu->space(AS_IO), 12);
268   m_b7_rtc = (data) ? 1 : 0;
269
270247   if ((m_io_config->read() & 0xc0) == 0x40) // RTC selected in config menu
271248      m_pio->port_b_write(pio_port_b_r(generic_space(),0,0xff));
272
273   timer_set(attotime::from_hz(10), TIMER_MBEE_RTC_IRQ);
274249}
275250
276251
r244652r244653
327302            if (!BIT(b_byte, 4))
328303            {
329304               // select video
330               if (m_is_premium)
331               {
332                  mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this));
333                  mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this));
334               }
335               else
336               {
337                  mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::mbee_low_r), this));
338                  mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::mbeeic_high_r), this));
339               }
305               mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::video_low_r), this));
306               mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::video_high_r), this));
340307            }
341308            else
342309            {
r244652r244653
367334            if (!BIT(b_byte, 4))
368335            {
369336               // select video
370               if (m_is_premium)
371               {
372                  mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
373                  mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
374               }
375               else
376               {
377                  mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::mbee_low_w), this));
378                  mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::mbeeic_high_w), this));
379               }
337               mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::video_low_w), this));
338               mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::video_high_w), this));
380339            }
381340            else
382341            {
r244652r244653
433392
434393************************************************************/
435394
436READ8_MEMBER( mbee_state::mbeeic_0a_r )
395WRITE8_MEMBER( mbee_state::port0a_w )
437396{
438   return m_0a;
439}
440
441WRITE8_MEMBER( mbee_state::mbeeic_0a_w )
442{
443397   m_0a = data;
444   m_pak->set_entry(data & 15);
398
399   if (m_pak)
400      m_pak->set_entry(data & 15);
445401}
446402
447READ8_MEMBER( mbee_state::mbeepc_telcom_low_r )
403READ8_MEMBER( mbee_state::telcom_low_r )
448404{
449405/* Read of port 0A - set Telcom rom to first half */
450   m_telcom->set_entry(0);
406   if (m_telcom)
407      m_telcom->set_entry(0);
408
451409   return m_0a;
452410}
453411
454READ8_MEMBER( mbee_state::mbeepc_telcom_high_r )
412READ8_MEMBER( mbee_state::telcom_high_r )
455413{
456414/* Read of port 10A - set Telcom rom to 2nd half */
457   m_telcom->set_entry(1);
415   if (m_telcom)
416      m_telcom->set_entry(1);
417
458418   return m_0a;
459419}
460420
r244652r244653
471431*/
472432
473433
474/* after the first 4 bytes have been read from ROM, switch the ram back in */
475TIMER_CALLBACK_MEMBER( mbee_state::timer_boot )
434void mbee_state::machine_reset_common()
476435{
477   m_boot->set_entry(0);
478}
479
480void mbee_state::machine_reset_common_disk()
481{
482436   m_fdc_rq = 0;
437   m_08 = 0;
438   m_0a = 0;
439   m_0b = 0;
440   m_1c = 0;
441
442   if (m_basic)
443      m_basic->set_entry(0);
444
445   if (m_telcom)
446      m_telcom->set_entry(0);
483447}
484448
485449MACHINE_RESET_MEMBER( mbee_state, mbee )
486450{
487   m_boot->set_entry(1);
488   timer_set(attotime::from_usec(4), TIMER_MBEE_BOOT);
451   machine_reset_common();
452   m_maincpu->set_pc(0x8000);
489453}
490454
491455MACHINE_RESET_MEMBER( mbee_state, mbee56 )
492456{
493   machine_reset_common_disk();
494   m_boot->set_entry(1);
495   timer_set(attotime::from_usec(4), TIMER_MBEE_BOOT);
457   machine_reset_common();
458   m_maincpu->set_pc(0xE000);
496459}
497460
498461MACHINE_RESET_MEMBER( mbee_state, mbee128 )
499462{
500   machine_reset_common_disk();
463   machine_reset_common();
501464   setup_banks(0, 1, 3); // set banks to default
502465   m_maincpu->set_pc(0x8000);
503466}
504467
505468MACHINE_RESET_MEMBER( mbee_state, mbee256 )
506469{
507   UINT8 i;
508   for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0;
509470   m_mbee256_q_pos = 0;
510   machine_reset_common_disk();
471   machine_reset_common();
511472   setup_banks(0, 1, 7); // set banks to default
512473   m_maincpu->set_pc(0x8000);
513474}
514475
515476MACHINE_RESET_MEMBER( mbee_state, mbeett )
516477{
517   UINT8 i;
518   for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0;
519478   m_mbee256_q_pos = 0;
520   m_boot->set_entry(1);
521   timer_set(attotime::from_usec(4), TIMER_MBEE_BOOT);
479   machine_reset_common();
480   m_maincpu->set_pc(0x8000);
522481}
523482
524483DRIVER_INIT_MEMBER( mbee_state, mbee )
525484{
526   UINT8 *RAM = memregion("maincpu")->base();
527   m_boot->configure_entries(0, 2, &RAM[0x0000], 0x8000);
528485   m_size = 0x4000;
529486   m_has_oldkb = 1;
530487   m_is_mbeett = 0;
r244652r244653
532489
533490DRIVER_INIT_MEMBER( mbee_state, mbeeic )
534491{
535   UINT8 *RAM = memregion("maincpu")->base();
536   m_boot->configure_entries(0, 2, &RAM[0x0000], 0x8000);
537
538   RAM = memregion("pakrom")->base();
492   UINT8 *RAM = memregion("pakrom")->base();
539493   m_pak->configure_entries(0, 16, &RAM[0x0000], 0x2000);
540
541494   m_pak->set_entry(0);
495
542496   m_size = 0x8000;
543497   m_has_oldkb = 1;
544498   m_is_mbeett = 0;
r244652r244653
546500
547501DRIVER_INIT_MEMBER( mbee_state, mbeepc )
548502{
549   UINT8 *RAM = memregion("maincpu")->base();
550   m_boot->configure_entries(0, 2, &RAM[0x0000], 0x8000);
551
552   RAM = memregion("telcomrom")->base();
503   UINT8 *RAM = memregion("telcomrom")->base();
553504   m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000);
554505
555506   RAM = memregion("pakrom")->base();
556507   m_pak->configure_entries(0, 16, &RAM[0x0000], 0x2000);
557
558508   m_pak->set_entry(0);
559   m_telcom->set_entry(0);
509
560510   m_size = 0x8000;
561511   m_has_oldkb = 1;
562512   m_is_mbeett = 0;
r244652r244653
564514
565515DRIVER_INIT_MEMBER( mbee_state, mbeepc85 )
566516{
567   UINT8 *RAM = memregion("maincpu")->base();
568   m_boot->configure_entries(0, 2, &RAM[0x0000], 0x8000);
569
570   RAM = memregion("telcomrom")->base();
517   UINT8 *RAM = memregion("telcomrom")->base();
571518   m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000);
572519
573520   RAM = memregion("pakrom")->base();
574521   m_pak->configure_entries(0, 16, &RAM[0x0000], 0x2000);
575
576522   m_pak->set_entry(5);
577   m_telcom->set_entry(0);
523
578524   m_size = 0x8000;
579525   m_has_oldkb = 1;
580526   m_is_mbeett = 0;
r244652r244653
582528
583529DRIVER_INIT_MEMBER( mbee_state, mbeeppc )
584530{
585   UINT8 *RAM = memregion("maincpu")->base();
586   m_boot->configure_entry(0, &RAM[0x0000]);
587
588   RAM = memregion("basicrom")->base();
531   UINT8 *RAM = memregion("basicrom")->base();
589532   m_basic->configure_entries(0, 2, &RAM[0x0000], 0x2000);
590   m_boot->configure_entry(1, &RAM[0x0000]);
591533
592534   RAM = memregion("telcomrom")->base();
593535   m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000);
594536
595537   RAM = memregion("pakrom")->base();
596538   m_pak->configure_entries(0, 16, &RAM[0x0000], 0x2000);
597
598539   m_pak->set_entry(5);
599   m_telcom->set_entry(0);
600   m_basic->set_entry(0);
540
601541   m_size = 0x8000;
602542   m_has_oldkb = 1;
603543   m_is_mbeett = 0;
r244652r244653
605545
606546DRIVER_INIT_MEMBER( mbee_state, mbee56 )
607547{
608   UINT8 *RAM = memregion("maincpu")->base();
609   m_boot->configure_entries(0, 2, &RAM[0x0000], 0xe000);
610548   m_size = 0xe000;
611549   m_has_oldkb = 1;
612550   m_is_mbeett = 0;
r244652r244653
629567      membank(banktag)->configure_entries(64, 1, &ROM[0x4000], 0x1000); // dummy rom
630568   }
631569
632   timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ);   /* timer for rtc */
633
634570   m_size = 0x8000;
635571   m_has_oldkb = 1;
636572   m_is_mbeett = 0;
r244652r244653
653589      membank(banktag)->configure_entries(64, 1, &ROM[0x4000], 0x1000); // dummy rom
654590   }
655591
656   timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ);   /* timer for rtc */
657   timer_set(attotime::from_hz(25), TIMER_MBEE_NEWKB);   /* timer for kbd */
592   timer_set(attotime::from_hz(1), TIMER_MBEE_NEWKB);   /* kick-start timer for kbd */
658593
659594   m_size = 0x8000;
660595   m_has_oldkb = 0;
r244652r244653
663598
664599DRIVER_INIT_MEMBER( mbee_state, mbeett )
665600{
666   UINT8 *RAM = memregion("maincpu")->base();
667   m_boot->configure_entries(0, 2, &RAM[0x0000], 0x8000);
668
669   RAM = memregion("telcomrom")->base();
601   UINT8 *RAM = memregion("telcomrom")->base();
670602   m_telcom->configure_entries(0, 2, &RAM[0x0000], 0x1000);
671603
672604   RAM = memregion("pakrom")->base();
673605   m_pak->configure_entries(0, 16, &RAM[0x0000], 0x2000);
674
675606   m_pak->set_entry(5);
676   m_telcom->set_entry(0);
677607
678   timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ);   /* timer for rtc */
679   timer_set(attotime::from_hz(25), TIMER_MBEE_NEWKB);   /* timer for kbd */
608   timer_set(attotime::from_hz(1), TIMER_MBEE_NEWKB);   /* kick-start timer for kbd */
680609
681610   m_size = 0x8000;
682611   m_has_oldkb = 0;
trunk/src/mess/mess.mak
r244652r244653
12261226   $(MESS_DRIVERS)/advision.o $(MESS_MACHINE)/advision.o $(MESS_VIDEO)/advision.o \
12271227
12281228$(MESSOBJ)/epoch.a:             \
1229   $(MESS_DRIVERS)/edracula.o  \
12301229   $(MESS_DRIVERS)/gamepock.o $(MESS_MACHINE)/gamepock.o \
12311230   $(MESS_DRIVERS)/scv.o $(MESS_AUDIO)/upd1771.o \
12321231
r244652r244653
17781777   $(MESS_DRIVERS)/tiki100.o   \
17791778
17801779$(MESSOBJ)/tomy.a:              \
1781   $(MESS_DRIVERS)/alnchase.o  \
1782   $(MESS_DRIVERS)/tmtennis.o  \
17831780   $(MESS_DRIVERS)/tutor.o     \
17841781
17851782$(MESSOBJ)/toshiba.a:           \
r244652r244653
20842081$(MESS_DRIVERS)/aim65.o:    $(MESS_LAYOUT)/aim65.lh
20852082$(MESS_DRIVERS)/aim65_40.o: $(MESS_LAYOUT)/aim65_40.lh
20862083$(MESS_DRIVERS)/alesis.o:   $(MESS_LAYOUT)/sr16.lh
2087$(MESS_DRIVERS)/alnchase.o: $(MESS_LAYOUT)/alnchase.lh
2088$(MESS_DRIVERS)/amaztron.o: $(MESS_LAYOUT)/amaztron.lh
20892084$(MESS_DRIVERS)/amico2k.o:  $(MESS_LAYOUT)/amico2k.lh
20902085$(MESS_DRIVERS)/amiga.o:    $(MESS_LAYOUT)/amiga.lh
20912086$(MESS_VIDEO)/apollo.o:     $(MESS_LAYOUT)/apollo.lh \
r244652r244653
21032098$(MESS_DRIVERS)/chessmst.o: $(MESS_LAYOUT)/chessmst.lh
21042099$(MESS_DRIVERS)/chesstrv.o: $(MESS_LAYOUT)/chesstrv.lh \
21052100                     $(MESS_LAYOUT)/borisdpl.lh
2106$(MESS_DRIVERS)/comp4.o:    $(MESS_LAYOUT)/comp4.lh
21072101$(MESS_DRIVERS)/cp1.o:      $(MESS_LAYOUT)/cp1.lh
21082102$(MESS_DRIVERS)/cvicny.o:   $(MESS_LAYOUT)/cvicny.lh
21092103$(MESS_DRIVERS)/coco3.o:    $(MESS_LAYOUT)/coco3.lh
r244652r244653
21132107$(MESS_DRIVERS)/dmv.o:      $(MESS_LAYOUT)/dmv.lh
21142108$(MESS_DRIVERS)/dolphunk.o: $(MESS_LAYOUT)/dolphunk.lh
21152109$(MESS_DRIVERS)/eacc.o:     $(MESS_LAYOUT)/eacc.lh
2116$(MESS_DRIVERS)/edracula.o: $(MESS_LAYOUT)/edracula.lh
21172110$(MESS_DRIVERS)/elekscmp.o: $(MESS_LAYOUT)/elekscmp.lh
21182111$(MESS_DRIVERS)/elf.o:      $(MESS_LAYOUT)/elf2.lh
21192112$(MESS_MACHINE)/esqvfd.o:   $(MESS_LAYOUT)/esq2by40.lh \
r244652r244653
21402133                            $(MESS_LAYOUT)/stopthie.lh \
21412134                            $(MESS_LAYOUT)/tandy12.lh \
21422135                            $(MESS_LAYOUT)/tc4.lh
2143$(MESS_DRIVERS)/hh_ucom4.o: $(MESS_LAYOUT)/tmpacman.lh
2136$(MESS_DRIVERS)/hh_ucom4.o: $(MESS_LAYOUT)/alnchase.lh \
2137                            $(MESS_LAYOUT)/edracula.lh \
2138                            $(MESS_LAYOUT)/tmpacman.lh \
2139                            $(MESS_LAYOUT)/tmtennis.lh
21442140$(MESS_DRIVERS)/ie15.o:     $(MESS_LAYOUT)/ie15.lh
21452141$(MESS_DRIVERS)/instruct.o: $(MESS_LAYOUT)/instruct.lh
21462142$(MESS_DRIVERS)/k1003.o:    $(MESS_LAYOUT)/k1003.lh
r244652r244653
21842180$(MESS_DRIVERS)/sdk85.o:    $(MESS_LAYOUT)/sdk85.lh
21852181$(MESS_DRIVERS)/sdk86.o:    $(MESS_LAYOUT)/sdk86.lh
21862182$(MESS_DRIVERS)/selz80.o:   $(MESS_LAYOUT)/selz80.lh
2187$(MESS_DRIVERS)/simon.o:    $(MESS_LAYOUT)/simon.lh
21882183$(MESS_DRIVERS)/sitcom.o:   $(MESS_LAYOUT)/sitcom.lh
21892184$(MESS_DRIVERS)/slc1.o:     $(MESS_LAYOUT)/slc1.lh
21902185$(MESS_DRIVERS)/sms.o:      $(MESS_LAYOUT)/sms1.lh
r244652r244653
22092204$(MESS_DRIVERS)/tk80.o:     $(MESS_LAYOUT)/tk80.lh
22102205$(MESS_DRIVERS)/tm990189.o: $(MESS_LAYOUT)/tm990189.lh \
22112206                     $(MESS_LAYOUT)/tm990189v.lh
2212$(MESS_DRIVERS)/tmtennis.o: $(MESS_LAYOUT)/tmtennis.lh
22132207$(MESS_DRIVERS)/unixpc.o:   $(MESS_LAYOUT)/unixpc.lh
22142208$(MESS_DRIVERS)/ut88.o:     $(MESS_LAYOUT)/ut88mini.lh
22152209$(MESS_DRIVERS)/vboy.o:     $(MESS_LAYOUT)/vboy.lh
trunk/src/mess/video/mbee.c
r244652r244653
6969************************************************************/
7070
7171
72READ8_MEMBER( mbee_state::mbee_low_r )
72READ8_MEMBER( mbee_state::video_low_r )
7373{
74   if (m_0b & 1)
74   if (m_is_premium && ((m_1c & 0x9f) == 0x90))
75      return m_p_attribram[offset];
76   else
77   if BIT(m_0b, 0)
7578      return m_p_gfxram[offset];
7679   else
7780      return m_p_videoram[offset];
7881}
7982
80WRITE8_MEMBER( mbee_state::mbee_low_w )
83WRITE8_MEMBER( mbee_state::video_low_w )
8184{
82   m_p_videoram[offset] = data;
85   if BIT(m_1c, 4)
86   {
87      // non-premium attribute writes are discarded
88      if (m_is_premium && BIT(m_1c, 7))
89         m_p_attribram[offset] = data;
90   }
91   else
92      m_p_videoram[offset] = data;
8393}
8494
85READ8_MEMBER( mbee_state::mbee_high_r )
95READ8_MEMBER( mbee_state::video_high_r )
8696{
87   return m_p_gfxram[0x800 | offset];
97   if BIT(m_08, 6)
98      return m_p_colorram[offset];
99   else
100      return m_p_gfxram[(((m_1c & 15) + 1) << 11) | offset];
88101}
89102
90WRITE8_MEMBER( mbee_state::mbee_high_w )
103WRITE8_MEMBER( mbee_state::video_high_w )
91104{
92   m_p_gfxram[0x800 | offset] = data;
105   if (BIT(m_08, 6) && (~m_0b & 1))
106      m_p_colorram[offset] = data;
107   else
108      m_p_gfxram[(((m_1c & 15) + 1) << 11) | offset] = data;
93109}
94110
95READ8_MEMBER( mbee_state::mbee_0b_r )
111WRITE8_MEMBER( mbee_state::port0b_w )
96112{
97   return m_0b;
113   m_0b = data & 1;
98114}
99115
100WRITE8_MEMBER( mbee_state::mbee_0b_w )
116READ8_MEMBER( mbee_state::port08_r )
101117{
102   m_0b = data;
103}
104
105READ8_MEMBER( mbee_state::mbeeic_08_r )
106{
107118   return m_08;
108119}
109120
110WRITE8_MEMBER( mbee_state::mbeeic_08_w )
121WRITE8_MEMBER( mbee_state::port08_w )
111122{
112123   m_08 = data;
113124}
114125
115READ8_MEMBER( mbee_state::mbeeic_high_r )
126READ8_MEMBER( mbee_state::port1c_r )
116127{
117   if (m_08 & 0x40)
118      return m_p_colorram[offset];
119   else
120      return m_p_gfxram[0x800 | offset];
121}
122
123WRITE8_MEMBER( mbee_state::mbeeic_high_w )
124{
125   if ((m_08 & 0x40) && (~m_0b & 1))
126      m_p_colorram[offset] = data;
127   else
128      m_p_gfxram[0x0800 | offset] = data;
129}
130
131READ8_MEMBER( mbee_state::mbeeppc_1c_r )
132{
133128   return m_1c;
134129}
135130
136WRITE8_MEMBER( mbee_state::mbeeppc_1c_w )
131WRITE8_MEMBER( mbee_state::port1c_w )
137132{
138133/*  d7 extended graphics (1=allow attributes and pcg banks)
139134    d5 bankswitch basic rom
140135    d4 select attribute ram
141136    d3..d0 select m_videoram bank */
142137
143   m_1c = data;
144   membank("basic")->set_entry(BIT(data, 5));
145}
146
147WRITE8_MEMBER( mbee_state::mbee256_1c_w )
148{
149/*  d7 extended graphics (1=allow attributes and pcg banks)
150    d5 bankswitch basic rom
151    d4 select attribute ram
152    d3..d0 select m_videoram bank */
153
154   m_1c = data;
155}
156
157READ8_MEMBER( mbee_state::mbeeppc_low_r )
158{
159   if ((m_1c & 0x1f) == 0x10)
160      return m_p_attribram[offset];
138   if (m_is_premium && BIT(data, 7))
139      m_1c = data;
161140   else
162   if (m_0b & 1)
163      return m_p_gfxram[offset];
164   else
165      return m_p_videoram[offset];
166}
141      m_1c = data & 0x30;
167142
168WRITE8_MEMBER( mbee_state::mbeeppc_low_w )
169{
170   if (m_1c & 16)
171      m_p_attribram[offset] = data;
172   else
173      m_p_videoram[offset] = data;
143   if (m_basic)
144      m_basic->set_entry(BIT(data, 5));
174145}
175146
176READ8_MEMBER( mbee_state::mbeeppc_high_r )
177{
178   if (m_08 & 0x40)
179      return m_p_colorram[offset];
180   else
181      return m_p_gfxram[(((m_1c & 15) + 1) << 11) | offset];
182}
183147
184WRITE8_MEMBER ( mbee_state::mbeeppc_high_w )
185{
186   if ((m_08 & 0x40) && (~m_0b & 1))
187      m_p_colorram[offset] = data;
188   else
189      m_p_gfxram[(((m_1c & 15) + 1) << 11) | offset] = data;
190}
191
192
193148/***********************************************************
194149
195150    CRTC-driven keyboard
r244652r244653
197152************************************************************/
198153
199154
200void mbee_state::keyboard_matrix_r(int offs)
155void mbee_state::oldkb_matrix_r(UINT16 offs)
201156{
202   UINT8 port = (offs >> 7) & 7;
203   UINT8 bit = (offs >> 4) & 7;
204   UINT8 data = m_io_oldkb[port]->read();
205   bool keydown  = ( data >> bit ) & 1;
206
207   // This adds premium-style cursor keys to the old keyboard
208   // They are used by the pc85 & ppc menu, and the 128k shell.
209   if (!keydown)
157   if (m_has_oldkb)
210158   {
211      UINT8 extra = m_io_extra->read();
159      UINT8 port = (offs >> 7) & 7;
160      UINT8 bit = (offs >> 4) & 7;
161      UINT8 data = m_io_oldkb[port]->read();
162      bool keydown  = ( data >> bit ) & 1;
212163
213      if (extra && port == 7 && bit == 1) keydown = 1;   /* Control */
164      // This adds premium-style cursor keys to the old keyboard
165      // They are used by the pc85 & ppc menu, and the 128k shell.
166      if (!keydown)
167      {
168         UINT8 extra = m_io_extra->read();
214169
215      if (BIT(extra, 0) && ( port == 0 && bit == 5 )) keydown = 1; // cursor up = ^E
216      else
217      if (BIT(extra, 1) && ( port == 3 && bit == 0 )) keydown = 1; // cursor down = ^X
218      else
219      if (BIT(extra, 2) && ( port == 2 && bit == 3 )) keydown = 1; // cursor left = ^S
220      else
221      if (BIT(extra, 3) && ( port == 0 && bit == 4 )) keydown = 1; // cursor right = ^D
222#if 0
223      // this key doesn't appear on any keyboard afaik. It is a Wordbee function.
224      else
225      if (BIT(extra, 4) && ( port == 2 && bit == 6 )) keydown = 1;  // insert = ^V
226#endif
227   }
170         if (extra && port == 7 && bit == 1) keydown = 1;   /* Control */
228171
229   if( keydown )
230   {
231      m_sy6545_reg[17] = offs;
232      m_sy6545_reg[16] = (offs >> 8) & 0x3f;
233      m_sy6545_status |= 0x40; //lpen_strobe
172         if (BIT(extra, 0) && ( port == 0 && bit == 5 )) keydown = 1; // cursor up = ^E
173         else
174         if (BIT(extra, 1) && ( port == 3 && bit == 0 )) keydown = 1; // cursor down = ^X
175         else
176         if (BIT(extra, 2) && ( port == 2 && bit == 3 )) keydown = 1; // cursor left = ^S
177         else
178         if (BIT(extra, 3) && ( port == 0 && bit == 4 )) keydown = 1; // cursor right = ^D
179         else
180         if (BIT(extra, 4) && ( port == 2 && bit == 6 )) keydown = 1; // insert = ^V
181      }
182
183      if( keydown )
184      {
185         m_sy6545_reg[17] = offs;
186         m_sy6545_reg[16] = (offs >> 8) & 0x3f;
187         m_sy6545_status |= 0x40; //lpen_strobe
188      }
234189   }
235190}
236191
237192
238void mbee_state::mbee_video_kbd_scan( int param )
193void mbee_state::oldkb_scan( UINT16 param )
239194{
240   if (m_0b) return; // can't remember why this is here
195   if (m_0b) return; // IC5 (pins 11,12,13)
241196   if (param & 15) return; // only scan once per row instead of 16 times
242   keyboard_matrix_r(param);
197   oldkb_matrix_r(param);
243198}
244199
245200
r244652r244653
277232      // This firstly pushes the contents of the transparent registers onto the MA lines,
278233      // then increments the address, then sets update strobe on.
279234      addr = (m_sy6545_reg[18] << 8) | m_sy6545_reg[19];
280      keyboard_matrix_r(addr);
235      oldkb_matrix_r(addr);
281236      m_sy6545_reg[19]++;
282237      if (!m_sy6545_reg[19]) m_sy6545_reg[18]++;
283238      m_sy6545_status |= 0x80; // update_strobe
r244652r244653
296251WRITE8_MEMBER ( mbee_state::m6545_data_w )
297252{
298253   static const UINT8 sy6545_mask[32]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0,0x3f,0xff};
299   int addr = 0;
254   UINT16 addr = 0;
300255
301256   switch( m_sy6545_ind )
302257   {
r244652r244653
309264      // This firstly pushes the contents of the transparent registers onto the MA lines,
310265      // then increments the address, then sets update strobe on.
311266      addr = (m_sy6545_reg[18] << 8) | m_sy6545_reg[19];
312      keyboard_matrix_r(addr);
267      oldkb_matrix_r(addr);
313268      m_sy6545_reg[19]++;
314269      if (!m_sy6545_reg[19]) m_sy6545_reg[18]++;
315270      m_sy6545_status |= 0x80; // update_strobe
r244652r244653
382337      mem = (ma + x) & 0x7ff;
383338      chr = m_p_videoram[mem];
384339
385      mbee_video_kbd_scan(x+ma);
340      oldkb_scan(x+ma);
386341
387342      /* process cursor */
388343      if (x == cursor_x)
r244652r244653
419374      chr = m_p_videoram[mem];
420375      col = m_p_colorram[mem];                     // read a byte of colour
421376
422      if (m_is_premium)
377      if BIT(m_1c, 7) // premium graphics enabled?
423378      {
424         if (m_1c & 0x80)                     // are extended features enabled?
425         {
426            attr = m_p_attribram[mem];
379         attr = m_p_attribram[mem];
427380
428            if (chr & 0x80)
429               chr += ((attr & 15) << 7);          // bump chr to its particular pcg definition
381         if BIT(chr, 7)
382            chr += ((attr & 15) << 7);          // bump chr to its particular pcg definition
430383
431            if (attr & 0x40)
432               inv ^= 0xff;                    // inverse attribute
384         if BIT(attr, 6)
385            inv ^= 0xff;                    // inverse attribute
433386
434            if ((attr & 0x80) && (m_framecnt & 0x10))            // flashing attribute
435               chr = 0x20;
436         }
387         if (BIT(attr, 7) & BIT(m_framecnt, 4))            // flashing attribute
388            chr = 0x20;
437389      }
438390      else
439391         col |= colourm;
440392
441      if (m_has_oldkb)
442         mbee_video_kbd_scan(x+ma);
393      oldkb_scan(x+ma);
443394
444395      /* process cursor */
445396      if (x == cursor_x)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team