diff options
author | 2015-04-01 11:49:51 +0100 | |
---|---|---|
committer | 2015-04-01 11:49:51 +0100 | |
commit | 0823325dbb211c1723053536e440a724b4c912b4 (patch) | |
tree | 1ea90d52f0a09b2b7bbd9a913cd8f8e6142a37c6 | |
parent | 652fd58d753d8770f3745ccebc8d02c571d59cb2 (diff) | |
parent | 26214cc6ec6f95c9a8c7caa44b90bbbf0bc3bf05 (diff) |
Merge branch 'master' of https://github.com/mamedev/mame
573 files changed, 40684 insertions, 34705 deletions
diff --git a/.gitignore b/.gitignore index 69a16083596..db29d636e1c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,10 @@ /inp /nvram /obj +/roms /snap src/regtests/chdman/temp src/regtests/jedutil/output /sta *.pyc +/build
\ No newline at end of file diff --git a/3rdparty/bgfx/.editorconfig b/3rdparty/bgfx/.editorconfig index e9070240b79..f39662686c0 100644 --- a/3rdparty/bgfx/.editorconfig +++ b/3rdparty/bgfx/.editorconfig @@ -8,6 +8,9 @@ max_line_length = 100 insert_final_newline = true trim_trailing_whitespace = true +[*.c99.h] +indent_style = space + [*.md] trim_trailing_whitespace = false max_line_length = 80 diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp index 866bec93420..8a26d9cffb4 100644 --- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp @@ -350,8 +350,8 @@ #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. #pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it. #pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness // -#endif -#ifdef __GNUC__ +#pragma clang diagnostic ignored "-Wunused-parameter" // warning: unused parameter ‘xxxx’ +#elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used #pragma GCC diagnostic ignored "-Wunused-parameter" // warning: unused parameter ‘xxxx’ #pragma GCC diagnostic ignored "-Wtype-limits" // warning: comparison is always true due to limited range of data type diff --git a/3rdparty/bgfx/3rdparty/sdf/sdf.h b/3rdparty/bgfx/3rdparty/sdf/sdf.h index e6ec857f88c..13a13a31255 100644 --- a/3rdparty/bgfx/3rdparty/sdf/sdf.h +++ b/3rdparty/bgfx/3rdparty/sdf/sdf.h @@ -92,7 +92,7 @@ static float sdf__edgedf(float gx, float gy, float a) } else if (a < (1.0-a1)) { // a1 <= a <= 1-a1 df = (0.5f-a)*gx; } else { // 1-a1 < a <= 1 - df = -0.5f*(gx + gy) + sqrt(2.0f*gx*gy*(1.0f-a)); + df = -0.5f*(gx + gy) + sqrtf(2.0f*gx*gy*(1.0f-a)); } } return df; diff --git a/3rdparty/bgfx/3rdparty/stb/stb_image.c b/3rdparty/bgfx/3rdparty/stb/stb_image.c index 1eadb99b12a..9431567ec2a 100644 --- a/3rdparty/bgfx/3rdparty/stb/stb_image.c +++ b/3rdparty/bgfx/3rdparty/stb/stb_image.c @@ -187,10 +187,15 @@ #ifndef STBI_NO_STDIO -#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen() -#pragma warning(push) -#pragma warning(disable:4996) // suppress even more warnings about fopen() +#if defined(_MSC_VER) && _MSC_VER >= 1400 +# if !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS // suppress warnings about fopen() +# endif +# pragma warning(push) +# pragma warning(disable:4996) // suppress even more warnings about fopen() +# pragma warning(disable:4312) // warning C4312: 'type cast': conversion from 'int' to 'unsigned char *' of greater size +# pragma warning(disable:4456) // warning C4456: declaration of 'k' hides previous local declaration +# pragma warning(disable:4457) // warning C4457: declaration of 'y' hides function parameter #endif #include <stdio.h> #endif // STBI_NO_STDIO @@ -3249,7 +3254,7 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int unsigned char *tga_data; unsigned char *tga_palette = NULL; int i, j; - unsigned char raw_data[4]; + unsigned char raw_data[4] = {}; int RLE_count = 0; int RLE_repeating = 0; int read_next_pixel = 1; diff --git a/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md index e0fd614bb36..91fd26ba496 100644 --- a/3rdparty/bgfx/README.md +++ b/3rdparty/bgfx/README.md @@ -432,6 +432,13 @@ Configuration is `<platform>-<debug/release>[32/64]`. For example: linux-release32, nacl-debug64, nacl-arm-debug, pnacl-release, android-release, etc. +Amalgamated build +----------------- + +For ease of integration to other build system bgfx library can be built with +single .cpp file. It's only necessary to build [src/amalgamated.cpp](https://github.com/bkaradzic/bgfx/blob/master/src/amalgamated.cpp) +inside different build system. + OculusVR integration -------------------- @@ -568,6 +575,11 @@ with examples: genie --with-sdl vs2012 +**NOTE** Special care is necessary to make custom windowing to work with +multithreaded renderer. Each platform has rules about where renderer can be and +how multithreading interacts with context/device. To disable multithreaded +render use `BGFX_CONFIG_MULTITHREDED=0` preprocessor define. + Tools ----- diff --git a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp index 3689b14a39c..7578433b317 100644 --- a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp +++ b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp @@ -592,10 +592,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) float sphere[numSpheres][4]; for (uint32_t ii = 0; ii < numSpheres; ++ii) { - sphere[ii][0] = sin(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f); - sphere[ii][1] = sin(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f); - sphere[ii][2] = cos(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f); - sphere[ii][3] = 1.0f/(2.0f + (sin(time*(ii*0.13f) )*0.5f+0.5f)*2.0f); + sphere[ii][0] = sinf(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f); + sphere[ii][1] = sinf(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f); + sphere[ii][2] = cosf(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f); + sphere[ii][3] = 1.0f/(2.0f + (sinf(time*(ii*0.13f) )*0.5f+0.5f)*2.0f); } profUpdate = bx::getHPCounter(); diff --git a/3rdparty/bgfx/examples/05-instancing/instancing.cpp b/3rdparty/bgfx/examples/05-instancing/instancing.cpp index e17f7fb8c16..40b180ea857 100644 --- a/3rdparty/bgfx/examples/05-instancing/instancing.cpp +++ b/3rdparty/bgfx/examples/05-instancing/instancing.cpp @@ -182,9 +182,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) mtx[14] = 0.0f; float* color = (float*)&data[64]; - color[0] = sin(time+float(xx)/11.0f)*0.5f+0.5f; - color[1] = cos(time+float(yy)/11.0f)*0.5f+0.5f; - color[2] = sin(time*3.0f)*0.5f+0.5f; + color[0] = sinf(time+float(xx)/11.0f)*0.5f+0.5f; + color[1] = cosf(time+float(yy)/11.0f)*0.5f+0.5f; + color[2] = sinf(time*3.0f)*0.5f+0.5f; color[3] = 1.0f; data += instanceStride; diff --git a/3rdparty/bgfx/examples/06-bump/bump.cpp b/3rdparty/bgfx/examples/06-bump/bump.cpp index 352430f78f6..e5c4a521876 100644 --- a/3rdparty/bgfx/examples/06-bump/bump.cpp +++ b/3rdparty/bgfx/examples/06-bump/bump.cpp @@ -192,7 +192,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) float at[3] = { 0.0f, 0.0f, 0.0f }; float eye[3] = { 0.0f, 0.0f, -7.0f }; - + // Set view and projection matrix for view 0. const bgfx::HMD* hmd = bgfx::getHMD(); if (NULL != hmd) @@ -227,8 +227,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) float lightPosRadius[4][4]; for (uint32_t ii = 0; ii < numLights; ++ii) { - lightPosRadius[ii][0] = sin( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f; - lightPosRadius[ii][1] = cos( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f; + lightPosRadius[ii][0] = sinf( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f; + lightPosRadius[ii][1] = cosf( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f; lightPosRadius[ii][2] = -2.5f; lightPosRadius[ii][3] = 3.0f; } @@ -338,7 +338,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) } } - // Advance to next frame. Rendering thread will be kicked to + // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. bgfx::frame(); } diff --git a/3rdparty/bgfx/examples/07-callback/callback.cpp b/3rdparty/bgfx/examples/07-callback/callback.cpp index 3e4480912d0..3caec753fed 100644 --- a/3rdparty/bgfx/examples/07-callback/callback.cpp +++ b/3rdparty/bgfx/examples/07-callback/callback.cpp @@ -372,6 +372,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::init( renderers[bx::getHPCounter() % numRenderers] /* randomize renderer */ + , BGFX_PCI_ID_NONE + , 0 , &callback // custom callback handler , &allocator // custom allocator ); @@ -442,7 +444,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) float at[3] = { 0.0f, 0.0f, 0.0f }; float eye[3] = { 0.0f, 0.0f, -35.0f }; - + float view[16]; float proj[16]; bx::mtxLookAt(view, eye, at); @@ -488,7 +490,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::saveScreenShot("temp/frame150"); } - // Advance to next frame. Rendering thread will be kicked to + // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. bgfx::frame(); } diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp index d87371aeb92..38486b9b3e3 100644 --- a/3rdparty/bgfx/examples/08-update/update.cpp +++ b/3rdparty/bgfx/examples/08-update/update.cpp @@ -167,12 +167,29 @@ int _main_(int /*_argc*/, char** /*_argv*/) } } - bgfx::TextureHandle textures3d[] = + const bgfx::Caps* caps = bgfx::getCaps(); + const bool texture3DSupported = !!(caps->supported & BGFX_CAPS_TEXTURE_3D); + + uint32_t numTextures3d = 0; + bgfx::TextureHandle textures3d[3] = {}; + + if (texture3DSupported) { - bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8), - bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f), - bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f), - }; + if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R8]) ) + { + textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8); + } + + if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R16F]) ) + { + textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f); + } + + if (0 != (BGFX_CAPS_FORMAT_TEXTURE_COLOR & caps->formats[bgfx::TextureFormat::R32F]) ) + { + textures3d[numTextures3d++] = bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f); + } + } // Create static vertex buffer. bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) ), PosTexcoordVertex::ms_decl); @@ -188,7 +205,11 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update"); bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp"); - bgfx::ProgramHandle program3d = loadProgram("vs_update", "fs_update_3d"); + bgfx::ProgramHandle program3d = BGFX_INVALID_HANDLE; + if (texture3DSupported) + { + program3d = loadProgram("vs_update", "fs_update_3d"); + } const uint32_t textureSide = 2048; @@ -271,8 +292,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) for (uint32_t ii = 0, num = bx::uint32_min(10, (uint32_t)quads.size() ); ii < num; ++ii) { - const PackCube& face = quads.front(); - cube.clear(face); + cube.clear(quads.front() ); quads.pop_front(); } } @@ -399,7 +419,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::submit(1); } - for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii) + for (uint32_t ii = 0; ii < numTextures3d; ++ii) { bx::mtxTranslate(mtx, xpos + ii*2.1f, -4.0f, 0.0f); @@ -465,7 +485,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyTexture(textures[ii]); } - for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii) + for (uint32_t ii = 0; ii < numTextures3d; ++ii) { bgfx::destroyTexture(textures3d[ii]); } @@ -474,7 +494,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyTexture(textureCube); bgfx::destroyIndexBuffer(ibh); bgfx::destroyVertexBuffer(vbh); - bgfx::destroyProgram(program3d); + if (bgfx::isValid(program3d) ) + { + bgfx::destroyProgram(program3d); + } bgfx::destroyProgram(programCmp); bgfx::destroyProgram(program); bgfx::destroyUniform(u_time); diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp index 1e925f378ef..c8dbfea1539 100644 --- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp +++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp @@ -174,7 +174,12 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setViewName(8, "Blur vertical"); bgfx::setViewName(9, "Blur horizontal + tonemap"); - bgfx::TextureHandle uffizi = loadTexture("uffizi.dds", BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP); + bgfx::TextureHandle uffizi = loadTexture("uffizi.dds" + , 0 + | BGFX_TEXTURE_U_CLAMP + | BGFX_TEXTURE_V_CLAMP + | BGFX_TEXTURE_W_CLAMP + ); bgfx::ProgramHandle skyProgram = loadProgram("vs_hdr_skybox", "fs_hdr_skybox"); bgfx::ProgramHandle lumProgram = loadProgram("vs_hdr_lum", "fs_hdr_lum"); @@ -371,6 +376,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Render skybox into view 0. bgfx::setTexture(0, u_texCube, uffizi); + bgfx::setProgram(skyProgram); bgfx::setState(BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE); screenSpaceQuad( (float)width, (float)height, true); diff --git a/3rdparty/bgfx/examples/12-lod/lod.cpp b/3rdparty/bgfx/examples/12-lod/lod.cpp index a8bdf4dd8c8..7317c8488c7 100644 --- a/3rdparty/bgfx/examples/12-lod/lod.cpp +++ b/3rdparty/bgfx/examples/12-lod/lod.cpp @@ -20,7 +20,7 @@ KnightPos knightTour[8*4] = {0,0}, {1,2}, {3,3}, {4,1}, {5,3}, {7,2}, {6,0}, {5,2}, {7,3}, {6,1}, {4,0}, {3,2}, {2,0}, {0,1}, {1,3}, {2,1}, {0,2}, {1,0}, {2,2}, {0,3}, {1,1}, {3,0}, {4,2}, {5,0}, - {7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3} + {7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3}, }; int _main_(int /*_argc*/, char** /*_argv*/) @@ -55,15 +55,19 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::TextureHandle textureStipple; - const bgfx::Memory* stipple = bgfx::alloc(8*4); - memset(stipple->data, 0, stipple->size); + const bgfx::Memory* stippleTex = bgfx::alloc(8*4); + memset(stippleTex->data, 0, stippleTex->size); for (uint32_t ii = 0; ii < 32; ++ii) { - stipple->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4; + stippleTex->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4; } - textureStipple = bgfx::createTexture2D(8, 4, 1, bgfx::TextureFormat::R8, BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT, stipple); + textureStipple = bgfx::createTexture2D(8, 4, 1 + , bgfx::TextureFormat::R8 + , BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT + , stippleTex + ); Mesh* meshTop[3] = { diff --git a/3rdparty/bgfx/examples/13-stencil/stencil.cpp b/3rdparty/bgfx/examples/13-stencil/stencil.cpp index a9f62402e54..3b869b5c5f3 100644 --- a/3rdparty/bgfx/examples/13-stencil/stencil.cpp +++ b/3rdparty/bgfx/examples/13-stencil/stencil.cpp @@ -1040,9 +1040,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) const float radius = (scene == StencilReflectionScene) ? 15.0f : 25.0f; for (uint8_t ii = 0; ii < numLights; ++ii) { - lightPosRadius[ii][0] = sin( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f; - lightPosRadius[ii][1] = 8.0f + (1.0f - cos( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f; - lightPosRadius[ii][2] = cos( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f; + lightPosRadius[ii][0] = sinf( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f; + lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f; + lightPosRadius[ii][2] = cosf( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f; lightPosRadius[ii][3] = radius; } memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float)); @@ -1112,9 +1112,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) , 0.0f , 0.0f , 0.0f - , sin(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f + , sinf(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f , 4.0f - , cos(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f + , cosf(ii * 2.0f + 13.0f - sceneTimeAccumulator) * 13.0f ); } @@ -1188,7 +1188,6 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Set lights back. memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float)); - // Third pass - Blend plane. // Floor. @@ -1217,6 +1216,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) , s_renderStates[RenderState::StencilReflection_DrawScene] ); } + } break; @@ -1319,10 +1319,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) ); // Cubes. - for (uint8_t ii = 0; ii < numCubes; ++ii) + for (uint8_t jj = 0; jj < numCubes; ++jj) { cubeMesh.submit(viewId - , cubeMtx[ii] + , cubeMtx[jj] , programTextureLightning , s_renderStates[RenderState::ProjectionShadows_DrawDiffuse] , figureTex diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp index e6a79456de3..3b1bc71daeb 100644 --- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp @@ -2276,9 +2276,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) { for (uint8_t ii = 0; ii < settings_numLights; ++ii) { - lightPosRadius[ii][0] = cos(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; + lightPosRadius[ii][0] = cosf(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; lightPosRadius[ii][1] = 20.0f; - lightPosRadius[ii][2] = sin(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; + lightPosRadius[ii][2] = sinf(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; lightPosRadius[ii][3] = 20.0f; } } @@ -2286,9 +2286,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) { for (uint8_t ii = 0; ii < settings_numLights; ++ii) { - lightPosRadius[ii][0] = cos(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; + lightPosRadius[ii][0] = cosf(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; lightPosRadius[ii][1] = 20.0f; - lightPosRadius[ii][2] = sin(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; + lightPosRadius[ii][2] = sinf(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; lightPosRadius[ii][3] = 20.0f; } } @@ -2362,9 +2362,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) inst.m_rotation[0] = 0.0f; inst.m_rotation[1] = 0.0f; inst.m_rotation[2] = 0.0f; - inst.m_pos[0] = sin(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[0] = sinf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_pos[1] = 6.0f; - inst.m_pos[2] = cos(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[2] = cosf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_model = &cubeModel; } @@ -2379,9 +2379,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) inst.m_rotation[0] = 0.0f; inst.m_rotation[1] = 0.0f; inst.m_rotation[2] = 0.0f; - inst.m_pos[0] = sin(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[0] = sinf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_pos[1] = 22.0f; - inst.m_pos[2] = cos(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; + inst.m_pos[2] = cosf(ii * 2.0f + 13.0f + sceneTimeAccumulator * 1.1f) * 13.0f; inst.m_model = &cubeModel; } diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index 72b9e0dda56..3e4e7940a4a 100644 --- a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -221,9 +221,9 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Setup lights. float lightPos[4]; - lightPos[0] = -cos(timeAccumulatorLight); + lightPos[0] = -cosf(timeAccumulatorLight); lightPos[1] = -1.0f; - lightPos[2] = -sin(timeAccumulatorLight); + lightPos[2] = -sinf(timeAccumulatorLight); lightPos[3] = 0.0f; bgfx::setUniform(u_lightPos, lightPos); diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp index 86b3d7082f6..09dc689a5f2 100644 --- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp +++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp @@ -2165,16 +2165,16 @@ int _main_(int /*_argc*/, char** /*_argv*/) if (settings.m_updateScene) { timeAccumulatorScene += deltaTime; } // Setup lights. - pointLight.m_position.m_x = cos(timeAccumulatorLight) * 20.0f; + pointLight.m_position.m_x = cosf(timeAccumulatorLight) * 20.0f; pointLight.m_position.m_y = 26.0f; - pointLight.m_position.m_z = sin(timeAccumulatorLight) * 20.0f; + pointLight.m_position.m_z = sinf(timeAccumulatorLight) * 20.0f; pointLight.m_spotDirectionInner.m_x = -pointLight.m_position.m_x; pointLight.m_spotDirectionInner.m_y = -pointLight.m_position.m_y; pointLight.m_spotDirectionInner.m_z = -pointLight.m_position.m_z; - directionalLight.m_position.m_x = -cos(timeAccumulatorLight); + directionalLight.m_position.m_x = -cosf(timeAccumulatorLight); directionalLight.m_position.m_y = -1.0f; - directionalLight.m_position.m_z = -sin(timeAccumulatorLight); + directionalLight.m_position.m_z = -sinf(timeAccumulatorLight); // Setup instance matrices. float mtxFloor[16]; diff --git a/3rdparty/bgfx/examples/20-nanovg/blendish.h b/3rdparty/bgfx/examples/20-nanovg/blendish.h index 43258e040e1..1afb1f5d0ed 100644 --- a/3rdparty/bgfx/examples/20-nanovg/blendish.h +++ b/3rdparty/bgfx/examples/20-nanovg/blendish.h @@ -1109,6 +1109,7 @@ BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState s #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings #pragma warning (disable: 4244) #pragma warning (disable: 4305) + #pragma warning (disable: 4838) // warning C4838: conversion from 'double' to 'float' requires a narrowing conversion #ifdef __cplusplus #define BND_INLINE inline #else diff --git a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp index cd90111b246..2b30ef39e7b 100644 --- a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp +++ b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp @@ -387,7 +387,7 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m float ry = y + ey; float dx,dy,d; float br = (ex < ey ? ex : ey) * 0.5f; - float blink = 1 - pow(sinf(t*0.5f),200)*0.8f; + float blink = 1 - powf(sinf(t*0.5f),200)*0.8f; bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16)); nvgBeginPath(vg); @@ -1042,10 +1042,10 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h for (j = 0; j < nglyphs; j++) { float x0 = glyphs[j].x; float x1 = (j+1 < nglyphs) ? glyphs[j+1].x : x+row->width; - float gx = x0 * 0.3f + x1 * 0.7f; - if (mx >= px && mx < gx) + float tgx = x0 * 0.3f + x1 * 0.7f; + if (mx >= px && mx < tgx) caretx = glyphs[j].x; - px = gx; + px = tgx; } nvgBeginPath(vg); nvgFillColor(vg, nvgRGBA(255,192,0,255)); @@ -1075,11 +1075,11 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h nvgBeginPath(vg); nvgFillColor(vg, nvgRGBA(255,192,0,255)); nvgRoundedRect(vg - , round(bounds[0])-4.0f - , round(bounds[1])-2.0f - , round(bounds[2]-bounds[0])+8.0f - , round(bounds[3]-bounds[1])+4.0f - , (round(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f + , roundf(bounds[0])-4.0f + , roundf(bounds[1])-2.0f + , roundf(bounds[2]-bounds[0])+8.0f + , roundf(bounds[3]-bounds[1])+4.0f + , (roundf(bounds[3]-bounds[1])+4.0f)/2.0f-1.0f ); nvgFill(vg); @@ -1097,10 +1097,10 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h nvgBeginPath(vg); nvgFillColor(vg, nvgRGBA(220,220,220,255)); nvgRoundedRect(vg - , round(bounds[0]-2.0f) - , round(bounds[1]-2.0f) - , round(bounds[2]-bounds[0])+4.0f - , round(bounds[3]-bounds[1])+4.0f + , roundf(bounds[0]-2.0f) + , roundf(bounds[1]-2.0f) + , roundf(bounds[2]-bounds[0])+4.0f + , roundf(bounds[3]-bounds[1])+4.0f , 3.0f ); px = float( (int)((bounds[2]+bounds[0])/2) ); diff --git a/3rdparty/bgfx/examples/21-deferred/deferred.cpp b/3rdparty/bgfx/examples/21-deferred/deferred.cpp index 1c472b6010d..7d7190c6d7f 100644 --- a/3rdparty/bgfx/examples/21-deferred/deferred.cpp +++ b/3rdparty/bgfx/examples/21-deferred/deferred.cpp @@ -529,10 +529,10 @@ int _main_(int /*_argc*/, char** /*_argv*/) { Sphere lightPosRadius; - float lightTime = time * lightAnimationSpeed * (sin(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f); - lightPosRadius.m_center[0] = sin( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset; - lightPosRadius.m_center[1] = cos( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset; - lightPosRadius.m_center[2] = sin( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f; + float lightTime = time * lightAnimationSpeed * (sinf(light/float(numLights) * bx::piHalf ) * 0.5f + 0.5f); + lightPosRadius.m_center[0] = sinf( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset; + lightPosRadius.m_center[1] = cosf( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset; + lightPosRadius.m_center[2] = sinf( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f; lightPosRadius.m_radius = 2.0f; Aabb aabb; diff --git a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp index 52d5ab9f52a..4d6b5132a5a 100644 --- a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp +++ b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp @@ -150,8 +150,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) // draw moving shape static float counter = 0.0f; counter += 0.01f; - float posX = width / 2.0f + sin(counter * 3.18378f) * (width / 2.0f); - float posY = height / 2.0f + cos(counter) * (height / 2.0f); + float posX = width / 2.0f + sinf(counter * 3.18378f) * (width / 2.0f); + float posY = height / 2.0f + cosf(counter) * (height / 2.0f); vd.drawCircle(posX, posY, 5.0f, 10.0f); vd.endFrame(); diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp index 41ecbd7f2ff..7f603c15d9e 100644 --- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp +++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp @@ -361,10 +361,10 @@ void VectorDisplay::endDraw() line->y0 = m_pendingPoints[i - 1].y; line->x1 = m_pendingPoints[i].x; line->y1 = m_pendingPoints[i].y; - line->a = atan2(line->y1 - line->y0, line->x1 - line->x0); // angle from positive x axis, increasing ccw, [-pi, pi] + line->a = atan2f(line->y1 - line->y0, line->x1 - line->x0); // angle from positive x axis, increasing ccw, [-pi, pi] line->sin_a = sinf(line->a); line->cos_a = cosf(line->a); - line->len = sqrt( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) ); + line->len = sqrtf( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) ); // figure out what connections we have line->has_prev = (!line->is_first diff --git a/3rdparty/bgfx/examples/24-nbody/nbody.cpp b/3rdparty/bgfx/examples/24-nbody/nbody.cpp index 36a98e97862..b006f0b1315 100644 --- a/3rdparty/bgfx/examples/24-nbody/nbody.cpp +++ b/3rdparty/bgfx/examples/24-nbody/nbody.cpp @@ -117,211 +117,238 @@ int _main_(int /*_argc*/, char** /*_argv*/) , 0 ); - // Imgui. - imguiCreate(); - - bgfx::VertexDecl quadVertexDecl; - quadVertexDecl.begin() - .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float) - .end(); - - // Create static vertex buffer. - bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer( - // Static data can be passed with bgfx::makeRef - bgfx::makeRef(s_quadVertices, sizeof(s_quadVertices) ) - , quadVertexDecl - ); - - // Create static index buffer. - bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer( - // Static data can be passed with bgfx::makeRef - bgfx::makeRef(s_quadIndices, sizeof(s_quadIndices) ) - ); - - // Create particle program from shaders. - bgfx::ProgramHandle particleProgram = loadProgram("vs_particle", "fs_particle"); - - // Setup compute buffers - bgfx::VertexDecl computeVertexDecl; - computeVertexDecl.begin() - .add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float) - .end(); - - const uint32_t threadGroupUpdateSize = 512; - const uint32_t maxParticleCount = 32 * 1024; - - bgfx::DynamicVertexBufferHandle currPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); - bgfx::DynamicVertexBufferHandle currPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); - bgfx::DynamicVertexBufferHandle prevPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); - bgfx::DynamicVertexBufferHandle prevPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); - - bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv, 3); - - bgfx::ShaderHandle initInstancesShader = loadShader("cs_init_instances"); - bgfx::ProgramHandle initInstancesProgram = bgfx::createProgram(initInstancesShader, true); - bgfx::ShaderHandle updateInstancesShader = loadShader("cs_update_instances"); - bgfx::ProgramHandle updateInstancesProgram = bgfx::createProgram(updateInstancesShader, true); + const bgfx::Caps* caps = bgfx::getCaps(); + const bool computeSupported = !!(caps->supported & BGFX_CAPS_COMPUTE); - u_paramsDataStruct u_paramsData; - InitializeParams(0, &u_paramsData); - - bgfx::setUniform(u_params, &u_paramsData, 3); - bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write); - bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write); - bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1); - - float view[16]; - float initialPos[3] = { 0.0f, 0.0f, -45.0f }; - cameraCreate(); - cameraSetPosition(initialPos); - cameraSetVerticalAngle(0.0f); - cameraGetViewMtx(view); - - int32_t scrollArea = 0; - - entry::MouseState mouseState; - while (!entry::processEvents(width, height, debug, reset, &mouseState) ) + if (computeSupported) { - int64_t now = bx::getHPCounter(); - static int64_t last = now; - const int64_t frameTime = now - last; - last = now; - const double freq = double(bx::getHPFrequency() ); - const float deltaTime = float(frameTime/freq); - - // Set view 0 default viewport. - bgfx::setViewRect(0, 0, 0, width, height); - - // Use debug font to print information about this example. - bgfx::dbgTextClear(); - bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/24-nbody"); - bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: N-body simulation with compute shaders using buffers."); - - imguiBeginFrame(mouseState.m_mx - , mouseState.m_my - , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0) - | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0) - , 0 - , width - , height - ); - imguiBeginScrollArea("Settings", width - width / 4 - 10, 10, width / 4, 500, &scrollArea); - imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100); - int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut"); - imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f); - bool reset = imguiButton("Reset"); - imguiSeparatorLine(); - imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64); - imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f); - imguiSlider("Damping", u_paramsData.damping, 0.0f, 1.0f, 0.01f); - imguiSlider("Max acceleration", u_paramsData.maxAccel, 0.0f, 100.0f, 0.01f); - imguiSlider("Time step", u_paramsData.timeStep, 0.0f, 0.02f, 0.0001f); - imguiSeparatorLine(); - imguiSlider("Particle intensity", u_paramsData.particleIntensity, 0.0f, 1.0f, 0.001f); - imguiSlider("Particle size", u_paramsData.particleSize, 0.0f, 1.0f, 0.001f); - imguiSlider("Particle power", u_paramsData.particlePower, 0.001f, 16.0f, 0.01f); - imguiEndScrollArea(); - imguiEndFrame(); - - // Modify parameters and reset if shape is changed - if (shape != u_paramsData.initialShape) - { - reset = true; - InitializeParams(shape, &u_paramsData); - } - - if (reset) - { - bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write); - bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write); - bgfx::setUniform(u_params, &u_paramsData, 3); - bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1); - } + // Imgui. + imguiCreate(); + + bgfx::VertexDecl quadVertexDecl; + quadVertexDecl.begin() + .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float) + .end(); + + // Create static vertex buffer. + bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer( + // Static data can be passed with bgfx::makeRef + bgfx::makeRef(s_quadVertices, sizeof(s_quadVertices) ) + , quadVertexDecl + ); + + // Create static index buffer. + bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer( + // Static data can be passed with bgfx::makeRef + bgfx::makeRef(s_quadIndices, sizeof(s_quadIndices) ) + ); + + // Create particle program from shaders. + bgfx::ProgramHandle particleProgram = loadProgram("vs_particle", "fs_particle"); + + // Setup compute buffers + bgfx::VertexDecl computeVertexDecl; + computeVertexDecl.begin() + .add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float) + .end(); + + const uint32_t threadGroupUpdateSize = 512; + const uint32_t maxParticleCount = 32 * 1024; + + bgfx::DynamicVertexBufferHandle currPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); + bgfx::DynamicVertexBufferHandle currPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); + bgfx::DynamicVertexBufferHandle prevPositionBuffer0 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); + bgfx::DynamicVertexBufferHandle prevPositionBuffer1 = bgfx::createDynamicVertexBuffer(1 << 15, computeVertexDecl, BGFX_BUFFER_COMPUTE_READ_WRITE); + + bgfx::UniformHandle u_params = bgfx::createUniform("u_params", bgfx::UniformType::Uniform4fv, 3); + + bgfx::ShaderHandle initInstancesShader = loadShader("cs_init_instances"); + bgfx::ProgramHandle initInstancesProgram = bgfx::createProgram(initInstancesShader, true); + bgfx::ShaderHandle updateInstancesShader = loadShader("cs_update_instances"); + bgfx::ProgramHandle updateInstancesProgram = bgfx::createProgram(updateInstancesShader, true); + + u_paramsDataStruct u_paramsData; + InitializeParams(0, &u_paramsData); - bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Read); - bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Read); - bgfx::setBuffer(2, prevPositionBuffer1, bgfx::Access::Write); - bgfx::setBuffer(3, currPositionBuffer1, bgfx::Access::Write); bgfx::setUniform(u_params, &u_paramsData, 3); - bgfx::dispatch(0, updateInstancesProgram, u_paramsData.dispatchSize, 1, 1); - - bx::xchg(currPositionBuffer0, currPositionBuffer1); - bx::xchg(prevPositionBuffer0, prevPositionBuffer1); + bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write); + bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write); + bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1); float view[16]; - - // Update camera. - cameraUpdate(deltaTime, mouseState); + float initialPos[3] = { 0.0f, 0.0f, -45.0f }; + cameraCreate(); + cameraSetPosition(initialPos); + cameraSetVerticalAngle(0.0f); cameraGetViewMtx(view); - // Set view and projection matrix for view 0. - const bgfx::HMD* hmd = bgfx::getHMD(); - if (NULL != hmd) - { - float viewHead[16]; - float eye[3] = {}; - bx::mtxQuatTranslationHMD(viewHead, hmd->eye[0].rotation, eye); - - float tmp[16]; - bx::mtxMul(tmp, view, viewHead); + int32_t scrollArea = 0; - float proj[16]; - bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 10000.0f); - - bgfx::setViewTransform(0, tmp, proj); - - // Set view 0 default viewport. - // - // Use HMD's width/height since HMD's internal frame buffer size - // might be much larger than window size. - bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height); - } - else + entry::MouseState mouseState; + while (!entry::processEvents(width, height, debug, reset, &mouseState) ) { - float proj[16]; - bx::mtxProj(proj, 90.0f, float(width)/float(height), 0.1f, 10000.0f); - bgfx::setViewTransform(0, view, proj); + int64_t now = bx::getHPCounter(); + static int64_t last = now; + const int64_t frameTime = now - last; + last = now; + const double freq = double(bx::getHPFrequency() ); + const float deltaTime = float(frameTime/freq); // Set view 0 default viewport. bgfx::setViewRect(0, 0, 0, width, height); + + // Use debug font to print information about this example. + bgfx::dbgTextClear(); + bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/24-nbody"); + bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: N-body simulation with compute shaders using buffers."); + + imguiBeginFrame(mouseState.m_mx + , mouseState.m_my + , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0) + | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0) + , 0 + , width + , height + ); + imguiBeginScrollArea("Settings", width - width / 4 - 10, 10, width / 4, 500, &scrollArea); + imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100); + int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut"); + imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f); + bool defaults = imguiButton("Reset"); + imguiSeparatorLine(); + imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64); + imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f); + imguiSlider("Damping", u_paramsData.damping, 0.0f, 1.0f, 0.01f); + imguiSlider("Max acceleration", u_paramsData.maxAccel, 0.0f, 100.0f, 0.01f); + imguiSlider("Time step", u_paramsData.timeStep, 0.0f, 0.02f, 0.0001f); + imguiSeparatorLine(); + imguiSlider("Particle intensity", u_paramsData.particleIntensity, 0.0f, 1.0f, 0.001f); + imguiSlider("Particle size", u_paramsData.particleSize, 0.0f, 1.0f, 0.001f); + imguiSlider("Particle power", u_paramsData.particlePower, 0.001f, 16.0f, 0.01f); + imguiEndScrollArea(); + imguiEndFrame(); + + // Modify parameters and reset if shape is changed + if (shape != u_paramsData.initialShape) + { + defaults = true; + InitializeParams(shape, &u_paramsData); + } + + if (defaults) + { + bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write); + bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write); + bgfx::setUniform(u_params, &u_paramsData, 3); + bgfx::dispatch(0, initInstancesProgram, maxParticleCount / threadGroupUpdateSize, 1, 1); + } + + bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Read); + bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Read); + bgfx::setBuffer(2, prevPositionBuffer1, bgfx::Access::Write); + bgfx::setBuffer(3, currPositionBuffer1, bgfx::Access::Write); + bgfx::setUniform(u_params, &u_paramsData, 3); + bgfx::dispatch(0, updateInstancesProgram, u_paramsData.dispatchSize, 1, 1); + + bx::xchg(currPositionBuffer0, currPositionBuffer1); + bx::xchg(prevPositionBuffer0, prevPositionBuffer1); + + // Update camera. + cameraUpdate(deltaTime, mouseState); + cameraGetViewMtx(view); + + // Set view and projection matrix for view 0. + const bgfx::HMD* hmd = bgfx::getHMD(); + if (NULL != hmd) + { + float viewHead[16]; + float eye[3] = {}; + bx::mtxQuatTranslationHMD(viewHead, hmd->eye[0].rotation, eye); + + float tmp[16]; + bx::mtxMul(tmp, view, viewHead); + + float proj[16]; + bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 10000.0f); + + bgfx::setViewTransform(0, tmp, proj); + + // Set view 0 default viewport. + // + // Use HMD's width/height since HMD's internal frame buffer size + // might be much larger than window size. + bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height); + } + else + { + float proj[16]; + bx::mtxProj(proj, 90.0f, float(width)/float(height), 0.1f, 10000.0f); + bgfx::setViewTransform(0, view, proj); + + // Set view 0 default viewport. + bgfx::setViewRect(0, 0, 0, width, height); + } + + // Set vertex and fragment shaders. + bgfx::setProgram(particleProgram); + + // Set vertex and index buffer. + bgfx::setVertexBuffer(vbh); + bgfx::setIndexBuffer(ibh); + bgfx::setInstanceDataBuffer(currPositionBuffer0, 0, u_paramsData.dispatchSize * threadGroupUpdateSize); + + // Set render states. + bgfx::setState(0 + | BGFX_STATE_RGB_WRITE + | BGFX_STATE_BLEND_ADD + | BGFX_STATE_DEPTH_TEST_ALWAYS + ); + + // Submit primitive for rendering to view 0. + bgfx::submit(0); + + // Advance to next frame. Rendering thread will be kicked to + // process submitted rendering primitives. + bgfx::frame(); } - // Set vertex and fragment shaders. - bgfx::setProgram(particleProgram); + // Cleanup. + cameraDestroy(); + imguiDestroy(); + bgfx::destroyUniform(u_params); + bgfx::destroyDynamicVertexBuffer(currPositionBuffer0); + bgfx::destroyDynamicVertexBuffer(currPositionBuffer1); + bgfx::destroyDynamicVertexBuffer(prevPositionBuffer0); + bgfx::destroyDynamicVertexBuffer(prevPositionBuffer1); + bgfx::destroyProgram(updateInstancesProgram); + bgfx::destroyProgram(initInstancesProgram); + bgfx::destroyIndexBuffer(ibh); + bgfx::destroyVertexBuffer(vbh); + bgfx::destroyProgram(particleProgram); + } + else + { + int64_t timeOffset = bx::getHPCounter(); - // Set vertex and index buffer. - bgfx::setVertexBuffer(vbh); - bgfx::setIndexBuffer(ibh); - bgfx::setInstanceDataBuffer(currPositionBuffer0, 0, u_paramsData.dispatchSize * threadGroupUpdateSize); + entry::MouseState mouseState; + while (!entry::processEvents(width, height, debug, reset, &mouseState) ) + { + int64_t now = bx::getHPCounter(); + float time = (float)( (now - timeOffset)/double(bx::getHPFrequency() ) ); - // Set render states. - bgfx::setState(0 - | BGFX_STATE_RGB_WRITE - | BGFX_STATE_BLEND_ADD - | BGFX_STATE_DEPTH_TEST_ALWAYS - ); + bgfx::setViewRect(0, 0, 0, width, height); - // Submit primitive for rendering to view 0. - bgfx::submit(0); + bgfx::dbgTextClear(); + bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/24-nbody"); + bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: N-body simulation with compute shaders using buffers."); - // Advance to next frame. Rendering thread will be kicked to - // process submitted rendering primitives. - bgfx::frame(); - } + bool blink = uint32_t(time*3.0f)&1; + bgfx::dbgTextPrintf(0, 5, blink ? 0x1f : 0x01, " Compute is not supported by GPU. "); - // Cleanup. - cameraDestroy(); - imguiDestroy(); - bgfx::destroyUniform(u_params); - bgfx::destroyDynamicVertexBuffer(currPositionBuffer0); - bgfx::destroyDynamicVertexBuffer(currPositionBuffer1); - bgfx::destroyDynamicVertexBuffer(prevPositionBuffer0); - bgfx::destroyDynamicVertexBuffer(prevPositionBuffer1); - bgfx::destroyProgram(updateInstancesProgram); - bgfx::destroyProgram(initInstancesProgram); - bgfx::destroyIndexBuffer(ibh); - bgfx::destroyVertexBuffer(vbh); - bgfx::destroyProgram(particleProgram); + bgfx::submit(0); + bgfx::frame(); + } + } // Shutdown bgfx. bgfx::shutdown(); diff --git a/3rdparty/bgfx/examples/25-c99/helloworld.c b/3rdparty/bgfx/examples/25-c99/helloworld.c index b3862ebd2a1..e217e10e8c6 100644 --- a/3rdparty/bgfx/examples/25-c99/helloworld.c +++ b/3rdparty/bgfx/examples/25-c99/helloworld.c @@ -15,14 +15,19 @@ uint16_t uint16_max(uint16_t _a, uint16_t _b) int _main_(int _argc, char** _argv) { + uint32_t width = 1280; + uint32_t height = 720; + uint32_t debug = BGFX_DEBUG_TEXT; + uint32_t reset = BGFX_RESET_VSYNC; (void)_argc; (void)_argv; - uint32_t width = 1280; - uint32_t height = 720; - uint32_t debug = BGFX_DEBUG_TEXT; - uint32_t reset = BGFX_RESET_VSYNC; - bgfx_init(BGFX_RENDERER_TYPE_COUNT, NULL, NULL); + bgfx_init(BGFX_RENDERER_TYPE_COUNT + , BGFX_PCI_ID_NONE + , 0 + , NULL + , NULL + ); bgfx_reset(width, height, reset); // Enable debug text. diff --git a/3rdparty/bgfx/examples/common/bounds.cpp b/3rdparty/bgfx/examples/common/bounds.cpp index 4af4555511d..8fc91b63e99 100644 --- a/3rdparty/bgfx/examples/common/bounds.cpp +++ b/3rdparty/bgfx/examples/common/bounds.cpp @@ -264,9 +264,9 @@ void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num { position = (float*)&vertex[index*_stride]; - float xx = position[0] - center[0]; - float yy = position[1] - center[1]; - float zz = position[2] - center[2]; + xx = position[0] - center[0]; + yy = position[1] - center[1]; + zz = position[2] - center[2]; float distSq = xx*xx + yy*yy + zz*zz; if (distSq > maxDistSq) diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp index 7ef7853145f..001232d5556 100644 --- a/3rdparty/bgfx/examples/common/entry/entry.cpp +++ b/3rdparty/bgfx/examples/common/entry/entry.cpp @@ -29,8 +29,11 @@ namespace entry #if ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR bx::ReallocatorI* getDefaultAllocator() { +BX_PRAGMA_DIAGNOSTIC_PUSH_MSVC(); +BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4459); // warning C4459: declaration of 's_allocator' hides global declaration static bx::CrtAllocator s_allocator; return &s_allocator; +BX_PRAGMA_DIAGNOSTIC_POP_MSVC(); } #endif // ENTRY_CONFIG_IMPLEMENT_DEFAULT_ALLOCATOR diff --git a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp new file mode 100644 index 00000000000..42a7bc6f047 --- /dev/null +++ b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp @@ -0,0 +1,139 @@ +/* + * Copyright 2011-2015 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#include "entry_p.h" + +#if ENTRY_CONFIG_USE_GLFW + +#define GLFW_DLL +#include <GLFW/glfw3.h> +#include <bgfxplatform.h> +#include "dbg.h" + +// This is just trivial implementation of GLFW3 integration. +// It's here just for testing purpose. + +namespace entry +{ + static void errorCb(int _error, const char* _description) + { + DBG("GLFW error %d: %s", _error, _description); + } + + struct Context + { + Context() + { + } + + int run(int _argc, char** _argv) + { + glfwSetErrorCallback(errorCb); + + glfwInit(); + m_window = glfwCreateWindow(1280, 720, "bgfx", NULL, NULL); + glfwMakeContextCurrent(m_window); + + glfwSetKeyCallback(m_window, keyCb); + + bgfx::glfwSetWindow(m_window); + int result = main(_argc, _argv); + + glfwDestroyWindow(m_window); + glfwTerminate(); + return result; + } + + static void keyCb(GLFWwindow* _window, int _key, int _scancode, int _action, int _mods); + + EventQueue m_eventQueue; + + GLFWwindow* m_window; + }; + + Context s_ctx; + + void Context::keyCb(GLFWwindow* _window, int _key, int _scancode, int _action, int _mods) + { + BX_UNUSED(_window, _scancode, _mods); + if (_key == GLFW_KEY_Q + && _action == GLFW_PRESS + && _mods == GLFW_MOD_CONTROL) + { + s_ctx.m_eventQueue.postExitEvent(); + } + } + + const Event* poll() + { + glfwPollEvents(); + + if (glfwWindowShouldClose(s_ctx.m_window) ) + { + s_ctx.m_eventQueue.postExitEvent(); + } + return s_ctx.m_eventQueue.poll(); + } + + const Event* poll(WindowHandle _handle) + { + return s_ctx.m_eventQueue.poll(_handle); + } + + void release(const Event* _event) + { + s_ctx.m_eventQueue.release(_event); + } + + WindowHandle createWindow(int32_t _x, int32_t _y, uint32_t _width, uint32_t _height, uint32_t _flags, const char* _title) + { + BX_UNUSED(_x, _y, _width, _height, _flags, _title); + WindowHandle handle = { UINT16_MAX }; + return handle; + } + + void destroyWindow(WindowHandle _handle) + { + BX_UNUSED(_handle); + } + + void setWindowPos(WindowHandle _handle, int32_t _x, int32_t _y) + { + BX_UNUSED(_handle, _x, _y); + } + + void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height) + { + BX_UNUSED(_handle, _width, _height); + } + + void setWindowTitle(WindowHandle _handle, const char* _title) + { + BX_UNUSED(_handle, _title); + } + + void toggleWindowFrame(WindowHandle _handle) + { + BX_UNUSED(_handle); + } + + void toggleFullscreen(WindowHandle _handle) + { + BX_UNUSED(_handle); + } + + void setMouseLock(WindowHandle _handle, bool _lock) + { + BX_UNUSED(_handle, _lock); + } +} + +int main(int _argc, char** _argv) +{ + using namespace entry; + return s_ctx.run(_argc, _argv); +} + +#endif // ENTRY_CONFIG_USE_GLFW diff --git a/3rdparty/bgfx/examples/common/entry/entry_osx.mm b/3rdparty/bgfx/examples/common/entry/entry_osx.mm index 14a4930128a..89e7c4814d1 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_osx.mm +++ b/3rdparty/bgfx/examples/common/entry/entry_osx.mm @@ -311,19 +311,9 @@ namespace entry else { enum { ShiftMask = Modifier::LeftShift|Modifier::RightShift }; - const bool nonShiftModifiers = (0 != (modifiers&(~ShiftMask) ) ); - const bool isCharPressed = (Key::Key0 <= key && key <= Key::KeyZ) || (Key::Esc <= key && key <= Key::Minus); - const bool isText = isCharPressed && !nonShiftModifiers; - if (isText) - { - m_eventQueue.postCharEvent(s_defaultWindow, 1, pressedChar); - return false; - } - else - { - m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, true); - return false; - } + m_eventQueue.postCharEvent(s_defaultWindow, 1, pressedChar); + m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, true); + return false; } } diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h index 74d4756b5cb..d0ba73311c5 100644 --- a/3rdparty/bgfx/examples/common/entry/entry_p.h +++ b/3rdparty/bgfx/examples/common/entry/entry_p.h @@ -17,8 +17,13 @@ # define ENTRY_CONFIG_USE_SDL 0 #endif // ENTRY_CONFIG_USE_SDL -#if !ENTRY_CONFIG_USE_SDL && \ - !defined(ENTRY_CONFIG_USE_NATIVE) +#ifndef ENTRY_CONFIG_USE_GLFW +# define ENTRY_CONFIG_USE_GLFW 0 +#endif // ENTRY_CONFIG_USE_GLFW + +#if !defined(ENTRY_CONFIG_USE_NATIVE) \ + && !ENTRY_CONFIG_USE_SDL \ + && !ENTRY_CONFIG_USE_GLFW # define ENTRY_CONFIG_USE_NATIVE 1 #else # define ENTRY_CONFIG_USE_NATIVE 0 @@ -156,6 +161,14 @@ namespace entry class EventQueue { public: + ~EventQueue() + { + for (const Event* ev = poll(); NULL != ev; ev = poll() ) + { + release(ev); + } + } + void postAxisEvent(WindowHandle _handle, GamepadHandle _gamepad, GamepadAxis::Enum _axis, int32_t _value) { AxisEvent* ev = new AxisEvent(_handle); diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp index bb0e6bb3571..7c472f2664b 100644 --- a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp +++ b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp @@ -412,7 +412,7 @@ NVGcolor nvgLerpRGBA(NVGcolor c0, NVGcolor c1, float u) { cint.rgba[i] = c0.rgba[i] * oneminu + c1.rgba[i] * u; } - + return cint; } @@ -934,7 +934,7 @@ void nvgIntersectScissor(NVGcontext* ctx, float x, float y, float w, float h) } // Transform the current scissor rect into current transform space. - // If there is difference in rotation, this will be approximation. + // If there is difference in rotation, this will be approximation. memcpy(pxform, state->scissor.xform, sizeof(float)*6); ex = state->scissor.extent[0]; ey = state->scissor.extent[1]; @@ -1194,7 +1194,7 @@ static void nvg__tesselateBezier(NVGcontext* ctx, { float x12,y12,x23,y23,x34,y34,x123,y123,x234,y234,x1234,y1234; float dx,dy,d2,d3; - + if (level > 10) return; x12 = (x1+x2)*0.5f; @@ -1226,8 +1226,8 @@ static void nvg__tesselateBezier(NVGcontext* ctx, x1234 = (x123+x234)*0.5f; y1234 = (y123+y234)*0.5f; - nvg__tesselateBezier(ctx, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0); - nvg__tesselateBezier(ctx, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type); + nvg__tesselateBezier(ctx, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0); + nvg__tesselateBezier(ctx, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type); } static void nvg__flattenPaths(NVGcontext* ctx) @@ -1625,7 +1625,7 @@ static void nvg__calculateJoins(NVGcontext* ctx, float w, int lineJoin, float mi static int nvg__expandStroke(NVGcontext* ctx, float w, int lineCap, int lineJoin, float miterLimit) -{ +{ NVGpathCache* cache = ctx->cache; NVGvertex* verts; NVGvertex* dst; @@ -1889,7 +1889,7 @@ void nvgQuadTo(NVGcontext* ctx, float cx, float cy, float x, float y) { float x0 = ctx->commandx; float y0 = ctx->commandy; - float vals[] = { NVG_BEZIERTO, + float vals[] = { NVG_BEZIERTO, x0 + 2.0f/3.0f*(cx - x0), y0 + 2.0f/3.0f*(cy - y0), x + 2.0f/3.0f*(cx - x), y + 2.0f/3.0f*(cy - y), x, y }; @@ -1971,7 +1971,7 @@ void nvgArc(NVGcontext* ctx, float cx, float cy, float r, float a0, float a1, in float px = 0, py = 0, ptanx = 0, ptany = 0; float vals[3 + 5*7 + 100]; int i, ndivs, nvals; - int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO; + int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO; // Clamp angles da = a1 - a0; @@ -2364,7 +2364,7 @@ float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char* } } - // TODO: add back-end bit to do this just once per frame. + // TODO: add back-end bit to do this just once per frame. nvg__flushTextTexture(ctx); nvg__renderText(ctx, verts, nverts); diff --git a/3rdparty/bgfx/examples/runtime/.gitignore b/3rdparty/bgfx/examples/runtime/.gitignore index babe9f7d0c3..5394aa127bf 100644 --- a/3rdparty/bgfx/examples/runtime/.gitignore +++ b/3rdparty/bgfx/examples/runtime/.gitignore @@ -1,3 +1,4 @@ *.dll +*.so *.pdb imgui* diff --git a/3rdparty/bgfx/include/bgfx.c99.h b/3rdparty/bgfx/include/bgfx.c99.h index 43effbcc5ec..38b55e327bb 100644 --- a/3rdparty/bgfx/include/bgfx.c99.h +++ b/3rdparty/bgfx/include/bgfx.c99.h @@ -273,6 +273,15 @@ typedef struct bgfx_texture_info } bgfx_texture_info_t; /** + */ +typedef struct bgfx_caps_gpu +{ + uint16_t vendorId; + uint16_t deviceId; + +} bgfx_caps_gpu_t; + +/** * Renderer capabilities. */ typedef struct bgfx_caps @@ -293,6 +302,11 @@ typedef struct bgfx_caps uint16_t maxViews; /* < Maximum views. */ uint16_t maxDrawCalls; /* < Maximum draw calls. */ uint8_t maxFBAttachments; /* < Maximum frame buffer attachments. */ + uint8_t numGPUs; /* < */ + + uint16_t vendorId; /* < */ + uint16_t deviceId; /* < */ + bgfx_caps_gpu_t gpu[4]; /* < */ /** * Supported texture formats. @@ -559,7 +573,7 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type); * specified, library uses default CRT allocator. The library assumes * custom allocator is thread safe. */ -BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator); +BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator); /** * Shutdown bgfx library. diff --git a/3rdparty/bgfx/include/bgfx.h b/3rdparty/bgfx/include/bgfx.h index dd3b4c5db79..257086a54fb 100644 --- a/3rdparty/bgfx/include/bgfx.h +++ b/3rdparty/bgfx/include/bgfx.h @@ -315,6 +315,18 @@ namespace bgfx uint16_t maxViews; ///< Maximum views. uint16_t maxDrawCalls; ///< Maximum draw calls. uint8_t maxFBAttachments; ///< Maximum frame buffer attachments. + uint8_t numGPUs; ///< + + uint16_t vendorId; ///< + uint16_t deviceId; ///< + + struct GPU + { + uint16_t vendorId; + uint16_t deviceId; + }; + + GPU gpu[4]; ///< /// Supported texture formats. /// - `BGFX_CAPS_FORMAT_TEXTURE_NONE` - not supported @@ -508,6 +520,15 @@ namespace bgfx /// default rendering backend will be selected. /// See: `bgfx::RendererType` /// + /// @param _vendorId Vendor PCI id. If set to BGFX_PCI_ID_NONE it will select the first device. + /// - `BGFX_PCI_ID_NONE` - autoselect. + /// - `BGFX_PCI_ID_AMD` - AMD. + /// - `BGFX_PCI_ID_INTEL` - Intel. + /// - `BGFX_PCI_ID_NVIDIA` - nVidia. + /// + /// @param _deviceId Device id. If set to 0 it will select first device, or device with + /// matching id. + /// /// @param _callback Provide application specific callback interface. /// See: `bgfx::CallbackI` /// @@ -517,7 +538,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_init`. /// - void init(RendererType::Enum _type = RendererType::Count, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL); + void init(RendererType::Enum _type = RendererType::Count, uint16_t _vendorId = BGFX_PCI_ID_NONE, uint16_t _deviceId = 0, CallbackI* _callback = NULL, bx::ReallocatorI* _reallocator = NULL); /// Shutdown bgfx library. /// diff --git a/3rdparty/bgfx/include/bgfxdefines.h b/3rdparty/bgfx/include/bgfxdefines.h index eb57fdba47c..f8878a9e05e 100644 --- a/3rdparty/bgfx/include/bgfxdefines.h +++ b/3rdparty/bgfx/include/bgfxdefines.h @@ -81,16 +81,16 @@ | BGFX_STATE_MSAA \ ) -#define BGFX_STATE_ALPHA_REF(_ref) ( (uint64_t(_ref)<<BGFX_STATE_ALPHA_REF_SHIFT)&BGFX_STATE_ALPHA_REF_MASK) -#define BGFX_STATE_POINT_SIZE(_size) ( (uint64_t(_size)<<BGFX_STATE_POINT_SIZE_SHIFT)&BGFX_STATE_POINT_SIZE_MASK) +#define BGFX_STATE_ALPHA_REF(_ref) ( ( (uint64_t)(_ref )<<BGFX_STATE_ALPHA_REF_SHIFT )&BGFX_STATE_ALPHA_REF_MASK) +#define BGFX_STATE_POINT_SIZE(_size) ( ( (uint64_t)(_size)<<BGFX_STATE_POINT_SIZE_SHIFT)&BGFX_STATE_POINT_SIZE_MASK) /// -#define BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) (0 \ - | ( (uint64_t(_srcRGB)|(uint64_t(_dstRGB)<<4) ) ) \ - | ( (uint64_t(_srcA )|(uint64_t(_dstA )<<4) )<<8) \ +#define BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) (UINT64_C(0) \ + | ( ( (uint64_t)(_srcRGB)|( (uint64_t)(_dstRGB)<<4) ) ) \ + | ( ( (uint64_t)(_srcA )|( (uint64_t)(_dstA )<<4) )<<8) \ ) -#define BGFX_STATE_BLEND_EQUATION_SEPARATE(_rgb, _a) (uint64_t(_rgb)|(uint64_t(_a)<<3) ) +#define BGFX_STATE_BLEND_EQUATION_SEPARATE(_rgb, _a) ( (uint64_t)(_rgb)|( (uint64_t)(_a)<<3) ) /// #define BGFX_STATE_BLEND_FUNC(_src, _dst) BGFX_STATE_BLEND_FUNC_SEPARATE(_src, _dst, _src, _dst) @@ -333,4 +333,10 @@ #define BGFX_SUBMIT_EYE_MASK UINT8_C(0x03) #define BGFX_SUBMIT_EYE_FIRST BGFX_SUBMIT_EYE_LEFT +/// +#define BGFX_PCI_ID_NONE UINT16_C(0x0000) +#define BGFX_PCI_ID_AMD UINT16_C(0x1002) +#define BGFX_PCI_ID_INTEL UINT16_C(0x8086) +#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de) + #endif // BGFX_DEFINES_H_HEADER_GUARD diff --git a/3rdparty/bgfx/include/bgfxplatform.h b/3rdparty/bgfx/include/bgfxplatform.h index 1e073de835e..4598fc1e7d7 100644 --- a/3rdparty/bgfx/include/bgfxplatform.h +++ b/3rdparty/bgfx/include/bgfxplatform.h @@ -55,7 +55,7 @@ namespace bgfx namespace bgfx { /// - void x11SetDisplayWindow(void* _display, uint32_t _window); + void x11SetDisplayWindow(void* _display, uint32_t _window, void* _glx = NULL); } // namespace bgfx @@ -76,7 +76,7 @@ namespace bgfx namespace bgfx { /// - void osxSetNSWindow(void* _window); + void osxSetNSWindow(void* _window, void* _nsgl = NULL); } // namespace bgfx @@ -155,15 +155,17 @@ namespace bgfx { # if BX_PLATFORM_LINUX || BX_PLATFORM_FREEBSD ::Display* display = glfwGetX11Display(); - ::Window window = glfwGetX11Window(_window); - x11SetDisplayWindow(display, window); + ::Window window = glfwGetX11Window(_window); + void* glx = glfwGetGLXContext(_window); + x11SetDisplayWindow(display, window, glx); # elif BX_PLATFORM_OSX - void* id = glfwGetCocoaWindow(_window); - osxSetNSWindow(id); + void* window = glfwGetCocoaWindow(_window); + void* nsgl = glfwGetNSGLContext(_window); + osxSetNSWindow(window, nsgl); # elif BX_PLATFORM_WINDOWS HWND hwnd = glfwGetWin32Window(_window); winSetHwnd(hwnd); -# endif BX_PLATFORM_WINDOWS +# endif // BX_PLATFORM_WINDOWS } } // namespace bgfx diff --git a/3rdparty/bgfx/makefile b/3rdparty/bgfx/makefile index 46848cd3dbf..4b51342bab2 100644 --- a/3rdparty/bgfx/makefile +++ b/3rdparty/bgfx/makefile @@ -217,12 +217,14 @@ OS=darwin BUILD_PROJECT_DIR=gmake-osx BUILD_OUTPUT_DIR=osx64_clang BUILD_TOOLS_CONFIG=release64 +BUILD_TOOLS_SUFFIX=Release EXE= else OS=linux BUILD_PROJECT_DIR=gmake-linux BUILD_OUTPUT_DIR=linux64_gcc BUILD_TOOLS_CONFIG=release64 +BUILD_TOOLS_SUFFIX=Release EXE= endif else @@ -230,19 +232,16 @@ OS=windows BUILD_PROJECT_DIR=gmake-mingw-gcc BUILD_OUTPUT_DIR=win32_mingw-gcc BUILD_TOOLS_CONFIG=release32 +BUILD_TOOLS_SUFFIX=Release EXE=.exe endif -.build/$(BUILD_OUTPUT_DIR)/bin/shadercRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR) +tools/bin/$(OS)/shaderc$(EXE): .build/projects/$(BUILD_PROJECT_DIR) $(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) -f shaderc.make config=$(BUILD_TOOLS_CONFIG) + $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/shaderc$(BUILD_TOOLS_SUFFIX)$(EXE) $(@) -tools/bin/$(OS)/shaderc$(EXE): .build/$(BUILD_OUTPUT_DIR)/bin/shadercRelease$(EXE) - $(SILENT) cp $(<) $(@) - -.build/$(BUILD_OUTPUT_DIR)/bin/geometrycRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR) +tools/bin/$(OS)/geometryc$(EXE): .build/projects/$(BUILD_PROJECT_DIR) $(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) -f geometryc.make config=$(BUILD_TOOLS_CONFIG) - -tools/bin/$(OS)/geometryc$(EXE): .build/$(BUILD_OUTPUT_DIR)/bin/geometrycRelease$(EXE) - $(SILENT) cp $(<) $(@) + $(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/geometryc$(BUILD_TOOLS_SUFFIX)$(EXE) $(@) tools: tools/bin/$(OS)/shaderc$(EXE) tools/bin/$(OS)/geometryc$(EXE) diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua index 644f9c4e96d..b02fea8a40a 100644 --- a/3rdparty/bgfx/scripts/bgfx.lua +++ b/3rdparty/bgfx/scripts/bgfx.lua @@ -26,7 +26,7 @@ function bgfxProject(_name, _kind, _defines) } configuration { "linux-*" } - buildoptions { + buildoptions { "-fPIC", } @@ -42,6 +42,12 @@ function bgfxProject(_name, _kind, _defines) _defines, } + if _OPTIONS["with-glfw"] then + defines { + "BGFX_CONFIG_MULTITHREADED=0", + } + end + if _OPTIONS["with-ovr"] then defines { "BGFX_CONFIG_USE_OVR=1", @@ -113,10 +119,34 @@ function bgfxProject(_name, _kind, _defines) path.join(BGFX_DIR, "src/**.h"), } - excludes { + removefiles { path.join(BGFX_DIR, "src/**.bin.h"), } + if _OPTIONS["with-amalgamated"] then + excludes { + path.join(BGFX_DIR, "src/bgfx.cpp"), + path.join(BGFX_DIR, "src/glcontext_egl.cpp"), + path.join(BGFX_DIR, "src/glcontext_glx.cpp"), + path.join(BGFX_DIR, "src/glcontext_ppapi.cpp"), + path.join(BGFX_DIR, "src/glcontext_wgl.cpp"), + path.join(BGFX_DIR, "src/image.cpp"), + path.join(BGFX_DIR, "src/ovr.cpp"), + path.join(BGFX_DIR, "src/renderdoc.cpp"), + path.join(BGFX_DIR, "src/renderer_d3d9.cpp"), + path.join(BGFX_DIR, "src/renderer_d3d11.cpp"), + path.join(BGFX_DIR, "src/renderer_d3d12.cpp"), + path.join(BGFX_DIR, "src/renderer_null.cpp"), + path.join(BGFX_DIR, "src/renderer_gl.cpp"), + path.join(BGFX_DIR, "src/renderer_vk.cpp"), + path.join(BGFX_DIR, "src/vertexdecl.cpp"), + } + else + excludes { + path.join(BGFX_DIR, "src/amalgamated.cpp"), + } + end + configuration {} copyLib() diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua index 6ab71ab9602..d408224e319 100644 --- a/3rdparty/bgfx/scripts/example-common.lua +++ b/3rdparty/bgfx/scripts/example-common.lua @@ -31,6 +31,12 @@ project ("example-common") } end + if _OPTIONS["with-glfw"] then + defines { + "ENTRY_CONFIG_USE_GLFW=1", + } + end + configuration { "mingw* or vs2008" } includedirs { "$(DXSDK_DIR)/include", diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua index 9f7888a2a70..31ad5f3aa11 100644 --- a/3rdparty/bgfx/scripts/genie.lua +++ b/3rdparty/bgfx/scripts/genie.lua @@ -4,13 +4,13 @@ -- newoption { - trigger = "with-tools", - description = "Enable building tools.", + trigger = "with-amalgamated", + description = "Enable amalgamated build.", } newoption { - trigger = "with-shared-lib", - description = "Enable building shared library.", + trigger = "with-ovr", + description = "Enable OculusVR integration.", } newoption { @@ -19,8 +19,18 @@ newoption { } newoption { - trigger = "with-ovr", - description = "Enable OculusVR integration.", + trigger = "with-glfw", + description = "Enable GLFW entry.", +} + +newoption { + trigger = "with-shared-lib", + description = "Enable building shared library.", +} + +newoption { + trigger = "with-tools", + description = "Enable building tools.", } solution "bgfx" @@ -32,14 +42,14 @@ solution "bgfx" if _ACTION == "xcode4" then platforms { "Universal", - } + } else platforms { "x32", "x64", -- "Xbox360", "Native", -- for targets where bitness is not specified - } + } end language "C++" @@ -96,6 +106,10 @@ function exampleProject(_name) path.join(BGFX_DIR, "examples", _name, "**.h"), } + removefiles { + path.join(BGFX_DIR, "examples", _name, "**.bin.h"), + } + links { "bgfx", "example-common", @@ -114,29 +128,72 @@ function exampleProject(_name) configuration {} end + if _OPTIONS["with-glfw"] then + defines { "ENTRY_CONFIG_USE_GLFW=1" } + links { + "glfw3" + } + + configuration { "linux" } + links { + "Xrandr", + "Xinerama", + "Xi", + "Xxf86vm", + "Xcursor", + } + + configuration { "osx" } + linkoptions { + "-framework CoreVideo", + "-framework IOKit", + } + + configuration {} + end + if _OPTIONS["with-ovr"] then links { "winmm", "ws2_32", } - configuration { "x32" } - libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Win32", _ACTION) } + -- Check for LibOVR 5.0+ + if os.isdir(path.join(os.getenv("OVR_DIR"), "LibOVR/Lib/Windows/Win32/Debug/VS2012")) then + + configuration { "x32", "Debug" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/Win32/Debug", _ACTION) } + + configuration { "x32", "Release" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/Win32/Release", _ACTION) } - configuration { "x64" } - libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/x64", _ACTION) } + configuration { "x64", "Debug" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/x64/Debug", _ACTION) } - configuration { "x32", "Debug" } - links { "libovrd" } + configuration { "x64", "Release" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/x64/Release", _ACTION) } - configuration { "x32", "Release" } - links { "libovr" } + configuration { "x32 or x64" } + links { "libovr" } + else + configuration { "x32" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Win32", _ACTION) } - configuration { "x64", "Debug" } - links { "libovr64d" } + configuration { "x64" } + libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/x64", _ACTION) } - configuration { "x64", "Release" } - links { "libovr64" } + configuration { "x32", "Debug" } + links { "libovrd" } + + configuration { "x32", "Release" } + links { "libovr" } + + configuration { "x64", "Debug" } + links { "libovr64d" } + + configuration { "x64", "Release" } + links { "libovr64" } + end configuration {} end diff --git a/3rdparty/bgfx/src/amalgamated.cpp b/3rdparty/bgfx/src/amalgamated.cpp new file mode 100644 index 00000000000..2a88eeab6ac --- /dev/null +++ b/3rdparty/bgfx/src/amalgamated.cpp @@ -0,0 +1,20 @@ +/* + * Copyright 2011-2015 Branimir Karadzic. All rights reserved. + * License: http://www.opensource.org/licenses/BSD-2-Clause + */ + +#include "bgfx.cpp" +#include "glcontext_egl.cpp" +#include "glcontext_glx.cpp" +#include "glcontext_ppapi.cpp" +#include "glcontext_wgl.cpp" +#include "image.cpp" +#include "ovr.cpp" +#include "renderdoc.cpp" +#include "renderer_d3d9.cpp" +#include "renderer_d3d11.cpp" +#include "renderer_d3d12.cpp" +#include "renderer_null.cpp" +#include "renderer_gl.cpp" +#include "renderer_vk.cpp" +#include "vertexdecl.cpp" diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp index 7ac7060e641..3a353942cc5 100644 --- a/3rdparty/bgfx/src/bgfx.cpp +++ b/3rdparty/bgfx/src/bgfx.cpp @@ -19,14 +19,6 @@ namespace bgfx # define BGFX_CHECK_RENDER_THREAD() #endif // BGFX_CONFIG_MULTITHREADED && !BX_PLATFORM_OSX && !BX_PLATFORM_IOS -#define BGFX_CHECK_HANDLE(_handle, _max) \ - BX_CHECK(isValid(_handle) \ - && _handle.idx < _max \ - , "Invalid handle. %d (< %d " #_max ")" \ - , _handle.idx \ - , _max \ - ); - #if BX_PLATFORM_ANDROID ::ANativeWindow* g_bgfxAndroidWindow = NULL; @@ -44,18 +36,22 @@ namespace bgfx #elif BX_PLATFORM_LINUX void* g_bgfxX11Display; uint32_t g_bgfxX11Window; + void* g_bgfxGLX; - void x11SetDisplayWindow(void* _display, uint32_t _window) + void x11SetDisplayWindow(void* _display, uint32_t _window, void* _glx) { g_bgfxX11Display = _display; g_bgfxX11Window = _window; + g_bgfxGLX = _glx; } #elif BX_PLATFORM_OSX void* g_bgfxNSWindow = NULL; + void* g_bgfxNSGL = NULL; - void osxSetNSWindow(void* _window) + void osxSetNSWindow(void* _window, void* _nsgl) { g_bgfxNSWindow = _window; + g_bgfxNSGL = _nsgl; } #elif BX_PLATFORM_WINDOWS ::HWND g_bgfxHwnd = NULL; @@ -892,7 +888,11 @@ namespace bgfx static void dumpCaps() { - BX_TRACE("Supported capabilities (%s):", s_ctx->m_renderCtx->getRendererName() ); + BX_TRACE("Supported capabilities (renderer %s, vendor 0x%04x, device 0x%04x):" + , s_ctx->m_renderCtx->getRendererName() + , g_caps.vendorId + , g_caps.deviceId + ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_capsFlags); ++ii) { if (0 != (g_caps.supported & s_capsFlags[ii].m_flag) ) @@ -1332,23 +1332,21 @@ namespace bgfx typedef RendererContextI* (*RendererCreateFn)(); typedef void (*RendererDestroyFn)(); - extern RendererContextI* rendererCreateNULL(); - extern void rendererDestroyNULL(); - - extern RendererContextI* rendererCreateGL(); - extern void rendererDestroyGL(); - - extern RendererContextI* rendererCreateD3D9(); - extern void rendererDestroyD3D9(); - - extern RendererContextI* rendererCreateD3D11(); - extern void rendererDestroyD3D11(); +#define BGFX_RENDERER_CONTEXT(_namespace) \ + namespace _namespace \ + { \ + extern RendererContextI* rendererCreate(); \ + extern void rendererDestroy(); \ + } - extern RendererContextI* rendererCreateD3D12(); - extern void rendererDestroyD3D12(); + BGFX_RENDERER_CONTEXT(noop); + BGFX_RENDERER_CONTEXT(d3d9); + BGFX_RENDERER_CONTEXT(d3d11); + BGFX_RENDERER_CONTEXT(d3d12); + BGFX_RENDERER_CONTEXT(gl); + BGFX_RENDERER_CONTEXT(vk); - extern RendererContextI* rendererCreateVK(); - extern void rendererDestroyVK(); +#undef BGFX_RENDERER_CONTEXT struct RendererCreator { @@ -1360,13 +1358,13 @@ namespace bgfx static const RendererCreator s_rendererCreator[] = { - { rendererCreateNULL, rendererDestroyNULL, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Null - { rendererCreateD3D9, rendererDestroyD3D9, BGFX_RENDERER_DIRECT3D9_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D9 }, // Direct3D9 - { rendererCreateD3D11, rendererDestroyD3D11, BGFX_RENDERER_DIRECT3D11_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D11 }, // Direct3D11 - { rendererCreateD3D12, rendererDestroyD3D12, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12 - { rendererCreateGL, rendererDestroyGL, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGLES }, // OpenGLES - { rendererCreateGL, rendererDestroyGL, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL - { rendererCreateVK, rendererDestroyVK, BGFX_RENDERER_VULKAN_NAME, !!BGFX_CONFIG_RENDERER_VULKAN }, // Vulkan + { noop::rendererCreate, noop::rendererDestroy, BGFX_RENDERER_NULL_NAME, !!BGFX_CONFIG_RENDERER_NULL }, // Null + { d3d9::rendererCreate, d3d9::rendererDestroy, BGFX_RENDERER_DIRECT3D9_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D9 }, // Direct3D9 + { d3d11::rendererCreate, d3d11::rendererDestroy, BGFX_RENDERER_DIRECT3D11_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D11 }, // Direct3D11 + { d3d12::rendererCreate, d3d12::rendererDestroy, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12 + { gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGLES }, // OpenGLES + { gl::rendererCreate, gl::rendererDestroy, BGFX_RENDERER_OPENGL_NAME, !!BGFX_CONFIG_RENDERER_OPENGL }, // OpenGL + { vk::rendererCreate, vk::rendererDestroy, BGFX_RENDERER_VULKAN_NAME, !!BGFX_CONFIG_RENDERER_VULKAN }, // Vulkan }; BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count); @@ -1983,7 +1981,7 @@ again: return s_rendererCreator[_type].name; } - void init(RendererType::Enum _type, CallbackI* _callback, bx::ReallocatorI* _allocator) + void init(RendererType::Enum _type, uint16_t _vendorId, uint16_t _deviceId, CallbackI* _callback, bx::ReallocatorI* _allocator) { BX_CHECK(NULL == s_ctx, "bgfx is already initialized."); BX_TRACE("Init..."); @@ -1995,6 +1993,8 @@ again: g_caps.maxViews = BGFX_CONFIG_MAX_VIEWS; g_caps.maxDrawCalls = BGFX_CONFIG_MAX_DRAW_CALLS; g_caps.maxFBAttachments = 1; + g_caps.vendorId = _vendorId; + g_caps.deviceId = _deviceId; if (NULL != _allocator) { @@ -2770,21 +2770,18 @@ again: void setUniform(UniformHandle _handle, const void* _value, uint16_t _num) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_UNIFORMS); s_ctx->setUniform(_handle, _value, _num); } void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_INDEX_BUFFERS); s_ctx->setIndexBuffer(_handle, _firstIndex, _numIndices); } void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS); s_ctx->setIndexBuffer(_handle, _firstIndex, _numIndices); } @@ -2809,14 +2806,12 @@ again: void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS); s_ctx->setVertexBuffer(_handle, _startVertex, _numVertices); } void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _numVertices) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS); s_ctx->setVertexBuffer(_handle, _numVertices); } @@ -2842,21 +2837,18 @@ again: void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS); s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num); } void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS); s_ctx->setInstanceDataBuffer(_handle, _startVertex, _num); } void setProgram(ProgramHandle _handle) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_PROGRAMS); s_ctx->setProgram(_handle); } @@ -2881,28 +2873,24 @@ again: void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_INDEX_BUFFERS); s_ctx->setBuffer(_stage, _handle, _access); } void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_VERTEX_BUFFERS); s_ctx->setBuffer(_stage, _handle, _access); } void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS); s_ctx->setBuffer(_stage, _handle, _access); } void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access) { BGFX_CHECK_MAIN_THREAD(); - BGFX_CHECK_HANDLE(_handle, BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS); s_ctx->setBuffer(_stage, _handle, _access); } @@ -3030,9 +3018,11 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type) return bgfx::getRendererName(bgfx::RendererType::Enum(_type) ); } -BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, struct bgfx_callback_interface* _callback, struct bgfx_reallocator_interface* _allocator) +BGFX_C_API void bgfx_init(bgfx_renderer_type_t _type, uint16_t _vendorId, uint16_t _deviceId, bgfx_callback_interface_t* _callback, bgfx_reallocator_interface_t* _allocator) { return bgfx::init(bgfx::RendererType::Enum(_type) + , _vendorId + , _deviceId , reinterpret_cast<bgfx::CallbackI*>(_callback) , reinterpret_cast<bx::ReallocatorI*>(_allocator) ); diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h index 11ccfa7b85c..efc413a62da 100644 --- a/3rdparty/bgfx/src/bgfx_p.h +++ b/3rdparty/bgfx/src/bgfx_p.h @@ -29,6 +29,26 @@ #include <string.h> #include <alloca.h> +// Check handle, cannot be bgfx::invalidHandle and must be valid. +#define BGFX_CHECK_HANDLE(_desc, _handleAlloc, _handle) \ + BX_CHECK(isValid(_handle) \ + && _handleAlloc.isValid(_handle.idx) \ + , "Invalid handle. %s handle: %d (max %d)" \ + , _desc \ + , _handle.idx \ + , _handleAlloc.getMaxHandles() \ + ) + +// Check handle, it's ok to be bgfx::invalidHandle or must be valid. +#define BGFX_CHECK_HANDLE_INVALID_OK(_desc, _handleAlloc, _handle) \ + BX_CHECK(!isValid(_handle) \ + || _handleAlloc.isValid(_handle.idx) \ + , "Invalid handle. %s handle: %d (max %d)" \ + , _desc \ + , _handle.idx \ + , _handleAlloc.getMaxHandles() \ + ) + namespace bgfx { #if BX_COMPILER_CLANG_ANALYZER @@ -204,8 +224,10 @@ namespace bgfx #elif BX_PLATFORM_LINUX extern void* g_bgfxX11Display; extern uint32_t g_bgfxX11Window; + extern void* g_bgfxGLX; #elif BX_PLATFORM_OSX extern void* g_bgfxNSWindow; + extern void* g_bgfxNSGL; #elif BX_PLATFORM_WINDOWS extern ::HWND g_bgfxHwnd; #elif BX_PLATFORM_WINRT @@ -1418,7 +1440,10 @@ namespace bgfx { Binding& sampler = m_draw.m_bind[_stage]; sampler.m_idx = _handle.idx; - sampler.m_un.m_draw.m_flags = (_flags&BGFX_SAMPLER_DEFAULT_FLAGS) ? BGFX_SAMPLER_DEFAULT_FLAGS : _flags; + sampler.m_un.m_draw.m_flags = (_flags&BGFX_SAMPLER_DEFAULT_FLAGS) + ? BGFX_SAMPLER_DEFAULT_FLAGS + : _flags + ; if (isValid(_sampler) && (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) ) ) @@ -1989,6 +2014,8 @@ namespace bgfx BGFX_API_FUNC(void destroyIndexBuffer(IndexBufferHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyIndexBuffer", m_indexBufferHandle, _handle); + CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyIndexBuffer); cmdbuf.write(_handle); m_submit->free(_handle); @@ -2034,6 +2061,8 @@ namespace bgfx BGFX_API_FUNC(void destroyVertexBuffer(VertexBufferHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyVertexBuffer", m_vertexBufferHandle, _handle); + CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexBuffer); cmdbuf.write(_handle); m_submit->free(_handle); @@ -2135,6 +2164,8 @@ namespace bgfx BGFX_API_FUNC(void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, const Memory* _mem) ) { + BGFX_CHECK_HANDLE("updateDynamicIndexBuffer", m_dynamicIndexBufferHandle, _handle); + DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx]; BX_CHECK(0 == (dib.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE), "Can't update GPU buffer from CPU."); @@ -2166,6 +2197,8 @@ namespace bgfx BGFX_API_FUNC(void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyDynamicIndexBuffer", m_dynamicIndexBufferHandle, _handle); + m_freeDynamicIndexBufferHandle[m_numFreeDynamicIndexBufferHandles++] = _handle; } @@ -2279,6 +2312,8 @@ namespace bgfx BGFX_API_FUNC(void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, const Memory* _mem) ) { + BGFX_CHECK_HANDLE("updateDynamicVertexBuffer", m_dynamicVertexBufferHandle, _handle); + DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx]; BX_CHECK(0 == (dvb.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE), "Can't update GPU buffer from CPU."); @@ -2311,6 +2346,8 @@ namespace bgfx BGFX_API_FUNC(void destroyDynamicVertexBuffer(DynamicVertexBufferHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyDynamicVertexBuffer", m_dynamicVertexBufferHandle, _handle); + m_freeDynamicVertexBufferHandle[m_numFreeDynamicVertexBufferHandles++] = _handle; } @@ -2593,6 +2630,8 @@ namespace bgfx BGFX_API_FUNC(void destroyShader(ShaderHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyShader", m_shaderHandle, _handle); + if (!isValid(_handle) ) { BX_WARN(false, "Passing invalid shader handle to bgfx::destroyShader."); @@ -2704,6 +2743,8 @@ namespace bgfx BGFX_API_FUNC(void destroyProgram(ProgramHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyProgram", m_programHandle, _handle); + CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyProgram); cmdbuf.write(_handle); m_submit->free(_handle); @@ -2769,6 +2810,8 @@ namespace bgfx BGFX_API_FUNC(void destroyTexture(TextureHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyTexture", m_textureHandle, _handle); + if (!isValid(_handle) ) { BX_WARN(false, "Passing invalid texture handle to bgfx::destroyTexture"); @@ -2832,6 +2875,7 @@ namespace bgfx for (uint32_t ii = 0; ii < _num; ++ii) { TextureHandle texHandle = _handles[ii]; + BGFX_CHECK_HANDLE("createFrameBuffer texture handle", m_textureHandle, texHandle); cmdbuf.write(texHandle); @@ -2868,6 +2912,8 @@ namespace bgfx BGFX_API_FUNC(void destroyFrameBuffer(FrameBufferHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyFrameBuffer", m_frameBufferHandle, _handle); + CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyFrameBuffer); cmdbuf.write(_handle); m_submit->free(_handle); @@ -2951,6 +2997,8 @@ namespace bgfx BGFX_API_FUNC(void destroyUniform(UniformHandle _handle) ) { + BGFX_CHECK_HANDLE("destroyUniform", m_uniformHandle, _handle); + UniformRef& uniform = m_uniformRef[_handle.idx]; BX_CHECK(uniform.m_refCount > 0, "Destroying already destroyed uniform %d.", _handle.idx); int32_t refs = --uniform.m_refCount; @@ -3054,6 +3102,7 @@ namespace bgfx BGFX_API_FUNC(void setViewFrameBuffer(uint8_t _id, FrameBufferHandle _handle) ) { + BGFX_CHECK_HANDLE_INVALID_OK("setViewFrameBuffer", m_frameBufferHandle, _handle); m_fb[_id] = _handle; } @@ -3091,7 +3140,7 @@ namespace bgfx BGFX_API_FUNC(void setViewRemap(uint8_t _id, uint8_t _num, const void* _remap) ) { - const uint32_t num = bx::uint32_min( (BGFX_CONFIG_MAX_VIEWS - _id) + _num, BGFX_CONFIG_MAX_VIEWS) - _id; + const uint32_t num = bx::uint32_min(_id + _num, BGFX_CONFIG_MAX_VIEWS) - _id; if (NULL == _remap) { for (uint32_t ii = 0; ii < num; ++ii) @@ -3148,6 +3197,7 @@ namespace bgfx BGFX_API_FUNC(void setUniform(UniformHandle _handle, const void* _value, uint16_t _num) ) { + BGFX_CHECK_HANDLE("setUniform", m_uniformHandle, _handle); UniformRef& uniform = m_uniformRef[_handle.idx]; BX_CHECK(uniform.m_num >= _num, "Truncated uniform update. %d (max: %d)", _num, uniform.m_num); m_submit->writeUniform(uniform.m_type, _handle, _value, bx::uint16_min(uniform.m_num, _num) ); @@ -3155,11 +3205,13 @@ namespace bgfx BGFX_API_FUNC(void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices) ) { + BGFX_CHECK_HANDLE("setIndexBuffer", m_indexBufferHandle, _handle); m_submit->setIndexBuffer(_handle, _firstIndex, _numIndices); } BGFX_API_FUNC(void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices) ) { + BGFX_CHECK_HANDLE("setIndexBuffer", m_dynamicIndexBufferHandle, _handle); m_submit->setIndexBuffer(m_dynamicIndexBuffers[_handle.idx], _firstIndex, _numIndices); } @@ -3170,11 +3222,13 @@ namespace bgfx BGFX_API_FUNC(void setVertexBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices) ) { + BGFX_CHECK_HANDLE("setVertexBuffer", m_vertexBufferHandle, _handle); m_submit->setVertexBuffer(_handle, _startVertex, _numVertices); } BGFX_API_FUNC(void setVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _numVertices) ) { + BGFX_CHECK_HANDLE("setVertexBuffer", m_dynamicVertexBufferHandle, _handle); m_submit->setVertexBuffer(m_dynamicVertexBuffers[_handle.idx], _numVertices); } @@ -3192,12 +3246,14 @@ namespace bgfx BGFX_API_FUNC(void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num) ) { + BGFX_CHECK_HANDLE("setInstanceDataBuffer", m_vertexBufferHandle, _handle); const VertexBuffer& vb = m_vertexBuffers[_handle.idx]; m_submit->setInstanceDataBuffer(_handle, _startVertex, _num, vb.m_stride); } BGFX_API_FUNC(void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _num) ) { + BGFX_CHECK_HANDLE("setInstanceDataBuffer", m_dynamicVertexBufferHandle, _handle); const DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx]; m_submit->setInstanceDataBuffer(dvb.m_handle , dvb.m_startVertex + _startVertex @@ -3208,16 +3264,19 @@ namespace bgfx BGFX_API_FUNC(void setProgram(ProgramHandle _handle) ) { + BGFX_CHECK_HANDLE("setProgram", m_programHandle, _handle); m_submit->setProgram(_handle); } BGFX_API_FUNC(void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags) ) { + BGFX_CHECK_HANDLE_INVALID_OK("setTexture/TextureHandle", m_textureHandle, _handle); m_submit->setTexture(_stage, _sampler, _handle, _flags); } BGFX_API_FUNC(void setTexture(uint8_t _stage, UniformHandle _sampler, FrameBufferHandle _handle, uint8_t _attachment, uint32_t _flags) ) { + BGFX_CHECK_HANDLE_INVALID_OK("setTexture/FrameBufferHandle", m_frameBufferHandle, _handle); BX_CHECK(_attachment < g_caps.maxFBAttachments, "Frame buffer attachment index %d is invalid.", _attachment); TextureHandle textureHandle = BGFX_INVALID_HANDLE; if (isValid(_handle) ) @@ -3238,22 +3297,26 @@ namespace bgfx BGFX_API_FUNC(void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access) ) { + BGFX_CHECK_HANDLE("setBuffer", m_indexBufferHandle, _handle); m_submit->setBuffer(_stage, _handle, _access); } BGFX_API_FUNC(void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access) ) { + BGFX_CHECK_HANDLE("setBuffer", m_vertexBufferHandle, _handle); m_submit->setBuffer(_stage, _handle, _access); } BGFX_API_FUNC(void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access) ) { + BGFX_CHECK_HANDLE("setBuffer", m_dynamicIndexBufferHandle, _handle); const DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx]; m_submit->setBuffer(_stage, dib.m_handle, _access); } BGFX_API_FUNC(void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access) ) { + BGFX_CHECK_HANDLE("setBuffer", m_dynamicVertexBufferHandle, _handle); const DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx]; m_submit->setBuffer(_stage, dvb.m_handle, _access); } diff --git a/3rdparty/bgfx/src/glcontext_eagl.h b/3rdparty/bgfx/src/glcontext_eagl.h index 9c6775d8df2..5c26a71f2a4 100644 --- a/3rdparty/bgfx/src/glcontext_eagl.h +++ b/3rdparty/bgfx/src/glcontext_eagl.h @@ -8,7 +8,7 @@ #if BX_PLATFORM_IOS -namespace bgfx +namespace bgfx { namespace gl { struct SwapChainGL; @@ -48,7 +48,7 @@ namespace bgfx GLuint m_colorRbo; GLuint m_depthStencilRbo; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BX_PLATFORM_IOS diff --git a/3rdparty/bgfx/src/glcontext_eagl.mm b/3rdparty/bgfx/src/glcontext_eagl.mm index 4a10d43fd92..4348eb65178 100644 --- a/3rdparty/bgfx/src/glcontext_eagl.mm +++ b/3rdparty/bgfx/src/glcontext_eagl.mm @@ -10,7 +10,7 @@ # include <QuartzCore/CAEAGLLayer.h> # include "renderer_gl.h" -namespace bgfx +namespace bgfx { namespace gl { # define GL_IMPORT(_optional, _proto, _func, _import) _proto _func = NULL # include "glimports.h" @@ -123,6 +123,6 @@ namespace bgfx { } -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BX_PLATFORM_IOS && (BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL) diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp index 1a70e37b720..a3fe4e77c80 100644 --- a/3rdparty/bgfx/src/glcontext_egl.cpp +++ b/3rdparty/bgfx/src/glcontext_egl.cpp @@ -22,7 +22,7 @@ # define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB #endif // EGL_CONTEXT_MINOR_VERSION_KHR -namespace bgfx +namespace bgfx { namespace gl { #if BGFX_USE_GL_DYNAMIC_LIB @@ -369,7 +369,7 @@ EGL_IMPORT # include "glimports.h" } -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx # endif // BGFX_USE_EGL #endif // (BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_OPENGL) diff --git a/3rdparty/bgfx/src/glcontext_egl.h b/3rdparty/bgfx/src/glcontext_egl.h index 98fd63f7928..122591ca832 100644 --- a/3rdparty/bgfx/src/glcontext_egl.h +++ b/3rdparty/bgfx/src/glcontext_egl.h @@ -10,7 +10,7 @@ #include <EGL/egl.h> -namespace bgfx +namespace bgfx { namespace gl { struct SwapChainGL; @@ -48,7 +48,7 @@ namespace bgfx EGLDisplay m_display; EGLSurface m_surface; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BGFX_USE_EGL diff --git a/3rdparty/bgfx/src/glcontext_glx.cpp b/3rdparty/bgfx/src/glcontext_glx.cpp index af40d2d9413..13a91de7daf 100644 --- a/3rdparty/bgfx/src/glcontext_glx.cpp +++ b/3rdparty/bgfx/src/glcontext_glx.cpp @@ -12,7 +12,7 @@ # define GLX_GLXEXT_PROTOTYPES # include <glx/glxext.h> -namespace bgfx +namespace bgfx { namespace gl { typedef int (*PFNGLXSWAPINTERVALMESAPROC)(uint32_t _interval); @@ -55,122 +55,128 @@ namespace bgfx void GlContext::create(uint32_t _width, uint32_t _height) { BX_UNUSED(_width, _height); - XLockDisplay( (::Display*)g_bgfxX11Display); - int major, minor; - bool version = glXQueryVersion( (::Display*)g_bgfxX11Display, &major, &minor); - BGFX_FATAL(version, Fatal::UnableToInitialize, "Failed to query GLX version"); - BGFX_FATAL( (major == 1 && minor >= 2) || major > 1 - , Fatal::UnableToInitialize - , "GLX version is not >=1.2 (%d.%d)." - , major - , minor - ); + m_context = (GLXContext)g_bgfxGLX; - int32_t screen = DefaultScreen( (::Display*)g_bgfxX11Display); + if (NULL == g_bgfxGLX) + { + XLockDisplay( (::Display*)g_bgfxX11Display); - const char* extensions = glXQueryExtensionsString( (::Display*)g_bgfxX11Display, screen); - BX_TRACE("GLX extensions:"); - dumpExtensions(extensions); + int major, minor; + bool version = glXQueryVersion( (::Display*)g_bgfxX11Display, &major, &minor); + BGFX_FATAL(version, Fatal::UnableToInitialize, "Failed to query GLX version"); + BGFX_FATAL( (major == 1 && minor >= 2) || major > 1 + , Fatal::UnableToInitialize + , "GLX version is not >=1.2 (%d.%d)." + , major + , minor + ); - const int attrsGlx[] = - { - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_DOUBLEBUFFER, true, - GLX_RED_SIZE, 8, - GLX_BLUE_SIZE, 8, - GLX_GREEN_SIZE, 8, -// GLX_ALPHA_SIZE, 8, - GLX_DEPTH_SIZE, 24, - GLX_STENCIL_SIZE, 8, - 0, - }; - - // Find suitable config - GLXFBConfig bestConfig = NULL; - - int numConfigs; - GLXFBConfig* configs = glXChooseFBConfig( (::Display*)g_bgfxX11Display, screen, attrsGlx, &numConfigs); - - BX_TRACE("glX num configs %d", numConfigs); - - for (int ii = 0; ii < numConfigs; ++ii) - { - m_visualInfo = glXGetVisualFromFBConfig( (::Display*)g_bgfxX11Display, configs[ii]); - if (NULL != m_visualInfo) + int32_t screen = DefaultScreen( (::Display*)g_bgfxX11Display); + + const char* extensions = glXQueryExtensionsString( (::Display*)g_bgfxX11Display, screen); + BX_TRACE("GLX extensions:"); + dumpExtensions(extensions); + + const int attrsGlx[] = + { + GLX_RENDER_TYPE, GLX_RGBA_BIT, + GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, + GLX_DOUBLEBUFFER, true, + GLX_RED_SIZE, 8, + GLX_BLUE_SIZE, 8, + GLX_GREEN_SIZE, 8, + // GLX_ALPHA_SIZE, 8, + GLX_DEPTH_SIZE, 24, + GLX_STENCIL_SIZE, 8, + 0, + }; + + // Find suitable config + GLXFBConfig bestConfig = NULL; + + int numConfigs; + GLXFBConfig* configs = glXChooseFBConfig( (::Display*)g_bgfxX11Display, screen, attrsGlx, &numConfigs); + + BX_TRACE("glX num configs %d", numConfigs); + + for (int ii = 0; ii < numConfigs; ++ii) { - BX_TRACE("---"); - bool valid = true; - for (uint32_t attr = 6; attr < BX_COUNTOF(attrsGlx)-1 && attrsGlx[attr] != None; attr += 2) + m_visualInfo = glXGetVisualFromFBConfig( (::Display*)g_bgfxX11Display, configs[ii]); + if (NULL != m_visualInfo) { - int value; - glXGetFBConfigAttrib( (::Display*)g_bgfxX11Display, configs[ii], attrsGlx[attr], &value); - BX_TRACE("glX %d/%d %2d: %4x, %8x (%8x%s)" - , ii - , numConfigs - , attr/2 - , attrsGlx[attr] - , value - , attrsGlx[attr + 1] - , value < attrsGlx[attr + 1] ? " *" : "" - ); - - if (value < attrsGlx[attr + 1]) + BX_TRACE("---"); + bool valid = true; + for (uint32_t attr = 6; attr < BX_COUNTOF(attrsGlx)-1 && attrsGlx[attr] != None; attr += 2) { - valid = false; + int value; + glXGetFBConfigAttrib( (::Display*)g_bgfxX11Display, configs[ii], attrsGlx[attr], &value); + BX_TRACE("glX %d/%d %2d: %4x, %8x (%8x%s)" + , ii + , numConfigs + , attr/2 + , attrsGlx[attr] + , value + , attrsGlx[attr + 1] + , value < attrsGlx[attr + 1] ? " *" : "" + ); + + if (value < attrsGlx[attr + 1]) + { + valid = false; #if !BGFX_CONFIG_DEBUG - break; + break; #endif // BGFX_CONFIG_DEBUG + } } - } - if (valid) - { - bestConfig = configs[ii]; - BX_TRACE("Best config %d.", ii); - break; + if (valid) + { + bestConfig = configs[ii]; + BX_TRACE("Best config %d.", ii); + break; + } } - } - XFree(m_visualInfo); - m_visualInfo = NULL; - } + XFree(m_visualInfo); + m_visualInfo = NULL; + } - XFree(configs); - BGFX_FATAL(m_visualInfo, Fatal::UnableToInitialize, "Failed to find a suitable X11 display configuration."); + XFree(configs); + BGFX_FATAL(m_visualInfo, Fatal::UnableToInitialize, "Failed to find a suitable X11 display configuration."); - BX_TRACE("Create GL 2.1 context."); - m_context = glXCreateContext( (::Display*)g_bgfxX11Display, m_visualInfo, 0, GL_TRUE); - BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create GL 2.1 context."); + BX_TRACE("Create GL 2.1 context."); + m_context = glXCreateContext( (::Display*)g_bgfxX11Display, m_visualInfo, 0, GL_TRUE); + BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create GL 2.1 context."); #if BGFX_CONFIG_RENDERER_OPENGL >= 31 - glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress( (const GLubyte*)"glXCreateContextAttribsARB"); + glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress( (const GLubyte*)"glXCreateContextAttribsARB"); - if (NULL != glXCreateContextAttribsARB) - { - BX_TRACE("Create GL 3.1 context."); - const int contextAttrs[] = + if (NULL != glXCreateContextAttribsARB) { - GLX_CONTEXT_MAJOR_VERSION_ARB, 3, - GLX_CONTEXT_MINOR_VERSION_ARB, 1, - GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, - 0, - }; + BX_TRACE("Create GL 3.1 context."); + const int contextAttrs[] = + { + GLX_CONTEXT_MAJOR_VERSION_ARB, 3, + GLX_CONTEXT_MINOR_VERSION_ARB, 1, + GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, + 0, + }; - GLXContext context = glXCreateContextAttribsARB( (::Display*)g_bgfxX11Display, bestConfig, 0, true, contextAttrs); + GLXContext context = glXCreateContextAttribsARB( (::Display*)g_bgfxX11Display, bestConfig, 0, true, contextAttrs); - if (NULL != context) - { - glXDestroyContext( (::Display*)g_bgfxX11Display, m_context); - m_context = context; + if (NULL != context) + { + glXDestroyContext( (::Display*)g_bgfxX11Display, m_context); + m_context = context; + } } - } #else - BX_UNUSED(bestConfig); + BX_UNUSED(bestConfig); #endif // BGFX_CONFIG_RENDERER_OPENGL >= 31 - XUnlockDisplay( (::Display*)g_bgfxX11Display); + XUnlockDisplay( (::Display*)g_bgfxX11Display); + } import(); @@ -210,8 +216,13 @@ namespace bgfx void GlContext::destroy() { glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0); - glXDestroyContext( (::Display*)g_bgfxX11Display, m_context); - XFree(m_visualInfo); + if (NULL == g_bgfxGLX) + { + glXDestroyContext( (::Display*)g_bgfxX11Display, m_context); + XFree(m_visualInfo); + } + m_context = NULL; + m_visualInfo = NULL; } void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, bool _vsync) @@ -292,7 +303,7 @@ namespace bgfx # include "glimports.h" } -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx # endif // BGFX_USE_GLX diff --git a/3rdparty/bgfx/src/glcontext_glx.h b/3rdparty/bgfx/src/glcontext_glx.h index 3fa7dbf2a64..cff6faa16a6 100644 --- a/3rdparty/bgfx/src/glcontext_glx.h +++ b/3rdparty/bgfx/src/glcontext_glx.h @@ -11,7 +11,7 @@ # include <X11/Xlib.h> # include <GL/glx.h> -namespace bgfx +namespace bgfx { namespace gl { struct SwapChainGL; @@ -45,7 +45,7 @@ namespace bgfx GLXContext m_context; XVisualInfo* m_visualInfo; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BGFX_USE_GLX diff --git a/3rdparty/bgfx/src/glcontext_nsgl.h b/3rdparty/bgfx/src/glcontext_nsgl.h index cde844df0a6..c88673d8fe6 100644 --- a/3rdparty/bgfx/src/glcontext_nsgl.h +++ b/3rdparty/bgfx/src/glcontext_nsgl.h @@ -8,7 +8,7 @@ #if BX_PLATFORM_OSX -namespace bgfx +namespace bgfx { namespace gl { struct SwapChainGL; @@ -39,7 +39,7 @@ namespace bgfx void* m_view; void* m_context; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BX_PLATFORM_OSX diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm index 70630a08456..667fdf4f0b3 100644 --- a/3rdparty/bgfx/src/glcontext_nsgl.mm +++ b/3rdparty/bgfx/src/glcontext_nsgl.mm @@ -10,7 +10,7 @@ # include <Cocoa/Cocoa.h> # include <bx/os.h> -namespace bgfx +namespace bgfx { namespace gl { # define GL_IMPORT(_optional, _proto, _func, _import) _proto _func @@ -35,7 +35,7 @@ namespace bgfx { } }; - + static void* s_opengl = NULL; void GlContext::create(uint32_t _width, uint32_t _height) @@ -46,56 +46,63 @@ namespace bgfx BX_CHECK(NULL != s_opengl, "OpenGL dynamic library is not found!"); NSWindow* nsWindow = (NSWindow*)g_bgfxNSWindow; + m_context = g_bgfxNSGL; - NSOpenGLPixelFormatAttribute profile = + if (NULL == g_bgfxNSGL) + { + NSOpenGLPixelFormatAttribute profile = #if BGFX_CONFIG_RENDERER_OPENGL >= 31 - NSOpenGLProfileVersion3_2Core + NSOpenGLProfileVersion3_2Core #else - NSOpenGLProfileVersionLegacy + NSOpenGLProfileVersionLegacy #endif // BGFX_CONFIG_RENDERER_OPENGL >= 31 - ; - - NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = { - NSOpenGLPFAOpenGLProfile, profile, - NSOpenGLPFAColorSize, 24, - NSOpenGLPFAAlphaSize, 8, - NSOpenGLPFADepthSize, 24, - NSOpenGLPFAStencilSize, 8, - NSOpenGLPFADoubleBuffer, true, - NSOpenGLPFAAccelerated, true, - NSOpenGLPFANoRecovery, true, - 0, 0, - }; - - NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; - BGFX_FATAL(NULL != pixelFormat, Fatal::UnableToInitialize, "Failed to initialize pixel format."); - - NSRect glViewRect = [[nsWindow contentView] bounds]; - NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat]; - - [pixelFormat release]; - [nsWindow setContentView:glView]; - - NSOpenGLContext* glContext = [glView openGLContext]; - BGFX_FATAL(NULL != glContext, Fatal::UnableToInitialize, "Failed to initialize GL context."); - - [glContext makeCurrentContext]; - GLint interval = 0; - [glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval]; - - m_view = glView; - m_context = glContext; + ; + + NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = { + NSOpenGLPFAOpenGLProfile, profile, + NSOpenGLPFAColorSize, 24, + NSOpenGLPFAAlphaSize, 8, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAStencilSize, 8, + NSOpenGLPFADoubleBuffer, true, + NSOpenGLPFAAccelerated, true, + NSOpenGLPFANoRecovery, true, + 0, 0, + }; + + NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; + BGFX_FATAL(NULL != pixelFormat, Fatal::UnableToInitialize, "Failed to initialize pixel format."); + + NSRect glViewRect = [[nsWindow contentView] bounds]; + NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat]; + + [pixelFormat release]; + [nsWindow setContentView:glView]; + + NSOpenGLContext* glContext = [glView openGLContext]; + BGFX_FATAL(NULL != glContext, Fatal::UnableToInitialize, "Failed to initialize GL context."); + + [glContext makeCurrentContext]; + GLint interval = 0; + [glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval]; + + m_view = glView; + m_context = glContext; + } import(); } void GlContext::destroy() { - NSOpenGLView* glView = (NSOpenGLView*)m_view; - m_view = 0; - m_context = 0; - [glView release]; + if (NULL == g_bgfxNSGL) + { + NSOpenGLView* glView = (NSOpenGLView*)m_view; + [glView release]; + } + m_view = 0; + m_context = 0; bx::dlclose(s_opengl); } @@ -165,6 +172,6 @@ namespace bgfx # include "glimports.h" } -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BX_PLATFORM_OSX && (BGFX_CONFIG_RENDERER_OPENGLES2|BGFX_CONFIG_RENDERER_OPENGLES3|BGFX_CONFIG_RENDERER_OPENGL) diff --git a/3rdparty/bgfx/src/glcontext_ppapi.cpp b/3rdparty/bgfx/src/glcontext_ppapi.cpp index f22228e04e6..3910e7a13ee 100644 --- a/3rdparty/bgfx/src/glcontext_ppapi.cpp +++ b/3rdparty/bgfx/src/glcontext_ppapi.cpp @@ -9,14 +9,14 @@ # include <bgfxplatform.h> # include "renderer_gl.h" -namespace bgfx +namespace bgfx { namespace gl { # define GL_IMPORT(_optional, _proto, _func, _import) _proto _func # include "glimports.h" void naclSwapCompleteCb(void* /*_data*/, int32_t /*_result*/); - PP_CompletionCallback naclSwapComplete = + PP_CompletionCallback naclSwapComplete = { naclSwapCompleteCb, NULL, @@ -62,7 +62,7 @@ namespace bgfx PostSwapBuffersFn m_postSwapBuffers; bool m_forceSwap; }; - + static Ppapi s_ppapi; void naclSwapCompleteCb(void* /*_data*/, int32_t /*_result*/) @@ -95,11 +95,6 @@ namespace bgfx s_ppapi.m_instancedArrays->DrawElementsInstancedANGLE(s_ppapi.m_context, _mode, _count, _type, _indices, _primcount); } - bool naclSetInterfaces(PP_Instance _instance, const PPB_Instance* _instInterface, const PPB_Graphics3D* _graphicsInterface, PostSwapBuffersFn _postSwapBuffers) - { - return s_ppapi.setInterfaces( _instance, _instInterface, _graphicsInterface, _postSwapBuffers); - } - bool Ppapi::setInterfaces(PP_Instance _instance, const PPB_Instance* _instInterface, const PPB_Graphics3D* _graphicsInterface, PostSwapBuffersFn _postSwapBuffers) { BX_TRACE("PPAPI Interfaces"); @@ -192,6 +187,14 @@ namespace bgfx return s_ppapi.isValid(); } +} /* namespace gl */ } // namespace bgfx + +namespace bgfx +{ + bool naclSetInterfaces(PP_Instance _instance, const PPB_Instance* _instInterface, const PPB_Graphics3D* _graphicsInterface, PostSwapBuffersFn _postSwapBuffers) + { + return gl::s_ppapi.setInterfaces( _instance, _instInterface, _graphicsInterface, _postSwapBuffers); + } } // namespace bgfx #endif // BX_PLATFORM_NACL && (BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_OPENGL) diff --git a/3rdparty/bgfx/src/glcontext_ppapi.h b/3rdparty/bgfx/src/glcontext_ppapi.h index e3acc876803..3142b6acdf5 100644 --- a/3rdparty/bgfx/src/glcontext_ppapi.h +++ b/3rdparty/bgfx/src/glcontext_ppapi.h @@ -13,7 +13,7 @@ # include <ppapi/c/ppb_instance.h> # include <ppapi/c/ppb_graphics_3d.h> -namespace bgfx +namespace bgfx { namespace gl { struct SwapChainGL; @@ -36,7 +36,7 @@ namespace bgfx void import(); bool isValid() const; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BX_PLATFORM_NACL diff --git a/3rdparty/bgfx/src/glcontext_wgl.cpp b/3rdparty/bgfx/src/glcontext_wgl.cpp index 56aad127514..84c32a06633 100644 --- a/3rdparty/bgfx/src/glcontext_wgl.cpp +++ b/3rdparty/bgfx/src/glcontext_wgl.cpp @@ -10,7 +10,7 @@ # if BGFX_USE_WGL -namespace bgfx +namespace bgfx { namespace gl { PFNWGLGETPROCADDRESSPROC wglGetProcAddress; PFNWGLMAKECURRENTPROC wglMakeCurrent; @@ -376,7 +376,7 @@ namespace bgfx # include "glimports.h" } -} // namespace bgfx +} } // namespace bgfx # endif // BGFX_USE_WGL #endif // (BGFX_CONFIG_RENDERER_OPENGLES|BGFX_CONFIG_RENDERER_OPENGL) diff --git a/3rdparty/bgfx/src/glcontext_wgl.h b/3rdparty/bgfx/src/glcontext_wgl.h index 4d0f64fb281..98338f09410 100644 --- a/3rdparty/bgfx/src/glcontext_wgl.h +++ b/3rdparty/bgfx/src/glcontext_wgl.h @@ -10,7 +10,7 @@ #include <wgl/wglext.h> -namespace bgfx +namespace bgfx { namespace gl { typedef PROC (APIENTRYP PFNWGLGETPROCADDRESSPROC) (LPCSTR lpszProc); typedef BOOL (APIENTRYP PFNWGLMAKECURRENTPROC) (HDC hdc, HGLRC hglrc); @@ -93,7 +93,7 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z HGLRC m_context; HDC m_hdc; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BGFX_USE_WGL diff --git a/3rdparty/bgfx/src/image.cpp b/3rdparty/bgfx/src/image.cpp index c18d4e939cf..b420b2da364 100644 --- a/3rdparty/bgfx/src/image.cpp +++ b/3rdparty/bgfx/src/image.cpp @@ -1235,49 +1235,49 @@ namespace bgfx #define DDS_BC5U BX_MAKEFOURCC('B', 'C', '5', 'U') #define DDS_DX10 BX_MAKEFOURCC('D', 'X', '1', '0') -#define D3DFMT_A8R8G8B8 21 -#define D3DFMT_R5G6B5 23 -#define D3DFMT_A1R5G5B5 25 -#define D3DFMT_A4R4G4B4 26 -#define D3DFMT_A2B10G10R10 31 -#define D3DFMT_G16R16 34 -#define D3DFMT_A2R10G10B10 35 -#define D3DFMT_A16B16G16R16 36 -#define D3DFMT_A8L8 51 -#define D3DFMT_R16F 111 -#define D3DFMT_G16R16F 112 -#define D3DFMT_A16B16G16R16F 113 -#define D3DFMT_R32F 114 -#define D3DFMT_G32R32F 115 -#define D3DFMT_A32B32G32R32F 116 - -#define DXGI_FORMAT_R32G32B32A32_FLOAT 2 -#define DXGI_FORMAT_R32G32B32A32_UINT 3 -#define DXGI_FORMAT_R16G16B16A16_FLOAT 10 -#define DXGI_FORMAT_R16G16B16A16_UNORM 11 -#define DXGI_FORMAT_R16G16B16A16_UINT 12 -#define DXGI_FORMAT_R32G32_FLOAT 16 -#define DXGI_FORMAT_R32G32_UINT 17 -#define DXGI_FORMAT_R10G10B10A2_UNORM 24 -#define DXGI_FORMAT_R16G16_FLOAT 34 -#define DXGI_FORMAT_R16G16_UNORM 35 -#define DXGI_FORMAT_R32_FLOAT 41 -#define DXGI_FORMAT_R32_UINT 42 -#define DXGI_FORMAT_R8G8_UNORM 49 -#define DXGI_FORMAT_R16_FLOAT 54 -#define DXGI_FORMAT_R16_UNORM 56 -#define DXGI_FORMAT_R8_UNORM 61 -#define DXGI_FORMAT_BC1_UNORM 71 -#define DXGI_FORMAT_BC2_UNORM 74 -#define DXGI_FORMAT_BC3_UNORM 77 -#define DXGI_FORMAT_BC4_UNORM 80 -#define DXGI_FORMAT_BC5_UNORM 83 -#define DXGI_FORMAT_B5G6R5_UNORM 85 -#define DXGI_FORMAT_B5G5R5A1_UNORM 86 -#define DXGI_FORMAT_B8G8R8A8_UNORM 87 -#define DXGI_FORMAT_BC6H_SF16 96 -#define DXGI_FORMAT_BC7_UNORM 98 -#define DXGI_FORMAT_B4G4R4A4_UNORM 115 +#define DDS_A8R8G8B8 21 +#define DDS_R5G6B5 23 +#define DDS_A1R5G5B5 25 +#define DDS_A4R4G4B4 26 +#define DDS_A2B10G10R10 31 +#define DDS_G16R16 34 +#define DDS_A2R10G10B10 35 +#define DDS_A16B16G16R16 36 +#define DDS_A8L8 51 +#define DDS_R16F 111 +#define DDS_G16R16F 112 +#define DDS_A16B16G16R16F 113 +#define DDS_R32F 114 +#define DDS_G32R32F 115 +#define DDS_A32B32G32R32F 116 + +#define DDS_FORMAT_R32G32B32A32_FLOAT 2 +#define DDS_FORMAT_R32G32B32A32_UINT 3 +#define DDS_FORMAT_R16G16B16A16_FLOAT 10 +#define DDS_FORMAT_R16G16B16A16_UNORM 11 +#define DDS_FORMAT_R16G16B16A16_UINT 12 +#define DDS_FORMAT_R32G32_FLOAT 16 +#define DDS_FORMAT_R32G32_UINT 17 +#define DDS_FORMAT_R10G10B10A2_UNORM 24 +#define DDS_FORMAT_R16G16_FLOAT 34 +#define DDS_FORMAT_R16G16_UNORM 35 +#define DDS_FORMAT_R32_FLOAT 41 +#define DDS_FORMAT_R32_UINT 42 +#define DDS_FORMAT_R8G8_UNORM 49 +#define DDS_FORMAT_R16_FLOAT 54 +#define DDS_FORMAT_R16_UNORM 56 +#define DDS_FORMAT_R8_UNORM 61 +#define DDS_FORMAT_BC1_UNORM 71 +#define DDS_FORMAT_BC2_UNORM 74 +#define DDS_FORMAT_BC3_UNORM 77 +#define DDS_FORMAT_BC4_UNORM 80 +#define DDS_FORMAT_BC5_UNORM 83 +#define DDS_FORMAT_B5G6R5_UNORM 85 +#define DDS_FORMAT_B5G5R5A1_UNORM 86 +#define DDS_FORMAT_B8G8R8A8_UNORM 87 +#define DDS_FORMAT_BC6H_SF16 96 +#define DDS_FORMAT_BC7_UNORM 98 +#define DDS_FORMAT_B4G4R4A4_UNORM 115 #define DDSD_CAPS 0x00000001 #define DDSD_HEIGHT 0x00000002 @@ -1331,57 +1331,57 @@ namespace bgfx { DDS_BC4U, TextureFormat::BC4 }, { DDS_ATI2, TextureFormat::BC5 }, { DDS_BC5U, TextureFormat::BC5 }, - { D3DFMT_A16B16G16R16, TextureFormat::RGBA16 }, - { D3DFMT_A16B16G16R16F, TextureFormat::RGBA16F }, + { DDS_A16B16G16R16, TextureFormat::RGBA16 }, + { DDS_A16B16G16R16F, TextureFormat::RGBA16F }, { DDPF_RGB|DDPF_ALPHAPIXELS, TextureFormat::BGRA8 }, { DDPF_INDEXED, TextureFormat::R8 }, { DDPF_LUMINANCE, TextureFormat::R8 }, { DDPF_ALPHA, TextureFormat::R8 }, - { D3DFMT_R16F, TextureFormat::R16F }, - { D3DFMT_R32F, TextureFormat::R32F }, - { D3DFMT_A8L8, TextureFormat::RG8 }, - { D3DFMT_G16R16, TextureFormat::RG16 }, - { D3DFMT_G16R16F, TextureFormat::RG16F }, - { D3DFMT_G32R32F, TextureFormat::RG32F }, - { D3DFMT_A8R8G8B8, TextureFormat::BGRA8 }, - { D3DFMT_A16B16G16R16, TextureFormat::RGBA16 }, - { D3DFMT_A16B16G16R16F, TextureFormat::RGBA16F }, - { D3DFMT_A32B32G32R32F, TextureFormat::RGBA32F }, - { D3DFMT_R5G6B5, TextureFormat::R5G6B5 }, - { D3DFMT_A4R4G4B4, TextureFormat::RGBA4 }, - { D3DFMT_A1R5G5B5, TextureFormat::RGB5A1 }, - { D3DFMT_A2B10G10R10, TextureFormat::RGB10A2 }, + { DDS_R16F, TextureFormat::R16F }, + { DDS_R32F, TextureFormat::R32F }, + { DDS_A8L8, TextureFormat::RG8 }, + { DDS_G16R16, TextureFormat::RG16 }, + { DDS_G16R16F, TextureFormat::RG16F }, + { DDS_G32R32F, TextureFormat::RG32F }, + { DDS_A8R8G8B8, TextureFormat::BGRA8 }, + { DDS_A16B16G16R16, TextureFormat::RGBA16 }, + { DDS_A16B16G16R16F, TextureFormat::RGBA16F }, + { DDS_A32B32G32R32F, TextureFormat::RGBA32F }, + { DDS_R5G6B5, TextureFormat::R5G6B5 }, + { DDS_A4R4G4B4, TextureFormat::RGBA4 }, + { DDS_A1R5G5B5, TextureFormat::RGB5A1 }, + { DDS_A2B10G10R10, TextureFormat::RGB10A2 }, }; static TranslateDdsFormat s_translateDxgiFormat[] = { - { DXGI_FORMAT_BC1_UNORM, TextureFormat::BC1 }, - { DXGI_FORMAT_BC2_UNORM, TextureFormat::BC2 }, - { DXGI_FORMAT_BC3_UNORM, TextureFormat::BC3 }, - { DXGI_FORMAT_BC4_UNORM, TextureFormat::BC4 }, - { DXGI_FORMAT_BC5_UNORM, TextureFormat::BC5 }, - { DXGI_FORMAT_BC6H_SF16, TextureFormat::BC6H }, - { DXGI_FORMAT_BC7_UNORM, TextureFormat::BC7 }, - - { DXGI_FORMAT_R8_UNORM, TextureFormat::R8 }, - { DXGI_FORMAT_R16_UNORM, TextureFormat::R16 }, - { DXGI_FORMAT_R16_FLOAT, TextureFormat::R16F }, - { DXGI_FORMAT_R32_UINT, TextureFormat::R32 }, - { DXGI_FORMAT_R32_FLOAT, TextureFormat::R32F }, - { DXGI_FORMAT_R8G8_UNORM, TextureFormat::RG8 }, - { DXGI_FORMAT_R16G16_UNORM, TextureFormat::RG16 }, - { DXGI_FORMAT_R16G16_FLOAT, TextureFormat::RG16F }, - { DXGI_FORMAT_R32G32_UINT, TextureFormat::RG32 }, - { DXGI_FORMAT_R32G32_FLOAT, TextureFormat::RG32F }, - { DXGI_FORMAT_B8G8R8A8_UNORM, TextureFormat::BGRA8 }, - { DXGI_FORMAT_R16G16B16A16_UNORM, TextureFormat::RGBA16 }, - { DXGI_FORMAT_R16G16B16A16_FLOAT, TextureFormat::RGBA16F }, - { DXGI_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32 }, - { DXGI_FORMAT_R32G32B32A32_FLOAT, TextureFormat::RGBA32F }, - { DXGI_FORMAT_B5G6R5_UNORM, TextureFormat::R5G6B5 }, - { DXGI_FORMAT_B4G4R4A4_UNORM, TextureFormat::RGBA4 }, - { DXGI_FORMAT_B5G5R5A1_UNORM, TextureFormat::RGB5A1 }, - { DXGI_FORMAT_R10G10B10A2_UNORM, TextureFormat::RGB10A2 }, + { DDS_FORMAT_BC1_UNORM, TextureFormat::BC1 }, + { DDS_FORMAT_BC2_UNORM, TextureFormat::BC2 }, + { DDS_FORMAT_BC3_UNORM, TextureFormat::BC3 }, + { DDS_FORMAT_BC4_UNORM, TextureFormat::BC4 }, + { DDS_FORMAT_BC5_UNORM, TextureFormat::BC5 }, + { DDS_FORMAT_BC6H_SF16, TextureFormat::BC6H }, + { DDS_FORMAT_BC7_UNORM, TextureFormat::BC7 }, + + { DDS_FORMAT_R8_UNORM, TextureFormat::R8 }, + { DDS_FORMAT_R16_UNORM, TextureFormat::R16 }, + { DDS_FORMAT_R16_FLOAT, TextureFormat::R16F }, + { DDS_FORMAT_R32_UINT, TextureFormat::R32 }, + { DDS_FORMAT_R32_FLOAT, TextureFormat::R32F }, + { DDS_FORMAT_R8G8_UNORM, TextureFormat::RG8 }, + { DDS_FORMAT_R16G16_UNORM, TextureFormat::RG16 }, + { DDS_FORMAT_R16G16_FLOAT, TextureFormat::RG16F }, + { DDS_FORMAT_R32G32_UINT, TextureFormat::RG32 }, + { DDS_FORMAT_R32G32_FLOAT, TextureFormat::RG32F }, + { DDS_FORMAT_B8G8R8A8_UNORM, TextureFormat::BGRA8 }, + { DDS_FORMAT_R16G16B16A16_UNORM, TextureFormat::RGBA16 }, + { DDS_FORMAT_R16G16B16A16_FLOAT, TextureFormat::RGBA16F }, + { DDS_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32 }, + { DDS_FORMAT_R32G32B32A32_FLOAT, TextureFormat::RGBA32F }, + { DDS_FORMAT_B5G6R5_UNORM, TextureFormat::R5G6B5 }, + { DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::RGBA4 }, + { DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::RGB5A1 }, + { DDS_FORMAT_R10G10B10A2_UNORM, TextureFormat::RGB10A2 }, }; struct TranslateDdsPixelFormat diff --git a/3rdparty/bgfx/src/ovr.cpp b/3rdparty/bgfx/src/ovr.cpp index 732f750cc9e..f86d69a345d 100644 --- a/3rdparty/bgfx/src/ovr.cpp +++ b/3rdparty/bgfx/src/ovr.cpp @@ -123,7 +123,9 @@ namespace bgfx result = ovrHmd_ConfigureRendering(m_hmd , _config , 0 - | ovrDistortionCap_Chromatic +#if OVR_VERSION < OVR_VERSION_050 + | ovrDistortionCap_Chromatic // permanently enabled >= v5.0 +#endif | ovrDistortionCap_Vignette | ovrDistortionCap_TimeWarp | ovrDistortionCap_Overdrive diff --git a/3rdparty/bgfx/src/ovr.h b/3rdparty/bgfx/src/ovr.h index 331406e61bb..e8c86b895e0 100644 --- a/3rdparty/bgfx/src/ovr.h +++ b/3rdparty/bgfx/src/ovr.h @@ -3,21 +3,35 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ +#ifndef BGFX_OVR_H_HEADER_GUARD +#define BGFX_OVR_H_HEADER_GUARD + #include "bgfx_p.h" #if BGFX_CONFIG_USE_OVR -# include <OVR.h> +# include <OVR_Version.h> # define OVR_VERSION_(_a, _b, _c) (_a * 10000 + _b * 100 + _c) # define OVR_VERSION OVR_VERSION_(OVR_MAJOR_VERSION, OVR_MINOR_VERSION, OVR_BUILD_VERSION) # define OVR_VERSION_042 OVR_VERSION_(0, 4, 2) # define OVR_VERSION_043 OVR_VERSION_(0, 4, 3) # define OVR_VERSION_044 OVR_VERSION_(0, 4, 4) +# define OVR_VERSION_050 OVR_VERSION_(0, 5, 0) + +# if OVR_VERSION < OVR_VERSION_050 +# include <OVR.h> +# else +# include <OVR_CAPI.h> +# endif // OVR_VERSION < OVR_VERSION_050 # if BGFX_CONFIG_RENDERER_DIRECT3D9 # define OVR_D3D_VERSION 9 -# include <OVR_D3D.h> +# if OVR_VERSION < OVR_VERSION_050 +# include <OVR_D3D.h> +# else +# include <OVR_CAPI_D3D.h> +# endif # endif // BGFX_CONFIG_RENDERER_DIRECT3D9 # if BGFX_CONFIG_RENDERER_DIRECT3D11 @@ -26,11 +40,19 @@ # undef OVR_D3D_VERSION # endif // OVR_CAPI_D3D_h # define OVR_D3D_VERSION 11 -# include <OVR_D3D.h> +# if OVR_VERSION < OVR_VERSION_050 +# include <OVR_D3D.h> +# else +# include <OVR_CAPI_D3D.h> +# endif # endif // BGFX_CONFIG_RENDERER_DIRECT3D11 # if BGFX_CONFIG_RENDERER_OPENGL -# include <OVR_GL.h> +# if OVR_VERSION < OVR_VERSION_050 +# include <OVR_GL.h> +# else +# include <OVR_CAPI_GL.h> +# endif # endif // BGFX_CONFIG_RENDERER_OPENGL namespace bgfx @@ -146,3 +168,5 @@ namespace bgfx } // namespace bgfx #endif // BGFX_CONFIG_USE_OVR + +#endif // BGFX_OVR_H_HEADER_GUARD diff --git a/3rdparty/bgfx/src/renderdoc.h b/3rdparty/bgfx/src/renderdoc.h index e52a030cd8b..9a7e6eb0225 100644 --- a/3rdparty/bgfx/src/renderdoc.h +++ b/3rdparty/bgfx/src/renderdoc.h @@ -3,9 +3,14 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ +#ifndef BGFX_RENDERDOC_H_HEADER_GUARD +#define BGFX_RENDERDOC_H_HEADER_GUARD + namespace bgfx { void* loadRenderDoc(); void unloadRenderDoc(void*); } // namespace bgfx + +#endif // BGFX_RENDERDOC_H_HEADER_GUARD diff --git a/3rdparty/bgfx/src/renderer.h b/3rdparty/bgfx/src/renderer.h index 95e0762aa83..738f5988e56 100644 --- a/3rdparty/bgfx/src/renderer.h +++ b/3rdparty/bgfx/src/renderer.h @@ -3,6 +3,9 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ +#ifndef BGFX_RENDERER_H_HEADER_GUARD +#define BGFX_RENDERER_H_HEADER_GUARD + #include "bgfx_p.h" namespace bgfx @@ -262,3 +265,5 @@ namespace bgfx }; } // namespace bgfx + +#endif // BGFX_RENDERER_H_HEADER_GUARD diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp index 1ccaeffd290..c69424ca7ab 100644 --- a/3rdparty/bgfx/src/renderer_d3d11.cpp +++ b/3rdparty/bgfx/src/renderer_d3d11.cpp @@ -8,7 +8,7 @@ #if BGFX_CONFIG_RENDERER_DIRECT3D11 # include "renderer_d3d11.h" -namespace bgfx +namespace bgfx { namespace d3d11 { static wchar_t s_viewNameW[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; @@ -513,7 +513,10 @@ namespace bgfx m_driverType = D3D_DRIVER_TYPE_HARDWARE; IDXGIAdapter* adapter; - for (uint32_t ii = 0; DXGI_ERROR_NOT_FOUND != factory->EnumAdapters(ii, &adapter); ++ii) + for (uint32_t ii = 0 + ; DXGI_ERROR_NOT_FOUND != factory->EnumAdapters(ii, &adapter) && ii < BX_COUNTOF(g_caps.gpu) + ; ++ii + ) { DXGI_ADAPTER_DESC desc; hr = adapter->GetDesc(&desc); @@ -536,11 +539,27 @@ namespace bgfx , desc.SharedSystemMemory ); - if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD) - && 0 != strstr(description, "PerfHUD") ) + g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId; + g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId; + ++g_caps.numGPUs; + + if (NULL == m_adapter) { - m_adapter = adapter; - m_driverType = D3D_DRIVER_TYPE_REFERENCE; + if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId) + && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId) + && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) ) + { + m_adapter = adapter; + m_adapter->AddRef(); + m_driverType = D3D_DRIVER_TYPE_UNKNOWN; + } + + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD) + && 0 != strstr(description, "PerfHUD") ) + { + m_adapter = adapter; + m_driverType = D3D_DRIVER_TYPE_REFERENCE; + } } } @@ -594,6 +613,11 @@ namespace bgfx } BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device."); + if (NULL != m_adapter) + { + DX_RELEASE(m_adapter, 2); + } + IDXGIDevice* device = NULL; hr = E_FAIL; for (uint32_t ii = 0; ii < BX_COUNTOF(s_deviceIIDs) && FAILED(hr); ++ii) @@ -616,6 +640,8 @@ namespace bgfx hr = adapter->GetDesc(&m_adapterDesc); BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device."); + g_caps.vendorId = (uint16_t)m_adapterDesc.VendorId; + g_caps.deviceId = (uint16_t)m_adapterDesc.DeviceId; #if BX_PLATFORM_WINRT hr = adapter->GetParent(__uuidof(IDXGIFactory2), (void**)&m_factory); @@ -673,6 +699,7 @@ namespace bgfx m_numWindows = 1; +#if !defined(__MINGW32__) if (BX_ENABLED(BGFX_CONFIG_DEBUG) ) { ID3D11InfoQueue* infoQueue; @@ -704,6 +731,7 @@ namespace bgfx setGraphicsDebuggerPresent(true); } } +#endif // __MINGW__ UniformHandle handle = BGFX_INVALID_HANDLE; for (uint32_t ii = 0; ii < PredefinedUniform::Count; ++ii) @@ -734,7 +762,7 @@ namespace bgfx { D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2 data.InFormat = s_textureFormat[ii].m_fmt; - HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); + hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) ); if (SUCCEEDED(hr) ) { support |= 0 != (data.OutFormatSupport & (0 @@ -2299,14 +2327,14 @@ namespace bgfx static RendererContextD3D11* s_renderD3D11; - RendererContextI* rendererCreateD3D11() + RendererContextI* rendererCreate() { s_renderD3D11 = BX_NEW(g_allocator, RendererContextD3D11); s_renderD3D11->init(); return s_renderD3D11; } - void rendererDestroyD3D11() + void rendererDestroy() { s_renderD3D11->shutdown(); BX_DELETE(g_allocator, s_renderD3D11); @@ -3123,6 +3151,7 @@ namespace bgfx uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) { @@ -3135,6 +3164,8 @@ namespace bgfx for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; + const bool viewChanged = 0 || key.m_view != view || item == numItems @@ -3778,8 +3809,10 @@ namespace bgfx ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii) @@ -3839,20 +3872,20 @@ namespace bgfx PIX_ENDEVENT(); } } -} // namespace bgfx +} /* namespace d3d11 */ } // namespace bgfx #else -namespace bgfx +namespace bgfx { namespace d3d11 { - RendererContextI* rendererCreateD3D11() + RendererContextI* rendererCreate() { return NULL; } - void rendererDestroyD3D11() + void rendererDestroy() { } -} // namespace bgfx +} /* namespace d3d11 */ } // namespace bgfx #endif // BGFX_CONFIG_RENDERER_DIRECT3D11 diff --git a/3rdparty/bgfx/src/renderer_d3d11.h b/3rdparty/bgfx/src/renderer_d3d11.h index 3d485e3913d..e3a6b7d9bc8 100644 --- a/3rdparty/bgfx/src/renderer_d3d11.h +++ b/3rdparty/bgfx/src/renderer_d3d11.h @@ -49,28 +49,50 @@ BX_PRAGMA_DIAGNOSTIC_POP() # define D3D_FEATURE_LEVEL_11_1 D3D_FEATURE_LEVEL(0xb100) #endif // D3D_FEATURE_LEVEL_11_1 +#if defined(__MINGW32__) // MinGW Linux/Wine missing defines... -#ifndef D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT -# define D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT 8 -#endif // D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT +# ifndef D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT +# define D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT 8 +# endif // D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT -#ifndef D3D11_PS_CS_UAV_REGISTER_COUNT -# define D3D11_PS_CS_UAV_REGISTER_COUNT 8 -#endif // D3D11_PS_CS_UAV_REGISTER_COUNT +# ifndef D3D11_PS_CS_UAV_REGISTER_COUNT +# define D3D11_PS_CS_UAV_REGISTER_COUNT 8 +# endif // D3D11_PS_CS_UAV_REGISTER_COUNT -#ifndef D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT -# define D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT 8 -#endif +# ifndef D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT +# define D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT 8 +# endif + +# ifndef D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT +# define D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT 8 +# endif // D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + +# ifndef D3D11_APPEND_ALIGNED_ELEMENT +# define D3D11_APPEND_ALIGNED_ELEMENT UINT32_MAX +# endif // D3D11_APPEND_ALIGNED_ELEMENT -#ifndef D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT -# define D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT 8 -#endif // D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT +# ifndef D3D11_REQ_MAXANISOTROPY +# define D3D11_REQ_MAXANISOTROPY 16 +# endif // D3D11_REQ_MAXANISOTROPY -#ifndef D3D11_APPEND_ALIGNED_ELEMENT -# define D3D11_APPEND_ALIGNED_ELEMENT UINT32_MAX -#endif // D3D11_APPEND_ALIGNED_ELEMENT +# ifndef D3D11_FEATURE_DATA_FORMAT_SUPPORT +typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT +{ + DXGI_FORMAT InFormat; + UINT OutFormatSupport; +} D3D11_FEATURE_DATA_FORMAT_SUPPORT; +# endif // D3D11_FEATURE_DATA_FORMAT_SUPPORT + +# ifndef D3D11_FEATURE_DATA_FORMAT_SUPPORT2 +typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 +{ + DXGI_FORMAT InFormat; + UINT OutFormatSupport2; +} D3D11_FEATURE_DATA_FORMAT_SUPPORT2; +# endif // D3D11_FEATURE_DATA_FORMAT_SUPPORT2 +#endif // __MINGW32__ -namespace bgfx +namespace bgfx { namespace d3d11 { struct BufferD3D11 { @@ -280,6 +302,6 @@ namespace bgfx uint8_t m_num; }; -} // namespace bgfx +} /* namespace d3d11 */ } // namespace bgfx #endif // BGFX_RENDERER_D3D11_H_HEADER_GUARD diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp index 25054230866..b41207cbc31 100644 --- a/3rdparty/bgfx/src/renderer_d3d12.cpp +++ b/3rdparty/bgfx/src/renderer_d3d12.cpp @@ -9,16 +9,16 @@ # include "../../d3d12/src/renderer_d3d12.cpp" #else -namespace bgfx +namespace bgfx { namespace d3d12 { - RendererContextI* rendererCreateD3D12() + RendererContextI* rendererCreate() { return NULL; } - void rendererDestroyD3D12() + void rendererDestroy() { } -} // namespace bgfx +} /* namespace d3d12 */ } // namespace bgfx #endif // BGFX_CONFIG_RENDERER_DIRECT3D12 diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp index 8d4e362176a..b31e25d6f45 100644 --- a/3rdparty/bgfx/src/renderer_d3d9.cpp +++ b/3rdparty/bgfx/src/renderer_d3d9.cpp @@ -8,7 +8,7 @@ #if BGFX_CONFIG_RENDERER_DIRECT3D9 # include "renderer_d3d9.h" -namespace bgfx +namespace bgfx { namespace d3d9 { static wchar_t s_viewNameW[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; @@ -359,37 +359,51 @@ namespace bgfx m_adapter = D3DADAPTER_DEFAULT; m_deviceType = D3DDEVTYPE_HAL; - uint32_t adapterCount = m_d3d9->GetAdapterCount(); - for (uint32_t ii = 0; ii < adapterCount; ++ii) + uint8_t numGPUs = bx::uint32_min(BX_COUNTOF(g_caps.gpu), m_d3d9->GetAdapterCount() ); + for (uint32_t ii = 0; ii < numGPUs; ++ii) { - D3DADAPTER_IDENTIFIER9 identifier; - HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &identifier); + D3DADAPTER_IDENTIFIER9 desc; + HRESULT hr = m_d3d9->GetAdapterIdentifier(ii, 0, &desc); if (SUCCEEDED(hr) ) - { + { BX_TRACE("Adapter #%d", ii); - BX_TRACE("\tDriver: %s", identifier.Driver); - BX_TRACE("\tDescription: %s", identifier.Description); - BX_TRACE("\tDeviceName: %s", identifier.DeviceName); + BX_TRACE("\tDriver: %s", desc.Driver); + BX_TRACE("\tDescription: %s", desc.Description); + BX_TRACE("\tDeviceName: %s", desc.DeviceName); BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x" - , identifier.VendorId - , identifier.DeviceId - , identifier.SubSysId - , identifier.Revision + , desc.VendorId + , desc.DeviceId + , desc.SubSysId + , desc.Revision ); -#if BGFX_CONFIG_DEBUG_PERFHUD - if (0 != strstr(identifier.Description, "PerfHUD") ) + g_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId; + g_caps.gpu[ii].deviceId = (uint16_t)desc.DeviceId; + + if (D3DADAPTER_DEFAULT == m_adapter) { - m_adapter = ii; - m_deviceType = D3DDEVTYPE_REF; + if ( (BGFX_PCI_ID_NONE != g_caps.vendorId || 0 != g_caps.deviceId) + && (BGFX_PCI_ID_NONE == g_caps.vendorId || desc.VendorId == g_caps.vendorId) + && ( 0 == g_caps.deviceId || desc.DeviceId == g_caps.deviceId) ) + { + m_adapter = ii; + } + + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD) + && 0 != strstr(desc.Description, "PerfHUD")) + { + m_adapter = ii; + m_deviceType = D3DDEVTYPE_REF; + } } -#endif // BGFX_CONFIG_DEBUG_PERFHUD } } DX_CHECK(m_d3d9->GetAdapterIdentifier(m_adapter, 0, &m_identifier) ); - m_amd = m_identifier.VendorId == 0x1002; - m_nvidia = m_identifier.VendorId == 0x10de; + m_amd = m_identifier.VendorId == BGFX_PCI_ID_AMD; + m_nvidia = m_identifier.VendorId == BGFX_PCI_ID_NVIDIA; + g_caps.vendorId = (uint16_t)m_identifier.VendorId; + g_caps.deviceId = (uint16_t)m_identifier.DeviceId; uint32_t behaviorFlags[] = { @@ -1731,14 +1745,14 @@ namespace bgfx static RendererContextD3D9* s_renderD3D9; - RendererContextI* rendererCreateD3D9() + RendererContextI* rendererCreate() { s_renderD3D9 = BX_NEW(g_allocator, RendererContextD3D9); s_renderD3D9->init(); return s_renderD3D9; } - void rendererDestroyD3D9() + void rendererDestroy() { s_renderD3D9->shutdown(); BX_DELETE(g_allocator, s_renderD3D9); @@ -2215,10 +2229,10 @@ namespace bgfx if (NULL != _rect) { RECT rect; - rect.left = _rect->m_x; - rect.top = _rect->m_y; - rect.right = rect.left + _rect->m_width; - rect.bottom = rect.top + _rect->m_height; + rect.left = _rect->m_x; + rect.top = _rect->m_y; + rect.right = rect.left + _rect->m_width; + rect.bottom = rect.top + _rect->m_height; DX_CHECK(m_texture2d->LockRect(_lod, &lockedRect, &rect, 0) ); } else @@ -2494,7 +2508,7 @@ namespace bgfx if (convert) { - uint8_t* temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); + temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch*_rect.m_height); imageDecodeToBgra8(temp, data, _rect.m_width, _rect.m_height, srcpitch, m_requestedFormat); data = temp; } @@ -2864,8 +2878,11 @@ namespace bgfx FrameBufferHandle fbh = BGFX_INVALID_HANDLE; uint32_t blendFactor = 0; - const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; - uint8_t primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + uint8_t primIndex; + { + const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; + primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + } PrimInfo prim = s_primInfo[primIndex]; bool viewHasScissor = false; @@ -2876,6 +2893,7 @@ namespace bgfx uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; invalidateSamplerState(); @@ -2884,6 +2902,7 @@ namespace bgfx for (uint32_t item = 0, numItems = _render->m_num; item < numItems; ++item) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; if (isCompute) { @@ -3414,8 +3433,10 @@ namespace bgfx ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primName); ++ii) @@ -3460,20 +3481,20 @@ namespace bgfx device->EndScene(); } -} // namespace bgfx +} /* namespace d3d9 */ } // namespace bgfx #else -namespace bgfx +namespace bgfx { namespace d3d9 { - RendererContextI* rendererCreateD3D9() + RendererContextI* rendererCreate() { return NULL; } - void rendererDestroyD3D9() + void rendererDestroy() { } -} // namespace bgfx +} /* namespace d3d9 */ } // namespace bgfx #endif // BGFX_CONFIG_RENDERER_DIRECT3D9 diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h index e32a91a18d8..5ff3762581b 100644 --- a/3rdparty/bgfx/src/renderer_d3d9.h +++ b/3rdparty/bgfx/src/renderer_d3d9.h @@ -41,7 +41,7 @@ #include "renderer.h" #include "renderer_d3d.h" -namespace bgfx +namespace bgfx { namespace d3d9 { # if defined(D3D_DISABLE_9EX) # define D3DFMT_S8_LOCKABLE D3DFORMAT( 85) @@ -386,6 +386,6 @@ namespace bgfx bool m_needResolve; }; -} // namespace bgfx +} /* namespace d3d9 */ } // namespace bgfx #endif // BGFX_RENDERER_D3D9_H_HEADER_GUARD diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp index 6d4dc557175..c35e9c5a30f 100644 --- a/3rdparty/bgfx/src/renderer_gl.cpp +++ b/3rdparty/bgfx/src/renderer_gl.cpp @@ -10,7 +10,7 @@ # include <bx/timer.h> # include <bx/uint32_t.h> -namespace bgfx +namespace bgfx { namespace gl { static char s_viewName[BGFX_CONFIG_MAX_VIEWS][BGFX_CONFIG_MAX_VIEW_NAME]; @@ -237,6 +237,8 @@ namespace bgfx }; BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) ); + static bool s_textureFilter[TextureFormat::Count+1]; + static GLenum s_rboFormat[] = { GL_ZERO, // BC1 @@ -358,6 +360,7 @@ namespace bgfx ANGLE_texture_compression_dxt1, ANGLE_texture_compression_dxt3, ANGLE_texture_compression_dxt5, + ANGLE_timer_query, ANGLE_translated_shader_source, APPLE_texture_format_BGRA8888, @@ -417,10 +420,13 @@ namespace bgfx EXT_blend_color, EXT_blend_minmax, EXT_blend_subtract, + EXT_color_buffer_half_float, + EXT_color_buffer_float, EXT_compressed_ETC1_RGB8_sub_texture, EXT_debug_label, EXT_debug_marker, EXT_discard_framebuffer, + EXT_disjoint_timer_query, EXT_draw_buffers, EXT_frag_depth, EXT_framebuffer_blit, @@ -491,10 +497,12 @@ namespace bgfx OES_vertex_half_float, OES_vertex_type_10_10_10_2, + WEBGL_color_buffer_float, WEBGL_compressed_texture_etc1, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_pvrtc, WEBGL_depth_texture, + WEBGL_draw_buffers, WEBKIT_EXT_texture_filter_anisotropic, WEBKIT_WEBGL_compressed_texture_s3tc, @@ -508,7 +516,27 @@ namespace bgfx bool m_initialize; }; - static Extension s_extension[Extension::Count] = + // Extension registry + // + // ANGLE: + // https://github.com/google/angle/tree/master/extensions + // + // CHROMIUM: + // https://chromium.googlesource.com/chromium/src.git/+/refs/heads/git-svn/gpu/GLES2/extensions/CHROMIUM + // + // EGL: + // https://www.khronos.org/registry/egl/extensions/ + // + // GL: + // https://www.opengl.org/registry/ + // + // GLES: + // https://www.khronos.org/registry/gles/extensions/ + // + // WEBGL: + // https://www.khronos.org/registry/webgl/extensions/ + // + static Extension s_extension[] = { { "AMD_conservative_depth", false, true }, @@ -519,6 +547,7 @@ namespace bgfx { "ANGLE_texture_compression_dxt1", false, true }, { "ANGLE_texture_compression_dxt3", false, true }, { "ANGLE_texture_compression_dxt5", false, true }, + { "ANGLE_timer_query", false, true }, { "ANGLE_translated_shader_source", false, true }, { "APPLE_texture_format_BGRA8888", false, true }, @@ -578,10 +607,13 @@ namespace bgfx { "EXT_blend_color", BGFX_CONFIG_RENDERER_OPENGL >= 31, true }, { "EXT_blend_minmax", BGFX_CONFIG_RENDERER_OPENGL >= 14, true }, { "EXT_blend_subtract", BGFX_CONFIG_RENDERER_OPENGL >= 14, true }, + { "EXT_color_buffer_half_float", false, true }, // GLES2 extension. + { "EXT_color_buffer_float", false, true }, // GLES2 extension. { "EXT_compressed_ETC1_RGB8_sub_texture", false, true }, // GLES2 extension. { "EXT_debug_label", false, true }, { "EXT_debug_marker", false, true }, { "EXT_discard_framebuffer", false, true }, // GLES2 extension. + { "EXT_disjoint_timer_query", false, true }, // GLES2 extension. { "EXT_draw_buffers", false, true }, // GLES2 extension. { "EXT_frag_depth", false, true }, // GLES2 extension. { "EXT_framebuffer_blit", BGFX_CONFIG_RENDERER_OPENGL >= 30, true }, @@ -605,7 +637,7 @@ namespace bgfx { "EXT_texture_storage", false, true }, { "EXT_texture_swizzle", false, true }, { "EXT_texture_type_2_10_10_10_REV", false, true }, - { "EXT_timer_query", false, true }, + { "EXT_timer_query", BGFX_CONFIG_RENDERER_OPENGL >= 33, true }, { "EXT_unpack_subimage", false, true }, { "GOOGLE_depth_texture", false, true }, @@ -652,15 +684,18 @@ namespace bgfx { "OES_vertex_half_float", false, true }, { "OES_vertex_type_10_10_10_2", false, true }, + { "WEBGL_color_buffer_float", false, true }, { "WEBGL_compressed_texture_etc1", false, true }, { "WEBGL_compressed_texture_s3tc", false, true }, { "WEBGL_compressed_texture_pvrtc", false, true }, { "WEBGL_depth_texture", false, true }, + { "WEBGL_draw_buffers", false, true }, { "WEBKIT_EXT_texture_filter_anisotropic", false, true }, { "WEBKIT_WEBGL_compressed_texture_s3tc", false, true }, { "WEBKIT_WEBGL_depth_texture", false, true }, }; + BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) ); static const char* s_ARB_shader_texture_lod[] = { @@ -915,6 +950,15 @@ namespace bgfx return 0 == err; } + static void getFilters(uint32_t _flags, bool _hasMips, GLenum& _magFilter, GLenum& _minFilter) + { + const uint32_t mag = (_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT; + const uint32_t min = (_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT; + const uint32_t mip = (_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT; + _magFilter = s_textureFilterMag[mag]; + _minFilter = s_textureFilterMin[min][_hasMips ? mip+1 : 0]; + } + struct RendererContextGL : public RendererContextI { RendererContextGL() @@ -933,6 +977,7 @@ namespace bgfx , m_programBinarySupport(false) , m_textureSwizzleSupport(false) , m_depthTextureSupport(false) + , m_timerQuerySupport(false) , m_flip(false) , m_hash( (BX_PLATFORM_WINDOWS<<1) | BX_ARCH_64BIT) , m_backBufferFbo(0) @@ -1094,6 +1139,9 @@ namespace bgfx } } + // Allow all texture filters. + memset(s_textureFilter, true, BX_COUNTOF(s_textureFilter) ); + bool bc123Supported = 0 || s_extension[Extension::EXT_texture_compression_s3tc ].m_supported || s_extension[Extension::MOZ_WEBGL_compressed_texture_s3tc ].m_supported @@ -1186,6 +1234,23 @@ namespace bgfx { setTextureFormat(TextureFormat::RGBA16F, GL_RGBA, GL_RGBA, GL_HALF_FLOAT); + if (s_extension[Extension::OES_texture_half_float].m_supported + || s_extension[Extension::OES_texture_float ].m_supported) + { + // https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt + // When half/float is available via extensions texture will be marked as + // incomplete if it uses anything other than nearest filter. + const bool linear16F = s_extension[Extension::OES_texture_half_float_linear].m_supported; + const bool linear32F = s_extension[Extension::OES_texture_float_linear ].m_supported; + + s_textureFilter[TextureFormat::R16F] = linear16F; + s_textureFilter[TextureFormat::RG16F] = linear16F; + s_textureFilter[TextureFormat::RGBA16F] = linear16F; + s_textureFilter[TextureFormat::R32F] = linear32F; + s_textureFilter[TextureFormat::RG32F] = linear32F; + s_textureFilter[TextureFormat::RGBA32F] = linear32F; + } + if (BX_ENABLED(BX_PLATFORM_IOS) ) { setTextureFormat(TextureFormat::D16, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT); @@ -1294,7 +1359,8 @@ namespace bgfx if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) - || s_extension[Extension::EXT_draw_buffers].m_supported) + || s_extension[Extension::EXT_draw_buffers ].m_supported + || s_extension[Extension::WEBGL_draw_buffers].m_supported) { g_caps.maxFBAttachments = bx::uint32_min(glGet(GL_MAX_COLOR_ATTACHMENTS), BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS); } @@ -1306,7 +1372,8 @@ namespace bgfx if (BX_ENABLED(BX_PLATFORM_NACL) ) { - m_vaoSupport &= NULL != glGenVertexArrays + m_vaoSupport &= true + && NULL != glGenVertexArrays && NULL != glDeleteVertexArrays && NULL != glBindVertexArray ; @@ -1346,6 +1413,15 @@ namespace bgfx || s_extension[Extension::WEBKIT_WEBGL_depth_texture].m_supported ; + m_timerQuerySupport = 0 + || s_extension[Extension::ANGLE_timer_query ].m_supported + || s_extension[Extension::ARB_timer_query ].m_supported + || s_extension[Extension::EXT_disjoint_timer_query].m_supported + || s_extension[Extension::EXT_timer_query ].m_supported + ; + + m_timerQuerySupport &= NULL != glGetQueryObjectui64v; + g_caps.supported |= m_depthTextureSupport ? BGFX_CAPS_TEXTURE_COMPARE_LEQUAL : 0 @@ -1455,7 +1531,8 @@ namespace bgfx glInvalidateFramebuffer = stubInvalidateFramebuffer; } - if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) ) + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) + && m_timerQuerySupport) { m_queries.create(); } @@ -1485,7 +1562,8 @@ namespace bgfx invalidateCache(); - if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) ) + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) + && m_timerQuerySupport) { m_queries.destroy(); } @@ -2047,16 +2125,25 @@ namespace bgfx { sampler = m_samplerStateCache.add(_flags); - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT]) ); - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_WRAP_T, s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT]) ); - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_WRAP_R, s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT]) ); + GL_CHECK(glSamplerParameteri(sampler + , GL_TEXTURE_WRAP_S + , s_textureAddress[(_flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT] + ) ); + GL_CHECK(glSamplerParameteri(sampler + , GL_TEXTURE_WRAP_T + , s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT] + ) ); + GL_CHECK(glSamplerParameteri(sampler + , GL_TEXTURE_WRAP_R + , s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT] + ) ); - const uint32_t mag = (_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT; - const uint32_t min = (_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT; - const uint32_t mip = (_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT; - GLenum minFilter = s_textureFilterMin[min][1 < _numMips ? mip+1 : 0]; - GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, s_textureFilterMag[mag]) ); + GLenum minFilter; + GLenum magFilter; + getFilters(_flags, 1 < _numMips, magFilter, minFilter); + GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, magFilter) ); GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, minFilter) ); + if (0 != (_flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) && 0.0f < m_maxAnisotropy) { @@ -2557,6 +2644,7 @@ namespace bgfx bool m_programBinarySupport; bool m_textureSwizzleSupport; bool m_depthTextureSupport; + bool m_timerQuerySupport; bool m_flip; uint64_t m_hash; @@ -2579,14 +2667,14 @@ namespace bgfx RendererContextGL* s_renderGL; - RendererContextI* rendererCreateGL() + RendererContextI* rendererCreate() { s_renderGL = BX_NEW(g_allocator, RendererContextGL); s_renderGL->init(); return s_renderGL; } - void rendererDestroyGL() + void rendererDestroy() { s_renderGL->shutdown(); BX_DELETE(g_allocator, s_renderGL); @@ -2662,6 +2750,7 @@ namespace bgfx GLENUM(GL_RENDERBUFFER); GLENUM(GL_INVALID_ENUM); + GLENUM(GL_INVALID_FRAMEBUFFER_OPERATION); GLENUM(GL_INVALID_VALUE); GLENUM(GL_INVALID_OPERATION); GLENUM(GL_OUT_OF_MEMORY); @@ -2861,20 +2950,20 @@ namespace bgfx m_numPredefined = 0; m_numSamplers = 0; - struct VariableInfo - { - GLenum type; - GLint loc; - GLint num; - }; - VariableInfo vi; - GLenum props[] = { GL_TYPE, GL_LOCATION, GL_ARRAY_SIZE }; - const bool piqSupported = s_extension[Extension::ARB_program_interface_query].m_supported; BX_TRACE("Uniforms (%d):", activeUniforms); for (int32_t ii = 0; ii < activeUniforms; ++ii) { + struct VariableInfo + { + GLenum type; + GLint loc; + GLint num; + }; + VariableInfo vi; + GLenum props[] ={ GL_TYPE, GL_LOCATION, GL_ARRAY_SIZE }; + GLenum gltype; GLint num; GLint loc; @@ -3202,10 +3291,8 @@ namespace bgfx BX_CHECK(0 != m_id, "Failed to generate texture id."); GL_CHECK(glBindTexture(_target, m_id) ); - setSamplerState(_flags); - const TextureFormatInfo& tfi = s_textureFormat[_format]; - m_fmt = tfi.m_fmt; + m_fmt = tfi.m_fmt; m_type = tfi.m_type; const bool compressed = isCompressed(TextureFormat::Enum(_format) ); @@ -3214,11 +3301,13 @@ namespace bgfx if (decompress) { m_textureFormat = (uint8_t)TextureFormat::BGRA8; - const TextureFormatInfo& tfi = s_textureFormat[TextureFormat::BGRA8]; - m_fmt = tfi.m_fmt; - m_type = tfi.m_type; + const TextureFormatInfo& tfiBgra8 = s_textureFormat[TextureFormat::BGRA8]; + m_fmt = tfiBgra8.m_fmt; + m_type = tfiBgra8.m_type; } + setSamplerState(_flags); + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) && TextureFormat::BGRA8 == m_textureFormat && GL_RGBA == m_fmt @@ -3583,6 +3672,22 @@ namespace bgfx void TextureGL::setSamplerState(uint32_t _flags) { + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30) + && !s_textureFilter[m_textureFormat]) + { + // Force point sampling when texture format doesn't support linear sampling. + _flags &= 0 + | BGFX_TEXTURE_MIN_MASK + | BGFX_TEXTURE_MAG_MASK + | BGFX_TEXTURE_MIP_MASK + ; + _flags |= 0 + | BGFX_TEXTURE_MIN_POINT + | BGFX_TEXTURE_MAG_POINT + | BGFX_TEXTURE_MIP_POINT + ; + } + const uint32_t flags = (0 != (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ? m_flags : _flags) & BGFX_TEXTURE_SAMPLER_BITS_MASK; if (flags != m_currentFlags) { @@ -3603,11 +3708,10 @@ namespace bgfx GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_R, s_textureAddress[(flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT]) ); } - const uint32_t mag = (flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT; - const uint32_t min = (flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT; - const uint32_t mip = (flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT; - const GLenum minFilter = s_textureFilterMin[min][1 < numMips ? mip+1 : 0]; - GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, s_textureFilterMag[mag]) ); + GLenum magFilter; + GLenum minFilter; + getFilters(flags, 1 < numMips, magFilter, minFilter); + GL_CHECK(glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilter) ); GL_CHECK(glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter) ); if (0 != (flags & (BGFX_TEXTURE_MIN_ANISOTROPIC|BGFX_TEXTURE_MAG_ANISOTROPIC) ) && 0.0f < s_renderGL->m_maxAnisotropy) @@ -3794,7 +3898,10 @@ namespace bgfx if (usesFragData) { - BX_WARN(s_extension[Extension::EXT_draw_buffers].m_supported, "EXT_draw_buffers is used but not supported by GLES2 driver."); + BX_WARN(s_extension[Extension::EXT_draw_buffers ].m_supported + || s_extension[Extension::WEBGL_draw_buffers].m_supported + , "EXT_draw_buffers is used but not supported by GLES2 driver." + ); writeString(&writer , "#extension GL_EXT_draw_buffers : enable\n" ); @@ -3995,9 +4102,9 @@ namespace bgfx { for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii) { - char temp[16]; - bx::snprintf(temp, BX_COUNTOF(temp), "gl_FragData[%d]", ii); - fragData = bx::uint32_max(fragData, NULL == strstr(code, temp) ? 0 : ii+1); + char tmpFragData[16]; + bx::snprintf(tmpFragData, BX_COUNTOF(tmpFragData), "gl_FragData[%d]", ii); + fragData = bx::uint32_max(fragData, NULL == strstr(code, tmpFragData) ? 0 : ii+1); } BGFX_FATAL(0 != fragData, Fatal::InvalidShader, "Unable to find and patch gl_FragData!"); @@ -4197,7 +4304,8 @@ namespace bgfx GL_CHECK(glGenFramebuffers(1, &m_fbo[1]) ); GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo[1]) ); - for (uint32_t ii = 0, colorIdx = 0; ii < _num; ++ii) + colorIdx = 0; + for (uint32_t ii = 0; ii < _num; ++ii) { TextureHandle handle = _handles[ii]; if (isValid(handle) ) @@ -4345,7 +4453,8 @@ namespace bgfx int64_t captureElapsed = 0; if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) - && (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) ) + && (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) + && m_timerQuerySupport) { m_queries.begin(0, GL_TIME_ELAPSED); } @@ -4390,8 +4499,11 @@ namespace bgfx ; uint32_t blendFactor = 0; - const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; - uint8_t primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + uint8_t primIndex; + { + const uint64_t pt = _render->m_debug&BGFX_DEBUG_WIREFRAME ? BGFX_STATE_PT_LINES : 0; + primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT); + } PrimInfo prim = s_primInfo[primIndex]; uint32_t baseVertex = 0; @@ -4410,6 +4522,7 @@ namespace bgfx uint32_t statsNumPrimsRendered[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumInstances[BX_COUNTOF(s_primInfo)] = {}; uint32_t statsNumIndices = 0; + uint32_t statsKeyType[2] = {}; if (0 == (_render->m_debug&BGFX_DEBUG_IFH) ) { @@ -4424,6 +4537,8 @@ namespace bgfx for (int32_t item = 0, restartItem = numItems; item < numItems || restartItem < numItems;) { const bool isCompute = key.decode(_render->m_sortKeys[item], _render->m_viewRemap); + statsKeyType[isCompute]++; + const bool viewChanged = 0 || key.m_view != view || item == numItems @@ -4783,16 +4898,15 @@ namespace bgfx && blendIndependentSupported ; - const uint32_t blend = uint32_t( (newFlags&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT); - const uint32_t equation = uint32_t( (newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT); - - const uint32_t srcRGB = (blend )&0xf; - const uint32_t dstRGB = (blend>> 4)&0xf; - const uint32_t srcA = (blend>> 8)&0xf; - const uint32_t dstA = (blend>>12)&0xf; + const uint32_t blend = uint32_t( (newFlags&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT); + const uint32_t srcRGB = (blend )&0xf; + const uint32_t dstRGB = (blend>> 4)&0xf; + const uint32_t srcA = (blend>> 8)&0xf; + const uint32_t dstA = (blend>>12)&0xf; - const uint32_t equRGB = (equation )&0x7; - const uint32_t equA = (equation>>3)&0x7; + const uint32_t equ = uint32_t((newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT); + const uint32_t equRGB = (equ )&0x7; + const uint32_t equA = (equ>>3)&0x7; const uint32_t numRt = getNumRt(); @@ -4974,7 +5088,6 @@ namespace bgfx currentVao = id; GL_CHECK(glBindVertexArray(id) ); - ProgramGL& program = m_program[programIdx]; program.add(hash); if (isValid(draw.m_vertexBuffer) ) @@ -5072,7 +5185,6 @@ namespace bgfx baseVertex = draw.m_startVertex; const VertexBufferGL& vb = m_vertexBuffers[draw.m_vertexBuffer.idx]; uint16_t decl = !isValid(vb.m_decl) ? draw.m_vertexDecl.idx : vb.m_decl.idx; - const ProgramGL& program = m_program[programIdx]; program.bindAttributes(m_vertexDecls[decl], draw.m_startVertex); if (isValid(draw.m_instanceDataBuffer) ) @@ -5178,11 +5290,14 @@ namespace bgfx if (_render->m_debug & (BGFX_DEBUG_IFH|BGFX_DEBUG_STATS) ) { double elapsedGpuMs = 0.0; -#if BGFX_CONFIG_RENDERER_OPENGL - m_queries.end(GL_TIME_ELAPSED); - uint64_t elapsedGl = m_queries.getResult(0); - elapsedGpuMs = double(elapsedGl)/1e6; -#endif // BGFX_CONFIG_RENDERER_OPENGL + uint64_t elapsedGl = 0; + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) + && m_timerQuerySupport) + { + m_queries.end(GL_TIME_ELAPSED); + elapsedGl = m_queries.getResult(0); + elapsedGpuMs = double(elapsedGl)/1e6; + } TextVideoMem& tvm = m_textVideoMem; @@ -5225,15 +5340,17 @@ namespace bgfx ); double elapsedCpuMs = double(elapsed)*toMs; - tvm.printf(10, pos++, 0x8e, " Draw calls: %4d / CPU %3.4f [ms] %c GPU %3.4f [ms]" + tvm.printf(10, pos++, 0x8e, " Submitted: %4d (draw %4d, compute %4d) / CPU %3.4f [ms] %c GPU %3.4f [ms]" , _render->m_num + , statsKeyType[0] + , statsKeyType[1] , elapsedCpuMs , elapsedCpuMs > elapsedGpuMs ? '>' : '<' , elapsedGpuMs ); for (uint32_t ii = 0; ii < BX_COUNTOF(s_primInfo); ++ii) { - tvm.printf(10, pos++, 0x8e, " %8s: %7d (#inst: %5d), submitted: %7d" + tvm.printf(10, pos++, 0x8e, " %9s: %7d (#inst: %5d), submitted: %7d" , s_primName[ii] , statsNumPrimsRendered[ii] , statsNumInstances[ii] @@ -5246,9 +5363,9 @@ namespace bgfx tvm.printf(tvm.m_width-27, 0, 0x1f, " [F11 - RenderDoc capture] "); } - tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices); - tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset); - tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset); + tvm.printf(10, pos++, 0x8e, " Indices: %7d", statsNumIndices); + tvm.printf(10, pos++, 0x8e, " DVB size: %7d", _render->m_vboffset); + tvm.printf(10, pos++, 0x8e, " DIB size: %7d", _render->m_iboffset); pos++; tvm.printf(10, pos++, 0x8e, " State cache: "); @@ -5354,21 +5471,21 @@ namespace bgfx GL_CHECK(glFrameTerminatorGREMEDY() ); } -} // namespace bgfx +} } // namespace bgfx #else -namespace bgfx +namespace bgfx { namespace gl { - RendererContextI* rendererCreateGL() + RendererContextI* rendererCreate() { return NULL; } - void rendererDestroyGL() + void rendererDestroy() { } -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // (BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_OPENGL) diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h index 9160fbfe44f..65dae432203 100644 --- a/3rdparty/bgfx/src/renderer_gl.h +++ b/3rdparty/bgfx/src/renderer_gl.h @@ -611,6 +611,10 @@ typedef uint64_t GLuint64; namespace bgfx { class ConstantBuffer; +} // namespace bgfx + +namespace bgfx { namespace gl +{ void dumpExtensions(const char* _extensions); const char* glEnumName(GLenum _enum); @@ -619,9 +623,9 @@ namespace bgfx BX_MACRO_BLOCK_BEGIN \ /*BX_TRACE(#_call);*/ \ _call; \ - GLenum err = glGetError(); \ - _check(0 == err, #_call "; GL error 0x%x: %s", err, glEnumName(err) ); \ - BX_UNUSED(err); \ + GLenum gl_err = glGetError(); \ + _check(0 == gl_err, #_call "; GL error 0x%x: %s", gl_err, glEnumName(gl_err) ); \ + BX_UNUSED(gl_err); \ BX_MACRO_BLOCK_END #define IGNORE_GL_ERROR_CHECK(...) BX_NOOP() @@ -1001,6 +1005,6 @@ namespace bgfx GLuint m_queries[64]; }; -} // namespace bgfx +} /* namespace gl */ } // namespace bgfx #endif // BGFX_RENDERER_GL_H_HEADER_GUARD diff --git a/3rdparty/bgfx/src/renderer_null.cpp b/3rdparty/bgfx/src/renderer_null.cpp index cde647bf979..76cd0fadb13 100644 --- a/3rdparty/bgfx/src/renderer_null.cpp +++ b/3rdparty/bgfx/src/renderer_null.cpp @@ -7,7 +7,7 @@ #if BGFX_CONFIG_RENDERER_NULL -namespace bgfx +namespace bgfx { namespace noop { struct RendererContextNULL : public RendererContextI { @@ -168,31 +168,31 @@ namespace bgfx static RendererContextNULL* s_renderNULL; - RendererContextI* rendererCreateNULL() + RendererContextI* rendererCreate() { s_renderNULL = BX_NEW(g_allocator, RendererContextNULL); return s_renderNULL; } - void rendererDestroyNULL() + void rendererDestroy() { BX_DELETE(g_allocator, s_renderNULL); s_renderNULL = NULL; } -} // namespace bgfx +} /* namespace noop */ } // namespace bgfx #else -namespace bgfx +namespace bgfx { namespace noop { - RendererContextI* rendererCreateNULL() + RendererContextI* rendererCreate() { return NULL; } - void rendererDestroyNULL() + void rendererDestroy() { } -} // namespace bgfx +} /* namespace noop */ } // namespace bgfx #endif // BGFX_CONFIG_RENDERER_NULL diff --git a/3rdparty/bgfx/src/renderer_vk.cpp b/3rdparty/bgfx/src/renderer_vk.cpp index 809a0c8ec1e..e2ff8cdfe7a 100644 --- a/3rdparty/bgfx/src/renderer_vk.cpp +++ b/3rdparty/bgfx/src/renderer_vk.cpp @@ -8,16 +8,16 @@ # include "../../vk/src/renderer_vk.cpp" #else -namespace bgfx +namespace bgfx { namespace vk { - RendererContextI* rendererCreateVK() + RendererContextI* rendererCreate() { return NULL; } - void rendererDestroyVK() + void rendererDestroy() { } -} // namespace bgfx +} /* namespace vk */ } // namespace bgfx #endif // BGFX_CONFIG_RENDERER_VULKAN diff --git a/3rdparty/bgfx/tools/geometryc/geometryc.cpp b/3rdparty/bgfx/tools/geometryc/geometryc.cpp index 23ecb1088c8..f748e5c797a 100644 --- a/3rdparty/bgfx/tools/geometryc/geometryc.cpp +++ b/3rdparty/bgfx/tools/geometryc/geometryc.cpp @@ -504,11 +504,14 @@ int main(int _argc, const char* _argv[]) Triangle triangle; memset(&triangle, 0, sizeof(Triangle) ); + const int numNormals = (int)normals.size(); + const int numTexcoords = (int)texcoords.size(); + const int numPositions = (int)positions.size(); for (uint32_t edge = 0, numEdges = argc-1; edge < numEdges; ++edge) { Index3 index; - index.m_texcoord = -1; - index.m_normal = -1; + index.m_texcoord = 0; + index.m_normal = 0; index.m_vertexIndex = -1; char* vertex = argv[edge+1]; @@ -521,13 +524,16 @@ int main(int _argc, const char* _argv[]) if (NULL != normal) { *normal++ = '\0'; - index.m_normal = atoi(normal)-1; + const int nn = atoi(normal); + index.m_normal = (nn < 0) ? nn+numNormals : nn-1; } - index.m_texcoord = atoi(texcoord)-1; + const int tex = atoi(texcoord); + index.m_texcoord = (tex < 0) ? tex+numTexcoords : tex-1; } - index.m_position = atoi(vertex)-1; + const int pos = atoi(vertex); + index.m_position = (pos < 0) ? pos+numPositions : pos-1; uint64_t hash0 = index.m_position; uint64_t hash1 = uint64_t(index.m_texcoord)<<20; @@ -710,8 +716,8 @@ int main(int _argc, const char* _argv[]) bool hasTexcoord; { Index3Map::const_iterator it = indexMap.begin(); - hasNormal = -1 != it->second.m_normal; - hasTexcoord = -1 != it->second.m_texcoord; + hasNormal = 0 != it->second.m_normal; + hasTexcoord = 0 != it->second.m_texcoord; if (!hasTexcoord && texcoords.size() == positions.size() ) diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.cpp b/3rdparty/bgfx/tools/shaderc/shaderc.cpp index a4a42af5af6..f25a03823df 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc.cpp @@ -845,7 +845,7 @@ int main(int _argc, const char* _argv[]) preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX"); char glslDefine[128]; - bx::snprintf(glslDefine, BX_COUNTOF(glslDefine), "BGFX_SHADER_LANGUAGE_GLSL=%d", glsl); + bx::snprintf(glslDefine, BX_COUNTOF(glslDefine), "BGFX_SHADER_LANGUAGE_GLSL=%d", essl ? 1 : glsl); if (0 == bx::stricmp(platform, "android") ) { @@ -972,9 +972,9 @@ int main(int _argc, const char* _argv[]) const char* name = parse = bx::strws(bx::strword(parse) ); const char* column = parse = bx::strws(bx::strword(parse) ); - const char* semantics = parse = bx::strws(bx::strnws (parse) ); + const char* semantics = parse = bx::strws((*parse == ':' ? ++parse : parse)); const char* assign = parse = bx::strws(bx::strword(parse) ); - const char* init = parse = bx::strws(bx::strnws (parse) ); + const char* init = parse = bx::strws((*parse == '=' ? ++parse : parse)); if (type < eol && name < eol @@ -1155,7 +1155,8 @@ int main(int _argc, const char* _argv[]) } else { - if (0 != glsl) + if (0 != glsl + || 0 != essl) { } else @@ -1269,7 +1270,8 @@ int main(int _argc, const char* _argv[]) bx::write(writer, BGFX_CHUNK_MAGIC_CSH); bx::write(writer, outputHash); - if (0 != glsl) + if (0 != glsl + || 0 != essl) { std::string code; @@ -1338,10 +1340,11 @@ int main(int _argc, const char* _argv[]) } else { - if (0 != glsl) + if (0 != glsl + || 0 != essl) { if (120 == glsl - || essl) + || 0 != essl) { preprocessor.writef( "#define ivec2 vec2\n" @@ -1700,7 +1703,8 @@ int main(int _argc, const char* _argv[]) bx::write(writer, outputHash); } - if (0 != glsl) + if (0 != glsl + || 0 != essl) { std::string code; diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_dx11.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_dx11.cpp index d9ffab61102..e1f0d90ec10 100644 --- a/3rdparty/bgfx/tools/shaderc/shaderc_dx11.cpp +++ b/3rdparty/bgfx/tools/shaderc/shaderc_dx11.cpp @@ -8,6 +8,13 @@ #if SHADERC_CONFIG_DIRECT3D11 #include <d3dcompiler.h> +#include <d3d11shader.h> + +#ifndef D3D_SVF_USED +# define D3D_SVF_USED 2 +#endif // D3D_SVF_USED + +static const GUID GUID_ID3D11ShaderReflection = { 0x0a233719, 0x3960, 0x4578, { 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1 } }; struct RemapInputSemantic { @@ -202,7 +209,7 @@ bool compileHLSLShaderDx11(bx::CommandLine& _cmdLine, const std::string& _code, ID3D11ShaderReflection* reflect = NULL; hr = D3DReflect(code->GetBufferPointer() , code->GetBufferSize() - , IID_ID3D11ShaderReflection + , GUID_ID3D11ShaderReflection , (void**)&reflect ); if (FAILED(hr) ) @@ -370,7 +377,7 @@ bool compileHLSLShaderDx11(bx::CommandLine& _cmdLine, const std::string& _code, ID3DBlob* stripped; hr = D3DStripShader(code->GetBufferPointer() , code->GetBufferSize() - , D3DCOMPILER_STRIP_REFLECTION_DATA + , D3DCOMPILER_STRIP_REFLECTION_DATA | D3DCOMPILER_STRIP_TEST_BLOBS , &stripped ); @@ -437,4 +444,4 @@ bool compileHLSLShaderDx11(bx::CommandLine& _cmdLine, const std::string& _code, return false; } -#endif // SHADERC_CONFIG_DIRECT3D11
\ No newline at end of file +#endif // SHADERC_CONFIG_DIRECT3D11 diff --git a/3rdparty/bx/include/bx/handlealloc.h b/3rdparty/bx/include/bx/handlealloc.h index 25e250ec135..41dbd4fd142 100644 --- a/3rdparty/bx/include/bx/handlealloc.h +++ b/3rdparty/bx/include/bx/handlealloc.h @@ -71,7 +71,9 @@ namespace bx uint16_t* sparse = &m_handles[MaxHandlesT]; uint16_t index = sparse[_handle]; - return (index < m_numHandles && m_handles[index] == _handle); + return index < m_numHandles + && m_handles[index] == _handle + ; } void free(uint16_t _handle) diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h index c3eda5f4123..08b31bf787f 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -218,7 +218,9 @@ BX_STRINGIZE(__clang_minor__) "." \ BX_STRINGIZE(__clang_patchlevel__) #elif BX_COMPILER_MSVC -# if BX_COMPILER_MSVC >= 1800 +# if BX_COMPILER_MSVC >= 1900 +# define BX_COMPILER_NAME "MSVC 14.0" +# elif BX_COMPILER_MSVC >= 1800 # define BX_COMPILER_NAME "MSVC 12.0" # elif BX_COMPILER_MSVC >= 1700 # define BX_COMPILER_NAME "MSVC 11.0" diff --git a/3rdparty/bx/include/bx/radixsort.h b/3rdparty/bx/include/bx/radixsort.h index 56c59f3ecc5..5f37a269c9d 100644 --- a/3rdparty/bx/include/bx/radixsort.h +++ b/3rdparty/bx/include/bx/radixsort.h @@ -30,14 +30,16 @@ namespace bx memset(histogram, 0, sizeof(uint16_t)*BX_RADIXSORT_HISTOGRAM_SIZE); bool sorted = true; - uint32_t key = keys[0]; - uint32_t prevKey = key; - for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) { - key = keys[ii]; - uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; - ++histogram[index]; - sorted &= prevKey <= key; + uint32_t key = keys[0]; + uint32_t prevKey = key; + for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) + { + key = keys[ii]; + uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; + ++histogram[index]; + sorted &= prevKey <= key; + } } if (sorted) @@ -101,14 +103,16 @@ done: memset(histogram, 0, sizeof(uint16_t)*BX_RADIXSORT_HISTOGRAM_SIZE); bool sorted = true; - uint64_t key = keys[0]; - uint64_t prevKey = key; - for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) { - key = keys[ii]; - uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; - ++histogram[index]; - sorted &= prevKey <= key; + uint64_t key = keys[0]; + uint64_t prevKey = key; + for (uint32_t ii = 0; ii < _size; ++ii, prevKey = key) + { + key = keys[ii]; + uint16_t index = (key>>shift)&BX_RADIXSORT_BIT_MASK; + ++histogram[index]; + sorted &= prevKey <= key; + } } if (sorted) diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 85f24e10746..2d3f0817c7b 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -19,6 +19,7 @@ function toolchain(_buildDir, _libDir) { "asmjs", "Emscripten/asm.js" }, { "freebsd", "FreeBSD" }, { "linux-gcc", "Linux (GCC compiler)" }, + { "linux-gcc-5", "Linux (GCC-5 compiler)" }, { "linux-clang", "Linux (Clang compiler)" }, { "ios-arm", "iOS - ARM" }, { "ios-simulator", "iOS - Simulator" }, @@ -40,8 +41,9 @@ function toolchain(_buildDir, _libDir) allowed = { { "vs2012-clang", "Clang 3.6" }, { "vs2013-clang", "Clang 3.6" }, - { "vs2012-xp", "Visual Studio 2012 targeting XP" }, - { "vs2013-xp", "Visual Studio 2013 targeting XP" }, + { "vs2012-xp", "Visual Studio 2012 targeting XP" }, + { "vs2013-xp", "Visual Studio 2013 targeting XP" }, + { "vs2015-xp", "Visual Studio 2015 targeting XP" }, { "winphone8", "Windows Phone 8.0" }, { "winphone81", "Windows Phone 8.1" }, }, @@ -110,9 +112,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++" premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar" location (path.join(_buildDir, "projects", _ACTION .. "-android-arm")) - end - if "android-mips" == _OPTIONS["gcc"] then + elseif "android-mips" == _OPTIONS["gcc"] then if not os.getenv("ANDROID_NDK_MIPS") or not os.getenv("ANDROID_NDK_ROOT") then print("Set ANDROID_NDK_MIPS and ANDROID_NDK_ROOT envrionment variables.") @@ -122,9 +123,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-g++" premake.gcc.ar = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar" location (path.join(_buildDir, "projects", _ACTION .. "-android-mips")) - end - if "android-x86" == _OPTIONS["gcc"] then + elseif "android-x86" == _OPTIONS["gcc"] then if not os.getenv("ANDROID_NDK_X86") or not os.getenv("ANDROID_NDK_ROOT") then print("Set ANDROID_NDK_X86 and ANDROID_NDK_ROOT envrionment variables.") @@ -134,9 +134,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = "$(ANDROID_NDK_X86)/bin/i686-linux-android-g++" premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar" location (path.join(_buildDir, "projects", _ACTION .. "-android-x86")) - end - if "asmjs" == _OPTIONS["gcc"] then + elseif "asmjs" == _OPTIONS["gcc"] then if not os.getenv("EMSCRIPTEN") then print("Set EMSCRIPTEN enviroment variables.") @@ -147,54 +146,52 @@ function toolchain(_buildDir, _libDir) premake.gcc.ar = "$(EMSCRIPTEN)/emar" premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-asmjs")) - end - if "freebsd" == _OPTIONS["gcc"] then + elseif "freebsd" == _OPTIONS["gcc"] then location (path.join(_buildDir, "projects", _ACTION .. "-freebsd")) - end - if "ios-arm" == _OPTIONS["gcc"] then + elseif "ios-arm" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" premake.gcc.ar = "ar" location (path.join(_buildDir, "projects", _ACTION .. "-ios-arm")) - end - if "ios-simulator" == _OPTIONS["gcc"] then + elseif "ios-simulator" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" premake.gcc.ar = "ar" location (path.join(_buildDir, "projects", _ACTION .. "-ios-simulator")) - end - if "linux-gcc" == _OPTIONS["gcc"] then + elseif "linux-gcc" == _OPTIONS["gcc"] then + location (path.join(_buildDir, "projects", _ACTION .. "-linux")) + + elseif "linux-gcc-5" == _OPTIONS["gcc"] then + premake.gcc.cc = "gcc-5" + premake.gcc.cxx = "g++-5" + premake.gcc.ar = "ar" location (path.join(_buildDir, "projects", _ACTION .. "-linux")) - end - if "linux-clang" == _OPTIONS["gcc"] then + elseif "linux-clang" == _OPTIONS["gcc"] then premake.gcc.cc = "clang" premake.gcc.cxx = "clang++" premake.gcc.ar = "ar" location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang")) - end - if "mingw-gcc" == _OPTIONS["gcc"] then + elseif "mingw-gcc" == _OPTIONS["gcc"] then premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc" premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++" premake.gcc.ar = "$(MINGW)/bin/ar" location (path.join(_buildDir, "projects", _ACTION .. "-mingw-gcc")) - end - if "mingw-clang" == _OPTIONS["gcc"] then + elseif "mingw-clang" == _OPTIONS["gcc"] then premake.gcc.cc = "$(CLANG)/bin/clang" premake.gcc.cxx = "$(CLANG)/bin/clang++" premake.gcc.ar = "$(MINGW)/bin/ar" -- premake.gcc.ar = "$(CLANG)/bin/llvm-ar" -- premake.gcc.llvm = true location (path.join(_buildDir, "projects", _ACTION .. "-mingw-clang")) - end - if "nacl" == _OPTIONS["gcc"] then + elseif "nacl" == _OPTIONS["gcc"] then if not os.getenv("NACL_SDK_ROOT") then print("Set NACL_SDK_ROOT enviroment variables.") @@ -211,9 +208,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = naclToolchain .. "g++" premake.gcc.ar = naclToolchain .. "ar" location (path.join(_buildDir, "projects", _ACTION .. "-nacl")) - end - if "nacl-arm" == _OPTIONS["gcc"] then + elseif "nacl-arm" == _OPTIONS["gcc"] then if not os.getenv("NACL_SDK_ROOT") then print("Set NACL_SDK_ROOT enviroment variables.") @@ -230,9 +226,9 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = naclToolchain .. "g++" premake.gcc.ar = naclToolchain .. "ar" location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm")) - end - if "osx" == _OPTIONS["gcc"] then + elseif "osx" == _OPTIONS["gcc"] then + if os.is("linux") then local osxToolchain = "x86_64-apple-darwin13-" premake.gcc.cc = osxToolchain .. "clang" @@ -240,9 +236,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.ar = osxToolchain .. "ar" end location (path.join(_buildDir, "projects", _ACTION .. "-osx")) - end - if "pnacl" == _OPTIONS["gcc"] then + elseif "pnacl" == _OPTIONS["gcc"] then if not os.getenv("NACL_SDK_ROOT") then print("Set NACL_SDK_ROOT enviroment variables.") @@ -259,9 +254,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = naclToolchain .. "clang++" premake.gcc.ar = naclToolchain .. "ar" location (path.join(_buildDir, "projects", _ACTION .. "-pnacl")) - end - if "qnx-arm" == _OPTIONS["gcc"] then + elseif "qnx-arm" == _OPTIONS["gcc"] then if not os.getenv("QNX_HOST") then print("Set QNX_HOST enviroment variables.") @@ -271,9 +265,8 @@ function toolchain(_buildDir, _libDir) premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++" premake.gcc.ar = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar" location (path.join(_buildDir, "projects", _ACTION .. "-qnx-arm")) - end - if "rpi" == _OPTIONS["gcc"] then + elseif "rpi" == _OPTIONS["gcc"] then location (path.join(_buildDir, "projects", _ACTION .. "-rpi")) end elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then @@ -281,27 +274,27 @@ function toolchain(_buildDir, _libDir) if (_ACTION .. "-clang") == _OPTIONS["vs"] then premake.vstudio.toolset = ("LLVM-" .. _ACTION) location (path.join(_buildDir, "projects", _ACTION .. "-clang")) - end - if "winphone8" == _OPTIONS["vs"] then + elseif "winphone8" == _OPTIONS["vs"] then premake.vstudio.toolset = "v110_wp80" location (path.join(_buildDir, "projects", _ACTION .. "-winphone8")) - end - if "winphone81" == _OPTIONS["vs"] then + elseif "winphone81" == _OPTIONS["vs"] then premake.vstudio.toolset = "v120_wp81" platforms { "ARM" } location (path.join(_buildDir, "projects", _ACTION .. "-winphone81")) - end - if ("vs2012-xp") == _OPTIONS["vs"] then + elseif ("vs2012-xp") == _OPTIONS["vs"] then premake.vstudio.toolset = ("v110_xp") location (path.join(_buildDir, "projects", _ACTION .. "-xp")) - end - if ("vs2013-xp") == _OPTIONS["vs"] then + elseif ("vs2013-xp") == _OPTIONS["vs"] then premake.vstudio.toolset = ("v120_xp") location (path.join(_buildDir, "projects", _ACTION .. "-xp")) + + elseif ("vs2015-xp") == _OPTIONS["vs"] then + premake.vstudio.toolset = ("v140_xp") + location (path.join(_buildDir, "projects", _ACTION .. "-xp")) end elseif _ACTION == "xcode4" then @@ -309,8 +302,8 @@ function toolchain(_buildDir, _libDir) if "osx" == _OPTIONS["xcode"] then premake.xcode.toolset = "macosx" location (path.join(_buildDir, "projects", _ACTION .. "-osx")) - end - if "ios" == _OPTIONS["xcode"] then + + elseif "ios" == _OPTIONS["xcode"] then premake.xcode.toolset = "iphoneos" location (path.join(_buildDir, "projects", _ACTION .. "-ios")) end @@ -479,12 +472,25 @@ function toolchain(_buildDir, _libDir) } buildoptions { "-m64" } - configuration { "linux-gcc and not linux-clang" } + configuration { "linux-clang" } + + configuration { "linux-gcc-5" } buildoptions { - "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic. +-- "-fno-omit-frame-pointer", +-- "-fsanitize=address", +-- "-fsanitize=undefined", +-- "-fsanitize=float-divide-by-zero", +-- "-fsanitize=float-cast-overflow", + } + links { +-- "asan", +-- "ubsan", } - configuration { "linux-clang" } + configuration { "linux-g*" } + buildoptions { + "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic. + } configuration { "linux-*" } buildoptions { @@ -494,7 +500,7 @@ function toolchain(_buildDir, _libDir) } buildoptions_cpp { "-std=c++0x", - } + } links { "rt", "dl", @@ -503,7 +509,7 @@ function toolchain(_buildDir, _libDir) "-Wl,--gc-sections", } - configuration { "linux-gcc", "x32" } + configuration { "linux-g*", "x32" } targetdir (path.join(_buildDir, "linux32_gcc/bin")) objdir (path.join(_buildDir, "linux32_gcc/obj")) libdirs { path.join(_libDir, "lib/linux32_gcc") } @@ -511,7 +517,7 @@ function toolchain(_buildDir, _libDir) "-m32", } - configuration { "linux-gcc", "x64" } + configuration { "linux-g*", "x64" } targetdir (path.join(_buildDir, "linux64_gcc/bin")) objdir (path.join(_buildDir, "linux64_gcc/obj")) libdirs { path.join(_libDir, "lib/linux64_gcc") } @@ -558,7 +564,6 @@ function toolchain(_buildDir, _libDir) } buildoptions { "-fPIC", - "-std=c++0x", "-no-canonical-prefixes", "-Wa,--noexecstack", "-fstack-protector", @@ -567,6 +572,9 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } linkoptions { "-no-canonical-prefixes", "-Wl,--no-undefined", @@ -670,7 +678,6 @@ function toolchain(_buildDir, _libDir) configuration { "nacl or nacl-arm or pnacl" } buildoptions { - "-std=c++0x", "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,... "-fno-stack-protector", "-fdiagnostics-show-option", @@ -679,6 +686,9 @@ function toolchain(_buildDir, _libDir) "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } includedirs { "$(NACL_SDK_ROOT)/include", path.join(bxDir, "include/compat/nacl"), @@ -756,7 +766,7 @@ function toolchain(_buildDir, _libDir) configuration { "osx", "x32" } targetdir (path.join(_buildDir, "osx32_clang/bin")) objdir (path.join(_buildDir, "osx32_clang/obj")) - libdirs { path.join(_libDir, "lib/osx32_clang") } + --libdirs { path.join(_libDir, "lib/osx32_clang") } buildoptions { "-m32", } @@ -764,7 +774,7 @@ function toolchain(_buildDir, _libDir) configuration { "osx", "x64" } targetdir (path.join(_buildDir, "osx64_clang/bin")) objdir (path.join(_buildDir, "osx64_clang/obj")) - libdirs { path.join(_libDir, "lib/osx64_clang") } + --libdirs { path.join(_libDir, "lib/osx64_clang") } buildoptions { "-m64", } @@ -831,11 +841,13 @@ function toolchain(_buildDir, _libDir) libdirs { path.join(_libDir, "lib/qnx-arm") } -- includedirs { path.join(bxDir, "include/compat/qnx") } buildoptions { - "-std=c++0x", "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0 "-Wunused-value", "-Wundef", } + buildoptions_cpp { + "-std=c++0x", + } configuration { "rpi" } targetdir (path.join(_buildDir, "rpi/bin")) diff --git a/3rdparty/bx/tests/unordered_map_nonpod.cpp b/3rdparty/bx/tests/unordered_map_nonpod.cpp index c94580323fb..f9607e35e3f 100644 --- a/3rdparty/bx/tests/unordered_map_nonpod.cpp +++ b/3rdparty/bx/tests/unordered_map_nonpod.cpp @@ -29,10 +29,11 @@ #include <tinystl/allocator.h> #include <tinystl/unordered_map.h> +struct Foo { int bar; }; + TEST(uomap_nonpod_compiles) { - struct Foo { int bar; }; // verify this compiles typedef tinystl::unordered_map<int, Foo> map; map m; -}
\ No newline at end of file +} diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie Binary files differindex 19f84f8eb7f..6a87e019ef2 100644 --- a/3rdparty/bx/tools/bin/darwin/genie +++ b/3rdparty/bx/tools/bin/darwin/genie diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie Binary files differindex db40bf0bce2..057e0249710 100644 --- a/3rdparty/bx/tools/bin/linux/genie +++ b/3rdparty/bx/tools/bin/linux/genie diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe Binary files differindex 3075bc286ee..d4b655cc846 100644 --- a/3rdparty/bx/tools/bin/windows/genie.exe +++ b/3rdparty/bx/tools/bin/windows/genie.exe diff --git a/3rdparty/genie/.gitignore b/3rdparty/genie/.gitignore index aa2a77c9cc7..42624a0c146 100644 --- a/3rdparty/genie/.gitignore +++ b/3rdparty/genie/.gitignore @@ -1,10 +1,2 @@ bin build/*/obj -scripts/obj -*.sln -*.suo -*.vcxproj -*.vcxproj.filters -*.vcxproj.user -*.opensdf -*.sdf
\ No newline at end of file diff --git a/3rdparty/genie/README.md b/3rdparty/genie/README.md index e5e20890119..7282d91a701 100644 --- a/3rdparty/genie/README.md +++ b/3rdparty/genie/README.md @@ -14,7 +14,7 @@ Supported project generators: Download (stable) ----------------- - version 225 (commit 2321131cbf61d5a13df44c255b8d18d73121149d) + version 257 (commit 77931cf939ad4ec1bacb1fe92045012fd1e25eba) Linux: https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie @@ -50,7 +50,7 @@ intention to keep it compatible with it. - Added search for default script. Default script name is changed to genie.lua (solution.lua and premake4.lua are also allowed), and it can be located in `scripts` directory. - - Updated Lua from 5.1.4 to 5.2.3. + - Updated Lua from 5.1.4 to 5.3.0. - Disabled `SmallerTypeCheck` VS option when `ExtraWarnings` is set (need to move it into separate option). - New versioning scheme based on revision number from git. @@ -73,6 +73,11 @@ intention to keep it compatible with it. - Added `msgcompile`, `msgresource`, `msglinking` and `msgarchiving` as overrides for make messages. - Added `messageskip` list to disable some of compiler messages. + - Added `buildoptions_c`, `buildoptions_cpp`, `buildoptions_objc` for + configuring language specific build options. + - Split functionality of `excludes` in `removefiles` and `excludes`. With VS + `excludes` will exclude files from build but files will be added to project + file. `removefiles` removes files completely from project. ## Why fork? @@ -112,7 +117,7 @@ state of Premake, it's just acknowledging the problem, and dealing with it. GENie Copyright (c) 2014 Branimir Karadžić, Neil Richardson, Mike Popoloski, - Drew Solomon, Ted de Munnik, Miodrag Milanović. + Drew Solomon, Ted de Munnik, Miodrag Milanović, Brett Vickers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/3rdparty/genie/build/gmake.darwin/genie.make b/3rdparty/genie/build/gmake.darwin/genie.make index e1dbd874d32..fb4279f6110 100644 --- a/3rdparty/genie/build/gmake.darwin/genie.make +++ b/3rdparty/genie/build/gmake.darwin/genie.make @@ -42,7 +42,7 @@ ifeq ($(config),release) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4 @@ -53,57 +53,59 @@ ifeq ($(config),release) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -118,7 +120,7 @@ ifeq ($(config),debug) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4 @@ -129,57 +131,59 @@ ifeq ($(config),debug) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -194,7 +198,7 @@ ifeq ($(config),releaseuniv32) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4 @@ -205,57 +209,59 @@ ifeq ($(config),releaseuniv32) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -270,7 +276,7 @@ ifeq ($(config),debuguniv32) TARGETDIR = ../../bin/darwin override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4 ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4 @@ -281,57 +287,59 @@ ifeq ($(config),debuguniv32) LIBS += $(LDDEPS) -framework CoreServices LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -344,7 +352,7 @@ endif OBJDIRS := \ $(OBJDIR) \ $(OBJDIR)/src/host \ - $(OBJDIR)/src/host/lua-5.2.3/src \ + $(OBJDIR)/src/host/lua-5.3.0/src \ RESOURCES := \ @@ -363,7 +371,7 @@ $(TARGETDIR): -$(call MKDIR,$(TARGETDIR)) $(OBJDIRS): - @echo Creating $(OBJDIR) + @echo Creating $(@) -$(call MKDIR,$@) clean: @@ -388,7 +396,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -396,11 +404,11 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -408,11 +416,19 @@ $(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c +$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -420,175 +436,175 @@ $(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c +$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c +$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c +$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c +$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/build/gmake.linux/genie.make b/3rdparty/genie/build/gmake.linux/genie.make index ee290792707..e369e8649b1 100644 --- a/3rdparty/genie/build/gmake.linux/genie.make +++ b/3rdparty/genie/build/gmake.linux/genie.make @@ -42,7 +42,7 @@ ifeq ($(config),release) TARGETDIR = ../../bin/linux override TARGET = $(TARGETDIR)/genie DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os @@ -53,57 +53,59 @@ ifeq ($(config),release) LIBS += $(LDDEPS) -ldl -lm LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -118,7 +120,7 @@ ifeq ($(config),debug) TARGETDIR = ../../bin/linux override TARGET = $(TARGETDIR)/genie DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g @@ -129,57 +131,59 @@ ifeq ($(config),debug) LIBS += $(LDDEPS) -ldl -lm LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -191,8 +195,8 @@ endif OBJDIRS := \ $(OBJDIR) \ - $(OBJDIR)/src/host/lua-5.2.3/src \ $(OBJDIR)/src/host \ + $(OBJDIR)/src/host/lua-5.3.0/src \ RESOURCES := \ @@ -211,7 +215,7 @@ $(TARGETDIR): -$(call MKDIR,$(TARGETDIR)) $(OBJDIRS): - @echo Creating $(OBJDIR) + @echo Creating $(@) -$(call MKDIR,$@) clean: @@ -236,7 +240,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -244,11 +248,11 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -256,11 +260,19 @@ $(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c +$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -268,175 +280,175 @@ $(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c +$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c +$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c +$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c +$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/build/gmake.windows/genie.make b/3rdparty/genie/build/gmake.windows/genie.make index 73f6d7218a3..d0ebef02506 100644 --- a/3rdparty/genie/build/gmake.windows/genie.make +++ b/3rdparty/genie/build/gmake.windows/genie.make @@ -42,7 +42,7 @@ ifeq ($(config),release) TARGETDIR = ../../bin/windows override TARGET = $(TARGETDIR)/genie.exe DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os @@ -53,57 +53,59 @@ ifeq ($(config),release) LIBS += $(LDDEPS) -lole32 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -118,7 +120,7 @@ ifeq ($(config),debug) TARGETDIR = ../../bin/windows override TARGET = $(TARGETDIR)/genie.exe DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE - INCLUDES += -I../../src/host/lua-5.2.3/src + INCLUDES += -I../../src/host/lua-5.3.0/src ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g @@ -129,57 +131,59 @@ ifeq ($(config),debug) LIBS += $(LDDEPS) -lole32 LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) OBJECTS := \ - $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/os_stat.o \ - $(OBJDIR)/src/host/os_chdir.o \ - $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_isdir.o \ + $(OBJDIR)/src/host/os_rmdir.o \ $(OBJDIR)/src/host/os_uuid.o \ - $(OBJDIR)/src/host/os_isfile.o \ - $(OBJDIR)/src/host/os_copyfile.o \ - $(OBJDIR)/src/host/scripts.o \ $(OBJDIR)/src/host/string_endswith.o \ + $(OBJDIR)/src/host/os_chdir.o \ $(OBJDIR)/src/host/os_getversion.o \ - $(OBJDIR)/src/host/string_hash.o \ - $(OBJDIR)/src/host/os_pathsearch.o \ - $(OBJDIR)/src/host/os_rmdir.o \ - $(OBJDIR)/src/host/os_match.o \ - $(OBJDIR)/src/host/premake.o \ - $(OBJDIR)/src/host/os_isdir.o \ - $(OBJDIR)/src/host/os_mkdir.o \ $(OBJDIR)/src/host/path_isabsolute.o \ + $(OBJDIR)/src/host/scripts.o \ + $(OBJDIR)/src/host/premake.o \ + $(OBJDIR)/src/host/os_getcwd.o \ + $(OBJDIR)/src/host/premake_main.o \ + $(OBJDIR)/src/host/os_ticks.o \ + $(OBJDIR)/src/host/string_hash.o \ $(OBJDIR)/src/host/os_is64bit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/linit.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/llex.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \ - $(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \ + $(OBJDIR)/src/host/os_match.o \ + $(OBJDIR)/src/host/os_isfile.o \ + $(OBJDIR)/src/host/os_copyfile.o \ + $(OBJDIR)/src/host/os_pathsearch.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lobject.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lparser.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lundump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/liolib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lctype.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstate.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lgc.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltable.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lmem.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lvm.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lcode.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lzio.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/linit.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldo.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lstring.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ldump.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/llex.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loslib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o \ + $(OBJDIR)/src/host/lua-5.3.0/src/ltm.o \ define PREBUILDCMDS endef @@ -191,8 +195,8 @@ endif OBJDIRS := \ $(OBJDIR) \ + $(OBJDIR)/src/host/lua-5.3.0/src \ $(OBJDIR)/src/host \ - $(OBJDIR)/src/host/lua-5.2.3/src \ RESOURCES := \ @@ -211,7 +215,7 @@ $(TARGETDIR): -$(call MKDIR,$(TARGETDIR)) $(OBJDIRS): - @echo Creating $(OBJDIR) + @echo Creating $(@) -$(call MKDIR,$@) clean: @@ -236,7 +240,7 @@ $(GCH): $(PCH) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" endif -$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c +$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -244,11 +248,11 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c +$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c +$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -256,11 +260,19 @@ $(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c +$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c +$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c + @echo $(notdir $<) + $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" + +$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" @@ -268,175 +280,175 @@ $(OBJDIR)/src/host/scripts.o: ../../src/host/scripts.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c +$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c +$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c +$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c +$(OBJDIR)/src/host/os_ticks.o: ../../src/host/os_ticks.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c +$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c +$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/premake.o: ../../src/host/premake.c +$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c +$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c +$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c +$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lobject.o: ../../src/host/lua-5.3.0/src/lobject.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c +$(OBJDIR)/src/host/lua-5.3.0/src/lparser.o: ../../src/host/lua-5.3.0/src/lparser.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c +$(OBJDIR)/src/host/lua-5.3.0/src/lundump.o: ../../src/host/lua-5.3.0/src/lundump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c +$(OBJDIR)/src/host/lua-5.3.0/src/lfunc.o: ../../src/host/lua-5.3.0/src/lfunc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcorolib.o: ../../src/host/lua-5.3.0/src/lcorolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/liolib.o: ../../src/host/lua-5.3.0/src/liolib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltablib.o: ../../src/host/lua-5.3.0/src/ltablib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldblib.o: ../../src/host/lua-5.3.0/src/ldblib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldebug.o: ../../src/host/lua-5.3.0/src/ldebug.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmathlib.o: ../../src/host/lua-5.3.0/src/lmathlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c +$(OBJDIR)/src/host/lua-5.3.0/src/lctype.o: ../../src/host/lua-5.3.0/src/lctype.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lutf8lib.o: ../../src/host/lua-5.3.0/src/lutf8lib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o: ../../src/host/lua-5.3.0/src/lauxlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstate.o: ../../src/host/lua-5.3.0/src/lstate.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c +$(OBJDIR)/src/host/lua-5.3.0/src/lgc.o: ../../src/host/lua-5.3.0/src/lgc.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltable.o: ../../src/host/lua-5.3.0/src/ltable.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbitlib.o: ../../src/host/lua-5.3.0/src/lbitlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c +$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o: ../../src/host/lua-5.3.0/src/lapi.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c +$(OBJDIR)/src/host/lua-5.3.0/src/lmem.o: ../../src/host/lua-5.3.0/src/lmem.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c +$(OBJDIR)/src/host/lua-5.3.0/src/lvm.o: ../../src/host/lua-5.3.0/src/lvm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c +$(OBJDIR)/src/host/lua-5.3.0/src/lcode.o: ../../src/host/lua-5.3.0/src/lcode.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c +$(OBJDIR)/src/host/lua-5.3.0/src/lzio.o: ../../src/host/lua-5.3.0/src/lzio.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstrlib.o: ../../src/host/lua-5.3.0/src/lstrlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c +$(OBJDIR)/src/host/lua-5.3.0/src/lbaselib.o: ../../src/host/lua-5.3.0/src/lbaselib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c +$(OBJDIR)/src/host/lua-5.3.0/src/linit.o: ../../src/host/lua-5.3.0/src/linit.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldo.o: ../../src/host/lua-5.3.0/src/ldo.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c +$(OBJDIR)/src/host/lua-5.3.0/src/lstring.o: ../../src/host/lua-5.3.0/src/lstring.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c +$(OBJDIR)/src/host/lua-5.3.0/src/ldump.o: ../../src/host/lua-5.3.0/src/ldump.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c +$(OBJDIR)/src/host/lua-5.3.0/src/llex.o: ../../src/host/lua-5.3.0/src/llex.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c +$(OBJDIR)/src/host/lua-5.3.0/src/lopcodes.o: ../../src/host/lua-5.3.0/src/lopcodes.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c +$(OBJDIR)/src/host/lua-5.3.0/src/loslib.o: ../../src/host/lua-5.3.0/src/loslib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c +$(OBJDIR)/src/host/lua-5.3.0/src/loadlib.o: ../../src/host/lua-5.3.0/src/loadlib.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c +$(OBJDIR)/src/host/lua-5.3.0/src/ltm.o: ../../src/host/lua-5.3.0/src/ltm.c @echo $(notdir $<) $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua index fbf273030b9..4cbd3928a8f 100644 --- a/3rdparty/genie/scripts/genie.lua +++ b/3rdparty/genie/scripts/genie.lua @@ -26,7 +26,7 @@ "StaticRuntime" } includedirs { - "../src/host/lua-5.2.3/src" + "../src/host/lua-5.3.0/src" } files { @@ -36,12 +36,12 @@ "../src/host/scripts.c", } - removefiles { + excludes { "../src/premake.lua", - "../src/host/lua-5.2.3/src/lua.c", - "../src/host/lua-5.2.3/src/luac.c", - "../src/host/lua-5.2.3/**.lua", - "../src/host/lua-5.2.3/etc/*.c", + "../src/host/lua-5.3.0/src/lua.c", + "../src/host/lua-5.3.0/src/luac.c", + "../src/host/lua-5.3.0/**.lua", + "../src/host/lua-5.3.0/etc/*.c", } configuration "Debug" diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua index cff6ddebe86..2abc945d288 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -73,20 +73,20 @@ _p('endef') _p('') end - + -- target build rule _p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)') - - if prj.kind == "StaticLib" then + + if prj.kind == "StaticLib" then if prj.msgarchiving then _p('\t@echo ' .. prj.msgarchiving) else _p('\t@echo Archiving %s', prj.name) - end - if (not prj.archivesplit_size) then + end + if (not prj.archivesplit_size) then prj.archivesplit_size=200 end - if (not prj.options.ArchiveSplit) then + if (not prj.options.ArchiveSplit) then _p('\t$(SILENT) $(LINKCMD) $(OBJECTS)') else _p('\t$(call RM,$(TARGET))') @@ -98,7 +98,7 @@ _p('\t@echo ' .. prj.msglinking) else _p('\t@echo Linking %s', prj.name) - end + end _p('\t$(SILENT) $(LINKCMD)') end _p('\t$(POSTBUILDCMDS)') @@ -111,7 +111,7 @@ _p('$(OBJDIRS):') if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then - _p('\t@echo Creating $(OBJDIR)') + _p('\t@echo Creating $(@)') end _p('\t-$(call MKDIR,$@)') _p('') @@ -246,14 +246,8 @@ for _, file in ipairs(prj.files) do if path.iscppfile(file) then -- check if file is excluded. - local excluded = false - for _, exclude in ipairs(cfg.excludes) do - excluded = (exclude == file) - if (excluded) then break end - end - - -- if not excluded, add it. - if excluded == false then + if not table.icontains(cfg.excludes, file) then + -- if not excluded, add it. _p('\t$(OBJDIR)/%s.o \\' , _MAKE.esc(path.trimdots(path.removeext(file))) ) diff --git a/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua b/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua index c5ee17d841c..7a0003b7a41 100644 --- a/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua +++ b/3rdparty/genie/src/actions/vstudio/vs2010_vcxproj.lua @@ -477,19 +477,7 @@ vc2010.link(cfg) event_hooks(cfg) _p(1,'</ItemDefinitionGroup>') - - - end - end - - - - function exists(table, fine) - for _, value in ipairs(table) do - if value == find then return true end end - - return false end @@ -506,7 +494,7 @@ ClInclude = {}, None = {}, ResourceCompile = {}, - AppxManifest = {} + AppxManifest = {} } local foundAppxManifest = false @@ -514,19 +502,19 @@ if path.iscppfile(file.name) then table.insert(sortedfiles.ClCompile, file) elseif path.iscppheader(file.name) then - if not exists(prj.removefiles, file) then + if not table.icontains(prj.removefiles, file) then table.insert(sortedfiles.ClInclude, file) end elseif path.isresourcefile(file.name) then table.insert(sortedfiles.ResourceCompile, file) else - local ext = path.getextension(file.name):lower() - if ext == ".appxmanifest" then + local ext = path.getextension(file.name):lower() + if ext == ".appxmanifest" then foundAppxManifest = true - table.insert(sortedfiles.AppxManifest, file) - else - table.insert(sortedfiles.None, file) - end + table.insert(sortedfiles.AppxManifest, file) + else + table.insert(sortedfiles.None, file) + end end end @@ -557,7 +545,7 @@ vc2010.compilerfilesgroup(prj) vc2010.simplefilesgroup(prj, "None") vc2010.simplefilesgroup(prj, "ResourceCompile") - vc2010.simplefilesgroup(prj, "AppxManifest") + vc2010.simplefilesgroup(prj, "AppxManifest") end @@ -566,13 +554,13 @@ if #files > 0 then _p(1,'<ItemGroup>') for _, file in ipairs(files) do - if subtype then - _p(2,'<%s Include=\"%s\">', section, path.translate(file.name, "\\")) - _p(3,'<SubType>%s</SubType>', subtype) - _p(2,'</%s>', section) - else - _p(2,'<%s Include=\"%s\" />', section, path.translate(file.name, "\\")) - end + if subtype then + _p(2,'<%s Include=\"%s\">', section, path.translate(file.name, "\\")) + _p(3,'<SubType>%s</SubType>', subtype) + _p(2,'</%s>', section) + else + _p(2,'<%s Include=\"%s\" />', section, path.translate(file.name, "\\")) + end end _p(1,'</ItemGroup>') end @@ -605,37 +593,15 @@ end end - -- Global exclude - local excluded = false - for _, exclude in ipairs(prj.excludes) do - if exclude == file.name then - for _, vsconfig in ipairs(configs) do - local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) - _p(3, '<ExcludedFromBuild ' - .. if_config_and_platform() - .. '>true</ExcludedFromBuild>' - , premake.esc(vsconfig.name) - ) - end - excluded = true - break - end - end - - if not excluded then - -- Per configuration excludes - for _, vsconfig in ipairs(configs) do - local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) - for _, exclude in ipairs(cfg.excludes) do - - if exclude == file.name then - _p(3, '<ExcludedFromBuild ' - .. if_config_and_platform() - .. '>true</ExcludedFromBuild>' - , premake.esc(vsconfig.name) - ) - end - end + local excluded = table.icontains(prj.excludes, file.name) + for _, vsconfig in ipairs(configs) do + local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform) + if excluded or table.icontains(cfg.excludes, file.name) then + _p(3, '<ExcludedFromBuild ' + .. if_config_and_platform() + .. '>true</ExcludedFromBuild>' + , premake.esc(vsconfig.name) + ) end end diff --git a/3rdparty/genie/src/base/api.lua b/3rdparty/genie/src/base/api.lua index 9a3a26d0c43..5b53c818284 100644 --- a/3rdparty/genie/src/base/api.lua +++ b/3rdparty/genie/src/base/api.lua @@ -810,13 +810,16 @@ end -- list value types get a remove() call too - if info.kind == "list" or - info.kind == "dirlist" or - info.kind == "filelist" or - info.kind == "absolutefilelist" + if info.kind == "list" + or info.kind == "dirlist" + or info.kind == "filelist" + or info.kind == "absolutefilelist" then - _G["remove"..name] = function(value) - premake.remove(name, value) + if name ~= "removefiles" + and name ~= "files" then + _G["remove"..name] = function(value) + premake.remove(name, value) + end end end end diff --git a/3rdparty/genie/src/base/bake.lua b/3rdparty/genie/src/base/bake.lua index 62737fa4d19..0c4a7473ee3 100644 --- a/3rdparty/genie/src/base/bake.lua +++ b/3rdparty/genie/src/base/bake.lua @@ -253,6 +253,7 @@ -- build the configuration base by merging the solution and project level settings local cfg = {} mergeobject(cfg, basis[key]) + adjustpaths(obj.location, cfg) mergeobject(cfg, obj) @@ -376,7 +377,7 @@ local dir local start = iif(cfg.name, 2, 1) - for v = start, iif(cfg.flags.SingleOutputDir,num_variations-1,num_variations) do + for v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,num_variations) do dir = cfg_dirs[cfg][v] if hit_counts[dir] == 1 then break end end @@ -701,15 +702,13 @@ end -- remove excluded files from the file list - local files = { } + local removefiles = cfg.removefiles + if _ACTION == 'gmake' then + removefiles = table.join(removefiles, cfg.excludes) + end + local files = {} for _, fname in ipairs(cfg.files) do - local removed = false - for _, removefname in ipairs(cfg.removefiles) do - removed = (fname == removefname) - if (removed) then break end - end - - if (not removed) then + if not table.icontains(removefiles, fname) then table.insert(files, fname) end end @@ -725,21 +724,9 @@ end -- build configuration objects for all files - -- TODO: can I build this as a tree instead, and avoid the extra - -- step of building it later? cfg.__fileconfigs = { } for _, fname in ipairs(cfg.files) do - cfg.terms.required = fname:lower() - local fcfg = {} - for _, blk in ipairs(cfg.project.blocks) do - if (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then - mergeobject(fcfg, blk) - end - end - - -- add indexed by name and integer - -- TODO: when everything is converted to trees I won't need - -- to index by name any longer + local fcfg = { } fcfg.name = fname cfg.__fileconfigs[fname] = fcfg table.insert(cfg.__fileconfigs, fcfg) diff --git a/3rdparty/genie/src/base/inspect.lua b/3rdparty/genie/src/base/inspect.lua index b163a806505..b654cd76bec 100644 --- a/3rdparty/genie/src/base/inspect.lua +++ b/3rdparty/genie/src/base/inspect.lua @@ -283,7 +283,9 @@ function inspect(rootObject, options) end function printtable(name, table) - print("--- " .. name) - print(inspect(table)) - print("---") + print("table: ", name, inspect(table), "\n") +end + +function printstack() + print(debug.traceback(), "\n") end diff --git a/3rdparty/genie/src/base/table.lua b/3rdparty/genie/src/base/table.lua index 8e5c6100a90..20581c239c3 100644 --- a/3rdparty/genie/src/base/table.lua +++ b/3rdparty/genie/src/base/table.lua @@ -3,22 +3,27 @@ -- Additions to Lua's built-in table functions. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- - + -- -- Returns true if the table contains the specified value. -- function table.contains(t, value) - for _,v in pairs(t) do - if (v == value) then - return true - end + for _, v in pairs(t) do + if v == value then return true end + end + return false + end + + function table.icontains(t, value) + for _, v in ipairs(t) do + if v == value then return true end end return false end - - + + -- -- Enumerates an array of objects and returns a new table containing -- only the value of one particular field. @@ -31,8 +36,8 @@ end return result end - - + + -- -- Flattens a hierarchy of tables into a single array containing all @@ -41,7 +46,7 @@ function table.flatten(arr) local result = { } - + local function flatten(arr) for _, v in ipairs(arr) do if type(v) == "table" then @@ -51,7 +56,7 @@ end end end - + flatten(arr) return result end @@ -75,7 +80,7 @@ -- -- Inserts a value of array of values into a table. If the value is --- itself a table, its contents are enumerated and added instead. So +-- itself a table, its contents are enumerated and added instead. So -- these inputs give these outputs: -- -- "x" -> { "x" } @@ -156,7 +161,7 @@ end return result end - + -- @@ -179,5 +184,5 @@ end return result end - -
\ No newline at end of file + + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/Makefile b/3rdparty/genie/src/host/lua-5.2.3/src/Makefile deleted file mode 100644 index 7b4b2b75420..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/Makefile +++ /dev/null @@ -1,187 +0,0 @@ -# Makefile for building Lua -# See ../doc/readme.html for installation and customization instructions. - -# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= - -# Your platform. See PLATS for possible values. -PLAT= none - -CC= gcc -CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS) -LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) -LIBS= -lm $(SYSLIBS) $(MYLIBS) - -AR= ar rcu -RANLIB= ranlib -RM= rm -f - -SYSCFLAGS= -SYSLDFLAGS= -SYSLIBS= - -MYCFLAGS= -MYLDFLAGS= -MYLIBS= -MYOBJS= - -# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= - -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris - -LUA_A= liblua.a -CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ - lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ - ltm.o lundump.o lvm.o lzio.o -LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \ - lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o -BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) - -LUA_T= lua -LUA_O= lua.o - -LUAC_T= luac -LUAC_O= luac.o - -ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) -ALL_A= $(LUA_A) - -# Targets start here. -default: $(PLAT) - -all: $(ALL_T) - -o: $(ALL_O) - -a: $(ALL_A) - -$(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ - -$(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - -$(LUAC_T): $(LUAC_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) - -clean: - $(RM) $(ALL_T) $(ALL_O) - -depend: - @$(CC) $(CFLAGS) -MM l*.c - -echo: - @echo "PLAT= $(PLAT)" - @echo "CC= $(CC)" - @echo "CFLAGS= $(CFLAGS)" - @echo "LDFLAGS= $(SYSLDFLAGS)" - @echo "LIBS= $(LIBS)" - @echo "AR= $(AR)" - @echo "RANLIB= $(RANLIB)" - @echo "RM= $(RM)" - -# Convenience targets for popular platforms -ALL= all - -none: - @echo "Please do 'make PLATFORM' where PLATFORM is one of these:" - @echo " $(PLATS)" - -aix: - $(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" SYSLDFLAGS="-brtl -bexpall" - -ansi: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_ANSI" - -bsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E" - -freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" - -generic: $(ALL) - -linux: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" - -macosx: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc - -mingw: - $(MAKE) "LUA_A=lua52.dll" "LUA_T=lua.exe" \ - "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \ - "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe - $(MAKE) "LUAC_T=luac.exe" luac.exe - -posix: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX" - -solaris: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" - -# list targets that do not create files (but not all makes understand .PHONY) -.PHONY: all $(PLATS) default o a clean depend echo none - -# DO NOT DELETE - -lapi.o: lapi.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \ - lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h ltable.h lundump.h \ - lvm.h -lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h -lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h -lbitlib.o: lbitlib.c lua.h luaconf.h lauxlib.h lualib.h -lcode.o: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \ - lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \ - lstring.h ltable.h lvm.h -lcorolib.o: lcorolib.c lua.h luaconf.h lauxlib.h lualib.h -lctype.o: lctype.c lctype.h lua.h luaconf.h llimits.h -ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h -ldebug.o: ldebug.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \ - ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h ldebug.h ldo.h \ - lfunc.h lstring.h lgc.h ltable.h lvm.h -ldo.o: ldo.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \ - lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h lparser.h \ - lstring.h ltable.h lundump.h lvm.h -ldump.o: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \ - lzio.h lmem.h lundump.h -lfunc.o: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h \ - lstate.h ltm.h lzio.h lmem.h -lgc.o: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \ - lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h -linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h -liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h -llex.o: llex.c lua.h luaconf.h lctype.h llimits.h ldo.h lobject.h \ - lstate.h ltm.h lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h -lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h -lmem.o: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \ - ltm.h lzio.h lmem.h ldo.h lgc.h -loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h -lobject.o: lobject.c lua.h luaconf.h lctype.h llimits.h ldebug.h lstate.h \ - lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h lvm.h -lopcodes.o: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h -loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h -lparser.o: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \ - lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lfunc.h \ - lstring.h lgc.h ltable.h -lstate.o: lstate.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h \ - ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h lstring.h \ - ltable.h -lstring.o: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \ - ltm.h lzio.h lstring.h lgc.h -lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h -ltable.o: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \ - ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h -ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h -ltm.o: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \ - lmem.h lstring.h lgc.h ltable.h -lua.o: lua.c lua.h luaconf.h lauxlib.h lualib.h -luac.o: luac.c lua.h luaconf.h lauxlib.h lobject.h llimits.h lstate.h \ - ltm.h lzio.h lmem.h lundump.h ldebug.h lopcodes.h -lundump.o: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \ - llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h -lvm.o: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \ - lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h -lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \ - lzio.h - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldump.c b/3rdparty/genie/src/host/lua-5.2.3/src/ldump.c deleted file mode 100644 index 61fa2cd892d..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldump.c +++ /dev/null @@ -1,173 +0,0 @@ -/* -** $Id: ldump.c,v 2.17.1.1 2013/04/12 18:48:47 roberto Exp $ -** save precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include <stddef.h> - -#define ldump_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lundump.h" - -typedef struct { - lua_State* L; - lua_Writer writer; - void* data; - int strip; - int status; -} DumpState; - -#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) -#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) - -static void DumpBlock(const void* b, size_t size, DumpState* D) -{ - if (D->status==0) - { - lua_unlock(D->L); - D->status=(*D->writer)(D->L,b,size,D->data); - lua_lock(D->L); - } -} - -static void DumpChar(int y, DumpState* D) -{ - char x=(char)y; - DumpVar(x,D); -} - -static void DumpInt(int x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpNumber(lua_Number x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpVector(const void* b, int n, size_t size, DumpState* D) -{ - DumpInt(n,D); - DumpMem(b,n,size,D); -} - -static void DumpString(const TString* s, DumpState* D) -{ - if (s==NULL) - { - size_t size=0; - DumpVar(size,D); - } - else - { - size_t size=s->tsv.len+1; /* include trailing '\0' */ - DumpVar(size,D); - DumpBlock(getstr(s),size*sizeof(char),D); - } -} - -#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) - -static void DumpFunction(const Proto* f, DumpState* D); - -static void DumpConstants(const Proto* f, DumpState* D) -{ - int i,n=f->sizek; - DumpInt(n,D); - for (i=0; i<n; i++) - { - const TValue* o=&f->k[i]; - DumpChar(ttypenv(o),D); - switch (ttypenv(o)) - { - case LUA_TNIL: - break; - case LUA_TBOOLEAN: - DumpChar(bvalue(o),D); - break; - case LUA_TNUMBER: - DumpNumber(nvalue(o),D); - break; - case LUA_TSTRING: - DumpString(rawtsvalue(o),D); - break; - default: lua_assert(0); - } - } - n=f->sizep; - DumpInt(n,D); - for (i=0; i<n; i++) DumpFunction(f->p[i],D); -} - -static void DumpUpvalues(const Proto* f, DumpState* D) -{ - int i,n=f->sizeupvalues; - DumpInt(n,D); - for (i=0; i<n; i++) - { - DumpChar(f->upvalues[i].instack,D); - DumpChar(f->upvalues[i].idx,D); - } -} - -static void DumpDebug(const Proto* f, DumpState* D) -{ - int i,n; - DumpString((D->strip) ? NULL : f->source,D); - n= (D->strip) ? 0 : f->sizelineinfo; - DumpVector(f->lineinfo,n,sizeof(int),D); - n= (D->strip) ? 0 : f->sizelocvars; - DumpInt(n,D); - for (i=0; i<n; i++) - { - DumpString(f->locvars[i].varname,D); - DumpInt(f->locvars[i].startpc,D); - DumpInt(f->locvars[i].endpc,D); - } - n= (D->strip) ? 0 : f->sizeupvalues; - DumpInt(n,D); - for (i=0; i<n; i++) DumpString(f->upvalues[i].name,D); -} - -static void DumpFunction(const Proto* f, DumpState* D) -{ - DumpInt(f->linedefined,D); - DumpInt(f->lastlinedefined,D); - DumpChar(f->numparams,D); - DumpChar(f->is_vararg,D); - DumpChar(f->maxstacksize,D); - DumpCode(f,D); - DumpConstants(f,D); - DumpUpvalues(f,D); - DumpDebug(f,D); -} - -static void DumpHeader(DumpState* D) -{ - lu_byte h[LUAC_HEADERSIZE]; - luaU_header(h); - DumpBlock(h,LUAC_HEADERSIZE,D); -} - -/* -** dump Lua function as precompiled chunk -*/ -int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) -{ - DumpState D; - D.L=L; - D.writer=w; - D.data=data; - D.strip=strip; - D.status=0; - DumpHeader(&D); - DumpFunction(f,&D); - return D.status; -} diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.c b/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.c deleted file mode 100644 index e90e1520ce9..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.c +++ /dev/null @@ -1,161 +0,0 @@ -/* -** $Id: lfunc.c,v 2.30.1.1 2013/04/12 18:48:47 roberto Exp $ -** Auxiliary functions to manipulate prototypes and closures -** See Copyright Notice in lua.h -*/ - - -#include <stddef.h> - -#define lfunc_c -#define LUA_CORE - -#include "lua.h" - -#include "lfunc.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" - - - -Closure *luaF_newCclosure (lua_State *L, int n) { - Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n), NULL, 0)->cl; - c->c.nupvalues = cast_byte(n); - return c; -} - - -Closure *luaF_newLclosure (lua_State *L, int n) { - Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl; - c->l.p = NULL; - c->l.nupvalues = cast_byte(n); - while (n--) c->l.upvals[n] = NULL; - return c; -} - - -UpVal *luaF_newupval (lua_State *L) { - UpVal *uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), NULL, 0)->uv; - uv->v = &uv->u.value; - setnilvalue(uv->v); - return uv; -} - - -UpVal *luaF_findupval (lua_State *L, StkId level) { - global_State *g = G(L); - GCObject **pp = &L->openupval; - UpVal *p; - UpVal *uv; - while (*pp != NULL && (p = gco2uv(*pp))->v >= level) { - GCObject *o = obj2gco(p); - lua_assert(p->v != &p->u.value); - lua_assert(!isold(o) || isold(obj2gco(L))); - if (p->v == level) { /* found a corresponding upvalue? */ - if (isdead(g, o)) /* is it dead? */ - changewhite(o); /* resurrect it */ - return p; - } - pp = &p->next; - } - /* not found: create a new one */ - uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), pp, 0)->uv; - uv->v = level; /* current value lives in the stack */ - uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ - uv->u.l.next = g->uvhead.u.l.next; - uv->u.l.next->u.l.prev = uv; - g->uvhead.u.l.next = uv; - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - return uv; -} - - -static void unlinkupval (UpVal *uv) { - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ - uv->u.l.prev->u.l.next = uv->u.l.next; -} - - -void luaF_freeupval (lua_State *L, UpVal *uv) { - if (uv->v != &uv->u.value) /* is it open? */ - unlinkupval(uv); /* remove from open list */ - luaM_free(L, uv); /* free upvalue */ -} - - -void luaF_close (lua_State *L, StkId level) { - UpVal *uv; - global_State *g = G(L); - while (L->openupval != NULL && (uv = gco2uv(L->openupval))->v >= level) { - GCObject *o = obj2gco(uv); - lua_assert(!isblack(o) && uv->v != &uv->u.value); - L->openupval = uv->next; /* remove from `open' list */ - if (isdead(g, o)) - luaF_freeupval(L, uv); /* free upvalue */ - else { - unlinkupval(uv); /* remove upvalue from 'uvhead' list */ - setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */ - uv->v = &uv->u.value; /* now current value lives here */ - gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */ - g->allgc = o; - luaC_checkupvalcolor(g, uv); - } - } -} - - -Proto *luaF_newproto (lua_State *L) { - Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), NULL, 0)->p; - f->k = NULL; - f->sizek = 0; - f->p = NULL; - f->sizep = 0; - f->code = NULL; - f->cache = NULL; - f->sizecode = 0; - f->lineinfo = NULL; - f->sizelineinfo = 0; - f->upvalues = NULL; - f->sizeupvalues = 0; - f->numparams = 0; - f->is_vararg = 0; - f->maxstacksize = 0; - f->locvars = NULL; - f->sizelocvars = 0; - f->linedefined = 0; - f->lastlinedefined = 0; - f->source = NULL; - return f; -} - - -void luaF_freeproto (lua_State *L, Proto *f) { - luaM_freearray(L, f->code, f->sizecode); - luaM_freearray(L, f->p, f->sizep); - luaM_freearray(L, f->k, f->sizek); - luaM_freearray(L, f->lineinfo, f->sizelineinfo); - luaM_freearray(L, f->locvars, f->sizelocvars); - luaM_freearray(L, f->upvalues, f->sizeupvalues); - luaM_free(L, f); -} - - -/* -** Look for n-th local variable at line `line' in function `func'. -** Returns NULL if not found. -*/ -const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { - int i; - for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { - if (pc < f->locvars[i].endpc) { /* is variable active? */ - local_number--; - if (local_number == 0) - return getstr(f->locvars[i].varname); - } - } - return NULL; /* not found */ -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/llimits.h b/3rdparty/genie/src/host/lua-5.2.3/src/llimits.h deleted file mode 100644 index 152dd055154..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/llimits.h +++ /dev/null @@ -1,309 +0,0 @@ -/* -** $Id: llimits.h,v 1.103.1.1 2013/04/12 18:48:47 roberto Exp $ -** Limits, basic types, and some other `installation-dependent' definitions -** See Copyright Notice in lua.h -*/ - -#ifndef llimits_h -#define llimits_h - - -#include <limits.h> -#include <stddef.h> - - -#include "lua.h" - - -typedef unsigned LUA_INT32 lu_int32; - -typedef LUAI_UMEM lu_mem; - -typedef LUAI_MEM l_mem; - - - -/* chars used as small naturals (so that `char' is reserved for characters) */ -typedef unsigned char lu_byte; - - -#define MAX_SIZET ((size_t)(~(size_t)0)-2) - -#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) - -#define MAX_LMEM ((l_mem) ((MAX_LUMEM >> 1) - 2)) - - -#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ - -/* -** conversion of pointer to integer -** this is for hashing only; there is no problem if the integer -** cannot hold the whole pointer value -*/ -#define IntPoint(p) ((unsigned int)(lu_mem)(p)) - - - -/* type to ensure maximum alignment */ -#if !defined(LUAI_USER_ALIGNMENT_T) -#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } -#endif - -typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; - - -/* result of a `usual argument conversion' over lua_Number */ -typedef LUAI_UACNUMBER l_uacNumber; - - -/* internal assertions for in-house debugging */ -#if defined(lua_assert) -#define check_exp(c,e) (lua_assert(c), (e)) -/* to avoid problems with conditions too long */ -#define lua_longassert(c) { if (!(c)) lua_assert(0); } -#else -#define lua_assert(c) ((void)0) -#define check_exp(c,e) (e) -#define lua_longassert(c) ((void)0) -#endif - -/* -** assertion for checking API calls -*/ -#if !defined(luai_apicheck) - -#if defined(LUA_USE_APICHECK) -#include <assert.h> -#define luai_apicheck(L,e) assert(e) -#else -#define luai_apicheck(L,e) lua_assert(e) -#endif - -#endif - -#define api_check(l,e,msg) luai_apicheck(l,(e) && msg) - - -#if !defined(UNUSED) -#define UNUSED(x) ((void)(x)) /* to avoid warnings */ -#endif - - -#define cast(t, exp) ((t)(exp)) - -#define cast_byte(i) cast(lu_byte, (i)) -#define cast_num(i) cast(lua_Number, (i)) -#define cast_int(i) cast(int, (i)) -#define cast_uchar(i) cast(unsigned char, (i)) - - -/* -** non-return type -*/ -#if defined(__GNUC__) -#define l_noret void __attribute__((noreturn)) -#elif defined(_MSC_VER) -#define l_noret void __declspec(noreturn) -#else -#define l_noret void -#endif - - - -/* -** maximum depth for nested C calls and syntactical nested non-terminals -** in a program. (Value must fit in an unsigned short int.) -*/ -#if !defined(LUAI_MAXCCALLS) -#define LUAI_MAXCCALLS 200 -#endif - -/* -** maximum number of upvalues in a closure (both C and Lua). (Value -** must fit in an unsigned char.) -*/ -#define MAXUPVAL UCHAR_MAX - - -/* -** type for virtual-machine instructions -** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) -*/ -typedef lu_int32 Instruction; - - - -/* maximum stack for a Lua function */ -#define MAXSTACK 250 - - - -/* minimum size for the string table (must be power of 2) */ -#if !defined(MINSTRTABSIZE) -#define MINSTRTABSIZE 32 -#endif - - -/* minimum size for string buffer */ -#if !defined(LUA_MINBUFFER) -#define LUA_MINBUFFER 32 -#endif - - -#if !defined(lua_lock) -#define lua_lock(L) ((void) 0) -#define lua_unlock(L) ((void) 0) -#endif - -#if !defined(luai_threadyield) -#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} -#endif - - -/* -** these macros allow user-specific actions on threads when you defined -** LUAI_EXTRASPACE and need to do something extra when a thread is -** created/deleted/resumed/yielded. -*/ -#if !defined(luai_userstateopen) -#define luai_userstateopen(L) ((void)L) -#endif - -#if !defined(luai_userstateclose) -#define luai_userstateclose(L) ((void)L) -#endif - -#if !defined(luai_userstatethread) -#define luai_userstatethread(L,L1) ((void)L) -#endif - -#if !defined(luai_userstatefree) -#define luai_userstatefree(L,L1) ((void)L) -#endif - -#if !defined(luai_userstateresume) -#define luai_userstateresume(L,n) ((void)L) -#endif - -#if !defined(luai_userstateyield) -#define luai_userstateyield(L,n) ((void)L) -#endif - -/* -** lua_number2int is a macro to convert lua_Number to int. -** lua_number2integer is a macro to convert lua_Number to lua_Integer. -** lua_number2unsigned is a macro to convert a lua_Number to a lua_Unsigned. -** lua_unsigned2number is a macro to convert a lua_Unsigned to a lua_Number. -** luai_hashnum is a macro to hash a lua_Number value into an integer. -** The hash must be deterministic and give reasonable values for -** both small and large values (outside the range of integers). -*/ - -#if defined(MS_ASMTRICK) || defined(LUA_MSASMTRICK) /* { */ -/* trick with Microsoft assembler for X86 */ - -#define lua_number2int(i,n) __asm {__asm fld n __asm fistp i} -#define lua_number2integer(i,n) lua_number2int(i, n) -#define lua_number2unsigned(i,n) \ - {__int64 l; __asm {__asm fld n __asm fistp l} i = (unsigned int)l;} - - -#elif defined(LUA_IEEE754TRICK) /* }{ */ -/* the next trick should work on any machine using IEEE754 with - a 32-bit int type */ - -union luai_Cast { double l_d; LUA_INT32 l_p[2]; }; - -#if !defined(LUA_IEEEENDIAN) /* { */ -#define LUAI_EXTRAIEEE \ - static const union luai_Cast ieeeendian = {-(33.0 + 6755399441055744.0)}; -#define LUA_IEEEENDIANLOC (ieeeendian.l_p[1] == 33) -#else -#define LUA_IEEEENDIANLOC LUA_IEEEENDIAN -#define LUAI_EXTRAIEEE /* empty */ -#endif /* } */ - -#define lua_number2int32(i,n,t) \ - { LUAI_EXTRAIEEE \ - volatile union luai_Cast u; u.l_d = (n) + 6755399441055744.0; \ - (i) = (t)u.l_p[LUA_IEEEENDIANLOC]; } - -#define luai_hashnum(i,n) \ - { volatile union luai_Cast u; u.l_d = (n) + 1.0; /* avoid -0 */ \ - (i) = u.l_p[0]; (i) += u.l_p[1]; } /* add double bits for his hash */ - -#define lua_number2int(i,n) lua_number2int32(i, n, int) -#define lua_number2unsigned(i,n) lua_number2int32(i, n, lua_Unsigned) - -/* the trick can be expanded to lua_Integer when it is a 32-bit value */ -#if defined(LUA_IEEELL) -#define lua_number2integer(i,n) lua_number2int32(i, n, lua_Integer) -#endif - -#endif /* } */ - - -/* the following definitions always work, but may be slow */ - -#if !defined(lua_number2int) -#define lua_number2int(i,n) ((i)=(int)(n)) -#endif - -#if !defined(lua_number2integer) -#define lua_number2integer(i,n) ((i)=(lua_Integer)(n)) -#endif - -#if !defined(lua_number2unsigned) /* { */ -/* the following definition assures proper modulo behavior */ -#if defined(LUA_NUMBER_DOUBLE) || defined(LUA_NUMBER_FLOAT) -#include <math.h> -#define SUPUNSIGNED ((lua_Number)(~(lua_Unsigned)0) + 1) -#define lua_number2unsigned(i,n) \ - ((i)=(lua_Unsigned)((n) - floor((n)/SUPUNSIGNED)*SUPUNSIGNED)) -#else -#define lua_number2unsigned(i,n) ((i)=(lua_Unsigned)(n)) -#endif -#endif /* } */ - - -#if !defined(lua_unsigned2number) -/* on several machines, coercion from unsigned to double is slow, - so it may be worth to avoid */ -#define lua_unsigned2number(u) \ - (((u) <= (lua_Unsigned)INT_MAX) ? (lua_Number)(int)(u) : (lua_Number)(u)) -#endif - - - -#if defined(ltable_c) && !defined(luai_hashnum) - -#include <float.h> -#include <math.h> - -#define luai_hashnum(i,n) { int e; \ - n = l_mathop(frexp)(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \ - lua_number2int(i, n); i += e; } - -#endif - - - -/* -** macro to control inclusion of some hard tests on stack reallocation -*/ -#if !defined(HARDSTACKTESTS) -#define condmovestack(L) ((void)0) -#else -/* realloc stack keeping its size */ -#define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) -#endif - -#if !defined(HARDMEMTESTS) -#define condchangemem(L) condmovestack(L) -#else -#define condchangemem(L) \ - ((void)(!(G(L)->gcrunning) || (luaC_fullgc(L, 0), 1))) -#endif - -#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lmathlib.c b/3rdparty/genie/src/host/lua-5.2.3/src/lmathlib.c deleted file mode 100644 index fe9fc5423d1..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lmathlib.c +++ /dev/null @@ -1,279 +0,0 @@ -/* -** $Id: lmathlib.c,v 1.83.1.1 2013/04/12 18:48:47 roberto Exp $ -** Standard mathematical library -** See Copyright Notice in lua.h -*/ - - -#include <stdlib.h> -#include <math.h> - -#define lmathlib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#undef PI -#define PI ((lua_Number)(3.1415926535897932384626433832795)) -#define RADIANS_PER_DEGREE ((lua_Number)(PI/180.0)) - - - -static int math_abs (lua_State *L) { - lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_sin (lua_State *L) { - lua_pushnumber(L, l_mathop(sin)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_sinh (lua_State *L) { - lua_pushnumber(L, l_mathop(sinh)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_cos (lua_State *L) { - lua_pushnumber(L, l_mathop(cos)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_cosh (lua_State *L) { - lua_pushnumber(L, l_mathop(cosh)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_tan (lua_State *L) { - lua_pushnumber(L, l_mathop(tan)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_tanh (lua_State *L) { - lua_pushnumber(L, l_mathop(tanh)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_asin (lua_State *L) { - lua_pushnumber(L, l_mathop(asin)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_acos (lua_State *L) { - lua_pushnumber(L, l_mathop(acos)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_atan (lua_State *L) { - lua_pushnumber(L, l_mathop(atan)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_atan2 (lua_State *L) { - lua_pushnumber(L, l_mathop(atan2)(luaL_checknumber(L, 1), - luaL_checknumber(L, 2))); - return 1; -} - -static int math_ceil (lua_State *L) { - lua_pushnumber(L, l_mathop(ceil)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_floor (lua_State *L) { - lua_pushnumber(L, l_mathop(floor)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_fmod (lua_State *L) { - lua_pushnumber(L, l_mathop(fmod)(luaL_checknumber(L, 1), - luaL_checknumber(L, 2))); - return 1; -} - -static int math_modf (lua_State *L) { - lua_Number ip; - lua_Number fp = l_mathop(modf)(luaL_checknumber(L, 1), &ip); - lua_pushnumber(L, ip); - lua_pushnumber(L, fp); - return 2; -} - -static int math_sqrt (lua_State *L) { - lua_pushnumber(L, l_mathop(sqrt)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_pow (lua_State *L) { - lua_Number x = luaL_checknumber(L, 1); - lua_Number y = luaL_checknumber(L, 2); - lua_pushnumber(L, l_mathop(pow)(x, y)); - return 1; -} - -static int math_log (lua_State *L) { - lua_Number x = luaL_checknumber(L, 1); - lua_Number res; - if (lua_isnoneornil(L, 2)) - res = l_mathop(log)(x); - else { - lua_Number base = luaL_checknumber(L, 2); - if (base == (lua_Number)10.0) res = l_mathop(log10)(x); - else res = l_mathop(log)(x)/l_mathop(log)(base); - } - lua_pushnumber(L, res); - return 1; -} - -#if defined(LUA_COMPAT_LOG10) -static int math_log10 (lua_State *L) { - lua_pushnumber(L, l_mathop(log10)(luaL_checknumber(L, 1))); - return 1; -} -#endif - -static int math_exp (lua_State *L) { - lua_pushnumber(L, l_mathop(exp)(luaL_checknumber(L, 1))); - return 1; -} - -static int math_deg (lua_State *L) { - lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); - return 1; -} - -static int math_rad (lua_State *L) { - lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); - return 1; -} - -static int math_frexp (lua_State *L) { - int e; - lua_pushnumber(L, l_mathop(frexp)(luaL_checknumber(L, 1), &e)); - lua_pushinteger(L, e); - return 2; -} - -static int math_ldexp (lua_State *L) { - lua_Number x = luaL_checknumber(L, 1); - int ep = luaL_checkint(L, 2); - lua_pushnumber(L, l_mathop(ldexp)(x, ep)); - return 1; -} - - - -static int math_min (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - lua_Number dmin = luaL_checknumber(L, 1); - int i; - for (i=2; i<=n; i++) { - lua_Number d = luaL_checknumber(L, i); - if (d < dmin) - dmin = d; - } - lua_pushnumber(L, dmin); - return 1; -} - - -static int math_max (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - lua_Number dmax = luaL_checknumber(L, 1); - int i; - for (i=2; i<=n; i++) { - lua_Number d = luaL_checknumber(L, i); - if (d > dmax) - dmax = d; - } - lua_pushnumber(L, dmax); - return 1; -} - - -static int math_random (lua_State *L) { - /* the `%' avoids the (rare) case of r==1, and is needed also because on - some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ - lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; - switch (lua_gettop(L)) { /* check number of arguments */ - case 0: { /* no arguments */ - lua_pushnumber(L, r); /* Number between 0 and 1 */ - break; - } - case 1: { /* only upper limit */ - lua_Number u = luaL_checknumber(L, 1); - luaL_argcheck(L, (lua_Number)1.0 <= u, 1, "interval is empty"); - lua_pushnumber(L, l_mathop(floor)(r*u) + (lua_Number)(1.0)); /* [1, u] */ - break; - } - case 2: { /* lower and upper limits */ - lua_Number l = luaL_checknumber(L, 1); - lua_Number u = luaL_checknumber(L, 2); - luaL_argcheck(L, l <= u, 2, "interval is empty"); - lua_pushnumber(L, l_mathop(floor)(r*(u-l+1)) + l); /* [l, u] */ - break; - } - default: return luaL_error(L, "wrong number of arguments"); - } - return 1; -} - - -static int math_randomseed (lua_State *L) { - srand(luaL_checkunsigned(L, 1)); - (void)rand(); /* discard first value to avoid undesirable correlations */ - return 0; -} - - -static const luaL_Reg mathlib[] = { - {"abs", math_abs}, - {"acos", math_acos}, - {"asin", math_asin}, - {"atan2", math_atan2}, - {"atan", math_atan}, - {"ceil", math_ceil}, - {"cosh", math_cosh}, - {"cos", math_cos}, - {"deg", math_deg}, - {"exp", math_exp}, - {"floor", math_floor}, - {"fmod", math_fmod}, - {"frexp", math_frexp}, - {"ldexp", math_ldexp}, -#if defined(LUA_COMPAT_LOG10) - {"log10", math_log10}, -#endif - {"log", math_log}, - {"max", math_max}, - {"min", math_min}, - {"modf", math_modf}, - {"pow", math_pow}, - {"rad", math_rad}, - {"random", math_random}, - {"randomseed", math_randomseed}, - {"sinh", math_sinh}, - {"sin", math_sin}, - {"sqrt", math_sqrt}, - {"tanh", math_tanh}, - {"tan", math_tan}, - {NULL, NULL} -}; - - -/* -** Open math library -*/ -LUAMOD_API int luaopen_math (lua_State *L) { - luaL_newlib(L, mathlib); - lua_pushnumber(L, PI); - lua_setfield(L, -2, "pi"); - lua_pushnumber(L, HUGE_VAL); - lua_setfield(L, -2, "huge"); - return 1; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lobject.c b/3rdparty/genie/src/host/lua-5.2.3/src/lobject.c deleted file mode 100644 index 882d994d413..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lobject.c +++ /dev/null @@ -1,287 +0,0 @@ -/* -** $Id: lobject.c,v 2.58.1.1 2013/04/12 18:48:47 roberto Exp $ -** Some generic functions over Lua objects -** See Copyright Notice in lua.h -*/ - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#define lobject_c -#define LUA_CORE - -#include "lua.h" - -#include "lctype.h" -#include "ldebug.h" -#include "ldo.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "lvm.h" - - - -LUAI_DDEF const TValue luaO_nilobject_ = {NILCONSTANT}; - - -/* -** converts an integer to a "floating point byte", represented as -** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if -** eeeee != 0 and (xxx) otherwise. -*/ -int luaO_int2fb (unsigned int x) { - int e = 0; /* exponent */ - if (x < 8) return x; - while (x >= 0x10) { - x = (x+1) >> 1; - e++; - } - return ((e+1) << 3) | (cast_int(x) - 8); -} - - -/* converts back */ -int luaO_fb2int (int x) { - int e = (x >> 3) & 0x1f; - if (e == 0) return x; - else return ((x & 7) + 8) << (e - 1); -} - - -int luaO_ceillog2 (unsigned int x) { - static const lu_byte log_2[256] = { - 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 - }; - int l = 0; - x--; - while (x >= 256) { l += 8; x >>= 8; } - return l + log_2[x]; -} - - -lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2) { - switch (op) { - case LUA_OPADD: return luai_numadd(NULL, v1, v2); - case LUA_OPSUB: return luai_numsub(NULL, v1, v2); - case LUA_OPMUL: return luai_nummul(NULL, v1, v2); - case LUA_OPDIV: return luai_numdiv(NULL, v1, v2); - case LUA_OPMOD: return luai_nummod(NULL, v1, v2); - case LUA_OPPOW: return luai_numpow(NULL, v1, v2); - case LUA_OPUNM: return luai_numunm(NULL, v1); - default: lua_assert(0); return 0; - } -} - - -int luaO_hexavalue (int c) { - if (lisdigit(c)) return c - '0'; - else return ltolower(c) - 'a' + 10; -} - - -#if !defined(lua_strx2number) - -#include <math.h> - - -static int isneg (const char **s) { - if (**s == '-') { (*s)++; return 1; } - else if (**s == '+') (*s)++; - return 0; -} - - -static lua_Number readhexa (const char **s, lua_Number r, int *count) { - for (; lisxdigit(cast_uchar(**s)); (*s)++) { /* read integer part */ - r = (r * cast_num(16.0)) + cast_num(luaO_hexavalue(cast_uchar(**s))); - (*count)++; - } - return r; -} - - -/* -** convert an hexadecimal numeric string to a number, following -** C99 specification for 'strtod' -*/ -static lua_Number lua_strx2number (const char *s, char **endptr) { - lua_Number r = 0.0; - int e = 0, i = 0; - int neg = 0; /* 1 if number is negative */ - *endptr = cast(char *, s); /* nothing is valid yet */ - while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ - neg = isneg(&s); /* check signal */ - if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */ - return 0.0; /* invalid format (no '0x') */ - s += 2; /* skip '0x' */ - r = readhexa(&s, r, &i); /* read integer part */ - if (*s == '.') { - s++; /* skip dot */ - r = readhexa(&s, r, &e); /* read fractional part */ - } - if (i == 0 && e == 0) - return 0.0; /* invalid format (no digit) */ - e *= -4; /* each fractional digit divides value by 2^-4 */ - *endptr = cast(char *, s); /* valid up to here */ - if (*s == 'p' || *s == 'P') { /* exponent part? */ - int exp1 = 0; - int neg1; - s++; /* skip 'p' */ - neg1 = isneg(&s); /* signal */ - if (!lisdigit(cast_uchar(*s))) - goto ret; /* must have at least one digit */ - while (lisdigit(cast_uchar(*s))) /* read exponent */ - exp1 = exp1 * 10 + *(s++) - '0'; - if (neg1) exp1 = -exp1; - e += exp1; - } - *endptr = cast(char *, s); /* valid up to here */ - ret: - if (neg) r = -r; - return l_mathop(ldexp)(r, e); -} - -#endif - - -int luaO_str2d (const char *s, size_t len, lua_Number *result) { - char *endptr; - if (strpbrk(s, "nN")) /* reject 'inf' and 'nan' */ - return 0; - else if (strpbrk(s, "xX")) /* hexa? */ - *result = lua_strx2number(s, &endptr); - else - *result = lua_str2number(s, &endptr); - if (endptr == s) return 0; /* nothing recognized */ - while (lisspace(cast_uchar(*endptr))) endptr++; - return (endptr == s + len); /* OK if no trailing characters */ -} - - - -static void pushstr (lua_State *L, const char *str, size_t l) { - setsvalue2s(L, L->top++, luaS_newlstr(L, str, l)); -} - - -/* this function handles only `%d', `%c', %f, %p, and `%s' formats */ -const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { - int n = 0; - for (;;) { - const char *e = strchr(fmt, '%'); - if (e == NULL) break; - luaD_checkstack(L, 2); /* fmt + item */ - pushstr(L, fmt, e - fmt); - switch (*(e+1)) { - case 's': { - const char *s = va_arg(argp, char *); - if (s == NULL) s = "(null)"; - pushstr(L, s, strlen(s)); - break; - } - case 'c': { - char buff; - buff = cast(char, va_arg(argp, int)); - pushstr(L, &buff, 1); - break; - } - case 'd': { - setnvalue(L->top++, cast_num(va_arg(argp, int))); - break; - } - case 'f': { - setnvalue(L->top++, cast_num(va_arg(argp, l_uacNumber))); - break; - } - case 'p': { - char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ - int l = sprintf(buff, "%p", va_arg(argp, void *)); - pushstr(L, buff, l); - break; - } - case '%': { - pushstr(L, "%", 1); - break; - } - default: { - luaG_runerror(L, - "invalid option " LUA_QL("%%%c") " to " LUA_QL("lua_pushfstring"), - *(e + 1)); - } - } - n += 2; - fmt = e+2; - } - luaD_checkstack(L, 1); - pushstr(L, fmt, strlen(fmt)); - if (n > 0) luaV_concat(L, n + 1); - return svalue(L->top - 1); -} - - -const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { - const char *msg; - va_list argp; - va_start(argp, fmt); - msg = luaO_pushvfstring(L, fmt, argp); - va_end(argp); - return msg; -} - - -/* number of chars of a literal string without the ending \0 */ -#define LL(x) (sizeof(x)/sizeof(char) - 1) - -#define RETS "..." -#define PRE "[string \"" -#define POS "\"]" - -#define addstr(a,b,l) ( memcpy(a,b,(l) * sizeof(char)), a += (l) ) - -void luaO_chunkid (char *out, const char *source, size_t bufflen) { - size_t l = strlen(source); - if (*source == '=') { /* 'literal' source */ - if (l <= bufflen) /* small enough? */ - memcpy(out, source + 1, l * sizeof(char)); - else { /* truncate it */ - addstr(out, source + 1, bufflen - 1); - *out = '\0'; - } - } - else if (*source == '@') { /* file name */ - if (l <= bufflen) /* small enough? */ - memcpy(out, source + 1, l * sizeof(char)); - else { /* add '...' before rest of name */ - addstr(out, RETS, LL(RETS)); - bufflen -= LL(RETS); - memcpy(out, source + 1 + l - bufflen, bufflen * sizeof(char)); - } - } - else { /* string; format as [string "source"] */ - const char *nl = strchr(source, '\n'); /* find first new line (if any) */ - addstr(out, PRE, LL(PRE)); /* add prefix */ - bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ - if (l < bufflen && nl == NULL) { /* small one-line source? */ - addstr(out, source, l); /* keep it */ - } - else { - if (nl != NULL) l = nl - source; /* stop at first newline */ - if (l > bufflen) l = bufflen; - addstr(out, source, l); - addstr(out, RETS, LL(RETS)); - } - memcpy(out, POS, (LL(POS) + 1) * sizeof(char)); - } -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lstring.c b/3rdparty/genie/src/host/lua-5.2.3/src/lstring.c deleted file mode 100644 index af96c89c183..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lstring.c +++ /dev/null @@ -1,185 +0,0 @@ -/* -** $Id: lstring.c,v 2.26.1.1 2013/04/12 18:48:47 roberto Exp $ -** String table (keeps all strings handled by Lua) -** See Copyright Notice in lua.h -*/ - - -#include <string.h> - -#define lstring_c -#define LUA_CORE - -#include "lua.h" - -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" - - -/* -** Lua will use at most ~(2^LUAI_HASHLIMIT) bytes from a string to -** compute its hash -*/ -#if !defined(LUAI_HASHLIMIT) -#define LUAI_HASHLIMIT 5 -#endif - - -/* -** equality for long strings -*/ -int luaS_eqlngstr (TString *a, TString *b) { - size_t len = a->tsv.len; - lua_assert(a->tsv.tt == LUA_TLNGSTR && b->tsv.tt == LUA_TLNGSTR); - return (a == b) || /* same instance or... */ - ((len == b->tsv.len) && /* equal length and ... */ - (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ -} - - -/* -** equality for strings -*/ -int luaS_eqstr (TString *a, TString *b) { - return (a->tsv.tt == b->tsv.tt) && - (a->tsv.tt == LUA_TSHRSTR ? eqshrstr(a, b) : luaS_eqlngstr(a, b)); -} - - -unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { - unsigned int h = seed ^ cast(unsigned int, l); - size_t l1; - size_t step = (l >> LUAI_HASHLIMIT) + 1; - for (l1 = l; l1 >= step; l1 -= step) - h = h ^ ((h<<5) + (h>>2) + cast_byte(str[l1 - 1])); - return h; -} - - -/* -** resizes the string table -*/ -void luaS_resize (lua_State *L, int newsize) { - int i; - stringtable *tb = &G(L)->strt; - /* cannot resize while GC is traversing strings */ - luaC_runtilstate(L, ~bitmask(GCSsweepstring)); - if (newsize > tb->size) { - luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); - for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; - } - /* rehash */ - for (i=0; i<tb->size; i++) { - GCObject *p = tb->hash[i]; - tb->hash[i] = NULL; - while (p) { /* for each node in the list */ - GCObject *next = gch(p)->next; /* save next */ - unsigned int h = lmod(gco2ts(p)->hash, newsize); /* new position */ - gch(p)->next = tb->hash[h]; /* chain it */ - tb->hash[h] = p; - resetoldbit(p); /* see MOVE OLD rule */ - p = next; - } - } - if (newsize < tb->size) { - /* shrinking slice must be empty */ - lua_assert(tb->hash[newsize] == NULL && tb->hash[tb->size - 1] == NULL); - luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); - } - tb->size = newsize; -} - - -/* -** creates a new string object -*/ -static TString *createstrobj (lua_State *L, const char *str, size_t l, - int tag, unsigned int h, GCObject **list) { - TString *ts; - size_t totalsize; /* total size of TString object */ - totalsize = sizeof(TString) + ((l + 1) * sizeof(char)); - ts = &luaC_newobj(L, tag, totalsize, list, 0)->ts; - ts->tsv.len = l; - ts->tsv.hash = h; - ts->tsv.extra = 0; - memcpy(ts+1, str, l*sizeof(char)); - ((char *)(ts+1))[l] = '\0'; /* ending 0 */ - return ts; -} - - -/* -** creates a new short string, inserting it into string table -*/ -static TString *newshrstr (lua_State *L, const char *str, size_t l, - unsigned int h) { - GCObject **list; /* (pointer to) list where it will be inserted */ - stringtable *tb = &G(L)->strt; - TString *s; - if (tb->nuse >= cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) - luaS_resize(L, tb->size*2); /* too crowded */ - list = &tb->hash[lmod(h, tb->size)]; - s = createstrobj(L, str, l, LUA_TSHRSTR, h, list); - tb->nuse++; - return s; -} - - -/* -** checks whether short string exists and reuses it or creates a new one -*/ -static TString *internshrstr (lua_State *L, const char *str, size_t l) { - GCObject *o; - global_State *g = G(L); - unsigned int h = luaS_hash(str, l, g->seed); - for (o = g->strt.hash[lmod(h, g->strt.size)]; - o != NULL; - o = gch(o)->next) { - TString *ts = rawgco2ts(o); - if (h == ts->tsv.hash && - l == ts->tsv.len && - (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { - if (isdead(G(L), o)) /* string is dead (but was not collected yet)? */ - changewhite(o); /* resurrect it */ - return ts; - } - } - return newshrstr(L, str, l, h); /* not found; create a new string */ -} - - -/* -** new string (with explicit length) -*/ -TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { - if (l <= LUAI_MAXSHORTLEN) /* short string? */ - return internshrstr(L, str, l); - else { - if (l + 1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) - luaM_toobig(L); - return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed, NULL); - } -} - - -/* -** new zero-terminated string -*/ -TString *luaS_new (lua_State *L, const char *str) { - return luaS_newlstr(L, str, strlen(str)); -} - - -Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { - Udata *u; - if (s > MAX_SIZET - sizeof(Udata)) - luaM_toobig(L); - u = &luaC_newobj(L, LUA_TUSERDATA, sizeof(Udata) + s, NULL, 0)->u; - u->uv.len = s; - u->uv.metatable = NULL; - u->uv.env = e; - return u; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ltablib.c b/3rdparty/genie/src/host/lua-5.2.3/src/ltablib.c deleted file mode 100644 index 6001224e39b..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ltablib.c +++ /dev/null @@ -1,283 +0,0 @@ -/* -** $Id: ltablib.c,v 1.65.1.1 2013/04/12 18:48:47 roberto Exp $ -** Library for Table Manipulation -** See Copyright Notice in lua.h -*/ - - -#include <stddef.h> - -#define ltablib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n)) - - - -#if defined(LUA_COMPAT_MAXN) -static int maxn (lua_State *L) { - lua_Number max = 0; - luaL_checktype(L, 1, LUA_TTABLE); - lua_pushnil(L); /* first key */ - while (lua_next(L, 1)) { - lua_pop(L, 1); /* remove value */ - if (lua_type(L, -1) == LUA_TNUMBER) { - lua_Number v = lua_tonumber(L, -1); - if (v > max) max = v; - } - } - lua_pushnumber(L, max); - return 1; -} -#endif - - -static int tinsert (lua_State *L) { - int e = aux_getn(L, 1) + 1; /* first empty element */ - int pos; /* where to insert new element */ - switch (lua_gettop(L)) { - case 2: { /* called with only 2 arguments */ - pos = e; /* insert new element at the end */ - break; - } - case 3: { - int i; - pos = luaL_checkint(L, 2); /* 2nd argument is the position */ - luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds"); - for (i = e; i > pos; i--) { /* move up elements */ - lua_rawgeti(L, 1, i-1); - lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ - } - break; - } - default: { - return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); - } - } - lua_rawseti(L, 1, pos); /* t[pos] = v */ - return 0; -} - - -static int tremove (lua_State *L) { - int size = aux_getn(L, 1); - int pos = luaL_optint(L, 2, size); - if (pos != size) /* validate 'pos' if given */ - luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds"); - lua_rawgeti(L, 1, pos); /* result = t[pos] */ - for ( ; pos < size; pos++) { - lua_rawgeti(L, 1, pos+1); - lua_rawseti(L, 1, pos); /* t[pos] = t[pos+1] */ - } - lua_pushnil(L); - lua_rawseti(L, 1, pos); /* t[pos] = nil */ - return 1; -} - - -static void addfield (lua_State *L, luaL_Buffer *b, int i) { - lua_rawgeti(L, 1, i); - if (!lua_isstring(L, -1)) - luaL_error(L, "invalid value (%s) at index %d in table for " - LUA_QL("concat"), luaL_typename(L, -1), i); - luaL_addvalue(b); -} - - -static int tconcat (lua_State *L) { - luaL_Buffer b; - size_t lsep; - int i, last; - const char *sep = luaL_optlstring(L, 2, "", &lsep); - luaL_checktype(L, 1, LUA_TTABLE); - i = luaL_optint(L, 3, 1); - last = luaL_opt(L, luaL_checkint, 4, luaL_len(L, 1)); - luaL_buffinit(L, &b); - for (; i < last; i++) { - addfield(L, &b, i); - luaL_addlstring(&b, sep, lsep); - } - if (i == last) /* add last value (if interval was not empty) */ - addfield(L, &b, i); - luaL_pushresult(&b); - return 1; -} - - -/* -** {====================================================== -** Pack/unpack -** ======================================================= -*/ - -static int pack (lua_State *L) { - int n = lua_gettop(L); /* number of elements to pack */ - lua_createtable(L, n, 1); /* create result table */ - lua_pushinteger(L, n); - lua_setfield(L, -2, "n"); /* t.n = number of elements */ - if (n > 0) { /* at least one element? */ - int i; - lua_pushvalue(L, 1); - lua_rawseti(L, -2, 1); /* insert first element */ - lua_replace(L, 1); /* move table into index 1 */ - for (i = n; i >= 2; i--) /* assign other elements */ - lua_rawseti(L, 1, i); - } - return 1; /* return table */ -} - - -static int unpack (lua_State *L) { - int i, e, n; - luaL_checktype(L, 1, LUA_TTABLE); - i = luaL_optint(L, 2, 1); - e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1)); - if (i > e) return 0; /* empty range */ - n = e - i + 1; /* number of elements */ - if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ - return luaL_error(L, "too many results to unpack"); - lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ - while (i++ < e) /* push arg[i + 1...e] */ - lua_rawgeti(L, 1, i); - return n; -} - -/* }====================================================== */ - - - -/* -** {====================================================== -** Quicksort -** (based on `Algorithms in MODULA-3', Robert Sedgewick; -** Addison-Wesley, 1993.) -** ======================================================= -*/ - - -static void set2 (lua_State *L, int i, int j) { - lua_rawseti(L, 1, i); - lua_rawseti(L, 1, j); -} - -static int sort_comp (lua_State *L, int a, int b) { - if (!lua_isnil(L, 2)) { /* function? */ - int res; - lua_pushvalue(L, 2); - lua_pushvalue(L, a-1); /* -1 to compensate function */ - lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ - lua_call(L, 2, 1); - res = lua_toboolean(L, -1); - lua_pop(L, 1); - return res; - } - else /* a < b? */ - return lua_compare(L, a, b, LUA_OPLT); -} - -static void auxsort (lua_State *L, int l, int u) { - while (l < u) { /* for tail recursion */ - int i, j; - /* sort elements a[l], a[(l+u)/2] and a[u] */ - lua_rawgeti(L, 1, l); - lua_rawgeti(L, 1, u); - if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */ - set2(L, l, u); /* swap a[l] - a[u] */ - else - lua_pop(L, 2); - if (u-l == 1) break; /* only 2 elements */ - i = (l+u)/2; - lua_rawgeti(L, 1, i); - lua_rawgeti(L, 1, l); - if (sort_comp(L, -2, -1)) /* a[i]<a[l]? */ - set2(L, i, l); - else { - lua_pop(L, 1); /* remove a[l] */ - lua_rawgeti(L, 1, u); - if (sort_comp(L, -1, -2)) /* a[u]<a[i]? */ - set2(L, i, u); - else - lua_pop(L, 2); - } - if (u-l == 2) break; /* only 3 elements */ - lua_rawgeti(L, 1, i); /* Pivot */ - lua_pushvalue(L, -1); - lua_rawgeti(L, 1, u-1); - set2(L, i, u-1); - /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */ - i = l; j = u-1; - for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */ - /* repeat ++i until a[i] >= P */ - while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { - if (i>=u) luaL_error(L, "invalid order function for sorting"); - lua_pop(L, 1); /* remove a[i] */ - } - /* repeat --j until a[j] <= P */ - while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { - if (j<=l) luaL_error(L, "invalid order function for sorting"); - lua_pop(L, 1); /* remove a[j] */ - } - if (j<i) { - lua_pop(L, 3); /* pop pivot, a[i], a[j] */ - break; - } - set2(L, i, j); - } - lua_rawgeti(L, 1, u-1); - lua_rawgeti(L, 1, i); - set2(L, u-1, i); /* swap pivot (a[u-1]) with a[i] */ - /* a[l..i-1] <= a[i] == P <= a[i+1..u] */ - /* adjust so that smaller half is in [j..i] and larger one in [l..u] */ - if (i-l < u-i) { - j=l; i=i-1; l=i+2; - } - else { - j=i+1; i=u; u=j-2; - } - auxsort(L, j, i); /* call recursively the smaller one */ - } /* repeat the routine for the larger one */ -} - -static int sort (lua_State *L) { - int n = aux_getn(L, 1); - luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */ - if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ - luaL_checktype(L, 2, LUA_TFUNCTION); - lua_settop(L, 2); /* make sure there is two arguments */ - auxsort(L, 1, n); - return 0; -} - -/* }====================================================== */ - - -static const luaL_Reg tab_funcs[] = { - {"concat", tconcat}, -#if defined(LUA_COMPAT_MAXN) - {"maxn", maxn}, -#endif - {"insert", tinsert}, - {"pack", pack}, - {"unpack", unpack}, - {"remove", tremove}, - {"sort", sort}, - {NULL, NULL} -}; - - -LUAMOD_API int luaopen_table (lua_State *L) { - luaL_newlib(L, tab_funcs); -#if defined(LUA_COMPAT_UNPACK) - /* _G.unpack = table.unpack */ - lua_getfield(L, -1, "unpack"); - lua_setglobal(L, "unpack"); -#endif - return 1; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ltm.c b/3rdparty/genie/src/host/lua-5.2.3/src/ltm.c deleted file mode 100644 index 69b4ed77271..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ltm.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -** $Id: ltm.c,v 2.14.1.1 2013/04/12 18:48:47 roberto Exp $ -** Tag methods -** See Copyright Notice in lua.h -*/ - - -#include <string.h> - -#define ltm_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" - - -static const char udatatypename[] = "userdata"; - -LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = { - "no value", - "nil", "boolean", udatatypename, "number", - "string", "table", "function", udatatypename, "thread", - "proto", "upval" /* these last two cases are used for tests only */ -}; - - -void luaT_init (lua_State *L) { - static const char *const luaT_eventname[] = { /* ORDER TM */ - "__index", "__newindex", - "__gc", "__mode", "__len", "__eq", - "__add", "__sub", "__mul", "__div", "__mod", - "__pow", "__unm", "__lt", "__le", - "__concat", "__call" - }; - int i; - for (i=0; i<TM_N; i++) { - G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); - luaS_fix(G(L)->tmname[i]); /* never collect these names */ - } -} - - -/* -** function to be used with macro "fasttm": optimized for absence of -** tag methods -*/ -const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { - const TValue *tm = luaH_getstr(events, ename); - lua_assert(event <= TM_EQ); - if (ttisnil(tm)) { /* no tag method? */ - events->flags |= cast_byte(1u<<event); /* cache this fact */ - return NULL; - } - else return tm; -} - - -const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { - Table *mt; - switch (ttypenv(o)) { - case LUA_TTABLE: - mt = hvalue(o)->metatable; - break; - case LUA_TUSERDATA: - mt = uvalue(o)->metatable; - break; - default: - mt = G(L)->mt[ttypenv(o)]; - } - return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lua.c b/3rdparty/genie/src/host/lua-5.2.3/src/lua.c deleted file mode 100644 index 4345e554e92..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lua.c +++ /dev/null @@ -1,497 +0,0 @@ -/* -** $Id: lua.c,v 1.206.1.1 2013/04/12 18:48:47 roberto Exp $ -** Lua stand-alone interpreter -** See Copyright Notice in lua.h -*/ - - -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#define lua_c - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#if !defined(LUA_PROMPT) -#define LUA_PROMPT "> " -#define LUA_PROMPT2 ">> " -#endif - -#if !defined(LUA_PROGNAME) -#define LUA_PROGNAME "lua" -#endif - -#if !defined(LUA_MAXINPUT) -#define LUA_MAXINPUT 512 -#endif - -#if !defined(LUA_INIT) -#define LUA_INIT "LUA_INIT" -#endif - -#define LUA_INITVERSION \ - LUA_INIT "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR - - -/* -** lua_stdin_is_tty detects whether the standard input is a 'tty' (that -** is, whether we're running lua interactively). -*/ -#if defined(LUA_USE_ISATTY) -#include <unistd.h> -#define lua_stdin_is_tty() isatty(0) -#elif defined(LUA_WIN) -#include <io.h> -#include <stdio.h> -#define lua_stdin_is_tty() _isatty(_fileno(stdin)) -#else -#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ -#endif - - -/* -** lua_readline defines how to show a prompt and then read a line from -** the standard input. -** lua_saveline defines how to "save" a read line in a "history". -** lua_freeline defines how to free a line read by lua_readline. -*/ -#if defined(LUA_USE_READLINE) - -#include <stdio.h> -#include <readline/readline.h> -#include <readline/history.h> -#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) -#define lua_saveline(L,idx) \ - if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \ - add_history(lua_tostring(L, idx)); /* add it to history */ -#define lua_freeline(L,b) ((void)L, free(b)) - -#elif !defined(lua_readline) - -#define lua_readline(L,b,p) \ - ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ - fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ -#define lua_saveline(L,idx) { (void)L; (void)idx; } -#define lua_freeline(L,b) { (void)L; (void)b; } - -#endif - - - - -static lua_State *globalL = NULL; - -static const char *progname = LUA_PROGNAME; - - - -static void lstop (lua_State *L, lua_Debug *ar) { - (void)ar; /* unused arg. */ - lua_sethook(L, NULL, 0, 0); - luaL_error(L, "interrupted!"); -} - - -static void laction (int i) { - signal(i, SIG_DFL); /* if another SIGINT happens before lstop, - terminate process (default action) */ - lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); -} - - -static void print_usage (const char *badoption) { - luai_writestringerror("%s: ", progname); - if (badoption[1] == 'e' || badoption[1] == 'l') - luai_writestringerror("'%s' needs argument\n", badoption); - else - luai_writestringerror("unrecognized option '%s'\n", badoption); - luai_writestringerror( - "usage: %s [options] [script [args]]\n" - "Available options are:\n" - " -e stat execute string " LUA_QL("stat") "\n" - " -i enter interactive mode after executing " LUA_QL("script") "\n" - " -l name require library " LUA_QL("name") "\n" - " -v show version information\n" - " -E ignore environment variables\n" - " -- stop handling options\n" - " - stop handling options and execute stdin\n" - , - progname); -} - - -static void l_message (const char *pname, const char *msg) { - if (pname) luai_writestringerror("%s: ", pname); - luai_writestringerror("%s\n", msg); -} - - -static int report (lua_State *L, int status) { - if (status != LUA_OK && !lua_isnil(L, -1)) { - const char *msg = lua_tostring(L, -1); - if (msg == NULL) msg = "(error object is not a string)"; - l_message(progname, msg); - lua_pop(L, 1); - /* force a complete garbage collection in case of errors */ - lua_gc(L, LUA_GCCOLLECT, 0); - } - return status; -} - - -/* the next function is called unprotected, so it must avoid errors */ -static void finalreport (lua_State *L, int status) { - if (status != LUA_OK) { - const char *msg = (lua_type(L, -1) == LUA_TSTRING) ? lua_tostring(L, -1) - : NULL; - if (msg == NULL) msg = "(error object is not a string)"; - l_message(progname, msg); - lua_pop(L, 1); - } -} - - -static int traceback (lua_State *L) { - const char *msg = lua_tostring(L, 1); - if (msg) - luaL_traceback(L, L, msg, 1); - else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */ - if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ - lua_pushliteral(L, "(no error message)"); - } - return 1; -} - - -static int docall (lua_State *L, int narg, int nres) { - int status; - int base = lua_gettop(L) - narg; /* function index */ - lua_pushcfunction(L, traceback); /* push traceback function */ - lua_insert(L, base); /* put it under chunk and args */ - globalL = L; /* to be available to 'laction' */ - signal(SIGINT, laction); - status = lua_pcall(L, narg, nres, base); - signal(SIGINT, SIG_DFL); - lua_remove(L, base); /* remove traceback function */ - return status; -} - - -static void print_version (void) { - luai_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); - luai_writeline(); -} - - -static int getargs (lua_State *L, char **argv, int n) { - int narg; - int i; - int argc = 0; - while (argv[argc]) argc++; /* count total number of arguments */ - narg = argc - (n + 1); /* number of arguments to the script */ - luaL_checkstack(L, narg + 3, "too many arguments to script"); - for (i=n+1; i < argc; i++) - lua_pushstring(L, argv[i]); - lua_createtable(L, narg, n + 1); - for (i=0; i < argc; i++) { - lua_pushstring(L, argv[i]); - lua_rawseti(L, -2, i - n); - } - return narg; -} - - -static int dofile (lua_State *L, const char *name) { - int status = luaL_loadfile(L, name); - if (status == LUA_OK) status = docall(L, 0, 0); - return report(L, status); -} - - -static int dostring (lua_State *L, const char *s, const char *name) { - int status = luaL_loadbuffer(L, s, strlen(s), name); - if (status == LUA_OK) status = docall(L, 0, 0); - return report(L, status); -} - - -static int dolibrary (lua_State *L, const char *name) { - int status; - lua_getglobal(L, "require"); - lua_pushstring(L, name); - status = docall(L, 1, 1); /* call 'require(name)' */ - if (status == LUA_OK) - lua_setglobal(L, name); /* global[name] = require return */ - return report(L, status); -} - - -static const char *get_prompt (lua_State *L, int firstline) { - const char *p; - lua_getglobal(L, firstline ? "_PROMPT" : "_PROMPT2"); - p = lua_tostring(L, -1); - if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); - return p; -} - -/* mark in error messages for incomplete statements */ -#define EOFMARK "<eof>" -#define marklen (sizeof(EOFMARK)/sizeof(char) - 1) - -static int incomplete (lua_State *L, int status) { - if (status == LUA_ERRSYNTAX) { - size_t lmsg; - const char *msg = lua_tolstring(L, -1, &lmsg); - if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) { - lua_pop(L, 1); - return 1; - } - } - return 0; /* else... */ -} - - -static int pushline (lua_State *L, int firstline) { - char buffer[LUA_MAXINPUT]; - char *b = buffer; - size_t l; - const char *prmt = get_prompt(L, firstline); - int readstatus = lua_readline(L, b, prmt); - lua_pop(L, 1); /* remove result from 'get_prompt' */ - if (readstatus == 0) - return 0; /* no input */ - l = strlen(b); - if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ - b[l-1] = '\0'; /* remove it */ - if (firstline && b[0] == '=') /* first line starts with `=' ? */ - lua_pushfstring(L, "return %s", b+1); /* change it to `return' */ - else - lua_pushstring(L, b); - lua_freeline(L, b); - return 1; -} - - -static int loadline (lua_State *L) { - int status; - lua_settop(L, 0); - if (!pushline(L, 1)) - return -1; /* no input */ - for (;;) { /* repeat until gets a complete line */ - size_t l; - const char *line = lua_tolstring(L, 1, &l); - status = luaL_loadbuffer(L, line, l, "=stdin"); - if (!incomplete(L, status)) break; /* cannot try to add lines? */ - if (!pushline(L, 0)) /* no more input? */ - return -1; - lua_pushliteral(L, "\n"); /* add a new line... */ - lua_insert(L, -2); /* ...between the two lines */ - lua_concat(L, 3); /* join them */ - } - lua_saveline(L, 1); - lua_remove(L, 1); /* remove line */ - return status; -} - - -static void dotty (lua_State *L) { - int status; - const char *oldprogname = progname; - progname = NULL; - while ((status = loadline(L)) != -1) { - if (status == LUA_OK) status = docall(L, 0, LUA_MULTRET); - report(L, status); - if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ - luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); - lua_getglobal(L, "print"); - lua_insert(L, 1); - if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) - l_message(progname, lua_pushfstring(L, - "error calling " LUA_QL("print") " (%s)", - lua_tostring(L, -1))); - } - } - lua_settop(L, 0); /* clear stack */ - luai_writeline(); - progname = oldprogname; -} - - -static int handle_script (lua_State *L, char **argv, int n) { - int status; - const char *fname; - int narg = getargs(L, argv, n); /* collect arguments */ - lua_setglobal(L, "arg"); - fname = argv[n]; - if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) - fname = NULL; /* stdin */ - status = luaL_loadfile(L, fname); - lua_insert(L, -(narg+1)); - if (status == LUA_OK) - status = docall(L, narg, LUA_MULTRET); - else - lua_pop(L, narg); - return report(L, status); -} - - -/* check that argument has no extra characters at the end */ -#define noextrachars(x) {if ((x)[2] != '\0') return -1;} - - -/* indices of various argument indicators in array args */ -#define has_i 0 /* -i */ -#define has_v 1 /* -v */ -#define has_e 2 /* -e */ -#define has_E 3 /* -E */ - -#define num_has 4 /* number of 'has_*' */ - - -static int collectargs (char **argv, int *args) { - int i; - for (i = 1; argv[i] != NULL; i++) { - if (argv[i][0] != '-') /* not an option? */ - return i; - switch (argv[i][1]) { /* option */ - case '-': - noextrachars(argv[i]); - return (argv[i+1] != NULL ? i+1 : 0); - case '\0': - return i; - case 'E': - args[has_E] = 1; - break; - case 'i': - noextrachars(argv[i]); - args[has_i] = 1; /* go through */ - case 'v': - noextrachars(argv[i]); - args[has_v] = 1; - break; - case 'e': - args[has_e] = 1; /* go through */ - case 'l': /* both options need an argument */ - if (argv[i][2] == '\0') { /* no concatenated argument? */ - i++; /* try next 'argv' */ - if (argv[i] == NULL || argv[i][0] == '-') - return -(i - 1); /* no next argument or it is another option */ - } - break; - default: /* invalid option; return its index... */ - return -i; /* ...as a negative value */ - } - } - return 0; -} - - -static int runargs (lua_State *L, char **argv, int n) { - int i; - for (i = 1; i < n; i++) { - lua_assert(argv[i][0] == '-'); - switch (argv[i][1]) { /* option */ - case 'e': { - const char *chunk = argv[i] + 2; - if (*chunk == '\0') chunk = argv[++i]; - lua_assert(chunk != NULL); - if (dostring(L, chunk, "=(command line)") != LUA_OK) - return 0; - break; - } - case 'l': { - const char *filename = argv[i] + 2; - if (*filename == '\0') filename = argv[++i]; - lua_assert(filename != NULL); - if (dolibrary(L, filename) != LUA_OK) - return 0; /* stop if file fails */ - break; - } - default: break; - } - } - return 1; -} - - -static int handle_luainit (lua_State *L) { - const char *name = "=" LUA_INITVERSION; - const char *init = getenv(name + 1); - if (init == NULL) { - name = "=" LUA_INIT; - init = getenv(name + 1); /* try alternative name */ - } - if (init == NULL) return LUA_OK; - else if (init[0] == '@') - return dofile(L, init+1); - else - return dostring(L, init, name); -} - - -static int pmain (lua_State *L) { - int argc = (int)lua_tointeger(L, 1); - char **argv = (char **)lua_touserdata(L, 2); - int script; - int args[num_has]; - args[has_i] = args[has_v] = args[has_e] = args[has_E] = 0; - if (argv[0] && argv[0][0]) progname = argv[0]; - script = collectargs(argv, args); - if (script < 0) { /* invalid arg? */ - print_usage(argv[-script]); - return 0; - } - if (args[has_v]) print_version(); - if (args[has_E]) { /* option '-E'? */ - lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */ - lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); - } - /* open standard libraries */ - luaL_checkversion(L); - lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ - luaL_openlibs(L); /* open libraries */ - lua_gc(L, LUA_GCRESTART, 0); - if (!args[has_E] && handle_luainit(L) != LUA_OK) - return 0; /* error running LUA_INIT */ - /* execute arguments -e and -l */ - if (!runargs(L, argv, (script > 0) ? script : argc)) return 0; - /* execute main script (if there is one) */ - if (script && handle_script(L, argv, script) != LUA_OK) return 0; - if (args[has_i]) /* -i option? */ - dotty(L); - else if (script == 0 && !args[has_e] && !args[has_v]) { /* no arguments? */ - if (lua_stdin_is_tty()) { - print_version(); - dotty(L); - } - else dofile(L, NULL); /* executes stdin as a file */ - } - lua_pushboolean(L, 1); /* signal no errors */ - return 1; -} - - -int main (int argc, char **argv) { - int status, result; - lua_State *L = luaL_newstate(); /* create state */ - if (L == NULL) { - l_message(argv[0], "cannot create state: not enough memory"); - return EXIT_FAILURE; - } - /* call 'pmain' in protected mode */ - lua_pushcfunction(L, &pmain); - lua_pushinteger(L, argc); /* 1st argument */ - lua_pushlightuserdata(L, argv); /* 2nd argument */ - status = lua_pcall(L, 2, 1, 0); - result = lua_toboolean(L, -1); /* get result */ - finalreport(L, status); - lua_close(L); - return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/luaconf.h b/3rdparty/genie/src/host/lua-5.2.3/src/luaconf.h deleted file mode 100644 index 18be9a9e436..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/luaconf.h +++ /dev/null @@ -1,551 +0,0 @@ -/* -** $Id: luaconf.h,v 1.176.1.1 2013/04/12 18:48:47 roberto Exp $ -** Configuration file for Lua -** See Copyright Notice in lua.h -*/ - - -#ifndef lconfig_h -#define lconfig_h - -#include <limits.h> -#include <stddef.h> - - -/* -** ================================================================== -** Search for "@@" to find all configurable definitions. -** =================================================================== -*/ - - -/* -@@ LUA_ANSI controls the use of non-ansi features. -** CHANGE it (define it) if you want Lua to avoid the use of any -** non-ansi feature or library. -*/ -#if !defined(LUA_ANSI) && defined(__STRICT_ANSI__) -#define LUA_ANSI -#endif - - -#if !defined(LUA_ANSI) && defined(_WIN32) && !defined(_WIN32_WCE) -#define LUA_WIN /* enable goodies for regular Windows platforms */ -#endif - -#if defined(LUA_WIN) -#define LUA_DL_DLL -#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */ -#endif - - - -#if defined(LUA_USE_LINUX) -#define LUA_USE_POSIX -#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ -#define LUA_USE_READLINE /* needs some extra libraries */ -#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */ -#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */ -#define LUA_USE_LONGLONG /* assume support for long long */ -#endif - -#if defined(LUA_USE_MACOSX) -#define LUA_USE_POSIX -#define LUA_USE_DLOPEN /* does not need -ldl */ -#define LUA_USE_READLINE /* needs an extra library: -lreadline */ -#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */ -#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */ -#define LUA_USE_LONGLONG /* assume support for long long */ -#endif - - - -/* -@@ LUA_USE_POSIX includes all functionality listed as X/Open System -@* Interfaces Extension (XSI). -** CHANGE it (define it) if your system is XSI compatible. -*/ -#if defined(LUA_USE_POSIX) -#define LUA_USE_MKSTEMP -#define LUA_USE_ISATTY -#define LUA_USE_POPEN -#define LUA_USE_ULONGJMP -#define LUA_USE_GMTIME_R -#endif - - - -/* -@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for -@* Lua libraries. -@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for -@* C libraries. -** CHANGE them if your machine has a non-conventional directory -** hierarchy or if you want to install your libraries in -** non-conventional directories. -*/ -#if defined(_WIN32) /* { */ -/* -** In Windows, any exclamation mark ('!') in the path is replaced by the -** path of the directory of the executable file of the current process. -*/ -#define LUA_LDIR "!\\lua\\" -#define LUA_CDIR "!\\" -#define LUA_PATH_DEFAULT \ - LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" ".\\?.lua" -#define LUA_CPATH_DEFAULT \ - LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" ".\\?.dll" - -#else /* }{ */ - -#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/" -#define LUA_ROOT "/usr/local/" -#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR -#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR -#define LUA_PATH_DEFAULT \ - LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua" -#define LUA_CPATH_DEFAULT \ - LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" -#endif /* } */ - - -/* -@@ LUA_DIRSEP is the directory separator (for submodules). -** CHANGE it if your machine does not use "/" as the directory separator -** and is not Windows. (On Windows Lua automatically uses "\".) -*/ -#if defined(_WIN32) -#define LUA_DIRSEP "\\" -#else -#define LUA_DIRSEP "/" -#endif - - -/* -@@ LUA_ENV is the name of the variable that holds the current -@@ environment, used to access global names. -** CHANGE it if you do not like this name. -*/ -#define LUA_ENV "_ENV" - - -/* -@@ LUA_API is a mark for all core API functions. -@@ LUALIB_API is a mark for all auxiliary library functions. -@@ LUAMOD_API is a mark for all standard library opening functions. -** CHANGE them if you need to define those functions in some special way. -** For instance, if you want to create one Windows DLL with the core and -** the libraries, you may want to use the following definition (define -** LUA_BUILD_AS_DLL to get it). -*/ -#if defined(LUA_BUILD_AS_DLL) /* { */ - -#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ -#define LUA_API __declspec(dllexport) -#else /* }{ */ -#define LUA_API __declspec(dllimport) -#endif /* } */ - -#else /* }{ */ - -#define LUA_API extern - -#endif /* } */ - - -/* more often than not the libs go together with the core */ -#define LUALIB_API LUA_API -#define LUAMOD_API LUALIB_API - - -/* -@@ LUAI_FUNC is a mark for all extern functions that are not to be -@* exported to outside modules. -@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables -@* that are not to be exported to outside modules (LUAI_DDEF for -@* definitions and LUAI_DDEC for declarations). -** CHANGE them if you need to mark them in some special way. Elf/gcc -** (versions 3.2 and later) mark them as "hidden" to optimize access -** when Lua is compiled as a shared library. Not all elf targets support -** this attribute. Unfortunately, gcc does not offer a way to check -** whether the target offers that support, and those without support -** give a warning about it. To avoid these warnings, change to the -** default definition. -*/ -#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) /* { */ -#define LUAI_FUNC __attribute__((visibility("hidden"))) extern -#define LUAI_DDEC LUAI_FUNC -#define LUAI_DDEF /* empty */ - -#else /* }{ */ -#define LUAI_FUNC extern -#define LUAI_DDEC extern -#define LUAI_DDEF /* empty */ -#endif /* } */ - - - -/* -@@ LUA_QL describes how error messages quote program elements. -** CHANGE it if you want a different appearance. -*/ -#define LUA_QL(x) "'" x "'" -#define LUA_QS LUA_QL("%s") - - -/* -@@ LUA_IDSIZE gives the maximum size for the description of the source -@* of a function in debug information. -** CHANGE it if you want a different size. -*/ -#define LUA_IDSIZE 60 - - -/* -@@ luai_writestring/luai_writeline define how 'print' prints its results. -** They are only used in libraries and the stand-alone program. (The #if -** avoids including 'stdio.h' everywhere.) -*/ -#if defined(LUA_LIB) || defined(lua_c) -#include <stdio.h> -#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) -#define luai_writeline() (luai_writestring("\n", 1), fflush(stdout)) -#endif - -/* -@@ luai_writestringerror defines how to print error messages. -** (A format string with one argument is enough for Lua...) -*/ -#define luai_writestringerror(s,p) \ - (fprintf(stderr, (s), (p)), fflush(stderr)) - - -/* -@@ LUAI_MAXSHORTLEN is the maximum length for short strings, that is, -** strings that are internalized. (Cannot be smaller than reserved words -** or tags for metamethods, as these strings must be internalized; -** #("function") = 8, #("__newindex") = 10.) -*/ -#define LUAI_MAXSHORTLEN 40 - - - -/* -** {================================================================== -** Compatibility with previous versions -** =================================================================== -*/ - -/* -@@ LUA_COMPAT_ALL controls all compatibility options. -** You can define it to get all options, or change specific options -** to fit your specific needs. -*/ -#if defined(LUA_COMPAT_ALL) /* { */ - -/* -@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. -** You can replace it with 'table.unpack'. -*/ -#define LUA_COMPAT_UNPACK - -/* -@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. -** You can replace it with 'package.searchers'. -*/ -#define LUA_COMPAT_LOADERS - -/* -@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. -** You can call your C function directly (with light C functions). -*/ -#define lua_cpcall(L,f,u) \ - (lua_pushcfunction(L, (f)), \ - lua_pushlightuserdata(L,(u)), \ - lua_pcall(L,1,0,0)) - - -/* -@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. -** You can rewrite 'log10(x)' as 'log(x, 10)'. -*/ -#define LUA_COMPAT_LOG10 - -/* -@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base -** library. You can rewrite 'loadstring(s)' as 'load(s)'. -*/ -#define LUA_COMPAT_LOADSTRING - -/* -@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. -*/ -#define LUA_COMPAT_MAXN - -/* -@@ The following macros supply trivial compatibility for some -** changes in the API. The macros themselves document how to -** change your code to avoid using them. -*/ -#define lua_strlen(L,i) lua_rawlen(L, (i)) - -#define lua_objlen(L,i) lua_rawlen(L, (i)) - -#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) -#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) - -/* -@@ LUA_COMPAT_MODULE controls compatibility with previous -** module functions 'module' (Lua) and 'luaL_register' (C). -*/ -#define LUA_COMPAT_MODULE - -#endif /* } */ - -/* }================================================================== */ - - - -/* -@@ LUAI_BITSINT defines the number of bits in an int. -** CHANGE here if Lua cannot automatically detect the number of bits of -** your machine. Probably you do not need to change this. -*/ -/* avoid overflows in comparison */ -#if INT_MAX-20 < 32760 /* { */ -#define LUAI_BITSINT 16 -#elif INT_MAX > 2147483640L /* }{ */ -/* int has at least 32 bits */ -#define LUAI_BITSINT 32 -#else /* }{ */ -#error "you must define LUA_BITSINT with number of bits in an integer" -#endif /* } */ - - -/* -@@ LUA_INT32 is an signed integer with exactly 32 bits. -@@ LUAI_UMEM is an unsigned integer big enough to count the total -@* memory used by Lua. -@@ LUAI_MEM is a signed integer big enough to count the total memory -@* used by Lua. -** CHANGE here if for some weird reason the default definitions are not -** good enough for your machine. Probably you do not need to change -** this. -*/ -#if LUAI_BITSINT >= 32 /* { */ -#define LUA_INT32 int -#define LUAI_UMEM size_t -#define LUAI_MEM ptrdiff_t -#else /* }{ */ -/* 16-bit ints */ -#define LUA_INT32 long -#define LUAI_UMEM unsigned long -#define LUAI_MEM long -#endif /* } */ - - -/* -@@ LUAI_MAXSTACK limits the size of the Lua stack. -** CHANGE it if you need a different limit. This limit is arbitrary; -** its only purpose is to stop Lua to consume unlimited stack -** space (and to reserve some numbers for pseudo-indices). -*/ -#if LUAI_BITSINT >= 32 -#define LUAI_MAXSTACK 1000000 -#else -#define LUAI_MAXSTACK 15000 -#endif - -/* reserve some space for error handling */ -#define LUAI_FIRSTPSEUDOIDX (-LUAI_MAXSTACK - 1000) - - - - -/* -@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. -** CHANGE it if it uses too much C-stack space. -*/ -#define LUAL_BUFFERSIZE BUFSIZ - - - - -/* -** {================================================================== -@@ LUA_NUMBER is the type of numbers in Lua. -** CHANGE the following definitions only if you want to build Lua -** with a number type different from double. You may also need to -** change lua_number2int & lua_number2integer. -** =================================================================== -*/ - -#define LUA_NUMBER_DOUBLE -#define LUA_NUMBER double - -/* -@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' -@* over a number. -*/ -#define LUAI_UACNUMBER double - - -/* -@@ LUA_NUMBER_SCAN is the format for reading numbers. -@@ LUA_NUMBER_FMT is the format for writing numbers. -@@ lua_number2str converts a number to a string. -@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. -*/ -#define LUA_NUMBER_SCAN "%lf" -#define LUA_NUMBER_FMT "%.14g" -#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) -#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ - - -/* -@@ l_mathop allows the addition of an 'l' or 'f' to all math operations -*/ -#define l_mathop(x) (x) - - -/* -@@ lua_str2number converts a decimal numeric string to a number. -@@ lua_strx2number converts an hexadecimal numeric string to a number. -** In C99, 'strtod' does both conversions. C89, however, has no function -** to convert floating hexadecimal strings to numbers. For these -** systems, you can leave 'lua_strx2number' undefined and Lua will -** provide its own implementation. -*/ -#define lua_str2number(s,p) strtod((s), (p)) - -#if defined(LUA_USE_STRTODHEX) -#define lua_strx2number(s,p) strtod((s), (p)) -#endif - - -/* -@@ The luai_num* macros define the primitive operations over numbers. -*/ - -/* the following operations need the math library */ -#if defined(lobject_c) || defined(lvm_c) -#include <math.h> -#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b)) -#define luai_numpow(L,a,b) (l_mathop(pow)(a,b)) -#endif - -/* these are quite standard operations */ -#if defined(LUA_CORE) -#define luai_numadd(L,a,b) ((a)+(b)) -#define luai_numsub(L,a,b) ((a)-(b)) -#define luai_nummul(L,a,b) ((a)*(b)) -#define luai_numdiv(L,a,b) ((a)/(b)) -#define luai_numunm(L,a) (-(a)) -#define luai_numeq(a,b) ((a)==(b)) -#define luai_numlt(L,a,b) ((a)<(b)) -#define luai_numle(L,a,b) ((a)<=(b)) -#define luai_numisnan(L,a) (!luai_numeq((a), (a))) -#endif - - - -/* -@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger. -** CHANGE that if ptrdiff_t is not adequate on your machine. (On most -** machines, ptrdiff_t gives a good choice between int or long.) -*/ -#define LUA_INTEGER ptrdiff_t - -/* -@@ LUA_UNSIGNED is the integral type used by lua_pushunsigned/lua_tounsigned. -** It must have at least 32 bits. -*/ -#define LUA_UNSIGNED unsigned LUA_INT32 - - - -/* -** Some tricks with doubles -*/ - -#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) /* { */ -/* -** The next definitions activate some tricks to speed up the -** conversion from doubles to integer types, mainly to LUA_UNSIGNED. -** -@@ LUA_MSASMTRICK uses Microsoft assembler to avoid clashes with a -** DirectX idiosyncrasy. -** -@@ LUA_IEEE754TRICK uses a trick that should work on any machine -** using IEEE754 with a 32-bit integer type. -** -@@ LUA_IEEELL extends the trick to LUA_INTEGER; should only be -** defined when LUA_INTEGER is a 32-bit integer. -** -@@ LUA_IEEEENDIAN is the endianness of doubles in your machine -** (0 for little endian, 1 for big endian); if not defined, Lua will -** check it dynamically for LUA_IEEE754TRICK (but not for LUA_NANTRICK). -** -@@ LUA_NANTRICK controls the use of a trick to pack all types into -** a single double value, using NaN values to represent non-number -** values. The trick only works on 32-bit machines (ints and pointers -** are 32-bit values) with numbers represented as IEEE 754-2008 doubles -** with conventional endianess (12345678 or 87654321), in CPUs that do -** not produce signaling NaN values (all NaNs are quiet). -*/ - -/* Microsoft compiler on a Pentium (32 bit) ? */ -#if defined(LUA_WIN) && defined(_MSC_VER) && defined(_M_IX86) /* { */ - -#define LUA_MSASMTRICK -#define LUA_IEEEENDIAN 0 -#define LUA_NANTRICK - - -/* pentium 32 bits? */ -#elif defined(__i386__) || defined(__i386) || defined(__X86__) /* }{ */ - -#define LUA_IEEE754TRICK -#define LUA_IEEELL -#define LUA_IEEEENDIAN 0 -#define LUA_NANTRICK - -/* pentium 64 bits? */ -#elif defined(__x86_64) /* }{ */ - -#define LUA_IEEE754TRICK -#define LUA_IEEEENDIAN 0 - -#elif defined(__POWERPC__) || defined(__ppc__) /* }{ */ - -#define LUA_IEEE754TRICK -#define LUA_IEEEENDIAN 1 - -#else /* }{ */ - -/* assume IEEE754 and a 32-bit integer type */ -#define LUA_IEEE754TRICK - -#endif /* } */ - -#endif /* } */ - -/* }================================================================== */ - - - - -/* =================================================================== */ - -/* -** Local configuration. You can use this space to add your redefinitions -** without modifying the main part of the file. -*/ - - - -#endif - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.c b/3rdparty/genie/src/host/lua-5.2.3/src/lundump.c deleted file mode 100644 index 4163cb5d3b0..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.c +++ /dev/null @@ -1,258 +0,0 @@ -/* -** $Id: lundump.c,v 2.22.1.1 2013/04/12 18:48:47 roberto Exp $ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include <string.h> - -#define lundump_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstring.h" -#include "lundump.h" -#include "lzio.h" - -typedef struct { - lua_State* L; - ZIO* Z; - Mbuffer* b; - const char* name; -} LoadState; - -static l_noret error(LoadState* S, const char* why) -{ - luaO_pushfstring(S->L,"%s: %s precompiled chunk",S->name,why); - luaD_throw(S->L,LUA_ERRSYNTAX); -} - -#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) -#define LoadByte(S) (lu_byte)LoadChar(S) -#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) -#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) - -#if !defined(luai_verifycode) -#define luai_verifycode(L,b,f) /* empty */ -#endif - -static void LoadBlock(LoadState* S, void* b, size_t size) -{ - if (luaZ_read(S->Z,b,size)!=0) error(S,"truncated"); -} - -static int LoadChar(LoadState* S) -{ - char x; - LoadVar(S,x); - return x; -} - -static int LoadInt(LoadState* S) -{ - int x; - LoadVar(S,x); - if (x<0) error(S,"corrupted"); - return x; -} - -static lua_Number LoadNumber(LoadState* S) -{ - lua_Number x; - LoadVar(S,x); - return x; -} - -static TString* LoadString(LoadState* S) -{ - size_t size; - LoadVar(S,size); - if (size==0) - return NULL; - else - { - char* s=luaZ_openspace(S->L,S->b,size); - LoadBlock(S,s,size*sizeof(char)); - return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ - } -} - -static void LoadCode(LoadState* S, Proto* f) -{ - int n=LoadInt(S); - f->code=luaM_newvector(S->L,n,Instruction); - f->sizecode=n; - LoadVector(S,f->code,n,sizeof(Instruction)); -} - -static void LoadFunction(LoadState* S, Proto* f); - -static void LoadConstants(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->k=luaM_newvector(S->L,n,TValue); - f->sizek=n; - for (i=0; i<n; i++) setnilvalue(&f->k[i]); - for (i=0; i<n; i++) - { - TValue* o=&f->k[i]; - int t=LoadChar(S); - switch (t) - { - case LUA_TNIL: - setnilvalue(o); - break; - case LUA_TBOOLEAN: - setbvalue(o,LoadChar(S)); - break; - case LUA_TNUMBER: - setnvalue(o,LoadNumber(S)); - break; - case LUA_TSTRING: - setsvalue2n(S->L,o,LoadString(S)); - break; - default: lua_assert(0); - } - } - n=LoadInt(S); - f->p=luaM_newvector(S->L,n,Proto*); - f->sizep=n; - for (i=0; i<n; i++) f->p[i]=NULL; - for (i=0; i<n; i++) - { - f->p[i]=luaF_newproto(S->L); - LoadFunction(S,f->p[i]); - } -} - -static void LoadUpvalues(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->upvalues=luaM_newvector(S->L,n,Upvaldesc); - f->sizeupvalues=n; - for (i=0; i<n; i++) f->upvalues[i].name=NULL; - for (i=0; i<n; i++) - { - f->upvalues[i].instack=LoadByte(S); - f->upvalues[i].idx=LoadByte(S); - } -} - -static void LoadDebug(LoadState* S, Proto* f) -{ - int i,n; - f->source=LoadString(S); - n=LoadInt(S); - f->lineinfo=luaM_newvector(S->L,n,int); - f->sizelineinfo=n; - LoadVector(S,f->lineinfo,n,sizeof(int)); - n=LoadInt(S); - f->locvars=luaM_newvector(S->L,n,LocVar); - f->sizelocvars=n; - for (i=0; i<n; i++) f->locvars[i].varname=NULL; - for (i=0; i<n; i++) - { - f->locvars[i].varname=LoadString(S); - f->locvars[i].startpc=LoadInt(S); - f->locvars[i].endpc=LoadInt(S); - } - n=LoadInt(S); - for (i=0; i<n; i++) f->upvalues[i].name=LoadString(S); -} - -static void LoadFunction(LoadState* S, Proto* f) -{ - f->linedefined=LoadInt(S); - f->lastlinedefined=LoadInt(S); - f->numparams=LoadByte(S); - f->is_vararg=LoadByte(S); - f->maxstacksize=LoadByte(S); - LoadCode(S,f); - LoadConstants(S,f); - LoadUpvalues(S,f); - LoadDebug(S,f); -} - -/* the code below must be consistent with the code in luaU_header */ -#define N0 LUAC_HEADERSIZE -#define N1 (sizeof(LUA_SIGNATURE)-sizeof(char)) -#define N2 N1+2 -#define N3 N2+6 - -static void LoadHeader(LoadState* S) -{ - lu_byte h[LUAC_HEADERSIZE]; - lu_byte s[LUAC_HEADERSIZE]; - luaU_header(h); - memcpy(s,h,sizeof(char)); /* first char already read */ - LoadBlock(S,s+sizeof(char),LUAC_HEADERSIZE-sizeof(char)); - if (memcmp(h,s,N0)==0) return; - if (memcmp(h,s,N1)!=0) error(S,"not a"); - if (memcmp(h,s,N2)!=0) error(S,"version mismatch in"); - if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted"); -} - -/* -** load precompiled chunk -*/ -Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) -{ - LoadState S; - Closure* cl; - if (*name=='@' || *name=='=') - S.name=name+1; - else if (*name==LUA_SIGNATURE[0]) - S.name="binary string"; - else - S.name=name; - S.L=L; - S.Z=Z; - S.b=buff; - LoadHeader(&S); - cl=luaF_newLclosure(L,1); - setclLvalue(L,L->top,cl); incr_top(L); - cl->l.p=luaF_newproto(L); - LoadFunction(&S,cl->l.p); - if (cl->l.p->sizeupvalues != 1) - { - Proto* p=cl->l.p; - cl=luaF_newLclosure(L,cl->l.p->sizeupvalues); - cl->l.p=p; - setclLvalue(L,L->top-1,cl); - } - luai_verifycode(L,buff,cl->l.p); - return cl; -} - -#define MYINT(s) (s[0]-'0') -#define VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) -#define FORMAT 0 /* this is the official format */ - -/* -* make header for precompiled chunks -* if you change the code below be sure to update LoadHeader and FORMAT above -* and LUAC_HEADERSIZE in lundump.h -*/ -void luaU_header (lu_byte* h) -{ - int x=1; - memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-sizeof(char)); - h+=sizeof(LUA_SIGNATURE)-sizeof(char); - *h++=cast_byte(VERSION); - *h++=cast_byte(FORMAT); - *h++=cast_byte(*(char*)&x); /* endianness */ - *h++=cast_byte(sizeof(int)); - *h++=cast_byte(sizeof(size_t)); - *h++=cast_byte(sizeof(Instruction)); - *h++=cast_byte(sizeof(lua_Number)); - *h++=cast_byte(((lua_Number)0.5)==0); /* is lua_Number integral? */ - memcpy(h,LUAC_TAIL,sizeof(LUAC_TAIL)-sizeof(char)); -} diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.h b/3rdparty/genie/src/host/lua-5.2.3/src/lundump.h deleted file mode 100644 index 5255db259df..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lundump.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -** $Id: lundump.h,v 1.39.1.1 2013/04/12 18:48:47 roberto Exp $ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#ifndef lundump_h -#define lundump_h - -#include "lobject.h" -#include "lzio.h" - -/* load one chunk; from lundump.c */ -LUAI_FUNC Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); - -/* make header; from lundump.c */ -LUAI_FUNC void luaU_header (lu_byte* h); - -/* dump one chunk; from ldump.c */ -LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); - -/* data to catch conversion errors */ -#define LUAC_TAIL "\x19\x93\r\n\x1a\n" - -/* size in bytes of header of binary files */ -#define LUAC_HEADERSIZE (sizeof(LUA_SIGNATURE)-sizeof(char)+2+6+sizeof(LUAC_TAIL)-sizeof(char)) - -#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.c b/3rdparty/genie/src/host/lua-5.2.3/src/lvm.c deleted file mode 100644 index 141b9fd19c3..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.c +++ /dev/null @@ -1,867 +0,0 @@ -/* -** $Id: lvm.c,v 2.155.1.1 2013/04/12 18:48:47 roberto Exp $ -** Lua virtual machine -** See Copyright Notice in lua.h -*/ - - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#define lvm_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" -#include "lvm.h" - - - -/* limit for table tag-method chains (to avoid loops) */ -#define MAXTAGLOOP 100 - - -const TValue *luaV_tonumber (const TValue *obj, TValue *n) { - lua_Number num; - if (ttisnumber(obj)) return obj; - if (ttisstring(obj) && luaO_str2d(svalue(obj), tsvalue(obj)->len, &num)) { - setnvalue(n, num); - return n; - } - else - return NULL; -} - - -int luaV_tostring (lua_State *L, StkId obj) { - if (!ttisnumber(obj)) - return 0; - else { - char s[LUAI_MAXNUMBER2STR]; - lua_Number n = nvalue(obj); - int l = lua_number2str(s, n); - setsvalue2s(L, obj, luaS_newlstr(L, s, l)); - return 1; - } -} - - -static void traceexec (lua_State *L) { - CallInfo *ci = L->ci; - lu_byte mask = L->hookmask; - int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); - if (counthook) - resethookcount(L); /* reset count */ - if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ - ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ - return; /* do not call hook again (VM yielded, so it did not move) */ - } - if (counthook) - luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ - if (mask & LUA_MASKLINE) { - Proto *p = ci_func(ci)->p; - int npc = pcRel(ci->u.l.savedpc, p); - int newline = getfuncline(p, npc); - if (npc == 0 || /* call linehook when enter a new function, */ - ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */ - newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */ - luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ - } - L->oldpc = ci->u.l.savedpc; - if (L->status == LUA_YIELD) { /* did hook yield? */ - if (counthook) - L->hookcount = 1; /* undo decrement to zero */ - ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ - ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ - ci->func = L->top - 1; /* protect stack below results */ - luaD_throw(L, LUA_YIELD); - } -} - - -static void callTM (lua_State *L, const TValue *f, const TValue *p1, - const TValue *p2, TValue *p3, int hasres) { - ptrdiff_t result = savestack(L, p3); - setobj2s(L, L->top++, f); /* push function */ - setobj2s(L, L->top++, p1); /* 1st argument */ - setobj2s(L, L->top++, p2); /* 2nd argument */ - if (!hasres) /* no result? 'p3' is third argument */ - setobj2s(L, L->top++, p3); /* 3rd argument */ - /* metamethod may yield only when called from Lua code */ - luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); - if (hasres) { /* if has result, move it to its place */ - p3 = restorestack(L, result); - setobjs2s(L, p3, --L->top); - } -} - - -void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ - Table *h = hvalue(t); - const TValue *res = luaH_get(h, key); /* do a primitive get */ - if (!ttisnil(res) || /* result is not nil? */ - (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ - setobj2s(L, val, res); - return; - } - /* else will try the tag method */ - } - else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) - luaG_typeerror(L, t, "index"); - if (ttisfunction(tm)) { - callTM(L, tm, t, key, val, 1); - return; - } - t = tm; /* else repeat with 'tm' */ - } - luaG_runerror(L, "loop in gettable"); -} - - -void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ - Table *h = hvalue(t); - TValue *oldval = cast(TValue *, luaH_get(h, key)); - /* if previous value is not nil, there must be a previous entry - in the table; moreover, a metamethod has no relevance */ - if (!ttisnil(oldval) || - /* previous value is nil; must check the metamethod */ - ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL && - /* no metamethod; is there a previous entry in the table? */ - (oldval != luaO_nilobject || - /* no previous entry; must create one. (The next test is - always true; we only need the assignment.) */ - (oldval = luaH_newkey(L, h, key), 1)))) { - /* no metamethod and (now) there is an entry with given key */ - setobj2t(L, oldval, val); /* assign new value to that entry */ - invalidateTMcache(h); - luaC_barrierback(L, obj2gco(h), val); - return; - } - /* else will try the metamethod */ - } - else /* not a table; check metamethod */ - if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) - luaG_typeerror(L, t, "index"); - /* there is a metamethod */ - if (ttisfunction(tm)) { - callTM(L, tm, t, key, val, 0); - return; - } - t = tm; /* else repeat with 'tm' */ - } - luaG_runerror(L, "loop in settable"); -} - - -static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, - StkId res, TMS event) { - const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ - if (ttisnil(tm)) - tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ - if (ttisnil(tm)) return 0; - callTM(L, tm, p1, p2, res, 1); - return 1; -} - - -static const TValue *get_equalTM (lua_State *L, Table *mt1, Table *mt2, - TMS event) { - const TValue *tm1 = fasttm(L, mt1, event); - const TValue *tm2; - if (tm1 == NULL) return NULL; /* no metamethod */ - if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ - tm2 = fasttm(L, mt2, event); - if (tm2 == NULL) return NULL; /* no metamethod */ - if (luaV_rawequalobj(tm1, tm2)) /* same metamethods? */ - return tm1; - return NULL; -} - - -static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, - TMS event) { - if (!call_binTM(L, p1, p2, L->top, event)) - return -1; /* no metamethod */ - else - return !l_isfalse(L->top); -} - - -static int l_strcmp (const TString *ls, const TString *rs) { - const char *l = getstr(ls); - size_t ll = ls->tsv.len; - const char *r = getstr(rs); - size_t lr = rs->tsv.len; - for (;;) { - int temp = strcoll(l, r); - if (temp != 0) return temp; - else { /* strings are equal up to a `\0' */ - size_t len = strlen(l); /* index of first `\0' in both strings */ - if (len == lr) /* r is finished? */ - return (len == ll) ? 0 : 1; - else if (len == ll) /* l is finished? */ - return -1; /* l is smaller than r (because r is not finished) */ - /* both strings longer than `len'; go on comparing (after the `\0') */ - len++; - l += len; ll -= len; r += len; lr -= len; - } - } -} - - -int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { - int res; - if (ttisnumber(l) && ttisnumber(r)) - return luai_numlt(L, nvalue(l), nvalue(r)); - else if (ttisstring(l) && ttisstring(r)) - return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; - else if ((res = call_orderTM(L, l, r, TM_LT)) < 0) - luaG_ordererror(L, l, r); - return res; -} - - -int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { - int res; - if (ttisnumber(l) && ttisnumber(r)) - return luai_numle(L, nvalue(l), nvalue(r)); - else if (ttisstring(l) && ttisstring(r)) - return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; - else if ((res = call_orderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ - return res; - else if ((res = call_orderTM(L, r, l, TM_LT)) < 0) /* else try `lt' */ - luaG_ordererror(L, l, r); - return !res; -} - - -/* -** equality of Lua values. L == NULL means raw equality (no metamethods) -*/ -int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2) { - const TValue *tm; - lua_assert(ttisequal(t1, t2)); - switch (ttype(t1)) { - case LUA_TNIL: return 1; - case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); - case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ - case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); - case LUA_TLCF: return fvalue(t1) == fvalue(t2); - case LUA_TSHRSTR: return eqshrstr(rawtsvalue(t1), rawtsvalue(t2)); - case LUA_TLNGSTR: return luaS_eqlngstr(rawtsvalue(t1), rawtsvalue(t2)); - case LUA_TUSERDATA: { - if (uvalue(t1) == uvalue(t2)) return 1; - else if (L == NULL) return 0; - tm = get_equalTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, TM_EQ); - break; /* will try TM */ - } - case LUA_TTABLE: { - if (hvalue(t1) == hvalue(t2)) return 1; - else if (L == NULL) return 0; - tm = get_equalTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); - break; /* will try TM */ - } - default: - lua_assert(iscollectable(t1)); - return gcvalue(t1) == gcvalue(t2); - } - if (tm == NULL) return 0; /* no TM? */ - callTM(L, tm, t1, t2, L->top, 1); /* call TM */ - return !l_isfalse(L->top); -} - - -void luaV_concat (lua_State *L, int total) { - lua_assert(total >= 2); - do { - StkId top = L->top; - int n = 2; /* number of elements handled in this pass (at least 2) */ - if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { - if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) - luaG_concaterror(L, top-2, top-1); - } - else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ - (void)tostring(L, top - 2); /* result is first operand */ - else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { - setobjs2s(L, top - 2, top - 1); /* result is second op. */ - } - else { - /* at least two non-empty string values; get as many as possible */ - size_t tl = tsvalue(top-1)->len; - char *buffer; - int i; - /* collect total length */ - for (i = 1; i < total && tostring(L, top-i-1); i++) { - size_t l = tsvalue(top-i-1)->len; - if (l >= (MAX_SIZET/sizeof(char)) - tl) - luaG_runerror(L, "string length overflow"); - tl += l; - } - buffer = luaZ_openspace(L, &G(L)->buff, tl); - tl = 0; - n = i; - do { /* concat all strings */ - size_t l = tsvalue(top-i)->len; - memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); - tl += l; - } while (--i > 0); - setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); - } - total -= n-1; /* got 'n' strings to create 1 new */ - L->top -= n-1; /* popped 'n' strings and pushed one */ - } while (total > 1); /* repeat until only 1 result left */ -} - - -void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { - const TValue *tm; - switch (ttypenv(rb)) { - case LUA_TTABLE: { - Table *h = hvalue(rb); - tm = fasttm(L, h->metatable, TM_LEN); - if (tm) break; /* metamethod? break switch to call it */ - setnvalue(ra, cast_num(luaH_getn(h))); /* else primitive len */ - return; - } - case LUA_TSTRING: { - setnvalue(ra, cast_num(tsvalue(rb)->len)); - return; - } - default: { /* try metamethod */ - tm = luaT_gettmbyobj(L, rb, TM_LEN); - if (ttisnil(tm)) /* no metamethod? */ - luaG_typeerror(L, rb, "get length of"); - break; - } - } - callTM(L, tm, rb, rb, ra, 1); -} - - -void luaV_arith (lua_State *L, StkId ra, const TValue *rb, - const TValue *rc, TMS op) { - TValue tempb, tempc; - const TValue *b, *c; - if ((b = luaV_tonumber(rb, &tempb)) != NULL && - (c = luaV_tonumber(rc, &tempc)) != NULL) { - lua_Number res = luaO_arith(op - TM_ADD + LUA_OPADD, nvalue(b), nvalue(c)); - setnvalue(ra, res); - } - else if (!call_binTM(L, rb, rc, ra, op)) - luaG_aritherror(L, rb, rc); -} - - -/* -** check whether cached closure in prototype 'p' may be reused, that is, -** whether there is a cached closure with the same upvalues needed by -** new closure to be created. -*/ -static Closure *getcached (Proto *p, UpVal **encup, StkId base) { - Closure *c = p->cache; - if (c != NULL) { /* is there a cached closure? */ - int nup = p->sizeupvalues; - Upvaldesc *uv = p->upvalues; - int i; - for (i = 0; i < nup; i++) { /* check whether it has right upvalues */ - TValue *v = uv[i].instack ? base + uv[i].idx : encup[uv[i].idx]->v; - if (c->l.upvals[i]->v != v) - return NULL; /* wrong upvalue; cannot reuse closure */ - } - } - return c; /* return cached closure (or NULL if no cached closure) */ -} - - -/* -** create a new Lua closure, push it in the stack, and initialize -** its upvalues. Note that the call to 'luaC_barrierproto' must come -** before the assignment to 'p->cache', as the function needs the -** original value of that field. -*/ -static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, - StkId ra) { - int nup = p->sizeupvalues; - Upvaldesc *uv = p->upvalues; - int i; - Closure *ncl = luaF_newLclosure(L, nup); - ncl->l.p = p; - setclLvalue(L, ra, ncl); /* anchor new closure in stack */ - for (i = 0; i < nup; i++) { /* fill in its upvalues */ - if (uv[i].instack) /* upvalue refers to local variable? */ - ncl->l.upvals[i] = luaF_findupval(L, base + uv[i].idx); - else /* get upvalue from enclosing function */ - ncl->l.upvals[i] = encup[uv[i].idx]; - } - luaC_barrierproto(L, p, ncl); - p->cache = ncl; /* save it on cache for reuse */ -} - - -/* -** finish execution of an opcode interrupted by an yield -*/ -void luaV_finishOp (lua_State *L) { - CallInfo *ci = L->ci; - StkId base = ci->u.l.base; - Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ - OpCode op = GET_OPCODE(inst); - switch (op) { /* finish its execution */ - case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: - case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN: - case OP_GETTABUP: case OP_GETTABLE: case OP_SELF: { - setobjs2s(L, base + GETARG_A(inst), --L->top); - break; - } - case OP_LE: case OP_LT: case OP_EQ: { - int res = !l_isfalse(L->top - 1); - L->top--; - /* metamethod should not be called when operand is K */ - lua_assert(!ISK(GETARG_B(inst))); - if (op == OP_LE && /* "<=" using "<" instead? */ - ttisnil(luaT_gettmbyobj(L, base + GETARG_B(inst), TM_LE))) - res = !res; /* invert result */ - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP); - if (res != GETARG_A(inst)) /* condition failed? */ - ci->u.l.savedpc++; /* skip jump instruction */ - break; - } - case OP_CONCAT: { - StkId top = L->top - 1; /* top when 'call_binTM' was called */ - int b = GETARG_B(inst); /* first element to concatenate */ - int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ - setobj2s(L, top - 2, top); /* put TM result in proper position */ - if (total > 1) { /* are there elements to concat? */ - L->top = top - 1; /* top is one after last element (at top-2) */ - luaV_concat(L, total); /* concat them (may yield again) */ - } - /* move final result to final position */ - setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); - L->top = ci->top; /* restore top */ - break; - } - case OP_TFORCALL: { - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_TFORLOOP); - L->top = ci->top; /* correct top */ - break; - } - case OP_CALL: { - if (GETARG_C(inst) - 1 >= 0) /* nresults >= 0? */ - L->top = ci->top; /* adjust results */ - break; - } - case OP_TAILCALL: case OP_SETTABUP: case OP_SETTABLE: - break; - default: lua_assert(0); - } -} - - - -/* -** some macros for common tasks in `luaV_execute' -*/ - -#if !defined luai_runtimecheck -#define luai_runtimecheck(L, c) /* void */ -#endif - - -#define RA(i) (base+GETARG_A(i)) -/* to be used after possible stack reallocation */ -#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) -#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) -#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ - ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) -#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ - ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) -#define KBx(i) \ - (k + (GETARG_Bx(i) != 0 ? GETARG_Bx(i) - 1 : GETARG_Ax(*ci->u.l.savedpc++))) - - -/* execute a jump instruction */ -#define dojump(ci,i,e) \ - { int a = GETARG_A(i); \ - if (a > 0) luaF_close(L, ci->u.l.base + a - 1); \ - ci->u.l.savedpc += GETARG_sBx(i) + e; } - -/* for test instructions, execute the jump instruction that follows it */ -#define donextjump(ci) { i = *ci->u.l.savedpc; dojump(ci, i, 1); } - - -#define Protect(x) { {x;}; base = ci->u.l.base; } - -#define checkGC(L,c) \ - Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \ - luaC_step(L); \ - L->top = ci->top;}) /* restore top */ \ - luai_threadyield(L); ) - - -#define arith_op(op,tm) { \ - TValue *rb = RKB(i); \ - TValue *rc = RKC(i); \ - if (ttisnumber(rb) && ttisnumber(rc)) { \ - lua_Number nb = nvalue(rb), nc = nvalue(rc); \ - setnvalue(ra, op(L, nb, nc)); \ - } \ - else { Protect(luaV_arith(L, ra, rb, rc, tm)); } } - - -#define vmdispatch(o) switch(o) -#define vmcase(l,b) case l: {b} break; -#define vmcasenb(l,b) case l: {b} /* nb = no break */ - -void luaV_execute (lua_State *L) { - CallInfo *ci = L->ci; - LClosure *cl; - TValue *k; - StkId base; - newframe: /* reentry point when frame changes (call/return) */ - lua_assert(ci == L->ci); - cl = clLvalue(ci->func); - k = cl->p->k; - base = ci->u.l.base; - /* main loop of interpreter */ - for (;;) { - Instruction i = *(ci->u.l.savedpc++); - StkId ra; - if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && - (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { - Protect(traceexec(L)); - } - /* WARNING: several calls may realloc the stack and invalidate `ra' */ - ra = RA(i); - lua_assert(base == ci->u.l.base); - lua_assert(base <= L->top && L->top < L->stack + L->stacksize); - vmdispatch (GET_OPCODE(i)) { - vmcase(OP_MOVE, - setobjs2s(L, ra, RB(i)); - ) - vmcase(OP_LOADK, - TValue *rb = k + GETARG_Bx(i); - setobj2s(L, ra, rb); - ) - vmcase(OP_LOADKX, - TValue *rb; - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); - rb = k + GETARG_Ax(*ci->u.l.savedpc++); - setobj2s(L, ra, rb); - ) - vmcase(OP_LOADBOOL, - setbvalue(ra, GETARG_B(i)); - if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */ - ) - vmcase(OP_LOADNIL, - int b = GETARG_B(i); - do { - setnilvalue(ra++); - } while (b--); - ) - vmcase(OP_GETUPVAL, - int b = GETARG_B(i); - setobj2s(L, ra, cl->upvals[b]->v); - ) - vmcase(OP_GETTABUP, - int b = GETARG_B(i); - Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra)); - ) - vmcase(OP_GETTABLE, - Protect(luaV_gettable(L, RB(i), RKC(i), ra)); - ) - vmcase(OP_SETTABUP, - int a = GETARG_A(i); - Protect(luaV_settable(L, cl->upvals[a]->v, RKB(i), RKC(i))); - ) - vmcase(OP_SETUPVAL, - UpVal *uv = cl->upvals[GETARG_B(i)]; - setobj(L, uv->v, ra); - luaC_barrier(L, uv, ra); - ) - vmcase(OP_SETTABLE, - Protect(luaV_settable(L, ra, RKB(i), RKC(i))); - ) - vmcase(OP_NEWTABLE, - int b = GETARG_B(i); - int c = GETARG_C(i); - Table *t = luaH_new(L); - sethvalue(L, ra, t); - if (b != 0 || c != 0) - luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c)); - checkGC(L, ra + 1); - ) - vmcase(OP_SELF, - StkId rb = RB(i); - setobjs2s(L, ra+1, rb); - Protect(luaV_gettable(L, rb, RKC(i), ra)); - ) - vmcase(OP_ADD, - arith_op(luai_numadd, TM_ADD); - ) - vmcase(OP_SUB, - arith_op(luai_numsub, TM_SUB); - ) - vmcase(OP_MUL, - arith_op(luai_nummul, TM_MUL); - ) - vmcase(OP_DIV, - arith_op(luai_numdiv, TM_DIV); - ) - vmcase(OP_MOD, - arith_op(luai_nummod, TM_MOD); - ) - vmcase(OP_POW, - arith_op(luai_numpow, TM_POW); - ) - vmcase(OP_UNM, - TValue *rb = RB(i); - if (ttisnumber(rb)) { - lua_Number nb = nvalue(rb); - setnvalue(ra, luai_numunm(L, nb)); - } - else { - Protect(luaV_arith(L, ra, rb, rb, TM_UNM)); - } - ) - vmcase(OP_NOT, - TValue *rb = RB(i); - int res = l_isfalse(rb); /* next assignment may change this value */ - setbvalue(ra, res); - ) - vmcase(OP_LEN, - Protect(luaV_objlen(L, ra, RB(i))); - ) - vmcase(OP_CONCAT, - int b = GETARG_B(i); - int c = GETARG_C(i); - StkId rb; - L->top = base + c + 1; /* mark the end of concat operands */ - Protect(luaV_concat(L, c - b + 1)); - ra = RA(i); /* 'luav_concat' may invoke TMs and move the stack */ - rb = b + base; - setobjs2s(L, ra, rb); - checkGC(L, (ra >= rb ? ra + 1 : rb)); - L->top = ci->top; /* restore top */ - ) - vmcase(OP_JMP, - dojump(ci, i, 0); - ) - vmcase(OP_EQ, - TValue *rb = RKB(i); - TValue *rc = RKC(i); - Protect( - if (cast_int(equalobj(L, rb, rc)) != GETARG_A(i)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - ) - vmcase(OP_LT, - Protect( - if (luaV_lessthan(L, RKB(i), RKC(i)) != GETARG_A(i)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - ) - vmcase(OP_LE, - Protect( - if (luaV_lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - ) - vmcase(OP_TEST, - if (GETARG_C(i) ? l_isfalse(ra) : !l_isfalse(ra)) - ci->u.l.savedpc++; - else - donextjump(ci); - ) - vmcase(OP_TESTSET, - TValue *rb = RB(i); - if (GETARG_C(i) ? l_isfalse(rb) : !l_isfalse(rb)) - ci->u.l.savedpc++; - else { - setobjs2s(L, ra, rb); - donextjump(ci); - } - ) - vmcase(OP_CALL, - int b = GETARG_B(i); - int nresults = GETARG_C(i) - 1; - if (b != 0) L->top = ra+b; /* else previous instruction set top */ - if (luaD_precall(L, ra, nresults)) { /* C function? */ - if (nresults >= 0) L->top = ci->top; /* adjust results */ - base = ci->u.l.base; - } - else { /* Lua function */ - ci = L->ci; - ci->callstatus |= CIST_REENTRY; - goto newframe; /* restart luaV_execute over new Lua function */ - } - ) - vmcase(OP_TAILCALL, - int b = GETARG_B(i); - if (b != 0) L->top = ra+b; /* else previous instruction set top */ - lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); - if (luaD_precall(L, ra, LUA_MULTRET)) /* C function? */ - base = ci->u.l.base; - else { - /* tail call: put called frame (n) in place of caller one (o) */ - CallInfo *nci = L->ci; /* called frame */ - CallInfo *oci = nci->previous; /* caller frame */ - StkId nfunc = nci->func; /* called function */ - StkId ofunc = oci->func; /* caller function */ - /* last stack slot filled by 'precall' */ - StkId lim = nci->u.l.base + getproto(nfunc)->numparams; - int aux; - /* close all upvalues from previous call */ - if (cl->p->sizep > 0) luaF_close(L, oci->u.l.base); - /* move new frame into old one */ - for (aux = 0; nfunc + aux < lim; aux++) - setobjs2s(L, ofunc + aux, nfunc + aux); - oci->u.l.base = ofunc + (nci->u.l.base - nfunc); /* correct base */ - oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ - oci->u.l.savedpc = nci->u.l.savedpc; - oci->callstatus |= CIST_TAIL; /* function was tail called */ - ci = L->ci = oci; /* remove new frame */ - lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); - goto newframe; /* restart luaV_execute over new Lua function */ - } - ) - vmcasenb(OP_RETURN, - int b = GETARG_B(i); - if (b != 0) L->top = ra+b-1; - if (cl->p->sizep > 0) luaF_close(L, base); - b = luaD_poscall(L, ra); - if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ - return; /* external invocation: return */ - else { /* invocation via reentry: continue execution */ - ci = L->ci; - if (b) L->top = ci->top; - lua_assert(isLua(ci)); - lua_assert(GET_OPCODE(*((ci)->u.l.savedpc - 1)) == OP_CALL); - goto newframe; /* restart luaV_execute over new Lua function */ - } - ) - vmcase(OP_FORLOOP, - lua_Number step = nvalue(ra+2); - lua_Number idx = luai_numadd(L, nvalue(ra), step); /* increment index */ - lua_Number limit = nvalue(ra+1); - if (luai_numlt(L, 0, step) ? luai_numle(L, idx, limit) - : luai_numle(L, limit, idx)) { - ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ - setnvalue(ra, idx); /* update internal index... */ - setnvalue(ra+3, idx); /* ...and external index */ - } - ) - vmcase(OP_FORPREP, - const TValue *init = ra; - const TValue *plimit = ra+1; - const TValue *pstep = ra+2; - if (!tonumber(init, ra)) - luaG_runerror(L, LUA_QL("for") " initial value must be a number"); - else if (!tonumber(plimit, ra+1)) - luaG_runerror(L, LUA_QL("for") " limit must be a number"); - else if (!tonumber(pstep, ra+2)) - luaG_runerror(L, LUA_QL("for") " step must be a number"); - setnvalue(ra, luai_numsub(L, nvalue(ra), nvalue(pstep))); - ci->u.l.savedpc += GETARG_sBx(i); - ) - vmcasenb(OP_TFORCALL, - StkId cb = ra + 3; /* call base */ - setobjs2s(L, cb+2, ra+2); - setobjs2s(L, cb+1, ra+1); - setobjs2s(L, cb, ra); - L->top = cb + 3; /* func. + 2 args (state and index) */ - Protect(luaD_call(L, cb, GETARG_C(i), 1)); - L->top = ci->top; - i = *(ci->u.l.savedpc++); /* go to next instruction */ - ra = RA(i); - lua_assert(GET_OPCODE(i) == OP_TFORLOOP); - goto l_tforloop; - ) - vmcase(OP_TFORLOOP, - l_tforloop: - if (!ttisnil(ra + 1)) { /* continue loop? */ - setobjs2s(L, ra, ra + 1); /* save control variable */ - ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ - } - ) - vmcase(OP_SETLIST, - int n = GETARG_B(i); - int c = GETARG_C(i); - int last; - Table *h; - if (n == 0) n = cast_int(L->top - ra) - 1; - if (c == 0) { - lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); - c = GETARG_Ax(*ci->u.l.savedpc++); - } - luai_runtimecheck(L, ttistable(ra)); - h = hvalue(ra); - last = ((c-1)*LFIELDS_PER_FLUSH) + n; - if (last > h->sizearray) /* needs more space? */ - luaH_resizearray(L, h, last); /* pre-allocate it at once */ - for (; n > 0; n--) { - TValue *val = ra+n; - luaH_setint(L, h, last--, val); - luaC_barrierback(L, obj2gco(h), val); - } - L->top = ci->top; /* correct top (in case of previous open call) */ - ) - vmcase(OP_CLOSURE, - Proto *p = cl->p->p[GETARG_Bx(i)]; - Closure *ncl = getcached(p, cl->upvals, base); /* cached closure */ - if (ncl == NULL) /* no match? */ - pushclosure(L, p, cl->upvals, base, ra); /* create a new one */ - else - setclLvalue(L, ra, ncl); /* push cashed closure */ - checkGC(L, ra + 1); - ) - vmcase(OP_VARARG, - int b = GETARG_B(i) - 1; - int j; - int n = cast_int(base - ci->func) - cl->p->numparams - 1; - if (b < 0) { /* B == 0? */ - b = n; /* get all var. arguments */ - Protect(luaD_checkstack(L, n)); - ra = RA(i); /* previous call may change the stack */ - L->top = ra + n; - } - for (j = 0; j < b; j++) { - if (j < n) { - setobjs2s(L, ra + j, base - n + j); - } - else { - setnilvalue(ra + j); - } - } - ) - vmcase(OP_EXTRAARG, - lua_assert(0); - ) - } - } -} - diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.h b/3rdparty/genie/src/host/lua-5.2.3/src/lvm.h deleted file mode 100644 index 5380270da63..00000000000 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lvm.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -** $Id: lvm.h,v 2.18.1.1 2013/04/12 18:48:47 roberto Exp $ -** Lua virtual machine -** See Copyright Notice in lua.h -*/ - -#ifndef lvm_h -#define lvm_h - - -#include "ldo.h" -#include "lobject.h" -#include "ltm.h" - - -#define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o))) - -#define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) - -#define equalobj(L,o1,o2) (ttisequal(o1, o2) && luaV_equalobj_(L, o1, o2)) - -#define luaV_rawequalobj(o1,o2) equalobj(NULL,o1,o2) - - -/* not to called directly */ -LUAI_FUNC int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2); - - -LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); -LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); -LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); -LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); -LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, - StkId val); -LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, - StkId val); -LUAI_FUNC void luaV_finishOp (lua_State *L); -LUAI_FUNC void luaV_execute (lua_State *L); -LUAI_FUNC void luaV_concat (lua_State *L, int total); -LUAI_FUNC void luaV_arith (lua_State *L, StkId ra, const TValue *rb, - const TValue *rc, TMS op); -LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); - -#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/Makefile b/3rdparty/genie/src/host/lua-5.3.0/Makefile index d2c7db4a2da..7fa91c858bb 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/Makefile +++ b/3rdparty/genie/src/host/lua-5.3.0/Makefile @@ -36,7 +36,7 @@ RM= rm -f # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # Convenience platforms targets. -PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris +PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris # What to install. TO_BIN= lua luac @@ -45,8 +45,8 @@ TO_LIB= liblua.a TO_MAN= lua.1 luac.1 # Lua version and release. -V= 5.2 -R= $V.3 +V= 5.3 +R= $V.0 # Targets start here. all: $(PLAT) diff --git a/3rdparty/genie/src/host/lua-5.2.3/README b/3rdparty/genie/src/host/lua-5.3.0/README index 49033adb5bf..32fb68e77e3 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/README +++ b/3rdparty/genie/src/host/lua-5.3.0/README @@ -1,5 +1,5 @@ -This is Lua 5.2.3, released on 11 Nov 2013. +This is Lua 5.3.0, released on 06 Jan 2015. For installation instructions, license details, and further information about Lua, see doc/readme.html. diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/contents.html b/3rdparty/genie/src/host/lua-5.3.0/doc/contents.html index 0ce297da19c..e59e4215eee 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/contents.html +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/contents.html @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> -<TITLE>Lua 5.2 Reference Manual - contents</TITLE> +<TITLE>Lua 5.3 Reference Manual - contents</TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css"> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> <STYLE TYPE="text/css"> @@ -17,7 +17,7 @@ ul { <HR> <H1> <A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="" BORDER=0></A> -Lua 5.2 Reference Manual +Lua 5.3 Reference Manual </H1> <P> @@ -33,7 +33,7 @@ For a complete introduction to Lua programming, see the book <A HREF="#index">index</A> <HR> <SMALL> -Copyright © 2011–2013 Lua.org, PUC-Rio. +Copyright © 2015 Lua.org, PUC-Rio. Freely available under the terms of the <A HREF="http://www.lua.org/license.html">Lua license</A>. </SMALL> @@ -73,15 +73,16 @@ Freely available under the terms of the <LI><A HREF="manual.html#3.4">3.4 – Expressions</A> <UL> <LI><A HREF="manual.html#3.4.1">3.4.1 – Arithmetic Operators</A> -<LI><A HREF="manual.html#3.4.2">3.4.2 – Coercion</A> -<LI><A HREF="manual.html#3.4.3">3.4.3 – Relational Operators</A> -<LI><A HREF="manual.html#3.4.4">3.4.4 – Logical Operators</A> -<LI><A HREF="manual.html#3.4.5">3.4.5 – Concatenation</A> -<LI><A HREF="manual.html#3.4.6">3.4.6 – The Length Operator</A> -<LI><A HREF="manual.html#3.4.7">3.4.7 – Precedence</A> -<LI><A HREF="manual.html#3.4.8">3.4.8 – Table Constructors</A> -<LI><A HREF="manual.html#3.4.9">3.4.9 – Function Calls</A> -<LI><A HREF="manual.html#3.4.10">3.4.10 – Function Definitions</A> +<LI><A HREF="manual.html#3.4.2">3.4.2 – Bitwise Operators</A> +<LI><A HREF="manual.html#3.4.3">3.4.3 – Coercions and Conversions</A> +<LI><A HREF="manual.html#3.4.4">3.4.4 – Relational Operators</A> +<LI><A HREF="manual.html#3.4.5">3.4.5 – Logical Operators</A> +<LI><A HREF="manual.html#3.4.6">3.4.6 – Concatenation</A> +<LI><A HREF="manual.html#3.4.7">3.4.7 – The Length Operator</A> +<LI><A HREF="manual.html#3.4.8">3.4.8 – Precedence</A> +<LI><A HREF="manual.html#3.4.9">3.4.9 – Table Constructors</A> +<LI><A HREF="manual.html#3.4.10">3.4.10 – Function Calls</A> +<LI><A HREF="manual.html#3.4.11">3.4.11 – Function Definitions</A> </UL> <LI><A HREF="manual.html#3.5">3.5 – Visibility Rules</A> </UL> @@ -112,10 +113,11 @@ Freely available under the terms of the <LI><A HREF="manual.html#6.4">6.4 – String Manipulation</A> <UL> <LI><A HREF="manual.html#6.4.1">6.4.1 – Patterns</A> +<LI><A HREF="manual.html#6.4.2">6.4.2 – Format Strings for Pack and Unpack</A> </UL> -<LI><A HREF="manual.html#6.5">6.5 – Table Manipulation</A> -<LI><A HREF="manual.html#6.6">6.6 – Mathematical Functions</A> -<LI><A HREF="manual.html#6.7">6.7 – Bitwise Operations</A> +<LI><A HREF="manual.html#6.5">6.5 – UTF-8 Support</A> +<LI><A HREF="manual.html#6.6">6.6 – Table Manipulation</A> +<LI><A HREF="manual.html#6.7">6.7 – Mathematical Functions</A> <LI><A HREF="manual.html#6.8">6.8 – Input and Output Facilities</A> <LI><A HREF="manual.html#6.9">6.9 – Operating System Facilities</A> <LI><A HREF="manual.html#6.10">6.10 – The Debug Library</A> @@ -139,10 +141,10 @@ Freely available under the terms of the <TD> <H3><A NAME="functions">Lua functions</A></H3> <P> +<A HREF="manual.html#6.1">basic</A><BR> <A HREF="manual.html#pdf-_G">_G</A><BR> <A HREF="manual.html#pdf-_VERSION">_VERSION</A><BR> -<P> <A HREF="manual.html#pdf-assert">assert</A><BR> <A HREF="manual.html#pdf-collectgarbage">collectgarbage</A><BR> <A HREF="manual.html#pdf-dofile">dofile</A><BR> @@ -168,21 +170,9 @@ Freely available under the terms of the <A HREF="manual.html#pdf-xpcall">xpcall</A><BR> <P> -<A HREF="manual.html#pdf-bit32.arshift">bit32.arshift</A><BR> -<A HREF="manual.html#pdf-bit32.band">bit32.band</A><BR> -<A HREF="manual.html#pdf-bit32.bnot">bit32.bnot</A><BR> -<A HREF="manual.html#pdf-bit32.bor">bit32.bor</A><BR> -<A HREF="manual.html#pdf-bit32.btest">bit32.btest</A><BR> -<A HREF="manual.html#pdf-bit32.bxor">bit32.bxor</A><BR> -<A HREF="manual.html#pdf-bit32.extract">bit32.extract</A><BR> -<A HREF="manual.html#pdf-bit32.lrotate">bit32.lrotate</A><BR> -<A HREF="manual.html#pdf-bit32.lshift">bit32.lshift</A><BR> -<A HREF="manual.html#pdf-bit32.replace">bit32.replace</A><BR> -<A HREF="manual.html#pdf-bit32.rrotate">bit32.rrotate</A><BR> -<A HREF="manual.html#pdf-bit32.rshift">bit32.rshift</A><BR> - -<P> +<A HREF="manual.html#6.2">coroutine</A><BR> <A HREF="manual.html#pdf-coroutine.create">coroutine.create</A><BR> +<A HREF="manual.html#pdf-coroutine.isyieldable">coroutine.isyieldable</A><BR> <A HREF="manual.html#pdf-coroutine.resume">coroutine.resume</A><BR> <A HREF="manual.html#pdf-coroutine.running">coroutine.running</A><BR> <A HREF="manual.html#pdf-coroutine.status">coroutine.status</A><BR> @@ -190,33 +180,26 @@ Freely available under the terms of the <A HREF="manual.html#pdf-coroutine.yield">coroutine.yield</A><BR> <P> +<A HREF="manual.html#6.10">debug</A><BR> <A HREF="manual.html#pdf-debug.debug">debug.debug</A><BR> -<A HREF="manual.html#pdf-debug.getuservalue">debug.getuservalue</A><BR> <A HREF="manual.html#pdf-debug.gethook">debug.gethook</A><BR> <A HREF="manual.html#pdf-debug.getinfo">debug.getinfo</A><BR> <A HREF="manual.html#pdf-debug.getlocal">debug.getlocal</A><BR> <A HREF="manual.html#pdf-debug.getmetatable">debug.getmetatable</A><BR> <A HREF="manual.html#pdf-debug.getregistry">debug.getregistry</A><BR> <A HREF="manual.html#pdf-debug.getupvalue">debug.getupvalue</A><BR> -<A HREF="manual.html#pdf-debug.setuservalue">debug.setuservalue</A><BR> +<A HREF="manual.html#pdf-debug.getuservalue">debug.getuservalue</A><BR> <A HREF="manual.html#pdf-debug.sethook">debug.sethook</A><BR> <A HREF="manual.html#pdf-debug.setlocal">debug.setlocal</A><BR> <A HREF="manual.html#pdf-debug.setmetatable">debug.setmetatable</A><BR> <A HREF="manual.html#pdf-debug.setupvalue">debug.setupvalue</A><BR> +<A HREF="manual.html#pdf-debug.setuservalue">debug.setuservalue</A><BR> <A HREF="manual.html#pdf-debug.traceback">debug.traceback</A><BR> <A HREF="manual.html#pdf-debug.upvalueid">debug.upvalueid</A><BR> <A HREF="manual.html#pdf-debug.upvaluejoin">debug.upvaluejoin</A><BR> <P> -<A HREF="manual.html#pdf-file:close">file:close</A><BR> -<A HREF="manual.html#pdf-file:flush">file:flush</A><BR> -<A HREF="manual.html#pdf-file:lines">file:lines</A><BR> -<A HREF="manual.html#pdf-file:read">file:read</A><BR> -<A HREF="manual.html#pdf-file:seek">file:seek</A><BR> -<A HREF="manual.html#pdf-file:setvbuf">file:setvbuf</A><BR> -<A HREF="manual.html#pdf-file:write">file:write</A><BR> - -<P> +<A HREF="manual.html#6.8">io</A><BR> <A HREF="manual.html#pdf-io.close">io.close</A><BR> <A HREF="manual.html#pdf-io.flush">io.flush</A><BR> <A HREF="manual.html#pdf-io.input">io.input</A><BR> @@ -232,41 +215,49 @@ Freely available under the terms of the <A HREF="manual.html#pdf-io.type">io.type</A><BR> <A HREF="manual.html#pdf-io.write">io.write</A><BR> +<A HREF="manual.html#pdf-file:close">file:close</A><BR> +<A HREF="manual.html#pdf-file:flush">file:flush</A><BR> +<A HREF="manual.html#pdf-file:lines">file:lines</A><BR> +<A HREF="manual.html#pdf-file:read">file:read</A><BR> +<A HREF="manual.html#pdf-file:seek">file:seek</A><BR> +<A HREF="manual.html#pdf-file:setvbuf">file:setvbuf</A><BR> +<A HREF="manual.html#pdf-file:write">file:write</A><BR> + </TD> <TD> <H3> </H3> <P> +<A HREF="manual.html#6.7">math</A><BR> <A HREF="manual.html#pdf-math.abs">math.abs</A><BR> <A HREF="manual.html#pdf-math.acos">math.acos</A><BR> <A HREF="manual.html#pdf-math.asin">math.asin</A><BR> <A HREF="manual.html#pdf-math.atan">math.atan</A><BR> -<A HREF="manual.html#pdf-math.atan2">math.atan2</A><BR> <A HREF="manual.html#pdf-math.ceil">math.ceil</A><BR> <A HREF="manual.html#pdf-math.cos">math.cos</A><BR> -<A HREF="manual.html#pdf-math.cosh">math.cosh</A><BR> <A HREF="manual.html#pdf-math.deg">math.deg</A><BR> <A HREF="manual.html#pdf-math.exp">math.exp</A><BR> <A HREF="manual.html#pdf-math.floor">math.floor</A><BR> <A HREF="manual.html#pdf-math.fmod">math.fmod</A><BR> -<A HREF="manual.html#pdf-math.frexp">math.frexp</A><BR> <A HREF="manual.html#pdf-math.huge">math.huge</A><BR> -<A HREF="manual.html#pdf-math.ldexp">math.ldexp</A><BR> <A HREF="manual.html#pdf-math.log">math.log</A><BR> <A HREF="manual.html#pdf-math.max">math.max</A><BR> +<A HREF="manual.html#pdf-math.maxinteger">math.maxinteger</A><BR> <A HREF="manual.html#pdf-math.min">math.min</A><BR> +<A HREF="manual.html#pdf-math.mininteger">math.mininteger</A><BR> <A HREF="manual.html#pdf-math.modf">math.modf</A><BR> <A HREF="manual.html#pdf-math.pi">math.pi</A><BR> -<A HREF="manual.html#pdf-math.pow">math.pow</A><BR> <A HREF="manual.html#pdf-math.rad">math.rad</A><BR> <A HREF="manual.html#pdf-math.random">math.random</A><BR> <A HREF="manual.html#pdf-math.randomseed">math.randomseed</A><BR> <A HREF="manual.html#pdf-math.sin">math.sin</A><BR> -<A HREF="manual.html#pdf-math.sinh">math.sinh</A><BR> <A HREF="manual.html#pdf-math.sqrt">math.sqrt</A><BR> <A HREF="manual.html#pdf-math.tan">math.tan</A><BR> -<A HREF="manual.html#pdf-math.tanh">math.tanh</A><BR> +<A HREF="manual.html#pdf-math.tointeger">math.tointeger</A><BR> +<A HREF="manual.html#pdf-math.type">math.type</A><BR> +<A HREF="manual.html#pdf-math.ult">math.ult</A><BR> <P> +<A HREF="manual.html#6.9">os</A><BR> <A HREF="manual.html#pdf-os.clock">os.clock</A><BR> <A HREF="manual.html#pdf-os.date">os.date</A><BR> <A HREF="manual.html#pdf-os.difftime">os.difftime</A><BR> @@ -280,6 +271,7 @@ Freely available under the terms of the <A HREF="manual.html#pdf-os.tmpname">os.tmpname</A><BR> <P> +<A HREF="manual.html#6.3">package</A><BR> <A HREF="manual.html#pdf-package.config">package.config</A><BR> <A HREF="manual.html#pdf-package.cpath">package.cpath</A><BR> <A HREF="manual.html#pdf-package.loaded">package.loaded</A><BR> @@ -290,6 +282,7 @@ Freely available under the terms of the <A HREF="manual.html#pdf-package.searchpath">package.searchpath</A><BR> <P> +<A HREF="manual.html#6.4">string</A><BR> <A HREF="manual.html#pdf-string.byte">string.byte</A><BR> <A HREF="manual.html#pdf-string.char">string.char</A><BR> <A HREF="manual.html#pdf-string.dump">string.dump</A><BR> @@ -300,28 +293,52 @@ Freely available under the terms of the <A HREF="manual.html#pdf-string.len">string.len</A><BR> <A HREF="manual.html#pdf-string.lower">string.lower</A><BR> <A HREF="manual.html#pdf-string.match">string.match</A><BR> +<A HREF="manual.html#pdf-string.pack">string.pack</A><BR> +<A HREF="manual.html#pdf-string.packsize">string.packsize</A><BR> <A HREF="manual.html#pdf-string.rep">string.rep</A><BR> <A HREF="manual.html#pdf-string.reverse">string.reverse</A><BR> <A HREF="manual.html#pdf-string.sub">string.sub</A><BR> +<A HREF="manual.html#pdf-string.unpack">string.unpack</A><BR> <A HREF="manual.html#pdf-string.upper">string.upper</A><BR> <P> +<A HREF="manual.html#6.6">table</A><BR> <A HREF="manual.html#pdf-table.concat">table.concat</A><BR> <A HREF="manual.html#pdf-table.insert">table.insert</A><BR> +<A HREF="manual.html#pdf-table.move">table.move</A><BR> <A HREF="manual.html#pdf-table.pack">table.pack</A><BR> <A HREF="manual.html#pdf-table.remove">table.remove</A><BR> <A HREF="manual.html#pdf-table.sort">table.sort</A><BR> <A HREF="manual.html#pdf-table.unpack">table.unpack</A><BR> +<P> +<A HREF="manual.html#6.5">utf8</A><BR> +<A HREF="manual.html#pdf-utf8.char">utf8.char</A><BR> +<A HREF="manual.html#pdf-utf8.charpattern">utf8.charpattern</A><BR> +<A HREF="manual.html#pdf-utf8.codepoint">utf8.codepoint</A><BR> +<A HREF="manual.html#pdf-utf8.codes">utf8.codes</A><BR> +<A HREF="manual.html#pdf-utf8.len">utf8.len</A><BR> +<A HREF="manual.html#pdf-utf8.offset">utf8.offset</A><BR> + +<H3><A NAME="env">environment<BR>variables</A></H3> +<A HREF="manual.html#pdf-LUA_CPATH">LUA_CPATH</A><BR> +<A HREF="manual.html#pdf-LUA_CPATH_5_3">LUA_CPATH_5_3</A><BR> +<A HREF="manual.html#pdf-LUA_INIT">LUA_INIT</A><BR> +<A HREF="manual.html#pdf-LUA_INIT_5_3">LUA_INIT_5_3</A><BR> +<A HREF="manual.html#pdf-LUA_PATH">LUA_PATH</A><BR> +<A HREF="manual.html#pdf-LUA_PATH_5_3">LUA_PATH_5_3</A><BR> + </TD> <TD> -<H3>C API</H3> +<H3><A NAME="api">C API</A></H3> <P> <A HREF="manual.html#lua_Alloc">lua_Alloc</A><BR> <A HREF="manual.html#lua_CFunction">lua_CFunction</A><BR> <A HREF="manual.html#lua_Debug">lua_Debug</A><BR> <A HREF="manual.html#lua_Hook">lua_Hook</A><BR> <A HREF="manual.html#lua_Integer">lua_Integer</A><BR> +<A HREF="manual.html#lua_KContext">lua_KContext</A><BR> +<A HREF="manual.html#lua_KFunction">lua_KFunction</A><BR> <A HREF="manual.html#lua_Number">lua_Number</A><BR> <A HREF="manual.html#lua_Reader">lua_Reader</A><BR> <A HREF="manual.html#lua_State">lua_State</A><BR> @@ -344,12 +361,13 @@ Freely available under the terms of the <A HREF="manual.html#lua_error">lua_error</A><BR> <A HREF="manual.html#lua_gc">lua_gc</A><BR> <A HREF="manual.html#lua_getallocf">lua_getallocf</A><BR> -<A HREF="manual.html#lua_getctx">lua_getctx</A><BR> +<A HREF="manual.html#lua_getextraspace">lua_getextraspace</A><BR> <A HREF="manual.html#lua_getfield">lua_getfield</A><BR> <A HREF="manual.html#lua_getglobal">lua_getglobal</A><BR> <A HREF="manual.html#lua_gethook">lua_gethook</A><BR> <A HREF="manual.html#lua_gethookcount">lua_gethookcount</A><BR> <A HREF="manual.html#lua_gethookmask">lua_gethookmask</A><BR> +<A HREF="manual.html#lua_geti">lua_geti</A><BR> <A HREF="manual.html#lua_getinfo">lua_getinfo</A><BR> <A HREF="manual.html#lua_getlocal">lua_getlocal</A><BR> <A HREF="manual.html#lua_getmetatable">lua_getmetatable</A><BR> @@ -362,6 +380,7 @@ Freely available under the terms of the <A HREF="manual.html#lua_isboolean">lua_isboolean</A><BR> <A HREF="manual.html#lua_iscfunction">lua_iscfunction</A><BR> <A HREF="manual.html#lua_isfunction">lua_isfunction</A><BR> +<A HREF="manual.html#lua_isinteger">lua_isinteger</A><BR> <A HREF="manual.html#lua_islightuserdata">lua_islightuserdata</A><BR> <A HREF="manual.html#lua_isnil">lua_isnil</A><BR> <A HREF="manual.html#lua_isnone">lua_isnone</A><BR> @@ -371,6 +390,7 @@ Freely available under the terms of the <A HREF="manual.html#lua_istable">lua_istable</A><BR> <A HREF="manual.html#lua_isthread">lua_isthread</A><BR> <A HREF="manual.html#lua_isuserdata">lua_isuserdata</A><BR> +<A HREF="manual.html#lua_isyieldable">lua_isyieldable</A><BR> <A HREF="manual.html#lua_len">lua_len</A><BR> <A HREF="manual.html#lua_load">lua_load</A><BR> <A HREF="manual.html#lua_newstate">lua_newstate</A><BR> @@ -378,6 +398,7 @@ Freely available under the terms of the <A HREF="manual.html#lua_newthread">lua_newthread</A><BR> <A HREF="manual.html#lua_newuserdata">lua_newuserdata</A><BR> <A HREF="manual.html#lua_next">lua_next</A><BR> +<A HREF="manual.html#lua_numbertointeger">lua_numbertointeger</A><BR> <A HREF="manual.html#lua_pcall">lua_pcall</A><BR> <A HREF="manual.html#lua_pcallk">lua_pcallk</A><BR> <A HREF="manual.html#lua_pop">lua_pop</A><BR> @@ -394,7 +415,6 @@ Freely available under the terms of the <A HREF="manual.html#lua_pushnumber">lua_pushnumber</A><BR> <A HREF="manual.html#lua_pushstring">lua_pushstring</A><BR> <A HREF="manual.html#lua_pushthread">lua_pushthread</A><BR> -<A HREF="manual.html#lua_pushunsigned">lua_pushunsigned</A><BR> <A HREF="manual.html#lua_pushvalue">lua_pushvalue</A><BR> <A HREF="manual.html#lua_pushvfstring">lua_pushvfstring</A><BR> <A HREF="manual.html#lua_rawequal">lua_rawequal</A><BR> @@ -409,10 +429,12 @@ Freely available under the terms of the <A HREF="manual.html#lua_remove">lua_remove</A><BR> <A HREF="manual.html#lua_replace">lua_replace</A><BR> <A HREF="manual.html#lua_resume">lua_resume</A><BR> +<A HREF="manual.html#lua_rotate">lua_rotate</A><BR> <A HREF="manual.html#lua_setallocf">lua_setallocf</A><BR> <A HREF="manual.html#lua_setfield">lua_setfield</A><BR> <A HREF="manual.html#lua_setglobal">lua_setglobal</A><BR> <A HREF="manual.html#lua_sethook">lua_sethook</A><BR> +<A HREF="manual.html#lua_seti">lua_seti</A><BR> <A HREF="manual.html#lua_setlocal">lua_setlocal</A><BR> <A HREF="manual.html#lua_setmetatable">lua_setmetatable</A><BR> <A HREF="manual.html#lua_settable">lua_settable</A><BR> @@ -420,6 +442,7 @@ Freely available under the terms of the <A HREF="manual.html#lua_setupvalue">lua_setupvalue</A><BR> <A HREF="manual.html#lua_setuservalue">lua_setuservalue</A><BR> <A HREF="manual.html#lua_status">lua_status</A><BR> +<A HREF="manual.html#lua_stringtonumber">lua_stringtonumber</A><BR> <A HREF="manual.html#lua_toboolean">lua_toboolean</A><BR> <A HREF="manual.html#lua_tocfunction">lua_tocfunction</A><BR> <A HREF="manual.html#lua_tointeger">lua_tointeger</A><BR> @@ -430,8 +453,6 @@ Freely available under the terms of the <A HREF="manual.html#lua_topointer">lua_topointer</A><BR> <A HREF="manual.html#lua_tostring">lua_tostring</A><BR> <A HREF="manual.html#lua_tothread">lua_tothread</A><BR> -<A HREF="manual.html#lua_tounsigned">lua_tounsigned</A><BR> -<A HREF="manual.html#lua_tounsignedx">lua_tounsignedx</A><BR> <A HREF="manual.html#lua_touserdata">lua_touserdata</A><BR> <A HREF="manual.html#lua_type">lua_type</A><BR> <A HREF="manual.html#lua_typename">lua_typename</A><BR> @@ -445,10 +466,11 @@ Freely available under the terms of the </TD> <TD> -<H3>auxiliary library</H3> +<H3><A NAME="auxlib">auxiliary library</A></H3> <P> <A HREF="manual.html#luaL_Buffer">luaL_Buffer</A><BR> <A HREF="manual.html#luaL_Reg">luaL_Reg</A><BR> +<A HREF="manual.html#luaL_Stream">luaL_Stream</A><BR> <P> <A HREF="manual.html#luaL_addchar">luaL_addchar</A><BR> @@ -462,9 +484,7 @@ Freely available under the terms of the <A HREF="manual.html#luaL_buffinitsize">luaL_buffinitsize</A><BR> <A HREF="manual.html#luaL_callmeta">luaL_callmeta</A><BR> <A HREF="manual.html#luaL_checkany">luaL_checkany</A><BR> -<A HREF="manual.html#luaL_checkint">luaL_checkint</A><BR> <A HREF="manual.html#luaL_checkinteger">luaL_checkinteger</A><BR> -<A HREF="manual.html#luaL_checklong">luaL_checklong</A><BR> <A HREF="manual.html#luaL_checklstring">luaL_checklstring</A><BR> <A HREF="manual.html#luaL_checknumber">luaL_checknumber</A><BR> <A HREF="manual.html#luaL_checkoption">luaL_checkoption</A><BR> @@ -472,7 +492,6 @@ Freely available under the terms of the <A HREF="manual.html#luaL_checkstring">luaL_checkstring</A><BR> <A HREF="manual.html#luaL_checktype">luaL_checktype</A><BR> <A HREF="manual.html#luaL_checkudata">luaL_checkudata</A><BR> -<A HREF="manual.html#luaL_checkunsigned">luaL_checkunsigned</A><BR> <A HREF="manual.html#luaL_checkversion">luaL_checkversion</A><BR> <A HREF="manual.html#luaL_dofile">luaL_dofile</A><BR> <A HREF="manual.html#luaL_dostring">luaL_dostring</A><BR> @@ -494,13 +513,10 @@ Freely available under the terms of the <A HREF="manual.html#luaL_newmetatable">luaL_newmetatable</A><BR> <A HREF="manual.html#luaL_newstate">luaL_newstate</A><BR> <A HREF="manual.html#luaL_openlibs">luaL_openlibs</A><BR> -<A HREF="manual.html#luaL_optint">luaL_optint</A><BR> <A HREF="manual.html#luaL_optinteger">luaL_optinteger</A><BR> -<A HREF="manual.html#luaL_optlong">luaL_optlong</A><BR> <A HREF="manual.html#luaL_optlstring">luaL_optlstring</A><BR> <A HREF="manual.html#luaL_optnumber">luaL_optnumber</A><BR> <A HREF="manual.html#luaL_optstring">luaL_optstring</A><BR> -<A HREF="manual.html#luaL_optunsigned">luaL_optunsigned</A><BR> <A HREF="manual.html#luaL_prepbuffer">luaL_prepbuffer</A><BR> <A HREF="manual.html#luaL_prepbuffsize">luaL_prepbuffsize</A><BR> <A HREF="manual.html#luaL_pushresult">luaL_pushresult</A><BR> @@ -516,6 +532,76 @@ Freely available under the terms of the <A HREF="manual.html#luaL_unref">luaL_unref</A><BR> <A HREF="manual.html#luaL_where">luaL_where</A><BR> +<H3><A NAME="library">standard library</A></H3> +<P> +<A HREF="manual.html#pdf-luaopen_base">luaopen_base</A><BR> +<A HREF="manual.html#pdf-luaopen_coroutine">luaopen_coroutine</A><BR> +<A HREF="manual.html#pdf-luaopen_debug">luaopen_debug</A><BR> +<A HREF="manual.html#pdf-luaopen_io">luaopen_io</A><BR> +<A HREF="manual.html#pdf-luaopen_math">luaopen_math</A><BR> +<A HREF="manual.html#pdf-luaopen_os">luaopen_os</A><BR> +<A HREF="manual.html#pdf-luaopen_package">luaopen_package</A><BR> +<A HREF="manual.html#pdf-luaopen_string">luaopen_string</A><BR> +<A HREF="manual.html#pdf-luaopen_table">luaopen_table</A><BR> +<A HREF="manual.html#pdf-luaopen_utf8">luaopen_utf8</A><BR> + +<H3><A NAME="constants">constants</A></H3> +<A HREF="manual.html#pdf-LUA_ERRERR">LUA_ERRERR</A><BR> +<A HREF="manual.html#pdf-LUA_ERRFILE">LUA_ERRFILE</A><BR> +<A HREF="manual.html#pdf-LUA_ERRGCMM">LUA_ERRGCMM</A><BR> +<A HREF="manual.html#pdf-LUA_ERRMEM">LUA_ERRMEM</A><BR> +<A HREF="manual.html#pdf-LUA_ERRRUN">LUA_ERRRUN</A><BR> +<A HREF="manual.html#pdf-LUA_ERRSYNTAX">LUA_ERRSYNTAX</A><BR> +<A HREF="manual.html#pdf-LUA_HOOKCALL">LUA_HOOKCALL</A><BR> +<A HREF="manual.html#pdf-LUA_HOOKCOUNT">LUA_HOOKCOUNT</A><BR> +<A HREF="manual.html#pdf-LUA_HOOKLINE">LUA_HOOKLINE</A><BR> +<A HREF="manual.html#pdf-LUA_HOOKRET">LUA_HOOKRET</A><BR> +<A HREF="manual.html#pdf-LUA_HOOKTAILCALL">LUA_HOOKTAILCALL</A><BR> +<A HREF="manual.html#pdf-LUA_MASKCALL">LUA_MASKCALL</A><BR> +<A HREF="manual.html#pdf-LUA_MASKCOUNT">LUA_MASKCOUNT</A><BR> +<A HREF="manual.html#pdf-LUA_MASKLINE">LUA_MASKLINE</A><BR> +<A HREF="manual.html#pdf-LUA_MASKRET">LUA_MASKRET</A><BR> +<A HREF="manual.html#pdf-LUA_MAXINTEGER">LUA_MAXINTEGER</A><BR> +<A HREF="manual.html#pdf-LUA_MININTEGER">LUA_MININTEGER</A><BR> +<A HREF="manual.html#pdf-LUA_MINSTACK">LUA_MINSTACK</A><BR> +<A HREF="manual.html#pdf-LUA_MULTRET">LUA_MULTRET</A><BR> +<A HREF="manual.html#pdf-LUA_NOREF">LUA_NOREF</A><BR> +<A HREF="manual.html#pdf-LUA_OK">LUA_OK</A><BR> +<A HREF="manual.html#pdf-LUA_OPADD">LUA_OPADD</A><BR> +<A HREF="manual.html#pdf-LUA_OPBAND">LUA_OPBAND</A><BR> +<A HREF="manual.html#pdf-LUA_OPBNOT">LUA_OPBNOT</A><BR> +<A HREF="manual.html#pdf-LUA_OPBOR">LUA_OPBOR</A><BR> +<A HREF="manual.html#pdf-LUA_OPBXOR">LUA_OPBXOR</A><BR> +<A HREF="manual.html#pdf-LUA_OPDIV">LUA_OPDIV</A><BR> +<A HREF="manual.html#pdf-LUA_OPEQ">LUA_OPEQ</A><BR> +<A HREF="manual.html#pdf-LUA_OPIDIV">LUA_OPIDIV</A><BR> +<A HREF="manual.html#pdf-LUA_OPLE">LUA_OPLE</A><BR> +<A HREF="manual.html#pdf-LUA_OPLT">LUA_OPLT</A><BR> +<A HREF="manual.html#pdf-LUA_OPMOD">LUA_OPMOD</A><BR> +<A HREF="manual.html#pdf-LUA_OPMUL">LUA_OPMUL</A><BR> +<A HREF="manual.html#pdf-LUA_OPPOW">LUA_OPPOW</A><BR> +<A HREF="manual.html#pdf-LUA_OPSHL">LUA_OPSHL</A><BR> +<A HREF="manual.html#pdf-LUA_OPSHR">LUA_OPSHR</A><BR> +<A HREF="manual.html#pdf-LUA_OPSUB">LUA_OPSUB</A><BR> +<A HREF="manual.html#pdf-LUA_OPUNM">LUA_OPUNM</A><BR> +<A HREF="manual.html#pdf-LUA_REFNIL">LUA_REFNIL</A><BR> +<A HREF="manual.html#pdf-LUA_REGISTRYINDEX">LUA_REGISTRYINDEX</A><BR> +<A HREF="manual.html#pdf-LUA_RIDX_GLOBALS">LUA_RIDX_GLOBALS</A><BR> +<A HREF="manual.html#pdf-LUA_RIDX_MAINTHREAD">LUA_RIDX_MAINTHREAD</A><BR> +<A HREF="manual.html#pdf-LUA_TBOOLEAN">LUA_TBOOLEAN</A><BR> +<A HREF="manual.html#pdf-LUA_TFUNCTION">LUA_TFUNCTION</A><BR> +<A HREF="manual.html#pdf-LUA_TLIGHTUSERDATA">LUA_TLIGHTUSERDATA</A><BR> +<A HREF="manual.html#pdf-LUA_TNIL">LUA_TNIL</A><BR> +<A HREF="manual.html#pdf-LUA_TNONE">LUA_TNONE</A><BR> +<A HREF="manual.html#pdf-LUA_TNUMBER">LUA_TNUMBER</A><BR> +<A HREF="manual.html#pdf-LUA_TSTRING">LUA_TSTRING</A><BR> +<A HREF="manual.html#pdf-LUA_TTABLE">LUA_TTABLE</A><BR> +<A HREF="manual.html#pdf-LUA_TTHREAD">LUA_TTHREAD</A><BR> +<A HREF="manual.html#pdf-LUA_TUSERDATA">LUA_TUSERDATA</A><BR> +<A HREF="manual.html#pdf-LUA_USE_APICHECK">LUA_USE_APICHECK</A><BR> +<A HREF="manual.html#pdf-LUA_YIELD">LUA_YIELD</A><BR> +<A HREF="manual.html#pdf-LUAL_BUFFERSIZE">LUAL_BUFFERSIZE</A><BR> + </TD> </TR> </TABLE> @@ -523,10 +609,10 @@ Freely available under the terms of the <HR> <SMALL CLASS="footer"> Last update: -Tue Mar 12 11:22:18 BRT 2013 +Tue Dec 9 21:26:07 BRST 2014 </SMALL> <!-- -Last change: revised for Lua 5.2.2 +Last change: updated for Lua 5.3.0 (final) --> </BODY> diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/logo.gif b/3rdparty/genie/src/host/lua-5.3.0/doc/logo.gif Binary files differindex 2f5e4ac2e74..2f5e4ac2e74 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/logo.gif +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/logo.gif diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/lua.1 b/3rdparty/genie/src/host/lua-5.3.0/doc/lua.1 index 1dbf04366ce..411531b9ed6 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/lua.1 +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/lua.1 @@ -1,5 +1,4 @@ -.\" $Id: lua.man,v 1.13 2011/11/16 17:16:53 lhf Exp $ -.TH LUA 1 "$Date: 2011/11/16 17:16:53 $" +.TH LUA 1 "$Date: 2014/12/10 15:55:45 $" .SH NAME lua \- Lua interpreter .SH SYNOPSIS @@ -50,22 +49,18 @@ In interactive mode, prompts the user, reads lines from the standard input, and executes them as they are read. +If the line contains an expression or list of expressions, +then the line is evaluated and the results are printed. If a line does not contain a complete statement, then a secondary prompt is displayed and lines are read until a complete statement is formed or a syntax error is found. -If a line starts with -.BR '=' , -then -.B lua -evaluates and displays -the values of the expressions in the remainder of the line. .LP At the very start, before even handling the command line, .B lua checks the contents of the environment variables -.B LUA_INIT_5_2 +.B LUA_INIT_5_3 or .BR LUA_INIT , in that order. diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/lua.css b/3rdparty/genie/src/host/lua-5.3.0/doc/lua.css index 3d2443acffd..3199a2b6e8f 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/lua.css +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/lua.css @@ -53,12 +53,17 @@ a:visited { a:link:hover, a:visited:hover { color: #000080 ; background-color: #D0D0FF ; + border-radius: 4px; } a:link:active, a:visited:active { color: #FF0000 ; } +h1 a img { + vertical-align: text-bottom ; +} + hr { border: 0 ; height: 1px ; @@ -86,11 +91,15 @@ table hr { input[type=text] { border: solid #a0a0a0 2px ; border-radius: 2em ; - -moz-border-radius: 2em ; background-image: url('images/search.png') ; - background-repeat: no-repeat; + background-repeat: no-repeat ; background-position: 4px center ; padding-left: 20px ; height: 2em ; } +pre.session { + background-color: #F8F8F8 ; + padding: 1em ; + border-radius: 8px ; +} diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/luac.1 b/3rdparty/genie/src/host/lua-5.3.0/doc/luac.1 index 33a4ed00ace..33a4ed00ace 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/luac.1 +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/luac.1 diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/manual.css b/3rdparty/genie/src/host/lua-5.3.0/doc/manual.css index ca613cd9fb1..ca613cd9fb1 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/manual.css +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/manual.css diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/manual.html b/3rdparty/genie/src/host/lua-5.3.0/doc/manual.html index 85365363fb3..5ed8f069221 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/manual.html +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/manual.html @@ -2,7 +2,7 @@ <html> <head> -<title>Lua 5.2 Reference Manual</title> +<title>Lua 5.3 Reference Manual</title> <link rel="stylesheet" type="text/css" href="lua.css"> <link rel="stylesheet" type="text/css" href="manual.css"> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> @@ -13,13 +13,13 @@ <hr> <h1> <a href="http://www.lua.org/"><img src="logo.gif" alt="" border="0"></a> -Lua 5.2 Reference Manual +Lua 5.3 Reference Manual </h1> by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes <p> <small> -Copyright © 2011–2013 Lua.org, PUC-Rio. +Copyright © 2015 Lua.org, PUC-Rio. Freely available under the terms of the <a href="http://www.lua.org/license.html">Lua license</a>. </small> @@ -33,7 +33,7 @@ Freely available under the terms of the <!-- ====================================================================== --> <p> -<!-- $Id: manual.of,v 1.103 2013/03/14 18:51:56 roberto Exp $ --> +<!-- $Id: manual.of,v 1.146 2015/01/06 11:23:01 roberto Exp $ --> @@ -44,7 +44,7 @@ Freely available under the terms of the Lua is an extension programming language designed to support general procedural programming with data description facilities. -It also offers good support for object-oriented programming, +Lua also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, lightweight, embeddable scripting language for any program that needs one. @@ -53,7 +53,7 @@ the common subset of Standard C and C++. <p> -Being an extension language, Lua has no notion of a "main" program: +As an extension language, Lua has no notion of a "main" program: it only works <em>embedded</em> in a host client, called the <em>embedding program</em> or simply the <em>host</em>. The host program can invoke functions to execute a piece of Lua code, @@ -119,34 +119,50 @@ it usually represents the absence of a useful value. <em>Boolean</em> is the type of the values <b>false</b> and <b>true</b>. Both <b>nil</b> and <b>false</b> make a condition false; any other value makes it true. -<em>Number</em> represents real (double-precision floating-point) numbers. -Operations on numbers follow the same rules of -the underlying C implementation, -which, in turn, usually follows the IEEE 754 standard. -(It is easy to build Lua interpreters that use other -internal representations for numbers, -such as single-precision floats or long integers; -see file <code>luaconf.h</code>.) +<em>Number</em> represents both +integer numbers and real (floating-point) numbers. <em>String</em> represents immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('<code>\0</code>'). +Lua is also encoding-agnostic; +it makes no assumptions about the contents of a string. + + +<p> +The type <em>number</em> uses two internal representations, +one called <em>integer</em> and the other called <em>float</em>. +Lua has explicit rules about when each representation is used, +but it also converts between them automatically as needed (see <a href="#3.4.3">§3.4.3</a>). +Therefore, +the programmer may choose to mostly ignore the difference +between integers and floats +or to assume complete control over the representation of each number. +Standard Lua uses 64-bit integers and double-precision (64-bit) floats, +but you can also compile Lua so that it +uses 32-bit integers and/or single-precision (32-bit) floats. +The option with 32 bits for both integers and floats +is particularly attractive +for small machines and embedded systems. +(See macro <code>LUA_32BITS</code> in file <code>luaconf.h</code>.) <p> Lua can call (and manipulate) functions written in Lua and -functions written in C -(see <a href="#3.4.9">§3.4.9</a>). +functions written in C (see <a href="#3.4.10">§3.4.10</a>). +Both are represented by the type <em>function</em>. <p> The type <em>userdata</em> is provided to allow arbitrary C data to be stored in Lua variables. -A userdata value is a pointer to a block of raw memory. +A userdata value represents a block of raw memory. There are two kinds of userdata: -full userdata, where the block of memory is managed by Lua, -and light userdata, where the block of memory is managed by the host. +<em>full userdata</em>, +which is an object with a block of memory managed by Lua, +and <em>light userdata</em>, +which is simply a C pointer value. Userdata has no predefined operations in Lua, except assignment and identity test. By using <em>metatables</em>, @@ -160,17 +176,17 @@ This guarantees the integrity of data owned by the host program. <p> The type <em>thread</em> represents independent threads of execution and it is used to implement coroutines (see <a href="#2.6">§2.6</a>). -Do not confuse Lua threads with operating-system threads. +Lua threads are not related to operating-system threads. Lua supports coroutines on all systems, -even those that do not support threads. +even those that do not support threads natively. <p> The type <em>table</em> implements associative arrays, that is, arrays that can be indexed not only with numbers, -but with any Lua value except <b>nil</b> and NaN -(<em>Not a Number</em>, a special numeric value used to represent -undefined or unrepresentable results, such as <code>0/0</code>). +but with any Lua value except <b>nil</b> and NaN. +(<em>Not a Number</em> is a special numeric value used to represent +undefined or unrepresentable results, such as <code>0/0</code>.) Tables can be <em>heterogeneous</em>; that is, they can contain values of all types (except <b>nil</b>). Any key with value <b>nil</b> is not considered part of the table. @@ -179,21 +195,21 @@ an associated value <b>nil</b>. <p> -Tables are the sole data structuring mechanism in Lua; +Tables are the sole data-structuring mechanism in Lua; they can be used to represent ordinary arrays, sequences, symbol tables, sets, records, graphs, trees, etc. To represent records, Lua uses the field name as an index. The language supports this representation by providing <code>a.name</code> as syntactic sugar for <code>a["name"]</code>. There are several convenient ways to create tables in Lua -(see <a href="#3.4.8">§3.4.8</a>). +(see <a href="#3.4.9">§3.4.9</a>). <p> We use the term <em>sequence</em> to denote a table where -the set of all positive numeric keys is equal to <em>{1..n}</em> -for some integer <em>n</em>, -which is called the length of the sequence (see <a href="#3.4.6">§3.4.6</a>). +the set of all positive numeric keys is equal to {1..<em>n</em>} +for some non-negative integer <em>n</em>, +which is called the length of the sequence (see <a href="#3.4.7">§3.4.7</a>). <p> @@ -202,7 +218,7 @@ the values of table fields can be of any type. In particular, because functions are first-class values, table fields can contain functions. -Thus tables can also carry <em>methods</em> (see <a href="#3.4.10">§3.4.10</a>). +Thus tables can also carry <em>methods</em> (see <a href="#3.4.11">§3.4.11</a>). <p> @@ -212,6 +228,18 @@ The expressions <code>a[i]</code> and <code>a[j]</code> denote the same table element if and only if <code>i</code> and <code>j</code> are raw equal (that is, equal without metamethods). +In particular, floats with integral values +are equal to their respective integers +(e.g., <code>1.0 == 1</code>). +To avoid ambiguities, +any float with integral value used as a key +is converted to its respective integer. +For instance, if you write <code>a[2.0] = true</code>, +the actual key inserted into the table will be the +integer <code>2</code>. +(On the other hand, +2 and "<code>2</code>" are different Lua values and therefore +denote different table entries.) <p> @@ -235,20 +263,21 @@ of a given value (see <a href="#6.1">§6.1</a>). <p> As will be discussed in <a href="#3.2">§3.2</a> and <a href="#3.3.3">§3.3.3</a>, -any reference to a global name <code>var</code> is syntactically translated -to <code>_ENV.var</code>. +any reference to a free name +(that is, a name not bound to any declaration) <code>var</code> +is syntactically translated to <code>_ENV.var</code>. Moreover, every chunk is compiled in the scope of -an external local variable called <code>_ENV</code> (see <a href="#3.3.2">§3.3.2</a>), -so <code>_ENV</code> itself is never a global name in a chunk. +an external local variable named <code>_ENV</code> (see <a href="#3.3.2">§3.3.2</a>), +so <code>_ENV</code> itself is never a free name in a chunk. <p> Despite the existence of this external <code>_ENV</code> variable and -the translation of global names, +the translation of free names, <code>_ENV</code> is a completely regular name. In particular, you can define new variables and parameters with that name. -Each reference to a global name uses the <code>_ENV</code> that is +Each reference to a free name uses the <code>_ENV</code> that is visible at that point in the program, following the usual visibility rules of Lua (see <a href="#3.5">§3.5</a>). @@ -260,34 +289,25 @@ Any table used as the value of <code>_ENV</code> is called an <em>environment</e <p> Lua keeps a distinguished environment called the <em>global environment</em>. This value is kept at a special index in the C registry (see <a href="#4.5">§4.5</a>). -In Lua, the variable <a href="#pdf-_G"><code>_G</code></a> is initialized with this same value. +In Lua, the global variable <a href="#pdf-_G"><code>_G</code></a> is initialized with this same value. +(<a href="#pdf-_G"><code>_G</code></a> is never used internally.) <p> -When Lua compiles a chunk, -it initializes the value of its <code>_ENV</code> upvalue -with the global environment (see <a href="#pdf-load"><code>load</code></a>). +When Lua loads a chunk, +the default value for its <code>_ENV</code> upvalue +is the global environment (see <a href="#pdf-load"><code>load</code></a>). Therefore, by default, -global variables in Lua code refer to entries in the global environment. +free names in Lua code refer to entries in the global environment +(and, therefore, they are also called <em>global variables</em>). Moreover, all standard libraries are loaded in the global environment -and several functions there operate on that environment. +and some functions there operate on that environment. You can use <a href="#pdf-load"><code>load</code></a> (or <a href="#pdf-loadfile"><code>loadfile</code></a>) to load a chunk with a different environment. (In C, you have to load the chunk and then change the value of its first upvalue.) -<p> -If you change the global environment in the registry -(through C code or the debug library), -all chunks loaded after the change will get the new environment. -Previously loaded chunks are not affected, however, -as each has its own reference to the environment in its <code>_ENV</code> variable. -Moreover, the variable <a href="#pdf-_G"><code>_G</code></a> -(which is stored in the original global environment) -is never updated by Lua. - - @@ -296,7 +316,9 @@ is never updated by Lua. <p> Because Lua is an embedded extension language, all Lua actions start from C code in the host program -calling a function from the Lua library (see <a href="#lua_pcall"><code>lua_pcall</code></a>). +calling a function from the Lua library. +(When you use Lua standalone, +the <code>lua</code> application is the host program.) Whenever an error occurs during the compilation or execution of a Lua chunk, control returns to the host, @@ -316,9 +338,10 @@ to call a given function in <em>protected mode</em>. Whenever there is an error, an <em>error object</em> (also called an <em>error message</em>) is propagated with information about the error. -Lua itself only generates errors where the error object is a string, +Lua itself only generates errors whose error object is a string, but programs may generate errors with -any value for the error object. +any value as the error object. +It is up to the Lua program or its host to handle such error objects. <p> @@ -333,7 +356,8 @@ for instance by inspecting the stack and creating a stack traceback. This message handler is still protected by the protected call; so, an error inside the message handler will call the message handler again. -If this loop goes on, Lua breaks it and returns an appropriate message. +If this loop goes on for too long, +Lua breaks it and returns an appropriate message. @@ -370,7 +394,7 @@ using the <a href="#pdf-getmetatable"><code>getmetatable</code></a> function. You can replace the metatable of tables using the <a href="#pdf-setmetatable"><code>setmetatable</code></a> function. You cannot change the metatable of other types from Lua -(except by using the debug library); +(except by using the debug library (<a href="#6.10">§6.10</a>)); you must use the C API for that. @@ -385,57 +409,37 @@ but the string library sets a metatable for the string type (see <a href="#6.4"> <p> -A metatable controls how an object behaves in arithmetic operations, -order comparisons, concatenation, length operation, and indexing. +A metatable controls how an object behaves in +arithmetic operations, bitwise operations, +order comparisons, concatenation, length operation, calls, and indexing. A metatable also can define a function to be called -when a userdata or a table is garbage collected. -When Lua performs one of these operations over a value, -it checks whether this value has a metatable with the corresponding event. -If so, the value associated with that key (the metamethod) -controls how Lua will perform the operation. +when a userdata or a table is garbage collected (<a href="#2.5">§2.5</a>). <p> -Metatables control the operations listed next. -Each operation is identified by its corresponding name. -The key for each operation is a string with its name prefixed by +A detailed list of events controlled by metatables is given next. +Each operation is identified by its corresponding event name. +The key for each event is a string with its name prefixed by two underscores, '<code>__</code>'; for instance, the key for operation "add" is the string "<code>__add</code>". - - -<p> -The semantics of these operations is better explained by a Lua function -describing how the interpreter executes the operation. -The code shown here in Lua is only illustrative; -the real behavior is hard coded in the interpreter -and it is much more efficient than this simulation. -All functions used in these descriptions -(<a href="#pdf-rawget"><code>rawget</code></a>, <a href="#pdf-tonumber"><code>tonumber</code></a>, etc.) -are described in <a href="#6.1">§6.1</a>. -In particular, to retrieve the metamethod of a given object, -we use the expression +Note that queries for metamethods are always raw; +the access to a metamethod does not invoke other metamethods. +You can emulate how Lua queries a metamethod for an object <code>obj</code> +with the following code: <pre> - metatable(obj)[event] -</pre><p> -This should be read as - -<pre> - rawget(getmetatable(obj) or {}, event) -</pre><p> -This means that the access to a metamethod does not invoke other metamethods, -and access to objects with no metatables does not fail -(it simply results in <b>nil</b>). - + rawget(getmetatable(obj) or {}, "__" .. event_name) +</pre> <p> -For the unary <code>-</code> and <code>#</code> operators, -the metamethod is called with a dummy second argument. -This extra argument is only to simplify Lua's internals; -it may be removed in future versions and therefore it is not present -in the following code. -(For most uses this extra argument is irrelevant.) +For the unary operators (negation, length, and bitwise not), +the metamethod is computed and called with a dummy second operand, +equal to the first one. +This extra operand is only to simplify Lua's internals +(by making these operators behave like a binary operation) +and may be removed in future versions. +(For most uses this extra operand is irrelevant.) @@ -444,39 +448,19 @@ in the following code. <li><b>"add": </b> the <code>+</code> operation. - - -<p> -The function <code>getbinhandler</code> below defines how Lua chooses a handler -for a binary operation. -First, Lua tries the first operand. -If its type does not define a handler for the operation, -then Lua tries the second operand. - -<pre> - function getbinhandler (op1, op2, event) - return metatable(op1)[event] or metatable(op2)[event] - end -</pre><p> -By using this function, -the behavior of the <code>op1 + op2</code> is - -<pre> - function add_event (op1, op2) - local o1, o2 = tonumber(op1), tonumber(op2) - if o1 and o2 then -- both operands are numeric? - return o1 + o2 -- '+' here is the primitive 'add' - else -- at least one of the operands is not numeric - local h = getbinhandler(op1, op2, "__add") - if h then - -- call the handler with both operands - return (h(op1, op2)) - else -- no handler available: default behavior - error(···) - end - end - end -</pre><p> +If any operand for an addition is not a number +(nor a string coercible to a number), +Lua will try to call a metamethod. +First, Lua will check the first operand (even if it is valid). +If that operand does not define a metamethod for the "<code>__add</code>" event, +then Lua will check the second operand. +If Lua can find a metamethod, +it calls the metamethod with the two operands as arguments, +and the result of the call +(adjusted to one value) +is the result of the operation. +Otherwise, +it raises an error. </li> <li><b>"sub": </b> @@ -500,263 +484,179 @@ Behavior similar to the "add" operation. <li><b>"mod": </b> the <code>%</code> operation. -Behavior similar to the "add" operation, -with the operation -<code>o1 - floor(o1/o2)*o2</code> as the primitive operation. +Behavior similar to the "add" operation. </li> <li><b>"pow": </b> the <code>^</code> (exponentiation) operation. -Behavior similar to the "add" operation, -with the function <code>pow</code> (from the C math library) -as the primitive operation. +Behavior similar to the "add" operation. </li> <li><b>"unm": </b> -the unary <code>-</code> operation. +the <code>-</code> (unary minus) operation. +Behavior similar to the "add" operation. +</li> -<pre> - function unm_event (op) - local o = tonumber(op) - if o then -- operand is numeric? - return -o -- '-' here is the primitive 'unm' - else -- the operand is not numeric. - -- Try to get a handler from the operand - local h = metatable(op).__unm - if h then - -- call the handler with the operand - return (h(op)) - else -- no handler available: default behavior - error(···) - end - end - end -</pre><p> +<li><b>"idiv": </b> +the <code>//</code> (floor division) operation. + +Behavior similar to the "add" operation. </li> -<li><b>"concat": </b> -the <code>..</code> (concatenation) operation. +<li><b>"band": </b> +the <code>&</code> (bitwise and) operation. +Behavior similar to the "add" operation, +except that Lua will try a metamethod +if any operator is neither an integer +nor a value coercible to an integer (see <a href="#3.4.3">§3.4.3</a>). +</li> -<pre> - function concat_event (op1, op2) - if (type(op1) == "string" or type(op1) == "number") and - (type(op2) == "string" or type(op2) == "number") then - return op1 .. op2 -- primitive string concatenation - else - local h = getbinhandler(op1, op2, "__concat") - if h then - return (h(op1, op2)) - else - error(···) - end - end - end -</pre><p> +<li><b>"bor": </b> +the <code>|</code> (bitwise or) operation. + +Behavior similar to the "band" operation. </li> -<li><b>"len": </b> -the <code>#</code> operation. +<li><b>"bxor": </b> +the <code>~</code> (bitwise exclusive or) operation. +Behavior similar to the "band" operation. +</li> -<pre> - function len_event (op) - if type(op) == "string" then - return strlen(op) -- primitive string length - else - local h = metatable(op).__len - if h then - return (h(op)) -- call handler with the operand - elseif type(op) == "table" then - return #op -- primitive table length - else -- no handler available: error - error(···) - end - end - end -</pre><p> -See <a href="#3.4.6">§3.4.6</a> for a description of the length of a table. +<li><b>"bnot": </b> +the <code>~</code> (bitwise unary not) operation. + +Behavior similar to the "band" operation. </li> -<li><b>"eq": </b> -the <code>==</code> operation. +<li><b>"shl": </b> +the <code><<</code> (bitwise left shift) operation. -The function <code>getequalhandler</code> defines how Lua chooses a metamethod -for equality. -A metamethod is selected only when both values -being compared have the same type -and the same metamethod for the selected operation, -and the values are either tables or full userdata. +Behavior similar to the "band" operation. +</li> -<pre> - function getequalhandler (op1, op2) - if type(op1) ~= type(op2) or - (type(op1) ~= "table" and type(op1) ~= "userdata") then - return nil -- different values - end - local mm1 = metatable(op1).__eq - local mm2 = metatable(op2).__eq - if mm1 == mm2 then return mm1 else return nil end - end -</pre><p> -The "eq" event is defined as follows: +<li><b>"shr": </b> +the <code>>></code> (bitwise right shift) operation. -<pre> - function eq_event (op1, op2) - if op1 == op2 then -- primitive equal? - return true -- values are equal - end - -- try metamethod - local h = getequalhandler(op1, op2) - if h then - return not not h(op1, op2) - else - return false - end - end -</pre><p> -Note that the result is always a boolean. +Behavior similar to the "band" operation. </li> -<li><b>"lt": </b> -the <code><</code> operation. +<li><b>"concat": </b> +the <code>..</code> (concatenation) operation. +Behavior similar to the "add" operation, +except that Lua will try a metamethod +if any operator is neither a string nor a number +(which is always coercible to a string). +</li> -<pre> - function lt_event (op1, op2) - if type(op1) == "number" and type(op2) == "number" then - return op1 < op2 -- numeric comparison - elseif type(op1) == "string" and type(op2) == "string" then - return op1 < op2 -- lexicographic comparison - else - local h = getbinhandler(op1, op2, "__lt") - if h then - return not not h(op1, op2) - else - error(···) - end - end - end -</pre><p> -Note that the result is always a boolean. +<li><b>"len": </b> +the <code>#</code> (length) operation. + +If the object is not a string, +Lua will try its metamethod. +If there is a metamethod, +Lua calls it with the object as argument, +and the result of the call +(always adjusted to one value) +is the result of the operation. +If there is no metamethod but the object is a table, +then Lua uses the table length operation (see <a href="#3.4.7">§3.4.7</a>). +Otherwise, Lua raises an error. </li> -<li><b>"le": </b> -the <code><=</code> operation. +<li><b>"eq": </b> +the <code>==</code> (equal) operation. +Behavior similar to the "add" operation, +except that Lua will try a metamethod only when the values +being compared are either both tables or both full userdata +and they are not primitively equal. +The result of the call is always converted to a boolean. +</li> -<pre> - function le_event (op1, op2) - if type(op1) == "number" and type(op2) == "number" then - return op1 <= op2 -- numeric comparison - elseif type(op1) == "string" and type(op2) == "string" then - return op1 <= op2 -- lexicographic comparison - else - local h = getbinhandler(op1, op2, "__le") - if h then - return not not h(op1, op2) - else - h = getbinhandler(op1, op2, "__lt") - if h then - return not h(op2, op1) - else - error(···) - end - end - end - end -</pre><p> -Note that, in the absence of a "le" metamethod, -Lua tries the "lt", assuming that <code>a <= b</code> is -equivalent to <code>not (b < a)</code>. +<li><b>"lt": </b> +the <code><</code> (less than) operation. +Behavior similar to the "add" operation, +except that Lua will try a metamethod only when the values +being compared are neither both numbers nor both strings. +The result of the call is always converted to a boolean. +</li> -<p> +<li><b>"le": </b> +the <code><=</code> (less equal) operation. + +Unlike other operations, +The less-equal operation can use two different events. +First, Lua looks for the "<code>__le</code>" metamethod in both operands, +like in the "lt" operation. +If it cannot find such a metamethod, +then it will try the "<code>__lt</code>" event, +assuming that <code>a <= b</code> is equivalent to <code>not (b < a)</code>. As with the other comparison operators, the result is always a boolean. </li> <li><b>"index": </b> The indexing access <code>table[key]</code>. -Note that the metamethod is tried only + +This event happens when <code>table</code> is not a table or when <code>key</code> is not present in <code>table</code>. -(When <code>table</code> is not a table, -no key is ever present, -so the metamethod is always tried.) +The metamethod is looked up in <code>table</code>. -<pre> - function gettable_event (table, key) - local h - if type(table) == "table" then - local v = rawget(table, key) - -- if key is present, return raw value - if v ~= nil then return v end - h = metatable(table).__index - if h == nil then return nil end - else - h = metatable(table).__index - if h == nil then - error(···) - end - end - if type(h) == "function" then - return (h(table, key)) -- call the handler - else return h[key] -- or repeat operation on it - end - end -</pre><p> +<p> +Despite the name, +the metamethod for this event can be either a function or a table. +If it is a function, +it is called with <code>table</code> and <code>key</code> as arguments. +If it is a table, +the final result is the result of indexing this table with <code>key</code>. +(This indexing is regular, not raw, +and therefore can trigger another metamethod.) </li> <li><b>"newindex": </b> The indexing assignment <code>table[key] = value</code>. -Note that the metamethod is tried only + +Like the index event, +this event happens when <code>table</code> is not a table or when <code>key</code> is not present in <code>table</code>. +The metamethod is looked up in <code>table</code>. -<pre> - function settable_event (table, key, value) - local h - if type(table) == "table" then - local v = rawget(table, key) - -- if key is present, do raw assignment - if v ~= nil then rawset(table, key, value); return end - h = metatable(table).__newindex - if h == nil then rawset(table, key, value); return end - else - h = metatable(table).__newindex - if h == nil then - error(···) - end - end - if type(h) == "function" then - h(table, key,value) -- call the handler - else h[key] = value -- or repeat operation on it - end - end -</pre><p> +<p> +Like with indexing, +the metamethod for this event can be either a function or a table. +If it is a function, +it is called with <code>table</code>, <code>key</code>, and <code>value</code> as arguments. +If it is a table, +Lua does an indexing assignment to this table with the same key and value. +(This assignment is regular, not raw, +and therefore can trigger another metamethod.) + + +<p> +Whenever there is a "newindex" metamethod, +Lua does not perform the primitive assignment. +(If necessary, +the metamethod itself can call <a href="#pdf-rawset"><code>rawset</code></a> +to do the assignment.) </li> <li><b>"call": </b> -called when Lua calls a value. - +The call operation <code>func(args)</code>. -<pre> - function function_event (func, ...) - if type(func) == "function" then - return func(...) -- primitive call - else - local h = metatable(func).__call - if h then - return h(func, ...) - else - error(···) - end - end - end -</pre><p> +This event happens when Lua tries to call a non-function value +(that is, <code>func</code> is not a function). +The metamethod is looked up in <code>func</code>. +If present, +the metamethod is called with <code>func</code> as its first argument, +followed by the arguments of the original call (<code>args</code>). </li> </ul> @@ -769,8 +669,8 @@ called when Lua calls a value. <p> Lua performs automatic memory management. This means that -you have to worry neither about allocating memory for new objects -nor about freeing it when the objects are no longer needed. +you do not have to worry about allocating memory for new objects +or freeing it when the objects are no longer needed. Lua manages memory automatically by running a <em>garbage collector</em> to collect all <em>dead objects</em> (that is, objects that are no longer accessible from Lua). @@ -803,7 +703,8 @@ controls the relative speed of the collector relative to memory allocation. Larger values make the collector more aggressive but also increase the size of each incremental step. -Values smaller than 100 make the collector too slow and +You should not use values smaller than 100, +because they make the collector too slow and can result in the collector never finishing a cycle. The default is 200, which means that the collector runs at "twice" @@ -828,21 +729,6 @@ You can also use these functions to control the collector directly (e.g., stop and restart it). -<p> -As an experimental feature in Lua 5.2, -you can change the collector's operation mode -from incremental to <em>generational</em>. -A <em>generational collector</em> assumes that most objects die young, -and therefore it traverses only young (recently created) objects. -This behavior can reduce the time used by the collector, -but also increases memory usage (as old dead objects may accumulate). -To mitigate this second problem, -from time to time the generational collector performs a full collection. -Remember that this is an experimental feature; -you are welcome to try it, -but check your gains. - - <h3>2.5.1 – <a name="2.5.1">Garbage-Collection Metamethods</a></h3> @@ -866,7 +752,7 @@ and the metatable has a field indexed by the string "<code>__gc</code>". Note that if you set a metatable without a <code>__gc</code> field and later create that field in the metatable, the object will not be marked for finalization. -However, after an object is marked, +However, after an object has been marked, you can freely change the <code>__gc</code> field of its metatable. @@ -875,22 +761,19 @@ When a marked object becomes garbage, it is not collected immediately by the garbage collector. Instead, Lua puts it in a list. After the collection, -Lua does the equivalent of the following function -for each object in that list: +Lua goes through that list. +For each object in the list, +it checks the object's <code>__gc</code> metamethod: +If it is a function, +Lua calls it with the object as its single argument; +if the metamethod is not a function, +Lua simply ignores it. -<pre> - function gc_event (obj) - local h = metatable(obj).__gc - if type(h) == "function" then - h(obj) - end - end -</pre> <p> At the end of each garbage-collection cycle, the finalizers for objects are called in -the reverse order that they were marked for collection, +the reverse order that the objects were marked for finalization, among those collected in that cycle; that is, the first finalizer to be called is the one associated with the object marked last in the program. @@ -900,24 +783,27 @@ the execution of the regular code. <p> Because the object being collected must still be used by the finalizer, -it (and other objects accessible only through it) +that object (and other objects accessible only through it) must be <em>resurrected</em> by Lua. Usually, this resurrection is transient, and the object memory is freed in the next garbage-collection cycle. However, if the finalizer stores the object in some global place (e.g., a global variable), -then there is a permanent resurrection. +then the resurrection is permanent. +Moreover, if the finalizer marks a finalizing object for finalization again, +its finalizer will be called again in the next cycle where the +object is unreachable. In any case, -the object memory is freed only when it becomes completely inaccessible; -its finalizer will never be called twice. +the object memory is freed only in the GC cycle where +the object is unreachable and not marked for finalization. <p> When you close a state (see <a href="#lua_close"><code>lua_close</code></a>), Lua calls the finalizers of all objects marked for finalization, following the reverse order that they were marked. -If any finalizer marks new objects for collection during that phase, -these new objects will not be finalized. +If any finalizer marks objects for collection during that phase, +these marks have no effect. @@ -974,7 +860,7 @@ are removed from weak tables. Values, such as numbers and light C functions, are not subject to garbage collection, and therefore are not removed from weak tables -(unless its associated value is collected). +(unless their associated values are collected). Although strings are subject to garbage collection, they do not have an explicit construction, and therefore are not removed from weak tables. @@ -1029,8 +915,8 @@ passing as its first argument a thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>, the coroutine starts its execution, at the first line of its main function. -Extra arguments passed to <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> are passed on -to the coroutine main function. +Extra arguments passed to <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> are passed +as arguments to the coroutine's main function. After the coroutine starts running, it runs until it terminates or <em>yields</em>. @@ -1040,7 +926,8 @@ A coroutine can terminate its execution in two ways: normally, when its main function returns (explicitly or implicitly, after the last instruction); and abnormally, if there is an unprotected error. -In the first case, <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> returns <b>true</b>, +In case of normal termination, +<a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> returns <b>true</b>, plus any values returned by the coroutine main function. In case of errors, <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> returns <b>false</b> plus an error message. @@ -1179,9 +1066,10 @@ and cannot be used as names: Lua is a case-sensitive language: <code>and</code> is a reserved word, but <code>And</code> and <code>AND</code> are two different, valid names. -As a convention, names starting with an underscore followed by -uppercase letters (such as <a href="#pdf-_VERSION"><code>_VERSION</code></a>) -are reserved for variables used by Lua. +As a convention, +programs should avoid creating +names that start with an underscore followed by +one or more uppercase letters (such as <a href="#pdf-_VERSION"><code>_VERSION</code></a>). <p> @@ -1189,6 +1077,7 @@ The following strings denote other tokens: <pre> + - * / % ^ # + & ~ | << >> // == ~= <= >= < > = ( ) { } [ ] :: ; : , . .. ... @@ -1219,15 +1108,26 @@ into the string contents. <p> -A byte in a literal string can also be specified by its numerical value. -This can be done with the escape sequence <code>\x<em>XX</em></code>, +Strings in Lua can contain any 8-bit value, including embedded zeros, +which can be specified as '<code>\0</code>'. +More generally, +we can specify any byte in a literal string by its numerical value. +This can be done +with the escape sequence <code>\x<em>XX</em></code>, where <em>XX</em> is a sequence of exactly two hexadecimal digits, or with the escape sequence <code>\<em>ddd</em></code>, where <em>ddd</em> is a sequence of up to three decimal digits. -(Note that if a decimal escape is to be followed by a digit, +(Note that if a decimal escape sequence is to be followed by a digit, it must be expressed using exactly three digits.) -Strings in Lua can contain any 8-bit value, including embedded zeros, -which can be specified as '<code>\0</code>'. + + +<p> +The UTF-8 encoding of a Unicode character +can be inserted in a literal string with +the escape sequence <code>\u{<em>XXX</em>}</code> +(note the mandatory enclosing brackets), +where <em>XXX</em> is a sequence of one or more hexadecimal digits +representing the character code point. <p> @@ -1236,14 +1136,15 @@ enclosed by <em>long brackets</em>. We define an <em>opening long bracket of level <em>n</em></em> as an opening square bracket followed by <em>n</em> equal signs followed by another opening square bracket. -So, an opening long bracket of level 0 is written as <code>[[</code>, -an opening long bracket of level 1 is written as <code>[=[</code>, +So, an opening long bracket of level 0 is written as <code>[[</code>, +an opening long bracket of level 1 is written as <code>[=[</code>, and so on. A <em>closing long bracket</em> is defined similarly; -for instance, a closing long bracket of level 4 is written as <code>]====]</code>. +for instance, +a closing long bracket of level 4 is written as <code>]====]</code>. A <em>long literal</em> starts with an opening long bracket of any level and ends at the first closing long bracket of the same level. -It can contain any text except a closing bracket of the proper level. +It can contain any text except a closing bracket of the same level. Literals in this bracketed form can run for several lines, do not interpret any escape sequences, and ignore long brackets of any other level. @@ -1285,7 +1186,8 @@ the five literal strings below denote the same string: </pre> <p> -A <em>numerical constant</em> can be written with an optional fractional part +A <em>numerical constant</em> (or <em>numeral</em>) +can be written with an optional fractional part and an optional decimal exponent, marked by a letter '<code>e</code>' or '<code>E</code>'. Lua also accepts hexadecimal constants, @@ -1293,11 +1195,19 @@ which start with <code>0x</code> or <code>0X</code>. Hexadecimal constants also accept an optional fractional part plus an optional binary exponent, marked by a letter '<code>p</code>' or '<code>P</code>'. -Examples of valid numerical constants are +A numeric constant with a fractional dot or an exponent +denotes a float; +otherwise it denotes an integer. +Examples of valid integer constants are <pre> - 3 3.0 3.1416 314.16e-2 0.31416E1 - 0xff 0x0.1E 0xA23p-4 0X1.921FB54442D18P+1 + 3 345 0xff 0xBEBADA +</pre><p> +Examples of valid float constants are + +<pre> + 3.0 3.1416 314.16e-2 0.31416E1 34e1 + 0x0.1E 0xA23p-4 0X1.921FB54442D18P+1 </pre> <p> @@ -1466,7 +1376,7 @@ a chunk is simply a block: <p> Lua handles a chunk as the body of an anonymous function with a variable number of arguments -(see <a href="#3.4.10">§3.4.10</a>). +(see <a href="#3.4.11">§3.4.11</a>). As such, chunks can define local variables, receive arguments, and return values. Moreover, such anonymous function is compiled as in the @@ -1478,17 +1388,17 @@ even if it does not use that variable. <p> A chunk can be stored in a file or in a string inside the host program. To execute a chunk, -Lua first precompiles the chunk into instructions for a virtual machine, -and then it executes the compiled code +Lua first <em>loads</em> it, +precompiling the chunk's code into instructions for a virtual machine, +and then Lua executes the compiled code with an interpreter for the virtual machine. <p> Chunks can also be precompiled into binary form; -see program <code>luac</code> for details. +see program <code>luac</code> and function <a href="#pdf-string.dump"><code>string.dump</code></a> for details. Programs in source and compiled forms are interchangeable; -Lua automatically detects the file type and acts accordingly. - +Lua automatically detects the file type and acts accordingly (see <a href="#pdf-load"><code>load</code></a>). @@ -1527,7 +1437,7 @@ before the adjustment <p> The assignment statement first evaluates all its expressions -and only then are the assignments performed. +and only then the assignments are performed. Thus the code <pre> @@ -1563,7 +1473,7 @@ We use it here only for explanatory purposes.) <p> -An assignment to a global variable <code>x = val</code> +An assignment to a global name <code>x = val</code> is equivalent to the assignment <code>_ENV.x = val</code> (see <a href="#2.2">§2.2</a>). @@ -1644,7 +1554,8 @@ A <b>break</b> ends the innermost enclosing loop. <p> The <b>return</b> statement is used to return values -from a function or a chunk (which is a function in disguise). +from a function or a chunk +(which is an anonymous function). Functions can return more than one value, so the syntax for the <b>return</b> statement is @@ -1695,13 +1606,19 @@ is equivalent to the code: do local <em>var</em>, <em>limit</em>, <em>step</em> = tonumber(<em>e1</em>), tonumber(<em>e2</em>), tonumber(<em>e3</em>) if not (<em>var</em> and <em>limit</em> and <em>step</em>) then error() end - while (<em>step</em> > 0 and <em>var</em> <= <em>limit</em>) or (<em>step</em> <= 0 and <em>var</em> >= <em>limit</em>) do + <em>var</em> = <em>var</em> - <em>step</em> + while true do + <em>var</em> = <em>var</em> + <em>step</em> + if (<em>step</em> >= 0 and <em>var</em> > <em>limit</em>) or (<em>step</em> < 0 and <em>var</em> < <em>limit</em>) then + break + end local v = <em>var</em> <em>block</em> - <em>var</em> = <em>var</em> + <em>step</em> end end -</pre><p> +</pre> + +<p> Note the following: <ul> @@ -1723,14 +1640,13 @@ then a step of 1 is used. </li> <li> -You can use <b>break</b> to exit a <b>for</b> loop. +You can use <b>break</b> and <b>goto</b> to exit a <b>for</b> loop. </li> <li> -The loop variable <code>v</code> is local to the loop; -you cannot use its value after the <b>for</b> ends or is broken. -If you need this value, -assign it to another variable before breaking or exiting the loop. +The loop variable <code>v</code> is local to the loop body. +If you need its value after the loop, +assign it to another variable before exiting the loop. </li> </ul> @@ -1804,7 +1720,7 @@ function calls can be executed as statements: stat ::= functioncall </pre><p> In this case, all returned values are thrown away. -Function calls are explained in <a href="#3.4.9">§3.4.9</a>. +Function calls are explained in <a href="#3.4.10">§3.4.10</a>. @@ -1844,8 +1760,8 @@ The basic expressions in Lua are the following: <pre> exp ::= prefixexp exp ::= <b>nil</b> | <b>false</b> | <b>true</b> - exp ::= Number - exp ::= String + exp ::= Numeral + exp ::= LiteralString exp ::= functiondef exp ::= tableconstructor exp ::= ‘<b>...</b>’ @@ -1855,24 +1771,26 @@ The basic expressions in Lua are the following: </pre> <p> -Numbers and literal strings are explained in <a href="#3.1">§3.1</a>; +Numerals and literal strings are explained in <a href="#3.1">§3.1</a>; variables are explained in <a href="#3.2">§3.2</a>; -function definitions are explained in <a href="#3.4.10">§3.4.10</a>; -function calls are explained in <a href="#3.4.9">§3.4.9</a>; -table constructors are explained in <a href="#3.4.8">§3.4.8</a>. +function definitions are explained in <a href="#3.4.11">§3.4.11</a>; +function calls are explained in <a href="#3.4.10">§3.4.10</a>; +table constructors are explained in <a href="#3.4.9">§3.4.9</a>. Vararg expressions, denoted by three dots ('<code>...</code>'), can only be used when directly inside a vararg function; -they are explained in <a href="#3.4.10">§3.4.10</a>. +they are explained in <a href="#3.4.11">§3.4.11</a>. <p> Binary operators comprise arithmetic operators (see <a href="#3.4.1">§3.4.1</a>), -relational operators (see <a href="#3.4.3">§3.4.3</a>), logical operators (see <a href="#3.4.4">§3.4.4</a>), -and the concatenation operator (see <a href="#3.4.5">§3.4.5</a>). +bitwise operators (see <a href="#3.4.2">§3.4.2</a>), +relational operators (see <a href="#3.4.4">§3.4.4</a>), logical operators (see <a href="#3.4.5">§3.4.5</a>), +and the concatenation operator (see <a href="#3.4.6">§3.4.6</a>). Unary operators comprise the unary minus (see <a href="#3.4.1">§3.4.1</a>), -the unary <b>not</b> (see <a href="#3.4.4">§3.4.4</a>), -and the unary <em>length operator</em> (see <a href="#3.4.6">§3.4.6</a>). +the unary bitwise not (see <a href="#3.4.2">§3.4.2</a>), +the unary logical <b>not</b> (see <a href="#3.4.5">§3.4.5</a>), +and the unary <em>length operator</em> (see <a href="#3.4.7">§3.4.7</a>). <p> @@ -1923,38 +1841,144 @@ or <b>nil</b> if <code>f</code> does not return any values.) <h3>3.4.1 – <a name="3.4.1">Arithmetic Operators</a></h3><p> -Lua supports the usual arithmetic operators: -the binary <code>+</code> (addition), -<code>-</code> (subtraction), <code>*</code> (multiplication), -<code>/</code> (division), <code>%</code> (modulo), and <code>^</code> (exponentiation); -and unary <code>-</code> (mathematical negation). -If the operands are numbers, or strings that can be converted to -numbers (see <a href="#3.4.2">§3.4.2</a>), -then all operations have the usual meaning. -Exponentiation works for any exponent. -For instance, <code>x^(-0.5)</code> computes the inverse of the square root of <code>x</code>. -Modulo is defined as +Lua supports the following arithmetic operators: -<pre> - a % b == a - math.floor(a/b)*b -</pre><p> -That is, it is the remainder of a division that rounds -the quotient towards minus infinity. +<ul> +<li><b><code>+</code>: </b>addition</li> +<li><b><code>-</code>: </b>subtraction</li> +<li><b><code>*</code>: </b>multiplication</li> +<li><b><code>/</code>: </b>float division</li> +<li><b><code>//</code>: </b>floor division</li> +<li><b><code>%</code>: </b>modulo</li> +<li><b><code>^</code>: </b>exponentiation</li> +<li><b><code>-</code>: </b>unary minus</li> +</ul> +<p> +With the exception of exponentiation and float division, +the arithmetic operators work as follows: +If both operands are integers, +the operation is performed over integers and the result is an integer. +Otherwise, if both operands are numbers +or strings that can be converted to +numbers (see <a href="#3.4.3">§3.4.3</a>), +then they are converted to floats, +the operation is performed following the usual rules +for floating-point arithmetic +(usually the IEEE 754 standard), +and the result is a float. +<p> +Exponentiation and float division (<code>/</code>) +always convert their operands to floats +and the result is always a float. +Exponentiation uses the ISO C function <code>pow</code>, +so that it works for non-integer exponents too. -<h3>3.4.2 – <a name="3.4.2">Coercion</a></h3> +<p> +Floor division (<code>//</code>) is a division +that rounds the quotient towards minus infinite, +that is, the floor of the division of its operands. + <p> -Lua provides automatic conversion between -string and number values at run time. -Any arithmetic operation applied to a string tries to convert -this string to a number, following the rules of the Lua lexer. -(The string may have leading and trailing spaces and a sign.) -Conversely, whenever a number is used where a string is expected, -the number is converted to a string, in a reasonable format. +Modulo is defined as the remainder of a division +that rounds the quotient towards minus infinite (floor division). + + +<p> +In case of overflows in integer arithmetic, +all operations <em>wrap around</em>, +according to the usual rules of two-complement arithmetic. +(In other words, +they return the unique representable integer +that is equal modulo <em>2<sup>64</sup></em> to the mathematical result.) + + + +<h3>3.4.2 – <a name="3.4.2">Bitwise Operators</a></h3><p> +Lua supports the following bitwise operators: + +<ul> +<li><b><code>&</code>: </b>bitwise and</li> +<li><b><code>|</code>: </b>bitwise or</li> +<li><b><code>~</code>: </b>bitwise exclusive or</li> +<li><b><code>>></code>: </b>right shift</li> +<li><b><code><<</code>: </b>left shift</li> +<li><b><code>~</code>: </b>unary bitwise not</li> +</ul> + +<p> +All bitwise operations convert its operands to integers +(see <a href="#3.4.3">§3.4.3</a>), +operate on all bits of those integers, +and result in an integer. + + +<p> +Both right and left shifts fill the vacant bits with zeros. +Negative displacements shift to the other direction; +displacements with absolute values equal to or higher than +the number of bits in an integer +result in zero (as all bits are shifted out). + + + + + +<h3>3.4.3 – <a name="3.4.3">Coercions and Conversions</a></h3><p> +Lua provides some automatic conversions between some +types and representations at run time. +Bitwise operators always convert float operands to integers. +Exponentiation and float division +always convert integer operands to floats. +All other arithmetic operations applied to mixed numbers +(integers and floats) convert the integer operand to a float; +this is called the <em>usual rule</em>. +The C API also converts both integers to floats and +floats to integers, as needed. +Moreover, string concatenation accepts numbers as arguments, +besides strings. + + +<p> +Lua also converts strings to numbers, +whenever a number is expected. + + +<p> +In a conversion from integer to float, +if the integer value has an exact representation as a float, +that is the result. +Otherwise, +the conversion gets the nearest higher or +the nearest lower representable value. +This kind of conversion never fails. + + +<p> +The conversion from float to integer +checks whether the float has an exact representation as an integer +(that is, the float has an integral value and +it is in the range of integer representation). +If it does, that representation is the result. +Otherwise, the conversion fails. + + +<p> +The conversion from strings to numbers goes as follows: +First, the string is converted to an integer or a float, +following its syntax and the rules of the Lua lexer. +(The string may have also leading and trailing spaces and a sign.) +Then, the resulting number is converted to the required type +(float or integer) according to the previous rules. + + +<p> +The conversion from numbers to strings uses a +non-specified human-readable format. For complete control over how numbers are converted to strings, use the <code>format</code> function from the string library (see <a href="#pdf-string.format"><code>string.format</code></a>). @@ -1963,12 +1987,17 @@ use the <code>format</code> function from the string library -<h3>3.4.3 – <a name="3.4.3">Relational Operators</a></h3><p> -The relational operators in Lua are +<h3>3.4.4 – <a name="3.4.4">Relational Operators</a></h3><p> +Lua supports the following relational operators: -<pre> - == ~= < > <= >= -</pre><p> +<ul> +<li><b><code>==</code>: </b>equality</li> +<li><b><code>~=</code>: </b>inequality</li> +<li><b><code><</code>: </b>less than</li> +<li><b><code>></code>: </b>greater than</li> +<li><b><code><=</code>: </b>less or equal</li> +<li><b><code>>=</code>: </b>greater or equal</li> +</ul><p> These operators always result in <b>false</b> or <b>true</b>. @@ -1976,7 +2005,15 @@ These operators always result in <b>false</b> or <b>true</b>. Equality (<code>==</code>) first compares the type of its operands. If the types are different, then the result is <b>false</b>. Otherwise, the values of the operands are compared. -Numbers and strings are compared in the usual way. +Strings are compared in the obvious way. +Numbers follow the usual rule for binary operations: +if both operands are integers, +they are compared as integers; +otherwise, they are converted to floats +and compared as such. + + +<p> Tables, userdata, and threads are compared by reference: two objects are considered equal only if they are the same object. @@ -1994,8 +2031,8 @@ by using the "eq" metamethod (see <a href="#2.4">§2.4</a>). <p> -The conversion rules of <a href="#3.4.2">§3.4.2</a> -do not apply to equality comparisons. +Equality comparisons do not convert strings to numbers +or vice versa. Thus, <code>"0"==0</code> evaluates to <b>false</b>, and <code>t[0]</code> and <code>t["0"]</code> denote different entries in a table. @@ -2007,7 +2044,9 @@ The operator <code>~=</code> is exactly the negation of equality (<code>==</code <p> The order operators work as follows. -If both arguments are numbers, then they are compared as such. +If both arguments are numbers, +then they are compared following +the usual rule for binary operations. Otherwise, if both arguments are strings, then their values are compared according to the current locale. Otherwise, Lua tries to call the "lt" or the "le" @@ -2019,7 +2058,7 @@ and <code>a >= b</code> is translated to <code>b <= a</code>. -<h3>3.4.4 – <a name="3.4.4">Logical Operators</a></h3><p> +<h3>3.4.5 – <a name="3.4.5">Logical Operators</a></h3><p> The logical operators in Lua are <b>and</b>, <b>or</b>, and <b>not</b>. Like the control structures (see <a href="#3.3.4">§3.3.4</a>), @@ -2035,7 +2074,7 @@ otherwise, <b>and</b> returns its second argument. The disjunction operator <b>or</b> returns its first argument if this value is different from <b>nil</b> and <b>false</b>; otherwise, <b>or</b> returns its second argument. -Both <b>and</b> and <b>or</b> use short-cut evaluation; +Both <b>and</b> and <b>or</b> use short-circuit evaluation; that is, the second operand is evaluated only if necessary. Here are some examples: @@ -2057,18 +2096,18 @@ Here are some examples: -<h3>3.4.5 – <a name="3.4.5">Concatenation</a></h3><p> +<h3>3.4.6 – <a name="3.4.6">Concatenation</a></h3><p> The string concatenation operator in Lua is denoted by two dots ('<code>..</code>'). If both operands are strings or numbers, then they are converted to -strings according to the rules mentioned in <a href="#3.4.2">§3.4.2</a>. +strings according to the rules described in <a href="#3.4.3">§3.4.3</a>. Otherwise, the <code>__concat</code> metamethod is called (see <a href="#2.4">§2.4</a>). -<h3>3.4.6 – <a name="3.4.6">The Length Operator</a></h3> +<h3>3.4.7 – <a name="3.4.7">The Length Operator</a></h3> <p> The length operator is denoted by the unary prefix operator <code>#</code>. @@ -2088,7 +2127,7 @@ the length of a table <code>t</code> is only defined if the table is a <em>sequence</em>, that is, the set of its positive numeric keys is equal to <em>{1..n}</em> -for some integer <em>n</em>. +for some non-negative integer <em>n</em>. In that case, <em>n</em> is its length. Note that a table like @@ -2106,7 +2145,7 @@ with whether a table is a sequence. -<h3>3.4.7 – <a name="3.4.7">Precedence</a></h3><p> +<h3>3.4.8 – <a name="3.4.8">Precedence</a></h3><p> Operator precedence in Lua follows the table below, from lower to higher priority: @@ -2114,10 +2153,14 @@ from lower to higher priority: or and < > <= >= ~= == + | + ~ + & + << >> .. + - - * / % - not # - (unary) + * / // % + unary operators (not # - ~) ^ </pre><p> As usual, @@ -2130,7 +2173,7 @@ All other binary operators are left associative. -<h3>3.4.8 – <a name="3.4.8">Table Constructors</a></h3><p> +<h3>3.4.9 – <a name="3.4.9">Table Constructors</a></h3><p> Table constructors are expressions that create tables. Every time a constructor is evaluated, a new table is created. A constructor can be used to create an empty table @@ -2150,7 +2193,7 @@ with key <code>exp1</code> and value <code>exp2</code>. A field of the form <code>name = exp</code> is equivalent to <code>["name"] = exp</code>. Finally, fields of the form <code>exp</code> are equivalent to -<code>[i] = exp</code>, where <code>i</code> are consecutive numerical integers, +<code>[i] = exp</code>, where <code>i</code> are consecutive integers starting with 1. Fields in the other formats do not affect this counting. For example, @@ -2175,10 +2218,15 @@ is equivalent to </pre> <p> +The order of the assignments in a constructor is undefined. +(This order would be relevant only when there are repeated keys.) + + +<p> If the last field in the list has the form <code>exp</code> and the expression is a function call or a vararg expression, then all values returned by this expression enter the list consecutively -(see <a href="#3.4.9">§3.4.9</a>). +(see <a href="#3.4.10">§3.4.10</a>). <p> @@ -2189,7 +2237,7 @@ as a convenience for machine-generated code. -<h3>3.4.9 – <a name="3.4.9">Function Calls</a></h3><p> +<h3>3.4.10 – <a name="3.4.10">Function Calls</a></h3><p> A function call in Lua has the following syntax: <pre> @@ -2224,7 +2272,7 @@ Arguments have the following syntax: <pre> args ::= ‘<b>(</b>’ [explist] ‘<b>)</b>’ args ::= tableconstructor - args ::= String + args ::= LiteralString </pre><p> All argument expressions are evaluated before the call. A call of the form <code>f{<em>fields</em>}</code> is @@ -2264,7 +2312,7 @@ So, none of the following examples are tail calls: -<h3>3.4.10 – <a name="3.4.10">Function Definitions</a></h3> +<h3>3.4.11 – <a name="3.4.11">Function Definitions</a></h3> <p> The syntax for function definition is @@ -2555,12 +2603,13 @@ you are responsible for ensuring consistency. In particular, <em>you are responsible for controlling stack overflow</em>. You can use the function <a href="#lua_checkstack"><code>lua_checkstack</code></a> -to ensure that the stack has extra slots when pushing new elements. +to ensure that the stack has enough space for pushing new elements. <p> Whenever Lua calls C, -it ensures that the stack has at least <a name="pdf-LUA_MINSTACK"><code>LUA_MINSTACK</code></a> extra slots. +it ensures that the stack has space for +at least <a name="pdf-LUA_MINSTACK"><code>LUA_MINSTACK</code></a> extra slots. <code>LUA_MINSTACK</code> is defined as 20, so that usually you do not have to worry about stack space unless your code has loops pushing elements onto the stack. @@ -2569,7 +2618,7 @@ unless your code has loops pushing elements onto the stack. <p> When you call a Lua function without a fixed number of results (see <a href="#lua_call"><code>lua_call</code></a>), -Lua ensures that the stack has enough size for all results, +Lua ensures that the stack has enough space for all results, but it does not ensure any extra space. So, before pushing anything in the stack after such a call you should use <a href="#lua_checkstack"><code>lua_checkstack</code></a>. @@ -2673,22 +2722,22 @@ The registry table is always located at pseudo-index <a name="pdf-LUA_REGISTRYINDEX"><code>LUA_REGISTRYINDEX</code></a>, which is a valid index. Any C library can store data into this table, -but it should take care to choose keys +but it must take care to choose keys that are different from those used by other libraries, to avoid collisions. Typically, you should use as key a string containing your library name, or a light userdata with the address of a C object in your code, or any Lua object created by your code. -As with global names, +As with variable names, string keys starting with an underscore followed by uppercase letters are reserved for Lua. <p> -The integer keys in the registry are used by the reference mechanism, -implemented by the auxiliary library, +The integer keys in the registry are used +by the reference mechanism (see <a href="#luaL_ref"><code>luaL_ref</code></a>) and by some predefined values. -Therefore, integer keys should not be used for other purposes. +Therefore, integer keys must not be used for other purposes. <p> @@ -2716,8 +2765,8 @@ the global environment. <p> Internally, Lua uses the C <code>longjmp</code> facility to handle errors. -(You can also choose to use exceptions if you compile Lua as C++; -search for <code>LUAI_THROW</code> in the source code.) +(Lua will use exceptions if you compile it as C++; +search for <code>LUAI_THROW</code> in the source code for details.) When Lua faces any error (such as a memory allocation error, type errors, syntax errors, and runtime errors) @@ -2741,20 +2790,20 @@ never returning <p> The panic function runs as if it were a message handler (see <a href="#2.3">§2.3</a>); in particular, the error message is at the top of the stack. -However, there is no guarantees about stack space. +However, there is no guarantee about stack space. To push anything on the stack, -the panic function should first check the available space (see <a href="#4.2">§4.2</a>). +the panic function must first check the available space (see <a href="#4.2">§4.2</a>). <p> -Most functions in the API can throw an error, +Most functions in the API can raise an error, for instance due to a memory allocation error. The documentation for each function indicates whether -it can throw errors. +it can raise errors. <p> -Inside a C function you can throw an error by calling <a href="#lua_error"><code>lua_error</code></a>. +Inside a C function you can raise an error by calling <a href="#lua_error"><code>lua_error</code></a>. @@ -2764,7 +2813,7 @@ Inside a C function you can throw an error by calling <a href="#lua_error"> <p> Internally, Lua uses the C <code>longjmp</code> facility to yield a coroutine. -Therefore, if a function <code>foo</code> calls an API function +Therefore, if a C function <code>foo</code> calls an API function and this API function yields (directly or indirectly by calling another function that yields), Lua cannot return to <code>foo</code> any more, @@ -2777,7 +2826,7 @@ Lua raises an error whenever it tries to yield across an API call, except for three functions: <a href="#lua_yieldk"><code>lua_yieldk</code></a>, <a href="#lua_callk"><code>lua_callk</code></a>, and <a href="#lua_pcallk"><code>lua_pcallk</code></a>. All those functions receive a <em>continuation function</em> -(as a parameter called <code>k</code>) to continue execution after a yield. +(as a parameter named <code>k</code>) to continue execution after a yield. <p> @@ -2807,6 +2856,81 @@ of the original function. <p> +As an illustration, consider the following function: + +<pre> + int original_function (lua_State *L) { + ... /* code 1 */ + status = lua_pcall(L, n, m, h); /* calls Lua */ + ... /* code 2 */ + } +</pre><p> +Now we want to allow +the Lua code being run by <a href="#lua_pcall"><code>lua_pcall</code></a> to yield. +First, we can rewrite our function like here: + +<pre> + int k (lua_State *L, int status, lua_KContext ctx) { + ... /* code 2 */ + } + + int original_function (lua_State *L) { + ... /* code 1 */ + return k(L, lua_pcall(L, n, m, h), ctx); + } +</pre><p> +In the above code, +the new function <code>k</code> is a +<em>continuation function</em> (with type <a href="#lua_KFunction"><code>lua_KFunction</code></a>), +which should do all the work that the original function +was doing after calling <a href="#lua_pcall"><code>lua_pcall</code></a>. +Now, we must inform Lua that it must call <code>k</code> if the Lua code +being executed by <a href="#lua_pcall"><code>lua_pcall</code></a> gets interrupted in some way +(errors or yielding), +so we rewrite the code as here, +replacing <a href="#lua_pcall"><code>lua_pcall</code></a> by <a href="#lua_pcallk"><code>lua_pcallk</code></a>: + +<pre> + int original_function (lua_State *L) { + ... /* code 1 */ + return k(L, lua_pcallk(L, n, m, h, ctx2, k), ctx1); + } +</pre><p> +Note the external, explicit call to the continuation: +Lua will call the continuation only if needed, that is, +in case of errors or resuming after a yield. +If the called function returns normally without ever yielding, +<a href="#lua_pcallk"><code>lua_pcallk</code></a> (and <a href="#lua_callk"><code>lua_callk</code></a>) will also return normally. +(Of course, instead of calling the continuation in that case, +you can do the equivalent work directly inside the original function.) + + +<p> +Besides the Lua state, +the continuation function has two other parameters: +the final status of the call plus the context value (<code>ctx</code>) that +was passed originally to <a href="#lua_pcallk"><code>lua_pcallk</code></a>. +(Lua does not use this context value; +it only passes this value from the original function to the +continuation function.) +For <a href="#lua_pcallk"><code>lua_pcallk</code></a>, +the status is the same value that would be returned by <a href="#lua_pcallk"><code>lua_pcallk</code></a>, +except that it is <a href="#pdf-LUA_YIELD"><code>LUA_YIELD</code></a> when being executed after a yield +(instead of <a href="#pdf-LUA_OK"><code>LUA_OK</code></a>). +For <a href="#lua_yieldk"><code>lua_yieldk</code></a> and <a href="#lua_callk"><code>lua_callk</code></a>, +the status is always <a href="#pdf-LUA_YIELD"><code>LUA_YIELD</code></a> when Lua calls the continuation. +(For these two functions, +Lua will not call the continuation in case of errors, +because they do not handle errors.) +Similarly, when using <a href="#lua_callk"><code>lua_callk</code></a>, +you should call the continuation function +with <a href="#pdf-LUA_OK"><code>LUA_OK</code></a> as the status. +(For <a href="#lua_yieldk"><code>lua_yieldk</code></a>, there is not much point in calling +directly the continuation function, +because <a href="#lua_yieldk"><code>lua_yieldk</code></a> usually does not return.) + + +<p> Lua treats the continuation function as if it were the original function. The continuation function receives the same Lua stack from the original function, @@ -2819,11 +2943,6 @@ Whatever it returns is handled by Lua as if it were the return of the original function. -<p> -The only difference in the Lua state between the original function -and its continuation is the result of a call to <a href="#lua_getctx"><code>lua_getctx</code></a>. - - @@ -2850,10 +2969,10 @@ we cannot know how many elements the function pops/pushes by looking only at its arguments (e.g., they may depend on what is on the stack). The third field, <code>x</code>, -tells whether the function may throw errors: -'<code>-</code>' means the function never throws any error; -'<code>e</code>' means the function may throw errors; -'<code>v</code>' means the function may throw an error on purpose. +tells whether the function may raise errors: +'<code>-</code>' means the function never raises any error; +'<code>e</code>' means the function may raise errors; +'<code>v</code>' means the function may raise an error on purpose. @@ -2885,7 +3004,7 @@ Its arguments are <code>ptr</code>, a pointer to the block being allocated/reallocated/freed; <code>osize</code>, the original size of the block or some code about what is being allocated; -<code>nsize</code>, the new size of the block. +and <code>nsize</code>, the new size of the block. <p> @@ -2911,13 +3030,13 @@ Lua assumes the following behavior from the allocator function: <p> When <code>nsize</code> is zero, -the allocator should behave like <code>free</code> +the allocator must behave like <code>free</code> and return <code>NULL</code>. <p> When <code>nsize</code> is not zero, -the allocator should behave like <code>realloc</code>. +the allocator must behave like <code>realloc</code>. The allocator returns <code>NULL</code> if and only if it cannot fulfill the request. Lua assumes that the allocator never fails when @@ -2942,7 +3061,7 @@ It is used in the auxiliary library by <a href="#luaL_newstate"><code>luaL_newst </pre><p> Note that Standard C ensures that <code>free(NULL)</code> has no effect and that -<code>realloc(NULL, size)</code> is equivalent to <code>malloc(size)</code>. +<code>realloc(NULL,size)</code> is equivalent to <code>malloc(size)</code>. This code assumes that <code>realloc</code> does not fail when shrinking a block. (Although Standard C does not ensure this behavior, it seems to be a safe assumption.) @@ -2956,8 +3075,8 @@ it seems to be a safe assumption.) <pre>void lua_arith (lua_State *L, int op);</pre> <p> -Performs an arithmetic operation over the two values -(or one, in the case of negation) +Performs an arithmetic or bitwise operation over the two values +(or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. @@ -2973,10 +3092,17 @@ The value of <code>op</code> must be one of the following constants: <li><b><a name="pdf-LUA_OPADD"><code>LUA_OPADD</code></a>: </b> performs addition (<code>+</code>)</li> <li><b><a name="pdf-LUA_OPSUB"><code>LUA_OPSUB</code></a>: </b> performs subtraction (<code>-</code>)</li> <li><b><a name="pdf-LUA_OPMUL"><code>LUA_OPMUL</code></a>: </b> performs multiplication (<code>*</code>)</li> -<li><b><a name="pdf-LUA_OPDIV"><code>LUA_OPDIV</code></a>: </b> performs division (<code>/</code>)</li> +<li><b><a name="pdf-LUA_OPDIV"><code>LUA_OPDIV</code></a>: </b> performs float division (<code>/</code>)</li> +<li><b><a name="pdf-LUA_OPIDIV"><code>LUA_OPIDIV</code></a>: </b> performs floor division (<code>//</code>)</li> <li><b><a name="pdf-LUA_OPMOD"><code>LUA_OPMOD</code></a>: </b> performs modulo (<code>%</code>)</li> <li><b><a name="pdf-LUA_OPPOW"><code>LUA_OPPOW</code></a>: </b> performs exponentiation (<code>^</code>)</li> <li><b><a name="pdf-LUA_OPUNM"><code>LUA_OPUNM</code></a>: </b> performs mathematical negation (unary <code>-</code>)</li> +<li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise negation (<code>~</code>)</li> +<li><b><a name="pdf-LUA_OPBAND"><code>LUA_OPBAND</code></a>: </b> performs bitwise and (<code>&</code>)</li> +<li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>: </b> performs bitwise or (<code>|</code>)</li> +<li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive or (<code>~</code>)</li> +<li><b><a name="pdf-LUA_OPSHL"><code>LUA_OPSHL</code></a>: </b> performs left shift (<code><<</code>)</li> +<li><b><a name="pdf-LUA_OPSHR"><code>LUA_OPSHR</code></a>: </b> performs right shift (<code>>></code>)</li> </ul> @@ -3038,7 +3164,7 @@ Here it is in C: <pre> lua_getglobal(L, "f"); /* function to be called */ - lua_pushstring(L, "how"); /* 1st argument */ + lua_pushliteral(L, "how"); /* 1st argument */ lua_getglobal(L, "t"); /* table to be indexed */ lua_getfield(L, -1, "x"); /* push result of t.x (2nd arg) */ lua_remove(L, -2); /* remove 't' from the stack */ @@ -3046,7 +3172,7 @@ Here it is in C: lua_call(L, 3, 1); /* call 'f' with 3 arguments and 1 result */ lua_setglobal(L, "a"); /* set global 'a' */ </pre><p> -Note that the code above is "balanced": +Note that the code above is <em>balanced</em>: at its end, the stack is back to its original configuration. This is considered good programming practice. @@ -3056,8 +3182,11 @@ This is considered good programming practice. <hr><h3><a name="lua_callk"><code>lua_callk</code></a></h3><p> <span class="apii">[-(nargs + 1), +nresults, <em>e</em>]</span> -<pre>void lua_callk (lua_State *L, int nargs, int nresults, int ctx, - lua_CFunction k);</pre> +<pre>void lua_callk (lua_State *L, + int nargs, + int nresults, + lua_KContext ctx, + lua_KFunction k);</pre> <p> This function behaves exactly like <a href="#lua_call"><code>lua_call</code></a>, @@ -3095,16 +3224,16 @@ many results. <p> As an example, the following function receives a variable number -of numerical arguments and returns their average and sum: +of numerical arguments and returns their average and their sum: <pre> static int foo (lua_State *L) { int n = lua_gettop(L); /* number of arguments */ - lua_Number sum = 0; + lua_Number sum = 0.0; int i; for (i = 1; i <= n; i++) { if (!lua_isnumber(L, i)) { - lua_pushstring(L, "incorrect argument"); + lua_pushliteral(L, "incorrect argument"); lua_error(L); } sum += lua_tonumber(L, i); @@ -3120,14 +3249,15 @@ of numerical arguments and returns their average and sum: <hr><h3><a name="lua_checkstack"><code>lua_checkstack</code></a></h3><p> <span class="apii">[-0, +0, –]</span> -<pre>int lua_checkstack (lua_State *L, int extra);</pre> +<pre>int lua_checkstack (lua_State *L, int n);</pre> <p> -Ensures that there are at least <code>extra</code> free stack slots in the stack. +Ensures that the stack has space for at least <code>n</code> extra slots. It returns false if it cannot fulfill the request, -because it would cause the stack to be larger than a fixed maximum size -(typically at least a few thousand elements) or -because it cannot allocate memory for the new stack size. +either because it would cause the stack +to be larger than a fixed maximum size +(typically at least several thousand elements) or +because it cannot allocate memory for the extra space. This function never shrinks the stack; if the stack is already larger than the new size, it is left unchanged. @@ -3148,7 +3278,7 @@ On several platforms, you may not need to call this function, because all resources are naturally released when the host program ends. On the other hand, long-running programs that create multiple states, such as daemons or web servers, -might need to close states as soon as they are not needed. +will probably need to close states as soon as they are not needed. @@ -3165,7 +3295,7 @@ when compared with the value at index <code>index2</code>, following the semantics of the corresponding Lua operator (that is, it may call metamethods). Otherwise returns 0. -Also returns 0 if any of the indices is non valid. +Also returns 0 if any of the indices is not valid. <p> @@ -3193,7 +3323,7 @@ If <code>n</code> is 1, the result is the single value on the stack (that is, the function does nothing); if <code>n</code> is 0, the result is the empty string. Concatenation is performed following the usual semantics of Lua -(see <a href="#3.4.5">§3.4.5</a>). +(see <a href="#3.4.6">§3.4.6</a>). @@ -3204,10 +3334,10 @@ Concatenation is performed following the usual semantics of Lua <pre>void lua_copy (lua_State *L, int fromidx, int toidx);</pre> <p> -Moves the element at index <code>fromidx</code> -into the valid index <code>toidx</code> -without shifting any element -(therefore replacing the value at that position). +Copies the element at index <code>fromidx</code> +into the valid index <code>toidx</code>, +replacing the value at that position. +Values at other positions are not affected. @@ -3234,7 +3364,10 @@ Otherwise you can use the function <a href="#lua_newtable"><code>lua_newtable</c <hr><h3><a name="lua_dump"><code>lua_dump</code></a></h3><p> <span class="apii">[-0, +0, <em>e</em>]</span> -<pre>int lua_dump (lua_State *L, lua_Writer writer, void *data);</pre> +<pre>int lua_dump (lua_State *L, + lua_Writer writer, + void *data, + int strip);</pre> <p> Dumps a function as a binary chunk. @@ -3249,6 +3382,12 @@ to write them. <p> +If <code>strip</code> is true, +the binary representation is created without debug information +about the function. + + +<p> The value returned is the error code returned by the last call to the writer; 0 means no errors. @@ -3266,9 +3405,8 @@ This function does not pop the Lua function from the stack. <pre>int lua_error (lua_State *L);</pre> <p> -Generates a Lua error. -The error message (which can actually be a Lua value of any type) -must be on the stack top. +Generates a Lua error, +using the value at the top of the stack as the error object. This function does a long jump, and therefore never returns (see <a href="#luaL_error"><code>luaL_error</code></a>). @@ -3314,24 +3452,18 @@ memory in use by Lua by 1024. <li><b><code>LUA_GCSTEP</code>: </b> performs an incremental step of garbage collection. -The step "size" is controlled by <code>data</code> -(larger values mean more steps) in a non-specified way. -If you want to control the step size -you must experimentally tune the value of <code>data</code>. -The function returns 1 if the step finished a -garbage-collection cycle. </li> <li><b><code>LUA_GCSETPAUSE</code>: </b> sets <code>data</code> as the new value -for the <em>pause</em> of the collector (see <a href="#2.5">§2.5</a>). -The function returns the previous value of the pause. +for the <em>pause</em> of the collector (see <a href="#2.5">§2.5</a>) +and returns the previous value of the pause. </li> <li><b><code>LUA_GCSETSTEPMUL</code>: </b> sets <code>data</code> as the new value for the <em>step multiplier</em> of -the collector (see <a href="#2.5">§2.5</a>). -The function returns the previous value of the step multiplier. +the collector (see <a href="#2.5">§2.5</a>) +and returns the previous value of the step multiplier. </li> <li><b><code>LUA_GCISRUNNING</code>: </b> @@ -3339,16 +3471,6 @@ returns a boolean that tells whether the collector is running (i.e., not stopped). </li> -<li><b><code>LUA_GCGEN</code>: </b> -changes the collector to generational mode -(see <a href="#2.5">§2.5</a>). -</li> - -<li><b><code>LUA_GCINC</code>: </b> -changes the collector to incremental mode. -This is the default mode. -</li> - </ul> <p> @@ -3366,68 +3488,80 @@ see <a href="#pdf-collectgarbage"><code>collectgarbage</code></a>. <p> Returns the memory-allocation function of a given state. If <code>ud</code> is not <code>NULL</code>, Lua stores in <code>*ud</code> the -opaque pointer passed to <a href="#lua_newstate"><code>lua_newstate</code></a>. +opaque pointer given when the memory-allocator function was set. + + + +<hr><h3><a name="lua_getfield"><code>lua_getfield</code></a></h3><p> +<span class="apii">[-0, +1, <em>e</em>]</span> +<pre>int lua_getfield (lua_State *L, int index, const char *k);</pre> +<p> +Pushes onto the stack the value <code>t[k]</code>, +where <code>t</code> is the value at the given index. +As in Lua, this function may trigger a metamethod +for the "index" event (see <a href="#2.4">§2.4</a>). -<hr><h3><a name="lua_getctx"><code>lua_getctx</code></a></h3><p> +<p> +Returns the type of the pushed value. + + + + + +<hr><h3><a name="lua_getextraspace"><code>lua_getextraspace</code></a></h3><p> <span class="apii">[-0, +0, –]</span> -<pre>int lua_getctx (lua_State *L, int *ctx);</pre> +<pre>void *lua_getextraspace (lua_State *L);</pre> <p> -This function is called by a continuation function (see <a href="#4.7">§4.7</a>) -to retrieve the status of the thread and a context information. +Returns a pointer to a raw memory area associated with the +given Lua state. +The application can use this area for any purpose; +Lua does not use it for anything. <p> -When called in the original function, -<a href="#lua_getctx"><code>lua_getctx</code></a> always returns <a href="#pdf-LUA_OK"><code>LUA_OK</code></a> -and does not change the value of its argument <code>ctx</code>. -When called inside a continuation function, -<a href="#lua_getctx"><code>lua_getctx</code></a> returns <a href="#pdf-LUA_YIELD"><code>LUA_YIELD</code></a> and sets -the value of <code>ctx</code> to be the context information -(the value passed as the <code>ctx</code> argument -to the callee together with the continuation function). +Each new thread has this area initialized with a copy +of the area of the main thread. <p> -When the callee is <a href="#lua_pcallk"><code>lua_pcallk</code></a>, -Lua may also call its continuation function -to handle errors during the call. -That is, upon an error in the function called by <a href="#lua_pcallk"><code>lua_pcallk</code></a>, -Lua may not return to the original function -but instead may call the continuation function. -In that case, a call to <a href="#lua_getctx"><code>lua_getctx</code></a> will return the error code -(the value that would be returned by <a href="#lua_pcallk"><code>lua_pcallk</code></a>); -the value of <code>ctx</code> will be set to the context information, -as in the case of a yield. +By default, this area has the size of a pointer to void, +but you can recompile Lua with a different size for this area. +(See <code>LUA_EXTRASPACE</code> in <code>luaconf.h</code>.) -<hr><h3><a name="lua_getfield"><code>lua_getfield</code></a></h3><p> +<hr><h3><a name="lua_getglobal"><code>lua_getglobal</code></a></h3><p> <span class="apii">[-0, +1, <em>e</em>]</span> -<pre>void lua_getfield (lua_State *L, int index, const char *k);</pre> +<pre>int lua_getglobal (lua_State *L, const char *name);</pre> <p> -Pushes onto the stack the value <code>t[k]</code>, -where <code>t</code> is the value at the given index. -As in Lua, this function may trigger a metamethod -for the "index" event (see <a href="#2.4">§2.4</a>). +Pushes onto the stack the value of the global <code>name</code>. +Returns the type of that value. -<hr><h3><a name="lua_getglobal"><code>lua_getglobal</code></a></h3><p> +<hr><h3><a name="lua_geti"><code>lua_geti</code></a></h3><p> <span class="apii">[-0, +1, <em>e</em>]</span> -<pre>void lua_getglobal (lua_State *L, const char *name);</pre> +<pre>int lua_geti (lua_State *L, int index, lua_Integer i);</pre> <p> -Pushes onto the stack the value of the global <code>name</code>. +Pushes onto the stack the value <code>t[i]</code>, +where <code>t</code> is the value at the given index. +As in Lua, this function may trigger a metamethod +for the "index" event (see <a href="#2.4">§2.4</a>). + + +<p> +Returns the type of the pushed value. @@ -3438,8 +3572,9 @@ Pushes onto the stack the value of the global <code>name</code>. <pre>int lua_getmetatable (lua_State *L, int index);</pre> <p> -Pushes onto the stack the metatable of the value at the given index. -If the value does not have a metatable, +If the value at the given index has a metatable, +the function pushes that metatable onto the stack and returns 1. +Otherwise, the function returns 0 and pushes nothing on the stack. @@ -3448,7 +3583,7 @@ the function returns 0 and pushes nothing on the stack. <hr><h3><a name="lua_gettable"><code>lua_gettable</code></a></h3><p> <span class="apii">[-1, +1, <em>e</em>]</span> -<pre>void lua_gettable (lua_State *L, int index);</pre> +<pre>int lua_gettable (lua_State *L, int index);</pre> <p> Pushes onto the stack the value <code>t[k]</code>, @@ -3457,12 +3592,16 @@ and <code>k</code> is the value at the top of the stack. <p> -This function pops the key from the stack -(putting the resulting value in its place). +This function pops the key from the stack, +pushing the resulting value in its place. As in Lua, this function may trigger a metamethod for the "index" event (see <a href="#2.4">§2.4</a>). +<p> +Returns the type of the pushed value. + + @@ -3473,8 +3612,8 @@ for the "index" event (see <a href="#2.4">§2.4</a>). <p> Returns the index of the top element in the stack. Because indices start at 1, -this result is equal to the number of elements in the stack -(and so 0 means an empty stack). +this result is equal to the number of elements in the stack; +in particular, 0 means an empty stack. @@ -3482,12 +3621,15 @@ this result is equal to the number of elements in the stack <hr><h3><a name="lua_getuservalue"><code>lua_getuservalue</code></a></h3><p> <span class="apii">[-0, +1, –]</span> -<pre>void lua_getuservalue (lua_State *L, int index);</pre> +<pre>int lua_getuservalue (lua_State *L, int index);</pre> <p> Pushes onto the stack the Lua value associated with the userdata at the given index. -This Lua value must be a table or <b>nil</b>. + + +<p> +Returns the type of the pushed value. @@ -3508,16 +3650,24 @@ because a pseudo-index is not an actual stack position. <hr><h3><a name="lua_Integer"><code>lua_Integer</code></a></h3> -<pre>typedef ptrdiff_t lua_Integer;</pre> +<pre>typedef ... lua_Integer;</pre> + +<p> +The type of integers in Lua. + <p> -The type used by the Lua API to represent signed integral values. +By default this type is <code>long long</code>, +(usually a 64-bit two-complement integer), +but that can be changed to <code>long</code> or <code>int</code> +(usually a 32-bit two-complement integer). +(See <code>LUA_INT</code> in <code>luaconf.h</code>.) <p> -By default it is a <code>ptrdiff_t</code>, -which is usually the largest signed integral type the machine handles -"comfortably". +Lua also defines the constants +<a name="pdf-LUA_MININTEGER"><code>LUA_MININTEGER</code></a> and <a name="pdf-LUA_MAXINTEGER"><code>LUA_MAXINTEGER</code></a>, +with the minimum and the maximum values that fit in this type. @@ -3559,6 +3709,19 @@ Returns 1 if the value at the given index is a function +<hr><h3><a name="lua_isinteger"><code>lua_isinteger</code></a></h3><p> +<span class="apii">[-0, +0, –]</span> +<pre>int lua_isinteger (lua_State *L, int index);</pre> + +<p> +Returns 1 if the value at the given index is an integer +(that is, the value is a number and is represented as an integer), +and 0 otherwise. + + + + + <hr><h3><a name="lua_islightuserdata"><code>lua_islightuserdata</code></a></h3><p> <span class="apii">[-0, +0, –]</span> <pre>int lua_islightuserdata (lua_State *L, int index);</pre> @@ -3670,13 +3833,51 @@ Returns 1 if the value at the given index is a userdata +<hr><h3><a name="lua_isyieldable"><code>lua_isyieldable</code></a></h3><p> +<span class="apii">[-0, +0, –]</span> +<pre>int lua_isyieldable (lua_State *L);</pre> + +<p> +Returns 1 if the given coroutine can yield, +and 0 otherwise. + + + + + +<hr><h3><a name="lua_KContext"><code>lua_KContext</code></a></h3> +<pre>typedef ... lua_KContext;</pre> + +<p> +The type for continuation-function contexts. +It must be a numerical type. +This type is defined as <code>intptr_t</code> +when <code>intptr_t</code> is available, +so that it can store pointers too. +Otherwise, it is defined as <code>ptrdiff_t</code>. + + + + + +<hr><h3><a name="lua_KFunction"><code>lua_KFunction</code></a></h3> +<pre>typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx);</pre> + +<p> +Type for continuation functions (see <a href="#4.7">§4.7</a>). + + + + + <hr><h3><a name="lua_len"><code>lua_len</code></a></h3><p> <span class="apii">[-0, +1, <em>e</em>]</span> <pre>void lua_len (lua_State *L, int index);</pre> <p> -Returns the "length" of the value at the given index; -it is equivalent to the '<code>#</code>' operator in Lua (see <a href="#3.4.6">§3.4.6</a>). +Returns the length of the value at the given index. +It is equivalent to the '<code>#</code>' operator in Lua (see <a href="#3.4.7">§3.4.7</a>) and +may trigger a metamethod for the "length" event (see <a href="#2.4">§2.4</a>). The result is pushed on the stack. @@ -3688,11 +3889,11 @@ The result is pushed on the stack. <pre>int lua_load (lua_State *L, lua_Reader reader, void *data, - const char *source, + const char *chunkname, const char *mode);</pre> <p> -Loads a Lua chunk (without running it). +Loads a Lua chunk without running it. If there are no errors, <code>lua_load</code> pushes the compiled chunk as a Lua function on top of the stack. @@ -3727,7 +3928,7 @@ The <code>data</code> argument is an opaque value passed to the reader function. <p> -The <code>source</code> argument gives a name to the chunk, +The <code>chunkname</code> argument gives a name to the chunk, which is used for error messages and in debug information (see <a href="#4.9">§4.9</a>). @@ -3741,16 +3942,17 @@ a <code>NULL</code> value is equivalent to the string "<code>bt</code>". <p> <code>lua_load</code> uses the stack internally, -so the reader function should always leave the stack +so the reader function must always leave the stack unmodified when returning. <p> -If the resulting function has one upvalue, -this upvalue is set to the value of the global environment +If the resulting function has upvalues, +its first upvalue is set to the value of the global environment stored at index <code>LUA_RIDX_GLOBALS</code> in the registry (see <a href="#4.5">§4.5</a>). When loading main chunks, this upvalue will be the <code>_ENV</code> variable (see <a href="#2.2">§2.2</a>). +Other upvalues are initialized with <b>nil</b>. @@ -3762,7 +3964,7 @@ this upvalue will be the <code>_ENV</code> variable (see <a href="#2.2">§2. <p> Creates a new thread running in a new, independent state. -Returns <code>NULL</code> if cannot create the thread or the state +Returns <code>NULL</code> if it cannot create the thread or the state (due to lack of memory). The argument <code>f</code> is the allocator function; Lua does all memory allocation for this state through this function. @@ -3869,10 +4071,35 @@ the table during its traversal. <pre>typedef double lua_Number;</pre> <p> -The type of numbers in Lua. -By default, it is double, but that can be changed in <code>luaconf.h</code>. -Through this configuration file you can change -Lua to operate with another type for numbers (e.g., float or long). +The type of floats in Lua. + + +<p> +By default this type is double, +but that can be changed to a single float. +(See <code>LUA_REAL</code> in <code>luaconf.h</code>.) + + + + + +<hr><h3><a name="lua_numbertointeger"><code>lua_numbertointeger</code></a></h3> +<pre>int lua_numbertointeger (lua_Number n, lua_Integer *p);</pre> + +<p> +Converts a Lua float to a Lua integer. +This macro assumes that <code>n</code> has an integral value. +If that value is within the range of Lua integers, +it is converted to an integer and assigned to <code>*p</code>. +The macro results in a boolean indicating whether the +conversion was successful. +(Note that this range test can be tricky to do +correctly without this macro, +due to roundings.) + + +<p> +This macro may evaluate its arguments more than once. @@ -3921,7 +4148,7 @@ since by then the stack has unwound. <p> -The <a href="#lua_pcall"><code>lua_pcall</code></a> function returns one of the following codes +The <a href="#lua_pcall"><code>lua_pcall</code></a> function returns one of the following constants (defined in <code>lua.h</code>): <ul> @@ -3944,8 +4171,7 @@ error while running the message handler. <li><b><a name="pdf-LUA_ERRGCMM"><code>LUA_ERRGCMM</code></a>: </b> error while running a <code>__gc</code> metamethod. -(This error typically has no relation with the function being called. -It is generated by the garbage collector.) +(This error typically has no relation with the function being called.) </li> </ul> @@ -3958,9 +4184,9 @@ It is generated by the garbage collector.) <pre>int lua_pcallk (lua_State *L, int nargs, int nresults, - int errfunc, - int ctx, - lua_CFunction k);</pre> + int msgh, + lua_KContext ctx, + lua_KFunction k);</pre> <p> This function behaves exactly like <a href="#lua_pcall"><code>lua_pcall</code></a>, @@ -4006,11 +4232,11 @@ it is possible to associate some values with it, thus creating a C closure (see <a href="#4.4">§4.4</a>); these values are then accessible to the function whenever it is called. To associate values with a C function, -first these values should be pushed onto the stack +first these values must be pushed onto the stack (when there are multiple values, the first value is pushed first). Then <a href="#lua_pushcclosure"><code>lua_pushcclosure</code></a> is called to create and push the C function onto the stack, -with the argument <code>n</code> telling how many values should be +with the argument <code>n</code> telling how many values will be associated with the function. <a href="#lua_pushcclosure"><code>lua_pushcclosure</code></a> also pops these values from the stack. @@ -4023,7 +4249,7 @@ The maximum value for <code>n</code> is 255. When <code>n</code> is zero, this function creates a <em>light C function</em>, which is just a pointer to the C function. -In that case, it never throws a memory error. +In that case, it never raises a memory error. @@ -4065,7 +4291,7 @@ Note that <code>f</code> is used twice. <p> Pushes onto the stack a formatted string and returns a pointer to this string. -It is similar to the ANSI C function <code>sprintf</code>, +It is similar to the ISO C function <code>sprintf</code>, but has some important differences: <ul> @@ -4080,12 +4306,14 @@ the result is a Lua string and Lua takes care of memory allocation The conversion specifiers are quite restricted. There are no flags, widths, or precisions. The conversion specifiers can only be -'<code>%%</code>' (inserts a '<code>%</code>' in the string), +'<code>%%</code>' (inserts the character '<code>%</code>'), '<code>%s</code>' (inserts a zero-terminated string, with no size restrictions), '<code>%f</code>' (inserts a <a href="#lua_Number"><code>lua_Number</code></a>), +'<code>%L</code>' (inserts a <a href="#lua_Integer"><code>lua_Integer</code></a>), '<code>%p</code>' (inserts a pointer as a hexadecimal numeral), -'<code>%d</code>' (inserts an <code>int</code>), and -'<code>%c</code>' (inserts an <code>int</code> as a byte). +'<code>%d</code>' (inserts an <code>int</code>), +'<code>%c</code>' (inserts an <code>int</code> as a one-byte character), and +'<code>%U</code>' (inserts a <code>long int</code> as a UTF-8 byte sequence). </li> </ul> @@ -4109,7 +4337,7 @@ Pushes the global environment onto the stack. <pre>void lua_pushinteger (lua_State *L, lua_Integer n);</pre> <p> -Pushes a number with value <code>n</code> onto the stack. +Pushes an integer with value <code>n</code> onto the stack. @@ -4186,7 +4414,7 @@ Pushes a nil value onto the stack. <pre>void lua_pushnumber (lua_State *L, lua_Number n);</pre> <p> -Pushes a number with value <code>n</code> onto the stack. +Pushes a float with value <code>n</code> onto the stack. @@ -4227,17 +4455,6 @@ Returns 1 if this thread is the main thread of its state. -<hr><h3><a name="lua_pushunsigned"><code>lua_pushunsigned</code></a></h3><p> -<span class="apii">[-0, +1, –]</span> -<pre>void lua_pushunsigned (lua_State *L, lua_Unsigned n);</pre> - -<p> -Pushes a number with value <code>n</code> onto the stack. - - - - - <hr><h3><a name="lua_pushvalue"><code>lua_pushvalue</code></a></h3><p> <span class="apii">[-0, +1, –]</span> <pre>void lua_pushvalue (lua_State *L, int index);</pre> @@ -4273,7 +4490,7 @@ Returns 1 if the two values in indices <code>index1</code> and <code>index2</code> are primitively equal (that is, without calling metamethods). Otherwise returns 0. -Also returns 0 if any of the indices are non valid. +Also returns 0 if any of the indices are not valid. @@ -4281,7 +4498,7 @@ Also returns 0 if any of the indices are non valid. <hr><h3><a name="lua_rawget"><code>lua_rawget</code></a></h3><p> <span class="apii">[-1, +1, –]</span> -<pre>void lua_rawget (lua_State *L, int index);</pre> +<pre>int lua_rawget (lua_State *L, int index);</pre> <p> Similar to <a href="#lua_gettable"><code>lua_gettable</code></a>, but does a raw access @@ -4293,7 +4510,7 @@ Similar to <a href="#lua_gettable"><code>lua_gettable</code></a>, but does a raw <hr><h3><a name="lua_rawgeti"><code>lua_rawgeti</code></a></h3><p> <span class="apii">[-0, +1, –]</span> -<pre>void lua_rawgeti (lua_State *L, int index, int n);</pre> +<pre>int lua_rawgeti (lua_State *L, int index, lua_Integer n);</pre> <p> Pushes onto the stack the value <code>t[n]</code>, @@ -4302,12 +4519,16 @@ The access is raw; that is, it does not invoke metamethods. +<p> +Returns the type of the pushed value. + + <hr><h3><a name="lua_rawgetp"><code>lua_rawgetp</code></a></h3><p> <span class="apii">[-0, +1, –]</span> -<pre>void lua_rawgetp (lua_State *L, int index, const void *p);</pre> +<pre>int lua_rawgetp (lua_State *L, int index, const void *p);</pre> <p> Pushes onto the stack the value <code>t[k]</code>, @@ -4317,6 +4538,10 @@ The access is raw; that is, it does not invoke metamethods. +<p> +Returns the type of the pushed value. + + @@ -4351,10 +4576,10 @@ Similar to <a href="#lua_settable"><code>lua_settable</code></a>, but does a raw <hr><h3><a name="lua_rawseti"><code>lua_rawseti</code></a></h3><p> <span class="apii">[-1, +0, <em>e</em>]</span> -<pre>void lua_rawseti (lua_State *L, int index, int n);</pre> +<pre>void lua_rawseti (lua_State *L, int index, lua_Integer i);</pre> <p> -Does the equivalent of <code>t[n] = v</code>, +Does the equivalent of <code>t[i] = v</code>, where <code>t</code> is the table at the given index and <code>v</code> is the value at the top of the stack. @@ -4501,6 +4726,22 @@ this parameter can be <code>NULL</code>. +<hr><h3><a name="lua_rotate"><code>lua_rotate</code></a></h3><p> +<span class="apii">[-0, +0, –]</span> +<pre>void lua_rotate (lua_State *L, int idx, int n);</pre> + +<p> +Rotates the stack elements from <code>idx</code> to the top <code>n</code> positions +in the direction of the top, for a positive <code>n</code>, +or <code>-n</code> positions in the direction of the bottom, +for a negative <code>n</code>. +The absolute value of <code>n</code> must not be greater than the size +of the slice being rotated. + + + + + <hr><h3><a name="lua_setallocf"><code>lua_setallocf</code></a></h3><p> <span class="apii">[-0, +0, –]</span> <pre>void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);</pre> @@ -4544,6 +4785,25 @@ sets it as the new value of global <code>name</code>. +<hr><h3><a name="lua_seti"><code>lua_seti</code></a></h3><p> +<span class="apii">[-1, +0, <em>e</em>]</span> +<pre>void lua_seti (lua_State *L, int index, lua_Integer n);</pre> + +<p> +Does the equivalent to <code>t[n] = v</code>, +where <code>t</code> is the value at the given index +and <code>v</code> is the value at the top of the stack. + + +<p> +This function pops the value from the stack. +As in Lua, this function may trigger a metamethod +for the "newindex" event (see <a href="#2.4">§2.4</a>). + + + + + <hr><h3><a name="lua_setmetatable"><code>lua_setmetatable</code></a></h3><p> <span class="apii">[-1, +0, –]</span> <pre>void lua_setmetatable (lua_State *L, int index);</pre> @@ -4596,7 +4856,7 @@ If <code>index</code> is 0, then all stack elements are removed. <pre>void lua_setuservalue (lua_State *L, int index);</pre> <p> -Pops a table or <b>nil</b> from the stack and sets it as +Pops a value from the stack and sets it as the new value associated to the userdata at the given index. @@ -4648,6 +4908,27 @@ You can resume threads with status <a href="#pdf-LUA_OK"><code>LUA_OK</code></a> +<hr><h3><a name="lua_stringtonumber"><code>lua_stringtonumber</code></a></h3><p> +<span class="apii">[-0, +1, –]</span> +<pre>size_t lua_stringtonumber (lua_State *L, const char *s);</pre> + +<p> +Converts the zero-terminated string <code>s</code> to a number, +pushes that number into the stack, +and returns the total size of the string, +that is, its length plus one. +The conversion can result in an integer or a float, +according to the lexical conventions of Lua (see <a href="#3.1">§3.1</a>). +The string may have leading and trailing spaces and a sign. +If the string is not a valid numeral, +returns 0 and pushes nothing. +(Note that the result can be used as a boolean, +true if the conversion succeeds.) + + + + + <hr><h3><a name="lua_toboolean"><code>lua_toboolean</code></a></h3><p> <span class="apii">[-0, +0, –]</span> <pre>int lua_toboolean (lua_State *L, int index);</pre> @@ -4697,17 +4978,12 @@ Equivalent to <a href="#lua_tointegerx"><code>lua_tointegerx</code></a> with <co <p> Converts the Lua value at the given index to the signed integral type <a href="#lua_Integer"><code>lua_Integer</code></a>. -The Lua value must be a number or a string convertible to a number -(see <a href="#3.4.2">§3.4.2</a>); +The Lua value must be an integer, +or a number or string convertible to an integer (see <a href="#3.4.3">§3.4.3</a>); otherwise, <code>lua_tointegerx</code> returns 0. <p> -If the number is not an integer, -it is truncated in some non-specified way. - - -<p> If <code>isnum</code> is not <code>NULL</code>, its referent is assigned a boolean value that indicates whether the operation succeeded. @@ -4739,9 +5015,12 @@ to a string inside the Lua state. This string always has a zero ('<code>\0</code>') after its last character (as in C), but can contain other zeros in its body. + + +<p> Because Lua has garbage collection, there is no guarantee that the pointer returned by <code>lua_tolstring</code> -will be valid after the corresponding value is removed from the stack. +will be valid after the corresponding Lua value is removed from the stack. @@ -4766,7 +5045,7 @@ Equivalent to <a href="#lua_tonumberx"><code>lua_tonumberx</code></a> with <code Converts the Lua value at the given index to the C type <a href="#lua_Number"><code>lua_Number</code></a> (see <a href="#lua_Number"><code>lua_Number</code></a>). The Lua value must be a number or a string convertible to a number -(see <a href="#3.4.2">§3.4.2</a>); +(see <a href="#3.4.3">§3.4.3</a>); otherwise, <a href="#lua_tonumberx"><code>lua_tonumberx</code></a> returns 0. @@ -4824,46 +5103,6 @@ otherwise, the function returns <code>NULL</code>. -<hr><h3><a name="lua_tounsigned"><code>lua_tounsigned</code></a></h3><p> -<span class="apii">[-0, +0, –]</span> -<pre>lua_Unsigned lua_tounsigned (lua_State *L, int index);</pre> - -<p> -Equivalent to <a href="#lua_tounsignedx"><code>lua_tounsignedx</code></a> with <code>isnum</code> equal to <code>NULL</code>. - - - - - -<hr><h3><a name="lua_tounsignedx"><code>lua_tounsignedx</code></a></h3><p> -<span class="apii">[-0, +0, –]</span> -<pre>lua_Unsigned lua_tounsignedx (lua_State *L, int index, int *isnum);</pre> - -<p> -Converts the Lua value at the given index -to the unsigned integral type <a href="#lua_Unsigned"><code>lua_Unsigned</code></a>. -The Lua value must be a number or a string convertible to a number -(see <a href="#3.4.2">§3.4.2</a>); -otherwise, <code>lua_tounsignedx</code> returns 0. - - -<p> -If the number is not an integer, -it is truncated in some non-specified way. -If the number is outside the range of representable values, -it is normalized to the remainder of its division by -one more than the maximum representable value. - - -<p> -If <code>isnum</code> is not <code>NULL</code>, -its referent is assigned a boolean value that -indicates whether the operation succeeded. - - - - - <hr><h3><a name="lua_touserdata"><code>lua_touserdata</code></a></h3><p> <span class="apii">[-0, +0, –]</span> <pre>void *lua_touserdata (lua_State *L, int index);</pre> @@ -4916,16 +5155,10 @@ which must be one the values returned by <a href="#lua_type"><code>lua_type</cod <hr><h3><a name="lua_Unsigned"><code>lua_Unsigned</code></a></h3> -<pre>typedef unsigned long lua_Unsigned;</pre> - -<p> -The type used by the Lua API to represent unsigned integral values. -It must have at least 32 bits. - +<pre>typedef ... lua_Unsigned;</pre> <p> -By default it is an <code>unsigned int</code> or an <code>unsigned long</code>, -whichever can hold 32-bit values. +The unsigned version of <a href="#lua_Integer"><code>lua_Integer</code></a>. @@ -5000,14 +5233,14 @@ and pushes them onto the stack <code>to</code>. <hr><h3><a name="lua_yield"><code>lua_yield</code></a></h3><p> -<span class="apii">[-?, +?, –]</span> +<span class="apii">[-?, +?, <em>e</em>]</span> <pre>int lua_yield (lua_State *L, int nresults);</pre> <p> This function is equivalent to <a href="#lua_yieldk"><code>lua_yieldk</code></a>, but it has no continuation (see <a href="#4.7">§4.7</a>). Therefore, when the thread resumes, -it returns to the function that called +it continues the function that called the function calling <code>lua_yield</code>. @@ -5015,25 +5248,22 @@ the function calling <code>lua_yield</code>. <hr><h3><a name="lua_yieldk"><code>lua_yieldk</code></a></h3><p> -<span class="apii">[-?, +?, –]</span> -<pre>int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k);</pre> +<span class="apii">[-?, +?, <em>e</em>]</span> +<pre>int lua_yieldk (lua_State *L, + int nresults, + lua_KContext ctx, + lua_KFunction k);</pre> <p> -Yields a coroutine. +Yields a coroutine (thread). <p> -This function should only be called as the -return expression of a C function, as follows: - -<pre> - return lua_yieldk (L, n, i, k); -</pre><p> -When a C function calls <a href="#lua_yieldk"><code>lua_yieldk</code></a> in that way, +When a C function calls <a href="#lua_yieldk"><code>lua_yieldk</code></a>, the running coroutine suspends its execution, and the call to <a href="#lua_resume"><code>lua_resume</code></a> that started this coroutine returns. The parameter <code>nresults</code> is the number of values from the stack -that are passed as results to <a href="#lua_resume"><code>lua_resume</code></a>. +that will be passed as results to <a href="#lua_resume"><code>lua_resume</code></a>. <p> @@ -5042,11 +5272,34 @@ Lua calls the given continuation function <code>k</code> to continue the execution of the C function that yielded (see <a href="#4.7">§4.7</a>). This continuation function receives the same stack from the previous function, -with the results removed and +with the <code>n</code> results removed and replaced by the arguments passed to <a href="#lua_resume"><code>lua_resume</code></a>. Moreover, -the continuation function may access the value <code>ctx</code> -by calling <a href="#lua_getctx"><code>lua_getctx</code></a>. +the continuation function receives the value <code>ctx</code> +that was passed to <a href="#lua_yieldk"><code>lua_yieldk</code></a>. + + +<p> +Usually, this function does not return; +when the coroutine eventually resumes, +it continues executing the continuation function. +However, there is one special case, +which is when this function is called +from inside a line hook (see <a href="#4.9">§4.9</a>). +In that case, <code>lua_yieldk</code> should be called with no continuation +(probably in the form of <a href="#lua_yield"><code>lua_yield</code></a>), +and the hook should return immediately after the call. +Lua will yield and, +when the coroutine resumes again, +it will continue the normal execution +of the (Lua) function that triggered the hook. + + +<p> +This function can raise an error if it is called from a thread +with a pending C call with no continuation function, +or it is called from a thread that is not running inside a resume +(e.g., the main thread). @@ -5100,7 +5353,7 @@ The fields of <a href="#lua_Debug"><code>lua_Debug</code></a> have the following <ul> <li><b><code>source</code>: </b> -the source of the chunk that created the function. +the name of the chunk that created the function. If <code>source</code> starts with a '<code>@</code>', it means that the function was defined in a file where the file name follows the '<code>@</code>'. @@ -5279,6 +5532,11 @@ numbers of the lines that are valid on the function. (A <em>valid line</em> is a line with some associated code, that is, a line where you can put a break point. Non-valid lines include empty lines and comments.) + + +<p> +If this option is given together with option '<code>f</code>', +its table is pushed after the function. </li> </ul> @@ -5293,7 +5551,7 @@ This function returns 0 on error <hr><h3><a name="lua_getlocal"><code>lua_getlocal</code></a></h3><p> <span class="apii">[-0, +(0|1), –]</span> -<pre>const char *lua_getlocal (lua_State *L, lua_Debug *ar, int n);</pre> +<pre>const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);</pre> <p> Gets information about a local variable of @@ -5316,7 +5574,7 @@ and returns its name. <p> -In the second case, <code>ar</code> should be <code>NULL</code> and the function +In the second case, <code>ar</code> must be <code>NULL</code> and the function to be inspected must be at the top of the stack. In this case, only parameters of Lua functions are visible (as there is no information about what variables are active) @@ -5433,7 +5691,7 @@ calling <a href="#lua_yield"><code>lua_yield</code></a> with <code>nresults</cod <hr><h3><a name="lua_sethook"><code>lua_sethook</code></a></h3><p> <span class="apii">[-0, +0, –]</span> -<pre>int lua_sethook (lua_State *L, lua_Hook f, int mask, int count);</pre> +<pre>void lua_sethook (lua_State *L, lua_Hook f, int mask, int count);</pre> <p> Sets the debugging hook function. @@ -5486,7 +5744,7 @@ A hook is disabled by setting <code>mask</code> to zero. <hr><h3><a name="lua_setlocal"><code>lua_setlocal</code></a></h3><p> <span class="apii">[-(0|1), +0, –]</span> -<pre>const char *lua_setlocal (lua_State *L, lua_Debug *ar, int n);</pre> +<pre>const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);</pre> <p> Sets the value of a local variable of a given activation record. @@ -5532,7 +5790,7 @@ when the index is greater than the number of upvalues. <pre>void *lua_upvalueid (lua_State *L, int funcindex, int n);</pre> <p> -Returns an unique identifier for the upvalue numbered <code>n</code> +Returns a unique identifier for the upvalue numbered <code>n</code> from the closure at index <code>funcindex</code>. Parameters <code>funcindex</code> and <code>n</code> are as in the <a href="#lua_getupvalue"><code>lua_getupvalue</code></a> (see <a href="#lua_getupvalue"><code>lua_getupvalue</code></a>) @@ -5609,7 +5867,7 @@ you should not use these functions for other stack values. <p> Functions called <code>luaL_check*</code> -always throw an error if the check is not satisfied. +always raise an error if the check is not satisfied. @@ -5668,7 +5926,6 @@ buffer area (see <a href="#luaL_prepbuffer"><code>luaL_prepbuffer</code></a>). Adds the zero-terminated string pointed to by <code>s</code> to the buffer <code>B</code> (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>). -The string cannot contain embedded zeros. @@ -5703,7 +5960,7 @@ which is the value to be added to the buffer. <p> Checks whether <code>cond</code> is true. -If not, raises an error with a standard message. +If it is not, raises an error with a standard message (see <a href="#luaL_argerror"><code>luaL_argerror</code></a>). @@ -5714,14 +5971,15 @@ If not, raises an error with a standard message. <pre>int luaL_argerror (lua_State *L, int arg, const char *extramsg);</pre> <p> -Raises an error with a standard message -that includes <code>extramsg</code> as a comment. - +Raises an error reporting a problem with argument <code>arg</code> +of the C function that called it, +using a standard message +that includes <code>extramsg</code> as a comment: -<p> -This function never returns, -but it is an idiom to use it in C functions -as <code>return luaL_argerror(<em>args</em>)</code>. +<pre> + bad argument #<em>arg</em> to '<em>funcname</em>' (<em>extramsg</em>) +</pre><p> +This function never returns. @@ -5856,37 +6114,14 @@ of any type (including <b>nil</b>) at position <code>arg</code>. -<hr><h3><a name="luaL_checkint"><code>luaL_checkint</code></a></h3><p> -<span class="apii">[-0, +0, <em>v</em>]</span> -<pre>int luaL_checkint (lua_State *L, int arg);</pre> - -<p> -Checks whether the function argument <code>arg</code> is a number -and returns this number cast to an <code>int</code>. - - - - - <hr><h3><a name="luaL_checkinteger"><code>luaL_checkinteger</code></a></h3><p> <span class="apii">[-0, +0, <em>v</em>]</span> <pre>lua_Integer luaL_checkinteger (lua_State *L, int arg);</pre> <p> -Checks whether the function argument <code>arg</code> is a number -and returns this number cast to a <a href="#lua_Integer"><code>lua_Integer</code></a>. - - - - - -<hr><h3><a name="luaL_checklong"><code>luaL_checklong</code></a></h3><p> -<span class="apii">[-0, +0, <em>v</em>]</span> -<pre>long luaL_checklong (lua_State *L, int arg);</pre> - -<p> -Checks whether the function argument <code>arg</code> is a number -and returns this number cast to a <code>long</code>. +Checks whether the function argument <code>arg</code> is an integer +(or can be converted to an integer) +and returns this integer cast to a <a href="#lua_Integer"><code>lua_Integer</code></a>. @@ -6010,18 +6245,6 @@ returns the userdata address (see <a href="#lua_touserdata"><code>lua_touserdata -<hr><h3><a name="luaL_checkunsigned"><code>luaL_checkunsigned</code></a></h3><p> -<span class="apii">[-0, +0, <em>v</em>]</span> -<pre>lua_Unsigned luaL_checkunsigned (lua_State *L, int arg);</pre> - -<p> -Checks whether the function argument <code>arg</code> is a number -and returns this number cast to a <a href="#lua_Unsigned"><code>lua_Unsigned</code></a>. - - - - - <hr><h3><a name="luaL_checkversion"><code>luaL_checkversion</code></a></h3><p> <span class="apii">[-0, +0, –]</span> <pre>void luaL_checkversion (lua_State *L);</pre> @@ -6129,10 +6352,10 @@ file-related functions in the standard library <p> Pushes onto the stack the field <code>e</code> from the metatable -of the object at index <code>obj</code>. +of the object at index <code>obj</code> and returns the type of pushed value. If the object does not have a metatable, or if the metatable does not have this field, -returns false and pushes nothing. +pushes nothing and returns <code>LUA_TNIL</code>. @@ -6140,11 +6363,13 @@ returns false and pushes nothing. <hr><h3><a name="luaL_getmetatable"><code>luaL_getmetatable</code></a></h3><p> <span class="apii">[-0, +1, –]</span> -<pre>void luaL_getmetatable (lua_State *L, const char *tname);</pre> +<pre>int luaL_getmetatable (lua_State *L, const char *tname);</pre> <p> Pushes onto the stack the metatable associated with name <code>tname</code> in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>). +If there is no metatable associated with <code>tname</code>, +returns false and pushes <b>nil</b>. @@ -6185,13 +6410,13 @@ Pushes the resulting string on the stack and returns it. <hr><h3><a name="luaL_len"><code>luaL_len</code></a></h3><p> <span class="apii">[-0, +0, <em>e</em>]</span> -<pre>int luaL_len (lua_State *L, int index);</pre> +<pre>lua_Integer luaL_len (lua_State *L, int index);</pre> <p> Returns the "length" of the value at the given index as a number; -it is equivalent to the '<code>#</code>' operator in Lua (see <a href="#3.4.6">§3.4.6</a>). -Raises an error if the result of the operation is not a number. +it is equivalent to the '<code>#</code>' operator in Lua (see <a href="#3.4.7">§3.4.7</a>). +Raises an error if the result of the operation is not an integer. (This case only can happen through metamethods.) @@ -6303,16 +6528,22 @@ it does not run it. <hr><h3><a name="luaL_newlib"><code>luaL_newlib</code></a></h3><p> <span class="apii">[-0, +1, <em>e</em>]</span> -<pre>void luaL_newlib (lua_State *L, const luaL_Reg *l);</pre> +<pre>void luaL_newlib (lua_State *L, const luaL_Reg l[]);</pre> <p> Creates a new table and registers there the functions in list <code>l</code>. + + +<p> It is implemented as the following macro: <pre> (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) -</pre> +</pre><p> +The array <code>l</code> must be the actual array, +not a pointer to it. + @@ -6347,8 +6578,10 @@ If the registry already has the key <code>tname</code>, returns 0. Otherwise, creates a new table to be used as a metatable for userdata, -adds it to the registry with key <code>tname</code>, +adds to this new table the pair <code>__name = tname</code>, +adds to the registry the pair <code>[tname] = new table</code>, and returns 1. +(The entry <code>__name</code> is used by some error-reporting functions.) <p> @@ -6391,21 +6624,6 @@ Opens all standard Lua libraries into the given state. -<hr><h3><a name="luaL_optint"><code>luaL_optint</code></a></h3><p> -<span class="apii">[-0, +0, <em>v</em>]</span> -<pre>int luaL_optint (lua_State *L, int arg, int d);</pre> - -<p> -If the function argument <code>arg</code> is a number, -returns this number cast to an <code>int</code>. -If this argument is absent or is <b>nil</b>, -returns <code>d</code>. -Otherwise, raises an error. - - - - - <hr><h3><a name="luaL_optinteger"><code>luaL_optinteger</code></a></h3><p> <span class="apii">[-0, +0, <em>v</em>]</span> <pre>lua_Integer luaL_optinteger (lua_State *L, @@ -6413,23 +6631,9 @@ Otherwise, raises an error. lua_Integer d);</pre> <p> -If the function argument <code>arg</code> is a number, -returns this number cast to a <a href="#lua_Integer"><code>lua_Integer</code></a>. -If this argument is absent or is <b>nil</b>, -returns <code>d</code>. -Otherwise, raises an error. - - - - - -<hr><h3><a name="luaL_optlong"><code>luaL_optlong</code></a></h3><p> -<span class="apii">[-0, +0, <em>v</em>]</span> -<pre>long luaL_optlong (lua_State *L, int arg, long d);</pre> - -<p> -If the function argument <code>arg</code> is a number, -returns this number cast to a <code>long</code>. +If the function argument <code>arg</code> is an integer +(or convertible to an integer), +returns this integer. If this argument is absent or is <b>nil</b>, returns <code>d</code>. Otherwise, raises an error. @@ -6493,23 +6697,6 @@ Otherwise, raises an error. -<hr><h3><a name="luaL_optunsigned"><code>luaL_optunsigned</code></a></h3><p> -<span class="apii">[-0, +0, <em>v</em>]</span> -<pre>lua_Unsigned luaL_optunsigned (lua_State *L, - int arg, - lua_Unsigned u);</pre> - -<p> -If the function argument <code>arg</code> is a number, -returns this number cast to a <a href="#lua_Unsigned"><code>lua_Unsigned</code></a>. -If this argument is absent or is <b>nil</b>, -returns <code>u</code>. -Otherwise, raises an error. - - - - - <hr><h3><a name="luaL_prepbuffer"><code>luaL_prepbuffer</code></a></h3><p> <span class="apii">[-?, +?, <em>e</em>]</span> <pre>char *luaL_prepbuffer (luaL_Buffer *B);</pre> @@ -6601,7 +6788,7 @@ Type for arrays of functions to be registered by <a href="#luaL_setfuncs"><code>luaL_setfuncs</code></a>. <code>name</code> is the function name and <code>func</code> is a pointer to the function. -Any array of <a href="#luaL_Reg"><code>luaL_Reg</code></a> must end with an sentinel entry +Any array of <a href="#luaL_Reg"><code>luaL_Reg</code></a> must end with a sentinel entry in which both <code>name</code> and <code>func</code> are <code>NULL</code>. @@ -6614,18 +6801,19 @@ in which both <code>name</code> and <code>func</code> are <code>NULL</code>. lua_CFunction openf, int glb);</pre> <p> -Calls function <code>openf</code> with string <code>modname</code> as an argument +If <code>modname</code> is not already present in <a href="#pdf-package.loaded"><code>package.loaded</code></a>, +calls function <code>openf</code> with string <code>modname</code> as an argument and sets the call result in <code>package.loaded[modname]</code>, as if that function has been called through <a href="#pdf-require"><code>require</code></a>. <p> If <code>glb</code> is true, -also stores the result into global <code>modname</code>. +also stores the module into global <code>modname</code>. <p> -Leaves a copy of that result on the stack. +Leaves a copy of the module on the stack. @@ -6665,6 +6853,44 @@ in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code> +<hr><h3><a name="luaL_Stream"><code>luaL_Stream</code></a></h3> +<pre>typedef struct luaL_Stream { + FILE *f; + lua_CFunction closef; +} luaL_Stream;</pre> + +<p> +The standard representation for file handles, +which is used by the standard I/O library. + + +<p> +A file handle is implemented as a full userdata, +with a metatable called <code>LUA_FILEHANDLE</code> +(where <code>LUA_FILEHANDLE</code> is a macro with the actual metatable's name). +The metatable is created by the I/O library +(see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>). + + +<p> +This userdata must start with the structure <code>luaL_Stream</code>; +it can contain other data after this initial structure. +Field <code>f</code> points to the corresponding C stream +(or it can be <code>NULL</code> to indicate an incompletely created handle). +Field <code>closef</code> points to a Lua function +that will be called to close the stream +when the handle is closed or collected; +this function receives the file handle as its sole argument and +must return either <b>true</b> (in case of success) +or <b>nil</b> plus an error message (in case of error). +Once Lua calls this field, +the field value is changed to <code>NULL</code> +to signal that the handle is closed. + + + + + <hr><h3><a name="luaL_testudata"><code>luaL_testudata</code></a></h3><p> <span class="apii">[-0, +0, <em>e</em>]</span> <pre>void *luaL_testudata (lua_State *L, int arg, const char *tname);</pre> @@ -6672,7 +6898,7 @@ in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code> <p> This function works like <a href="#luaL_checkudata"><code>luaL_checkudata</code></a>, except that, when the test fails, -it returns <code>NULL</code> instead of throwing an error. +it returns <code>NULL</code> instead of raising an error. @@ -6802,11 +7028,11 @@ Currently, Lua has the following standard libraries: <li>string manipulation (<a href="#6.4">§6.4</a>);</li> -<li>table manipulation (<a href="#6.5">§6.5</a>);</li> +<li>basic UTF-8 support (<a href="#6.5">§6.5</a>);</li> -<li>mathematical functions (<a href="#6.6">§6.6</a>) (sin, log, etc.);</li> +<li>table manipulation (<a href="#6.6">§6.6</a>);</li> -<li>bitwise operations (<a href="#6.7">§6.7</a>);</li> +<li>mathematical functions (<a href="#6.7">§6.7</a>) (sin, log, etc.);</li> <li>input and output (<a href="#6.8">§6.8</a>);</li> @@ -6831,11 +7057,11 @@ the host program can open them individually by using <a name="pdf-luaopen_package"><code>luaopen_package</code></a> (for the package library), <a name="pdf-luaopen_coroutine"><code>luaopen_coroutine</code></a> (for the coroutine library), <a name="pdf-luaopen_string"><code>luaopen_string</code></a> (for the string library), +<a name="pdf-luaopen_utf8"><code>luaopen_utf8</code></a> (for the UTF8 library), <a name="pdf-luaopen_table"><code>luaopen_table</code></a> (for the table library), <a name="pdf-luaopen_math"><code>luaopen_math</code></a> (for the mathematical library), -<a name="pdf-luaopen_bit32"><code>luaopen_bit32</code></a> (for the bit library), <a name="pdf-luaopen_io"><code>luaopen_io</code></a> (for the I/O library), -<a name="pdf-luaopen_os"><code>luaopen_os</code></a> (for the Operating System library), +<a name="pdf-luaopen_os"><code>luaopen_os</code></a> (for the operating system library), and <a name="pdf-luaopen_debug"><code>luaopen_debug</code></a> (for the debug library). These functions are declared in <a name="pdf-lualib.h"><code>lualib.h</code></a>. @@ -6852,11 +7078,15 @@ implementations for some of its facilities. <p> <hr><h3><a name="pdf-assert"><code>assert (v [, message])</code></a></h3> -Issues an error when + + +<p> +Calls <a href="#pdf-error"><code>error</code></a> if the value of its argument <code>v</code> is false (i.e., <b>nil</b> or <b>false</b>); otherwise, returns all its arguments. -<code>message</code> is an error message; -when absent, it defaults to "assertion failed!" +In case of error, +<code>message</code> is the error object; +when absent, it defaults to "<code>assertion failed!</code>" @@ -6887,25 +7117,21 @@ restarts automatic execution of the garbage collector. </li> <li><b>"<code>count</code>": </b> -returns the total memory in use by Lua (in Kbytes) and -a second value with the total memory in bytes modulo 1024. -The first value has a fractional part, -so the following equality is always true: - -<pre> - k, b = collectgarbage("count") - assert(k*1024 == math.floor(k)*1024 + b) -</pre><p> -(The second result is useful when Lua is compiled -with a non floating-point type for numbers.) +returns the total memory in use by Lua in Kbytes. +The value has a fractional part, +so that it multiplied by 1024 +gives the exact number of bytes in use by Lua +(except for overflows). </li> <li><b>"<code>step</code>": </b> performs a garbage-collection step. -The step "size" is controlled by <code>arg</code> -(larger values mean more steps) in a non-specified way. -If you want to control the step size -you must experimentally tune the value of <code>arg</code>. +The step "size" is controlled by <code>arg</code>. +With a zero value, +the collector will perform one basic (indivisible) step. +For non-zero values, +the collector will perform as if that amount of memory +(in KBytes) had been allocated by Lua. Returns <b>true</b> if the step finished a collection cycle. </li> @@ -6926,16 +7152,6 @@ returns a boolean that tells whether the collector is running (i.e., not stopped). </li> -<li><b>"<code>generational</code>": </b> -changes the collector to generational mode. -This is an experimental feature (see <a href="#2.5">§2.5</a>). -</li> - -<li><b>"<code>incremental</code>": </b> -changes the collector to incremental mode. -This is the default mode. -</li> - </ul> @@ -6955,7 +7171,7 @@ to its caller (that is, <code>dofile</code> does not run in protected mode). <p> <hr><h3><a name="pdf-error"><code>error (message [, level])</code></a></h3> Terminates the last protected function called -and returns <code>message</code> as the error message. +and returns <code>message</code> as the error object. Function <code>error</code> never returns. @@ -6979,7 +7195,7 @@ A global variable (not a function) that holds the global environment (see <a href="#2.2">§2.2</a>). Lua itself does not use this variable; changing its value does not affect any environment, -nor vice-versa. +nor vice versa. @@ -7003,27 +7219,21 @@ Otherwise, returns the metatable of the given object. <p> -If <code>t</code> has a metamethod <code>__ipairs</code>, -calls it with <code>t</code> as argument and returns the first three -results from the call. - - -<p> -Otherwise, -returns three values: an iterator function, the table <code>t</code>, and 0, +Returns three values (an iterator function, the table <code>t</code>, and 0) so that the construction <pre> for i,v in ipairs(t) do <em>body</em> end </pre><p> -will iterate over the pairs (<code>1,t[1]</code>), (<code>2,t[2]</code>), ..., -up to the first integer key absent from the table. +will iterate over the key–value pairs +(<code>1,t[1]</code>), (<code>2,t[2]</code>), ..., +up to the first nil value. <p> -<hr><h3><a name="pdf-load"><code>load (ld [, source [, mode [, env]]])</code></a></h3> +<hr><h3><a name="pdf-load"><code>load (chunk [, chunkname [, mode [, env]]])</code></a></h3> <p> @@ -7031,10 +7241,10 @@ Loads a chunk. <p> -If <code>ld</code> is a string, the chunk is this string. -If <code>ld</code> is a function, +If <code>chunk</code> is a string, the chunk is this string. +If <code>chunk</code> is a function, <code>load</code> calls it repeatedly to get the chunk pieces. -Each call to <code>ld</code> must return a string that concatenates +Each call to <code>chunk</code> must return a string that concatenates with previous results. A return of an empty string, <b>nil</b>, or no value signals the end of the chunk. @@ -7050,18 +7260,22 @@ If the resulting function has upvalues, the first upvalue is set to the value of <code>env</code>, if that parameter is given, or to the value of the global environment. +Other upvalues are initialized with <b>nil</b>. (When you load a main chunk, the resulting function will always have exactly one upvalue, the <code>_ENV</code> variable (see <a href="#2.2">§2.2</a>). -When you load a binary chunk created from a function (see <a href="#pdf-string.dump"><code>string.dump</code></a>), -the resulting function can have arbitrary upvalues.) +However, +when you load a binary chunk created from a function (see <a href="#pdf-string.dump"><code>string.dump</code></a>), +the resulting function can have an arbitrary number of upvalues.) +All upvalues are fresh, that is, +they are not shared with any other function. <p> -<code>source</code> is used as the source of the chunk for error messages +<code>chunkname</code> is used as the name of the chunk for error messages and debug information (see <a href="#4.9">§4.9</a>). When absent, -it defaults to <code>ld</code>, if <code>ld</code> is a string, +it defaults to <code>chunk</code>, if <code>chunk</code> is a string, or to "<code>=(load)</code>" otherwise. @@ -7074,6 +7288,12 @@ or "<code>bt</code>" (both binary and text). The default is "<code>bt</code>". +<p> +Lua does not check the consistency of binary chunks. +Maliciously crafted binary chunks can crash +the interpreter. + + <p> @@ -7212,7 +7432,7 @@ without invoking any metamethod. Returns the length of the object <code>v</code>, which must be a table or a string, without invoking any metamethod. -Returns an integer number. +Returns an integer. @@ -7273,14 +7493,20 @@ This function returns <code>table</code>. When called with no <code>base</code>, <code>tonumber</code> tries to convert its argument to a number. If the argument is already a number or -a string convertible to a number (see <a href="#3.4.2">§3.4.2</a>), +a string convertible to a number, then <code>tonumber</code> returns this number; otherwise, it returns <b>nil</b>. <p> +The conversion of strings can result in integers or floats, +according to the lexical conventions of Lua (see <a href="#3.1">§3.1</a>). +(The string may have leading and trailing spaces and a sign.) + + +<p> When called with <code>base</code>, -then <code>e</code> should be a string to be interpreted as +then <code>e</code> must be a string to be interpreted as an integer numeral in that base. The base may be any integer between 2 and 36, inclusive. In bases above 10, the letter '<code>A</code>' (in either upper or lower case) @@ -7295,7 +7521,9 @@ the function returns <b>nil</b>. <p> <hr><h3><a name="pdf-tostring"><code>tostring (v)</code></a></h3> Receives a value of any type and -converts it to a string in a reasonable format. +converts it to a string in a human-readable format. +Floats always produce strings with some +floating-point indication (either a decimal dot or an exponent). (For complete control of how numbers are converted, use <a href="#pdf-string.format"><code>string.format</code></a>.) @@ -7329,7 +7557,7 @@ and "<code>userdata</code>". <hr><h3><a name="pdf-_VERSION"><code>_VERSION</code></a></h3> A global variable (not a function) that holds a string containing the current interpreter version. -The current contents of this variable is "<code>Lua 5.2</code>". +The current value of this variable is "<code>Lua 5.3</code>". @@ -7370,6 +7598,21 @@ an object with type <code>"thread"</code>. <p> +<hr><h3><a name="pdf-coroutine.isyieldable"><code>coroutine.isyieldable ()</code></a></h3> + + +<p> +Returns true when the running coroutine can yield. + + +<p> +A running coroutine is yieldable if it is not the main thread and +it is not inside a non-yieldable C function. + + + + +<p> <hr><h3><a name="pdf-coroutine.resume"><code>coroutine.resume (co [, val1, ···])</code></a></h3> @@ -7388,8 +7631,8 @@ as the results from the yield. <p> If the coroutine runs without any errors, <code>resume</code> returns <b>true</b> plus any values passed to <code>yield</code> -(if the coroutine yields) or any values returned by the body function -(if the coroutine terminates). +(when the coroutine yields) or any values returned by the body function +(when the coroutine terminates). If there is any error, <code>resume</code> returns <b>false</b> plus the error message. @@ -7491,7 +7734,7 @@ for <a href="#pdf-package.searchers"><code>package.searchers</code></a>. <p> First <code>require</code> queries <code>package.preload[modname]</code>. If it has a value, -this value (which should be a function) is the loader. +this value (which must be a function) is the loader. Otherwise <code>require</code> searches for a Lua loader using the path stored in <a href="#pdf-package.path"><code>package.path</code></a>. If that also fails, it searches for a C loader using the @@ -7547,7 +7790,7 @@ Default is '<code>?</code>'.</li> is replaced by the executable's directory. Default is '<code>!</code>'.</li> -<li>The fifth line is a mark to ignore all text before it +<li>The fifth line is a mark to ignore all text after it when building the <code>luaopen_</code> function name. Default is '<code>-</code>'.</li> @@ -7566,7 +7809,7 @@ The path used by <a href="#pdf-require"><code>require</code></a> to search for a <p> Lua initializes the C path <a href="#pdf-package.cpath"><code>package.cpath</code></a> in the same way it initializes the Lua path <a href="#pdf-package.path"><code>package.path</code></a>, -using the environment variable <a name="pdf-LUA_CPATH_5_2"><code>LUA_CPATH_5_2</code></a> +using the environment variable <a name="pdf-LUA_CPATH_5_3"><code>LUA_CPATH_5_3</code></a> or the environment variable <a name="pdf-LUA_CPATH"><code>LUA_CPATH</code></a> or a default path defined in <code>luaconf.h</code>. @@ -7644,7 +7887,7 @@ The path used by <a href="#pdf-require"><code>require</code></a> to search for a <p> At start-up, Lua initializes this variable with -the value of the environment variable <a name="pdf-LUA_PATH_5_2"><code>LUA_PATH_5_2</code></a> or +the value of the environment variable <a name="pdf-LUA_PATH_5_3"><code>LUA_PATH_5_3</code></a> or the environment variable <a name="pdf-LUA_PATH"><code>LUA_PATH</code></a> or with a default path defined in <code>luaconf.h</code>, if those environment variables are not defined. @@ -7729,9 +7972,9 @@ The name of this C function is the string "<code>luaopen_</code>" concatenated with a copy of the module name where each dot is replaced by an underscore. Moreover, if the module name has a hyphen, -its prefix up to (and including) the first hyphen is removed. -For instance, if the module name is <code>a.v1-b.c</code>, -the function name will be <code>luaopen_b_c</code>. +its suffix after (and including) the first hyphen is removed. +For instance, if the module name is <code>a.b.c-v2.1</code>, +the function name will be <code>luaopen_a_b_c</code>. <p> @@ -7859,13 +8102,28 @@ Numerical codes are not necessarily portable across platforms. <p> -<hr><h3><a name="pdf-string.dump"><code>string.dump (function)</code></a></h3> +<hr><h3><a name="pdf-string.dump"><code>string.dump (function [, strip])</code></a></h3> <p> -Returns a string containing a binary representation of the given function, +Returns a string containing a binary representation +(a <em>binary chunk</em>) +of the given function, so that a later <a href="#pdf-load"><code>load</code></a> on this string returns a copy of the function (but with new upvalues). +If <code>strip</code> is a true value, +the binary representation is created without debug information +about the function +(local variable names, lines, etc.). + + +<p> +Functions with upvalues have only their number of upvalues saved. +When (re)loaded, +those upvalues receive fresh instances containing <b>nil</b>. +(You can use the debug library to serialize +and reload the upvalues of a function +in a way adequate to your needs.) @@ -7876,7 +8134,7 @@ a copy of the function (but with new upvalues). <p> Looks for the first match of -<code>pattern</code> in the string <code>s</code>. +<code>pattern</code> (see <a href="#6.4.1">§6.4.1</a>) in the string <code>s</code>. If it finds a match, then <code>find</code> returns the indices of <code>s</code> where this occurrence starts and ends; otherwise, it returns <b>nil</b>. @@ -7906,7 +8164,7 @@ after the two indices. <p> Returns a formatted version of its variable number of arguments following the description given in its first argument (which must be a string). -The format string follows the same rules as the ANSI C function <code>sprintf</code>. +The format string follows the same rules as the ISO C function <code>sprintf</code>. The only differences are that the options/modifiers <code>*</code>, <code>h</code>, <code>L</code>, <code>l</code>, <code>n</code>, and <code>p</code> are not supported @@ -7933,11 +8191,7 @@ Options <code>G</code>, and <code>g</code> all expect a number as argument. Options <code>c</code>, <code>d</code>, <code>i</code>, <code>o</code>, <code>u</code>, <code>X</code>, and <code>x</code> -also expect a number, -but the range of that number may be limited by -the underlying C implementation. -For options <code>o</code>, <code>u</code>, <code>X</code>, and <code>x</code>, -the number cannot be negative. +expect an integer. Option <code>q</code> expects a string; option <code>s</code> expects a string without embedded zeros. If the argument to option <code>s</code> is not a string, @@ -7950,7 +8204,8 @@ it is converted to one following the same rules of <a href="#pdf-tostring"><code <hr><h3><a name="pdf-string.gmatch"><code>string.gmatch (s, pattern)</code></a></h3> Returns an iterator function that, each time it is called, -returns the next captures from <code>pattern</code> over the string <code>s</code>. +returns the next captures from <code>pattern</code> (see <a href="#6.4.1">§6.4.1</a>) +over the string <code>s</code>. If <code>pattern</code> specifies no captures, then the whole match is produced in each call. @@ -7988,7 +8243,7 @@ work as an anchor, as this would prevent the iteration. <hr><h3><a name="pdf-string.gsub"><code>string.gsub (s, pattern, repl [, n])</code></a></h3> Returns a copy of <code>s</code> in which all (or the first <code>n</code>, if given) -occurrences of the <code>pattern</code> have been +occurrences of the <code>pattern</code> (see <a href="#6.4.1">§6.4.1</a>) have been replaced by a replacement string specified by <code>repl</code>, which can be a string, a table, or a function. <code>gsub</code> also returns, as its second value, @@ -8053,9 +8308,9 @@ Here are some examples: end) --> x="4+5 = 9" - local t = {name="lua", version="5.2"} + local t = {name="lua", version="5.3"} x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t) - --> x="lua-5.2.tar.gz" + --> x="lua-5.3.tar.gz" </pre> @@ -8083,7 +8338,7 @@ The definition of what an uppercase letter is depends on the current locale. <p> <hr><h3><a name="pdf-string.match"><code>string.match (s, pattern [, init])</code></a></h3> Looks for the first <em>match</em> of -<code>pattern</code> in the string <code>s</code>. +<code>pattern</code> (see <a href="#6.4.1">§6.4.1</a>) in the string <code>s</code>. If it finds one, then <code>match</code> returns the captures from the pattern; otherwise it returns <b>nil</b>. @@ -8097,11 +8352,37 @@ its default value is 1 and can be negative. <p> +<hr><h3><a name="pdf-string.pack"><code>string.pack (fmt, v1, v2, ···)</code></a></h3> + + +<p> +Returns a binary string containing the values <code>v1</code>, <code>v2</code>, etc. +packed (that is, serialized in binary form) +according to the format string <code>fmt</code> (see <a href="#6.4.2">§6.4.2</a>). + + + + +<p> +<hr><h3><a name="pdf-string.packsize"><code>string.packsize (fmt)</code></a></h3> + + +<p> +Returns the size of a string resulting from <a href="#pdf-string.pack"><code>string.pack</code></a> +with the given format. +The format string cannot have the variable-length options +'<code>s</code>' or '<code>z</code>' (see <a href="#6.4.2">§6.4.2</a>). + + + + +<p> <hr><h3><a name="pdf-string.rep"><code>string.rep (s, n [, sep])</code></a></h3> Returns a string that is the concatenation of <code>n</code> copies of the string <code>s</code> separated by the string <code>sep</code>. The default value for <code>sep</code> is the empty string (that is, no separator). +Returns the empty string if <code>n</code> is not positive. @@ -8141,6 +8422,21 @@ the function returns the empty string. <p> +<hr><h3><a name="pdf-string.unpack"><code>string.unpack (fmt, s [, pos])</code></a></h3> + + +<p> +Returns the values packed in string <code>s</code> (see <a href="#pdf-string.pack"><code>string.pack</code></a>) +according to the format string <code>fmt</code> (see <a href="#6.4.2">§6.4.2</a>). +An optional <code>pos</code> marks where +to start reading in <code>s</code> (default is 1). +After the read values, +this function also returns the index of the first unread byte in <code>s</code>. + + + + +<p> <hr><h3><a name="pdf-string.upper"><code>string.upper (s)</code></a></h3> Receives a string and returns a copy of this string with all lowercase letters changed to uppercase. @@ -8149,8 +8445,21 @@ The definition of what a lowercase letter is depends on the current locale. + + <h3>6.4.1 – <a name="6.4.1">Patterns</a></h3> +<p> +Patterns in Lua are described by regular strings, +which are interpreted as patterns by the pattern-matching functions +<a href="#pdf-string.find"><code>string.find</code></a>, +<a href="#pdf-string.gmatch"><code>string.gmatch</code></a>, +<a href="#pdf-string.gsub"><code>string.gsub</code></a>, +and <a href="#pdf-string.match"><code>string.match</code></a>. +This section describes the syntax and the meaning +(that is, what they match) of these strings. + + <h4>Character Class:</h4><p> A <em>character class</em> is used to represent a set of characters. @@ -8189,7 +8498,8 @@ represents the character <em>x</em> itself. <li><b><code>%<em>x</em></code>: </b> (where <em>x</em> is any non-alphanumeric character) represents the character <em>x</em>. This is the standard way to escape the magic characters. -Any punctuation character (even the non magic) +Any non-alphanumeric character +(including all punctuations, even the non-magical) can be preceded by a '<code>%</code>' when used to represent itself in a pattern. </li> @@ -8199,7 +8509,7 @@ represents the class which is the union of all characters in <em>set</em>. A range of characters can be specified by separating the end characters of the range, -in ascending order, with a '<code>-</code>', +in ascending order, with a '<code>-</code>'. All classes <code>%</code><em>x</em> described above can also be used as components in <em>set</em>. All other characters in <em>set</em> represent themselves. @@ -8248,26 +8558,27 @@ which matches any single character in the class; <li> a single character class followed by '<code>*</code>', -which matches 0 or more repetitions of characters in the class. +which matches zero or more repetitions of characters in the class. These repetition items will always match the longest possible sequence; </li> <li> a single character class followed by '<code>+</code>', -which matches 1 or more repetitions of characters in the class. +which matches one or more repetitions of characters in the class. These repetition items will always match the longest possible sequence; </li> <li> a single character class followed by '<code>-</code>', -which also matches 0 or more repetitions of characters in the class. +which also matches zero or more repetitions of characters in the class. Unlike '<code>*</code>', these repetition items will always match the shortest possible sequence; </li> <li> a single character class followed by '<code>?</code>', -which matches 0 or 1 occurrence of a character in the class; +which matches zero or one occurrence of a character in the class. +It always matches one occurrence if possible; </li> <li> @@ -8340,11 +8651,204 @@ string <code>"flaaap"</code>, there will be two captures: 3 and 5. +<h3>6.4.2 – <a name="6.4.2">Format Strings for Pack and Unpack</a></h3> + +<p> +The first argument to <a href="#pdf-string.pack"><code>string.pack</code></a>, +<a href="#pdf-string.packsize"><code>string.packsize</code></a>, and <a href="#pdf-string.unpack"><code>string.unpack</code></a> +is a format string, +which describes the layout of the structure being created or read. + + +<p> +A format string is a sequence of conversion options. +The conversion options are as follows: + +<ul> +<li><b><code><</code>: </b>sets little endian</li> +<li><b><code>></code>: </b>sets big endian</li> +<li><b><code>=</code>: </b>sets native endian</li> +<li><b><code>![<em>n</em>]</code>: </b>sets maximum alignment to <code>n</code> +(default is native alignment)</li> +<li><b><code>b</code>: </b>a signed byte (<code>char</code>)</li> +<li><b><code>B</code>: </b>an unsigned byte (<code>char</code>)</li> +<li><b><code>h</code>: </b>a signed <code>short</code> (native size)</li> +<li><b><code>H</code>: </b>an unsigned <code>short</code> (native size)</li> +<li><b><code>l</code>: </b>a signed <code>long</code> (native size)</li> +<li><b><code>L</code>: </b>an unsigned <code>long</code> (native size)</li> +<li><b><code>j</code>: </b>a <code>lua_Integer</code></li> +<li><b><code>J</code>: </b>a <code>lua_Unsigned</code></li> +<li><b><code>T</code>: </b>a <code>size_t</code> (native size)</li> +<li><b><code>i[<em>n</em>]</code>: </b>a signed <code>int</code> with <code>n</code> bytes +(default is native size)</li> +<li><b><code>I[<em>n</em>]</code>: </b>an unsigned <code>int</code> with <code>n</code> bytes +(default is native size)</li> +<li><b><code>f</code>: </b>a <code>float</code> (native size)</li> +<li><b><code>d</code>: </b>a <code>double</code> (native size)</li> +<li><b><code>n</code>: </b>a <code>lua_Number</code></li> +<li><b><code>c<em>n</em></code>: </b>a fixed-sized string with <code>n</code> bytes</li> +<li><b><code>z</code>: </b>a zero-terminated string</li> +<li><b><code>s[<em>n</em>]</code>: </b>a string preceded by its length +coded as an unsigned integer with <code>n</code> bytes +(default is a <code>size_t</code>)</li> +<li><b><code>x</code>: </b>one byte of padding</li> +<li><b><code>X<em>op</em></code>: </b>an empty item that aligns +according to option <code>op</code> +(which is otherwise ignored)</li> +<li><b>'<code> </code>': </b>(empty space) ignored</li> +</ul><p> +(A "<code>[<em>n</em>]</code>" means an optional integral numeral.) +Except for padding, spaces, and configurations +(options "<code>xX <=>!</code>"), +each option corresponds to an argument (in <a href="#pdf-string.pack"><code>string.pack</code></a>) +or a result (in <a href="#pdf-string.unpack"><code>string.unpack</code></a>). + + +<p> +For options "<code>!<em>n</em></code>", "<code>s<em>n</em></code>", "<code>i<em>n</em></code>", and "<code>I<em>n</em></code>", +<code>n</code> can be any integer between 1 and 16. +All integral options check overflows; +<a href="#pdf-string.pack"><code>string.pack</code></a> checks whether the given value fits in the given size; +<a href="#pdf-string.unpack"><code>string.unpack</code></a> checks whether the read value fits in a Lua integer. + + +<p> +Any format string starts as if prefixed by "<code>!1=</code>", +that is, +with maximum alignment of 1 (no alignment) +and native endianness. + +<p> +Alignment works as follows: +For each option, +the format gets extra padding until the data starts +at an offset that is a multiple of the minimum between the +option size and the maximum alignment; +this minimum must be a power of 2. +Options "<code>c</code>" and "<code>z</code>" are not aligned; +option "<code>s</code>" follows the alignment of its starting integer. +<p> +All padding is filled with zeros by <a href="#pdf-string.pack"><code>string.pack</code></a> +(and ignored by <a href="#pdf-string.unpack"><code>string.unpack</code></a>). -<h2>6.5 – <a name="6.5">Table Manipulation</a></h2> + + + + + + +<h2>6.5 – <a name="6.5">UTF-8 Support</a></h2> + +<p> +This library provides basic support for UTF-8 encoding. +It provides all its functions inside the table <a name="pdf-utf8"><code>utf8</code></a>. +This library does not provide any support for Unicode other +than the handling of the encoding. +Any operation that needs the meaning of a character, +such as character classification, is outside its scope. + + +<p> +Unless stated otherwise, +all functions that expect a byte position as a parameter +assume that the given position is either the start of a byte sequence +or one plus the length of the subject string. +As in the string library, +negative indices count from the end of the string. + + +<p> +<hr><h3><a name="pdf-utf8.char"><code>utf8.char (···)</code></a></h3> +Receives zero or more integers, +converts each one to its corresponding UTF-8 byte sequence +and returns a string with the concatenation of all these sequences. + + + + +<p> +<hr><h3><a name="pdf-utf8.charpattern"><code>utf8.charpattern</code></a></h3> +The pattern (a string, not a function) "<code>[\0-\x7F\xC2-\xF4][\x80-\xBF]*</code>" +(see <a href="#6.4.1">§6.4.1</a>), +which matches exactly one UTF-8 byte sequence, +assuming that the subject is a valid UTF-8 string. + + + + +<p> +<hr><h3><a name="pdf-utf8.codes"><code>utf8.codes (s)</code></a></h3> + + +<p> +Returns values so that the construction + +<pre> + for p, c in utf8.codes(s) do <em>body</em> end +</pre><p> +will iterate over all characters in string <code>s</code>, +with <code>p</code> being the position (in bytes) and <code>c</code> the code point +of each character. +It raises an error if it meets any invalid byte sequence. + + + + +<p> +<hr><h3><a name="pdf-utf8.codepoint"><code>utf8.codepoint (s [, i [, j]])</code></a></h3> +Returns the codepoints (as integers) from all characters in <code>s</code> +that start between byte position <code>i</code> and <code>j</code> (both included). +The default for <code>i</code> is 1 and for <code>j</code> is <code>i</code>. +It raises an error if it meets any invalid byte sequence. + + + + +<p> +<hr><h3><a name="pdf-utf8.len"><code>utf8.len (s [, i [, j]])</code></a></h3> +Returns the number of UTF-8 characters in string <code>s</code> +that start between positions <code>i</code> and <code>j</code> (both inclusive). +The default for <code>i</code> is 1 and for <code>j</code> is -1. +If it finds any invalid byte sequence, +returns a false value plus the position of the first invalid byte. + + + + +<p> +<hr><h3><a name="pdf-utf8.offset"><code>utf8.offset (s, n [, i])</code></a></h3> +Returns the position (in bytes) where the encoding of the +<code>n</code>-th character of <code>s</code> +(counting from position <code>i</code>) starts. +A negative <code>n</code> gets characters before position <code>i</code>. +The default for <code>i</code> is 1 when <code>n</code> is non-negative +and <code>#s + 1</code> otherwise, +so that <code>utf8.offset(s, -n)</code> gets the offset of the +<code>n</code>-th character from the end of the string. +If the specified character is neither in the subject +nor right after its end, +the function returns <b>nil</b>. + + +<p> +As a special case, +when <code>n</code> is 0 the function returns the start of the encoding +of the character that contains the <code>i</code>-th byte of <code>s</code>. + + +<p> +This function assumes that <code>s</code> is a valid UTF-8 string. + + + + + + + +<h2>6.6 – <a name="6.6">Table Manipulation</a></h2> <p> This library provides generic functions for table manipulation. @@ -8353,15 +8857,10 @@ It provides all its functions inside the table <a name="pdf-table"><code>table</ <p> Remember that, whenever an operation needs the length of a table, -the table should be a proper sequence -or have a <code>__len</code> metamethod (see <a href="#3.4.6">§3.4.6</a>). +the table must be a proper sequence +or have a <code>__len</code> metamethod (see <a href="#3.4.7">§3.4.7</a>). All functions ignore non-numeric keys -in tables given as arguments. - - -<p> -For performance reasons, -all table accesses (get/set) performed by these functions are raw. +in the tables given as arguments. <p> @@ -8395,6 +8894,22 @@ of list <code>t</code>. <p> +<hr><h3><a name="pdf-table.move"><code>table.move (a1, f, e, t [,a2])</code></a></h3> + + +<p> +Moves elements from table <code>a1</code> to table <code>a2</code>. +This function performs the equivalent to the following +multiple assignment: +<code>a2[t],··· = a1[f],···,a1[e]</code>. +The default for <code>a2</code> is <code>a1</code>. +The destination range can overlap with the source range. +Index <code>f</code> must be positive. + + + + +<p> <hr><h3><a name="pdf-table.pack"><code>table.pack (···)</code></a></h3> @@ -8424,8 +8939,8 @@ in those cases, the function erases the element <code>list[pos]</code>. <p> The default value for <code>pos</code> is <code>#list</code>, -so that a call <code>table.remove(t)</code> removes the last element -of list <code>t</code>. +so that a call <code>table.remove(l)</code> removes the last element +of list <code>l</code>. @@ -8459,7 +8974,7 @@ may have their relative positions changed by the sort. <p> -Returns the elements from the given table. +Returns the elements from the given list. This function is equivalent to <pre> @@ -8473,11 +8988,18 @@ By default, <code>i</code> is 1 and <code>j</code> is <code>#list</code>. -<h2>6.6 – <a name="6.6">Mathematical Functions</a></h2> +<h2>6.7 – <a name="6.7">Mathematical Functions</a></h2> <p> -This library is an interface to the standard C math library. -It provides all its functions inside the table <a name="pdf-math"><code>math</code></a>. +This library provides basic mathematical functions. +It provides all its functions and constants inside the table <a name="pdf-math"><code>math</code></a>. +Functions with the annotation "<code>integer/float</code>" give +integer results for integer arguments +and float results for float (or mixed) arguments. +Rounding functions +(<a href="#pdf-math.ceil"><code>math.ceil</code></a>, <a href="#pdf-math.floor"><code>math.floor</code></a>, and <a href="#pdf-math.modf"><code>math.modf</code></a>) +return an integer when the result fits in the range of an integer, +or a float otherwise. <p> @@ -8485,7 +9007,7 @@ It provides all its functions inside the table <a name="pdf-math"><code>math</co <p> -Returns the absolute value of <code>x</code>. +Returns the absolute value of <code>x</code>. (integer/float) @@ -8511,54 +9033,41 @@ Returns the arc sine of <code>x</code> (in radians). <p> -<hr><h3><a name="pdf-math.atan"><code>math.atan (x)</code></a></h3> +<hr><h3><a name="pdf-math.atan"><code>math.atan (y [, x])</code></a></h3> <p> -Returns the arc tangent of <code>x</code> (in radians). - - - -<p> -<hr><h3><a name="pdf-math.atan2"><code>math.atan2 (y, x)</code></a></h3> - - -<p> Returns the arc tangent of <code>y/x</code> (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of <code>x</code> being zero.) - - <p> -<hr><h3><a name="pdf-math.ceil"><code>math.ceil (x)</code></a></h3> - - -<p> -Returns the smallest integer larger than or equal to <code>x</code>. +The default value for <code>x</code> is 1, +so that the call <code>math.atan(y)</code> +returns the arc tangent of <code>y</code>. <p> -<hr><h3><a name="pdf-math.cos"><code>math.cos (x)</code></a></h3> +<hr><h3><a name="pdf-math.ceil"><code>math.ceil (x)</code></a></h3> <p> -Returns the cosine of <code>x</code> (assumed to be in radians). +Returns the smallest integral value larger than or equal to <code>x</code>. <p> -<hr><h3><a name="pdf-math.cosh"><code>math.cosh (x)</code></a></h3> +<hr><h3><a name="pdf-math.cos"><code>math.cos (x)</code></a></h3> <p> -Returns the hyperbolic cosine of <code>x</code>. +Returns the cosine of <code>x</code> (assumed to be in radians). @@ -8568,7 +9077,7 @@ Returns the hyperbolic cosine of <code>x</code>. <p> -Returns the angle <code>x</code> (given in radians) in degrees. +Converts the angle <code>x</code> from radians to degrees. @@ -8578,7 +9087,8 @@ Returns the angle <code>x</code> (given in radians) in degrees. <p> -Returns the value <em>e<sup>x</sup></em>. +Returns the value <em>e<sup>x</sup></em> +(where <code>e</code> is the base of natural logarithms). @@ -8588,7 +9098,7 @@ Returns the value <em>e<sup>x</sup></em>. <p> -Returns the largest integer smaller than or equal to <code>x</code>. +Returns the largest integral value smaller than or equal to <code>x</code>. @@ -8599,20 +9109,7 @@ Returns the largest integer smaller than or equal to <code>x</code>. <p> Returns the remainder of the division of <code>x</code> by <code>y</code> -that rounds the quotient towards zero. - - - - -<p> -<hr><h3><a name="pdf-math.frexp"><code>math.frexp (x)</code></a></h3> - - -<p> -Returns <code>m</code> and <code>e</code> such that <em>x = m2<sup>e</sup></em>, -<code>e</code> is an integer and the absolute value of <code>m</code> is -in the range <em>[0.5, 1)</em> -(or zero when <code>x</code> is zero). +that rounds the quotient towards zero. (integer/float) @@ -8622,18 +9119,8 @@ in the range <em>[0.5, 1)</em> <p> -The value <code>HUGE_VAL</code>, -a value larger than or equal to any other numerical value. - - - - -<p> -<hr><h3><a name="pdf-math.ldexp"><code>math.ldexp (m, e)</code></a></h3> - - -<p> -Returns <em>m2<sup>e</sup></em> (<code>e</code> should be an integer). +The float value <code>HUGE_VAL</code>, +a value larger than any other numerical value. @@ -8655,49 +9142,54 @@ The default for <code>base</code> is <em>e</em> <p> -Returns the maximum value among its arguments. +Returns the argument with the maximum value, +according to the Lua operator <code><</code>. (integer/float) <p> -<hr><h3><a name="pdf-math.min"><code>math.min (x, ···)</code></a></h3> +<hr><h3><a name="pdf-math.maxinteger"><code>math.maxinteger</code></a></h3> +An integer with the maximum value for an integer. -<p> -Returns the minimum value among its arguments. +<p> +<hr><h3><a name="pdf-math.min"><code>math.min (x, ···)</code></a></h3> <p> -<hr><h3><a name="pdf-math.modf"><code>math.modf (x)</code></a></h3> +Returns the argument with the minimum value, +according to the Lua operator <code><</code>. (integer/float) + + <p> -Returns two numbers, -the integral part of <code>x</code> and the fractional part of <code>x</code>. +<hr><h3><a name="pdf-math.mininteger"><code>math.mininteger</code></a></h3> +An integer with the minimum value for an integer. <p> -<hr><h3><a name="pdf-math.pi"><code>math.pi</code></a></h3> +<hr><h3><a name="pdf-math.modf"><code>math.modf (x)</code></a></h3> <p> -The value of <em>π</em>. +Returns the integral part of <code>x</code> and the fractional part of <code>x</code>. +Its second result is always a float. <p> -<hr><h3><a name="pdf-math.pow"><code>math.pow (x, y)</code></a></h3> +<hr><h3><a name="pdf-math.pi"><code>math.pi</code></a></h3> <p> -Returns <em>x<sup>y</sup></em>. -(You can also use the expression <code>x^y</code> to compute this value.) +The value of <em>π</em>. @@ -8707,7 +9199,7 @@ Returns <em>x<sup>y</sup></em>. <p> -Returns the angle <code>x</code> (given in degrees) in radians. +Converts the angle <code>x</code> from degrees to radians. @@ -8717,21 +9209,20 @@ Returns the angle <code>x</code> (given in degrees) in radians. <p> -This function is an interface to the simple -pseudo-random generator function <code>rand</code> provided by Standard C. -(No guarantees can be given for its statistical properties.) +When called without arguments, +returns a pseudo-random float with uniform distribution +in the range <em>[0,1)</em>. +When called with two integers <code>m</code> and <code>n</code>, +<code>math.random</code> returns a pseudo-random integer +with uniform distribution in the range <em>[m, n]</em>. +(The value <em>m-n</em> cannot be negative and must fit in a Lua integer.) +The call <code>math.random(n)</code> is equivalent to <code>math.random(1,n)</code>. <p> -When called without arguments, -returns a uniform pseudo-random real number -in the range <em>[0,1)</em>. -When called with an integer number <code>m</code>, -<code>math.random</code> returns -a uniform pseudo-random integer in the range <em>[1, m]</em>. -When called with two integer numbers <code>m</code> and <code>n</code>, -<code>math.random</code> returns a uniform pseudo-random -integer in the range <em>[m, n]</em>. +This function is an interface to the underling +pseudo-random generator function provided by C. +No guarantees can be given for its statistical properties. @@ -8759,16 +9250,6 @@ Returns the sine of <code>x</code> (assumed to be in radians). <p> -<hr><h3><a name="pdf-math.sinh"><code>math.sinh (x)</code></a></h3> - - -<p> -Returns the hyperbolic sine of <code>x</code>. - - - - -<p> <hr><h3><a name="pdf-math.sqrt"><code>math.sqrt (x)</code></a></h3> @@ -8790,238 +9271,37 @@ Returns the tangent of <code>x</code> (assumed to be in radians). <p> -<hr><h3><a name="pdf-math.tanh"><code>math.tanh (x)</code></a></h3> - - -<p> -Returns the hyperbolic tangent of <code>x</code>. - - - - - - - -<h2>6.7 – <a name="6.7">Bitwise Operations</a></h2> - -<p> -This library provides bitwise operations. -It provides all its functions inside the table <a name="pdf-bit32"><code>bit32</code></a>. - - -<p> -Unless otherwise stated, -all functions accept numeric arguments in the range -<em>(-2<sup>51</sup>,+2<sup>51</sup>)</em>; -each argument is normalized to -the remainder of its division by <em>2<sup>32</sup></em> -and truncated to an integer (in some unspecified way), -so that its final value falls in the range <em>[0,2<sup>32</sup> - 1]</em>. -Similarly, all results are in the range <em>[0,2<sup>32</sup> - 1]</em>. -Note that <code>bit32.bnot(0)</code> is <code>0xFFFFFFFF</code>, -which is different from <code>-1</code>. - - -<p> -<hr><h3><a name="pdf-bit32.arshift"><code>bit32.arshift (x, disp)</code></a></h3> - - -<p> -Returns the number <code>x</code> shifted <code>disp</code> bits to the right. -The number <code>disp</code> may be any representable integer. -Negative displacements shift to the left. - - -<p> -This shift operation is what is called arithmetic shift. -Vacant bits on the left are filled -with copies of the higher bit of <code>x</code>; -vacant bits on the right are filled with zeros. -In particular, -displacements with absolute values higher than 31 -result in zero or <code>0xFFFFFFFF</code> (all original bits are shifted out). - - - - -<p> -<hr><h3><a name="pdf-bit32.band"><code>bit32.band (···)</code></a></h3> - - -<p> -Returns the bitwise <em>and</em> of its operands. - - - - -<p> -<hr><h3><a name="pdf-bit32.bnot"><code>bit32.bnot (x)</code></a></h3> - - -<p> -Returns the bitwise negation of <code>x</code>. -For any integer <code>x</code>, -the following identity holds: - -<pre> - assert(bit32.bnot(x) == (-1 - x) % 2^32) -</pre> - - - -<p> -<hr><h3><a name="pdf-bit32.bor"><code>bit32.bor (···)</code></a></h3> +<hr><h3><a name="pdf-math.tointeger"><code>math.tointeger (x)</code></a></h3> <p> -Returns the bitwise <em>or</em> of its operands. +If the value <code>x</code> is convertible to an integer, +returns that integer. +Otherwise, returns <b>nil</b>. <p> -<hr><h3><a name="pdf-bit32.btest"><code>bit32.btest (···)</code></a></h3> +<hr><h3><a name="pdf-math.type"><code>math.type (x)</code></a></h3> <p> -Returns a boolean signaling -whether the bitwise <em>and</em> of its operands is different from zero. +Returns "<code>integer</code>" if <code>x</code> is an integer, +"<code>float</code>" if it is a float, +or <b>nil</b> if <code>x</code> is not a number. <p> -<hr><h3><a name="pdf-bit32.bxor"><code>bit32.bxor (···)</code></a></h3> +<hr><h3><a name="pdf-math.ult"><code>math.ult (m, n)</code></a></h3> <p> -Returns the bitwise <em>exclusive or</em> of its operands. - - - - -<p> -<hr><h3><a name="pdf-bit32.extract"><code>bit32.extract (n, field [, width])</code></a></h3> - - -<p> -Returns the unsigned number formed by the bits -<code>field</code> to <code>field + width - 1</code> from <code>n</code>. -Bits are numbered from 0 (least significant) to 31 (most significant). -All accessed bits must be in the range <em>[0, 31]</em>. - - -<p> -The default for <code>width</code> is 1. - - - - -<p> -<hr><h3><a name="pdf-bit32.replace"><code>bit32.replace (n, v, field [, width])</code></a></h3> - - -<p> -Returns a copy of <code>n</code> with -the bits <code>field</code> to <code>field + width - 1</code> -replaced by the value <code>v</code>. -See <a href="#pdf-bit32.extract"><code>bit32.extract</code></a> for details about <code>field</code> and <code>width</code>. - - - - -<p> -<hr><h3><a name="pdf-bit32.lrotate"><code>bit32.lrotate (x, disp)</code></a></h3> - - -<p> -Returns the number <code>x</code> rotated <code>disp</code> bits to the left. -The number <code>disp</code> may be any representable integer. - - -<p> -For any valid displacement, -the following identity holds: - -<pre> - assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp % 32)) -</pre><p> -In particular, -negative displacements rotate to the right. - - - - -<p> -<hr><h3><a name="pdf-bit32.lshift"><code>bit32.lshift (x, disp)</code></a></h3> - - -<p> -Returns the number <code>x</code> shifted <code>disp</code> bits to the left. -The number <code>disp</code> may be any representable integer. -Negative displacements shift to the right. -In any direction, vacant bits are filled with zeros. -In particular, -displacements with absolute values higher than 31 -result in zero (all bits are shifted out). - - -<p> -For positive displacements, -the following equality holds: - -<pre> - assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32) -</pre> - - - -<p> -<hr><h3><a name="pdf-bit32.rrotate"><code>bit32.rrotate (x, disp)</code></a></h3> - - -<p> -Returns the number <code>x</code> rotated <code>disp</code> bits to the right. -The number <code>disp</code> may be any representable integer. - - -<p> -For any valid displacement, -the following identity holds: - -<pre> - assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp % 32)) -</pre><p> -In particular, -negative displacements rotate to the left. - - - - -<p> -<hr><h3><a name="pdf-bit32.rshift"><code>bit32.rshift (x, disp)</code></a></h3> - - -<p> -Returns the number <code>x</code> shifted <code>disp</code> bits to the right. -The number <code>disp</code> may be any representable integer. -Negative displacements shift to the left. -In any direction, vacant bits are filled with zeros. -In particular, -displacements with absolute values higher than 31 -result in zero (all bits are shifted out). - - -<p> -For positive displacements, -the following equality holds: - -<pre> - assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp)) -</pre> - -<p> -This shift operation is what is called logical shift. +Returns a boolean, +true if integer <code>m</code> is below integer <code>n</code> when +they are compared as unsigned integers. @@ -9033,24 +9313,24 @@ This shift operation is what is called logical shift. <p> The I/O library provides two different styles for file manipulation. -The first one uses implicit file descriptors; +The first one uses implicit file handles; that is, there are operations to set a default input file and a default output file, and all input/output operations are over these default files. -The second style uses explicit file descriptors. +The second style uses explicit file handles. <p> -When using implicit file descriptors, +When using implicit file handles, all operations are supplied by table <a name="pdf-io"><code>io</code></a>. -When using explicit file descriptors, -the operation <a href="#pdf-io.open"><code>io.open</code></a> returns a file descriptor -and then all operations are supplied as methods of the file descriptor. +When using explicit file handles, +the operation <a href="#pdf-io.open"><code>io.open</code></a> returns a file handle +and then all operations are supplied as methods of the file handle. <p> The table <code>io</code> also provides -three predefined file descriptors with their usual meanings from C: +three predefined file handles with their usual meanings from C: <a name="pdf-io.stdin"><code>io.stdin</code></a>, <a name="pdf-io.stdout"><code>io.stdout</code></a>, and <a name="pdf-io.stderr"><code>io.stderr</code></a>. The I/O library never closes these files. @@ -9061,7 +9341,7 @@ all I/O functions return <b>nil</b> on failure (plus an error message as a second result and a system-dependent error code as a third result) and some value different from <b>nil</b> on success. -On non-Posix systems, +On non-POSIX systems, the computation of the error message and error code in case of errors may be not thread safe, @@ -9118,12 +9398,12 @@ Opens the given file name in read mode and returns an iterator function that works like <code>file:lines(···)</code> over the opened file. When the iterator function detects the end of file, -it returns <b>nil</b> (to finish the loop) and automatically closes the file. +it returns no values (to finish the loop) and automatically closes the file. <p> The call <code>io.lines()</code> (with no file name) is equivalent -to <code>io.input():lines()</code>; +to <code>io.input():lines("*l")</code>; that is, it iterates over the lines of the default input file. In this case it does not close the file when the loop ends. @@ -9276,7 +9556,7 @@ Returns an iterator function that, each time it is called, reads the file according to the given formats. When no format is given, -uses "*l" as a default. +uses "<code>l</code>" as a default. As an example, the construction <pre> @@ -9303,8 +9583,10 @@ instead of returning an error code. Reads the file <code>file</code>, according to the given formats, which specify what to read. For each format, -the function returns a string (or a number) with the characters read, +the function returns a string or a number with the characters read, or <b>nil</b> if it cannot read data with the specified format. +(In this latter case, +the function does not read subsequent formats.) When called without formats, it uses a default format that reads the next line (see below). @@ -9315,36 +9597,48 @@ The available formats are <ul> -<li><b>"<code>*n</code>": </b> -reads a number; -this is the only format that returns a number instead of a string. +<li><b>"<code>n</code>": </b> +reads a numeral and returns it as a float or an integer, +following the lexical conventions of Lua. +(The numeral may have leading spaces and a sign.) +This format always reads the longest input sequence that +is a valid prefix for a number; +if that prefix does not form a valid number +(e.g., an empty string, "<code>0x</code>", or "<code>3.4e-</code>"), +it is discarded and the function returns <b>nil</b>. </li> -<li><b>"<code>*a</code>": </b> +<li><b>"<code>i</code>": </b> +reads an integral number and returns it as an integer. +</li> + +<li><b>"<code>a</code>": </b> reads the whole file, starting at the current position. On end of file, it returns the empty string. </li> -<li><b>"<code>*l</code>": </b> +<li><b>"<code>l</code>": </b> reads the next line skipping the end of line, returning <b>nil</b> on end of file. This is the default format. </li> -<li><b>"<code>*L</code>": </b> -reads the next line keeping the end of line (if present), +<li><b>"<code>L</code>": </b> +reads the next line keeping the end-of-line character (if present), returning <b>nil</b> on end of file. </li> <li><b><em>number</em>: </b> reads a string with up to this number of bytes, returning <b>nil</b> on end of file. -If number is zero, +If <code>number</code> is zero, it reads nothing and returns an empty string, or <b>nil</b> on end of file. </li> -</ul> +</ul><p> +The formats "<code>l</code>" and "<code>L</code>" should be used only for text files. + @@ -9486,7 +9780,7 @@ if the information is not available. <p> If <code>format</code> is not "<code>*t</code>", then <code>date</code> returns the date as a string, -formatted according to the same rules as the ANSI C function <code>strftime</code>. +formatted according to the same rules as the ISO C function <code>strftime</code>. <p> @@ -9497,7 +9791,7 @@ the host system and on the current locale <p> -On non-Posix systems, +On non-POSIX systems, this function may be not thread safe because of its reliance on C function <code>gmtime</code> and C function <code>localtime</code>. @@ -9509,7 +9803,9 @@ because of its reliance on C function <code>gmtime</code> and C functi <p> -Returns the number of seconds from time <code>t1</code> to time <code>t2</code>. +Returns the difference, in seconds, +from time <code>t1</code> to time <code>t2</code> +(where the times are values returned by <a href="#pdf-os.time"><code>os.time</code></a>). In POSIX, Windows, and some other systems, this value is exactly <code>t2</code><em>-</em><code>t1</code>. @@ -9521,13 +9817,13 @@ this value is exactly <code>t2</code><em>-</em><code>t1</code>. <p> -This function is equivalent to the ANSI C function <code>system</code>. +This function is equivalent to the ISO C function <code>system</code>. It passes <code>command</code> to be executed by an operating system shell. Its first result is <b>true</b> if the command terminated successfully, or <b>nil</b> otherwise. After this first result -the function returns a string and a number, +the function returns a string plus a number, as follows: <ul> @@ -9552,11 +9848,11 @@ When called without a <code>command</code>, <p> -<hr><h3><a name="pdf-os.exit"><code>os.exit ([code [, close])</code></a></h3> +<hr><h3><a name="pdf-os.exit"><code>os.exit ([code [, close]])</code></a></h3> <p> -Calls the ANSI C function <code>exit</code> to terminate the host program. +Calls the ISO C function <code>exit</code> to terminate the host program. If <code>code</code> is <b>true</b>, the returned status is <code>EXIT_SUCCESS</code>; if <code>code</code> is <b>false</b>, @@ -9819,7 +10115,9 @@ but also parameters, temporaries, etc. <p> The first parameter or local variable has index 1, and so on, -until the last active variable. +following the order that they are declared in the code, +counting only the variables that are active +in the current scope of the function. Negative indices refer to vararg parameters; -1 is the first vararg parameter. The function returns <b>nil</b> if there is no variable with the given index, @@ -9828,9 +10126,10 @@ and raises an error when called with a level out of range. <p> -Variable names starting with '<code>(</code>' (open parenthesis) -represent internal variables -(loop control variables, temporaries, varargs, and C function locals). +Variable names starting with '<code>(</code>' (open parenthesis) +represent variables with no known names +(internal variables such as loop control variables, +and variables from chunks saved without debug information). <p> @@ -9871,6 +10170,12 @@ with index <code>up</code> of the function <code>f</code>. The function returns <b>nil</b> if there is no upvalue with the given index. +<p> +Variable names starting with '<code>(</code>' (open parenthesis) +represent variables with no known names +(variables from chunks saved without debug information). + + <p> @@ -9893,7 +10198,7 @@ returns <b>nil</b>. Sets the given function as a hook. The string <code>mask</code> and the number <code>count</code> describe when the hook will be called. -The string mask may have the following characters, +The string mask may have any combination of the following characters, with the given meaning: <ul> @@ -9901,8 +10206,9 @@ with the given meaning: <li><b>'<code>r</code>': </b> the hook is called every time Lua returns from a function;</li> <li><b>'<code>l</code>': </b> the hook is called every time Lua enters a new line of code.</li> </ul><p> -With a <code>count</code> different from zero, -the hook is called after every <code>count</code> instructions. +Moreover, +with a <code>count</code> different from zero, +the hook is called also after every <code>count</code> instructions. <p> @@ -9981,7 +10287,6 @@ Otherwise, it returns the name of the upvalue. <p> Sets the given <code>value</code> as the Lua value associated to the given <code>udata</code>. -<code>value</code> must be a table or <b>nil</b>; <code>udata</code> must be a full userdata. @@ -10000,7 +10305,7 @@ If <code>message</code> is present but is neither a string nor <b>nil</b>, this function returns <code>message</code> without further processing. Otherwise, it returns a string with a traceback of the call stack. -An optional <code>message</code> string is appended +The optional <code>message</code> string is appended at the beginning of the traceback. An optional <code>level</code> number tells at which level to start the traceback @@ -10014,7 +10319,7 @@ to start the traceback <p> -Returns an unique identifier (as a light userdata) +Returns a unique identifier (as a light userdata) for the upvalue numbered <code>n</code> from the given function. @@ -10070,8 +10375,7 @@ The options are: <li><b><code>--</code>: </b> stops handling options;</li> <li><b><code>-</code>: </b> executes <code>stdin</code> as a file and stops handling options.</li> </ul><p> -After handling its options, <code>lua</code> runs the given <em>script</em>, -passing to it the given <em>args</em> as string arguments. +After handling its options, <code>lua</code> runs the given <em>script</em>. When called without arguments, <code>lua</code> behaves as <code>lua -v -i</code> when the standard input (<code>stdin</code>) is a terminal, @@ -10080,8 +10384,8 @@ and as <code>lua -</code> otherwise. <p> When called without option <code>-E</code>, -the interpreter checks for an environment variable <a name="pdf-LUA_INIT_5_2"><code>LUA_INIT_5_2</code></a> -(or <a name="pdf-LUA_INIT"><code>LUA_INIT</code></a> if it is not defined) +the interpreter checks for an environment variable <a name="pdf-LUA_INIT_5_3"><code>LUA_INIT_5_3</code></a> +(or <a name="pdf-LUA_INIT"><code>LUA_INIT</code></a> if the versioned name is not defined) before running any argument. If the variable content has the format <code>@<em>filename</em></code>, then <code>lua</code> executes the file. @@ -10111,37 +10415,51 @@ and finally run the file <code>script.lua</code> with no arguments. <p> -Before starting to run the script, -<code>lua</code> collects all arguments in the command line +Before running any code, +<code>lua</code> collects all command-line arguments in a global table called <code>arg</code>. -The script name is stored at index 0, +The script name goes to index 0, the first argument after the script name goes to index 1, and so on. Any arguments before the script name -(that is, the interpreter name plus the options) +(that is, the interpreter name plus its options) go to negative indices. For instance, in the call <pre> $ lua -la b.lua t1 t2 </pre><p> -the interpreter first runs the file <code>a.lua</code>, -then creates a table +the table is like this: <pre> arg = { [-2] = "lua", [-1] = "-la", [0] = "b.lua", [1] = "t1", [2] = "t2" } </pre><p> -and finally runs the file <code>b.lua</code>. -The script is called with <code>arg[1]</code>, <code>arg[2]</code>, ... -as arguments; -it can also access these arguments with the vararg expression '<code>...</code>'. +If there is no script in the call, +the interpreter name goes to index 0, +followed by the other arguments. +For instance, the call + +<pre> + $ lua -e "print(arg[1])" +</pre><p> +will print "<code>-e</code>". +If there is a script, +the script is called with parameters +<code>arg[1]</code>, ···, <code>arg[#arg]</code>. +(Like all chunks in Lua, +the script is compiled as a vararg function.) <p> In interactive mode, -if you write an incomplete statement, +Lua repeatedly prompts and waits for a line. +After reading a line, +Lua first try to interpret the line as an expression. +If it succeeds, it prints its value. +Otherwise, it interprets the line as a statement. +If you write an incomplete statement, the interpreter waits for its completion by issuing a different prompt. @@ -10149,12 +10467,11 @@ by issuing a different prompt. <p> In case of unprotected errors in the script, the interpreter reports the error to the standard error stream. -If the error object is a string, -the interpreter adds a stack traceback to it. -Otherwise, if the error object has a metamethod <code>__tostring</code>, +If the error object is not a string but +has a metamethod <code>__tostring</code>, the interpreter calls this metamethod to produce the final message. -Finally, if the error object is <b>nil</b>, -the interpreter does not report the error. +Otherwise, the interpreter converts the error object to a string +and adds a stack traceback to it. <p> @@ -10193,67 +10510,80 @@ is a more portable solution.) <p> Here we list the incompatibilities that you may find when moving a program -from Lua 5.1 to Lua 5.2. +from Lua 5.2 to Lua 5.3. You can avoid some incompatibilities by compiling Lua with appropriate options (see file <code>luaconf.h</code>). However, -all these compatibility options will be removed in the next version of Lua. -Similarly, -all features marked as deprecated in Lua 5.1 -have been removed in Lua 5.2. +all these compatibility options will be removed in the future. +<p> +Lua versions can always change the C API in ways that +do not imply source-code changes in a program, +such as the numeric values for constants +or the implementation of functions as macros. +Therefore, +you should not assume that binaries are compatible between +different Lua versions. +Always recompile clients of the Lua API when +using a new version. -<h2>8.1 – <a name="8.1">Changes in the Language</a></h2> -<ul> -<li> -The concept of <em>environment</em> changed. -Only Lua functions have environments. -To set the environment of a Lua function, -use the variable <code>_ENV</code> or the function <a href="#pdf-load"><code>load</code></a>. +<p> +Similarly, Lua versions can always change the internal representation +of precompiled chunks; +precompiled chunks are not compatible between different Lua versions. <p> -C functions no longer have environments. -Use an upvalue with a shared table if you need to keep -shared state among several C functions. -(You may use <a href="#luaL_setfuncs"><code>luaL_setfuncs</code></a> to open a C library -with all functions sharing a common upvalue.) +The standard paths in the official distribution may +change between versions. -<p> -To manipulate the "environment" of a userdata -(which is now called user value), -use the new functions -<a href="#lua_getuservalue"><code>lua_getuservalue</code></a> and <a href="#lua_setuservalue"><code>lua_setuservalue</code></a>. -</li> -<li> -Lua identifiers cannot use locale-dependent letters. -</li> +<h2>8.1 – <a name="8.1">Changes in the Language</a></h2> +<ul> <li> -Doing a step or a full collection in the garbage collector -does not restart the collector if it has been stopped. -</li> +The main difference between Lua 5.2 and Lua 5.3 is the +introduction of an integer subtype for numbers. +Although this change should not affect "normal" computations, +some computations +(mainly those that involve some kind of overflow) +can give different results. -<li> -Weak tables with weak keys now perform like <em>ephemeron tables</em>. + +<p> +You can fix these differences by forcing a number to be a float +(in Lua 5.2 all numbers were float), +in particular writing constants with an ending <code>.0</code> +or using <code>x = x + 0.0</code> to convert a variable. +(This recommendation is only for a quick fix +for an occasional incompatibility; +it is not a general guideline for good programming. +For good programming, +use floats where you need floats +and integers where you need integers.) </li> <li> -The event <em>tail return</em> in debug hooks was removed. -Instead, tail calls generate a special new event, -<em>tail call</em>, so that the debugger can know that -there will not be a corresponding return event. +The conversion of a float to a string now adds a <code>.0</code> suffix +to the result if it looks like an integer. +(For instance, the float 2.0 will be printed as <code>2.0</code>, +not as <code>2</code>.) +You should always use an explicit format +when you need a specific format for numbers. + + +<p> +(Formally this is not an incompatibility, +because Lua does not specify how numbers are formatted as strings, +but some programs assumed a specific format.) </li> <li> -Equality between function values has changed. -Now, a function definition may not create a new value; -it may reuse some previous value if there is no -observable difference to the new function. +The generational mode for the garbage collector was removed. +(It was an experimental feature in Lua 5.2.) </li> </ul> @@ -10265,67 +10595,50 @@ observable difference to the new function. <ul> <li> -Function <code>module</code> is deprecated. -It is easy to set up a module with regular Lua code. -Modules are not expected to set global variables. -</li> - -<li> -Functions <code>setfenv</code> and <code>getfenv</code> were removed, -because of the changes in environments. -</li> - -<li> -Function <code>math.log10</code> is deprecated. -Use <a href="#pdf-math.log"><code>math.log</code></a> with 10 as its second argument, instead. -</li> - -<li> -Function <code>loadstring</code> is deprecated. -Use <code>load</code> instead; it now accepts string arguments -and are exactly equivalent to <code>loadstring</code>. -</li> - -<li> -Function <code>table.maxn</code> is deprecated. -Write it in Lua if you really need it. -</li> - -<li> -Function <code>os.execute</code> now returns <b>true</b> when command -terminates successfully and <b>nil</b> plus error information -otherwise. +The <code>bit32</code> library has been deprecated. +It is easy to require a compatible external library or, +better yet, to replace its functions with appropriate bitwise operations. +(Keep in mind that <code>bit32</code> operates on 32-bit integers, +while the bitwise operators in standard Lua operate on 64-bit integers.) </li> <li> -Function <code>unpack</code> was moved into the table library -and therefore must be called as <a href="#pdf-table.unpack"><code>table.unpack</code></a>. +The Table library now respects metamethods +for setting and getting elements. </li> <li> -Character class <code>%z</code> in patterns is deprecated, -as now patterns may contain '<code>\0</code>' as a regular character. +The <a href="#pdf-ipairs"><code>ipairs</code></a> iterator now respects metamethods and +its <code>__ipairs</code> metamethod has been deprecated. </li> <li> -The table <code>package.loaders</code> was renamed <code>package.searchers</code>. +Option names in <a href="#pdf-io.read"><code>io.read</code></a> do not have a starting '<code>*</code>' anymore. +For compatibility, Lua will continue to ignore this character. </li> <li> -Lua does not have bytecode verification anymore. -So, all functions that load code -(<a href="#pdf-load"><code>load</code></a> and <a href="#pdf-loadfile"><code>loadfile</code></a>) -are potentially insecure when loading untrusted binary data. -(Actually, those functions were already insecure because -of flaws in the verification algorithm.) -When in doubt, -use the <code>mode</code> argument of those functions -to restrict them to loading textual chunks. +The following functions were deprecated in the mathematical library: +<code>atan2</code>, <code>cosh</code>, <code>sinh</code>, <code>tanh</code>, <code>pow</code>, +<code>frexp</code>, and <code>ldexp</code>. +You can replace <code>math.pow(x,y)</code> with <code>x^y</code>; +you can replace <code>math.atan2</code> with <code>math.atan</code>, +which now accepts one or two parameters; +you can replace <code>math.ldexp(x,exp)</code> with <code>x * 2.0^exp</code>. +For the other operations, +you can either use an external library or +implement them in Lua. </li> <li> -The standard paths in the official distribution may -change between versions. +The searcher for C loaders used by <a href="#pdf-require"><code>require</code></a> +changed the way it handles versioned names. +Now, the version should come after the module name +(as is usual in most other tools). +For compatibility, that searcher still tries the old format +if it cannot find an open function according to the new style. +(Lua 5.2 already worked that way, +but it did not document the change.) </li> </ul> @@ -10334,75 +10647,36 @@ change between versions. <h2>8.3 – <a name="8.3">Changes in the API</a></h2> -<ul> -<li> -Pseudoindex <code>LUA_GLOBALSINDEX</code> was removed. -You must get the global environment from the registry -(see <a href="#4.5">§4.5</a>). -</li> - -<li> -Pseudoindex <code>LUA_ENVIRONINDEX</code> -and functions <code>lua_getfenv</code>/<code>lua_setfenv</code> -were removed, -as C functions no longer have environments. -</li> - -<li> -Function <code>luaL_register</code> is deprecated. -Use <a href="#luaL_setfuncs"><code>luaL_setfuncs</code></a> so that your module does not create globals. -(Modules are not expected to set global variables anymore.) -</li> -<li> -The <code>osize</code> argument to the allocation function -may not be zero when creating a new block, -that is, when <code>ptr</code> is <code>NULL</code> -(see <a href="#lua_Alloc"><code>lua_Alloc</code></a>). -Use only the test <code>ptr == NULL</code> to check whether -the block is new. -</li> - -<li> -Finalizers (<code>__gc</code> metamethods) for userdata are called in the -reverse order that they were marked for finalization, -not that they were created (see <a href="#2.5.1">§2.5.1</a>). -(Most userdata are marked immediately after they are created.) -Moreover, -if the metatable does not have a <code>__gc</code> field when set, -the finalizer will not be called, -even if it is set later. -</li> - -<li> -<code>luaL_typerror</code> was removed. -Write your own version if you need it. -</li> - -<li> -Function <code>lua_cpcall</code> is deprecated. -You can simply push the function with <a href="#lua_pushcfunction"><code>lua_pushcfunction</code></a> -and call it with <a href="#lua_pcall"><code>lua_pcall</code></a>. -</li> +<ul> <li> -Functions <code>lua_equal</code> and <code>lua_lessthan</code> are deprecated. -Use the new <a href="#lua_compare"><code>lua_compare</code></a> with appropriate options instead. +Continuation functions now receive as parameters what they needed +to get through <code>lua_getctx</code>, +so <code>lua_getctx</code> has been removed. +Adapt your code accordingly. </li> <li> -Function <code>lua_objlen</code> was renamed <a href="#lua_rawlen"><code>lua_rawlen</code></a>. +Function <a href="#lua_dump"><code>lua_dump</code></a> has an extra parameter, <code>strip</code>. +Use 0 as the value of this parameter to get the old behavior. </li> <li> -Function <a href="#lua_load"><code>lua_load</code></a> has an extra parameter, <code>mode</code>. -Pass <code>NULL</code> to simulate the old behavior. +Functions to inject/project unsigned integers +(<code>lua_pushunsigned</code>, <code>lua_tounsigned</code>, <code>lua_tounsignedx</code>, +<code>luaL_checkunsigned</code>, <code>luaL_optunsigned</code>) +were deprecated. +Use their signed equivalents with a type cast. </li> <li> -Function <a href="#lua_resume"><code>lua_resume</code></a> has an extra parameter, <code>from</code>. -Pass <code>NULL</code> or the thread doing the call. +Macros to project non-default integer types +(<code>luaL_checkint</code>, <code>luaL_optint</code>, <code>luaL_checklong</code>, <code>luaL_optlong</code>) +were deprecated. +Use their equivalent over <a href="#lua_Integer"><code>lua_Integer</code></a> with a type cast +(or, when possible, use <a href="#lua_Integer"><code>lua_Integer</code></a> in your code). </li> </ul> @@ -10414,7 +10688,13 @@ Pass <code>NULL</code> or the thread doing the call. <p> Here is the complete syntax of Lua in extended BNF. -(It does not describe operator precedences.) +As usual in extended BNF, +{A} means 0 or more As, +and [A] means an optional A. +(For operator precedences, see <a href="#3.4.8">§3.4.8</a>; +for a description of the terminals +Name, Numeral, +and LiteralString, see <a href="#3.1">§3.1</a>.) @@ -10455,14 +10735,14 @@ Here is the complete syntax of Lua in extended BNF. explist ::= exp {‘<b>,</b>’ exp} - exp ::= <b>nil</b> | <b>false</b> | <b>true</b> | Number | String | ‘<b>...</b>’ | functiondef | + exp ::= <b>nil</b> | <b>false</b> | <b>true</b> | Numeral | LiteralString | ‘<b>...</b>’ | functiondef | prefixexp | tableconstructor | exp binop exp | unop exp prefixexp ::= var | functioncall | ‘<b>(</b>’ exp ‘<b>)</b>’ functioncall ::= prefixexp args | prefixexp ‘<b>:</b>’ Name args - args ::= ‘<b>(</b>’ [explist] ‘<b>)</b>’ | tableconstructor | String + args ::= ‘<b>(</b>’ [explist] ‘<b>)</b>’ | tableconstructor | LiteralString functiondef ::= <b>function</b> funcbody @@ -10478,11 +10758,12 @@ Here is the complete syntax of Lua in extended BNF. fieldsep ::= ‘<b>,</b>’ | ‘<b>;</b>’ - binop ::= ‘<b>+</b>’ | ‘<b>-</b>’ | ‘<b>*</b>’ | ‘<b>/</b>’ | ‘<b>^</b>’ | ‘<b>%</b>’ | ‘<b>..</b>’ | + binop ::= ‘<b>+</b>’ | ‘<b>-</b>’ | ‘<b>*</b>’ | ‘<b>/</b>’ | ‘<b>//</b>’ | ‘<b>^</b>’ | ‘<b>%</b>’ | + ‘<b>&</b>’ | ‘<b>~</b>’ | ‘<b>|</b>’ | ‘<b>>></b>’ | ‘<b><<</b>’ | ‘<b>..</b>’ | ‘<b><</b>’ | ‘<b><=</b>’ | ‘<b>></b>’ | ‘<b>>=</b>’ | ‘<b>==</b>’ | ‘<b>~=</b>’ | <b>and</b> | <b>or</b> - unop ::= ‘<b>-</b>’ | <b>not</b> | ‘<b>#</b>’ + unop ::= ‘<b>-</b>’ | <b>not</b> | ‘<b>#</b>’ | ‘<b>~</b>’ </pre> @@ -10494,13 +10775,14 @@ Here is the complete syntax of Lua in extended BNF. + <HR> <SMALL CLASS="footer"> Last update: -Thu Mar 21 12:58:59 BRT 2013 +Tue Jan 6 10:10:50 BRST 2015 </SMALL> <!-- -Last change: revised for Lua 5.2.2 +Last change: revised for Lua 5.3.0 (final) --> </body></html> diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/osi-certified-72x60.png b/3rdparty/genie/src/host/lua-5.3.0/doc/osi-certified-72x60.png Binary files differindex 07df5f6ee7a..07df5f6ee7a 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/osi-certified-72x60.png +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/osi-certified-72x60.png diff --git a/3rdparty/genie/src/host/lua-5.2.3/doc/readme.html b/3rdparty/genie/src/host/lua-5.3.0/doc/readme.html index 8acec874caf..01657557013 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/doc/readme.html +++ b/3rdparty/genie/src/host/lua-5.3.0/doc/readme.html @@ -1,15 +1,15 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> -<TITLE>Lua 5.2 readme</TITLE> +<TITLE>Lua 5.3 readme</TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css"> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> <STYLE TYPE="text/css"> blockquote, .display { border: solid #a0a0a0 2px ; - border-radius: 8px ; padding: 1em ; margin: 0px ; + border-radius: 8px ; } .display { @@ -31,7 +31,7 @@ tt, kbd, code { <HR> <H1> <A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua" BORDER=0></A> -Welcome to Lua 5.2 +Welcome to Lua 5.3.0 </H1> <P> @@ -70,7 +70,7 @@ and updated <A HREF="http://www.lua.org/docs.html">documentation</A>, especially the -<A HREF="http://www.lua.org/manual/5.2/">reference manual</A>, +<A HREF="http://www.lua.org/manual/5.3/">reference manual</A>, which may differ slightly from the <A HREF="contents.html">local copy</A> distributed in this package. @@ -98,8 +98,8 @@ If you don't have the time or the inclination to compile Lua yourself, get a binary from <A HREF="http://lua-users.org/wiki/LuaBinaries">LuaBinaries</A>. Try also -<A HREF="http://luaforwindows.luaforge.net/">Lua for Windows</A>, -an easy-to-use distribution of Lua that includes many useful libraries. +<A HREF="http://luadist.org/">LuaDist</A>, +a multi-platform distribution of Lua that includes batteries. <H3>Building Lua</H3> @@ -110,22 +110,22 @@ Here are the details. <OL> <LI> Open a terminal window and move to -the top-level directory, which is named <TT>lua-5.2.3</TT>. -The Makefile there controls both the build process and the installation process. +the top-level directory, which is named <TT>lua-5.3.0</TT>. +The <TT>Makefile</TT> there controls both the build process and the installation process. <P> <LI> Do "<KBD>make</KBD>" and see if your platform is listed. The platforms currently supported are: <P> <P CLASS="display"> - aix ansi bsd freebsd generic linux macosx mingw posix solaris + aix bsd c89 freebsd generic linux macosx mingw posix solaris </P> <P> If your platform is listed, just do "<KBD>make xxx</KBD>", where xxx is your platform name. <P> If your platform is not listed, try the closest one or posix, generic, - ansi, in this order. + c89, in this order. <P> <LI> The compilation takes only a few moments @@ -136,7 +136,7 @@ and liblua.a (the library). <P> <LI> To check that Lua has been built correctly, do "<KBD>make test</KBD>" - after building Lua. This will run the interpreter and print its version string. + after building Lua. This will run the interpreter and print its version. </OL> <P> If you're running Linux and get compilation errors, @@ -148,7 +148,7 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". <P> Once you have built Lua, you may want to install it in an official place in your system. In this case, do "<KBD>make install</KBD>". The official - place and the way to install files are defined in the Makefile. You'll + place and the way to install files are defined in the <TT>Makefile</TT>. You'll probably need the right permissions to install files. <P> @@ -158,11 +158,13 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". <P> To install Lua locally, do "<KBD>make local</KBD>". This will create a directory <TT>install</TT> with subdirectories - <TT>bin</TT>, <TT>include</TT>, <TT>lib</TT>, <TT>man</TT>, + <TT>bin</TT>, <TT>include</TT>, <TT>lib</TT>, <TT>man</TT>, <TT>share</TT>, and install Lua as listed below. To install Lua locally, but in some other directory, do "<KBD>make install INSTALL_TOP=xxx</KBD>", where xxx is your chosen directory. + The installation starts in the <TT>src</TT> and <TT>doc</TT> directories, + so take care if <TT>INSTALL_TOP</TT> is not an absolute path. <DL CLASS="display"> <DT> @@ -172,7 +174,7 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". <DT> include: <DD> - lua.h luaconf.h lualib.h lauxlib.h lua.hpp + lauxlib.h lua.h lua.hpp luaconf.h lualib.h <DT> lib: <DD> @@ -186,8 +188,8 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". <P> These are the only directories you need for development. If you only want to run Lua programs, - you only need the files in bin and man. - The files in include and lib are needed for + you only need the files in <TT>bin</TT> and <TT>man</TT>. + The files in <TT>include</TT> and <TT>lib</TT> are needed for embedding Lua in C or C++ programs. <H3><A NAME="customization">Customization</A></H3> @@ -203,7 +205,7 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". You don't actually need to edit the Makefiles because you may set the relevant variables in the command line when invoking make. Nevertheless, it's probably best to edit and save the Makefiles to - record the changes you need. + record the changes you've made. <P> On the other hand, if you need to customize some Lua features, you'll need @@ -212,11 +214,6 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". it will be used by any Lua clients that you build, to ensure consistency. Further customization is available to experts by editing the Lua sources. -<P> - We strongly recommend that you enable dynamic loading in <TT>src/luaconf.h</TT>. - This is done automatically for all platforms listed above that have - this feature and also for Windows. - <H3><A NAME="other">Building Lua on other systems</A></H3> <P> @@ -233,7 +230,7 @@ lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c -lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c +lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c linit.c <DT> interpreter: <DD> @@ -254,15 +251,16 @@ compiler: be linked statically into the host program and its symbols exported for dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter. For Windows, we recommend that the Lua library be a DLL. + In all cases, the compiler luac should be linked statically. <P> As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize some features before building Lua. -<H2><A NAME="changes">Changes since Lua 5.1</A></H2> +<H2><A NAME="changes">Changes since Lua 5.2</A></H2> <P> -Here are the main changes introduced in Lua 5.2. +Here are the main changes introduced in Lua 5.3. The <A HREF="contents.html">reference manual</A> lists the @@ -270,90 +268,50 @@ lists the <H3>Main changes</H3> <UL> -<LI> yieldable pcall and metamethods -<LI> new lexical scheme for globals -<LI> ephemeron tables -<LI> new library for bitwise operations -<LI> light C functions -<LI> emergency garbage collector -<LI> <CODE>goto</CODE> statement -<LI> finalizers for tables +<LI> integers (64-bit by default) +<LI> official support for 32-bit numbers +<LI> bitwise operators +<LI> basic utf-8 support +<LI> functions for packing and unpacking values + </UL> -Here are the other changes introduced in Lua 5.2: +Here are the other changes introduced in Lua 5.3: <H3>Language</H3> <UL> -<LI> no more fenv for threads or functions -<LI> tables honor the <CODE>__len</CODE> metamethod -<LI> hex and <CODE>\z</CODE> escapes in strings -<LI> support for hexadecimal floats -<LI> order metamethods work for different types -<LI> no more verification of opcode consistency -<LI> hook event "tail return" replaced by "tail call" -<LI> empty statement -<LI> <CODE>break</CODE> statement may appear in the middle of a block +<LI> userdata can have any Lua value as uservalue +<LI> integer division +<LI> more flexible rules for some metamethods </UL> <H3>Libraries</H3> <UL> -<LI> arguments for function called through <CODE>xpcall</CODE> -<LI> optional 'mode' argument to load and loadfile (to control binary x text) -<LI> optional 'env' argument to load and loadfile (environment for loaded chunk) -<LI> <CODE>loadlib</CODE> may load libraries with global names (RTLD_GLOBAL) -<LI> new function <CODE>package.searchpath</CODE> -<LI> modules receive their paths when loaded -<LI> optional base in <CODE>math.log</CODE> -<LI> optional separator in <CODE>string.rep</CODE> -<LI> <CODE>file:write</CODE> returns <CODE>file</CODE> -<LI> closing a pipe returns exit status -<LI> <CODE>os.exit</CODE> may close state -<LI> new metamethods <CODE>__pairs</CODE> and <CODE>__ipairs</CODE> -<LI> new option 'isrunning' for <CODE>collectgarbage</CODE> and <CODE>lua_gc</CODE> -<LI> frontier patterns -<LI> <CODE>\0</CODE> in patterns -<LI> new option <CODE>*L</CODE> for <CODE>io.read</CODE> -<LI> options for <CODE>io.lines</CODE> -<LI> <CODE>debug.getlocal</CODE> can access function varargs +<LI> <CODE>ipairs</CODE> and the table library respect metamethods +<LI> strip option in <CODE>string.dump</CODE> +<LI> table library respects metamethods +<LI> new function <CODE>table.move</CODE> +<LI> new function <CODE>string.pack</CODE> +<LI> new function <CODE>string.unpack</CODE> +<LI> new function <CODE>string.packsize</CODE> </UL> <H3>C API</H3> <UL> -<LI> main thread predefined in the registry -<LI> new functions -<CODE>lua_absindex</CODE>, -<CODE>lua_arith</CODE>, -<CODE>lua_compare</CODE>, -<CODE>lua_copy</CODE>, -<CODE>lua_len</CODE>, -<CODE>lua_rawgetp</CODE>, -<CODE>lua_rawsetp</CODE>, -<CODE>lua_upvalueid</CODE>, -<CODE>lua_upvaluejoin</CODE>, -<CODE>lua_version</CODE>. -<LI> new functions -<CODE>luaL_checkversion</CODE>, -<CODE>luaL_setmetatable</CODE>, -<CODE>luaL_testudata</CODE>, -<CODE>luaL_tolstring</CODE>. -<LI> <CODE>lua_pushstring</CODE> and <CODE>pushlstring</CODE> return string -<LI> <CODE>nparams</CODE> and <CODE>isvararg</CODE> available in debug API -<LI> new <CODE>lua_Unsigned</CODE> -</UL> - -<H3>Implementation</H3> -<UL> -<LI> max constants per function raised to 2<SUP>26</SUP> -<LI> generational mode for garbage collection (experimental) -<LI> NaN trick (experimental) -<LI> internal (immutable) version of ctypes -<LI> simpler implementation for string buffers -<LI> parser uses much less C-stack space (no more auto arrays) +<LI> simpler API for continuation functions in C +<LI> <CODE>lua_gettable</CODE> and similar functions return type of resulted value +<LI> strip option in <CODE>lua_dump</CODE> +<LI> new function: <CODE>lua_geti</CODE> +<LI> new function: <CODE>lua_seti</CODE> +<LI> new function: <CODE>lua_isyieldable</CODE> +<LI> new function: <CODE>lua_numbertointeger</CODE> +<LI> new function: <CODE>lua_rotate</CODE> +<LI> new function: <CODE>lua_stringtonumber</CODE> </UL> <H3>Lua standalone interpreter</H3> <UL> -<LI> new <CODE>-E</CODE> option to avoid environment variables -<LI> handling of non-string error messages +<LI> can be used as calculator; no need to prefix with '=' +<LI> <CODE>arg</CODE> table available to all code </UL> <H2><A NAME="license">License</A></H2> @@ -375,7 +333,7 @@ For details, see <A HREF="http://www.lua.org/license.html">this</A>. <BLOCKQUOTE STYLE="padding-bottom: 0em"> -Copyright © 1994–2013 Lua.org, PUC-Rio. +Copyright © 1994–2015 Lua.org, PUC-Rio. <P> Permission is hereby granted, free of charge, to any person obtaining a copy @@ -403,10 +361,10 @@ THE SOFTWARE. <HR> <SMALL CLASS="footer"> Last update: -Sat Nov 9 22:39:16 BRST 2013 +Fri Dec 12 09:58:42 BRST 2014 </SMALL> <!-- -Last change: revised for Lua 5.2.3 +Last change: updated for Lua 5.3.0 (final) --> </BODY> diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/Makefile b/3rdparty/genie/src/host/lua-5.3.0/src/Makefile new file mode 100644 index 00000000000..2e7a4120cef --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/Makefile @@ -0,0 +1,197 @@ +# Makefile for building Lua +# See ../doc/readme.html for installation and customization instructions. + +# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= + +# Your platform. See PLATS for possible values. +PLAT= none + +CC= gcc -std=gnu99 +CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) +LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) +LIBS= -lm $(SYSLIBS) $(MYLIBS) + +AR= ar rcu +RANLIB= ranlib +RM= rm -f + +SYSCFLAGS= +SYSLDFLAGS= +SYSLIBS= + +MYCFLAGS= +MYLDFLAGS= +MYLIBS= +MYOBJS= + +# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= + +PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris + +LUA_A= liblua.a +CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ + lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ + ltm.o lundump.o lvm.o lzio.o +LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \ + lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o +BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) + +LUA_T= lua +LUA_O= lua.o + +LUAC_T= luac +LUAC_O= luac.o + +ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) +ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) +ALL_A= $(LUA_A) + +# Targets start here. +default: $(PLAT) + +all: $(ALL_T) + +o: $(ALL_O) + +a: $(ALL_A) + +$(LUA_A): $(BASE_O) + $(AR) $@ $(BASE_O) + $(RANLIB) $@ + +$(LUA_T): $(LUA_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + +$(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) + +clean: + $(RM) $(ALL_T) $(ALL_O) + +depend: + @$(CC) $(CFLAGS) -MM l*.c + +echo: + @echo "PLAT= $(PLAT)" + @echo "CC= $(CC)" + @echo "CFLAGS= $(CFLAGS)" + @echo "LDFLAGS= $(SYSLDFLAGS)" + @echo "LIBS= $(LIBS)" + @echo "AR= $(AR)" + @echo "RANLIB= $(RANLIB)" + @echo "RM= $(RM)" + +# Convenience targets for popular platforms +ALL= all + +none: + @echo "Please do 'make PLATFORM' where PLATFORM is one of these:" + @echo " $(PLATS)" + +aix: + $(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" SYSLDFLAGS="-brtl -bexpall" + +bsd: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E" + +c89: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_C89" CC="gcc -std=c89" + @echo '' + @echo '*** C89 does not guarantee 64-bit integers for Lua.' + @echo '' + + +freebsd: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" + +generic: $(ALL) + +linux: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" + +macosx: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc + +mingw: + $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \ + "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \ + "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe + $(MAKE) "LUAC_T=luac.exe" luac.exe + +posix: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX" + +solaris: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_REENTRANT" SYSLIBS="-ldl" + +# list targets that do not create files (but not all makes understand .PHONY) +.PHONY: all $(PLATS) default o a clean depend echo none + +# DO NOT DELETE + +lapi.o: lapi.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ + lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h \ + ltable.h lundump.h lvm.h +lauxlib.o: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h +lbaselib.o: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lbitlib.o: lbitlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lcode.o: lcode.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \ + llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \ + ldo.h lgc.h lstring.h ltable.h lvm.h +lcorolib.o: lcorolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lctype.o: lctype.c lprefix.h lctype.h lua.h luaconf.h llimits.h +ldblib.o: ldblib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +ldebug.o: ldebug.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ + lobject.h ltm.h lzio.h lmem.h lcode.h llex.h lopcodes.h lparser.h \ + ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h lvm.h +ldo.o: ldo.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ + lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lopcodes.h \ + lparser.h lstring.h ltable.h lundump.h lvm.h +ldump.o: ldump.c lprefix.h lua.h luaconf.h lobject.h llimits.h lstate.h \ + ltm.h lzio.h lmem.h lundump.h +lfunc.o: lfunc.c lprefix.h lua.h luaconf.h lfunc.h lobject.h llimits.h \ + lgc.h lstate.h ltm.h lzio.h lmem.h +lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ + llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h +linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h +liolib.o: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +llex.o: llex.c lprefix.h lua.h luaconf.h lctype.h llimits.h ldo.h \ + lobject.h lstate.h ltm.h lzio.h lmem.h lgc.h llex.h lparser.h lstring.h \ + ltable.h +lmathlib.o: lmathlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lmem.o: lmem.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ + llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h +loadlib.o: loadlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lobject.o: lobject.c lprefix.h lua.h luaconf.h lctype.h llimits.h \ + ldebug.h lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h \ + lvm.h +lopcodes.o: lopcodes.c lprefix.h lopcodes.h llimits.h lua.h luaconf.h +loslib.o: loslib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lparser.o: lparser.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \ + llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \ + ldo.h lfunc.h lstring.h lgc.h ltable.h +lstate.o: lstate.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ + lobject.h ltm.h lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h llex.h \ + lstring.h ltable.h +lstring.o: lstring.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \ + lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h +lstrlib.o: lstrlib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +ltable.o: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ + llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h +ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ + llimits.h ltm.h lzio.h lmem.h ldo.h lstring.h lgc.h ltable.h lvm.h +lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +luac.o: luac.c lprefix.h lua.h luaconf.h lauxlib.h lobject.h llimits.h \ + lstate.h ltm.h lzio.h lmem.h lundump.h ldebug.h lopcodes.h +lundump.o: lundump.c lprefix.h lua.h luaconf.h ldebug.h lstate.h \ + lobject.h llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h \ + lundump.h +lutf8lib.o: lutf8lib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h +lvm.o: lvm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ + llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h \ + ltable.h lvm.h +lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \ + lobject.h ltm.h lzio.h + +# (end of Makefile) diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lapi.c b/3rdparty/genie/src/host/lua-5.3.0/src/lapi.c index d011431eadf..fbfafa304ff 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lapi.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lapi.c @@ -1,16 +1,18 @@ /* -** $Id: lapi.c,v 2.171.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lapi.c,v 2.244 2014/12/26 14:43:45 roberto Exp $ ** Lua API ** See Copyright Notice in lua.h */ +#define lapi_c +#define LUA_CORE + +#include "lprefix.h" + #include <stdarg.h> #include <string.h> -#define lapi_c -#define LUA_CORE - #include "lua.h" #include "lapi.h" @@ -43,32 +45,35 @@ const char lua_ident[] = /* test for pseudo index */ #define ispseudo(i) ((i) <= LUA_REGISTRYINDEX) +/* test for upvalue */ +#define isupvalue(i) ((i) < LUA_REGISTRYINDEX) + /* test for valid but not pseudo index */ #define isstackindex(i, o) (isvalid(o) && !ispseudo(i)) -#define api_checkvalidindex(L, o) api_check(L, isvalid(o), "invalid index") +#define api_checkvalidindex(o) api_check(isvalid(o), "invalid index") -#define api_checkstackindex(L, i, o) \ - api_check(L, isstackindex(i, o), "index not in the stack") +#define api_checkstackindex(i, o) \ + api_check(isstackindex(i, o), "index not in the stack") static TValue *index2addr (lua_State *L, int idx) { CallInfo *ci = L->ci; if (idx > 0) { TValue *o = ci->func + idx; - api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index"); + api_check(idx <= ci->top - (ci->func + 1), "unacceptable index"); if (o >= L->top) return NONVALIDVALUE; else return o; } else if (!ispseudo(idx)) { /* negative index */ - api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); + api_check(idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); return L->top + idx; } else if (idx == LUA_REGISTRYINDEX) return &G(L)->l_registry; else { /* upvalues */ idx = LUA_REGISTRYINDEX - idx; - api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large"); + api_check(idx <= MAXUPVAL + 1, "upvalue index too large"); if (ttislcf(ci->func)) /* light C function? */ return NONVALIDVALUE; /* it has no upvalues */ else { @@ -89,21 +94,22 @@ static void growstack (lua_State *L, void *ud) { } -LUA_API int lua_checkstack (lua_State *L, int size) { +LUA_API int lua_checkstack (lua_State *L, int n) { int res; CallInfo *ci = L->ci; lua_lock(L); - if (L->stack_last - L->top > size) /* stack large enough? */ + api_check(n >= 0, "negative 'n'"); + if (L->stack_last - L->top > n) /* stack large enough? */ res = 1; /* yes; check is OK */ else { /* no; need to grow stack */ int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; - if (inuse > LUAI_MAXSTACK - size) /* can grow without overflow? */ + if (inuse > LUAI_MAXSTACK - n) /* can grow without overflow? */ res = 0; /* no */ else /* try to grow stack */ - res = (luaD_rawrunprotected(L, &growstack, &size) == LUA_OK); + res = (luaD_rawrunprotected(L, &growstack, &n) == LUA_OK); } - if (res && ci->top < L->top + size) - ci->top = L->top + size; /* adjust frame top */ + if (res && ci->top < L->top + n) + ci->top = L->top + n; /* adjust frame top */ lua_unlock(L); return res; } @@ -114,8 +120,8 @@ LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { if (from == to) return; lua_lock(to); api_checknelems(from, n); - api_check(from, G(from) == G(to), "moving among independent states"); - api_check(from, to->ci->top - to->top >= n, "not enough elements to move"); + api_check(G(from) == G(to), "moving among independent states"); + api_check(to->ci->top - to->top >= n, "not enough elements to move"); from->top -= n; for (i = 0; i < n; i++) { setobj2s(to, to->top++, from->top + i); @@ -166,68 +172,63 @@ LUA_API void lua_settop (lua_State *L, int idx) { StkId func = L->ci->func; lua_lock(L); if (idx >= 0) { - api_check(L, idx <= L->stack_last - (func + 1), "new top too large"); + api_check(idx <= L->stack_last - (func + 1), "new top too large"); while (L->top < (func + 1) + idx) setnilvalue(L->top++); L->top = (func + 1) + idx; } else { - api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); - L->top += idx+1; /* `subtract' index (index is negative) */ + api_check(-(idx+1) <= (L->top - (func + 1)), "invalid new top"); + L->top += idx+1; /* 'subtract' index (index is negative) */ } lua_unlock(L); } -LUA_API void lua_remove (lua_State *L, int idx) { - StkId p; - lua_lock(L); - p = index2addr(L, idx); - api_checkstackindex(L, idx, p); - while (++p < L->top) setobjs2s(L, p-1, p); - L->top--; - lua_unlock(L); +/* +** Reverse the stack segment from 'from' to 'to' +** (auxiliary to 'lua_rotate') +*/ +static void reverse (lua_State *L, StkId from, StkId to) { + for (; from < to; from++, to--) { + TValue temp; + setobj(L, &temp, from); + setobjs2s(L, from, to); + setobj2s(L, to, &temp); + } } -LUA_API void lua_insert (lua_State *L, int idx) { - StkId p; - StkId q; +/* +** Let x = AB, where A is a prefix of length 'n'. Then, +** rotate x n == BA. But BA == (A^r . B^r)^r. +*/ +LUA_API void lua_rotate (lua_State *L, int idx, int n) { + StkId p, t, m; lua_lock(L); - p = index2addr(L, idx); - api_checkstackindex(L, idx, p); - for (q = L->top; q > p; q--) /* use L->top as a temporary */ - setobjs2s(L, q, q - 1); - setobjs2s(L, p, L->top); + t = L->top - 1; /* end of stack segment being rotated */ + p = index2addr(L, idx); /* start of segment */ + api_checkstackindex(idx, p); + api_check((n >= 0 ? n : -n) <= (t - p + 1), "invalid 'n'"); + m = (n >= 0 ? t - n : p - n - 1); /* end of prefix */ + reverse(L, p, m); /* reverse the prefix with length 'n' */ + reverse(L, m + 1, t); /* reverse the suffix */ + reverse(L, p, t); /* reverse the entire segment */ lua_unlock(L); } -static void moveto (lua_State *L, TValue *fr, int idx) { - TValue *to = index2addr(L, idx); - api_checkvalidindex(L, to); +LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { + TValue *fr, *to; + lua_lock(L); + fr = index2addr(L, fromidx); + to = index2addr(L, toidx); + api_checkvalidindex(to); setobj(L, to, fr); - if (idx < LUA_REGISTRYINDEX) /* function upvalue? */ + if (isupvalue(toidx)) /* function upvalue? */ luaC_barrier(L, clCvalue(L->ci->func), fr); /* LUA_REGISTRYINDEX does not need gc barrier (collector revisits it before finishing collection) */ -} - - -LUA_API void lua_replace (lua_State *L, int idx) { - lua_lock(L); - api_checknelems(L, 1); - moveto(L, L->top - 1, idx); - L->top--; - lua_unlock(L); -} - - -LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { - TValue *fr; - lua_lock(L); - fr = index2addr(L, fromidx); - moveto(L, fr, toidx); lua_unlock(L); } @@ -248,12 +249,13 @@ LUA_API void lua_pushvalue (lua_State *L, int idx) { LUA_API int lua_type (lua_State *L, int idx) { StkId o = index2addr(L, idx); - return (isvalid(o) ? ttypenv(o) : LUA_TNONE); + return (isvalid(o) ? ttnov(o) : LUA_TNONE); } LUA_API const char *lua_typename (lua_State *L, int t) { UNUSED(L); + api_check(LUA_TNONE <= t && t < LUA_NUMTAGS, "invalid tag"); return ttypename(t); } @@ -264,22 +266,28 @@ LUA_API int lua_iscfunction (lua_State *L, int idx) { } +LUA_API int lua_isinteger (lua_State *L, int idx) { + StkId o = index2addr(L, idx); + return ttisinteger(o); +} + + LUA_API int lua_isnumber (lua_State *L, int idx) { - TValue n; + lua_Number n; const TValue *o = index2addr(L, idx); return tonumber(o, &n); } LUA_API int lua_isstring (lua_State *L, int idx) { - int t = lua_type(L, idx); - return (t == LUA_TSTRING || t == LUA_TNUMBER); + const TValue *o = index2addr(L, idx); + return (ttisstring(o) || cvt2str(o)); } LUA_API int lua_isuserdata (lua_State *L, int idx) { const TValue *o = index2addr(L, idx); - return (ttisuserdata(o) || ttislightuserdata(o)); + return (ttisfulluserdata(o) || ttislightuserdata(o)); } @@ -291,24 +299,17 @@ LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { LUA_API void lua_arith (lua_State *L, int op) { - StkId o1; /* 1st operand */ - StkId o2; /* 2nd operand */ lua_lock(L); - if (op != LUA_OPUNM) /* all other operations expect two operands */ - api_checknelems(L, 2); - else { /* for unary minus, add fake 2nd operand */ + if (op != LUA_OPUNM && op != LUA_OPBNOT) + api_checknelems(L, 2); /* all other operations expect two operands */ + else { /* for unary operations, add fake 2nd operand */ api_checknelems(L, 1); setobjs2s(L, L->top, L->top - 1); L->top++; } - o1 = L->top - 2; - o2 = L->top - 1; - if (ttisnumber(o1) && ttisnumber(o2)) { - setnvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2))); - } - else - luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD)); - L->top--; + /* first operand at top - 2, second at top - 1; result go to top - 2 */ + luaO_arith(L, op, L->top - 2, L->top - 1, L->top - 2); + L->top--; /* remove second operand */ lua_unlock(L); } @@ -321,10 +322,10 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { o2 = index2addr(L, index2); if (isvalid(o1) && isvalid(o2)) { switch (op) { - case LUA_OPEQ: i = equalobj(L, o1, o2); break; + case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break; case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break; case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break; - default: api_check(L, 0, "invalid option"); + default: api_check(0, "invalid option"); } } lua_unlock(L); @@ -332,51 +333,33 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { } -LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum) { - TValue n; - const TValue *o = index2addr(L, idx); - if (tonumber(o, &n)) { - if (isnum) *isnum = 1; - return nvalue(o); - } - else { - if (isnum) *isnum = 0; - return 0; - } +LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) { + size_t sz = luaO_str2num(s, L->top); + if (sz != 0) + api_incr_top(L); + return sz; } -LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum) { - TValue n; +LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *pisnum) { + lua_Number n; const TValue *o = index2addr(L, idx); - if (tonumber(o, &n)) { - lua_Integer res; - lua_Number num = nvalue(o); - lua_number2integer(res, num); - if (isnum) *isnum = 1; - return res; - } - else { - if (isnum) *isnum = 0; - return 0; - } + int isnum = tonumber(o, &n); + if (!isnum) + n = 0; /* call to 'tonumber' may change 'n' even if it fails */ + if (pisnum) *pisnum = isnum; + return n; } -LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) { - TValue n; +LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *pisnum) { + lua_Integer res; const TValue *o = index2addr(L, idx); - if (tonumber(o, &n)) { - lua_Unsigned res; - lua_Number num = nvalue(o); - lua_number2unsigned(res, num); - if (isnum) *isnum = 1; - return res; - } - else { - if (isnum) *isnum = 0; - return 0; - } + int isnum = tointeger(o, &res); + if (!isnum) + res = 0; /* call to 'tointeger' may change 'n' even if it fails */ + if (pisnum) *pisnum = isnum; + return res; } @@ -389,14 +372,14 @@ LUA_API int lua_toboolean (lua_State *L, int idx) { LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { StkId o = index2addr(L, idx); if (!ttisstring(o)) { - lua_lock(L); /* `luaV_tostring' may create a new string */ - if (!luaV_tostring(L, o)) { /* conversion failed? */ + if (!cvt2str(o)) { /* not convertible? */ if (len != NULL) *len = 0; - lua_unlock(L); return NULL; } + lua_lock(L); /* 'luaO_tostring' may create a new string */ luaC_checkGC(L); o = index2addr(L, idx); /* previous call may reallocate the stack */ + luaO_tostring(L, o); lua_unlock(L); } if (len != NULL) *len = tsvalue(o)->len; @@ -406,7 +389,7 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { LUA_API size_t lua_rawlen (lua_State *L, int idx) { StkId o = index2addr(L, idx); - switch (ttypenv(o)) { + switch (ttnov(o)) { case LUA_TSTRING: return tsvalue(o)->len; case LUA_TUSERDATA: return uvalue(o)->len; case LUA_TTABLE: return luaH_getn(hvalue(o)); @@ -426,8 +409,8 @@ LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { LUA_API void *lua_touserdata (lua_State *L, int idx) { StkId o = index2addr(L, idx); - switch (ttypenv(o)) { - case LUA_TUSERDATA: return (rawuvalue(o) + 1); + switch (ttnov(o)) { + case LUA_TUSERDATA: return getudatamem(uvalue(o)); case LUA_TLIGHTUSERDATA: return pvalue(o); default: return NULL; } @@ -472,9 +455,7 @@ LUA_API void lua_pushnil (lua_State *L) { LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { lua_lock(L); - setnvalue(L->top, n); - luai_checknum(L, L->top, - luaG_runerror(L, "C API - attempt to push a signaling NaN")); + setfltvalue(L->top, n); api_incr_top(L); lua_unlock(L); } @@ -482,17 +463,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { lua_lock(L); - setnvalue(L->top, cast_num(n)); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushunsigned (lua_State *L, lua_Unsigned u) { - lua_Number n; - lua_lock(L); - n = lua_unsigned2number(u); - setnvalue(L->top, n); + setivalue(L->top, n); api_incr_top(L); lua_unlock(L); } @@ -558,15 +529,17 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { setfvalue(L->top, fn); } else { - Closure *cl; + CClosure *cl; api_checknelems(L, n); - api_check(L, n <= MAXUPVAL, "upvalue index too large"); + api_check(n <= MAXUPVAL, "upvalue index too large"); luaC_checkGC(L); cl = luaF_newCclosure(L, n); - cl->c.f = fn; + cl->f = fn; L->top -= n; - while (n--) - setobj2n(L, &cl->c.upvalue[n], L->top + n); + while (n--) { + setobj2n(L, &cl->upvalue[n], L->top + n); + /* does not need barrier because closure is white */ + } setclCvalue(L, L->top, cl); } api_incr_top(L); @@ -605,27 +578,29 @@ LUA_API int lua_pushthread (lua_State *L) { */ -LUA_API void lua_getglobal (lua_State *L, const char *var) { +LUA_API int lua_getglobal (lua_State *L, const char *name) { Table *reg = hvalue(&G(L)->l_registry); const TValue *gt; /* global table */ lua_lock(L); gt = luaH_getint(reg, LUA_RIDX_GLOBALS); - setsvalue2s(L, L->top++, luaS_new(L, var)); + setsvalue2s(L, L->top++, luaS_new(L, name)); luaV_gettable(L, gt, L->top - 1, L->top - 1); lua_unlock(L); + return ttnov(L->top - 1); } -LUA_API void lua_gettable (lua_State *L, int idx) { +LUA_API int lua_gettable (lua_State *L, int idx) { StkId t; lua_lock(L); t = index2addr(L, idx); luaV_gettable(L, t, L->top - 1, L->top - 1); lua_unlock(L); + return ttnov(L->top - 1); } -LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { +LUA_API int lua_getfield (lua_State *L, int idx, const char *k) { StkId t; lua_lock(L); t = index2addr(L, idx); @@ -633,40 +608,56 @@ LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { api_incr_top(L); luaV_gettable(L, t, L->top - 1, L->top - 1); lua_unlock(L); + return ttnov(L->top - 1); } -LUA_API void lua_rawget (lua_State *L, int idx) { +LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { StkId t; lua_lock(L); t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); + setivalue(L->top, n); + api_incr_top(L); + luaV_gettable(L, t, L->top - 1, L->top - 1); + lua_unlock(L); + return ttnov(L->top - 1); +} + + +LUA_API int lua_rawget (lua_State *L, int idx) { + StkId t; + lua_lock(L); + t = index2addr(L, idx); + api_check(ttistable(t), "table expected"); setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); lua_unlock(L); + return ttnov(L->top - 1); } -LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { +LUA_API int lua_rawgeti (lua_State *L, int idx, lua_Integer n) { StkId t; lua_lock(L); t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); + api_check(ttistable(t), "table expected"); setobj2s(L, L->top, luaH_getint(hvalue(t), n)); api_incr_top(L); lua_unlock(L); + return ttnov(L->top - 1); } -LUA_API void lua_rawgetp (lua_State *L, int idx, const void *p) { +LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) { StkId t; TValue k; lua_lock(L); t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); + api_check(ttistable(t), "table expected"); setpvalue(&k, cast(void *, p)); setobj2s(L, L->top, luaH_get(hvalue(t), &k)); api_incr_top(L); lua_unlock(L); + return ttnov(L->top - 1); } @@ -685,11 +676,11 @@ LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { LUA_API int lua_getmetatable (lua_State *L, int objindex) { const TValue *obj; - Table *mt = NULL; - int res; + Table *mt; + int res = 0; lua_lock(L); obj = index2addr(L, objindex); - switch (ttypenv(obj)) { + switch (ttnov(obj)) { case LUA_TTABLE: mt = hvalue(obj)->metatable; break; @@ -697,12 +688,10 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { mt = uvalue(obj)->metatable; break; default: - mt = G(L)->mt[ttypenv(obj)]; + mt = G(L)->mt[ttnov(obj)]; break; } - if (mt == NULL) - res = 0; - else { + if (mt != NULL) { sethvalue(L, L->top, mt); api_incr_top(L); res = 1; @@ -712,17 +701,15 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { } -LUA_API void lua_getuservalue (lua_State *L, int idx) { +LUA_API int lua_getuservalue (lua_State *L, int idx) { StkId o; lua_lock(L); o = index2addr(L, idx); - api_check(L, ttisuserdata(o), "userdata expected"); - if (uvalue(o)->env) { - sethvalue(L, L->top, uvalue(o)->env); - } else - setnilvalue(L->top); + api_check(ttisfulluserdata(o), "full userdata expected"); + getuservalue(L, uvalue(o), L->top); api_incr_top(L); lua_unlock(L); + return ttnov(L->top - 1); } @@ -731,13 +718,13 @@ LUA_API void lua_getuservalue (lua_State *L, int idx) { */ -LUA_API void lua_setglobal (lua_State *L, const char *var) { +LUA_API void lua_setglobal (lua_State *L, const char *name) { Table *reg = hvalue(&G(L)->l_registry); const TValue *gt; /* global table */ lua_lock(L); api_checknelems(L, 1); gt = luaH_getint(reg, LUA_RIDX_GLOBALS); - setsvalue2s(L, L->top++, luaS_new(L, var)); + setsvalue2s(L, L->top++, luaS_new(L, name)); luaV_settable(L, gt, L->top - 1, L->top - 2); L->top -= 2; /* pop value and key */ lua_unlock(L); @@ -767,43 +754,61 @@ LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { } -LUA_API void lua_rawset (lua_State *L, int idx) { +LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) { StkId t; lua_lock(L); - api_checknelems(L, 2); + api_checknelems(L, 1); t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); - setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); - invalidateTMcache(hvalue(t)); - luaC_barrierback(L, gcvalue(t), L->top-1); + setivalue(L->top++, n); + luaV_settable(L, t, L->top - 1, L->top - 2); + L->top -= 2; /* pop value and key */ + lua_unlock(L); +} + + +LUA_API void lua_rawset (lua_State *L, int idx) { + StkId o; + Table *t; + lua_lock(L); + api_checknelems(L, 2); + o = index2addr(L, idx); + api_check(ttistable(o), "table expected"); + t = hvalue(o); + setobj2t(L, luaH_set(L, t, L->top-2), L->top-1); + invalidateTMcache(t); + luaC_barrierback(L, t, L->top-1); L->top -= 2; lua_unlock(L); } -LUA_API void lua_rawseti (lua_State *L, int idx, int n) { - StkId t; +LUA_API void lua_rawseti (lua_State *L, int idx, lua_Integer n) { + StkId o; + Table *t; lua_lock(L); api_checknelems(L, 1); - t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); - luaH_setint(L, hvalue(t), n, L->top - 1); - luaC_barrierback(L, gcvalue(t), L->top-1); + o = index2addr(L, idx); + api_check(ttistable(o), "table expected"); + t = hvalue(o); + luaH_setint(L, t, n, L->top - 1); + luaC_barrierback(L, t, L->top-1); L->top--; lua_unlock(L); } LUA_API void lua_rawsetp (lua_State *L, int idx, const void *p) { - StkId t; + StkId o; + Table *t; TValue k; lua_lock(L); api_checknelems(L, 1); - t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); + o = index2addr(L, idx); + api_check(ttistable(o), "table expected"); + t = hvalue(o); setpvalue(&k, cast(void *, p)); - setobj2t(L, luaH_set(L, hvalue(t), &k), L->top - 1); - luaC_barrierback(L, gcvalue(t), L->top - 1); + setobj2t(L, luaH_set(L, t, &k), L->top - 1); + luaC_barrierback(L, t, L->top - 1); L->top--; lua_unlock(L); } @@ -818,14 +823,14 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { if (ttisnil(L->top - 1)) mt = NULL; else { - api_check(L, ttistable(L->top - 1), "table expected"); + api_check(ttistable(L->top - 1), "table expected"); mt = hvalue(L->top - 1); } - switch (ttypenv(obj)) { + switch (ttnov(obj)) { case LUA_TTABLE: { hvalue(obj)->metatable = mt; if (mt) { - luaC_objbarrierback(L, gcvalue(obj), mt); + luaC_objbarrier(L, gcvalue(obj), mt); luaC_checkfinalizer(L, gcvalue(obj), mt); } break; @@ -833,13 +838,13 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { case LUA_TUSERDATA: { uvalue(obj)->metatable = mt; if (mt) { - luaC_objbarrier(L, rawuvalue(obj), mt); + luaC_objbarrier(L, uvalue(obj), mt); luaC_checkfinalizer(L, gcvalue(obj), mt); } break; } default: { - G(L)->mt[ttypenv(obj)] = mt; + G(L)->mt[ttnov(obj)] = mt; break; } } @@ -854,46 +859,32 @@ LUA_API void lua_setuservalue (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 1); o = index2addr(L, idx); - api_check(L, ttisuserdata(o), "userdata expected"); - if (ttisnil(L->top - 1)) - uvalue(o)->env = NULL; - else { - api_check(L, ttistable(L->top - 1), "table expected"); - uvalue(o)->env = hvalue(L->top - 1); - luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); - } + api_check(ttisfulluserdata(o), "full userdata expected"); + setuservalue(L, uvalue(o), L->top - 1); + luaC_barrier(L, gcvalue(o), L->top - 1); L->top--; lua_unlock(L); } /* -** `load' and `call' functions (run Lua code) +** 'load' and 'call' functions (run Lua code) */ #define checkresults(L,na,nr) \ - api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \ + api_check((nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \ "results from function overflow current stack size") -LUA_API int lua_getctx (lua_State *L, int *ctx) { - if (L->ci->callstatus & CIST_YIELDED) { - if (ctx) *ctx = L->ci->u.c.ctx; - return L->ci->u.c.status; - } - else return LUA_OK; -} - - -LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, - lua_CFunction k) { +LUA_API void lua_callk (lua_State *L, int nargs, int nresults, + lua_KContext ctx, lua_KFunction k) { StkId func; lua_lock(L); - api_check(L, k == NULL || !isLua(L->ci), + api_check(k == NULL || !isLua(L->ci), "cannot use continuations inside hooks"); api_checknelems(L, nargs+1); - api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); + api_check(L->status == LUA_OK, "cannot do calls on non-normal thread"); checkresults(L, nargs, nresults); func = L->top - (nargs+1); if (k != NULL && L->nny == 0) { /* need to prepare continuation? */ @@ -912,7 +903,7 @@ LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, /* ** Execute a protected call. */ -struct CallS { /* data to `f_call' */ +struct CallS { /* data to 'f_call' */ StkId func; int nresults; }; @@ -926,21 +917,21 @@ static void f_call (lua_State *L, void *ud) { LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, - int ctx, lua_CFunction k) { + lua_KContext ctx, lua_KFunction k) { struct CallS c; int status; ptrdiff_t func; lua_lock(L); - api_check(L, k == NULL || !isLua(L->ci), + api_check(k == NULL || !isLua(L->ci), "cannot use continuations inside hooks"); api_checknelems(L, nargs+1); - api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); + api_check(L->status == LUA_OK, "cannot do calls on non-normal thread"); checkresults(L, nargs, nresults); if (errfunc == 0) func = 0; else { StkId o = index2addr(L, errfunc); - api_checkstackindex(L, errfunc, o); + api_checkstackindex(errfunc, o); func = savestack(L, o); } c.func = L->top - (nargs+1); /* function to be called */ @@ -954,11 +945,10 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, ci->u.c.ctx = ctx; /* save context */ /* save information for error recovery */ ci->extra = savestack(L, c.func); - ci->u.c.old_allowhook = L->allowhook; ci->u.c.old_errfunc = L->errfunc; L->errfunc = func; - /* mark that function may do error recovery */ - ci->callstatus |= CIST_YPCALL; + setoah(ci->callstatus, L->allowhook); /* save value of 'allowhook' */ + ci->callstatus |= CIST_YPCALL; /* function can do error recovery */ luaD_call(L, c.func, nresults, 1); /* do the call */ ci->callstatus &= ~CIST_YPCALL; L->errfunc = ci->u.c.old_errfunc; @@ -980,13 +970,13 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, status = luaD_protectedparser(L, &z, chunkname, mode); if (status == LUA_OK) { /* no errors? */ LClosure *f = clLvalue(L->top - 1); /* get newly created function */ - if (f->nupvalues == 1) { /* does it have one upvalue? */ + if (f->nupvalues >= 1) { /* does it have an upvalue? */ /* get global table from registry */ Table *reg = hvalue(&G(L)->l_registry); const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS); /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */ setobj(L, f->upvals[0]->v, gt); - luaC_barrier(L, f->upvals[0], gt); + luaC_upvalbarrier(L, f->upvals[0]); } } lua_unlock(L); @@ -994,14 +984,14 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, } -LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { +LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) { int status; TValue *o; lua_lock(L); api_checknelems(L, 1); o = L->top - 1; if (isLfunction(o)) - status = luaU_dump(L, getproto(o), writer, data, 0); + status = luaU_dump(L, getproto(o), writer, data, strip); else status = 1; lua_unlock(L); @@ -1047,19 +1037,21 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { break; } case LUA_GCSTEP: { - if (g->gckind == KGC_GEN) { /* generational mode? */ - res = (g->GCestimate == 0); /* true if it will do major collection */ - luaC_forcestep(L); /* do a single step */ + l_mem debt = 1; /* =1 to signal that it did an actual step */ + int oldrunning = g->gcrunning; + g->gcrunning = 1; /* allow GC to run */ + if (data == 0) { + luaE_setdebt(g, -GCSTEPSIZE); /* to do a "small" step */ + luaC_step(L); } - else { - lu_mem debt = cast(lu_mem, data) * 1024 - GCSTEPSIZE; - if (g->gcrunning) - debt += g->GCdebt; /* include current debt */ - luaE_setdebt(g, debt); - luaC_forcestep(L); - if (g->gcstate == GCSpause) /* end of cycle? */ - res = 1; /* signal it */ + else { /* add 'data' to total debt */ + debt = cast(l_mem, data) * 1024 + g->GCdebt; + luaE_setdebt(g, debt); + luaC_checkGC(L); } + g->gcrunning = oldrunning; /* restore previous state */ + if (debt > 0 && g->gcstate == GCSpause) /* end of cycle? */ + res = 1; /* signal it */ break; } case LUA_GCSETPAUSE: { @@ -1067,13 +1059,9 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { g->gcpause = data; break; } - case LUA_GCSETMAJORINC: { - res = g->gcmajorinc; - g->gcmajorinc = data; - break; - } case LUA_GCSETSTEPMUL: { res = g->gcstepmul; + if (data < 40) data = 40; /* avoid ridiculous low values (and 0) */ g->gcstepmul = data; break; } @@ -1081,14 +1069,6 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { res = g->gcrunning; break; } - case LUA_GCGEN: { /* change collector to generational mode */ - luaC_changemode(L, KGC_GEN); - break; - } - case LUA_GCINC: { /* change collector to incremental mode */ - luaC_changemode(L, KGC_NORMAL); - break; - } default: res = -1; /* invalid option */ } lua_unlock(L); @@ -1116,7 +1096,7 @@ LUA_API int lua_next (lua_State *L, int idx) { int more; lua_lock(L); t = index2addr(L, idx); - api_check(L, ttistable(t), "table expected"); + api_check(ttistable(t), "table expected"); more = luaH_next(L, hvalue(t), L->top - 1); if (more) { api_incr_top(L); @@ -1176,23 +1156,23 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size) { Udata *u; lua_lock(L); luaC_checkGC(L); - u = luaS_newudata(L, size, NULL); + u = luaS_newudata(L, size); setuvalue(L, L->top, u); api_incr_top(L); lua_unlock(L); - return u + 1; + return getudatamem(u); } static const char *aux_upvalue (StkId fi, int n, TValue **val, - GCObject **owner) { + CClosure **owner, UpVal **uv) { switch (ttype(fi)) { case LUA_TCCL: { /* C closure */ CClosure *f = clCvalue(fi); if (!(1 <= n && n <= f->nupvalues)) return NULL; *val = &f->upvalue[n-1]; - if (owner) *owner = obj2gco(f); + if (owner) *owner = f; return ""; } case LUA_TLCL: { /* Lua closure */ @@ -1201,9 +1181,9 @@ static const char *aux_upvalue (StkId fi, int n, TValue **val, Proto *p = f->p; if (!(1 <= n && n <= p->sizeupvalues)) return NULL; *val = f->upvals[n-1]->v; - if (owner) *owner = obj2gco(f->upvals[n - 1]); + if (uv) *uv = f->upvals[n - 1]; name = p->upvalues[n-1].name; - return (name == NULL) ? "" : getstr(name); + return (name == NULL) ? "(*no name)" : getstr(name); } default: return NULL; /* not a closure */ } @@ -1214,7 +1194,7 @@ LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { const char *name; TValue *val = NULL; /* to avoid warnings */ lua_lock(L); - name = aux_upvalue(index2addr(L, funcindex), n, &val, NULL); + name = aux_upvalue(index2addr(L, funcindex), n, &val, NULL, NULL); if (name) { setobj2s(L, L->top, val); api_incr_top(L); @@ -1227,16 +1207,18 @@ LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { const char *name; TValue *val = NULL; /* to avoid warnings */ - GCObject *owner = NULL; /* to avoid warnings */ + CClosure *owner = NULL; + UpVal *uv = NULL; StkId fi; lua_lock(L); fi = index2addr(L, funcindex); api_checknelems(L, 1); - name = aux_upvalue(fi, n, &val, &owner); + name = aux_upvalue(fi, n, &val, &owner, &uv); if (name) { L->top--; setobj(L, val, L->top); - luaC_barrier(L, owner, L->top); + if (owner) { luaC_barrier(L, owner, L->top); } + else if (uv) { luaC_upvalbarrier(L, uv); } } lua_unlock(L); return name; @@ -1246,9 +1228,9 @@ LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { LClosure *f; StkId fi = index2addr(L, fidx); - api_check(L, ttisLclosure(fi), "Lua function expected"); + api_check(ttisLclosure(fi), "Lua function expected"); f = clLvalue(fi); - api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); + api_check((1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); if (pf) *pf = f; return &f->upvals[n - 1]; /* get its upvalue pointer */ } @@ -1262,11 +1244,11 @@ LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) { } case LUA_TCCL: { /* C closure */ CClosure *f = clCvalue(fi); - api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index"); + api_check(1 <= n && n <= f->nupvalues, "invalid upvalue index"); return &f->upvalue[n - 1]; } default: { - api_check(L, 0, "closure expected"); + api_check(0, "closure expected"); return NULL; } } @@ -1278,7 +1260,11 @@ LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1, LClosure *f1; UpVal **up1 = getupvalref(L, fidx1, n1, &f1); UpVal **up2 = getupvalref(L, fidx2, n2, NULL); + luaC_upvdeccount(L, *up1); *up1 = *up2; - luaC_objbarrier(L, f1, *up2); + (*up1)->refcount++; + if (upisopen(*up1)) (*up1)->u.open.touched = 1; + luaC_upvalbarrier(L, *up1); } + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lapi.h b/3rdparty/genie/src/host/lua-5.3.0/src/lapi.h index c7d34ad8486..092f5e974cb 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lapi.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lapi.h @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lapi.h,v 2.8 2014/07/15 21:26:50 roberto Exp $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ @@ -11,13 +11,13 @@ #include "llimits.h" #include "lstate.h" -#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ +#define api_incr_top(L) {L->top++; api_check(L->top <= L->ci->top, \ "stack overflow");} #define adjustresults(L,nres) \ { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } -#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ +#define api_checknelems(L,n) api_check((n) < (L->top - L->ci->func), \ "not enough elements in the stack") diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lauxlib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lauxlib.c index b00f8c70968..1c41d6a8eaf 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lauxlib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lauxlib.c @@ -1,9 +1,14 @@ /* -** $Id: lauxlib.c,v 1.248.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lauxlib.c,v 1.279 2014/12/14 18:32:26 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ +#define lauxlib_c +#define LUA_LIB + +#include "lprefix.h" + #include <errno.h> #include <stdarg.h> @@ -16,9 +21,6 @@ ** Any function declared here could be written as an application function. */ -#define lauxlib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" @@ -64,11 +66,20 @@ static int findfield (lua_State *L, int objidx, int level) { } +/* +** Search for a name for a function in all loaded modules +** (registry._LOADED). +*/ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { int top = lua_gettop(L); lua_getinfo(L, "f", ar); /* push function */ - lua_pushglobaltable(L); + lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); if (findfield(L, top + 1, 2)) { + const char *name = lua_tostring(L, -1); + if (strncmp(name, "_G.", 3) == 0) { /* name start with '_G.'? */ + lua_pushstring(L, name + 3); /* push name without prefix */ + lua_remove(L, -2); /* remove original name */ + } lua_copy(L, -1, top + 1); /* move name to proper place */ lua_pop(L, 2); /* remove pushed values */ return 1; @@ -81,20 +92,18 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { static void pushfuncname (lua_State *L, lua_Debug *ar) { - if (*ar->namewhat != '\0') /* is there a name? */ - lua_pushfstring(L, "function " LUA_QS, ar->name); + if (pushglobalfuncname(L, ar)) { /* try first a global name */ + lua_pushfstring(L, "function '%s'", lua_tostring(L, -1)); + lua_remove(L, -2); /* remove name */ + } + else if (*ar->namewhat != '\0') /* is there a name from code? */ + lua_pushfstring(L, "%s '%s'", ar->namewhat, ar->name); /* use it */ else if (*ar->what == 'm') /* main? */ lua_pushliteral(L, "main chunk"); - else if (*ar->what == 'C') { - if (pushglobalfuncname(L, ar)) { - lua_pushfstring(L, "function " LUA_QS, lua_tostring(L, -1)); - lua_remove(L, -2); /* remove name */ - } - else - lua_pushliteral(L, "?"); - } - else + else if (*ar->what != 'C') /* for Lua functions, use <file:line> */ lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined); + else /* nothing left... */ + lua_pushliteral(L, "?"); } @@ -150,33 +159,40 @@ LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, ** ======================================================= */ -LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { +LUALIB_API int luaL_argerror (lua_State *L, int arg, const char *extramsg) { lua_Debug ar; if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ - return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); + return luaL_error(L, "bad argument #%d (%s)", arg, extramsg); lua_getinfo(L, "n", &ar); if (strcmp(ar.namewhat, "method") == 0) { - narg--; /* do not count `self' */ - if (narg == 0) /* error is in the self argument itself? */ - return luaL_error(L, "calling " LUA_QS " on bad self (%s)", + arg--; /* do not count 'self' */ + if (arg == 0) /* error is in the self argument itself? */ + return luaL_error(L, "calling '%s' on bad self (%s)", ar.name, extramsg); } if (ar.name == NULL) ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?"; - return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", - narg, ar.name, extramsg); + return luaL_error(L, "bad argument #%d to '%s' (%s)", + arg, ar.name, extramsg); } -static int typeerror (lua_State *L, int narg, const char *tname) { - const char *msg = lua_pushfstring(L, "%s expected, got %s", - tname, luaL_typename(L, narg)); - return luaL_argerror(L, narg, msg); +static int typeerror (lua_State *L, int arg, const char *tname) { + const char *msg; + const char *typearg; /* name for the type of the actual argument */ + if (luaL_getmetafield(L, arg, "__name") == LUA_TSTRING) + typearg = lua_tostring(L, -1); /* use the given type name */ + else if (lua_type(L, arg) == LUA_TLIGHTUSERDATA) + typearg = "light userdata"; /* special name for messages */ + else + typearg = luaL_typename(L, arg); /* standard name */ + msg = lua_pushfstring(L, "%s expected, got %s", tname, typearg); + return luaL_argerror(L, arg, msg); } -static void tag_error (lua_State *L, int narg, int tag) { - typeerror(L, narg, lua_typename(L, tag)); +static void tag_error (lua_State *L, int arg, int tag) { + typeerror(L, arg, lua_typename(L, tag)); } @@ -222,7 +238,7 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { } -#if !defined(inspectstat) /* { */ +#if !defined(l_inspectstat) /* { */ #if defined(LUA_USE_POSIX) @@ -231,13 +247,13 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { /* ** use appropriate macros to interpret 'pclose' return status */ -#define inspectstat(stat,what) \ +#define l_inspectstat(stat,what) \ if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \ else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; } #else -#define inspectstat(stat,what) /* no op */ +#define l_inspectstat(stat,what) /* no op */ #endif @@ -249,7 +265,7 @@ LUALIB_API int luaL_execresult (lua_State *L, int stat) { if (stat == -1) /* error? */ return luaL_fileresult(L, 0, NULL); else { - inspectstat(stat, what); /* interpret result */ + l_inspectstat(stat, what); /* interpret result */ if (*what == 'e' && stat == 0) /* successful termination? */ lua_pushboolean(L, 1); else @@ -270,11 +286,12 @@ LUALIB_API int luaL_execresult (lua_State *L, int stat) { */ LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { - luaL_getmetatable(L, tname); /* try to get metatable */ - if (!lua_isnil(L, -1)) /* name already in use? */ + if (luaL_getmetatable(L, tname)) /* name already in use? */ return 0; /* leave previous value on top, but return 0 */ lua_pop(L, 1); lua_newtable(L); /* create metatable */ + lua_pushstring(L, tname); + lua_setfield(L, -2, "__name"); /* metatable.__name = tname */ lua_pushvalue(L, -1); lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ return 1; @@ -317,16 +334,16 @@ LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { ** ======================================================= */ -LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, +LUALIB_API int luaL_checkoption (lua_State *L, int arg, const char *def, const char *const lst[]) { - const char *name = (def) ? luaL_optstring(L, narg, def) : - luaL_checkstring(L, narg); + const char *name = (def) ? luaL_optstring(L, arg, def) : + luaL_checkstring(L, arg); int i; for (i=0; lst[i]; i++) if (strcmp(lst[i], name) == 0) return i; - return luaL_argerror(L, narg, - lua_pushfstring(L, "invalid option " LUA_QS, name)); + return luaL_argerror(L, arg, + lua_pushfstring(L, "invalid option '%s'", name)); } @@ -342,77 +359,71 @@ LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) { } -LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { - if (lua_type(L, narg) != t) - tag_error(L, narg, t); +LUALIB_API void luaL_checktype (lua_State *L, int arg, int t) { + if (lua_type(L, arg) != t) + tag_error(L, arg, t); } -LUALIB_API void luaL_checkany (lua_State *L, int narg) { - if (lua_type(L, narg) == LUA_TNONE) - luaL_argerror(L, narg, "value expected"); +LUALIB_API void luaL_checkany (lua_State *L, int arg) { + if (lua_type(L, arg) == LUA_TNONE) + luaL_argerror(L, arg, "value expected"); } -LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { - const char *s = lua_tolstring(L, narg, len); - if (!s) tag_error(L, narg, LUA_TSTRING); +LUALIB_API const char *luaL_checklstring (lua_State *L, int arg, size_t *len) { + const char *s = lua_tolstring(L, arg, len); + if (!s) tag_error(L, arg, LUA_TSTRING); return s; } -LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, +LUALIB_API const char *luaL_optlstring (lua_State *L, int arg, const char *def, size_t *len) { - if (lua_isnoneornil(L, narg)) { + if (lua_isnoneornil(L, arg)) { if (len) *len = (def ? strlen(def) : 0); return def; } - else return luaL_checklstring(L, narg, len); + else return luaL_checklstring(L, arg, len); } -LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { +LUALIB_API lua_Number luaL_checknumber (lua_State *L, int arg) { int isnum; - lua_Number d = lua_tonumberx(L, narg, &isnum); + lua_Number d = lua_tonumberx(L, arg, &isnum); if (!isnum) - tag_error(L, narg, LUA_TNUMBER); + tag_error(L, arg, LUA_TNUMBER); return d; } -LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { - return luaL_opt(L, luaL_checknumber, narg, def); +LUALIB_API lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number def) { + return luaL_opt(L, luaL_checknumber, arg, def); } -LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { - int isnum; - lua_Integer d = lua_tointegerx(L, narg, &isnum); - if (!isnum) - tag_error(L, narg, LUA_TNUMBER); - return d; +static void interror (lua_State *L, int arg) { + if (lua_isnumber(L, arg)) + luaL_argerror(L, arg, "number has no integer representation"); + else + tag_error(L, arg, LUA_TNUMBER); } -LUALIB_API lua_Unsigned luaL_checkunsigned (lua_State *L, int narg) { +LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int arg) { int isnum; - lua_Unsigned d = lua_tounsignedx(L, narg, &isnum); - if (!isnum) - tag_error(L, narg, LUA_TNUMBER); + lua_Integer d = lua_tointegerx(L, arg, &isnum); + if (!isnum) { + interror(L, arg); + } return d; } -LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, +LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int arg, lua_Integer def) { - return luaL_opt(L, luaL_checkinteger, narg, def); -} - - -LUALIB_API lua_Unsigned luaL_optunsigned (lua_State *L, int narg, - lua_Unsigned def) { - return luaL_opt(L, luaL_checkunsigned, narg, def); + return luaL_opt(L, luaL_checkinteger, arg, def); } /* }====================================================== */ @@ -523,7 +534,7 @@ LUALIB_API int luaL_ref (lua_State *L, int t) { int ref; if (lua_isnil(L, -1)) { lua_pop(L, 1); /* remove from stack */ - return LUA_REFNIL; /* `nil' has a unique fixed reference */ + return LUA_REFNIL; /* 'nil' has a unique fixed reference */ } t = lua_absindex(L, t); lua_rawgeti(L, t, freelist); /* get first free element */ @@ -562,7 +573,7 @@ LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { typedef struct LoadF { int n; /* number of pre-read characters */ FILE *f; /* file being read */ - char buff[LUAL_BUFFERSIZE]; /* area for reading file */ + char buff[BUFSIZ]; /* area for reading file */ } LoadF; @@ -655,7 +666,7 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, readstatus = ferror(lf.f); if (filename) fclose(lf.f); /* close file (even in case of errors) */ if (readstatus) { - lua_settop(L, fnameindex); /* ignore results from `lua_load' */ + lua_settop(L, fnameindex); /* ignore results from 'lua_load' */ return errfile(L, "read", fnameindex); } lua_remove(L, fnameindex); @@ -698,23 +709,23 @@ LUALIB_API int luaL_loadstring (lua_State *L, const char *s) { LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { if (!lua_getmetatable(L, obj)) /* no metatable? */ - return 0; - lua_pushstring(L, event); - lua_rawget(L, -2); - if (lua_isnil(L, -1)) { - lua_pop(L, 2); /* remove metatable and metafield */ - return 0; - } + return LUA_TNIL; else { - lua_remove(L, -2); /* remove only metatable */ - return 1; + int tt; + lua_pushstring(L, event); + tt = lua_rawget(L, -2); + if (tt == LUA_TNIL) /* is metafield nil? */ + lua_pop(L, 2); /* remove metatable and metafield */ + else + lua_remove(L, -2); /* remove only metatable */ + return tt; /* return metafield type */ } } LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { obj = lua_absindex(L, obj); - if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ + if (luaL_getmetafield(L, obj, event) == LUA_TNIL) /* no metafield? */ return 0; lua_pushvalue(L, obj); lua_call(L, 1, 1); @@ -722,13 +733,13 @@ LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { } -LUALIB_API int luaL_len (lua_State *L, int idx) { - int l; +LUALIB_API lua_Integer luaL_len (lua_State *L, int idx) { + lua_Integer l; int isnum; lua_len(L, idx); - l = (int)lua_tointegerx(L, -1, &isnum); + l = lua_tointegerx(L, -1, &isnum); if (!isnum) - luaL_error(L, "object length is not a number"); + luaL_error(L, "object length is not an integer"); lua_pop(L, 1); /* remove object */ return l; } @@ -737,7 +748,13 @@ LUALIB_API int luaL_len (lua_State *L, int idx) { LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { if (!luaL_callmeta(L, idx, "__tostring")) { /* no metafield? */ switch (lua_type(L, idx)) { - case LUA_TNUMBER: + case LUA_TNUMBER: { + if (lua_isinteger(L, idx)) + lua_pushfstring(L, "%I", lua_tointeger(L, idx)); + else + lua_pushfstring(L, "%f", lua_tonumber(L, idx)); + break; + } case LUA_TSTRING: lua_pushvalue(L, idx); break; @@ -772,8 +789,7 @@ static const char *luaL_findtable (lua_State *L, int idx, e = strchr(fname, '.'); if (e == NULL) e = fname + strlen(fname); lua_pushlstring(L, fname, e - fname); - lua_rawget(L, -2); - if (lua_isnil(L, -1)) { /* no such field? */ + if (lua_rawget(L, -2) == LUA_TNIL) { /* no such field? */ lua_pop(L, 1); /* remove this nil */ lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ lua_pushlstring(L, fname, e - fname); @@ -810,13 +826,12 @@ static int libsize (const luaL_Reg *l) { LUALIB_API void luaL_pushmodule (lua_State *L, const char *modname, int sizehint) { luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); /* get _LOADED table */ - lua_getfield(L, -1, modname); /* get _LOADED[modname] */ - if (!lua_istable(L, -1)) { /* not found? */ + if (lua_getfield(L, -1, modname) != LUA_TTABLE) { /* no _LOADED[modname]? */ lua_pop(L, 1); /* remove previous result */ /* try global variable (and create one if it does not exist) */ lua_pushglobaltable(L); if (luaL_findtable(L, 0, modname, sizehint) != NULL) - luaL_error(L, "name conflict for module " LUA_QS, modname); + luaL_error(L, "name conflict for module '%s'", modname); lua_pushvalue(L, -1); lua_setfield(L, -3, modname); /* _LOADED[modname] = new table */ } @@ -846,7 +861,6 @@ LUALIB_API void luaL_openlib (lua_State *L, const char *libname, ** Returns with only the table at the stack. */ LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { - luaL_checkversion(L); luaL_checkstack(L, nup, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ int i; @@ -864,8 +878,8 @@ LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { ** into the stack */ LUALIB_API int luaL_getsubtable (lua_State *L, int idx, const char *fname) { - lua_getfield(L, idx, fname); - if (lua_istable(L, -1)) return 1; /* table already there */ + if (lua_getfield(L, idx, fname) == LUA_TTABLE) + return 1; /* table already there */ else { lua_pop(L, 1); /* remove previous result */ idx = lua_absindex(L, idx); @@ -878,22 +892,26 @@ LUALIB_API int luaL_getsubtable (lua_State *L, int idx, const char *fname) { /* -** stripped-down 'require'. Calls 'openf' to open a module, -** registers the result in 'package.loaded' table and, if 'glb' -** is true, also registers the result in the global table. +** Stripped-down 'require': After checking "loaded" table, calls 'openf' +** to open a module, registers the result in 'package.loaded' table and, +** if 'glb' is true, also registers the result in the global table. ** Leaves resulting module on the top. */ LUALIB_API void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb) { - lua_pushcfunction(L, openf); - lua_pushstring(L, modname); /* argument to open function */ - lua_call(L, 1, 1); /* open module */ luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_pushvalue(L, -2); /* make copy of module (call result) */ - lua_setfield(L, -2, modname); /* _LOADED[modname] = module */ - lua_pop(L, 1); /* remove _LOADED table */ + lua_getfield(L, -1, modname); /* _LOADED[modname] */ + if (!lua_toboolean(L, -1)) { /* package not already loaded? */ + lua_pop(L, 1); /* remove field */ + lua_pushcfunction(L, openf); + lua_pushstring(L, modname); /* argument to open function */ + lua_call(L, 1, 1); /* call 'openf' to open module */ + lua_pushvalue(L, -1); /* make copy of module (call result) */ + lua_setfield(L, -3, modname); /* _LOADED[modname] = module */ + } + lua_remove(L, -2); /* remove _LOADED table */ if (glb) { - lua_pushvalue(L, -1); /* copy of 'mod' */ + lua_pushvalue(L, -1); /* copy of module */ lua_setglobal(L, modname); /* _G[modname] = module */ } } @@ -908,7 +926,7 @@ LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, while ((wild = strstr(s, p)) != NULL) { luaL_addlstring(&b, s, wild - s); /* push prefix */ luaL_addstring(&b, r); /* push replacement in place of pattern */ - s = wild + l; /* continue after `p' */ + s = wild + l; /* continue after 'p' */ } luaL_addstring(&b, s); /* push last suffix */ luaL_pushresult(&b); @@ -928,8 +946,8 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { static int panic (lua_State *L) { - luai_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", - lua_tostring(L, -1)); + lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", + lua_tostring(L, -1)); return 0; /* return to Lua to abort */ } @@ -941,19 +959,14 @@ LUALIB_API lua_State *luaL_newstate (void) { } -LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { +LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { const lua_Number *v = lua_version(L); + if (sz != LUAL_NUMSIZES) /* check numeric types */ + luaL_error(L, "core and library have incompatible numeric types"); if (v != lua_version(NULL)) luaL_error(L, "multiple Lua VMs detected"); else if (*v != ver) luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", ver, *v); - /* check conversions number -> integer types */ - lua_pushnumber(L, -(lua_Number)0x1234); - if (lua_tointeger(L, -1) != -0x1234 || - lua_tounsigned(L, -1) != (lua_Unsigned)-0x1234) - luaL_error(L, "bad conversion number->int;" - " must recompile Lua with proper settings"); - lua_pop(L, 1); } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lauxlib.h b/3rdparty/genie/src/host/lua-5.3.0/src/lauxlib.h index 0fb023b8e73..0bac2467ec6 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lauxlib.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lauxlib.h @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.120.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lauxlib.h,v 1.128 2014/10/29 16:11:17 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -16,7 +16,7 @@ -/* extra error code for `luaL_load' */ +/* extra error code for 'luaL_load' */ #define LUA_ERRFILE (LUA_ERRERR+1) @@ -26,30 +26,30 @@ typedef struct luaL_Reg { } luaL_Reg; -LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver); -#define luaL_checkversion(L) luaL_checkversion_(L, LUA_VERSION_NUM) +#define LUAL_NUMSIZES (sizeof(lua_Integer)*16 + sizeof(lua_Number)) + +LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver, size_t sz); +#define luaL_checkversion(L) \ + luaL_checkversion_(L, LUA_VERSION_NUM, LUAL_NUMSIZES) LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len); -LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); -LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, +LUALIB_API int (luaL_argerror) (lua_State *L, int arg, const char *extramsg); +LUALIB_API const char *(luaL_checklstring) (lua_State *L, int arg, size_t *l); -LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, +LUALIB_API const char *(luaL_optlstring) (lua_State *L, int arg, const char *def, size_t *l); -LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); -LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); +LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int arg); +LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int arg, lua_Number def); -LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); -LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, +LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int arg); +LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int arg, lua_Integer def); -LUALIB_API lua_Unsigned (luaL_checkunsigned) (lua_State *L, int numArg); -LUALIB_API lua_Unsigned (luaL_optunsigned) (lua_State *L, int numArg, - lua_Unsigned def); LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); -LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); -LUALIB_API void (luaL_checkany) (lua_State *L, int narg); +LUALIB_API void (luaL_checktype) (lua_State *L, int arg, int t); +LUALIB_API void (luaL_checkany) (lua_State *L, int arg); LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname); @@ -59,7 +59,7 @@ LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); LUALIB_API void (luaL_where) (lua_State *L, int lvl); LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); -LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, +LUALIB_API int (luaL_checkoption) (lua_State *L, int arg, const char *def, const char *const lst[]); LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname); @@ -83,7 +83,7 @@ LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); LUALIB_API lua_State *(luaL_newstate) (void); -LUALIB_API int (luaL_len) (lua_State *L, int idx); +LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx); LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, const char *r); @@ -108,16 +108,13 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, #define luaL_newlibtable(L,l) \ lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1) -#define luaL_newlib(L,l) (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) +#define luaL_newlib(L,l) \ + (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) -#define luaL_argcheck(L, cond,numarg,extramsg) \ - ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) +#define luaL_argcheck(L, cond,arg,extramsg) \ + ((void)((cond) || luaL_argerror(L, (arg), (extramsg)))) #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) -#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) -#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) -#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) -#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) #define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) @@ -207,6 +204,53 @@ LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, #endif +/* +** {================================================================== +** "Abstraction Layer" for basic report of messages and errors +** =================================================================== +*/ + +/* print a string */ +#if !defined(lua_writestring) +#define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) +#endif + +/* print a newline and flush the output */ +#if !defined(lua_writeline) +#define lua_writeline() (lua_writestring("\n", 1), fflush(stdout)) +#endif + +/* print an error message */ +#if !defined(lua_writestringerror) +#define lua_writestringerror(s,p) \ + (fprintf(stderr, (s), (p)), fflush(stderr)) +#endif + +/* }================================================================== */ + + +/* +** {============================================================ +** Compatibility with deprecated conversions +** ============================================================= +*/ +#if defined(LUA_COMPAT_APIINTCASTS) + +#define luaL_checkunsigned(L,a) ((lua_Unsigned)luaL_checkinteger(L,a)) +#define luaL_optunsigned(L,a,d) \ + ((lua_Unsigned)luaL_optinteger(L,a,(lua_Integer)(d))) + +#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) +#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) + +#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) +#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) + +#endif +/* }============================================================ */ + + + #endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lbaselib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lbaselib.c index 5255b3cd9b7..a2403952f02 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lbaselib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lbaselib.c @@ -1,9 +1,13 @@ /* -** $Id: lbaselib.c,v 1.276.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lbaselib.c,v 1.309 2014/12/10 12:26:42 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ +#define lbaselib_c +#define LUA_LIB + +#include "lprefix.h" #include <ctype.h> @@ -11,9 +15,6 @@ #include <stdlib.h> #include <string.h> -#define lbaselib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" @@ -32,62 +33,74 @@ static int luaB_print (lua_State *L) { lua_call(L, 1, 1); s = lua_tolstring(L, -1, &l); /* get result */ if (s == NULL) - return luaL_error(L, - LUA_QL("tostring") " must return a string to " LUA_QL("print")); - if (i>1) luai_writestring("\t", 1); - luai_writestring(s, l); + return luaL_error(L, "'tostring' must return a string to 'print'"); + if (i>1) lua_writestring("\t", 1); + lua_writestring(s, l); lua_pop(L, 1); /* pop result */ } - luai_writeline(); + lua_writeline(); return 0; } #define SPACECHARS " \f\n\r\t\v" +static const char *b_str2int (const char *s, int base, lua_Integer *pn) { + lua_Unsigned n = 0; + int neg = 0; + s += strspn(s, SPACECHARS); /* skip initial spaces */ + if (*s == '-') { s++; neg = 1; } /* handle signal */ + else if (*s == '+') s++; + if (!isalnum((unsigned char)*s)) /* no digit? */ + return NULL; + do { + int digit = (isdigit((unsigned char)*s)) ? *s - '0' + : toupper((unsigned char)*s) - 'A' + 10; + if (digit >= base) return NULL; /* invalid numeral */ + n = n * base + digit; + s++; + } while (isalnum((unsigned char)*s)); + s += strspn(s, SPACECHARS); /* skip trailing spaces */ + *pn = (lua_Integer)((neg) ? (0u - n) : n); + return s; +} + + static int luaB_tonumber (lua_State *L) { - if (lua_isnoneornil(L, 2)) { /* standard conversion */ - int isnum; - lua_Number n = lua_tonumberx(L, 1, &isnum); - if (isnum) { - lua_pushnumber(L, n); - return 1; - } /* else not a number; must be something */ + if (lua_isnoneornil(L, 2)) { /* standard conversion? */ luaL_checkany(L, 1); + if (lua_type(L, 1) == LUA_TNUMBER) { /* already a number? */ + lua_settop(L, 1); /* yes; return it */ + return 1; + } + else { + size_t l; + const char *s = lua_tolstring(L, 1, &l); + if (s != NULL && lua_stringtonumber(L, s) == l + 1) + return 1; /* successful conversion to number */ + /* else not a number */ + } } else { size_t l; - const char *s = luaL_checklstring(L, 1, &l); - const char *e = s + l; /* end point for 's' */ - int base = luaL_checkint(L, 2); - int neg = 0; + const char *s; + lua_Integer n = 0; /* to avoid warnings */ + lua_Integer base = luaL_checkinteger(L, 2); + luaL_checktype(L, 1, LUA_TSTRING); /* before 'luaL_checklstring'! */ + s = luaL_checklstring(L, 1, &l); luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); - s += strspn(s, SPACECHARS); /* skip initial spaces */ - if (*s == '-') { s++; neg = 1; } /* handle signal */ - else if (*s == '+') s++; - if (isalnum((unsigned char)*s)) { - lua_Number n = 0; - do { - int digit = (isdigit((unsigned char)*s)) ? *s - '0' - : toupper((unsigned char)*s) - 'A' + 10; - if (digit >= base) break; /* invalid numeral; force a fail */ - n = n * (lua_Number)base + (lua_Number)digit; - s++; - } while (isalnum((unsigned char)*s)); - s += strspn(s, SPACECHARS); /* skip trailing spaces */ - if (s == e) { /* no invalid trailing characters? */ - lua_pushnumber(L, (neg) ? -n : n); - return 1; - } /* else not a number */ + if (b_str2int(s, (int)base, &n) == s + l) { + lua_pushinteger(L, n); + return 1; } /* else not a number */ - } + } /* else not a number */ lua_pushnil(L); /* not a number */ return 1; } static int luaB_error (lua_State *L) { - int level = luaL_optint(L, 2, 1); + int level = (int)luaL_optinteger(L, 2, 1); lua_settop(L, 1); if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ luaL_where(L, level); @@ -114,7 +127,7 @@ static int luaB_setmetatable (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, "nil or table expected"); - if (luaL_getmetafield(L, 1, "__metatable")) + if (luaL_getmetafield(L, 1, "__metatable") != LUA_TNIL) return luaL_error(L, "cannot change a protected metatable"); lua_settop(L, 2); lua_setmetatable(L, 1); @@ -160,19 +173,18 @@ static int luaB_rawset (lua_State *L) { static int luaB_collectgarbage (lua_State *L) { static const char *const opts[] = {"stop", "restart", "collect", "count", "step", "setpause", "setstepmul", - "setmajorinc", "isrunning", "generational", "incremental", NULL}; + "isrunning", NULL}; static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, - LUA_GCSETMAJORINC, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; + LUA_GCISRUNNING}; int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; - int ex = luaL_optint(L, 2, 0); + int ex = (int)luaL_optinteger(L, 2, 0); int res = lua_gc(L, o, ex); switch (o) { case LUA_GCCOUNT: { int b = lua_gc(L, LUA_GCCOUNTB, 0); - lua_pushnumber(L, res + ((lua_Number)b/1024)); - lua_pushinteger(L, b); - return 2; + lua_pushnumber(L, (lua_Number)res + ((lua_Number)b/1024)); + return 1; } case LUA_GCSTEP: case LUA_GCISRUNNING: { lua_pushboolean(L, res); @@ -186,16 +198,19 @@ static int luaB_collectgarbage (lua_State *L) { } +/* +** This function has all type names as upvalues, to maximize performance. +*/ static int luaB_type (lua_State *L) { luaL_checkany(L, 1); - lua_pushstring(L, luaL_typename(L, 1)); + lua_pushvalue(L, lua_upvalueindex(lua_type(L, 1) + 1)); return 1; } static int pairsmeta (lua_State *L, const char *method, int iszero, lua_CFunction iter) { - if (!luaL_getmetafield(L, 1, method)) { /* no metamethod? */ + if (luaL_getmetafield(L, 1, method) == LUA_TNIL) { /* no metamethod? */ luaL_checktype(L, 1, LUA_TTABLE); /* argument must be a table */ lua_pushcfunction(L, iter); /* will return generator, */ lua_pushvalue(L, 1); /* state, */ @@ -227,18 +242,44 @@ static int luaB_pairs (lua_State *L) { } -static int ipairsaux (lua_State *L) { - int i = luaL_checkint(L, 2); +/* +** Traversal function for 'ipairs' for raw tables +*/ +static int ipairsaux_raw (lua_State *L) { + lua_Integer i = luaL_checkinteger(L, 2) + 1; luaL_checktype(L, 1, LUA_TTABLE); - i++; /* next value */ lua_pushinteger(L, i); - lua_rawgeti(L, 1, i); - return (lua_isnil(L, -1)) ? 1 : 2; + return (lua_rawgeti(L, 1, i) == LUA_TNIL) ? 1 : 2; } +/* +** Traversal function for 'ipairs' for tables with metamethods +*/ +static int ipairsaux (lua_State *L) { + lua_Integer i = luaL_checkinteger(L, 2) + 1; + lua_pushinteger(L, i); + return (lua_geti(L, 1, i) == LUA_TNIL) ? 1 : 2; +} + + +/* +** This function will use either 'ipairsaux' or 'ipairsaux_raw' to +** traverse a table, depending on whether the table has metamethods +** that can affect the traversal. +*/ static int luaB_ipairs (lua_State *L) { - return pairsmeta(L, "__ipairs", 1, ipairsaux); + lua_CFunction iter = (luaL_getmetafield(L, 1, "__index") != LUA_TNIL) + ? ipairsaux : ipairsaux_raw; +#if defined(LUA_COMPAT_IPAIRS) + return pairsmeta(L, "__ipairs", 1, iter); +#else + luaL_checkany(L, 1); + lua_pushcfunction(L, iter); /* iteration function */ + lua_pushvalue(L, 1); /* state */ + lua_pushinteger(L, 0); /* initial value */ + return 3; +#endif } @@ -284,7 +325,7 @@ static int luaB_loadfile (lua_State *L) { /* -** Reader for generic `load' function: `lua_load' uses the +** Reader for generic 'load' function: 'lua_load' uses the ** stack for internal stuff, so the reader cannot change the ** stack top. Instead, it keeps its resulting string in a ** reserved slot inside the stack. @@ -328,7 +369,8 @@ static int luaB_load (lua_State *L) { /* }====================================================== */ -static int dofilecont (lua_State *L) { +static int dofilecont (lua_State *L, int d1, lua_KContext d2) { + (void)d1; (void)d2; /* only to match 'lua_Kfunction' prototype */ return lua_gettop(L) - 1; } @@ -339,14 +381,20 @@ static int luaB_dofile (lua_State *L) { if (luaL_loadfile(L, fname) != LUA_OK) return lua_error(L); lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); - return dofilecont(L); + return dofilecont(L, 0, 0); } static int luaB_assert (lua_State *L) { - if (!lua_toboolean(L, 1)) - return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); - return lua_gettop(L); + if (lua_toboolean(L, 1)) /* condition is true? */ + return lua_gettop(L); /* return all arguments */ + else { /* error */ + luaL_checkany(L, 1); /* there must be a condition */ + lua_remove(L, 1); /* remove it */ + lua_pushliteral(L, "assertion failed!"); /* default message */ + lua_settop(L, 1); /* leave only message (default if no other one) */ + return luaB_error(L); /* call 'error' */ + } } @@ -357,53 +405,57 @@ static int luaB_select (lua_State *L) { return 1; } else { - int i = luaL_checkint(L, 1); + lua_Integer i = luaL_checkinteger(L, 1); if (i < 0) i = n + i; else if (i > n) i = n; luaL_argcheck(L, 1 <= i, 1, "index out of range"); - return n - i; + return n - (int)i; } } -static int finishpcall (lua_State *L, int status) { - if (!lua_checkstack(L, 1)) { /* no space for extra boolean? */ - lua_settop(L, 0); /* create space for return values */ - lua_pushboolean(L, 0); - lua_pushstring(L, "stack overflow"); +/* +** Continuation function for 'pcall' and 'xpcall'. Both functions +** already pushed a 'true' before doing the call, so in case of success +** 'finishpcall' only has to return everything in the stack minus +** 'extra' values (where 'extra' is exactly the number of items to be +** ignored). +*/ +static int finishpcall (lua_State *L, int status, lua_KContext extra) { + if (status != LUA_OK && status != LUA_YIELD) { /* error? */ + lua_pushboolean(L, 0); /* first result (false) */ + lua_pushvalue(L, -2); /* error message */ return 2; /* return false, msg */ } - lua_pushboolean(L, status); /* first result (status) */ - lua_replace(L, 1); /* put first result in first slot */ - return lua_gettop(L); -} - - -static int pcallcont (lua_State *L) { - int status = lua_getctx(L, NULL); - return finishpcall(L, (status == LUA_YIELD)); + else + return lua_gettop(L) - (int)extra; /* return all results */ } static int luaB_pcall (lua_State *L) { int status; luaL_checkany(L, 1); - lua_pushnil(L); - lua_insert(L, 1); /* create space for status result */ - status = lua_pcallk(L, lua_gettop(L) - 2, LUA_MULTRET, 0, 0, pcallcont); - return finishpcall(L, (status == LUA_OK)); + lua_pushboolean(L, 1); /* first result if no errors */ + lua_insert(L, 1); /* put it in place */ + status = lua_pcallk(L, lua_gettop(L) - 2, LUA_MULTRET, 0, 0, finishpcall); + return finishpcall(L, status, 0); } +/* +** Do a protected call with error handling. After 'lua_rotate', the +** stack will have <f, err, true, f, [args...]>; so, the function passes +** 2 to 'finishpcall' to skip the 2 first values when returning results. +*/ static int luaB_xpcall (lua_State *L) { int status; int n = lua_gettop(L); - luaL_argcheck(L, n >= 2, 2, "value expected"); - lua_pushvalue(L, 1); /* exchange function... */ - lua_copy(L, 2, 1); /* ...and error handler */ - lua_replace(L, 2); - status = lua_pcallk(L, n - 2, LUA_MULTRET, 1, 0, pcallcont); - return finishpcall(L, (status == LUA_OK)); + luaL_checktype(L, 2, LUA_TFUNCTION); /* check error function */ + lua_pushboolean(L, 1); /* first result */ + lua_pushvalue(L, 1); /* function */ + lua_rotate(L, 3, 2); /* move them below function's arguments */ + status = lua_pcallk(L, n - 2, LUA_MULTRET, 2, 2, finishpcall); + return finishpcall(L, status, 2); } @@ -438,21 +490,31 @@ static const luaL_Reg base_funcs[] = { {"setmetatable", luaB_setmetatable}, {"tonumber", luaB_tonumber}, {"tostring", luaB_tostring}, - {"type", luaB_type}, {"xpcall", luaB_xpcall}, + /* placeholders */ + {"type", NULL}, + {"_G", NULL}, + {"_VERSION", NULL}, {NULL, NULL} }; LUAMOD_API int luaopen_base (lua_State *L) { - /* set global _G */ - lua_pushglobaltable(L); - lua_pushglobaltable(L); - lua_setfield(L, -2, "_G"); + int i; /* open lib into global table */ + lua_pushglobaltable(L); luaL_setfuncs(L, base_funcs, 0); + /* set global _G */ + lua_pushvalue(L, -1); + lua_setfield(L, -2, "_G"); + /* set global _VERSION */ lua_pushliteral(L, LUA_VERSION); - lua_setfield(L, -2, "_VERSION"); /* set global _VERSION */ + lua_setfield(L, -2, "_VERSION"); + /* set function 'type' with proper upvalues */ + for (i = 0; i < LUA_NUMTAGS; i++) /* push all type names as upvalues */ + lua_pushstring(L, lua_typename(L, i)); + lua_pushcclosure(L, luaB_type, LUA_NUMTAGS); + lua_setfield(L, -2, "type"); return 1; } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lbitlib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lbitlib.c index 31c7b66f129..15d5f0cdfc4 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lbitlib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lbitlib.c @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.18.1.2 2013/07/09 18:01:41 roberto Exp $ +** $Id: lbitlib.c,v 1.28 2014/11/02 19:19:04 roberto Exp $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ @@ -7,20 +7,32 @@ #define lbitlib_c #define LUA_LIB +#include "lprefix.h" + + #include "lua.h" #include "lauxlib.h" #include "lualib.h" +#if defined(LUA_COMPAT_BITLIB) /* { */ + + /* number of bits to consider in a number */ #if !defined(LUA_NBITS) #define LUA_NBITS 32 #endif +/* +** a lua_Unsigned with its first LUA_NBITS bits equal to 1. (Shift must +** be made in two parts to avoid problems when LUA_NBITS is equal to the +** number of bits in a lua_Unsigned.) +*/ #define ALLONES (~(((~(lua_Unsigned)0) << (LUA_NBITS - 1)) << 1)) + /* macro to trim extra bits */ #define trim(x) ((x) & ALLONES) @@ -29,13 +41,10 @@ #define mask(n) (~((ALLONES << 1) << ((n) - 1))) -typedef lua_Unsigned b_uint; - - -static b_uint andaux (lua_State *L) { +static lua_Unsigned andaux (lua_State *L) { int i, n = lua_gettop(L); - b_uint r = ~(b_uint)0; + lua_Unsigned r = ~(lua_Unsigned)0; for (i = 1; i <= n; i++) r &= luaL_checkunsigned(L, i); return trim(r); @@ -43,14 +52,14 @@ static b_uint andaux (lua_State *L) { static int b_and (lua_State *L) { - b_uint r = andaux(L); + lua_Unsigned r = andaux(L); lua_pushunsigned(L, r); return 1; } static int b_test (lua_State *L) { - b_uint r = andaux(L); + lua_Unsigned r = andaux(L); lua_pushboolean(L, r != 0); return 1; } @@ -58,7 +67,7 @@ static int b_test (lua_State *L) { static int b_or (lua_State *L) { int i, n = lua_gettop(L); - b_uint r = 0; + lua_Unsigned r = 0; for (i = 1; i <= n; i++) r |= luaL_checkunsigned(L, i); lua_pushunsigned(L, trim(r)); @@ -68,7 +77,7 @@ static int b_or (lua_State *L) { static int b_xor (lua_State *L) { int i, n = lua_gettop(L); - b_uint r = 0; + lua_Unsigned r = 0; for (i = 1; i <= n; i++) r ^= luaL_checkunsigned(L, i); lua_pushunsigned(L, trim(r)); @@ -77,13 +86,13 @@ static int b_xor (lua_State *L) { static int b_not (lua_State *L) { - b_uint r = ~luaL_checkunsigned(L, 1); + lua_Unsigned r = ~luaL_checkunsigned(L, 1); lua_pushunsigned(L, trim(r)); return 1; } -static int b_shift (lua_State *L, b_uint r, int i) { +static int b_shift (lua_State *L, lua_Unsigned r, lua_Integer i) { if (i < 0) { /* shift right? */ i = -i; r = trim(r); @@ -101,33 +110,33 @@ static int b_shift (lua_State *L, b_uint r, int i) { static int b_lshift (lua_State *L) { - return b_shift(L, luaL_checkunsigned(L, 1), luaL_checkint(L, 2)); + return b_shift(L, luaL_checkunsigned(L, 1), luaL_checkinteger(L, 2)); } static int b_rshift (lua_State *L) { - return b_shift(L, luaL_checkunsigned(L, 1), -luaL_checkint(L, 2)); + return b_shift(L, luaL_checkunsigned(L, 1), -luaL_checkinteger(L, 2)); } static int b_arshift (lua_State *L) { - b_uint r = luaL_checkunsigned(L, 1); - int i = luaL_checkint(L, 2); - if (i < 0 || !(r & ((b_uint)1 << (LUA_NBITS - 1)))) + lua_Unsigned r = luaL_checkunsigned(L, 1); + lua_Integer i = luaL_checkinteger(L, 2); + if (i < 0 || !(r & ((lua_Unsigned)1 << (LUA_NBITS - 1)))) return b_shift(L, r, -i); else { /* arithmetic shift for 'negative' number */ if (i >= LUA_NBITS) r = ALLONES; else - r = trim((r >> i) | ~(~(b_uint)0 >> i)); /* add signal bit */ + r = trim((r >> i) | ~(trim(~(lua_Unsigned)0) >> i)); /* add signal bit */ lua_pushunsigned(L, r); return 1; } } -static int b_rot (lua_State *L, int i) { - b_uint r = luaL_checkunsigned(L, 1); - i &= (LUA_NBITS - 1); /* i = i % NBITS */ +static int b_rot (lua_State *L, lua_Integer d) { + lua_Unsigned r = luaL_checkunsigned(L, 1); + int i = d & (LUA_NBITS - 1); /* i = d % NBITS */ r = trim(r); if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */ r = (r << i) | (r >> (LUA_NBITS - i)); @@ -137,12 +146,12 @@ static int b_rot (lua_State *L, int i) { static int b_lrot (lua_State *L) { - return b_rot(L, luaL_checkint(L, 2)); + return b_rot(L, luaL_checkinteger(L, 2)); } static int b_rrot (lua_State *L) { - return b_rot(L, -luaL_checkint(L, 2)); + return b_rot(L, -luaL_checkinteger(L, 2)); } @@ -153,20 +162,20 @@ static int b_rrot (lua_State *L) { ** 'width' being used uninitialized.) */ static int fieldargs (lua_State *L, int farg, int *width) { - int f = luaL_checkint(L, farg); - int w = luaL_optint(L, farg + 1, 1); + lua_Integer f = luaL_checkinteger(L, farg); + lua_Integer w = luaL_optinteger(L, farg + 1, 1); luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); if (f + w > LUA_NBITS) luaL_error(L, "trying to access non-existent bits"); - *width = w; - return f; + *width = (int)w; + return (int)f; } static int b_extract (lua_State *L) { int w; - b_uint r = luaL_checkunsigned(L, 1); + lua_Unsigned r = trim(luaL_checkunsigned(L, 1)); int f = fieldargs(L, 2, &w); r = (r >> f) & mask(w); lua_pushunsigned(L, r); @@ -176,8 +185,8 @@ static int b_extract (lua_State *L) { static int b_replace (lua_State *L) { int w; - b_uint r = luaL_checkunsigned(L, 1); - b_uint v = luaL_checkunsigned(L, 2); + lua_Unsigned r = trim(luaL_checkunsigned(L, 1)); + lua_Unsigned v = luaL_checkunsigned(L, 2); int f = fieldargs(L, 3, &w); int m = mask(w); v &= m; /* erase bits outside given width */ @@ -210,3 +219,12 @@ LUAMOD_API int luaopen_bit32 (lua_State *L) { return 1; } + +#else /* }{ */ + + +LUAMOD_API int luaopen_bit32 (lua_State *L) { + return luaL_error(L, "library 'bit32' has been deprecated"); +} + +#endif /* } */ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lcode.c b/3rdparty/genie/src/host/lua-5.3.0/src/lcode.c index 820b95c0e18..5e34624bf46 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lcode.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lcode.c @@ -1,15 +1,18 @@ /* -** $Id: lcode.c,v 2.62.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lcode.c,v 2.99 2014/12/29 16:49:25 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ - -#include <stdlib.h> - #define lcode_c #define LUA_CORE +#include "lprefix.h" + + +#include <math.h> +#include <stdlib.h> + #include "lua.h" #include "lcode.h" @@ -26,11 +29,25 @@ #include "lvm.h" +/* Maximum number of registers in a Lua function */ +#define MAXREGS 250 + + #define hasjumps(e) ((e)->t != (e)->f) -static int isnumeral(expdesc *e) { - return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP); +static int tonumeral(expdesc *e, TValue *v) { + if (e->t != NO_JUMP || e->f != NO_JUMP) + return 0; /* not a numeral */ + switch (e->k) { + case VKINT: + if (v) setivalue(v, e->u.ival); + return 1; + case VKFLT: + if (v) setfltvalue(v, e->u.nval); + return 1; + default: return 0; + } } @@ -88,7 +105,7 @@ static void fixjump (FuncState *fs, int pc, int dest) { /* -** returns current `pc' and marks it as a jump target (to avoid wrong +** returns current 'pc' and marks it as a jump target (to avoid wrong ** optimizations with consecutive instructions not in the same basic block). */ int luaK_getlabel (FuncState *fs) { @@ -176,7 +193,7 @@ void luaK_patchlist (FuncState *fs, int list, int target) { } -LUAI_FUNC void luaK_patchclose (FuncState *fs, int list, int level) { +void luaK_patchclose (FuncState *fs, int list, int level) { level++; /* argument is +1 to reserve 0 as non-op */ while (list != NO_JUMP) { int next = getjump(fs, list); @@ -211,7 +228,7 @@ void luaK_concat (FuncState *fs, int *l1, int l2) { static int luaK_code (FuncState *fs, Instruction i) { Proto *f = fs->f; - dischargejpc(fs); /* `pc' will change */ + dischargejpc(fs); /* 'pc' will change */ /* put new instruction in code array */ luaM_growvector(fs->ls->L, f->code, fs->pc, f->sizecode, Instruction, MAX_INT, "opcodes"); @@ -261,7 +278,7 @@ int luaK_codek (FuncState *fs, int reg, int k) { void luaK_checkstack (FuncState *fs, int n) { int newstack = fs->freereg + n; if (newstack > fs->f->maxstacksize) { - if (newstack >= MAXSTACK) + if (newstack >= MAXREGS) luaX_syntaxerror(fs->ls, "function or expression too complex"); fs->f->maxstacksize = cast_byte(newstack); } @@ -288,25 +305,28 @@ static void freeexp (FuncState *fs, expdesc *e) { } +/* +** Use scanner's table to cache position of constants in constant list +** and try to reuse constants +*/ static int addk (FuncState *fs, TValue *key, TValue *v) { lua_State *L = fs->ls->L; - TValue *idx = luaH_set(L, fs->h, key); Proto *f = fs->f; + TValue *idx = luaH_set(L, fs->ls->h, key); /* index scanner table */ int k, oldsize; - if (ttisnumber(idx)) { - lua_Number n = nvalue(idx); - lua_number2int(k, n); - if (luaV_rawequalobj(&f->k[k], v)) - return k; - /* else may be a collision (e.g., between 0.0 and "\0\0\0\0\0\0\0\0"); - go through and create a new entry for this value */ + if (ttisinteger(idx)) { /* is there an index there? */ + k = cast_int(ivalue(idx)); + /* correct value? (warning: must distinguish floats from integers!) */ + if (k < fs->nk && ttype(&f->k[k]) == ttype(v) && + luaV_rawequalobj(&f->k[k], v)) + return k; /* reuse index */ } /* constant not found; create a new entry */ oldsize = f->sizek; k = fs->nk; /* numerical value does not need GC barrier; table has no metatable, so it does not need to invalidate cache */ - setnvalue(idx, cast_num(k)); + setivalue(idx, k); luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); setobj(L, &f->k[k], v); @@ -323,20 +343,23 @@ int luaK_stringK (FuncState *fs, TString *s) { } -int luaK_numberK (FuncState *fs, lua_Number r) { - int n; - lua_State *L = fs->ls->L; +/* +** Integers use userdata as keys to avoid collision with floats with same +** value; conversion to 'void*' used only for hashing, no "precision" +** problems +*/ +int luaK_intK (FuncState *fs, lua_Integer n) { + TValue k, o; + setpvalue(&k, cast(void*, cast(size_t, n))); + setivalue(&o, n); + return addk(fs, &k, &o); +} + + +static int luaK_numberK (FuncState *fs, lua_Number r) { TValue o; - setnvalue(&o, r); - if (r == 0 || luai_numisnan(NULL, r)) { /* handle -0 and NaN */ - /* use raw representation as key to avoid numeric problems */ - setsvalue(L, L->top++, luaS_newlstr(L, (char *)&r, sizeof(r))); - n = addk(fs, L->top - 1, &o); - L->top--; - } - else - n = addk(fs, &o, &o); /* regular case */ - return n; + setfltvalue(&o, r); + return addk(fs, &o, &o); } @@ -351,7 +374,7 @@ static int nilK (FuncState *fs) { TValue k, v; setnilvalue(&v); /* cannot use nil as key; instead use table itself to represent nil */ - sethvalue(fs->ls->L, &k, fs->h); + sethvalue(fs->ls->L, &k, fs->ls->h); return addk(fs, &k, &v); } @@ -433,10 +456,14 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) { luaK_codek(fs, reg, e->u.info); break; } - case VKNUM: { + case VKFLT: { luaK_codek(fs, reg, luaK_numberK(fs, e->u.nval)); break; } + case VKINT: { + luaK_codek(fs, reg, luaK_intK(fs, e->u.ival)); + break; + } case VRELOCABLE: { Instruction *pc = &getcode(fs, e); SETARG_A(*pc, reg); @@ -468,7 +495,7 @@ static void discharge2anyreg (FuncState *fs, expdesc *e) { static void exp2reg (FuncState *fs, expdesc *e, int reg) { discharge2reg(fs, e, reg); if (e->k == VJMP) - luaK_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */ + luaK_concat(fs, &e->t, e->u.info); /* put this jump in 't' list */ if (hasjumps(e)) { int final; /* position after whole expression */ int p_f = NO_JUMP; /* position of an eventual LOAD false */ @@ -538,13 +565,19 @@ int luaK_exp2RK (FuncState *fs, expdesc *e) { } else break; } - case VKNUM: { + case VKINT: { + e->u.info = luaK_intK(fs, e->u.ival); + e->k = VK; + goto vk; + } + case VKFLT: { e->u.info = luaK_numberK(fs, e->u.nval); e->k = VK; /* go through */ } case VK: { - if (e->u.info <= MAXINDEXRK) /* constant fits in argC? */ + vk: + if (e->u.info <= MAXINDEXRK) /* constant fits in 'argC'? */ return RKASK(e->u.info); else break; } @@ -627,7 +660,7 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) { pc = e->u.info; break; } - case VK: case VKNUM: case VTRUE: { + case VK: case VKFLT: case VKINT: case VTRUE: { pc = NO_JUMP; /* always true; do nothing */ break; } @@ -636,7 +669,7 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) { break; } } - luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ + luaK_concat(fs, &e->f, pc); /* insert last jump in 'f' list */ luaK_patchtohere(fs, e->t); e->t = NO_JUMP; } @@ -659,7 +692,7 @@ void luaK_goiffalse (FuncState *fs, expdesc *e) { break; } } - luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ + luaK_concat(fs, &e->t, pc); /* insert last jump in 't' list */ luaK_patchtohere(fs, e->f); e->f = NO_JUMP; } @@ -672,7 +705,7 @@ static void codenot (FuncState *fs, expdesc *e) { e->k = VTRUE; break; } - case VK: case VKNUM: case VTRUE: { + case VK: case VKFLT: case VKINT: case VTRUE: { e->k = VFALSE; break; } @@ -710,25 +743,70 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { } -static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { - lua_Number r; - if (!isnumeral(e1) || !isnumeral(e2)) return 0; - if ((op == OP_DIV || op == OP_MOD) && e2->u.nval == 0) - return 0; /* do not attempt to divide by 0 */ - r = luaO_arith(op - OP_ADD + LUA_OPADD, e1->u.nval, e2->u.nval); - e1->u.nval = r; +/* +** return false if folding can raise an error +*/ +static int validop (int op, TValue *v1, TValue *v2) { + switch (op) { + case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: + case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */ + lua_Integer i; + return (tointeger(v1, &i) && tointeger(v2, &i)); + } + case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */ + return (nvalue(v2) != 0); + default: return 1; /* everything else is valid */ + } +} + + +/* +** Try to "constant-fold" an operation; return 1 iff successful +*/ +static int constfolding (FuncState *fs, int op, expdesc *e1, expdesc *e2) { + TValue v1, v2, res; + if (!tonumeral(e1, &v1) || !tonumeral(e2, &v2) || !validop(op, &v1, &v2)) + return 0; /* non-numeric operands or not safe to fold */ + luaO_arith(fs->ls->L, op, &v1, &v2, &res); /* does operation */ + if (ttisinteger(&res)) { + e1->k = VKINT; + e1->u.ival = ivalue(&res); + } + else { /* folds neither NaN nor 0.0 (to avoid collapsing with -0.0) */ + lua_Number n = fltvalue(&res); + if (luai_numisnan(n) || n == 0) + return 0; + e1->k = VKFLT; + e1->u.nval = n; + } return 1; } -static void codearith (FuncState *fs, OpCode op, - expdesc *e1, expdesc *e2, int line) { - if (constfolding(op, e1, e2)) - return; +/* +** Code for binary and unary expressions that "produce values" +** (arithmetic operations, bitwise operations, concat, length). First +** try to do constant folding (only for numeric [arithmetic and +** bitwise] operations, which is what 'lua_arith' accepts). +** Expression to produce final result will be encoded in 'e1'. +*/ +static void codeexpval (FuncState *fs, OpCode op, + expdesc *e1, expdesc *e2, int line) { + lua_assert(op >= OP_ADD); + if (op <= OP_BNOT && constfolding(fs, op - OP_ADD + LUA_OPADD, e1, e2)) + return; /* result has been folded */ else { - int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; - int o1 = luaK_exp2RK(fs, e1); - if (o1 > o2) { + int o1, o2; + /* move operands to registers (if needed) */ + if (op == OP_UNM || op == OP_BNOT || op == OP_LEN) { /* unary op? */ + o2 = 0; /* no second expression */ + o1 = luaK_exp2anyreg(fs, e1); /* cannot operate on constants */ + } + else { /* regular case (binary operators) */ + o2 = luaK_exp2RK(fs, e2); /* both operands are "RK" */ + o1 = luaK_exp2RK(fs, e1); + } + if (o1 > o2) { /* free registers in proper order */ freeexp(fs, e1); freeexp(fs, e2); } @@ -736,8 +814,8 @@ static void codearith (FuncState *fs, OpCode op, freeexp(fs, e2); freeexp(fs, e1); } - e1->u.info = luaK_codeABC(fs, op, 0, o1, o2); - e1->k = VRELOCABLE; + e1->u.info = luaK_codeABC(fs, op, 0, o1, o2); /* generate opcode */ + e1->k = VRELOCABLE; /* all those operations are relocable */ luaK_fixline(fs, line); } } @@ -750,7 +828,7 @@ static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, freeexp(fs, e2); freeexp(fs, e1); if (cond == 0 && op != OP_EQ) { - int temp; /* exchange args to replace by `<' or `<=' */ + int temp; /* exchange args to replace by '<' or '<=' */ temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ cond = 1; } @@ -761,23 +839,13 @@ static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { expdesc e2; - e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; + e2.t = e2.f = NO_JUMP; e2.k = VKINT; e2.u.ival = 0; switch (op) { - case OPR_MINUS: { - if (isnumeral(e)) /* minus constant? */ - e->u.nval = luai_numunm(NULL, e->u.nval); /* fold it */ - else { - luaK_exp2anyreg(fs, e); - codearith(fs, OP_UNM, e, &e2, line); - } + case OPR_MINUS: case OPR_BNOT: case OPR_LEN: { + codeexpval(fs, cast(OpCode, (op - OPR_MINUS) + OP_UNM), e, &e2, line); break; } case OPR_NOT: codenot(fs, e); break; - case OPR_LEN: { - luaK_exp2anyreg(fs, e); /* cannot operate on constants */ - codearith(fs, OP_LEN, e, &e2, line); - break; - } default: lua_assert(0); } } @@ -794,12 +862,15 @@ void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { break; } case OPR_CONCAT: { - luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ + luaK_exp2nextreg(fs, v); /* operand must be on the 'stack' */ break; } - case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: - case OPR_MOD: case OPR_POW: { - if (!isnumeral(v)) luaK_exp2RK(fs, v); + case OPR_ADD: case OPR_SUB: + case OPR_MUL: case OPR_DIV: case OPR_IDIV: + case OPR_MOD: case OPR_POW: + case OPR_BAND: case OPR_BOR: case OPR_BXOR: + case OPR_SHL: case OPR_SHR: { + if (!tonumeral(v, NULL)) luaK_exp2RK(fs, v); break; } default: { @@ -837,13 +908,15 @@ void luaK_posfix (FuncState *fs, BinOpr op, } else { luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ - codearith(fs, OP_CONCAT, e1, e2, line); + codeexpval(fs, OP_CONCAT, e1, e2, line); } break; } case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: - case OPR_MOD: case OPR_POW: { - codearith(fs, cast(OpCode, op - OPR_ADD + OP_ADD), e1, e2, line); + case OPR_IDIV: case OPR_MOD: case OPR_POW: + case OPR_BAND: case OPR_BOR: case OPR_BXOR: + case OPR_SHL: case OPR_SHR: { + codeexpval(fs, cast(OpCode, (op - OPR_ADD) + OP_ADD), e1, e2, line); break; } case OPR_EQ: case OPR_LT: case OPR_LE: { diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lcode.h b/3rdparty/genie/src/host/lua-5.3.0/src/lcode.h index 6a1424cf5a7..43ab86db77b 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lcode.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lcode.h @@ -1,5 +1,5 @@ /* -** $Id: lcode.h,v 1.58.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lcode.h,v 1.63 2013/12/30 20:47:58 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -24,7 +24,11 @@ ** grep "ORDER OPR" if you change these enums (ORDER OP) */ typedef enum BinOpr { - OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, + OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, + OPR_DIV, + OPR_IDIV, + OPR_BAND, OPR_BOR, OPR_BXOR, + OPR_SHL, OPR_SHR, OPR_CONCAT, OPR_EQ, OPR_LT, OPR_LE, OPR_NE, OPR_GT, OPR_GE, @@ -33,7 +37,7 @@ typedef enum BinOpr { } BinOpr; -typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; +typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; #define getcode(fs,e) ((fs)->f->code[(e)->u.info]) @@ -52,7 +56,7 @@ LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); -LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); +LUAI_FUNC int luaK_intK (FuncState *fs, lua_Integer n); LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e); diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lcorolib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lcorolib.c index ce4f6ad42c6..0c0b7fa6b31 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lcorolib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lcorolib.c @@ -1,15 +1,16 @@ /* -** $Id: lcorolib.c,v 1.5.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lcorolib.c,v 1.9 2014/11/02 19:19:04 roberto Exp $ ** Coroutine Library ** See Copyright Notice in lua.h */ +#define lcorolib_c +#define LUA_LIB -#include <stdlib.h> +#include "lprefix.h" -#define lcorolib_c -#define LUA_LIB +#include <stdlib.h> #include "lua.h" @@ -17,6 +18,13 @@ #include "lualib.h" +static lua_State *getco (lua_State *L) { + lua_State *co = lua_tothread(L, 1); + luaL_argcheck(L, co, 1, "thread expected"); + return co; +} + + static int auxresume (lua_State *L, lua_State *co, int narg) { int status; if (!lua_checkstack(co, narg)) { @@ -47,9 +55,8 @@ static int auxresume (lua_State *L, lua_State *co, int narg) { static int luaB_coresume (lua_State *L) { - lua_State *co = lua_tothread(L, 1); + lua_State *co = getco(L); int r; - luaL_argcheck(L, co, 1, "coroutine expected"); r = auxresume(L, co, lua_gettop(L) - 1); if (r < 0) { lua_pushboolean(L, 0); @@ -59,7 +66,7 @@ static int luaB_coresume (lua_State *L) { else { lua_pushboolean(L, 1); lua_insert(L, -(r + 1)); - return r + 1; /* return true + `resume' returns */ + return r + 1; /* return true + 'resume' returns */ } } @@ -102,8 +109,7 @@ static int luaB_yield (lua_State *L) { static int luaB_costatus (lua_State *L) { - lua_State *co = lua_tothread(L, 1); - luaL_argcheck(L, co, 1, "coroutine expected"); + lua_State *co = getco(L); if (L == co) lua_pushliteral(L, "running"); else { switch (lua_status(co)) { @@ -129,6 +135,12 @@ static int luaB_costatus (lua_State *L) { } +static int luaB_yieldable (lua_State *L) { + lua_pushboolean(L, lua_isyieldable(L)); + return 1; +} + + static int luaB_corunning (lua_State *L) { int ismain = lua_pushthread(L); lua_pushboolean(L, ismain); @@ -143,6 +155,7 @@ static const luaL_Reg co_funcs[] = { {"status", luaB_costatus}, {"wrap", luaB_cowrap}, {"yield", luaB_yield}, + {"isyieldable", luaB_yieldable}, {NULL, NULL} }; diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lctype.c b/3rdparty/genie/src/host/lua-5.3.0/src/lctype.c index 93f8cadc39d..ae9367e691b 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lctype.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lctype.c @@ -1,5 +1,5 @@ /* -** $Id: lctype.c,v 1.11.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lctype.c,v 1.12 2014/11/02 19:19:04 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ @@ -7,6 +7,9 @@ #define lctype_c #define LUA_CORE +#include "lprefix.h" + + #include "lctype.h" #if !LUA_USE_CTYPE /* { */ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lctype.h b/3rdparty/genie/src/host/lua-5.3.0/src/lctype.h index b09b21a337c..99c7d122376 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lctype.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lctype.h @@ -1,5 +1,5 @@ /* -** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldblib.c b/3rdparty/genie/src/host/lua-5.3.0/src/ldblib.c index 84fe3c7d823..24a11b53ee3 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldblib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ldblib.c @@ -1,25 +1,30 @@ /* -** $Id: ldblib.c,v 1.132.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: ldblib.c,v 1.148 2015/01/02 12:52:22 roberto Exp $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ +#define ldblib_c +#define LUA_LIB + +#include "lprefix.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#define ldblib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" #include "lualib.h" -#define HOOKKEY "_HKEY" - +/* +** The hook table at registry[&HOOKKEY] maps threads to their current +** hook function. (We only need the unique address of 'HOOKKEY'.) +*/ +static const int HOOKKEY = 0; static int db_getregistry (lua_State *L) { @@ -57,35 +62,20 @@ static int db_getuservalue (lua_State *L) { static int db_setuservalue (lua_State *L) { - if (lua_type(L, 1) == LUA_TLIGHTUSERDATA) - luaL_argerror(L, 1, "full userdata expected, got light userdata"); luaL_checktype(L, 1, LUA_TUSERDATA); - if (!lua_isnoneornil(L, 2)) - luaL_checktype(L, 2, LUA_TTABLE); + luaL_checkany(L, 2); lua_settop(L, 2); lua_setuservalue(L, 1); return 1; } -static void settabss (lua_State *L, const char *i, const char *v) { - lua_pushstring(L, v); - lua_setfield(L, -2, i); -} - - -static void settabsi (lua_State *L, const char *i, int v) { - lua_pushinteger(L, v); - lua_setfield(L, -2, i); -} - - -static void settabsb (lua_State *L, const char *i, int v) { - lua_pushboolean(L, v); - lua_setfield(L, -2, i); -} - - +/* +** Auxiliary function used by several library functions: check for +** an optional thread as function's first argument and set 'arg' with +** 1 if this argument is present (so that functions can skip it to +** access their other arguments) +*/ static lua_State *getthread (lua_State *L, int *arg) { if (lua_isthread(L, 1)) { *arg = 1; @@ -93,44 +83,70 @@ static lua_State *getthread (lua_State *L, int *arg) { } else { *arg = 0; - return L; + return L; /* function will operate over current thread */ } } +/* +** Variations of 'lua_settable', used by 'db_getinfo' to put results +** from 'lua_getinfo' into result table. Key is always a string; +** value can be a string, an int, or a boolean. +*/ +static void settabss (lua_State *L, const char *k, const char *v) { + lua_pushstring(L, v); + lua_setfield(L, -2, k); +} + +static void settabsi (lua_State *L, const char *k, int v) { + lua_pushinteger(L, v); + lua_setfield(L, -2, k); +} + +static void settabsb (lua_State *L, const char *k, int v) { + lua_pushboolean(L, v); + lua_setfield(L, -2, k); +} + + +/* +** In function 'db_getinfo', the call to 'lua_getinfo' may push +** results on the stack; later it creates the result table to put +** these objects. Function 'treatstackoption' puts the result from +** 'lua_getinfo' on top of the result table so that it can call +** 'lua_setfield'. +*/ static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) { - if (L == L1) { - lua_pushvalue(L, -2); - lua_remove(L, -3); - } + if (L == L1) + lua_rotate(L, -2, 1); /* exchange object and table */ else - lua_xmove(L1, L, 1); - lua_setfield(L, -2, fname); + lua_xmove(L1, L, 1); /* move object to the "main" stack */ + lua_setfield(L, -2, fname); /* put object into table */ } +/* +** Calls 'lua_getinfo' and collects all results in a new table. +*/ static int db_getinfo (lua_State *L) { lua_Debug ar; int arg; lua_State *L1 = getthread(L, &arg); const char *options = luaL_optstring(L, arg+2, "flnStu"); - if (lua_isnumber(L, arg+1)) { - if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) { + if (lua_isfunction(L, arg + 1)) { /* info about a function? */ + options = lua_pushfstring(L, ">%s", options); /* add '>' to 'options' */ + lua_pushvalue(L, arg + 1); /* move function to 'L1' stack */ + lua_xmove(L, L1, 1); + } + else { /* stack level */ + if (!lua_getstack(L1, (int)luaL_checkinteger(L, arg + 1), &ar)) { lua_pushnil(L); /* level out of range */ return 1; } } - else if (lua_isfunction(L, arg+1)) { - lua_pushfstring(L, ">%s", options); - options = lua_tostring(L, -1); - lua_pushvalue(L, arg+1); - lua_xmove(L, L1, 1); - } - else - return luaL_argerror(L, arg+1, "function or level expected"); if (!lua_getinfo(L1, options, &ar)) return luaL_argerror(L, arg+2, "invalid option"); - lua_createtable(L, 0, 2); + lua_newtable(L); /* table to collect results */ if (strchr(options, 'S')) { settabss(L, "source", ar.source); settabss(L, "short_src", ar.short_src); @@ -164,20 +180,21 @@ static int db_getlocal (lua_State *L) { lua_State *L1 = getthread(L, &arg); lua_Debug ar; const char *name; - int nvar = luaL_checkint(L, arg+2); /* local-variable index */ + int nvar = (int)luaL_checkinteger(L, arg + 2); /* local-variable index */ if (lua_isfunction(L, arg + 1)) { /* function argument? */ lua_pushvalue(L, arg + 1); /* push function */ lua_pushstring(L, lua_getlocal(L, NULL, nvar)); /* push local name */ - return 1; + return 1; /* return only name (there is no value) */ } else { /* stack-level argument */ - if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ + int level = (int)luaL_checkinteger(L, arg + 1); + if (!lua_getstack(L1, level, &ar)) /* out of range? */ return luaL_argerror(L, arg+1, "level out of range"); name = lua_getlocal(L1, &ar, nvar); if (name) { - lua_xmove(L1, L, 1); /* push local value */ + lua_xmove(L1, L, 1); /* move local value */ lua_pushstring(L, name); /* push name */ - lua_pushvalue(L, -2); /* re-order */ + lua_rotate(L, -2, 1); /* re-order */ return 2; } else { @@ -190,26 +207,35 @@ static int db_getlocal (lua_State *L) { static int db_setlocal (lua_State *L) { int arg; + const char *name; lua_State *L1 = getthread(L, &arg); lua_Debug ar; - if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ + int level = (int)luaL_checkinteger(L, arg + 1); + int nvar = (int)luaL_checkinteger(L, arg + 2); + if (!lua_getstack(L1, level, &ar)) /* out of range? */ return luaL_argerror(L, arg+1, "level out of range"); luaL_checkany(L, arg+3); lua_settop(L, arg+3); lua_xmove(L, L1, 1); - lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); + name = lua_setlocal(L1, &ar, nvar); + if (name == NULL) + lua_pop(L1, 1); /* pop value (if not popped by 'lua_setlocal') */ + lua_pushstring(L, name); return 1; } +/* +** get (if 'get' is true) or set an upvalue from a closure +*/ static int auxupvalue (lua_State *L, int get) { const char *name; - int n = luaL_checkint(L, 2); - luaL_checktype(L, 1, LUA_TFUNCTION); + int n = (int)luaL_checkinteger(L, 2); /* upvalue index */ + luaL_checktype(L, 1, LUA_TFUNCTION); /* closure */ name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); if (name == NULL) return 0; lua_pushstring(L, name); - lua_insert(L, -(get+1)); + lua_insert(L, -(get+1)); /* no-op if get is false */ return get + 1; } @@ -225,13 +251,15 @@ static int db_setupvalue (lua_State *L) { } +/* +** Check whether a given upvalue from a given closure exists and +** returns its index +*/ static int checkupval (lua_State *L, int argf, int argnup) { - lua_Debug ar; - int nup = luaL_checkint(L, argnup); - luaL_checktype(L, argf, LUA_TFUNCTION); - lua_pushvalue(L, argf); - lua_getinfo(L, ">u", &ar); - luaL_argcheck(L, 1 <= nup && nup <= ar.nups, argnup, "invalid upvalue index"); + int nup = (int)luaL_checkinteger(L, argnup); /* upvalue index */ + luaL_checktype(L, argf, LUA_TFUNCTION); /* closure */ + luaL_argcheck(L, (lua_getupvalue(L, argf, nup) != NULL), argnup, + "invalid upvalue index"); return nup; } @@ -253,26 +281,29 @@ static int db_upvaluejoin (lua_State *L) { } -#define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY) - - +/* +** Call hook function registered at hook table for the current +** thread (if there is one) +*/ static void hookf (lua_State *L, lua_Debug *ar) { static const char *const hooknames[] = {"call", "return", "line", "count", "tail call"}; - gethooktable(L); + lua_rawgetp(L, LUA_REGISTRYINDEX, &HOOKKEY); lua_pushthread(L); - lua_rawget(L, -2); - if (lua_isfunction(L, -1)) { - lua_pushstring(L, hooknames[(int)ar->event]); + if (lua_rawget(L, -2) == LUA_TFUNCTION) { /* is there a hook function? */ + lua_pushstring(L, hooknames[(int)ar->event]); /* push event name */ if (ar->currentline >= 0) - lua_pushinteger(L, ar->currentline); + lua_pushinteger(L, ar->currentline); /* push current line */ else lua_pushnil(L); lua_assert(lua_getinfo(L, "lS", ar)); - lua_call(L, 2, 0); + lua_call(L, 2, 0); /* call hook function */ } } +/* +** Convert a string mask (for 'sethook') into a bit mask +*/ static int makemask (const char *smask, int count) { int mask = 0; if (strchr(smask, 'c')) mask |= LUA_MASKCALL; @@ -283,6 +314,9 @@ static int makemask (const char *smask, int count) { } +/* +** Convert a bit mask (for 'gethook') into a string mask +*/ static char *unmakemask (int mask, char *smask) { int i = 0; if (mask & LUA_MASKCALL) smask[i++] = 'c'; @@ -297,26 +331,29 @@ static int db_sethook (lua_State *L) { int arg, mask, count; lua_Hook func; lua_State *L1 = getthread(L, &arg); - if (lua_isnoneornil(L, arg+1)) { + if (lua_isnoneornil(L, arg+1)) { /* no hook? */ lua_settop(L, arg+1); func = NULL; mask = 0; count = 0; /* turn off hooks */ } else { const char *smask = luaL_checkstring(L, arg+2); luaL_checktype(L, arg+1, LUA_TFUNCTION); - count = luaL_optint(L, arg+3, 0); + count = (int)luaL_optinteger(L, arg + 3, 0); func = hookf; mask = makemask(smask, count); } - if (gethooktable(L) == 0) { /* creating hook table? */ + if (lua_rawgetp(L, LUA_REGISTRYINDEX, &HOOKKEY) == LUA_TNIL) { + lua_createtable(L, 0, 2); /* create a hook table */ + lua_pushvalue(L, -1); + lua_rawsetp(L, LUA_REGISTRYINDEX, &HOOKKEY); /* set it in position */ lua_pushstring(L, "k"); lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */ lua_pushvalue(L, -1); lua_setmetatable(L, -2); /* setmetatable(hooktable) = hooktable */ } - lua_pushthread(L1); lua_xmove(L1, L, 1); - lua_pushvalue(L, arg+1); - lua_rawset(L, -3); /* set new hook */ - lua_sethook(L1, func, mask, count); /* set hooks */ + lua_pushthread(L1); lua_xmove(L1, L, 1); /* key (thread) */ + lua_pushvalue(L, arg + 1); /* value (hook function) */ + lua_rawset(L, -3); /* hooktable[L1] = new Lua hook */ + lua_sethook(L1, func, mask, count); return 0; } @@ -327,16 +364,18 @@ static int db_gethook (lua_State *L) { char buff[5]; int mask = lua_gethookmask(L1); lua_Hook hook = lua_gethook(L1); - if (hook != NULL && hook != hookf) /* external hook? */ + if (hook == NULL) /* no hook? */ + lua_pushnil(L); + else if (hook != hookf) /* external hook? */ lua_pushliteral(L, "external hook"); - else { - gethooktable(L); + else { /* hook table must exist */ + lua_rawgetp(L, LUA_REGISTRYINDEX, &HOOKKEY); lua_pushthread(L1); lua_xmove(L1, L, 1); - lua_rawget(L, -2); /* get hook */ + lua_rawget(L, -2); /* 1st result = hooktable[L1] */ lua_remove(L, -2); /* remove hook table */ } - lua_pushstring(L, unmakemask(mask, buff)); - lua_pushinteger(L, lua_gethookcount(L1)); + lua_pushstring(L, unmakemask(mask, buff)); /* 2nd result = mask */ + lua_pushinteger(L, lua_gethookcount(L1)); /* 3rd result = count */ return 3; } @@ -344,13 +383,13 @@ static int db_gethook (lua_State *L) { static int db_debug (lua_State *L) { for (;;) { char buffer[250]; - luai_writestringerror("%s", "lua_debug> "); + lua_writestringerror("%s", "lua_debug> "); if (fgets(buffer, sizeof(buffer), stdin) == 0 || strcmp(buffer, "cont\n") == 0) return 0; if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || lua_pcall(L, 0, 0, 0)) - luai_writestringerror("%s\n", lua_tostring(L, -1)); + lua_writestringerror("%s\n", lua_tostring(L, -1)); lua_settop(L, 0); /* remove eventual returns */ } } @@ -363,7 +402,7 @@ static int db_traceback (lua_State *L) { if (msg == NULL && !lua_isnoneornil(L, arg + 1)) /* non-string 'msg'? */ lua_pushvalue(L, arg + 1); /* return it untouched */ else { - int level = luaL_optint(L, arg + 2, (L == L1) ? 1 : 0); + int level = (int)luaL_optinteger(L, arg + 2, (L == L1) ? 1 : 0); luaL_traceback(L, L1, msg, level); } return 1; diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldebug.c b/3rdparty/genie/src/host/lua-5.3.0/src/ldebug.c index 20d663efff3..6986bf0f609 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldebug.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ldebug.c @@ -1,18 +1,19 @@ /* -** $Id: ldebug.c,v 2.90.1.3 2013/05/16 16:04:15 roberto Exp $ +** $Id: ldebug.c,v 2.110 2015/01/02 12:52:22 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ +#define ldebug_c +#define LUA_CORE + +#include "lprefix.h" + #include <stdarg.h> #include <stddef.h> #include <string.h> - -#define ldebug_c -#define LUA_CORE - #include "lua.h" #include "lapi.h" @@ -50,7 +51,7 @@ static int currentline (CallInfo *ci) { /* ** this function can be called asynchronous (e.g. during a signal) */ -LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { +LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { if (func == NULL || mask == 0) { /* turn off hooks? */ mask = 0; func = NULL; @@ -61,7 +62,6 @@ LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { L->basehookcount = count; resethookcount(L); L->hookmask = cast_byte(mask); - return 1; } @@ -167,9 +167,10 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { StkId pos = 0; /* to avoid warnings */ const char *name = findlocal(L, ar->i_ci, n, &pos); lua_lock(L); - if (name) + if (name) { setobjs2s(L, pos, L->top - 1); - L->top--; /* pop value */ + L->top--; /* pop value */ + } lua_unlock(L); return name; } @@ -272,7 +273,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { if (*what == '>') { ci = NULL; func = L->top - 1; - api_check(L, ttisfunction(func), "function expected"); + api_check(ttisfunction(func), "function expected"); what++; /* skip the '>' */ L->top--; /* pop function */ } @@ -366,18 +367,13 @@ static int findsetreg (Proto *p, int lastpc, int reg) { case OP_JMP: { int b = GETARG_sBx(i); int dest = pc + 1 + b; - /* jump is forward and do not skip `lastpc'? */ + /* jump is forward and do not skip 'lastpc'? */ if (pc < dest && dest <= lastpc) { if (dest > jmptarget) jmptarget = dest; /* update 'jmptarget' */ } break; } - case OP_TEST: { - if (reg == a) /* jumped code can change 'a' */ - setreg = filterpc(pc, jmptarget); - break; - } default: if (testAMode(op) && reg == a) /* any instruction that set A */ setreg = filterpc(pc, jmptarget); @@ -443,10 +439,14 @@ static const char *getobjname (Proto *p, int lastpc, int reg, static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { - TMS tm; + TMS tm = (TMS)0; /* to avoid warnings */ Proto *p = ci_func(ci)->p; /* calling function */ int pc = currentpc(ci); /* calling instruction index */ Instruction i = p->code[pc]; /* calling instruction */ + if (ci->callstatus & CIST_HOOKED) { /* was it called inside a hook? */ + *name = "?"; + return "hook"; + } switch (GET_OPCODE(i)) { case OP_CALL: case OP_TAILCALL: /* get function name */ @@ -456,25 +456,27 @@ static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { return "for iterator"; } /* all other instructions can call only through metamethods */ - case OP_SELF: - case OP_GETTABUP: - case OP_GETTABLE: tm = TM_INDEX; break; - case OP_SETTABUP: - case OP_SETTABLE: tm = TM_NEWINDEX; break; - case OP_EQ: tm = TM_EQ; break; - case OP_ADD: tm = TM_ADD; break; - case OP_SUB: tm = TM_SUB; break; - case OP_MUL: tm = TM_MUL; break; - case OP_DIV: tm = TM_DIV; break; - case OP_MOD: tm = TM_MOD; break; - case OP_POW: tm = TM_POW; break; + case OP_SELF: case OP_GETTABUP: case OP_GETTABLE: + tm = TM_INDEX; + break; + case OP_SETTABUP: case OP_SETTABLE: + tm = TM_NEWINDEX; + break; + case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD: + case OP_POW: case OP_DIV: case OP_IDIV: case OP_BAND: + case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: { + int offset = cast_int(GET_OPCODE(i)) - cast_int(OP_ADD); /* ORDER OP */ + tm = cast(TMS, offset + cast_int(TM_ADD)); /* ORDER TM */ + break; + } case OP_UNM: tm = TM_UNM; break; + case OP_BNOT: tm = TM_BNOT; break; case OP_LEN: tm = TM_LEN; break; + case OP_CONCAT: tm = TM_CONCAT; break; + case OP_EQ: tm = TM_EQ; break; case OP_LT: tm = TM_LT; break; case OP_LE: tm = TM_LE; break; - case OP_CONCAT: tm = TM_CONCAT; break; - default: - return NULL; /* else no useful name can be found */ + default: lua_assert(0); /* other instructions cannot call a function */ } *name = getstr(G(L)->tmname[tm]); return "metamethod"; @@ -485,17 +487,21 @@ static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { /* -** only ANSI way to check whether a pointer points to an array -** (used only for error messages, so efficiency is not a big concern) +** The subtraction of two potentially unrelated pointers is +** not ISO C, but it should not crash a program; the subsequent +** checks are ISO C and ensure a correct result. */ static int isinstack (CallInfo *ci, const TValue *o) { - StkId p; - for (p = ci->u.l.base; p < ci->top; p++) - if (o == p) return 1; - return 0; + ptrdiff_t i = o - ci->u.l.base; + return (0 <= i && i < (ci->top - ci->u.l.base) && ci->u.l.base + i == o); } +/* +** Checks whether value 'o' came from an upvalue. (That can only happen +** with instructions OP_GETTABUP/OP_SETTABUP, which operate directly on +** upvalues.) +*/ static const char *getupvalname (CallInfo *ci, const TValue *o, const char **name) { LClosure *c = ci_func(ci); @@ -510,10 +516,9 @@ static const char *getupvalname (CallInfo *ci, const TValue *o, } -l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) { +static const char *varinfo (lua_State *L, const TValue *o) { + const char *name = NULL; /* to avoid warnings */ CallInfo *ci = L->ci; - const char *name = NULL; - const char *t = objtypename(o); const char *kind = NULL; if (isLua(ci)) { kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */ @@ -521,26 +526,39 @@ l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) { kind = getobjname(ci_func(ci)->p, currentpc(ci), cast_int(o - ci->u.l.base), &name); } - if (kind) - luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", - op, kind, name, t); - else - luaG_runerror(L, "attempt to %s a %s value", op, t); + return (kind) ? luaO_pushfstring(L, " (%s '%s')", kind, name) : ""; +} + + +l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) { + const char *t = objtypename(o); + luaG_runerror(L, "attempt to %s a %s value%s", op, t, varinfo(L, o)); } -l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2) { - if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; - lua_assert(!ttisstring(p1) && !ttisnumber(p1)); +l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2) { + if (ttisstring(p1) || cvt2str(p1)) p1 = p2; luaG_typeerror(L, p1, "concatenate"); } -l_noret luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { - TValue temp; - if (luaV_tonumber(p1, &temp) == NULL) - p2 = p1; /* first operand is wrong */ - luaG_typeerror(L, p2, "perform arithmetic on"); +l_noret luaG_opinterror (lua_State *L, const TValue *p1, + const TValue *p2, const char *msg) { + lua_Number temp; + if (!tonumber(p1, &temp)) /* first operand is wrong? */ + p2 = p1; /* now second is wrong */ + luaG_typeerror(L, p2, msg); +} + + +/* +** Error when both values are convertible to numbers, but not to integers +*/ +l_noret luaG_tointerror (lua_State *L, const TValue *p1, const TValue *p2) { + lua_Integer temp; + if (!tointeger(p1, &temp)) + p2 = p1; + luaG_runerror(L, "number%s has no integer representation", varinfo(L, p2)); } @@ -573,10 +591,9 @@ static void addinfo (lua_State *L, const char *msg) { l_noret luaG_errormsg (lua_State *L) { if (L->errfunc != 0) { /* is there an error handling function? */ StkId errfunc = restorestack(L, L->errfunc); - if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); setobjs2s(L, L->top, L->top - 1); /* move argument */ setobjs2s(L, L->top - 1, errfunc); /* push function */ - L->top++; + L->top++; /* assume EXTRA_STACK */ luaD_call(L, L->top - 2, 1, 0); /* call it */ } luaD_throw(L, LUA_ERRRUN); @@ -591,3 +608,36 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { luaG_errormsg(L); } + +void luaG_traceexec (lua_State *L) { + CallInfo *ci = L->ci; + lu_byte mask = L->hookmask; + int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); + if (counthook) + resethookcount(L); /* reset count */ + if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ + ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ + return; /* do not call hook again (VM yielded, so it did not move) */ + } + if (counthook) + luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ + if (mask & LUA_MASKLINE) { + Proto *p = ci_func(ci)->p; + int npc = pcRel(ci->u.l.savedpc, p); + int newline = getfuncline(p, npc); + if (npc == 0 || /* call linehook when enter a new function, */ + ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */ + newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */ + luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ + } + L->oldpc = ci->u.l.savedpc; + if (L->status == LUA_YIELD) { /* did hook yield? */ + if (counthook) + L->hookcount = 1; /* undo decrement to zero */ + ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ + ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ + ci->func = L->top - 1; /* protect stack below results */ + luaD_throw(L, LUA_YIELD); + } +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldebug.h b/3rdparty/genie/src/host/lua-5.3.0/src/ldebug.h index 6445c763ea5..0d8966ca9a6 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldebug.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ldebug.h @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: ldebug.h,v 2.12 2014/11/10 14:46:05 roberto Exp $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ @@ -13,7 +13,7 @@ #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) -#define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) +#define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) #define resethookcount(L) (L->hookcount = L->basehookcount) @@ -23,12 +23,18 @@ LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *opname); -LUAI_FUNC l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2); -LUAI_FUNC l_noret luaG_aritherror (lua_State *L, const TValue *p1, +LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, + const TValue *p2); +LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, + const TValue *p2, + const char *msg); +LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2); LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); LUAI_FUNC l_noret luaG_errormsg (lua_State *L); +LUAI_FUNC void luaG_traceexec (lua_State *L); + #endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldo.c b/3rdparty/genie/src/host/lua-5.3.0/src/ldo.c index e9dd5fa9519..6159e51da2d 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldo.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ldo.c @@ -1,17 +1,19 @@ /* -** $Id: ldo.c,v 2.108.1.3 2013/11/08 18:22:50 roberto Exp $ +** $Id: ldo.c,v 2.135 2014/11/11 17:13:39 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ +#define ldo_c +#define LUA_CORE + +#include "lprefix.h" + #include <setjmp.h> #include <stdlib.h> #include <string.h> -#define ldo_c -#define LUA_CORE - #include "lua.h" #include "lapi.h" @@ -33,6 +35,8 @@ +#define errorstatus(s) ((s) > LUA_YIELD) + /* ** {====================================================== @@ -46,30 +50,33 @@ ** C++ code, with _longjmp/_setjmp when asked to use them, and with ** longjmp/setjmp otherwise. */ -#if !defined(LUAI_THROW) +#if !defined(LUAI_THROW) /* { */ + +#if defined(__cplusplus) && !defined(LUA_USE_LONGJMP) /* { */ -#if defined(__cplusplus) && !defined(LUA_USE_LONGJMP) /* C++ exceptions */ #define LUAI_THROW(L,c) throw(c) #define LUAI_TRY(L,c,a) \ try { a } catch(...) { if ((c)->status == 0) (c)->status = -1; } #define luai_jmpbuf int /* dummy variable */ -#elif defined(LUA_USE_ULONGJMP) -/* in Unix, try _longjmp/_setjmp (more efficient) */ +#elif defined(LUA_USE_POSIX) /* }{ */ + +/* in POSIX, try _longjmp/_setjmp (more efficient) */ #define LUAI_THROW(L,c) _longjmp((c)->b, 1) #define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } #define luai_jmpbuf jmp_buf -#else -/* default handling with long jumps */ +#else /* }{ */ + +/* ISO C handling with long jumps */ #define LUAI_THROW(L,c) longjmp((c)->b, 1) #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } #define luai_jmpbuf jmp_buf -#endif +#endif /* } */ -#endif +#endif /* } */ @@ -106,15 +113,19 @@ l_noret luaD_throw (lua_State *L, int errcode) { LUAI_THROW(L, L->errorJmp); /* jump to it */ } else { /* thread has no error handler */ + global_State *g = G(L); L->status = cast_byte(errcode); /* mark it as dead */ - if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */ - setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */ - luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */ + if (g->mainthread->errorJmp) { /* main thread has a handler? */ + setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */ + luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ } else { /* no handler at all; abort */ - if (G(L)->panic) { /* panic function? */ + if (g->panic) { /* panic function? */ + seterrorobj(L, errcode, L->top); /* assume EXTRA_STACK */ + if (L->ci->top < L->top) + L->ci->top = L->top; /* pushing msg. can break this invariant */ lua_unlock(L); - G(L)->panic(L); /* call it (last chance to jump out) */ + g->panic(L); /* call panic function (last chance to jump out) */ } abort(); } @@ -141,10 +152,10 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { static void correctstack (lua_State *L, TValue *oldstack) { CallInfo *ci; - GCObject *up; + UpVal *up; L->top = (L->top - oldstack) + L->stack; - for (up = L->openupval; up != NULL; up = up->gch.next) - gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; + for (up = L->openupval; up != NULL; up = up->u.open.next) + up->v = (up->v - oldstack) + L->stack; for (ci = L->ci; ci != NULL; ci = ci->previous) { ci->top = (ci->top - oldstack) + L->stack; ci->func = (ci->func - oldstack) + L->stack; @@ -206,7 +217,11 @@ void luaD_shrinkstack (lua_State *L) { int inuse = stackinuse(L); int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; - if (inuse > LUAI_MAXSTACK || /* handling stack overflow? */ + if (L->stacksize > LUAI_MAXSTACK) /* was handling stack overflow? */ + luaE_freeCI(L); /* free all CIs (list grew because of an error) */ + else + luaE_shrinkCI(L); /* shrink list */ + if (inuse > LUAI_MAXSTACK || /* still handling stack overflow? */ goodsize >= L->stacksize) /* would grow instead of shrink? */ condmovestack(L); /* don't change stack (change only for debugging) */ else @@ -271,18 +286,21 @@ static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { } -static StkId tryfuncTM (lua_State *L, StkId func) { +/* +** Check whether __call metafield of 'func' is a function. If so, put +** it in stack below original 'func' so that 'luaD_precall' can call +** it. Raise an error if __call metafield is not a function. +*/ +static void tryfuncTM (lua_State *L, StkId func) { const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); StkId p; - ptrdiff_t funcr = savestack(L, func); if (!ttisfunction(tm)) luaG_typeerror(L, func, "call"); - /* Open a hole inside the stack at `func' */ - for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); - incr_top(L); - func = restorestack(L, funcr); /* previous call may change stack */ + /* Open a hole inside the stack at 'func' */ + for (p = L->top; p > func; p--) + setobjs2s(L, p, p-1); + L->top++; /* slot ensured by caller */ setobj2s(L, func, tm); /* tag method is the new function to be called */ - return func; } @@ -352,7 +370,9 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { return 0; } default: { /* not a function */ - func = tryfuncTM(L, func); /* retry with 'function' tag method */ + luaD_checkstack(L, 1); /* ensure space for metamethod */ + func = restorestack(L, funcr); /* previous call may change stack */ + tryfuncTM(L, func); /* try to get '__call' metamethod */ return luaD_precall(L, func, nresults); /* now it must be a function */ } } @@ -405,24 +425,27 @@ void luaD_call (lua_State *L, StkId func, int nResults, int allowyield) { } -static void finishCcall (lua_State *L) { +/* +** Completes the execution of an interrupted C function, calling its +** continuation function. +*/ +static void finishCcall (lua_State *L, int status) { CallInfo *ci = L->ci; int n; - lua_assert(ci->u.c.k != NULL); /* must have a continuation */ - lua_assert(L->nny == 0); + /* must have a continuation and must be able to call it */ + lua_assert(ci->u.c.k != NULL && L->nny == 0); + /* error status can only happen in a protected call */ + lua_assert((ci->callstatus & CIST_YPCALL) || status == LUA_YIELD); if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */ ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */ L->errfunc = ci->u.c.old_errfunc; } - /* finish 'lua_callk'/'lua_pcall' */ + /* finish 'lua_callk'/'lua_pcall'; CIST_YPCALL and 'errfunc' already + handled */ adjustresults(L, ci->nresults); /* call continuation function */ - if (!(ci->callstatus & CIST_STAT)) /* no call status? */ - ci->u.c.status = LUA_YIELD; /* 'default' status */ - lua_assert(ci->u.c.status != LUA_OK); - ci->callstatus = (ci->callstatus & ~(CIST_YPCALL | CIST_STAT)) | CIST_YIELDED; lua_unlock(L); - n = (*ci->u.c.k)(L); + n = (*ci->u.c.k)(L, status, ci->u.c.ctx); lua_lock(L); api_checknelems(L, n); /* finish 'luaD_precall' */ @@ -430,13 +453,20 @@ static void finishCcall (lua_State *L) { } +/* +** Executes "full continuation" (everything in the stack) of a +** previously interrupted coroutine until the stack is empty (or another +** interruption long-jumps out of the loop). If the coroutine is +** recovering from an error, 'ud' points to the error status, which must +** be passed to the first continuation function (otherwise the default +** status is LUA_YIELD). +*/ static void unroll (lua_State *L, void *ud) { - UNUSED(ud); - for (;;) { - if (L->ci == &L->base_ci) /* stack is empty? */ - return; /* coroutine finished normally */ + if (ud != NULL) /* error status? */ + finishCcall(L, *(int *)ud); /* finish 'lua_pcallk' callee */ + while (L->ci != &L->base_ci) { /* something in the stack */ if (!isLua(L->ci)) /* C function? */ - finishCcall(L); + finishCcall(L, LUA_YIELD); /* complete its execution */ else { /* Lua function */ luaV_finishOp(L); /* finish interrupted instruction */ luaV_execute(L); /* execute down to higher C 'boundary' */ @@ -446,7 +476,8 @@ static void unroll (lua_State *L, void *ud) { /* -** check whether thread has a suspended protected call +** Try to find a suspended protected call (a "recover point") for the +** given thread. */ static CallInfo *findpcall (lua_State *L) { CallInfo *ci; @@ -458,6 +489,11 @@ static CallInfo *findpcall (lua_State *L) { } +/* +** Recovers from an error in a coroutine. Finds a recover point (if +** there is one) and completes the execution of the interrupted +** 'luaD_pcall'. If there is no recover point, returns zero. +*/ static int recover (lua_State *L, int status) { StkId oldtop; CallInfo *ci = findpcall(L); @@ -467,12 +503,10 @@ static int recover (lua_State *L, int status) { luaF_close(L, oldtop); seterrorobj(L, status, oldtop); L->ci = ci; - L->allowhook = ci->u.c.old_allowhook; + L->allowhook = getoah(ci->callstatus); /* restore original 'allowhook' */ L->nny = 0; /* should be zero to be yieldable */ luaD_shrinkstack(L); L->errfunc = ci->u.c.old_errfunc; - ci->callstatus |= CIST_STAT; /* call has error status */ - ci->u.c.status = status; /* (here it is) */ return 1; /* continue running the coroutine */ } @@ -491,7 +525,11 @@ static l_noret resume_error (lua_State *L, const char *msg, StkId firstArg) { /* -** do the work for 'lua_resume' in protected mode +** Do the work for 'lua_resume' in protected mode. Most of the work +** depends on the status of the coroutine: initial state, suspended +** inside a hook, or regularly suspended (optionally with a continuation +** function), plus erroneous cases: non-suspended coroutine or dead +** coroutine. */ static void resume (lua_State *L, void *ud) { int nCcalls = L->nCcalls; @@ -509,24 +547,22 @@ static void resume (lua_State *L, void *ud) { else if (L->status != LUA_YIELD) resume_error(L, "cannot resume dead coroutine", firstArg); else { /* resuming from previous yield */ - L->status = LUA_OK; + L->status = LUA_OK; /* mark that it is running (again) */ ci->func = restorestack(L, ci->extra); if (isLua(ci)) /* yielded inside a hook? */ luaV_execute(L); /* just continue running Lua code */ else { /* 'common' yield */ - if (ci->u.c.k != NULL) { /* does it have a continuation? */ + if (ci->u.c.k != NULL) { /* does it have a continuation function? */ int n; - ci->u.c.status = LUA_YIELD; /* 'default' status */ - ci->callstatus |= CIST_YIELDED; lua_unlock(L); - n = (*ci->u.c.k)(L); /* call continuation */ + n = (*ci->u.c.k)(L, LUA_YIELD, ci->u.c.ctx); /* call continuation */ lua_lock(L); api_checknelems(L, n); firstArg = L->top - n; /* yield results come from continuation */ } luaD_poscall(L, firstArg); /* finish 'luaD_precall' */ } - unroll(L, NULL); + unroll(L, NULL); /* run continuation */ } lua_assert(nCcalls == L->nCcalls); } @@ -534,7 +570,7 @@ static void resume (lua_State *L, void *ud) { LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { int status; - int oldnny = L->nny; /* save 'nny' */ + int oldnny = L->nny; /* save "number of non-yieldable" calls */ lua_lock(L); luai_userstateresume(L, nargs); L->nCcalls = (from) ? from->nCcalls + 1 : 1; @@ -543,18 +579,17 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { status = luaD_rawrunprotected(L, resume, L->top - nargs); if (status == -1) /* error calling 'lua_resume'? */ status = LUA_ERRRUN; - else { /* yield or regular error */ - while (status != LUA_OK && status != LUA_YIELD) { /* error? */ - if (recover(L, status)) /* recover point? */ - status = luaD_rawrunprotected(L, unroll, NULL); /* run continuation */ - else { /* unrecoverable error */ - L->status = cast_byte(status); /* mark thread as `dead' */ - seterrorobj(L, status, L->top); - L->ci->top = L->top; - break; - } + else { /* continue running after recoverable errors */ + while (errorstatus(status) && recover(L, status)) { + /* unroll continuation */ + status = luaD_rawrunprotected(L, unroll, &status); + } + if (errorstatus(status)) { /* unrecoverable error? */ + L->status = cast_byte(status); /* mark thread as 'dead' */ + seterrorobj(L, status, L->top); /* push error message */ + L->ci->top = L->top; } - lua_assert(status == L->status); + else lua_assert(status == L->status); /* normal end or yield */ } L->nny = oldnny; /* restore 'nny' */ L->nCcalls--; @@ -564,7 +599,13 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { } -LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) { +LUA_API int lua_isyieldable (lua_State *L) { + return (L->nny == 0); +} + + +LUA_API int lua_yieldk (lua_State *L, int nresults, lua_KContext ctx, + lua_KFunction k) { CallInfo *ci = L->ci; luai_userstateyield(L, nresults); lua_lock(L); @@ -578,7 +619,7 @@ LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) { L->status = LUA_YIELD; ci->extra = savestack(L, ci->func); /* save current 'func' */ if (isLua(ci)) { /* inside a hook? */ - api_check(L, k == NULL, "hooks cannot continue after yielding"); + api_check(k == NULL, "hooks cannot continue after yielding"); } else { if ((ci->u.c.k = k) != NULL) /* is there a continuation? */ @@ -619,7 +660,7 @@ int luaD_pcall (lua_State *L, Pfunc func, void *u, /* ** Execute a protected parser. */ -struct SParser { /* data to `f_parser' */ +struct SParser { /* data to 'f_parser' */ ZIO *z; Mbuffer buff; /* dynamic structure used by the scanner */ Dyndata dyd; /* dynamic structures used by the parser */ @@ -631,15 +672,14 @@ struct SParser { /* data to `f_parser' */ static void checkmode (lua_State *L, const char *mode, const char *x) { if (mode && strchr(mode, x[0]) == NULL) { luaO_pushfstring(L, - "attempt to load a %s chunk (mode is " LUA_QS ")", x, mode); + "attempt to load a %s chunk (mode is '%s')", x, mode); luaD_throw(L, LUA_ERRSYNTAX); } } static void f_parser (lua_State *L, void *ud) { - int i; - Closure *cl; + LClosure *cl; struct SParser *p = cast(struct SParser *, ud); int c = zgetc(p->z); /* read first character */ if (c == LUA_SIGNATURE[0]) { @@ -650,12 +690,8 @@ static void f_parser (lua_State *L, void *ud) { checkmode(L, p->mode, "text"); cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); } - lua_assert(cl->l.nupvalues == cl->l.p->sizeupvalues); - for (i = 0; i < cl->l.nupvalues; i++) { /* initialize upvalues */ - UpVal *up = luaF_newupval(L); - cl->l.upvals[i] = up; - luaC_objbarrier(L, cl, up); - } + lua_assert(cl->nupvalues == cl->p->sizeupvalues); + luaF_initupvals(L, cl); } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ldo.h b/3rdparty/genie/src/host/lua-5.3.0/src/ldo.h index d3d3082c9ba..05745c8ad8d 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ldo.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ldo.h @@ -1,5 +1,5 @@ /* -** $Id: ldo.h,v 2.20.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: ldo.h,v 2.21 2014/10/25 11:50:46 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -23,7 +23,7 @@ #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) -/* type of protected functions, to be ran by `runprotected' */ +/* type of protected functions, to be ran by 'runprotected' */ typedef void (*Pfunc) (lua_State *L, void *ud); LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/ldump.c b/3rdparty/genie/src/host/lua-5.3.0/src/ldump.c new file mode 100644 index 00000000000..b6c7114f5d9 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ldump.c @@ -0,0 +1,214 @@ +/* +** $Id: ldump.c,v 2.34 2014/11/02 19:19:04 roberto Exp $ +** save precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#define ldump_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <stddef.h> + +#include "lua.h" + +#include "lobject.h" +#include "lstate.h" +#include "lundump.h" + + +typedef struct { + lua_State *L; + lua_Writer writer; + void *data; + int strip; + int status; +} DumpState; + + +/* +** All high-level dumps go through DumpVector; you can change it to +** change the endianness of the result +*/ +#define DumpVector(v,n,D) DumpBlock(v,(n)*sizeof((v)[0]),D) + +#define DumpLiteral(s,D) DumpBlock(s, sizeof(s) - sizeof(char), D) + + +static void DumpBlock (const void *b, size_t size, DumpState *D) { + if (D->status == 0) { + lua_unlock(D->L); + D->status = (*D->writer)(D->L, b, size, D->data); + lua_lock(D->L); + } +} + + +#define DumpVar(x,D) DumpVector(&x,1,D) + + +static void DumpByte (int y, DumpState *D) { + lu_byte x = (lu_byte)y; + DumpVar(x, D); +} + + +static void DumpInt (int x, DumpState *D) { + DumpVar(x, D); +} + + +static void DumpNumber (lua_Number x, DumpState *D) { + DumpVar(x, D); +} + + +static void DumpInteger (lua_Integer x, DumpState *D) { + DumpVar(x, D); +} + + +static void DumpString (const TString *s, DumpState *D) { + if (s == NULL) + DumpByte(0, D); + else { + size_t size = s->len + 1; /* include trailing '\0' */ + if (size < 0xFF) + DumpByte(cast_int(size), D); + else { + DumpByte(0xFF, D); + DumpVar(size, D); + } + DumpVector(getstr(s), size - 1, D); /* no need to save '\0' */ + } +} + + +static void DumpCode (const Proto *f, DumpState *D) { + DumpInt(f->sizecode, D); + DumpVector(f->code, f->sizecode, D); +} + + +static void DumpFunction(const Proto *f, TString *psource, DumpState *D); + +static void DumpConstants (const Proto *f, DumpState *D) { + int i; + int n = f->sizek; + DumpInt(n, D); + for (i = 0; i < n; i++) { + const TValue *o = &f->k[i]; + DumpByte(ttype(o), D); + switch (ttype(o)) { + case LUA_TNIL: + break; + case LUA_TBOOLEAN: + DumpByte(bvalue(o), D); + break; + case LUA_TNUMFLT: + DumpNumber(fltvalue(o), D); + break; + case LUA_TNUMINT: + DumpInteger(ivalue(o), D); + break; + case LUA_TSHRSTR: + case LUA_TLNGSTR: + DumpString(tsvalue(o), D); + break; + default: + lua_assert(0); + } + } +} + + +static void DumpProtos (const Proto *f, DumpState *D) { + int i; + int n = f->sizep; + DumpInt(n, D); + for (i = 0; i < n; i++) + DumpFunction(f->p[i], f->source, D); +} + + +static void DumpUpvalues (const Proto *f, DumpState *D) { + int i, n = f->sizeupvalues; + DumpInt(n, D); + for (i = 0; i < n; i++) { + DumpByte(f->upvalues[i].instack, D); + DumpByte(f->upvalues[i].idx, D); + } +} + + +static void DumpDebug (const Proto *f, DumpState *D) { + int i, n; + n = (D->strip) ? 0 : f->sizelineinfo; + DumpInt(n, D); + DumpVector(f->lineinfo, n, D); + n = (D->strip) ? 0 : f->sizelocvars; + DumpInt(n, D); + for (i = 0; i < n; i++) { + DumpString(f->locvars[i].varname, D); + DumpInt(f->locvars[i].startpc, D); + DumpInt(f->locvars[i].endpc, D); + } + n = (D->strip) ? 0 : f->sizeupvalues; + DumpInt(n, D); + for (i = 0; i < n; i++) + DumpString(f->upvalues[i].name, D); +} + + +static void DumpFunction (const Proto *f, TString *psource, DumpState *D) { + if (D->strip || f->source == psource) + DumpString(NULL, D); /* no debug info or same source as its parent */ + else + DumpString(f->source, D); + DumpInt(f->linedefined, D); + DumpInt(f->lastlinedefined, D); + DumpByte(f->numparams, D); + DumpByte(f->is_vararg, D); + DumpByte(f->maxstacksize, D); + DumpCode(f, D); + DumpConstants(f, D); + DumpUpvalues(f, D); + DumpProtos(f, D); + DumpDebug(f, D); +} + + +static void DumpHeader (DumpState *D) { + DumpLiteral(LUA_SIGNATURE, D); + DumpByte(LUAC_VERSION, D); + DumpByte(LUAC_FORMAT, D); + DumpLiteral(LUAC_DATA, D); + DumpByte(sizeof(int), D); + DumpByte(sizeof(size_t), D); + DumpByte(sizeof(Instruction), D); + DumpByte(sizeof(lua_Integer), D); + DumpByte(sizeof(lua_Number), D); + DumpInteger(LUAC_INT, D); + DumpNumber(LUAC_NUM, D); +} + + +/* +** dump Lua function as precompiled chunk +*/ +int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data, + int strip) { + DumpState D; + D.L = L; + D.writer = w; + D.data = data; + D.strip = strip; + D.status = 0; + DumpHeader(&D); + DumpByte(f->sizeupvalues, &D); + DumpFunction(f, NULL, &D); + return D.status; +} + diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lfunc.c b/3rdparty/genie/src/host/lua-5.3.0/src/lfunc.c new file mode 100644 index 00000000000..67967dab3fc --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lfunc.c @@ -0,0 +1,151 @@ +/* +** $Id: lfunc.c,v 2.45 2014/11/02 19:19:04 roberto Exp $ +** Auxiliary functions to manipulate prototypes and closures +** See Copyright Notice in lua.h +*/ + +#define lfunc_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <stddef.h> + +#include "lua.h" + +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" + + + +CClosure *luaF_newCclosure (lua_State *L, int n) { + GCObject *o = luaC_newobj(L, LUA_TCCL, sizeCclosure(n)); + CClosure *c = gco2ccl(o); + c->nupvalues = cast_byte(n); + return c; +} + + +LClosure *luaF_newLclosure (lua_State *L, int n) { + GCObject *o = luaC_newobj(L, LUA_TLCL, sizeLclosure(n)); + LClosure *c = gco2lcl(o); + c->p = NULL; + c->nupvalues = cast_byte(n); + while (n--) c->upvals[n] = NULL; + return c; +} + +/* +** fill a closure with new closed upvalues +*/ +void luaF_initupvals (lua_State *L, LClosure *cl) { + int i; + for (i = 0; i < cl->nupvalues; i++) { + UpVal *uv = luaM_new(L, UpVal); + uv->refcount = 1; + uv->v = &uv->u.value; /* make it closed */ + setnilvalue(uv->v); + cl->upvals[i] = uv; + } +} + + +UpVal *luaF_findupval (lua_State *L, StkId level) { + UpVal **pp = &L->openupval; + UpVal *p; + UpVal *uv; + lua_assert(isintwups(L) || L->openupval == NULL); + while (*pp != NULL && (p = *pp)->v >= level) { + lua_assert(upisopen(p)); + if (p->v == level) /* found a corresponding upvalue? */ + return p; /* return it */ + pp = &p->u.open.next; + } + /* not found: create a new upvalue */ + uv = luaM_new(L, UpVal); + uv->refcount = 0; + uv->u.open.next = *pp; /* link it to list of open upvalues */ + uv->u.open.touched = 1; + *pp = uv; + uv->v = level; /* current value lives in the stack */ + if (!isintwups(L)) { /* thread not in list of threads with upvalues? */ + L->twups = G(L)->twups; /* link it to the list */ + G(L)->twups = L; + } + return uv; +} + + +void luaF_close (lua_State *L, StkId level) { + UpVal *uv; + while (L->openupval != NULL && (uv = L->openupval)->v >= level) { + lua_assert(upisopen(uv)); + L->openupval = uv->u.open.next; /* remove from 'open' list */ + if (uv->refcount == 0) /* no references? */ + luaM_free(L, uv); /* free upvalue */ + else { + setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */ + uv->v = &uv->u.value; /* now current value lives here */ + luaC_upvalbarrier(L, uv); + } + } +} + + +Proto *luaF_newproto (lua_State *L) { + GCObject *o = luaC_newobj(L, LUA_TPROTO, sizeof(Proto)); + Proto *f = gco2p(o); + f->k = NULL; + f->sizek = 0; + f->p = NULL; + f->sizep = 0; + f->code = NULL; + f->cache = NULL; + f->sizecode = 0; + f->lineinfo = NULL; + f->sizelineinfo = 0; + f->upvalues = NULL; + f->sizeupvalues = 0; + f->numparams = 0; + f->is_vararg = 0; + f->maxstacksize = 0; + f->locvars = NULL; + f->sizelocvars = 0; + f->linedefined = 0; + f->lastlinedefined = 0; + f->source = NULL; + return f; +} + + +void luaF_freeproto (lua_State *L, Proto *f) { + luaM_freearray(L, f->code, f->sizecode); + luaM_freearray(L, f->p, f->sizep); + luaM_freearray(L, f->k, f->sizek); + luaM_freearray(L, f->lineinfo, f->sizelineinfo); + luaM_freearray(L, f->locvars, f->sizelocvars); + luaM_freearray(L, f->upvalues, f->sizeupvalues); + luaM_free(L, f); +} + + +/* +** Look for n-th local variable at line 'line' in function 'func'. +** Returns NULL if not found. +*/ +const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { + int i; + for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { + if (pc < f->locvars[i].endpc) { /* is variable active? */ + local_number--; + if (local_number == 0) + return getstr(f->locvars[i].varname); + } + } + return NULL; /* not found */ +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.h b/3rdparty/genie/src/host/lua-5.3.0/src/lfunc.h index ca0d3a3e0b0..256d3cf90bd 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lfunc.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lfunc.h @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.8.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lfunc.h,v 2.14 2014/06/19 18:27:20 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -18,14 +18,35 @@ cast(int, sizeof(TValue *)*((n)-1))) +/* test whether thread is in 'twups' list */ +#define isintwups(L) (L->twups != L) + + +/* +** Upvalues for Lua closures +*/ +struct UpVal { + TValue *v; /* points to stack or to its own value */ + lu_mem refcount; /* reference counter */ + union { + struct { /* (when open) */ + UpVal *next; /* linked list */ + int touched; /* mark to avoid cycles with dead threads */ + } open; + TValue value; /* the value (when closed) */ + } u; +}; + +#define upisopen(up) ((up)->v != &(up)->u.value) + + LUAI_FUNC Proto *luaF_newproto (lua_State *L); -LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems); -LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems); -LUAI_FUNC UpVal *luaF_newupval (lua_State *L); +LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); +LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); +LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); LUAI_FUNC void luaF_close (lua_State *L, StkId level); LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); -LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, int pc); diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lgc.c b/3rdparty/genie/src/host/lua-5.3.0/src/lgc.c index 52460dcdd5a..8b95fb67da0 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lgc.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lgc.c @@ -1,14 +1,17 @@ /* -** $Id: lgc.c,v 2.140.1.2 2013/04/26 18:22:05 roberto Exp $ +** $Id: lgc.c,v 2.201 2014/12/20 13:58:15 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ -#include <string.h> - #define lgc_c #define LUA_CORE +#include "lprefix.h" + + +#include <string.h> + #include "lua.h" #include "ldebug.h" @@ -23,6 +26,11 @@ #include "ltm.h" +/* +** internal state for collector while inside the atomic phase. The +** collector should never be in this state while running regular code. +*/ +#define GCSinsideatomic (GCSpause + 1) /* ** cost of sweeping one element (the size of a small object divided @@ -33,8 +41,8 @@ /* maximum number of elements to sweep in each single step */ #define GCSWEEPMAX (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4)) -/* maximum number of finalizers to call in each GC step */ -#define GCFINALIZENUM 4 +/* cost of calling one finalizer */ +#define GCFINALIZECOST GCSWEEPCOST /* @@ -52,18 +60,18 @@ /* -** 'makewhite' erases all color bits plus the old bit and then -** sets only the current white bit +** 'makewhite' erases all color bits then sets only the current white +** bit */ -#define maskcolors (~(bit2mask(BLACKBIT, OLDBIT) | WHITEBITS)) +#define maskcolors (~(bitmask(BLACKBIT) | WHITEBITS)) #define makewhite(g,x) \ - (gch(x)->marked = cast_byte((gch(x)->marked & maskcolors) | luaC_white(g))) + (x->marked = cast_byte((x->marked & maskcolors) | luaC_white(g))) -#define white2gray(x) resetbits(gch(x)->marked, WHITEBITS) -#define black2gray(x) resetbit(gch(x)->marked, BLACKBIT) +#define white2gray(x) resetbits(x->marked, WHITEBITS) +#define black2gray(x) resetbit(x->marked, BLACKBIT) -#define isfinalized(x) testbit(gch(x)->marked, FINALIZEDBIT) +#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) #define checkdeadkey(n) lua_assert(!ttisdeadkey(gkey(n)) || ttisnil(gval(n))) @@ -75,8 +83,8 @@ #define markvalue(g,o) { checkconsistency(o); \ if (valiswhite(o)) reallymarkobject(g,gcvalue(o)); } -#define markobject(g,t) { if ((t) && iswhite(obj2gco(t))) \ - reallymarkobject(g, obj2gco(t)); } +#define markobject(g,t) \ + { if ((t) && iswhite(t)) reallymarkobject(g, obj2gco(t)); } static void reallymarkobject (global_State *g, GCObject *o); @@ -95,9 +103,9 @@ static void reallymarkobject (global_State *g, GCObject *o); /* -** link table 'h' into list pointed by 'p' +** link collectable object 'o' into list pointed by 'p' */ -#define linktable(h,p) ((h)->gclist = *(p), *(p) = obj2gco(h)) +#define linkgclist(o,p) ((o)->gclist = (p), (p) = obj2gco(o)) /* @@ -107,21 +115,21 @@ static void reallymarkobject (global_State *g, GCObject *o); static void removeentry (Node *n) { lua_assert(ttisnil(gval(n))); if (valiswhite(gkey(n))) - setdeadvalue(gkey(n)); /* unused and unmarked key; remove it */ + setdeadvalue(wgkey(n)); /* unused and unmarked key; remove it */ } /* ** tells whether a key or value can be cleared from a weak ** table. Non-collectable objects are never removed from weak -** tables. Strings behave as `values', so are never removed too. for +** tables. Strings behave as 'values', so are never removed too. for ** other objects: if really collected, cannot keep them; for objects ** being finalized, keep them in keys, but not in values */ static int iscleared (global_State *g, const TValue *o) { if (!iscollectable(o)) return 0; else if (ttisstring(o)) { - markobject(g, rawtsvalue(o)); /* strings are `values', so are never weak */ + markobject(g, tsvalue(o)); /* strings are 'values', so are never weak */ return 0; } else return iswhite(gcvalue(o)); @@ -130,14 +138,14 @@ static int iscleared (global_State *g, const TValue *o) { /* ** barrier that moves collector forward, that is, mark the white object -** being pointed by a black object. +** being pointed by a black object. (If in sweep phase, clear the black +** object to white [sweep it] to avoid other barrier calls for this +** same object.) */ void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { global_State *g = G(L); lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); - lua_assert(g->gcstate != GCSpause); - lua_assert(gch(o)->tt != LUA_TTABLE); - if (keepinvariantout(g)) /* must keep invariant? */ + if (keepinvariant(g)) /* must keep invariant? */ reallymarkobject(g, v); /* restore invariant */ else { /* sweep phase */ lua_assert(issweepphase(g)); @@ -148,78 +156,52 @@ void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { /* ** barrier that moves collector backward, that is, mark the black object -** pointing to a white object as gray again. (Current implementation -** only works for tables; access to 'gclist' is not uniform across -** different types.) +** pointing to a white object as gray again. */ -void luaC_barrierback_ (lua_State *L, GCObject *o) { +void luaC_barrierback_ (lua_State *L, Table *t) { global_State *g = G(L); - lua_assert(isblack(o) && !isdead(g, o) && gch(o)->tt == LUA_TTABLE); - black2gray(o); /* make object gray (again) */ - gco2t(o)->gclist = g->grayagain; - g->grayagain = o; + lua_assert(isblack(t) && !isdead(g, t)); + black2gray(t); /* make table gray (again) */ + linkgclist(t, g->grayagain); } /* -** barrier for prototypes. When creating first closure (cache is -** NULL), use a forward barrier; this may be the only closure of the -** prototype (if it is a "regular" function, with a single instance) -** and the prototype may be big, so it is better to avoid traversing -** it again. Otherwise, use a backward barrier, to avoid marking all -** possible instances. +** barrier for assignments to closed upvalues. Because upvalues are +** shared among closures, it is impossible to know the color of all +** closures pointing to it. So, we assume that the object being assigned +** must be marked. */ -LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c) { +void luaC_upvalbarrier_ (lua_State *L, UpVal *uv) { global_State *g = G(L); - lua_assert(isblack(obj2gco(p))); - if (p->cache == NULL) { /* first time? */ - luaC_objbarrier(L, p, c); - } - else { /* use a backward barrier */ - black2gray(obj2gco(p)); /* make prototype gray (again) */ - p->gclist = g->grayagain; - g->grayagain = obj2gco(p); - } + GCObject *o = gcvalue(uv->v); + lua_assert(!upisopen(uv)); /* ensured by macro luaC_upvalbarrier */ + if (keepinvariant(g)) + markobject(g, o); } -/* -** check color (and invariants) for an upvalue that was closed, -** i.e., moved into the 'allgc' list -*/ -void luaC_checkupvalcolor (global_State *g, UpVal *uv) { - GCObject *o = obj2gco(uv); - lua_assert(!isblack(o)); /* open upvalues are never black */ - if (isgray(o)) { - if (keepinvariant(g)) { - resetoldbit(o); /* see MOVE OLD rule */ - gray2black(o); /* it is being visited now */ - markvalue(g, uv->v); - } - else { - lua_assert(issweepphase(g)); - makewhite(g, o); - } - } +void luaC_fix (lua_State *L, GCObject *o) { + global_State *g = G(L); + lua_assert(g->allgc == o); /* object must be 1st in 'allgc' list! */ + white2gray(o); /* they will be gray forever */ + g->allgc = o->next; /* remove object from 'allgc' list */ + o->next = g->fixedgc; /* link it to 'fixedgc' list */ + g->fixedgc = o; } /* ** create a new collectable object (with given type and size) and link -** it to '*list'. 'offset' tells how many bytes to allocate before the -** object itself (used only by states). +** it to 'allgc' list. */ -GCObject *luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list, - int offset) { +GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { global_State *g = G(L); - char *raw = cast(char *, luaM_newobject(L, novariant(tt), sz)); - GCObject *o = obj2gco(raw + offset); - if (list == NULL) - list = &g->allgc; /* standard list for collectable objects */ - gch(o)->marked = luaC_white(g); - gch(o)->tt = tt; - gch(o)->next = *list; - *list = o; + GCObject *o = cast(GCObject *, luaM_newobject(L, novariant(tt), sz)); + o->marked = luaC_white(g); + o->tt = tt; + o->next = g->allgc; + g->allgc = o; return o; } @@ -241,57 +223,49 @@ GCObject *luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list, ** upvalues are already linked in 'headuv' list.) */ static void reallymarkobject (global_State *g, GCObject *o) { - lu_mem size; + reentry: white2gray(o); - switch (gch(o)->tt) { + switch (o->tt) { case LUA_TSHRSTR: case LUA_TLNGSTR: { - size = sizestring(gco2ts(o)); - break; /* nothing else to mark; make it black */ - } - case LUA_TUSERDATA: { - Table *mt = gco2u(o)->metatable; - markobject(g, mt); - markobject(g, gco2u(o)->env); - size = sizeudata(gco2u(o)); + gray2black(o); + g->GCmemtrav += sizestring(gco2ts(o)); break; } - case LUA_TUPVAL: { - UpVal *uv = gco2uv(o); - markvalue(g, uv->v); - if (uv->v != &uv->u.value) /* open? */ - return; /* open upvalues remain gray */ - size = sizeof(UpVal); + case LUA_TUSERDATA: { + TValue uvalue; + markobject(g, gco2u(o)->metatable); /* mark its metatable */ + gray2black(o); + g->GCmemtrav += sizeudata(gco2u(o)); + getuservalue(g->mainthread, gco2u(o), &uvalue); + if (valiswhite(&uvalue)) { /* markvalue(g, &uvalue); */ + o = gcvalue(&uvalue); + goto reentry; + } break; } case LUA_TLCL: { - gco2lcl(o)->gclist = g->gray; - g->gray = o; - return; + linkgclist(gco2lcl(o), g->gray); + break; } case LUA_TCCL: { - gco2ccl(o)->gclist = g->gray; - g->gray = o; - return; + linkgclist(gco2ccl(o), g->gray); + break; } case LUA_TTABLE: { - linktable(gco2t(o), &g->gray); - return; + linkgclist(gco2t(o), g->gray); + break; } case LUA_TTHREAD: { - gco2th(o)->gclist = g->gray; - g->gray = o; - return; + linkgclist(gco2th(o), g->gray); + break; } case LUA_TPROTO: { - gco2p(o)->gclist = g->gray; - g->gray = o; - return; + linkgclist(gco2p(o), g->gray); + break; } - default: lua_assert(0); return; + default: lua_assert(0); break; } - gray2black(o); - g->GCmemtrav += size; } @@ -310,29 +284,41 @@ static void markmt (global_State *g) { */ static void markbeingfnz (global_State *g) { GCObject *o; - for (o = g->tobefnz; o != NULL; o = gch(o)->next) { - makewhite(g, o); - reallymarkobject(g, o); - } + for (o = g->tobefnz; o != NULL; o = o->next) + markobject(g, o); } /* -** mark all values stored in marked open upvalues. (See comment in -** 'lstate.h'.) +** Mark all values stored in marked open upvalues from non-marked threads. +** (Values from marked threads were already marked when traversing the +** thread.) Remove from the list threads that no longer have upvalues and +** not-marked threads. */ static void remarkupvals (global_State *g) { - UpVal *uv; - for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { - if (isgray(obj2gco(uv))) - markvalue(g, uv->v); + lua_State *thread; + lua_State **p = &g->twups; + while ((thread = *p) != NULL) { + lua_assert(!isblack(thread)); /* threads are never black */ + if (isgray(thread) && thread->openupval != NULL) + p = &thread->twups; /* keep marked thread with upvalues in the list */ + else { /* thread is not marked or without upvalues */ + UpVal *uv; + *p = thread->twups; /* remove thread from the list */ + thread->twups = thread; /* mark that it is out of list */ + for (uv = thread->openupval; uv != NULL; uv = uv->u.open.next) { + if (uv->u.open.touched) { + markvalue(g, uv->v); /* remark upvalue's value */ + uv->u.open.touched = 0; + } + } + } } } /* -** mark root set and reset all gray lists, to start a new -** incremental (or full) collection +** mark root set and reset all gray lists, to start a new collection */ static void restartcollection (global_State *g) { g->gray = g->grayagain = NULL; @@ -352,12 +338,18 @@ static void restartcollection (global_State *g) { ** ======================================================= */ +/* +** Traverse a table with weak values and link it to proper list. During +** propagate phase, keep it in 'grayagain' list, to be revisited in the +** atomic phase. In the atomic phase, if table has any white value, +** put it in 'weak' list, to be cleared. +*/ static void traverseweakvalue (global_State *g, Table *h) { Node *n, *limit = gnodelast(h); - /* if there is array part, assume it may have white values (do not - traverse it just to check) */ + /* if there is array part, assume it may have white values (it is not + worth traversing it now just to check) */ int hasclears = (h->sizearray > 0); - for (n = gnode(h, 0); n < limit; n++) { + for (n = gnode(h, 0); n < limit; n++) { /* traverse hash part */ checkdeadkey(n); if (ttisnil(gval(n))) /* entry is empty? */ removeentry(n); /* remove it */ @@ -368,20 +360,30 @@ static void traverseweakvalue (global_State *g, Table *h) { hasclears = 1; /* table will have to be cleared */ } } - if (hasclears) - linktable(h, &g->weak); /* has to be cleared later */ - else /* no white values */ - linktable(h, &g->grayagain); /* no need to clean */ + if (g->gcstate == GCSpropagate) + linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */ + else if (hasclears) + linkgclist(h, g->weak); /* has to be cleared later */ } +/* +** Traverse an ephemeron table and link it to proper list. Returns true +** iff any object was marked during this traversal (which implies that +** convergence has to continue). During propagation phase, keep table +** in 'grayagain' list, to be visited again in the atomic phase. In +** the atomic phase, if table has any white->white entry, it has to +** be revisited during ephemeron convergence (as that key may turn +** black). Otherwise, if it has any white key, table has to be cleared +** (in the atomic phase). +*/ static int traverseephemeron (global_State *g, Table *h) { int marked = 0; /* true if an object is marked in this traversal */ int hasclears = 0; /* true if table has white keys */ - int prop = 0; /* true if table has entry "white-key -> white-value" */ + int hasww = 0; /* true if table has entry "white-key -> white-value" */ Node *n, *limit = gnodelast(h); - int i; - /* traverse array part (numeric keys are 'strong') */ + unsigned int i; + /* traverse array part */ for (i = 0; i < h->sizearray; i++) { if (valiswhite(&h->array[i])) { marked = 1; @@ -396,26 +398,27 @@ static int traverseephemeron (global_State *g, Table *h) { else if (iscleared(g, gkey(n))) { /* key is not marked (yet)? */ hasclears = 1; /* table must be cleared */ if (valiswhite(gval(n))) /* value not marked yet? */ - prop = 1; /* must propagate again */ + hasww = 1; /* white-white entry */ } else if (valiswhite(gval(n))) { /* value not marked yet? */ marked = 1; reallymarkobject(g, gcvalue(gval(n))); /* mark it now */ } } - if (prop) - linktable(h, &g->ephemeron); /* have to propagate again */ - else if (hasclears) /* does table have white keys? */ - linktable(h, &g->allweak); /* may have to clean white keys */ - else /* no white keys */ - linktable(h, &g->grayagain); /* no need to clean */ + /* link table into proper list */ + if (g->gcstate == GCSpropagate) + linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */ + else if (hasww) /* table has white->white entries? */ + linkgclist(h, g->ephemeron); /* have to propagate again */ + else if (hasclears) /* table has white keys? */ + linkgclist(h, g->allweak); /* may have to clean white keys */ return marked; } static void traversestrongtable (global_State *g, Table *h) { Node *n, *limit = gnodelast(h); - int i; + unsigned int i; for (i = 0; i < h->sizearray; i++) /* traverse array part */ markvalue(g, &h->array[i]); for (n = gnode(h, 0); n < limit; n++) { /* traverse hash part */ @@ -439,13 +442,13 @@ static lu_mem traversetable (global_State *g, Table *h) { ((weakkey = strchr(svalue(mode), 'k')), (weakvalue = strchr(svalue(mode), 'v')), (weakkey || weakvalue))) { /* is really weak? */ - black2gray(obj2gco(h)); /* keep table gray */ + black2gray(h); /* keep table gray */ if (!weakkey) /* strong keys? */ traverseweakvalue(g, h); else if (!weakvalue) /* strong values? */ traverseephemeron(g, h); else /* all weak */ - linktable(h, &g->allweak); /* nothing to traverse now */ + linkgclist(h, g->allweak); /* nothing to traverse now */ } else /* not weak */ traversestrongtable(g, h); @@ -456,7 +459,7 @@ static lu_mem traversetable (global_State *g, Table *h) { static int traverseproto (global_State *g, Proto *f) { int i; - if (f->cache && iswhite(obj2gco(f->cache))) + if (f->cache && iswhite(f->cache)) f->cache = NULL; /* allow cache to be collected */ markobject(g, f->source); for (i = 0; i < f->sizek; i++) /* mark literals */ @@ -483,34 +486,49 @@ static lu_mem traverseCclosure (global_State *g, CClosure *cl) { return sizeCclosure(cl->nupvalues); } +/* +** open upvalues point to values in a thread, so those values should +** be marked when the thread is traversed except in the atomic phase +** (because then the value cannot be changed by the thread and the +** thread may not be traversed again) +*/ static lu_mem traverseLclosure (global_State *g, LClosure *cl) { int i; markobject(g, cl->p); /* mark its prototype */ - for (i = 0; i < cl->nupvalues; i++) /* mark its upvalues */ - markobject(g, cl->upvals[i]); + for (i = 0; i < cl->nupvalues; i++) { /* mark its upvalues */ + UpVal *uv = cl->upvals[i]; + if (uv != NULL) { + if (upisopen(uv) && g->gcstate != GCSinsideatomic) + uv->u.open.touched = 1; /* can be marked in 'remarkupvals' */ + else + markvalue(g, uv->v); + } + } return sizeLclosure(cl->nupvalues); } -static lu_mem traversestack (global_State *g, lua_State *th) { - int n = 0; +static lu_mem traversethread (global_State *g, lua_State *th) { StkId o = th->stack; if (o == NULL) return 1; /* stack not completely built yet */ + lua_assert(g->gcstate == GCSinsideatomic || + th->openupval == NULL || isintwups(th)); for (; o < th->top; o++) /* mark live elements in the stack */ markvalue(g, o); - if (g->gcstate == GCSatomic) { /* final traversal? */ + if (g->gcstate == GCSinsideatomic) { /* final traversal? */ StkId lim = th->stack + th->stacksize; /* real end of stack */ for (; o < lim; o++) /* clear not-marked stack slice */ setnilvalue(o); + /* 'remarkupvals' may have removed thread from 'twups' list */ + if (!isintwups(th) && th->openupval != NULL) { + th->twups = g->twups; /* link it back to the list */ + g->twups = th; + } } - else { /* count call infos to compute size */ - CallInfo *ci; - for (ci = &th->base_ci; ci != th->ci; ci = ci->next) - n++; - } - return sizeof(lua_State) + sizeof(TValue) * th->stacksize + - sizeof(CallInfo) * n; + else if (g->gckind != KGC_EMERGENCY) + luaD_shrinkstack(th); /* do not change stack in emergency cycle */ + return (sizeof(lua_State) + sizeof(TValue) * th->stacksize); } @@ -523,7 +541,7 @@ static void propagatemark (global_State *g) { GCObject *o = g->gray; lua_assert(isgray(o)); gray2black(o); - switch (gch(o)->tt) { + switch (o->tt) { case LUA_TTABLE: { Table *h = gco2t(o); g->gray = h->gclist; /* remove from 'gray' list */ @@ -545,10 +563,9 @@ static void propagatemark (global_State *g) { case LUA_TTHREAD: { lua_State *th = gco2th(o); g->gray = th->gclist; /* remove from 'gray' list */ - th->gclist = g->grayagain; - g->grayagain = o; /* insert into 'grayagain' list */ + linkgclist(th, g->grayagain); /* insert into 'grayagain' list */ black2gray(o); - size = traversestack(g, th); + size = traversethread(g, th); break; } case LUA_TPROTO: { @@ -568,35 +585,12 @@ static void propagateall (global_State *g) { } -static void propagatelist (global_State *g, GCObject *l) { - lua_assert(g->gray == NULL); /* no grays left */ - g->gray = l; - propagateall(g); /* traverse all elements from 'l' */ -} - -/* -** retraverse all gray lists. Because tables may be reinserted in other -** lists when traversed, traverse the original lists to avoid traversing -** twice the same table (which is not wrong, but inefficient) -*/ -static void retraversegrays (global_State *g) { - GCObject *weak = g->weak; /* save original lists */ - GCObject *grayagain = g->grayagain; - GCObject *ephemeron = g->ephemeron; - g->weak = g->grayagain = g->ephemeron = NULL; - propagateall(g); /* traverse main gray list */ - propagatelist(g, grayagain); - propagatelist(g, weak); - propagatelist(g, ephemeron); -} - - static void convergeephemerons (global_State *g) { int changed; do { GCObject *w; GCObject *next = g->ephemeron; /* get ephemeron list */ - g->ephemeron = NULL; /* tables will return to this list when traversed */ + g->ephemeron = NULL; /* tables may return to this list when traversed */ changed = 0; while ((w = next) != NULL) { next = gco2t(w)->gclist; @@ -644,7 +638,7 @@ static void clearvalues (global_State *g, GCObject *l, GCObject *f) { for (; l != f; l = gco2t(l)->gclist) { Table *h = gco2t(l); Node *n, *limit = gnodelast(h); - int i; + unsigned int i; for (i = 0; i < h->sizearray; i++) { TValue *o = &h->array[i]; if (iscleared(g, o)) /* value was collected? */ @@ -660,23 +654,41 @@ static void clearvalues (global_State *g, GCObject *l, GCObject *f) { } +void luaC_upvdeccount (lua_State *L, UpVal *uv) { + lua_assert(uv->refcount > 0); + uv->refcount--; + if (uv->refcount == 0 && !upisopen(uv)) + luaM_free(L, uv); +} + + +static void freeLclosure (lua_State *L, LClosure *cl) { + int i; + for (i = 0; i < cl->nupvalues; i++) { + UpVal *uv = cl->upvals[i]; + if (uv) + luaC_upvdeccount(L, uv); + } + luaM_freemem(L, cl, sizeLclosure(cl->nupvalues)); +} + + static void freeobj (lua_State *L, GCObject *o) { - switch (gch(o)->tt) { + switch (o->tt) { case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; case LUA_TLCL: { - luaM_freemem(L, o, sizeLclosure(gco2lcl(o)->nupvalues)); + freeLclosure(L, gco2lcl(o)); break; } case LUA_TCCL: { luaM_freemem(L, o, sizeCclosure(gco2ccl(o)->nupvalues)); break; } - case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; case LUA_TTABLE: luaH_free(L, gco2t(o)); break; case LUA_TTHREAD: luaE_freethread(L, gco2th(o)); break; case LUA_TUSERDATA: luaM_freemem(L, o, sizeudata(gco2u(o))); break; case LUA_TSHRSTR: - G(L)->strt.nuse--; + luaS_remove(L, gco2ts(o)); /* remove it from hash table */ /* go through */ case LUA_TLNGSTR: { luaM_freemem(L, o, sizestring(gco2ts(o))); @@ -692,60 +704,26 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count); /* -** sweep the (open) upvalues of a thread and resize its stack and -** list of call-info structures. -*/ -static void sweepthread (lua_State *L, lua_State *L1) { - if (L1->stack == NULL) return; /* stack not completely built yet */ - sweepwholelist(L, &L1->openupval); /* sweep open upvalues */ - luaE_freeCI(L1); /* free extra CallInfo slots */ - /* should not change the stack during an emergency gc cycle */ - if (G(L)->gckind != KGC_EMERGENCY) - luaD_shrinkstack(L1); -} - - -/* ** sweep at most 'count' elements from a list of GCObjects erasing dead -** objects, where a dead (not alive) object is one marked with the "old" -** (non current) white and not fixed. -** In non-generational mode, change all non-dead objects back to white, -** preparing for next collection cycle. -** In generational mode, keep black objects black, and also mark them as -** old; stop when hitting an old object, as all objects after that -** one will be old too. -** When object is a thread, sweep its list of open upvalues too. +** objects, where a dead object is one marked with the old (non current) +** white; change all non-dead objects back to white, preparing for next +** collection cycle. Return where to continue the traversal or NULL if +** list is finished. */ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { global_State *g = G(L); int ow = otherwhite(g); - int toclear, toset; /* bits to clear and to set in all live objects */ - int tostop; /* stop sweep when this is true */ - if (isgenerational(g)) { /* generational mode? */ - toclear = ~0; /* clear nothing */ - toset = bitmask(OLDBIT); /* set the old bit of all surviving objects */ - tostop = bitmask(OLDBIT); /* do not sweep old generation */ - } - else { /* normal mode */ - toclear = maskcolors; /* clear all color bits + old bit */ - toset = luaC_white(g); /* make object white */ - tostop = 0; /* do not stop */ - } + int white = luaC_white(g); /* current white */ while (*p != NULL && count-- > 0) { GCObject *curr = *p; - int marked = gch(curr)->marked; + int marked = curr->marked; if (isdeadm(ow, marked)) { /* is 'curr' dead? */ - *p = gch(curr)->next; /* remove 'curr' from list */ + *p = curr->next; /* remove 'curr' from list */ freeobj(L, curr); /* erase 'curr' */ } - else { - if (testbits(marked, tostop)) - return NULL; /* stop sweeping this list */ - if (gch(curr)->tt == LUA_TTHREAD) - sweepthread(L, gco2th(curr)); /* sweep thread's upvalues */ - /* update marks */ - gch(curr)->marked = cast_byte((marked & toclear) | toset); - p = &gch(curr)->next; /* go to next element */ + else { /* change mark to 'white' */ + curr->marked = cast_byte((marked & maskcolors) | white); + p = &curr->next; /* go to next element */ } } return (*p == NULL) ? NULL : p; @@ -756,7 +734,7 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { ** sweep a list until a live object (or end of list) */ static GCObject **sweeptolive (lua_State *L, GCObject **p, int *n) { - GCObject ** old = p; + GCObject **old = p; int i = 0; do { i++; @@ -775,26 +753,28 @@ static GCObject **sweeptolive (lua_State *L, GCObject **p, int *n) { ** ======================================================= */ -static void checkSizes (lua_State *L) { - global_State *g = G(L); - if (g->gckind != KGC_EMERGENCY) { /* do not change sizes in emergency */ - int hs = g->strt.size / 2; /* half the size of the string table */ - if (g->strt.nuse < cast(lu_int32, hs)) /* using less than that half? */ - luaS_resize(L, hs); /* halve its size */ +/* +** If possible, free concatenation buffer and shrink string table +*/ +static void checkSizes (lua_State *L, global_State *g) { + if (g->gckind != KGC_EMERGENCY) { + l_mem olddebt = g->GCdebt; luaZ_freebuffer(L, &g->buff); /* free concatenation buffer */ + if (g->strt.nuse < g->strt.size / 4) /* string table too big? */ + luaS_resize(L, g->strt.size / 2); /* shrink it a little */ + g->GCestimate += g->GCdebt - olddebt; /* update estimate */ } } static GCObject *udata2finalize (global_State *g) { GCObject *o = g->tobefnz; /* get first element */ - lua_assert(isfinalized(o)); - g->tobefnz = gch(o)->next; /* remove it from 'tobefnz' list */ - gch(o)->next = g->allgc; /* return it to 'allgc' list */ + lua_assert(tofinalize(o)); + g->tobefnz = o->next; /* remove it from 'tobefnz' list */ + o->next = g->allgc; /* return it to 'allgc' list */ g->allgc = o; - resetbit(gch(o)->marked, SEPARATED); /* mark that it is not in 'tobefnz' */ - lua_assert(!isold(o)); /* see MOVE OLD rule */ - if (!keepinvariantout(g)) /* not keeping invariant? */ + resetbit(o->marked, FINALIZEDBIT); /* object is "normal" again */ + if (issweepphase(g)) makewhite(g, o); /* "sweep" object */ return o; } @@ -839,28 +819,57 @@ static void GCTM (lua_State *L, int propagateerrors) { /* +** call a few (up to 'g->gcfinnum') finalizers +*/ +static int runafewfinalizers (lua_State *L) { + global_State *g = G(L); + unsigned int i; + lua_assert(!g->tobefnz || g->gcfinnum > 0); + for (i = 0; g->tobefnz && i < g->gcfinnum; i++) + GCTM(L, 1); /* call one finalizer */ + g->gcfinnum = (!g->tobefnz) ? 0 /* nothing more to finalize? */ + : g->gcfinnum * 2; /* else call a few more next time */ + return i; +} + + +/* +** call all pending finalizers +*/ +static void callallpendingfinalizers (lua_State *L, int propagateerrors) { + global_State *g = G(L); + while (g->tobefnz) + GCTM(L, propagateerrors); +} + + +/* +** find last 'next' field in list 'p' list (to add elements in its end) +*/ +static GCObject **findlast (GCObject **p) { + while (*p != NULL) + p = &(*p)->next; + return p; +} + + +/* ** move all unreachable objects (or 'all' objects) that need ** finalization from list 'finobj' to list 'tobefnz' (to be finalized) */ -static void separatetobefnz (lua_State *L, int all) { - global_State *g = G(L); - GCObject **p = &g->finobj; +static void separatetobefnz (global_State *g, int all) { GCObject *curr; - GCObject **lastnext = &g->tobefnz; - /* find last 'next' field in 'tobefnz' list (to add elements in its end) */ - while (*lastnext != NULL) - lastnext = &gch(*lastnext)->next; + GCObject **p = &g->finobj; + GCObject **lastnext = findlast(&g->tobefnz); while ((curr = *p) != NULL) { /* traverse all finalizable objects */ - lua_assert(!isfinalized(curr)); - lua_assert(testbit(gch(curr)->marked, SEPARATED)); + lua_assert(tofinalize(curr)); if (!(iswhite(curr) || all)) /* not being collected? */ - p = &gch(curr)->next; /* don't bother with it */ + p = &curr->next; /* don't bother with it */ else { - l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */ - *p = gch(curr)->next; /* remove 'curr' from 'finobj' list */ - gch(curr)->next = *lastnext; /* link at the end of 'tobefnz' list */ + *p = curr->next; /* remove 'curr' from 'finobj' list */ + curr->next = *lastnext; /* link at the end of 'tobefnz' list */ *lastnext = curr; - lastnext = &gch(curr)->next; + lastnext = &curr->next; } } } @@ -872,33 +881,29 @@ static void separatetobefnz (lua_State *L, int all) { */ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) { global_State *g = G(L); - if (testbit(gch(o)->marked, SEPARATED) || /* obj. is already separated... */ - isfinalized(o) || /* ... or is finalized... */ - gfasttm(g, mt, TM_GC) == NULL) /* or has no finalizer? */ + if (tofinalize(o) || /* obj. is already marked... */ + gfasttm(g, mt, TM_GC) == NULL) /* or has no finalizer? */ return; /* nothing to be done */ else { /* move 'o' to 'finobj' list */ GCObject **p; - GCheader *ho = gch(o); - if (g->sweepgc == &ho->next) { /* avoid removing current sweep object */ - lua_assert(issweepphase(g)); - g->sweepgc = sweeptolive(L, g->sweepgc, NULL); + if (issweepphase(g)) { + makewhite(g, o); /* "sweep" object 'o' */ + if (g->sweepgc == &o->next) /* should not remove 'sweepgc' object */ + g->sweepgc = sweeptolive(L, g->sweepgc, NULL); /* change 'sweepgc' */ } /* search for pointer pointing to 'o' */ - for (p = &g->allgc; *p != o; p = &gch(*p)->next) { /* empty */ } - *p = ho->next; /* remove 'o' from root list */ - ho->next = g->finobj; /* link it in list 'finobj' */ + for (p = &g->allgc; *p != o; p = &(*p)->next) { /* empty */ } + *p = o->next; /* remove 'o' from 'allgc' list */ + o->next = g->finobj; /* link it in 'finobj' list */ g->finobj = o; - l_setbit(ho->marked, SEPARATED); /* mark it as such */ - if (!keepinvariantout(g)) /* not keeping invariant? */ - makewhite(g, o); /* "sweep" object */ - else - resetoldbit(o); /* see MOVE OLD rule */ + l_setbit(o->marked, FINALIZEDBIT); /* mark it as such */ } } /* }====================================================== */ + /* ** {====================================================== ** GC control @@ -907,127 +912,93 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) { /* -** set a reasonable "time" to wait before starting a new GC cycle; -** cycle will start when memory use hits threshold +** Set a reasonable "time" to wait before starting a new GC cycle; cycle +** will start when memory use hits threshold. (Division by 'estimate' +** should be OK: it cannot be zero (because Lua cannot even start with +** less than PAUSEADJ bytes). */ -static void setpause (global_State *g, l_mem estimate) { - l_mem debt, threshold; - estimate = estimate / PAUSEADJ; /* adjust 'estimate' */ +static void setpause (global_State *g) { + l_mem threshold, debt; + l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */ + lua_assert(estimate > 0); threshold = (g->gcpause < MAX_LMEM / estimate) /* overflow? */ ? estimate * g->gcpause /* no overflow */ : MAX_LMEM; /* overflow; truncate to maximum */ - debt = -cast(l_mem, threshold - gettotalbytes(g)); + debt = gettotalbytes(g) - threshold; luaE_setdebt(g, debt); } -#define sweepphases \ - (bitmask(GCSsweepstring) | bitmask(GCSsweepudata) | bitmask(GCSsweep)) - - /* -** enter first sweep phase (strings) and prepare pointers for other -** sweep phases. The calls to 'sweeptolive' make pointers point to an -** object inside the list (instead of to the header), so that the real -** sweep do not need to skip objects created between "now" and the start -** of the real sweep. +** Enter first sweep phase. +** The call to 'sweeptolive' makes pointer point to an object inside +** the list (instead of to the header), so that the real sweep do not +** need to skip objects created between "now" and the start of the real +** sweep. ** Returns how many objects it swept. */ static int entersweep (lua_State *L) { global_State *g = G(L); int n = 0; - g->gcstate = GCSsweepstring; - lua_assert(g->sweepgc == NULL && g->sweepfin == NULL); - /* prepare to sweep strings, finalizable objects, and regular objects */ - g->sweepstrgc = 0; - g->sweepfin = sweeptolive(L, &g->finobj, &n); + g->gcstate = GCSswpallgc; + lua_assert(g->sweepgc == NULL); g->sweepgc = sweeptolive(L, &g->allgc, &n); return n; } -/* -** change GC mode -*/ -void luaC_changemode (lua_State *L, int mode) { - global_State *g = G(L); - if (mode == g->gckind) return; /* nothing to change */ - if (mode == KGC_GEN) { /* change to generational mode */ - /* make sure gray lists are consistent */ - luaC_runtilstate(L, bitmask(GCSpropagate)); - g->GCestimate = gettotalbytes(g); - g->gckind = KGC_GEN; - } - else { /* change to incremental mode */ - /* sweep all objects to turn them back to white - (as white has not changed, nothing extra will be collected) */ - g->gckind = KGC_NORMAL; - entersweep(L); - luaC_runtilstate(L, ~sweepphases); - } -} - - -/* -** call all pending finalizers -*/ -static void callallpendingfinalizers (lua_State *L, int propagateerrors) { - global_State *g = G(L); - while (g->tobefnz) { - resetoldbit(g->tobefnz); - GCTM(L, propagateerrors); - } -} - - void luaC_freeallobjects (lua_State *L) { global_State *g = G(L); - int i; - separatetobefnz(L, 1); /* separate all objects with finalizers */ + separatetobefnz(g, 1); /* separate all objects with finalizers */ lua_assert(g->finobj == NULL); callallpendingfinalizers(L, 0); + lua_assert(g->tobefnz == NULL); g->currentwhite = WHITEBITS; /* this "white" makes all objects look dead */ g->gckind = KGC_NORMAL; - sweepwholelist(L, &g->finobj); /* finalizers can create objs. in 'finobj' */ + sweepwholelist(L, &g->finobj); sweepwholelist(L, &g->allgc); - for (i = 0; i < g->strt.size; i++) /* free all string lists */ - sweepwholelist(L, &g->strt.hash[i]); + sweepwholelist(L, &g->fixedgc); /* collect fixed objects */ lua_assert(g->strt.nuse == 0); } static l_mem atomic (lua_State *L) { global_State *g = G(L); - l_mem work = -cast(l_mem, g->GCmemtrav); /* start counting work */ + l_mem work; GCObject *origweak, *origall; - lua_assert(!iswhite(obj2gco(g->mainthread))); + GCObject *grayagain = g->grayagain; /* save original list */ + lua_assert(g->ephemeron == NULL && g->weak == NULL); + lua_assert(!iswhite(g->mainthread)); + g->gcstate = GCSinsideatomic; + g->GCmemtrav = 0; /* start counting work */ markobject(g, L); /* mark running thread */ /* registry and global metatables may be changed by API */ markvalue(g, &g->l_registry); - markmt(g); /* mark basic metatables */ + markmt(g); /* mark global metatables */ /* remark occasional upvalues of (maybe) dead threads */ remarkupvals(g); propagateall(g); /* propagate changes */ - work += g->GCmemtrav; /* stop counting (do not (re)count grays) */ - /* traverse objects caught by write barrier and by 'remarkupvals' */ - retraversegrays(g); - work -= g->GCmemtrav; /* restart counting */ + work = g->GCmemtrav; /* stop counting (do not recount 'grayagain') */ + g->gray = grayagain; + propagateall(g); /* traverse 'grayagain' list */ + g->GCmemtrav = 0; /* restart counting */ convergeephemerons(g); /* at this point, all strongly accessible objects are marked. */ - /* clear values from weak tables, before checking finalizers */ + /* Clear values from weak tables, before checking finalizers */ clearvalues(g, g->weak, NULL); clearvalues(g, g->allweak, NULL); origweak = g->weak; origall = g->allweak; work += g->GCmemtrav; /* stop counting (objects being finalized) */ - separatetobefnz(L, 0); /* separate objects to be finalized */ + separatetobefnz(g, 0); /* separate objects to be finalized */ + g->gcfinnum = 1; /* there may be objects to be finalized */ markbeingfnz(g); /* mark objects that will be finalized */ - propagateall(g); /* remark, to propagate `preserveness' */ - work -= g->GCmemtrav; /* restart counting */ + propagateall(g); /* remark, to propagate 'resurrection' */ + g->GCmemtrav = 0; /* restart counting */ convergeephemerons(g); /* at this point, all resurrected objects are marked. */ /* remove dead objects from weak tables */ clearkeys(g, g->ephemeron, NULL); /* clear keys from all ephemeron tables */ - clearkeys(g, g->allweak, NULL); /* clear keys from all allweak tables */ + clearkeys(g, g->allweak, NULL); /* clear keys from all 'allweak' tables */ /* clear values from resurrected weak tables */ clearvalues(g, g->weak, origweak); clearvalues(g, g->allweak, origall); @@ -1037,65 +1008,71 @@ static l_mem atomic (lua_State *L) { } +static lu_mem sweepstep (lua_State *L, global_State *g, + int nextstate, GCObject **nextlist) { + if (g->sweepgc) { + l_mem olddebt = g->GCdebt; + g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); + g->GCestimate += g->GCdebt - olddebt; /* update estimate */ + if (g->sweepgc) /* is there still something to sweep? */ + return (GCSWEEPMAX * GCSWEEPCOST); + } + /* else enter next state */ + g->gcstate = nextstate; + g->sweepgc = nextlist; + return 0; +} + + static lu_mem singlestep (lua_State *L) { global_State *g = G(L); switch (g->gcstate) { case GCSpause: { - /* start to count memory traversed */ g->GCmemtrav = g->strt.size * sizeof(GCObject*); - lua_assert(!isgenerational(g)); restartcollection(g); g->gcstate = GCSpropagate; return g->GCmemtrav; } case GCSpropagate: { - if (g->gray) { - lu_mem oldtrav = g->GCmemtrav; - propagatemark(g); - return g->GCmemtrav - oldtrav; /* memory traversed in this step */ - } - else { /* no more `gray' objects */ - lu_mem work; - int sw; - g->gcstate = GCSatomic; /* finish mark phase */ - g->GCestimate = g->GCmemtrav; /* save what was counted */; - work = atomic(L); /* add what was traversed by 'atomic' */ - g->GCestimate += work; /* estimate of total memory traversed */ - sw = entersweep(L); - return work + sw * GCSWEEPCOST; - } + g->GCmemtrav = 0; + lua_assert(g->gray); + propagatemark(g); + if (g->gray == NULL) /* no more gray objects? */ + g->gcstate = GCSatomic; /* finish propagate phase */ + return g->GCmemtrav; /* memory traversed in this step */ } - case GCSsweepstring: { - int i; - for (i = 0; i < GCSWEEPMAX && g->sweepstrgc + i < g->strt.size; i++) - sweepwholelist(L, &g->strt.hash[g->sweepstrgc + i]); - g->sweepstrgc += i; - if (g->sweepstrgc >= g->strt.size) /* no more strings to sweep? */ - g->gcstate = GCSsweepudata; - return i * GCSWEEPCOST; + case GCSatomic: { + lu_mem work; + int sw; + propagateall(g); /* make sure gray list is empty */ + work = atomic(L); /* work is what was traversed by 'atomic' */ + sw = entersweep(L); + g->GCestimate = gettotalbytes(g); /* first estimate */; + return work + sw * GCSWEEPCOST; } - case GCSsweepudata: { - if (g->sweepfin) { - g->sweepfin = sweeplist(L, g->sweepfin, GCSWEEPMAX); - return GCSWEEPMAX*GCSWEEPCOST; - } - else { - g->gcstate = GCSsweep; - return 0; - } + case GCSswpallgc: { /* sweep "regular" objects */ + return sweepstep(L, g, GCSswpfinobj, &g->finobj); + } + case GCSswpfinobj: { /* sweep objects with finalizers */ + return sweepstep(L, g, GCSswptobefnz, &g->tobefnz); + } + case GCSswptobefnz: { /* sweep objects to be finalized */ + return sweepstep(L, g, GCSswpend, NULL); } - case GCSsweep: { - if (g->sweepgc) { - g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); - return GCSWEEPMAX*GCSWEEPCOST; + case GCSswpend: { /* finish sweeps */ + makewhite(g, g->mainthread); /* sweep main thread */ + checkSizes(L, g); + g->gcstate = GCScallfin; + return 0; + } + case GCScallfin: { /* call remaining finalizers */ + if (g->tobefnz && g->gckind != KGC_EMERGENCY) { + int n = runafewfinalizers(L); + return (n * GCFINALIZECOST); } - else { - /* sweep main thread */ - GCObject *mt = obj2gco(g->mainthread); - sweeplist(L, &mt, 1); - checkSizes(L); + else { /* emergency mode or no more finalizers */ g->gcstate = GCSpause; /* finish collection */ - return GCSWEEPCOST; + return 0; } } default: lua_assert(0); return 0; @@ -1114,105 +1091,67 @@ void luaC_runtilstate (lua_State *L, int statesmask) { } -static void generationalcollection (lua_State *L) { - global_State *g = G(L); - lua_assert(g->gcstate == GCSpropagate); - if (g->GCestimate == 0) { /* signal for another major collection? */ - luaC_fullgc(L, 0); /* perform a full regular collection */ - g->GCestimate = gettotalbytes(g); /* update control */ - } - else { - lu_mem estimate = g->GCestimate; - luaC_runtilstate(L, bitmask(GCSpause)); /* run complete (minor) cycle */ - g->gcstate = GCSpropagate; /* skip restart */ - if (gettotalbytes(g) > (estimate / 100) * g->gcmajorinc) - g->GCestimate = 0; /* signal for a major collection */ - else - g->GCestimate = estimate; /* keep estimate from last major coll. */ - - } - setpause(g, gettotalbytes(g)); - lua_assert(g->gcstate == GCSpropagate); -} - - -static void incstep (lua_State *L) { - global_State *g = G(L); +/* +** get GC debt and convert it from Kb to 'work units' (avoid zero debt +** and overflows) +*/ +static l_mem getdebt (global_State *g) { l_mem debt = g->GCdebt; int stepmul = g->gcstepmul; - if (stepmul < 40) stepmul = 40; /* avoid ridiculous low values (and 0) */ - /* convert debt from Kb to 'work units' (avoid zero debt and overflows) */ debt = (debt / STEPMULADJ) + 1; debt = (debt < MAX_LMEM / stepmul) ? debt * stepmul : MAX_LMEM; - do { /* always perform at least one single step */ - lu_mem work = singlestep(L); /* do some work */ - debt -= work; - } while (debt > -GCSTEPSIZE && g->gcstate != GCSpause); - if (g->gcstate == GCSpause) - setpause(g, g->GCestimate); /* pause until next cycle */ - else { - debt = (debt / stepmul) * STEPMULADJ; /* convert 'work units' to Kb */ - luaE_setdebt(g, debt); - } + return debt; } - /* -** performs a basic GC step -*/ -void luaC_forcestep (lua_State *L) { - global_State *g = G(L); - int i; - if (isgenerational(g)) generationalcollection(L); - else incstep(L); - /* run a few finalizers (or all of them at the end of a collect cycle) */ - for (i = 0; g->tobefnz && (i < GCFINALIZENUM || g->gcstate == GCSpause); i++) - GCTM(L, 1); /* call one finalizer */ -} - - -/* -** performs a basic GC step only if collector is running +** performs a basic GC step when collector is running */ void luaC_step (lua_State *L) { global_State *g = G(L); - if (g->gcrunning) luaC_forcestep(L); - else luaE_setdebt(g, -GCSTEPSIZE); /* avoid being called too often */ + l_mem debt = getdebt(g); /* GC deficit (be paid now) */ + if (!g->gcrunning) { /* not running? */ + luaE_setdebt(g, -GCSTEPSIZE * 10); /* avoid being called too often */ + return; + } + do { /* repeat until pause or enough "credit" (negative debt) */ + lu_mem work = singlestep(L); /* perform one single step */ + debt -= work; + } while (debt > -GCSTEPSIZE && g->gcstate != GCSpause); + if (g->gcstate == GCSpause) + setpause(g); /* pause until next cycle */ + else { + debt = (debt / g->gcstepmul) * STEPMULADJ; /* convert 'work units' to Kb */ + luaE_setdebt(g, debt); + runafewfinalizers(L); + } } - /* -** performs a full GC cycle; if "isemergency", does not call -** finalizers (which could change stack positions) +** Performs a full GC cycle; if 'isemergency', set a flag to avoid +** some operations which could change the interpreter state in some +** unexpected ways (running finalizers and shrinking some structures). +** Before running the collection, check 'keepinvariant'; if it is true, +** there may be some objects marked as black, so the collector has +** to sweep all objects to turn them back to white (as white has not +** changed, nothing will be collected). */ void luaC_fullgc (lua_State *L, int isemergency) { global_State *g = G(L); - int origkind = g->gckind; - lua_assert(origkind != KGC_EMERGENCY); - if (isemergency) /* do not run finalizers during emergency GC */ - g->gckind = KGC_EMERGENCY; - else { - g->gckind = KGC_NORMAL; - callallpendingfinalizers(L, 1); - } - if (keepinvariant(g)) { /* may there be some black objects? */ - /* must sweep all objects to turn them back to white - (as white has not changed, nothing will be collected) */ - entersweep(L); + lua_assert(g->gckind == KGC_NORMAL); + if (isemergency) g->gckind = KGC_EMERGENCY; /* set flag */ + if (keepinvariant(g)) { /* black objects? */ + entersweep(L); /* sweep everything to turn them back to white */ } /* finish any pending sweep phase to start a new cycle */ luaC_runtilstate(L, bitmask(GCSpause)); luaC_runtilstate(L, ~bitmask(GCSpause)); /* start new collection */ - luaC_runtilstate(L, bitmask(GCSpause)); /* run entire collection */ - if (origkind == KGC_GEN) { /* generational mode? */ - /* generational mode must be kept in propagate phase */ - luaC_runtilstate(L, bitmask(GCSpropagate)); - } - g->gckind = origkind; - setpause(g, gettotalbytes(g)); - if (!isemergency) /* do not run finalizers during emergency GC */ - callallpendingfinalizers(L, 1); + luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */ + /* estimate must be correct after a full GC cycle */ + lua_assert(g->GCestimate == gettotalbytes(g)); + luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */ + g->gckind = KGC_NORMAL; + setpause(g); } /* }====================================================== */ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lgc.h b/3rdparty/genie/src/host/lua-5.3.0/src/lgc.h index 84bb1cdf99f..0eedf84204a 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lgc.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.58.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lgc.h,v 2.86 2014/10/25 11:50:46 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -38,36 +38,27 @@ */ #define GCSpropagate 0 #define GCSatomic 1 -#define GCSsweepstring 2 -#define GCSsweepudata 3 -#define GCSsweep 4 -#define GCSpause 5 +#define GCSswpallgc 2 +#define GCSswpfinobj 3 +#define GCSswptobefnz 4 +#define GCSswpend 5 +#define GCScallfin 6 +#define GCSpause 7 #define issweepphase(g) \ - (GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep) + (GCSswpallgc <= (g)->gcstate && (g)->gcstate <= GCSswpend) -#define isgenerational(g) ((g)->gckind == KGC_GEN) /* -** macros to tell when main invariant (white objects cannot point to black -** ones) must be kept. During a non-generational collection, the sweep +** macro to tell when main invariant (white objects cannot point to black +** ones) must be kept. During a collection, the sweep ** phase may break the invariant, as objects turned white may point to ** still-black objects. The invariant is restored when sweep ends and -** all objects are white again. During a generational collection, the -** invariant must be kept all times. +** all objects are white again. */ -#define keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic) - - -/* -** Outside the collector, the state in generational mode is kept in -** 'propagate', so 'keepinvariant' is always true. -*/ -#define keepinvariantout(g) \ - check_exp(g->gcstate == GCSpropagate || !isgenerational(g), \ - g->gcstate <= GCSatomic) +#define keepinvariant(g) ((g)->gcstate <= GCSatomic) /* @@ -83,38 +74,29 @@ #define testbit(x,b) testbits(x, bitmask(b)) -/* Layout for bit use in `marked' field: */ +/* Layout for bit use in 'marked' field: */ #define WHITE0BIT 0 /* object is white (type 0) */ #define WHITE1BIT 1 /* object is white (type 1) */ #define BLACKBIT 2 /* object is black */ -#define FINALIZEDBIT 3 /* object has been separated for finalization */ -#define SEPARATED 4 /* object is in 'finobj' list or in 'tobefnz' */ -#define FIXEDBIT 5 /* object is fixed (should not be collected) */ -#define OLDBIT 6 /* object is old (only in generational mode) */ +#define FINALIZEDBIT 3 /* object has been marked for finalization */ /* bit 7 is currently used by tests (luaL_checkmemory) */ #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) -#define iswhite(x) testbits((x)->gch.marked, WHITEBITS) -#define isblack(x) testbit((x)->gch.marked, BLACKBIT) +#define iswhite(x) testbits((x)->marked, WHITEBITS) +#define isblack(x) testbit((x)->marked, BLACKBIT) #define isgray(x) /* neither white nor black */ \ - (!testbits((x)->gch.marked, WHITEBITS | bitmask(BLACKBIT))) + (!testbits((x)->marked, WHITEBITS | bitmask(BLACKBIT))) -#define isold(x) testbit((x)->gch.marked, OLDBIT) +#define tofinalize(x) testbit((x)->marked, FINALIZEDBIT) -/* MOVE OLD rule: whenever an object is moved to the beginning of - a GC list, its old bit must be cleared */ -#define resetoldbit(o) resetbit((o)->gch.marked, OLDBIT) - -#define otherwhite(g) (g->currentwhite ^ WHITEBITS) +#define otherwhite(g) ((g)->currentwhite ^ WHITEBITS) #define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow))) -#define isdead(g,v) isdeadm(otherwhite(g), (v)->gch.marked) - -#define changewhite(x) ((x)->gch.marked ^= WHITEBITS) -#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) +#define isdead(g,v) isdeadm(otherwhite(g), (v)->marked) -#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) +#define changewhite(x) ((x)->marked ^= WHITEBITS) +#define gray2black(x) l_setbit((x)->marked, BLACKBIT) #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) @@ -124,34 +106,33 @@ #define luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) -#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ +#define luaC_barrier(L,p,v) { \ + if (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) \ luaC_barrier_(L,obj2gco(p),gcvalue(v)); } -#define luaC_barrierback(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ +#define luaC_barrierback(L,p,v) { \ + if (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) \ luaC_barrierback_(L,p); } -#define luaC_objbarrier(L,p,o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ +#define luaC_objbarrier(L,p,o) { \ + if (isblack(p) && iswhite(o)) \ luaC_barrier_(L,obj2gco(p),obj2gco(o)); } -#define luaC_objbarrierback(L,p,o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); } - -#define luaC_barrierproto(L,p,c) \ - { if (isblack(obj2gco(p))) luaC_barrierproto_(L,p,c); } +#define luaC_upvalbarrier(L,uv) \ + { if (iscollectable((uv)->v) && !upisopen(uv)) \ + luaC_upvalbarrier_(L,uv); } +LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); LUAI_FUNC void luaC_freeallobjects (lua_State *L); LUAI_FUNC void luaC_step (lua_State *L); -LUAI_FUNC void luaC_forcestep (lua_State *L); LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask); LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); -LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz, - GCObject **list, int offset); +LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); -LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o); -LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c); +LUAI_FUNC void luaC_barrierback_ (lua_State *L, Table *o); +LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv); LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); -LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv); -LUAI_FUNC void luaC_changemode (lua_State *L, int mode); +LUAI_FUNC void luaC_upvdeccount (lua_State *L, UpVal *uv); + #endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/linit.c b/3rdparty/genie/src/host/lua-5.3.0/src/linit.c index c1a38304711..8ce94ccb355 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/linit.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/linit.c @@ -1,20 +1,33 @@ /* -** $Id: linit.c,v 1.32.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: linit.c,v 1.38 2015/01/05 13:48:33 roberto Exp $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ +#define linit_c +#define LUA_LIB + /* ** If you embed Lua in your program and need to open the standard ** libraries, call luaL_openlibs in your program. If you need a ** different set of libraries, copy this file to your project and edit ** it to suit your needs. +** +** You can also *preload* libraries, so that a later 'require' can +** open the library, which is already linked to the application. +** For that, do the following code: +** +** luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); +** lua_pushcfunction(L, luaopen_modname); +** lua_setfield(L, -2, modname); +** lua_pop(L, 1); // remove _PRELOAD table */ +#include "lprefix.h" -#define linit_c -#define LUA_LIB + +#include <stddef.h> #include "lua.h" @@ -34,34 +47,22 @@ static const luaL_Reg loadedlibs[] = { {LUA_IOLIBNAME, luaopen_io}, {LUA_OSLIBNAME, luaopen_os}, {LUA_STRLIBNAME, luaopen_string}, - {LUA_BITLIBNAME, luaopen_bit32}, {LUA_MATHLIBNAME, luaopen_math}, + {LUA_UTF8LIBNAME, luaopen_utf8}, {LUA_DBLIBNAME, luaopen_debug}, - {NULL, NULL} -}; - - -/* -** these libs are preloaded and must be required before used -*/ -static const luaL_Reg preloadedlibs[] = { +#if defined(LUA_COMPAT_BITLIB) + {LUA_BITLIBNAME, luaopen_bit32}, +#endif {NULL, NULL} }; LUALIB_API void luaL_openlibs (lua_State *L) { const luaL_Reg *lib; - /* call open functions from 'loadedlibs' and set results to global table */ + /* "require" functions from 'loadedlibs' and set results to global table */ for (lib = loadedlibs; lib->func; lib++) { luaL_requiref(L, lib->name, lib->func, 1); lua_pop(L, 1); /* remove lib */ } - /* add open functions from 'preloadedlibs' into 'package.preload' table */ - luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); - for (lib = preloadedlibs; lib->func; lib++) { - lua_pushcfunction(L, lib->func); - lua_setfield(L, -2, lib->name); - } - lua_pop(L, 1); /* remove _PRELOAD table */ } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/liolib.c b/3rdparty/genie/src/host/lua-5.3.0/src/liolib.c index 2a4ec4aa344..4dea39684a3 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/liolib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/liolib.c @@ -1,42 +1,36 @@ /* -** $Id: liolib.c,v 2.112.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: liolib.c,v 2.142 2015/01/02 12:50:28 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ +#define liolib_c +#define LUA_LIB -/* -** This definition must come before the inclusion of 'stdio.h'; it -** should not affect non-POSIX systems -*/ -#if !defined(_FILE_OFFSET_BITS) -#define _LARGEFILE_SOURCE 1 -#define _FILE_OFFSET_BITS 64 -#endif +#include "lprefix.h" +#include <ctype.h> #include <errno.h> +#include <locale.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#define liolib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" #include "lualib.h" -#if !defined(lua_checkmode) +#if !defined(l_checkmode) /* ** Check whether 'mode' matches '[rwa]%+?b?'. ** Change this macro to accept other modes for 'fopen' besides ** the standard ones. */ -#define lua_checkmode(mode) \ +#define l_checkmode(mode) \ (*mode != '\0' && strchr("rwa", *(mode++)) != NULL && \ (*mode != '+' || ++mode) && /* skip if char is '+' */ \ (*mode != 'b' || ++mode) && /* skip if char is 'b' */ \ @@ -46,75 +40,94 @@ /* ** {====================================================== -** lua_popen spawns a new process connected to the current +** l_popen spawns a new process connected to the current ** one through the file streams. ** ======================================================= */ -#if !defined(lua_popen) /* { */ - -#if defined(LUA_USE_POPEN) /* { */ +#if !defined(l_popen) /* { */ -#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) -#define lua_pclose(L,file) ((void)L, pclose(file)) +#if defined(LUA_USE_POSIX) /* { */ -#elif defined(LUA_WIN) /* }{ */ +#define l_popen(L,c,m) (fflush(NULL), popen(c,m)) +#define l_pclose(L,file) (pclose(file)) -#define lua_popen(L,c,m) ((void)L, _popen(c,m)) -#define lua_pclose(L,file) ((void)L, _pclose(file)) +#elif defined(LUA_USE_WINDOWS) /* }{ */ +#define l_popen(L,c,m) (_popen(c,m)) +#define l_pclose(L,file) (_pclose(file)) #else /* }{ */ -#define lua_popen(L,c,m) ((void)((void)c, m), \ - luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) -#define lua_pclose(L,file) ((void)((void)L, file), -1) - +/* ISO C definitions */ +#define l_popen(L,c,m) \ + ((void)((void)c, m), \ + luaL_error(L, "'popen' not supported"), \ + (FILE*)0) +#define l_pclose(L,file) ((void)L, (void)file, -1) #endif /* } */ -#endif /* } */ +#endif /* } */ /* }====================================================== */ +#if !defined(l_getc) /* { */ + +#if defined(LUA_USE_POSIX) +#define l_getc(f) getc_unlocked(f) +#define l_lockfile(f) flockfile(f) +#define l_unlockfile(f) funlockfile(f) +#else +#define l_getc(f) getc(f) +#define l_lockfile(f) ((void)0) +#define l_unlockfile(f) ((void)0) +#endif + +#endif /* } */ + + /* ** {====================================================== -** lua_fseek: configuration for longer offsets +** l_fseek: configuration for longer offsets ** ======================================================= */ -#if !defined(lua_fseek) && !defined(LUA_ANSI) /* { */ +#if !defined(l_fseek) /* { */ #if defined(LUA_USE_POSIX) /* { */ +#include <sys/types.h> + #define l_fseek(f,o,w) fseeko(f,o,w) #define l_ftell(f) ftello(f) #define l_seeknum off_t -#elif defined(LUA_WIN) && !defined(_CRTIMP_TYPEINFO) \ +#elif defined(LUA_USE_WINDOWS) && !defined(_CRTIMP_TYPEINFO) \ && defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */ -/* Windows (but not DDK) and Visual C++ 2005 or higher */ +/* Windows (but not DDK) and Visual C++ 2005 or higher */ #define l_fseek(f,o,w) _fseeki64(f,o,w) #define l_ftell(f) _ftelli64(f) #define l_seeknum __int64 -#endif /* } */ - -#endif /* } */ - +#else /* }{ */ -#if !defined(l_fseek) /* default definitions */ +/* ISO C definitions */ #define l_fseek(f,o,w) fseek(f,o,w) #define l_ftell(f) ftell(f) #define l_seeknum long -#endif + +#endif /* } */ + +#endif /* } */ /* }====================================================== */ #define IO_PREFIX "_IO_" +#define IOPREF_LEN (sizeof(IO_PREFIX)/sizeof(char) - 1) #define IO_INPUT (IO_PREFIX "input") #define IO_OUTPUT (IO_PREFIX "output") @@ -161,7 +174,7 @@ static FILE *tofile (lua_State *L) { /* -** When creating file handles, always creates a `closed' file handle +** When creating file handles, always creates a 'closed' file handle ** before opening the actual file; so, if there is a memory error, the ** file is not left opened. */ @@ -173,9 +186,14 @@ static LStream *newprefile (lua_State *L) { } +/* +** Calls the 'close' function from a file handle. The 'volatile' avoids +** a bug in some versions of the Clang compiler (e.g., clang 3.0 for +** 32 bits). +*/ static int aux_close (lua_State *L) { LStream *p = tolstream(L); - lua_CFunction cf = p->closef; + volatile lua_CFunction cf = p->closef; p->closef = NULL; /* mark stream as closed */ return (*cf)(L); /* close it */ } @@ -219,7 +237,7 @@ static void opencheck (lua_State *L, const char *fname, const char *mode) { LStream *p = newfile(L); p->f = fopen(fname, mode); if (p->f == NULL) - luaL_error(L, "cannot open file " LUA_QS " (%s)", fname, strerror(errno)); + luaL_error(L, "cannot open file '%s' (%s)", fname, strerror(errno)); } @@ -228,7 +246,7 @@ static int io_open (lua_State *L) { const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newfile(L); const char *md = mode; /* to traverse/check mode */ - luaL_argcheck(L, lua_checkmode(md), 2, "invalid mode"); + luaL_argcheck(L, l_checkmode(md), 2, "invalid mode"); p->f = fopen(filename, mode); return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; } @@ -239,7 +257,7 @@ static int io_open (lua_State *L) { */ static int io_pclose (lua_State *L) { LStream *p = tolstream(L); - return luaL_execresult(L, lua_pclose(L, p->f)); + return luaL_execresult(L, l_pclose(L, p->f)); } @@ -247,7 +265,7 @@ static int io_popen (lua_State *L) { const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newprefile(L); - p->f = lua_popen(L, filename, mode); + p->f = l_popen(L, filename, mode); p->closef = &io_pclose; return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; } @@ -265,7 +283,7 @@ static FILE *getiofile (lua_State *L, const char *findex) { lua_getfield(L, LUA_REGISTRYINDEX, findex); p = (LStream *)lua_touserdata(L, -1); if (isclosed(p)) - luaL_error(L, "standard %s file is closed", findex + strlen(IO_PREFIX)); + luaL_error(L, "standard %s file is closed", findex + IOPREF_LEN); return p->f; } @@ -301,14 +319,10 @@ static int io_readline (lua_State *L); static void aux_lines (lua_State *L, int toclose) { - int i; int n = lua_gettop(L) - 1; /* number of arguments to read */ - /* ensure that arguments will fit here and into 'io_readline' stack */ - luaL_argcheck(L, n <= LUA_MINSTACK - 3, LUA_MINSTACK - 3, "too many options"); - lua_pushvalue(L, 1); /* file handle */ lua_pushinteger(L, n); /* number of arguments to read */ lua_pushboolean(L, toclose); /* close/not close file when finished */ - for (i = 1; i <= n; i++) lua_pushvalue(L, i + 1); /* copy arguments */ + lua_rotate(L, 2, 2); /* move 'n' and 'toclose' to their positions */ lua_pushcclosure(L, io_readline, 3 + n); } @@ -347,13 +361,93 @@ static int io_lines (lua_State *L) { */ -static int read_number (lua_State *L, FILE *f) { - lua_Number d; - if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { - lua_pushnumber(L, d); - return 1; +/* maximum length of a numeral */ +#define MAXRN 200 + +/* auxiliary structure used by 'read_number' */ +typedef struct { + FILE *f; /* file being read */ + int c; /* current character (look ahead) */ + int n; /* number of elements in buffer 'buff' */ + char buff[MAXRN + 1]; /* +1 for ending '\0' */ +} RN; + + +/* +** Add current char to buffer (if not out of space) and read next one +*/ +static int nextc (RN *rn) { + if (rn->n >= MAXRN) { /* buffer overflow? */ + rn->buff[0] = '\0'; /* invalidate result */ + return 0; /* fail */ } else { + rn->buff[rn->n++] = rn->c; /* save current char */ + rn->c = l_getc(rn->f); /* read next one */ + return 1; + } +} + + +/* +** Accept current char if it is in 'set' (of size 1 or 2) +*/ +static int test2 (RN *rn, const char *set) { + if (rn->c == set[0] || (rn->c == set[1] && rn->c != '\0')) + return nextc(rn); + else return 0; +} + + +/* +** Read a sequence of (hex)digits +*/ +static int readdigits (RN *rn, int hex) { + int count = 0; + while ((hex ? isxdigit(rn->c) : isdigit(rn->c)) && nextc(rn)) + count++; + return count; +} + + +/* access to locale "radix character" (decimal point) */ +#if !defined(l_getlocaledecpoint) +#define l_getlocaledecpoint() (localeconv()->decimal_point[0]) +#endif + + +/* +** Read a number: first reads a valid prefix of a numeral into a buffer. +** Then it calls 'lua_stringtonumber' to check whether the format is +** correct and to convert it to a Lua number +*/ +static int read_number (lua_State *L, FILE *f) { + RN rn; + int count = 0; + int hex = 0; + char decp[2] = "."; + rn.f = f; rn.n = 0; + decp[0] = l_getlocaledecpoint(); /* get decimal point from locale */ + l_lockfile(rn.f); + do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ + test2(&rn, "-+"); /* optional signal */ + if (test2(&rn, "0")) { + if (test2(&rn, "xX")) hex = 1; /* numeral is hexadecimal */ + else count = 1; /* count initial '0' as a valid digit */ + } + count += readdigits(&rn, hex); /* integral part */ + if (test2(&rn, decp)) /* decimal point? */ + count += readdigits(&rn, hex); /* fractional part */ + if (count > 0 && test2(&rn, (hex ? "pP" : "eE"))) { /* exponent mark? */ + test2(&rn, "-+"); /* exponent signal */ + readdigits(&rn, 0); /* exponent digits */ + } + ungetc(rn.c, rn.f); /* unread look-ahead char */ + l_unlockfile(rn.f); + rn.buff[rn.n] = '\0'; /* finish string */ + if (lua_stringtonumber(L, rn.buff)) /* is this a valid number? */ + return 1; /* ok */ + else { /* invalid format */ lua_pushnil(L); /* "result" to be removed */ return 0; /* read fails */ } @@ -362,7 +456,7 @@ static int read_number (lua_State *L, FILE *f) { static int test_eof (lua_State *L, FILE *f) { int c = getc(f); - ungetc(c, f); + ungetc(c, f); /* no-op when c == EOF */ lua_pushlstring(L, NULL, 0); return (c != EOF); } @@ -370,40 +464,34 @@ static int test_eof (lua_State *L, FILE *f) { static int read_line (lua_State *L, FILE *f, int chop) { luaL_Buffer b; + int c = '\0'; luaL_buffinit(L, &b); - for (;;) { - size_t l; - char *p = luaL_prepbuffer(&b); - if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ - luaL_pushresult(&b); /* close buffer */ - return (lua_rawlen(L, -1) > 0); /* check whether read something */ - } - l = strlen(p); - if (l == 0 || p[l-1] != '\n') - luaL_addsize(&b, l); - else { - luaL_addsize(&b, l - chop); /* chop 'eol' if needed */ - luaL_pushresult(&b); /* close buffer */ - return 1; /* read at least an `eol' */ - } + while (c != EOF && c != '\n') { /* repeat until end of line */ + char *buff = luaL_prepbuffer(&b); /* pre-allocate buffer */ + int i = 0; + l_lockfile(f); /* no memory errors can happen inside the lock */ + while (i < LUAL_BUFFERSIZE && (c = l_getc(f)) != EOF && c != '\n') + buff[i++] = c; + l_unlockfile(f); + luaL_addsize(&b, i); } + if (!chop && c == '\n') /* want a newline and have one? */ + luaL_addchar(&b, c); /* add ending newline to result */ + luaL_pushresult(&b); /* close buffer */ + /* return ok if read something (either a newline or something else) */ + return (c == '\n' || lua_rawlen(L, -1) > 0); } -#define MAX_SIZE_T (~(size_t)0) - static void read_all (lua_State *L, FILE *f) { - size_t rlen = LUAL_BUFFERSIZE; /* how much to read in each cycle */ + size_t nr; luaL_Buffer b; luaL_buffinit(L, &b); - for (;;) { - char *p = luaL_prepbuffsize(&b, rlen); - size_t nr = fread(p, sizeof(char), rlen, f); + do { /* read file in chunks of LUAL_BUFFERSIZE bytes */ + char *p = luaL_prepbuffsize(&b, LUAL_BUFFERSIZE); + nr = fread(p, sizeof(char), LUAL_BUFFERSIZE, f); luaL_addsize(&b, nr); - if (nr < rlen) break; /* eof? */ - else if (rlen <= (MAX_SIZE_T / 4)) /* avoid buffers too large */ - rlen *= 2; /* double buffer size at each iteration */ - } + } while (nr == LUAL_BUFFERSIZE); luaL_pushresult(&b); /* close buffer */ } @@ -435,13 +523,13 @@ static int g_read (lua_State *L, FILE *f, int first) { success = 1; for (n = first; nargs-- && success; n++) { if (lua_type(L, n) == LUA_TNUMBER) { - size_t l = (size_t)lua_tointeger(L, n); + size_t l = (size_t)luaL_checkinteger(L, n); success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); } else { - const char *p = lua_tostring(L, n); - luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); - switch (p[1]) { + const char *p = luaL_checkstring(L, n); + if (*p == '*') p++; /* skip optional '*' (for compatibility) */ + switch (*p) { case 'n': /* number */ success = read_number(L, f); break; @@ -488,11 +576,12 @@ static int io_readline (lua_State *L) { if (isclosed(p)) /* file is already closed? */ return luaL_error(L, "file is already closed"); lua_settop(L , 1); + luaL_checkstack(L, n, "too many arguments"); for (i = 1; i <= n; i++) /* push arguments to 'g_read' */ lua_pushvalue(L, lua_upvalueindex(3 + i)); n = g_read(L, p->f, 2); /* 'n' is number of results */ lua_assert(n > 0); /* should return at least a nil */ - if (!lua_isnil(L, -n)) /* read at least one value? */ + if (lua_toboolean(L, -n)) /* read at least one value? */ return n; /* return them */ else { /* first result is nil: EOF or error */ if (n > 1) { /* is there error information? */ @@ -517,8 +606,10 @@ static int g_write (lua_State *L, FILE *f, int arg) { for (; nargs--; arg++) { if (lua_type(L, arg) == LUA_TNUMBER) { /* optimization: could be done exactly as for strings */ - status = status && - fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; + int len = lua_isinteger(L, arg) + ? fprintf(f, LUA_INTEGER_FMT, lua_tointeger(L, arg)) + : fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)); + status = status && (len > 0); } else { size_t l; @@ -548,15 +639,15 @@ static int f_seek (lua_State *L) { static const char *const modenames[] = {"set", "cur", "end", NULL}; FILE *f = tofile(L); int op = luaL_checkoption(L, 2, "cur", modenames); - lua_Number p3 = luaL_optnumber(L, 3, 0); + lua_Integer p3 = luaL_optinteger(L, 3, 0); l_seeknum offset = (l_seeknum)p3; - luaL_argcheck(L, (lua_Number)offset == p3, 3, + luaL_argcheck(L, (lua_Integer)offset == p3, 3, "not an integer in proper range"); op = l_fseek(f, offset, mode[op]); if (op) return luaL_fileresult(L, 0, NULL); /* error */ else { - lua_pushnumber(L, (lua_Number)l_ftell(f)); + lua_pushinteger(L, (lua_Integer)l_ftell(f)); return 1; } } @@ -568,7 +659,7 @@ static int f_setvbuf (lua_State *L) { FILE *f = tofile(L); int op = luaL_checkoption(L, 2, NULL, modenames); lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); - int res = setvbuf(f, NULL, mode[op], sz); + int res = setvbuf(f, NULL, mode[op], (size_t)sz); return luaL_fileresult(L, res == 0, NULL); } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/llex.c b/3rdparty/genie/src/host/lua-5.3.0/src/llex.c index c4b820e8332..6e4a457ad63 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/llex.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/llex.c @@ -1,20 +1,23 @@ /* -** $Id: llex.c,v 2.63.1.2 2013/08/30 15:49:41 roberto Exp $ +** $Id: llex.c,v 2.89 2014/11/14 16:06:09 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ +#define llex_c +#define LUA_CORE + +#include "lprefix.h" + #include <locale.h> #include <string.h> -#define llex_c -#define LUA_CORE - #include "lua.h" #include "lctype.h" #include "ldo.h" +#include "lgc.h" #include "llex.h" #include "lobject.h" #include "lparser.h" @@ -38,8 +41,9 @@ static const char *const luaX_tokens [] = { "end", "false", "for", "function", "goto", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while", - "..", "...", "==", ">=", "<=", "~=", "::", "<eof>", - "<number>", "<name>", "<string>" + "//", "..", "...", "==", ">=", "<=", "~=", + "<<", ">>", "::", "<eof>", + "<number>", "<integer>", "<name>", "<string>" }; @@ -53,7 +57,7 @@ static void save (LexState *ls, int c) { Mbuffer *b = ls->buff; if (luaZ_bufflen(b) + 1 > luaZ_sizebuffer(b)) { size_t newsize; - if (luaZ_sizebuffer(b) >= MAX_SIZET/2) + if (luaZ_sizebuffer(b) >= MAX_SIZE/2) lexerror(ls, "lexical element too long", 0); newsize = luaZ_sizebuffer(b) * 2; luaZ_resizebuffer(ls->L, b, newsize); @@ -64,24 +68,25 @@ static void save (LexState *ls, int c) { void luaX_init (lua_State *L) { int i; + TString *e = luaS_new(L, LUA_ENV); /* create env name */ + luaC_fix(L, obj2gco(e)); /* never collect this name */ for (i=0; i<NUM_RESERVED; i++) { TString *ts = luaS_new(L, luaX_tokens[i]); - luaS_fix(ts); /* reserved words are never collected */ - ts->tsv.extra = cast_byte(i+1); /* reserved word */ + luaC_fix(L, obj2gco(ts)); /* reserved words are never collected */ + ts->extra = cast_byte(i+1); /* reserved word */ } } const char *luaX_token2str (LexState *ls, int token) { if (token < FIRST_RESERVED) { /* single-byte symbols? */ - lua_assert(token == cast(unsigned char, token)); - return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : - luaO_pushfstring(ls->L, "char(%d)", token); + lua_assert(token == cast_uchar(token)); + return luaO_pushfstring(ls->L, "'%c'", token); } else { const char *s = luaX_tokens[token - FIRST_RESERVED]; if (token < TK_EOS) /* fixed format (symbols and reserved words)? */ - return luaO_pushfstring(ls->L, LUA_QS, s); + return luaO_pushfstring(ls->L, "'%s'", s); else /* names, strings, and numerals */ return s; } @@ -90,11 +95,10 @@ const char *luaX_token2str (LexState *ls, int token) { static const char *txtToken (LexState *ls, int token) { switch (token) { - case TK_NAME: - case TK_STRING: - case TK_NUMBER: + case TK_NAME: case TK_STRING: + case TK_FLT: case TK_INT: save(ls, '\0'); - return luaO_pushfstring(ls->L, LUA_QS, luaZ_buffer(ls->buff)); + return luaO_pushfstring(ls->L, "'%s'", luaZ_buffer(ls->buff)); default: return luaX_token2str(ls, token); } @@ -117,24 +121,24 @@ l_noret luaX_syntaxerror (LexState *ls, const char *msg) { /* -** creates a new string and anchors it in function's table so that -** it will not be collected until the end of the function's compilation -** (by that time it should be anchored in function's prototype) +** creates a new string and anchors it in scanner's table so that +** it will not be collected until the end of the compilation +** (by that time it should be anchored somewhere) */ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { lua_State *L = ls->L; - TValue *o; /* entry for `str' */ + TValue *o; /* entry for 'str' */ TString *ts = luaS_newlstr(L, str, l); /* create new string */ setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */ - o = luaH_set(L, ls->fs->h, L->top - 1); - if (ttisnil(o)) { /* not in use yet? (see 'addK') */ + o = luaH_set(L, ls->h, L->top - 1); + if (ttisnil(o)) { /* not in use yet? */ /* boolean value does not need GC barrier; table has no metatable, so it does not need to invalidate cache */ setbvalue(o, 1); /* t[string] = true */ luaC_checkGC(L); } else { /* string already present */ - ts = rawtsvalue(keyfromval(o)); /* re-use value previously stored */ + ts = tsvalue(keyfromval(o)); /* re-use value previously stored */ } L->top--; /* remove string from stack */ return ts; @@ -148,16 +152,17 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { static void inclinenumber (LexState *ls) { int old = ls->current; lua_assert(currIsNewline(ls)); - next(ls); /* skip `\n' or `\r' */ + next(ls); /* skip '\n' or '\r' */ if (currIsNewline(ls) && ls->current != old) - next(ls); /* skip `\n\r' or `\r\n' */ + next(ls); /* skip '\n\r' or '\r\n' */ if (++ls->linenumber >= MAX_INT) - luaX_syntaxerror(ls, "chunk has too many lines"); + lexerror(ls, "chunk has too many lines", 0); } void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar) { + ls->t.token = 0; ls->decpoint = '.'; ls->L = L; ls->current = firstchar; @@ -167,8 +172,7 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, ls->linenumber = 1; ls->lastline = 1; ls->source = source; - ls->envn = luaS_new(L, LUA_ENV); /* create env name */ - luaS_fix(ls->envn); /* never collect this name */ + ls->envn = luaS_new(L, LUA_ENV); /* get env name */ luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ } @@ -181,12 +185,26 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, */ +static int check_next1 (LexState *ls, int c) { + if (ls->current == c) { + next(ls); + return 1; + } + else return 0; +} -static int check_next (LexState *ls, const char *set) { - if (ls->current == '\0' || !strchr(set, ls->current)) - return 0; - save_and_next(ls); - return 1; + +/* +** Check whether current char is in set 'set' (with two chars) and +** saves it +*/ +static int check_next2 (LexState *ls, const char *set) { + lua_assert(set[2] == '\0'); + if (ls->current == set[0] || ls->current == set[1]) { + save_and_next(ls); + return 1; + } + else return 0; } @@ -194,59 +212,73 @@ static int check_next (LexState *ls, const char *set) { ** change all characters 'from' in buffer to 'to' */ static void buffreplace (LexState *ls, char from, char to) { - size_t n = luaZ_bufflen(ls->buff); - char *p = luaZ_buffer(ls->buff); - while (n--) - if (p[n] == from) p[n] = to; + if (from != to) { + size_t n = luaZ_bufflen(ls->buff); + char *p = luaZ_buffer(ls->buff); + while (n--) + if (p[n] == from) p[n] = to; + } } -#if !defined(getlocaledecpoint) -#define getlocaledecpoint() (localeconv()->decimal_point[0]) +#if !defined(l_getlocaledecpoint) +#define l_getlocaledecpoint() (localeconv()->decimal_point[0]) #endif -#define buff2d(b,e) luaO_str2d(luaZ_buffer(b), luaZ_bufflen(b) - 1, e) +#define buff2num(b,o) (luaO_str2num(luaZ_buffer(b), o) != 0) /* ** in case of format error, try to change decimal point separator to ** the one defined in the current locale and check again */ -static void trydecpoint (LexState *ls, SemInfo *seminfo) { +static void trydecpoint (LexState *ls, TValue *o) { char old = ls->decpoint; - ls->decpoint = getlocaledecpoint(); + ls->decpoint = l_getlocaledecpoint(); buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ - if (!buff2d(ls->buff, &seminfo->r)) { + if (!buff2num(ls->buff, o)) { /* format error with correct decimal point: no more options */ buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ - lexerror(ls, "malformed number", TK_NUMBER); + lexerror(ls, "malformed number", TK_FLT); } } /* LUA_NUMBER */ /* -** this function is quite liberal in what it accepts, as 'luaO_str2d' +** this function is quite liberal in what it accepts, as 'luaO_str2num' ** will reject ill-formed numerals. */ -static void read_numeral (LexState *ls, SemInfo *seminfo) { +static int read_numeral (LexState *ls, SemInfo *seminfo) { + TValue obj; const char *expo = "Ee"; int first = ls->current; lua_assert(lisdigit(ls->current)); save_and_next(ls); - if (first == '0' && check_next(ls, "Xx")) /* hexadecimal? */ + if (first == '0' && check_next2(ls, "xX")) /* hexadecimal? */ expo = "Pp"; for (;;) { - if (check_next(ls, expo)) /* exponent part? */ - check_next(ls, "+-"); /* optional exponent sign */ - if (lisxdigit(ls->current) || ls->current == '.') + if (check_next2(ls, expo)) /* exponent part? */ + check_next2(ls, "-+"); /* optional exponent sign */ + if (lisxdigit(ls->current)) + save_and_next(ls); + else if (ls->current == '.') save_and_next(ls); - else break; + else break; } save(ls, '\0'); buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ - if (!buff2d(ls->buff, &seminfo->r)) /* format error? */ - trydecpoint(ls, seminfo); /* try to update decimal point separator */ + if (!buff2num(ls->buff, &obj)) /* format error? */ + trydecpoint(ls, &obj); /* try to update decimal point separator */ + if (ttisinteger(&obj)) { + seminfo->i = ivalue(&obj); + return TK_INT; + } + else { + lua_assert(ttisfloat(&obj)); + seminfo->r = fltvalue(&obj); + return TK_FLT; + } } @@ -268,18 +300,22 @@ static int skip_sep (LexState *ls) { static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { - save_and_next(ls); /* skip 2nd `[' */ + int line = ls->linenumber; /* initial line (for error message) */ + save_and_next(ls); /* skip 2nd '[' */ if (currIsNewline(ls)) /* string starts with a newline? */ inclinenumber(ls); /* skip it */ for (;;) { switch (ls->current) { - case EOZ: - lexerror(ls, (seminfo) ? "unfinished long string" : - "unfinished long comment", TK_EOS); + case EOZ: { /* error */ + const char *what = (seminfo ? "string" : "comment"); + const char *msg = luaO_pushfstring(ls->L, + "unfinished long %s (starting at line %d)", what, line); + lexerror(ls, msg, TK_EOS); break; /* to avoid warnings */ + } case ']': { if (skip_sep(ls) == sep) { - save_and_next(ls); /* skip 2nd `]' */ + save_and_next(ls); /* skip 2nd ']' */ goto endloop; } break; @@ -302,40 +338,65 @@ static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { } -static void escerror (LexState *ls, int *c, int n, const char *msg) { - int i; - luaZ_resetbuffer(ls->buff); /* prepare error message */ - save(ls, '\\'); - for (i = 0; i < n && c[i] != EOZ; i++) - save(ls, c[i]); - lexerror(ls, msg, TK_STRING); +static void esccheck (LexState *ls, int c, const char *msg) { + if (!c) { + if (ls->current != EOZ) + save_and_next(ls); /* add current to buffer for error message */ + lexerror(ls, msg, TK_STRING); + } +} + + +static int gethexa (LexState *ls) { + save_and_next(ls); + esccheck (ls, lisxdigit(ls->current), "hexadecimal digit expected"); + return luaO_hexavalue(ls->current); } static int readhexaesc (LexState *ls) { - int c[3], i; /* keep input for error message */ - int r = 0; /* result accumulator */ - c[0] = 'x'; /* for error message */ - for (i = 1; i < 3; i++) { /* read two hexadecimal digits */ - c[i] = next(ls); - if (!lisxdigit(c[i])) - escerror(ls, c, i + 1, "hexadecimal digit expected"); - r = (r << 4) + luaO_hexavalue(c[i]); + int r = gethexa(ls); + r = (r << 4) + gethexa(ls); + luaZ_buffremove(ls->buff, 2); /* remove saved chars from buffer */ + return r; +} + + +static unsigned long readutf8esc (LexState *ls) { + unsigned long r; + int i = 4; /* chars to be removed: '\', 'u', '{', and first digit */ + save_and_next(ls); /* skip 'u' */ + esccheck(ls, ls->current == '{', "missing '{'"); + r = gethexa(ls); /* must have at least one digit */ + while ((save_and_next(ls), lisxdigit(ls->current))) { + i++; + r = (r << 4) + luaO_hexavalue(ls->current); + esccheck(ls, r <= 0x10FFFF, "UTF-8 value too large"); } + esccheck(ls, ls->current == '}', "missing '}'"); + next(ls); /* skip '}' */ + luaZ_buffremove(ls->buff, i); /* remove saved chars from buffer */ return r; } +static void utf8esc (LexState *ls) { + char buff[UTF8BUFFSZ]; + int n = luaO_utf8esc(buff, readutf8esc(ls)); + for (; n > 0; n--) /* add 'buff' to string */ + save(ls, buff[UTF8BUFFSZ - n]); +} + + static int readdecesc (LexState *ls) { - int c[3], i; + int i; int r = 0; /* result accumulator */ for (i = 0; i < 3 && lisdigit(ls->current); i++) { /* read up to 3 digits */ - c[i] = ls->current; - r = 10*r + c[i] - '0'; - next(ls); + r = 10*r + ls->current - '0'; + save_and_next(ls); } - if (r > UCHAR_MAX) - escerror(ls, c, i, "decimal escape too large"); + esccheck(ls, r <= UCHAR_MAX, "decimal escape too large"); + luaZ_buffremove(ls->buff, i); /* remove read digits from buffer */ return r; } @@ -353,7 +414,7 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) { break; /* to avoid warnings */ case '\\': { /* escape sequences */ int c; /* final character to be saved */ - next(ls); /* do not save the `\' */ + save_and_next(ls); /* keep '\\' for error messages */ switch (ls->current) { case 'a': c = '\a'; goto read_save; case 'b': c = '\b'; goto read_save; @@ -363,12 +424,14 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) { case 't': c = '\t'; goto read_save; case 'v': c = '\v'; goto read_save; case 'x': c = readhexaesc(ls); goto read_save; + case 'u': utf8esc(ls); goto no_save; case '\n': case '\r': inclinenumber(ls); c = '\n'; goto only_save; case '\\': case '\"': case '\'': c = ls->current; goto read_save; case EOZ: goto no_save; /* will raise an error next loop */ case 'z': { /* zap following span of spaces */ + luaZ_buffremove(ls->buff, 1); /* remove '\\' */ next(ls); /* skip the 'z' */ while (lisspace(ls->current)) { if (currIsNewline(ls)) inclinenumber(ls); @@ -377,15 +440,18 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) { goto no_save; } default: { - if (!lisdigit(ls->current)) - escerror(ls, &ls->current, 1, "invalid escape sequence"); - /* digital escape \ddd */ - c = readdecesc(ls); + esccheck(ls, lisdigit(ls->current), "invalid escape sequence"); + c = readdecesc(ls); /* digital escape '\ddd' */ goto only_save; } } - read_save: next(ls); /* read next character */ - only_save: save(ls, c); /* save 'c' */ + read_save: + next(ls); + /* go through */ + only_save: + luaZ_buffremove(ls->buff, 1); /* remove '\\' */ + save(ls, c); + /* go through */ no_save: break; } default: @@ -417,7 +483,7 @@ static int llex (LexState *ls, SemInfo *seminfo) { next(ls); if (ls->current == '[') { /* long comment? */ int sep = skip_sep(ls); - luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ + luaZ_resetbuffer(ls->buff); /* 'skip_sep' may dirty the buffer */ if (sep >= 0) { read_long_string(ls, NULL, sep); /* skip long comment */ luaZ_resetbuffer(ls->buff); /* previous call may dirty the buff. */ @@ -440,28 +506,35 @@ static int llex (LexState *ls, SemInfo *seminfo) { } case '=': { next(ls); - if (ls->current != '=') return '='; - else { next(ls); return TK_EQ; } + if (check_next1(ls, '=')) return TK_EQ; + else return '='; } case '<': { next(ls); - if (ls->current != '=') return '<'; - else { next(ls); return TK_LE; } + if (check_next1(ls, '=')) return TK_LE; + else if (check_next1(ls, '<')) return TK_SHL; + else return '<'; } case '>': { next(ls); - if (ls->current != '=') return '>'; - else { next(ls); return TK_GE; } + if (check_next1(ls, '=')) return TK_GE; + else if (check_next1(ls, '>')) return TK_SHR; + else return '>'; + } + case '/': { + next(ls); + if (check_next1(ls, '/')) return TK_IDIV; + else return '/'; } case '~': { next(ls); - if (ls->current != '=') return '~'; - else { next(ls); return TK_NE; } + if (check_next1(ls, '=')) return TK_NE; + else return '~'; } case ':': { next(ls); - if (ls->current != ':') return ':'; - else { next(ls); return TK_DBCOLON; } + if (check_next1(ls, ':')) return TK_DBCOLON; + else return ':'; } case '"': case '\'': { /* short literal strings */ read_string(ls, ls->current, seminfo); @@ -469,18 +542,17 @@ static int llex (LexState *ls, SemInfo *seminfo) { } case '.': { /* '.', '..', '...', or number */ save_and_next(ls); - if (check_next(ls, ".")) { - if (check_next(ls, ".")) + if (check_next1(ls, '.')) { + if (check_next1(ls, '.')) return TK_DOTS; /* '...' */ else return TK_CONCAT; /* '..' */ } else if (!lisdigit(ls->current)) return '.'; - /* else go through */ + else return read_numeral(ls, seminfo); } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { - read_numeral(ls, seminfo); - return TK_NUMBER; + return read_numeral(ls, seminfo); } case EOZ: { return TK_EOS; @@ -495,7 +567,7 @@ static int llex (LexState *ls, SemInfo *seminfo) { luaZ_bufflen(ls->buff)); seminfo->ts = ts; if (isreserved(ts)) /* reserved word? */ - return ts->tsv.extra - 1 + FIRST_RESERVED; + return ts->extra - 1 + FIRST_RESERVED; else { return TK_NAME; } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/llex.h b/3rdparty/genie/src/host/lua-5.3.0/src/llex.h index a4acdd30218..afb40b56228 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/llex.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/llex.h @@ -1,5 +1,5 @@ /* -** $Id: llex.h,v 1.72.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: llex.h,v 1.78 2014/10/29 15:38:24 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -14,6 +14,10 @@ #define FIRST_RESERVED 257 +#if !defined(LUA_ENV) +#define LUA_ENV "_ENV" +#endif + /* * WARNING: if you change the order of this enumeration, @@ -26,8 +30,10 @@ enum RESERVED { TK_GOTO, TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, /* other terminal symbols */ - TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_DBCOLON, TK_EOS, - TK_NUMBER, TK_NAME, TK_STRING + TK_IDIV, TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, + TK_SHL, TK_SHR, + TK_DBCOLON, TK_EOS, + TK_FLT, TK_INT, TK_NAME, TK_STRING }; /* number of reserved words */ @@ -36,6 +42,7 @@ enum RESERVED { typedef union { lua_Number r; + lua_Integer i; TString *ts; } SemInfo; /* semantics information */ @@ -51,13 +58,14 @@ typedef struct Token { typedef struct LexState { int current; /* current character (charint) */ int linenumber; /* input line counter */ - int lastline; /* line of last token `consumed' */ + int lastline; /* line of last token 'consumed' */ Token t; /* current token */ Token lookahead; /* look ahead token */ struct FuncState *fs; /* current function (parser) */ struct lua_State *L; ZIO *z; /* input stream */ Mbuffer *buff; /* buffer for tokens */ + Table *h; /* to avoid collection/reuse strings */ struct Dyndata *dyd; /* dynamic structures used by the parser */ TString *source; /* current source name */ TString *envn; /* environment variable name */ diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/llimits.h b/3rdparty/genie/src/host/lua-5.3.0/src/llimits.h new file mode 100644 index 00000000000..8f71a6ffb95 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/llimits.h @@ -0,0 +1,242 @@ +/* +** $Id: llimits.h,v 1.125 2014/12/19 13:30:23 roberto Exp $ +** Limits, basic types, and some other 'installation-dependent' definitions +** See Copyright Notice in lua.h +*/ + +#ifndef llimits_h +#define llimits_h + + +#include <limits.h> +#include <stddef.h> + + +#include "lua.h" + +/* +** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count +** the total memory used by Lua (in bytes). Usually, 'size_t' and +** 'ptrdiff_t' should work, but we use 'long' for 16-bit machines. +*/ +#if defined(LUAI_MEM) /* { external definitions? */ +typedef LUAI_UMEM lu_mem; +typedef LUAI_MEM l_mem; +#elif LUAI_BITSINT >= 32 /* }{ */ +typedef size_t lu_mem; +typedef ptrdiff_t l_mem; +#else /* 16-bit ints */ /* }{ */ +typedef unsigned long lu_mem; +typedef long l_mem; +#endif /* } */ + + +/* chars used as small naturals (so that 'char' is reserved for characters) */ +typedef unsigned char lu_byte; + + +/* maximum value for size_t */ +#define MAX_SIZET ((size_t)(~(size_t)0)) + +/* maximum size visible for Lua (must be representable in a lua_Integer */ +#define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \ + : (size_t)(LUA_MAXINTEGER)) + + +#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)) + +#define MAX_LMEM ((l_mem)(MAX_LUMEM >> 1)) + + +#define MAX_INT INT_MAX /* maximum value of an int */ + + +/* +** conversion of pointer to integer: +** this is for hashing only; there is no problem if the integer +** cannot hold the whole pointer value +*/ +#define point2int(p) ((unsigned int)((size_t)(p) & UINT_MAX)) + + + +/* type to ensure maximum alignment */ +#if defined(LUAI_USER_ALIGNMENT_T) +typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; +#else +typedef union { double u; void *s; lua_Integer i; long l; } L_Umaxalign; +#endif + + + +/* types of 'usual argument conversions' for lua_Number and lua_Integer */ +typedef LUAI_UACNUMBER l_uacNumber; +typedef LUAI_UACINT l_uacInt; + + +/* internal assertions for in-house debugging */ +#if defined(lua_assert) +#define check_exp(c,e) (lua_assert(c), (e)) +/* to avoid problems with conditions too long */ +#define lua_longassert(c) { if (!(c)) lua_assert(0); } +#else +#define lua_assert(c) ((void)0) +#define check_exp(c,e) (e) +#define lua_longassert(c) ((void)0) +#endif + +/* +** assertion for checking API calls +*/ +#if defined(LUA_USE_APICHECK) +#include <assert.h> +#define luai_apicheck(e) assert(e) +#else +#define luai_apicheck(e) lua_assert(e) +#endif + + +#define api_check(e,msg) luai_apicheck((e) && msg) + + +#if !defined(UNUSED) +#define UNUSED(x) ((void)(x)) /* to avoid warnings */ +#endif + + +#define cast(t, exp) ((t)(exp)) + +#define cast_void(i) cast(void, (i)) +#define cast_byte(i) cast(lu_byte, (i)) +#define cast_num(i) cast(lua_Number, (i)) +#define cast_int(i) cast(int, (i)) +#define cast_uchar(i) cast(unsigned char, (i)) + + +/* cast a signed lua_Integer to lua_Unsigned */ +#if !defined(l_castS2U) +#define l_castS2U(i) ((lua_Unsigned)(i)) +#endif + +/* +** cast a lua_Unsigned to a signed lua_Integer; this cast is +** not strict ISO C, but two-complement architectures should +** work fine. +*/ +#if !defined(l_castU2S) +#define l_castU2S(i) ((lua_Integer)(i)) +#endif + + +/* +** non-return type +*/ +#if defined(__GNUC__) +#define l_noret void __attribute__((noreturn)) +#elif defined(_MSC_VER) && _MSC_VER >= 1200 +#define l_noret void __declspec(noreturn) +#else +#define l_noret void +#endif + + + +/* +** maximum depth for nested C calls and syntactical nested non-terminals +** in a program. (Value must fit in an unsigned short int.) +*/ +#if !defined(LUAI_MAXCCALLS) +#define LUAI_MAXCCALLS 200 +#endif + +/* +** maximum number of upvalues in a closure (both C and Lua). (Value +** must fit in an unsigned char.) +*/ +#define MAXUPVAL UCHAR_MAX + + +/* +** type for virtual-machine instructions; +** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) +*/ +#if LUAI_BITSINT >= 32 +typedef unsigned int Instruction; +#else +typedef unsigned long Instruction; +#endif + + + + +/* minimum size for the string table (must be power of 2) */ +#if !defined(MINSTRTABSIZE) +#define MINSTRTABSIZE 64 /* minimum size for "predefined" strings */ +#endif + + +/* minimum size for string buffer */ +#if !defined(LUA_MINBUFFER) +#define LUA_MINBUFFER 32 +#endif + + +#if !defined(lua_lock) +#define lua_lock(L) ((void) 0) +#define lua_unlock(L) ((void) 0) +#endif + +#if !defined(luai_threadyield) +#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} +#endif + + +/* +** these macros allow user-specific actions on threads when you defined +** LUAI_EXTRASPACE and need to do something extra when a thread is +** created/deleted/resumed/yielded. +*/ +#if !defined(luai_userstateopen) +#define luai_userstateopen(L) ((void)L) +#endif + +#if !defined(luai_userstateclose) +#define luai_userstateclose(L) ((void)L) +#endif + +#if !defined(luai_userstatethread) +#define luai_userstatethread(L,L1) ((void)L) +#endif + +#if !defined(luai_userstatefree) +#define luai_userstatefree(L,L1) ((void)L) +#endif + +#if !defined(luai_userstateresume) +#define luai_userstateresume(L,n) ((void)L) +#endif + +#if !defined(luai_userstateyield) +#define luai_userstateyield(L,n) ((void)L) +#endif + + + +/* +** macro to control inclusion of some hard tests on stack reallocation +*/ +#if !defined(HARDSTACKTESTS) +#define condmovestack(L) ((void)0) +#else +/* realloc stack keeping its size */ +#define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) +#endif + +#if !defined(HARDMEMTESTS) +#define condchangemem(L) condmovestack(L) +#else +#define condchangemem(L) \ + ((void)(!(G(L)->gcrunning) || (luaC_fullgc(L, 0), 1))) +#endif + +#endif diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lmathlib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lmathlib.c new file mode 100644 index 00000000000..002c508bc46 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lmathlib.c @@ -0,0 +1,404 @@ +/* +** $Id: lmathlib.c,v 1.114 2014/12/27 20:32:26 roberto Exp $ +** Standard mathematical library +** See Copyright Notice in lua.h +*/ + +#define lmathlib_c +#define LUA_LIB + +#include "lprefix.h" + + +#include <stdlib.h> +#include <math.h> + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#undef PI +#define PI (l_mathop(3.141592653589793238462643383279502884)) + + +#if !defined(l_rand) /* { */ +#if defined(LUA_USE_POSIX) +#define l_rand() random() +#define l_srand(x) srandom(x) +#define L_RANDMAX 2147483647 /* (2^31 - 1), following POSIX */ +#else +#define l_rand() rand() +#define l_srand(x) srand(x) +#define L_RANDMAX RAND_MAX +#endif +#endif /* } */ + + +static int math_abs (lua_State *L) { + if (lua_isinteger(L, 1)) { + lua_Integer n = lua_tointeger(L, 1); + if (n < 0) n = (lua_Integer)(0u - n); + lua_pushinteger(L, n); + } + else + lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_sin (lua_State *L) { + lua_pushnumber(L, l_mathop(sin)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_cos (lua_State *L) { + lua_pushnumber(L, l_mathop(cos)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_tan (lua_State *L) { + lua_pushnumber(L, l_mathop(tan)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_asin (lua_State *L) { + lua_pushnumber(L, l_mathop(asin)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_acos (lua_State *L) { + lua_pushnumber(L, l_mathop(acos)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_atan (lua_State *L) { + lua_Number y = luaL_checknumber(L, 1); + lua_Number x = luaL_optnumber(L, 2, 1); + lua_pushnumber(L, l_mathop(atan2)(y, x)); + return 1; +} + + +static int math_toint (lua_State *L) { + int valid; + lua_Integer n = lua_tointegerx(L, 1, &valid); + if (valid) + lua_pushinteger(L, n); + else { + luaL_checkany(L, 1); + lua_pushnil(L); /* value is not convertible to integer */ + } + return 1; +} + + +static void pushnumint (lua_State *L, lua_Number d) { + lua_Integer n; + if (lua_numbertointeger(d, &n)) /* does 'd' fit in an integer? */ + lua_pushinteger(L, n); /* result is integer */ + else + lua_pushnumber(L, d); /* result is float */ +} + + +static int math_floor (lua_State *L) { + if (lua_isinteger(L, 1)) + lua_settop(L, 1); /* integer is its own floor */ + else { + lua_Number d = l_mathop(floor)(luaL_checknumber(L, 1)); + pushnumint(L, d); + } + return 1; +} + + +static int math_ceil (lua_State *L) { + if (lua_isinteger(L, 1)) + lua_settop(L, 1); /* integer is its own ceil */ + else { + lua_Number d = l_mathop(ceil)(luaL_checknumber(L, 1)); + pushnumint(L, d); + } + return 1; +} + + +static int math_fmod (lua_State *L) { + if (lua_isinteger(L, 1) && lua_isinteger(L, 2)) { + lua_Integer d = lua_tointeger(L, 2); + if ((lua_Unsigned)d + 1u <= 1u) { /* special cases: -1 or 0 */ + luaL_argcheck(L, d != 0, 2, "zero"); + lua_pushinteger(L, 0); /* avoid overflow with 0x80000... / -1 */ + } + else + lua_pushinteger(L, lua_tointeger(L, 1) % d); + } + else + lua_pushnumber(L, l_mathop(fmod)(luaL_checknumber(L, 1), + luaL_checknumber(L, 2))); + return 1; +} + + +/* +** next function does not use 'modf', avoiding problems with 'double*' +** (which is not compatible with 'float*') when lua_Number is not +** 'double'. +*/ +static int math_modf (lua_State *L) { + if (lua_isinteger(L ,1)) { + lua_settop(L, 1); /* number is its own integer part */ + lua_pushnumber(L, 0); /* no fractional part */ + } + else { + lua_Number n = luaL_checknumber(L, 1); + /* integer part (rounds toward zero) */ + lua_Number ip = (n < 0) ? l_mathop(ceil)(n) : l_mathop(floor)(n); + pushnumint(L, ip); + /* fractional part (test needed for inf/-inf) */ + lua_pushnumber(L, (n == ip) ? l_mathop(0.0) : (n - ip)); + } + return 2; +} + + +static int math_sqrt (lua_State *L) { + lua_pushnumber(L, l_mathop(sqrt)(luaL_checknumber(L, 1))); + return 1; +} + + +static int math_ult (lua_State *L) { + lua_Integer a = luaL_checkinteger(L, 1); + lua_Integer b = luaL_checkinteger(L, 2); + lua_pushboolean(L, (lua_Unsigned)a < (lua_Unsigned)b); + return 1; +} + +static int math_log (lua_State *L) { + lua_Number x = luaL_checknumber(L, 1); + lua_Number res; + if (lua_isnoneornil(L, 2)) + res = l_mathop(log)(x); + else { + lua_Number base = luaL_checknumber(L, 2); + if (base == 10.0) res = l_mathop(log10)(x); + else res = l_mathop(log)(x)/l_mathop(log)(base); + } + lua_pushnumber(L, res); + return 1; +} + +static int math_exp (lua_State *L) { + lua_pushnumber(L, l_mathop(exp)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_deg (lua_State *L) { + lua_pushnumber(L, luaL_checknumber(L, 1) * (l_mathop(180.0) / PI)); + return 1; +} + +static int math_rad (lua_State *L) { + lua_pushnumber(L, luaL_checknumber(L, 1) * (PI / l_mathop(180.0))); + return 1; +} + + +static int math_min (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + int imin = 1; /* index of current minimum value */ + int i; + luaL_argcheck(L, n >= 1, 1, "value expected"); + for (i = 2; i <= n; i++) { + if (lua_compare(L, i, imin, LUA_OPLT)) + imin = i; + } + lua_pushvalue(L, imin); + return 1; +} + + +static int math_max (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + int imax = 1; /* index of current maximum value */ + int i; + luaL_argcheck(L, n >= 1, 1, "value expected"); + for (i = 2; i <= n; i++) { + if (lua_compare(L, imax, i, LUA_OPLT)) + imax = i; + } + lua_pushvalue(L, imax); + return 1; +} + +/* +** This function uses 'double' (instead of 'lua_Number') to ensure that +** all bits from 'l_rand' can be represented, and that 'RANDMAX + 1.0' +** will keep full precision (ensuring that 'r' is always less than 1.0.) +*/ +static int math_random (lua_State *L) { + lua_Integer low, up; + double r = (double)l_rand() * (1.0 / ((double)L_RANDMAX + 1.0)); + switch (lua_gettop(L)) { /* check number of arguments */ + case 0: { /* no arguments */ + lua_pushnumber(L, (lua_Number)r); /* Number between 0 and 1 */ + return 1; + } + case 1: { /* only upper limit */ + low = 1; + up = luaL_checkinteger(L, 1); + break; + } + case 2: { /* lower and upper limits */ + low = luaL_checkinteger(L, 1); + up = luaL_checkinteger(L, 2); + break; + } + default: return luaL_error(L, "wrong number of arguments"); + } + /* random integer in the interval [low, up] */ + luaL_argcheck(L, low <= up, 1, "interval is empty"); + luaL_argcheck(L, low >= 0 || up <= LUA_MAXINTEGER + low, 1, + "interval too large"); + r *= (double)(up - low) + 1.0; + lua_pushinteger(L, (lua_Integer)r + low); + return 1; +} + + +static int math_randomseed (lua_State *L) { + l_srand((unsigned int)(lua_Integer)luaL_checknumber(L, 1)); + (void)rand(); /* discard first value to avoid undesirable correlations */ + return 0; +} + + +static int math_type (lua_State *L) { + if (lua_type(L, 1) == LUA_TNUMBER) { + if (lua_isinteger(L, 1)) + lua_pushliteral(L, "integer"); + else + lua_pushliteral(L, "float"); + } + else { + luaL_checkany(L, 1); + lua_pushnil(L); + } + return 1; +} + + +/* +** {================================================================== +** Deprecated functions (for compatibility only) +** =================================================================== +*/ +#if defined(LUA_COMPAT_MATHLIB) + +static int math_cosh (lua_State *L) { + lua_pushnumber(L, l_mathop(cosh)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_sinh (lua_State *L) { + lua_pushnumber(L, l_mathop(sinh)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_tanh (lua_State *L) { + lua_pushnumber(L, l_mathop(tanh)(luaL_checknumber(L, 1))); + return 1; +} + +static int math_pow (lua_State *L) { + lua_Number x = luaL_checknumber(L, 1); + lua_Number y = luaL_checknumber(L, 2); + lua_pushnumber(L, l_mathop(pow)(x, y)); + return 1; +} + +static int math_frexp (lua_State *L) { + int e; + lua_pushnumber(L, l_mathop(frexp)(luaL_checknumber(L, 1), &e)); + lua_pushinteger(L, e); + return 2; +} + +static int math_ldexp (lua_State *L) { + lua_Number x = luaL_checknumber(L, 1); + int ep = (int)luaL_checkinteger(L, 2); + lua_pushnumber(L, l_mathop(ldexp)(x, ep)); + return 1; +} + +static int math_log10 (lua_State *L) { + lua_pushnumber(L, l_mathop(log10)(luaL_checknumber(L, 1))); + return 1; +} + +#endif +/* }================================================================== */ + + + +static const luaL_Reg mathlib[] = { + {"abs", math_abs}, + {"acos", math_acos}, + {"asin", math_asin}, + {"atan", math_atan}, + {"ceil", math_ceil}, + {"cos", math_cos}, + {"deg", math_deg}, + {"exp", math_exp}, + {"tointeger", math_toint}, + {"floor", math_floor}, + {"fmod", math_fmod}, + {"ult", math_ult}, + {"log", math_log}, + {"max", math_max}, + {"min", math_min}, + {"modf", math_modf}, + {"rad", math_rad}, + {"random", math_random}, + {"randomseed", math_randomseed}, + {"sin", math_sin}, + {"sqrt", math_sqrt}, + {"tan", math_tan}, + {"type", math_type}, +#if defined(LUA_COMPAT_MATHLIB) + {"atan2", math_atan}, + {"cosh", math_cosh}, + {"sinh", math_sinh}, + {"tanh", math_tanh}, + {"pow", math_pow}, + {"frexp", math_frexp}, + {"ldexp", math_ldexp}, + {"log10", math_log10}, +#endif + /* placeholders */ + {"pi", NULL}, + {"huge", NULL}, + {"maxinteger", NULL}, + {"mininteger", NULL}, + {NULL, NULL} +}; + + +/* +** Open math library +*/ +LUAMOD_API int luaopen_math (lua_State *L) { + luaL_newlib(L, mathlib); + lua_pushnumber(L, PI); + lua_setfield(L, -2, "pi"); + lua_pushnumber(L, (lua_Number)HUGE_VAL); + lua_setfield(L, -2, "huge"); + lua_pushinteger(L, LUA_MAXINTEGER); + lua_setfield(L, -2, "maxinteger"); + lua_pushinteger(L, LUA_MININTEGER); + lua_setfield(L, -2, "mininteger"); + return 1; +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lmem.c b/3rdparty/genie/src/host/lua-5.3.0/src/lmem.c index ee343e3e037..4feaf036c72 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lmem.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lmem.c @@ -1,15 +1,17 @@ /* -** $Id: lmem.c,v 1.84.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lmem.c,v 1.89 2014/11/02 19:33:33 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ - -#include <stddef.h> - #define lmem_c #define LUA_CORE +#include "lprefix.h" + + +#include <stddef.h> + #include "lua.h" #include "ldebug.h" @@ -24,15 +26,15 @@ /* ** About the realloc function: ** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); -** (`osize' is the old size, `nsize' is the new size) +** ('osize' is the old size, 'nsize' is the new size) ** -** * frealloc(ud, NULL, x, s) creates a new block of size `s' (no +** * frealloc(ud, NULL, x, s) creates a new block of size 's' (no ** matter 'x'). ** -** * frealloc(ud, p, x, 0) frees the block `p' +** * frealloc(ud, p, x, 0) frees the block 'p' ** (in this specific case, frealloc must return NULL); ** particularly, frealloc(ud, NULL, 0, 0) does nothing -** (which is equivalent to free(NULL) in ANSI C) +** (which is equivalent to free(NULL) in ISO C) ** ** frealloc returns NULL if it cannot create or reallocate the area ** (any reallocation to an equal or smaller size cannot fail!) @@ -83,12 +85,10 @@ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { #endif newblock = (*g->frealloc)(g->ud, block, osize, nsize); if (newblock == NULL && nsize > 0) { - api_check(L, nsize > realosize, + api_check( nsize > realosize, "realloc cannot fail when shrinking a block"); - if (g->gcrunning) { - luaC_fullgc(L, 1); /* try to free some memory... */ - newblock = (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ - } + luaC_fullgc(L, 1); /* try to free some memory... */ + newblock = (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ if (newblock == NULL) luaD_throw(L, LUA_ERRMEM); } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lmem.h b/3rdparty/genie/src/host/lua-5.3.0/src/lmem.h index bd4f4e0726f..30f484895e7 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lmem.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lmem.h @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.40.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -15,20 +15,32 @@ /* -** This macro avoids the runtime division MAX_SIZET/(e), as 'e' is -** always constant. -** The macro is somewhat complex to avoid warnings: -** +1 avoids warnings of "comparison has constant result"; -** cast to 'void' avoids warnings of "value unused". +** This macro reallocs a vector 'b' from 'on' to 'n' elements, where +** each element has size 'e'. In case of arithmetic overflow of the +** product 'n'*'e', it raises an error (calling 'luaM_toobig'). Because +** 'e' is always constant, it avoids the runtime division MAX_SIZET/(e). +** +** (The macro is somewhat complex to avoid warnings: The 'sizeof' +** comparison avoids a runtime comparison when overflow cannot occur. +** The compiler should be able to optimize the real test by itself, but +** when it does it, it may give a warning about "comparison is always +** false due to limited range of data type"; the +1 tricks the compiler, +** avoiding this warning but also this optimization.) */ #define luaM_reallocv(L,b,on,n,e) \ - (cast(void, \ - (cast(size_t, (n)+1) > MAX_SIZET/(e)) ? (luaM_toobig(L), 0) : 0), \ + (((sizeof(n) >= sizeof(size_t) && cast(size_t, (n)) + 1 > MAX_SIZET/(e)) \ + ? luaM_toobig(L) : cast_void(0)) , \ luaM_realloc_(L, (b), (on)*(e), (n)*(e))) +/* +** Arrays of chars do not need any test +*/ +#define luaM_reallocvchar(L,b,on,n) \ + cast(char *, luaM_realloc_(L, (b), (on)*sizeof(char), (n)*sizeof(char))) + #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) -#define luaM_freearray(L, b, n) luaM_reallocv(L, (b), n, 0, sizeof((b)[0])) +#define luaM_freearray(L, b, n) luaM_realloc_(L, (b), (n)*sizeof(*(b)), 0) #define luaM_malloc(L,s) luaM_realloc_(L, NULL, 0, (s)) #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/loadlib.c b/3rdparty/genie/src/host/lua-5.3.0/src/loadlib.c index bedbea3e9a7..7f8d9902986 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/loadlib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.111.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: loadlib.c,v 1.124 2015/01/05 13:51:39 roberto Exp $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -8,22 +8,15 @@ ** systems. */ +#define loadlib_c +#define LUA_LIB -/* -** if needed, includes windows header before everything else -*/ -#if defined(_WIN32) -#include <windows.h> -#endif +#include "lprefix.h" #include <stdlib.h> #include <string.h> - -#define loadlib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" @@ -31,21 +24,21 @@ /* -** LUA_PATH and LUA_CPATH are the names of the environment +** LUA_PATH_VAR and LUA_CPATH_VAR are the names of the environment ** variables that Lua check to set its paths. */ -#if !defined(LUA_PATH) -#define LUA_PATH "LUA_PATH" +#if !defined(LUA_PATH_VAR) +#define LUA_PATH_VAR "LUA_PATH" #endif -#if !defined(LUA_CPATH) -#define LUA_CPATH "LUA_CPATH" +#if !defined(LUA_CPATH_VAR) +#define LUA_CPATH_VAR "LUA_CPATH" #endif #define LUA_PATHSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR -#define LUA_PATHVERSION LUA_PATH LUA_PATHSUFFIX -#define LUA_CPATHVERSION LUA_CPATH LUA_PATHSUFFIX +#define LUA_PATHVARVERSION LUA_PATH_VAR LUA_PATHSUFFIX +#define LUA_CPATHVARVERSION LUA_CPATH_VAR LUA_PATHSUFFIX /* ** LUA_PATH_SEP is the character that separates templates in a path. @@ -92,29 +85,45 @@ #define LUA_OFSEP "_" -/* table (in the registry) that keeps handles for all loaded C libraries */ -#define CLIBS "_CLIBS" +/* +** unique key for table in the registry that keeps handles +** for all loaded C libraries +*/ +static const int CLIBS = 0; #define LIB_FAIL "open" - -/* error codes for ll_loadfunc */ -#define ERRLIB 1 -#define ERRFUNC 2 - #define setprogdir(L) ((void)0) /* ** system-dependent functions */ -static void ll_unloadlib (void *lib); -static void *ll_load (lua_State *L, const char *path, int seeglb); -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); +/* +** unload library 'lib' +*/ +static void lsys_unloadlib (void *lib); + +/* +** load C library in file 'path'. If 'seeglb', load with all names in +** the library global. +** Returns the library; in case of error, returns NULL plus an +** error string in the stack. +*/ +static void *lsys_load (lua_State *L, const char *path, int seeglb); + +/* +** Try to find a function named 'sym' in library 'lib'. +** Returns the function; in case of error, returns NULL plus an +** error string in the stack. +*/ +static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym); -#if defined(LUA_USE_DLOPEN) + + +#if defined(LUA_USE_DLOPEN) /* { */ /* ** {======================================================================== ** This is an implementation of loadlib based on the dlfcn interface. @@ -126,20 +135,32 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); #include <dlfcn.h> -static void ll_unloadlib (void *lib) { +/* +** Macro to covert pointer to void* to pointer to function. This cast +** is undefined according to ISO C, but POSIX assumes that it must work. +** (The '__extension__' in gnu compilers is only to avoid warnings.) +*/ +#if defined(__GNUC__) +#define cast_func(p) (__extension__ (lua_CFunction)(p)) +#else +#define cast_func(p) ((lua_CFunction)(p)) +#endif + + +static void lsys_unloadlib (void *lib) { dlclose(lib); } -static void *ll_load (lua_State *L, const char *path, int seeglb) { +static void *lsys_load (lua_State *L, const char *path, int seeglb) { void *lib = dlopen(path, RTLD_NOW | (seeglb ? RTLD_GLOBAL : RTLD_LOCAL)); if (lib == NULL) lua_pushstring(L, dlerror()); return lib; } -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { - lua_CFunction f = (lua_CFunction)dlsym(lib, sym); +static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) { + lua_CFunction f = cast_func(dlsym(lib, sym)); if (f == NULL) lua_pushstring(L, dlerror()); return f; } @@ -148,13 +169,15 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { -#elif defined(LUA_DL_DLL) +#elif defined(LUA_DL_DLL) /* }{ */ /* ** {====================================================================== ** This is an implementation of loadlib for Windows using native functions. ** ======================================================================= */ +#include <windows.h> + #undef setprogdir /* @@ -190,12 +213,12 @@ static void pusherror (lua_State *L) { lua_pushfstring(L, "system error %d\n", error); } -static void ll_unloadlib (void *lib) { +static void lsys_unloadlib (void *lib) { FreeLibrary((HMODULE)lib); } -static void *ll_load (lua_State *L, const char *path, int seeglb) { +static void *lsys_load (lua_State *L, const char *path, int seeglb) { HMODULE lib = LoadLibraryExA(path, NULL, LUA_LLE_FLAGS); (void)(seeglb); /* not used: symbols are 'global' by default */ if (lib == NULL) pusherror(L); @@ -203,7 +226,7 @@ static void *ll_load (lua_State *L, const char *path, int seeglb) { } -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { +static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) { lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym); if (f == NULL) pusherror(L); return f; @@ -212,7 +235,7 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { /* }====================================================== */ -#else +#else /* }{ */ /* ** {====================================================== ** Fallback for other systems @@ -226,31 +249,34 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { #define DLMSG "dynamic libraries not enabled; check your Lua installation" -static void ll_unloadlib (void *lib) { +static void lsys_unloadlib (void *lib) { (void)(lib); /* not used */ } -static void *ll_load (lua_State *L, const char *path, int seeglb) { +static void *lsys_load (lua_State *L, const char *path, int seeglb) { (void)(path); (void)(seeglb); /* not used */ lua_pushliteral(L, DLMSG); return NULL; } -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { +static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) { (void)(lib); (void)(sym); /* not used */ lua_pushliteral(L, DLMSG); return NULL; } /* }====================================================== */ -#endif +#endif /* } */ -static void *ll_checkclib (lua_State *L, const char *path) { +/* +** return registry.CLIBS[path] +*/ +static void *checkclib (lua_State *L, const char *path) { void *plib; - lua_getfield(L, LUA_REGISTRYINDEX, CLIBS); + lua_rawgetp(L, LUA_REGISTRYINDEX, &CLIBS); lua_getfield(L, -1, path); plib = lua_touserdata(L, -1); /* plib = CLIBS[path] */ lua_pop(L, 2); /* pop CLIBS table and 'plib' */ @@ -258,8 +284,12 @@ static void *ll_checkclib (lua_State *L, const char *path) { } -static void ll_addtoclib (lua_State *L, const char *path, void *plib) { - lua_getfield(L, LUA_REGISTRYINDEX, CLIBS); +/* +** registry.CLIBS[path] = plib -- for queries +** registry.CLIBS[#CLIBS + 1] = plib -- also keep a list of all libraries +*/ +static void addtoclib (lua_State *L, const char *path, void *plib) { + lua_rawgetp(L, LUA_REGISTRYINDEX, &CLIBS); lua_pushlightuserdata(L, plib); lua_pushvalue(L, -1); lua_setfield(L, -3, path); /* CLIBS[path] = plib */ @@ -269,33 +299,49 @@ static void ll_addtoclib (lua_State *L, const char *path, void *plib) { /* -** __gc tag method for CLIBS table: calls 'll_unloadlib' for all lib +** __gc tag method for CLIBS table: calls 'lsys_unloadlib' for all lib ** handles in list CLIBS */ static int gctm (lua_State *L) { - int n = luaL_len(L, 1); + lua_Integer n = luaL_len(L, 1); for (; n >= 1; n--) { /* for each handle, in reverse order */ lua_rawgeti(L, 1, n); /* get handle CLIBS[n] */ - ll_unloadlib(lua_touserdata(L, -1)); + lsys_unloadlib(lua_touserdata(L, -1)); lua_pop(L, 1); /* pop handle */ } return 0; } -static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { - void *reg = ll_checkclib(L, path); /* check loaded C libraries */ + +/* error codes for 'lookforfunc' */ +#define ERRLIB 1 +#define ERRFUNC 2 + +/* +** Look for a C function named 'sym' in a dynamically loaded library +** 'path'. +** First, check whether the library is already loaded; if not, try +** to load it. +** Then, if 'sym' is '*', return true (as library has been loaded). +** Otherwise, look for symbol 'sym' in the library and push a +** C function with that symbol. +** Return 0 and 'true' or a function in the stack; in case of +** errors, return an error code and an error message in the stack. +*/ +static int lookforfunc (lua_State *L, const char *path, const char *sym) { + void *reg = checkclib(L, path); /* check loaded C libraries */ if (reg == NULL) { /* must load library? */ - reg = ll_load(L, path, *sym == '*'); + reg = lsys_load(L, path, *sym == '*'); /* global symbols if 'sym'=='*' */ if (reg == NULL) return ERRLIB; /* unable to load library */ - ll_addtoclib(L, path, reg); + addtoclib(L, path, reg); } if (*sym == '*') { /* loading only library (no function)? */ lua_pushboolean(L, 1); /* return 'true' */ return 0; /* no errors */ } else { - lua_CFunction f = ll_sym(L, reg, sym); + lua_CFunction f = lsys_sym(L, reg, sym); if (f == NULL) return ERRFUNC; /* unable to find function */ lua_pushcfunction(L, f); /* else create new function */ @@ -307,7 +353,7 @@ static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { static int ll_loadlib (lua_State *L) { const char *path = luaL_checkstring(L, 1); const char *init = luaL_checkstring(L, 2); - int stat = ll_loadfunc(L, path, init); + int stat = lookforfunc(L, path, init); if (stat == 0) /* no errors? */ return 1; /* return the loaded function */ else { /* error; error message is on stack top */ @@ -360,7 +406,7 @@ static const char *searchpath (lua_State *L, const char *name, lua_remove(L, -2); /* remove path template */ if (readable(filename)) /* does file exist and is readable? */ return filename; /* return that file name */ - lua_pushfstring(L, "\n\tno file " LUA_QS, filename); + lua_pushfstring(L, "\n\tno file '%s'", filename); lua_remove(L, -2); /* remove file name */ luaL_addvalue(&msg); /* concatenate error msg. entry */ } @@ -390,7 +436,7 @@ static const char *findfile (lua_State *L, const char *name, lua_getfield(L, lua_upvalueindex(1), pname); path = lua_tostring(L, -1); if (path == NULL) - luaL_error(L, LUA_QL("package.%s") " must be a string", pname); + luaL_error(L, "'package.%s' must be a string", pname); return searchpath(L, name, path, ".", dirsep); } @@ -401,8 +447,7 @@ static int checkload (lua_State *L, int stat, const char *filename) { return 2; /* return open function and file name */ } else - return luaL_error(L, "error loading module " LUA_QS - " from file " LUA_QS ":\n\t%s", + return luaL_error(L, "error loading module '%s' from file '%s':\n\t%s", lua_tostring(L, 1), filename, lua_tostring(L, -1)); } @@ -416,21 +461,29 @@ static int searcher_Lua (lua_State *L) { } +/* +** Try to find a load function for module 'modname' at file 'filename'. +** First, change '.' to '_' in 'modname'; then, if 'modname' has +** the form X-Y (that is, it has an "ignore mark"), build a function +** name "luaopen_X" and look for it. (For compatibility, if that +** fails, it also tries "luaopen_Y".) If there is no ignore mark, +** look for a function named "luaopen_modname". +*/ static int loadfunc (lua_State *L, const char *filename, const char *modname) { - const char *funcname; + const char *openfunc; const char *mark; modname = luaL_gsub(L, modname, ".", LUA_OFSEP); mark = strchr(modname, *LUA_IGMARK); if (mark) { int stat; - funcname = lua_pushlstring(L, modname, mark - modname); - funcname = lua_pushfstring(L, LUA_POF"%s", funcname); - stat = ll_loadfunc(L, filename, funcname); + openfunc = lua_pushlstring(L, modname, mark - modname); + openfunc = lua_pushfstring(L, LUA_POF"%s", openfunc); + stat = lookforfunc(L, filename, openfunc); if (stat != ERRFUNC) return stat; modname = mark + 1; /* else go ahead and try old-style name */ } - funcname = lua_pushfstring(L, LUA_POF"%s", modname); - return ll_loadfunc(L, filename, funcname); + openfunc = lua_pushfstring(L, LUA_POF"%s", modname); + return lookforfunc(L, filename, openfunc); } @@ -455,8 +508,7 @@ static int searcher_Croot (lua_State *L) { if (stat != ERRFUNC) return checkload(L, 0, filename); /* real error */ else { /* open function not found */ - lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, - name, filename); + lua_pushfstring(L, "\n\tno module '%s' in file '%s'", name, filename); return 1; } } @@ -468,8 +520,7 @@ static int searcher_Croot (lua_State *L) { static int searcher_preload (lua_State *L) { const char *name = luaL_checkstring(L, 1); lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); - lua_getfield(L, -1, name); - if (lua_isnil(L, -1)) /* not found? */ + if (lua_getfield(L, -1, name) == LUA_TNIL) /* not found? */ lua_pushfstring(L, "\n\tno field package.preload['%s']", name); return 1; } @@ -479,17 +530,15 @@ static void findloader (lua_State *L, const char *name) { int i; luaL_Buffer msg; /* to build error message */ luaL_buffinit(L, &msg); - lua_getfield(L, lua_upvalueindex(1), "searchers"); /* will be at index 3 */ - if (!lua_istable(L, 3)) - luaL_error(L, LUA_QL("package.searchers") " must be a table"); + /* push 'package.searchers' to index 3 in the stack */ + if (lua_getfield(L, lua_upvalueindex(1), "searchers") != LUA_TTABLE) + luaL_error(L, "'package.searchers' must be a table"); /* iterate over available searchers to find a loader */ for (i = 1; ; i++) { - lua_rawgeti(L, 3, i); /* get a searcher */ - if (lua_isnil(L, -1)) { /* no more searchers? */ + if (lua_rawgeti(L, 3, i) == LUA_TNIL) { /* no more searchers? */ lua_pop(L, 1); /* remove nil */ luaL_pushresult(&msg); /* create error message */ - luaL_error(L, "module " LUA_QS " not found:%s", - name, lua_tostring(L, -1)); + luaL_error(L, "module '%s' not found:%s", name, lua_tostring(L, -1)); } lua_pushstring(L, name); lua_call(L, 1, 2); /* call it */ @@ -520,8 +569,7 @@ static int ll_require (lua_State *L) { lua_call(L, 2, 1); /* run loader to load module */ if (!lua_isnil(L, -1)) /* non-nil return? */ lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ - lua_getfield(L, 2, name); - if (lua_isnil(L, -1)) { /* module did not set a value? */ + if (lua_getfield(L, 2, name) == LUA_TNIL) { /* module set no value? */ lua_pushboolean(L, 1); /* use true as result */ lua_pushvalue(L, -1); /* extra copy to be returned */ lua_setfield(L, 2, name); /* _LOADED[name] = true */ @@ -548,7 +596,7 @@ static void set_env (lua_State *L) { if (lua_getstack(L, 1, &ar) == 0 || lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ lua_iscfunction(L, -1)) - luaL_error(L, LUA_QL("module") " not called from a Lua function"); + luaL_error(L, "'module' not called from a Lua function"); lua_pushvalue(L, -2); /* copy new environment table to top */ lua_setupvalue(L, -2, 1); lua_pop(L, 1); /* remove function */ @@ -587,9 +635,8 @@ static int ll_module (lua_State *L) { int lastarg = lua_gettop(L); /* last parameter */ luaL_pushmodule(L, modname, 1); /* get/create module table */ /* check whether table already has a _NAME field */ - lua_getfield(L, -1, "_NAME"); - if (!lua_isnil(L, -1)) /* is table an initialized module? */ - lua_pop(L, 1); + if (lua_getfield(L, -1, "_NAME") != LUA_TNIL) + lua_pop(L, 1); /* table is an initialized module */ else { /* no; initialize it */ lua_pop(L, 1); modinit(L, modname); @@ -659,6 +706,12 @@ static const luaL_Reg pk_funcs[] = { #if defined(LUA_COMPAT_MODULE) {"seeall", ll_seeall}, #endif + /* placeholders */ + {"preload", NULL}, + {"cpath", NULL}, + {"path", NULL}, + {"searchers", NULL}, + {"loaded", NULL}, {NULL, NULL} }; @@ -684,36 +737,44 @@ static void createsearcherstable (lua_State *L) { lua_pushcclosure(L, searchers[i], 1); lua_rawseti(L, -2, i+1); } +#if defined(LUA_COMPAT_LOADERS) + lua_pushvalue(L, -1); /* make a copy of 'searchers' table */ + lua_setfield(L, -3, "loaders"); /* put it in field 'loaders' */ +#endif + lua_setfield(L, -2, "searchers"); /* put it in field 'searchers' */ } -LUAMOD_API int luaopen_package (lua_State *L) { - /* create table CLIBS to keep track of loaded C libraries */ - luaL_getsubtable(L, LUA_REGISTRYINDEX, CLIBS); - lua_createtable(L, 0, 1); /* metatable for CLIBS */ +/* +** create table CLIBS to keep track of loaded C libraries, +** setting a finalizer to close all libraries when closing state. +*/ +static void createclibstable (lua_State *L) { + lua_newtable(L); /* create CLIBS table */ + lua_createtable(L, 0, 1); /* create metatable for CLIBS */ lua_pushcfunction(L, gctm); lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */ lua_setmetatable(L, -2); - /* create `package' table */ - luaL_newlib(L, pk_funcs); + lua_rawsetp(L, LUA_REGISTRYINDEX, &CLIBS); /* set CLIBS table in registry */ +} + + +LUAMOD_API int luaopen_package (lua_State *L) { + createclibstable(L); + luaL_newlib(L, pk_funcs); /* create 'package' table */ createsearcherstable(L); -#if defined(LUA_COMPAT_LOADERS) - lua_pushvalue(L, -1); /* make a copy of 'searchers' table */ - lua_setfield(L, -3, "loaders"); /* put it in field `loaders' */ -#endif - lua_setfield(L, -2, "searchers"); /* put it in field 'searchers' */ /* set field 'path' */ - setpath(L, "path", LUA_PATHVERSION, LUA_PATH, LUA_PATH_DEFAULT); + setpath(L, "path", LUA_PATHVARVERSION, LUA_PATH_VAR, LUA_PATH_DEFAULT); /* set field 'cpath' */ - setpath(L, "cpath", LUA_CPATHVERSION, LUA_CPATH, LUA_CPATH_DEFAULT); + setpath(L, "cpath", LUA_CPATHVARVERSION, LUA_CPATH_VAR, LUA_CPATH_DEFAULT); /* store config information */ lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATH_SEP "\n" LUA_PATH_MARK "\n" LUA_EXEC_DIR "\n" LUA_IGMARK "\n"); lua_setfield(L, -2, "config"); - /* set field `loaded' */ + /* set field 'loaded' */ luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); lua_setfield(L, -2, "loaded"); - /* set field `preload' */ + /* set field 'preload' */ luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); lua_setfield(L, -2, "preload"); lua_pushglobaltable(L); diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lobject.c b/3rdparty/genie/src/host/lua-5.3.0/src/lobject.c new file mode 100644 index 00000000000..6a24aff95d9 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lobject.c @@ -0,0 +1,470 @@ +/* +** $Id: lobject.c,v 2.101 2014/12/26 14:43:45 roberto Exp $ +** Some generic functions over Lua objects +** See Copyright Notice in lua.h +*/ + +#define lobject_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "lua.h" + +#include "lctype.h" +#include "ldebug.h" +#include "ldo.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "lvm.h" + + + +LUAI_DDEF const TValue luaO_nilobject_ = {NILCONSTANT}; + + +/* +** converts an integer to a "floating point byte", represented as +** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if +** eeeee != 0 and (xxx) otherwise. +*/ +int luaO_int2fb (unsigned int x) { + int e = 0; /* exponent */ + if (x < 8) return x; + while (x >= 0x10) { + x = (x+1) >> 1; + e++; + } + return ((e+1) << 3) | (cast_int(x) - 8); +} + + +/* converts back */ +int luaO_fb2int (int x) { + int e = (x >> 3) & 0x1f; + if (e == 0) return x; + else return ((x & 7) + 8) << (e - 1); +} + + +int luaO_ceillog2 (unsigned int x) { + static const lu_byte log_2[256] = { + 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 + }; + int l = 0; + x--; + while (x >= 256) { l += 8; x >>= 8; } + return l + log_2[x]; +} + + +static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, + lua_Integer v2) { + switch (op) { + case LUA_OPADD: return intop(+, v1, v2); + case LUA_OPSUB:return intop(-, v1, v2); + case LUA_OPMUL:return intop(*, v1, v2); + case LUA_OPMOD: return luaV_mod(L, v1, v2); + case LUA_OPIDIV: return luaV_div(L, v1, v2); + case LUA_OPBAND: return intop(&, v1, v2); + case LUA_OPBOR: return intop(|, v1, v2); + case LUA_OPBXOR: return intop(^, v1, v2); + case LUA_OPSHL: return luaV_shiftl(v1, v2); + case LUA_OPSHR: return luaV_shiftl(v1, -v2); + case LUA_OPUNM: return intop(-, 0, v1); + case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); + default: lua_assert(0); return 0; + } +} + + +static lua_Number numarith (lua_State *L, int op, lua_Number v1, + lua_Number v2) { + switch (op) { + case LUA_OPADD: return luai_numadd(L, v1, v2); + case LUA_OPSUB: return luai_numsub(L, v1, v2); + case LUA_OPMUL: return luai_nummul(L, v1, v2); + case LUA_OPDIV: return luai_numdiv(L, v1, v2); + case LUA_OPPOW: return luai_numpow(L, v1, v2); + case LUA_OPIDIV: return luai_numidiv(L, v1, v2); + case LUA_OPUNM: return luai_numunm(L, v1); + case LUA_OPMOD: { + lua_Number m; + luai_nummod(L, v1, v2, m); + return m; + } + default: lua_assert(0); return 0; + } +} + + +void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2, + TValue *res) { + switch (op) { + case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: + case LUA_OPSHL: case LUA_OPSHR: + case LUA_OPBNOT: { /* operate only on integers */ + lua_Integer i1; lua_Integer i2; + if (tointeger(p1, &i1) && tointeger(p2, &i2)) { + setivalue(res, intarith(L, op, i1, i2)); + return; + } + else break; /* go to the end */ + } + case LUA_OPDIV: case LUA_OPPOW: { /* operate only on floats */ + lua_Number n1; lua_Number n2; + if (tonumber(p1, &n1) && tonumber(p2, &n2)) { + setfltvalue(res, numarith(L, op, n1, n2)); + return; + } + else break; /* go to the end */ + } + default: { /* other operations */ + lua_Number n1; lua_Number n2; + if (ttisinteger(p1) && ttisinteger(p2)) { + setivalue(res, intarith(L, op, ivalue(p1), ivalue(p2))); + return; + } + else if (tonumber(p1, &n1) && tonumber(p2, &n2)) { + setfltvalue(res, numarith(L, op, n1, n2)); + return; + } + else break; /* go to the end */ + } + } + /* could not perform raw operation; try metamethod */ + lua_assert(L != NULL); /* should not fail when folding (compile time) */ + luaT_trybinTM(L, p1, p2, res, cast(TMS, op - LUA_OPADD + TM_ADD)); +} + + +int luaO_hexavalue (int c) { + if (lisdigit(c)) return c - '0'; + else return ltolower(c) - 'a' + 10; +} + + +static int isneg (const char **s) { + if (**s == '-') { (*s)++; return 1; } + else if (**s == '+') (*s)++; + return 0; +} + + + +/* +** {================================================================== +** Lua's implementation for 'lua_strx2number' +** =================================================================== +*/ +#if !defined(lua_strx2number) + +#include <math.h> + +/* maximum number of significant digits to read (to avoid overflows + even with single floats) */ +#define MAXSIGDIG 30 + +/* +** convert an hexadecimal numeric string to a number, following +** C99 specification for 'strtod' +*/ +static lua_Number lua_strx2number (const char *s, char **endptr) { + lua_Number r = 0.0; /* result (accumulator) */ + int sigdig = 0; /* number of significant digits */ + int nosigdig = 0; /* number of non-significant digits */ + int e = 0; /* exponent correction */ + int neg; /* 1 if number is negative */ + int dot = 0; /* true after seen a dot */ + *endptr = cast(char *, s); /* nothing is valid yet */ + while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ + neg = isneg(&s); /* check signal */ + if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */ + return 0.0; /* invalid format (no '0x') */ + for (s += 2; ; s++) { /* skip '0x' and read numeral */ + if (*s == '.') { + if (dot) break; /* second dot? stop loop */ + else dot = 1; + } + else if (lisxdigit(cast_uchar(*s))) { + if (sigdig == 0 && *s == '0') /* non-significant digit (zero)? */ + nosigdig++; + else if (++sigdig <= MAXSIGDIG) /* can read it without overflow? */ + r = (r * cast_num(16.0)) + luaO_hexavalue(*s); + else e++; /* too many digits; ignore, but still count for exponent */ + if (dot) e--; /* decimal digit? correct exponent */ + } + else break; /* neither a dot nor a digit */ + } + if (nosigdig + sigdig == 0) /* no digits? */ + return 0.0; /* invalid format */ + *endptr = cast(char *, s); /* valid up to here */ + e *= 4; /* each digit multiplies/divides value by 2^4 */ + if (*s == 'p' || *s == 'P') { /* exponent part? */ + int exp1 = 0; /* exponent value */ + int neg1; /* exponent signal */ + s++; /* skip 'p' */ + neg1 = isneg(&s); /* signal */ + if (!lisdigit(cast_uchar(*s))) + return 0.0; /* invalid; must have at least one digit */ + while (lisdigit(cast_uchar(*s))) /* read exponent */ + exp1 = exp1 * 10 + *(s++) - '0'; + if (neg1) exp1 = -exp1; + e += exp1; + *endptr = cast(char *, s); /* valid up to here */ + } + if (neg) r = -r; + return l_mathop(ldexp)(r, e); +} + +#endif +/* }====================================================== */ + + +static const char *l_str2d (const char *s, lua_Number *result) { + char *endptr; + if (strpbrk(s, "nN")) /* reject 'inf' and 'nan' */ + return NULL; + else if (strpbrk(s, "xX")) /* hex? */ + *result = lua_strx2number(s, &endptr); + else + *result = lua_str2number(s, &endptr); + if (endptr == s) return 0; /* nothing recognized */ + while (lisspace(cast_uchar(*endptr))) endptr++; + return (*endptr == '\0' ? endptr : NULL); /* OK if no trailing characters */ +} + + +static const char *l_str2int (const char *s, lua_Integer *result) { + lua_Unsigned a = 0; + int empty = 1; + int neg; + while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ + neg = isneg(&s); + if (s[0] == '0' && + (s[1] == 'x' || s[1] == 'X')) { /* hex? */ + s += 2; /* skip '0x' */ + for (; lisxdigit(cast_uchar(*s)); s++) { + a = a * 16 + luaO_hexavalue(*s); + empty = 0; + } + } + else { /* decimal */ + for (; lisdigit(cast_uchar(*s)); s++) { + a = a * 10 + *s - '0'; + empty = 0; + } + } + while (lisspace(cast_uchar(*s))) s++; /* skip trailing spaces */ + if (empty || *s != '\0') return NULL; /* something wrong in the numeral */ + else { + *result = l_castU2S((neg) ? 0u - a : a); + return s; + } +} + + +size_t luaO_str2num (const char *s, TValue *o) { + lua_Integer i; lua_Number n; + const char *e; + if ((e = l_str2int(s, &i)) != NULL) { /* try as an integer */ + setivalue(o, i); + } + else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */ + setfltvalue(o, n); + } + else + return 0; /* conversion failed */ + return (e - s + 1); /* success; return string size */ +} + + +int luaO_utf8esc (char *buff, unsigned long x) { + int n = 1; /* number of bytes put in buffer (backwards) */ + lua_assert(x <= 0x10FFFF); + if (x < 0x80) /* ascii? */ + buff[UTF8BUFFSZ - 1] = cast(char, x); + else { /* need continuation bytes */ + unsigned int mfb = 0x3f; /* maximum that fits in first byte */ + do { /* add continuation bytes */ + buff[UTF8BUFFSZ - (n++)] = cast(char, 0x80 | (x & 0x3f)); + x >>= 6; /* remove added bits */ + mfb >>= 1; /* now there is one less bit available in first byte */ + } while (x > mfb); /* still needs continuation byte? */ + buff[UTF8BUFFSZ - n] = cast(char, (~mfb << 1) | x); /* add first byte */ + } + return n; +} + + +/* maximum length of the conversion of a number to a string */ +#define MAXNUMBER2STR 50 + + +/* +** Convert a number object to a string +*/ +void luaO_tostring (lua_State *L, StkId obj) { + char buff[MAXNUMBER2STR]; + size_t len; + lua_assert(ttisnumber(obj)); + if (ttisinteger(obj)) + len = lua_integer2str(buff, ivalue(obj)); + else { + len = lua_number2str(buff, fltvalue(obj)); +#if !defined(LUA_COMPAT_FLOATSTRING) + if (buff[strspn(buff, "-0123456789")] == '\0') { /* looks like an int? */ + buff[len++] = '.'; + buff[len++] = '0'; /* adds '.0' to result */ + } +#endif + } + setsvalue2s(L, obj, luaS_newlstr(L, buff, len)); +} + + +static void pushstr (lua_State *L, const char *str, size_t l) { + setsvalue2s(L, L->top++, luaS_newlstr(L, str, l)); +} + + +/* this function handles only '%d', '%c', '%f', '%p', and '%s' + conventional formats, plus Lua-specific '%I' and '%U' */ +const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { + int n = 0; + for (;;) { + const char *e = strchr(fmt, '%'); + if (e == NULL) break; + luaD_checkstack(L, 2); /* fmt + item */ + pushstr(L, fmt, e - fmt); + switch (*(e+1)) { + case 's': { + const char *s = va_arg(argp, char *); + if (s == NULL) s = "(null)"; + pushstr(L, s, strlen(s)); + break; + } + case 'c': { + char buff = cast(char, va_arg(argp, int)); + if (lisprint(cast_uchar(buff))) + pushstr(L, &buff, 1); + else /* non-printable character; print its code */ + luaO_pushfstring(L, "<\\%d>", cast_uchar(buff)); + break; + } + case 'd': { + setivalue(L->top++, va_arg(argp, int)); + luaO_tostring(L, L->top - 1); + break; + } + case 'I': { + setivalue(L->top++, cast(lua_Integer, va_arg(argp, l_uacInt))); + luaO_tostring(L, L->top - 1); + break; + } + case 'f': { + setfltvalue(L->top++, cast_num(va_arg(argp, l_uacNumber))); + luaO_tostring(L, L->top - 1); + break; + } + case 'p': { + char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */ + int l = sprintf(buff, "%p", va_arg(argp, void *)); + pushstr(L, buff, l); + break; + } + case 'U': { + char buff[UTF8BUFFSZ]; + int l = luaO_utf8esc(buff, cast(long, va_arg(argp, long))); + pushstr(L, buff + UTF8BUFFSZ - l, l); + break; + } + case '%': { + pushstr(L, "%", 1); + break; + } + default: { + luaG_runerror(L, "invalid option '%%%c' to 'lua_pushfstring'", + *(e + 1)); + } + } + n += 2; + fmt = e+2; + } + luaD_checkstack(L, 1); + pushstr(L, fmt, strlen(fmt)); + if (n > 0) luaV_concat(L, n + 1); + return svalue(L->top - 1); +} + + +const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { + const char *msg; + va_list argp; + va_start(argp, fmt); + msg = luaO_pushvfstring(L, fmt, argp); + va_end(argp); + return msg; +} + + +/* number of chars of a literal string without the ending \0 */ +#define LL(x) (sizeof(x)/sizeof(char) - 1) + +#define RETS "..." +#define PRE "[string \"" +#define POS "\"]" + +#define addstr(a,b,l) ( memcpy(a,b,(l) * sizeof(char)), a += (l) ) + +void luaO_chunkid (char *out, const char *source, size_t bufflen) { + size_t l = strlen(source); + if (*source == '=') { /* 'literal' source */ + if (l <= bufflen) /* small enough? */ + memcpy(out, source + 1, l * sizeof(char)); + else { /* truncate it */ + addstr(out, source + 1, bufflen - 1); + *out = '\0'; + } + } + else if (*source == '@') { /* file name */ + if (l <= bufflen) /* small enough? */ + memcpy(out, source + 1, l * sizeof(char)); + else { /* add '...' before rest of name */ + addstr(out, RETS, LL(RETS)); + bufflen -= LL(RETS); + memcpy(out, source + 1 + l - bufflen, bufflen * sizeof(char)); + } + } + else { /* string; format as [string "source"] */ + const char *nl = strchr(source, '\n'); /* find first new line (if any) */ + addstr(out, PRE, LL(PRE)); /* add prefix */ + bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ + if (l < bufflen && nl == NULL) { /* small one-line source? */ + addstr(out, source, l); /* keep it */ + } + else { + if (nl != NULL) l = nl - source; /* stop at first newline */ + if (l > bufflen) l = bufflen; + addstr(out, source, l); + addstr(out, RETS, LL(RETS)); + } + memcpy(out, POS, (LL(POS) + 1) * sizeof(char)); + } +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lobject.h b/3rdparty/genie/src/host/lua-5.3.0/src/lobject.h index 3a630b944c7..d7d0ebf31b0 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lobject.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.71.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lobject.h,v 2.106 2015/01/05 13:52:37 roberto Exp $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -20,13 +20,12 @@ ** Extra tags for non-values */ #define LUA_TPROTO LUA_NUMTAGS -#define LUA_TUPVAL (LUA_NUMTAGS+1) -#define LUA_TDEADKEY (LUA_NUMTAGS+2) +#define LUA_TDEADKEY (LUA_NUMTAGS+1) /* ** number of all possible tags (including LUA_TNONE but excluding DEADKEY) */ -#define LUA_TOTALTAGS (LUA_TUPVAL+2) +#define LUA_TOTALTAGS (LUA_TPROTO + 2) /* @@ -57,6 +56,11 @@ #define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */ +/* Variant tags for numbers */ +#define LUA_TNUMFLT (LUA_TNUMBER | (0 << 4)) /* float numbers */ +#define LUA_TNUMINT (LUA_TNUMBER | (1 << 4)) /* integer numbers */ + + /* Bit mark for collectable types */ #define BIT_ISCOLLECTABLE (1 << 6) @@ -65,9 +69,9 @@ /* -** Union of all collectable objects +** Common type for all collectable objects */ -typedef union GCObject GCObject; +typedef struct GCObject GCObject; /* @@ -78,11 +82,11 @@ typedef union GCObject GCObject; /* -** Common header in struct form +** Common type has only the common header */ -typedef struct GCheader { +struct GCObject { CommonHeader; -} GCheader; +}; @@ -92,8 +96,6 @@ typedef struct GCheader { typedef union Value Value; -#define numfield lua_Number n; /* numbers */ - /* @@ -111,7 +113,6 @@ typedef struct lua_TValue TValue; #define val_(o) ((o)->value_) -#define num_(o) (val_(o).n) /* raw type tag of a TValue */ @@ -124,13 +125,15 @@ typedef struct lua_TValue TValue; #define ttype(o) (rttype(o) & 0x3F) /* type tag of a TValue with no variants (bits 0-3) */ -#define ttypenv(o) (novariant(rttype(o))) +#define ttnov(o) (novariant(rttype(o))) /* Macros to test type */ #define checktag(o,t) (rttype(o) == (t)) -#define checktype(o,t) (ttypenv(o) == (t)) -#define ttisnumber(o) checktag((o), LUA_TNUMBER) +#define checktype(o,t) (ttnov(o) == (t)) +#define ttisnumber(o) checktype((o), LUA_TNUMBER) +#define ttisfloat(o) checktag((o), LUA_TNUMFLT) +#define ttisinteger(o) checktag((o), LUA_TNUMINT) #define ttisnil(o) checktag((o), LUA_TNIL) #define ttisboolean(o) checktag((o), LUA_TBOOLEAN) #define ttislightuserdata(o) checktag((o), LUA_TLIGHTUSERDATA) @@ -143,27 +146,27 @@ typedef struct lua_TValue TValue; #define ttisCclosure(o) checktag((o), ctb(LUA_TCCL)) #define ttisLclosure(o) checktag((o), ctb(LUA_TLCL)) #define ttislcf(o) checktag((o), LUA_TLCF) -#define ttisuserdata(o) checktag((o), ctb(LUA_TUSERDATA)) +#define ttisfulluserdata(o) checktag((o), ctb(LUA_TUSERDATA)) #define ttisthread(o) checktag((o), ctb(LUA_TTHREAD)) #define ttisdeadkey(o) checktag((o), LUA_TDEADKEY) -#define ttisequal(o1,o2) (rttype(o1) == rttype(o2)) /* Macros to access values */ -#define nvalue(o) check_exp(ttisnumber(o), num_(o)) +#define ivalue(o) check_exp(ttisinteger(o), val_(o).i) +#define fltvalue(o) check_exp(ttisfloat(o), val_(o).n) +#define nvalue(o) check_exp(ttisnumber(o), \ + (ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o))) #define gcvalue(o) check_exp(iscollectable(o), val_(o).gc) #define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p) -#define rawtsvalue(o) check_exp(ttisstring(o), &val_(o).gc->ts) -#define tsvalue(o) (&rawtsvalue(o)->tsv) -#define rawuvalue(o) check_exp(ttisuserdata(o), &val_(o).gc->u) -#define uvalue(o) (&rawuvalue(o)->uv) -#define clvalue(o) check_exp(ttisclosure(o), &val_(o).gc->cl) -#define clLvalue(o) check_exp(ttisLclosure(o), &val_(o).gc->cl.l) -#define clCvalue(o) check_exp(ttisCclosure(o), &val_(o).gc->cl.c) +#define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc)) +#define uvalue(o) check_exp(ttisfulluserdata(o), gco2u(val_(o).gc)) +#define clvalue(o) check_exp(ttisclosure(o), gco2cl(val_(o).gc)) +#define clLvalue(o) check_exp(ttisLclosure(o), gco2lcl(val_(o).gc)) +#define clCvalue(o) check_exp(ttisCclosure(o), gco2ccl(val_(o).gc)) #define fvalue(o) check_exp(ttislcf(o), val_(o).f) -#define hvalue(o) check_exp(ttistable(o), &val_(o).gc->h) +#define hvalue(o) check_exp(ttistable(o), gco2t(val_(o).gc)) #define bvalue(o) check_exp(ttisboolean(o), val_(o).b) -#define thvalue(o) check_exp(ttisthread(o), &val_(o).gc->th) +#define thvalue(o) check_exp(ttisthread(o), gco2th(val_(o).gc)) /* a dead value may get the 'gc' field, but cannot access its contents */ #define deadvalue(o) check_exp(ttisdeadkey(o), cast(void *, val_(o).gc)) @@ -174,7 +177,7 @@ typedef struct lua_TValue TValue; /* Macros for internal tests */ -#define righttt(obj) (ttype(obj) == gcvalue(obj)->gch.tt) +#define righttt(obj) (ttype(obj) == gcvalue(obj)->tt) #define checkliveness(g,obj) \ lua_longassert(!iscollectable(obj) || \ @@ -184,8 +187,11 @@ typedef struct lua_TValue TValue; /* Macros to set values */ #define settt_(o,t) ((o)->tt_=(t)) -#define setnvalue(obj,x) \ - { TValue *io=(obj); num_(io)=(x); settt_(io, LUA_TNUMBER); } +#define setfltvalue(obj,x) \ + { TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_TNUMFLT); } + +#define setivalue(obj,x) \ + { TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_TNUMINT); } #define setnilvalue(obj) settt_(obj, LUA_TNIL) @@ -199,38 +205,37 @@ typedef struct lua_TValue TValue; { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); } #define setgcovalue(L,obj,x) \ - { TValue *io=(obj); GCObject *i_g=(x); \ - val_(io).gc=i_g; settt_(io, ctb(gch(i_g)->tt)); } + { TValue *io = (obj); GCObject *i_g=(x); \ + val_(io).gc = i_g; settt_(io, ctb(i_g->tt)); } #define setsvalue(L,obj,x) \ - { TValue *io=(obj); \ - TString *x_ = (x); \ - val_(io).gc=cast(GCObject *, x_); settt_(io, ctb(x_->tsv.tt)); \ + { TValue *io = (obj); TString *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(x_->tt)); \ checkliveness(G(L),io); } #define setuvalue(L,obj,x) \ - { TValue *io=(obj); \ - val_(io).gc=cast(GCObject *, (x)); settt_(io, ctb(LUA_TUSERDATA)); \ + { TValue *io = (obj); Udata *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TUSERDATA)); \ checkliveness(G(L),io); } #define setthvalue(L,obj,x) \ - { TValue *io=(obj); \ - val_(io).gc=cast(GCObject *, (x)); settt_(io, ctb(LUA_TTHREAD)); \ + { TValue *io = (obj); lua_State *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTHREAD)); \ checkliveness(G(L),io); } #define setclLvalue(L,obj,x) \ - { TValue *io=(obj); \ - val_(io).gc=cast(GCObject *, (x)); settt_(io, ctb(LUA_TLCL)); \ + { TValue *io = (obj); LClosure *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TLCL)); \ checkliveness(G(L),io); } #define setclCvalue(L,obj,x) \ - { TValue *io=(obj); \ - val_(io).gc=cast(GCObject *, (x)); settt_(io, ctb(LUA_TCCL)); \ + { TValue *io = (obj); CClosure *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TCCL)); \ checkliveness(G(L),io); } #define sethvalue(L,obj,x) \ - { TValue *io=(obj); \ - val_(io).gc=cast(GCObject *, (x)); settt_(io, ctb(LUA_TTABLE)); \ + { TValue *io = (obj); Table *x_ = (x); \ + val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTABLE)); \ checkliveness(G(L),io); } #define setdeadvalue(obj) settt_(obj, LUA_TDEADKEY) @@ -238,9 +243,8 @@ typedef struct lua_TValue TValue; #define setobj(L,obj1,obj2) \ - { const TValue *io2=(obj2); TValue *io1=(obj1); \ - io1->value_ = io2->value_; io1->tt_ = io2->tt_; \ - checkliveness(G(L),io1); } + { TValue *io1=(obj1); *io1 = *(obj2); \ + (void)L; checkliveness(G(L),io1); } /* @@ -263,119 +267,6 @@ typedef struct lua_TValue TValue; #define setsvalue2n setsvalue -/* check whether a number is valid (useful only for NaN trick) */ -#define luai_checknum(L,o,c) { /* empty */ } - - -/* -** {====================================================== -** NaN Trick -** ======================================================= -*/ -#if defined(LUA_NANTRICK) - -/* -** numbers are represented in the 'd_' field. All other values have the -** value (NNMARK | tag) in 'tt__'. A number with such pattern would be -** a "signaled NaN", which is never generated by regular operations by -** the CPU (nor by 'strtod') -*/ - -/* allows for external implementation for part of the trick */ -#if !defined(NNMARK) /* { */ - - -#if !defined(LUA_IEEEENDIAN) -#error option 'LUA_NANTRICK' needs 'LUA_IEEEENDIAN' -#endif - - -#define NNMARK 0x7FF7A500 -#define NNMASK 0x7FFFFF00 - -#undef TValuefields -#undef NILCONSTANT - -#if (LUA_IEEEENDIAN == 0) /* { */ - -/* little endian */ -#define TValuefields \ - union { struct { Value v__; int tt__; } i; double d__; } u -#define NILCONSTANT {{{NULL}, tag2tt(LUA_TNIL)}} -/* field-access macros */ -#define v_(o) ((o)->u.i.v__) -#define d_(o) ((o)->u.d__) -#define tt_(o) ((o)->u.i.tt__) - -#else /* }{ */ - -/* big endian */ -#define TValuefields \ - union { struct { int tt__; Value v__; } i; double d__; } u -#define NILCONSTANT {{tag2tt(LUA_TNIL), {NULL}}} -/* field-access macros */ -#define v_(o) ((o)->u.i.v__) -#define d_(o) ((o)->u.d__) -#define tt_(o) ((o)->u.i.tt__) - -#endif /* } */ - -#endif /* } */ - - -/* correspondence with standard representation */ -#undef val_ -#define val_(o) v_(o) -#undef num_ -#define num_(o) d_(o) - - -#undef numfield -#define numfield /* no such field; numbers are the entire struct */ - -/* basic check to distinguish numbers from non-numbers */ -#undef ttisnumber -#define ttisnumber(o) ((tt_(o) & NNMASK) != NNMARK) - -#define tag2tt(t) (NNMARK | (t)) - -#undef rttype -#define rttype(o) (ttisnumber(o) ? LUA_TNUMBER : tt_(o) & 0xff) - -#undef settt_ -#define settt_(o,t) (tt_(o) = tag2tt(t)) - -#undef setnvalue -#define setnvalue(obj,x) \ - { TValue *io_=(obj); num_(io_)=(x); lua_assert(ttisnumber(io_)); } - -#undef setobj -#define setobj(L,obj1,obj2) \ - { const TValue *o2_=(obj2); TValue *o1_=(obj1); \ - o1_->u = o2_->u; \ - checkliveness(G(L),o1_); } - - -/* -** these redefinitions are not mandatory, but these forms are more efficient -*/ - -#undef checktag -#undef checktype -#define checktag(o,t) (tt_(o) == tag2tt(t)) -#define checktype(o,t) (ctb(tt_(o) | VARBITS) == ctb(tag2tt(t) | VARBITS)) - -#undef ttisequal -#define ttisequal(o1,o2) \ - (ttisnumber(o1) ? ttisnumber(o2) : (tt_(o1) == tt_(o2))) - - -#undef luai_checknum -#define luai_checknum(L,o,c) { if (!ttisnumber(o)) c; } - -#endif -/* }====================================================== */ - /* @@ -390,7 +281,8 @@ union Value { void *p; /* light userdata */ int b; /* booleans */ lua_CFunction f; /* light C functions */ - numfield /* numbers */ + lua_Integer i; /* integer numbers */ + lua_Number n; /* float numbers */ }; @@ -406,39 +298,78 @@ typedef TValue *StkId; /* index to stack elements */ /* ** Header for string value; string bytes follow the end of this structure +** (aligned according to 'UTString'; see next). */ -typedef union TString { - L_Umaxalign dummy; /* ensures maximum alignment for strings */ - struct { - CommonHeader; - lu_byte extra; /* reserved words for short strings; "has hash" for longs */ - unsigned int hash; - size_t len; /* number of characters in string */ - } tsv; +typedef struct TString { + CommonHeader; + lu_byte extra; /* reserved words for short strings; "has hash" for longs */ + unsigned int hash; + size_t len; /* number of characters in string */ + struct TString *hnext; /* linked list for hash table */ } TString; -/* get the actual string (array of bytes) from a TString */ -#define getstr(ts) cast(const char *, (ts) + 1) +/* +** Ensures that address after this type is always fully aligned. +*/ +typedef union UTString { + L_Umaxalign dummy; /* ensures maximum alignment for strings */ + TString tsv; +} UTString; + + +/* +** Get the actual string (array of bytes) from a 'TString'. +** (Access to 'extra' ensures that value is really a 'TString'.) +*/ +#define getaddrstr(ts) (cast(char *, (ts)) + sizeof(UTString)) +#define getstr(ts) \ + check_exp(sizeof((ts)->extra), cast(const char*, getaddrstr(ts))) /* get the actual string (array of bytes) from a Lua value */ -#define svalue(o) getstr(rawtsvalue(o)) +#define svalue(o) getstr(tsvalue(o)) /* ** Header for userdata; memory area follows the end of this structure +** (aligned according to 'UUdata'; see next). */ -typedef union Udata { - L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */ - struct { - CommonHeader; - struct Table *metatable; - struct Table *env; - size_t len; /* number of bytes */ - } uv; +typedef struct Udata { + CommonHeader; + lu_byte ttuv_; /* user value's tag */ + struct Table *metatable; + size_t len; /* number of bytes */ + union Value user_; /* user value */ } Udata; +/* +** Ensures that address after this type is always fully aligned. +*/ +typedef union UUdata { + L_Umaxalign dummy; /* ensures maximum alignment for 'local' udata */ + Udata uv; +} UUdata; + + +/* +** Get the address of memory block inside 'Udata'. +** (Access to 'ttuv_' ensures that value is really a 'Udata'.) +*/ +#define getudatamem(u) \ + check_exp(sizeof((u)->ttuv_), (cast(char*, (u)) + sizeof(UUdata))) + +#define setuservalue(L,u,o) \ + { const TValue *io=(o); Udata *iu = (u); \ + iu->user_ = io->value_; iu->ttuv_ = io->tt_; \ + checkliveness(G(L),io); } + + +#define getuservalue(L,u,o) \ + { TValue *io=(o); const Udata *iu = (u); \ + io->value_ = iu->user_; io->tt_ = iu->ttuv_; \ + checkliveness(G(L),io); } + /* ** Description of an upvalue for function prototypes @@ -466,26 +397,26 @@ typedef struct LocVar { */ typedef struct Proto { CommonHeader; + lu_byte numparams; /* number of fixed parameters */ + lu_byte is_vararg; + lu_byte maxstacksize; /* maximum stack used by this function */ + int sizeupvalues; /* size of 'upvalues' */ + int sizek; /* size of 'k' */ + int sizecode; + int sizelineinfo; + int sizep; /* size of 'p' */ + int sizelocvars; + int linedefined; + int lastlinedefined; TValue *k; /* constants used by the function */ Instruction *code; struct Proto **p; /* functions defined inside the function */ int *lineinfo; /* map from opcodes to source lines (debug information) */ LocVar *locvars; /* information about local variables (debug information) */ Upvaldesc *upvalues; /* upvalue information */ - union Closure *cache; /* last created closure with this prototype */ + struct LClosure *cache; /* last created closure with this prototype */ TString *source; /* used for debug information */ - int sizeupvalues; /* size of 'upvalues' */ - int sizek; /* size of `k' */ - int sizecode; - int sizelineinfo; - int sizep; /* size of `p' */ - int sizelocvars; - int linedefined; - int lastlinedefined; GCObject *gclist; - lu_byte numparams; /* number of fixed parameters */ - lu_byte is_vararg; - lu_byte maxstacksize; /* maximum stack used by this function */ } Proto; @@ -493,17 +424,7 @@ typedef struct Proto { /* ** Lua Upvalues */ -typedef struct UpVal { - CommonHeader; - TValue *v; /* points to stack or to its own value */ - union { - TValue value; /* the value (when closed) */ - struct { /* double linked list (when open) */ - struct UpVal *prev; - struct UpVal *next; - } l; - } u; -} UpVal; +typedef struct UpVal UpVal; /* @@ -545,12 +466,19 @@ typedef union Closure { typedef union TKey { struct { TValuefields; - struct Node *next; /* for chaining */ + int next; /* for chaining (offset for next node) */ } nk; TValue tvk; } TKey; +/* copy a value into a key without messing up field 'next' */ +#define setnodekey(L,key,obj) \ + { TKey *k_=(key); const TValue *io_=(obj); \ + k_->nk.value_ = io_->value_; k_->nk.tt_ = io_->tt_; \ + (void)L; checkliveness(G(L),io_); } + + typedef struct Node { TValue i_val; TKey i_key; @@ -560,19 +488,19 @@ typedef struct Node { typedef struct Table { CommonHeader; lu_byte flags; /* 1<<p means tagmethod(p) is not present */ - lu_byte lsizenode; /* log2 of size of `node' array */ - struct Table *metatable; + lu_byte lsizenode; /* log2 of size of 'node' array */ + unsigned int sizearray; /* size of 'array' array */ TValue *array; /* array part */ Node *node; Node *lastfree; /* any free position is before this position */ + struct Table *metatable; GCObject *gclist; - int sizearray; /* size of `array' array */ } Table; /* -** `module' operation for hashing (size is always a power of 2) +** 'module' operation for hashing (size is always a power of 2) */ #define lmod(s,size) \ (check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1))))) @@ -590,13 +518,18 @@ typedef struct Table { LUAI_DDEC const TValue luaO_nilobject_; +/* size of buffer for 'luaO_utf8esc' function */ +#define UTF8BUFFSZ 8 LUAI_FUNC int luaO_int2fb (unsigned int x); LUAI_FUNC int luaO_fb2int (int x); +LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x); LUAI_FUNC int luaO_ceillog2 (unsigned int x); -LUAI_FUNC lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2); -LUAI_FUNC int luaO_str2d (const char *s, size_t len, lua_Number *result); +LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, + const TValue *p2, TValue *res); +LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o); LUAI_FUNC int luaO_hexavalue (int c); +LUAI_FUNC void luaO_tostring (lua_State *L, StkId obj); LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp); LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lopcodes.c b/3rdparty/genie/src/host/lua-5.3.0/src/lopcodes.c index 4190dc76242..a1cbef85737 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lopcodes.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lopcodes.c @@ -1,13 +1,16 @@ /* -** $Id: lopcodes.c,v 1.49.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lopcodes.c,v 1.55 2015/01/05 13:48:33 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ - #define lopcodes_c #define LUA_CORE +#include "lprefix.h" + + +#include <stddef.h> #include "lopcodes.h" @@ -31,10 +34,17 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { "ADD", "SUB", "MUL", - "DIV", "MOD", "POW", + "DIV", + "IDIV", + "BAND", + "BOR", + "BXOR", + "SHL", + "SHR", "UNM", + "BNOT", "NOT", "LEN", "CONCAT", @@ -79,10 +89,17 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_IDIV */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BAND */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BOR */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BXOR */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SHL */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SHR */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_BNOT */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lopcodes.h b/3rdparty/genie/src/host/lua-5.3.0/src/lopcodes.h index 51f57915455..864b8e4bb5d 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lopcodes.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.142.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lopcodes.h,v 1.148 2014/10/25 11:50:46 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -14,12 +14,12 @@ We assume that instructions are unsigned numbers. All instructions have an opcode in the first 6 bits. Instructions can have the following fields: - `A' : 8 bits - `B' : 9 bits - `C' : 9 bits + 'A' : 8 bits + 'B' : 9 bits + 'C' : 9 bits 'Ax' : 26 bits ('A', 'B', and 'C' together) - `Bx' : 18 bits (`B' and `C' together) - `sBx' : signed Bx + 'Bx' : 18 bits ('B' and 'C' together) + 'sBx' : signed Bx A signed argument is represented in excess K; that is, the number value is the unsigned value minus K. K is exactly the maximum value @@ -58,7 +58,7 @@ enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */ */ #if SIZE_Bx < LUAI_BITSINT-1 #define MAXARG_Bx ((1<<SIZE_Bx)-1) -#define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */ +#define MAXARG_sBx (MAXARG_Bx>>1) /* 'sBx' is signed */ #else #define MAXARG_Bx MAX_INT #define MAXARG_sBx MAX_INT @@ -76,10 +76,10 @@ enum OpMode {iABC, iABx, iAsBx, iAx}; /* basic instruction format */ #define MAXARG_C ((1<<SIZE_C)-1) -/* creates a mask with `n' 1 bits at position `p' */ +/* creates a mask with 'n' 1 bits at position 'p' */ #define MASK1(n,p) ((~((~(Instruction)0)<<(n)))<<(p)) -/* creates a mask with `n' 0 bits at position `p' */ +/* creates a mask with 'n' 0 bits at position 'p' */ #define MASK0(n,p) (~MASK1(n,p)) /* @@ -187,16 +187,23 @@ OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */ OP_ADD,/* A B C R(A) := RK(B) + RK(C) */ OP_SUB,/* A B C R(A) := RK(B) - RK(C) */ OP_MUL,/* A B C R(A) := RK(B) * RK(C) */ -OP_DIV,/* A B C R(A) := RK(B) / RK(C) */ OP_MOD,/* A B C R(A) := RK(B) % RK(C) */ OP_POW,/* A B C R(A) := RK(B) ^ RK(C) */ +OP_DIV,/* A B C R(A) := RK(B) / RK(C) */ +OP_IDIV,/* A B C R(A) := RK(B) // RK(C) */ +OP_BAND,/* A B C R(A) := RK(B) & RK(C) */ +OP_BOR,/* A B C R(A) := RK(B) | RK(C) */ +OP_BXOR,/* A B C R(A) := RK(B) ~ RK(C) */ +OP_SHL,/* A B C R(A) := RK(B) << RK(C) */ +OP_SHR,/* A B C R(A) := RK(B) >> RK(C) */ OP_UNM,/* A B R(A) := -R(B) */ +OP_BNOT,/* A B R(A) := ~R(B) */ OP_NOT,/* A B R(A) := not R(B) */ OP_LEN,/* A B R(A) := length of R(B) */ OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ -OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A) + 1 */ +OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A - 1) */ OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ @@ -231,16 +238,16 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ /*=========================================================================== Notes: - (*) In OP_CALL, if (B == 0) then B = top. If (C == 0), then `top' is + (*) In OP_CALL, if (B == 0) then B = top. If (C == 0), then 'top' is set to last_result+1, so next open instruction (OP_CALL, OP_RETURN, - OP_SETLIST) may use `top'. + OP_SETLIST) may use 'top'. (*) In OP_VARARG, if (B == 0) then use actual number of varargs and set top (like in OP_CALL with C == 0). - (*) In OP_RETURN, if (B == 0) then return up to `top'. + (*) In OP_RETURN, if (B == 0) then return up to 'top'. - (*) In OP_SETLIST, if (B == 0) then B = `top'; if (C == 0) then next + (*) In OP_SETLIST, if (B == 0) then B = 'top'; if (C == 0) then next 'instruction' is EXTRAARG(real C). (*) In OP_LOADKX, the next 'instruction' is always EXTRAARG. @@ -248,7 +255,7 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ (*) For comparisons, A specifies what condition the test should accept (true or false). - (*) All `skips' (pc++) assume that next instruction is a jump. + (*) All 'skips' (pc++) assume that next instruction is a jump. ===========================================================================*/ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/loslib.c b/3rdparty/genie/src/host/lua-5.3.0/src/loslib.c index 052ba174413..20359b24747 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/loslib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/loslib.c @@ -1,9 +1,14 @@ /* -** $Id: loslib.c,v 1.40.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: loslib.c,v 1.54 2014/12/26 14:46:07 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ +#define loslib_c +#define LUA_LIB + +#include "lprefix.h" + #include <errno.h> #include <locale.h> @@ -11,69 +16,96 @@ #include <string.h> #include <time.h> -#define loslib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" #include "lualib.h" +#if !defined(LUA_STRFTIMEOPTIONS) /* { */ /* ** list of valid conversion specifiers for the 'strftime' function */ -#if !defined(LUA_STRFTIMEOPTIONS) -#if !defined(LUA_USE_POSIX) +#if defined(LUA_USE_C89) #define LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" } -#else +#else /* C99 specification */ #define LUA_STRFTIMEOPTIONS \ - { "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "" \ - "", "E", "cCxXyY", \ + { "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "", \ + "E", "cCxXyY", \ "O", "deHImMSuUVwWy" } #endif -#endif +#endif /* } */ + + + +#if !defined(l_time_t) /* { */ +/* +** type to represent time_t in Lua +*/ +#define l_timet lua_Integer +#define l_pushtime(L,t) lua_pushinteger(L,(lua_Integer)(t)) +#define l_checktime(L,a) ((time_t)luaL_checkinteger(L,a)) + +#endif /* } */ +#if !defined(lua_tmpnam) /* { */ /* ** By default, Lua uses tmpnam except when POSIX is available, where it ** uses mkstemp. */ -#if defined(LUA_USE_MKSTEMP) + +#if defined(LUA_USE_POSIX) /* { */ + #include <unistd.h> + #define LUA_TMPNAMBUFSIZE 32 + +#if !defined(LUA_TMPNAMTEMPLATE) +#define LUA_TMPNAMTEMPLATE "/tmp/lua_XXXXXX" +#endif + #define lua_tmpnam(b,e) { \ - strcpy(b, "/tmp/lua_XXXXXX"); \ + strcpy(b, LUA_TMPNAMTEMPLATE); \ e = mkstemp(b); \ if (e != -1) close(e); \ e = (e == -1); } -#elif !defined(lua_tmpnam) +#else /* }{ */ +/* ISO C definitions */ #define LUA_TMPNAMBUFSIZE L_tmpnam #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } -#endif +#endif /* } */ +#endif /* } */ + + +#if !defined(l_gmtime) /* { */ /* ** By default, Lua uses gmtime/localtime, except when POSIX is available, ** where it uses gmtime_r/localtime_r */ -#if defined(LUA_USE_GMTIME_R) + +#if defined(LUA_USE_POSIX) /* { */ #define l_gmtime(t,r) gmtime_r(t,r) #define l_localtime(t,r) localtime_r(t,r) -#elif !defined(l_gmtime) +#else /* }{ */ -#define l_gmtime(t,r) ((void)r, gmtime(t)) -#define l_localtime(t,r) ((void)r, localtime(t)) +/* ISO C definitions */ +#define l_gmtime(t,r) ((void)(r)->tm_sec, gmtime(t)) +#define l_localtime(t,r) ((void)(r)->tm_sec, localtime(t)) -#endif +#endif /* } */ + +#endif /* } */ @@ -147,8 +179,7 @@ static void setboolfield (lua_State *L, const char *key, int value) { static int getboolfield (lua_State *L, const char *key) { int res; - lua_getfield(L, -1, key); - res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); + res = (lua_getfield(L, -1, key) == LUA_TNIL) ? -1 : lua_toboolean(L, -1); lua_pop(L, 1); return res; } @@ -160,7 +191,7 @@ static int getfield (lua_State *L, const char *key, int d) { res = (int)lua_tointegerx(L, -1, &isnum); if (!isnum) { if (d < 0) - return luaL_error(L, "field " LUA_QS " missing in date table", key); + return luaL_error(L, "field '%s' missing in date table", key); res = d; } lua_pop(L, 1); @@ -194,11 +225,11 @@ static const char *checkoption (lua_State *L, const char *conv, char *buff) { static int os_date (lua_State *L) { const char *s = luaL_optstring(L, 1, "%c"); - time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); + time_t t = luaL_opt(L, l_checktime, 2, time(NULL)); struct tm tmr, *stm; if (*s == '!') { /* UTC? */ stm = l_gmtime(&t, &tmr); - s++; /* skip `!' */ + s++; /* skip '!' */ } else stm = l_localtime(&t, &tmr); @@ -255,17 +286,19 @@ static int os_time (lua_State *L) { ts.tm_isdst = getboolfield(L, "isdst"); t = mktime(&ts); } - if (t == (time_t)(-1)) + if (t != (time_t)(l_timet)t) + luaL_error(L, "time result cannot be represented in this Lua instalation"); + else if (t == (time_t)(-1)) lua_pushnil(L); else - lua_pushnumber(L, (lua_Number)t); + l_pushtime(L, t); return 1; } static int os_difftime (lua_State *L) { - lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), - (time_t)(luaL_optnumber(L, 2, 0)))); + double res = difftime((l_checktime(L, 1)), (l_checktime(L, 2))); + lua_pushnumber(L, (lua_Number)res); return 1; } @@ -289,7 +322,7 @@ static int os_exit (lua_State *L) { if (lua_isboolean(L, 1)) status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE); else - status = luaL_optint(L, 1, EXIT_SUCCESS); + status = (int)luaL_optinteger(L, 1, EXIT_SUCCESS); if (lua_toboolean(L, 2)) lua_close(L); if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */ diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lparser.c b/3rdparty/genie/src/host/lua-5.3.0/src/lparser.c index 9e1a9ca2cfe..9a54dfc98d7 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lparser.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lparser.c @@ -1,15 +1,17 @@ /* -** $Id: lparser.c,v 2.130.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lparser.c,v 2.147 2014/12/27 20:31:43 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ - -#include <string.h> - #define lparser_c #define LUA_CORE +#include "lprefix.h" + + +#include <string.h> + #include "lua.h" #include "lcode.h" @@ -35,17 +37,21 @@ #define hasmultret(k) ((k) == VCALL || (k) == VVARARG) +/* because all strings are unified by the scanner, the parser + can use pointer equality for string equality */ +#define eqstr(a,b) ((a) == (b)) + /* ** nodes for block list (list of active blocks) */ typedef struct BlockCnt { struct BlockCnt *previous; /* chain */ - short firstlabel; /* index of first label in this block */ - short firstgoto; /* index of first pending goto in this block */ + int firstlabel; /* index of first label in this block */ + int firstgoto; /* index of first pending goto in this block */ lu_byte nactvar; /* # active locals outside the block */ lu_byte upval; /* true if some variable in the block is an upvalue */ - lu_byte isloop; /* true if `block' is a loop */ + lu_byte isloop; /* true if 'block' is a loop */ } BlockCnt; @@ -57,19 +63,9 @@ static void statement (LexState *ls); static void expr (LexState *ls, expdesc *v); -static void anchor_token (LexState *ls) { - /* last token from outer function must be EOS */ - lua_assert(ls->fs != NULL || ls->t.token == TK_EOS); - if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { - TString *ts = ls->t.seminfo.ts; - luaX_newstring(ls, getstr(ts), ts->tsv.len); - } -} - - /* semantic error */ static l_noret semerror (LexState *ls, const char *msg) { - ls->t.token = 0; /* remove 'near to' from final message */ + ls->t.token = 0; /* remove "near <token>" from final message */ luaX_syntaxerror(ls, msg); } @@ -222,7 +218,7 @@ static int searchupvalue (FuncState *fs, TString *name) { int i; Upvaldesc *up = fs->f->upvalues; for (i = 0; i < fs->nups; i++) { - if (luaS_eqstr(up[i].name, name)) return i; + if (eqstr(up[i].name, name)) return i; } return -1; /* not found */ } @@ -246,7 +242,7 @@ static int newupvalue (FuncState *fs, TString *name, expdesc *v) { static int searchvar (FuncState *fs, TString *n) { int i; for (i = cast_int(fs->nactvar) - 1; i >= 0; i--) { - if (luaS_eqstr(n, getlocvar(fs, i)->varname)) + if (eqstr(n, getlocvar(fs, i)->varname)) return i; } return -1; /* not found */ @@ -342,11 +338,11 @@ static void closegoto (LexState *ls, int g, Labeldesc *label) { FuncState *fs = ls->fs; Labellist *gl = &ls->dyd->gt; Labeldesc *gt = &gl->arr[g]; - lua_assert(luaS_eqstr(gt->name, label->name)); + lua_assert(eqstr(gt->name, label->name)); if (gt->nactvar < label->nactvar) { TString *vname = getlocvar(fs, gt->nactvar)->varname; const char *msg = luaO_pushfstring(ls->L, - "<goto %s> at line %d jumps into the scope of local " LUA_QS, + "<goto %s> at line %d jumps into the scope of local '%s'", getstr(gt->name), gt->line, getstr(vname)); semerror(ls, msg); } @@ -369,7 +365,7 @@ static int findlabel (LexState *ls, int g) { /* check labels in current block for a match */ for (i = bl->firstlabel; i < dyd->label.n; i++) { Labeldesc *lb = &dyd->label.arr[i]; - if (luaS_eqstr(lb->name, gt->name)) { /* correct label? */ + if (eqstr(lb->name, gt->name)) { /* correct label? */ if (gt->nactvar > lb->nactvar && (bl->upval || dyd->label.n > bl->firstlabel)) luaK_patchclose(ls->fs, gt->pc, lb->nactvar); @@ -390,7 +386,7 @@ static int newlabelentry (LexState *ls, Labellist *l, TString *name, l->arr[n].line = line; l->arr[n].nactvar = ls->fs->nactvar; l->arr[n].pc = pc; - l->n++; + l->n = n + 1; return n; } @@ -403,7 +399,7 @@ static void findgotos (LexState *ls, Labeldesc *lb) { Labellist *gl = &ls->dyd->gt; int i = ls->fs->bl->firstgoto; while (i < gl->n) { - if (luaS_eqstr(gl->arr[i].name, lb->name)) + if (eqstr(gl->arr[i].name, lb->name)) closegoto(ls, i, lb); else i++; @@ -412,7 +408,7 @@ static void findgotos (LexState *ls, Labeldesc *lb) { /* -** "export" pending gotos to outer level, to check them against +** export pending gotos to outer level, to check them against ** outer labels; if the block being exited has upvalues, and ** the goto exits the scope of any variable (which can be the ** upvalue), close those variables being exited. @@ -448,7 +444,7 @@ static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isloop) { /* -** create a label named "break" to resolve break statements +** create a label named 'break' to resolve break statements */ static void breaklabel (LexState *ls) { TString *n = luaS_new(ls->L, "break"); @@ -463,7 +459,7 @@ static void breaklabel (LexState *ls) { static l_noret undefgoto (LexState *ls, Labeldesc *gt) { const char *msg = isreserved(gt->name) ? "<%s> at line %d not inside a loop" - : "no visible label " LUA_QS " for <goto> at line %d"; + : "no visible label '%s' for <goto> at line %d"; msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line); semerror(ls, msg); } @@ -525,7 +521,6 @@ static void codeclosure (LexState *ls, expdesc *v) { static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) { - lua_State *L = ls->L; Proto *f; fs->prev = ls->fs; /* linked list of funcstates */ fs->ls = ls; @@ -544,10 +539,6 @@ static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) { f = fs->f; f->source = ls->source; f->maxstacksize = 2; /* registers 0/1 are always valid */ - fs->h = luaH_new(L); - /* anchor table of constants (to avoid being collected) */ - sethvalue2s(L, L->top, fs->h); - incr_top(L); enterblock(fs, bl, 0); } @@ -572,9 +563,6 @@ static void close_func (LexState *ls) { f->sizeupvalues = fs->nups; lua_assert(fs->bl == NULL); ls->fs = fs->prev; - /* last token read was anchored in defunct function; must re-anchor it */ - anchor_token(ls); - L->top--; /* pop table of constants */ luaC_checkGC(L); } @@ -588,7 +576,7 @@ static void close_func (LexState *ls) { /* ** check whether current token is in the follow set of a block. ** 'until' closes syntactical blocks, but do not close scope, -** so it handled in separate. +** so it is handled in separate. */ static int block_follow (LexState *ls, int withuntil) { switch (ls->t.token) { @@ -602,7 +590,7 @@ static int block_follow (LexState *ls, int withuntil) { static void statlist (LexState *ls) { - /* statlist -> { stat [`;'] } */ + /* statlist -> { stat [';'] } */ while (!block_follow(ls, 1)) { if (ls->t.token == TK_RETURN) { statement(ls); @@ -643,14 +631,14 @@ static void yindex (LexState *ls, expdesc *v) { struct ConsControl { expdesc v; /* last list item read */ expdesc *t; /* table descriptor */ - int nh; /* total number of `record' elements */ + int nh; /* total number of 'record' elements */ int na; /* total number of array elements */ int tostore; /* number of array elements pending to be stored */ }; static void recfield (LexState *ls, struct ConsControl *cc) { - /* recfield -> (NAME | `['exp1`]') = exp1 */ + /* recfield -> (NAME | '['exp1']') = exp1 */ FuncState *fs = ls->fs; int reg = ls->fs->freereg; expdesc key, val; @@ -757,12 +745,12 @@ static void constructor (LexState *ls, expdesc *t) { static void parlist (LexState *ls) { - /* parlist -> [ param { `,' param } ] */ + /* parlist -> [ param { ',' param } ] */ FuncState *fs = ls->fs; Proto *f = fs->f; int nparams = 0; f->is_vararg = 0; - if (ls->t.token != ')') { /* is `parlist' not empty? */ + if (ls->t.token != ')') { /* is 'parlist' not empty? */ do { switch (ls->t.token) { case TK_NAME: { /* param -> NAME */ @@ -770,12 +758,12 @@ static void parlist (LexState *ls) { nparams++; break; } - case TK_DOTS: { /* param -> `...' */ + case TK_DOTS: { /* param -> '...' */ luaX_next(ls); f->is_vararg = 1; break; } - default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected"); + default: luaX_syntaxerror(ls, "<name> or '...' expected"); } } while (!f->is_vararg && testnext(ls, ',')); } @@ -786,7 +774,7 @@ static void parlist (LexState *ls) { static void body (LexState *ls, expdesc *e, int ismethod, int line) { - /* body -> `(' parlist `)' block END */ + /* body -> '(' parlist ')' block END */ FuncState new_fs; BlockCnt bl; new_fs.f = addprototype(ls); @@ -808,7 +796,7 @@ static void body (LexState *ls, expdesc *e, int ismethod, int line) { static int explist (LexState *ls, expdesc *v) { - /* explist -> expr { `,' expr } */ + /* explist -> expr { ',' expr } */ int n = 1; /* at least one expression */ expr(ls, v); while (testnext(ls, ',')) { @@ -825,7 +813,7 @@ static void funcargs (LexState *ls, expdesc *f, int line) { expdesc args; int base, nparams; switch (ls->t.token) { - case '(': { /* funcargs -> `(' [ explist ] `)' */ + case '(': { /* funcargs -> '(' [ explist ] ')' */ luaX_next(ls); if (ls->t.token == ')') /* arg list is empty? */ args.k = VVOID; @@ -842,7 +830,7 @@ static void funcargs (LexState *ls, expdesc *f, int line) { } case TK_STRING: { /* funcargs -> STRING */ codestring(ls, &args, ls->t.seminfo.ts); - luaX_next(ls); /* must use `seminfo' before `next' */ + luaX_next(ls); /* must use 'seminfo' before 'next' */ break; } default: { @@ -908,14 +896,14 @@ static void suffixedexp (LexState *ls, expdesc *v) { fieldsel(ls, v); break; } - case '[': { /* `[' exp1 `]' */ + case '[': { /* '[' exp1 ']' */ expdesc key; luaK_exp2anyregup(fs, v); yindex(ls, &key); luaK_indexed(fs, v, &key); break; } - case ':': { /* `:' NAME funcargs */ + case ':': { /* ':' NAME funcargs */ expdesc key; luaX_next(ls); checkname(ls, &key); @@ -935,14 +923,19 @@ static void suffixedexp (LexState *ls, expdesc *v) { static void simpleexp (LexState *ls, expdesc *v) { - /* simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE | ... | + /* simpleexp -> FLT | INT | STRING | NIL | TRUE | FALSE | ... | constructor | FUNCTION body | suffixedexp */ switch (ls->t.token) { - case TK_NUMBER: { - init_exp(v, VKNUM, 0); + case TK_FLT: { + init_exp(v, VKFLT, 0); v->u.nval = ls->t.seminfo.r; break; } + case TK_INT: { + init_exp(v, VKINT, 0); + v->u.ival = ls->t.seminfo.i; + break; + } case TK_STRING: { codestring(ls, v, ls->t.seminfo.ts); break; @@ -962,7 +955,7 @@ static void simpleexp (LexState *ls, expdesc *v) { case TK_DOTS: { /* vararg */ FuncState *fs = ls->fs; check_condition(ls, fs->f->is_vararg, - "cannot use " LUA_QL("...") " outside a vararg function"); + "cannot use '...' outside a vararg function"); init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); break; } @@ -988,6 +981,7 @@ static UnOpr getunopr (int op) { switch (op) { case TK_NOT: return OPR_NOT; case '-': return OPR_MINUS; + case '~': return OPR_BNOT; case '#': return OPR_LEN; default: return OPR_NOUNOPR; } @@ -999,9 +993,15 @@ static BinOpr getbinopr (int op) { case '+': return OPR_ADD; case '-': return OPR_SUB; case '*': return OPR_MUL; - case '/': return OPR_DIV; case '%': return OPR_MOD; case '^': return OPR_POW; + case '/': return OPR_DIV; + case TK_IDIV: return OPR_IDIV; + case '&': return OPR_BAND; + case '|': return OPR_BOR; + case '~': return OPR_BXOR; + case TK_SHL: return OPR_SHL; + case TK_SHR: return OPR_SHR; case TK_CONCAT: return OPR_CONCAT; case TK_NE: return OPR_NE; case TK_EQ: return OPR_EQ; @@ -1020,19 +1020,24 @@ static const struct { lu_byte left; /* left priority for each binary operator */ lu_byte right; /* right priority */ } priority[] = { /* ORDER OPR */ - {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `*' `/' `%' */ - {10, 9}, {5, 4}, /* ^, .. (right associative) */ - {3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ - {3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ - {2, 2}, {1, 1} /* and, or */ + {10, 10}, {10, 10}, /* '+' '-' */ + {11, 11}, {11, 11}, /* '*' '%' */ + {14, 13}, /* '^' (right associative) */ + {11, 11}, {11, 11}, /* '/' '//' */ + {6, 6}, {4, 4}, {5, 5}, /* '&' '|' '~' */ + {7, 7}, {7, 7}, /* '<<' '>>' */ + {9, 8}, /* '..' (right associative) */ + {3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ + {3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ + {2, 2}, {1, 1} /* and, or */ }; -#define UNARY_PRIORITY 8 /* priority for unary operators */ +#define UNARY_PRIORITY 12 /* priority for unary operators */ /* ** subexpr -> (simpleexp | unop subexpr) { binop subexpr } -** where `binop' is any binary operator with a priority higher than `limit' +** where 'binop' is any binary operator with a priority higher than 'limit' */ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) { BinOpr op; @@ -1046,7 +1051,7 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) { luaK_prefix(ls->fs, uop, v, line); } else simpleexp(ls, v); - /* expand while operators have priorities higher than `limit' */ + /* expand while operators have priorities higher than 'limit' */ op = getbinopr(ls->t.token); while (op != OPR_NOBINOPR && priority[op].left > limit) { expdesc v2; @@ -1146,7 +1151,7 @@ static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { "C levels"); assignment(ls, &nv, nvars+1); } - else { /* assignment -> `=' explist */ + else { /* assignment -> '=' explist */ int nexps; checknext(ls, '='); nexps = explist(ls, &e); @@ -1170,7 +1175,7 @@ static int cond (LexState *ls) { /* cond -> exp */ expdesc v; expr(ls, &v); /* read condition */ - if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ + if (v.k == VNIL) v.k = VFALSE; /* 'falses' are all equal here */ luaK_goiftrue(ls->fs, &v); return v.f; } @@ -1195,9 +1200,9 @@ static void gotostat (LexState *ls, int pc) { static void checkrepeated (FuncState *fs, Labellist *ll, TString *label) { int i; for (i = fs->bl->firstlabel; i < ll->n; i++) { - if (luaS_eqstr(label, ll->arr[i].name)) { + if (eqstr(label, ll->arr[i].name)) { const char *msg = luaO_pushfstring(fs->ls->L, - "label " LUA_QS " already defined on line %d", + "label '%s' already defined on line %d", getstr(label), ll->arr[i].line); semerror(fs->ls, msg); } @@ -1321,7 +1326,7 @@ static void fornum (LexState *ls, TString *varname, int line) { if (testnext(ls, ',')) exp1(ls); /* optional step */ else { /* default step = 1 */ - luaK_codek(fs, fs->freereg, luaK_numberK(fs, 1)); + luaK_codek(fs, fs->freereg, luaK_intK(fs, 1)); luaK_reserveregs(fs, 1); } forbody(ls, base, line, 1, 1); @@ -1359,15 +1364,15 @@ static void forstat (LexState *ls, int line) { TString *varname; BlockCnt bl; enterblock(fs, &bl, 1); /* scope for loop and control variables */ - luaX_next(ls); /* skip `for' */ + luaX_next(ls); /* skip 'for' */ varname = str_checkname(ls); /* first variable name */ switch (ls->t.token) { case '=': fornum(ls, varname, line); break; case ',': case TK_IN: forlist(ls, varname); break; - default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); + default: luaX_syntaxerror(ls, "'=' or 'in' expected"); } check_match(ls, TK_END, TK_FOR, line); - leaveblock(fs); /* loop scope (`break' jumps to this point) */ + leaveblock(fs); /* loop scope ('break' jumps to this point) */ } @@ -1397,7 +1402,7 @@ static void test_then_block (LexState *ls, int *escapelist) { enterblock(fs, &bl, 0); jf = v.f; } - statlist(ls); /* `then' part */ + statlist(ls); /* 'then' part */ leaveblock(fs); if (ls->t.token == TK_ELSE || ls->t.token == TK_ELSEIF) /* followed by 'else'/'elseif'? */ @@ -1414,7 +1419,7 @@ static void ifstat (LexState *ls, int line) { while (ls->t.token == TK_ELSEIF) test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ if (testnext(ls, TK_ELSE)) - block(ls); /* `else' part */ + block(ls); /* 'else' part */ check_match(ls, TK_END, TK_IF, line); luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ } @@ -1432,7 +1437,7 @@ static void localfunc (LexState *ls) { static void localstat (LexState *ls) { - /* stat -> LOCAL NAME {`,' NAME} [`=' explist] */ + /* stat -> LOCAL NAME {',' NAME} ['=' explist] */ int nvars = 0; int nexps; expdesc e; @@ -1452,7 +1457,7 @@ static void localstat (LexState *ls) { static int funcname (LexState *ls, expdesc *v) { - /* funcname -> NAME {fieldsel} [`:' NAME] */ + /* funcname -> NAME {fieldsel} [':' NAME] */ int ismethod = 0; singlevar(ls, v); while (ls->t.token == '.') @@ -1473,7 +1478,7 @@ static void funcstat (LexState *ls, int line) { ismethod = funcname(ls, &v); body(ls, &b, ismethod, line); luaK_storevar(ls->fs, &v, &b); - luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ + luaK_fixline(ls->fs, line); /* definition "happens" in the first line */ } @@ -1515,8 +1520,8 @@ static void retstat (LexState *ls) { if (nret == 1) /* only one single value? */ first = luaK_exp2anyreg(fs, &e); else { - luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ - first = fs->nactvar; /* return all `active' values */ + luaK_exp2nextreg(fs, &e); /* values must go to the stack */ + first = fs->nactvar; /* return all active values */ lua_assert(nret == fs->freereg - first); } } @@ -1615,16 +1620,19 @@ static void mainfunc (LexState *ls, FuncState *fs) { } -Closure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, - Dyndata *dyd, const char *name, int firstchar) { +LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, + Dyndata *dyd, const char *name, int firstchar) { LexState lexstate; FuncState funcstate; - Closure *cl = luaF_newLclosure(L, 1); /* create main closure */ - /* anchor closure (to avoid being collected) */ - setclLvalue(L, L->top, cl); + LClosure *cl = luaF_newLclosure(L, 1); /* create main closure */ + setclLvalue(L, L->top, cl); /* anchor it (to avoid being collected) */ + incr_top(L); + lexstate.h = luaH_new(L); /* create table for scanner */ + sethvalue(L, L->top, lexstate.h); /* anchor it */ incr_top(L); - funcstate.f = cl->l.p = luaF_newproto(L); + funcstate.f = cl->p = luaF_newproto(L); funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ + lua_assert(iswhite(funcstate.f)); /* do not need barrier here */ lexstate.buff = buff; lexstate.dyd = dyd; dyd->actvar.n = dyd->gt.n = dyd->label.n = 0; @@ -1633,6 +1641,7 @@ Closure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); /* all scopes should be correctly finished */ lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); - return cl; /* it's on the stack too */ + L->top--; /* remove scanner's table */ + return cl; /* closure is on the stack, too */ } diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lparser.h b/3rdparty/genie/src/host/lua-5.3.0/src/lparser.h index 0346e3c41a8..62c50cac7cc 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lparser.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lparser.h @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.70.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lparser.h,v 1.74 2014/10/25 11:50:46 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -21,8 +21,9 @@ typedef enum { VNIL, VTRUE, VFALSE, - VK, /* info = index of constant in `k' */ - VKNUM, /* nval = numerical value */ + VK, /* info = index of constant in 'k' */ + VKFLT, /* nval = numerical float value */ + VKINT, /* nval = numerical integer value */ VNONRELOC, /* info = result register */ VLOCAL, /* info = local register */ VUPVAL, /* info = index of upvalue in 'upvalues' */ @@ -46,10 +47,11 @@ typedef struct expdesc { lu_byte vt; /* whether 't' is register (VLOCAL) or upvalue (VUPVAL) */ } ind; int info; /* for generic use */ - lua_Number nval; /* for VKNUM */ + lua_Number nval; /* for VKFLT */ + lua_Integer ival; /* for VKINT */ } u; - int t; /* patch list of `exit when true' */ - int f; /* patch list of `exit when false' */ + int t; /* patch list of 'exit when true' */ + int f; /* patch list of 'exit when false' */ } expdesc; @@ -95,15 +97,14 @@ struct BlockCnt; /* defined in lparser.c */ /* state needed to generate code for a given function */ typedef struct FuncState { Proto *f; /* current function header */ - Table *h; /* table to find (and reuse) elements in `k' */ struct FuncState *prev; /* enclosing function */ struct LexState *ls; /* lexical state */ struct BlockCnt *bl; /* chain of current blocks */ - int pc; /* next position to code (equivalent to `ncode') */ + int pc; /* next position to code (equivalent to 'ncode') */ int lasttarget; /* 'label' of last 'jump label' */ - int jpc; /* list of pending jumps to `pc' */ - int nk; /* number of elements in `k' */ - int np; /* number of elements in `p' */ + int jpc; /* list of pending jumps to 'pc' */ + int nk; /* number of elements in 'k' */ + int np; /* number of elements in 'p' */ int firstlocal; /* index of first local var (in Dyndata array) */ short nlocvars; /* number of elements in 'f->locvars' */ lu_byte nactvar; /* number of active local variables */ @@ -112,8 +113,8 @@ typedef struct FuncState { } FuncState; -LUAI_FUNC Closure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, - Dyndata *dyd, const char *name, int firstchar); +LUAI_FUNC LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, + Dyndata *dyd, const char *name, int firstchar); #endif diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lprefix.h b/3rdparty/genie/src/host/lua-5.3.0/src/lprefix.h new file mode 100644 index 00000000000..02daa837f55 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lprefix.h @@ -0,0 +1,45 @@ +/* +** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ +** Definitions for Lua code that must come before any other header file +** See Copyright Notice in lua.h +*/ + +#ifndef lprefix_h +#define lprefix_h + + +/* +** Allows POSIX/XSI stuff +*/ +#if !defined(LUA_USE_C89) /* { */ + +#if !defined(_XOPEN_SOURCE) +#define _XOPEN_SOURCE 600 +#elif _XOPEN_SOURCE == 0 +#undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ +#endif + +/* +** Allows manipulation of large files in gcc and some other compilers +*/ +#if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) +#define _LARGEFILE_SOURCE 1 +#define _FILE_OFFSET_BITS 64 +#endif + +#endif /* } */ + + +/* +** Windows stuff +*/ +#if defined(_WIN32) /* { */ + +#if !defined(_CRT_SECURE_NO_WARNINGS) +#define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ +#endif + +#endif /* } */ + +#endif + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lstate.c b/3rdparty/genie/src/host/lua-5.3.0/src/lstate.c index c7f2672be7b..ff6b02d36ae 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lstate.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lstate.c @@ -1,16 +1,18 @@ /* -** $Id: lstate.c,v 2.99.1.2 2013/11/08 17:45:31 roberto Exp $ +** $Id: lstate.c,v 2.127 2014/11/02 19:33:33 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ +#define lstate_c +#define LUA_CORE + +#include "lprefix.h" + #include <stddef.h> #include <string.h> -#define lstate_c -#define LUA_CORE - #include "lua.h" #include "lapi.h" @@ -30,10 +32,6 @@ #define LUAI_GCPAUSE 200 /* 200% */ #endif -#if !defined(LUAI_GCMAJOR) -#define LUAI_GCMAJOR 200 /* 200% */ -#endif - #if !defined(LUAI_GCMUL) #define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ #endif @@ -57,9 +55,7 @@ ** thread state + extra space */ typedef struct LX { -#if defined(LUAI_EXTRASPACE) - char buff[LUAI_EXTRASPACE]; -#endif + lu_byte extra_[LUA_EXTRASPACE]; lua_State l; } LX; @@ -78,9 +74,8 @@ typedef struct LG { /* -** Compute an initial seed as random as possible. In ANSI, rely on -** Address Space Layout Randomization (if present) to increase -** randomness.. +** Compute an initial seed as random as possible. Rely on Address Space +** Layout Randomization (if present) to increase randomness.. */ #define addbuff(b,p,e) \ { size_t t = cast(size_t, e); \ @@ -119,6 +114,9 @@ CallInfo *luaE_extendCI (lua_State *L) { } +/* +** free all CallInfo structures not in use by a thread +*/ void luaE_freeCI (lua_State *L) { CallInfo *ci = L->ci; CallInfo *next = ci->next; @@ -130,6 +128,22 @@ void luaE_freeCI (lua_State *L) { } +/* +** free half of the CallInfo structures not in use by a thread +*/ +void luaE_shrinkCI (lua_State *L) { + CallInfo *ci = L->ci; + while (ci->next != NULL) { /* while there is 'next' */ + CallInfo *next2 = ci->next->next; /* next's next */ + if (next2 == NULL) break; + luaM_free(L, ci->next); /* remove next */ + ci->next = next2; /* remove 'next' from the list */ + next2->previous = ci; + ci = next2; + } +} + + static void stack_init (lua_State *L1, lua_State *L) { int i; CallInfo *ci; /* initialize stack array */ @@ -163,22 +177,23 @@ static void freestack (lua_State *L) { ** Create registry table and its predefined values */ static void init_registry (lua_State *L, global_State *g) { - TValue mt; + TValue temp; /* create registry */ Table *registry = luaH_new(L); sethvalue(L, &g->l_registry, registry); luaH_resize(L, registry, LUA_RIDX_LAST, 0); /* registry[LUA_RIDX_MAINTHREAD] = L */ - setthvalue(L, &mt, L); - luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &mt); + setthvalue(L, &temp, L); /* temp = L */ + luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp); /* registry[LUA_RIDX_GLOBALS] = table of globals */ - sethvalue(L, &mt, luaH_new(L)); - luaH_setint(L, registry, LUA_RIDX_GLOBALS, &mt); + sethvalue(L, &temp, luaH_new(L)); /* temp = new table (global table) */ + luaH_setint(L, registry, LUA_RIDX_GLOBALS, &temp); } /* -** open parts of the state that may cause memory-allocation errors +** open parts of the state that may cause memory-allocation errors. +** ('g->version' != NULL flags that the state was completely build) */ static void f_luaopen (lua_State *L, void *ud) { global_State *g = G(L); @@ -190,7 +205,7 @@ static void f_luaopen (lua_State *L, void *ud) { luaX_init(L); /* pre-create memory-error message */ g->memerrmsg = luaS_newliteral(L, MEMERRMSG); - luaS_fix(g->memerrmsg); /* it should never be collected */ + luaC_fix(L, obj2gco(g->memerrmsg)); /* it should never be collected */ g->gcrunning = 1; /* allow gc */ g->version = lua_version(NULL); luai_userstateopen(L); @@ -198,14 +213,15 @@ static void f_luaopen (lua_State *L, void *ud) { /* -** preinitialize a state with consistent values without allocating +** preinitialize a thread with consistent values without allocating ** any memory (to avoid errors) */ -static void preinit_state (lua_State *L, global_State *g) { +static void preinit_thread (lua_State *L, global_State *g) { G(L) = g; L->stack = NULL; L->ci = NULL; L->stacksize = 0; + L->twups = L; /* thread has no upvalues */ L->errorJmp = NULL; L->nCcalls = 0; L->hook = NULL; @@ -235,17 +251,28 @@ static void close_state (lua_State *L) { LUA_API lua_State *lua_newthread (lua_State *L) { + global_State *g = G(L); lua_State *L1; lua_lock(L); luaC_checkGC(L); - L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th; + /* create new thread */ + L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l; + L1->marked = luaC_white(g); + L1->tt = LUA_TTHREAD; + /* link it on list 'allgc' */ + L1->next = g->allgc; + g->allgc = obj2gco(L1); + /* anchor it on L stack */ setthvalue(L, L->top, L1); api_incr_top(L); - preinit_state(L1, G(L)); + preinit_thread(L1, g); L1->hookmask = L->hookmask; L1->basehookcount = L->basehookcount; L1->hook = L->hook; resethookcount(L1); + /* initialize L1 extra space */ + memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread), + LUA_EXTRASPACE); luai_userstatethread(L, L1); stack_init(L1, L); /* init stack */ lua_unlock(L); @@ -273,36 +300,32 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { g = &l->g; L->next = NULL; L->tt = LUA_TTHREAD; - g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); + g->currentwhite = bitmask(WHITE0BIT); L->marked = luaC_white(g); - g->gckind = KGC_NORMAL; - preinit_state(L, g); + preinit_thread(L, g); g->frealloc = f; g->ud = ud; g->mainthread = L; g->seed = makeseed(L); - g->uvhead.u.l.prev = &g->uvhead; - g->uvhead.u.l.next = &g->uvhead; g->gcrunning = 0; /* no GC while building state */ g->GCestimate = 0; - g->strt.size = 0; - g->strt.nuse = 0; + g->strt.size = g->strt.nuse = 0; g->strt.hash = NULL; setnilvalue(&g->l_registry); luaZ_initbuffer(L, &g->buff); g->panic = NULL; g->version = NULL; g->gcstate = GCSpause; - g->allgc = NULL; - g->finobj = NULL; - g->tobefnz = NULL; - g->sweepgc = g->sweepfin = NULL; + g->gckind = KGC_NORMAL; + g->allgc = g->finobj = g->tobefnz = g->fixedgc = NULL; + g->sweepgc = NULL; g->gray = g->grayagain = NULL; g->weak = g->ephemeron = g->allweak = NULL; + g->twups = NULL; g->totalbytes = sizeof(LG); g->GCdebt = 0; + g->gcfinnum = 0; g->gcpause = LUAI_GCPAUSE; - g->gcmajorinc = LUAI_GCMAJOR; g->gcstepmul = LUAI_GCMUL; for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lstate.h b/3rdparty/genie/src/host/lua-5.3.0/src/lstate.h index daffd9aacfb..81e12c40db0 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lstate.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.82.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lstate.h,v 2.119 2014/10/30 18:53:28 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -16,25 +16,16 @@ /* -** Some notes about garbage-collected objects: All objects in Lua must -** be kept somehow accessible until being freed. +** Some notes about garbage-collected objects: All objects in Lua must +** be kept somehow accessible until being freed, so all objects always +** belong to one (and only one) of these lists, using field 'next' of +** the 'CommonHeader' for the link: ** -** Lua keeps most objects linked in list g->allgc. The link uses field -** 'next' of the CommonHeader. -** -** Strings are kept in several lists headed by the array g->strt.hash. -** -** Open upvalues are not subject to independent garbage collection. They -** are collected together with their respective threads. Lua keeps a -** double-linked list with all open upvalues (g->uvhead) so that it can -** mark objects referred by them. (They are always gray, so they must -** be remarked in the atomic step. Usually their contents would be marked -** when traversing the respective threads, but the thread may already be -** dead, while the upvalue is still accessible through closures.) -** -** Objects with finalizers are kept in the list g->finobj. -** -** The list g->tobefnz links all objects being finalized. +** 'allgc': all objects not marked for finalization; +** 'finobj': all objects marked for finalization; +** 'tobefnz': all objects ready to be finalized; +** 'fixedgc': all objects that are not to be collected (currently +** only small strings, such as reserved words). */ @@ -53,65 +44,70 @@ struct lua_longjmp; /* defined in ldo.c */ /* kinds of Garbage Collection */ #define KGC_NORMAL 0 #define KGC_EMERGENCY 1 /* gc was forced by an allocation failure */ -#define KGC_GEN 2 /* generational collection */ typedef struct stringtable { - GCObject **hash; - lu_int32 nuse; /* number of elements */ + TString **hash; + int nuse; /* number of elements */ int size; } stringtable; /* -** information about a call +** Information about a call. +** When a thread yields, 'func' is adjusted to pretend that the +** top function has only the yielded values in its stack; in that +** case, the actual 'func' value is saved in field 'extra'. +** When a function calls another with a continuation, 'extra' keeps +** the function index so that, in case of errors, the continuation +** function can be called with the correct top. */ typedef struct CallInfo { StkId func; /* function index in the stack */ StkId top; /* top for this function */ struct CallInfo *previous, *next; /* dynamic call link */ - short nresults; /* expected number of results from this function */ - lu_byte callstatus; - ptrdiff_t extra; union { struct { /* only for Lua functions */ StkId base; /* base for this function */ const Instruction *savedpc; } l; struct { /* only for C functions */ - int ctx; /* context info. in case of yields */ - lua_CFunction k; /* continuation in case of yields */ + lua_KFunction k; /* continuation in case of yields */ ptrdiff_t old_errfunc; - lu_byte old_allowhook; - lu_byte status; + lua_KContext ctx; /* context info. in case of yields */ } c; } u; + ptrdiff_t extra; + short nresults; /* expected number of results from this function */ + lu_byte callstatus; } CallInfo; /* ** Bits in CallInfo status */ -#define CIST_LUA (1<<0) /* call is running a Lua function */ -#define CIST_HOOKED (1<<1) /* call is running a debug hook */ -#define CIST_REENTRY (1<<2) /* call is running on same invocation of +#define CIST_OAH (1<<0) /* original value of 'allowhook' */ +#define CIST_LUA (1<<1) /* call is running a Lua function */ +#define CIST_HOOKED (1<<2) /* call is running a debug hook */ +#define CIST_REENTRY (1<<3) /* call is running on same invocation of luaV_execute of previous call */ -#define CIST_YIELDED (1<<3) /* call reentered after suspension */ #define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ -#define CIST_STAT (1<<5) /* call has an error status (pcall) */ -#define CIST_TAIL (1<<6) /* call was tail called */ -#define CIST_HOOKYIELD (1<<7) /* last hook called yielded */ - +#define CIST_TAIL (1<<5) /* call was tail called */ +#define CIST_HOOKYIELD (1<<6) /* last hook called yielded */ #define isLua(ci) ((ci)->callstatus & CIST_LUA) +/* assume that CIST_OAH has offset 0 and that 'v' is strictly 0/1 */ +#define setoah(st,v) ((st) = ((st) & ~CIST_OAH) | (v)) +#define getoah(st) ((st) & CIST_OAH) + /* -** `global state', shared by all threads of this state +** 'global state', shared by all threads of this state */ typedef struct global_State { lua_Alloc frealloc; /* function to reallocate memory */ - void *ud; /* auxiliary data to `frealloc' */ + void *ud; /* auxiliary data to 'frealloc' */ lu_mem totalbytes; /* number of bytes currently allocated - GCdebt */ l_mem GCdebt; /* bytes allocated not yet compensated by the collector */ lu_mem GCmemtrav; /* memory traversed by the GC */ @@ -123,22 +119,21 @@ typedef struct global_State { lu_byte gcstate; /* state of garbage collector */ lu_byte gckind; /* kind of GC running */ lu_byte gcrunning; /* true if GC is running */ - int sweepstrgc; /* position of sweep in `strt' */ GCObject *allgc; /* list of all collectable objects */ + GCObject **sweepgc; /* current position of sweep in list */ GCObject *finobj; /* list of collectable objects with finalizers */ - GCObject **sweepgc; /* current position of sweep in list 'allgc' */ - GCObject **sweepfin; /* current position of sweep in list 'finobj' */ GCObject *gray; /* list of gray objects */ GCObject *grayagain; /* list of objects to be traversed atomically */ GCObject *weak; /* list of tables with weak values */ GCObject *ephemeron; /* list of ephemeron tables (weak keys) */ GCObject *allweak; /* list of all-weak tables */ GCObject *tobefnz; /* list of userdata to be GC */ - UpVal uvhead; /* head of double-linked list of all open upvalues */ + GCObject *fixedgc; /* list of objects not to be collected */ + struct lua_State *twups; /* list of threads with open upvalues */ Mbuffer buff; /* temporary buffer for string concatenation */ + unsigned int gcfinnum; /* number of finalizers to call in each GC step */ int gcpause; /* size of pause between successive GCs */ - int gcmajorinc; /* pause between major collections (only in gen. mode) */ - int gcstepmul; /* GC `granularity' */ + int gcstepmul; /* GC 'granularity' */ lua_CFunction panic; /* to be called in unprotected errors */ struct lua_State *mainthread; const lua_Number *version; /* pointer to version number */ @@ -149,7 +144,7 @@ typedef struct global_State { /* -** `per thread' state +** 'per thread' state */ struct lua_State { CommonHeader; @@ -160,19 +155,20 @@ struct lua_State { const Instruction *oldpc; /* last pc traced */ StkId stack_last; /* last free slot in the stack */ StkId stack; /* stack base */ + UpVal *openupval; /* list of open upvalues in this stack */ + GCObject *gclist; + struct lua_State *twups; /* list of threads with open upvalues */ + struct lua_longjmp *errorJmp; /* current error recover point */ + CallInfo base_ci; /* CallInfo for first level (C calling Lua) */ + lua_Hook hook; + ptrdiff_t errfunc; /* current error handling function (stack index) */ int stacksize; + int basehookcount; + int hookcount; unsigned short nny; /* number of non-yieldable calls in stack */ unsigned short nCcalls; /* number of nested C calls */ lu_byte hookmask; lu_byte allowhook; - int basehookcount; - int hookcount; - lua_Hook hook; - GCObject *openupval; /* list of open upvalues in this stack */ - GCObject *gclist; - struct lua_longjmp *errorJmp; /* current error recover point */ - ptrdiff_t errfunc; /* current error handling function (stack index) */ - CallInfo base_ci; /* CallInfo for first level (C calling Lua) */ }; @@ -180,39 +176,37 @@ struct lua_State { /* -** Union of all collectable objects +** Union of all collectable objects (only for conversions) */ -union GCObject { - GCheader gch; /* common header */ - union TString ts; - union Udata u; +union GCUnion { + GCObject gc; /* common header */ + struct TString ts; + struct Udata u; union Closure cl; struct Table h; struct Proto p; - struct UpVal uv; struct lua_State th; /* thread */ }; -#define gch(o) (&(o)->gch) +#define cast_u(o) cast(union GCUnion *, (o)) /* macros to convert a GCObject into a specific value */ -#define rawgco2ts(o) \ - check_exp(novariant((o)->gch.tt) == LUA_TSTRING, &((o)->ts)) -#define gco2ts(o) (&rawgco2ts(o)->tsv) -#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u)) -#define gco2u(o) (&rawgco2u(o)->uv) -#define gco2lcl(o) check_exp((o)->gch.tt == LUA_TLCL, &((o)->cl.l)) -#define gco2ccl(o) check_exp((o)->gch.tt == LUA_TCCL, &((o)->cl.c)) +#define gco2ts(o) \ + check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts)) +#define gco2u(o) check_exp((o)->tt == LUA_TUSERDATA, &((cast_u(o))->u)) +#define gco2lcl(o) check_exp((o)->tt == LUA_TLCL, &((cast_u(o))->cl.l)) +#define gco2ccl(o) check_exp((o)->tt == LUA_TCCL, &((cast_u(o))->cl.c)) #define gco2cl(o) \ - check_exp(novariant((o)->gch.tt) == LUA_TFUNCTION, &((o)->cl)) -#define gco2t(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) -#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) -#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) -#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) + check_exp(novariant((o)->tt) == LUA_TFUNCTION, &((cast_u(o))->cl)) +#define gco2t(o) check_exp((o)->tt == LUA_TTABLE, &((cast_u(o))->h)) +#define gco2p(o) check_exp((o)->tt == LUA_TPROTO, &((cast_u(o))->p)) +#define gco2th(o) check_exp((o)->tt == LUA_TTHREAD, &((cast_u(o))->th)) + -/* macro to convert any Lua object into a GCObject */ -#define obj2gco(v) (cast(GCObject *, (v))) +/* macro to convert a Lua object into a GCObject */ +#define obj2gco(v) \ + check_exp(novariant((v)->tt) < LUA_TDEADKEY, (&(cast_u(v)->gc))) /* actual number of total bytes allocated */ @@ -222,6 +216,7 @@ LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt); LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); LUAI_FUNC void luaE_freeCI (lua_State *L); +LUAI_FUNC void luaE_shrinkCI (lua_State *L); #endif diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lstring.c b/3rdparty/genie/src/host/lua-5.3.0/src/lstring.c new file mode 100644 index 00000000000..2947113c3c9 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lstring.c @@ -0,0 +1,182 @@ +/* +** $Id: lstring.c,v 2.45 2014/11/02 19:19:04 roberto Exp $ +** String table (keeps all strings handled by Lua) +** See Copyright Notice in lua.h +*/ + +#define lstring_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <string.h> + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" + + + +/* +** Lua will use at most ~(2^LUAI_HASHLIMIT) bytes from a string to +** compute its hash +*/ +#if !defined(LUAI_HASHLIMIT) +#define LUAI_HASHLIMIT 5 +#endif + + +/* +** equality for long strings +*/ +int luaS_eqlngstr (TString *a, TString *b) { + size_t len = a->len; + lua_assert(a->tt == LUA_TLNGSTR && b->tt == LUA_TLNGSTR); + return (a == b) || /* same instance or... */ + ((len == b->len) && /* equal length and ... */ + (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ +} + + +unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { + unsigned int h = seed ^ cast(unsigned int, l); + size_t l1; + size_t step = (l >> LUAI_HASHLIMIT) + 1; + for (l1 = l; l1 >= step; l1 -= step) + h = h ^ ((h<<5) + (h>>2) + cast_byte(str[l1 - 1])); + return h; +} + + +/* +** resizes the string table +*/ +void luaS_resize (lua_State *L, int newsize) { + int i; + stringtable *tb = &G(L)->strt; + if (newsize > tb->size) { /* grow table if needed */ + luaM_reallocvector(L, tb->hash, tb->size, newsize, TString *); + for (i = tb->size; i < newsize; i++) + tb->hash[i] = NULL; + } + for (i = 0; i < tb->size; i++) { /* rehash */ + TString *p = tb->hash[i]; + tb->hash[i] = NULL; + while (p) { /* for each node in the list */ + TString *hnext = p->hnext; /* save next */ + unsigned int h = lmod(p->hash, newsize); /* new position */ + p->hnext = tb->hash[h]; /* chain it */ + tb->hash[h] = p; + p = hnext; + } + } + if (newsize < tb->size) { /* shrink table if needed */ + /* vanishing slice should be empty */ + lua_assert(tb->hash[newsize] == NULL && tb->hash[tb->size - 1] == NULL); + luaM_reallocvector(L, tb->hash, tb->size, newsize, TString *); + } + tb->size = newsize; +} + + + +/* +** creates a new string object +*/ +static TString *createstrobj (lua_State *L, const char *str, size_t l, + int tag, unsigned int h) { + TString *ts; + GCObject *o; + size_t totalsize; /* total size of TString object */ + totalsize = sizelstring(l); + o = luaC_newobj(L, tag, totalsize); + ts = gco2ts(o); + ts->len = l; + ts->hash = h; + ts->extra = 0; + memcpy(getaddrstr(ts), str, l * sizeof(char)); + getaddrstr(ts)[l] = '\0'; /* ending 0 */ + return ts; +} + + +void luaS_remove (lua_State *L, TString *ts) { + stringtable *tb = &G(L)->strt; + TString **p = &tb->hash[lmod(ts->hash, tb->size)]; + while (*p != ts) /* find previous element */ + p = &(*p)->hnext; + *p = (*p)->hnext; /* remove element from its list */ + tb->nuse--; +} + + +/* +** checks whether short string exists and reuses it or creates a new one +*/ +static TString *internshrstr (lua_State *L, const char *str, size_t l) { + TString *ts; + global_State *g = G(L); + unsigned int h = luaS_hash(str, l, g->seed); + TString **list = &g->strt.hash[lmod(h, g->strt.size)]; + for (ts = *list; ts != NULL; ts = ts->hnext) { + if (l == ts->len && + (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { + /* found! */ + if (isdead(g, ts)) /* dead (but not collected yet)? */ + changewhite(ts); /* resurrect it */ + return ts; + } + } + if (g->strt.nuse >= g->strt.size && g->strt.size <= MAX_INT/2) { + luaS_resize(L, g->strt.size * 2); + list = &g->strt.hash[lmod(h, g->strt.size)]; /* recompute with new size */ + } + ts = createstrobj(L, str, l, LUA_TSHRSTR, h); + ts->hnext = *list; + *list = ts; + g->strt.nuse++; + return ts; +} + + +/* +** new string (with explicit length) +*/ +TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { + if (l <= LUAI_MAXSHORTLEN) /* short string? */ + return internshrstr(L, str, l); + else { + if (l + 1 > (MAX_SIZE - sizeof(TString))/sizeof(char)) + luaM_toobig(L); + return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed); + } +} + + +/* +** new zero-terminated string +*/ +TString *luaS_new (lua_State *L, const char *str) { + return luaS_newlstr(L, str, strlen(str)); +} + + +Udata *luaS_newudata (lua_State *L, size_t s) { + Udata *u; + GCObject *o; + if (s > MAX_SIZE - sizeof(Udata)) + luaM_toobig(L); + o = luaC_newobj(L, LUA_TUSERDATA, sizeludata(s)); + u = gco2u(o); + u->len = s; + u->metatable = NULL; + setuservalue(L, u, luaO_nilobject); + return u; +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lstring.h b/3rdparty/genie/src/host/lua-5.3.0/src/lstring.h index 260e7f169bd..d3f04caf728 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lstring.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lstring.h @@ -1,5 +1,5 @@ /* -** $Id: lstring.h,v 1.49.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lstring.h,v 1.56 2014/07/18 14:46:47 roberto Exp $ ** String table (keep all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -12,33 +12,33 @@ #include "lstate.h" -#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) +#define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) +#define sizestring(s) sizelstring((s)->len) -#define sizeudata(u) (sizeof(union Udata)+(u)->len) +#define sizeludata(l) (sizeof(union UUdata) + (l)) +#define sizeudata(u) sizeludata((u)->len) #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ (sizeof(s)/sizeof(char))-1)) -#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) - /* ** test whether a string is a reserved word */ -#define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0) +#define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0) /* ** equality for short strings, which are always internalized */ -#define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b)) +#define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b)) LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); -LUAI_FUNC int luaS_eqstr (TString *a, TString *b); LUAI_FUNC void luaS_resize (lua_State *L, int newsize); -LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); +LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); +LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lstrlib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lstrlib.c index 9261fd220db..a650b768d57 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lstrlib.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lstrlib.c @@ -1,19 +1,22 @@ /* -** $Id: lstrlib.c,v 1.178.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lstrlib.c,v 1.221 2014/12/11 14:03:07 roberto Exp $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ +#define lstrlib_c +#define LUA_LIB + +#include "lprefix.h" + #include <ctype.h> +#include <limits.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#define lstrlib_c -#define LUA_LIB - #include "lua.h" #include "lauxlib.h" @@ -29,10 +32,19 @@ #endif -/* macro to `unsign' a character */ +/* macro to 'unsign' a character */ #define uchar(c) ((unsigned char)(c)) +/* +** Some sizes are better limited to fit in 'int', but must also fit in +** 'size_t'. (We assume that 'lua_Integer' cannot be smaller than 'int'.) +*/ +#define MAXSIZE \ + (sizeof(size_t) < sizeof(int) ? (~(size_t)0) : (size_t)(INT_MAX)) + + + static int str_len (lua_State *L) { size_t l; @@ -43,22 +55,22 @@ static int str_len (lua_State *L) { /* translate a relative string position: negative means back from end */ -static size_t posrelat (ptrdiff_t pos, size_t len) { - if (pos >= 0) return (size_t)pos; +static lua_Integer posrelat (lua_Integer pos, size_t len) { + if (pos >= 0) return pos; else if (0u - (size_t)pos > len) return 0; - else return len - ((size_t)-pos) + 1; + else return (lua_Integer)len + pos + 1; } static int str_sub (lua_State *L) { size_t l; const char *s = luaL_checklstring(L, 1, &l); - size_t start = posrelat(luaL_checkinteger(L, 2), l); - size_t end = posrelat(luaL_optinteger(L, 3, -1), l); + lua_Integer start = posrelat(luaL_checkinteger(L, 2), l); + lua_Integer end = posrelat(luaL_optinteger(L, 3, -1), l); if (start < 1) start = 1; - if (end > l) end = l; + if (end > (lua_Integer)l) end = l; if (start <= end) - lua_pushlstring(L, s + start - 1, end - start + 1); + lua_pushlstring(L, s + start - 1, (size_t)(end - start + 1)); else lua_pushliteral(L, ""); return 1; } @@ -102,25 +114,23 @@ static int str_upper (lua_State *L) { } -/* reasonable limit to avoid arithmetic overflow */ -#define MAXSIZE ((~(size_t)0) >> 1) - static int str_rep (lua_State *L) { size_t l, lsep; const char *s = luaL_checklstring(L, 1, &l); - int n = luaL_checkint(L, 2); + lua_Integer n = luaL_checkinteger(L, 2); const char *sep = luaL_optlstring(L, 3, "", &lsep); if (n <= 0) lua_pushliteral(L, ""); - else if (l + lsep < l || l + lsep >= MAXSIZE / n) /* may overflow? */ + else if (l + lsep < l || l + lsep > MAXSIZE / n) /* may overflow? */ return luaL_error(L, "resulting string too large"); else { - size_t totallen = n * l + (n - 1) * lsep; + size_t totallen = (size_t)n * l + (size_t)(n - 1) * lsep; luaL_Buffer b; char *p = luaL_buffinitsize(L, &b, totallen); while (n-- > 1) { /* first n-1 copies (followed by separator) */ memcpy(p, s, l * sizeof(char)); p += l; - if (lsep > 0) { /* avoid empty 'memcpy' (may be expensive) */ - memcpy(p, sep, lsep * sizeof(char)); p += lsep; + if (lsep > 0) { /* empty 'memcpy' is not that cheap */ + memcpy(p, sep, lsep * sizeof(char)); + p += lsep; } } memcpy(p, s, l * sizeof(char)); /* last copy (not followed by separator) */ @@ -133,14 +143,14 @@ static int str_rep (lua_State *L) { static int str_byte (lua_State *L) { size_t l; const char *s = luaL_checklstring(L, 1, &l); - size_t posi = posrelat(luaL_optinteger(L, 2, 1), l); - size_t pose = posrelat(luaL_optinteger(L, 3, posi), l); + lua_Integer posi = posrelat(luaL_optinteger(L, 2, 1), l); + lua_Integer pose = posrelat(luaL_optinteger(L, 3, posi), l); int n, i; if (posi < 1) posi = 1; - if (pose > l) pose = l; + if (pose > (lua_Integer)l) pose = l; if (posi > pose) return 0; /* empty interval; return no values */ n = (int)(pose - posi + 1); - if (posi + n <= pose) /* (size_t -> int) overflow? */ + if (posi + n <= pose) /* arithmetic overflow? */ return luaL_error(L, "string slice too long"); luaL_checkstack(L, n, "string slice too long"); for (i=0; i<n; i++) @@ -155,7 +165,7 @@ static int str_char (lua_State *L) { luaL_Buffer b; char *p = luaL_buffinitsize(L, &b, n); for (i=1; i<=n; i++) { - int c = luaL_checkint(L, i); + lua_Integer c = luaL_checkinteger(L, i); luaL_argcheck(L, uchar(c) == c, i, "value out of range"); p[i - 1] = uchar(c); } @@ -164,19 +174,20 @@ static int str_char (lua_State *L) { } -static int writer (lua_State *L, const void* b, size_t size, void* B) { +static int writer (lua_State *L, const void *b, size_t size, void *B) { (void)L; - luaL_addlstring((luaL_Buffer*) B, (const char *)b, size); + luaL_addlstring((luaL_Buffer *) B, (const char *)b, size); return 0; } static int str_dump (lua_State *L) { luaL_Buffer b; + int strip = lua_toboolean(L, 2); luaL_checktype(L, 1, LUA_TFUNCTION); lua_settop(L, 1); luaL_buffinit(L,&b); - if (lua_dump(L, writer, &b) != 0) + if (lua_dump(L, writer, &b, strip) != 0) return luaL_error(L, "unable to dump given function"); luaL_pushresult(&b); return 1; @@ -243,16 +254,16 @@ static const char *classend (MatchState *ms, const char *p) { switch (*p++) { case L_ESC: { if (p == ms->p_end) - luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); + luaL_error(ms->L, "malformed pattern (ends with '%%')"); return p+1; } case '[': { if (*p == '^') p++; - do { /* look for a `]' */ + do { /* look for a ']' */ if (p == ms->p_end) - luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); + luaL_error(ms->L, "malformed pattern (missing ']')"); if (*(p++) == L_ESC && p < ms->p_end) - p++; /* skip escapes (e.g. `%]') */ + p++; /* skip escapes (e.g. '%]') */ } while (*p != ']'); return p+1; } @@ -287,7 +298,7 @@ static int matchbracketclass (int c, const char *p, const char *ec) { int sig = 1; if (*(p+1) == '^') { sig = 0; - p++; /* skip the `^' */ + p++; /* skip the '^' */ } while (++p < ec) { if (*p == L_ESC) { @@ -325,8 +336,7 @@ static int singlematch (MatchState *ms, const char *s, const char *p, static const char *matchbalance (MatchState *ms, const char *s, const char *p) { if (p >= ms->p_end - 1) - luaL_error(ms->L, "malformed pattern " - "(missing arguments to " LUA_QL("%%b") ")"); + luaL_error(ms->L, "malformed pattern (missing arguments to '%%b')"); if (*s != *p) return NULL; else { int b = *p; @@ -425,7 +435,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) { break; } case '$': { - if ((p + 1) != ms->p_end) /* is the `$' the last char in pattern? */ + if ((p + 1) != ms->p_end) /* is the '$' the last char in pattern? */ goto dflt; /* no; go to default */ s = (s == ms->src_end) ? s : NULL; /* check end of string */ break; @@ -443,8 +453,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) { const char *ep; char previous; p += 2; if (*p != '[') - luaL_error(ms->L, "missing " LUA_QL("[") " after " - LUA_QL("%%f") " in pattern"); + luaL_error(ms->L, "missing '[' after '%%f' in pattern"); ep = classend(ms, p); /* points to what is next */ previous = (s == ms->src_init) ? '\0' : *(s - 1); if (!matchbracketclass(uchar(previous), p, ep - 1) && @@ -514,16 +523,16 @@ static const char *match (MatchState *ms, const char *s, const char *p) { static const char *lmemfind (const char *s1, size_t l1, const char *s2, size_t l2) { if (l2 == 0) return s1; /* empty strings are everywhere */ - else if (l2 > l1) return NULL; /* avoids a negative `l1' */ + else if (l2 > l1) return NULL; /* avoids a negative 'l1' */ else { - const char *init; /* to search for a `*s2' inside `s1' */ - l2--; /* 1st char will be checked by `memchr' */ - l1 = l1-l2; /* `s2' cannot be found after that */ + const char *init; /* to search for a '*s2' inside 's1' */ + l2--; /* 1st char will be checked by 'memchr' */ + l1 = l1-l2; /* 's2' cannot be found after that */ while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { init++; /* 1st char is already checked */ if (memcmp(init, s2+1, l2) == 0) return init-1; - else { /* correct `l1' and `s1' to try again */ + else { /* correct 'l1' and 's1' to try again */ l1 -= init-s1; s1 = init; } @@ -539,7 +548,7 @@ static void push_onecapture (MatchState *ms, int i, const char *s, if (i == 0) /* ms->level == 0, too */ lua_pushlstring(ms->L, s, e - s); /* add whole match */ else - luaL_error(ms->L, "invalid capture index"); + luaL_error(ms->L, "invalid capture index %%%d", i + 1); } else { ptrdiff_t l = ms->capture[i].len; @@ -578,16 +587,16 @@ static int str_find_aux (lua_State *L, int find) { size_t ls, lp; const char *s = luaL_checklstring(L, 1, &ls); const char *p = luaL_checklstring(L, 2, &lp); - size_t init = posrelat(luaL_optinteger(L, 3, 1), ls); + lua_Integer init = posrelat(luaL_optinteger(L, 3, 1), ls); if (init < 1) init = 1; - else if (init > ls + 1) { /* start after string's end? */ + else if (init > (lua_Integer)ls + 1) { /* start after string's end? */ lua_pushnil(L); /* cannot find anything */ return 1; } /* explicit request or no special characters? */ if (find && (lua_toboolean(L, 4) || nospecials(p, lp))) { /* do a plain search */ - const char *s2 = lmemfind(s + init - 1, ls - init + 1, p, lp); + const char *s2 = lmemfind(s + init - 1, ls - (size_t)init + 1, p, lp); if (s2) { lua_pushinteger(L, s2 - s + 1); lua_pushinteger(L, s2 - s + lp); @@ -678,7 +687,8 @@ static int gmatch (lua_State *L) { static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, const char *e) { size_t l, i; - const char *news = lua_tolstring(ms->L, 3, &l); + lua_State *L = ms->L; + const char *news = lua_tolstring(L, 3, &l); for (i = 0; i < l; i++) { if (news[i] != L_ESC) luaL_addchar(b, news[i]); @@ -686,14 +696,15 @@ static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, i++; /* skip ESC */ if (!isdigit(uchar(news[i]))) { if (news[i] != L_ESC) - luaL_error(ms->L, "invalid use of " LUA_QL("%c") - " in replacement string", L_ESC); + luaL_error(L, "invalid use of '%c' in replacement string", L_ESC); luaL_addchar(b, news[i]); } else if (news[i] == '0') luaL_addlstring(b, s, e - s); else { push_onecapture(ms, news[i] - '1', s, e); + luaL_tolstring(L, -1, NULL); /* if number, convert it to string */ + lua_remove(L, -2); /* remove original value */ luaL_addvalue(b); /* add capture to accumulated result */ } } @@ -737,9 +748,9 @@ static int str_gsub (lua_State *L) { const char *src = luaL_checklstring(L, 1, &srcl); const char *p = luaL_checklstring(L, 2, &lp); int tr = lua_type(L, 3); - size_t max_s = luaL_optinteger(L, 4, srcl+1); + lua_Integer max_s = luaL_optinteger(L, 4, srcl + 1); int anchor = (*p == '^'); - size_t n = 0; + lua_Integer n = 0; MatchState ms; luaL_Buffer b; luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || @@ -786,48 +797,17 @@ static int str_gsub (lua_State *L) { ** ======================================================= */ -/* -** LUA_INTFRMLEN is the length modifier for integer conversions in -** 'string.format'; LUA_INTFRM_T is the integer type corresponding to -** the previous length -*/ -#if !defined(LUA_INTFRMLEN) /* { */ -#if defined(LUA_USE_LONGLONG) - -#define LUA_INTFRMLEN "ll" -#define LUA_INTFRM_T long long - -#else - -#define LUA_INTFRMLEN "l" -#define LUA_INTFRM_T long - -#endif -#endif /* } */ - - -/* -** LUA_FLTFRMLEN is the length modifier for float conversions in -** 'string.format'; LUA_FLTFRM_T is the float type corresponding to -** the previous length -*/ -#if !defined(LUA_FLTFRMLEN) - -#define LUA_FLTFRMLEN "" -#define LUA_FLTFRM_T double - -#endif - - /* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ #define MAX_ITEM 512 + /* valid flags in a format specification */ #define FLAGS "-+ #0" + /* -** maximum size of each format specification (such as '%-099.99d') -** (+10 accounts for %99.99x plus margin of error) +** maximum size of each format specification (such as "%-099.99d") +** (+2 for length modifiers; +10 accounts for %99.99x plus margin of error) */ -#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10) +#define MAX_FORMAT (sizeof(FLAGS) + 2 + 10) static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { @@ -903,7 +883,7 @@ static int str_format (lua_State *L) { else if (*++strfrmt == L_ESC) luaL_addchar(&b, *strfrmt++); /* %% */ else { /* format item */ - char form[MAX_FORMAT]; /* to store the format (`%...') */ + char form[MAX_FORMAT]; /* to store the format ('%...') */ char *buff = luaL_prepbuffsize(&b, MAX_ITEM); /* to put formatted item */ int nb = 0; /* number of bytes in added item */ if (++arg > top) @@ -911,36 +891,23 @@ static int str_format (lua_State *L) { strfrmt = scanformat(L, strfrmt, form); switch (*strfrmt++) { case 'c': { - nb = sprintf(buff, form, luaL_checkint(L, arg)); - break; - } - case 'd': case 'i': { - lua_Number n = luaL_checknumber(L, arg); - LUA_INTFRM_T ni = (LUA_INTFRM_T)n; - lua_Number diff = n - (lua_Number)ni; - luaL_argcheck(L, -1 < diff && diff < 1, arg, - "not a number in proper range"); - addlenmod(form, LUA_INTFRMLEN); - nb = sprintf(buff, form, ni); + nb = sprintf(buff, form, (int)luaL_checkinteger(L, arg)); break; } + case 'd': case 'i': case 'o': case 'u': case 'x': case 'X': { - lua_Number n = luaL_checknumber(L, arg); - unsigned LUA_INTFRM_T ni = (unsigned LUA_INTFRM_T)n; - lua_Number diff = n - (lua_Number)ni; - luaL_argcheck(L, -1 < diff && diff < 1, arg, - "not a non-negative number in proper range"); - addlenmod(form, LUA_INTFRMLEN); - nb = sprintf(buff, form, ni); + lua_Integer n = luaL_checkinteger(L, arg); + addlenmod(form, LUA_INTEGER_FRMLEN); + nb = sprintf(buff, form, n); break; } - case 'e': case 'E': case 'f': #if defined(LUA_USE_AFORMAT) case 'a': case 'A': #endif + case 'e': case 'E': case 'f': case 'g': case 'G': { - addlenmod(form, LUA_FLTFRMLEN); - nb = sprintf(buff, form, (LUA_FLTFRM_T)luaL_checknumber(L, arg)); + addlenmod(form, LUA_NUMBER_FRMLEN); + nb = sprintf(buff, form, luaL_checknumber(L, arg)); break; } case 'q': { @@ -962,9 +929,9 @@ static int str_format (lua_State *L) { break; } } - default: { /* also treat cases `pnLlh' */ - return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " - LUA_QL("format"), *(strfrmt - 1)); + default: { /* also treat cases 'pnLlh' */ + return luaL_error(L, "invalid option '%%%c' to 'format'", + *(strfrmt - 1)); } } luaL_addsize(&b, nb); @@ -977,6 +944,447 @@ static int str_format (lua_State *L) { /* }====================================================== */ +/* +** {====================================================== +** PACK/UNPACK +** ======================================================= +*/ + + +/* value used for padding */ +#if !defined(LUA_PACKPADBYTE) +#define LUA_PACKPADBYTE 0x00 +#endif + +/* maximum size for the binary representation of an integer */ +#define MAXINTSIZE 16 + +/* number of bits in a character */ +#define NB CHAR_BIT + +/* mask for one character (NB 1's) */ +#define MC ((1 << NB) - 1) + +/* size of a lua_Integer */ +#define SZINT ((int)sizeof(lua_Integer)) + + +/* dummy union to get native endianness */ +static const union { + int dummy; + char little; /* true iff machine is little endian */ +} nativeendian = {1}; + + +/* dummy structure to get native alignment requirements */ +struct cD { + char c; + union { double d; void *p; lua_Integer i; lua_Number n; } u; +}; + +#define MAXALIGN (offsetof(struct cD, u)) + + +/* +** Union for serializing floats +*/ +typedef union Ftypes { + float f; + double d; + lua_Number n; + char buff[5 * sizeof(lua_Number)]; /* enough for any float type */ +} Ftypes; + + +/* +** information to pack/unpack stuff +*/ +typedef struct Header { + lua_State *L; + int islittle; + int maxalign; +} Header; + + +/* +** options for pack/unpack +*/ +typedef enum KOption { + Kint, /* signed integers */ + Kuint, /* unsigned integers */ + Kfloat, /* floating-point numbers */ + Kchar, /* fixed-length strings */ + Kstring, /* strings with prefixed length */ + Kzstr, /* zero-terminated strings */ + Kpadding, /* padding */ + Kpaddalign, /* padding for alignment */ + Knop /* no-op (configuration or spaces) */ +} KOption; + + +/* +** Read an integer numeral from string 'fmt' or return 'df' if +** there is no numeral +*/ +static int digit (int c) { return '0' <= c && c <= '9'; } + +static int getnum (const char **fmt, int df) { + if (!digit(**fmt)) /* no number? */ + return df; /* return default value */ + else { + int a = 0; + do { + a = a*10 + (*((*fmt)++) - '0'); + } while (digit(**fmt) && a <= ((int)MAXSIZE - 9)/10); + return a; + } +} + + +/* +** Read an integer numeral and raises an error if it is larger +** than the maximum size for integers. +*/ +static int getnumlimit (Header *h, const char **fmt, int df) { + int sz = getnum(fmt, df); + if (sz > MAXINTSIZE || sz <= 0) + luaL_error(h->L, "integral size (%d) out of limits [1,%d]", + sz, MAXINTSIZE); + return sz; +} + + +/* +** Initialize Header +*/ +static void initheader (lua_State *L, Header *h) { + h->L = L; + h->islittle = nativeendian.little; + h->maxalign = 1; +} + + +/* +** Read and classify next option. 'size' is filled with option's size. +*/ +static KOption getoption (Header *h, const char **fmt, int *size) { + int opt = *((*fmt)++); + *size = 0; /* default */ + switch (opt) { + case 'b': *size = sizeof(char); return Kint; + case 'B': *size = sizeof(char); return Kuint; + case 'h': *size = sizeof(short); return Kint; + case 'H': *size = sizeof(short); return Kuint; + case 'l': *size = sizeof(long); return Kint; + case 'L': *size = sizeof(long); return Kuint; + case 'j': *size = sizeof(lua_Integer); return Kint; + case 'J': *size = sizeof(lua_Integer); return Kuint; + case 'T': *size = sizeof(size_t); return Kuint; + case 'f': *size = sizeof(float); return Kfloat; + case 'd': *size = sizeof(double); return Kfloat; + case 'n': *size = sizeof(lua_Number); return Kfloat; + case 'i': *size = getnumlimit(h, fmt, sizeof(int)); return Kint; + case 'I': *size = getnumlimit(h, fmt, sizeof(int)); return Kuint; + case 's': *size = getnumlimit(h, fmt, sizeof(size_t)); return Kstring; + case 'c': + *size = getnum(fmt, -1); + if (*size == -1) + luaL_error(h->L, "missing size for format option 'c'"); + return Kchar; + case 'z': return Kzstr; + case 'x': *size = 1; return Kpadding; + case 'X': return Kpaddalign; + case ' ': break; + case '<': h->islittle = 1; break; + case '>': h->islittle = 0; break; + case '=': h->islittle = nativeendian.little; break; + case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); break; + default: luaL_error(h->L, "invalid format option '%c'", opt); + } + return Knop; +} + + +/* +** Read, classify, and fill other details about the next option. +** 'psize' is filled with option's size, 'notoalign' with its +** alignment requirements. +** Local variable 'size' gets the size to be aligned. (Kpadal option +** always gets its full alignment, other options are limited by +** the maximum alignment ('maxalign'). Kchar option needs no alignment +** despite its size. +*/ +static KOption getdetails (Header *h, size_t totalsize, + const char **fmt, int *psize, int *ntoalign) { + KOption opt = getoption(h, fmt, psize); + int align = *psize; /* usually, alignment follows size */ + if (opt == Kpaddalign) { /* 'X' gets alignment from following option */ + if (**fmt == '\0' || getoption(h, fmt, &align) == Kchar || align == 0) + luaL_argerror(h->L, 1, "invalid next option for option 'X'"); + } + if (align <= 1 || opt == Kchar) /* need no alignment? */ + *ntoalign = 0; + else { + if (align > h->maxalign) /* enforce maximum alignment */ + align = h->maxalign; + if ((align & (align - 1)) != 0) /* is 'align' not a power of 2? */ + luaL_argerror(h->L, 1, "format asks for alignment not power of 2"); + *ntoalign = (align - (int)(totalsize & (align - 1))) & (align - 1); + } + return opt; +} + + +/* +** Pack integer 'n' with 'size' bytes and 'islittle' endianness. +** The final 'if' handles the case when 'size' is larger than +** the size of a Lua integer, correcting the extra sign-extension +** bytes if necessary (by default they would be zeros). +*/ +static void packint (luaL_Buffer *b, lua_Unsigned n, + int islittle, int size, int neg) { + char *buff = luaL_prepbuffsize(b, size); + int i; + buff[islittle ? 0 : size - 1] = (char)(n & MC); /* first byte */ + for (i = 1; i < size; i++) { + n >>= NB; + buff[islittle ? i : size - 1 - i] = (char)(n & MC); + } + if (neg && size > SZINT) { /* negative number need sign extension? */ + for (i = SZINT; i < size; i++) /* correct extra bytes */ + buff[islittle ? i : size - 1 - i] = (char)MC; + } + luaL_addsize(b, size); /* add result to buffer */ +} + + +/* +** Copy 'size' bytes from 'src' to 'dest', correcting endianness if +** given 'islittle' is different from native endianness. +*/ +static void copywithendian (volatile char *dest, volatile const char *src, + int size, int islittle) { + if (islittle == nativeendian.little) { + while (size-- != 0) + *(dest++) = *(src++); + } + else { + dest += size - 1; + while (size-- != 0) + *(dest--) = *(src++); + } +} + + +static int str_pack (lua_State *L) { + luaL_Buffer b; + Header h; + const char *fmt = luaL_checkstring(L, 1); /* format string */ + int arg = 1; /* current argument to pack */ + size_t totalsize = 0; /* accumulate total size of result */ + initheader(L, &h); + lua_pushnil(L); /* mark to separate arguments from string buffer */ + luaL_buffinit(L, &b); + while (*fmt != '\0') { + int size, ntoalign; + KOption opt = getdetails(&h, totalsize, &fmt, &size, &ntoalign); + totalsize += ntoalign + size; + while (ntoalign-- > 0) + luaL_addchar(&b, LUA_PACKPADBYTE); /* fill alignment */ + arg++; + switch (opt) { + case Kint: { /* signed integers */ + lua_Integer n = luaL_checkinteger(L, arg); + if (size < SZINT) { /* need overflow check? */ + lua_Integer lim = (lua_Integer)1 << ((size * NB) - 1); + luaL_argcheck(L, -lim <= n && n < lim, arg, "integer overflow"); + } + packint(&b, (lua_Unsigned)n, h.islittle, size, (n < 0)); + break; + } + case Kuint: { /* unsigned integers */ + lua_Integer n = luaL_checkinteger(L, arg); + if (size < SZINT) /* need overflow check? */ + luaL_argcheck(L, (lua_Unsigned)n < ((lua_Unsigned)1 << (size * NB)), + arg, "unsigned overflow"); + packint(&b, (lua_Unsigned)n, h.islittle, size, 0); + break; + } + case Kfloat: { /* floating-point options */ + volatile Ftypes u; + char *buff = luaL_prepbuffsize(&b, size); + lua_Number n = luaL_checknumber(L, arg); /* get argument */ + if (size == sizeof(u.f)) u.f = (float)n; /* copy it into 'u' */ + else if (size == sizeof(u.d)) u.d = (double)n; + else u.n = n; + /* move 'u' to final result, correcting endianness if needed */ + copywithendian(buff, u.buff, size, h.islittle); + luaL_addsize(&b, size); + break; + } + case Kchar: { /* fixed-size string */ + size_t len; + const char *s = luaL_checklstring(L, arg, &len); + luaL_argcheck(L, len == (size_t)size, arg, "wrong length"); + luaL_addlstring(&b, s, size); + break; + } + case Kstring: { /* strings with length count */ + size_t len; + const char *s = luaL_checklstring(L, arg, &len); + luaL_argcheck(L, size >= (int)sizeof(size_t) || + len < ((size_t)1 << (size * NB)), + arg, "string length does not fit in given size"); + packint(&b, (lua_Unsigned)len, h.islittle, size, 0); /* pack length */ + luaL_addlstring(&b, s, len); + totalsize += len; + break; + } + case Kzstr: { /* zero-terminated string */ + size_t len; + const char *s = luaL_checklstring(L, arg, &len); + luaL_argcheck(L, strlen(s) == len, arg, "string contains zeros"); + luaL_addlstring(&b, s, len); + luaL_addchar(&b, '\0'); /* add zero at the end */ + totalsize += len + 1; + break; + } + case Kpadding: luaL_addchar(&b, LUA_PACKPADBYTE); /* go through */ + case Kpaddalign: case Knop: + arg--; /* undo increment */ + break; + } + } + luaL_pushresult(&b); + return 1; +} + + +static int str_packsize (lua_State *L) { + Header h; + const char *fmt = luaL_checkstring(L, 1); /* format string */ + size_t totalsize = 0; /* accumulate total size of result */ + initheader(L, &h); + while (*fmt != '\0') { + int size, ntoalign; + KOption opt = getdetails(&h, totalsize, &fmt, &size, &ntoalign); + size += ntoalign; /* total space used by option */ + luaL_argcheck(L, totalsize <= MAXSIZE - size, 1, + "format result too large"); + totalsize += size; + switch (opt) { + case Kstring: /* strings with length count */ + case Kzstr: /* zero-terminated string */ + luaL_argerror(L, 1, "variable-length format"); + break; + default: break; + } + } + lua_pushinteger(L, (lua_Integer)totalsize); + return 1; +} + + +/* +** Unpack an integer with 'size' bytes and 'islittle' endianness. +** If size is smaller than the size of a Lua integer and integer +** is signed, must do sign extension (propagating the sign to the +** higher bits); if size is larger than the size of a Lua integer, +** it must check the unread bytes to see whether they do not cause an +** overflow. +*/ +static lua_Integer unpackint (lua_State *L, const char *str, + int islittle, int size, int issigned) { + lua_Unsigned res = 0; + int i; + int limit = (size <= SZINT) ? size : SZINT; + for (i = limit - 1; i >= 0; i--) { + res <<= NB; + res |= (lua_Unsigned)(unsigned char)str[islittle ? i : size - 1 - i]; + } + if (size < SZINT) { /* real size smaller than lua_Integer? */ + if (issigned) { /* needs sign extension? */ + lua_Unsigned mask = (lua_Unsigned)1 << (size*NB - 1); + res = ((res ^ mask) - mask); /* do sign extension */ + } + } + else if (size > SZINT) { /* must check unread bytes */ + int mask = (!issigned || (lua_Integer)res >= 0) ? 0 : MC; + for (i = limit; i < size; i++) { + if ((unsigned char)str[islittle ? i : size - 1 - i] != mask) + luaL_error(L, "%d-byte integer does not fit into Lua Integer", size); + } + } + return (lua_Integer)res; +} + + +static int str_unpack (lua_State *L) { + Header h; + const char *fmt = luaL_checkstring(L, 1); + size_t ld; + const char *data = luaL_checklstring(L, 2, &ld); + size_t pos = (size_t)posrelat(luaL_optinteger(L, 3, 1), ld) - 1; + int n = 0; /* number of results */ + luaL_argcheck(L, pos <= ld, 3, "initial position out of string"); + initheader(L, &h); + while (*fmt != '\0') { + int size, ntoalign; + KOption opt = getdetails(&h, pos, &fmt, &size, &ntoalign); + if ((size_t)ntoalign + size > ~pos || pos + ntoalign + size > ld) + luaL_argerror(L, 2, "data string too short"); + pos += ntoalign; /* skip alignment */ + /* stack space for item + next position */ + luaL_checkstack(L, 2, "too many results"); + n++; + switch (opt) { + case Kint: + case Kuint: { + lua_Integer res = unpackint(L, data + pos, h.islittle, size, + (opt == Kint)); + lua_pushinteger(L, res); + break; + } + case Kfloat: { + volatile Ftypes u; + lua_Number num; + copywithendian(u.buff, data + pos, size, h.islittle); + if (size == sizeof(u.f)) num = (lua_Number)u.f; + else if (size == sizeof(u.d)) num = (lua_Number)u.d; + else num = u.n; + lua_pushnumber(L, num); + break; + } + case Kchar: { + lua_pushlstring(L, data + pos, size); + break; + } + case Kstring: { + size_t len = (size_t)unpackint(L, data + pos, h.islittle, size, 0); + luaL_argcheck(L, pos + len + size <= ld, 2, "data string too short"); + lua_pushlstring(L, data + pos + size, len); + pos += len; /* skip string */ + break; + } + case Kzstr: { + size_t len = (int)strlen(data + pos); + lua_pushlstring(L, data + pos, len); + pos += len + 1; /* skip string plus final '\0' */ + break; + } + case Kpaddalign: case Kpadding: case Knop: + n--; /* undo increment */ + break; + } + pos += size; + } + lua_pushinteger(L, pos + 1); /* next position */ + return n + 1; +} + +/* }====================================================== */ + + static const luaL_Reg strlib[] = { {"byte", str_byte}, {"char", str_char}, @@ -992,6 +1400,9 @@ static const luaL_Reg strlib[] = { {"reverse", str_reverse}, {"sub", str_sub}, {"upper", str_upper}, + {"pack", str_pack}, + {"packsize", str_packsize}, + {"unpack", str_unpack}, {NULL, NULL} }; diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ltable.c b/3rdparty/genie/src/host/lua-5.3.0/src/ltable.c index 5d76f97ec3c..38be00513dc 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ltable.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ltable.c @@ -1,27 +1,32 @@ /* -** $Id: ltable.c,v 2.72.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: ltable.c,v 2.100 2015/01/05 13:52:37 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ +#define ltable_c +#define LUA_CORE + +#include "lprefix.h" + /* ** Implementation of tables (aka arrays, objects, or hash tables). ** Tables keep its elements in two parts: an array part and a hash part. ** Non-negative integer keys are all candidates to be kept in the array -** part. The actual size of the array is the largest `n' such that at +** part. The actual size of the array is the largest 'n' such that at ** least half the slots between 0 and n are in use. ** Hash uses a mix of chained scatter table with Brent's variation. ** A main invariant of these tables is that, if an element is not -** in its main position (i.e. the `original' position that its hash gives +** in its main position (i.e. the 'original' position that its hash gives ** to it), then the colliding element is in its own main position. ** Hence even when the load factor reaches 100%, performance remains good. */ +#include <float.h> +#include <math.h> #include <string.h> - -#define ltable_c -#define LUA_CORE +#include <limits.h> #include "lua.h" @@ -37,21 +42,26 @@ /* -** max size of array part is 2^MAXBITS +** Maximum size of array part (MAXASIZE) is 2^MAXABITS. MAXABITS is +** the largest integer such that MAXASIZE fits in an unsigned int. */ -#if LUAI_BITSINT >= 32 -#define MAXBITS 30 -#else -#define MAXBITS (LUAI_BITSINT-2) -#endif +#define MAXABITS cast_int(sizeof(int) * CHAR_BIT - 1) +#define MAXASIZE (1u << MAXABITS) -#define MAXASIZE (1 << MAXBITS) +/* +** Maximum size of hash part is 2^MAXHBITS. MAXHBITS is the largest +** integer such that 2^MAXHBITS fits in a signed int. (Note that the +** maximum number of elements in a table, 2^MAXABITS + 2^MAXHBITS, still +** fits comfortably in an unsigned int.) +*/ +#define MAXHBITS (MAXABITS - 1) #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) -#define hashstr(t,str) hashpow2(t, (str)->tsv.hash) +#define hashstr(t,str) hashpow2(t, (str)->hash) #define hashboolean(t,p) hashpow2(t, p) +#define hashint(t,i) hashpow2(t, i) /* @@ -61,7 +71,7 @@ #define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) -#define hashpointer(t,p) hashmod(t, IntPoint(p)) +#define hashpointer(t,p) hashmod(t, point2int(p)) #define dummynode (&dummynode_) @@ -70,16 +80,28 @@ static const Node dummynode_ = { {NILCONSTANT}, /* value */ - {{NILCONSTANT, NULL}} /* key */ + {{NILCONSTANT, 0}} /* key */ }; /* -** hash for lua_Numbers +** Checks whether a float has a value representable as a lua_Integer +** (and does the conversion if so) +*/ +static int numisinteger (lua_Number x, lua_Integer *p) { + if ((x) == l_floor(x)) /* integral value? */ + return lua_numbertointeger(x, p); /* try as an integer */ + else return 0; +} + + +/* +** hash for floating-point numbers */ -static Node *hashnum (const Table *t, lua_Number n) { +static Node *hashfloat (const Table *t, lua_Number n) { int i; - luai_hashnum(i, n); + n = l_mathop(frexp)(n, &i) * cast_num(INT_MAX - DBL_MAX_EXP); + i += cast_int(n); if (i < 0) { if (cast(unsigned int, i) == 0u - i) /* use unsigned to avoid overflows */ i = 0; /* handle INT_MIN */ @@ -91,23 +113,25 @@ static Node *hashnum (const Table *t, lua_Number n) { /* -** returns the `main' position of an element in a table (that is, the index +** returns the 'main' position of an element in a table (that is, the index ** of its hash value) */ static Node *mainposition (const Table *t, const TValue *key) { switch (ttype(key)) { - case LUA_TNUMBER: - return hashnum(t, nvalue(key)); + case LUA_TNUMINT: + return hashint(t, ivalue(key)); + case LUA_TNUMFLT: + return hashfloat(t, fltvalue(key)); + case LUA_TSHRSTR: + return hashstr(t, tsvalue(key)); case LUA_TLNGSTR: { - TString *s = rawtsvalue(key); - if (s->tsv.extra == 0) { /* no hash? */ - s->tsv.hash = luaS_hash(getstr(s), s->tsv.len, s->tsv.hash); - s->tsv.extra = 1; /* now it has its hash */ + TString *s = tsvalue(key); + if (s->extra == 0) { /* no hash? */ + s->hash = luaS_hash(getstr(s), s->len, s->hash); + s->extra = 1; /* now it has its hash */ } - return hashstr(t, rawtsvalue(key)); + return hashstr(t, tsvalue(key)); } - case LUA_TSHRSTR: - return hashstr(t, rawtsvalue(key)); case LUA_TBOOLEAN: return hashboolean(t, bvalue(key)); case LUA_TLIGHTUSERDATA: @@ -121,61 +145,61 @@ static Node *mainposition (const Table *t, const TValue *key) { /* -** returns the index for `key' if `key' is an appropriate key to live in -** the array part of the table, -1 otherwise. +** returns the index for 'key' if 'key' is an appropriate key to live in +** the array part of the table, 0 otherwise. */ -static int arrayindex (const TValue *key) { - if (ttisnumber(key)) { - lua_Number n = nvalue(key); - int k; - lua_number2int(k, n); - if (luai_numeq(cast_num(k), n)) - return k; +static unsigned int arrayindex (const TValue *key) { + if (ttisinteger(key)) { + lua_Integer k = ivalue(key); + if (0 < k && (lua_Unsigned)k <= MAXASIZE) + return cast(unsigned int, k); /* 'key' is an appropriate array index */ } - return -1; /* `key' did not match some condition */ + return 0; /* 'key' did not match some condition */ } /* -** returns the index of a `key' for table traversals. First goes all +** returns the index of a 'key' for table traversals. First goes all ** elements in the array part, then elements in the hash part. The -** beginning of a traversal is signaled by -1. +** beginning of a traversal is signaled by 0. */ -static int findindex (lua_State *L, Table *t, StkId key) { - int i; - if (ttisnil(key)) return -1; /* first iteration */ +static unsigned int findindex (lua_State *L, Table *t, StkId key) { + unsigned int i; + if (ttisnil(key)) return 0; /* first iteration */ i = arrayindex(key); - if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ - return i-1; /* yes; that's the index (corrected to C) */ + if (i != 0 && i <= t->sizearray) /* is 'key' inside array part? */ + return i; /* yes; that's the index */ else { + int nx; Node *n = mainposition(t, key); - for (;;) { /* check whether `key' is somewhere in the chain */ - /* key may be dead already, but it is ok to use it in `next' */ + for (;;) { /* check whether 'key' is somewhere in the chain */ + /* key may be dead already, but it is ok to use it in 'next' */ if (luaV_rawequalobj(gkey(n), key) || (ttisdeadkey(gkey(n)) && iscollectable(key) && deadvalue(gkey(n)) == gcvalue(key))) { i = cast_int(n - gnode(t, 0)); /* key index in hash table */ /* hash elements are numbered after array ones */ - return i + t->sizearray; + return (i + 1) + t->sizearray; } - else n = gnext(n); - if (n == NULL) - luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ + nx = gnext(n); + if (nx == 0) + luaG_runerror(L, "invalid key to 'next'"); /* key not found */ + else n += nx; } } } int luaH_next (lua_State *L, Table *t, StkId key) { - int i = findindex(L, t, key); /* find original element */ - for (i++; i < t->sizearray; i++) { /* try first array part */ + unsigned int i = findindex(L, t, key); /* find original element */ + for (; i < t->sizearray; i++) { /* try first array part */ if (!ttisnil(&t->array[i])) { /* a non-nil value? */ - setnvalue(key, cast_num(i+1)); + setivalue(key, i + 1); setobj2s(L, key+1, &t->array[i]); return 1; } } - for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ + for (i -= t->sizearray; cast_int(i) < sizenode(t); i++) { /* hash part */ if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ setobj2s(L, key, gkey(gnode(t, i))); setobj2s(L, key+1, gval(gnode(t, i))); @@ -192,19 +216,24 @@ int luaH_next (lua_State *L, Table *t, StkId key) { ** ============================================================== */ - -static int computesizes (int nums[], int *narray) { +/* +** Compute the optimal size for the array part of table 't'. 'nums' is a +** "count array" where 'nums[i]' is the number of integers in the table +** between 2^(i - 1) + 1 and 2^i. Put in '*narray' the optimal size, and +** return the number of elements that will go to that part. +*/ +static unsigned int computesizes (unsigned int nums[], unsigned int *narray) { int i; - int twotoi; /* 2^i */ - int a = 0; /* number of elements smaller than 2^i */ - int na = 0; /* number of elements to go to array part */ - int n = 0; /* optimal size for array part */ + unsigned int twotoi; /* 2^i */ + unsigned int a = 0; /* number of elements smaller than 2^i */ + unsigned int na = 0; /* number of elements to go to array part */ + unsigned int n = 0; /* optimal size for array part */ for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { if (nums[i] > 0) { a += nums[i]; if (a > twotoi/2) { /* more than half elements present? */ n = twotoi; /* optimal size (till now) */ - na = a; /* all elements smaller than n will go to array part */ + na = a; /* all elements up to 'n' will go to array part */ } } if (a == *narray) break; /* all elements already counted */ @@ -215,9 +244,9 @@ static int computesizes (int nums[], int *narray) { } -static int countint (const TValue *key, int *nums) { - int k = arrayindex(key); - if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ +static int countint (const TValue *key, unsigned int *nums) { + unsigned int k = arrayindex(key); + if (k != 0) { /* is 'key' an appropriate array index? */ nums[luaO_ceillog2(k)]++; /* count as such */ return 1; } @@ -226,20 +255,21 @@ static int countint (const TValue *key, int *nums) { } -static int numusearray (const Table *t, int *nums) { +static unsigned int numusearray (const Table *t, unsigned int *nums) { int lg; - int ttlg; /* 2^lg */ - int ause = 0; /* summation of `nums' */ - int i = 1; /* count to traverse all array keys */ - for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ - int lc = 0; /* counter */ - int lim = ttlg; + unsigned int ttlg; /* 2^lg */ + unsigned int ause = 0; /* summation of 'nums' */ + unsigned int i = 1; /* count to traverse all array keys */ + /* traverse each slice */ + for (lg = 0, ttlg = 1; lg <= MAXABITS; lg++, ttlg *= 2) { + unsigned int lc = 0; /* counter */ + unsigned int lim = ttlg; if (lim > t->sizearray) { lim = t->sizearray; /* adjust upper limit */ if (i > lim) break; /* no more elements to count */ } - /* count elements in range (2^(lg-1), 2^lg] */ + /* count elements in range (2^(lg - 1), 2^lg] */ for (; i <= lim; i++) { if (!ttisnil(&t->array[i-1])) lc++; @@ -251,9 +281,10 @@ static int numusearray (const Table *t, int *nums) { } -static int numusehash (const Table *t, int *nums, int *pnasize) { +static int numusehash (const Table *t, unsigned int *nums, + unsigned int *pnasize) { int totaluse = 0; /* total number of elements */ - int ause = 0; /* summation of `nums' */ + int ause = 0; /* elements added to 'nums' (can go to array part) */ int i = sizenode(t); while (i--) { Node *n = &t->node[i]; @@ -267,8 +298,8 @@ static int numusehash (const Table *t, int *nums, int *pnasize) { } -static void setarrayvector (lua_State *L, Table *t, int size) { - int i; +static void setarrayvector (lua_State *L, Table *t, unsigned int size) { + unsigned int i; luaM_reallocvector(L, t->array, t->sizearray, size, TValue); for (i=t->sizearray; i<size; i++) setnilvalue(&t->array[i]); @@ -276,23 +307,23 @@ static void setarrayvector (lua_State *L, Table *t, int size) { } -static void setnodevector (lua_State *L, Table *t, int size) { +static void setnodevector (lua_State *L, Table *t, unsigned int size) { int lsize; if (size == 0) { /* no elements to hash part? */ - t->node = cast(Node *, dummynode); /* use common `dummynode' */ + t->node = cast(Node *, dummynode); /* use common 'dummynode' */ lsize = 0; } else { int i; lsize = luaO_ceillog2(size); - if (lsize > MAXBITS) + if (lsize > MAXHBITS) luaG_runerror(L, "table overflow"); size = twoto(lsize); t->node = luaM_newvector(L, size, Node); - for (i=0; i<size; i++) { + for (i = 0; i < (int)size; i++) { Node *n = gnode(t, i); - gnext(n) = NULL; - setnilvalue(gkey(n)); + gnext(n) = 0; + setnilvalue(wgkey(n)); setnilvalue(gval(n)); } } @@ -301,9 +332,11 @@ static void setnodevector (lua_State *L, Table *t, int size) { } -void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { - int i; - int oldasize = t->sizearray; +void luaH_resize (lua_State *L, Table *t, unsigned int nasize, + unsigned int nhsize) { + unsigned int i; + int j; + unsigned int oldasize = t->sizearray; int oldhsize = t->lsizenode; Node *nold = t->node; /* save old hash ... */ if (nasize > oldasize) /* array part must grow? */ @@ -321,8 +354,8 @@ void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { luaM_reallocvector(L, t->array, oldasize, nasize, TValue); } /* re-insert elements from hash part */ - for (i = twoto(oldhsize) - 1; i >= 0; i--) { - Node *old = nold+i; + for (j = twoto(oldhsize) - 1; j >= 0; j--) { + Node *old = nold + j; if (!ttisnil(gval(old))) { /* doesn't need barrier/invalidate cache, as entry was already present in the table */ @@ -334,18 +367,20 @@ void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { } -void luaH_resizearray (lua_State *L, Table *t, int nasize) { +void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize) { int nsize = isdummy(t->node) ? 0 : sizenode(t); luaH_resize(L, t, nasize, nsize); } - +/* +** nums[i] = number of keys 'k' where 2^(i - 1) < k <= 2^i +*/ static void rehash (lua_State *L, Table *t, const TValue *ek) { - int nasize, na; - int nums[MAXBITS+1]; /* nums[i] = number of keys with 2^(i-1) < k <= 2^i */ + unsigned int nasize, na; + unsigned int nums[MAXABITS + 1]; int i; int totaluse; - for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ + for (i = 0; i <= MAXABITS; i++) nums[i] = 0; /* reset counts */ nasize = numusearray(t, nums); /* count keys in array part */ totaluse = nasize; /* all those keys are integer keys */ totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ @@ -366,7 +401,8 @@ static void rehash (lua_State *L, Table *t, const TValue *ek) { Table *luaH_new (lua_State *L) { - Table *t = &luaC_newobj(L, LUA_TTABLE, sizeof(Table), NULL, 0)->h; + GCObject *o = luaC_newobj(L, LUA_TTABLE, sizeof(Table)); + Table *t = gco2t(o); t->metatable = NULL; t->flags = cast_byte(~0); t->array = NULL; @@ -404,37 +440,52 @@ static Node *getfreepos (Table *t) { */ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { Node *mp; + TValue aux; if (ttisnil(key)) luaG_runerror(L, "table index is nil"); - else if (ttisnumber(key) && luai_numisnan(L, nvalue(key))) - luaG_runerror(L, "table index is NaN"); + else if (ttisfloat(key)) { + lua_Number n = fltvalue(key); + lua_Integer k; + if (luai_numisnan(n)) + luaG_runerror(L, "table index is NaN"); + if (numisinteger(n, &k)) { /* index is int? */ + setivalue(&aux, k); + key = &aux; /* insert it as an integer */ + } + } mp = mainposition(t, key); if (!ttisnil(gval(mp)) || isdummy(mp)) { /* main position is taken? */ Node *othern; - Node *n = getfreepos(t); /* get a free place */ - if (n == NULL) { /* cannot find a free place? */ + Node *f = getfreepos(t); /* get a free place */ + if (f == NULL) { /* cannot find a free place? */ rehash(L, t, key); /* grow table */ - /* whatever called 'newkey' take care of TM cache and GC barrier */ + /* whatever called 'newkey' takes care of TM cache and GC barrier */ return luaH_set(L, t, key); /* insert key into grown table */ } - lua_assert(!isdummy(n)); + lua_assert(!isdummy(f)); othern = mainposition(t, gkey(mp)); if (othern != mp) { /* is colliding node out of its main position? */ /* yes; move colliding node into free position */ - while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ - gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ - *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ - gnext(mp) = NULL; /* now `mp' is free */ + while (othern + gnext(othern) != mp) /* find previous */ + othern += gnext(othern); + gnext(othern) = cast_int(f - othern); /* rechain to point to 'f' */ + *f = *mp; /* copy colliding node into free pos. (mp->next also goes) */ + if (gnext(mp) != 0) { + gnext(f) += cast_int(mp - f); /* correct 'next' */ + gnext(mp) = 0; /* now 'mp' is free */ + } setnilvalue(gval(mp)); } else { /* colliding node is in its own main position */ /* new node will go into free position */ - gnext(n) = gnext(mp); /* chain new position */ - gnext(mp) = n; - mp = n; + if (gnext(mp) != 0) + gnext(f) = cast_int((mp + gnext(mp)) - f); /* chain new position */ + else lua_assert(gnext(f) == 0); + gnext(mp) = cast_int(f - mp); + mp = f; } } - setobj2t(L, gkey(mp), key); - luaC_barrierback(L, obj2gco(t), key); + setnodekey(L, &mp->i_key, key); + luaC_barrierback(L, t, key); lua_assert(ttisnil(gval(mp))); return gval(mp); } @@ -443,18 +494,21 @@ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { /* ** search function for integers */ -const TValue *luaH_getint (Table *t, int key) { +const TValue *luaH_getint (Table *t, lua_Integer key) { /* (1 <= key && key <= t->sizearray) */ - if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) - return &t->array[key-1]; + if (l_castS2U(key - 1) < t->sizearray) + return &t->array[key - 1]; else { - lua_Number nk = cast_num(key); - Node *n = hashnum(t, nk); - do { /* check whether `key' is somewhere in the chain */ - if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) + Node *n = hashint(t, key); + for (;;) { /* check whether 'key' is somewhere in the chain */ + if (ttisinteger(gkey(n)) && ivalue(gkey(n)) == key) return gval(n); /* that's it */ - else n = gnext(n); - } while (n); + else { + int nx = gnext(n); + if (nx == 0) break; + n += nx; + } + }; return luaO_nilobject; } } @@ -465,12 +519,17 @@ const TValue *luaH_getint (Table *t, int key) { */ const TValue *luaH_getstr (Table *t, TString *key) { Node *n = hashstr(t, key); - lua_assert(key->tsv.tt == LUA_TSHRSTR); - do { /* check whether `key' is somewhere in the chain */ - if (ttisshrstring(gkey(n)) && eqshrstr(rawtsvalue(gkey(n)), key)) + lua_assert(key->tt == LUA_TSHRSTR); + for (;;) { /* check whether 'key' is somewhere in the chain */ + const TValue *k = gkey(n); + if (ttisshrstring(k) && eqshrstr(tsvalue(k), key)) return gval(n); /* that's it */ - else n = gnext(n); - } while (n); + else { + int nx = gnext(n); + if (nx == 0) break; + n += nx; + } + }; return luaO_nilobject; } @@ -480,23 +539,26 @@ const TValue *luaH_getstr (Table *t, TString *key) { */ const TValue *luaH_get (Table *t, const TValue *key) { switch (ttype(key)) { - case LUA_TSHRSTR: return luaH_getstr(t, rawtsvalue(key)); + case LUA_TSHRSTR: return luaH_getstr(t, tsvalue(key)); + case LUA_TNUMINT: return luaH_getint(t, ivalue(key)); case LUA_TNIL: return luaO_nilobject; - case LUA_TNUMBER: { - int k; - lua_Number n = nvalue(key); - lua_number2int(k, n); - if (luai_numeq(cast_num(k), n)) /* index is int? */ + case LUA_TNUMFLT: { + lua_Integer k; + if (numisinteger(fltvalue(key), &k)) /* index is int? */ return luaH_getint(t, k); /* use specialized version */ /* else go through */ } default: { Node *n = mainposition(t, key); - do { /* check whether `key' is somewhere in the chain */ + for (;;) { /* check whether 'key' is somewhere in the chain */ if (luaV_rawequalobj(gkey(n), key)) return gval(n); /* that's it */ - else n = gnext(n); - } while (n); + else { + int nx = gnext(n); + if (nx == 0) break; + n += nx; + } + }; return luaO_nilobject; } } @@ -515,14 +577,14 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { } -void luaH_setint (lua_State *L, Table *t, int key, TValue *value) { +void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) { const TValue *p = luaH_getint(t, key); TValue *cell; if (p != luaO_nilobject) cell = cast(TValue *, p); else { TValue k; - setnvalue(&k, cast_num(key)); + setivalue(&k, key); cell = luaH_newkey(L, t, &k); } setobj2t(L, cell, value); @@ -532,16 +594,16 @@ void luaH_setint (lua_State *L, Table *t, int key, TValue *value) { static int unbound_search (Table *t, unsigned int j) { unsigned int i = j; /* i is zero or a present index */ j++; - /* find `i' and `j' such that i is present and j is not */ + /* find 'i' and 'j' such that i is present and j is not */ while (!ttisnil(luaH_getint(t, j))) { i = j; - j *= 2; - if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ + if (j > cast(unsigned int, MAX_INT)/2) { /* overflow? */ /* table was built with bad purposes: resort to linear search */ i = 1; while (!ttisnil(luaH_getint(t, i))) i++; return i - 1; } + j *= 2; } /* now do a binary search between them */ while (j - i > 1) { @@ -554,7 +616,7 @@ static int unbound_search (Table *t, unsigned int j) { /* -** Try to find a boundary in table `t'. A `boundary' is an integer index +** Try to find a boundary in table 't'. A 'boundary' is an integer index ** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). */ int luaH_getn (Table *t) { diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ltable.h b/3rdparty/genie/src/host/lua-5.3.0/src/ltable.h index d69449b2b86..53d25511ad4 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ltable.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 2.16.1.2 2013/08/30 15:49:41 roberto Exp $ +** $Id: ltable.h,v 2.20 2014/09/04 18:15:29 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -11,26 +11,34 @@ #define gnode(t,i) (&(t)->node[i]) -#define gkey(n) (&(n)->i_key.tvk) #define gval(n) (&(n)->i_val) #define gnext(n) ((n)->i_key.nk.next) + +/* 'const' to avoid wrong writings that can mess up field 'next' */ +#define gkey(n) cast(const TValue*, (&(n)->i_key.tvk)) + +#define wgkey(n) (&(n)->i_key.nk) + #define invalidateTMcache(t) ((t)->flags = 0) + /* returns the key, given the value of a table entry */ #define keyfromval(v) \ (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) -LUAI_FUNC const TValue *luaH_getint (Table *t, int key); -LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value); +LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); +LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, + TValue *value); LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); LUAI_FUNC Table *luaH_new (lua_State *L); -LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize); -LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); +LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, + unsigned int nhsize); +LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); LUAI_FUNC void luaH_free (lua_State *L, Table *t); LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); LUAI_FUNC int luaH_getn (Table *t); diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/ltablib.c b/3rdparty/genie/src/host/lua-5.3.0/src/ltablib.c new file mode 100644 index 00000000000..8f78afb7f25 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ltablib.c @@ -0,0 +1,357 @@ +/* +** $Id: ltablib.c,v 1.79 2014/11/02 19:19:04 roberto Exp $ +** Library for Table Manipulation +** See Copyright Notice in lua.h +*/ + +#define ltablib_c +#define LUA_LIB + +#include "lprefix.h" + + +#include <limits.h> +#include <stddef.h> + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + +/* +** Structure with table-access functions +*/ +typedef struct { + int (*geti) (lua_State *L, int idx, lua_Integer n); + void (*seti) (lua_State *L, int idx, lua_Integer n); +} TabA; + + +/* +** Check that 'arg' has a table and set access functions in 'ta' to raw +** or non-raw according to the presence of corresponding metamethods. +*/ +static void checktab (lua_State *L, int arg, TabA *ta) { + ta->geti = NULL; ta->seti = NULL; + if (lua_getmetatable(L, arg)) { + lua_pushliteral(L, "__index"); /* 'index' metamethod */ + if (lua_rawget(L, -2) != LUA_TNIL) + ta->geti = lua_geti; + lua_pushliteral(L, "__newindex"); /* 'newindex' metamethod */ + if (lua_rawget(L, -3) != LUA_TNIL) + ta->seti = lua_seti; + lua_pop(L, 3); /* pop metatable plus both metamethods */ + } + if (ta->geti == NULL || ta->seti == NULL) { + luaL_checktype(L, arg, LUA_TTABLE); /* must be table for raw methods */ + if (ta->geti == NULL) ta->geti = lua_rawgeti; + if (ta->seti == NULL) ta->seti = lua_rawseti; + } +} + + +#define aux_getn(L,n,ta) (checktab(L, n, ta), luaL_len(L, n)) + + +#if defined(LUA_COMPAT_MAXN) +static int maxn (lua_State *L) { + lua_Number max = 0; + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushnil(L); /* first key */ + while (lua_next(L, 1)) { + lua_pop(L, 1); /* remove value */ + if (lua_type(L, -1) == LUA_TNUMBER) { + lua_Number v = lua_tonumber(L, -1); + if (v > max) max = v; + } + } + lua_pushnumber(L, max); + return 1; +} +#endif + + +static int tinsert (lua_State *L) { + TabA ta; + lua_Integer e = aux_getn(L, 1, &ta) + 1; /* first empty element */ + lua_Integer pos; /* where to insert new element */ + switch (lua_gettop(L)) { + case 2: { /* called with only 2 arguments */ + pos = e; /* insert new element at the end */ + break; + } + case 3: { + lua_Integer i; + pos = luaL_checkinteger(L, 2); /* 2nd argument is the position */ + luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds"); + for (i = e; i > pos; i--) { /* move up elements */ + (*ta.geti)(L, 1, i - 1); + (*ta.seti)(L, 1, i); /* t[i] = t[i - 1] */ + } + break; + } + default: { + return luaL_error(L, "wrong number of arguments to 'insert'"); + } + } + (*ta.seti)(L, 1, pos); /* t[pos] = v */ + return 0; +} + + +static int tremove (lua_State *L) { + TabA ta; + lua_Integer size = aux_getn(L, 1, &ta); + lua_Integer pos = luaL_optinteger(L, 2, size); + if (pos != size) /* validate 'pos' if given */ + luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds"); + (*ta.geti)(L, 1, pos); /* result = t[pos] */ + for ( ; pos < size; pos++) { + (*ta.geti)(L, 1, pos + 1); + (*ta.seti)(L, 1, pos); /* t[pos] = t[pos + 1] */ + } + lua_pushnil(L); + (*ta.seti)(L, 1, pos); /* t[pos] = nil */ + return 1; +} + + +static int tmove (lua_State *L) { + TabA ta; + lua_Integer f = luaL_checkinteger(L, 2); + lua_Integer e = luaL_checkinteger(L, 3); + lua_Integer t = luaL_checkinteger(L, 4); + int tt = !lua_isnoneornil(L, 5) ? 5 : 1; /* destination table */ + /* the following restriction avoids several problems with overflows */ + luaL_argcheck(L, f > 0, 2, "initial position must be positive"); + if (e >= f) { /* otherwise, nothing to move */ + lua_Integer n, i; + ta.geti = (luaL_getmetafield(L, 1, "__index") == LUA_TNIL) + ? (luaL_checktype(L, 1, LUA_TTABLE), lua_rawgeti) + : lua_geti; + ta.seti = (luaL_getmetafield(L, tt, "__newindex") == LUA_TNIL) + ? (luaL_checktype(L, tt, LUA_TTABLE), lua_rawseti) + : lua_seti; + n = e - f + 1; /* number of elements to move */ + if (t > f) { + for (i = n - 1; i >= 0; i--) { + (*ta.geti)(L, 1, f + i); + (*ta.seti)(L, tt, t + i); + } + } + else { + for (i = 0; i < n; i++) { + (*ta.geti)(L, 1, f + i); + (*ta.seti)(L, tt, t + i); + } + } + } + lua_pushvalue(L, tt); /* return "to table" */ + return 1; +} + + +static void addfield (lua_State *L, luaL_Buffer *b, TabA *ta, lua_Integer i) { + (*ta->geti)(L, 1, i); + if (!lua_isstring(L, -1)) + luaL_error(L, "invalid value (%s) at index %d in table for 'concat'", + luaL_typename(L, -1), i); + luaL_addvalue(b); +} + + +static int tconcat (lua_State *L) { + TabA ta; + luaL_Buffer b; + size_t lsep; + lua_Integer i, last; + const char *sep = luaL_optlstring(L, 2, "", &lsep); + checktab(L, 1, &ta); + i = luaL_optinteger(L, 3, 1); + last = luaL_opt(L, luaL_checkinteger, 4, luaL_len(L, 1)); + luaL_buffinit(L, &b); + for (; i < last; i++) { + addfield(L, &b, &ta, i); + luaL_addlstring(&b, sep, lsep); + } + if (i == last) /* add last value (if interval was not empty) */ + addfield(L, &b, &ta, i); + luaL_pushresult(&b); + return 1; +} + + +/* +** {====================================================== +** Pack/unpack +** ======================================================= +*/ + +static int pack (lua_State *L) { + int i; + int n = lua_gettop(L); /* number of elements to pack */ + lua_createtable(L, n, 1); /* create result table */ + lua_insert(L, 1); /* put it at index 1 */ + for (i = n; i >= 1; i--) /* assign elements */ + lua_rawseti(L, 1, i); + lua_pushinteger(L, n); + lua_setfield(L, 1, "n"); /* t.n = number of elements */ + return 1; /* return table */ +} + + +static int unpack (lua_State *L) { + TabA ta; + lua_Integer i, e; + lua_Unsigned n; + checktab(L, 1, &ta); + i = luaL_optinteger(L, 2, 1); + e = luaL_opt(L, luaL_checkinteger, 3, luaL_len(L, 1)); + if (i > e) return 0; /* empty range */ + n = (lua_Unsigned)e - i; /* number of elements minus 1 (avoid overflows) */ + if (n >= (unsigned int)INT_MAX || !lua_checkstack(L, (int)(++n))) + return luaL_error(L, "too many results to unpack"); + do { /* must have at least one element */ + (*ta.geti)(L, 1, i); /* push arg[i..e] */ + } while (i++ < e); + + return (int)n; +} + +/* }====================================================== */ + + + +/* +** {====================================================== +** Quicksort +** (based on 'Algorithms in MODULA-3', Robert Sedgewick; +** Addison-Wesley, 1993.) +** ======================================================= +*/ + + +static void set2 (lua_State *L, TabA *ta, int i, int j) { + (*ta->seti)(L, 1, i); + (*ta->seti)(L, 1, j); +} + +static int sort_comp (lua_State *L, int a, int b) { + if (!lua_isnil(L, 2)) { /* function? */ + int res; + lua_pushvalue(L, 2); + lua_pushvalue(L, a-1); /* -1 to compensate function */ + lua_pushvalue(L, b-2); /* -2 to compensate function and 'a' */ + lua_call(L, 2, 1); + res = lua_toboolean(L, -1); + lua_pop(L, 1); + return res; + } + else /* a < b? */ + return lua_compare(L, a, b, LUA_OPLT); +} + +static void auxsort (lua_State *L, TabA *ta, int l, int u) { + while (l < u) { /* for tail recursion */ + int i, j; + /* sort elements a[l], a[(l+u)/2] and a[u] */ + (*ta->geti)(L, 1, l); + (*ta->geti)(L, 1, u); + if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */ + set2(L, ta, l, u); /* swap a[l] - a[u] */ + else + lua_pop(L, 2); + if (u-l == 1) break; /* only 2 elements */ + i = (l+u)/2; + (*ta->geti)(L, 1, i); + (*ta->geti)(L, 1, l); + if (sort_comp(L, -2, -1)) /* a[i]<a[l]? */ + set2(L, ta, i, l); + else { + lua_pop(L, 1); /* remove a[l] */ + (*ta->geti)(L, 1, u); + if (sort_comp(L, -1, -2)) /* a[u]<a[i]? */ + set2(L, ta, i, u); + else + lua_pop(L, 2); + } + if (u-l == 2) break; /* only 3 elements */ + (*ta->geti)(L, 1, i); /* Pivot */ + lua_pushvalue(L, -1); + (*ta->geti)(L, 1, u-1); + set2(L, ta, i, u-1); + /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */ + i = l; j = u-1; + for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */ + /* repeat ++i until a[i] >= P */ + while ((*ta->geti)(L, 1, ++i), sort_comp(L, -1, -2)) { + if (i>=u) luaL_error(L, "invalid order function for sorting"); + lua_pop(L, 1); /* remove a[i] */ + } + /* repeat --j until a[j] <= P */ + while ((*ta->geti)(L, 1, --j), sort_comp(L, -3, -1)) { + if (j<=l) luaL_error(L, "invalid order function for sorting"); + lua_pop(L, 1); /* remove a[j] */ + } + if (j<i) { + lua_pop(L, 3); /* pop pivot, a[i], a[j] */ + break; + } + set2(L, ta, i, j); + } + (*ta->geti)(L, 1, u-1); + (*ta->geti)(L, 1, i); + set2(L, ta, u-1, i); /* swap pivot (a[u-1]) with a[i] */ + /* a[l..i-1] <= a[i] == P <= a[i+1..u] */ + /* adjust so that smaller half is in [j..i] and larger one in [l..u] */ + if (i-l < u-i) { + j=l; i=i-1; l=i+2; + } + else { + j=i+1; i=u; u=j-2; + } + auxsort(L, ta, j, i); /* call recursively the smaller one */ + } /* repeat the routine for the larger one */ +} + +static int sort (lua_State *L) { + TabA ta; + int n = (int)aux_getn(L, 1, &ta); + luaL_checkstack(L, 50, ""); /* assume array is smaller than 2^50 */ + if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ + luaL_checktype(L, 2, LUA_TFUNCTION); + lua_settop(L, 2); /* make sure there are two arguments */ + auxsort(L, &ta, 1, n); + return 0; +} + +/* }====================================================== */ + + +static const luaL_Reg tab_funcs[] = { + {"concat", tconcat}, +#if defined(LUA_COMPAT_MAXN) + {"maxn", maxn}, +#endif + {"insert", tinsert}, + {"pack", pack}, + {"unpack", unpack}, + {"remove", tremove}, + {"move", tmove}, + {"sort", sort}, + {NULL, NULL} +}; + + +LUAMOD_API int luaopen_table (lua_State *L) { + luaL_newlib(L, tab_funcs); +#if defined(LUA_COMPAT_UNPACK) + /* _G.unpack = table.unpack */ + lua_getfield(L, -1, "unpack"); + lua_setglobal(L, "unpack"); +#endif + return 1; +} + diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/ltm.c b/3rdparty/genie/src/host/lua-5.3.0/src/ltm.c new file mode 100644 index 00000000000..25b46b17f90 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ltm.c @@ -0,0 +1,143 @@ +/* +** $Id: ltm.c,v 2.33 2014/11/21 12:15:57 roberto Exp $ +** Tag methods +** See Copyright Notice in lua.h +*/ + +#define ltm_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <string.h> + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lvm.h" + + +static const char udatatypename[] = "userdata"; + +LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = { + "no value", + "nil", "boolean", udatatypename, "number", + "string", "table", "function", udatatypename, "thread", + "proto" /* this last case is used for tests only */ +}; + + +void luaT_init (lua_State *L) { + static const char *const luaT_eventname[] = { /* ORDER TM */ + "__index", "__newindex", + "__gc", "__mode", "__len", "__eq", + "__add", "__sub", "__mul", "__mod", "__pow", + "__div", "__idiv", + "__band", "__bor", "__bxor", "__shl", "__shr", + "__unm", "__bnot", "__lt", "__le", + "__concat", "__call" + }; + int i; + for (i=0; i<TM_N; i++) { + G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); + luaC_fix(L, obj2gco(G(L)->tmname[i])); /* never collect these names */ + } +} + + +/* +** function to be used with macro "fasttm": optimized for absence of +** tag methods +*/ +const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { + const TValue *tm = luaH_getstr(events, ename); + lua_assert(event <= TM_EQ); + if (ttisnil(tm)) { /* no tag method? */ + events->flags |= cast_byte(1u<<event); /* cache this fact */ + return NULL; + } + else return tm; +} + + +const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { + Table *mt; + switch (ttnov(o)) { + case LUA_TTABLE: + mt = hvalue(o)->metatable; + break; + case LUA_TUSERDATA: + mt = uvalue(o)->metatable; + break; + default: + mt = G(L)->mt[ttnov(o)]; + } + return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); +} + + +void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, + const TValue *p2, TValue *p3, int hasres) { + ptrdiff_t result = savestack(L, p3); + setobj2s(L, L->top++, f); /* push function (assume EXTRA_STACK) */ + setobj2s(L, L->top++, p1); /* 1st argument */ + setobj2s(L, L->top++, p2); /* 2nd argument */ + if (!hasres) /* no result? 'p3' is third argument */ + setobj2s(L, L->top++, p3); /* 3rd argument */ + /* metamethod may yield only when called from Lua code */ + luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); + if (hasres) { /* if has result, move it to its place */ + p3 = restorestack(L, result); + setobjs2s(L, p3, --L->top); + } +} + + +int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, TMS event) { + const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ + if (ttisnil(tm)) + tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ + if (ttisnil(tm)) return 0; + luaT_callTM(L, tm, p1, p2, res, 1); + return 1; +} + + +void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, TMS event) { + if (!luaT_callbinTM(L, p1, p2, res, event)) { + switch (event) { + case TM_CONCAT: + luaG_concaterror(L, p1, p2); + case TM_BAND: case TM_BOR: case TM_BXOR: + case TM_SHL: case TM_SHR: case TM_BNOT: { + lua_Number dummy; + if (tonumber(p1, &dummy) && tonumber(p2, &dummy)) + luaG_tointerror(L, p1, p2); + else + luaG_opinterror(L, p1, p2, "perform bitwise operation on"); + /* else go through */ + } + default: + luaG_opinterror(L, p1, p2, "perform arithmetic on"); + } + } +} + + +int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, + TMS event) { + if (!luaT_callbinTM(L, p1, p2, L->top, event)) + return -1; /* no metamethod */ + else + return !l_isfalse(L->top); +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/ltm.h b/3rdparty/genie/src/host/lua-5.3.0/src/ltm.h index 7f89c841f9c..180179ce038 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/ltm.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/ltm.h @@ -1,5 +1,5 @@ /* -** $Id: ltm.h,v 2.11.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: ltm.h,v 2.21 2014/10/25 11:50:46 roberto Exp $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -13,7 +13,7 @@ /* * WARNING: if you change the order of this enumeration, -* grep "ORDER TM" +* grep "ORDER TM" and "ORDER OP" */ typedef enum { TM_INDEX, @@ -21,14 +21,21 @@ typedef enum { TM_GC, TM_MODE, TM_LEN, - TM_EQ, /* last tag method with `fast' access */ + TM_EQ, /* last tag method with fast access */ TM_ADD, TM_SUB, TM_MUL, - TM_DIV, TM_MOD, TM_POW, + TM_DIV, + TM_IDIV, + TM_BAND, + TM_BOR, + TM_BXOR, + TM_SHL, + TM_SHR, TM_UNM, + TM_BNOT, TM_LT, TM_LE, TM_CONCAT, @@ -44,7 +51,7 @@ typedef enum { #define fasttm(l,et,e) gfasttm(G(l), et, e) #define ttypename(x) luaT_typenames_[(x) + 1] -#define objtypename(x) ttypename(ttypenv(x)) +#define objtypename(x) ttypename(ttnov(x)) LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; @@ -54,4 +61,15 @@ LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event); LUAI_FUNC void luaT_init (lua_State *L); +LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, + const TValue *p2, TValue *p3, int hasres); +LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, TMS event); +LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, TMS event); +LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, + const TValue *p2, TMS event); + + + #endif diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lua.c b/3rdparty/genie/src/host/lua-5.3.0/src/lua.c new file mode 100644 index 00000000000..34a3900a794 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lua.c @@ -0,0 +1,611 @@ +/* +** $Id: lua.c,v 1.222 2014/11/11 19:41:27 roberto Exp $ +** Lua stand-alone interpreter +** See Copyright Notice in lua.h +*/ + +#define lua_c + +#include "lprefix.h" + + +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#if !defined(LUA_PROMPT) +#define LUA_PROMPT "> " +#define LUA_PROMPT2 ">> " +#endif + +#if !defined(LUA_PROGNAME) +#define LUA_PROGNAME "lua" +#endif + +#if !defined(LUA_MAXINPUT) +#define LUA_MAXINPUT 512 +#endif + +#if !defined(LUA_INIT_VAR) +#define LUA_INIT_VAR "LUA_INIT" +#endif + +#define LUA_INITVARVERSION \ + LUA_INIT_VAR "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR + + +/* +** lua_stdin_is_tty detects whether the standard input is a 'tty' (that +** is, whether we're running lua interactively). +*/ +#if !defined(lua_stdin_is_tty) /* { */ + +#if defined(LUA_USE_POSIX) /* { */ + +#include <unistd.h> +#define lua_stdin_is_tty() isatty(0) + +#elif defined(LUA_USE_WINDOWS) /* }{ */ + +#include <io.h> +#define lua_stdin_is_tty() _isatty(_fileno(stdin)) + +#else /* }{ */ + +/* ISO C definition */ +#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ + +#endif /* } */ + +#endif /* } */ + + +/* +** lua_readline defines how to show a prompt and then read a line from +** the standard input. +** lua_saveline defines how to "save" a read line in a "history". +** lua_freeline defines how to free a line read by lua_readline. +*/ +#if !defined(lua_readline) /* { */ + +#if defined(LUA_USE_READLINE) /* { */ + +#include <readline/readline.h> +#include <readline/history.h> +#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) +#define lua_saveline(L,idx) \ + if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \ + add_history(lua_tostring(L, idx)); /* add it to history */ +#define lua_freeline(L,b) ((void)L, free(b)) + +#else /* }{ */ + +#define lua_readline(L,b,p) \ + ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ + fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ +#define lua_saveline(L,idx) { (void)L; (void)idx; } +#define lua_freeline(L,b) { (void)L; (void)b; } + +#endif /* } */ + +#endif /* } */ + + + + +static lua_State *globalL = NULL; + +static const char *progname = LUA_PROGNAME; + + +/* +** Hook set by signal function to stop the interpreter. +*/ +static void lstop (lua_State *L, lua_Debug *ar) { + (void)ar; /* unused arg. */ + lua_sethook(L, NULL, 0, 0); /* reset hook */ + luaL_error(L, "interrupted!"); +} + + +/* +** Function to be called at a C signal. Because a C signal cannot +** just change a Lua state (as there is no proper synchronization), +** this function only sets a hook that, when called, will stop the +** interpreter. +*/ +static void laction (int i) { + signal(i, SIG_DFL); /* if another SIGINT happens, terminate process */ + lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); +} + + +static void print_usage (const char *badoption) { + lua_writestringerror("%s: ", progname); + if (badoption[1] == 'e' || badoption[1] == 'l') + lua_writestringerror("'%s' needs argument\n", badoption); + else + lua_writestringerror("unrecognized option '%s'\n", badoption); + lua_writestringerror( + "usage: %s [options] [script [args]]\n" + "Available options are:\n" + " -e stat execute string 'stat'\n" + " -i enter interactive mode after executing 'script'\n" + " -l name require library 'name'\n" + " -v show version information\n" + " -E ignore environment variables\n" + " -- stop handling options\n" + " - stop handling options and execute stdin\n" + , + progname); +} + + +/* +** Prints an error message, adding the program name in front of it +** (if present) +*/ +static void l_message (const char *pname, const char *msg) { + if (pname) lua_writestringerror("%s: ", pname); + lua_writestringerror("%s\n", msg); +} + + +/* +** Check whether 'status' is not OK and, if so, prints the error +** message on the top of the stack. It assumes that the error object +** is a string, as it was either generated by Lua or by 'msghandler'. +*/ +static int report (lua_State *L, int status) { + if (status != LUA_OK) { + const char *msg = lua_tostring(L, -1); + l_message(progname, msg); + lua_pop(L, 1); /* remove message */ + } + return status; +} + + +/* +** Message handler used to run all chunks +*/ +static int msghandler (lua_State *L) { + const char *msg = lua_tostring(L, 1); + if (msg == NULL) { /* is error object not a string? */ + if (luaL_callmeta(L, 1, "__tostring") && /* does it have a metamethod */ + lua_type(L, -1) == LUA_TSTRING) /* that produces a string? */ + return 1; /* that is the message */ + else + msg = lua_pushfstring(L, "(error object is a %s value)", + luaL_typename(L, 1)); + } + luaL_traceback(L, L, msg, 1); /* append a standard traceback */ + return 1; /* return the traceback */ +} + + +/* +** Interface to 'lua_pcall', which sets appropriate message function +** and C-signal handler. Used to run all chunks. +*/ +static int docall (lua_State *L, int narg, int nres) { + int status; + int base = lua_gettop(L) - narg; /* function index */ + lua_pushcfunction(L, msghandler); /* push message handler */ + lua_insert(L, base); /* put it under function and args */ + globalL = L; /* to be available to 'laction' */ + signal(SIGINT, laction); /* set C-signal handler */ + status = lua_pcall(L, narg, nres, base); + signal(SIGINT, SIG_DFL); /* reset C-signal handler */ + lua_remove(L, base); /* remove message handler from the stack */ + return status; +} + + +static void print_version (void) { + lua_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); + lua_writeline(); +} + + +/* +** Create the 'arg' table, which stores all arguments from the +** command line ('argv'). It should be aligned so that, at index 0, +** it has 'argv[script]', which is the script name. The arguments +** to the script (everything after 'script') go to positive indices; +** other arguments (before the script name) go to negative indices. +** If there is no script name, assume interpreter's name as base. +*/ +static void createargtable (lua_State *L, char **argv, int argc, int script) { + int i, narg; + if (script == argc) script = 0; /* no script name? */ + narg = argc - (script + 1); /* number of positive indices */ + lua_createtable(L, narg, script + 1); + for (i = 0; i < argc; i++) { + lua_pushstring(L, argv[i]); + lua_rawseti(L, -2, i - script); + } + lua_setglobal(L, "arg"); +} + + +static int dochunk (lua_State *L, int status) { + if (status == LUA_OK) status = docall(L, 0, 0); + return report(L, status); +} + + +static int dofile (lua_State *L, const char *name) { + return dochunk(L, luaL_loadfile(L, name)); +} + + +static int dostring (lua_State *L, const char *s, const char *name) { + return dochunk(L, luaL_loadbuffer(L, s, strlen(s), name)); +} + + +/* +** Calls 'require(name)' and stores the result in a global variable +** with the given name. +*/ +static int dolibrary (lua_State *L, const char *name) { + int status; + lua_getglobal(L, "require"); + lua_pushstring(L, name); + status = docall(L, 1, 1); /* call 'require(name)' */ + if (status == LUA_OK) + lua_setglobal(L, name); /* global[name] = require return */ + return report(L, status); +} + + +/* +** Returns the string to be used as a prompt by the interpreter. +*/ +static const char *get_prompt (lua_State *L, int firstline) { + const char *p; + lua_getglobal(L, firstline ? "_PROMPT" : "_PROMPT2"); + p = lua_tostring(L, -1); + if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); + return p; +} + +/* mark in error messages for incomplete statements */ +#define EOFMARK "<eof>" +#define marklen (sizeof(EOFMARK)/sizeof(char) - 1) + + +/* +** Check whether 'status' signals a syntax error and the error +** message at the top of the stack ends with the above mark for +** incomplete statements. +*/ +static int incomplete (lua_State *L, int status) { + if (status == LUA_ERRSYNTAX) { + size_t lmsg; + const char *msg = lua_tolstring(L, -1, &lmsg); + if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) { + lua_pop(L, 1); + return 1; + } + } + return 0; /* else... */ +} + + +/* +** Prompt the user, read a line, and push it into the Lua stack. +*/ +static int pushline (lua_State *L, int firstline) { + char buffer[LUA_MAXINPUT]; + char *b = buffer; + size_t l; + const char *prmt = get_prompt(L, firstline); + int readstatus = lua_readline(L, b, prmt); + if (readstatus == 0) + return 0; /* no input (prompt will be popped by caller) */ + lua_pop(L, 1); /* remove prompt */ + l = strlen(b); + if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ + b[l-1] = '\0'; /* remove it */ + if (firstline && b[0] == '=') /* for compatibility with 5.2, ... */ + lua_pushfstring(L, "return %s", b + 1); /* change '=' to 'return' */ + else + lua_pushstring(L, b); + lua_freeline(L, b); + return 1; +} + + +/* +** Try to compile line on the stack as 'return <line>'; on return, stack +** has either compiled chunk or original line (if compilation failed). +*/ +static int addreturn (lua_State *L) { + int status; + size_t len; const char *line; + lua_pushliteral(L, "return "); + lua_pushvalue(L, -2); /* duplicate line */ + lua_concat(L, 2); /* new line is "return ..." */ + line = lua_tolstring(L, -1, &len); + if ((status = luaL_loadbuffer(L, line, len, "=stdin")) == LUA_OK) + lua_remove(L, -3); /* remove original line */ + else + lua_pop(L, 2); /* remove result from 'luaL_loadbuffer' and new line */ + return status; +} + + +/* +** Read multiple lines until a complete Lua statement +*/ +static int multiline (lua_State *L) { + for (;;) { /* repeat until gets a complete statement */ + size_t len; + const char *line = lua_tolstring(L, 1, &len); /* get what it has */ + int status = luaL_loadbuffer(L, line, len, "=stdin"); /* try it */ + if (!incomplete(L, status) || !pushline(L, 0)) + return status; /* cannot or should not try to add continuation line */ + lua_pushliteral(L, "\n"); /* add newline... */ + lua_insert(L, -2); /* ...between the two lines */ + lua_concat(L, 3); /* join them */ + } +} + + +/* +** Read a line and try to load (compile) it first as an expression (by +** adding "return " in front of it) and second as a statement. Return +** the final status of load/call with the resulting function (if any) +** in the top of the stack. +*/ +static int loadline (lua_State *L) { + int status; + lua_settop(L, 0); + if (!pushline(L, 1)) + return -1; /* no input */ + if ((status = addreturn(L)) != LUA_OK) /* 'return ...' did not work? */ + status = multiline(L); /* try as command, maybe with continuation lines */ + lua_saveline(L, 1); /* keep history */ + lua_remove(L, 1); /* remove line from the stack */ + lua_assert(lua_gettop(L) == 1); + return status; +} + + +/* +** Prints (calling the Lua 'print' function) any values on the stack +*/ +static void l_print (lua_State *L) { + int n = lua_gettop(L); + if (n > 0) { /* any result to be printed? */ + luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); + lua_getglobal(L, "print"); + lua_insert(L, 1); + if (lua_pcall(L, n, 0, 0) != LUA_OK) + l_message(progname, lua_pushfstring(L, "error calling 'print' (%s)", + lua_tostring(L, -1))); + } +} + + +/* +** Do the REPL: repeatedly read (load) a line, evaluate (call) it, and +** print any results. +*/ +static void doREPL (lua_State *L) { + int status; + const char *oldprogname = progname; + progname = NULL; /* no 'progname' on errors in interactive mode */ + while ((status = loadline(L)) != -1) { + if (status == LUA_OK) + status = docall(L, 0, LUA_MULTRET); + if (status == LUA_OK) l_print(L); + else report(L, status); + } + lua_settop(L, 0); /* clear stack */ + lua_writeline(); + progname = oldprogname; +} + + +/* +** Push on the stack the contents of table 'arg' from 1 to #arg +*/ +static int pushargs (lua_State *L) { + int i, n; + if (lua_getglobal(L, "arg") != LUA_TTABLE) + luaL_error(L, "'arg' is not a table"); + n = (int)luaL_len(L, -1); + luaL_checkstack(L, n + 3, "too many arguments to script"); + for (i = 1; i <= n; i++) + lua_rawgeti(L, -i, i); + lua_remove(L, -i); /* remove table from the stack */ + return n; +} + + +static int handle_script (lua_State *L, char **argv) { + int status; + const char *fname = argv[0]; + if (strcmp(fname, "-") == 0 && strcmp(argv[-1], "--") != 0) + fname = NULL; /* stdin */ + status = luaL_loadfile(L, fname); + if (status == LUA_OK) { + int n = pushargs(L); /* push arguments to script */ + status = docall(L, n, LUA_MULTRET); + } + return report(L, status); +} + + + +/* bits of various argument indicators in 'args' */ +#define has_error 1 /* bad option */ +#define has_i 2 /* -i */ +#define has_v 4 /* -v */ +#define has_e 8 /* -e */ +#define has_E 16 /* -E */ + +/* +** Traverses all arguments from 'argv', returning a mask with those +** needed before running any Lua code (or an error code if it finds +** any invalid argument). 'first' returns the first not-handled argument +** (either the script name or a bad argument in case of error). +*/ +static int collectargs (char **argv, int *first) { + int args = 0; + int i; + for (i = 1; argv[i] != NULL; i++) { + *first = i; + if (argv[i][0] != '-') /* not an option? */ + return args; /* stop handling options */ + switch (argv[i][1]) { /* else check option */ + case '-': /* '--' */ + if (argv[i][2] != '\0') /* extra characters after '--'? */ + return has_error; /* invalid option */ + *first = i + 1; + return args; + case '\0': /* '-' */ + return args; /* script "name" is '-' */ + case 'E': + if (argv[i][2] != '\0') /* extra characters after 1st? */ + return has_error; /* invalid option */ + args |= has_E; + break; + case 'i': + args |= has_i; /* goes through (-i implies -v) */ + case 'v': + if (argv[i][2] != '\0') /* extra characters after 1st? */ + return has_error; /* invalid option */ + args |= has_v; + break; + case 'e': + args |= has_e; /* go through */ + case 'l': /* both options need an argument */ + if (argv[i][2] == '\0') { /* no concatenated argument? */ + i++; /* try next 'argv' */ + if (argv[i] == NULL || argv[i][0] == '-') + return has_error; /* no next argument or it is another option */ + } + break; + default: /* invalid option */ + return has_error; + } + } + *first = i; /* no script name */ + return args; +} + + +/* +** Processes options 'e' and 'l', which involve running Lua code. +** Returns 0 if some code raises an error. +*/ +static int runargs (lua_State *L, char **argv, int n) { + int i; + for (i = 1; i < n; i++) { + int status; + int option = argv[i][1]; + lua_assert(argv[i][0] == '-'); /* already checked */ + if (option == 'e' || option == 'l') { + const char *extra = argv[i] + 2; /* both options need an argument */ + if (*extra == '\0') extra = argv[++i]; + lua_assert(extra != NULL); + if (option == 'e') + status = dostring(L, extra, "=(command line)"); + else + status = dolibrary(L, extra); + if (status != LUA_OK) return 0; + } + } + return 1; +} + + +static int handle_luainit (lua_State *L) { + const char *name = "=" LUA_INITVARVERSION; + const char *init = getenv(name + 1); + if (init == NULL) { + name = "=" LUA_INIT_VAR; + init = getenv(name + 1); /* try alternative name */ + } + if (init == NULL) return LUA_OK; + else if (init[0] == '@') + return dofile(L, init+1); + else + return dostring(L, init, name); +} + + +/* +** Main body of stand-alone interpreter (to be called in protected mode). +** Reads the options and handles them all. +*/ +static int pmain (lua_State *L) { + int argc = (int)lua_tointeger(L, 1); + char **argv = (char **)lua_touserdata(L, 2); + int script; + int args = collectargs(argv, &script); + luaL_checkversion(L); /* check that interpreter has correct version */ + if (argv[0] && argv[0][0]) progname = argv[0]; + if (args == has_error) { /* bad arg? */ + print_usage(argv[script]); /* 'script' has index of bad arg. */ + return 0; + } + if (args & has_v) /* option '-v'? */ + print_version(); + if (args & has_E) { /* option '-E'? */ + lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */ + lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); + } + luaL_openlibs(L); /* open standard libraries */ + createargtable(L, argv, argc, script); /* create table 'arg' */ + if (!(args & has_E)) { /* no option '-E'? */ + if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */ + return 0; /* error running LUA_INIT */ + } + if (!runargs(L, argv, script)) /* execute arguments -e and -l */ + return 0; /* something failed */ + if (script < argc && /* execute main script (if there is one) */ + handle_script(L, argv + script) != LUA_OK) + return 0; + if (args & has_i) /* -i option? */ + doREPL(L); /* do read-eval-print loop */ + else if (script == argc && !(args & (has_e | has_v))) { /* no arguments? */ + if (lua_stdin_is_tty()) { /* running in interactive mode? */ + print_version(); + doREPL(L); /* do read-eval-print loop */ + } + else dofile(L, NULL); /* executes stdin as a file */ + } + lua_pushboolean(L, 1); /* signal no errors */ + return 1; +} + + +int main (int argc, char **argv) { + int status, result; + lua_State *L = luaL_newstate(); /* create state */ + if (L == NULL) { + l_message(argv[0], "cannot create state: not enough memory"); + return EXIT_FAILURE; + } + lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ + lua_pushinteger(L, argc); /* 1st argument */ + lua_pushlightuserdata(L, argv); /* 2nd argument */ + status = lua_pcall(L, 2, 1, 0); /* do the call */ + result = lua_toboolean(L, -1); /* get result */ + report(L, status); + lua_close(L); + return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; +} + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lua.h b/3rdparty/genie/src/host/lua-5.3.0/src/lua.h index 149a2c37bcd..09a4ccaf89f 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lua.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.285.1.2 2013/11/11 12:09:16 roberto Exp $ +** $Id: lua.h,v 1.325 2014/12/26 17:24:27 roberto Exp $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -17,18 +17,18 @@ #define LUA_VERSION_MAJOR "5" -#define LUA_VERSION_MINOR "2" -#define LUA_VERSION_NUM 502 -#define LUA_VERSION_RELEASE "3" +#define LUA_VERSION_MINOR "3" +#define LUA_VERSION_NUM 503 +#define LUA_VERSION_RELEASE "0" #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2013 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2015 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" /* mark for precompiled code ('<esc>Lua') */ -#define LUA_SIGNATURE "\033Lua" +#define LUA_SIGNATURE "\x1bLua" /* option for multiple returns in 'lua_pcall' and 'lua_call' */ #define LUA_MULTRET (-1) @@ -53,22 +53,6 @@ typedef struct lua_State lua_State; -typedef int (*lua_CFunction) (lua_State *L); - - -/* -** functions that read/write blocks when loading/dumping Lua chunks -*/ -typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); - -typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); - - -/* -** prototype for memory-allocation functions -*/ -typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); - /* ** basic types @@ -109,6 +93,34 @@ typedef LUA_INTEGER lua_Integer; /* unsigned integer type */ typedef LUA_UNSIGNED lua_Unsigned; +/* type for continuation-function contexts */ +typedef LUA_KCONTEXT lua_KContext; + + +/* +** Type for C functions registered with Lua +*/ +typedef int (*lua_CFunction) (lua_State *L); + +/* +** Type for continuation functions +*/ +typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx); + + +/* +** Type for functions that read/write blocks when loading/dumping Lua chunks +*/ +typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); + +typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud); + + +/* +** Type for memory-allocation functions +*/ +typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); + /* @@ -145,11 +157,9 @@ LUA_API int (lua_absindex) (lua_State *L, int idx); LUA_API int (lua_gettop) (lua_State *L); LUA_API void (lua_settop) (lua_State *L, int idx); LUA_API void (lua_pushvalue) (lua_State *L, int idx); -LUA_API void (lua_remove) (lua_State *L, int idx); -LUA_API void (lua_insert) (lua_State *L, int idx); -LUA_API void (lua_replace) (lua_State *L, int idx); +LUA_API void (lua_rotate) (lua_State *L, int idx, int n); LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx); -LUA_API int (lua_checkstack) (lua_State *L, int sz); +LUA_API int (lua_checkstack) (lua_State *L, int n); LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); @@ -161,13 +171,13 @@ LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); LUA_API int (lua_isnumber) (lua_State *L, int idx); LUA_API int (lua_isstring) (lua_State *L, int idx); LUA_API int (lua_iscfunction) (lua_State *L, int idx); +LUA_API int (lua_isinteger) (lua_State *L, int idx); LUA_API int (lua_isuserdata) (lua_State *L, int idx); LUA_API int (lua_type) (lua_State *L, int idx); LUA_API const char *(lua_typename) (lua_State *L, int tp); LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum); LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); -LUA_API lua_Unsigned (lua_tounsignedx) (lua_State *L, int idx, int *isnum); LUA_API int (lua_toboolean) (lua_State *L, int idx); LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); LUA_API size_t (lua_rawlen) (lua_State *L, int idx); @@ -181,13 +191,20 @@ LUA_API const void *(lua_topointer) (lua_State *L, int idx); ** Comparison and arithmetic functions */ -#define LUA_OPADD 0 /* ORDER TM */ +#define LUA_OPADD 0 /* ORDER TM, ORDER OP */ #define LUA_OPSUB 1 #define LUA_OPMUL 2 -#define LUA_OPDIV 3 -#define LUA_OPMOD 4 -#define LUA_OPPOW 5 -#define LUA_OPUNM 6 +#define LUA_OPMOD 3 +#define LUA_OPPOW 4 +#define LUA_OPDIV 5 +#define LUA_OPIDIV 6 +#define LUA_OPBAND 7 +#define LUA_OPBOR 8 +#define LUA_OPBXOR 9 +#define LUA_OPSHL 10 +#define LUA_OPSHR 11 +#define LUA_OPUNM 12 +#define LUA_OPBNOT 13 LUA_API void (lua_arith) (lua_State *L, int op); @@ -205,8 +222,7 @@ LUA_API int (lua_compare) (lua_State *L, int idx1, int idx2, int op); LUA_API void (lua_pushnil) (lua_State *L); LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); -LUA_API void (lua_pushunsigned) (lua_State *L, lua_Unsigned n); -LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t l); +LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t len); LUA_API const char *(lua_pushstring) (lua_State *L, const char *s); LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, va_list argp); @@ -220,26 +236,29 @@ LUA_API int (lua_pushthread) (lua_State *L); /* ** get functions (Lua -> stack) */ -LUA_API void (lua_getglobal) (lua_State *L, const char *var); -LUA_API void (lua_gettable) (lua_State *L, int idx); -LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawget) (lua_State *L, int idx); -LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); -LUA_API void (lua_rawgetp) (lua_State *L, int idx, const void *p); +LUA_API int (lua_getglobal) (lua_State *L, const char *name); +LUA_API int (lua_gettable) (lua_State *L, int idx); +LUA_API int (lua_getfield) (lua_State *L, int idx, const char *k); +LUA_API int (lua_geti) (lua_State *L, int idx, lua_Integer n); +LUA_API int (lua_rawget) (lua_State *L, int idx); +LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n); +LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); + LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); LUA_API int (lua_getmetatable) (lua_State *L, int objindex); -LUA_API void (lua_getuservalue) (lua_State *L, int idx); +LUA_API int (lua_getuservalue) (lua_State *L, int idx); /* ** set functions (stack -> Lua) */ -LUA_API void (lua_setglobal) (lua_State *L, const char *var); +LUA_API void (lua_setglobal) (lua_State *L, const char *name); LUA_API void (lua_settable) (lua_State *L, int idx); LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); +LUA_API void (lua_seti) (lua_State *L, int idx, lua_Integer n); LUA_API void (lua_rawset) (lua_State *L, int idx); -LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); +LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n); LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p); LUA_API int (lua_setmetatable) (lua_State *L, int objindex); LUA_API void (lua_setuservalue) (lua_State *L, int idx); @@ -248,31 +267,31 @@ LUA_API void (lua_setuservalue) (lua_State *L, int idx); /* ** 'load' and 'call' functions (load and run Lua code) */ -LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, int ctx, - lua_CFunction k); +LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, + lua_KContext ctx, lua_KFunction k); #define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL) -LUA_API int (lua_getctx) (lua_State *L, int *ctx); - LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc, - int ctx, lua_CFunction k); + lua_KContext ctx, lua_KFunction k); #define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL) LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, - const char *chunkname, - const char *mode); + const char *chunkname, const char *mode); -LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); +LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip); /* ** coroutine functions */ -LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx, - lua_CFunction k); +LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_KContext ctx, + lua_KFunction k); +LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); +LUA_API int (lua_status) (lua_State *L); +LUA_API int (lua_isyieldable) (lua_State *L); + #define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL) -LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); -LUA_API int (lua_status) (lua_State *L); + /* ** garbage-collection function and options @@ -286,10 +305,7 @@ LUA_API int (lua_status) (lua_State *L); #define LUA_GCSTEP 5 #define LUA_GCSETPAUSE 6 #define LUA_GCSETSTEPMUL 7 -#define LUA_GCSETMAJORINC 8 #define LUA_GCISRUNNING 9 -#define LUA_GCGEN 10 -#define LUA_GCINC 11 LUA_API int (lua_gc) (lua_State *L, int what, int data); @@ -305,20 +321,23 @@ LUA_API int (lua_next) (lua_State *L, int idx); LUA_API void (lua_concat) (lua_State *L, int n); LUA_API void (lua_len) (lua_State *L, int idx); +LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s); + LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); /* -** =============================================================== +** {============================================================== ** some useful macros ** =============================================================== */ -#define lua_tonumber(L,i) lua_tonumberx(L,i,NULL) -#define lua_tointeger(L,i) lua_tointegerx(L,i,NULL) -#define lua_tounsigned(L,i) lua_tounsignedx(L,i,NULL) +#define lua_getextraspace(L) ((void *)((char *)(L) - LUA_EXTRASPACE)) + +#define lua_tonumber(L,i) lua_tonumberx(L,(i),NULL) +#define lua_tointeger(L,i) lua_tointegerx(L,(i),NULL) #define lua_pop(L,n) lua_settop(L, -(n)-1) @@ -346,6 +365,28 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); #define lua_tostring(L,i) lua_tolstring(L, (i), NULL) +#define lua_insert(L,idx) lua_rotate(L, (idx), 1) + +#define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1)) + +#define lua_replace(L,idx) (lua_copy(L, -1, (idx)), lua_pop(L, 1)) + +/* }============================================================== */ + + +/* +** {============================================================== +** compatibility macros for unsigned conversions +** =============================================================== +*/ +#if defined(LUA_COMPAT_APIINTCASTS) + +#define lua_pushunsigned(L,n) lua_pushinteger(L, (lua_Integer)(n)) +#define lua_tounsignedx(L,i,is) ((lua_Unsigned)lua_tointegerx(L,i,is)) +#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL) + +#endif +/* }============================================================== */ /* ** {====================================================================== @@ -390,7 +431,7 @@ LUA_API void *(lua_upvalueid) (lua_State *L, int fidx, int n); LUA_API void (lua_upvaluejoin) (lua_State *L, int fidx1, int n1, int fidx2, int n2); -LUA_API int (lua_sethook) (lua_State *L, lua_Hook func, int mask, int count); +LUA_API void (lua_sethook) (lua_State *L, lua_Hook func, int mask, int count); LUA_API lua_Hook (lua_gethook) (lua_State *L); LUA_API int (lua_gethookmask) (lua_State *L); LUA_API int (lua_gethookcount) (lua_State *L); @@ -418,7 +459,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2013 Lua.org, PUC-Rio. +* Copyright (C) 1994-2015 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lua.hpp b/3rdparty/genie/src/host/lua-5.3.0/src/lua.hpp index ec417f59469..ec417f59469 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lua.hpp +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lua.hpp diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/luac.c b/3rdparty/genie/src/host/lua-5.3.0/src/luac.c index 7409706ec72..c565f46aa50 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/luac.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/luac.c @@ -1,17 +1,20 @@ /* -** $Id: luac.c,v 1.69 2011/11/29 17:46:33 lhf Exp $ -** Lua compiler (saves bytecodes to files; also list bytecodes) +** $Id: luac.c,v 1.72 2015/01/06 03:09:13 lhf Exp $ +** Lua compiler (saves bytecodes to files; also lists bytecodes) ** See Copyright Notice in lua.h */ +#define luac_c +#define LUA_CORE + +#include "lprefix.h" + +#include <ctype.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#define luac_c -#define LUA_CORE - #include "lua.h" #include "lauxlib.h" @@ -47,14 +50,14 @@ static void cannot(const char* what) static void usage(const char* message) { if (*message=='-') - fprintf(stderr,"%s: unrecognized option " LUA_QS "\n",progname,message); + fprintf(stderr,"%s: unrecognized option '%s'\n",progname,message); else fprintf(stderr,"%s: %s\n",progname,message); fprintf(stderr, "usage: %s [options] [filenames]\n" "Available options are:\n" " -l list (use -l -l for full listing)\n" - " -o name output to file " LUA_QL("name") " (default is \"%s\")\n" + " -o name output to file 'name' (default is \"%s\")\n" " -p parse only\n" " -s strip debug information\n" " -v show version information\n" @@ -89,7 +92,7 @@ static int doargs(int argc, char* argv[]) { output=argv[++i]; if (output==NULL || *output==0 || (*output=='-' && output[1]!=0)) - usage(LUA_QL("-o") " needs argument"); + usage("'-o' needs argument"); if (IS("-")) output=NULL; } else if (IS("-p")) /* parse only */ @@ -203,7 +206,7 @@ int main(int argc, char* argv[]) } /* -** $Id: print.c,v 1.69 2013/07/04 01:03:46 lhf Exp $ +** $Id: print.c,v 1.76 2015/01/05 16:12:50 lhf Exp $ ** print bytecodes ** See Copyright Notice in lua.h */ @@ -223,7 +226,7 @@ int main(int argc, char* argv[]) static void PrintString(const TString* ts) { const char* s=getstr(ts); - size_t i,n=ts->tsv.len; + size_t i,n=ts->len; printf("%c",'"'); for (i=0; i<n; i++) { @@ -251,7 +254,7 @@ static void PrintString(const TString* ts) static void PrintConstant(const Proto* f, int i) { const TValue* o=&f->k[i]; - switch (ttypenv(o)) + switch (ttype(o)) { case LUA_TNIL: printf("nil"); @@ -259,11 +262,19 @@ static void PrintConstant(const Proto* f, int i) case LUA_TBOOLEAN: printf(bvalue(o) ? "true" : "false"); break; - case LUA_TNUMBER: - printf(LUA_NUMBER_FMT,nvalue(o)); + case LUA_TNUMFLT: + { + char buff[100]; + sprintf(buff,LUA_NUMBER_FMT,fltvalue(o)); + printf("%s",buff); + if (buff[strspn(buff,"-0123456789")]=='\0') printf(".0"); + break; + } + case LUA_TNUMINT: + printf(LUA_INTEGER_FMT,ivalue(o)); break; - case LUA_TSTRING: - PrintString(rawtsvalue(o)); + case LUA_TSHRSTR: case LUA_TLNGSTR: + PrintString(tsvalue(o)); break; default: /* cannot happen */ printf("? type=%d",ttype(o)); @@ -337,8 +348,14 @@ static void PrintCode(const Proto* f) case OP_ADD: case OP_SUB: case OP_MUL: - case OP_DIV: case OP_POW: + case OP_DIV: + case OP_IDIV: + case OP_BAND: + case OP_BOR: + case OP_BXOR: + case OP_SHL: + case OP_SHR: case OP_EQ: case OP_LT: case OP_LE: diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/luaconf.h b/3rdparty/genie/src/host/lua-5.3.0/src/luaconf.h new file mode 100644 index 00000000000..fd28d21aec9 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/luaconf.h @@ -0,0 +1,735 @@ +/* +** $Id: luaconf.h,v 1.238 2014/12/29 13:27:55 roberto Exp $ +** Configuration file for Lua +** See Copyright Notice in lua.h +*/ + + +#ifndef luaconf_h +#define luaconf_h + +#include <limits.h> +#include <stddef.h> + + +/* +** =================================================================== +** Search for "@@" to find all configurable definitions. +** =================================================================== +*/ + + +/* +** {==================================================================== +** System Configuration: macros to adapt (if needed) Lua to some +** particular platform, for instance compiling it with 32-bit numbers or +** restricting it to C89. +** ===================================================================== +*/ + +/* +@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You +** can also define LUA_32BITS in the make file, but changing here you +** ensure that all software connected to Lua will be compiled with the +** same configuration. +*/ +/* #define LUA_32BITS */ + + +/* +@@ LUA_USE_C89 controls the use of non-ISO-C89 features. +** Define it if you want Lua to avoid the use of a few C99 features +** or Windows-specific features on Windows. +*/ +/* #define LUA_USE_C89 */ + + +/* +** By default, Lua on Windows use (some) specific Windows features +*/ +#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) +#define LUA_USE_WINDOWS /* enable goodies for regular Windows */ +#endif + + +#if defined(LUA_USE_WINDOWS) +#define LUA_DL_DLL /* enable support for DLL */ +#define LUA_USE_C89 /* broadly, Windows is C89 */ +#endif + + +#if defined(LUA_USE_LINUX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_USE_READLINE /* needs some extra libraries */ +#endif + + +#if defined(LUA_USE_MACOSX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* MacOS does not need -ldl */ +#define LUA_USE_READLINE /* needs an extra library: -lreadline */ +#endif + + +/* +@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for +** C89 ('long' and 'double'); Windows always has '__int64', so it does +** not need to use this case. +*/ +#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) +#define LUA_C89_NUMBERS +#endif + + + +/* +@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'. +*/ +/* avoid undefined shifts */ +#if ((INT_MAX >> 15) >> 15) >= 1 +#define LUAI_BITSINT 32 +#else +/* 'int' always must have at least 16 bits */ +#define LUAI_BITSINT 16 +#endif + + +/* +@@ LUA_INT_INT / LUA_INT_LONG / LUA_INT_LONGLONG defines the type for +** Lua integers. +@@ LUA_REAL_FLOAT / LUA_REAL_DOUBLE / LUA_REAL_LONGDOUBLE defines +** the type for Lua floats. +** Lua should work fine with any mix of these options (if supported +** by your C compiler). The usual configurations are 64-bit integers +** and 'double' (the default), 32-bit integers and 'float' (for +** restricted platforms), and 'long'/'double' (for C compilers not +** compliant with C99, which may not have support for 'long long'). +*/ + +#if defined(LUA_32BITS) /* { */ +/* +** 32-bit integers and 'float' +*/ +#if LUAI_BITSINT >= 32 /* use 'int' if big enough */ +#define LUA_INT_INT +#else /* otherwise use 'long' */ +#define LUA_INT_LONG +#endif +#define LUA_REAL_FLOAT + +#elif defined(LUA_C89_NUMBERS) /* }{ */ +/* +** largest types available for C89 ('long' and 'double') +*/ +#define LUA_INT_LONG +#define LUA_REAL_DOUBLE + +#else /* }{ */ +/* +** default configuration for 64-bit Lua ('long long' and 'double') +*/ +#define LUA_INT_LONGLONG +#define LUA_REAL_DOUBLE + +#endif /* } */ + +/* }================================================================== */ + + + + +/* +** {================================================================== +** Configuration for Paths. +** =================================================================== +*/ + +/* +@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for +** Lua libraries. +@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for +** C libraries. +** CHANGE them if your machine has a non-conventional directory +** hierarchy or if you want to install your libraries in +** non-conventional directories. +*/ +#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR +#if defined(_WIN32) /* { */ +/* +** In Windows, any exclamation mark ('!') in the path is replaced by the +** path of the directory of the executable file of the current process. +*/ +#define LUA_LDIR "!\\lua\\" +#define LUA_CDIR "!\\" +#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ + LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ + ".\\?.lua;" ".\\?\\init.lua" +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.dll;" \ + LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ + LUA_CDIR"loadall.dll;" ".\\?.dll" + +#else /* }{ */ + +#define LUA_ROOT "/usr/local/" +#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" +#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ + "./?.lua;" "./?/init.lua" +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so" +#endif /* } */ + + +/* +@@ LUA_DIRSEP is the directory separator (for submodules). +** CHANGE it if your machine does not use "/" as the directory separator +** and is not Windows. (On Windows Lua automatically uses "\".) +*/ +#if defined(_WIN32) +#define LUA_DIRSEP "\\" +#else +#define LUA_DIRSEP "/" +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Marks for exported symbols in the C code +** =================================================================== +*/ + +/* +@@ LUA_API is a mark for all core API functions. +@@ LUALIB_API is a mark for all auxiliary library functions. +@@ LUAMOD_API is a mark for all standard library opening functions. +** CHANGE them if you need to define those functions in some special way. +** For instance, if you want to create one Windows DLL with the core and +** the libraries, you may want to use the following definition (define +** LUA_BUILD_AS_DLL to get it). +*/ +#if defined(LUA_BUILD_AS_DLL) /* { */ + +#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ +#define LUA_API __declspec(dllexport) +#else /* }{ */ +#define LUA_API __declspec(dllimport) +#endif /* } */ + +#else /* }{ */ + +#define LUA_API extern + +#endif /* } */ + + +/* more often than not the libs go together with the core */ +#define LUALIB_API LUA_API +#define LUAMOD_API LUALIB_API + + +/* +@@ LUAI_FUNC is a mark for all extern functions that are not to be +** exported to outside modules. +@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables +** that are not to be exported to outside modules (LUAI_DDEF for +** definitions and LUAI_DDEC for declarations). +** CHANGE them if you need to mark them in some special way. Elf/gcc +** (versions 3.2 and later) mark them as "hidden" to optimize access +** when Lua is compiled as a shared library. Not all elf targets support +** this attribute. Unfortunately, gcc does not offer a way to check +** whether the target offers that support, and those without support +** give a warning about it. To avoid these warnings, change to the +** default definition. +*/ +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) /* { */ +#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#else /* }{ */ +#define LUAI_FUNC extern +#endif /* } */ + +#define LUAI_DDEC LUAI_FUNC +#define LUAI_DDEF /* empty */ + +/* }================================================================== */ + + +/* +** {================================================================== +** Compatibility with previous versions +** =================================================================== +*/ + +/* +@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2. +@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1. +** You can define it to get all options, or change specific options +** to fit your specific needs. +*/ +#if defined(LUA_COMPAT_5_2) /* { */ + +/* +@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated +** functions in the mathematical library. +*/ +#define LUA_COMPAT_MATHLIB + +/* +@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'. +*/ +#define LUA_COMPAT_BITLIB + +/* +@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod. +*/ +#define LUA_COMPAT_IPAIRS + +/* +@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for +** manipulating other integer types (lua_pushunsigned, lua_tounsigned, +** luaL_checkint, luaL_checklong, etc.) +*/ +#define LUA_COMPAT_APIINTCASTS + + +/* +@@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a +@@ a float mark ('.0'). +** This macro is not on by default even in compatibility mode, +** because this is not really an incompatibility. +*/ +/* #define LUA_COMPAT_FLOATSTRING */ + +#endif /* } */ + + +#if defined(LUA_COMPAT_5_1) /* { */ + +/* +@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. +** You can replace it with 'table.unpack'. +*/ +#define LUA_COMPAT_UNPACK + +/* +@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. +** You can replace it with 'package.searchers'. +*/ +#define LUA_COMPAT_LOADERS + +/* +@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. +** You can call your C function directly (with light C functions). +*/ +#define lua_cpcall(L,f,u) \ + (lua_pushcfunction(L, (f)), \ + lua_pushlightuserdata(L,(u)), \ + lua_pcall(L,1,0,0)) + + +/* +@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. +** You can rewrite 'log10(x)' as 'log(x, 10)'. +*/ +#define LUA_COMPAT_LOG10 + +/* +@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base +** library. You can rewrite 'loadstring(s)' as 'load(s)'. +*/ +#define LUA_COMPAT_LOADSTRING + +/* +@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. +*/ +#define LUA_COMPAT_MAXN + +/* +@@ The following macros supply trivial compatibility for some +** changes in the API. The macros themselves document how to +** change your code to avoid using them. +*/ +#define lua_strlen(L,i) lua_rawlen(L, (i)) + +#define lua_objlen(L,i) lua_rawlen(L, (i)) + +#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) +#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) + +/* +@@ LUA_COMPAT_MODULE controls compatibility with previous +** module functions 'module' (Lua) and 'luaL_register' (C). +*/ +#define LUA_COMPAT_MODULE + +#endif /* } */ + +/* }================================================================== */ + + + +/* +** {================================================================== +** Configuration for Numbers. +** Change these definitions if no predefined LUA_REAL_* / LUA_INT_* +** satisfy your needs. +** =================================================================== +*/ + +/* +@@ LUA_NUMBER is the floating-point type used by Lua. +** +@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' +@@ over a floating number. +** +@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. +@@ LUA_NUMBER_FMT is the format for writing floats. +@@ lua_number2str converts a float to a string. +** +@@ l_mathop allows the addition of an 'l' or 'f' to all math operations. +** +@@ lua_str2number converts a decimal numeric string to a number. +*/ + +#if defined(LUA_REAL_FLOAT) /* { single float */ + +#define LUA_NUMBER float + +#define LUAI_UACNUMBER double + +#define LUA_NUMBER_FRMLEN "" +#define LUA_NUMBER_FMT "%.7g" + +#define l_mathop(op) op##f + +#define lua_str2number(s,p) strtof((s), (p)) + + +#elif defined(LUA_REAL_LONGDOUBLE) /* }{ long double */ + +#define LUA_NUMBER long double + +#define LUAI_UACNUMBER long double + +#define LUA_NUMBER_FRMLEN "L" +#define LUA_NUMBER_FMT "%.19Lg" + +#define l_mathop(op) op##l + +#define lua_str2number(s,p) strtold((s), (p)) + +#elif defined(LUA_REAL_DOUBLE) /* }{ double */ + +#define LUA_NUMBER double + +#define LUAI_UACNUMBER double + +#define LUA_NUMBER_FRMLEN "" +#define LUA_NUMBER_FMT "%.14g" + +#define l_mathop(op) op + +#define lua_str2number(s,p) strtod((s), (p)) + +#else /* }{ */ + +#error "numeric real type not defined" + +#endif /* } */ + + +#define l_floor(x) (l_mathop(floor)(x)) + +#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) + + +/* +@@ lua_numbertointeger converts a float number to an integer, or +** returns 0 if float is not within the range of a lua_Integer. +** (The range comparisons are tricky because of rounding. The tests +** here assume a two-complement representation, where MININTEGER always +** has an exact representation as a float; MAXINTEGER may not have one, +** and therefore its conversion to float may have an ill-defined value.) +*/ +#define lua_numbertointeger(n,p) \ + ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \ + (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \ + (*(p) = (LUA_INTEGER)(n), 1)) + + +/* +@@ The luai_num* macros define the primitive operations over numbers. +** They should work for any size of floating numbers. +*/ + +/* the following operations need the math library */ +#if defined(lobject_c) || defined(lvm_c) +#include <math.h> + +/* floor division (defined as 'floor(a/b)') */ +#define luai_numidiv(L,a,b) ((void)L, l_mathop(floor)(luai_numdiv(L,a,b))) + +/* +** module: defined as 'a - floor(a/b)*b'; the previous definition gives +** NaN when 'b' is huge, but the result should be 'a'. 'fmod' gives the +** result of 'a - trunc(a/b)*b', and therefore must be corrected when +** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a +** non-integer negative result, which is equivalent to the test below +*/ +#define luai_nummod(L,a,b,m) \ + { (m) = l_mathop(fmod)(a,b); if ((m)*(b) < 0) (m) += (b); } + +/* exponentiation */ +#define luai_numpow(L,a,b) ((void)L, l_mathop(pow)(a,b)) + +#endif + +/* these are quite standard operations */ +#if defined(LUA_CORE) +#define luai_numadd(L,a,b) ((a)+(b)) +#define luai_numsub(L,a,b) ((a)-(b)) +#define luai_nummul(L,a,b) ((a)*(b)) +#define luai_numdiv(L,a,b) ((a)/(b)) +#define luai_numunm(L,a) (-(a)) +#define luai_numeq(a,b) ((a)==(b)) +#define luai_numlt(a,b) ((a)<(b)) +#define luai_numle(a,b) ((a)<=(b)) +#define luai_numisnan(a) (!luai_numeq((a), (a))) +#endif + + +/* +@@ LUA_INTEGER is the integer type used by Lua. +** +@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. +** +@@ LUAI_UACINT is the result of an 'usual argument conversion' +@@ over a lUA_INTEGER. +@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. +@@ LUA_INTEGER_FMT is the format for writing integers. +@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. +@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. +@@ lua_integer2str converts an integer to a string. +*/ + + +/* The following definitions are good for most cases here */ + +#define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" +#define lua_integer2str(s,n) sprintf((s), LUA_INTEGER_FMT, (n)) + +#define LUAI_UACINT LUA_INTEGER + +/* +** use LUAI_UACINT here to avoid problems with promotions (which +** can turn a comparison between unsigneds into a signed comparison) +*/ +#define LUA_UNSIGNED unsigned LUAI_UACINT + + +/* now the variable definitions */ + +#if defined(LUA_INT_INT) /* { int */ + +#define LUA_INTEGER int +#define LUA_INTEGER_FRMLEN "" + +#define LUA_MAXINTEGER INT_MAX +#define LUA_MININTEGER INT_MIN + +#elif defined(LUA_INT_LONG) /* }{ long */ + +#define LUA_INTEGER long +#define LUA_INTEGER_FRMLEN "l" + +#define LUA_MAXINTEGER LONG_MAX +#define LUA_MININTEGER LONG_MIN + +#elif defined(LUA_INT_LONGLONG) /* }{ long long */ + +#if defined(LLONG_MAX) /* { */ +/* use ISO C99 stuff */ + +#define LUA_INTEGER long long +#define LUA_INTEGER_FRMLEN "ll" + +#define LUA_MAXINTEGER LLONG_MAX +#define LUA_MININTEGER LLONG_MIN + +#elif defined(LUA_USE_WINDOWS) /* }{ */ +/* in Windows, can use specific Windows types */ + +#define LUA_INTEGER __int64 +#define LUA_INTEGER_FRMLEN "I64" + +#define LUA_MAXINTEGER _I64_MAX +#define LUA_MININTEGER _I64_MIN + +#else /* }{ */ + +#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ + or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" + +#endif /* } */ + +#else /* }{ */ + +#error "numeric integer type not defined" + +#endif /* } */ + +/* }================================================================== */ + + +/* +** {================================================================== +** Dependencies with C99 +** =================================================================== +*/ + +/* +@@ lua_strx2number converts an hexadecimal numeric string to a number. +** In C99, 'strtod' does both conversions. Otherwise, you can +** leave 'lua_strx2number' undefined and Lua will provide its own +** implementation. +*/ +#if !defined(LUA_USE_C89) +#define lua_strx2number(s,p) lua_str2number(s,p) +#endif + + +/* +@@ LUA_USE_AFORMAT allows '%a'/'%A' specifiers in 'string.format' +** Enable it if the C function 'printf' supports these specifiers. +** (C99 demands it and Windows also supports it.) +*/ +#if !defined(LUA_USE_C89) || defined(LUA_USE_WINDOWS) +#define LUA_USE_AFORMAT +#endif + + +/* +** 'strtof' and 'opf' variants for math functions are not valid in +** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the +** availability of these variants. ('math.h' is already included in +** all files that use these macros.) +*/ +#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF)) +#undef l_mathop /* variants not available */ +#undef lua_str2number +#define l_mathop(op) (lua_Number)op /* no variant */ +#define lua_str2number(s,p) ((lua_Number)strtod((s), (p))) +#endif + + +/* +@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation +** functions. It must be a numerical type; Lua will use 'intptr_t' if +** available, otherwise it will use 'ptrdiff_t' (the nearest thing to +** 'intptr_t' in C89) +*/ +#define LUA_KCONTEXT ptrdiff_t + +#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ + __STDC_VERSION__ >= 199901L +#include <stdint.h> +#if defined (INTPTR_MAX) /* even in C99 this type is optional */ +#undef LUA_KCONTEXT +#define LUA_KCONTEXT intptr_t +#endif +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Macros that affect the API and must be stable (that is, must be the +** same when you compile Lua and when you compile code that links to +** Lua). You probably do not want/need to change them. +** ===================================================================== +*/ + +/* +@@ LUAI_MAXSTACK limits the size of the Lua stack. +** CHANGE it if you need a different limit. This limit is arbitrary; +** its only purpose is to stop Lua from consuming unlimited stack +** space (and to reserve some numbers for pseudo-indices). +*/ +#if LUAI_BITSINT >= 32 +#define LUAI_MAXSTACK 1000000 +#else +#define LUAI_MAXSTACK 15000 +#endif + +/* reserve some space for error handling */ +#define LUAI_FIRSTPSEUDOIDX (-LUAI_MAXSTACK - 1000) + + +/* +@@ LUA_EXTRASPACE defines the size of a raw memory area associated with +** a Lua state with very fast access. +** CHANGE it if you need a different size. +*/ +#define LUA_EXTRASPACE (sizeof(void *)) + + +/* +@@ LUA_IDSIZE gives the maximum size for the description of the source +@@ of a function in debug information. +** CHANGE it if you want a different size. +*/ +#define LUA_IDSIZE 60 + + +/* +@@ LUAI_MAXSHORTLEN is the maximum length for short strings, that is, +** strings that are internalized. (Cannot be smaller than reserved words +** or tags for metamethods, as these strings must be internalized; +** #("function") = 8, #("__newindex") = 10.) +*/ +#define LUAI_MAXSHORTLEN 40 + + +/* +@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. +** CHANGE it if it uses too much C-stack space. +*/ +#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) + +/* }================================================================== */ + + +/* +@@ LUA_QL describes how error messages quote program elements. +** Lua does not use these macros anymore; they are here for +** compatibility only. +*/ +#define LUA_QL(x) "'" x "'" +#define LUA_QS LUA_QL("%s") + + + + +/* =================================================================== */ + +/* +** Local configuration. You can use this space to add your redefinitions +** without modifying the main part of the file. +*/ + + + + + +#endif + diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lualib.h b/3rdparty/genie/src/host/lua-5.3.0/src/lualib.h index da82005c9de..5165c0fb3f0 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lualib.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lualib.h @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.43.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lualib.h,v 1.44 2014/02/06 17:32:33 roberto Exp $ ** Lua standard libraries ** See Copyright Notice in lua.h */ @@ -29,6 +29,9 @@ LUAMOD_API int (luaopen_os) (lua_State *L); #define LUA_STRLIBNAME "string" LUAMOD_API int (luaopen_string) (lua_State *L); +#define LUA_UTF8LIBNAME "utf8" +LUAMOD_API int (luaopen_utf8) (lua_State *L); + #define LUA_BITLIBNAME "bit32" LUAMOD_API int (luaopen_bit32) (lua_State *L); diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lundump.c b/3rdparty/genie/src/host/lua-5.3.0/src/lundump.c new file mode 100644 index 00000000000..510f3258274 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lundump.c @@ -0,0 +1,277 @@ +/* +** $Id: lundump.c,v 2.41 2014/11/02 19:19:04 roberto Exp $ +** load precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#define lundump_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <string.h> + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstring.h" +#include "lundump.h" +#include "lzio.h" + + +#if !defined(luai_verifycode) +#define luai_verifycode(L,b,f) /* empty */ +#endif + + +typedef struct { + lua_State *L; + ZIO *Z; + Mbuffer *b; + const char *name; +} LoadState; + + +static l_noret error(LoadState *S, const char *why) { + luaO_pushfstring(S->L, "%s: %s precompiled chunk", S->name, why); + luaD_throw(S->L, LUA_ERRSYNTAX); +} + + +/* +** All high-level loads go through LoadVector; you can change it to +** adapt to the endianness of the input +*/ +#define LoadVector(S,b,n) LoadBlock(S,b,(n)*sizeof((b)[0])) + +static void LoadBlock (LoadState *S, void *b, size_t size) { + if (luaZ_read(S->Z, b, size) != 0) + error(S, "truncated"); +} + + +#define LoadVar(S,x) LoadVector(S,&x,1) + + +static lu_byte LoadByte (LoadState *S) { + lu_byte x; + LoadVar(S, x); + return x; +} + + +static int LoadInt (LoadState *S) { + int x; + LoadVar(S, x); + return x; +} + + +static lua_Number LoadNumber (LoadState *S) { + lua_Number x; + LoadVar(S, x); + return x; +} + + +static lua_Integer LoadInteger (LoadState *S) { + lua_Integer x; + LoadVar(S, x); + return x; +} + + +static TString *LoadString (LoadState *S) { + size_t size = LoadByte(S); + if (size == 0xFF) + LoadVar(S, size); + if (size == 0) + return NULL; + else { + char *s = luaZ_openspace(S->L, S->b, --size); + LoadVector(S, s, size); + return luaS_newlstr(S->L, s, size); + } +} + + +static void LoadCode (LoadState *S, Proto *f) { + int n = LoadInt(S); + f->code = luaM_newvector(S->L, n, Instruction); + f->sizecode = n; + LoadVector(S, f->code, n); +} + + +static void LoadFunction(LoadState *S, Proto *f, TString *psource); + + +static void LoadConstants (LoadState *S, Proto *f) { + int i; + int n = LoadInt(S); + f->k = luaM_newvector(S->L, n, TValue); + f->sizek = n; + for (i = 0; i < n; i++) + setnilvalue(&f->k[i]); + for (i = 0; i < n; i++) { + TValue *o = &f->k[i]; + int t = LoadByte(S); + switch (t) { + case LUA_TNIL: + setnilvalue(o); + break; + case LUA_TBOOLEAN: + setbvalue(o, LoadByte(S)); + break; + case LUA_TNUMFLT: + setfltvalue(o, LoadNumber(S)); + break; + case LUA_TNUMINT: + setivalue(o, LoadInteger(S)); + break; + case LUA_TSHRSTR: + case LUA_TLNGSTR: + setsvalue2n(S->L, o, LoadString(S)); + break; + default: + lua_assert(0); + } + } +} + + +static void LoadProtos (LoadState *S, Proto *f) { + int i; + int n = LoadInt(S); + f->p = luaM_newvector(S->L, n, Proto *); + f->sizep = n; + for (i = 0; i < n; i++) + f->p[i] = NULL; + for (i = 0; i < n; i++) { + f->p[i] = luaF_newproto(S->L); + LoadFunction(S, f->p[i], f->source); + } +} + + +static void LoadUpvalues (LoadState *S, Proto *f) { + int i, n; + n = LoadInt(S); + f->upvalues = luaM_newvector(S->L, n, Upvaldesc); + f->sizeupvalues = n; + for (i = 0; i < n; i++) + f->upvalues[i].name = NULL; + for (i = 0; i < n; i++) { + f->upvalues[i].instack = LoadByte(S); + f->upvalues[i].idx = LoadByte(S); + } +} + + +static void LoadDebug (LoadState *S, Proto *f) { + int i, n; + n = LoadInt(S); + f->lineinfo = luaM_newvector(S->L, n, int); + f->sizelineinfo = n; + LoadVector(S, f->lineinfo, n); + n = LoadInt(S); + f->locvars = luaM_newvector(S->L, n, LocVar); + f->sizelocvars = n; + for (i = 0; i < n; i++) + f->locvars[i].varname = NULL; + for (i = 0; i < n; i++) { + f->locvars[i].varname = LoadString(S); + f->locvars[i].startpc = LoadInt(S); + f->locvars[i].endpc = LoadInt(S); + } + n = LoadInt(S); + for (i = 0; i < n; i++) + f->upvalues[i].name = LoadString(S); +} + + +static void LoadFunction (LoadState *S, Proto *f, TString *psource) { + f->source = LoadString(S); + if (f->source == NULL) /* no source in dump? */ + f->source = psource; /* reuse parent's source */ + f->linedefined = LoadInt(S); + f->lastlinedefined = LoadInt(S); + f->numparams = LoadByte(S); + f->is_vararg = LoadByte(S); + f->maxstacksize = LoadByte(S); + LoadCode(S, f); + LoadConstants(S, f); + LoadUpvalues(S, f); + LoadProtos(S, f); + LoadDebug(S, f); +} + + +static void checkliteral (LoadState *S, const char *s, const char *msg) { + char buff[sizeof(LUA_SIGNATURE) + sizeof(LUAC_DATA)]; /* larger than both */ + size_t len = strlen(s); + LoadVector(S, buff, len); + if (memcmp(s, buff, len) != 0) + error(S, msg); +} + + +static void fchecksize (LoadState *S, size_t size, const char *tname) { + if (LoadByte(S) != size) + error(S, luaO_pushfstring(S->L, "%s size mismatch in", tname)); +} + + +#define checksize(S,t) fchecksize(S,sizeof(t),#t) + +static void checkHeader (LoadState *S) { + checkliteral(S, LUA_SIGNATURE + 1, "not a"); /* 1st char already checked */ + if (LoadByte(S) != LUAC_VERSION) + error(S, "version mismatch in"); + if (LoadByte(S) != LUAC_FORMAT) + error(S, "format mismatch in"); + checkliteral(S, LUAC_DATA, "corrupted"); + checksize(S, int); + checksize(S, size_t); + checksize(S, Instruction); + checksize(S, lua_Integer); + checksize(S, lua_Number); + if (LoadInteger(S) != LUAC_INT) + error(S, "endianness mismatch in"); + if (LoadNumber(S) != LUAC_NUM) + error(S, "float format mismatch in"); +} + + +/* +** load precompiled chunk +*/ +LClosure *luaU_undump(lua_State *L, ZIO *Z, Mbuffer *buff, + const char *name) { + LoadState S; + LClosure *cl; + if (*name == '@' || *name == '=') + S.name = name + 1; + else if (*name == LUA_SIGNATURE[0]) + S.name = "binary string"; + else + S.name = name; + S.L = L; + S.Z = Z; + S.b = buff; + checkHeader(&S); + cl = luaF_newLclosure(L, LoadByte(&S)); + setclLvalue(L, L->top, cl); + incr_top(L); + cl->p = luaF_newproto(L); + LoadFunction(&S, cl->p, NULL); + lua_assert(cl->nupvalues == cl->p->sizeupvalues); + luai_verifycode(L, buff, cl->p); + return cl; +} + diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lundump.h b/3rdparty/genie/src/host/lua-5.3.0/src/lundump.h new file mode 100644 index 00000000000..ef43d512647 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lundump.h @@ -0,0 +1,33 @@ +/* +** $Id: lundump.h,v 1.44 2014/06/19 18:27:20 roberto Exp $ +** load precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#ifndef lundump_h +#define lundump_h + +#include "llimits.h" +#include "lobject.h" +#include "lzio.h" + + +/* data to catch conversion errors */ +#define LUAC_DATA "\x19\x93\r\n\x1a\n" + +#define LUAC_INT 0x5678 +#define LUAC_NUM cast_num(370.5) + +#define MYINT(s) (s[0]-'0') +#define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) +#define LUAC_FORMAT 0 /* this is the official format */ + +/* load one chunk; from lundump.c */ +LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, + const char* name); + +/* dump one chunk; from ldump.c */ +LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, + void* data, int strip); + +#endif diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lutf8lib.c b/3rdparty/genie/src/host/lua-5.3.0/src/lutf8lib.c new file mode 100644 index 00000000000..be4f087f760 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lutf8lib.c @@ -0,0 +1,255 @@ +/* +** $Id: lutf8lib.c,v 1.13 2014/11/02 19:19:04 roberto Exp $ +** Standard library for UTF-8 manipulation +** See Copyright Notice in lua.h +*/ + +#define lutf8lib_c +#define LUA_LIB + +#include "lprefix.h" + + +#include <assert.h> +#include <stdlib.h> +#include <string.h> + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + +#define MAXUNICODE 0x10FFFF + +#define iscont(p) ((*(p) & 0xC0) == 0x80) + + +/* from strlib */ +/* translate a relative string position: negative means back from end */ +static lua_Integer u_posrelat (lua_Integer pos, size_t len) { + if (pos >= 0) return pos; + else if (0u - (size_t)pos > len) return 0; + else return (lua_Integer)len + pos + 1; +} + + +/* +** Decode one UTF-8 sequence, returning NULL if byte sequence is invalid. +*/ +static const char *utf8_decode (const char *o, int *val) { + static unsigned int limits[] = {0xFF, 0x7F, 0x7FF, 0xFFFF}; + const unsigned char *s = (const unsigned char *)o; + unsigned int c = s[0]; + unsigned int res = 0; /* final result */ + if (c < 0x80) /* ascii? */ + res = c; + else { + int count = 0; /* to count number of continuation bytes */ + while (c & 0x40) { /* still have continuation bytes? */ + int cc = s[++count]; /* read next byte */ + if ((cc & 0xC0) != 0x80) /* not a continuation byte? */ + return NULL; /* invalid byte sequence */ + res = (res << 6) | (cc & 0x3F); /* add lower 6 bits from cont. byte */ + c <<= 1; /* to test next bit */ + } + res |= ((c & 0x7F) << (count * 5)); /* add first byte */ + if (count > 3 || res > MAXUNICODE || res <= limits[count]) + return NULL; /* invalid byte sequence */ + s += count; /* skip continuation bytes read */ + } + if (val) *val = res; + return (const char *)s + 1; /* +1 to include first byte */ +} + + +/* +** utf8len(s [, i [, j]]) --> number of characters that start in the +** range [i,j], or nil + current position if 's' is not well formed in +** that interval +*/ +static int utflen (lua_State *L) { + int n = 0; + size_t len; + const char *s = luaL_checklstring(L, 1, &len); + lua_Integer posi = u_posrelat(luaL_optinteger(L, 2, 1), len); + lua_Integer posj = u_posrelat(luaL_optinteger(L, 3, -1), len); + luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 2, + "initial position out of string"); + luaL_argcheck(L, --posj < (lua_Integer)len, 3, + "final position out of string"); + while (posi <= posj) { + const char *s1 = utf8_decode(s + posi, NULL); + if (s1 == NULL) { /* conversion error? */ + lua_pushnil(L); /* return nil ... */ + lua_pushinteger(L, posi + 1); /* ... and current position */ + return 2; + } + posi = s1 - s; + n++; + } + lua_pushinteger(L, n); + return 1; +} + + +/* +** codepoint(s, [i, [j]]) -> returns codepoints for all characters +** that start in the range [i,j] +*/ +static int codepoint (lua_State *L) { + size_t len; + const char *s = luaL_checklstring(L, 1, &len); + lua_Integer posi = u_posrelat(luaL_optinteger(L, 2, 1), len); + lua_Integer pose = u_posrelat(luaL_optinteger(L, 3, posi), len); + int n; + const char *se; + luaL_argcheck(L, posi >= 1, 2, "out of range"); + luaL_argcheck(L, pose <= (lua_Integer)len, 3, "out of range"); + if (posi > pose) return 0; /* empty interval; return no values */ + n = (int)(pose - posi + 1); + if (posi + n <= pose) /* (lua_Integer -> int) overflow? */ + return luaL_error(L, "string slice too long"); + luaL_checkstack(L, n, "string slice too long"); + n = 0; + se = s + pose; + for (s += posi - 1; s < se;) { + int code; + s = utf8_decode(s, &code); + if (s == NULL) + return luaL_error(L, "invalid UTF-8 code"); + lua_pushinteger(L, code); + n++; + } + return n; +} + + +static void pushutfchar (lua_State *L, int arg) { + lua_Integer code = luaL_checkinteger(L, arg); + luaL_argcheck(L, 0 <= code && code <= MAXUNICODE, arg, "value out of range"); + lua_pushfstring(L, "%U", (long)code); +} + + +/* +** utfchar(n1, n2, ...) -> char(n1)..char(n2)... +*/ +static int utfchar (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + if (n == 1) /* optimize common case of single char */ + pushutfchar(L, 1); + else { + int i; + luaL_Buffer b; + luaL_buffinit(L, &b); + for (i = 1; i <= n; i++) { + pushutfchar(L, i); + luaL_addvalue(&b); + } + luaL_pushresult(&b); + } + return 1; +} + + +/* +** offset(s, n, [i]) -> index where n-th character counting from +** position 'i' starts; 0 means character at 'i'. +*/ +static int byteoffset (lua_State *L) { + size_t len; + const char *s = luaL_checklstring(L, 1, &len); + lua_Integer n = luaL_checkinteger(L, 2); + lua_Integer posi = (n >= 0) ? 1 : len + 1; + posi = u_posrelat(luaL_optinteger(L, 3, posi), len); + luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 3, + "position out of range"); + if (n == 0) { + /* find beginning of current byte sequence */ + while (posi > 0 && iscont(s + posi)) posi--; + } + else { + if (iscont(s + posi)) + luaL_error(L, "initial position is a continuation byte"); + if (n < 0) { + while (n < 0 && posi > 0) { /* move back */ + do { /* find beginning of previous character */ + posi--; + } while (posi > 0 && iscont(s + posi)); + n++; + } + } + else { + n--; /* do not move for 1st character */ + while (n > 0 && posi < (lua_Integer)len) { + do { /* find beginning of next character */ + posi++; + } while (iscont(s + posi)); /* (cannot pass final '\0') */ + n--; + } + } + } + if (n == 0) /* did it find given character? */ + lua_pushinteger(L, posi + 1); + else /* no such character */ + lua_pushnil(L); + return 1; +} + + +static int iter_aux (lua_State *L) { + size_t len; + const char *s = luaL_checklstring(L, 1, &len); + lua_Integer n = lua_tointeger(L, 2) - 1; + if (n < 0) /* first iteration? */ + n = 0; /* start from here */ + else if (n < (lua_Integer)len) { + n++; /* skip current byte */ + while (iscont(s + n)) n++; /* and its continuations */ + } + if (n >= (lua_Integer)len) + return 0; /* no more codepoints */ + else { + int code; + const char *next = utf8_decode(s + n, &code); + if (next == NULL || iscont(next)) + return luaL_error(L, "invalid UTF-8 code"); + lua_pushinteger(L, n + 1); + lua_pushinteger(L, code); + return 2; + } +} + + +static int iter_codes (lua_State *L) { + luaL_checkstring(L, 1); + lua_pushcfunction(L, iter_aux); + lua_pushvalue(L, 1); + lua_pushinteger(L, 0); + return 3; +} + + +/* pattern to match a single UTF-8 character */ +#define UTF8PATT "[\0-\x7F\xC2-\xF4][\x80-\xBF]*" + + +static struct luaL_Reg funcs[] = { + {"offset", byteoffset}, + {"codepoint", codepoint}, + {"char", utfchar}, + {"len", utflen}, + {"codes", iter_codes}, + /* placeholders */ + {"charpattern", NULL}, + {NULL, NULL} +}; + + +LUAMOD_API int luaopen_utf8 (lua_State *L) { + luaL_newlib(L, funcs); + lua_pushliteral(L, UTF8PATT); + lua_setfield(L, -2, "charpattern"); + return 1; +} + diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lvm.c b/3rdparty/genie/src/host/lua-5.3.0/src/lvm.c new file mode 100644 index 00000000000..2ac1b02df48 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lvm.c @@ -0,0 +1,1182 @@ +/* +** $Id: lvm.c,v 2.232 2014/12/27 20:30:38 roberto Exp $ +** Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#define lvm_c +#define LUA_CORE + +#include "lprefix.h" + + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lvm.h" + + +/* +** You can define LUA_FLOORN2I if you want to convert floats to integers +** by flooring them (instead of raising an error if they are not +** integral values) +*/ +#if !defined(LUA_FLOORN2I) +#define LUA_FLOORN2I 0 +#endif + + +/* limit for table tag-method chains (to avoid loops) */ +#define MAXTAGLOOP 2000 + + +/* +** Similar to 'tonumber', but does not attempt to convert strings and +** ensure correct precision (no extra bits). Used in comparisons. +*/ +static int tofloat (const TValue *obj, lua_Number *n) { + if (ttisfloat(obj)) *n = fltvalue(obj); + else if (ttisinteger(obj)) { + volatile lua_Number x = cast_num(ivalue(obj)); /* avoid extra precision */ + *n = x; + } + else { + *n = 0; /* to avoid warnings */ + return 0; + } + return 1; +} + + +/* +** Try to convert a value to a float. The float case is already handled +** by the macro 'tonumber'. +*/ +int luaV_tonumber_ (const TValue *obj, lua_Number *n) { + TValue v; + if (ttisinteger(obj)) { + *n = cast_num(ivalue(obj)); + return 1; + } + else if (cvt2num(obj) && /* string convertible to number? */ + luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) { + *n = nvalue(&v); /* convert result of 'luaO_str2num' to a float */ + return 1; + } + else + return 0; /* conversion failed */ +} + + +/* +** try to convert a value to an integer, rounding according to 'mode': +** mode == 0: accepts only integral values +** mode == 1: takes the floor of the number +** mode == 2: takes the ceil of the number +*/ +static int tointeger_aux (const TValue *obj, lua_Integer *p, int mode) { + TValue v; + again: + if (ttisfloat(obj)) { + lua_Number n = fltvalue(obj); + lua_Number f = l_floor(n); + if (n != f) { /* not an integral value? */ + if (mode == 0) return 0; /* fails if mode demands integral value */ + else if (mode > 1) /* needs ceil? */ + f += 1; /* convert floor to ceil (remember: n != f) */ + } + return lua_numbertointeger(f, p); + } + else if (ttisinteger(obj)) { + *p = ivalue(obj); + return 1; + } + else if (cvt2num(obj) && + luaO_str2num(svalue(obj), &v) == tsvalue(obj)->len + 1) { + obj = &v; + goto again; /* convert result from 'luaO_str2num' to an integer */ + } + return 0; /* conversion failed */ +} + + +/* +** try to convert a value to an integer +*/ +int luaV_tointeger_ (const TValue *obj, lua_Integer *p) { + return tointeger_aux(obj, p, LUA_FLOORN2I); +} + + +/* +** Try to convert a 'for' limit to an integer, preserving the +** semantics of the loop. +** (The following explanation assumes a non-negative step; it is valid +** for negative steps mutatis mutandis.) +** If the limit can be converted to an integer, rounding down, that is +** it. +** Otherwise, check whether the limit can be converted to a number. If +** the number is too large, it is OK to set the limit as LUA_MAXINTEGER, +** which means no limit. If the number is too negative, the loop +** should not run, because any initial integer value is larger than the +** limit. So, it sets the limit to LUA_MININTEGER. 'stopnow' corrects +** the extreme case when the initial value is LUA_MININTEGER, in which +** case the LUA_MININTEGER limit would still run the loop once. +*/ +static int forlimit (const TValue *obj, lua_Integer *p, lua_Integer step, + int *stopnow) { + *stopnow = 0; /* usually, let loops run */ + if (!tointeger_aux(obj, p, (step < 0 ? 2 : 1))) { /* not fit in integer? */ + lua_Number n; /* try to convert to float */ + if (!tonumber(obj, &n)) /* cannot convert to float? */ + return 0; /* not a number */ + if (n > 0) { /* if true, float is larger than max integer */ + *p = LUA_MAXINTEGER; + if (step < 0) *stopnow = 1; + } + else { /* float is smaller than min integer */ + *p = LUA_MININTEGER; + if (step >= 0) *stopnow = 1; + } + } + return 1; +} + + +/* +** Main function for table access (invoking metamethods if needed). +** Compute 'val = t[key]' +*/ +void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { + int loop; /* counter to avoid infinite loops */ + for (loop = 0; loop < MAXTAGLOOP; loop++) { + const TValue *tm; + if (ttistable(t)) { /* 't' is a table? */ + Table *h = hvalue(t); + const TValue *res = luaH_get(h, key); /* do a primitive get */ + if (!ttisnil(res) || /* result is not nil? */ + (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ + setobj2s(L, val, res); /* result is the raw get */ + return; + } + /* else will try metamethod */ + } + else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) + luaG_typeerror(L, t, "index"); /* no metamethod */ + if (ttisfunction(tm)) { /* metamethod is a function */ + luaT_callTM(L, tm, t, key, val, 1); + return; + } + t = tm; /* else repeat access over 'tm' */ + } + luaG_runerror(L, "gettable chain too long; possible loop"); +} + + +/* +** Main function for table assignment (invoking metamethods if needed). +** Compute 't[key] = val' +*/ +void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { + int loop; /* counter to avoid infinite loops */ + for (loop = 0; loop < MAXTAGLOOP; loop++) { + const TValue *tm; + if (ttistable(t)) { /* 't' is a table? */ + Table *h = hvalue(t); + TValue *oldval = cast(TValue *, luaH_get(h, key)); + /* if previous value is not nil, there must be a previous entry + in the table; a metamethod has no relevance */ + if (!ttisnil(oldval) || + /* previous value is nil; must check the metamethod */ + ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL && + /* no metamethod; is there a previous entry in the table? */ + (oldval != luaO_nilobject || + /* no previous entry; must create one. (The next test is + always true; we only need the assignment.) */ + (oldval = luaH_newkey(L, h, key), 1)))) { + /* no metamethod and (now) there is an entry with given key */ + setobj2t(L, oldval, val); /* assign new value to that entry */ + invalidateTMcache(h); + luaC_barrierback(L, h, val); + return; + } + /* else will try the metamethod */ + } + else /* not a table; check metamethod */ + if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) + luaG_typeerror(L, t, "index"); + /* try the metamethod */ + if (ttisfunction(tm)) { + luaT_callTM(L, tm, t, key, val, 0); + return; + } + t = tm; /* else repeat assignment over 'tm' */ + } + luaG_runerror(L, "settable chain too long; possible loop"); +} + + +/* +** Compare two strings 'ls' x 'rs', returning an integer smaller-equal- +** -larger than zero if 'ls' is smaller-equal-larger than 'rs'. +** The code is a little tricky because it allows '\0' in the strings +** and it uses 'strcoll' (to respect locales) for each segments +** of the strings. +*/ +static int l_strcmp (const TString *ls, const TString *rs) { + const char *l = getstr(ls); + size_t ll = ls->len; + const char *r = getstr(rs); + size_t lr = rs->len; + for (;;) { /* for each segment */ + int temp = strcoll(l, r); + if (temp != 0) /* not equal? */ + return temp; /* done */ + else { /* strings are equal up to a '\0' */ + size_t len = strlen(l); /* index of first '\0' in both strings */ + if (len == lr) /* 'rs' is finished? */ + return (len == ll) ? 0 : 1; /* check 'ls' */ + else if (len == ll) /* 'ls' is finished? */ + return -1; /* 'ls' is smaller than 'rs' ('rs' is not finished) */ + /* both strings longer than 'len'; go on comparing after the '\0' */ + len++; + l += len; ll -= len; r += len; lr -= len; + } + } +} + + +/* +** Main operation less than; return 'l < r'. +*/ +int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { + int res; + lua_Number nl, nr; + if (ttisinteger(l) && ttisinteger(r)) /* both operands are integers? */ + return (ivalue(l) < ivalue(r)); + else if (tofloat(l, &nl) && tofloat(r, &nr)) /* both are numbers? */ + return luai_numlt(nl, nr); + else if (ttisstring(l) && ttisstring(r)) /* both are strings? */ + return l_strcmp(tsvalue(l), tsvalue(r)) < 0; + else if ((res = luaT_callorderTM(L, l, r, TM_LT)) < 0) /* no metamethod? */ + luaG_ordererror(L, l, r); /* error */ + return res; +} + + +/* +** Main operation less than or equal to; return 'l <= r'. +*/ +int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { + int res; + lua_Number nl, nr; + if (ttisinteger(l) && ttisinteger(r)) /* both operands are integers? */ + return (ivalue(l) <= ivalue(r)); + else if (tofloat(l, &nl) && tofloat(r, &nr)) /* both are numbers? */ + return luai_numle(nl, nr); + else if (ttisstring(l) && ttisstring(r)) /* both are strings? */ + return l_strcmp(tsvalue(l), tsvalue(r)) <= 0; + else if ((res = luaT_callorderTM(L, l, r, TM_LE)) >= 0) /* first try 'le' */ + return res; + else if ((res = luaT_callorderTM(L, r, l, TM_LT)) < 0) /* else try 'lt' */ + luaG_ordererror(L, l, r); + return !res; +} + + +/* +** Main operation for equality of Lua values; return 't1 == t2'. +** L == NULL means raw equality (no metamethods) +*/ +int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { + const TValue *tm; + if (ttype(t1) != ttype(t2)) { /* not the same variant? */ + if (ttnov(t1) != ttnov(t2) || ttnov(t1) != LUA_TNUMBER) + return 0; /* only numbers can be equal with different variants */ + else { /* two numbers with different variants */ + lua_Number n1, n2; /* compare them as floats */ + lua_assert(ttisnumber(t1) && ttisnumber(t2)); + cast_void(tofloat(t1, &n1)); cast_void(tofloat(t2, &n2)); + return luai_numeq(n1, n2); + } + } + /* values have same type and same variant */ + switch (ttype(t1)) { + case LUA_TNIL: return 1; + case LUA_TNUMINT: return (ivalue(t1) == ivalue(t2)); + case LUA_TNUMFLT: return luai_numeq(fltvalue(t1), fltvalue(t2)); + case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ + case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); + case LUA_TLCF: return fvalue(t1) == fvalue(t2); + case LUA_TSHRSTR: return eqshrstr(tsvalue(t1), tsvalue(t2)); + case LUA_TLNGSTR: return luaS_eqlngstr(tsvalue(t1), tsvalue(t2)); + case LUA_TUSERDATA: { + if (uvalue(t1) == uvalue(t2)) return 1; + else if (L == NULL) return 0; + tm = fasttm(L, uvalue(t1)->metatable, TM_EQ); + if (tm == NULL) + tm = fasttm(L, uvalue(t2)->metatable, TM_EQ); + break; /* will try TM */ + } + case LUA_TTABLE: { + if (hvalue(t1) == hvalue(t2)) return 1; + else if (L == NULL) return 0; + tm = fasttm(L, hvalue(t1)->metatable, TM_EQ); + if (tm == NULL) + tm = fasttm(L, hvalue(t2)->metatable, TM_EQ); + break; /* will try TM */ + } + default: + return gcvalue(t1) == gcvalue(t2); + } + if (tm == NULL) /* no TM? */ + return 0; /* objects are different */ + luaT_callTM(L, tm, t1, t2, L->top, 1); /* call TM */ + return !l_isfalse(L->top); +} + + +/* macro used by 'luaV_concat' to ensure that element at 'o' is a string */ +#define tostring(L,o) \ + (ttisstring(o) || (cvt2str(o) && (luaO_tostring(L, o), 1))) + +/* +** Main operation for concatenation: concat 'total' values in the stack, +** from 'L->top - total' up to 'L->top - 1'. +*/ +void luaV_concat (lua_State *L, int total) { + lua_assert(total >= 2); + do { + StkId top = L->top; + int n = 2; /* number of elements handled in this pass (at least 2) */ + if (!(ttisstring(top-2) || cvt2str(top-2)) || !tostring(L, top-1)) + luaT_trybinTM(L, top-2, top-1, top-2, TM_CONCAT); + else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ + cast_void(tostring(L, top - 2)); /* result is first operand */ + else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { + setobjs2s(L, top - 2, top - 1); /* result is second op. */ + } + else { + /* at least two non-empty string values; get as many as possible */ + size_t tl = tsvalue(top-1)->len; + char *buffer; + int i; + /* collect total length */ + for (i = 1; i < total && tostring(L, top-i-1); i++) { + size_t l = tsvalue(top-i-1)->len; + if (l >= (MAX_SIZE/sizeof(char)) - tl) + luaG_runerror(L, "string length overflow"); + tl += l; + } + buffer = luaZ_openspace(L, &G(L)->buff, tl); + tl = 0; + n = i; + do { /* copy all strings to buffer */ + size_t l = tsvalue(top-i)->len; + memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); + tl += l; + } while (--i > 0); + setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); /* create result */ + } + total -= n-1; /* got 'n' strings to create 1 new */ + L->top -= n-1; /* popped 'n' strings and pushed one */ + } while (total > 1); /* repeat until only 1 result left */ +} + + +/* +** Main operation 'ra' = #rb'. +*/ +void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { + const TValue *tm; + switch (ttnov(rb)) { + case LUA_TTABLE: { + Table *h = hvalue(rb); + tm = fasttm(L, h->metatable, TM_LEN); + if (tm) break; /* metamethod? break switch to call it */ + setivalue(ra, luaH_getn(h)); /* else primitive len */ + return; + } + case LUA_TSTRING: { + setivalue(ra, tsvalue(rb)->len); + return; + } + default: { /* try metamethod */ + tm = luaT_gettmbyobj(L, rb, TM_LEN); + if (ttisnil(tm)) /* no metamethod? */ + luaG_typeerror(L, rb, "get length of"); + break; + } + } + luaT_callTM(L, tm, rb, rb, ra, 1); +} + + +/* +** Integer division; return 'm // n', that is, floor(m/n). +** C division truncates its result (rounds towards zero). +** 'floor(q) == trunc(q)' when 'q >= 0' or when 'q' is integer, +** otherwise 'floor(q) == trunc(q) - 1'. +*/ +lua_Integer luaV_div (lua_State *L, lua_Integer m, lua_Integer n) { + if (l_castS2U(n) + 1u <= 1u) { /* special cases: -1 or 0 */ + if (n == 0) + luaG_runerror(L, "attempt to divide by zero"); + return intop(-, 0, m); /* n==-1; avoid overflow with 0x80000...//-1 */ + } + else { + lua_Integer q = m / n; /* perform C division */ + if ((m ^ n) < 0 && m % n != 0) /* 'm/n' would be negative non-integer? */ + q -= 1; /* correct result for different rounding */ + return q; + } +} + + +/* +** Integer modulus; return 'm % n'. (Assume that C '%' with +** negative operands follows C99 behavior. See previous comment +** about luaV_div.) +*/ +lua_Integer luaV_mod (lua_State *L, lua_Integer m, lua_Integer n) { + if (l_castS2U(n) + 1u <= 1u) { /* special cases: -1 or 0 */ + if (n == 0) + luaG_runerror(L, "attempt to perform 'n%%0'"); + return 0; /* m % -1 == 0; avoid overflow with 0x80000...%-1 */ + } + else { + lua_Integer r = m % n; + if (r != 0 && (m ^ n) < 0) /* 'm/n' would be non-integer negative? */ + r += n; /* correct result for different rounding */ + return r; + } +} + + +/* number of bits in an integer */ +#define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT) + +/* +** Shift left operation. (Shift right just negates 'y'.) +*/ +lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) { + if (y < 0) { /* shift right? */ + if (y <= -NBITS) return 0; + else return intop(>>, x, -y); + } + else { /* shift left */ + if (y >= NBITS) return 0; + else return intop(<<, x, y); + } +} + + +/* +** check whether cached closure in prototype 'p' may be reused, that is, +** whether there is a cached closure with the same upvalues needed by +** new closure to be created. +*/ +static LClosure *getcached (Proto *p, UpVal **encup, StkId base) { + LClosure *c = p->cache; + if (c != NULL) { /* is there a cached closure? */ + int nup = p->sizeupvalues; + Upvaldesc *uv = p->upvalues; + int i; + for (i = 0; i < nup; i++) { /* check whether it has right upvalues */ + TValue *v = uv[i].instack ? base + uv[i].idx : encup[uv[i].idx]->v; + if (c->upvals[i]->v != v) + return NULL; /* wrong upvalue; cannot reuse closure */ + } + } + return c; /* return cached closure (or NULL if no cached closure) */ +} + + +/* +** create a new Lua closure, push it in the stack, and initialize +** its upvalues. Note that the closure is not cached if prototype is +** already black (which means that 'cache' was already cleared by the +** GC). +*/ +static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, + StkId ra) { + int nup = p->sizeupvalues; + Upvaldesc *uv = p->upvalues; + int i; + LClosure *ncl = luaF_newLclosure(L, nup); + ncl->p = p; + setclLvalue(L, ra, ncl); /* anchor new closure in stack */ + for (i = 0; i < nup; i++) { /* fill in its upvalues */ + if (uv[i].instack) /* upvalue refers to local variable? */ + ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx); + else /* get upvalue from enclosing function */ + ncl->upvals[i] = encup[uv[i].idx]; + ncl->upvals[i]->refcount++; + /* new closure is white, so we do not need a barrier here */ + } + if (!isblack(p)) /* cache will not break GC invariant? */ + p->cache = ncl; /* save it on cache for reuse */ +} + + +/* +** finish execution of an opcode interrupted by an yield +*/ +void luaV_finishOp (lua_State *L) { + CallInfo *ci = L->ci; + StkId base = ci->u.l.base; + Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ + OpCode op = GET_OPCODE(inst); + switch (op) { /* finish its execution */ + case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: case OP_IDIV: + case OP_BAND: case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: + case OP_MOD: case OP_POW: + case OP_UNM: case OP_BNOT: case OP_LEN: + case OP_GETTABUP: case OP_GETTABLE: case OP_SELF: { + setobjs2s(L, base + GETARG_A(inst), --L->top); + break; + } + case OP_LE: case OP_LT: case OP_EQ: { + int res = !l_isfalse(L->top - 1); + L->top--; + /* metamethod should not be called when operand is K */ + lua_assert(!ISK(GETARG_B(inst))); + if (op == OP_LE && /* "<=" using "<" instead? */ + ttisnil(luaT_gettmbyobj(L, base + GETARG_B(inst), TM_LE))) + res = !res; /* invert result */ + lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP); + if (res != GETARG_A(inst)) /* condition failed? */ + ci->u.l.savedpc++; /* skip jump instruction */ + break; + } + case OP_CONCAT: { + StkId top = L->top - 1; /* top when 'luaT_trybinTM' was called */ + int b = GETARG_B(inst); /* first element to concatenate */ + int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ + setobj2s(L, top - 2, top); /* put TM result in proper position */ + if (total > 1) { /* are there elements to concat? */ + L->top = top - 1; /* top is one after last element (at top-2) */ + luaV_concat(L, total); /* concat them (may yield again) */ + } + /* move final result to final position */ + setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); + L->top = ci->top; /* restore top */ + break; + } + case OP_TFORCALL: { + lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_TFORLOOP); + L->top = ci->top; /* correct top */ + break; + } + case OP_CALL: { + if (GETARG_C(inst) - 1 >= 0) /* nresults >= 0? */ + L->top = ci->top; /* adjust results */ + break; + } + case OP_TAILCALL: case OP_SETTABUP: case OP_SETTABLE: + break; + default: lua_assert(0); + } +} + + + + +/* +** {================================================================== +** Function 'luaV_execute': main interpreter loop +** =================================================================== +*/ + + +/* +** some macros for common tasks in 'luaV_execute' +*/ + +#if !defined luai_runtimecheck +#define luai_runtimecheck(L, c) /* void */ +#endif + + +#define RA(i) (base+GETARG_A(i)) +/* to be used after possible stack reallocation */ +#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) +#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) +#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ + ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) +#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ + ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) +#define KBx(i) \ + (k + (GETARG_Bx(i) != 0 ? GETARG_Bx(i) - 1 : GETARG_Ax(*ci->u.l.savedpc++))) + + +/* execute a jump instruction */ +#define dojump(ci,i,e) \ + { int a = GETARG_A(i); \ + if (a > 0) luaF_close(L, ci->u.l.base + a - 1); \ + ci->u.l.savedpc += GETARG_sBx(i) + e; } + +/* for test instructions, execute the jump instruction that follows it */ +#define donextjump(ci) { i = *ci->u.l.savedpc; dojump(ci, i, 1); } + + +#define Protect(x) { {x;}; base = ci->u.l.base; } + +#define checkGC(L,c) \ + Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \ + luaC_step(L); \ + L->top = ci->top;}) /* restore top */ \ + luai_threadyield(L); ) + + +#define vmdispatch(o) switch(o) +#define vmcase(l) case l: +#define vmbreak break + +void luaV_execute (lua_State *L) { + CallInfo *ci = L->ci; + LClosure *cl; + TValue *k; + StkId base; + newframe: /* reentry point when frame changes (call/return) */ + lua_assert(ci == L->ci); + cl = clLvalue(ci->func); + k = cl->p->k; + base = ci->u.l.base; + /* main loop of interpreter */ + for (;;) { + Instruction i = *(ci->u.l.savedpc++); + StkId ra; + if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && + (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { + Protect(luaG_traceexec(L)); + } + /* WARNING: several calls may realloc the stack and invalidate 'ra' */ + ra = RA(i); + lua_assert(base == ci->u.l.base); + lua_assert(base <= L->top && L->top < L->stack + L->stacksize); + vmdispatch (GET_OPCODE(i)) { + vmcase(OP_MOVE) { + setobjs2s(L, ra, RB(i)); + vmbreak; + } + vmcase(OP_LOADK) { + TValue *rb = k + GETARG_Bx(i); + setobj2s(L, ra, rb); + vmbreak; + } + vmcase(OP_LOADKX) { + TValue *rb; + lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); + rb = k + GETARG_Ax(*ci->u.l.savedpc++); + setobj2s(L, ra, rb); + vmbreak; + } + vmcase(OP_LOADBOOL) { + setbvalue(ra, GETARG_B(i)); + if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */ + vmbreak; + } + vmcase(OP_LOADNIL) { + int b = GETARG_B(i); + do { + setnilvalue(ra++); + } while (b--); + vmbreak; + } + vmcase(OP_GETUPVAL) { + int b = GETARG_B(i); + setobj2s(L, ra, cl->upvals[b]->v); + vmbreak; + } + vmcase(OP_GETTABUP) { + int b = GETARG_B(i); + Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra)); + vmbreak; + } + vmcase(OP_GETTABLE) { + Protect(luaV_gettable(L, RB(i), RKC(i), ra)); + vmbreak; + } + vmcase(OP_SETTABUP) { + int a = GETARG_A(i); + Protect(luaV_settable(L, cl->upvals[a]->v, RKB(i), RKC(i))); + vmbreak; + } + vmcase(OP_SETUPVAL) { + UpVal *uv = cl->upvals[GETARG_B(i)]; + setobj(L, uv->v, ra); + luaC_upvalbarrier(L, uv); + vmbreak; + } + vmcase(OP_SETTABLE) { + Protect(luaV_settable(L, ra, RKB(i), RKC(i))); + vmbreak; + } + vmcase(OP_NEWTABLE) { + int b = GETARG_B(i); + int c = GETARG_C(i); + Table *t = luaH_new(L); + sethvalue(L, ra, t); + if (b != 0 || c != 0) + luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c)); + checkGC(L, ra + 1); + vmbreak; + } + vmcase(OP_SELF) { + StkId rb = RB(i); + setobjs2s(L, ra+1, rb); + Protect(luaV_gettable(L, rb, RKC(i), ra)); + vmbreak; + } + vmcase(OP_ADD) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (ttisinteger(rb) && ttisinteger(rc)) { + lua_Integer ib = ivalue(rb); lua_Integer ic = ivalue(rc); + setivalue(ra, intop(+, ib, ic)); + } + else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + setfltvalue(ra, luai_numadd(L, nb, nc)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_ADD)); } + vmbreak; + } + vmcase(OP_SUB) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (ttisinteger(rb) && ttisinteger(rc)) { + lua_Integer ib = ivalue(rb); lua_Integer ic = ivalue(rc); + setivalue(ra, intop(-, ib, ic)); + } + else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + setfltvalue(ra, luai_numsub(L, nb, nc)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_SUB)); } + vmbreak; + } + vmcase(OP_MUL) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (ttisinteger(rb) && ttisinteger(rc)) { + lua_Integer ib = ivalue(rb); lua_Integer ic = ivalue(rc); + setivalue(ra, intop(*, ib, ic)); + } + else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + setfltvalue(ra, luai_nummul(L, nb, nc)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MUL)); } + vmbreak; + } + vmcase(OP_DIV) { /* float division (always with floats) */ + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + setfltvalue(ra, luai_numdiv(L, nb, nc)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_DIV)); } + vmbreak; + } + vmcase(OP_BAND) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Integer ib; lua_Integer ic; + if (tointeger(rb, &ib) && tointeger(rc, &ic)) { + setivalue(ra, intop(&, ib, ic)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_BAND)); } + vmbreak; + } + vmcase(OP_BOR) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Integer ib; lua_Integer ic; + if (tointeger(rb, &ib) && tointeger(rc, &ic)) { + setivalue(ra, intop(|, ib, ic)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_BOR)); } + vmbreak; + } + vmcase(OP_BXOR) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Integer ib; lua_Integer ic; + if (tointeger(rb, &ib) && tointeger(rc, &ic)) { + setivalue(ra, intop(^, ib, ic)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_BXOR)); } + vmbreak; + } + vmcase(OP_SHL) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Integer ib; lua_Integer ic; + if (tointeger(rb, &ib) && tointeger(rc, &ic)) { + setivalue(ra, luaV_shiftl(ib, ic)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_SHL)); } + vmbreak; + } + vmcase(OP_SHR) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Integer ib; lua_Integer ic; + if (tointeger(rb, &ib) && tointeger(rc, &ic)) { + setivalue(ra, luaV_shiftl(ib, -ic)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_SHR)); } + vmbreak; + } + vmcase(OP_MOD) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (ttisinteger(rb) && ttisinteger(rc)) { + lua_Integer ib = ivalue(rb); lua_Integer ic = ivalue(rc); + setivalue(ra, luaV_mod(L, ib, ic)); + } + else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + lua_Number m; + luai_nummod(L, nb, nc, m); + setfltvalue(ra, m); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MOD)); } + vmbreak; + } + vmcase(OP_IDIV) { /* floor division */ + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (ttisinteger(rb) && ttisinteger(rc)) { + lua_Integer ib = ivalue(rb); lua_Integer ic = ivalue(rc); + setivalue(ra, luaV_div(L, ib, ic)); + } + else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + setfltvalue(ra, luai_numidiv(L, nb, nc)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_IDIV)); } + vmbreak; + } + vmcase(OP_POW) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + lua_Number nb; lua_Number nc; + if (tonumber(rb, &nb) && tonumber(rc, &nc)) { + setfltvalue(ra, luai_numpow(L, nb, nc)); + } + else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_POW)); } + vmbreak; + } + vmcase(OP_UNM) { + TValue *rb = RB(i); + lua_Number nb; + if (ttisinteger(rb)) { + lua_Integer ib = ivalue(rb); + setivalue(ra, intop(-, 0, ib)); + } + else if (tonumber(rb, &nb)) { + setfltvalue(ra, luai_numunm(L, nb)); + } + else { + Protect(luaT_trybinTM(L, rb, rb, ra, TM_UNM)); + } + vmbreak; + } + vmcase(OP_BNOT) { + TValue *rb = RB(i); + lua_Integer ib; + if (tointeger(rb, &ib)) { + setivalue(ra, intop(^, ~l_castS2U(0), ib)); + } + else { + Protect(luaT_trybinTM(L, rb, rb, ra, TM_BNOT)); + } + vmbreak; + } + vmcase(OP_NOT) { + TValue *rb = RB(i); + int res = l_isfalse(rb); /* next assignment may change this value */ + setbvalue(ra, res); + vmbreak; + } + vmcase(OP_LEN) { + Protect(luaV_objlen(L, ra, RB(i))); + vmbreak; + } + vmcase(OP_CONCAT) { + int b = GETARG_B(i); + int c = GETARG_C(i); + StkId rb; + L->top = base + c + 1; /* mark the end of concat operands */ + Protect(luaV_concat(L, c - b + 1)); + ra = RA(i); /* 'luav_concat' may invoke TMs and move the stack */ + rb = b + base; + setobjs2s(L, ra, rb); + checkGC(L, (ra >= rb ? ra + 1 : rb)); + L->top = ci->top; /* restore top */ + vmbreak; + } + vmcase(OP_JMP) { + dojump(ci, i, 0); + vmbreak; + } + vmcase(OP_EQ) { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + Protect( + if (cast_int(luaV_equalobj(L, rb, rc)) != GETARG_A(i)) + ci->u.l.savedpc++; + else + donextjump(ci); + ) + vmbreak; + } + vmcase(OP_LT) { + Protect( + if (luaV_lessthan(L, RKB(i), RKC(i)) != GETARG_A(i)) + ci->u.l.savedpc++; + else + donextjump(ci); + ) + vmbreak; + } + vmcase(OP_LE) { + Protect( + if (luaV_lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) + ci->u.l.savedpc++; + else + donextjump(ci); + ) + vmbreak; + } + vmcase(OP_TEST) { + if (GETARG_C(i) ? l_isfalse(ra) : !l_isfalse(ra)) + ci->u.l.savedpc++; + else + donextjump(ci); + vmbreak; + } + vmcase(OP_TESTSET) { + TValue *rb = RB(i); + if (GETARG_C(i) ? l_isfalse(rb) : !l_isfalse(rb)) + ci->u.l.savedpc++; + else { + setobjs2s(L, ra, rb); + donextjump(ci); + } + vmbreak; + } + vmcase(OP_CALL) { + int b = GETARG_B(i); + int nresults = GETARG_C(i) - 1; + if (b != 0) L->top = ra+b; /* else previous instruction set top */ + if (luaD_precall(L, ra, nresults)) { /* C function? */ + if (nresults >= 0) L->top = ci->top; /* adjust results */ + base = ci->u.l.base; + } + else { /* Lua function */ + ci = L->ci; + ci->callstatus |= CIST_REENTRY; + goto newframe; /* restart luaV_execute over new Lua function */ + } + vmbreak; + } + vmcase(OP_TAILCALL) { + int b = GETARG_B(i); + if (b != 0) L->top = ra+b; /* else previous instruction set top */ + lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); + if (luaD_precall(L, ra, LUA_MULTRET)) /* C function? */ + base = ci->u.l.base; + else { + /* tail call: put called frame (n) in place of caller one (o) */ + CallInfo *nci = L->ci; /* called frame */ + CallInfo *oci = nci->previous; /* caller frame */ + StkId nfunc = nci->func; /* called function */ + StkId ofunc = oci->func; /* caller function */ + /* last stack slot filled by 'precall' */ + StkId lim = nci->u.l.base + getproto(nfunc)->numparams; + int aux; + /* close all upvalues from previous call */ + if (cl->p->sizep > 0) luaF_close(L, oci->u.l.base); + /* move new frame into old one */ + for (aux = 0; nfunc + aux < lim; aux++) + setobjs2s(L, ofunc + aux, nfunc + aux); + oci->u.l.base = ofunc + (nci->u.l.base - nfunc); /* correct base */ + oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ + oci->u.l.savedpc = nci->u.l.savedpc; + oci->callstatus |= CIST_TAIL; /* function was tail called */ + ci = L->ci = oci; /* remove new frame */ + lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); + goto newframe; /* restart luaV_execute over new Lua function */ + } + vmbreak; + } + vmcase(OP_RETURN) { + int b = GETARG_B(i); + if (b != 0) L->top = ra+b-1; + if (cl->p->sizep > 0) luaF_close(L, base); + b = luaD_poscall(L, ra); + if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ + return; /* external invocation: return */ + else { /* invocation via reentry: continue execution */ + ci = L->ci; + if (b) L->top = ci->top; + lua_assert(isLua(ci)); + lua_assert(GET_OPCODE(*((ci)->u.l.savedpc - 1)) == OP_CALL); + goto newframe; /* restart luaV_execute over new Lua function */ + } + } + vmcase(OP_FORLOOP) { + if (ttisinteger(ra)) { /* integer loop? */ + lua_Integer step = ivalue(ra + 2); + lua_Integer idx = ivalue(ra) + step; /* increment index */ + lua_Integer limit = ivalue(ra + 1); + if ((0 < step) ? (idx <= limit) : (limit <= idx)) { + ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ + setivalue(ra, idx); /* update internal index... */ + setivalue(ra + 3, idx); /* ...and external index */ + } + } + else { /* floating loop */ + lua_Number step = fltvalue(ra + 2); + lua_Number idx = luai_numadd(L, fltvalue(ra), step); /* inc. index */ + lua_Number limit = fltvalue(ra + 1); + if (luai_numlt(0, step) ? luai_numle(idx, limit) + : luai_numle(limit, idx)) { + ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ + setfltvalue(ra, idx); /* update internal index... */ + setfltvalue(ra + 3, idx); /* ...and external index */ + } + } + vmbreak; + } + vmcase(OP_FORPREP) { + TValue *init = ra; + TValue *plimit = ra + 1; + TValue *pstep = ra + 2; + lua_Integer ilimit; + int stopnow; + if (ttisinteger(init) && ttisinteger(pstep) && + forlimit(plimit, &ilimit, ivalue(pstep), &stopnow)) { + /* all values are integer */ + lua_Integer initv = (stopnow ? 0 : ivalue(init)); + setivalue(plimit, ilimit); + setivalue(init, initv - ivalue(pstep)); + } + else { /* try making all values floats */ + lua_Number ninit; lua_Number nlimit; lua_Number nstep; + if (!tonumber(plimit, &nlimit)) + luaG_runerror(L, "'for' limit must be a number"); + setfltvalue(plimit, nlimit); + if (!tonumber(pstep, &nstep)) + luaG_runerror(L, "'for' step must be a number"); + setfltvalue(pstep, nstep); + if (!tonumber(init, &ninit)) + luaG_runerror(L, "'for' initial value must be a number"); + setfltvalue(init, luai_numsub(L, ninit, nstep)); + } + ci->u.l.savedpc += GETARG_sBx(i); + vmbreak; + } + vmcase(OP_TFORCALL) { + StkId cb = ra + 3; /* call base */ + setobjs2s(L, cb+2, ra+2); + setobjs2s(L, cb+1, ra+1); + setobjs2s(L, cb, ra); + L->top = cb + 3; /* func. + 2 args (state and index) */ + Protect(luaD_call(L, cb, GETARG_C(i), 1)); + L->top = ci->top; + i = *(ci->u.l.savedpc++); /* go to next instruction */ + ra = RA(i); + lua_assert(GET_OPCODE(i) == OP_TFORLOOP); + goto l_tforloop; + } + vmcase(OP_TFORLOOP) { + l_tforloop: + if (!ttisnil(ra + 1)) { /* continue loop? */ + setobjs2s(L, ra, ra + 1); /* save control variable */ + ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ + } + vmbreak; + } + vmcase(OP_SETLIST) { + int n = GETARG_B(i); + int c = GETARG_C(i); + unsigned int last; + Table *h; + if (n == 0) n = cast_int(L->top - ra) - 1; + if (c == 0) { + lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); + c = GETARG_Ax(*ci->u.l.savedpc++); + } + luai_runtimecheck(L, ttistable(ra)); + h = hvalue(ra); + last = ((c-1)*LFIELDS_PER_FLUSH) + n; + if (last > h->sizearray) /* needs more space? */ + luaH_resizearray(L, h, last); /* pre-allocate it at once */ + for (; n > 0; n--) { + TValue *val = ra+n; + luaH_setint(L, h, last--, val); + luaC_barrierback(L, h, val); + } + L->top = ci->top; /* correct top (in case of previous open call) */ + vmbreak; + } + vmcase(OP_CLOSURE) { + Proto *p = cl->p->p[GETARG_Bx(i)]; + LClosure *ncl = getcached(p, cl->upvals, base); /* cached closure */ + if (ncl == NULL) /* no match? */ + pushclosure(L, p, cl->upvals, base, ra); /* create a new one */ + else + setclLvalue(L, ra, ncl); /* push cashed closure */ + checkGC(L, ra + 1); + vmbreak; + } + vmcase(OP_VARARG) { + int b = GETARG_B(i) - 1; + int j; + int n = cast_int(base - ci->func) - cl->p->numparams - 1; + if (b < 0) { /* B == 0? */ + b = n; /* get all var. arguments */ + Protect(luaD_checkstack(L, n)); + ra = RA(i); /* previous call may change the stack */ + L->top = ra + n; + } + for (j = 0; j < b; j++) { + if (j < n) { + setobjs2s(L, ra + j, base - n + j); + } + else { + setnilvalue(ra + j); + } + } + vmbreak; + } + vmcase(OP_EXTRAARG) { + lua_assert(0); + vmbreak; + } + } + } +} + +/* }================================================================== */ + diff --git a/3rdparty/genie/src/host/lua-5.3.0/src/lvm.h b/3rdparty/genie/src/host/lua-5.3.0/src/lvm.h new file mode 100644 index 00000000000..5c5e18c3ac7 --- /dev/null +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lvm.h @@ -0,0 +1,58 @@ +/* +** $Id: lvm.h,v 2.34 2014/08/01 17:24:02 roberto Exp $ +** Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#ifndef lvm_h +#define lvm_h + + +#include "ldo.h" +#include "lobject.h" +#include "ltm.h" + + +#if !defined(LUA_NOCVTN2S) +#define cvt2str(o) ttisnumber(o) +#else +#define cvt2str(o) 0 /* no conversion from numbers to strings */ +#endif + + +#if !defined(LUA_NOCVTS2N) +#define cvt2num(o) ttisstring(o) +#else +#define cvt2num(o) 0 /* no conversion from strings to numbers */ +#endif + + +#define tonumber(o,n) \ + (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n)) + +#define tointeger(o,i) \ + (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger_(o,i)) + +#define intop(op,v1,v2) l_castU2S(l_castS2U(v1) op l_castS2U(v2)) + +#define luaV_rawequalobj(t1,t2) luaV_equalobj(NULL,t1,t2) + + +LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); +LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); +LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); +LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n); +LUAI_FUNC int luaV_tointeger_ (const TValue *obj, lua_Integer *p); +LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, + StkId val); +LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, + StkId val); +LUAI_FUNC void luaV_finishOp (lua_State *L); +LUAI_FUNC void luaV_execute (lua_State *L); +LUAI_FUNC void luaV_concat (lua_State *L, int total); +LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y); +LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y); +LUAI_FUNC lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y); +LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb); + +#endif diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lzio.c b/3rdparty/genie/src/host/lua-5.3.0/src/lzio.c index 20efea98300..46493920f41 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lzio.c +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lzio.c @@ -1,15 +1,17 @@ /* -** $Id: lzio.c,v 1.35.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lzio.c,v 1.36 2014/11/02 19:19:04 roberto Exp $ ** Buffered streams ** See Copyright Notice in lua.h */ - -#include <string.h> - #define lzio_c #define LUA_CORE +#include "lprefix.h" + + +#include <string.h> + #include "lua.h" #include "llimits.h" diff --git a/3rdparty/genie/src/host/lua-5.2.3/src/lzio.h b/3rdparty/genie/src/host/lua-5.3.0/src/lzio.h index 441f7479cb1..b2e56bcd6e3 100644 --- a/3rdparty/genie/src/host/lua-5.2.3/src/lzio.h +++ b/3rdparty/genie/src/host/lua-5.3.0/src/lzio.h @@ -1,5 +1,5 @@ /* -** $Id: lzio.h,v 1.26.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lzio.h,v 1.30 2014/12/19 17:26:14 roberto Exp $ ** Buffered streams ** See Copyright Notice in lua.h */ @@ -32,11 +32,13 @@ typedef struct Mbuffer { #define luaZ_sizebuffer(buff) ((buff)->buffsize) #define luaZ_bufflen(buff) ((buff)->n) +#define luaZ_buffremove(buff,i) ((buff)->n -= (i)) #define luaZ_resetbuffer(buff) ((buff)->n = 0) #define luaZ_resizebuffer(L, buff, size) \ - (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ + ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ + (buff)->buffsize, size), \ (buff)->buffsize = size) #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) @@ -45,7 +47,7 @@ typedef struct Mbuffer { LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data); -LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ +LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ @@ -55,7 +57,7 @@ struct Zio { size_t n; /* bytes still unread */ const char *p; /* current position in buffer */ lua_Reader reader; /* reader function */ - void* data; /* additional data */ + void *data; /* additional data */ lua_State *L; /* Lua state (for reader) */ }; diff --git a/3rdparty/genie/src/host/os_ticks.c b/3rdparty/genie/src/host/os_ticks.c new file mode 100644 index 00000000000..1d0588c8cbe --- /dev/null +++ b/3rdparty/genie/src/host/os_ticks.c @@ -0,0 +1,41 @@ +/** + * \file os_ticks.c + * \brief Return the system tick counter (in microsecond units). + */ + +#include <stdlib.h> +#include "premake.h" + +// Epochs used by Windows and Unix time APIs. These adjustments, +// when added to the time value returned by the OS, will yield +// the number of microsecond intervals since Jan 1, year 1. +#define TICK_EPOCH_WINDOWS ((lua_Integer)0x0701ce1722770000) +#define TICK_EPOCH_UNIX ((lua_Integer)0x00dcbffeff2bc000) + +#define TICKS_PER_SECOND ((lua_Integer)1000000) + +int os_ticks(lua_State* L) +{ + lua_Integer ticks = 0; + +#if PLATFORM_WINDOWS + FILETIME fileTimeUtc; + GetSystemTimeAsFileTime(&fileTimeUtc); + ticks = + TICK_EPOCH_WINDOWS + + ((lua_Integer)fileTimeUtc.dwHighDateTime << 32 + | (lua_Integer)fileTimeUtc.dwLowDateTime); + ticks /= (lua_Integer)10; +#else + struct timeval tp; + if (gettimeofday(&tp, NULL) == 0) { + ticks = + TICK_EPOCH_UNIX + + (lua_Integer)tp.tv_sec * TICKS_PER_SECOND + + (lua_Integer)tp.tv_usec; + } +#endif + + lua_pushinteger(L, ticks); + return 1; +} diff --git a/3rdparty/genie/src/host/premake.c b/3rdparty/genie/src/host/premake.c index 6a67371f901..b589903802d 100644 --- a/3rdparty/genie/src/host/premake.c +++ b/3rdparty/genie/src/host/premake.c @@ -56,6 +56,7 @@ static const luaL_Reg os_functions[] = { { "pathsearch", os_pathsearch }, { "rmdir", os_rmdir }, { "stat", os_stat }, + { "ticks", os_ticks }, { "uuid", os_uuid }, { NULL, NULL } }; diff --git a/3rdparty/genie/src/host/premake.h b/3rdparty/genie/src/host/premake.h index 4fa011d56cf..5f7ee2ca4d6 100644 --- a/3rdparty/genie/src/host/premake.h +++ b/3rdparty/genie/src/host/premake.h @@ -33,6 +33,7 @@ #include <windows.h> #else #include <unistd.h> +#include <sys/time.h> #endif @@ -63,6 +64,7 @@ int os_mkdir(lua_State* L); int os_pathsearch(lua_State* L); int os_rmdir(lua_State* L); int os_stat(lua_State* L); +int os_ticks(lua_State* L); int os_uuid(lua_State* L); int string_endswith(lua_State* L); diff --git a/3rdparty/genie/src/host/scripts.c b/3rdparty/genie/src/host/scripts.c index c08c2b2dc3a..85cadb1f9f1 100644 --- a/3rdparty/genie/src/host/scripts.c +++ b/3rdparty/genie/src/host/scripts.c @@ -21,8 +21,8 @@ const char* builtin_scripts[] = { "function string.explode(s, pattern, plain)\nif (pattern == '') then return false end\nlocal pos = 0\nlocal arr = { }\nfor st,sp in function() return s:find(pattern, pos, plain) end do\ntable.insert(arr, s:sub(pos, st-1))\npos = sp + 1\nend\ntable.insert(arr, s:sub(pos))\nreturn arr\nend\nfunction string.findlast(s, pattern, plain)\nlocal curr = 0\nrepeat\nlocal next = s:find(pattern, curr + 1, plain)\nif (next) then curr = next end\nuntil (not next)\nif (curr > 0) then\nreturn curr\nend\nend\nfunction string.startswith(haystack, needle)\nreturn (haystack:find(needle, 1, true) == 1)\nend\n", /* base/table.lua */ - "function table.contains(t, value)\nfor _,v in pairs(t) do\nif (v == value) then\nreturn true\nend\nend\nreturn false\nend\nfunction table.extract(arr, fname)\nlocal result = { }\nfor _,v in ipairs(arr) do\ntable.insert(result, v[fname])\nend\nreturn result\nend\nfunction table.flatten(arr)\nlocal result = { }\nlocal function flatten(arr)\nfor _, v in ipairs(arr) do\nif type(v) == \"table\" then\nflatten(v)\nelse\ntable.insert(result, v)\nend\nend\nend\nflatten(arr)\nreturn result\nend\nfunction table.implode(arr, before, after, between)\nlocal result = \"\"\nfor _,v in ipairs(arr) do\nif (result ~= \"\" and between) then\nresult = result .. between\nend\nresult = result .. before .. v .. after\nend\nreturn result\nend\nfunction table.insertflat(tbl, values)\nif type(values) == \"table\" then\nfor _, value in ipairs(values) do\ntable.insertflat(tbl, value)\nend\nelse\ntable.insert(tbl, values)\nend\nend\nfunction table.isempty(t)\nreturn next(t) == nil\nend\nfunction table.join(...)\nlocal arg={...}\nlocal resu" - "lt = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor _,v in ipairs(t) do\ntable.insert(result, v)\nend\nelse\ntable.insert(result, t)\nend\nend\nreturn result\nend\nfunction table.keys(tbl)\nlocal keys = {}\nfor k, _ in pairs(tbl) do\ntable.insert(keys, k)\nend\nreturn keys\nend\nfunction table.merge(...)\nlocal arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor k,v in pairs(t) do\nresult[k] = v\nend\nelse\nerror(\"invalid value\")\nend\nend\nreturn result\nend\nfunction table.translate(arr, translation)\nlocal result = { }\nfor _, value in ipairs(arr) do\nlocal tvalue\nif type(translation) == \"function\" then\ntvalue = translation(value)\nelse\ntvalue = translation[value]\nend\nif (tvalue) then\ntable.insert(result, tvalue)\nend\nend\nreturn result\nend\n", + "function table.contains(t, value)\nfor _, v in pairs(t) do\nif v == value then return true end\nend\nreturn false\nend\nfunction table.icontains(t, value)\nfor _, v in ipairs(t) do\nif v == value then return true end\nend\nreturn false\nend\nfunction table.extract(arr, fname)\nlocal result = { }\nfor _,v in ipairs(arr) do\ntable.insert(result, v[fname])\nend\nreturn result\nend\nfunction table.flatten(arr)\nlocal result = { }\nlocal function flatten(arr)\nfor _, v in ipairs(arr) do\nif type(v) == \"table\" then\nflatten(v)\nelse\ntable.insert(result, v)\nend\nend\nend\nflatten(arr)\nreturn result\nend\nfunction table.implode(arr, before, after, between)\nlocal result = \"\"\nfor _,v in ipairs(arr) do\nif (result ~= \"\" and between) then\nresult = result .. between\nend\nresult = result .. before .. v .. after\nend\nreturn result\nend\nfunction table.insertflat(tbl, values)\nif type(values) == \"table\" then\nfor _, value in ipairs(values) do\ntable.insertflat(tbl, value)\nend\nelse\ntable.insert(tbl, values)" + "\nend\nend\nfunction table.isempty(t)\nreturn next(t) == nil\nend\nfunction table.join(...)\nlocal arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor _,v in ipairs(t) do\ntable.insert(result, v)\nend\nelse\ntable.insert(result, t)\nend\nend\nreturn result\nend\nfunction table.keys(tbl)\nlocal keys = {}\nfor k, _ in pairs(tbl) do\ntable.insert(keys, k)\nend\nreturn keys\nend\nfunction table.merge(...)\nlocal arg={...}\nlocal result = { }\nfor _,t in ipairs(arg) do\nif type(t) == \"table\" then\nfor k,v in pairs(t) do\nresult[k] = v\nend\nelse\nerror(\"invalid value\")\nend\nend\nreturn result\nend\nfunction table.translate(arr, translation)\nlocal result = { }\nfor _, value in ipairs(arr) do\nlocal tvalue\nif type(translation) == \"function\" then\ntvalue = translation(value)\nelse\ntvalue = translation[value]\nend\nif (tvalue) then\ntable.insert(result, tvalue)\nend\nend\nreturn result\nend\n", /* base/io.lua */ "function io.capture()\nio.captured = ''\nend\nfunction io.endcapture()\nlocal captured = io.captured\nio.captured = nil\nreturn captured\nend\nlocal builtin_open = io.open\nfunction io.open(fname, mode)\nif (mode) then\nif (mode:find(\"w\")) then\nlocal dir = path.getdirectory(fname)\nok, err = os.mkdir(dir)\nif (not ok) then\nerror(err, 0)\nend\nend\nend\nreturn builtin_open(fname, mode)\nend\nfunction io.printf(msg, ...)\nlocal arg={...}\nif not io.eol then\nio.eol = \"\\n\"\nend\nif not io.indent then\nio.indent = \"\\t\"\nend\nif type(msg) == \"number\" then\ns = string.rep(io.indent, msg) .. string.format(table.unpack(arg))\nelse\ns = string.format(msg, table.unpack(arg))\nend\nif io.captured then\nio.captured = io.captured .. s .. io.eol\nelse\nio.write(s)\nio.write(io.eol)\nend\nend\n_p = io.printf\n", @@ -68,16 +68,16 @@ const char* builtin_scripts[] = { "n\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value)\nend\nelse\nfor _, item in ipairs(src) do\nif not tbl[item] then\ntable.insert(tbl, item)\n" "tbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function removevalues(tbl, removes)\nfor i=#tbl,1,-1 do\nfor _, pattern in ipairs(removes) do\nif pattern == tbl[i] then\ntable.remove(tbl, i)\nbreak\nend\nend\nend\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\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\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_lo" - "cal, 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, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\n" - "if 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 if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\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 --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 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],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function wi" - "ll 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.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray," - " foundList, cfg, cfgname, \"uses\", false);\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 --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\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 return false;\n end\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 if type(srcCfg[s" - "trSrcField]) == \"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 dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entr" - "ies 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 for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field 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 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 _, 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\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 removed = false\nfor _, removefname in ipairs(cfg.removefiles) do\nremoved = (fname == removefname)\nif (removed) then break end\nend\nif (not removed) 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", + "cal, 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, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir==true,num_variations-1,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 if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\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 --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 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],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This functi" + "on 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.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstA" + "rray, foundList, cfg, cfgname, \"uses\", false);\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 --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\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 return false;\n end\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 if type(src" + "Cfg[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 dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\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 for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field 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 buil" + "ding 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 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 _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in i" + "pairs(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\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal removef" + "iles = cfg.removefiles\nif _ACTION == 'gmake' then\nremovefiles = table.join(removefiles, cfg.excludes)\nend\nlocal files = {}\nfor _, fname in ipairs(cfg.files) do\nif not table.icontains(removefiles, fname) 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\nlocal fcfg = { }\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n", /* base/api.lua */ "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},\nbuildoptions_objc =\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" @@ -90,12 +90,12 @@ const char* builtin_scripts[] = { " 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\"\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, dep" "th)\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\nlocal arr = matchfunc(value);\nif (premake.check_paths) and (#arr == 0) then\nerror(\"Can't find matching files for pattern :\" .. value)\nend\nmakeabsolute(arr, depth + 1)\nelse\ntable.insert(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[fiel" "dname] = {}\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) 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.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})\ntable.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 createg" - "roupsfrompath(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 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.us" - "age = 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) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or\n((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\npremake.CurrentContainer = createproject(name, sln, true)\nelse\npremake.CurrentContainer = iff(sln.projects[name].usage,\nsln.projects[name], sln.projects[name].usageProj)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction project(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(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) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or sln.projects[name].usage) then\npremake.CurrentContainer = createproject(name, sln)\nelse\npremake.CurrentContainer = sln.projects[name];\nend\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.Curren" - "tGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n", + "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.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\"\nor info.kind == \"dirlist\"\nor info.kind == \"filelist\"\nor info.kind == \"absolu" + "tefilelist\"\nthen\nif name ~= \"removefiles\"\nand name ~= \"files\" then\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\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 = { }\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.paren" + "t = 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 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.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or\n((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\npremake.CurrentContainer = createproject(name, sln, true)\nelse\npremake.CurrentContainer = iff(sln.projects[name].usage,\nsln.projects[name], sln.projects[name].usageProj)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction project(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\ni" + "f(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) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or sln.projects[name].usage) then\npremake.CurrentContainer = createproject(name, sln)\nelse\npremake.CurrentContainer = sln.projects[name];\nend\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\nen" + "d\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n", /* base/cmdline.lua */ "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{" @@ -108,17 +108,17 @@ const char* builtin_scripts[] = { " 1\n end\n end\n return tableAppearances\nend\nlocal function parse_filter(filter)\n if type(filter) == 'function' then return filter end\n -- not a function, so it must be a table or table-like\n filter = type(filter) == 'table' and filter or {filter}\n local dictionary = {}\n for _,v in pairs(filter) do dictionary[v] = true end\n return function(x) return dictionary[x] end\nend\nlocal function makePath(path, key)\n local newPath, len = {}, #path\n for i=1, len do newPath[i] = path[i] end\n newPath[len+1] = key\n return newPath\nend\nfunction inspect(rootObject, options)\n options = options or {}\n local depth = options.depth or math.huge\n local filter = parse_filter(options.filter or {})\n local tableAppearances = countTableAppearances(rootObject)\n local buffer = {}\n local maxIds = setmetatable({}, maxIdsMetaTable)\n local ids = setmetatable({}, idsMetaTable)\n local level = 0\n local blen = 0 -- buffer length\n local function puts(...)\n local args = {...}\n " "for i=1, #args do\n blen = blen + 1\n buffer[blen] = tostring(args[i])\n end\n end\n local function down(f)\n level = level + 1\n f()\n level = level - 1\n end\n local function tabify()\n puts(\"\\n\", string.rep(\" \", level))\n end\n local function commaControl(needsComma)\n if needsComma then puts(',') end\n return true\n end\n local function alreadyVisited(v)\n return ids[type(v)][v] ~= nil\n end\n local function getId(v)\n local tv = type(v)\n local id = ids[tv][v]\n if not id then\n id = maxIds[tv] + 1\n maxIds[tv] = id\n ids[tv][v] = id\n end\n return id\n end\n local putValue -- forward declaration that needs to go before putTable & putKey\n local function putKey(k)\n if isIdentifier(k) then return puts(k) end\n puts( \"[\" )\n putValue(k, {})\n puts(\"]\")\n end\n local function putTable(t, path)\n if alreadyVisited(t) then\n puts('<table ', getId(t), '>')\n elseif level >= depth then\n " "puts('{...}')\n else\n if tableAppearances[t] > 1 then puts('<', getId(t), '>') end\n local dictKeys = getDictionaryKeys(t)\n local length = #t\n local mt = getmetatable(t)\n local to_string_result = getToStringResultSafely(t, mt)\n puts('{')\n down(function()\n if to_string_result then\n puts(' -- ', escape(to_string_result))\n if length >= 1 then tabify() end -- tabify the array values\n end\n local needsComma = false\n for i=1, length do\n needsComma = commaControl(needsComma)\n puts(' ')\n putValue(t[i], makePath(path, i))\n end\n for _,k in ipairs(dictKeys) do\n needsComma = commaControl(needsComma)\n tabify()\n putKey(k)\n puts(' = ')\n putValue(t[k], makePath(path, k))\n end\n if mt then\n needsComma = commaControl(needsComma)\n tabify()\n puts('<metatable> = '" - ")\n putValue(mt, makePath(path, '<metatable>'))\n end\n end)\n if #dictKeys > 0 or mt then -- dictionary table. Justify closing }\n tabify()\n elseif length > 0 then -- array tables have one extra space before closing }\n puts(' ')\n end\n puts('}')\n end\n end\n -- putvalue is forward-declared before putTable & putKey\n putValue = function(v, path)\n if filter(v, path) then\n puts('<filtered>')\n else\n local tv = type(v)\n if tv == 'string' then\n puts(smartQuote(escape(v)))\n elseif tv == 'number' or tv == 'boolean' or tv == 'nil' then\n puts(tostring(v))\n elseif tv == 'table' then\n putTable(v, path)\n else\n puts('<',tv,' ',getId(v),'>')\n end\n end\n end\n putValue(rootObject, {})\n return table.concat(buffer)\nend\nfunction printtable(name, table)\nprint(\"--- \" .. name)\nprint(inspect(table))\nprint(\"---\")\nend\n", + ")\n putValue(mt, makePath(path, '<metatable>'))\n end\n end)\n if #dictKeys > 0 or mt then -- dictionary table. Justify closing }\n tabify()\n elseif length > 0 then -- array tables have one extra space before closing }\n puts(' ')\n end\n puts('}')\n end\n end\n -- putvalue is forward-declared before putTable & putKey\n putValue = function(v, path)\n if filter(v, path) then\n puts('<filtered>')\n else\n local tv = type(v)\n if tv == 'string' then\n puts(smartQuote(escape(v)))\n elseif tv == 'number' or tv == 'boolean' or tv == 'nil' then\n puts(tostring(v))\n elseif tv == 'table' then\n putTable(v, path)\n else\n puts('<',tv,' ',getId(v),'>')\n end\n end\n end\n putValue(rootObject, {})\n return table.concat(buffer)\nend\nfunction printtable(name, table)\nprint(\"table: \", name, inspect(table), \"\\n\")\nend\nfunction printstack()\nprint(debug.traceback(), \"\\n\")\nend\n", /* tools/dotnet.lua */ "premake.dotnet = { }\npremake.dotnet.namestyle = \"windows\"\nlocal flags =\n{\nFatalWarning = \"/warnaserror\",\nOptimize = \"/optimize\",\nOptimizeSize = \"/optimize\",\nOptimizeSpeed = \"/optimize\",\nSymbols = \"/debug\",\nUnsafe = \"/unsafe\"\n}\nfunction premake.dotnet.getbuildaction(fcfg)\nlocal ext = path.getextension(fcfg.name):lower()\nif fcfg.buildaction == \"Compile\" or ext == \".cs\" then\nreturn \"Compile\"\nelseif fcfg.buildaction == \"Embed\" or ext == \".resx\" then\nreturn \"EmbeddedResource\"\nelseif fcfg.buildaction == \"Copy\" or ext == \".asax\" or ext == \".aspx\" then\nreturn \"Content\"\nelse\nreturn \"None\"\nend\nend\nfunction premake.dotnet.getcompilervar(cfg)\nif (_OPTIONS.dotnet == \"msnet\") then\nreturn \"csc\"\nelseif (_OPTIONS.dotnet == \"mono\") then\nif (cfg.framework <= \"1.1\") then\nreturn \"mcs\"\nelseif (cfg.framework >= \"4.0\") then\nreturn \"dmcs\"\nelse \nreturn \"gmcs\"\nend\nelse\nreturn \"cscc\"\nend\nend\nfunction premake.dotnet.getfla" "gs(cfg)\nlocal result = table.translate(cfg.flags, flags)\nreturn result\nend\nfunction premake.dotnet.getkind(cfg)\nif (cfg.kind == \"ConsoleApp\") then\nreturn \"Exe\"\nelseif (cfg.kind == \"WindowedApp\") then\nreturn \"WinExe\"\nelseif (cfg.kind == \"SharedLib\") then\nreturn \"Library\"\nend\nend", /* tools/gcc.lua */ - "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\npremake.gcc.platforms =\n{\nNative = {\ncppflags = \"-MMD\",\n},\nx32 = {\ncppflags = \"-MMD\",\nflags = \"-m32\",\nldflags = \"-L/usr/lib32\",\n},\nx64 = {\ncppflags = \"-MMD\",\nflags = \"-m64\",\nldflags = \"-L/usr/lib64\",\n},\nUniversal = {\ncppflags = \"\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\ncppflags = \"\",\nflags " - " = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\ncppflags = \"\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result" - "\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result = table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-Wl,-x\")\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.ins" - "ert(result, '-L' .. _MAKE.esc(value))\nend\nreturn result\nend\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"name\")) do\nif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, '-D' .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\" .. _MAKE.esc(dir))\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n", + "premake.gcc = { }\npremake.gcc.cc = \"gcc\"\npremake.gcc.cxx = \"g++\"\npremake.gcc.ar = \"ar\"\npremake.gcc.llvm = false\nlocal cflags =\n{\nEnableSSE = \"-msse\",\nEnableSSE2 = \"-msse2\",\nExtraWarnings = \"-Wall -Wextra\",\nFatalWarnings = \"-Werror\",\nFloatFast = \"-ffast-math\",\nFloatStrict = \"-ffloat-store\",\nNoFramePointer = \"-fomit-frame-pointer\",\nOptimize = \"-O2\",\nOptimizeSize = \"-Os\",\nOptimizeSpeed = \"-O3\",\nSymbols = \"-g\",\n}\nlocal cxxflags =\n{\nNoExceptions = \"-fno-exceptions\",\nNoRTTI = \"-fno-rtti\",\nUnsignedChar = \"-funsigned-char\",\n}\npremake.gcc.platforms =\n{\nNative = {\ncppflags = \"-MMD\",\n},\nx32 = {\ncppflags = \"-MMD\",\nflags = \"-m32\",\n},\nx64 = {\ncppflags = \"-MMD\",\nflags = \"-m64\",\n},\nUniversal = {\ncppflags = \"\",\nflags = \"-arch i386 -arch x86_64 -arch ppc -arch ppc64\",\n},\nUniversal32 = {\ncppflags = \"\",\nflags = \"-arch i386 -arch ppc\",\n},\nUniversal64 = {\ncppflags" + " = \"\",\nflags = \"-arch x86_64 -arch ppc64\",\n},\nPS3 = {\ncc = \"ppu-lv2-g++\",\ncxx = \"ppu-lv2-g++\",\nar = \"ppu-lv2-ar\",\ncppflags = \"-MMD\",\n},\nWiiDev = {\ncppflags = \"-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)\",\nldflags= \"-L$(LIBOGC_LIB) $(MACHDEP)\",\ncfgsettings = [[\n ifeq ($(strip $(DEVKITPPC)),)\n $(error \"DEVKITPPC environment variable is not set\")'\n endif\n include $(DEVKITPPC)/wii_rules']],\n},\n}\nlocal platforms = premake.gcc.platforms\nfunction premake.gcc.getcppflags(cfg)\nlocal flags = { }\ntable.insert(flags, platforms[cfg.platform].cppflags)\nif flags[1]:startswith(\"-MMD\") then\ntable.insert(flags, \"-MP\")\nend\nreturn flags\nend\nfunction premake.gcc.getcflags(cfg)\nlocal result = table.translate(cfg.flags, cflags)\ntable.insert(result, platforms[cfg.platform].flags)\nif cfg.system ~= \"windows\" and cfg.kind == \"SharedLib\" then\ntable.insert(result, \"-fPIC\")\nend\nreturn result\nend\nfunction premake.gcc.getcxxflags(cfg)\nlocal result =" + " table.translate(cfg.flags, cxxflags)\nreturn result\nend\nfunction premake.gcc.getldflags(cfg)\nlocal result = { }\nif not cfg.flags.Symbols then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-Wl,-x\")\nelse\ntable.insert(result, \"-s\")\nend\nend\nif cfg.kind == \"SharedLib\" then\nif cfg.system == \"macosx\" then\ntable.insert(result, \"-dynamiclib\")\nelse\ntable.insert(result, \"-shared\")\nend\nif cfg.system == \"windows\" and not cfg.flags.NoImportLib then\ntable.insert(result, '-Wl,--out-implib=\"' .. cfg.linktarget.fullpath .. '\"')\nend\nend\nif cfg.kind == \"WindowedApp\" and cfg.system == \"windows\" then\ntable.insert(result, \"-mwindows\")\nend\nlocal platform = platforms[cfg.platform]\ntable.insert(result, platform.flags)\ntable.insert(result, platform.ldflags)\nreturn result\nend\nfunction premake.gcc.getlibdirflags(cfg)\nlocal result = { }\nfor _, value in ipairs(premake.getlinks(cfg, \"all\", \"directory\")) do\ntable.insert(result, '-L' .. _MAKE.esc(value))\nend\nreturn result\ne" + "nd\nfunction premake.gcc.getlinkflags(cfg)\nlocal result = {}\nfor _, value in ipairs(premake.getlinks(cfg, \"system\", \"name\")) do\nif path.getextension(value) == \".framework\" then\ntable.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))\nelse\ntable.insert(result, '-l' .. _MAKE.esc(value))\nend\nend\nreturn result\nend\nfunction premake.gcc.getdefines(defines)\nlocal result = { }\nfor _,def in ipairs(defines) do\ntable.insert(result, '-D' .. def)\nend\nreturn result\nend\nfunction premake.gcc.getincludedirs(includedirs)\nlocal result = { }\nfor _,dir in ipairs(includedirs) do\ntable.insert(result, \"-I\" .. _MAKE.esc(dir))\nend\nreturn result\nend\nfunction premake.gcc.getcfgsettings(cfg)\nreturn platforms[cfg.platform].cfgsettings\nend\n", /* tools/msc.lua */ "premake.msc = { }\npremake.msc.namestyle = \"windows\"\n", @@ -180,16 +180,16 @@ const char* builtin_scripts[] = { /* actions/make/make_cpp.lua */ "premake.make.cpp = { }\npremake.make.override = { }\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nlocal objdirs = {}\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in pairs(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('al" - "l: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then \nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\n_" - "p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(OBJDIR)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n" - "_p('\\t$(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(' COP" - "Y = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM= $(SILENT) rm -f \"$(1)\"')\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(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\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(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)" - ")\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. '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(prj, cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, file 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 platform = 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.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, 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 c" - "fg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif (not prj.options.ArchiveSplit) then\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) qc $(TARGET)')\n_p(' LINKCMD_NDX= $(AR) cs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -qc $(TARGET)')\n_p(' LINKCMD_NDX= $(AR) -cs $(TARGET)')\nend\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))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbrea" - "k\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 (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\ncpp.buildcommand(path.i" - "scfile(file) and not prj.options.ForceCPP, \"o\")\nend\n_p('')\nelseif (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", + "l: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\n_p" + "('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('" + "\\t$(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 =" + " $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM= $(SILENT) rm -f \"$(1)\"')\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(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\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(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_" + "p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. '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(prj, cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nif not table.icontains(cfg.excludes, file) 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 POSTBUILD" + "CMDS')\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 platform = 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.buildopt" + "ions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, 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 $(TAR" + "GET)')\nelse\nif (not prj.options.ArchiveSplit) then\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) qc $(TARGET)')\n_p(' LINKCMD_NDX= $(AR) cs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -qc $(TARGET)')\n_p(' LINKCMD_NDX= $(AR) -cs $(TARGET)')\nend\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))\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\nfu" + "nction 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 (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\n_p('')\nelseif (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", /* actions/make/make_csharp.lua */ "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" @@ -263,16 +263,15 @@ const char* builtin_scripts[] = { "seFileName>'\n, path.getbasename(cfg.buildtarget.name))\nend\nif cfg.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable" ".concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(cfg)\n -- The Xbox360 project files are stored in another place in the project file.\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\n_p(1,'</Lib>')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nfunction vc2010.link(cfg)\n_p(2,'<Link>')\n_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\n_p" "(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nif premake.config.isoptimizedbuild(cfg.flags) then\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(cfg)\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\nif #cfg.libdirs > 0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',\npremake.esc(path.translate(table.concat(cfg.libdirs, ';'), '\\\\')))\nend\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')\nelse\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffil" - "e)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nend\n_p(2,'</Link>')\nend\nfunction vc2010.additionalDependencies(cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',\ntable.concat(links, \";\"))\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction exists(table, fine)\nfor _, value in ipairs(table) do\nif value == find then return true end\nend\nreturn false\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {}," - "\nClInclude = {},\nNone = {},\nResourceCompile = {},\n AppxManifest = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj) do\nif path.iscppfile(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not exists(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelse\n local ext = path.getextension(file.name):lower()\n if ext == \".appxmanifest\" then\nfoundAppxManifest = true\n table.insert(sortedfiles.AppxManifest, file)\n else\n table.insert(sortedfiles.None, file)\n end\nend\nend\nif vstudio.toolset == \"v120_wp81\" and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \".appxmanifest\"\nfcfg.vpath = premake.project." - "getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\n vc2010.simplefilesgroup(prj, \"AppxManifest\")\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\n if subtype then\n _p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n _p(3,'<SubType>%s</SubType>', subtype)\n _p(2,'</%s>', section)\n else\n _p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\n end\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(" - "prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\n_p(3, '<ObjectFileName>$(IntDir)%s.obj</ObjectFileName>'\n, premake.esc(path.translate(path.trimdots(path.removeext(file.name))))\n)\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend" - "\nend\nlocal excluded = false\nfor _, exclude in ipairs(prj.excludes) do\nif exclude == file.name then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nexcluded = true\nbreak\nend\nend\nif not excluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nfor _, exclude in ipairs(cfg.excludes) do\nif exclude == file.name then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"4.0" - "\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t)\nend\nfunction premake.vs2010_vcxproj(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.projectReferences(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.g" - "etdependencies(prj)\nif #deps > 0 then\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.toolset == \"v120_wp81\" then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nif cfg.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>', path.translate(cfg.debugdir, '\\\\'))\n_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')\nend\nif cfg.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>', table.concat(cfg.debugargs, \" \"))\nend\nend\nfunction vc2010.debugenvs(cfg)\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(cfg.debugenvs, " - "\"\\n\")\n,iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)','')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\nvc2010.debugenvs(cfg)\n_p(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">')\n_p(1,'<Ide" - "ntity Name=\"' .. prj.uuid .. '\"')\n_p(2,'Publisher=\"CN=Unknown\"')\n_p(2,'Version=\"1.0.0.0\" />')\n_p(1,'<mp:PhoneIdentity PhoneProductId=\"' .. prj.uuid .. '\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\n_p(1,'<Properties>')\n_p(2,'<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2,'<PublisherDisplayName>Unknown</PublisherDisplayName>')\n_p(2,'<Logo>EmptyLogo.png</Logo>')\n_p(1,'</Properties>')\n_p(1,'<Prerequisites>')\n_p(2,'<OSMinVersion>6.3.1</OSMinVersion>')\n_p(2,'<OSMaxVersionTested>6.3.1</OSMaxVersionTested>')\n_p(1,'</Prerequisites>')\n_p(1,'<Resources>')\n_p(2,'<Resource Language=\"x-generate\"/>')\n_p(1,'</Resources>')\n_p(1,'<Applications>')\n_p(2,'<Application Id=\"App\"')\n_p(3,'Executable=\"$targetnametoken$.exe\"')\n_p(3,'EntryPoint=\"App\">')\n_p(3,'<m3:VisualElements')\n_p(4,'DisplayName=\"Blah\"')\n_p(4,'Square150x150Logo=\"Assets\\\\Logo.png\"')\n_p(4,'Square44x44Logo=\"Assets\\\\SmallLogo.png\"')\n_p(4,'Description=\"Blah\"')\n_p(4,'ForegroundText=\"light\"')\n_p(" - "4,'BackgroundColor=\"transparent\">')\n_p(3,'</m3:VisualElements>')\n_p(2,'</Application>')\n_p(1,'</Applications>')\n_p('</Package>')\nend\n", + "e)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nend\n_p(2,'</Link>')\nend\nfunction vc2010.additionalDependencies(cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',\ntable.concat(links, \";\"))\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nNone = {},\nResourceCompile = {},\nAppxManifest = {}\n}\nlocal foundAppxManifest = false\nfor file in premak" + "e.project.eachfile(prj) do\nif path.iscppfile(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not table.icontains(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelse\nlocal ext = path.getextension(file.name):lower()\nif ext == \".appxmanifest\" then\nfoundAppxManifest = true\ntable.insert(sortedfiles.AppxManifest, file)\nelse\ntable.insert(sortedfiles.None, file)\nend\nend\nend\nif vstudio.toolset == \"v120_wp81\" and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \".appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfil" + "esgroup(prj)\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\nvc2010.simplefilesgroup(prj, \"AppxManifest\")\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nif subtype then\n_p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n_p(3,'<SubType>%s</SubType>', subtype)\n_p(2,'</%s>', section)\nelse\n_p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\nend\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo" + "] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\n_p(3, '<ObjectFileName>$(IntDir)%s.obj</ObjectFileName>'\n, premake.esc(path.translate(path.trimdots(path.removeext(file.name))))\n)\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nlocal excluded = table.icontains(prj.excludes, file.name)\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nif excluded or table.icontains(cfg.excludes, file.name) then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.n" + "ame)\n)\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t)\nend\nfunction premake.vs2010_vcxproj(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_def" + "initions(prj)\nvc2010.files(prj)\nvc2010.projectReferences(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.toolset == \"v120_wp81\" then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nif cfg.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>', path.translate(cfg.debugdir, '\\\\'))\n_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')\nend\nif cfg.debugargs th" + "en\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>', table.concat(cfg.debugargs, \" \"))\nend\nend\nfunction vc2010.debugenvs(cfg)\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(cfg.debugenvs, \"\\n\")\n,iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)','')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\nvc2010.debugenvs(cfg)\n_p(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" " + "encoding=\"utf-8\"?>')\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">')\n_p(1,'<Identity Name=\"' .. prj.uuid .. '\"')\n_p(2,'Publisher=\"CN=Unknown\"')\n_p(2,'Version=\"1.0.0.0\" />')\n_p(1,'<mp:PhoneIdentity PhoneProductId=\"' .. prj.uuid .. '\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\n_p(1,'<Properties>')\n_p(2,'<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2,'<PublisherDisplayName>Unknown</PublisherDisplayName>')\n_p(2,'<Logo>EmptyLogo.png</Logo>')\n_p(1,'</Properties>')\n_p(1,'<Prerequisites>')\n_p(2,'<OSMinVersion>6.3.1</OSMinVersion>')\n_p(2,'<OSMaxVersionTested>6.3.1</OSMaxVersionTested>')\n_p(1,'</Prerequisites>')\n_p(1,'<Resources>')\n_p(2,'<Resource Language=\"x-generate\"/>')\n_p(1,'</Resources>')\n_p(1,'<Applications>')\n_p(2,'<Application Id=\"App\"')\n_p(3," + "'Executable=\"$targetnametoken$.exe\"')\n_p(3,'EntryPoint=\"App\">')\n_p(3,'<m3:VisualElements')\n_p(4,'DisplayName=\"Blah\"')\n_p(4,'Square150x150Logo=\"Assets\\\\Logo.png\"')\n_p(4,'Square44x44Logo=\"Assets\\\\SmallLogo.png\"')\n_p(4,'Description=\"Blah\"')\n_p(4,'ForegroundText=\"light\"')\n_p(4,'BackgroundColor=\"transparent\">')\n_p(3,'</m3:VisualElements>')\n_p(2,'</Application>')\n_p(1,'</Applications>')\n_p('</Package>')\nend\n", /* actions/vstudio/vs2010_vcxproj_filters.lua */ "local vc2010 = premake.vstudio.vc2010\nlocal project = premake.project\nfunction vc2010.filteridgroup(prj)\nlocal filters = { }\nlocal filterfound = false\nfor file in project.eachfile(prj) do\nlocal folders = string.explode(file.vpath, \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'<ItemGroup>')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '<Filter Include=\"%s\">', path)\n_p(3, '<UniqueIdentifier>{%s}</UniqueIdentifier>', os.uuid())\n_p(2, '</Filter>')\nend\npath = path .. \"\\\\\"\nend\nend\nif filterfound then\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.filefiltergroup(prj, section)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal filter\nif file.name ~= file.vpath then\nfilter = path.getdirectory(file.vpath)\nelse\nfilter = path.getdirectory(file.name)\nend\nif filter ~= \".\" then\n_p(2,'<%s Include=\\\"%s\\\">', " diff --git a/3rdparty/genie/src/host/version.h b/3rdparty/genie/src/host/version.h index 5004a1895e9..3bb0fa19180 100644 --- a/3rdparty/genie/src/host/version.h +++ b/3rdparty/genie/src/host/version.h @@ -1,2 +1,2 @@ -#define VERSION 38 -#define VERSION_STR "version 38 (commit c20199995d9bd33aa6aa5bbccf3153c12188f14a)" +#define VERSION 249 +#define VERSION_STR "version 249 (commit 206f5f691d3b9fe7461c07c466dcddd69cdd478a)" diff --git a/3rdparty/genie/src/tools/gcc.lua b/3rdparty/genie/src/tools/gcc.lua index 16c1bf7de1a..cf82c6ad9d5 100644 --- a/3rdparty/genie/src/tools/gcc.lua +++ b/3rdparty/genie/src/tools/gcc.lua @@ -57,12 +57,10 @@ x32 = { cppflags = "-MMD", flags = "-m32", - ldflags = "-L/usr/lib32", }, x64 = { cppflags = "-MMD", flags = "-m64", - ldflags = "-L/usr/lib64", }, Universal = { cppflags = "", @@ -165,7 +163,7 @@ local platform = platforms[cfg.platform] table.insert(result, platform.flags) table.insert(result, platform.ldflags) - + return result end diff --git a/docs/hlsl.txt b/docs/hlsl.txt index f87d173aba3..a2d5f652b2b 100644 --- a/docs/hlsl.txt +++ b/docs/hlsl.txt @@ -11,7 +11,7 @@ hlslpath [path] Path to the .fx files that are in use. hlsl_prescale_x [horizontal] HLSL pre-scale override factor for X. (0 for auto) hlsl_prescale_y [vertical] HLSL pre-scale override factor for Y. (0 for auto) hlsl_preset -1 through 3 HLSL preset to use. (default: -1) -hlsl_write 0/1 Enable HLSL AVI writing. (huge disk bandwidth suggested) +hlsl_write [filename] Enable HLSL AVI writing. (huge disk bandwidth suggested) hlsl_snap_width [width] HLSL upscaled-snapshot width. (default: 2048) hlsl_snap_height [height] HLSL upscaled-snapshot height. (default: 1536) diff --git a/hash/abc80_cass.xml b/hash/abc80_cass.xml new file mode 100644 index 00000000000..ac568c36b37 --- /dev/null +++ b/hash/abc80_cass.xml @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<softwarelist name="abc80_cass" description="Luxor ABC 80 cassettes"> + + <software name="abcdemo"> + <description>ABCDemo</description> + <year>2015</year> + <publisher>Genesis Project</publisher> + + <part name="cass1" interface="abc80_cass"> + <dataarea name="cass" size="10793090"> + <rom name="genesisproject_abcdemo.wav" size="10793090" crc="7642349f" sha1="a0a808e9c9c5f3ca162ef22869600e1c735846c2" offset="0" /> + </dataarea> + </part> + </software> + +</softwarelist>
\ No newline at end of file diff --git a/hash/abc80.xml b/hash/abc80_flop.xml index df6571b5c07..eee09a7527e 100644 --- a/hash/abc80.xml +++ b/hash/abc80_flop.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> -<softwarelist name="abc80" description="Luxor ABC 80 diskettes"> +<softwarelist name="abc80_flop" description="Luxor ABC 80 diskettes"> <software name="cpm" supported="no"> <description>CP/M BIOS 3.7</description> @@ -71,4 +71,16 @@ </part> </software> + <software name="abcdemo"> + <description>ABCDemo</description> + <year>2015</year> + <publisher>Genesis Project</publisher> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="163840"> + <rom name="genesisproject_abcdemo.dsk" size="163840" crc="29059d3c" sha1="55b38436a2d3cfe1caf8e35e44775402a1511eec" offset="0" /> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/n64dd.xml b/hash/n64dd.xml index a00f2370c31..7ea1a787e97 100644 --- a/hash/n64dd.xml +++ b/hash/n64dd.xml @@ -1,28 +1,178 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> <softwarelist name="n64dd" description="Nintendo 64 DD disks"> + <software name="dezaemon"> - <description>Dezaemon DD (Jpn, Prototype Rev 199802xx)</description> + <description>Dezaemon DD (Prototype Rev 199802xx)</description> <year>1998</year> <publisher>Athena</publisher> <info name="usage" value="Requires Dezaemon 3D cart" /> - + <info name="serial" value="NUD-DPGJ-JPN" /> <part name="disk" interface="n64dd_disk"> - <dataarea name="rom" size="64458560"> - <rom name="dezaemon.bin" size="64458560" crc="ccb84a39" sha1="d5cc4ab1fc79e27e54a9ad08c4dee47256352006" offset="0" /> + <dataarea name="rom" size="70627520"> + <rom name="dezaemon.bin" size="70627520" crc="8648a5e0" sha1="195426bc24501edfdfd36e3f75658b641738b8e3" offset="0" /> </dataarea> </part> </software> <software name="fzerox"> - <description>F-Zero X Expansion Kit (Jpn)</description> + <description>F-Zero X Expansion Kit</description> <year>2000</year> <publisher>Nintendo</publisher> <info name="usage" value="Requires F-Zero X cart" /> + <info name="serial" value="NUD-EFZJ-JPN" /> + <info name="release" value="20000421" /> + <info name="alt_title" value="エフ ゼロ エックス エクスパンションキット" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="f-zero x expansion kit [nud-efzj-jpn].bin" size="70627520" crc="9ab91e71" sha1="7b39677dad61b2fb91eb2ede756fbd3b49f15afe" offset="0" /> + </dataarea> + </part> + </software> + + <software name="progolf"> + <description>Nihon Pro Golf Tour 64</description> + <year>2000</year> + <publisher>Seta</publisher> + <info name="serial" value="NUD-DPGJ-JPN" /> + <info name="release" value="20000502" /> + <info name="alt_title" value="日本プロゴルフツアー" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="japan pro golf tour 64 [nud-dpgj-jpn].bin" size="70627520" crc="9190e021" sha1="08c7488d5fad40f7760316884823d686c5cae81f" offset="0" /> + </dataarea> + </part> + </software> + + <software name="kdoshin"> + <description>Kyojin no Doshin 1</description> + <year>1999</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DKDJ-JPN" /> + <info name="release" value="19991211" /> + <info name="alt_title" value="巨人のドシン1" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="kyojin no doshin [nud-dkdj-jpn].bin" size="70627520" crc="7df88308" sha1="204f6594a227e025b018594d7428c6a9e7ba39cb" offset="0" /> + </dataarea> + </part> + </software> + <software name="kdoshind" cloneof="kdoshin"> + <description>Kyojin no Doshin (Store Demo)</description> + <year>1999?</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DKIJ-JPN" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="kyojin no doshin demo [nud-dkij-jpn].bin" size="70627520" crc="bf29f471" sha1="c8a2e6d1e72b02cacccc2ef590258632f4903919" offset="0" /> + </dataarea> + </part> + </software> + + <software name="kdoshin2"> + <description>Kyojin no Doshin - Kaihou Sensen Chibikko Chikko Daishuugou</description> + <year>2000</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DKKJ-JPN" /> + <info name="release" value="20000517" /> + <info name="alt_title" value="巨人のドシン。 解放戦線チビッコチッコ大集合" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="kyojin no doshin - kaihou sensen chibikko chikko daishuugou [nud-dkkj-jpn].bin" size="70627520" crc="809550ea" sha1="9e570783e6119b3790cffb4b7a5d0e31325959d0" offset="0" /> + </dataarea> + </part> + </software> + + <software name="mariartc"> + <description>Mario Artist - Communication Kit</description> + <year>2000</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DMBJ-JPN" /> + <info name="release" value="20000629" /> + <info name="alt_title" value="マリオアーティスト。 コミュニケーションキット" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="mario artist - communication kit [nud-dmbj-jpn].bin" size="70627520" crc="5e088759" sha1="b00f0cfd523be8830d03f4f471dfa6ebb0900207" offset="0" /> + </dataarea> + </part> + </software> + + <software name="mariartp"> + <description>Mario Artist - Paint Studio</description> + <year>1999</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DMPJ-JPN" /> + <info name="release" value="19991211" /> + <info name="alt_title" value="マリオアーティスト。 ペイントスタジオ" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="mario artist - paint studio [nud-dmpj-jpn].bin" size="70627520" crc="3e3f3e21" sha1="6478c4ebe47aaad3da1087de66e2c1a476706855" offset="0" /> + </dataarea> + </part> + </software> + + <software name="mariartg"> + <description>Mario Artist - Polygon Studio</description> + <year>2000</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DMGJ-JPN" /> + <info name="release" value="20000829" /> + <info name="alt_title" value="マリオアーティスト。 ポリゴンスタジオ" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="mario artist - polygon studio [nud-dmgj-jpn].bin" size="70627520" crc="71a517c1" sha1="106f05379c56a69e8a20dc8c6eb7e76fc77f6927" offset="0" /> + </dataarea> + </part> + </software> + + <software name="mariartt"> + <description>Mario Artist - Talent Studio</description> + <year>2000</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DMTJ-JPN" /> + <info name="release" value="20000223" /> + <info name="alt_title" value="マリオアーティスト。 タレントスタジオ" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="mario artist - talent studio [nud-dmtj-jpn].bin" size="70627520" crc="f8803e76" sha1="e90fd7b98b0275d4c5135fcb22e86b1b46458993" offset="0" /> + </dataarea> + </part> + </software> + + <software name="randnet"> + <description>Randnet Browser</description> + <year>19??</year> + <publisher><unknown></publisher> + <info name="serial" value="NUD-DRDJ-JPN" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="randnet browser [nud-drdj-jpn].bin" size="70627520" crc="5e08cf47" sha1="516679e171e100fdbf95a1991ae8280c387bfdaf" offset="0" /> + </dataarea> + </part> + </software> + + <software name="simcity"> + <description>Sim City 64</description> + <year>2000</year> + <publisher>Nintendo</publisher> + <info name="serial" value="NUD-DSCJ-JPN" /> + <info name="release" value="20000223" /> + <info name="alt_title" value="シムシティー64" /> + <part name="disk" interface="n64dd_disk"> + <dataarea name="rom" size="70627520"> + <rom name="sim city 64 [nud-dscj-jpn].bin" size="70627520" crc="0b253f8f" sha1="ebac4aaa4737f1fa58453fbb7bfb05b8012c5d3d" offset="0" /> + </dataarea> + </part> + </software> + + <software name="sm64"> + <description>Super Mario 64</description> + <year>19??</year> + <publisher>Nintendo</publisher> <part name="disk" interface="n64dd_disk"> - <dataarea name="rom" size="67108864"> - <rom name="fzeroxe.bin" size="67108864" crc="a4a24ab0" sha1="c5845f582bc238e081588e172ef8ec50512e969d" offset="0" /> + <dataarea name="rom" size="70627520"> + <rom name="sm64disk.bin" size="70627520" crc="93921e57" sha1="1539ef4055762eab35acc5953911baef160b8c56" offset="0" /> </dataarea> </part> </software> diff --git a/hash/nes.xml b/hash/nes.xml index cac46e99d03..d007b53569b 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -57391,7 +57391,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx <publisher>Union Bond</publisher> <info name="serial" value="G-0005"/> <part name="cart" interface="nes_cart"> - <feature name="slot" value="nanjing" /> <!-- header actually says 164... --> + <feature name="slot" value="nanjing" /> <!-- header actually says 164... --> <feature name="pcb" value="UNL-NANJING" /> <dataarea name="prg" size="524288"> <rom name="ying tao xiao wan zi (g-005) (ch).prg" size="524288" crc="8209ba79" sha1="fa56608d8dcf5a144dd1fc81282cd86fd51060fe" offset="00000" status="baddump" /> @@ -75420,7 +75420,7 @@ be better to redump them properly. --> <year>19??</year> <publisher><unknown></publisher> <part name="cart" interface="nes_cart"> - <feature name="slot" value="fk23ca" /> <!-- UNIF header pointed to FK23C, but the menu does not appear with that mapper... investigate! --> + <feature name="slot" value="fk23ca" /> <!-- UNIF header pointed to FK23C, but the menu does not appear with that mapper... investigate! --> <feature name="pcb" value="BMC-FK23C" /> <dataarea name="prg" size="8388608"> <rom name="120-in-1 (unl)[u].prg" size="8388608" crc="678de5aa" sha1="01da22ddf1897b47d6b03ecb4ff0c093f9b39dfc" offset="00000" status="baddump" /> diff --git a/hash/pasogo.xml b/hash/pasogo.xml index e1242fb909f..b2544669957 100644 --- a/hash/pasogo.xml +++ b/hash/pasogo.xml @@ -9,7 +9,7 @@ 歴代棋聖戦名曲集 (Rekidai Kisei Sen Meikyokushuu) 棋界覇王伝・古典編 (Kikai Haoh Den - Koten-hen) 棋界覇王伝・現代編 (Kikai Haoh Den - Gendai-hen) - + The undumped cart numbers are KS-1005, KS-1006, KS-1007 and KS-1008 For the remaining undumped games, the game to cart number match is unknown. --> diff --git a/hash/pc88va.xml b/hash/pc88va.xml index d681c442dcf..db18d66a1ed 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -148,7 +148,7 @@ PC88VA doujin games (mostly undumped) </software> - <software name="Micromus" supported="no"> + <software name="micromus" supported="no"> <description>Micromusician VA</description> <year>19??</year> <publisher><unknown></publisher> diff --git a/hash/pet_rom.xml b/hash/pet_rom.xml index 2f7cf099a17..f6b415e3271 100644 --- a/hash/pet_rom.xml +++ b/hash/pet_rom.xml @@ -104,6 +104,18 @@ </part> </software> + <software name="mcterm110" cloneof="mcterm"> + <description>McTerm 1.10</description> + <year>1981</year> + <publisher>Madison Computer</publisher> + + <part name="rom" interface="pet_9000_rom"> + <dataarea name="rom" size="0x800"> + <rom name="mcterm110-9000.bin" size="0x800" crc="7ff92c17" sha1="4df7e96cf49a5bbbad60eef8dd0449b5233c2c20" offset="0" /> + </dataarea> + </part> + </software> + <software name="mcterm120" cloneof="mcterm"> <description>McTerm 1.20</description> <year>1981</year> diff --git a/hash/snread.xml b/hash/snread.xml new file mode 100644 index 00000000000..0df7dea4cd3 --- /dev/null +++ b/hash/snread.xml @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> + +<softwarelist name="snread" description="Speak & Read modules"> + + + <software name="dogonlog"> + <description>A Dog on a Log</description> + <year>1980</year> + <publisher>Texas Instruments</publisher> + <info name="serial" value="CD3534"/> + <part name="cart" interface="snread"> + <dataarea name="rom" size="0x4000"> + <rom name="cd3534a.vsm" size="0x4000" crc="78410e74" sha1="29bf24f7d3a49c097542befc51874bd238989a7a" offset="0" /> + </dataarea> + </part> + </software> + + <software name="ontrack"> + <description>On the Track</description> + <year>1981</year> + <publisher>Texas Instruments</publisher> + <info name="serial" value="CD3538"/> + <part name="cart" interface="snread"> + <dataarea name="rom" size="0x4000"> + <rom name="cd3538.vsm" size="0x4000" crc="873eeca6" sha1="6673ef02635d8c418cc647840d110488c9fc76fd" offset="0" /> + </dataarea> + </part> + </software> + + <software name="seasight"> + <description>Sea Sights</description> + <year>1980</year> + <publisher>Texas Instruments</publisher> + <info name="serial" value="CD2396"/> + <part name="cart" interface="snread"> + <dataarea name="rom" size="0x4000"> + <rom name="cd2396a.vsm" size="0x4000" crc="b005d92a" sha1="f1f9d83e18e77d89590e794cb157c8fe18e5aa05" offset="0" /> + </dataarea> + </part> + </software> + + <software name="mknight"> + <description>The Millionth Knight</description> + <year>1981</year> + <publisher>Texas Instruments</publisher> + <info name="serial" value="CD3540"/> + <part name="cart" interface="snread"> + <dataarea name="rom" size="0x4000"> + <rom name="cd3540.vsm" size="0x4000" crc="80c4da54" sha1="5663c8548484499a55052bc712440e794c8ba543" offset="0" /> + </dataarea> + </part> + </software> + + <software name="sealfly"> + <description>The Seal That Could Fly</description> + <year>1981</year> + <publisher>Texas Instruments</publisher> + <info name="serial" value="CD3535"/> + <part name="cart" interface="snread"> + <dataarea name="rom" size="0x4000"> + <rom name="cd3535.vsm" size="0x4000" crc="0694525d" sha1="d7ce974ad70e05be50f8cba5aab0a0adbfb54f8b" offset="0" /> + </dataarea> + </part> + </software> + + <software name="whoszoo"> + <description>Who's Who at the Zoo</description> + <year>1980</year> + <publisher>Texas Instruments</publisher> + <info name="serial" value="CD2397"/> + <part name="cart" interface="snread"> + <dataarea name="rom" size="0x4000"> + <rom name="cd2397.vsm" size="0x4000" crc="e0f1e76d" sha1="1cb73cf1e754536e7c09ac23ee45db60c70acd58" offset="0" /> + </dataarea> + </part> + </software> + + +</softwarelist> @@ -15,6 +15,46 @@ ################# BEGIN USER-CONFIGURABLE OPTIONS ##################### ########################################################################### +# +# Determine running OS +# + +ifeq ($(OS),Windows_NT) +OS := windows +GENIEOS := windows +else +UNAME := $(shell uname -mps) +GENIEOS := linux +ifeq ($(firstword $(filter Linux,$(UNAME))),Linux) +OS := linux +endif +ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris) +OS := solaris +endif +ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD) +OS := freebsd +endif +ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD) +OS := freebsd +endif +ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD) +OS := netbsd +endif +ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD) +OS := openbsd +endif +ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin) +OS := macosx +GENIEOS := darwin +DARWIN_VERSION := $(shell sw_vers -productVersion) +endif +ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku) +OS := haiku +endif +ifndef OS +$(error Unable to detect OS from uname -a: $(UNAME)) +endif +endif #------------------------------------------------- # specify core target: mame, mess, etc. @@ -24,36 +64,22 @@ #------------------------------------------------- ifndef TARGET -TARGET = mame +TARGET := mame endif ifndef SUBTARGET -SUBTARGET = $(TARGET) +SUBTARGET := $(TARGET) endif - - -#------------------------------------------------- -# specify OSD layer: windows, sdl, etc. -# build rules will be included from -# src/osd/$(OSD)/$(OSD).mak -#------------------------------------------------- - -ifndef OSD -ifeq ($(OS),Windows_NT) -OSD = windows -TARGETOS = win32 -else -OSD = sdl -endif +CONFIG = release +ifdef DEBUG +CONFIG := debug endif -ifndef CROSS_BUILD_OSD -CROSS_BUILD_OSD = $(OSD) +ifndef VERBOSE + SILENT := @ endif - - #------------------------------------------------- # specify OS target, which further differentiates # the underlying OS; supported values are: @@ -62,237 +88,118 @@ endif ifndef TARGETOS -ifeq ($(OS),Windows_NT) -TARGETOS = win32 -else - -ifneq ($(CROSS_BUILD),1) - -ifneq ($(OS2_SHELL),) -TARGETOS = os2 -else - -UNAME = $(shell uname -mps) - -ifeq ($(firstword $(filter Linux,$(UNAME))),Linux) -TARGETOS = linux -endif -ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris) -TARGETOS = solaris -endif -ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD) -TARGETOS = freebsd -endif -ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD) -TARGETOS = freebsd -endif -ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD) -TARGETOS = netbsd +ifeq ($(OS),windows) +TARGETOS := windows +WINDRES := windres +ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) +ARCHITECTURE := _x64 endif -ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD) -TARGETOS = openbsd -endif -ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin) -TARGETOS = macosx -endif -ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku) -TARGETOS = haiku +ifeq ($(PROCESSOR_ARCHITECTURE),x86) +ARCHITECTURE := _x64 +ifeq ($(PROCESSOR_ARCHITEW6432),AMD64) +else +ARCHITECTURE := _x86 endif -ifeq ($(firstword $(filter SunOS,$(UNAME))),SunOS) -TARGETOS = solaris -SDL_LIBVER = sdl endif +else +WINDRES := x86_64-w64-mingw32-windres +UNAME := $(shell uname -mps) +TARGETOS := $(OS) -ifndef TARGETOS -$(error Unable to detect TARGETOS from uname -a: $(UNAME)) -endif +ARCHITECTURE := _x86 -# Autodetect PTR64 -ifndef PTR64 ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64) -PTR64 = 1 +ARCHITECTURE := _x64 endif ifeq ($(firstword $(filter amd64,$(UNAME))),amd64) -PTR64 = 1 +ARCHITECTURE := _x64 endif ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64) -PTR64 = 1 -endif -ifeq ($(TARGETOS), solaris) -ifeq ($(firstword $(filter amd64,$(shell /usr/bin/isainfo -k))),amd64) -PTR64 = 1 -endif +ARCHITECTURE := _x64 endif endif -# Autodetect BIGENDIAN -# MacOSX -ifndef BIGENDIAN -ifneq (,$(findstring Power,$(UNAME))) -BIGENDIAN=1 -endif -# Linux -ifneq (,$(findstring ppc,$(UNAME))) -BIGENDIAN=1 -endif -endif # BIGENDIAN - -endif # OS/2 -endif # CROSS_BUILD -endif # Windows_NT - +else +CROSS_BUILD := 1 endif # TARGET_OS - -ifeq ($(TARGETOS),win32) - -# Autodetect PTR64 -ifndef PTR64 -WIN_TEST_GCC := $(shell gcc --version) -ifeq ($(findstring x86_64,$(WIN_TEST_GCC)),x86_64) - PTR64=1 -endif +ifdef PTR64 +ifeq ($(PTR64),1) +ARCHITECTURE := _x64 +else +ARCHITECTURE := _x86 endif - endif - -#------------------------------------------------- -# configure name of final executable -#------------------------------------------------- - -# uncomment and specify prefix to be added to the name -# PREFIX = - -# uncomment and specify suffix to be added to the name -# SUFFIX = - - - -#------------------------------------------------- -# specify architecture-specific optimizations -#------------------------------------------------- - -# uncomment and specify architecture-specific optimizations here -# some examples: -# ARCHOPTS = -march=pentiumpro # optimize for I686 -# ARCHOPTS = -march=core2 # optimize for Core 2 -# ARCHOPTS = -march=native # optimize for local machine (auto detect) -# ARCHOPTS = -mcpu=G4 # optimize for G4 -# note that we leave this commented by default so that you can -# configure this in your environment and never have to think about it -# ARCHOPTS = +ifeq ($(findstring arm,$(UNAME)),arm) +ifndef NOASM + NOASM := 1 +endif +endif +PYTHON := $(SILENT)python +CC := $(SILENT)gcc +LD := $(SILENT)g++ #------------------------------------------------- -# specify program options; see each option below -# for details +# specify OSD layer: windows, sdl, etc. +# build rules will be included from +# src/osd/$(OSD)/$(OSD).mak #------------------------------------------------- -# uncomment next line to build a debug version -# DEBUG = 1 - -# uncomment next line to disable some debug-related hotspots/slowdowns (e.g. for profiling) -# FASTDEBUG = 1 - -# uncomment next line to include the internal profiler -# PROFILER = 1 +ifndef OSD -# uncomment the force the universal DRC to always use the C backend -# you may need to do this if your target architecture does not have -# a native backend -# FORCE_DRC_C_BACKEND = 1 +OSD := osdmini -# uncomment next line to build using unix-style libsdl on Mac OS X -# (vs. the native framework port). Normal users should not enable this. -# MACOSX_USE_LIBSDL = 1 +ifeq ($(TARGETOS),windows) +OSD := windows +endif -# uncomment and specify path to cppcheck executable to perform -# static code analysis during compilation -# CPPCHECK = +ifeq ($(TARGETOS),linux) +OSD := sdl +endif +ifeq ($(TARGETOS),macosx) +OSD := sdl +endif +endif #------------------------------------------------- -# specify build options; see each option below -# for details +# distribution may change things #------------------------------------------------- -# uncomment next line if you are building for a 64-bit target -# PTR64 = 1 - -# uncomment next line if you are building for a big-endian target -# BIGENDIAN = 1 - -# uncomment next line to build expat as part of MAME build -BUILD_EXPAT = 1 - -# uncomment next line to build zlib as part of MAME build -BUILD_ZLIB = 1 - -# uncomment next line to build libflac as part of MAME build -BUILD_FLAC = 1 - -# uncomment next line to build jpeglib as part of MAME build -BUILD_JPEGLIB = 1 - -# uncomment next line to build libsqlite3 as part of MAME/MESS build -BUILD_SQLITE3 = 1 - -# uncomment next line to build PortMidi as part of MAME/MESS build -BUILD_MIDILIB = 1 - -# uncomment next line to include the symbols -# SYMBOLS = 1 - -# specify symbols level or leave commented to use the default -# (default is SYMLEVEL = 2 normally; use 1 if you only need backtrace) -# SYMLEVEL = 2 - -# uncomment next line to dump the symbols to a .sym file -# DUMPSYM = 1 - -# uncomment next line to include profiling information from the compiler -# PROFILE = 1 - -# uncomment next line to generate a link map for exception handling in windows -# MAP = 1 - -# uncomment next line to generate verbose build information -# VERBOSE = 1 - -# uncomment next line to generate deprecation warnings during compilation -# DEPRECATED = 1 - -# specify the sanitizer to use or leave empty to use none -# SANITIZE = - -# uncomment next line to enable LTO (link-time optimizations) -# LTO = 1 - -# uncomment next line to disable networking -# DONT_USE_NETWORK = 1 - -# uncomment to enable SSE2 optimized code and SSE2 code generation (implicitly enabled by 64-bit compilers) -# SSE2 = 1 - -# uncomment to enable OpenMP optimized code -# OPENMP = 1 - -# uncomment to compile c++ code as C++11 -# CPP11 = 1 - -# specify optimization level or leave commented to use the default -# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols) -# OPTIMIZE = 3 - +ifeq ($(DISTRO),) +DISTRO := generic +else +ifeq ($(DISTRO),debian-stable) +else +$(error DISTRO $(DISTRO) unknown) +endif +endif -########################################################################### -################## END USER-CONFIGURABLE OPTIONS ###################### -########################################################################### +PARAMS+= --distro=$(DISTRO) +ifdef OVERRIDE_CC +PARAMS += --CC='$(OVERRIDE_CC)' +ifndef CROSS_BUILD +CC := $(OVERRIDE_CC) +endif +endif +ifdef OVERRIDE_CXX +PARAMS += --CXX='$(OVERRIDE_CXX)' +ifndef CROSS_BUILD +CXX := $(OVERRIDE_CXX) +endif +endif +ifdef OVERRIDE_LD +PARAMS += --LD='$(OVERRIDE_LD)' +ifndef CROSS_BUILD +LD := $(OVERRIDE_LD) +endif +endif #------------------------------------------------- # sanity check the configuration @@ -315,6 +222,7 @@ endif ifdef PROFILE PROFILER = SYMBOLS = 1 +OPTIMIZE = 3 ifndef SYMLEVEL SYMLEVEL = 1 endif @@ -336,712 +244,679 @@ SYMLEVEL = 2 endif endif - -#------------------------------------------------- -# platform-specific definitions -#------------------------------------------------- - -# extension for executables -EXE = - -ifeq ($(TARGETOS),win32) -EXE = .exe -endif -ifeq ($(TARGETOS),os2) -EXE = .exe +ifdef TOOLS +PARAMS += --with-tools endif -# extension for build tools -BUILD_EXE = - -ifeq ($(OS),Windows_NT) -BUILD_EXE = .exe -endif -ifneq ($(OS2_SHELL),) -BUILD_EXE = .exe +ifdef SYMBOLS +PARAMS += --SYMBOLS=$(SYMBOLS) endif -# compiler, linker and utilities -ifneq ($(TARGETOS),emscripten) -AR = @ar -CC = @gcc -LD = @g++ +ifdef SYMLEVEL +PARAMS += --SYMLEVEL=$(SYMLEVEL) endif -MD = -mkdir$(BUILD_EXE) -RM = @rm -f -OBJDUMP = @objdump -PYTHON = @python - -#------------------------------------------------- -# form the name of the executable -#------------------------------------------------- - -# reset all internal prefixes/suffixes -PREFIXSDL = -SUFFIX64 = -SUFFIXDEBUG = -SUFFIXPROFILE = -# Windows SDL builds get an SDL prefix -ifeq ($(OSD),sdl) -ifeq ($(TARGETOS),win32) -PREFIXSDL = sdl -endif +ifdef PROFILER +PARAMS += --PROFILER=$(PROFILER) endif -ifeq ($(OSD),osdmini) -PREFIXSDL = mini +ifdef PROFILE +PARAMS += --PROFILE=$(PROFILE) endif -# 64-bit builds get a '64' suffix -ifeq ($(PTR64),1) -SUFFIX64 = 64 +ifdef OPTIMIZE +PARAMS += --OPTIMIZE=$(OPTIMIZE) endif -# debug builds just get the 'd' suffix and nothing more -ifdef DEBUG -SUFFIXDEBUG = d +ifdef ARCHOPTS +PARAMS += --ARCHOPTS='$(ARCHOPTS)' endif -# gprof builds get an addition 'p' suffix -ifdef PROFILE -SUFFIXPROFILE = p +ifdef MAP +PARAMS += --MAP='$(MAP)' endif -# the name is just 'target' if no subtarget; otherwise it is -# the concatenation of the two (e.g., mametiny) -ifeq ($(TARGET),$(SUBTARGET)) -NAME = $(TARGET) -else -NAME = $(TARGET)$(SUBTARGET) +ifdef USE_BGFX +PARAMS += --USE_BGFX='$(USE_BGFX)' endif -# fullname is prefix+name+suffix+suffix64+suffixdebug -FULLNAME ?= $(BIN)$(PREFIX)$(PREFIXSDL)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG)$(SUFFIXPROFILE) - -# add an EXE suffix to get the final emulator name -EMULATOR = $(FULLNAME)$(EXE) - - - -#------------------------------------------------- -# source and object locations -#------------------------------------------------- - -# all sources are under the src/ directory -SRC = src - -# all 3rd party sources are under the 3rdparty/ directory -3RDPARTY = 3rdparty - -# build the targets in different object dirs, so they can co-exist -OBJ = obj/$(PREFIX)$(OSD)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG)$(SUFFIXPROFILE) - -ifeq ($(CROSS_BUILD),1) -ifndef NATIVE_OBJ -NATIVE_OBJ = OBJ -endif # NATIVE_OBJ -endif # CROSS_BUILD - - -#------------------------------------------------- -# compile-time definitions -#------------------------------------------------- - -# CR/LF setup: use both on win32/os2, CR only on everything else -DEFS = -DCRLF=2 - -ifeq ($(TARGETOS),win32) -DEFS = -DCRLF=3 +ifdef NOASM +PARAMS += --NOASM='$(NOASM)' endif -ifeq ($(TARGETOS),os2) -DEFS = -DCRLF=3 -endif - -# map the INLINE to something digestible by GCC -DEFS += -DINLINE="static inline" -# define LSB_FIRST if we are a little-endian target -ifndef BIGENDIAN -DEFS += -DLSB_FIRST +ifdef FORCE_DRC_C_BACKEND +PARAMS += --FORCE_DRC_C_BACKEND='$(FORCE_DRC_C_BACKEND)' endif -# define PTR64 if we are a 64-bit target -ifeq ($(PTR64),1) -DEFS += -DPTR64 +ifdef NOWERROR +PARAMS += --NOWERROR=$(NOWERROR) endif -# define MAME_DEBUG if we are a debugging build -ifdef DEBUG -DEFS += -DMAME_DEBUG -ifdef FASTDEBUG -DEFS += -DMAME_DEBUG_FAST -endif -else -DEFS += -DNDEBUG +ifdef TARGET +PARAMS += --target=$(TARGET) endif -# define MAME_PROFILER if we are a profiling build -ifdef PROFILER -DEFS += -DMAME_PROFILER +ifdef SUBTARGET +PARAMS += --subtarget=$(SUBTARGET) endif -# define USE_NETWORK if networking is enabled (hasn't been disabled) -ifndef DONT_USE_NETWORK -DEFS += -DUSE_NETWORK +ifdef OSD +PARAMS += --osd=$(OSD) endif -# need to ensure FLAC functions are statically linked -ifeq ($(BUILD_FLAC),1) -DEFS += -DFLAC__NO_DLL +ifdef TARGETOS +PARAMS += --targetos=$(TARGETOS) endif -# define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used -ifneq ($(BUILD_JPEGLIB),1) -DEFS += -DUSE_SYSTEM_JPEGLIB +ifdef DONT_USE_NETWORK +PARAMS += --DONT_USE_NETWORK='$(DONT_USE_NETWORK)' endif -# To support casting in Lua 5.3 -DEFS += -DLUA_COMPAT_APIINTCASTS - -#------------------------------------------------- -# compile flags -# CCOMFLAGS are common flags -# CONLYFLAGS are flags only used when compiling for C -# CPPONLYFLAGS are flags only used when compiling for C++ -# COBJFLAGS are flags only used when compiling for Objective-C(++) -#------------------------------------------------- - -# start with empties for everything -CCOMFLAGS = -CONLYFLAGS = -COBJFLAGS = -CPPONLYFLAGS = - -# CFLAGS is defined based on C or C++ targets -# (remember, expansion only happens when used, so doing it here is ok) -CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS) $(INCPATH) - -# we compile C-only to C89 standard with GNU extensions -# we compile C++ code to C++98 standard with GNU extensions -CONLYFLAGS += -std=gnu89 -ifdef CPP11 -CPPONLYFLAGS += -x c++ -std=gnu++11 -else -CPPONLYFLAGS += -x c++ -std=gnu++98 +ifdef NO_OPENGL +PARAMS += --NO_OPENGL='$(NO_OPENGL)' endif -COBJFLAGS += -x objective-c++ - -# this speeds it up a bit by piping between the preprocessor/compiler/assembler -CCOMFLAGS += -pipe -# add -g if we need symbols, and ensure we have frame pointers -ifdef SYMBOLS -CCOMFLAGS += -g$(SYMLEVEL) -fno-omit-frame-pointer -fno-optimize-sibling-calls +ifdef USE_DISPATCH_GL +PARAMS += --USE_DISPATCH_GL='$(USE_DISPATCH_GL)' endif -# we need to disable some additional implicit optimizations for profiling -ifdef PROFILE -CCOMFLAGS += -mno-omit-leaf-frame-pointer +ifdef NO_USE_MIDI +PARAMS += --NO_USE_MIDI='$(NO_USE_MIDI)' endif -# add -v if we need verbose build information -ifdef VERBOSE -CCOMFLAGS += -v +ifdef USE_QTDEBUG +PARAMS += --USE_QTDEBUG='$(USE_QTDEBUG)' endif -# only show deprecation warnings when enabled -ifndef DEPRECATED -CCOMFLAGS += \ - -Wno-deprecated-declarations +ifdef DIRECTINPUT +PARAMS += --DIRECTINPUT='$(DIRECTINPUT)' endif -# add profiling information for the compiler -ifdef PROFILE -CCOMFLAGS += -pg +ifdef MESA_INSTALL_ROOT +PARAMS += --MESA_INSTALL_ROOT='$(MESA_INSTALL_ROOT)' endif -# add the optimization flag -CCOMFLAGS += -O$(OPTIMIZE) - -# add the error warning flag -ifndef NOWERROR -CCOMFLAGS += -Werror +ifdef NO_X11 +PARAMS += --NO_X11='$(NO_X11)' endif -# if we are optimizing, include optimization options -ifneq ($(OPTIMIZE),0) -CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS) -ifdef LTO -CCOMFLAGS += -flto -endif +ifdef NO_USE_XINPUT +PARAMS += --NO_USE_XINPUT='$(NO_USE_XINPUT)' endif -ifdef SSE2 -CCOMFLAGS += -msse2 +ifdef SDL_LIBVER +PARAMS += --SDL_LIBVER='$(SDL_LIBVER)' endif -ifdef OPENMP -CCOMFLAGS += -fopenmp -else -CCOMFLAGS += -Wno-unknown-pragmas +ifdef SDL2_MULTIAPI +PARAMS += --SDL2_MULTIAPI='$(SDL2_MULTIAPI)' endif -# add a basic set of warnings -CCOMFLAGS += \ - -Wall \ - -Wcast-align \ - -Wundef \ - -Wformat-security \ - -Wwrite-strings \ - -Wno-sign-compare \ - -Wno-conversion - -# warnings only applicable to C compiles -CONLYFLAGS += \ - -Wpointer-arith \ - -Wbad-function-cast \ - -Wstrict-prototypes - -# warnings only applicable to OBJ-C compiles -COBJFLAGS += \ - -Wpointer-arith - -# warnings only applicable to C++ compiles -CPPONLYFLAGS += \ - -Woverloaded-virtual - -ifdef SANITIZE -CCOMFLAGS += -fsanitize=$(SANITIZE) +ifdef SDL_INSTALL_ROOT +PARAMS += --SDL_INSTALL_ROOT='$(SDL_INSTALL_ROOT)' +endif -ifneq (,$(findstring thread,$(SANITIZE))) -CCOMFLAGS += -fPIE +ifdef SDL_FRAMEWORK_PATH +PARAMS += --SDL_FRAMEWORK_PATH='$(SDL_FRAMEWORK_PATH)' endif + +ifdef MACOSX_USE_LIBSDL +PARAMS += --MACOSX_USE_LIBSDL='$(MACOSX_USE_LIBSDL)' endif -include $(SRC)/build/cc_detection.mak +ifdef LDOPTS +PARAMS += --LDOPTS='$(LDOPTS)' +endif #------------------------------------------------- -# include paths +# All scripts #------------------------------------------------- -# add core include paths -INCPATH += \ - -I$(SRC)/$(TARGET) \ - -I$(OBJ)/$(TARGET)/layout \ - -I$(SRC)/emu \ - -I$(OBJ)/emu \ - -I$(OBJ)/emu/layout \ - -I$(SRC)/lib/util \ - -I$(SRC)/lib \ - -I$(3RDPARTY) \ - -I$(3RDPARTY)/lua/src \ - -I$(SRC)/osd \ - -I$(SRC)/osd/$(OSD) \ - - -#------------------------------------------------- -# archiving flags -#------------------------------------------------- -# Default to something reasonable for all platforms -ARFLAGS = -cr -# Deal with macosx brain damage if COMMAND_MODE is in -# the luser's environment: -ifeq ($(TARGETOS),macosx) -ifeq ($(COMMAND_MODE),"legacy") -ARFLAGS = -crs +SCRIPTS = scripts/genie.lua \ + scripts/src/lib.lua \ + scripts/src/emu.lua \ + scripts/src/machine.lua \ + scripts/src/main.lua \ + scripts/src/3rdparty.lua \ + scripts/src/cpu.lua \ + $(wildcard scripts/src/osd/$(OSD)*.lua) \ + scripts/src/sound.lua \ + scripts/src/tools.lua \ + scripts/src/video.lua \ + scripts/src/bus.lua \ + scripts/src/netlist.lua \ + scripts/toolchain.lua \ + scripts/target/$(TARGET)/$(SUBTARGET).lua \ + $(wildcard src/osd/$(OSD)/$(OSD).mak) \ + $(wildcard src/$(TARGET)/$(SUBTARGET).mak) +ifdef REGENIE +SCRIPTS+= regenie endif -endif - #------------------------------------------------- -# linking flags +# Dependent stuff #------------------------------------------------- -# LDFLAGS are used generally; LDFLAGSEMULATOR are additional -# flags only used when linking the core emulator -LDFLAGS = -ifneq ($(TARGETOS),macosx) -ifneq ($(TARGETOS),os2) -ifneq ($(TARGETOS),solaris) -LDFLAGS = -Wl,--warn-common -endif +# extension for executables +EXE := + +ifeq ($(OS),windows) +EXE := .exe endif +ifeq ($(OS),os2) +EXE := .exe endif -LDFLAGSEMULATOR = -# add profiling information for the linker -ifdef PROFILE -LDFLAGS += -pg +SHELLTYPE := msdos +ifeq (,$(ComSpec)$(COMSPEC)) + SHELLTYPE := posix +endif +ifeq (/bin,$(findstring /bin,$(SHELL))) + SHELLTYPE := posix endif -# strip symbols and other metadata in non-symbols and non profiling builds -ifndef SYMBOLS -ifneq ($(TARGETOS),macosx) -LDFLAGS += -s +ifeq (posix,$(SHELLTYPE)) + MKDIR = $(SILENT) mkdir -p "$(1)" + COPY = $(SILENT) cp -fR "$(1)" "$(2)" +else + MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0 + COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))" endif + +GENDIR = build/generated + +# all sources are under the src/ directory +SRC = src + +# all 3rd party sources are under the 3rdparty/ directory +3RDPARTY = 3rdparty + +ifeq ($(OS),windows) +GCC_VERSION := $(shell gcc -dumpversion 2> NUL) +CLANG_VERSION := $(shell %CLANG%\bin\clang --version 2> NUL| head -n 1 | sed "s/[^0-9,.]//g") +PYTHON_AVAILABLE := $(shell python --version > NUL 2>&1 && echo python) +CHECK_CLANG := +else +GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null) +CLANG_VERSION := $(shell clang --version 2> /dev/null | grep 'LLVM [0-9]\.[0-9]' -o | grep '[0-9]\.[0-9]' -o | head -n 1) +PYTHON_AVAILABLE := $(shell python --version > /dev/null 2>&1 && echo python) +CHECK_CLANG := $(shell gcc --version 2> /dev/null | grep 'clang' | head -n 1) endif -ifneq ($(OPTIMIZE),0) -ifdef LTO -LDFLAGS += -flto +ifeq ($(TARGETOS),macosx) +ifneq (,$(findstring 3.,$(CLANG_VERSION))) +ifeq ($(ARCHITECTURE),_x64) +ARCHITECTURE := _x64_clang +else +ARCHITECTURE := _x86_clang endif endif - -# output a map file (emulator only) -ifdef MAP -LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map endif -ifdef SANITIZE -LDFLAGS += -fsanitize=$(SANITIZE) -ifneq (,$(findstring thread,$(SANITIZE))) -LDFLAGS += -pie -endif -ifneq (,$(findstring memory,$(SANITIZE))) -LDFLAGS += -pie +ifneq ($(PYTHON_AVAILABLE),python) +$(error Python is not available in path) endif + +GENIE := 3rdparty/genie/bin/$(GENIEOS)/genie$(EXE) + +ifeq ($(TARGET),$(SUBTARGET)) +SUBDIR := $(OSD)/$(TARGET) +else +SUBDIR := $(OSD)/$(TARGET)$(SUBTARGET) endif +PROJECTDIR := build/projects/$(SUBDIR) +.PHONY: all clean regenie generate +all: $(GENIE) $(TARGETOS)$(ARCHITECTURE) +regenie: #------------------------------------------------- -# define the standard object directory; other -# projects can add their object directories to -# this variable +# gmake-mingw64-gcc #------------------------------------------------- -OBJDIRS += $(OBJ) $(OBJ)/$(TARGET)/$(SUBTARGET) +$(PROJECTDIR)/gmake-mingw64-gcc/Makefile: makefile $(SCRIPTS) $(GENIE) +ifndef MINGW64 + $(error MINGW64 is not set) +endif + $(SILENT) $(GENIE) $(PARAMS) --gcc=mingw64-gcc --gcc_version=$(GCC_VERSION) gmake +.PHONY: windows_x64 +windows_x64: generate $(PROJECTDIR)/gmake-mingw64-gcc/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-mingw64-gcc config=$(CONFIG)64 WINDRES=$(WINDRES) #------------------------------------------------- -# define standard libraries for CPU and sounds +# gmake-mingw32-gcc #------------------------------------------------- -LIBEMU = $(OBJ)/libemu.a -LIBOPTIONAL = $(OBJ)/$(TARGET)/$(SUBTARGET)/liboptional.a -LIBBUS = $(OBJ)/$(TARGET)/$(SUBTARGET)/libbus.a -LIBDASM = $(OBJ)/$(TARGET)/$(SUBTARGET)/libdasm.a -LIBUTIL = $(OBJ)/libutil.a -LIBOCORE = $(OBJ)/libocore.a -LIBOSD = $(OBJ)/libosd.a - -VERSIONOBJ = $(OBJ)/version.o -EMUINFOOBJ = $(OBJ)/$(TARGET)/$(TARGET).o -DRIVLISTSRC = $(OBJ)/$(TARGET)/$(SUBTARGET)/drivlist.c -DRIVLISTOBJ = $(OBJ)/$(TARGET)/$(SUBTARGET)/drivlist.o +.PHONY: windows +windows: windows_x86 +$(PROJECTDIR)/gmake-mingw32-gcc/Makefile: makefile $(SCRIPTS) $(GENIE) +ifndef MINGW32 + $(error MINGW32 is not set) +endif + $(SILENT) $(GENIE) $(PARAMS) --gcc=mingw32-gcc --gcc_version=$(GCC_VERSION) gmake +.PHONY: windows_x86 +windows_x86: generate $(PROJECTDIR)/gmake-mingw32-gcc/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-mingw32-gcc config=$(CONFIG)32 WINDRES=$(WINDRES) #------------------------------------------------- -# either build or link against the included -# libraries +# gmake-mingw-clang #------------------------------------------------- -# start with an empty set of libs -LIBS = - -# add expat XML library -ifeq ($(BUILD_EXPAT),1) -INCPATH += -I$(3RDPARTY)/expat/lib -EXPAT = $(OBJ)/libexpat.a -else -LIBS += -lexpat -EXPAT = +$(PROJECTDIR)/gmake-mingw-clang/Makefile: makefile $(SCRIPTS) $(GENIE) +ifndef CLANG + $(error CLANG is not set) endif + $(SILENT) $(GENIE) $(PARAMS) --gcc=mingw-clang --gcc_version=$(CLANG_VERSION) gmake -# add ZLIB compression library -ifeq ($(BUILD_ZLIB),1) -INCPATH += -I$(3RDPARTY)/zlib -ZLIB = $(OBJ)/libz.a -else -LIBS += -lz -BASELIBS += -lz -ZLIB = -endif +.PHONY: windows_x64_clang +windows_x64_clang: generate $(PROJECTDIR)/gmake-mingw-clang/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-mingw-clang config=$(CONFIG)64 WINDRES=$(WINDRES) + +.PHONY: windows_x86_clang +windows_x86_clang: generate $(PROJECTDIR)/gmake-mingw-clang/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES) -# add flac library -ifeq ($(BUILD_FLAC),1) -INCPATH += -I$(SRC)/lib/util -FLAC_LIB = $(OBJ)/libflac.a -# $(OBJ)/libflac++.a -else -LIBS += -lFLAC -BASELIBS += -lFLAC -FLAC_LIB = -endif +vs2010: generate + $(SILENT) $(GENIE) $(PARAMS) vs2010 -# add jpeglib image library -ifeq ($(BUILD_JPEGLIB),1) -INCPATH += -I$(3RDPARTY)/libjpeg -JPEG_LIB = $(OBJ)/libjpeg.a -else -LIBS += -ljpeg -JPEG_LIB = -endif +vs2012: generate + $(SILENT) $(GENIE) $(PARAMS) vs2012 -# add SoftFloat floating point emulation library -SOFTFLOAT = $(OBJ)/libsoftfloat.a +vs2012_intel: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=intel-15 vs2012 -# add formats emulation library -FORMATS_LIB = $(OBJ)/libformats.a +vs2012_xp: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=vs2012-xp vs2012 -# add LUA library -LUA_LIB = $(OBJ)/liblua.a +vs2013: generate + $(SILENT) $(GENIE) $(PARAMS) vs2013 -# add web library -WEB_LIB = $(OBJ)/libweb.a +vs2013_intel: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=intel-15 vs2013 -# add SQLite3 library -ifeq ($(BUILD_SQLITE3),1) -SQLITE3_LIB = $(OBJ)/libsqlite3.a -else -LIBS += -lsqlite3 -SQLITE3_LIB = -endif +vs2013_xp: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=vs2013-xp vs2013 -# add BGFX library - this is one in sdl.mak / windows.mak -# BGFX_LIB = $(OBJ)/libbgfx.a +vs2015: generate + $(SILENT) $(GENIE) $(PARAMS) vs2015 -# add PortMidi MIDI library -ifeq ($(BUILD_MIDILIB),1) -INCPATH += -I$(SRC)/lib/portmidi -MIDI_LIB = $(OBJ)/libportmidi.a -else -LIBS += -lportmidi -MIDI_LIB = +android-arm: generate +ifndef ANDROID_NDK_ARM + $(error ANDROID_NDK_ARM is not set) +endif +ifndef ANDROID_NDK_ROOT + $(error ANDROID_NDK_ROOT is not set) endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=android-arm --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-android-arm config=$(CONFIG) -ifneq (,$(findstring clang,$(CC))) -LIBS += -lstdc++ -lpthread +android-mips: generate +ifndef ANDROID_NDK_MIPS + $(error ANDROID_NDK_MIPS is not set) +endif +ifndef ANDROID_NDK_ROOT + $(error ANDROID_NDK_ROOT is not set) endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=android-mips --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-android-mips config=$(CONFIG) -#------------------------------------------------- -# 'default' target needs to go here, before the -# include files which define additional targets -#------------------------------------------------- +android-x86: generate +ifndef ANDROID_NDK_X86 + $(error ANDROID_NDK_X86 is not set) +endif +ifndef ANDROID_NDK_ROOT + $(error ANDROID_NDK_ROOT is not set) +endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=android-x86 --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-android-x86 config=$(CONFIG) -default: maketree buildtools emulator +asmjs: generate +ifndef EMSCRIPTEN + $(error EMSCRIPTEN is not set) +endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=asmjs --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-asmjs config=$(CONFIG) -all: default tools -7Z_LIB = $(OBJ)/lib7z.a +nacl: nacl_x86 -#------------------------------------------------- -# defines needed by multiple make files -#------------------------------------------------- +nacl_x64: generate +ifndef NACL_SDK_ROOT + $(error NACL_SDK_ROOT is not set) +endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=nacl --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-nacl config=$(CONFIG)64 -BUILDSRC = $(SRC)/build -BUILDOBJ = $(OBJ)/build -BUILDOUT = $(BUILDOBJ) +nacl_x86: generate +ifndef NACL_SDK_ROOT + $(error NACL_SDK_ROOT is not set) +endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=nacl --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-nacl config=$(CONFIG)32 -ifdef NATIVE_OBJ -BUILDOUT = $(NATIVE_OBJ)/build -endif # NATIVE_OBJ +nacl-arm: generate +ifndef NACL_SDK_ROOT + $(error NACL_SDK_ROOT is not set) +endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=nacl-arm --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-nacl-arm config=$(CONFIG) +pnacl: generate +ifndef NACL_SDK_ROOT + $(error NACL_SDK_ROOT is not set) +endif +ifndef COMPILE + $(SILENT) $(GENIE) $(PARAMS) --gcc=pnacl --gcc_version=4.8 gmake +endif + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-pnacl config=$(CONFIG) #------------------------------------------------- -# include the various .mak files +# gmake-linux #------------------------------------------------- -# include OSD-specific rules first -include $(SRC)/osd/$(OSD)/$(OSD).mak +$(PROJECTDIR)/gmake-linux/Makefile: makefile $(SCRIPTS) $(GENIE) + $(SILENT) $(GENIE) $(PARAMS) --gcc=linux-gcc --gcc_version=$(GCC_VERSION) gmake -# then the various core pieces -include $(SRC)/build/build.mak -include $(SRC)/$(TARGET)/$(SUBTARGET).mak --include $(SRC)/$(TARGET)/osd/$(OSD)/$(OSD).mak -include $(SRC)/emu/emu.mak -include $(SRC)/lib/lib.mak --include $(SRC)/osd/$(CROSS_BUILD_OSD)/build.mak -include $(SRC)/tools/tools.mak -include $(SRC)/regtests/regtests.mak +.PHONY: linux_x64 +linux_x64: generate $(PROJECTDIR)/gmake-linux/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)64 -# combine the various definitions to one -CDEFS = $(DEFS) +.PHONY: linux +linux: linux_x86 -# TODO: -x c++ should not be hard-coded -CPPCHECKFLAGS = $(CDEFS) $(INCPATH) -x c++ --enable=style +.PHONY: linux_x86 +linux_x86: generate $(PROJECTDIR)/gmake-linux/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)32 #------------------------------------------------- -# sanity check OSD additions +# gmake-linux-clang #------------------------------------------------- -ifeq (,$(findstring -DOSD_,$(CDEFS))) -$(error $(OSD).mak should have defined -DOSD_) -endif - -#------------------------------------------------- -# primary targets -#------------------------------------------------- +$(PROJECTDIR)/gmake-linux-clang/Makefile: makefile $(SCRIPTS) $(GENIE) + $(SILENT) $(GENIE) $(PARAMS) --gcc=linux-clang --gcc_version=$(CLANG_VERSION) gmake -emulator: maketree $(BUILD) $(EMULATOR) +.PHONY: linux_x64_clang +linux_x64_clang: generate $(PROJECTDIR)/gmake-linux-clang/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-linux-clang config=$(CONFIG)64 -buildtools: maketree $(BUILD) +.PHONY: linux_x86_clang +linux_x86_clang: generate $(PROJECTDIR)/gmake-linux-clang/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-linux-clang config=$(CONFIG)32 -tools: maketree $(TOOLS) +#------------------------------------------------- +# gmake-osx +#------------------------------------------------- -maketree: $(sort $(OBJDIRS)) +$(PROJECTDIR)/gmake-osx/Makefile: makefile $(SCRIPTS) $(GENIE) + $(SILENT) $(GENIE) $(PARAMS) --gcc=osx --os_version=$(DARWIN_VERSION) --gcc_version=$(GCC_VERSION) gmake -clean: $(OSDCLEAN) - @echo Deleting object tree $(OBJ)... - $(RM) -r $(OBJ) - @echo Deleting $(EMULATOR)... - $(RM) $(EMULATOR) - @echo Deleting $(TOOLS)... - $(RM) $(TOOLS) - @echo Deleting dependencies... - $(RM) depend_emu.mak - $(RM) depend_mame.mak - $(RM) depend_mess.mak - $(RM) depend_ume.mak -ifdef MAP - @echo Deleting $(FULLNAME).map... - $(RM) $(FULLNAME).map -endif -ifdef SYMBOLS - @echo Deleting $(FULLNAME).sym... - $(RM) $(FULLNAME).sym -endif +.PHONY: macosx_x64 +macosx_x64: generate $(PROJECTDIR)/gmake-osx/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-osx config=$(CONFIG)64 -checkautodetect: - @echo TARGETOS=$(TARGETOS) - @echo PTR64=$(PTR64) - @echo BIGENDIAN=$(BIGENDIAN) - @echo UNAME="$(UNAME)" +.PHONY: macosx +macosx: macosx_x86 -tests: $(REGTESTS) - -mak: maketree $(MAKEMAK_TARGET) - @echo Rebuilding $(SUBTARGET).mak... - $(MAKEMAK) $(SRC)/targets/$(SUBTARGET).lst -I. -I$(SRC)/emu -I$(SRC)/mame -I$(SRC)/mame/layout -I$(SRC)/mess -I$(SRC)/mess/layout $(SRC) > $(SUBTARGET).mak - $(MAKEMAK) $(SRC)/targets/$(SUBTARGET).lst > $(SUBTARGET).lst +.PHONY: macosx_x86 +macosx_x86: generate $(PROJECTDIR)/gmake-osx/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-osx config=$(CONFIG)32 #------------------------------------------------- -# directory targets +# gmake-osx-clang #------------------------------------------------- -$(sort $(OBJDIRS)): - $(MD) -p $@ +$(PROJECTDIR)/gmake-osx-clang/Makefile: makefile $(SCRIPTS) $(GENIE) + $(SILENT) $(GENIE) $(PARAMS) --gcc=osx-clang --os_version=$(DARWIN_VERSION) --gcc_version=$(CLANG_VERSION) gmake +.PHONY: macosx_x64_clang +macosx_x64_clang: generate $(PROJECTDIR)/gmake-osx-clang/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-osx-clang config=$(CONFIG)64 +.PHONY: macosx_x86_clang +macosx_x86_clang: generate $(PROJECTDIR)/gmake-osx-clang/Makefile + $(SILENT) $(MAKE) --no-print-directory -R -C $(PROJECTDIR)/gmake-osx-clang config=$(CONFIG)32 #------------------------------------------------- -# executable targets and dependencies +# Clean/bootstrap #------------------------------------------------- -ifndef EXECUTABLE_DEFINED +$(GENIE): + $(SILENT) $(MAKE) --no-print-directory -R -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make -ifeq ($(BUSES),) -LIBBUS = -endif +clean: + @echo Cleaning... + -@rm -rf build + $(SILENT) $(MAKE) --no-print-directory -R -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make clean + +GEN_FOLDERS := \ + $(GENDIR) \ + $(GENDIR)/$(TARGET)/$(SUBTARGET) \ + $(GENDIR)/emu/layout/ \ + $(GENDIR)/$(TARGET)/layout/ \ + $(GENDIR)/mess/drivers/ \ + $(GENDIR)/emu/cpu/arcompact/ \ + $(GENDIR)/emu/cpu/h8/ \ + $(GENDIR)/emu/cpu/mcs96/ \ + $(GENDIR)/emu/cpu/m6502/ \ + $(GENDIR)/emu/cpu/m6809/ \ + $(GENDIR)/emu/cpu/m68000/ \ + $(GENDIR)/emu/cpu/tms57002/ \ + $(GENDIR)/osd/modules/debugger/qt/ \ + $(GENDIR)/resource/ -EMULATOROBJLIST = $(EMUINFOOBJ) $(DRIVLISTOBJ) $(DRVLIBS) $(LIBOSD) $(LIBBUS) $(LIBOPTIONAL) $(LIBEMU) $(LIBDASM) $(LIBUTIL) $(EXPAT) $(SOFTFLOAT) $(JPEG_LIB) $(FLAC_LIB) $(7Z_LIB) $(FORMATS_LIB) $(LUA_LIB) $(SQLITE3_LIB) $(WEB_LIB) $(BGFX_LIB) $(ZLIB) $(LIBOCORE) $(MIDI_LIB) $(RESFILE) +LAYOUTS=$(wildcard $(SRC)/emu/layout/*.lay) $(wildcard $(SRC)/$(TARGET)/layout/*.lay) +MOC_FILES=$(wildcard $(SRC)/osd/modules/debugger/qt/*.h) +ifneq ($(USE_QTDEBUG),1) +ifeq ($(TARGETOS),macosx) +MOC_FILES= +endif +ifeq ($(TARGETOS),solaris) +MOC_FILES= +endif +ifeq ($(TARGETOS),haiku) +MOC_FILES= +endif ifeq ($(TARGETOS),emscripten) -EMULATOROBJ = $(EMULATOROBJLIST:.a=.bc) -else -EMULATOROBJ = $(EMULATOROBJLIST) +MOC_FILES= +endif +ifeq ($(TARGETOS),os2) +MOC_FILES= +endif endif -$(EMULATOR): $(VERSIONOBJ) $(EMULATOROBJ) - @echo Linking $@... -ifeq ($(TARGETOS),emscripten) -# Emscripten's linker seems to be stricter about the ordering of files - $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $(VERSIONOBJ) -Wl,--start-group $(EMULATOROBJ) -Wl,--end-group $(LIBS) -o $@ +ifeq ($(OS),windows) +MOC = moc else - $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $(VERSIONOBJ) $(EMULATOROBJ) $(LIBS) -o $@ -endif -ifeq ($(TARGETOS),win32) -ifdef SYMBOLS -ifndef MSVC_BUILD - $(OBJDUMP) --section=.text --line-numbers --syms --demangle $@ >$(FULLNAME).sym +MOCTST = $(shell which moc-qt4 2>/dev/null) +ifeq '$(MOCTST)' '' +MOCTST = $(shell which moc 2>/dev/null) +ifeq '$(MOCTST)' '' +ifneq '$(MOC_FILES)' '' +$(error Qt's Meta Object Compiler (moc) wasn't found!) endif +else +MOC = $(MOCTST) endif +else +MOC = $(MOCTST) endif - endif - -#------------------------------------------------- -# generic rules -#------------------------------------------------- - -$(OBJ)/%.o: $(SRC)/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ -ifdef CPPCHECK - @$(CPPCHECK) $(CPPCHECKFLAGS) $< +ifneq (,$(wildcard src/osd/$(OSD)/$(OSD).mak)) +include src/osd/$(OSD)/$(OSD).mak endif -$(OBJ)/%.o: $(OBJ)/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ -ifdef CPPCHECK - @$(CPPCHECK) $(CPPCHECKFLAGS) $< +ifneq (,$(wildcard src/$(TARGET)/$(SUBTARGET).mak)) +include src/$(TARGET)/$(SUBTARGET).mak endif -$(OBJ)/%.pp: $(SRC)/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -E $< -o $@ -ifdef CPPCHECK - @$(CPPCHECK) $(CPPCHECKFLAGS) $< -endif +$(GEN_FOLDERS): + -$(call MKDIR,$@) -$(OBJ)/%.s: $(SRC)/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -S $< -o $@ -ifdef CPPCHECK - @$(CPPCHECK) $(CPPCHECKFLAGS) $< -endif +generate: \ + $(GENIE) \ + $(GEN_FOLDERS) \ + $(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS)) \ + $(patsubst $(SRC)/%.h,$(GENDIR)/%.moc.c,$(MOC_FILES)) \ + $(GENDIR)/emu/uismall.fh \ + $(GENDIR)/resource/$(TARGET)vers.rc \ + $(GENDIR)/resource/$(TARGET)-Info.plist \ + $(GENDIR)/$(TARGET)/$(SUBTARGET)/drivlist.c \ + $(GENDIR)/mess/drivers/ymmu100.inc \ + $(GENDIR)/emu/cpu/arcompact/arcompact.inc \ + $(GENDIR)/emu/cpu/h8/h8.inc $(GENDIR)/emu/cpu/h8/h8h.inc $(GENDIR)/emu/cpu/h8/h8s2000.inc $(GENDIR)/emu/cpu/h8/h8s2600.inc \ + $(GENDIR)/emu/cpu/mcs96/mcs96.inc $(GENDIR)/emu/cpu/mcs96/i8x9x.inc $(GENDIR)/emu/cpu/mcs96/i8xc196.inc \ + $(GENDIR)/emu/cpu/m6502/deco16.inc $(GENDIR)/emu/cpu/m6502/m4510.inc $(GENDIR)/emu/cpu/m6502/m6502.inc $(GENDIR)/emu/cpu/m6502/m65c02.inc $(GENDIR)/emu/cpu/m6502/m65ce02.inc $(GENDIR)/emu/cpu/m6502/m6509.inc $(GENDIR)/emu/cpu/m6502/m6510.inc $(GENDIR)/emu/cpu/m6502/n2a03.inc $(GENDIR)/emu/cpu/m6502/r65c02.inc $(GENDIR)/emu/cpu/m6502/m740.inc \ + $(GENDIR)/emu/cpu/m6809/m6809.inc $(GENDIR)/emu/cpu/m6809/hd6309.inc $(GENDIR)/emu/cpu/m6809/konami.inc \ + $(GENDIR)/emu/cpu/tms57002/tms57002.inc \ + $(GENDIR)/m68kmake$(EXE) $(GENDIR)/emu/cpu/m68000/m68kops.c -$(OBJ)/%.lh: $(SRC)/%.lay $(SRC)/build/file2str.py +$(GENDIR)/%.lh: $(SRC)/%.lay $(SRC)/build/file2str.py @echo Converting $<... $(PYTHON) $(SRC)/build/file2str.py $< $@ layout_$(basename $(notdir $<)) -$(OBJ)/%.fh: $(SRC)/%.png $(SRC)/build/png2bdc.py $(SRC)/build/file2str.py +$(GENDIR)/%.fh: $(SRC)/%.png $(SRC)/build/png2bdc.py $(SRC)/build/file2str.py @echo Converting $<... - $(PYTHON) $(SRC)/build/png2bdc.py $< $(OBJ)/temp.bdc - $(PYTHON) $(SRC)/build/file2str.py $(OBJ)/temp.bdc $@ font_$(basename $(notdir $<)) UINT8 + $(PYTHON) $(SRC)/build/png2bdc.py $< $(GENDIR)/temp.bdc + $(PYTHON) $(SRC)/build/file2str.py $(GENDIR)/temp.bdc $@ font_$(basename $(notdir $<)) UINT8 -$(DRIVLISTOBJ): $(DRIVLISTSRC) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ -ifdef CPPCHECK - @$(CPPCHECK) $(CPPCHECKFLAGS) $< -endif +$(GENDIR)/resource/$(TARGET)vers.rc: $(SRC)/build/verinfo.py $(SRC)/version.c + @echo Emitting $@... + $(PYTHON) $(SRC)/build/verinfo.py -r -b $(TARGET) $(SRC)/version.c > $@ + +$(GENDIR)/resource/$(TARGET)-Info.plist: $(SRC)/build/verinfo.py $(SRC)/version.c + @echo Emitting $@... + $(PYTHON) $(SRC)/build/verinfo.py -p -b $(TARGET) $(SRC)/version.c > $@ -$(DRIVLISTSRC): $(SRC)/$(TARGET)/$(SUBTARGET).lst $(SRC)/build/makelist.py +$(GENDIR)/$(TARGET)/$(SUBTARGET)/drivlist.c: $(SRC)/$(TARGET)/$(SUBTARGET).lst $(SRC)/build/makelist.py @echo Building driver list $<... $(PYTHON) $(SRC)/build/makelist.py $< >$@ -ifeq ($(TARGETOS),emscripten) -# Avoid using .a files with Emscripten, link to bitcode instead -$(OBJ)/%.a: - @echo Linking $@... - $(RM) $@ - $(LD) $^ -o $@ -$(OBJ)/%.bc: $(OBJ)/%.a - @cp $< $@ -else -$(OBJ)/%.a: - @echo Archiving $@... - $(RM) $@ - $(AR) $(ARFLAGS) $@ $^ -endif +# rule to generate the C files +$(GENDIR)/emu/cpu/arcompact/arcompact.inc: $(SRC)/emu/cpu/arcompact/arcompact_make.py + @echo Generating arcompact source .inc files... + $(PYTHON) $(SRC)/emu/cpu/arcompact/arcompact_make.py $@ -ifeq ($(TARGETOS),macosx) -$(OBJ)/%.o: $(SRC)/%.m | $(OSPREBUILD) - @echo Objective-C compiling $<... - $(CC) $(CDEFS) $(COBJFLAGS) $(CCOMFLAGS) $(INCPATH) -c $< -o $@ -endif +$(GENDIR)/emu/cpu/h8/h8.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst + @echo Generating H8-300 source file... + $(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst o $@ +$(GENDIR)/emu/cpu/h8/h8h.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst + @echo Generating H8-300H source file... + $(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst h $@ +$(GENDIR)/emu/cpu/h8/h8s2000.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst + @echo Generating H8S/2000 source file... + $(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst s20 $@ -#------------------------------------------------- -# optional dependencies file -#------------------------------------------------- +$(GENDIR)/emu/cpu/h8/h8s2600.inc: $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst + @echo Generating H8S/2600 source file... + $(PYTHON) $(SRC)/emu/cpu/h8/h8make.py $(SRC)/emu/cpu/h8/h8.lst s26 $@ + +$(GENDIR)/emu/cpu/mcs96/mcs96.inc: $(SRC)/emu/cpu/mcs96/mcs96make.py $(SRC)/emu/cpu/mcs96/mcs96ops.lst + @echo Generating mcs96 source file... + $(PYTHON) $(SRC)/emu/cpu/mcs96/mcs96make.py mcs96 $(SRC)/emu/cpu/mcs96/mcs96ops.lst $@ + +$(GENDIR)/emu/cpu/mcs96/i8x9x.inc: $(SRC)/emu/cpu/mcs96/mcs96make.py $(SRC)/emu/cpu/mcs96/mcs96ops.lst + @echo Generating i8x9x source file... + $(PYTHON) $(SRC)/emu/cpu/mcs96/mcs96make.py i8x9x $(SRC)/emu/cpu/mcs96/mcs96ops.lst $@ + +$(GENDIR)/emu/cpu/mcs96/i8xc196.inc: $(SRC)/emu/cpu/mcs96/mcs96make.py $(SRC)/emu/cpu/mcs96/mcs96ops.lst + @echo Generating i8xc196 source file... + $(PYTHON) $(SRC)/emu/cpu/mcs96/mcs96make.py i8xc196 $(SRC)/emu/cpu/mcs96/mcs96ops.lst $@ + +$(GENDIR)/emu/cpu/m6502/deco16.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/odeco16.lst $(SRC)/emu/cpu/m6502/ddeco16.lst + @echo Generating deco16 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py deco16_device $(SRC)/emu/cpu/m6502/odeco16.lst $(SRC)/emu/cpu/m6502/ddeco16.lst $@ + +$(GENDIR)/emu/cpu/m6502/m4510.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om4510.lst $(SRC)/emu/cpu/m6502/dm4510.lst + @echo Generating m4510 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m4510_device $(SRC)/emu/cpu/m6502/om4510.lst $(SRC)/emu/cpu/m6502/dm4510.lst $@ + +$(GENDIR)/emu/cpu/m6502/m6502.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om6502.lst $(SRC)/emu/cpu/m6502/dm6502.lst + @echo Generating m6502 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m6502_device $(SRC)/emu/cpu/m6502/om6502.lst $(SRC)/emu/cpu/m6502/dm6502.lst $@ + +$(GENDIR)/emu/cpu/m6502/m65c02.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om65c02.lst $(SRC)/emu/cpu/m6502/dm65c02.lst + @echo Generating m65c02 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m65c02_device $(SRC)/emu/cpu/m6502/om65c02.lst $(SRC)/emu/cpu/m6502/dm65c02.lst $@ + +$(GENDIR)/emu/cpu/m6502/m65ce02.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om65ce02.lst $(SRC)/emu/cpu/m6502/dm65ce02.lst + @echo Generating m65ce02 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m65ce02_device $(SRC)/emu/cpu/m6502/om65ce02.lst $(SRC)/emu/cpu/m6502/dm65ce02.lst $@ + +$(GENDIR)/emu/cpu/m6502/m6509.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om6509.lst $(SRC)/emu/cpu/m6502/dm6509.lst + @echo Generating m6509 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m6509_device $(SRC)/emu/cpu/m6502/om6509.lst $(SRC)/emu/cpu/m6502/dm6509.lst $@ + +$(GENDIR)/emu/cpu/m6502/m6510.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om6510.lst $(SRC)/emu/cpu/m6502/dm6510.lst + @echo Generating m6510 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m6510_device $(SRC)/emu/cpu/m6502/om6510.lst $(SRC)/emu/cpu/m6502/dm6510.lst $@ + +$(GENDIR)/emu/cpu/m6502/n2a03.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/on2a03.lst $(SRC)/emu/cpu/m6502/dn2a03.lst + @echo Generating n2a03 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py n2a03_device $(SRC)/emu/cpu/m6502/on2a03.lst $(SRC)/emu/cpu/m6502/dn2a03.lst $@ + +$(GENDIR)/emu/cpu/m6502/r65c02.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/dr65c02.lst + @echo Generating r65c02 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py r65c02_device - $(SRC)/emu/cpu/m6502/dr65c02.lst $@ + +$(GENDIR)/emu/cpu/m6502/m740.inc: $(SRC)/emu/cpu/m6502/m6502make.py $(SRC)/emu/cpu/m6502/om740.lst $(SRC)/emu/cpu/m6502/dm740.lst + @echo Generating m740 source file... + $(PYTHON) $(SRC)/emu/cpu/m6502/m6502make.py m740_device $(SRC)/emu/cpu/m6502/om740.lst $(SRC)/emu/cpu/m6502/dm740.lst $@ + +$(GENDIR)/emu/cpu/m6809/m6809.inc: $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/m6809.ops $(SRC)/emu/cpu/m6809/base6x09.ops + @echo Generating m6809 source file... + $(PYTHON) $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/m6809.ops > $@ + +$(GENDIR)/emu/cpu/m6809/hd6309.inc: $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/hd6309.ops $(SRC)/emu/cpu/m6809/base6x09.ops + @echo Generating hd6309 source file... + $(PYTHON) $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/hd6309.ops > $@ + +$(GENDIR)/emu/cpu/m6809/konami.inc: $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/konami.ops $(SRC)/emu/cpu/m6809/base6x09.ops + @echo Generating konami source file... + $(PYTHON) $(SRC)/emu/cpu/m6809/m6809make.py $(SRC)/emu/cpu/m6809/konami.ops > $@ + +$(GENDIR)/emu/cpu/tms57002/tms57002.inc: $(SRC)/emu/cpu/tms57002/tmsmake.py $(SRC)/emu/cpu/tms57002/tmsinstr.lst + @echo Generating TMS57002 source file... + $(PYTHON) $(SRC)/emu/cpu/tms57002/tmsmake.py $(SRC)/emu/cpu/tms57002/tmsinstr.lst $@ + +$(GENDIR)/m68kmake.o: src/emu/cpu/m68000/m68kmake.c + @echo $(notdir $<) + $(SILENT) $(CC) -x c++ -std=gnu++98 -o "$@" -c "$<" + +$(GENDIR)/m68kmake$(EXE) : $(GENDIR)/m68kmake.o + @echo Linking $@... + $(LD) -lstdc++ $^ -o $@ + +$(GENDIR)/emu/cpu/m68000/m68kops.c: $(GENDIR)/m68kmake$(EXE) $(SRC)/emu/cpu/m68000/m68k_in.c + @echo Generating M68K source files... + $(SILENT) $(GENDIR)/m68kmake $(GENDIR)/emu/cpu/m68000 $(SRC)/emu/cpu/m68000/m68k_in.c + +$(GENDIR)/mess/drivers/ymmu100.inc: $(SRC)/mess/drivers/ymmu100.ppm $(SRC)/build/file2str.py + @echo Converting $<... + @$(PYTHON) $(SRC)/build/file2str.py $(SRC)/mess/drivers/ymmu100.ppm $@ ymmu100_bkg UINT8 --include depend_emu.mak --include depend_$(TARGET).mak +$(GENDIR)/%.moc.c: $(SRC)/%.h + $(SILENT) $(MOC) $(MOCINCPATH) $< -o $@ + diff --git a/scripts/depfilter.awk b/scripts/depfilter.awk new file mode 100644 index 00000000000..74f3cce9ce7 --- /dev/null +++ b/scripts/depfilter.awk @@ -0,0 +1,25 @@ +function base_dir(f) +{ + ne = split(f, s, "/") + for(k=ne;k>=1 && s[k] != "src";k--); + r = s[k] + for(j=k+1;j<ne;j++) + r = r "/" s[j] + return r +} + +{ + for(i=1; i<=NF; i++) { + if($i != "\\") { + ff = $i + fd = base_dir(ff) + if(substr(ff,length(ff)) == ":") { + root_dir = fd + } else if(fd != root_dir) { + if(fd == "src/emu" || fd == "src/osd" || fd == "src/lib/util") + $i = "" + } + } + } + print +}
\ No newline at end of file diff --git a/scripts/genie.lua b/scripts/genie.lua new file mode 100644 index 00000000000..d8af3bfb852 --- /dev/null +++ b/scripts/genie.lua @@ -0,0 +1,923 @@ +premake.check_paths = true +premake.make.override = { "TARGET" } +MAME_DIR = (path.getabsolute("..") .. "/") +local MAME_BUILD_DIR = (MAME_DIR .. "build/") +local naclToolchain = "" + + +function str_to_version (str) + local val = 0 + if (str == nil or str == '') then + return val + end + local cnt = 10000 + for word in string.gmatch(str, '([^.]+)') do + val = val + tonumber(word) * cnt + cnt = cnt / 100 + end + return val +end + +function findfunction(x) + assert(type(x) == "string") + local f=_G + for v in x:gmatch("[^%.]+") do + if type(f) ~= "table" then + return nil, "looking for '"..v.."' expected table, not "..type(f) + end + f=f[v] + end + if type(f) == "function" then + return f + else + return nil, "expected function, not "..type(f) + end +end + +function includeosd() + includedirs { + MAME_DIR .. "src/osd", + } +end + + +CPUS = {} +SOUNDS = {} +MACHINES = {} +VIDEOS = {} +BUSES = {} + +newoption { + trigger = "with-tools", + description = "Enable building tools.", +} + +newoption { + trigger = "osd", + description = "Choose target OSD", +} + +newoption { + trigger = "targetos", + description = "Choose target OS", + allowed = { + { "android-arm", "Android - ARM" }, + { "android-mips", "Android - MIPS" }, + { "android-x86", "Android - x86" }, + { "asmjs", "Emscripten/asm.js" }, + { "freebsd", "FreeBSD" }, + { "nacl", "Native Client" }, + { "nacl-arm", "Native Client - ARM" }, + { "pnacl", "Native Client - PNaCl" }, + { "linux", "Linux" }, + { "ios", "iOS" }, + { "macosx", "OSX" }, + { "windows", "Windows" }, + + }, +} + +newoption { + trigger = "distro", + description = "Choose distribution", + allowed = { + { "generic", "generic" }, + { "debian-stable", "debian-stable" }, + { "ubuntu-intrepid", "ubuntu-intrepid" }, + }, +} + +newoption { + trigger = "target", + description = "Building target", +} + +newoption { + trigger = "subtarget", + description = "Building subtarget", +} + +newoption { + trigger = "gcc_version", + description = "GCC compiler version", +} + +newoption { + trigger = "os_version", + description = "OS version", + value = "", +} + +newoption { + trigger = "CC", + description = "CC replacement", +} + +newoption { + trigger = "CXX", + description = "CXX replacement", +} + +newoption { + trigger = "LD", + description = "LD replacement", +} + +newoption { + trigger = "PROFILE", + description = "Enable profiling.", +} + +newoption { + trigger = "SYMBOLS", + description = "Enable symbols.", +} + +newoption { + trigger = "SYMLEVEL", + description = "Symbols level.", +} + +newoption { + trigger = "PROFILER", + description = "Include the internal profiler.", +} + +newoption { + trigger = "OPTIMIZE", + description = "Optimization level.", +} + +newoption { + trigger = "ARCHOPTS", + description = "ARCHOPTS.", +} + +newoption { + trigger = "LDOPTS", + description = "Additional linker options", +} + +newoption { + trigger = "MAP", + description = "Generate a link map.", +} + +newoption { + trigger = "NOASM", + description = "Disable implementations based on assembler code", + allowed = { + { "0", "Enable assembler code" }, + { "1", "Disable assembler code" }, + }, +} + +newoption { + trigger = "FORCE_DRC_C_BACKEND", + description = "Force DRC C backend.", +} + +newoption { + trigger = "NOWERROR", + description = "NOWERROR", +} + +newoption { + trigger = "USE_BGFX", + description = "Use of BGFX.", + allowed = { + { "0", "Disabled" }, + { "1", "Enabled" }, + } +} + +local os_version = str_to_version(_OPTIONS["os_version"]) + +if not _OPTIONS["NOASM"] then + if _OPTIONS["targetos"]=="emscripten" then + _OPTIONS["NOASM"] = "1" + else + _OPTIONS["NOASM"] = "0" + end +end + +if _OPTIONS["NOASM"]=="1" and not _OPTIONS["FORCE_DRC_C_BACKEND"] then + _OPTIONS["FORCE_DRC_C_BACKEND"] = "1" +end + +USE_BGFX = 1 +if (_OPTIONS["targetos"]=="macosx" and os_version < 100700) then + USE_BGFX = 0 +end +if(_OPTIONS["USE_BGFX"]~=nil) then + USE_BGFX = tonumber(_OPTIONS["USE_BGFX"]) +end + +GEN_DIR = MAME_BUILD_DIR .. "generated/" + +if (_OPTIONS["target"] == nil) then return false end +if (_OPTIONS["subtarget"] == nil) then return false end + +if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then + solution (_OPTIONS["target"]) +else + solution (_OPTIONS["target"] .. _OPTIONS["subtarget"]) +end + +configurations { + "Debug", + "Release", +} + +platforms { + "x32", + "x64", + "Native", -- for targets where bitness is not specified +} + +language "C++" + +flags { + "StaticRuntime", + "NoPCH", +} + +configuration { "vs*" } + flags { + "ExtraWarnings", + } + if not _OPTIONS["NOWERROR"] then + flags{ + "FatalWarnings", + } + end + + +configuration { "Debug", "vs*" } + flags { + "Symbols", + } + +configuration {} + +--aftercompilefile ("\t$(SILENT) gawk -f ../../../../../scripts/depfilter.awk $(@:%.o=%.d) > $(@:%.o=%.dep)\n\t$(SILENT) mv $(@:%.o=%.dep) $(@:%.o=%.d)") + + +msgcompile ("Compiling $(subst ../,,$<)...") + +msgcompile_objc ("Objective-C compiling $(subst ../,,$<)...") + +msgresource ("Compiling resources $(subst ../,,$<)...") + +msglinking ("Linking $(notdir $@)...") + +msgarchiving ("Archiving $(notdir $@)...") + +messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" } + +if (not os.isfile(path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then + error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") +end +dofile (path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua")) + +configuration { "gmake" } + flags { + "SingleOutputDir", + } + +configuration { "x64", "Release" } + targetsuffix "64" + if _OPTIONS["PROFILE"] then + targetsuffix "64p" + end + +configuration { "x64", "Debug" } + targetsuffix "64d" + if _OPTIONS["PROFILE"] then + targetsuffix "64dp" + end + +configuration { "x32", "Release" } + targetsuffix "" + if _OPTIONS["PROFILE"] then + targetsuffix "p" + end + +configuration { "x32", "Debug" } + targetsuffix "d" + if _OPTIONS["PROFILE"] then + targetsuffix "dp" + end + +configuration { "Native", "Release" } + targetsuffix "" + if _OPTIONS["PROFILE"] then + targetsuffix "p" + end + +configuration { "Native", "Debug" } + targetsuffix "d" + if _OPTIONS["PROFILE"] then + targetsuffix "dp" + end + +configuration { } + +dofile ("toolchain.lua") + + +if _OPTIONS["targetos"]=="windows" then + configuration { "x64" } + defines { + "X64_WINDOWS_ABI", + } + configuration { } +end + +-- Avoid error when invoking genie --help. +if (_ACTION == nil) then return false end + +-- define PTR64 if we are a 64-bit target +configuration { "x64" } + defines { "PTR64=1" } + +-- map the INLINE to something digestible by GCC +configuration { "gmake" } + buildoptions_cpp { + "-DINLINE=\"static inline\"", + } + buildoptions_objc { + "-DINLINE=\"static inline\"", + } +configuration { "vs*" } + defines { + "INLINE=static inline", + } + +-- define MAME_DEBUG if we are a debugging build +configuration { "Debug" } + defines { + "MAME_DEBUG", + } + if _OPTIONS["PROFILER"] then + defines{ + "MAME_PROFILER", -- define MAME_PROFILER if we are a profiling build + } + end + +configuration { "Release" } + defines { + "NDEBUG", + } + +configuration { } + +-- CR/LF setup: use both on win32/os2, CR only on everything else +if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="os2" then + defines { + "CRLF=3", + } +else + defines { + "CRLF=2", + } +end + + +-- define LSB_FIRST if we are a little-endian target +defines { + "LSB_FIRST", +} + +-- need to ensure FLAC functions are statically linked +defines { + "FLAC__NO_DLL", +} + +if _OPTIONS["NOASM"]=="1" then + defines { + "MAME_NOASM" + } +end + +-- fixme -- need to make this work for other target architectures (PPC) +if not _OPTIONS["FORCE_DRC_C_BACKEND"] then + configuration { "x64" } + defines { + "NATIVE_DRC=drcbe_x64", + } + configuration { "x32" } + defines { + "NATIVE_DRC=drcbe_x86", + } + configuration { } +end + +-- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used +--ifneq ($(BUILD_JPEGLIB),1) +--DEFS += -DUSE_SYSTEM_JPEGLIB +--endif + +--ifdef FASTDEBUG +--DEFS += -DMAME_DEBUG_FAST +--endif + + --To support casting in Lua 5.3 + defines { + "LUA_COMPAT_APIINTCASTS", + } + + if _ACTION == "gmake" then + + --we compile C-only to C89 standard with GNU extensions + buildoptions_c { + "-std=gnu89", + + } + --we compile C++ code to C++98 standard with GNU extensions + buildoptions_cpp { + "-x c++", + "-std=gnu++98", + } + + buildoptions_objc { + "-x objective-c++", + } +--ifdef CPP11 +--CPPONLYFLAGS += -x c++ -std=gnu++11 +--else + +-- this speeds it up a bit by piping between the preprocessor/compiler/assembler + if not ("pnacl" == _OPTIONS["gcc"]) then + buildoptions { + "--pipe", + } + end +-- add -g if we need symbols, and ensure we have frame pointers +if _OPTIONS["SYMBOLS"]~=nil then + buildoptions { + "-g" .. _OPTIONS["SYMLEVEL"], + "-fno-omit-frame-pointer", + "-fno-optimize-sibling-calls", + } +end + +--# we need to disable some additional implicit optimizations for profiling +if _OPTIONS["PROFILE"] then + buildoptions { + "-mno-omit-leaf-frame-pointer", + } +end +-- add -v if we need verbose build information +if _OPTIONS["VERBOSE"] then + buildoptions { + "-v", + } +end + +-- only show deprecation warnings when enabled +--ifndef DEPRECATED + buildoptions { + "-Wno-deprecated-declarations" + } +--endif + +-- add profiling information for the compiler +if _OPTIONS["PROFILE"] then + buildoptions { + "-pg", + } + linkoptions { + "-pg", + } +end + +if _OPTIONS["SYMBOLS"]~=nil then + flags { + "Symbols", + } +end + +--# add the optimization flag + buildoptions { + "-O".. _OPTIONS["OPTIMIZE"], + "-fno-strict-aliasing" + } + + -- add the error warning flag +if _OPTIONS["NOWERROR"]==nil then + buildoptions { + "-Werror", + } +end + +-- if we are optimizing, include optimization options +--ifneq ($(),0) +if _OPTIONS["OPTIMIZE"] then + buildoptions { + "-fno-strict-aliasing" + } + if _OPTIONS["ARCHOPTS"] then + buildoptions { + _OPTIONS["ARCHOPTS"] + } + end +--ifdef LTO +--CCOMFLAGS += -flto +--endif +end + +--ifdef SSE2 +--CCOMFLAGS += -msse2 +--endif + +--ifdef OPENMP +--CCOMFLAGS += -fopenmp +--else +--CCOMFLAGS += -Wno-unknown-pragmas +--endif + +if _OPTIONS["LDOPTS"] then + linkoptions { + _OPTIONS["LDOPTS"] + } +end + +if _OPTIONS["MAP"] then + if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then + linkoptions { + "-Wl,-Map," .. "../../../../" .. _OPTIONS["target"] .. ".map" + } + else + linkoptions { + "-Wl,-Map," .. "../../../../" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".map" + } + + end +end + buildoptions { + "-Wno-unknown-pragmas", + } +-- add a basic set of warnings + buildoptions { + "-Wall", + "-Wcast-align", + "-Wundef", + "-Wformat-security", + "-Wwrite-strings", + "-Wno-sign-compare", + "-Wno-conversion", + } +-- warnings only applicable to C compiles + buildoptions_c { + "-Wpointer-arith", + "-Wbad-function-cast", + "-Wstrict-prototypes", + } + +-- warnings only applicable to OBJ-C compiles + buildoptions_objc { + "-Wpointer-arith", + } + +-- warnings only applicable to C++ compiles + buildoptions_cpp { + "-Woverloaded-virtual", + } + +--ifdef SANITIZE +--CCOMFLAGS += -fsanitize=$(SANITIZE) + +--ifneq (,$(findstring thread,$(SANITIZE))) +--CCOMFLAGS += -fPIE +--endif +--endif + + + + local version = str_to_version(_OPTIONS["gcc_version"]) + if string.find(_OPTIONS["gcc"], "clang") then + buildoptions { + "-Wno-cast-align", + "-Wno-tautological-compare", + "-Wno-dynamic-class-memaccess", + "-Wno-self-assign-field", + } + if (version >= 30200) then + buildoptions { + "-Wno-unused-value", + } + end + if (version >= 30400) then + buildoptions { + "-Wno-inline-new-delete", + "-Wno-constant-logical-operand", + } + end + if (version >= 30500) then + buildoptions { + "-Wno-absolute-value", + "-Wno-unknown-warning-option", + "-Wno-extern-c-compat", + } + end + else + if (version == 40201) then + buildoptions { + "-Wno-cast-align" + } + end + if (version >= 40400) then + buildoptions { + "-Wno-unused-result", + } + end + + if (version >= 40700) then + buildoptions { + "-Wno-narrowing", + "-Wno-attributes" + } + end + if (version >= 40800) then + -- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds) + buildoptions { + "-Wno-unused-variable", + "-Wno-array-bounds" + } + end + end + end +--ifeq ($(findstring arm,$(UNAME)),arm) +-- CCOMFLAGS += -Wno-cast-align +--endif + +local subdir +if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then + subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] +else + subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] +end + +if not toolchain(MAME_BUILD_DIR, subdir) then + return -- no action specified +end + +configuration { "asmjs" } + buildoptions { + "-std=gnu89", + "-Wno-implicit-function-declaration", + } + buildoptions_cpp { + "-x c++", + "-std=gnu++98", + } + archivesplit_size "20" + +configuration { "android*" } + buildoptions_cpp { + "-x c++", + "-std=gnu++98", + } + archivesplit_size "20" + +configuration { "pnacl" } + buildoptions { + "-std=gnu89", + "-Wno-inline-new-delete", + } + buildoptions_cpp { + "-x c++", + "-std=gnu++98", + } + archivesplit_size "20" + +configuration { "nacl*" } + buildoptions_cpp { + "-x c++", + "-std=gnu++98", + } + archivesplit_size "20" + +configuration { "linux-*" } + links { + "dl", + } + if _OPTIONS["distro"]=="debian-stable" then + defines + { + "NO_AFFINITY_NP", + } + end + + +configuration { "osx*" } + links { + "pthread", + } + flags { + "Symbols", + } + + +configuration { "mingw*" } + linkoptions { + "-static-libgcc", + "-static-libstdc++", + } +if _OPTIONS["osd"]=="sdl" then + links { + "SDL2", + "imm32", + "version", + "ole32", + "oleaut32", + } +end + links { + "user32", + "gdi32", + "dsound", + "dxguid", + "winmm", + "advapi32", + "comctl32", + "shlwapi", + "wsock32", + "comdlg32", + } + +configuration { "vs*" } + defines { + "XML_STATIC", + "WIN32", + "_WIN32", + "_CRT_NONSTDC_NO_DEPRECATE", + "_CRT_SECURE_NO_DEPRECATE", + } + links { + "user32", + "gdi32", + "dsound", + "dxguid", + "winmm", + "advapi32", + "comctl32", + "shlwapi", + "wsock32", + "comdlg32", + } + + buildoptions { + "/wd4025", + "/wd4003", + "/wd4018", + "/wd4061", + "/wd4100", + "/wd4127", + "/wd4131", + "/wd4141", + "/wd4146", + "/wd4150", + "/wd4189", + "/wd4191", + "/wd4201", + "/wd4232", + "/wd4242", + "/wd4244", + "/wd4250", + "/wd4255", + "/wd4296", + "/wd4306", + "/wd4310", + "/wd4312", + "/wd4324", + "/wd4347", + "/wd4435", + "/wd4510", + "/wd4512", + "/wd4514", + "/wd4571", + "/wd4610", + "/wd4611", + "/wd4619", + "/wd4625", + "/wd4626", + "/wd4640", + "/wd4668", + "/wd4702", + "/wd4706", + "/wd4710", + "/wd4711", + "/wd4805", + "/wd4820", + "/wd4826", + "/wd4365", + "/wd4389", + "/wd4245", + "/wd4388", + "/wd4267", + "/wd4005", + "/wd4350", + "/wd4996", + "/wd4191", + "/wd4060", + "/wd4065", + "/wd4640", + "/wd4290", + "/wd4355", + "/wd4800", + "/wd4371", + "/wd4548", + } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd9", + "/Qwd82", + "/Qwd111", + "/Qwd128", + "/Qwd177", + "/Qwd181", + "/Qwd185", + "/Qwd280", + "/Qwd344", + "/Qwd411", + "/Qwd869", + "/Qwd2545", + "/Qwd2553", + "/Qwd2557", + "/Qwd3280", + + "/Qwd170", + "/Qwd188", + + "/Qwd63", + "/Qwd177", + "/Qwd186", + "/Qwd488", + "/Qwd1478", + "/Qwd1879", + "/Qwd3291", + "/Qwd1195", + "/Qwd1786", + "/Qwd592", -- For lua, false positive? + } +end + + linkoptions { + "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library + } + includedirs { + MAME_DIR .. "3rdparty/dxsdk/Include" + } + +configuration { "x32", "vs*" } + libdirs { + MAME_DIR .. "3rdparty/dxsdk/lib/x86", + } + +configuration { "x64", "vs*" } + libdirs { + MAME_DIR .. "3rdparty/dxsdk/lib/x64", + } + +configuration { } + + +group "libs" + +if (not os.isfile(path.join("src", "osd", _OPTIONS["osd"] .. ".lua"))) then + error("Unsupported value '" .. _OPTIONS["osd"] .. "' for OSD") +end +dofile(path.join("src", "osd", _OPTIONS["osd"] .. ".lua")) +dofile(path.join("src", "lib.lua")) + +group "3rdparty" +dofile(path.join("src", "3rdparty.lua")) + + +group "core" + +dofile(path.join("src", "emu.lua")) +emuProject(_OPTIONS["target"],_OPTIONS["subtarget"]) + +group "drivers" +findfunction("createProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"]) + +group "emulator" +dofile(path.join("src", "main.lua")) +if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then + startproject (_OPTIONS["target"]) +else + startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"]) +end +mainProject(_OPTIONS["target"],_OPTIONS["subtarget"]) + +if _OPTIONS["with-tools"] then + group "tools" + dofile(path.join("src", "tools.lua")) +end + +if (_ACTION == "gmake" and _OPTIONS["gcc"]=='asmjs') then + strip() +end diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua new file mode 100644 index 00000000000..f1e48125e1a --- /dev/null +++ b/scripts/src/3rdparty.lua @@ -0,0 +1,518 @@ +-------------------------------------------------- +-- expat library objects +-------------------------------------------------- + +project "expat" + uuid "f4cd40b1-c37c-452d-9785-640f26f0bf54" + kind "StaticLib" + + options { + "ForceCPP", + } + + files { + MAME_DIR .. "3rdparty/expat/lib/xmlparse.c", + MAME_DIR .. "3rdparty/expat/lib/xmlrole.c", + MAME_DIR .. "3rdparty/expat/lib/xmltok.c", + } + +-------------------------------------------------- +-- zlib library objects +-------------------------------------------------- + +project "zlib" + uuid "3d78bd2a-2bd0-4449-8087-42ddfaef7ec9" + kind "StaticLib" + + configuration "Debug" + defines { + "verbose=-1", + } + + configuration { "gmake" } + buildoptions_c { + "-Wno-strict-prototypes", + } + + configuration { } + defines { + "ZLIB_CONST", + } + + files { + MAME_DIR .. "3rdparty/zlib/adler32.c", + MAME_DIR .. "3rdparty/zlib/compress.c", + MAME_DIR .. "3rdparty/zlib/crc32.c", + MAME_DIR .. "3rdparty/zlib/deflate.c", + MAME_DIR .. "3rdparty/zlib/inffast.c", + MAME_DIR .. "3rdparty/zlib/inflate.c", + MAME_DIR .. "3rdparty/zlib/infback.c", + MAME_DIR .. "3rdparty/zlib/inftrees.c", + MAME_DIR .. "3rdparty/zlib/trees.c", + MAME_DIR .. "3rdparty/zlib/uncompr.c", + MAME_DIR .. "3rdparty/zlib/zutil.c", + } + +-------------------------------------------------- +-- SoftFloat library objects +-------------------------------------------------- + +project "softfloat" + uuid "04fbf89e-4761-4cf2-8a12-64500cf0c5c5" + kind "StaticLib" + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/expat/lib/", + } + includeosd() + + files { + MAME_DIR .. "3rdparty/softfloat/softfloat.c", + MAME_DIR .. "3rdparty/softfloat/fsincos.c", + MAME_DIR .. "3rdparty/softfloat/fyl2x.c", + } + +-------------------------------------------------- +-- libJPEG library objects +-------------------------------------------------- + +project "jpeg" + uuid "447c6800-dcfd-4c48-b72a-a8223bb409ca" + kind "StaticLib" + + files { + MAME_DIR .. "3rdparty/libjpeg/jaricom.c", + MAME_DIR .. "3rdparty/libjpeg/jcapimin.c", + MAME_DIR .. "3rdparty/libjpeg/jcapistd.c", + MAME_DIR .. "3rdparty/libjpeg/jcarith.c", + MAME_DIR .. "3rdparty/libjpeg/jccoefct.c", + MAME_DIR .. "3rdparty/libjpeg/jccolor.c", + MAME_DIR .. "3rdparty/libjpeg/jcdctmgr.c", + MAME_DIR .. "3rdparty/libjpeg/jchuff.c", + MAME_DIR .. "3rdparty/libjpeg/jcinit.c", + MAME_DIR .. "3rdparty/libjpeg/jcmainct.c", + MAME_DIR .. "3rdparty/libjpeg/jcmarker.c", + MAME_DIR .. "3rdparty/libjpeg/jcmaster.c", + MAME_DIR .. "3rdparty/libjpeg/jcomapi.c", + MAME_DIR .. "3rdparty/libjpeg/jcparam.c", + MAME_DIR .. "3rdparty/libjpeg/jcprepct.c", + MAME_DIR .. "3rdparty/libjpeg/jcsample.c", + MAME_DIR .. "3rdparty/libjpeg/jctrans.c", + MAME_DIR .. "3rdparty/libjpeg/jdapimin.c", + MAME_DIR .. "3rdparty/libjpeg/jdapistd.c", + MAME_DIR .. "3rdparty/libjpeg/jdarith.c", + MAME_DIR .. "3rdparty/libjpeg/jdatadst.c", + MAME_DIR .. "3rdparty/libjpeg/jdatasrc.c", + MAME_DIR .. "3rdparty/libjpeg/jdcoefct.c", + MAME_DIR .. "3rdparty/libjpeg/jdcolor.c", + MAME_DIR .. "3rdparty/libjpeg/jddctmgr.c", + MAME_DIR .. "3rdparty/libjpeg/jdhuff.c", + MAME_DIR .. "3rdparty/libjpeg/jdinput.c", + MAME_DIR .. "3rdparty/libjpeg/jdmainct.c", + MAME_DIR .. "3rdparty/libjpeg/jdmarker.c", + MAME_DIR .. "3rdparty/libjpeg/jdmaster.c", + MAME_DIR .. "3rdparty/libjpeg/jdmerge.c", + MAME_DIR .. "3rdparty/libjpeg/jdpostct.c", + MAME_DIR .. "3rdparty/libjpeg/jdsample.c", + MAME_DIR .. "3rdparty/libjpeg/jdtrans.c", + MAME_DIR .. "3rdparty/libjpeg/jerror.c", + MAME_DIR .. "3rdparty/libjpeg/jfdctflt.c", + MAME_DIR .. "3rdparty/libjpeg/jfdctfst.c", + MAME_DIR .. "3rdparty/libjpeg/jfdctint.c", + MAME_DIR .. "3rdparty/libjpeg/jidctflt.c", + MAME_DIR .. "3rdparty/libjpeg/jidctfst.c", + MAME_DIR .. "3rdparty/libjpeg/jidctint.c", + MAME_DIR .. "3rdparty/libjpeg/jquant1.c", + MAME_DIR .. "3rdparty/libjpeg/jquant2.c", + MAME_DIR .. "3rdparty/libjpeg/jutils.c", + MAME_DIR .. "3rdparty/libjpeg/jmemmgr.c", + MAME_DIR .. "3rdparty/libjpeg/jmemansi.c", + } + +-------------------------------------------------- +-- libflac library objects +-------------------------------------------------- + +project "flac" + uuid "b6fc19e8-073a-4541-bb7b-d24b548d424a" + kind "StaticLib" + + configuration { } + defines { + "WORDS_BIGENDIAN=0", + "FLAC__NO_ASM", + "_LARGEFILE_SOURCE", + "_FILE_OFFSET_BITS=64", + "FLAC__HAS_OGG=0", + } + configuration { "vs*" } + defines { + "VERSION=\"1.2.1\"" + } + configuration { "gmake" } + defines { + "VERSION=\\\"1.2.1\\\"" + } + buildoptions_c { + "-Wno-unused-function", + "-O0", + } + + configuration { } + + includedirs { + MAME_DIR .. "3rdparty/libflac/src/libFLAC/include", + MAME_DIR .. "3rdparty/libflac/include", + } + + files { + MAME_DIR .. "3rdparty/libflac/src/libFLAC/bitmath.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/bitreader.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/bitwriter.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/cpu.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/crc.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/fixed.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/float.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/format.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/lpc.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/md5.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/memory.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/stream_decoder.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/stream_encoder.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/stream_encoder_framing.c", + MAME_DIR .. "3rdparty/libflac/src/libFLAC/window.c", + } + +-------------------------------------------------- +-- lib7z library objects +-------------------------------------------------- + +project "7z" + uuid "ad573d62-e76a-4b11-ae34-5110a6789a42" + kind "StaticLib" + + configuration { } + defines { + "_7ZIP_PPMD_SUPPPORT", + "_7ZIP_ST", + } + + files { + MAME_DIR .. "3rdparty/lzma/C/7zBuf.c", + MAME_DIR .. "3rdparty/lzma/C/7zBuf2.c", + MAME_DIR .. "3rdparty/lzma/C/7zCrc.c", + MAME_DIR .. "3rdparty/lzma/C/7zCrcOpt.c", + MAME_DIR .. "3rdparty/lzma/C/7zDec.c", + MAME_DIR .. "3rdparty/lzma/C/7zIn.c", + MAME_DIR .. "3rdparty/lzma/C/CpuArch.c", + MAME_DIR .. "3rdparty/lzma/C/LzmaDec.c", + MAME_DIR .. "3rdparty/lzma/C/Lzma2Dec.c", + MAME_DIR .. "3rdparty/lzma/C/LzmaEnc.c", + MAME_DIR .. "3rdparty/lzma/C/Lzma2Enc.c", + MAME_DIR .. "3rdparty/lzma/C/LzFind.c", + MAME_DIR .. "3rdparty/lzma/C/Bra.c", + MAME_DIR .. "3rdparty/lzma/C/Bra86.c", + MAME_DIR .. "3rdparty/lzma/C/Bcj2.c", + MAME_DIR .. "3rdparty/lzma/C/Ppmd7.c", + MAME_DIR .. "3rdparty/lzma/C/Ppmd7Dec.c", + MAME_DIR .. "3rdparty/lzma/C/7zStream.c", + } + +-------------------------------------------------- +-- LUA library objects +-------------------------------------------------- + +project "lua" + uuid "d9e2eed1-f1ab-4737-a6ac-863700b1a5a9" + kind "StaticLib" + + configuration { } + defines { + "LUA_COMPAT_ALL", + } + if not (_OPTIONS["targetos"]=="windows") then + defines { + "LUA_USE_POSIX", + } + end + if ("pnacl" == _OPTIONS["gcc"]) then + defines { + "LUA_32BITS", + } + end + + configuration { } + + includedirs { + MAME_DIR .. "3rdparty", + } + + files { + MAME_DIR .. "3rdparty/lua/src/lapi.c", + MAME_DIR .. "3rdparty/lua/src/lcode.c", + MAME_DIR .. "3rdparty/lua/src/lctype.c", + MAME_DIR .. "3rdparty/lua/src/ldebug.c", + MAME_DIR .. "3rdparty/lua/src/ldo.c", + MAME_DIR .. "3rdparty/lua/src/ldump.c", + MAME_DIR .. "3rdparty/lua/src/lfunc.c", + MAME_DIR .. "3rdparty/lua/src/lgc.c", + MAME_DIR .. "3rdparty/lua/src/llex.c", + MAME_DIR .. "3rdparty/lua/src/lmem.c", + MAME_DIR .. "3rdparty/lua/src/lobject.c", + MAME_DIR .. "3rdparty/lua/src/lopcodes.c", + MAME_DIR .. "3rdparty/lua/src/lparser.c", + MAME_DIR .. "3rdparty/lua/src/lstate.c", + MAME_DIR .. "3rdparty/lua/src/lstring.c", + MAME_DIR .. "3rdparty/lua/src/ltable.c", + MAME_DIR .. "3rdparty/lua/src/ltm.c", + MAME_DIR .. "3rdparty/lua/src/lundump.c", + MAME_DIR .. "3rdparty/lua/src/lvm.c", + MAME_DIR .. "3rdparty/lua/src/lzio.c", + MAME_DIR .. "3rdparty/lua/src/lauxlib.c", + MAME_DIR .. "3rdparty/lua/src/lbaselib.c", + MAME_DIR .. "3rdparty/lua/src/lbitlib.c", + MAME_DIR .. "3rdparty/lua/src/lcorolib.c", + MAME_DIR .. "3rdparty/lua/src/ldblib.c", + MAME_DIR .. "3rdparty/lua/src/liolib.c", + MAME_DIR .. "3rdparty/lua/src/lmathlib.c", + MAME_DIR .. "3rdparty/lua/src/loslib.c", + MAME_DIR .. "3rdparty/lua/src/lstrlib.c", + MAME_DIR .. "3rdparty/lua/src/ltablib.c", + MAME_DIR .. "3rdparty/lua/src/loadlib.c", + MAME_DIR .. "3rdparty/lua/src/linit.c", + MAME_DIR .. "3rdparty/lua/src/lutf8lib.c", + } + +-------------------------------------------------- +-- sqlite3 lua library objects +-------------------------------------------------- + +project "lsqlite3" + uuid "1d84edab-94cf-48fb-83ee-b75bc697660e" + kind "StaticLib" + + configuration { } + defines { + "LUA_COMPAT_ALL", + } + + includedirs { + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/lua/src", + } + + files { + MAME_DIR .. "3rdparty/lsqlite3/lsqlite3.c", + } + +-------------------------------------------------- +-- mongoose library objects +-------------------------------------------------- + +project "mongoose" + uuid "ff05b529-2b6f-4166-9dff-5fe2aef89c40" + kind "StaticLib" + + options { + "ForceCPP", + } + defines { + "MONGOOSE_ENABLE_THREADS", + "NS_STACK_SIZE=0" + } + + includedirs { + MAME_DIR .. "3rdparty/mongoose", + } + + files { + MAME_DIR .. "3rdparty/mongoose/mongoose.c", + } + +-------------------------------------------------- +-- jsoncpp library objects +-------------------------------------------------- + +project "jsoncpp" + uuid "ae023ff3-d712-4e54-adc5-3b56a148650f" + kind "StaticLib" + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "3rdparty/jsoncpp/include", + } + + files { + MAME_DIR .. "3rdparty/jsoncpp/src/lib_json/json_reader.cpp", + MAME_DIR .. "3rdparty/jsoncpp/src/lib_json/json_value.cpp", + MAME_DIR .. "3rdparty/jsoncpp/src/lib_json/json_writer.cpp", + + } + +-------------------------------------------------- +-- SQLite3 library objects +-------------------------------------------------- + +project "sqllite3" + uuid "5cb3d495-57ed-461c-81e5-80dc0857517d" + kind "StaticLib" + + configuration { "gmake" } + buildoptions_c { + "-Wno-bad-function-cast", + "-Wno-undef", + } + + configuration { } + + files { + MAME_DIR .. "3rdparty/sqlite3/sqlite3.c", + } + +-------------------------------------------------- +-- portmidi library objects +-------------------------------------------------- + +project "portmidi" + uuid "587f2da6-3274-4a65-86a2-f13ea315bb98" + kind "StaticLib" + + includedirs { + MAME_DIR .. "3rdparty/portmidi/pm_common", + MAME_DIR .. "3rdparty/portmidi/porttime", + } + + includeosd() + + configuration { "linux*" } + defines { + "PMALSA=1", + } + + configuration { } + + files { + MAME_DIR .. "3rdparty/portmidi/pm_common/portmidi.c", + MAME_DIR .. "3rdparty/portmidi/pm_common/pmutil.c", + } + + if _OPTIONS["targetos"]=="windows" then + files { + MAME_DIR .. "3rdparty/portmidi/porttime/ptwinmm.c", + MAME_DIR .. "3rdparty/portmidi/pm_win/pmwin.c", + MAME_DIR .. "3rdparty/portmidi/pm_win/pmwinmm.c", + MAME_DIR .. "3rdparty/portmidi/porttime/ptwinmm.c", + } + end + + if _OPTIONS["targetos"]=="linux" then + files { + MAME_DIR .. "3rdparty/portmidi/pm_linux/pmlinux.c", + MAME_DIR .. "3rdparty/portmidi/pm_linux/pmlinuxalsa.c", + MAME_DIR .. "3rdparty/portmidi/pm_linux/finddefault.c", + MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c", + } + end + if _OPTIONS["targetos"]=="macosx" then + files { + MAME_DIR .. "3rdparty/portmidi/pm_mac/pmmac.c", + MAME_DIR .. "3rdparty/portmidi/pm_mac/pmmacosxcm.c", + MAME_DIR .. "3rdparty/portmidi/pm_mac/finddefault.c", + MAME_DIR .. "3rdparty/portmidi/pm_mac/readbinaryplist.c", + MAME_DIR .. "3rdparty/portmidi/pm_mac/osxsupport.m", + MAME_DIR .. "3rdparty/portmidi/porttime/ptmacosx_mach.c", + } + end + +-------------------------------------------------- +-- BGFX library objects +-------------------------------------------------- + +if (USE_BGFX == 1) then +project "bgfx" + uuid "d3e7e119-35cf-4f4f-aba0-d3bdcd1b879a" + kind "StaticLib" + + includedirs { + MAME_DIR .. "3rdparty/bgfx/include", + MAME_DIR .. "3rdparty/bgfx/3rdparty", + MAME_DIR .. "3rdparty/bx/include", + MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos", + } + + includeosd() + + configuration { "vs*" } + includedirs { + MAME_DIR .. "3rdparty/dxsdk/Include", + MAME_DIR .. "3rdparty/bx/include/compat/msvc", + } + configuration { "mingw*" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/mingw", + } + + configuration { "osx*" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/osx", + } + + configuration { "gmake" } + buildoptions { + "-Wno-uninitialized", + } + + configuration { } + + defines { + "__STDC_LIMIT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_CONSTANT_MACROS", + } + files { + MAME_DIR .. "3rdparty/bgfx/src/bgfx.cpp", + MAME_DIR .. "3rdparty/bgfx/src/glcontext_egl.cpp", + MAME_DIR .. "3rdparty/bgfx/src/glcontext_glx.cpp", + MAME_DIR .. "3rdparty/bgfx/src/glcontext_ppapi.cpp", + MAME_DIR .. "3rdparty/bgfx/src/glcontext_wgl.cpp", + MAME_DIR .. "3rdparty/bgfx/src/image.cpp", + MAME_DIR .. "3rdparty/bgfx/src/ovr.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderer_d3d12.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderer_d3d11.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderer_d3d9.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderer_gl.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderer_null.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderer_vk.cpp", + MAME_DIR .. "3rdparty/bgfx/src/renderdoc.cpp", + MAME_DIR .. "3rdparty/bgfx/src/vertexdecl.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/bgfx_utils.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/bounds.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/camera.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/cube_atlas.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/font/font_manager.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/font/text_metrics.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/font/utf8.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/imgui/imgui.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/nanovg/nanovg.cpp", + MAME_DIR .. "3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp", + } + if _OPTIONS["targetos"]=="macosx" then + files { + MAME_DIR .. "3rdparty/bgfx/src/glcontext_eagl.mm", + MAME_DIR .. "3rdparty/bgfx/src/glcontext_nsgl.mm", + + } + end +end diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua new file mode 100644 index 00000000000..c11562ebc3d --- /dev/null +++ b/scripts/src/bus.lua @@ -0,0 +1,1663 @@ +--------------------------------------------------------------------------- +-- +-- bus.lua +-- +-- Rules for building bus cores +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +--------------------------------------------------------------------------- + +------------------------------------------------- +-- +--@src/emu/bus/a7800/a78_slot.h,BUSES += A7800 +--------------------------------------------------- + +if (BUSES["A7800"]~=null) then + files { + MAME_DIR .. "src/emu/bus/a7800/a78_slot.c", + MAME_DIR .. "src/emu/bus/a7800/rom.c", + MAME_DIR .. "src/emu/bus/a7800/hiscore.c", + MAME_DIR .. "src/emu/bus/a7800/xboard.c", + MAME_DIR .. "src/emu/bus/a7800/cpuwiz.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/a800/a800_slot.h,BUSES += A800 +--------------------------------------------------- + +if (BUSES["A800"]~=null) then + files { + MAME_DIR .. "src/emu/bus/a800/a800_slot.c", + MAME_DIR .. "src/emu/bus/a800/rom.c", + MAME_DIR .. "src/emu/bus/a800/oss.c", + MAME_DIR .. "src/emu/bus/a800/sparta.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/a8sio/a8sio.h,BUSES += A8SIO +--------------------------------------------------- + +if (BUSES["A8SIO"]~=null) then + files { + MAME_DIR .. "src/emu/bus/a8sio/a8sio.c", + MAME_DIR .. "src/emu/bus/a8sio/cassette.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/abcbus/abcbus.h,BUSES += ABCBUS +--------------------------------------------------- + +if (BUSES["ABCBUS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/abcbus/abcbus.c", + MAME_DIR .. "src/emu/bus/abcbus/abc890.c", + MAME_DIR .. "src/emu/bus/abcbus/dos.c", + MAME_DIR .. "src/emu/bus/abcbus/fd2.c", + MAME_DIR .. "src/emu/bus/abcbus/hdc.c", + MAME_DIR .. "src/emu/bus/abcbus/lux10828.c", + MAME_DIR .. "src/emu/bus/abcbus/lux21046.c", + MAME_DIR .. "src/emu/bus/abcbus/lux21056.c", + MAME_DIR .. "src/emu/bus/abcbus/lux4105.c", + MAME_DIR .. "src/emu/bus/abcbus/uni800.c", + MAME_DIR .. "src/emu/bus/abcbus/sio.c", + MAME_DIR .. "src/emu/bus/abcbus/slutprov.c", + MAME_DIR .. "src/emu/bus/abcbus/turbo.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/adam/exp.h,BUSES += ADAM +--------------------------------------------------- + +if (BUSES["ADAM"]~=null) then + files { + MAME_DIR .. "src/emu/bus/adam/exp.c", + MAME_DIR .. "src/emu/bus/adam/adamlink.c", + MAME_DIR .. "src/emu/bus/adam/ide.c", + MAME_DIR .. "src/emu/bus/adam/ram.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/adamnet/adamnet.h,BUSES += ADAMNET +--------------------------------------------------- + +if (BUSES["ADAMNET"]~=null) then + files { + MAME_DIR .. "src/emu/bus/adamnet/adamnet.c", + MAME_DIR .. "src/emu/bus/adamnet/ddp.c", + MAME_DIR .. "src/emu/bus/adamnet/fdc.c", + MAME_DIR .. "src/emu/bus/adamnet/kb.c", + MAME_DIR .. "src/emu/bus/adamnet/printer.c", + MAME_DIR .. "src/emu/bus/adamnet/spi.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/apf/slot.h,BUSES += APF +--------------------------------------------------- + +if (BUSES["APF"]~=null) then + files { + MAME_DIR .. "src/emu/bus/apf/slot.c", + MAME_DIR .. "src/emu/bus/apf/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/arcadia/slot.h,BUSES += ARCADIA +--------------------------------------------------- + +if (BUSES["ARCADIA"]~=null) then + files { + MAME_DIR .. "src/emu/bus/arcadia/slot.c", + MAME_DIR .. "src/emu/bus/arcadia/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/astrocde/slot.h,BUSES += ASTROCADE +--------------------------------------------------- + +if (BUSES["ASTROCADE"]~=null) then + files { + MAME_DIR .. "src/emu/bus/astrocde/slot.c", + MAME_DIR .. "src/emu/bus/astrocde/rom.c", + MAME_DIR .. "src/emu/bus/astrocde/exp.c", + MAME_DIR .. "src/emu/bus/astrocde/ram.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/bw2/exp.h,BUSES += BW2 +--------------------------------------------------- + +if (BUSES["BW2"]~=null) then + files { + MAME_DIR .. "src/emu/bus/bw2/exp.c", + MAME_DIR .. "src/emu/bus/bw2/ramcard.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/c64/exp.h,BUSES += C64 +--@src/emu/bus/c64/user.h,BUSES += C64 +--------------------------------------------------- + +if (BUSES["C64"]~=null) then + files { + MAME_DIR .. "src/emu/bus/c64/exp.c", + MAME_DIR .. "src/emu/bus/c64/c128_comal80.c", + MAME_DIR .. "src/emu/bus/c64/comal80.c", + MAME_DIR .. "src/emu/bus/c64/cpm.c", + MAME_DIR .. "src/emu/bus/c64/currah_speech.c", + MAME_DIR .. "src/emu/bus/c64/dela_ep256.c", + MAME_DIR .. "src/emu/bus/c64/dela_ep64.c", + MAME_DIR .. "src/emu/bus/c64/dela_ep7x8.c", + MAME_DIR .. "src/emu/bus/c64/dinamic.c", + MAME_DIR .. "src/emu/bus/c64/dqbb.c", + MAME_DIR .. "src/emu/bus/c64/easy_calc_result.c", + MAME_DIR .. "src/emu/bus/c64/easyflash.c", + MAME_DIR .. "src/emu/bus/c64/epyx_fast_load.c", + MAME_DIR .. "src/emu/bus/c64/exos.c", + MAME_DIR .. "src/emu/bus/c64/fcc.c", + MAME_DIR .. "src/emu/bus/c64/final.c", + MAME_DIR .. "src/emu/bus/c64/final3.c", + MAME_DIR .. "src/emu/bus/c64/fun_play.c", + MAME_DIR .. "src/emu/bus/c64/georam.c", + MAME_DIR .. "src/emu/bus/c64/ide64.c", + MAME_DIR .. "src/emu/bus/c64/ieee488.c", + MAME_DIR .. "src/emu/bus/c64/kingsoft.c", + MAME_DIR .. "src/emu/bus/c64/mach5.c", + MAME_DIR .. "src/emu/bus/c64/magic_desk.c", + MAME_DIR .. "src/emu/bus/c64/magic_formel.c", + MAME_DIR .. "src/emu/bus/c64/magic_voice.c", + MAME_DIR .. "src/emu/bus/c64/midi_maplin.c", + MAME_DIR .. "src/emu/bus/c64/midi_namesoft.c", + MAME_DIR .. "src/emu/bus/c64/midi_passport.c", + MAME_DIR .. "src/emu/bus/c64/midi_sci.c", + MAME_DIR .. "src/emu/bus/c64/midi_siel.c", + MAME_DIR .. "src/emu/bus/c64/mikro_assembler.c", + MAME_DIR .. "src/emu/bus/c64/multiscreen.c", + MAME_DIR .. "src/emu/bus/c64/music64.c", + MAME_DIR .. "src/emu/bus/c64/neoram.c", + MAME_DIR .. "src/emu/bus/c64/ocean.c", + MAME_DIR .. "src/emu/bus/c64/pagefox.c", + MAME_DIR .. "src/emu/bus/c64/partner.c", + MAME_DIR .. "src/emu/bus/c64/prophet64.c", + MAME_DIR .. "src/emu/bus/c64/ps64.c", + MAME_DIR .. "src/emu/bus/c64/reu.c", + MAME_DIR .. "src/emu/bus/c64/rex.c", + MAME_DIR .. "src/emu/bus/c64/rex_ep256.c", + MAME_DIR .. "src/emu/bus/c64/ross.c", + MAME_DIR .. "src/emu/bus/c64/sfx_sound_expander.c", + MAME_DIR .. "src/emu/bus/c64/silverrock.c", + MAME_DIR .. "src/emu/bus/c64/simons_basic.c", + MAME_DIR .. "src/emu/bus/c64/stardos.c", + MAME_DIR .. "src/emu/bus/c64/std.c", + MAME_DIR .. "src/emu/bus/c64/structured_basic.c", + MAME_DIR .. "src/emu/bus/c64/super_explode.c", + MAME_DIR .. "src/emu/bus/c64/super_games.c", + MAME_DIR .. "src/emu/bus/c64/supercpu.c", + MAME_DIR .. "src/emu/bus/c64/sw8k.c", + MAME_DIR .. "src/emu/bus/c64/swiftlink.c", + MAME_DIR .. "src/emu/bus/c64/system3.c", + MAME_DIR .. "src/emu/bus/c64/tdos.c", + MAME_DIR .. "src/emu/bus/c64/turbo232.c", + MAME_DIR .. "src/emu/bus/c64/vizastar.c", + MAME_DIR .. "src/emu/bus/c64/vw64.c", + MAME_DIR .. "src/emu/bus/c64/warp_speed.c", + MAME_DIR .. "src/emu/bus/c64/westermann.c", + MAME_DIR .. "src/emu/bus/c64/xl80.c", + MAME_DIR .. "src/emu/bus/c64/zaxxon.c", + MAME_DIR .. "src/emu/bus/c64/user.c", + MAME_DIR .. "src/emu/bus/c64/4dxh.c", + MAME_DIR .. "src/emu/bus/c64/4ksa.c", + MAME_DIR .. "src/emu/bus/c64/4tba.c", + MAME_DIR .. "src/emu/bus/c64/16kb.c", + MAME_DIR .. "src/emu/bus/c64/bn1541.c", + MAME_DIR .. "src/emu/bus/c64/geocable.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/cbm2/exp.h,BUSES += CBM2 +--@src/emu/bus/cbm2/user.h,BUSES += CBM2 +--------------------------------------------------- + +if (BUSES["CBM2"]~=null) then + files { + MAME_DIR .. "src/emu/bus/cbm2/exp.c", + MAME_DIR .. "src/emu/bus/cbm2/24k.c", + MAME_DIR .. "src/emu/bus/cbm2/hrg.c", + MAME_DIR .. "src/emu/bus/cbm2/std.c", + MAME_DIR .. "src/emu/bus/cbm2/user.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/cbmiec/cbmiec.h,BUSES += CBMIEC +--------------------------------------------------- + +if (BUSES["CBMIEC"]~=null) then + files { + MAME_DIR .. "src/emu/bus/cbmiec/cbmiec.c", + MAME_DIR .. "src/emu/bus/cbmiec/c1541.c", + MAME_DIR .. "src/emu/bus/cbmiec/c1571.c", + MAME_DIR .. "src/emu/bus/cbmiec/c1581.c", + MAME_DIR .. "src/emu/bus/cbmiec/c64_nl10.c", + MAME_DIR .. "src/emu/bus/cbmiec/cmdhd.c", + MAME_DIR .. "src/emu/bus/cbmiec/diag264_lb_iec.c", + MAME_DIR .. "src/emu/bus/cbmiec/fd2000.c", + MAME_DIR .. "src/emu/bus/cbmiec/interpod.c", + MAME_DIR .. "src/emu/bus/cbmiec/serialbox.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/chanf/slot.h,BUSES += CHANNELF +--------------------------------------------------- + +if (BUSES["CHANNELF"]~=null) then + files { + MAME_DIR .. "src/emu/bus/chanf/slot.c", + MAME_DIR .. "src/emu/bus/chanf/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/comx35/exp.h,BUSES += COMX35 +--------------------------------------------------- + +if (BUSES["COMX35"]~=null) then + files { + MAME_DIR .. "src/emu/bus/comx35/exp.c", + MAME_DIR .. "src/emu/bus/comx35/clm.c", + MAME_DIR .. "src/emu/bus/comx35/expbox.c", + MAME_DIR .. "src/emu/bus/comx35/eprom.c", + MAME_DIR .. "src/emu/bus/comx35/fdc.c", + MAME_DIR .. "src/emu/bus/comx35/joycard.c", + MAME_DIR .. "src/emu/bus/comx35/printer.c", + MAME_DIR .. "src/emu/bus/comx35/ram.c", + MAME_DIR .. "src/emu/bus/comx35/thermal.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/coleco/ctrl.h,BUSES += COLECO +--------------------------------------------------- + +if (BUSES["COLECO"]~=null) then + files { + MAME_DIR .. "src/emu/bus/coleco/ctrl.c", + MAME_DIR .. "src/emu/bus/coleco/hand.c", + MAME_DIR .. "src/emu/bus/coleco/sac.c", + MAME_DIR .. "src/emu/bus/coleco/exp.c", + MAME_DIR .. "src/emu/bus/coleco/std.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/crvision/slot.h,BUSES += CRVISION +--------------------------------------------------- + +if (BUSES["CRVISION"]~=null) then + files { + MAME_DIR .. "src/emu/bus/crvision/slot.c", + MAME_DIR .. "src/emu/bus/crvision/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/dmv/dmv.h,BUSES += DMV +--------------------------------------------------- + +if (BUSES["DMV"]~=null) then + files { + MAME_DIR .. "src/emu/bus/dmv/dmvbus.c", + MAME_DIR .. "src/emu/bus/dmv/k210.c", + MAME_DIR .. "src/emu/bus/dmv/k220.c", + MAME_DIR .. "src/emu/bus/dmv/k230.c", + MAME_DIR .. "src/emu/bus/dmv/k233.c", + MAME_DIR .. "src/emu/bus/dmv/k801.c", + MAME_DIR .. "src/emu/bus/dmv/k803.c", + MAME_DIR .. "src/emu/bus/dmv/k806.c", + MAME_DIR .. "src/emu/bus/dmv/ram.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/ecbbus/ecbbus.h,BUSES += ECBBUS +--------------------------------------------------- + +if (BUSES["ECBBUS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/ecbbus/ecbbus.c", + MAME_DIR .. "src/emu/bus/ecbbus/grip.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/econet/econet.h,BUSES += ECONET +--------------------------------------------------- + +if (BUSES["ECONET"]~=null) then + files { + MAME_DIR .. "src/emu/bus/econet/econet.c", + MAME_DIR .. "src/emu/bus/econet/e01.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/ep64/exp.h,BUSES += EP64 +--------------------------------------------------- + +if (BUSES["EP64"]~=null) then + files { + MAME_DIR .. "src/emu/bus/ep64/exp.c", + MAME_DIR .. "src/emu/bus/ep64/exdos.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/generic/slot.h,BUSES += GENERIC +--------------------------------------------------- + +if (BUSES["GENERIC"]~=null) then + files { + MAME_DIR .. "src/emu/bus/generic/slot.c", + MAME_DIR .. "src/emu/bus/generic/carts.c", + MAME_DIR .. "src/emu/bus/generic/ram.c", + MAME_DIR .. "src/emu/bus/generic/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/ieee488/ieee488.h,BUSES += IEEE488 +--------------------------------------------------- + +if (BUSES["IEEE488"]~=null) then + files { + MAME_DIR .. "src/emu/bus/ieee488/ieee488.c", + MAME_DIR .. "src/emu/bus/ieee488/c2031.c", + MAME_DIR .. "src/emu/bus/ieee488/c2040.c", + MAME_DIR .. "src/emu/bus/ieee488/c2040fdc.c", + MAME_DIR .. "src/emu/bus/ieee488/c8050.c", + MAME_DIR .. "src/emu/bus/ieee488/c8050fdc.c", + MAME_DIR .. "src/emu/bus/ieee488/c8280.c", + MAME_DIR .. "src/emu/bus/ieee488/d9060.c", + MAME_DIR .. "src/emu/bus/ieee488/softbox.c", + MAME_DIR .. "src/emu/bus/ieee488/hardbox.c", + MAME_DIR .. "src/emu/bus/ieee488/shark.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/iq151/iq151.h,BUSES += IQ151 +--------------------------------------------------- + +if (BUSES["IQ151"]~=null) then + files { + MAME_DIR .. "src/emu/bus/iq151/iq151.c", + MAME_DIR .. "src/emu/bus/iq151/disc2.c", + MAME_DIR .. "src/emu/bus/iq151/grafik.c", + MAME_DIR .. "src/emu/bus/iq151/minigraf.c", + MAME_DIR .. "src/emu/bus/iq151/ms151a.c", + MAME_DIR .. "src/emu/bus/iq151/rom.c", + MAME_DIR .. "src/emu/bus/iq151/staper.c", + MAME_DIR .. "src/emu/bus/iq151/video32.c", + MAME_DIR .. "src/emu/bus/iq151/video64.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/isbx/isbx.h,BUSES += IMI7000 +--------------------------------------------------- + +if (BUSES["IMI7000"]~=null) then + files { + MAME_DIR .. "src/emu/bus/imi7000/imi7000.c", + MAME_DIR .. "src/emu/bus/imi7000/imi5000h.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/intv/slot.h,BUSES += INTV +--------------------------------------------------- + +if (BUSES["INTV"]~=null) then + files { + MAME_DIR .. "src/emu/bus/intv/slot.c", + MAME_DIR .. "src/emu/bus/intv/rom.c", + MAME_DIR .. "src/emu/bus/intv/voice.c", + MAME_DIR .. "src/emu/bus/intv/ecs.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/isa/isa.h,BUSES += ISA +--------------------------------------------------- + +if (BUSES["ISA"]~=null) then + files { + MAME_DIR .. "src/emu/bus/isa/isa.c", + MAME_DIR .. "src/emu/bus/isa/isa_cards.c", + MAME_DIR .. "src/emu/bus/isa/mda.c", + MAME_DIR .. "src/emu/bus/isa/wdxt_gen.c", + MAME_DIR .. "src/emu/bus/isa/adlib.c", + MAME_DIR .. "src/emu/bus/isa/com.c", + MAME_DIR .. "src/emu/bus/isa/fdc.c", + MAME_DIR .. "src/emu/bus/isa/mufdc.c", + MAME_DIR .. "src/emu/bus/isa/finalchs.c", + MAME_DIR .. "src/emu/bus/isa/gblaster.c", + MAME_DIR .. "src/emu/bus/isa/gus.c", + MAME_DIR .. "src/emu/bus/isa/sb16.c", + MAME_DIR .. "src/emu/bus/isa/hdc.c", + MAME_DIR .. "src/emu/bus/isa/ibm_mfc.c", + MAME_DIR .. "src/emu/bus/isa/mpu401.c", + MAME_DIR .. "src/emu/bus/isa/sblaster.c", + MAME_DIR .. "src/emu/bus/isa/stereo_fx.c", + MAME_DIR .. "src/emu/bus/isa/ssi2001.c", + MAME_DIR .. "src/emu/bus/isa/ide.c", + MAME_DIR .. "src/emu/bus/isa/xtide.c", + MAME_DIR .. "src/emu/bus/isa/side116.c", + MAME_DIR .. "src/emu/bus/isa/aha1542.c", + MAME_DIR .. "src/emu/bus/isa/wd1002a_wx1.c", + MAME_DIR .. "src/emu/bus/isa/dectalk.c", + MAME_DIR .. "src/emu/bus/isa/pds.c", + MAME_DIR .. "src/emu/bus/isa/omti8621.c", + MAME_DIR .. "src/emu/bus/isa/cga.c", + MAME_DIR .. "src/emu/bus/isa/svga_cirrus.c", + MAME_DIR .. "src/emu/bus/isa/ega.c", + MAME_DIR .. "src/emu/bus/isa/vga.c", + MAME_DIR .. "src/emu/bus/isa/vga_ati.c", + MAME_DIR .. "src/emu/bus/isa/mach32.c", + MAME_DIR .. "src/emu/bus/isa/svga_tseng.c", + MAME_DIR .. "src/emu/bus/isa/svga_s3.c", + MAME_DIR .. "src/emu/bus/isa/s3virge.c", + MAME_DIR .. "src/emu/bus/isa/pc1640_iga.c", + MAME_DIR .. "src/emu/bus/isa/3c503.c", + MAME_DIR .. "src/emu/bus/isa/ne1000.c", + MAME_DIR .. "src/emu/bus/isa/ne2000.c", + MAME_DIR .. "src/emu/bus/isa/3c505.c", + MAME_DIR .. "src/emu/bus/isa/lpt.c", + MAME_DIR .. "src/emu/bus/isa/p1_fdc.c", + MAME_DIR .. "src/emu/bus/isa/p1_hdc.c", + MAME_DIR .. "src/emu/bus/isa/p1_rom.c", + MAME_DIR .. "src/emu/bus/isa/mc1502_fdc.c", + MAME_DIR .. "src/emu/bus/isa/mc1502_rom.c", + MAME_DIR .. "src/emu/bus/isa/xsu_cards.c", + MAME_DIR .. "src/emu/bus/isa/sc499.c", + MAME_DIR .. "src/emu/bus/isa/aga.c", + MAME_DIR .. "src/emu/bus/isa/svga_trident.c", + MAME_DIR .. "src/emu/bus/isa/num9rev.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/isbx/isbx.h,BUSES += ISBX +--------------------------------------------------- + +if (BUSES["ISBX"]~=null) then + files { + MAME_DIR .. "src/emu/bus/isbx/isbx.c", + MAME_DIR .. "src/emu/bus/isbx/compis_fdc.c", + MAME_DIR .. "src/emu/bus/isbx/isbc_218a.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/msx_slot/slot.h,BUSES += MSX_SLOT +--------------------------------------------------- + +if (BUSES["MSX_SLOT"]~=null) then + files { + MAME_DIR .. "src/emu/bus/msx_slot/bunsetsu.c", + MAME_DIR .. "src/emu/bus/msx_slot/cartridge.c", + MAME_DIR .. "src/emu/bus/msx_slot/disk.c", + MAME_DIR .. "src/emu/bus/msx_slot/fs4600.c", + MAME_DIR .. "src/emu/bus/msx_slot/music.c", + MAME_DIR .. "src/emu/bus/msx_slot/panasonic08.c", + MAME_DIR .. "src/emu/bus/msx_slot/rom.c", + MAME_DIR .. "src/emu/bus/msx_slot/ram.c", + MAME_DIR .. "src/emu/bus/msx_slot/ram_mm.c", + MAME_DIR .. "src/emu/bus/msx_slot/slot.c", + MAME_DIR .. "src/emu/bus/msx_slot/sony08.c", + MAME_DIR .. "src/emu/bus/msx_cart/arc.c", + MAME_DIR .. "src/emu/bus/msx_cart/ascii.c", + MAME_DIR .. "src/emu/bus/msx_cart/bm_012.c", + MAME_DIR .. "src/emu/bus/msx_cart/cartridge.c", + MAME_DIR .. "src/emu/bus/msx_cart/crossblaim.c", + MAME_DIR .. "src/emu/bus/msx_cart/disk.c", + MAME_DIR .. "src/emu/bus/msx_cart/dooly.c", + MAME_DIR .. "src/emu/bus/msx_cart/fmpac.c", + MAME_DIR .. "src/emu/bus/msx_cart/halnote.c", + MAME_DIR .. "src/emu/bus/msx_cart/hfox.c", + MAME_DIR .. "src/emu/bus/msx_cart/holy_quran.c", + MAME_DIR .. "src/emu/bus/msx_cart/konami.c", + MAME_DIR .. "src/emu/bus/msx_cart/korean.c", + MAME_DIR .. "src/emu/bus/msx_cart/majutsushi.c", + MAME_DIR .. "src/emu/bus/msx_cart/msx_audio.c", + MAME_DIR .. "src/emu/bus/msx_cart/msx_audio_kb.c", + MAME_DIR .. "src/emu/bus/msx_cart/msxdos2.c", + MAME_DIR .. "src/emu/bus/msx_cart/nomapper.c", + MAME_DIR .. "src/emu/bus/msx_cart/rtype.c", + MAME_DIR .. "src/emu/bus/msx_cart/superloderunner.c", + MAME_DIR .. "src/emu/bus/msx_cart/super_swangi.c", + MAME_DIR .. "src/emu/bus/msx_cart/yamaha.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/kc/kc.h,BUSES += KC +--------------------------------------------------- + +if (BUSES["KC"]~=null) then + files { + MAME_DIR .. "src/emu/bus/kc/kc.c", + MAME_DIR .. "src/emu/bus/kc/d002.c", + MAME_DIR .. "src/emu/bus/kc/d004.c", + MAME_DIR .. "src/emu/bus/kc/ram.c", + MAME_DIR .. "src/emu/bus/kc/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/odyssey2/slot.h,BUSES += O2 +--------------------------------------------------- + +if (BUSES["O2"]~=null) then + files { + MAME_DIR .. "src/emu/bus/odyssey2/slot.c", + MAME_DIR .. "src/emu/bus/odyssey2/rom.c", + MAME_DIR .. "src/emu/bus/odyssey2/chess.c", + MAME_DIR .. "src/emu/bus/odyssey2/voice.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/pc_joy/pc_joy.h,BUSES += PC_JOY +--------------------------------------------------- + +if (BUSES["PC_JOY"]~=null) then + files { + MAME_DIR .. "src/emu/bus/pc_joy/pc_joy.c", + MAME_DIR .. "src/emu/bus/pc_joy/pc_joy_sw.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/pc_kbd/pc_kbdc.h,BUSES += PC_KBD +--------------------------------------------------- + +if (BUSES["PC_KBD"]~=null) then + files { + MAME_DIR .. "src/emu/bus/pc_kbd/pc_kbdc.c", + MAME_DIR .. "src/emu/bus/pc_kbd/keyboards.c", + MAME_DIR .. "src/emu/bus/pc_kbd/ec1841.c", + MAME_DIR .. "src/emu/bus/pc_kbd/iskr1030.c", + MAME_DIR .. "src/emu/bus/pc_kbd/keytro.c", + MAME_DIR .. "src/emu/bus/pc_kbd/msnat.c", + MAME_DIR .. "src/emu/bus/pc_kbd/pc83.c", + MAME_DIR .. "src/emu/bus/pc_kbd/pcat84.c", + MAME_DIR .. "src/emu/bus/pc_kbd/pcxt83.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/pet/cass.h,BUSES += PET +--@src/emu/bus/pet/exp.h,BUSES += PET +--@src/emu/bus/pet/user.h,BUSES += PET +--------------------------------------------------- + +if (BUSES["PET"]~=null) then + files { + MAME_DIR .. "src/emu/bus/pet/cass.c", + MAME_DIR .. "src/emu/bus/pet/c2n.c", + MAME_DIR .. "src/emu/bus/pet/diag264_lb_tape.c", + MAME_DIR .. "src/emu/bus/pet/exp.c", + MAME_DIR .. "src/emu/bus/pet/64k.c", + MAME_DIR .. "src/emu/bus/pet/hsg.c", + MAME_DIR .. "src/emu/bus/pet/superpet.c", + MAME_DIR .. "src/emu/bus/pet/user.c", + MAME_DIR .. "src/emu/bus/pet/diag.c", + MAME_DIR .. "src/emu/bus/pet/petuja.c", + MAME_DIR .. "src/emu/bus/pet/cb2snd.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/plus4/exp.h,BUSES += PLUS4 +--@src/emu/bus/plus4/user.h,BUSES += PLUS4 +--------------------------------------------------- + +if (BUSES["PLUS4"]~=null) then + files { + MAME_DIR .. "src/emu/bus/plus4/exp.c", + MAME_DIR .. "src/emu/bus/plus4/c1551.c", + MAME_DIR .. "src/emu/bus/plus4/sid.c", + MAME_DIR .. "src/emu/bus/plus4/std.c", + MAME_DIR .. "src/emu/bus/plus4/user.c", + MAME_DIR .. "src/emu/bus/plus4/diag264_lb_user.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/s100/s100.h,BUSES += S100 +--------------------------------------------------- + +if (BUSES["S100"]~=null) then + files { + MAME_DIR .. "src/emu/bus/s100/s100.c", + MAME_DIR .. "src/emu/bus/s100/dj2db.c", + MAME_DIR .. "src/emu/bus/s100/djdma.c", + MAME_DIR .. "src/emu/bus/s100/mm65k16s.c", + MAME_DIR .. "src/emu/bus/s100/nsmdsa.c", + MAME_DIR .. "src/emu/bus/s100/nsmdsad.c", + MAME_DIR .. "src/emu/bus/s100/wunderbus.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/spc1000/exp.h,BUSES += SPC1000 +--------------------------------------------------- + +if (BUSES["SPC1000"]~=null) then + files { + MAME_DIR .. "src/emu/bus/spc1000/exp.c", + MAME_DIR .. "src/emu/bus/spc1000/fdd.c", + MAME_DIR .. "src/emu/bus/spc1000/vdp.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/tvc/tvc.h,BUSES += TVC +--------------------------------------------------- + +if (BUSES["TVC"]~=null) then + files { + MAME_DIR .. "src/emu/bus/tvc/tvc.c", + MAME_DIR .. "src/emu/bus/tvc/hbf.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vc4000/slot.h,BUSES += VC4000 +--------------------------------------------------- + +if (BUSES["VC4000"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vc4000/slot.c", + MAME_DIR .. "src/emu/bus/vc4000/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vcs/vcs_slot.h,BUSES += VCS +--------------------------------------------------- + +if (BUSES["VCS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vcs/vcs_slot.c", + MAME_DIR .. "src/emu/bus/vcs/rom.c", + MAME_DIR .. "src/emu/bus/vcs/compumat.c", + MAME_DIR .. "src/emu/bus/vcs/dpc.c", + MAME_DIR .. "src/emu/bus/vcs/scharger.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vcs/ctrl.h,BUSES += VCS_CTRL +--------------------------------------------------- + +if (BUSES["VCS_CTRL"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vcs_ctrl/ctrl.c", + MAME_DIR .. "src/emu/bus/vcs_ctrl/joystick.c", + MAME_DIR .. "src/emu/bus/vcs_ctrl/joybooster.c", + MAME_DIR .. "src/emu/bus/vcs_ctrl/keypad.c", + MAME_DIR .. "src/emu/bus/vcs_ctrl/lightpen.c", + MAME_DIR .. "src/emu/bus/vcs_ctrl/paddles.c", + MAME_DIR .. "src/emu/bus/vcs_ctrl/wheel.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vectrex/slot.h,BUSES += VECTREX +--------------------------------------------------- + +if (BUSES["VECTREX"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vectrex/slot.c", + MAME_DIR .. "src/emu/bus/vectrex/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vic10/exp.h,BUSES += VIC10 +--------------------------------------------------- + +if (BUSES["VIC10"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vic10/exp.c", + MAME_DIR .. "src/emu/bus/vic10/std.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vic20/exp.h,BUSES += VIC20 +--@src/emu/bus/vic20/user.h,BUSES += VIC20 +--------------------------------------------------- + +if (BUSES["VIC20"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vic20/exp.c", + MAME_DIR .. "src/emu/bus/vic20/fe3.c", + MAME_DIR .. "src/emu/bus/vic20/megacart.c", + MAME_DIR .. "src/emu/bus/vic20/std.c", + MAME_DIR .. "src/emu/bus/vic20/vic1010.c", + MAME_DIR .. "src/emu/bus/vic20/vic1110.c", + MAME_DIR .. "src/emu/bus/vic20/vic1111.c", + MAME_DIR .. "src/emu/bus/vic20/vic1112.c", + MAME_DIR .. "src/emu/bus/vic20/vic1210.c", + MAME_DIR .. "src/emu/bus/vic20/user.c", + MAME_DIR .. "src/emu/bus/vic20/4cga.c", + MAME_DIR .. "src/emu/bus/vic20/vic1011.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vidbrain/exp.h,BUSES += VIDBRAIN +--------------------------------------------------- + +if (BUSES["VIDBRAIN"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vidbrain/exp.c", + MAME_DIR .. "src/emu/bus/vidbrain/std.c", + MAME_DIR .. "src/emu/bus/vidbrain/money_minder.c", + MAME_DIR .. "src/emu/bus/vidbrain/timeshare.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/vip/byteio.h,BUSES += VIP +--@src/emu/bus/vip/exp.h,BUSES += VIP +--------------------------------------------------- + +if (BUSES["VIP"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vip/byteio.c", + MAME_DIR .. "src/emu/bus/vip/vp620.c", + MAME_DIR .. "src/emu/bus/vip/exp.c", + MAME_DIR .. "src/emu/bus/vip/vp550.c", + MAME_DIR .. "src/emu/bus/vip/vp570.c", + MAME_DIR .. "src/emu/bus/vip/vp575.c", + MAME_DIR .. "src/emu/bus/vip/vp585.c", + MAME_DIR .. "src/emu/bus/vip/vp590.c", + MAME_DIR .. "src/emu/bus/vip/vp595.c", + MAME_DIR .. "src/emu/bus/vip/vp700.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/wangpc/wangpc.h,BUSES += WANGPC +--------------------------------------------------- + +if (BUSES["WANGPC"]~=null) then + files { + MAME_DIR .. "src/emu/bus/wangpc/wangpc.c", + MAME_DIR .. "src/emu/bus/wangpc/emb.c", + MAME_DIR .. "src/emu/bus/wangpc/lic.c", + MAME_DIR .. "src/emu/bus/wangpc/lvc.c", + MAME_DIR .. "src/emu/bus/wangpc/mcc.c", + MAME_DIR .. "src/emu/bus/wangpc/mvc.c", + MAME_DIR .. "src/emu/bus/wangpc/rtc.c", + MAME_DIR .. "src/emu/bus/wangpc/tig.c", + MAME_DIR .. "src/emu/bus/wangpc/wdc.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/z88/z88.h,BUSES += Z88 +--------------------------------------------------- + +if (BUSES["Z88"]~=null) then + files { + MAME_DIR .. "src/emu/bus/z88/z88.c", + MAME_DIR .. "src/emu/bus/z88/flash.c", + MAME_DIR .. "src/emu/bus/z88/ram.c", + MAME_DIR .. "src/emu/bus/z88/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/a2bus/a2bus.h,BUSES += A2BUS +--------------------------------------------------- + +if (BUSES["A2BUS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/a2bus/a2bus.c", + MAME_DIR .. "src/emu/bus/a2bus/a2lang.c", + MAME_DIR .. "src/emu/bus/a2bus/a2diskii.c", + MAME_DIR .. "src/emu/bus/a2bus/a2mockingboard.c", + MAME_DIR .. "src/emu/bus/a2bus/a2cffa.c", + MAME_DIR .. "src/emu/bus/a2bus/a2memexp.c", + MAME_DIR .. "src/emu/bus/a2bus/a2scsi.c", + MAME_DIR .. "src/emu/bus/a2bus/a2thunderclock.c", + MAME_DIR .. "src/emu/bus/a2bus/a2softcard.c", + MAME_DIR .. "src/emu/bus/a2bus/a2videoterm.c", + MAME_DIR .. "src/emu/bus/a2bus/a2ssc.c", + MAME_DIR .. "src/emu/bus/a2bus/a2swyft.c", + MAME_DIR .. "src/emu/bus/a2bus/a2eauxslot.c", + MAME_DIR .. "src/emu/bus/a2bus/a2themill.c", + MAME_DIR .. "src/emu/bus/a2bus/a2sam.c", + MAME_DIR .. "src/emu/bus/a2bus/a2alfam2.c", + MAME_DIR .. "src/emu/bus/a2bus/laser128.c", + MAME_DIR .. "src/emu/bus/a2bus/a2echoii.c", + MAME_DIR .. "src/emu/bus/a2bus/a2arcadebd.c", + MAME_DIR .. "src/emu/bus/a2bus/a2midi.c", + MAME_DIR .. "src/emu/bus/a2bus/a2vulcan.c", + MAME_DIR .. "src/emu/bus/a2bus/a2zipdrive.c", + MAME_DIR .. "src/emu/bus/a2bus/a2applicard.c", + MAME_DIR .. "src/emu/bus/a2bus/a2hsscsi.c", + MAME_DIR .. "src/emu/bus/a2bus/a2ultraterm.c", + MAME_DIR .. "src/emu/bus/a2bus/a2pic.c", + MAME_DIR .. "src/emu/bus/a2bus/a2estd80col.c", + MAME_DIR .. "src/emu/bus/a2bus/a2eext80col.c", + MAME_DIR .. "src/emu/bus/a2bus/a2eramworks3.c", + MAME_DIR .. "src/emu/bus/a2bus/a2corvus.c", + MAME_DIR .. "src/emu/bus/a2bus/a2diskiing.c", + MAME_DIR .. "src/emu/bus/a2bus/a2mcms.c", + MAME_DIR .. "src/emu/bus/a2bus/a2dx1.c", + MAME_DIR .. "src/emu/bus/a2bus/timemasterho.c", + MAME_DIR .. "src/emu/bus/a2bus/mouse.c", + MAME_DIR .. "src/emu/bus/a2bus/corvfdc01.c", + MAME_DIR .. "src/emu/bus/a2bus/corvfdc02.c", + MAME_DIR .. "src/emu/bus/a2bus/ramcard16k.c", + MAME_DIR .. "src/emu/bus/a2bus/ramcard128k.c", + MAME_DIR .. "src/emu/bus/a2bus/ezcgi.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/nubus/nubus.h,BUSES += NUBUS +--------------------------------------------------- + +if (BUSES["NUBUS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/nubus/nubus.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_48gc.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_cb264.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_vikbw.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_specpdq.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_m2hires.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_spec8.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_radiustpd.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_m2video.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_asntmc3b.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_image.c", + MAME_DIR .. "src/emu/bus/nubus/nubus_wsportrait.c", + MAME_DIR .. "src/emu/bus/nubus/pds30_cb264.c", + MAME_DIR .. "src/emu/bus/nubus/pds30_procolor816.c", + MAME_DIR .. "src/emu/bus/nubus/pds30_sigmalview.c", + MAME_DIR .. "src/emu/bus/nubus/pds30_30hr.c", + MAME_DIR .. "src/emu/bus/nubus/pds30_mc30.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/centronics/ctronics.h,BUSES += CENTRONICS +--------------------------------------------------- + +if (BUSES["CENTRONICS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/centronics/ctronics.c", + MAME_DIR .. "src/emu/bus/centronics/comxpl80.c", + MAME_DIR .. "src/emu/bus/centronics/covox.c", + MAME_DIR .. "src/emu/bus/centronics/dsjoy.c", + MAME_DIR .. "src/emu/bus/centronics/epson_ex800.c", + MAME_DIR .. "src/emu/bus/centronics/epson_lx800.c", + MAME_DIR .. "src/emu/bus/centronics/epson_lx810l.c", + MAME_DIR .. "src/emu/bus/centronics/printer.c", + MAME_DIR .. "src/emu/bus/centronics/digiblst.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/rs232/rs232.h,BUSES += RS232 +--------------------------------------------------- + +if (BUSES["RS232"]~=null) then + files { + MAME_DIR .. "src/emu/bus/rs232/keyboard.c", + MAME_DIR .. "src/emu/bus/rs232/loopback.c", + MAME_DIR .. "src/emu/bus/rs232/null_modem.c", + MAME_DIR .. "src/emu/bus/rs232/printer.c", + MAME_DIR .. "src/emu/bus/rs232/rs232.c", + MAME_DIR .. "src/emu/bus/rs232/ser_mouse.c", + MAME_DIR .. "src/emu/bus/rs232/terminal.c", + MAME_DIR .. "src/emu/bus/rs232/xvd701.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/midi/midi.h,BUSES += MIDI +--------------------------------------------------- + +if (BUSES["MIDI"]~=null) then + files { + MAME_DIR .. "src/emu/bus/midi/midi.c", + MAME_DIR .. "src/emu/bus/midi/midiinport.c", + MAME_DIR .. "src/emu/bus/midi/midioutport.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/lpci/pci.h,BUSES += LPCI +--------------------------------------------------- + +if (BUSES["LPCI"]~=null) then + files { + MAME_DIR .. "src/emu/bus/lpci/pci.c", + MAME_DIR .. "src/emu/bus/lpci/cirrus.c", + MAME_DIR .. "src/emu/bus/lpci/i82371ab.c", + MAME_DIR .. "src/emu/bus/lpci/i82371sb.c", + MAME_DIR .. "src/emu/bus/lpci/i82439tx.c", + MAME_DIR .. "src/emu/bus/lpci/northbridge.c", + MAME_DIR .. "src/emu/bus/lpci/southbridge.c", + MAME_DIR .. "src/emu/bus/lpci/mpc105.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/nes/nes_slot.h,BUSES += NES +--------------------------------------------------- + +if (BUSES["NES"]~=null) then + files { + MAME_DIR .. "src/emu/bus/nes/nes_slot.c", + MAME_DIR .. "src/emu/bus/nes/nes_carts.c", + MAME_DIR .. "src/emu/bus/nes/2a03pur.c", + MAME_DIR .. "src/emu/bus/nes/act53.c", + MAME_DIR .. "src/emu/bus/nes/aladdin.c", + MAME_DIR .. "src/emu/bus/nes/ave.c", + MAME_DIR .. "src/emu/bus/nes/bandai.c", + MAME_DIR .. "src/emu/bus/nes/benshieng.c", + MAME_DIR .. "src/emu/bus/nes/bootleg.c", + MAME_DIR .. "src/emu/bus/nes/camerica.c", + MAME_DIR .. "src/emu/bus/nes/cne.c", + MAME_DIR .. "src/emu/bus/nes/cony.c", + MAME_DIR .. "src/emu/bus/nes/datach.c", + MAME_DIR .. "src/emu/bus/nes/discrete.c", + MAME_DIR .. "src/emu/bus/nes/disksys.c", + MAME_DIR .. "src/emu/bus/nes/event.c", + MAME_DIR .. "src/emu/bus/nes/ggenie.c", + MAME_DIR .. "src/emu/bus/nes/henggedianzi.c", + MAME_DIR .. "src/emu/bus/nes/hes.c", + MAME_DIR .. "src/emu/bus/nes/hosenkan.c", + MAME_DIR .. "src/emu/bus/nes/irem.c", + MAME_DIR .. "src/emu/bus/nes/jaleco.c", + MAME_DIR .. "src/emu/bus/nes/jy.c", + MAME_DIR .. "src/emu/bus/nes/kaiser.c", + MAME_DIR .. "src/emu/bus/nes/karastudio.c", + MAME_DIR .. "src/emu/bus/nes/konami.c", + MAME_DIR .. "src/emu/bus/nes/legacy.c", + MAME_DIR .. "src/emu/bus/nes/mmc1.c", + MAME_DIR .. "src/emu/bus/nes/mmc2.c", + MAME_DIR .. "src/emu/bus/nes/mmc3.c", + MAME_DIR .. "src/emu/bus/nes/mmc3_clones.c", + MAME_DIR .. "src/emu/bus/nes/mmc5.c", + MAME_DIR .. "src/emu/bus/nes/multigame.c", + MAME_DIR .. "src/emu/bus/nes/namcot.c", + MAME_DIR .. "src/emu/bus/nes/nanjing.c", + MAME_DIR .. "src/emu/bus/nes/ntdec.c", + MAME_DIR .. "src/emu/bus/nes/nxrom.c", + MAME_DIR .. "src/emu/bus/nes/pirate.c", + MAME_DIR .. "src/emu/bus/nes/pt554.c", + MAME_DIR .. "src/emu/bus/nes/racermate.c", + MAME_DIR .. "src/emu/bus/nes/rcm.c", + MAME_DIR .. "src/emu/bus/nes/rexsoft.c", + MAME_DIR .. "src/emu/bus/nes/sachen.c", + MAME_DIR .. "src/emu/bus/nes/somari.c", + MAME_DIR .. "src/emu/bus/nes/sunsoft.c", + MAME_DIR .. "src/emu/bus/nes/sunsoft_dcs.c", + MAME_DIR .. "src/emu/bus/nes/taito.c", + MAME_DIR .. "src/emu/bus/nes/tengen.c", + MAME_DIR .. "src/emu/bus/nes/txc.c", + MAME_DIR .. "src/emu/bus/nes/waixing.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/nes_ctrl/ctrl.h,BUSES += NES_CTRL +--------------------------------------------------- + +if (BUSES["NES_CTRL"]~=null) then + files { + MAME_DIR .. "src/emu/bus/nes_ctrl/ctrl.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/joypad.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/4score.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/arkpaddle.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/bcbattle.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/ftrainer.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/fckeybrd.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/hori.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/konamihs.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/miracle.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/mjpanel.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/pachinko.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/partytap.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/powerpad.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/suborkey.c", + MAME_DIR .. "src/emu/bus/nes_ctrl/zapper.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/snes/snes_slot.h,BUSES += SNES +--------------------------------------------------- + +if (BUSES["SNES"]~=null) then + files { + MAME_DIR .. "src/emu/bus/snes/snes_slot.c", + MAME_DIR .. "src/emu/bus/snes/snes_carts.c", + MAME_DIR .. "src/emu/bus/snes/bsx.c", + MAME_DIR .. "src/emu/bus/snes/event.c", + MAME_DIR .. "src/emu/bus/snes/rom.c", + MAME_DIR .. "src/emu/bus/snes/rom21.c", + MAME_DIR .. "src/emu/bus/snes/sa1.c", + MAME_DIR .. "src/emu/bus/snes/sdd1.c", + MAME_DIR .. "src/emu/bus/snes/sfx.c", + MAME_DIR .. "src/emu/bus/snes/sgb.c", + MAME_DIR .. "src/emu/bus/snes/spc7110.c", + MAME_DIR .. "src/emu/bus/snes/sufami.c", + MAME_DIR .. "src/emu/bus/snes/upd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/snes_ctrl/ctrl.h,BUSES += SNES_CTRL +--------------------------------------------------- + +if (BUSES["SNES_CTRL"]~=null) then + files { + MAME_DIR .. "src/emu/bus/snes_ctrl/ctrl.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/bcbattle.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/joypad.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/miracle.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/mouse.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/multitap.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/pachinko.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/sscope.c", + MAME_DIR .. "src/emu/bus/snes_ctrl/twintap.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/vboy/slot.h,BUSES += VBOY +--------------------------------------------------- +if (BUSES["VBOY"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vboy/slot.c", + MAME_DIR .. "src/emu/bus/vboy/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/megadrive/md_slot.h,BUSES += MEGADRIVE +--------------------------------------------------- + +if (BUSES["MEGADRIVE"]~=null) then + files { + MAME_DIR .. "src/emu/bus/megadrive/md_slot.c", + MAME_DIR .. "src/emu/bus/megadrive/md_carts.c", + MAME_DIR .. "src/emu/bus/megadrive/eeprom.c", + MAME_DIR .. "src/emu/bus/megadrive/ggenie.c", + MAME_DIR .. "src/emu/bus/megadrive/jcart.c", + MAME_DIR .. "src/emu/bus/megadrive/rom.c", + MAME_DIR .. "src/emu/bus/megadrive/sk.c", + MAME_DIR .. "src/emu/bus/megadrive/stm95.c", + MAME_DIR .. "src/emu/bus/megadrive/svp.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/neogeo/neogeo_slot.h,BUSES += NEOGEO +--------------------------------------------------- + +if (BUSES["NEOGEO"]~=null) then + files { + MAME_DIR .. "src/emu/bus/neogeo/neogeo_slot.c", + MAME_DIR .. "src/emu/bus/neogeo/neogeo_intf.c", + MAME_DIR .. "src/emu/bus/neogeo/neogeo_carts.c", + MAME_DIR .. "src/emu/bus/neogeo/neogeo_helper.c", + MAME_DIR .. "src/emu/bus/neogeo/banked_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/mslugx_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/mslugx_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/sma_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/sma_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/cmc_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/cmc_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/pcm2_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/pcm2_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/kof2002_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/kof2002_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/pvc_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/pvc_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/fatfury2_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/fatfury2_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/kof98_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/kof98_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/bootleg_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/bootleg_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/bootleg_hybrid_cart.c", + MAME_DIR .. "src/emu/bus/neogeo/sbp_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/kog_prot.c", + MAME_DIR .. "src/emu/bus/neogeo/rom.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/bus/saturn/sat_slot.h,BUSES += SATURN +--------------------------------------------------- + +if (BUSES["SATURN"]~=null) then + files { + MAME_DIR .. "src/emu/bus/saturn/sat_slot.c", + MAME_DIR .. "src/emu/bus/saturn/bram.c", + MAME_DIR .. "src/emu/bus/saturn/dram.c", + MAME_DIR .. "src/emu/bus/saturn/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/sega8/sega8_slot.h,BUSES += SEGA8 +--------------------------------------------------- + +if (BUSES["SEGA8"]~=null) then + files { + MAME_DIR .. "src/emu/bus/sega8/sega8_slot.c", + MAME_DIR .. "src/emu/bus/sega8/rom.c", + MAME_DIR .. "src/emu/bus/sega8/ccatch.c", + MAME_DIR .. "src/emu/bus/sega8/mgear.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/sms_ctrl/smsctrl.h,BUSES += SMS_CTRL +--------------------------------------------------- + +if (BUSES["SMS_CTRL"]~=null) then + files { + MAME_DIR .. "src/emu/bus/sms_ctrl/smsctrl.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/joypad.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/lphaser.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/paddle.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/rfu.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/sports.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/sportsjp.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/multitap.c", + MAME_DIR .. "src/emu/bus/sms_ctrl/graphic.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/sms_exp/smsexp.h,BUSES += SMS_EXP +--------------------------------------------------- + +if (BUSES["SMS_EXP"]~=null) then + files { + MAME_DIR .. "src/emu/bus/sms_exp/smsexp.c", + MAME_DIR .. "src/emu/bus/sms_exp/gender.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/ti99_peb/peribox.h,BUSES += TI99PEB +--------------------------------------------------- + +if (BUSES["TI99PEB"]~=null) then + files { + MAME_DIR .. "src/emu/bus/ti99_peb/peribox.c", + MAME_DIR .. "src/emu/bus/ti99_peb/bwg.c", + MAME_DIR .. "src/emu/bus/ti99_peb/evpc.c", + MAME_DIR .. "src/emu/bus/ti99_peb/hfdc.c", + MAME_DIR .. "src/emu/bus/ti99_peb/horizon.c", + MAME_DIR .. "src/emu/bus/ti99_peb/hsgpl.c", + MAME_DIR .. "src/emu/bus/ti99_peb/memex.c", + MAME_DIR .. "src/emu/bus/ti99_peb/myarcmem.c", + MAME_DIR .. "src/emu/bus/ti99_peb/pcode.c", + MAME_DIR .. "src/emu/bus/ti99_peb/samsmem.c", + MAME_DIR .. "src/emu/bus/ti99_peb/spchsyn.c", + MAME_DIR .. "src/emu/bus/ti99_peb/ti_32kmem.c", + MAME_DIR .. "src/emu/bus/ti99_peb/ti_fdc.c", + MAME_DIR .. "src/emu/bus/ti99_peb/ti_rs232.c", + MAME_DIR .. "src/emu/bus/ti99_peb/tn_ide.c", + MAME_DIR .. "src/emu/bus/ti99_peb/tn_usbsm.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/gameboy/gb_slot.h,BUSES += GAMEBOY +--------------------------------------------------- + +if (BUSES["GAMEBOY"]~=null) then + files { + MAME_DIR .. "src/emu/bus/gameboy/gb_slot.c", + MAME_DIR .. "src/emu/bus/gameboy/rom.c", + MAME_DIR .. "src/emu/bus/gameboy/mbc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/gamegear/ggext.h,BUSES += GAMEGEAR +--------------------------------------------------- + +if (BUSES["GAMEGEAR"]~=null) then + files { + MAME_DIR .. "src/emu/bus/gamegear/ggext.c", + MAME_DIR .. "src/emu/bus/gamegear/smsctrladp.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/gba/gba_slot.h,BUSES += GBA +--------------------------------------------------- + +if (BUSES["GBA"]~=null) then + files { + MAME_DIR .. "src/emu/bus/gba/gba_slot.c", + MAME_DIR .. "src/emu/bus/gba/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/bml3/bml3bus.h,BUSES += BML3 +--------------------------------------------------- +if (BUSES["BML3"]~=null) then + files { + MAME_DIR .. "src/emu/bus/bml3/bml3bus.c", + MAME_DIR .. "src/emu/bus/bml3/bml3mp1802.c", + MAME_DIR .. "src/emu/bus/bml3/bml3mp1805.c", + MAME_DIR .. "src/emu/bus/bml3/bml3kanji.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/coco/cococart.h,BUSES += COCO +--------------------------------------------------- +if (BUSES["COCO"]~=null) then + files { + MAME_DIR .. "src/emu/bus/coco/cococart.c", + MAME_DIR .. "src/emu/bus/coco/coco_232.c", + MAME_DIR .. "src/emu/bus/coco/coco_orch90.c", + MAME_DIR .. "src/emu/bus/coco/coco_pak.c", + MAME_DIR .. "src/emu/bus/coco/coco_fdc.c", + MAME_DIR .. "src/emu/bus/coco/coco_multi.c", + MAME_DIR .. "src/emu/bus/coco/coco_dwsock.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/cpc/cpcexp.h,BUSES += CPC +--------------------------------------------------- +if (BUSES["CPC"]~=null) then + files { + MAME_DIR .. "src/emu/bus/cpc/cpcexp.c", + MAME_DIR .. "src/emu/bus/cpc/cpc_ssa1.c", + MAME_DIR .. "src/emu/bus/cpc/cpc_rom.c", + MAME_DIR .. "src/emu/bus/cpc/cpc_pds.c", + MAME_DIR .. "src/emu/bus/cpc/cpc_rs232.c", + MAME_DIR .. "src/emu/bus/cpc/mface2.c", + MAME_DIR .. "src/emu/bus/cpc/symbfac2.c", + MAME_DIR .. "src/emu/bus/cpc/amdrum.c", + MAME_DIR .. "src/emu/bus/cpc/playcity.c", + MAME_DIR .. "src/emu/bus/cpc/smartwatch.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/epson_sio/epson_sio.h,BUSES += EPSON_SIO +--------------------------------------------------- +if (BUSES["EPSON_SIO"]~=null) then + files { + MAME_DIR .. "src/emu/bus/epson_sio/epson_sio.c", + MAME_DIR .. "src/emu/bus/epson_sio/pf10.c", + MAME_DIR .. "src/emu/bus/epson_sio/tf20.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/pce/pce_slot.h,BUSES += PCE +--------------------------------------------------- +if (BUSES["PCE"]~=null) then + files { + MAME_DIR .. "src/emu/bus/pce/pce_slot.c", + MAME_DIR .. "src/emu/bus/pce/pce_rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/scv/slot.h,BUSES += SCV +--------------------------------------------------- +if (BUSES["SCV"]~=null) then + files { + MAME_DIR .. "src/emu/bus/scv/slot.c", + MAME_DIR .. "src/emu/bus/scv/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/x68k/x68kexp.h,BUSES += X68K +--------------------------------------------------- +if (BUSES["X68K"]~=null) then + files { + MAME_DIR .. "src/emu/bus/x68k/x68kexp.c", + MAME_DIR .. "src/emu/bus/x68k/x68k_neptunex.c", + MAME_DIR .. "src/emu/bus/x68k/x68k_scsiext.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/abckb/abckb.h,BUSES += ABCKB +--------------------------------------------------- +if (BUSES["ABCKB"]~=null) then + files { + MAME_DIR .. "src/emu/bus/abckb/abckb.c", + MAME_DIR .. "src/emu/bus/abckb/abc77.c", + MAME_DIR .. "src/emu/bus/abckb/abc99.c", + MAME_DIR .. "src/emu/bus/abckb/abc800kb.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/compucolor/compclr_flp.h,BUSES += COMPUCOLOR +--------------------------------------------------- +if (BUSES["COMPUCOLOR"]~=null) then + files { + MAME_DIR .. "src/emu/bus/compucolor/floppy.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/scsi/scsi.h,BUSES += SCSI +--------------------------------------------------- +if (BUSES["SCSI"]~=null) then + files { + MAME_DIR .. "src/emu/bus/scsi/scsi.c", + MAME_DIR .. "src/emu/bus/scsi/scsicd.c", + MAME_DIR .. "src/emu/bus/scsi/scsihd.c", + MAME_DIR .. "src/emu/bus/scsi/scsihle.c", + MAME_DIR .. "src/emu/bus/scsi/cdu76s.c", + MAME_DIR .. "src/emu/bus/scsi/acb4070.c", + MAME_DIR .. "src/emu/bus/scsi/d9060hd.c", + MAME_DIR .. "src/emu/bus/scsi/sa1403d.c", + MAME_DIR .. "src/emu/bus/scsi/s1410.c", + MAME_DIR .. "src/emu/bus/scsi/pc9801_sasi.c", + MAME_DIR .. "src/emu/bus/scsi/omti5100.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/macpds/macpds.h,BUSES += MACPDS +--------------------------------------------------- +if (BUSES["MACPDS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/macpds/macpds.c", + MAME_DIR .. "src/emu/bus/macpds/pds_tpdfpd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/oricext/oricext.h,BUSES += ORICEXT +--------------------------------------------------- +if (BUSES["ORICEXT"]~=null) then + files { + MAME_DIR .. "src/emu/bus/oricext/oricext.c", + MAME_DIR .. "src/emu/bus/oricext/jasmin.c", + MAME_DIR .. "src/emu/bus/oricext/microdisc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/a1bus/a1bus.h,BUSES += A1BUS +--------------------------------------------------- + +if (BUSES["A1BUS"]~=null) then + files { + MAME_DIR .. "src/emu/bus/a1bus/a1bus.c", + MAME_DIR .. "src/emu/bus/a1bus/a1cassette.c", + MAME_DIR .. "src/emu/bus/a1bus/a1cffa.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/amiga/zorro/zorro.h,BUSES += ZORRO +--------------------------------------------------- + +if (BUSES["ZORRO"]~=null) then + files { + MAME_DIR .. "src/emu/bus/amiga/zorro/zorro.c", + MAME_DIR .. "src/emu/bus/amiga/zorro/cards.c", + MAME_DIR .. "src/emu/bus/amiga/zorro/a2052.c", + MAME_DIR .. "src/emu/bus/amiga/zorro/a2232.c", + MAME_DIR .. "src/emu/bus/amiga/zorro/a590.c", + MAME_DIR .. "src/emu/bus/amiga/zorro/action_replay.c", + MAME_DIR .. "src/emu/bus/amiga/zorro/buddha.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/ql/exp.h,BUSES += QL +--------------------------------------------------- + +if (BUSES["QL"]~=null) then + files { + MAME_DIR .. "src/emu/bus/ql/exp.c", + MAME_DIR .. "src/emu/bus/ql/cst_qdisc.c", + MAME_DIR .. "src/emu/bus/ql/cst_q_plus4.c", + MAME_DIR .. "src/emu/bus/ql/cumana_fdi.c", + MAME_DIR .. "src/emu/bus/ql/kempston_di.c", + MAME_DIR .. "src/emu/bus/ql/miracle_gold_card.c", + MAME_DIR .. "src/emu/bus/ql/mp_fdi.c", + MAME_DIR .. "src/emu/bus/ql/opd_basic_master.c", + MAME_DIR .. "src/emu/bus/ql/pcml_qdisk.c", + MAME_DIR .. "src/emu/bus/ql/qubide.c", + MAME_DIR .. "src/emu/bus/ql/sandy_superdisk.c", + MAME_DIR .. "src/emu/bus/ql/sandy_superqboard.c", + MAME_DIR .. "src/emu/bus/ql/trumpcard.c", + MAME_DIR .. "src/emu/bus/ql/rom.c", + MAME_DIR .. "src/emu/bus/ql/miracle_hd.c", + MAME_DIR .. "src/emu/bus/ql/std.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/vtech/memexp/memexp.h,BUSES += VTECH_MEMEXP +--------------------------------------------------- + +if (BUSES["VTECH_MEMEXP"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vtech/memexp/memexp.c", + MAME_DIR .. "src/emu/bus/vtech/memexp/carts.c", + MAME_DIR .. "src/emu/bus/vtech/memexp/floppy.c", + MAME_DIR .. "src/emu/bus/vtech/memexp/memory.c", + MAME_DIR .. "src/emu/bus/vtech/memexp/rs232.c", + MAME_DIR .. "src/emu/bus/vtech/memexp/wordpro.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/vtech/ioexp/ioexp.h,BUSES += VTECH_IOEXP +--------------------------------------------------- + +if (BUSES["VTECH_IOEXP"]~=null) then + files { + MAME_DIR .. "src/emu/bus/vtech/ioexp/ioexp.c", + MAME_DIR .. "src/emu/bus/vtech/ioexp/carts.c", + MAME_DIR .. "src/emu/bus/vtech/ioexp/joystick.c", + MAME_DIR .. "src/emu/bus/vtech/ioexp/printer.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/wswan/slot.h,BUSES += WSWAN +--------------------------------------------------- + +if (BUSES["WSWAN"]~=null) then + files { + MAME_DIR .. "src/emu/bus/wswan/slot.c", + MAME_DIR .. "src/emu/bus/wswan/rom.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/bus/psx/ctlrport.h,BUSES += PSX_CONTROLLER +--------------------------------------------------- + +if (BUSES["PSX_CONTROLLER"]~=null) then + files { + MAME_DIR .. "src/emu/bus/psx/ctlrport.c", + MAME_DIR .. "src/emu/bus/psx/analogue.c", + MAME_DIR .. "src/emu/bus/psx/multitap.c", + MAME_DIR .. "src/emu/bus/psx/memcard.c", + } +end diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua new file mode 100644 index 00000000000..3dd2cc99601 --- /dev/null +++ b/scripts/src/cpu.lua @@ -0,0 +1,1764 @@ +--------------------------------------------------------------------------- +-- +-- cpu.lua +-- +-- Rules for building CPU cores +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +--------------------------------------------------------------------------- + +-------------------------------------------------- +-- Shared code +-------------------------------------------------- + +files { + MAME_DIR .. "src/emu/cpu/vtlb.c", +} + +-------------------------------------------------- +-- Dynamic recompiler objects +-------------------------------------------------- + +if (CPUS["SH2"]~=null or CPUS["MIPS"]~=null or CPUS["POWERPC"]~=null or CPUS["RSP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/drcbec.c", + MAME_DIR .. "src/emu/cpu/drcbeut.c", + MAME_DIR .. "src/emu/cpu/drccache.c", + MAME_DIR .. "src/emu/cpu/drcfe.c", + MAME_DIR .. "src/emu/cpu/drcuml.c", + MAME_DIR .. "src/emu/cpu/uml.c", + MAME_DIR .. "src/emu/cpu/i386/i386dasm.c", + MAME_DIR .. "src/emu/cpu/x86log.c", + MAME_DIR .. "src/emu/cpu/drcbex86.c", + MAME_DIR .. "src/emu/cpu/drcbex64.c", + } +end + +-------------------------------------------------- +-- Signetics 8X300 / Scientific Micro Systems SMS300 +--@src/emu/cpu/8x300/8x300.h,CPUS += 8X300 +-------------------------------------------------- + +if (CPUS["8X300"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/8x300/8x300.c", + } +end + +if (CPUS["8X300"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/8x300/8x300dasm.c") +end + +-------------------------------------------------- +-- ARCangent A4 +--@src/emu/cpu/arc/arc.h,CPUS += ARC +-------------------------------------------------- + +if (CPUS["ARC"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/arc/arc.c", + } +end + +if (CPUS["ARC"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arc/arcdasm.c") +end + +-------------------------------------------------- +-- ARcompact (ARCtangent-A5, ARC 600, ARC 700) +--@src/emu/cpu/arc/arc.h,CPUS += ARCOMPACT +-------------------------------------------------- + +if (CPUS["ARCOMPACT"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/arcompact/arcompact.c", + MAME_DIR .. "src/emu/cpu/arcompact/arcompact_execute.c", + } +end + +if (CPUS["ARCOMPACT"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arcompact/arcompactdasm.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arcompact/arcompactdasm_dispatch.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arcompact/arcompactdasm_ops.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arcompact/arcompact_common.c") +end + +-------------------------------------------------- +-- Acorn ARM series +-- +---@src/emu/cpu/arm/arm.h,CPUS += ARM +---@src/emu/cpu/arm7/arm7.h,CPUS += ARM7 +-------------------------------------------------- + +if (CPUS["ARM"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/arm/arm.c", + } +end + +if (CPUS["ARM"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arm/armdasm.c") +end + +if (CPUS["ARM7"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/arm7/arm7.c", + MAME_DIR .. "src/emu/cpu/arm7/arm7thmb.c", + MAME_DIR .. "src/emu/cpu/arm7/arm7ops.c", + } +end + +if (CPUS["ARM7"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/arm7/arm7dasm.c") +end + +-------------------------------------------------- +-- Advanced Digital Chips SE3208 +---@src/emu/cpu/se3208/se3208.h,CPUS += SE3208 +-------------------------------------------------- + +if (CPUS["SE3208"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/se3208/se3208.c", + } +end + +if (CPUS["SE3208"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/se3208/se3208dis.c") +end + +-------------------------------------------------- +-- American Microsystems, Inc.(AMI) S2000 series +---@src/emu/cpu/amis2000/amis2000.h,CPUS += AMIS2000 +-------------------------------------------------- + +if (CPUS["AMIS2000"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/amis2000/amis2000.c", + } +end + +if (CPUS["AMIS2000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/amis2000/amis2000d.c") +end + +-------------------------------------------------- +-- Alpha 8201 +---@src/emu/cpu/alph8201/alph8201.h,CPUS += ALPHA8201 +-------------------------------------------------- + +if (CPUS["ALPHA8201"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/alph8201/alph8201.c", + } +end + +if (CPUS["ALPHA8201"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/alph8201/8201dasm.c") +end + +-------------------------------------------------- +-- Analog Devices ADSP21xx series +---@src/emu/cpu/adsp2100/adsp2100.h,CPUS += ADSP21XX +-------------------------------------------------- + +if (CPUS["ADSP21XX"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/adsp2100/adsp2100.c", + } +end + +if (CPUS["ADSP21XX"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/adsp2100/2100dasm.c") +end + +-------------------------------------------------- +-- Analog Devices "Sharc" ADSP21062 +---@src/emu/cpu/sharc/sharc.h,CPUS += ADSP21062 +-------------------------------------------------- + +if (CPUS["ADSP21062"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/sharc/sharc.c", + } +end + +if (CPUS["ADSP21062"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sharc/sharcdsm.c") +end + +-------------------------------------------------- +-- APEXC +---@src/emu/cpu/apexc/apexc.h,CPUS += APEXC +-------------------------------------------------- + +if (CPUS["APEXC"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/apexc/apexc.c", + } +end + +if (CPUS["APEXC"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/apexc/apexcdsm.c") +end + +-------------------------------------------------- +-- AT&T DSP16A +---@src/emu/cpu/dsp16/dsp16.h,CPUS += DSP16A +-------------------------------------------------- + +if (CPUS["DSP16A"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/dsp16/dsp16.c", + } +end + +if (CPUS["DSP16A"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp16/dsp16dis.c") +end + +-------------------------------------------------- +-- AT&T DSP32C +---@src/emu/cpu/dsp32/dsp32.h,CPUS += DSP32C +-------------------------------------------------- + +if (CPUS["DSP32C"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/dsp32/dsp32.c", + } +end + +if (CPUS["DSP32C"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp32/dsp32dis.c") +end + +-------------------------------------------------- +-- Atari custom RISC processor +---@src/emu/cpu/asap/asap.h,CPUS += ASAP +-------------------------------------------------- + +if (CPUS["ASAP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/asap/asap.c", + } +end + +if (CPUS["ASAP"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/asap/asapdasm.c") +end + +-------------------------------------------------- +-- AMD Am29000 +---@src/emu/cpu/am29000/am29000.h,CPUS += AM29000 +-------------------------------------------------- + +if (CPUS["AM29000"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/am29000/am29000.c", + } +end + +if (CPUS["AM29000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/am29000/am29dasm.c") +end + +-------------------------------------------------- +-- Atari Jaguar custom DSPs +---@src/emu/cpu/jaguar/jaguar.h,CPUS += JAGUAR +-------------------------------------------------- + +if (CPUS["JAGUAR"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/jaguar/jaguar.c", + } +end + +if (CPUS["JAGUAR"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/jaguar/jagdasm.c") +end + +-------------------------------------------------- +-- Simutrek Cube Quest bit-sliced CPUs +---@src/emu/cpu/cubeqcpu/cubeqcpu.h,CPUS += CUBEQCPU +-------------------------------------------------- + +if (CPUS["CUBEQCPU"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/cubeqcpu/cubeqcpu.c", + } +end + +if (CPUS["CUBEQCPU"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/cubeqcpu/cubedasm.c") +end + +-------------------------------------------------- +-- Ensoniq ES5510 ('ESP') DSP +---@src/emu/cpu/es5510/es5510.h,CPUS += ES5510 +-------------------------------------------------- + +if (CPUS["ES5510"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/es5510/es5510.c", + } +end + +-------------------------------------------------- +-- Entertainment Sciences AM29116-based RIP +---@src/emu/cpu/esrip/esrip.h,CPUS += ESRIP +-------------------------------------------------- + +if (CPUS["ESRIP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/esrip/esrip.c", + } +end + +if (CPUS["ESRIP"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/esrip/esripdsm.c") +end + +-------------------------------------------------- +-- RCA COSMAC +---@src/emu/cpu/cosmac/cosmac.h,CPUS += COSMAC +-------------------------------------------------- + +if (CPUS["COSMAC"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/cosmac/cosmac.c", + } +end + +if (CPUS["COSMAC"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/cosmac/cosdasm.c") +end + +-------------------------------------------------- +-- National Semiconductor COP400 family +---@src/emu/cpu/cop400/cop400.h,CPUS += COP400 +-------------------------------------------------- + +if (CPUS["COP400"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/cop400/cop400.c", + } +end + +if (CPUS["COP400"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/cop400/cop410ds.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/cop400/cop420ds.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/cop400/cop440ds.c") +end + +-------------------------------------------------- +-- CP1610 +---@src/emu/cpu/cp1610/cp1610.h,CPUS += CP1610 +-------------------------------------------------- + +if (CPUS["CP1610"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/cp1610/cp1610.c", + } +end + +if (CPUS["CP1610"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/cp1610/1610dasm.c") +end + +-------------------------------------------------- +-- Cinematronics vector "CPU" +---@src/emu/cpu/ccpu/ccpu.h,CPUS += CCPU +-------------------------------------------------- + +if (CPUS["CCPU"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/ccpu/ccpu.c", + } +end + +if (CPUS["CCPU"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/ccpu/ccpudasm.c") +end + +-------------------------------------------------- +-- DEC T-11 +---@src/emu/cpu/t11/t11.h,CPUS += T11 +-------------------------------------------------- + +if (CPUS["T11"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/t11/t11.c", + } +end + +if (CPUS["T11"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/t11/t11dasm.c") +end + +-------------------------------------------------- +-- F8 +---@src/emu/cpu/f8/f8.h,CPUS += F8 +-------------------------------------------------- + +if (CPUS["F8"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/f8/f8.c", + } +end + +if (CPUS["F8"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/f8/f8dasm.c") +end + +-------------------------------------------------- +-- G65816 +---@src/emu/cpu/g65816/g65816.h,CPUS += G65816 +-------------------------------------------------- + +if (CPUS["G65816"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/g65816/g65816.c", + MAME_DIR .. "src/emu/cpu/g65816/g65816o0.c", + MAME_DIR .. "src/emu/cpu/g65816/g65816o1.c", + MAME_DIR .. "src/emu/cpu/g65816/g65816o2.c", + MAME_DIR .. "src/emu/cpu/g65816/g65816o3.c", + MAME_DIR .. "src/emu/cpu/g65816/g65816o4.c", + } +end + +if (CPUS["G65816"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/g65816/g65816ds.c") +end + +-------------------------------------------------- +-- Hitachi H8 (16/32-bit H8/300, H8/300H, H8S2000 and H8S2600 series) +---@src/emu/cpu/h8/h8.h,CPUS += H8 +-------------------------------------------------- + +if (CPUS["H8"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/h8/h8.c", + MAME_DIR .. "src/emu/cpu/h8/h8h.c", + MAME_DIR .. "src/emu/cpu/h8/h8s2000.c", + MAME_DIR .. "src/emu/cpu/h8/h8s2600.c", + MAME_DIR .. "src/emu/cpu/h8/h83337.c", + MAME_DIR .. "src/emu/cpu/h8/h83002.c", + MAME_DIR .. "src/emu/cpu/h8/h83006.c", + MAME_DIR .. "src/emu/cpu/h8/h83008.c", + MAME_DIR .. "src/emu/cpu/h8/h83048.c", + MAME_DIR .. "src/emu/cpu/h8/h8s2245.c", + MAME_DIR .. "src/emu/cpu/h8/h8s2320.c", + MAME_DIR .. "src/emu/cpu/h8/h8s2357.c", + MAME_DIR .. "src/emu/cpu/h8/h8s2655.c", + MAME_DIR .. "src/emu/cpu/h8/h8_adc.c", + MAME_DIR .. "src/emu/cpu/h8/h8_port.c", + MAME_DIR .. "src/emu/cpu/h8/h8_intc.c", + MAME_DIR .. "src/emu/cpu/h8/h8_timer8.c", + MAME_DIR .. "src/emu/cpu/h8/h8_timer16.c", + MAME_DIR .. "src/emu/cpu/h8/h8_sci.c", + } +end + +-------------------------------------------------- +-- Hitachi HCD62121 +---@src/emu/cpu/hcd62121/hcd62121.h,CPUS += HCD62121 +-------------------------------------------------- + +if (CPUS["HCD62121"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/hcd62121/hcd62121.c", + } +end + +if (CPUS["HCD62121"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/hcd62121/hcd62121d.c") +end + +-------------------------------------------------- +-- Hitachi HMCS40 series +---@src/emu/cpu/hmcs40/hmcs40.h,CPUS += HMCS40 +-------------------------------------------------- + +if (CPUS["HMCS40"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/hmcs40/hmcs40.c", + } +end + +if (CPUS["HMCS40"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/hmcs40/hmcs40d.c") +end + +-------------------------------------------------- +-- Hitachi SH1/SH2 +---@src/emu/cpu/sh2/sh2.h,CPUS += SH2 +-------------------------------------------------- + +if (CPUS["SH2"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/sh2/sh2.c", + MAME_DIR .. "src/emu/cpu/sh2/sh2fe.c", + } +end + +if (CPUS["SH2"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sh2/sh2dasm.c") +end + +-------------------------------------------------- +-- Hitachi SH4 +---@src/emu/cpu/sh4/sh4.h,CPUS += SH4 +-------------------------------------------------- + +if (CPUS["SH4"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/sh4/sh4.c", + MAME_DIR .. "src/emu/cpu/sh4/sh4comn.c", + MAME_DIR .. "src/emu/cpu/sh4/sh3comn.c", + MAME_DIR .. "src/emu/cpu/sh4/sh4tmu.c", + MAME_DIR .. "src/emu/cpu/sh4/sh4dmac.c", + } +end + +if (CPUS["SH4"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sh4/sh4dasm.c") +end + +-------------------------------------------------- +-- Hudsonsoft 6280 +---@src/emu/cpu/h6280/h6280.h,CPUS += H6280 +-------------------------------------------------- + +if (CPUS["H6280"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/h6280/h6280.c", + } +end + +if (CPUS["H6280"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/h6280/6280dasm.c") +end + +-------------------------------------------------- +-- Hyperstone E1 series +---@src/emu/cpu/e132xs/e132xs.h,CPUS += E1 +-------------------------------------------------- + +if (CPUS["E1"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/e132xs/e132xs.c", + } +end + +if (CPUS["E1"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/e132xs/32xsdasm.c") +end + +-------------------------------------------------- +-- 15IE-00-013 CPU ("Microprogrammed Control Device") +---@src/emu/cpu/ie15/ie15.h,CPUS += IE15 +-------------------------------------------------- + +if (CPUS["IE15"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/ie15/ie15.c", + } +end + +if (CPUS["IE15"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/ie15/ie15dasm.c") +end + +-------------------------------------------------- +-- Intel 4004 +---@src/emu/cpu/i4004/i4004.h,CPUS += I4004 +-------------------------------------------------- + +if (CPUS["I4004"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i4004/i4004.c", + } +end + +if (CPUS["I4004"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i4004/4004dasm.c") +end + +-------------------------------------------------- +-- Intel 8008 +---@src/emu/cpu/i8008/i8008.h,CPUS += I8008 +-------------------------------------------------- + +if (CPUS["I8008"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i8008/i8008.c", + } +end + +if (CPUS["I8008"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i8008/8008dasm.c") +end + +-------------------------------------------------- +-- National Semiconductor SC/MP +---@src/emu/cpu/scmp/scmp.h,CPUS += SCMP +-------------------------------------------------- + +if (CPUS["SCMP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/scmp/scmp.c", + } +end + +if (CPUS["SCMP"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/scmp/scmpdasm.c") +end + +-------------------------------------------------- +-- Intel 8080/8085A +---@src/emu/cpu/i8085/i8085.h,CPUS += I8085 +-------------------------------------------------- + +if (CPUS["I8085"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i8085/i8085.c", + } +end + +if (CPUS["I8085"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i8085/8085dasm.c") +end + +-------------------------------------------------- +-- Intel 8089 +---@src/emu/cpu/i8085/i8089.h,CPUS += I8089 +-------------------------------------------------- + +if (CPUS["I8089"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i8089/i8089.c", + MAME_DIR .. "src/emu/cpu/i8089/i8089_channel.c", + MAME_DIR .. "src/emu/cpu/i8089/i8089_ops.c", + } +end + +if (CPUS["I8089"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i8089/i8089_dasm.c") +end + +-------------------------------------------------- +-- Intel MCS-48 (8039 and derivatives) +---@src/emu/cpu/mcs48/mcs48.h,CPUS += MCS48 +-------------------------------------------------- + +if (CPUS["MCS48"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mcs48/mcs48.c", + } +end + +if (CPUS["MCS48"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mcs48/mcs48dsm.c") +end + +-------------------------------------------------- +-- Intel 8051 and derivatives +---@src/emu/cpu/mcs51/mcs51.h,CPUS += MCS51 +-------------------------------------------------- + +if (CPUS["MCS51"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mcs51/mcs51.c", + } +end + +if (CPUS["MCS51"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mcs51/mcs51dasm.c") +end + +-------------------------------------------------- +-- Intel MCS-96 +---@src/emu/cpu/mcs96/mcs96.h,CPUS += MCS96 +-------------------------------------------------- + +if (CPUS["MCS96"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mcs96/mcs96.c", + MAME_DIR .. "src/emu/cpu/mcs96/i8x9x.c", + MAME_DIR .. "src/emu/cpu/mcs96/i8xc196.c", + } +end + +-------------------------------------------------- +-- Intel 80x86 series +---@src/emu/cpu/i86/i86.h,CPUS += I86 +---@src/emu/cpu/i86/i286.h,CPUS += I86 +---@src/emu/cpu/i386/i386.h,CPUS += I386 +-------------------------------------------------- + +if (CPUS["I86"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i86/i86.c", + MAME_DIR .. "src/emu/cpu/i86/i186.c", + MAME_DIR .. "src/emu/cpu/i86/i286.c", + } +end + +if (CPUS["I86"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i386/i386dasm.c") +end + +if (CPUS["I386"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i386/i386.c", + } +end + +if (CPUS["I386"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i386/i386dasm.c") +end + +-------------------------------------------------- +-- Intel i860 +---@src/emu/cpu/i860/i860.h,CPUS += I860 +-------------------------------------------------- + +if (CPUS["I860"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i860/i860.c", + } +end + +if (CPUS["I860"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i860/i860dis.c") +end + +-------------------------------------------------- +-- Intel i960 +---@src/emu/cpu/i960/i960.h,CPUS += I960 +-------------------------------------------------- + +if (CPUS["I960"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/i960/i960.c", + } +end + +if (CPUS["I960"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/i960/i960dis.c") +end + +-------------------------------------------------- +-- LH5801 +---@src/emu/cpu/lh5801/lh5801.h,CPUS += LH5801 +-------------------------------------------------- + +if (CPUS["LH5801"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/lh5801/lh5801.c", + } +end + +if (CPUS["LH5801"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/lh5801/5801dasm.c") +end +-------- +------------------------------------------ +-- Manchester Small-Scale Experimental Machine +---@src/emu/cpu/ssem/ssem.h,CPUS += SSEM +-------------------------------------------------- + +if (CPUS["SSEM"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/ssem/ssem.c", + } +end + +if (CPUS["SSEM"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/ssem/ssemdasm.c") +end + +-------------------------------------------------- +-- Fujitsu MB88xx +---@src/emu/cpu/mb88xx/mb88xx.h,CPUS += MB88XX +-------------------------------------------------- + +if (CPUS["MB88XX"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mb88xx/mb88xx.c", + } +end + +if (CPUS["MB88XX"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mb88xx/mb88dasm.c") +end + +-------------------------------------------------- +-- Fujitsu MB86233 +---@src/emu/cpu/mb86233/mb86233.h,CPUS += MB86233 +-------------------------------------------------- + +if (CPUS["MB86233"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mb86233/mb86233.c", + } +end + +if (CPUS["MB86233"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mb86233/mb86233d.c") +end + +-------------------------------------------------- +-- Fujitsu MB86235 +---@src/emu/cpu/mb86233/mb86235.h,CPUS += MB86235 +-------------------------------------------------- + +if (CPUS["MB86235"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mb86235/mb86235.c", + } +end + +if (CPUS["MB86235"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mb86235/mb86235d.c") +end + +-------------------------------------------------- +-- Microchip PIC16C5x +---@src/emu/cpu/pic16c5x/pic16c5x.h,CPUS += PIC16C5X +-------------------------------------------------- + +if (CPUS["PIC16C5X"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/pic16c5x/pic16c5x.c", + } +end + +if (CPUS["PIC16C5X"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/pic16c5x/16c5xdsm.c") +end + +-------------------------------------------------- +-- Microchip PIC16C62x +---@src/emu/cpu/pic16c62x/pic16c62x.h,CPUS += PIC16C62X +-------------------------------------------------- + +if (CPUS["PIC16C62X"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/pic16c62x/pic16c62x.c", + } +end + +if (CPUS["PIC16C62X"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/pic16c62x/16c62xdsm.c") +end + +-------------------------------------------------- +-- MIPS R3000 (MIPS I/II) series +-- MIPS R4000 (MIPS III/IV) series +---@src/emu/cpu/mips/mips3.h,CPUS += MIPS +-------------------------------------------------- + +if (CPUS["MIPS"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mips/r3000.c", + MAME_DIR .. "src/emu/cpu/mips/mips3com.c", + MAME_DIR .. "src/emu/cpu/mips/mips3.c", + MAME_DIR .. "src/emu/cpu/mips/mips3fe.c", + MAME_DIR .. "src/emu/cpu/mips/mips3drc.c", + } +end + +if (CPUS["MIPS"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mips/r3kdasm.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mips/mips3dsm.c") +end + +-------------------------------------------------- +-- Sony PlayStation CPU (R3000-based + GTE) +---@src/emu/cpu/psx/psx.h,CPUS += PSX +-------------------------------------------------- + +if (CPUS["PSX"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/psx/psx.c", + MAME_DIR .. "src/emu/cpu/psx/gte.c", + MAME_DIR .. "src/emu/cpu/psx/dma.c", + MAME_DIR .. "src/emu/cpu/psx/irq.c", + MAME_DIR .. "src/emu/cpu/psx/mdec.c", + MAME_DIR .. "src/emu/cpu/psx/rcnt.c", + MAME_DIR .. "src/emu/cpu/psx/sio.c", + } +end + +if (CPUS["PSX"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/psx/psxdasm.c") +end + +-------------------------------------------------- +-- Mitsubishi M37702 and M37710 (based on 65C816) +---@src/emu/cpu/m37710/m37710.h,CPUS += M37710 +-------------------------------------------------- + +if (CPUS["M37710"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/m37710/m37710.c", + MAME_DIR .. "src/emu/cpu/m37710/m37710o0.c", + MAME_DIR .. "src/emu/cpu/m37710/m37710o1.c", + MAME_DIR .. "src/emu/cpu/m37710/m37710o2.c", + MAME_DIR .. "src/emu/cpu/m37710/m37710o3.c", + } +end + +if (CPUS["M37710"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m37710/m7700ds.c") +end + +-------------------------------------------------- +-- Mostek 6502 and its many derivatives +---@src/emu/cpu/m6502/m6502.h,CPUS += M6502 +---@src/emu/cpu/m6502/deco16.h,CPUS += M6502 +---@src/emu/cpu/m6502/m4510.h,CPUS += M6502 +---@src/emu/cpu/m6502/m65ce02.h,CPUS += M6502 +---@src/emu/cpu/m6502/m65c02.h,CPUS += M6502 +---@src/emu/cpu/m6502/r65c02.h,CPUS += M6502 +---@src/emu/cpu/m6502/m65sc02.h,CPUS += M6502 +---@src/emu/cpu/m6502/m6504.h,CPUS += M6502 +---@src/emu/cpu/m6502/m6509.h,CPUS += M6502 +---@src/emu/cpu/m6502/m6510.h,CPUS += M6502 +---@src/emu/cpu/m6502/m6510t.h,CPUS += M6502 +---@src/emu/cpu/m6502/m7501.h,CPUS += M6502 +---@src/emu/cpu/m6502/m8502.h,CPUS += M6502 +---@src/emu/cpu/m6502/n2a03.h,CPUS += M6502 +---@src/emu/cpu/m6502/m740.h,CPUS += M6502 +---@src/emu/cpu/m6502/m3745x.h,CPUS += M6502 +---@src/emu/cpu/m6502/m5074x.h,CPUS += M6502 + +-------------------------------------------------- + +if (CPUS["M6502"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/m6502/deco16.c", + MAME_DIR .. "src/emu/cpu/m6502/m4510.c", + MAME_DIR .. "src/emu/cpu/m6502/m6502.c", + MAME_DIR .. "src/emu/cpu/m6502/m65c02.c", + MAME_DIR .. "src/emu/cpu/m6502/m65ce02.c", + MAME_DIR .. "src/emu/cpu/m6502/m65sc02.c", + MAME_DIR .. "src/emu/cpu/m6502/m6504.c", + MAME_DIR .. "src/emu/cpu/m6502/m6509.c", + MAME_DIR .. "src/emu/cpu/m6502/m6510.c", + MAME_DIR .. "src/emu/cpu/m6502/m6510t.c", + MAME_DIR .. "src/emu/cpu/m6502/m7501.c", + MAME_DIR .. "src/emu/cpu/m6502/m8502.c", + MAME_DIR .. "src/emu/cpu/m6502/n2a03.c", + MAME_DIR .. "src/emu/cpu/m6502/r65c02.c", + MAME_DIR .. "src/emu/cpu/m6502/m740.c", + MAME_DIR .. "src/emu/cpu/m6502/m3745x.c", + MAME_DIR .. "src/emu/cpu/m6502/m5074x.c", + } +end + +-------------------------------------------------- +-- Motorola 680x +---@src/emu/cpu/m6800/m6800.h,CPUS += M6800 +-------------------------------------------------- + +if (CPUS["M6800"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/m6800/m6800.c", + } +end + +if (CPUS["M6800"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m6800/6800dasm.c") +end + +-------------------------------------------------- +-- Motorola 6805 +---@src/emu/cpu/m6805/m6805.h,CPUS += M6805 +-------------------------------------------------- + +if (CPUS["M6805"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/m6805/m6805.c", + } +end + +if (CPUS["M6805"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m6805/6805dasm.c") +end + +-------------------------------------------------- +-- Motorola 6809 +---@src/emu/cpu/m6809/m6809.h,CPUS += M6809 +---@src/emu/cpu/m6809/hd6309.h,CPUS += M6809 +---@src/emu/cpu/m6809/konami.h,CPUS += M6809 +-------------------------------------------------- + +if (CPUS["M6809"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/m6809/m6809.c", + MAME_DIR .. "src/emu/cpu/m6809/hd6309.c", + MAME_DIR .. "src/emu/cpu/m6809/konami.c", + } +end + +if (CPUS["M6809"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m6809/6809dasm.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m6809/6309dasm.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m6809/knmidasm.c") +end + +-------------------------------------------------- +-- Motorola 68HC11 +---@src/emu/cpu/mc68hc11/mc68hc11.h,CPUS += MC68HC11 +-------------------------------------------------- + +if (CPUS["MC68HC11"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mc68hc11/mc68hc11.c", + } +end + +if (CPUS["MC68HC11"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mc68hc11/hc11dasm.c") +end + +-------------------------------------------------- +-- Motorola 68000 series +---@src/emu/cpu/m68000/m68000.h,CPUS += M680X0 +-------------------------------------------------- + +if (CPUS["M680X0"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/m68000/m68kcpu.c", + GEN_DIR .. "emu/cpu/m68000/m68kops.c", + } +end + +if (CPUS["M680X0"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/m68000/m68kdasm.c") +end + +-------------------------------------------------- +-- Motorola/Freescale dsp56k +---@src/emu/cpu/dsp56k/dsp56k.h,CPUS += DSP56156 +-------------------------------------------------- + +if (CPUS["DSP56156"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/dsp56k/dsp56k.c", + MAME_DIR .. "src/emu/cpu/dsp56k/dsp56mem.c", + MAME_DIR .. "src/emu/cpu/dsp56k/dsp56pcu.c", + } +end + +if (CPUS["DSP56156"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp56k/dsp56dsm.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp56k/opcode.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp56k/inst.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp56k/pmove.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/dsp56k/tables.c") +end + +-------------------------------------------------- +-- PDP-1 +-- TX0 +---@src/emu/cpu/pdp1/pdp1.h,CPUS += PDP1 +---@src/emu/cpu/pdp1/tx0.h,CPUS += PDP1 +-------------------------------------------------- + +if (CPUS["PDP1"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/pdp1/pdp1.c", + MAME_DIR .. "src/emu/cpu/pdp1/tx0.c", + } +end + +if (CPUS["PDP1"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/pdp1/pdp1dasm.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/pdp1/tx0dasm.c") +end + +-------------------------------------------------- +-- Motorola PowerPC series +---@src/emu/cpu/powerpc/ppc.h,CPUS += POWERPC +-------------------------------------------------- + +if (CPUS["POWERPC"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/powerpc/ppccom.c", + MAME_DIR .. "src/emu/cpu/powerpc/ppcfe.c", + MAME_DIR .. "src/emu/cpu/powerpc/ppcdrc.c", + } +end + +if (CPUS["POWERPC"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/powerpc/ppc_dasm.c") +end + +-------------------------------------------------- +-- NEC V-series Intel-compatible +---@src/emu/cpu/nec/nec.h,CPUS += NEC +---@src/emu/cpu/v30mz/v30mz.h,CPUS += V30MZ +-------------------------------------------------- + +if (CPUS["NEC"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/nec/nec.c", + MAME_DIR .. "src/emu/cpu/nec/v25.c", + MAME_DIR .. "src/emu/cpu/nec/v25sfr.c", + MAME_DIR .. "src/emu/cpu/nec/v53.c", + } +end + +if (CPUS["NEC"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/nec/necdasm.c") +end + +if (CPUS["V30MZ"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/v30mz/v30mz.c", + } +end + +if (CPUS["V30MZ"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/nec/necdasm.c") +end + +-------------------------------------------------- +-- NEC V60/V70 +---@src/emu/cpu/v60/v60.h,CPUS += V60 +-------------------------------------------------- + +if (CPUS["V60"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/v60/v60.c", + } +end + +if (CPUS["V60"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/v60/v60d.c") +end + +-------------------------------------------------- +-- NEC V810 (uPD70732) +---@src/emu/cpu/v810/v810.h,CPUS += V810 +-------------------------------------------------- + +if (CPUS["V810"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/v810/v810.c", + } +end + +if (CPUS["V810"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/v810/v810dasm.c") +end + +-------------------------------------------------- +-- NEC uPD7725 +---@src/emu/cpu/upd7725/upd7725.h,CPUS += UPD7725 +-------------------------------------------------- + +if (CPUS["UPD7725"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/upd7725/upd7725.c", + } +end + +if (CPUS["UPD7725"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/upd7725/dasm7725.c") +end + +-------------------------------------------------- +-- NEC uPD7810 series +---@src/emu/cpu/upd7810/upd7810.h,CPUS += UPD7810 +-------------------------------------------------- + +if (CPUS["UPD7810"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/upd7810/upd7810.c", + MAME_DIR .. "src/emu/cpu/upd7810/upd7810_opcodes.c", + MAME_DIR .. "src/emu/cpu/upd7810/upd7810_table.c", + } +end + +if (CPUS["UPD7810"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/upd7810/upd7810_dasm.c") +end + +-------------------------------------------------- +-- NEC uCOM-4 series +---@src/emu/cpu/ucom4/ucom4.h,CPUS += UCOM4 +-------------------------------------------------- + +if (CPUS["UCOM4"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/ucom4/ucom4.c", + } +end + +if (CPUS["UCOM4"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/ucom4/ucom4d.c") +end + +-------------------------------------------------- +-- Nintendo Minx +---@src/emu/cpu/minx/minx.h,CPUS += MINX +-------------------------------------------------- + +if (CPUS["MINX"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/minx/minx.c", + } +end + +if (CPUS["MINX"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/minx/minxd.c") +end + +-------------------------------------------------- +-- Nintendo/SGI RSP (R3000-based + vector processing) +---@src/emu/cpu/rsp/rsp.h,CPUS += RSP +-------------------------------------------------- + +if (CPUS["RSP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/rsp/rsp.c", + MAME_DIR .. "src/emu/cpu/rsp/rspdrc.c", + MAME_DIR .. "src/emu/cpu/rsp/rspfe.c", + MAME_DIR .. "src/emu/cpu/rsp/rspcp2.c", + MAME_DIR .. "src/emu/cpu/rsp/rspcp2d.c", + } +end + +if (CPUS["RSP"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/rsp/rsp_dasm.c") +end + +-------------------------------------------------- +-- Panasonic MN10200 +---@src/emu/cpu/mn10200/mn10200.h,CPUS += MN10200 +-------------------------------------------------- + +if (CPUS["MN10200"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/mn10200/mn10200.c", + } +end + +if (CPUS["MN10200"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/mn10200/mn102dis.c") +end + +-------------------------------------------------- +-- Saturn +---@src/emu/cpu/saturn/saturn.h,CPUS += SATURN +-------------------------------------------------- + +if (CPUS["SATURN"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/saturn/saturn.c", + } +end + +if (CPUS["SATURN"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/saturn/saturnds.c") +end + +-------------------------------------------------- +-- Signetics 2650 +---@src/emu/cpu/s2650/s2650.h,CPUS += S2650 +-------------------------------------------------- + +if (CPUS["S2650"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/s2650/s2650.c", + } +end + +if (CPUS["S2650"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/s2650/2650dasm.c") +end + +-------------------------------------------------- +-- SC61860 +---@src/emu/cpu/sc61860/sc61860.h,CPUS += SC61860 +-------------------------------------------------- + +if (CPUS["SC61860"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/sc61860/sc61860.c", + } +end + +if (CPUS["SC61860"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sc61860/scdasm.c") +end + +-------------------------------------------------- +-- SM8500 +---@src/emu/cpu/sm8500/sm8500.h,CPUS += SM8500 +-------------------------------------------------- + +if (CPUS["SM8500"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/sm8500/sm8500.c", + } +end + +if (CPUS["SM8500"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sm8500/sm8500d.c") +end + +-------------------------------------------------- +-- Sony/Nintendo SPC700 +---@src/emu/cpu/spc700/spc700.h,CPUS += SPC700 +-------------------------------------------------- + +if (CPUS["SPC700"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/spc700/spc700.c", + } +end + +if (CPUS["SPC700"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/spc700/spc700ds.c") +end + +-------------------------------------------------- +-- SSP1601 +---@src/emu/cpu/ssp1601/ssp1601.h,CPUS += SSP1601 +-------------------------------------------------- + +if (CPUS["SSP1601"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/ssp1601/ssp1601.c", + } +end + +if (CPUS["SSP1601"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/ssp1601/ssp1601d.c") +end + +-------------------------------------------------- +-- SunPlus u'nSP +---@src/emu/cpu/unsp/unsp.h,CPUS += UNSP +-------------------------------------------------- + +if (CPUS["UNSP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/unsp/unsp.c", + } +end + +if (CPUS["UNSP"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/unsp/unspdasm.c") +end + +-------------------------------------------------- +-- Atmel 8-bit AVR +---@src/emu/cpu/avr8/avr8.h,CPUS += AVR8 +-------------------------------------------------- + +if (CPUS["AVR8"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/avr8/avr8.c", + } +end + +if (CPUS["AVR8"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/avr8/avr8dasm.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS0980 +---@src/emu/cpu/tms0980/tms0980.h,CPUS += TMS0980 +-------------------------------------------------- + +if (CPUS["TMS0980"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms0980/tms0980.c", + } +end + +if (CPUS["TMS0980"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms0980/tms0980d.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS7000 series +---@src/emu/cpu/tms7000/tms7000.h,CPUS += TMS7000 +-------------------------------------------------- + +if (CPUS["TMS7000"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms7000/tms7000.c", + } +end + +if (CPUS["TMS7000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms7000/7000dasm.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS99xx series +---@src/emu/cpu/tms9900/tms9900.h,CPUS += TMS9900 +---@src/emu/cpu/tms9900/tms9980a.h,CPUS += TMS9900 +---@src/emu/cpu/tms9900/tms9995.h,CPUS += TMS9900 + +-------------------------------------------------- + +if (CPUS["TMS9900"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms9900/tms9900.c", + MAME_DIR .. "src/emu/cpu/tms9900/tms9980a.c", + MAME_DIR .. "src/emu/cpu/tms9900/tms9995.c", + MAME_DIR .. "src/emu/cpu/tms9900/ti990_10.c", + } +end + +if (CPUS["TMS9900"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms9900/9900dasm.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS340x0 graphics controllers +---@src/emu/cpu/tms34010/tms34010.h,CPUS += TMS340X0 +-------------------------------------------------- + +if (CPUS["TMS340X0"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms34010/tms34010.c", + } +end + +if (CPUS["TMS340X0"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms34010/34010dsm.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS3201x DSP +---@src/emu/cpu/tms32010/tms32010.h,CPUS += TMS32010 +-------------------------------------------------- + +if (CPUS["TMS32010"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms32010/tms32010.c", + } +end + +if (CPUS["TMS32010"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms32010/32010dsm.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS3202x DSP +---@src/emu/cpu/tms32025/tms32025.h,CPUS += TMS32025 +-------------------------------------------------- + +if (CPUS["TMS32025"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms32025/tms32025.c", + } +end + +if (CPUS["TMS32025"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms32025/32025dsm.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS3203x DSP +---@src/emu/cpu/tms32031/tms32031.h,CPUS += TMS32031 +-------------------------------------------------- + +if (CPUS["TMS32031"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms32031/tms32031.c", + } +end + +if (CPUS["TMS32031"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms32031/dis32031.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS3205x DSP +---@src/emu/cpu/tms32051/tms32051.h,CPUS += TMS32051 +-------------------------------------------------- + +if (CPUS["TMS32051"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms32051/tms32051.c", + } +end + +if (CPUS["TMS32051"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms32051/dis32051.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS3208x DSP +---@src/emu/cpu/tms32082/tms32082.h,CPUS += TMS32082_MP +-------------------------------------------------- + +if (CPUS["TMS32082"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms32082/tms32082.c", + MAME_DIR .. "src/emu/cpu/tms32082/mp_ops.c", + } +end + +if (CPUS["TMS32082"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms32082/dis_mp.c") + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms32082/dis_pp.c") +end + +-------------------------------------------------- +-- Texas Instruments TMS57002 DSP +---@src/emu/cpu/tms57002/tms57002.h,CPUS += TMS57002 +-------------------------------------------------- + +if (CPUS["TMS57002"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tms57002/tms57002.c", + MAME_DIR .. "src/emu/cpu/tms57002/tms57kdec.c", + } +end + +if (CPUS["TMS57002"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tms57002/57002dsm.c") +end + +-------------------------------------------------- +-- Toshiba TLCS-90 Series +---@src/emu/cpu/tlcs90/tlcs90.h,CPUS += TLCS90 +-------------------------------------------------- + +if (CPUS["TLCS90"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tlcs90/tlcs90.c", + } +end + +-------------------------------------------------- +-- Toshiba TLCS-900 Series +---@src/emu/cpu/tlcs900/tlcs900.h,CPUS += TLCS900 +-------------------------------------------------- + +if (CPUS["TLCS900"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/tlcs900/tlcs900.c", + } +end + +if (CPUS["TLCS900"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/tlcs900/dasm900.c") +end + +-------------------------------------------------- +-- Zilog Z80 +---@src/emu/cpu/z80/z80.h,CPUS += Z80 +-------------------------------------------------- + +if (CPUS["Z80"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/z80/z80.c", + MAME_DIR .. "src/emu/cpu/z80/z80daisy.c", + MAME_DIR .. "src/emu/cpu/z80/tmpz84c011.c", + MAME_DIR .. "src/emu/cpu/z80/tmpz84c015.c", + MAME_DIR .. "src/emu/cpu/z80/kl5c80a12.c", + } +end + +if (CPUS["Z80"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/z80/z80dasm.c") +end + +-------------------------------------------------- +-- Sharp LR35902 (Game Boy CPU) +---@src/emu/cpu/lr35902/lr35902.h,CPUS += LR35902 +-------------------------------------------------- + +if (CPUS["LR35902"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/lr35902/lr35902.c", + } +end + +if (CPUS["LR35902"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/lr35902/lr35902d.c") +end + +-------------------------------------------------- +-- Zilog Z180 +---@src/emu/cpu/z180/z180.h,CPUS += Z180 +-------------------------------------------------- + +if (CPUS["Z180"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/z180/z180.c", + MAME_DIR .. "src/emu/cpu/z80/z80daisy.c", + } +end + +if (CPUS["Z180"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/z180/z180dasm.c") +end + +-------------------------------------------------- +-- Zilog Z8000 +---@src/emu/cpu/z8000/z8000.h,CPUS += Z8000 +-------------------------------------------------- + +if (CPUS["Z8000"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/z8000/z8000.c", + } +end + +if (CPUS["Z8000"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/z8000/8000dasm.c") +end + +-------------------------------------------------- +-- Zilog Z8 +---@src/emu/cpu/z8/z8.h,CPUS += Z8 +-------------------------------------------------- + +if (CPUS["Z8"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/z8/z8.c", + } +end + +if (CPUS["Z8"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/z8/z8dasm.c") +end + +-------------------------------------------------- +-- Argonaut SuperFX +---@src/emu/cpu/superfx/superfx.h,CPUS += SUPERFX +-------------------------------------------------- + +if (CPUS["SUPERFX"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/superfx/superfx.c", + } +end + +if (CPUS["SUPERFX"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/superfx/sfx_dasm.c") +end + +-------------------------------------------------- +-- Rockwell PPS-4 +---@src/emu/cpu/pps4/pps4.h,CPUS += PPS4 +-------------------------------------------------- + +if (CPUS["PPS4"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/pps4/pps4.c", + } +end + +if (CPUS["PPS4"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/pps4/pps4dasm.c") +end + +-------------------------------------------------- +-- Hitachi HD61700 +---@src/emu/cpu/hd61700/hd61700.h,CPUS += HD61700 +-------------------------------------------------- + +if (CPUS["HD61700"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/hd61700/hd61700.c", + } +end + +if (CPUS["HD61700"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/hd61700/hd61700d.c") +end + +-------------------------------------------------- +-- Sanyo LC8670 +---@src/emu/cpu/lc8670/lc8670.h,CPUS += LC8670 +-------------------------------------------------- + +if (CPUS["LC8670"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/lc8670/lc8670.c", + } +end + +if (CPUS["LC8670"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/lc8670/lc8670dsm.c") +end + +-------------------------------------------------- +-- Sega SCU DSP +---@src/emu/cpu/scudsp/scudsp.h,CPUS += SCUDSP +-------------------------------------------------- + +if (CPUS["SCUDSP"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/scudsp/scudsp.c", + } +end + +if (CPUS["SCUDSP"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/scudsp/scudspdasm.c") +end + +-------------------------------------------------- +-- Sunplus Technology S+core +---@src/emu/cpu/score/score.h,CPUS += SCORE +-------------------------------------------------- + +if (CPUS["SCORE"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/score/score.c", + } +end + +if (CPUS["SCORE"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/score/scoredsm.c") +end + +-------------------------------------------------- +-- Xerox Alto-II +---@src/emu/cpu/alto2/alto2cpu.h,CPUS += ALTO2 +-------------------------------------------------- + +if (CPUS["ALTO2"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/alto2/alto2cpu.c", + MAME_DIR .. "src/emu/cpu/alto2/a2disk.c", + MAME_DIR .. "src/emu/cpu/alto2/a2disp.c", + MAME_DIR .. "src/emu/cpu/alto2/a2curt.c", + MAME_DIR .. "src/emu/cpu/alto2/a2dht.c", + MAME_DIR .. "src/emu/cpu/alto2/a2dvt.c", + MAME_DIR .. "src/emu/cpu/alto2/a2dwt.c", + MAME_DIR .. "src/emu/cpu/alto2/a2emu.c", + MAME_DIR .. "src/emu/cpu/alto2/a2ether.c", + MAME_DIR .. "src/emu/cpu/alto2/a2hw.c", + MAME_DIR .. "src/emu/cpu/alto2/a2kbd.c", + MAME_DIR .. "src/emu/cpu/alto2/a2ksec.c", + MAME_DIR .. "src/emu/cpu/alto2/a2kwd.c", + MAME_DIR .. "src/emu/cpu/alto2/a2mem.c", + MAME_DIR .. "src/emu/cpu/alto2/a2mouse.c", + MAME_DIR .. "src/emu/cpu/alto2/a2mrt.c", + MAME_DIR .. "src/emu/cpu/alto2/a2part.c", + MAME_DIR .. "src/emu/cpu/alto2/a2ram.c", + MAME_DIR .. "src/emu/cpu/alto2/a2roms.c", + } +end + +if (CPUS["ALTO2"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/alto2/alto2dsm.c") +end + diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua new file mode 100644 index 00000000000..192dd0cd1b5 --- /dev/null +++ b/scripts/src/emu.lua @@ -0,0 +1,255 @@ +project ("emu") +uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf") +kind "StaticLib" +options { + "ForceCPP", +} + +includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/expat/lib", + MAME_DIR .. "3rdparty/lua/src", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "emu", + GEN_DIR .. "emu/layout", +} + +includeosd() + +files { + MAME_DIR .. "src/emu/hashfile.c", + MAME_DIR .. "src/emu/addrmap.c", + MAME_DIR .. "src/emu/attotime.c", + MAME_DIR .. "src/emu/audit.c", + MAME_DIR .. "src/emu/cheat.c", + MAME_DIR .. "src/emu/clifront.c", + MAME_DIR .. "src/emu/cliopts.c", + MAME_DIR .. "src/emu/config.c", + MAME_DIR .. "src/emu/crsshair.c", + MAME_DIR .. "src/emu/debugger.c", + MAME_DIR .. "src/emu/devdelegate.c", + MAME_DIR .. "src/emu/devcb.c", + MAME_DIR .. "src/emu/devcpu.c", + MAME_DIR .. "src/emu/devfind.c", + MAME_DIR .. "src/emu/device.c", + MAME_DIR .. "src/emu/didisasm.c", + MAME_DIR .. "src/emu/diexec.c", + MAME_DIR .. "src/emu/digfx.c", + MAME_DIR .. "src/emu/diimage.c", + MAME_DIR .. "src/emu/dimemory.c", + MAME_DIR .. "src/emu/dinetwork.c", + MAME_DIR .. "src/emu/dinvram.c", + MAME_DIR .. "src/emu/dioutput.c", + MAME_DIR .. "src/emu/dirtc.c", + MAME_DIR .. "src/emu/diserial.c", + MAME_DIR .. "src/emu/dislot.c", + MAME_DIR .. "src/emu/disound.c", + MAME_DIR .. "src/emu/dispatch.c", + MAME_DIR .. "src/emu/distate.c", + MAME_DIR .. "src/emu/divideo.c", + MAME_DIR .. "src/emu/drawgfx.c", + MAME_DIR .. "src/emu/driver.c", + MAME_DIR .. "src/emu/drivenum.c", + MAME_DIR .. "src/emu/emualloc.c", + MAME_DIR .. "src/emu/emucore.c", + MAME_DIR .. "src/emu/emuopts.c", + MAME_DIR .. "src/emu/emupal.c", + MAME_DIR .. "src/emu/fileio.c", + MAME_DIR .. "src/emu/hash.c", + MAME_DIR .. "src/emu/image.c", + MAME_DIR .. "src/emu/info.c", + MAME_DIR .. "src/emu/input.c", + MAME_DIR .. "src/emu/ioport.c", + MAME_DIR .. "src/emu/luaengine.c", + MAME_DIR .. "src/emu/mame.c", + MAME_DIR .. "src/emu/machine.c", + MAME_DIR .. "src/emu/mconfig.c", + MAME_DIR .. "src/emu/memarray.c", + MAME_DIR .. "src/emu/memory.c", + MAME_DIR .. "src/emu/network.c", + MAME_DIR .. "src/emu/parameters.c", + MAME_DIR .. "src/emu/output.c", + MAME_DIR .. "src/emu/render.c", + MAME_DIR .. "src/emu/rendfont.c", + MAME_DIR .. "src/emu/rendlay.c", + MAME_DIR .. "src/emu/rendutil.c", + MAME_DIR .. "src/emu/romload.c", + MAME_DIR .. "src/emu/save.c", + MAME_DIR .. "src/emu/schedule.c", + MAME_DIR .. "src/emu/screen.c", + MAME_DIR .. "src/emu/softlist.c", + MAME_DIR .. "src/emu/sound.c", + MAME_DIR .. "src/emu/speaker.c", + MAME_DIR .. "src/emu/sprite.c", + MAME_DIR .. "src/emu/tilemap.c", + MAME_DIR .. "src/emu/timer.c", + MAME_DIR .. "src/emu/uiinput.c", + MAME_DIR .. "src/emu/ui/ui.c", + MAME_DIR .. "src/emu/ui/menu.c", + MAME_DIR .. "src/emu/ui/mainmenu.c", + MAME_DIR .. "src/emu/ui/miscmenu.c", + MAME_DIR .. "src/emu/ui/barcode.c", + MAME_DIR .. "src/emu/ui/cheatopt.c", + MAME_DIR .. "src/emu/ui/devopt.c", + MAME_DIR .. "src/emu/ui/filemngr.c", + MAME_DIR .. "src/emu/ui/filesel.c", + MAME_DIR .. "src/emu/ui/imgcntrl.c", + MAME_DIR .. "src/emu/ui/info.c", + MAME_DIR .. "src/emu/ui/inputmap.c", + MAME_DIR .. "src/emu/ui/selgame.c", + MAME_DIR .. "src/emu/ui/sliders.c", + MAME_DIR .. "src/emu/ui/slotopt.c", + MAME_DIR .. "src/emu/ui/swlist.c", + MAME_DIR .. "src/emu/ui/tapectrl.c", + MAME_DIR .. "src/emu/ui/videoopt.c", + MAME_DIR .. "src/emu/ui/viewgfx.c", + MAME_DIR .. "src/emu/validity.c", + MAME_DIR .. "src/emu/video.c", + MAME_DIR .. "src/emu/debug/debugcmd.c", + MAME_DIR .. "src/emu/debug/debugcon.c", + MAME_DIR .. "src/emu/debug/debugcpu.c", + MAME_DIR .. "src/emu/debug/debughlp.c", + MAME_DIR .. "src/emu/debug/debugvw.c", + MAME_DIR .. "src/emu/debug/dvdisasm.c", + MAME_DIR .. "src/emu/debug/dvmemory.c", + MAME_DIR .. "src/emu/debug/dvbpoints.c", + MAME_DIR .. "src/emu/debug/dvwpoints.c", + MAME_DIR .. "src/emu/debug/dvstate.c", + MAME_DIR .. "src/emu/debug/dvtext.c", + MAME_DIR .. "src/emu/debug/express.c", + MAME_DIR .. "src/emu/debug/textbuf.c", + MAME_DIR .. "src/emu/profiler.c", + MAME_DIR .. "src/emu/webengine.c", + MAME_DIR .. "src/emu/sound/filter.c", + MAME_DIR .. "src/emu/sound/flt_vol.c", + MAME_DIR .. "src/emu/sound/flt_rc.c", + MAME_DIR .. "src/emu/sound/wavwrite.c", + MAME_DIR .. "src/emu/sound/samples.c", + MAME_DIR .. "src/emu/drivers/empty.c", + MAME_DIR .. "src/emu/drivers/testcpu.c", + MAME_DIR .. "src/emu/machine/bcreader.c", + MAME_DIR .. "src/emu/machine/buffer.c", + MAME_DIR .. "src/emu/machine/clock.c", + MAME_DIR .. "src/emu/machine/generic.c", + MAME_DIR .. "src/emu/machine/keyboard.c", + MAME_DIR .. "src/emu/machine/laserdsc.c", + MAME_DIR .. "src/emu/machine/latch.c", + MAME_DIR .. "src/emu/machine/netlist.c", + MAME_DIR .. "src/emu/machine/nvram.c", + MAME_DIR .. "src/emu/machine/ram.c", + MAME_DIR .. "src/emu/machine/legscsi.c", + MAME_DIR .. "src/emu/machine/terminal.c", + MAME_DIR .. "src/emu/imagedev/bitbngr.c", + MAME_DIR .. "src/emu/imagedev/cassette.c", + MAME_DIR .. "src/emu/imagedev/chd_cd.c", + MAME_DIR .. "src/emu/imagedev/diablo.c", + MAME_DIR .. "src/emu/imagedev/flopdrv.c", + MAME_DIR .. "src/emu/imagedev/floppy.c", + MAME_DIR .. "src/emu/imagedev/harddriv.c", + MAME_DIR .. "src/emu/imagedev/midiin.c", + MAME_DIR .. "src/emu/imagedev/midiout.c", + MAME_DIR .. "src/emu/imagedev/printer.c", + MAME_DIR .. "src/emu/imagedev/snapquik.c", + MAME_DIR .. "src/emu/video/generic.c", + MAME_DIR .. "src/emu/video/resnet.c", + MAME_DIR .. "src/emu/video/rgbutil.c", + MAME_DIR .. "src/emu/video/vector.c", +} + + +function emuProject(_target, _subtarget) + + disasm_files = { } + + project ("optional") + uuid (os.uuid("optional-" .. _target .."_" .. _subtarget)) + kind "StaticLib" + targetsubdir(_target .."_" .. _subtarget) + options { + "ForceCPP", + "ArchiveSplit", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mame", -- used for sound amiga + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/expat/lib", + MAME_DIR .. "3rdparty/lua/src", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "emu", + GEN_DIR .. "emu/layout", + MAME_DIR .. "src/emu/cpu/m68000", + GEN_DIR .. "emu/cpu/m68000", + } + includeosd() + + dofile(path.join("src", "cpu.lua")) + + dofile(path.join("src", "sound.lua")) + + dofile(path.join("src", "netlist.lua")) + + dofile(path.join("src", "video.lua")) + + dofile(path.join("src", "machine.lua")) + + + project ("bus") + uuid ("5d782c89-cf7e-4cfe-8f9f-0d4bfc16c91d") + kind "StaticLib" + targetsubdir(_target .."_" .. _subtarget) + options { + "ForceCPP", + "ArchiveSplit", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/expat/lib", + MAME_DIR .. "3rdparty/lua/src", + MAME_DIR .. "3rdparty/zlib", + MAME_DIR .. "src/mess", -- some mess bus devices need this + MAME_DIR .. "src/mame", -- used for nes bus devices + GEN_DIR .. "emu", + GEN_DIR .. "emu/layout", + } + + includeosd() + + dofile(path.join("src", "bus.lua")) + + + project ("dasm") + uuid ("f2d28b0a-6da5-4f78-b629-d834aa00429d") + kind "StaticLib" + targetsubdir(_target .."_" .. _subtarget) + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/expat/lib", + MAME_DIR .. "3rdparty/lua/src", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "emu", + } + + includeosd() + + files { + disasm_files + } +end
\ No newline at end of file diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua new file mode 100644 index 00000000000..aa49783b82c --- /dev/null +++ b/scripts/src/lib.lua @@ -0,0 +1,215 @@ +project "utils" + uuid "22489ad0-4cb2-4d91-ad81-24b0d80ca30a" + kind "StaticLib" + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/expat/lib", + MAME_DIR .. "3rdparty/zlib", + } + + includeosd() + + files { + MAME_DIR .. "src/lib/util/astring.c", + MAME_DIR .. "src/lib/util/avhuff.c", + MAME_DIR .. "src/lib/util/aviio.c", + MAME_DIR .. "src/lib/util/bitmap.c", + MAME_DIR .. "src/lib/util/cdrom.c", + MAME_DIR .. "src/lib/util/chd.c", + MAME_DIR .. "src/lib/util/chdcd.c", + MAME_DIR .. "src/lib/util/chdcodec.c", + MAME_DIR .. "src/lib/util/corealloc.c", + MAME_DIR .. "src/lib/util/corefile.c", + MAME_DIR .. "src/lib/util/corestr.c", + MAME_DIR .. "src/lib/util/coreutil.c", + MAME_DIR .. "src/lib/util/cstrpool.c", + MAME_DIR .. "src/lib/util/delegate.c", + MAME_DIR .. "src/lib/util/flac.c", + MAME_DIR .. "src/lib/util/harddisk.c", + MAME_DIR .. "src/lib/util/hashing.c", + MAME_DIR .. "src/lib/util/huffman.c", + MAME_DIR .. "src/lib/util/jedparse.c", + MAME_DIR .. "src/lib/util/md5.c", + MAME_DIR .. "src/lib/util/opresolv.c", + MAME_DIR .. "src/lib/util/options.c", + MAME_DIR .. "src/lib/util/palette.c", + MAME_DIR .. "src/lib/util/plaparse.c", + MAME_DIR .. "src/lib/util/png.c", + MAME_DIR .. "src/lib/util/pool.c", + MAME_DIR .. "src/lib/util/sha1.c", + MAME_DIR .. "src/lib/util/tagmap.c", + MAME_DIR .. "src/lib/util/unicode.c", + MAME_DIR .. "src/lib/util/unzip.c", + MAME_DIR .. "src/lib/util/un7z.c", + MAME_DIR .. "src/lib/util/vbiparse.c", + MAME_DIR .. "src/lib/util/xmlfile.c", + MAME_DIR .. "src/lib/util/zippath.c", + } + + +project "formats" + uuid "f69636b1-fcce-45ce-b09a-113e371a2d7a" + kind "StaticLib" + + options { + "ForceCPP", + "ArchiveSplit", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + } + + includeosd() + + files { + MAME_DIR .. "src/lib/formats/cassimg.c", + MAME_DIR .. "src/lib/formats/flopimg.c", + MAME_DIR .. "src/lib/formats/imageutl.c", + MAME_DIR .. "src/lib/formats/ioprocs.c", + MAME_DIR .. "src/lib/formats/basicdsk.c", + MAME_DIR .. "src/lib/formats/a26_cas.c", + MAME_DIR .. "src/lib/formats/a5105_dsk.c", + MAME_DIR .. "src/lib/formats/abc800_dsk.c", + MAME_DIR .. "src/lib/formats/ace_tap.c", + MAME_DIR .. "src/lib/formats/adam_cas.c", + MAME_DIR .. "src/lib/formats/adam_dsk.c", + MAME_DIR .. "src/lib/formats/ami_dsk.c", + MAME_DIR .. "src/lib/formats/ap2_dsk.c", + MAME_DIR .. "src/lib/formats/apf_apt.c", + MAME_DIR .. "src/lib/formats/apridisk.c", + MAME_DIR .. "src/lib/formats/apollo_dsk.c", + MAME_DIR .. "src/lib/formats/ap_dsk35.c", + MAME_DIR .. "src/lib/formats/applix_dsk.c", + MAME_DIR .. "src/lib/formats/asst128_dsk.c", + MAME_DIR .. "src/lib/formats/atari_dsk.c", + MAME_DIR .. "src/lib/formats/atarist_dsk.c", + MAME_DIR .. "src/lib/formats/atom_tap.c", + MAME_DIR .. "src/lib/formats/bw2_dsk.c", + MAME_DIR .. "src/lib/formats/bw12_dsk.c", + MAME_DIR .. "src/lib/formats/cbm_crt.c", + MAME_DIR .. "src/lib/formats/cbm_tap.c", + MAME_DIR .. "src/lib/formats/ccvf_dsk.c", + MAME_DIR .. "src/lib/formats/cgen_cas.c", + MAME_DIR .. "src/lib/formats/coco_cas.c", + MAME_DIR .. "src/lib/formats/coco_dsk.c", + MAME_DIR .. "src/lib/formats/comx35_dsk.c", + MAME_DIR .. "src/lib/formats/concept_dsk.c", + MAME_DIR .. "src/lib/formats/coupedsk.c", + MAME_DIR .. "src/lib/formats/cpis_dsk.c", + MAME_DIR .. "src/lib/formats/cqm_dsk.c", + MAME_DIR .. "src/lib/formats/csw_cas.c", + MAME_DIR .. "src/lib/formats/d64_dsk.c", + MAME_DIR .. "src/lib/formats/d67_dsk.c", + MAME_DIR .. "src/lib/formats/d71_dsk.c", + MAME_DIR .. "src/lib/formats/d80_dsk.c", + MAME_DIR .. "src/lib/formats/d81_dsk.c", + MAME_DIR .. "src/lib/formats/d82_dsk.c", + MAME_DIR .. "src/lib/formats/d88_dsk.c", + MAME_DIR .. "src/lib/formats/dcp_dsk.c", + MAME_DIR .. "src/lib/formats/dfi_dsk.c", + MAME_DIR .. "src/lib/formats/dim_dsk.c", + MAME_DIR .. "src/lib/formats/dip_dsk.c", + MAME_DIR .. "src/lib/formats/dmk_dsk.c", + MAME_DIR .. "src/lib/formats/dmv_dsk.c", + MAME_DIR .. "src/lib/formats/dsk_dsk.c", + MAME_DIR .. "src/lib/formats/ep64_dsk.c", + MAME_DIR .. "src/lib/formats/esq8_dsk.c", + MAME_DIR .. "src/lib/formats/esq16_dsk.c", + MAME_DIR .. "src/lib/formats/excali64_dsk.c", + MAME_DIR .. "src/lib/formats/fc100_cas.c", + MAME_DIR .. "src/lib/formats/fdi_dsk.c", + MAME_DIR .. "src/lib/formats/fdd_dsk.c", + MAME_DIR .. "src/lib/formats/flex_dsk.c", + MAME_DIR .. "src/lib/formats/fm7_cas.c", + MAME_DIR .. "src/lib/formats/fmsx_cas.c", + MAME_DIR .. "src/lib/formats/fmtowns_dsk.c", + MAME_DIR .. "src/lib/formats/g64_dsk.c", + MAME_DIR .. "src/lib/formats/gtp_cas.c", + MAME_DIR .. "src/lib/formats/hect_dsk.c", + MAME_DIR .. "src/lib/formats/hect_tap.c", + MAME_DIR .. "src/lib/formats/iq151_dsk.c", + MAME_DIR .. "src/lib/formats/imd_dsk.c", + MAME_DIR .. "src/lib/formats/ipf_dsk.c", + MAME_DIR .. "src/lib/formats/kaypro_dsk.c", + MAME_DIR .. "src/lib/formats/kc_cas.c", + MAME_DIR .. "src/lib/formats/kc85_dsk.c", + MAME_DIR .. "src/lib/formats/kim1_cas.c", + MAME_DIR .. "src/lib/formats/lviv_lvt.c", + MAME_DIR .. "src/lib/formats/m20_dsk.c", + MAME_DIR .. "src/lib/formats/m5_dsk.c", + MAME_DIR .. "src/lib/formats/mbee_cas.c", + MAME_DIR .. "src/lib/formats/mm_dsk.c", + MAME_DIR .. "src/lib/formats/msx_dsk.c", + MAME_DIR .. "src/lib/formats/mfi_dsk.c", + MAME_DIR .. "src/lib/formats/mz_cas.c", + MAME_DIR .. "src/lib/formats/nanos_dsk.c", + MAME_DIR .. "src/lib/formats/naslite_dsk.c", + MAME_DIR .. "src/lib/formats/nes_dsk.c", + MAME_DIR .. "src/lib/formats/nfd_dsk.c", + MAME_DIR .. "src/lib/formats/orao_cas.c", + MAME_DIR .. "src/lib/formats/oric_dsk.c", + MAME_DIR .. "src/lib/formats/oric_tap.c", + MAME_DIR .. "src/lib/formats/p6001_cas.c", + MAME_DIR .. "src/lib/formats/pasti_dsk.c", + MAME_DIR .. "src/lib/formats/pc_dsk.c", + MAME_DIR .. "src/lib/formats/pc98_dsk.c", + MAME_DIR .. "src/lib/formats/pc98fdi_dsk.c", + MAME_DIR .. "src/lib/formats/phc25_cas.c", + MAME_DIR .. "src/lib/formats/pmd_cas.c", + MAME_DIR .. "src/lib/formats/primoptp.c", + MAME_DIR .. "src/lib/formats/pyldin_dsk.c", + MAME_DIR .. "src/lib/formats/ql_dsk.c", + MAME_DIR .. "src/lib/formats/rk_cas.c", + MAME_DIR .. "src/lib/formats/rx50_dsk.c", + MAME_DIR .. "src/lib/formats/sc3000_bit.c", + MAME_DIR .. "src/lib/formats/sf7000_dsk.c", + MAME_DIR .. "src/lib/formats/smx_dsk.c", + MAME_DIR .. "src/lib/formats/sol_cas.c", + MAME_DIR .. "src/lib/formats/sorc_dsk.c", + MAME_DIR .. "src/lib/formats/sorc_cas.c", + MAME_DIR .. "src/lib/formats/sord_cas.c", + MAME_DIR .. "src/lib/formats/spc1000_cas.c", + MAME_DIR .. "src/lib/formats/st_dsk.c", + MAME_DIR .. "src/lib/formats/svi_cas.c", + MAME_DIR .. "src/lib/formats/svi_dsk.c", + MAME_DIR .. "src/lib/formats/tandy2k_dsk.c", + MAME_DIR .. "src/lib/formats/td0_dsk.c", + MAME_DIR .. "src/lib/formats/thom_cas.c", + MAME_DIR .. "src/lib/formats/thom_dsk.c", + MAME_DIR .. "src/lib/formats/ti99_dsk.c", + MAME_DIR .. "src/lib/formats/tiki100_dsk.c", + MAME_DIR .. "src/lib/formats/trd_dsk.c", + MAME_DIR .. "src/lib/formats/trs_cas.c", + MAME_DIR .. "src/lib/formats/trs_dsk.c", + MAME_DIR .. "src/lib/formats/tvc_cas.c", + MAME_DIR .. "src/lib/formats/tvc_dsk.c", + MAME_DIR .. "src/lib/formats/tzx_cas.c", + MAME_DIR .. "src/lib/formats/uef_cas.c", + MAME_DIR .. "src/lib/formats/upd765_dsk.c", + MAME_DIR .. "src/lib/formats/victor9k_dsk.c", + MAME_DIR .. "src/lib/formats/vg5k_cas.c", + MAME_DIR .. "src/lib/formats/vt_cas.c", + MAME_DIR .. "src/lib/formats/vt_dsk.c", + MAME_DIR .. "src/lib/formats/vtech1_dsk.c", + MAME_DIR .. "src/lib/formats/wavfile.c", + MAME_DIR .. "src/lib/formats/wd177x_dsk.c", + MAME_DIR .. "src/lib/formats/x07_cas.c", + MAME_DIR .. "src/lib/formats/x1_tap.c", + MAME_DIR .. "src/lib/formats/xdf_dsk.c", + MAME_DIR .. "src/lib/formats/z80ne_dsk.c", + MAME_DIR .. "src/lib/formats/zx81_p.c", + MAME_DIR .. "src/lib/formats/hxcmfm_dsk.c", + MAME_DIR .. "src/lib/formats/itt3030_dsk.c", + } + diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua new file mode 100644 index 00000000000..b60cdc028c3 --- /dev/null +++ b/scripts/src/machine.lua @@ -0,0 +1,2387 @@ +--------------------------------------------------------------------------- +-- +-- machine.lua +-- +-- Rules for building machine cores +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +---------------------------------------------------------------------------- + + +--------------------------------------------------- +-- +--@src/emu/machine/akiko.h,MACHINES += AKIKO +--------------------------------------------------- + +if (MACHINES["AKIKO"]~=null) then + files { + MAME_DIR .. "src/emu/machine/akiko.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/autoconfig.h,MACHINES += AUTOCONFIG +--------------------------------------------------- + +if (MACHINES["AUTOCONFIG"]~=null) then + files { + MAME_DIR .. "src/emu/machine/autoconfig.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/cr511b.h,MACHINES += CR511B +--------------------------------------------------- + +if (MACHINES["CR511B"]~=null) then + files { + MAME_DIR .. "src/emu/machine/cr511b.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/dmac.h,MACHINES += DMAC +--------------------------------------------------- + +if (MACHINES["DMAC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/dmac.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/gayle.h,MACHINES += GAYLE +--------------------------------------------------- + +if (MACHINES["GAYLE"]~=null) then + files { + MAME_DIR .. "src/emu/machine/gayle.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/40105.h,MACHINES += CMOS40105 +--------------------------------------------------- + +if (MACHINES["CMOS40105"]~=null) then + files { + MAME_DIR .. "src/emu/machine/40105.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/53c7xx.h,MACHINES += NCR53C7XX +--------------------------------------------------- + +if (MACHINES["NCR53C7XX"]~=null) then + MACHINES["NSCSI"] = true + files { + MAME_DIR .. "src/emu/machine/53c7xx.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/53c810.h,MACHINES += LSI53C810 +--------------------------------------------------- + +if (MACHINES["LSI53C810"]~=null) then + MACHINES["SCSI"] = true + files { + MAME_DIR .. "src/emu/machine/53c810.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/6522via.h,MACHINES += 6522VIA +--------------------------------------------------- + +if (MACHINES["6522VIA"]~=null) then + files { + MAME_DIR .. "src/emu/machine/6522via.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/6525tpi.h,MACHINES += TPI6525 +--------------------------------------------------- + +if (MACHINES["TPI6525"]~=null) then + files { + MAME_DIR .. "src/emu/machine/6525tpi.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/6532riot.h,MACHINES += RIOT6532 +--------------------------------------------------- + +if (MACHINES["RIOT6532"]~=null) then + files { + MAME_DIR .. "src/emu/machine/6532riot.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/6821pia.h,MACHINES += 6821PIA +--------------------------------------------------- + +if (MACHINES["6821PIA"]~=null) then + files { + MAME_DIR .. "src/emu/machine/6821pia.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/6840ptm.h,MACHINES += 6840PTM +--------------------------------------------------- + +if (MACHINES["6840PTM"]~=null) then + files { + MAME_DIR .. "src/emu/machine/6840ptm.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/6850acia.h,MACHINES += ACIA6850 +--------------------------------------------------- + +if (MACHINES["ACIA6850"]~=null) then + files { + MAME_DIR .. "src/emu/machine/6850acia.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/68561mpcc.h,MACHINES += 68561MPCC +--------------------------------------------------- + +if (MACHINES["68561MPCC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/68561mpcc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc68681.h,MACHINES += 68681 +--------------------------------------------------- + +if (MACHINES["68681"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc68681.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/7200fifo.h,MACHINES += 7200FIFO +--------------------------------------------------- + +if (MACHINES["7200FIFO"]~=null) then + files { + MAME_DIR .. "src/emu/machine/7200fifo.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/74123.h,MACHINES += TTL74123 +--------------------------------------------------- + +if (MACHINES["TTL74123"]~=null) then + files { + MAME_DIR .. "src/emu/machine/74123.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/74145.h,MACHINES += TTL74145 +--------------------------------------------------- + +if (MACHINES["TTL74145"]~=null) then + files { + MAME_DIR .. "src/emu/machine/74145.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/74148.h,MACHINES += TTL74148 +--------------------------------------------------- + +if (MACHINES["TTL74148"]~=null) then + files { + MAME_DIR .. "src/emu/machine/74148.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/74153.h,MACHINES += TTL74153 +--------------------------------------------------- + +if (MACHINES["TTL74153"]~=null) then + files { + MAME_DIR .. "src/emu/machine/74153.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/74181.h,MACHINES += TTL74181 +--------------------------------------------------- + +if (MACHINES["TTL74181"]~=null) then + files { + MAME_DIR .. "src/emu/machine/74181.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/7474.h,MACHINES += TTL7474 +--------------------------------------------------- + +if (MACHINES["TTL7474"]~=null) then + files { + MAME_DIR .. "src/emu/machine/7474.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/8042kbdc.h,MACHINES += KBDC8042 +--------------------------------------------------- + +if (MACHINES["KBDC8042"]~=null) then + files { + MAME_DIR .. "src/emu/machine/8042kbdc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/8530scc.h,MACHINES += 8530SCC +--------------------------------------------------- + +if (MACHINES["8530SCC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/8530scc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/aakart.h,MACHINES += AAKARTDEV +--------------------------------------------------- + +if (MACHINES["AAKARTDEV"]~=null) then + files { + MAME_DIR .. "src/emu/machine/aakart.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/adc0808.h,MACHINES += ADC0808 +--------------------------------------------------- + +if (MACHINES["ADC0808"]~=null) then + files { + MAME_DIR .. "src/emu/machine/adc0808.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/adc083x.h,MACHINES += ADC083X +--------------------------------------------------- + +if (MACHINES["ADC083X"]~=null) then + files { + MAME_DIR .. "src/emu/machine/adc083x.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/adc1038.h,MACHINES += ADC1038 +--------------------------------------------------- + +if (MACHINES["ADC1038"]~=null) then + files { + MAME_DIR .. "src/emu/machine/adc1038.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/adc1213x.h,MACHINES += ADC1213X +--------------------------------------------------- + +if (MACHINES["ADC1213X"]~=null) then + files { + MAME_DIR .. "src/emu/machine/adc1213x.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/aicartc.h,MACHINES += AICARTC +--------------------------------------------------- + +if (MACHINES["AICARTC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/aicartc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/am53cf96.h,MACHINES += AM53CF96 +--------------------------------------------------- + +if (MACHINES["AM53CF96"]~=null) then + files { + MAME_DIR .. "src/emu/machine/am53cf96.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/am9517a.h,MACHINES += AM9517A +--------------------------------------------------- + +if (MACHINES["AM9517A"]~=null) then + files { + MAME_DIR .. "src/emu/machine/am9517a.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/amigafdc.h,MACHINES += AMIGAFDC +--------------------------------------------------- + +if (MACHINES["AMIGAFDC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/amigafdc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/at28c16.h,MACHINES += AT28C16 +--------------------------------------------------- + +if (MACHINES["AT28C16"]~=null) then + files { + MAME_DIR .. "src/emu/machine/at28c16.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/at29040a.h,MACHINES += AT29040 +--------------------------------------------------- + +if (MACHINES["AT29040"]~=null) then + files { + MAME_DIR .. "src/emu/machine/at29040a.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/at45dbxx.h,MACHINES += AT45DBXX +--------------------------------------------------- + +if (MACHINES["AT45DBXX"]~=null) then + files { + MAME_DIR .. "src/emu/machine/at45dbxx.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ataflash.h,MACHINES += ATAFLASH +--------------------------------------------------- + +if (MACHINES["ATAFLASH"]~=null) then + MACHINES["IDE"] = true + MACHINES["PCCARD"] = true + files { + MAME_DIR .. "src/emu/machine/ataflash.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ay31015.h,MACHINES += AY31015 +--------------------------------------------------- + +if (MACHINES["AY31015"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ay31015.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/bankdev.h,MACHINES += BANKDEV +--------------------------------------------------- + +if (MACHINES["BANKDEV"]~=null) then + files { + MAME_DIR .. "src/emu/machine/bankdev.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/cdp1852.h,MACHINES += CDP1852 +--------------------------------------------------- + +if (MACHINES["CDP1852"]~=null) then + files { + MAME_DIR .. "src/emu/machine/cdp1852.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/cdp1871.h,MACHINES += CDP1871 +--------------------------------------------------- + +if (MACHINES["CDP1871"]~=null) then + files { + MAME_DIR .. "src/emu/machine/cdp1871.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/com8116.h,MACHINES += COM8116 +--------------------------------------------------- + +if (MACHINES["COM8116"]~=null) then + files { + MAME_DIR .. "src/emu/machine/com8116.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/cr589.h,MACHINES += CR589 +--------------------------------------------------- + +if (MACHINES["CR589"]~=null) then + files { + MAME_DIR .. "src/emu/machine/cr589.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/cs4031.h,MACHINES += CS4031 +--------------------------------------------------- + +if (MACHINES["CS4031"]~=null) then + files { + MAME_DIR .. "src/emu/machine/cs4031.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/cs8221.h,MACHINES += CS8221 +--------------------------------------------------- + +if (MACHINES["CS8221"]~=null) then + files { + MAME_DIR .. "src/emu/machine/cs8221.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds1204.h,MACHINES += DS1204 +--------------------------------------------------- + +if (MACHINES["DS1204"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds1204.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds1302.h,MACHINES += DS1302 +--------------------------------------------------- + +if (MACHINES["DS1302"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds1302.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds1315.h,MACHINES += DS1315 +--------------------------------------------------- + +if (MACHINES["DS1315"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds1315.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds2401.h,MACHINES += DS2401 +--------------------------------------------------- + +if (MACHINES["DS2401"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds2401.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds2404.h,MACHINES += DS2404 +--------------------------------------------------- + +if (MACHINES["DS2404"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds2404.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds75160a.h,MACHINES += DS75160A +--------------------------------------------------- + +if (MACHINES["DS75160A"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds75160a.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ds75161a.h,MACHINES += DS75161A +--------------------------------------------------- + +if (MACHINES["DS75161A"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ds75161a.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/e0516.h,MACHINES += E0516 +--------------------------------------------------- + +if (MACHINES["E0516"]~=null) then + files { + MAME_DIR .. "src/emu/machine/e0516.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/e05a03.h,MACHINES += E05A03 +--------------------------------------------------- + +if (MACHINES["E05A03"]~=null) then + files { + MAME_DIR .. "src/emu/machine/e05a03.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/e05a30.h,MACHINES += E05A30 +--------------------------------------------------- + +if (MACHINES["E05A30"]~=null) then + files { + MAME_DIR .. "src/emu/machine/e05a30.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/eeprom.h,MACHINES += EEPROMDEV +--@src/emu/machine/eepromser.h,MACHINES += EEPROMDEV +--@src/emu/machine/eeprompar.h,MACHINES += EEPROMDEV +--------------------------------------------------- + +if (MACHINES["EEPROMDEV"]~=null) then + files { + MAME_DIR .. "src/emu/machine/eeprom.c", + MAME_DIR .. "src/emu/machine/eepromser.c", + MAME_DIR .. "src/emu/machine/eeprompar.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/er2055.h,MACHINES += ER2055 +--------------------------------------------------- + +if (MACHINES["ER2055"]~=null) then + files { + MAME_DIR .. "src/emu/machine/er2055.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/f3853.h,MACHINES += F3853 +--------------------------------------------------- + +if (MACHINES["F3853"]~=null) then + files { + MAME_DIR .. "src/emu/machine/f3853.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/hd63450.h,MACHINES += HD63450 +--------------------------------------------------- + +if (MACHINES["HD63450"]~=null) then + files { + MAME_DIR .. "src/emu/machine/hd63450.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/hd64610.h,MACHINES += HD64610 +--------------------------------------------------- + +if (MACHINES["HD64610"]~=null) then + files { + MAME_DIR .. "src/emu/machine/hd64610.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i2cmem.h,MACHINES += I2CMEM +--------------------------------------------------- + +if (MACHINES["I2CMEM"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i2cmem.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8155.h,MACHINES += I8155 +--------------------------------------------------- + +if (MACHINES["I8155"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8155.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8212.h,MACHINES += I8212 +--------------------------------------------------- + +if (MACHINES["I8212"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8212.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8214.h,MACHINES += I8214 +--------------------------------------------------- + +if (MACHINES["I8214"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8214.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8243.h,MACHINES += I8243 +--------------------------------------------------- + +if (MACHINES["I8243"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8243.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8251.h,MACHINES += I8251 +--------------------------------------------------- + +if (MACHINES["I8251"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8251.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8257.h,MACHINES += I8257 +--------------------------------------------------- + +if (MACHINES["I8257"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8257.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/i8271.h,MACHINES += I8271 +--------------------------------------------------- + +if (MACHINES["I8271"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8271.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8279.h,MACHINES += I8279 +--------------------------------------------------- + +if (MACHINES["I8279"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8279.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8355.h,MACHINES += I8355 +--------------------------------------------------- + +if (MACHINES["I8355"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8355.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i80130.h,MACHINES += I80130 +--------------------------------------------------- + +if (MACHINES["I80130"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i80130.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/atadev.h,MACHINES += IDE +--@src/emu/machine/ataintf.h,MACHINES += IDE +--------------------------------------------------- + +if (MACHINES["IDE"]~=null) then + MACHINES["T10"] = true + files { + MAME_DIR .. "src/emu/machine/atadev.c", + MAME_DIR .. "src/emu/machine/atahle.c", + MAME_DIR .. "src/emu/machine/ataintf.c", + MAME_DIR .. "src/emu/machine/atapicdr.c", + MAME_DIR .. "src/emu/machine/atapihle.c", + MAME_DIR .. "src/emu/machine/idectrl.c", + MAME_DIR .. "src/emu/machine/idehd.c", + MAME_DIR .. "src/emu/machine/vt83c461.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/im6402.h,MACHINES += IM6402 +--------------------------------------------------- + +if (MACHINES["IM6402"]~=null) then + files { + MAME_DIR .. "src/emu/machine/im6402.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ins8154.h,MACHINES += INS8154 +--------------------------------------------------- + +if (MACHINES["INS8154"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ins8154.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ins8250.h,MACHINES += INS8250 +--------------------------------------------------- + +if (MACHINES["INS8250"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ins8250.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/intelfsh.h,MACHINES += INTELFLASH +--------------------------------------------------- + +if (MACHINES["INTELFLASH"]~=null) then + files { + MAME_DIR .. "src/emu/machine/intelfsh.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/jvsdev.h,MACHINES += JVS +--@src/emu/machine/jvshost.h,MACHINES += JVS +--------------------------------------------------- + +if (MACHINES["JVS"]~=null) then + files { + MAME_DIR .. "src/emu/machine/jvsdev.c", + MAME_DIR .. "src/emu/machine/jvshost.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/k033906.h,MACHINES += K033906 +--------------------------------------------------- + +if (MACHINES["K033906"]~=null) then + files { + MAME_DIR .. "src/emu/machine/k033906.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/k053252.h,MACHINES += K053252 +--------------------------------------------------- + +if (MACHINES["K053252"]~=null) then + files { + MAME_DIR .. "src/emu/machine/k053252.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/k056230.h,MACHINES += K056230 +--------------------------------------------------- + +if (MACHINES["K056230"]~=null) then + files { + MAME_DIR .. "src/emu/machine/k056230.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/kb3600.h,MACHINES += KB3600 +--------------------------------------------------- + +if (MACHINES["KB3600"]~=null) then + files { + MAME_DIR .. "src/emu/machine/kb3600.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/kr2376.h,MACHINES += KR2376 +--------------------------------------------------- + +if (MACHINES["KR2376"]~=null) then + files { + MAME_DIR .. "src/emu/machine/kr2376.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/latch8.h,MACHINES += LATCH8 +--------------------------------------------------- + +if (MACHINES["LATCH8"]~=null) then + files { + MAME_DIR .. "src/emu/machine/latch8.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/lc89510.h,MACHINES += LC89510 +--------------------------------------------------- + +if (MACHINES["LC89510"]~=null) then + files { + MAME_DIR .. "src/emu/machine/lc89510.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ldpr8210.h,MACHINES += LDPR8210 +--------------------------------------------------- + +if (MACHINES["LDPR8210"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ldpr8210.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ldstub.h,MACHINES += LDSTUB +--------------------------------------------------- + +if (MACHINES["LDSTUB"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ldstub.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ldv1000.h,MACHINES += LDV1000 +--------------------------------------------------- + +if (MACHINES["LDV1000"]~=null) then + MACHINES["Z80CTC"] = true + MACHINES["I8255"] = true + files { + MAME_DIR .. "src/emu/machine/ldv1000.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ldvp931.h,MACHINES += LDVP931 +--------------------------------------------------- + +if (MACHINES["LDVP931"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ldvp931.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/lh5810.h,MACHINES += LH5810 +--------------------------------------------------- + +if (MACHINES["LH5810"]~=null) then + files { + MAME_DIR .. "src/emu/machine/lh5810.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/linflash.h,MACHINES += LINFLASH +--------------------------------------------------- + +if (MACHINES["LINFLASH"]~=null) then + files { + MAME_DIR .. "src/emu/machine/linflash.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/m6m80011ap.h,MACHINES += M6M80011AP +--------------------------------------------------- + +if (MACHINES["M6M80011AP"]~=null) then + files { + MAME_DIR .. "src/emu/machine/m6m80011ap.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/matsucd.h,MACHINES += MATSUCD +--------------------------------------------------- + +if (MACHINES["MATSUCD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/matsucd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb14241.h,MACHINES += MB14241 +--------------------------------------------------- + +if (MACHINES["MB14241"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb14241.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb3773.h,MACHINES += MB3773 +--------------------------------------------------- + +if (MACHINES["MB3773"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb3773.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb8421.h,MACHINES += MB8421 +--------------------------------------------------- + +if (MACHINES["MB8421"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb8421.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb87078.h,MACHINES += MB87078 +--------------------------------------------------- + +if (MACHINES["MB87078"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb87078.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb8795.h,MACHINES += MB8795 +--------------------------------------------------- + +if (MACHINES["MB8795"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb8795.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb89352.h,MACHINES += MB89352 +--------------------------------------------------- + +if (MACHINES["MB89352"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb89352.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mb89371.h,MACHINES += MB89371 +--------------------------------------------------- + +if (MACHINES["MB89371"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mb89371.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc146818.h,MACHINES += MC146818 +--------------------------------------------------- + +if (MACHINES["MC146818"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc146818.c", + MAME_DIR .. "src/emu/machine/ds128x.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc2661.h,MACHINES += MC2661 +--------------------------------------------------- + +if (MACHINES["MC2661"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc2661.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc6843.h,MACHINES += MC6843 +--------------------------------------------------- + +if (MACHINES["MC6843"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc6843.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc6846.h,MACHINES += MC6846 +--------------------------------------------------- + +if (MACHINES["MC6846"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc6846.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc6852.h,MACHINES += MC6852 +--------------------------------------------------- + +if (MACHINES["MC6852"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc6852.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc6854.h,MACHINES += MC6854 +--------------------------------------------------- + +if (MACHINES["MC6854"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc6854.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc68328.h,MACHINES += MC68328 +--------------------------------------------------- + +if (MACHINES["MC68328"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc68328.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mc68901.h,MACHINES += MC68901 +--------------------------------------------------- + +if (MACHINES["MC68901"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mc68901.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mccs1850.h,MACHINES += MCCS1850 +--------------------------------------------------- + +if (MACHINES["MCCS1850"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mccs1850.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/68307.h,MACHINES += M68307 +--------------------------------------------------- + +if (MACHINES["M68307"]~=null) then + files { + MAME_DIR .. "src/emu/machine/68307.c", + MAME_DIR .. "src/emu/machine/68307sim.c", + MAME_DIR .. "src/emu/machine/68307bus.c", + MAME_DIR .. "src/emu/machine/68307tmu.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/68340.h,MACHINES += M68340 +--------------------------------------------------- + +if (MACHINES["M68340"]~=null) then + files { + MAME_DIR .. "src/emu/machine/68340.c", + MAME_DIR .. "src/emu/machine/68340sim.c", + MAME_DIR .. "src/emu/machine/68340dma.c", + MAME_DIR .. "src/emu/machine/68340ser.c", + MAME_DIR .. "src/emu/machine/68340tmu.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mcf5206e.h,MACHINES += MCF5206E +--------------------------------------------------- + +if (MACHINES["MCF5206E"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mcf5206e.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/microtch.h,MACHINES += MICROTOUCH +--------------------------------------------------- + +if (MACHINES["MICROTOUCH"]~=null) then + files { + MAME_DIR .. "src/emu/machine/microtch.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mm58274c.h,MACHINES += MM58274C +--------------------------------------------------- + +if (MACHINES["MM58274C"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mm58274c.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mm74c922.h,MACHINES += MM74C922 +--------------------------------------------------- + +if (MACHINES["MM74C922"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mm74c922.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos6526.h,MACHINES += MOS6526 +--------------------------------------------------- + +if (MACHINES["MOS6526"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos6526.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos6529.h,MACHINES += MOS6529 +--------------------------------------------------- + +if (MACHINES["MOS6529"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos6529.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos6702.h,MACHINES += MOS6702 +--------------------------------------------------- + +if (MACHINES["MOS6702"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos6702.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos8706.h,MACHINES += MOS8706 +--------------------------------------------------- + +if (MACHINES["MOS8706"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos8706.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos8722.h,MACHINES += MOS8722 +--------------------------------------------------- + +if (MACHINES["MOS8722"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos8722.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos8726.h,MACHINES += MOS8726 +--------------------------------------------------- + +if (MACHINES["MOS8726"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos8726.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos6530.h,MACHINES += MIOT6530 +--------------------------------------------------- + +if (MACHINES["MIOT6530"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos6530.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mos6551.h,MACHINES += MOS6551 +--------------------------------------------------- + +if (MACHINES["MOS6551"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mos6551.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/msm5832.h,MACHINES += MSM5832 +--------------------------------------------------- + +if (MACHINES["MSM5832"]~=null) then + files { + MAME_DIR .. "src/emu/machine/msm5832.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/msm58321.h,MACHINES += MSM58321 +--------------------------------------------------- + +if (MACHINES["MSM58321"]~=null) then + files { + MAME_DIR .. "src/emu/machine/msm58321.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/msm6242.h,MACHINES += MSM6242 +--------------------------------------------------- + +if (MACHINES["MSM6242"]~=null) then + files { + MAME_DIR .. "src/emu/machine/msm6242.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ncr539x.h,MACHINES += NCR539x +--------------------------------------------------- + +if (MACHINES["NCR539x"]~=null) then + MACHINES["SCSI"] = true + files { + MAME_DIR .. "src/emu/machine/ncr539x.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/nmc9306.h,MACHINES += NMC9306 +--------------------------------------------------- + +if (MACHINES["NMC9306"]~=null) then + files { + MAME_DIR .. "src/emu/machine/nmc9306.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/nscsi_bus.h,MACHINES += NSCSI +--@src/emu/machine/nscsi_cb.h,MACHINES += NSCSI +--@src/emu/machine/nscsi_cd.h,MACHINES += NSCSI +--@src/emu/machine/nscsi_hd.h,MACHINES += NSCSI +--@src/emu/machine/nscsi_s1410.h,MACHINES += NSCSI +--------------------------------------------------- + +if (MACHINES["NSCSI"]~=null) then + files { + MAME_DIR .. "src/emu/machine/nscsi_bus.c", + MAME_DIR .. "src/emu/machine/nscsi_cb.c", + MAME_DIR .. "src/emu/machine/nscsi_cd.c", + MAME_DIR .. "src/emu/machine/nscsi_hd.c", + MAME_DIR .. "src/emu/machine/nscsi_s1410.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pcf8593.h,MACHINES += PCF8593 +--------------------------------------------------- + +if (MACHINES["PCF8593"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pcf8593.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/lpci.h,MACHINES += LPCI +--------------------------------------------------- + +if (MACHINES["LPCI"]~=null) then + files { + MAME_DIR .. "src/emu/machine/lpci.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pci.h,MACHINES += PCI +--------------------------------------------------- + +if (MACHINES["PCI"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pci.c", + MAME_DIR .. "src/emu/machine/pci-usb.c", + MAME_DIR .. "src/emu/machine/pci-sata.c", + MAME_DIR .. "src/emu/machine/pci-apic.c", + MAME_DIR .. "src/emu/machine/pci-smbus.c", + MAME_DIR .. "src/emu/machine/i82541.c", + MAME_DIR .. "src/emu/machine/i82875p.c", + MAME_DIR .. "src/emu/machine/i6300esb.c", + MAME_DIR .. "src/emu/machine/lpc.c", + MAME_DIR .. "src/emu/machine/lpc-acpi.c", + MAME_DIR .. "src/emu/machine/lpc-rtc.c", + MAME_DIR .. "src/emu/machine/lpc-pit.c", + MAME_DIR .. "src/emu/machine/vrc4373.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pckeybrd.h,MACHINES += PCKEYBRD +--------------------------------------------------- + +if (MACHINES["PCKEYBRD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pckeybrd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pic8259.h,MACHINES += PIC8259 +--------------------------------------------------- + +if (MACHINES["PIC8259"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pic8259.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pit8253.h,MACHINES += PIT8253 +--------------------------------------------------- + +if (MACHINES["PIT8253"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pit8253.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pla.h,MACHINES += PLA +--------------------------------------------------- + +if (MACHINES["PLA"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pla.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/r10696.h,MACHINES += R10696 +--------------------------------------------------- + +if (MACHINES["R10696"]~=null) then + files { + MAME_DIR .. "src/emu/machine/r10696.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/r10788.h,MACHINES += R10788 +--------------------------------------------------- + +if (MACHINES["R10788"]~=null) then + files { + MAME_DIR .. "src/emu/machine/r10788.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ra17xx.h,MACHINES += RA17XX +--------------------------------------------------- + +if (MACHINES["RA17XX"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ra17xx.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rf5c296.h,MACHINES += RF5C296 +--------------------------------------------------- + +if (MACHINES["RF5C296"]~=null) then + MACHINES["PCCARD"] = true + files { + MAME_DIR .. "src/emu/machine/rf5c296.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/roc10937.h,MACHINES += ROC10937 +--------------------------------------------------- + +if (MACHINES["ROC10937"]~=null) then + files { + MAME_DIR .. "src/emu/machine/roc10937.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rp5c01.h,MACHINES += RP5C01 +--------------------------------------------------- + +if (MACHINES["RP5C01"]~=null) then + files { + MAME_DIR .. "src/emu/machine/rp5c01.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rp5c15.h,MACHINES += RP5C15 +--------------------------------------------------- + +if (MACHINES["RP5C15"]~=null) then + files { + MAME_DIR .. "src/emu/machine/rp5c15.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rp5h01.h,MACHINES += RP5H01 +--------------------------------------------------- + +if (MACHINES["RP5H01"]~=null) then + files { + MAME_DIR .. "src/emu/machine/rp5h01.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/64h156.h,MACHINES += R64H156 +--------------------------------------------------- + +if (MACHINES["R64H156"]~=null) then + files { + MAME_DIR .. "src/emu/machine/64h156.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rtc4543.h,MACHINES += RTC4543 +--------------------------------------------------- + +if (MACHINES["RTC4543"]~=null) then + files { + MAME_DIR .. "src/emu/machine/rtc4543.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rtc65271.h,MACHINES += RTC65271 +--------------------------------------------------- + +if (MACHINES["RTC65271"]~=null) then + files { + MAME_DIR .. "src/emu/machine/rtc65271.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/rtc9701.h,MACHINES += RTC9701 +--------------------------------------------------- + +if (MACHINES["RTC9701"]~=null) then + files { + MAME_DIR .. "src/emu/machine/rtc9701.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/s2636.h,MACHINES += S2636 +--------------------------------------------------- + +if (MACHINES["S2636"]~=null) then + files { + MAME_DIR .. "src/emu/machine/s2636.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/s3520cf.h,MACHINES += S3520CF +--------------------------------------------------- + +if (MACHINES["S3520CF"]~=null) then + files { + MAME_DIR .. "src/emu/machine/s3520cf.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/s3c2400.h,MACHINES += S3C2400 +--------------------------------------------------- + +if (MACHINES["S3C2400"]~=null) then + files { + MAME_DIR .. "src/emu/machine/s3c2400.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/s3c2410.h,MACHINES += S3C2410 +--------------------------------------------------- + +if (MACHINES["S3C2410"]~=null) then + files { + MAME_DIR .. "src/emu/machine/s3c2410.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/s3c44b0.h,MACHINES += S3C44B0 +--------------------------------------------------- + +if (MACHINES["S3C44B0"]~=null) then + files { + MAME_DIR .. "src/emu/machine/s3c44b0.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/s3c2440.h,MACHINES += S3C2440 +--------------------------------------------------- + +if (MACHINES["S3C2440"]~=null) then + files { + MAME_DIR .. "src/emu/machine/s3c2440.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/saturn.h,MACHINES += SATURN +--------------------------------------------------- + +if (MACHINES["SATURN"]~=null) then + files { + MAME_DIR .. "src/emu/machine/saturn.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/serflash.h,MACHINES += SERFLASH +--------------------------------------------------- + +if (MACHINES["SERFLASH"]~=null) then + files { + MAME_DIR .. "src/emu/machine/serflash.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/smc91c9x.h,MACHINES += SMC91C9X +--------------------------------------------------- + +if (MACHINES["SMC91C9X"]~=null) then + files { + MAME_DIR .. "src/emu/machine/smc91c9x.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/smpc.h,MACHINES += SMPC +--------------------------------------------------- + +if (MACHINES["SMPC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/smpc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/stvcd.h,MACHINES += STVCD +--------------------------------------------------- + +if (MACHINES["STVCD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/stvcd.c", + } +end + +--------------------------------------------------- +-- +-- +--------------------------------------------------- + +if (BUSES["SCSI"]~=null) then + MACHINES["T10"] = true +end + +if (MACHINES["T10"]~=null) then + files { + MAME_DIR .. "src/emu/machine/t10mmc.c", + MAME_DIR .. "src/emu/machine/t10sbc.c", + MAME_DIR .. "src/emu/machine/t10spc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/tc009xlvc.h,MACHINES += TC0091LVC +--------------------------------------------------- + +if (MACHINES["TC0091LVC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/tc009xlvc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/timekpr.h,MACHINES += TIMEKPR +--------------------------------------------------- + +if (MACHINES["TIMEKPR"]~=null) then + files { + MAME_DIR .. "src/emu/machine/timekpr.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/tmp68301.h,MACHINES += TMP68301 +--------------------------------------------------- + +if (MACHINES["TMP68301"]~=null) then + files { + MAME_DIR .. "src/emu/machine/tmp68301.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/tms5501.h,MACHINES += TMS5501 +--------------------------------------------------- + +if (MACHINES["TMS5501"]~=null) then + files { + MAME_DIR .. "src/emu/machine/tms5501.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/tms6100.h,MACHINES += TMS6100 +--------------------------------------------------- + +if (MACHINES["TMS6100"]~=null) then + files { + MAME_DIR .. "src/emu/machine/tms6100.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/tms9901.h,MACHINES += TMS9901 +--------------------------------------------------- + +if (MACHINES["TMS9901"]~=null) then + files { + MAME_DIR .. "src/emu/machine/tms9901.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/tms9902.h,MACHINES += TMS9902 +--------------------------------------------------- + +if (MACHINES["TMS9902"]~=null) then + files { + MAME_DIR .. "src/emu/machine/tms9902.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/upd1990a.h,MACHINES += UPD1990A +--------------------------------------------------- + +if (MACHINES["UPD1990A"]~=null) then + files { + MAME_DIR .. "src/emu/machine/upd1990a.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/upd4992.h,MACHINES += UPD4992 +--------------------------------------------------- + +if (MACHINES["UPD4992"]~=null) then + files { + MAME_DIR .. "src/emu/machine/upd4992.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/upd4701.h,MACHINES += UPD4701 +--------------------------------------------------- + +if (MACHINES["UPD4701"]~=null) then + files { + MAME_DIR .. "src/emu/machine/upd4701.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/upd7002.h,MACHINES += UPD7002 +--------------------------------------------------- + +if (MACHINES["UPD7002"]~=null) then + files { + MAME_DIR .. "src/emu/machine/upd7002.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/upd71071.h,MACHINES += UPD71071 +--------------------------------------------------- + +if (MACHINES["UPD71071"]~=null) then + files { + MAME_DIR .. "src/emu/machine/upd71071.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/upd765.h,MACHINES += UPD765 +--------------------------------------------------- + +if (MACHINES["UPD765"]~=null) then + files { + MAME_DIR .. "src/emu/machine/upd765.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/v3021.h,MACHINES += V3021 +--------------------------------------------------- + +if (MACHINES["V3021"]~=null) then + files { + MAME_DIR .. "src/emu/machine/v3021.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wd_fdc.h,MACHINES += WD_FDC +--------------------------------------------------- + +if (MACHINES["WD_FDC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/wd_fdc.c", + MAME_DIR .. "src/emu/machine/fdc_pll.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wd11c00_17.h,MACHINES += WD11C00_17 +--------------------------------------------------- + +if (MACHINES["WD11C00_17"]~=null) then + files { + MAME_DIR .. "src/emu/machine/wd11c00_17.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wd17xx.h,MACHINES += WD17XX +--------------------------------------------------- + +if (MACHINES["WD17XX"]~=null) then + files { + MAME_DIR .. "src/emu/machine/wd17xx.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wd2010.h,MACHINES += WD2010 +--------------------------------------------------- + +if (MACHINES["WD2010"]~=null) then + files { + MAME_DIR .. "src/emu/machine/wd2010.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wd33c93.h,MACHINES += WD33C93 +--------------------------------------------------- + +if (MACHINES["WD33C93"]~=null) then + MACHINES["SCSI"] = true + files { + MAME_DIR .. "src/emu/machine/wd33c93.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wd7600.h,MACHINES += WD7600 +--------------------------------------------------- + +if (MACHINES["WD7600"]~=null) then + files { + MAME_DIR .. "src/emu/machine/wd7600.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/x2212.h,MACHINES += X2212 +--------------------------------------------------- + +if (MACHINES["X2212"]~=null) then + files { + MAME_DIR .. "src/emu/machine/x2212.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/x76f041.h,MACHINES += X76F041 +--------------------------------------------------- + +if (MACHINES["X76F041"]~=null) then + files { + MAME_DIR .. "src/emu/machine/x76f041.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/x76f100.h,MACHINES += X76F100 +--------------------------------------------------- + +if (MACHINES["X76F100"]~=null) then + files { + MAME_DIR .. "src/emu/machine/x76f100.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ym2148.h,MACHINES += YM2148 +--------------------------------------------------- + +if (MACHINES["YM2148"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ym2148.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/z80ctc.h,MACHINES += Z80CTC +--------------------------------------------------- + +if (MACHINES["Z80CTC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/z80ctc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/z80dart.h,MACHINES += Z80DART +--------------------------------------------------- + +if (MACHINES["Z80DART"]~=null) then + files { + MAME_DIR .. "src/emu/machine/z80dart.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/z80dma.h,MACHINES += Z80DMA +--------------------------------------------------- + +if (MACHINES["Z80DMA"]~=null) then + files { + MAME_DIR .. "src/emu/machine/z80dma.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/z80pio.h,MACHINES += Z80PIO +--------------------------------------------------- + +if (MACHINES["Z80PIO"]~=null) then + files { + MAME_DIR .. "src/emu/machine/z80pio.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/z80sti.h,MACHINES += Z80STI +--------------------------------------------------- + +if (MACHINES["Z80STI"]~=null) then + files { + MAME_DIR .. "src/emu/machine/z80sti.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/z8536.h,MACHINES += Z8536 +--------------------------------------------------- + +if (MACHINES["Z8536"]~=null) then + files { + MAME_DIR .. "src/emu/machine/z8536.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pccard.h,MACHINES += PCCARD +--------------------------------------------------- + +if (MACHINES["PCCARD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pccard.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/i8255.h,MACHINES += I8255 +--------------------------------------------------- + +if (MACHINES["I8255"]~=null) then + files { + MAME_DIR .. "src/emu/machine/i8255.c", + MAME_DIR .. "src/emu/machine/mb89363b.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ncr5380.h,MACHINES += NCR5380 +--------------------------------------------------- + +if (MACHINES["NCR5380"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ncr5380.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ncr5380n.h,MACHINES += NCR5380N +--------------------------------------------------- + +if (MACHINES["NCR5380N"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ncr5380n.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ncr5389.h,MACHINES += NCR5390 +--------------------------------------------------- + +if (MACHINES["NCR5390"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ncr5390.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mm58167.h,MACHINES += MM58167 +--------------------------------------------------- + +if (MACHINES["MM58167"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mm58167.c", + } +end + + +--------------------------------------------------- +-- +--@src/emu/machine/dp8390.h,MACHINES += DP8390 +--------------------------------------------------- + +if (MACHINES["DP8390"]~=null) then + files { + MAME_DIR .. "src/emu/machine/dp8390.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pc_lpt.h,MACHINES += PC_LPT +--------------------------------------------------- + +if (MACHINES["PC_LPT"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pc_lpt.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/pc_fdc.h,MACHINES += PC_FDC +--------------------------------------------------- + +if (MACHINES["PC_FDC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/pc_fdc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/mpu401.h,MACHINES += MPU401 +--------------------------------------------------- + +if (MACHINES["MPU401"]~=null) then + files { + MAME_DIR .. "src/emu/machine/mpu401.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/at_keybc.h,MACHINES += AT_KEYBC +--------------------------------------------------- + +if (MACHINES["AT_KEYBC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/at_keybc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/smc92x4.h,MACHINES += SMC92X4 +--------------------------------------------------- + +if (MACHINES["SMC92X4"]~=null) then + files { + MAME_DIR .. "src/emu/machine/smc92x4.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/hdc9234.h,MACHINES += HDC9234 +--------------------------------------------------- + +if (MACHINES["HDC9234"]~=null) then + files { + MAME_DIR .. "src/emu/machine/hdc9234.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/ti99_hd.h,MACHINES += TI99_HD +--------------------------------------------------- + +if (MACHINES["TI99_HD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/ti99_hd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/strata.h,MACHINES += STRATA +--------------------------------------------------- + +if (MACHINES["STRATA"]~=null) then + files { + MAME_DIR .. "src/emu/machine/strata.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/steppers.h,MACHINES += STEPPERS +--------------------------------------------------- + +if (MACHINES["STEPPERS"]~=null) then + files { + MAME_DIR .. "src/emu/machine/steppers.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/corvushd.h,MACHINES += CORVUSHD +--------------------------------------------------- +if (MACHINES["CORVUSHD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/corvushd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/wozfdc.h,MACHINES += WOZFDC +--------------------------------------------------- +if (MACHINES["WOZFDC"]~=null) then + files { + MAME_DIR .. "src/emu/machine/wozfdc.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/diablo_hd.h,MACHINES += DIABLO_HD +--------------------------------------------------- +if (MACHINES["DIABLO_HD"]~=null) then + files { + MAME_DIR .. "src/emu/machine/diablo_hd.c", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/fdc37c665gt.h,MACHINES += FDC37C665GT +--------------------------------------------------- + +if (MACHINES["FDC37C665GT"]~=null) then + files { + MAME_DIR .. "src/emu/machine/fdc37c665gt.c", + } +end diff --git a/scripts/src/main.lua b/scripts/src/main.lua new file mode 100644 index 00000000000..08b5112ad73 --- /dev/null +++ b/scripts/src/main.lua @@ -0,0 +1,95 @@ +function mainProject(_target, _subtarget) + if (_target == _subtarget) then + project (_target) + else + project (_target .. _subtarget) + end + uuid (os.uuid(_target .."_" .. _subtarget)) + kind "ConsoleApp" + + options { + "ForceCPP", + } + flags { + "NoManifest", + } + + if _OPTIONS["SYMBOLS"] then + configuration { "mingw*" } + postbuildcommands { + "$(SILENT) echo Dumping symbols.", + "$(SILENT) objdump --section=.text --line-numbers --syms --demangle $(TARGET) >$(subst .exe,.sym,$(TARGET))" + } + end + + configuration { "mingw*" or "vs*" } + targetextension ".exe" + + configuration { "asmjs" } + targetextension ".bc" + + configuration { } + targetdir(MAME_DIR) + + findfunction("linkProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"]) + links { + "osd_" .. _OPTIONS["osd"], + "bus", + "optional", + "emu", + "dasm", + "utils", + "expat", + "softfloat", + "jpeg", + "flac", + "7z", + "formats", + "lua", + "lsqlite3", + "sqllite3", + "zlib", + "jsoncpp", + "mongoose", + "portmidi", + } + if (USE_BGFX == 1) then + links { + "bgfx" + } + end + links{ + "ocore_" .. _OPTIONS["osd"], + } + maintargetosdoptions(_target) + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/" .. _target, + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. _target .. "/layout", + GEN_DIR .. "resource", + } + + includeosd() + + if _OPTIONS["targetos"]=="macosx" then + linkoptions { + "-sectcreate __TEXT __info_plist " .. GEN_DIR .. "/resource/" .. _OPTIONS["target"] .. "-Info.plist" + } + end + + if _OPTIONS["targetos"]=="windows" then + end + + files { + MAME_DIR .. "src/".._target .."/" .. _target ..".c", + MAME_DIR .. "src/version.c", + GEN_DIR .. _target .. "/" .. _subtarget .."/drivlist.c", + } + debugdir (MAME_DIR) + debugargs ("-window") +end diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua new file mode 100644 index 00000000000..9c0dfd51509 --- /dev/null +++ b/scripts/src/netlist.lua @@ -0,0 +1,46 @@ +files { + MAME_DIR .. "src/emu/netlist/nl_base.c", + MAME_DIR .. "src/emu/netlist/nl_parser.c", + MAME_DIR .. "src/emu/netlist/nl_setup.c", + MAME_DIR .. "src/emu/netlist/nl_factory.c", + MAME_DIR .. "src/emu/netlist/pstring.c", + MAME_DIR .. "src/emu/netlist/pstate.c", + MAME_DIR .. "src/emu/netlist/analog/nld_bjt.c", + MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.c", + MAME_DIR .. "src/emu/netlist/analog/nld_solver.c", + MAME_DIR .. "src/emu/netlist/analog/nld_switches.c", + MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.c", + MAME_DIR .. "src/emu/netlist/analog/nld_opamps.c", + MAME_DIR .. "src/emu/netlist/devices/nld_4020.c", + MAME_DIR .. "src/emu/netlist/devices/nld_4066.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7400.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7402.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7404.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7408.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7410.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7411.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7420.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7425.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7427.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7430.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7432.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7437.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7448.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7450.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7474.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7483.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7486.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7490.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7493.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74107.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74123.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74153.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.c", + MAME_DIR .. "src/emu/netlist/devices/nld_9316.c", + MAME_DIR .. "src/emu/netlist/devices/nld_ne555.c", + MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.c", + MAME_DIR .. "src/emu/netlist/devices/nld_legacy.c", + MAME_DIR .. "src/emu/netlist/devices/net_lib.c", + MAME_DIR .. "src/emu/netlist/devices/nld_log.c", + MAME_DIR .. "src/emu/netlist/devices/nld_system.c", +}
\ No newline at end of file diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua new file mode 100644 index 00000000000..fafed82090f --- /dev/null +++ b/scripts/src/osd/modules.lua @@ -0,0 +1,258 @@ +function osdmodulesbuild() + + removeflags { + "SingleOutputDir", + } + + options { + "ForceCPP", + } + + files { + MAME_DIR .. "src/osd/osdnet.c", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.c", + MAME_DIR .. "src/osd/modules/debugger/none.c", + MAME_DIR .. "src/osd/modules/debugger/debugint.c", + MAME_DIR .. "src/osd/modules/debugger/debugwin.c", + MAME_DIR .. "src/osd/modules/debugger/debugqt.c", + MAME_DIR .. "src/osd/modules/font/font_sdl.c", + MAME_DIR .. "src/osd/modules/font/font_windows.c", + MAME_DIR .. "src/osd/modules/font/font_osx.c", + MAME_DIR .. "src/osd/modules/font/font_none.c", + MAME_DIR .. "src/osd/modules/netdev/taptun.c", + MAME_DIR .. "src/osd/modules/netdev/pcap.c", + MAME_DIR .. "src/osd/modules/netdev/none.c", + MAME_DIR .. "src/osd/modules/midi/portmidi.c", + MAME_DIR .. "src/osd/modules/midi/none.c", + MAME_DIR .. "src/osd/modules/sound/js_sound.c", + MAME_DIR .. "src/osd/modules/sound/direct_sound.c", + MAME_DIR .. "src/osd/modules/sound/sdl_sound.c", + MAME_DIR .. "src/osd/modules/sound/none.c", + } + + if _OPTIONS["targetos"]=="windows" then + includedirs { + MAME_DIR .. "3rdparty/winpcap/Include", + } + end + + if _OPTIONS["NO_OPENGL"]=="1" then + defines { + "USE_OPENGL=0", + } + else + files { + MAME_DIR .. "src/osd/modules/render/drawogl.c", + MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.c", + MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.c", + } + defines { + "USE_OPENGL=1", + } + if _OPTIONS["USE_DISPATCH_GL"]=="1" then + defines { + "USE_DISPATCH_GL=1", + } + end + end + + if USE_BGFX == 1 then + files { + MAME_DIR .. "src/osd/modules/render/drawbgfx.c", + } + defines { + "USE_BGFX" + } + includedirs { + MAME_DIR .. "3rdparty/bgfx/include", + MAME_DIR .. "3rdparty/bx/include", + } + end + + if _OPTIONS["NO_USE_MIDI"]=="1" then + defines { + "NO_USE_MIDI", + } + end + + if _OPTIONS["USE_QTDEBUG"]=="1" then + files { + MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.c", + MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.c", + MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.c", + MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.c", + MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.c", + MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.c", + MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.c", + MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.c", + MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.c", + GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/logwindow.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/dasmwindow.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/mainwindow.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/memorywindow.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.c", + GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.c", + } + defines { + "USE_QTDEBUG=1", + } + if _OPTIONS["targetos"]=="windows" then + configuration { "mingw*" } + buildoptions { + "-I$(shell qmake -query QT_INSTALL_HEADERS)", + } + configuration { } + elseif _OPTIONS["targetos"]=="macosx" then + buildoptions { + "-F" .. string.gsub(os.outputof("qmake -query QT_INSTALL_LIBS"), '[\r\n]+', ''), + } + else + buildoptions { + string.gsub(os.outputof("pkg-config --cflags Qt"), '[\r\n]+', ' '), + } + end + else + defines { + "USE_QTDEBUG=0", + } + end + +end + + +function osdmodulestargetconf() + + if _OPTIONS["NO_OPENGL"]~="1" then + if _OPTIONS["targetos"]=="macosx" then + links { + "OpenGL.framework", + } + elseif _OPTIONS["USE_DISPATCH_GL"]~="1" then + if _OPTIONS["targetos"]=="windows" then + links { + "opengl32", + } + else + links { + "GL", + } + end + end + end + + if _OPTIONS["NO_USE_MIDI"]~="1" then + if _OPTIONS["targetos"]=="linux" then + linkoptions { + string.gsub(os.outputof("pkg-config --libs alsa"), '[\r\n]+', ' '), + } + elseif _OPTIONS["targetos"]=="macosx" then + links { + "CoreAudio.framework", + "CoreMIDI.framework", + } + end + end + + if _OPTIONS["USE_QTDEBUG"]=="1" then + if _OPTIONS["targetos"]=="windows" then + linkoptions { + "-L$(shell qmake -query QT_INSTALL_LIBS)", + } + links { + "qtmain", + "QtGui4", + "QtCore4", + } + elseif _OPTIONS["targetos"]=="macosx" then + linkoptions { + "-F" .. string.gsub(os.outputof("qmake -query QT_INSTALL_LIBS"), '[\r\n]+', ''), + } + links { + "QtCore.framework", + "QtGui.framework", + } + else + linkoptions { + string.gsub(os.outputof("pkg-config --libs QtGui"), '[\r\n]+', ' '), + } + end + end + +end + + +newoption { + trigger = "DONT_USE_NETWORK", + description = "Disable network access", +} + +newoption { + trigger = "NO_OPENGL", + description = "Disable use of OpenGL", + allowed = { + { "0", "Enable OpenGL" }, + { "1", "Disable OpenGL" }, + }, +} + +if not _OPTIONS["NO_OPENGL"] then + if _OPTIONS["targetos"]=="os2" then + _OPTIONS["NO_OPENGL"] = "1" + else + _OPTIONS["NO_OPENGL"] = "0" + end +end + +newoption { + trigger = "USE_DISPATCH_GL", + description = "Use GL-dispatching", + allowed = { + { "0", "Link to OpenGL library" }, + { "1", "Use GL-dispatching" }, + }, +} + +if not _OPTIONS["USE_DISPATCH_GL"] then + if USE_BGFX == 1 then + _OPTIONS["USE_DISPATCH_GL"] = "0" + else + _OPTIONS["USE_DISPATCH_GL"] = "1" + end +end + +newoption { + trigger = "NO_USE_MIDI", + description = "Disable MIDI I/O", + allowed = { + { "0", "Enable MIDI" }, + { "1", "Disable MIDI" }, + }, +} + +if not _OPTIONS["NO_USE_MIDI"] then + if _OPTIONS["targetos"]=="freebsd" or _OPTIONS["targetos"]=="openbsd" or _OPTIONS["targetos"]=="netbsd" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "emscripten" or _OPTIONS["targetos"] == "os2" then + _OPTIONS["NO_USE_MIDI"] = "1" + else + _OPTIONS["NO_USE_MIDI"] = "0" + end +end + +newoption { + trigger = "USE_QTDEBUG", + description = "Use QT debugger", + allowed = { + { "0", "Don't use Qt debugger" }, + { "1", "Use Qt debugger" }, + }, +} + +if not _OPTIONS["USE_QTDEBUG"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "emscripten" or _OPTIONS["targetos"] == "os2" then + _OPTIONS["USE_QTDEBUG"] = "0" + else + _OPTIONS["USE_QTDEBUG"] = "1" + end +end diff --git a/scripts/src/osd/osdmini.lua b/scripts/src/osd/osdmini.lua new file mode 100644 index 00000000000..359308d19a9 --- /dev/null +++ b/scripts/src/osd/osdmini.lua @@ -0,0 +1,99 @@ +function maintargetosdoptions(_target) +end + + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind "StaticLib" + + removeflags { + "SingleOutputDir", + } + + options { + "ForceCPP", + } + + dofile("osdmini_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/sdl", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/winpcap/Include", + MAME_DIR .. "3rdparty/bgfx/include", + MAME_DIR .. "3rdparty/bx/include", + } + + files { + MAME_DIR .. "src/osd/osdnet.c", + MAME_DIR .. "src/osd/osdmini/minimain.c", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.c", + MAME_DIR .. "src/osd/modules/font/font_sdl.c", + MAME_DIR .. "src/osd/modules/font/font_windows.c", + MAME_DIR .. "src/osd/modules/font/font_osx.c", + MAME_DIR .. "src/osd/modules/font/font_none.c", + MAME_DIR .. "src/osd/modules/netdev/taptun.c", + MAME_DIR .. "src/osd/modules/netdev/pcap.c", + MAME_DIR .. "src/osd/modules/netdev/none.c", + MAME_DIR .. "src/osd/modules/midi/portmidi.c", + MAME_DIR .. "src/osd/modules/midi/none.c", + MAME_DIR .. "src/osd/modules/sound/js_sound.c", + MAME_DIR .. "src/osd/modules/sound/direct_sound.c", + MAME_DIR .. "src/osd/modules/sound/sdl_sound.c", + MAME_DIR .. "src/osd/modules/sound/none.c", + } + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind "StaticLib" + + options { + "ForceCPP", + } + + removeflags { + "SingleOutputDir", + } + + dofile("osdmini_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + if _OPTIONS["targetos"]=="linux" then + BASE_TARGETOS = "unix" + SDLOS_TARGETOS = "unix" + SYNC_IMPLEMENTATION = "tc" + end + + if _OPTIONS["targetos"]=="windows" then + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SYNC_IMPLEMENTATION = "windows" + end + + if _OPTIONS["targetos"]=="macosx" then + BASE_TARGETOS = "unix" + SDLOS_TARGETOS = "macosx" + SYNC_IMPLEMENTATION = "ntc" + end + + files { + MAME_DIR .. "src/osd/osdcore.c", + MAME_DIR .. "src/osd/modules/osdmodule.c", + MAME_DIR .. "src/osd/osdmini/minidir.c", + MAME_DIR .. "src/osd/osdmini/minifile.c", + MAME_DIR .. "src/osd/osdmini/minimisc.c", + MAME_DIR .. "src/osd/osdmini/minisync.c", + MAME_DIR .. "src/osd/osdmini/minitime.c", + MAME_DIR .. "src/osd/modules/sync/work_mini.c", + } diff --git a/scripts/src/osd/osdmini_cfg.lua b/scripts/src/osd/osdmini_cfg.lua new file mode 100644 index 00000000000..7b63824a3f3 --- /dev/null +++ b/scripts/src/osd/osdmini_cfg.lua @@ -0,0 +1,7 @@ +defines { + "OSD_MINI", + "USE_QTDEBUG", + "USE_SDL", + "SDLMAME_NOASM=1", + "USE_OPENGL=0", +} diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua new file mode 100644 index 00000000000..24c08f4de5a --- /dev/null +++ b/scripts/src/osd/sdl.lua @@ -0,0 +1,453 @@ +dofile("modules.lua") + + +function maintargetosdoptions(_target) + osdmodulestargetconf() + + if _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then + libdirs { + path.join(_OPTIONS["MESA_INSTALL_ROOT"],"lib"), + } + linkoptions { + "-Wl,-rpath=" .. path.join(_OPTIONS["MESA_INSTALL_ROOT"],"lib"), + } + end + + if _OPTIONS["NO_X11"]~="1" then + links { + "X11", + "Xinerama", + } + end + + if _OPTIONS["NO_USE_XINPUT"]~="1" then + links { + "Xext", + "Xi", + } + end + + if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" then + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2_ttf", + } + else + links { + "SDL_ttf", + } + end + linkoptions { + string.gsub(os.outputof("pkg-config --libs fontconfig"), '[\r\n]+', ' '), + } + end + + if _OPTIONS["targetos"]=="windows" then + configuration { "mingw*" } + linkoptions{ + "-municode", + } + configuration { "vs*" } + flags { + "Unicode", + } + configuration { "x32", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x86") + } + configuration { "x64", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") + } + configuration { "vs*" } + links { + "SDL2", + } + configuration {} + elseif _OPTIONS["targetos"]=="haiku" then + links { + "network", + "bsd", + } + end + + configuration { "mingw*" or "vs*" } + targetprefix "sdl" + + configuration { } +end + + +function sdlconfigcmd() + if not _OPTIONS["SDL_INSTALL_ROOT"] then + return _OPTIONS["SDL_LIBVER"] .. "-config" + else + return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin",_OPTIONS["SDL_LIBVER"]) .. "-config" + end +end + + +newoption { + trigger = "MESA_INSTALL_ROOT", + description = "link against specific GL-Library - also adds rpath to executable (overridden by USE_DISPATCH_GL)", +} + +newoption { + trigger = "NO_X11", + description = "Disable use of X11", + allowed = { + { "0", "Enable X11" }, + { "1", "Disable X11" }, + }, +} + +if not _OPTIONS["NO_X11"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="emscripten" or _OPTIONS["targetos"]=="os2" then + _OPTIONS["NO_X11"] = "1" + else + _OPTIONS["NO_X11"] = "0" + end +end + +newoption { + trigger = "NO_USE_XINPUT", + description = "Disable use of Xinput", + allowed = { + { "0", "Enable Xinput" }, + { "1", "Disable Xinput" }, + }, +} + +if not _OPTIONS["NO_USE_XINPUT"] then + _OPTIONS["NO_USE_XINPUT"] = "1" +end + +newoption { + trigger = "SDL_LIBVER", + description = "Choose SDL version", + allowed = { + { "sdl", "SDL" }, + { "sdl2", "SDL 2" }, + }, +} + +if not _OPTIONS["SDL_LIBVER"] then + if _OPTIONS["targetos"]=="os2" then + _OPTIONS["SDL_LIBVER"] = "sdl" + else + _OPTIONS["SDL_LIBVER"] = "sdl2" + end +end + +newoption { + trigger = "SDL2_MULTIAPI", + description = "Use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release)", + allowed = { + { "0", "Use single-keyboard API" }, + { "1", "Use multi-keyboard API" }, + }, +} + +if not _OPTIONS["SDL2_MULTIAPI"] then + _OPTIONS["SDL2_MULTIAPI"] = "0" +end + +newoption { + trigger = "SDL_INSTALL_ROOT", + description = "Equivalent to the ./configure --prefix=<path>", +} + +newoption { + trigger = "SDL_FRAMEWORK_PATH", + description = "Location of SDL framework for custom OS X installations", +} + +if not _OPTIONS["SDL_FRAMEWORK_PATH"] then + _OPTIONS["SDL_FRAMEWORK_PATH"] = "/Library/Frameworks/" +end + +newoption { + trigger = "MACOSX_USE_LIBSDL", + description = "Use SDL library on OS (rather than framework)", + allowed = { + { "0", "Use framework" }, + { "1", "Use library" }, + }, +} + +if not _OPTIONS["MACOSX_USE_LIBSDL"] then + _OPTIONS["MACOSX_USE_LIBSDL"] = "0" +end + + +BASE_TARGETOS = "unix" +SDLOS_TARGETOS = "unix" +SYNC_IMPLEMENTATION = "tc" +SDL_NETWORK = "" +if _OPTIONS["targetos"]=="linux" then + SDL_NETWORK = "taptun" +elseif _OPTIONS["targetos"]=="openbsd" then + SYNC_IMPLEMENTATION = "ntc" +elseif _OPTIONS["targetos"]=="netbsd" then + SYNC_IMPLEMENTATION = "ntc" + SDL_NETWORK = "pcap" +elseif _OPTIONS["targetos"]=="haiku" then + SYNC_IMPLEMENTATION = "ntc" +elseif _OPTIONS["targetos"]=="emscripten" then + SYNC_IMPLEMENTATION = "mini" +elseif _OPTIONS["targetos"]=="windows" then + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SYNC_IMPLEMENTATION = "windows" + SDL_NETWORK = "pcap" +elseif _OPTIONS["targetos"]=="macosx" then + SDLOS_TARGETOS = "macosx" + SYNC_IMPLEMENTATION = "ntc" + SDL_NETWORK = "pcap" +elseif _OPTIONS["targetos"]=="os2" then + BASE_TARGETOS = "os2" + SDLOS_TARGETOS = "os2" + SYNC_IMPLEMENTATION = "os2" +end + +if BASE_TARGETOS=="unix" then + if _OPTIONS["targetos"]=="macosx" then + links { + "Cocoa.framework", + } + if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then + linkoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2.framework", + } + else + links { + "SDL.framework", + } + end + else + linkoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'"), '[\r\n]+', ' '), + } + end + else + if _OPTIONS["NO_X11"]=="1" then + _OPTIONS["USE_QTDEBUG"] = "0" + USE_BGFX = 0 + else + libdirs { + "/usr/X11/lib", + "/usr/X11R6/lib", + "/usr/openwin/lib", + } + if _OPTIONS["SDL_LIBVER"]=="sdl" then + links { + "X11", + } + end + end + linkoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --libs"), '[\r\n]+', ' '), + } + if _OPTIONS["targetos"]~="haiku" then + links { + "m", + "pthread", + } + if _OPTIONS["targetos"]=="solaris" then + links { + "socket", + "nsl", + } + else + links { + "util", + } + end + end + end +elseif BASE_TARGETOS=="os2" then + linkoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --libs"), '[\r\n]+', ' '), + } + links { + "pthread" + } +end + +configuration { "mingw*" } + linkoptions { + "-static" + } + +configuration { } + + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind "StaticLib" + + dofile("sdl_cfg.lua") + osdmodulesbuild() + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/osd/sdl", + } + + if _OPTIONS["targetos"]=="windows" then + files { + MAME_DIR .. "src/osd/sdl/main.c", + } + end + + if _OPTIONS["targetos"]=="macosx" then + files { + MAME_DIR .. "src/osd/modules/debugger/debugosx.m", + MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/debugcommandhistory.m", + MAME_DIR .. "src/osd/modules/debugger/osx/debugconsole.m", + MAME_DIR .. "src/osd/modules/debugger/osx/debugview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/debugwindowhandler.m", + MAME_DIR .. "src/osd/modules/debugger/osx/deviceinfoviewer.m", + MAME_DIR .. "src/osd/modules/debugger/osx/devicesviewer.m", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyviewer.m", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogviewer.m", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryviewer.m", + MAME_DIR .. "src/osd/modules/debugger/osx/pointsviewer.m", + MAME_DIR .. "src/osd/modules/debugger/osx/registersview.m", + MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.m", + } + if _OPTIONS["SDL_LIBVER"]=="sdl" then + -- SDLMain_tmpl isn't necessary for SDL2 + files { + MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m", + } + end + end + + files { + MAME_DIR .. "src/osd/sdl/sdlmain.c", + MAME_DIR .. "src/osd/sdl/input.c", + MAME_DIR .. "src/osd/sdl/video.c", + MAME_DIR .. "src/osd/sdl/window.c", + MAME_DIR .. "src/osd/sdl/output.c", + MAME_DIR .. "src/osd/sdl/watchdog.c", + MAME_DIR .. "src/osd/modules/render/drawsdl.c", + } + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + files { + MAME_DIR .. "src/osd/modules/render/draw13.c", + } + end + + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind "StaticLib" + + options { + "ForceCPP", + } + + removeflags { + "SingleOutputDir", + } + + dofile("sdl_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/sdl", + } + + files { + MAME_DIR .. "src/osd/osdcore.c", + MAME_DIR .. "src/osd/strconv.c", + MAME_DIR .. "src/osd/sdl/sdldir.c", + MAME_DIR .. "src/osd/sdl/sdlfile.c", + MAME_DIR .. "src/osd/sdl/sdlptty_" .. BASE_TARGETOS ..".c", + MAME_DIR .. "src/osd/sdl/sdlsocket.c", + MAME_DIR .. "src/osd/sdl/sdlos_" .. SDLOS_TARGETOS .. ".c", + MAME_DIR .. "src/osd/modules/osdmodule.c", + MAME_DIR .. "src/osd/modules/lib/osdlib_" .. SDLOS_TARGETOS .. ".c", + MAME_DIR .. "src/osd/modules/sync/sync_" .. SYNC_IMPLEMENTATION .. ".c", + } + + if _OPTIONS["NOASM"]=="1" then + files { + MAME_DIR .. "src/osd/modules/sync/work_mini.c", + } + else + files { + MAME_DIR .. "src/osd/modules/sync/work_osd.c", + } + end + + if _OPTIONS["targetos"]=="macosx" then + files { + MAME_DIR .. "src/osd/sdl/osxutils.m", + } + end + + +-------------------------------------------------- +-- testkeys +-------------------------------------------------- + +if _OPTIONS["with-tools"] then + project("testkeys") + uuid ("744cec21-c3b6-4d69-93cb-6811fed0ffe3") + kind "ConsoleApp" + + options { + "ForceCPP", + } + + dofile("sdl_cfg.lua") + + includedirs { + MAME_DIR .. "src/lib/util", + } + targetdir(MAME_DIR) + + links { + "utils", + "ocore_" .. _OPTIONS["osd"], + } + + includeosd() + + files { + MAME_DIR .. "src/osd/sdl/testkeys.c", + } + + if _OPTIONS["targetos"]=="windows" then + linkoptions{ + "-municode", + } + files { + MAME_DIR .. "src/osd/sdl/main.c", + } + elseif _OPTIONS["targetos"]=="macosx" and _OPTIONS["SDL_LIBVER"]=="sdl" then + -- SDLMain_tmpl isn't necessary for SDL2 + files { + MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m", + } + end +end diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua new file mode 100644 index 00000000000..7f990ed31e6 --- /dev/null +++ b/scripts/src/osd/sdl_cfg.lua @@ -0,0 +1,132 @@ +forcedincludes { + MAME_DIR .. "src/osd/sdl/sdlprefix.h" +} + +if SDL_NETWORK~="" and not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "USE_NETWORK", + "OSD_NET_USE_" .. string.upper(SDL_NETWORK), + } +end + +if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then + includedirs { + path.join(_OPTIONS["MESA_INSTALL_ROOT"],"include"), + } +end + + +if _OPTIONS["NO_X11"]=="1" then + defines { + "SDLMAME_NO_X11", + } +else + defines { + "SDLMAME_X11", + } + includedirs { + "/usr/X11/include", + "/usr/X11R6/include", + "/usr/openwin/include", + } +end + +if _OPTIONS["NO_USE_XINPUT"]=="1" then + defines { + "USE_XINPUT=0", + } +else + defines { + "USE_XINPUT=1", + "USE_XINPUT_DEBUG=0", + } +end + +if _OPTIONS["NO_USE_MIDI"]~="1" and _OPTIONS["targetos"]=="linux" then + buildoptions { + string.gsub(os.outputof("pkg-config --cflags alsa"), '[\r\n]+', ' '), + } +end + +if _OPTIONS["SDL_LIBVER"]=="sdl2" then + defines { + "SDLMAME_SDL2=1", + } + if _OPTIONS["SDL2_MULTIAPI"]=="1" then + defines { + "SDL2_MULTIAPI", + } + end +else + defines { + "SDLMAME_SDL2=0", + } +end + +defines { + "OSD_SDL", + "SYNC_IMPLEMENTATION=" .. SYNC_IMPLEMENTATION, +} + +if BASE_TARGETOS=="unix" then + defines { + "SDLMAME_UNIX", + } + if _OPTIONS["targetos"]=="macosx" then + if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then + buildoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + else + defines { + "NO_SDL_GLEXT", + "MACOSX_USE_LIBSDL", + } + buildoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --cflags | sed 's:/SDL::'"), '[\r\n]+', ' '), + } + end + else + buildoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --cflags"), '[\r\n]+', ' '), + } + if _OPTIONS["targetos"]~="emscripten" then + buildoptions { + string.gsub(os.outputof("pkg-config --cflags fontconfig"), '[\r\n]+', ' '), + } + end + end +end + +if _OPTIONS["targetos"]=="windows" then + defines { + "UNICODE", + "_UNICODE", + "main=utf8_main", + } + + configuration { "vs*" } + includedirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"include") + } + configuration { } + +elseif _OPTIONS["targetos"]=="linux" then + buildoptions { + '$(shell pkg-config --cflags QtGui)', + } +elseif _OPTIONS["targetos"]=="macosx" then + defines { + "SDLMAME_MACOSX", + "SDLMAME_DARWIN", + } +elseif _OPTIONS["targetos"]=="freebsd" then + buildoptions { + -- /usr/local/include is not considered a system include director on FreeBSD. GL.h resides there and throws warnings + "-isystem /usr/local/include", + } +elseif _OPTIONS["targetos"]=="os2" then + buildoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --cflags"), '[\r\n]+', ' '), + } +end diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua new file mode 100644 index 00000000000..f372375b598 --- /dev/null +++ b/scripts/src/osd/windows.lua @@ -0,0 +1,195 @@ +dofile("modules.lua") + + +function maintargetosdoptions(_target) + osdmodulestargetconf() + + configuration { "mingw*" } + linkoptions { + "-municode", + } + + configuration { } + + if _OPTIONS["DIRECTINPUT"] == "8" then + links { + "dinput8", + } + else + links { + "dinput", + } + end + + local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc" + + if os.isfile(rcfile) then + files { + rcfile, + } + else + files { + MAME_DIR .. "src/osd/windows/mame.rc", + } + end +end + + +newoption { + trigger = "DIRECTINPUT", + description = "Minimum DirectInput version to support", + allowed = { + { "7", "Support DirectInput 7 or later" }, + { "8", "Support DirectInput 8 or later" }, + }, +} + +if not _OPTIONS["DIRECTINPUT"] then + _OPTIONS["DIRECTINPUT"] = "8" +end + + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind "StaticLib" + + dofile("windows_cfg.lua") + osdmodulesbuild() + + defines { + "DIRECT3D_VERSION=0x0900", + } + + if _OPTIONS["DIRECTINPUT"] == "8" then + defines { + "DIRECTINPUT_VERSION=0x0800", + } + else + defines { + "DIRECTINPUT_VERSION=0x0700", + } + end + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + + includedirs { + MAME_DIR .. "src/osd/windows", + } + + files { + MAME_DIR .. "src/osd/modules/render/drawd3d.c", + MAME_DIR .. "src/osd/modules/render/d3d/d3d9intf.c", + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.c", + MAME_DIR .. "src/osd/modules/render/drawdd.c", + MAME_DIR .. "src/osd/modules/render/drawgdi.c", + MAME_DIR .. "src/osd/modules/render/drawnone.c", + MAME_DIR .. "src/osd/windows/input.c", + MAME_DIR .. "src/osd/windows/output.c", + MAME_DIR .. "src/osd/windows/video.c", + MAME_DIR .. "src/osd/windows/window.c", + MAME_DIR .. "src/osd/windows/winmenu.c", + MAME_DIR .. "src/osd/windows/winmain.c", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.c", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.c", + } + + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind "StaticLib" + + options { + "ForceCPP", + } + removeflags { + "SingleOutputDir", + } + + dofile("windows_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SYNC_IMPLEMENTATION = "windows" + + includedirs { + MAME_DIR .. "src/osd/windows", + MAME_DIR .. "src/lib/winpcap", + } + + files { + MAME_DIR .. "src/osd/osdcore.c", + MAME_DIR .. "src/osd/strconv.c", + MAME_DIR .. "src/osd/windows/main.c", + MAME_DIR .. "src/osd/windows/windir.c", + MAME_DIR .. "src/osd/windows/winfile.c", + MAME_DIR .. "src/osd/modules/sync/sync_windows.c", + MAME_DIR .. "src/osd/windows/winutf8.c", + MAME_DIR .. "src/osd/windows/winutil.c", + MAME_DIR .. "src/osd/windows/winclip.c", + MAME_DIR .. "src/osd/windows/winsocket.c", + MAME_DIR .. "src/osd/windows/winptty.c", + MAME_DIR .. "src/osd/modules/osdmodule.c", + MAME_DIR .. "src/osd/modules/lib/osdlib_win32.c", + } + + if _OPTIONS["NOASM"]=="1" then + files { + MAME_DIR .. "src/osd/modules/sync/work_mini.c", + } + else + files { + MAME_DIR .. "src/osd/modules/sync/work_osd.c", + } + end + + +-------------------------------------------------- +-- ledutil +-------------------------------------------------- + +if _OPTIONS["with-tools"] then + project("ledutil") + uuid ("061293ca-7290-44ac-b2b5-5913ae8dc9c0") + kind "ConsoleApp" + + options { + "ForceCPP", + } + + targetdir(MAME_DIR) + + links { + "ocore_" .. _OPTIONS["osd"], + } + + includeosd() + + files { + MAME_DIR .. "src/osd/windows/ledutil.c", + } +end diff --git a/scripts/src/osd/windows_cfg.lua b/scripts/src/osd/windows_cfg.lua new file mode 100644 index 00000000000..8bbba52f8d6 --- /dev/null +++ b/scripts/src/osd/windows_cfg.lua @@ -0,0 +1,22 @@ +defines { + "UNICODE", + "_UNICODE", + "OSD_WINDOWS", + "USE_SDL=0", + "main=utf8_main", + "_WIN32_WINNT=0x0501", +} + +configuration { "vs*" } + flags { + "Unicode", + } + +configuration { } + +if not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "USE_NETWORK", + "OSD_NET_USE_PCAP", + } +end diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua new file mode 100644 index 00000000000..111d9777344 --- /dev/null +++ b/scripts/src/sound.lua @@ -0,0 +1,1157 @@ +--------------------------------------------------------------------------- +-- +-- sound.lua +-- +-- Rules for building sound cores +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +---------------------------------------------------------------------------- + + +--------------------------------------------------- +-- DACs +--@src/emu/sound/dac.h,SOUNDS += DAC +--@src/emu/sound/dmadac.h,SOUNDS += DMADAC +--@src/emu/sound/speaker.h,SOUNDS += SPEAKER +--@src/emu/sound/beep.h,SOUNDS += BEEP +--------------------------------------------------- + +if (SOUNDS["DAC"]~=null) then + files { + MAME_DIR .. "src/emu/sound/dac.c", + } +end + +if (SOUNDS["DMADAC"]~=null) then + files { + MAME_DIR .. "src/emu/sound/dmadac.c", + } +end + +if (SOUNDS["SPEAKER"]~=null) then + files { + MAME_DIR .. "src/emu/sound/speaker.c", + } +end + +if (SOUNDS["BEEP"]~=null) then + files { + MAME_DIR .. "src/emu/sound/beep.c", + } +end + + + +--------------------------------------------------- +-- CD audio +--@src/emu/sound/cdda.h,SOUNDS += CDDA +--------------------------------------------------- + +if (SOUNDS["CDDA"]~=null) then + files { + MAME_DIR .. "src/emu/sound/cdda.c", + } +end + + + +--------------------------------------------------- +-- Discrete component audio +--@src/emu/sound/discrete.h,SOUNDS += DISCRETE +--------------------------------------------------- + +if (SOUNDS["DISCRETE"]~=null) then + files { + MAME_DIR .. "src/emu/sound/discrete.c", + } +end + +--------------------------------------------------- +-- AC97 +--@src/emu/sound/pic-ac97.h,SOUNDS += AC97 +--------------------------------------------------- + +if (SOUNDS["AC97"]~=null) then + files { + MAME_DIR .. "src/emu/sound/pci-ac97.c", + } +end + + + +--------------------------------------------------- +-- Apple custom sound chips +--@src/emu/sound/asc.h,SOUNDS += ASC +--@src/emu/sound/awacs.h,SOUNDS += AWACS +--------------------------------------------------- + +if (SOUNDS["ASC"]~=null) then + files { + MAME_DIR .. "src/emu/sound/asc.c", + } +end + +if (SOUNDS["AWACS"]~=null) then + files { + MAME_DIR .. "src/emu/sound/awacs.c", + } +end + + +--------------------------------------------------- +-- Atari custom sound chips +--@src/emu/sound/pokey.h,SOUNDS += POKEY +--@src/emu/sound/tiaintf.h,SOUNDS += TIA +--------------------------------------------------- + +if (SOUNDS["POKEY"]~=null) then + files { + MAME_DIR .. "src/emu/sound/pokey.c", + } +end + +if (SOUNDS["TIA"]~=null) then + files { + MAME_DIR .. "src/emu/sound/tiasound.c", + MAME_DIR .. "src/emu/sound/tiaintf.c", + } +end + + + +--------------------------------------------------- +-- Amiga audio hardware +--@src/emu/sound/amiga.h,SOUNDS += AMIGA +--------------------------------------------------- + +if (SOUNDS["AMIGA"]~=null) then + files { + MAME_DIR .. "src/emu/sound/amiga.c", + } +end + + + +--------------------------------------------------- +-- Bally Astrocade sound system +--@src/emu/sound/astrocde.h,SOUNDS += ASTROCADE +--------------------------------------------------- + +if (SOUNDS["ASTROCADE"]~=null) then + files { + MAME_DIR .. "src/emu/sound/astrocde.c", + } +end + + + +--------------------------------------------------- +--------------------------------------------------- +-- AC97 +--@src/emu/sound/pic-ac97.h,SOUNDS += AC97 +--------------------------------------------------- + +if (SOUNDS["AC97"]~=null) then + files { + MAME_DIR .. "src/emu/sound/pci-ac97.c", + } +end +-- CEM 3394 analog synthesizer chip +--@src/emu/sound/cem3394.h,SOUNDS += CEM3394 +--------------------------------------------------- + +if (SOUNDS["CEM3394"]~=null) then + files { + MAME_DIR .. "src/emu/sound/cem3394.c", + } +end + + + +--------------------------------------------------- +-- Creative Labs SB0400 Audigy2 Value +--@src/emu/sound/sb0400.h,SOUNDS += AC97 +--------------------------------------------------- + +if (SOUNDS["SB0400"]~=null) then + files { + MAME_DIR .. "src/emu/sound/sb0400.c", + } +end + + +-------------------------------------------------- +-- Creative Labs Ensonic AudioPCI97 ES1373 +--@src/emu/sound/es1373.h,SOUNDS += ES1373 +-------------------------------------------------- + +if (SOUNDS["ES1373"]~=null) then + files { + MAME_DIR .. "src/emu/sound/es1373.c", + } +end + +--------------------------------------------------- +-- Data East custom sound chips +--@src/emu/sound/bsmt2000.h,SOUNDS += BSMT2000 +--------------------------------------------------- + +if (SOUNDS["BSMT2000"]~=null) then + files { + MAME_DIR .. "src/emu/sound/bsmt2000.c", + } +end + + + +--------------------------------------------------- +-- Ensoniq 5503 (Apple IIgs) +--@src/emu/sound/es5503.h,SOUNDS += ES5503 +--------------------------------------------------- + +if (SOUNDS["ES5503"]~=null) then + files { + MAME_DIR .. "src/emu/sound/es5503.c", + } +end + + + +--------------------------------------------------- +-- Ensoniq 5505/5506 +--@src/emu/sound/es5506.h,SOUNDS += ES5505 +--------------------------------------------------- + +if (SOUNDS["ES5505"]~=null or SOUNDS["ES5506"]~=null) then + files { + MAME_DIR .. "src/emu/sound/es5506.c", + } +end + + +--------------------------------------------------- +-- Ensoniq "pump" device, interfaces 5505/5506 with 5510 +--@src/emu/sound/esqpump.h,SOUNDS += ESQPUMP +--------------------------------------------------- + +if (SOUNDS["ESQPUMP"]~=null) then + files { + MAME_DIR .. "src/emu/sound/esqpump.c", + } +end + + +--------------------------------------------------- +-- Excellent Systems ADPCM sound chip +--@src/emu/sound/es8712.h,SOUNDS += ES8712 +--------------------------------------------------- + +if (SOUNDS["ES8712"]~=null) then + files { + MAME_DIR .. "src/emu/sound/es8712.c", + } +end + + + +--------------------------------------------------- +-- Gaelco custom sound chips +--@src/emu/sound/gaelco.h,SOUNDS += GAELCO_CG1V +--------------------------------------------------- + +if (SOUNDS["GAELCO_CG1V"]~=null or SOUNDS["GAELCO_GAE1"]~=null) then + files { + MAME_DIR .. "src/emu/sound/gaelco.c", + } +end + + +--------------------------------------------------- +-- RCA CDP1863 +--@src/emu/sound/cdp1863.h,SOUNDS += CDP1863 +--------------------------------------------------- + +if (SOUNDS["CDP1863"]~=null) then + files { + MAME_DIR .. "src/emu/sound/cdp1863.c", + } +end + + + +--------------------------------------------------- +-- RCA CDP1864 +--@src/emu/sound/cdp1864.h,SOUNDS += CDP1864 +--------------------------------------------------- + +if (SOUNDS["CDP1864"]~=null) then + files { + MAME_DIR .. "src/emu/sound/cdp1864.c", + } +end + + + +--------------------------------------------------- +-- RCA CDP1869 +--@src/emu/sound/cdp1869.h,SOUNDS += CDP1869 +--------------------------------------------------- + +if (SOUNDS["CDP1869"]~=null) then + files { + MAME_DIR .. "src/emu/sound/cdp1869.c", + } +end + + + +--------------------------------------------------- +-- GI AY-8910 +--@src/emu/sound/ay8910.h,SOUNDS += AY8910 +--------------------------------------------------- + +if (SOUNDS["AY8910"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ay8910.c", + } +end + + + +--------------------------------------------------- +-- Harris HC55516 CVSD +--@src/emu/sound/hc55516.h,SOUNDS += HC55516 +--------------------------------------------------- + +if (SOUNDS["HC55516"]~=null) then + files { + MAME_DIR .. "src/emu/sound/hc55516.c", + } +end + + + +--------------------------------------------------- +-- Hudsonsoft C6280 sound chip +--@src/emu/sound/c6280.h,SOUNDS += C6280 +--------------------------------------------------- + +if (SOUNDS["C6280"]~=null) then + files { + MAME_DIR .. "src/emu/sound/c6280.c", + } +end + + + +--------------------------------------------------- +-- ICS2115 sound chip +--@src/emu/sound/ics2115.h,SOUNDS += ICS2115 +--------------------------------------------------- + +if (SOUNDS["ICS2115"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ics2115.c", + } +end + + + +--------------------------------------------------- +-- Imagetek I5000 sound +--@src/emu/sound/i5000.h,SOUNDS += I5000_SND +--------------------------------------------------- + +if (SOUNDS["I5000_SND"]~=null) then + files { + MAME_DIR .. "src/emu/sound/i5000.c", + } +end + + + +--------------------------------------------------- +-- Irem custom sound chips +--@src/emu/sound/iremga20.h,SOUNDS += IREMGA20 +--------------------------------------------------- + +if (SOUNDS["IREMGA20"]~=null) then + files { + MAME_DIR .. "src/emu/sound/iremga20.c", + } +end + + + +--------------------------------------------------- +-- Konami custom sound chips +--@src/emu/sound/k005289.h,SOUNDS += K005289 +--@src/emu/sound/k007232.h,SOUNDS += K007232 +--@src/emu/sound/k051649.h,SOUNDS += K051649 +--@src/emu/sound/k053260.h,SOUNDS += K053260 +--@src/emu/sound/k054539.h,SOUNDS += K054539 +--@src/emu/sound/k056800.h,SOUNDS += K056800 +--------------------------------------------------- + +if (SOUNDS["K005289"]~=null) then + files { + MAME_DIR .. "src/emu/sound/k005289.c", + } +end + +if (SOUNDS["K007232"]~=null) then + files { + MAME_DIR .. "src/emu/sound/k007232.c", + } +end + +if (SOUNDS["K051649"]~=null) then + files { + MAME_DIR .. "src/emu/sound/k051649.c", + } +end + +if (SOUNDS["K053260"]~=null) then + files { + MAME_DIR .. "src/emu/sound/k053260.c", + } +end + +if (SOUNDS["K054539"]~=null) then + files { + MAME_DIR .. "src/emu/sound/k054539.c", + } +end + +if (SOUNDS["K056800"]~=null) then + files { + MAME_DIR .. "src/emu/sound/k056800.c", + } +end + + +--------------------------------------------------- +-- L7A1045 L6028 DSP-A +--@src/emu/sound/l7a1045_l6028_dsp_a.h,SOUNDS += L7A1045 +--------------------------------------------------- + +if (SOUNDS["L7A1045"]~=null) then + files { + MAME_DIR .. "src/emu/sound/l7a1045_l6028_dsp_a.c", + } +end + + +--------------------------------------------------- +-- LMC1992 mixer chip +--@src/emu/sound/lmc1992.h,SOUNDS += LMC1992 +--------------------------------------------------- + +if (SOUNDS["LMC1992"]~=null) then + files { + MAME_DIR .. "src/emu/sound/lmc1992.c", + } +end + + + +--------------------------------------------------- +-- MAS 3507D MPEG 1/2 Layer 2/3 Audio Decoder +--@src/emu/sound/mas3507d.h,SOUNDS += MAS3507D +--------------------------------------------------- + +if (SOUNDS["MAS3507D"]~=null) then + files { + MAME_DIR .. "src/emu/sound/mas3507d.c", + } +end + + + +--------------------------------------------------- +-- MOS 6560VIC +--@src/emu/sound/mos6560.h,SOUNDS += MOS656X +--------------------------------------------------- + +if (SOUNDS["MOS656X"]~=null) then + files { + MAME_DIR .. "src/emu/sound/mos6560.c", + } +end + + + +--------------------------------------------------- +-- MOS 7360 TED +--@src/emu/sound/mos7360.h,SOUNDS += MOS7360 +--------------------------------------------------- + +if (SOUNDS["MOS7360"]~=null) then + files { + MAME_DIR .. "src/emu/sound/mos7360.c", + } +end + + + +--------------------------------------------------- +-- Namco custom sound chips +--@src/emu/sound/namco.h,SOUNDS += NAMCO +--@src/emu/sound/n63701x.h,SOUNDS += NAMCO_63701X +--@src/emu/sound/c140.h,SOUNDS += C140 +--@src/emu/sound/c352.h,SOUNDS += C352 +--------------------------------------------------- + +if (SOUNDS["NAMCO"]~=null or SOUNDS["NAMCO_15XX"]~=null or SOUNDS["NAMCO_CUS30"]~=null) then + files { + MAME_DIR .. "src/emu/sound/namco.c", + } +end + +if (SOUNDS["NAMCO_63701X"]~=null) then + files { + MAME_DIR .. "src/emu/sound/n63701x.c", + } +end + +if (SOUNDS["C140"]~=null) then + files { + MAME_DIR .. "src/emu/sound/c140.c", + } +end + +if (SOUNDS["C352"]~=null) then + files { + MAME_DIR .. "src/emu/sound/c352.c", + } +end + + + +--------------------------------------------------- +-- National Semiconductor Digitalker +--@src/emu/sound/digitalk.h,SOUNDS += DIGITALKER +--------------------------------------------------- + +if (SOUNDS["DIGITALKER"]~=null) then + files { + MAME_DIR .. "src/emu/sound/digitalk.c", + } +end + + + +--------------------------------------------------- +-- Nintendo custom sound chips +--@src/emu/sound/nes_apu.h,SOUNDS += NES_APU +--------------------------------------------------- + +if (SOUNDS["NES_APU"]~=null) then + files { + MAME_DIR .. "src/emu/sound/nes_apu.c", + } +end + + + +--------------------------------------------------- +-- NEC uPD7759 ADPCM sample player +--@src/emu/sound/upd7759.h,SOUNDS += UPD7759 +--------------------------------------------------- + +if (SOUNDS["UPD7759"]~=null) then + files { + MAME_DIR .. "src/emu/sound/upd7759.c", + } +end + + + +--------------------------------------------------- +-- OKI ADPCM sample players +--@src/emu/sound/okim6258.h,SOUNDS += OKIM6258 +--@src/emu/sound/msm5205.h,SOUNDS += MSM5205 +--@src/emu/sound/msm5232.h,SOUNDS += MSM5232 +--@src/emu/sound/okim6376.h,SOUNDS += OKIM6376 +--@src/emu/sound/okim6295.h,SOUNDS += OKIM6295 +--@src/emu/sound/okim9810.h,SOUNDS += OKIM9810 +--------------------------------------------------- + +if (SOUNDS["OKIM6258"]~=null or SOUNDS["OKIM6295"]~=null or SOUNDS["OKIM9810"]~=null or SOUNDS["I5000_SND"]~=null) then + files { + MAME_DIR .. "src/emu/sound/okiadpcm.c", + } +end + +if (SOUNDS["MSM5205"]~=null or SOUNDS["MSM6585"]~=null) then + files { + MAME_DIR .. "src/emu/sound/msm5205.c", + } +end + +if (SOUNDS["MSM5232"]~=null) then + files { + MAME_DIR .. "src/emu/sound/msm5232.c", + } +end + +if (SOUNDS["OKIM6376"]~=null) then + files { + MAME_DIR .. "src/emu/sound/okim6376.c", + } +end + +if (SOUNDS["OKIM6295"]~=null) then + files { + MAME_DIR .. "src/emu/sound/okim6295.c", + } +end + +if (SOUNDS["OKIM6258"]~=null) then + files { + MAME_DIR .. "src/emu/sound/okim6258.c", + } +end + +if (SOUNDS["OKIM9810"]~=null) then + files { + MAME_DIR .. "src/emu/sound/okim9810.c", + } +end + + + +--------------------------------------------------- +-- Philips SAA1099 +--@src/emu/sound/saa1099.h,SOUNDS += SAA1099 +--------------------------------------------------- + +if (SOUNDS["SAA1099"]~=null) then + files { + MAME_DIR .. "src/emu/sound/saa1099.c", + } +end + + + +--------------------------------------------------- +-- AdMOS QS1000 +--@src/emu/sound/qs1000.h,SOUNDS += QS1000 +--------------------------------------------------- + +if (SOUNDS["QS1000"]~=null) then + files { + MAME_DIR .. "src/emu/sound/qs1000.c", + } +end + + + +--------------------------------------------------- +-- QSound sample player +--@src/emu/sound/qsound.h,SOUNDS += QSOUND +--------------------------------------------------- + +if (SOUNDS["QSOUND"]~=null) then + files { + MAME_DIR .. "src/emu/sound/qsound.c", + MAME_DIR .. "src/emu/cpu/dsp16/dsp16.c", + MAME_DIR .. "src/emu/cpu/dsp16/dsp16dis.c", + } +end + + + +--------------------------------------------------- +-- Ricoh sample players +--@src/emu/sound/rf5c68.h,SOUNDS += RF5C68 +--@src/emu/sound/rf5c400.h,SOUNDS += RF5C400 +--------------------------------------------------- + +if (SOUNDS["RF5C68"]~=null) then + files { + MAME_DIR .. "src/emu/sound/rf5c68.c", + } +end + +if (SOUNDS["RF5C400"]~=null) then + files { + MAME_DIR .. "src/emu/sound/rf5c400.c", + } +end + + + +--------------------------------------------------- +-- Sega custom sound chips +--@src/emu/sound/segapcm.h,SOUNDS += SEGAPCM +--@src/emu/sound/multipcm.h,SOUNDS += MULTIPCM +--@src/emu/sound/scsp.h,SOUNDS += SCSP +--@src/emu/sound/aica.h,SOUNDS += AICA +--------------------------------------------------- + +if (SOUNDS["SEGAPCM"]~=null) then + files { + MAME_DIR .. "src/emu/sound/segapcm.c", + } +end + +if (SOUNDS["MULTIPCM"]~=null) then + files { + MAME_DIR .. "src/emu/sound/multipcm.c", + } +end + +if (SOUNDS["SCSP"]~=null) then + files { + MAME_DIR .. "src/emu/sound/scsp.c", + MAME_DIR .. "src/emu/sound/scspdsp.c", + } +end + +if (SOUNDS["AICA"]~=null) then + files { + MAME_DIR .. "src/emu/sound/aica.c", + MAME_DIR .. "src/emu/sound/aicadsp.c", + } +end + +--------------------------------------------------- +-- Seta custom sound chips +--@src/emu/sound/st0016.h,SOUNDS += ST0016 +--@src/emu/sound/nile.h,SOUNDS += NILE +--@src/emu/sound/x1_010.h,SOUNDS += X1_010 +--------------------------------------------------- + +if (SOUNDS["ST0016"]~=null) then + files { + MAME_DIR .. "src/emu/sound/st0016.c", + } +end + +if (SOUNDS["NILE"]~=null) then + files { + MAME_DIR .. "src/emu/sound/nile.c", + } +end + +if (SOUNDS["X1_010"]~=null) then + files { + MAME_DIR .. "src/emu/sound/x1_010.c", + } +end + + + +--------------------------------------------------- +-- SID custom sound chips +--@src/emu/sound/mos6581.h,SOUNDS += SID6581 +--------------------------------------------------- + +if (SOUNDS["SID6581"]~=null or SOUNDS["SID8580"]~=null) then + files { + MAME_DIR .. "src/emu/sound/mos6581.c", + MAME_DIR .. "src/emu/sound/sid.c", + MAME_DIR .. "src/emu/sound/sidenvel.c", + MAME_DIR .. "src/emu/sound/sidvoice.c", + } +end + + +--------------------------------------------------- +-- SNK(?) custom stereo sn76489a clone +--@src/emu/sound/t6w28.h,SOUNDS += T6W28 +--------------------------------------------------- + +if (SOUNDS["T6W28"]~=null) then + files { + MAME_DIR .. "src/emu/sound/t6w28.c", + } +end + + + +--------------------------------------------------- +-- SNK custom wave generator +--@src/emu/sound/snkwave.h,SOUNDS += SNKWAVE +--------------------------------------------------- + +if (SOUNDS["SNKWAVE"]~=null) then + files { + MAME_DIR .. "src/emu/sound/snkwave.c", + } +end + + + +--------------------------------------------------- +-- Sony custom sound chips +--@src/emu/sound/spu.h,SOUNDS += SPU +--------------------------------------------------- + +if (SOUNDS["SPU"]~=null) then + files { + MAME_DIR .. "src/emu/sound/spu.c", + MAME_DIR .. "src/emu/sound/spu_tables.c", + MAME_DIR .. "src/emu/sound/spureverb.c", + } +end + + +--------------------------------------------------- +-- SP0256 speech synthesizer +--@src/emu/sound/sp0256.h,SOUNDS += SP0256 +--------------------------------------------------- + +if (SOUNDS["SP0256"]~=null) then + files { + MAME_DIR .. "src/emu/sound/sp0256.c", + } +end + + + +--------------------------------------------------- +-- SP0250 speech synthesizer +--@src/emu/sound/sp0250.h,SOUNDS += SP0250 +--------------------------------------------------- + +if (SOUNDS["SP0250"]~=null) then + files { + MAME_DIR .. "src/emu/sound/sp0250.c", + } +end + + +--------------------------------------------------- +-- S14001A speech synthesizer +--@src/emu/sound/s14001a.h,SOUNDS += S14001A +--------------------------------------------------- + +if (SOUNDS["S14001A"]~=null) then + files { + MAME_DIR .. "src/emu/sound/s14001a.c", + } +end + + + +--------------------------------------------------- +-- Texas Instruments SN76477 analog chip +--@src/emu/sound/sn76477.h,SOUNDS += SN76477 +--------------------------------------------------- + +if (SOUNDS["SN76477"]~=null) then + files { + MAME_DIR .. "src/emu/sound/sn76477.c", + } +end + + + +--------------------------------------------------- +-- Texas Instruments SN76496 +--@src/emu/sound/sn76496.h,SOUNDS += SN76496 +--------------------------------------------------- + +if (SOUNDS["SN76496"]~=null) then + files { + MAME_DIR .. "src/emu/sound/sn76496.c", + } +end + + + +--------------------------------------------------- +-- Texas Instruments TMS36xx doorbell chime +--@src/emu/sound/tms36xx.h,SOUNDS += TMS36XX +--------------------------------------------------- + +if (SOUNDS["TMS36XX"]~=null) then + files { + MAME_DIR .. "src/emu/sound/tms36xx.c", + } +end + + + +--------------------------------------------------- +-- Texas Instruments TMS3615 Octave Multiple Tone Synthesizer +--@src/emu/sound/tms3615.h,SOUNDS += TMS3615 +--------------------------------------------------- + +if (SOUNDS["TMS3615"]~=null) then + files { + MAME_DIR .. "src/emu/sound/tms3615.c", + } +end + + + +--------------------------------------------------- +-- Texas Instruments TMS5100-series speech synthesizers +--@src/emu/sound/tms5110.h,SOUNDS += TMS5110 +--------------------------------------------------- + +if (SOUNDS["TMS5110"]~=null) then + files { + MAME_DIR .. "src/emu/sound/tms5110.c", + } +end + +--------------------------------------------------- +-- Texas Instruments TMS5200-series speech synthesizers +--@src/emu/sound/tms5220.h,SOUNDS += TMS5220 +--------------------------------------------------- +if (SOUNDS["TMS5220"]~=null) then + files { + MAME_DIR .. "src/emu/sound/tms5220.c", + MAME_DIR .. "src/emu/machine/spchrom.c", + } +end + + +--------------------------------------------------- +-- Toshiba T6721A voice synthesizer +--@src/emu/sound/t6721a.h,SOUNDS += T6721A +--------------------------------------------------- + +if (SOUNDS["T6721A"]~=null) then + files { + MAME_DIR .. "src/emu/sound/t6721a.c", + } +end + + + +--------------------------------------------------- +-- Toshiba TC8830F sample player/recorder +--@src/emu/sound/tc8830f.h,SOUNDS += TC8830F +--------------------------------------------------- + +if (SOUNDS["TC8830F"]~=null) then + files { + MAME_DIR .. "src/emu/sound/tc8830f.c", + } +end + + +--------------------------------------------------- +-- NEC uPD7752 +--@src/emu/sound/upd7752.h,SOUNDS += UPD7752 +--------------------------------------------------- + +if (SOUNDS["UPD7752"]~=null) then + files { + MAME_DIR .. "src/emu/sound/upd7752.c", + } +end + + +--------------------------------------------------- +-- VLM5030 speech synthesizer +--@src/emu/sound/vlm5030.h,SOUNDS += VLM5030 +--------------------------------------------------- + +if (SOUNDS["VLM5030"]~=null) then + files { + MAME_DIR .. "src/emu/sound/vlm5030.c", + } +end + +--------------------------------------------------- +-- Votrax speech synthesizer +--@src/emu/sound/votrax.h,SOUNDS += VOTRAX +--------------------------------------------------- + +if (SOUNDS["VOTRAX"]~=null) then + files { + MAME_DIR .. "src/emu/sound/votrax.c", + MAME_DIR .. "src/emu/sound/samples.c", + } +end + + + +--------------------------------------------------- +-- VRender0 custom sound chip +--@src/emu/sound/vrender0.h,SOUNDS += VRENDER0 +--------------------------------------------------- + +if (SOUNDS["VRENDER0"]~=null) then + files { + MAME_DIR .. "src/emu/sound/vrender0.c", + } +end + + + +--------------------------------------------------- +-- WAVE file (used for MESS cassette) +--@src/emu/sound/wave.h,SOUNDS += WAVE +--------------------------------------------------- + +if (SOUNDS["WAVE"]~=null) then + files { + MAME_DIR .. "src/emu/sound/wave.c", + } +end + + + +--------------------------------------------------- +-- Yamaha FM synthesizers +--@src/emu/sound/2151intf.h,SOUNDS += YM2151 +--@src/emu/sound/2203intf.h,SOUNDS += YM2203 +--@src/emu/sound/2413intf.h,SOUNDS += YM2413 +--@src/emu/sound/2608intf.h,SOUNDS += YM2608 +--@src/emu/sound/2610intf.h,SOUNDS += YM2610 +--@src/emu/sound/2612intf.h,SOUNDS += YM2612 +--@src/emu/sound/3812intf.h,SOUNDS += YM3812 +--@src/emu/sound/3526intf.h,SOUNDS += YM3526 +--@src/emu/sound/8950intf.h,SOUNDS += Y8950 +--@src/emu/sound/ymf262.h,SOUNDS += YMF262 +--@src/emu/sound/ymf271.h,SOUNDS += YMF271 +--@src/emu/sound/ymf278b.h,SOUNDS += YMF278B +--------------------------------------------------- + +if (SOUNDS["YM2151"]~=null) then + files { + MAME_DIR .. "src/emu/sound/2151intf.c", + MAME_DIR .. "src/emu/sound/ym2151.c", + } +end + +if (SOUNDS["YM2203"]~=null) then + files { + MAME_DIR .. "src/emu/sound/2203intf.c", + MAME_DIR .. "src/emu/sound/ay8910.c", + MAME_DIR .. "src/emu/sound/fm.c", + } +end + +if (SOUNDS["YM2413"]~=null) then + files { + MAME_DIR .. "src/emu/sound/2413intf.c", + MAME_DIR .. "src/emu/sound/ym2413.c", + } +end + +if (SOUNDS["YM2608"]~=null) then + files { + MAME_DIR .. "src/emu/sound/2608intf.c", + MAME_DIR .. "src/emu/sound/ay8910.c", + MAME_DIR .. "src/emu/sound/fm.c", + MAME_DIR .. "src/emu/sound/ymdeltat.c", + } +end + +if (SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null) then + files { + MAME_DIR .. "src/emu/sound/2610intf.c", + MAME_DIR .. "src/emu/sound/ay8910.c", + MAME_DIR .. "src/emu/sound/fm.c", + MAME_DIR .. "src/emu/sound/ymdeltat.c", + } +end + +if (SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then + files { + MAME_DIR .. "src/emu/sound/2612intf.c", + MAME_DIR .. "src/emu/sound/ay8910.c", + MAME_DIR .. "src/emu/sound/fm2612.c", + } +end + +if (SOUNDS["YM3812"]~=null) then + files { + MAME_DIR .. "src/emu/sound/3812intf.c", + MAME_DIR .. "src/emu/sound/fmopl.c", + MAME_DIR .. "src/emu/sound/ymdeltat.c", + } +end + +if (SOUNDS["YM3526"]~=null) then + files { + MAME_DIR .. "src/emu/sound/3526intf.c", + MAME_DIR .. "src/emu/sound/fmopl.c", + MAME_DIR .. "src/emu/sound/ymdeltat.c", + } +end + +if (SOUNDS["Y8950"]~=null) then + files { + MAME_DIR .. "src/emu/sound/8950intf.c", + MAME_DIR .. "src/emu/sound/fmopl.c", + MAME_DIR .. "src/emu/sound/ymdeltat.c", + } +end + +if (SOUNDS["YMF262"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ymf262.c", + MAME_DIR .. "src/emu/sound/262intf.c", + } +end + +if (SOUNDS["YMF271"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ymf271.c", + } +end + +if (SOUNDS["YMF278B"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ymf278b.c", + } +end + + + +--------------------------------------------------- +-- Yamaha YMZ280B ADPCM +--@src/emu/sound/ymz280b.h,SOUNDS += YMZ280B +--------------------------------------------------- + +if (SOUNDS["YMZ280B"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ymz280b.c", + } +end + +--------------------------------------------------- +-- Yamaha YMZ770 AMM +--@src/emu/sound/ymz770.h,SOUNDS += YMZ770 +--------------------------------------------------- + +if (SOUNDS["YMZ770"]~=null) then + files { + MAME_DIR .. "src/emu/sound/ymz770.c", + MAME_DIR .. "src/emu/sound/mpeg_audio.c", + } +end + +--------------------------------------------------- +-- ZOOM ZSG-2 +--@src/emu/sound/zsg2.h,SOUNDS += ZSG2 +--------------------------------------------------- + +if (SOUNDS["ZSG2"]~=null) then + files { + MAME_DIR .. "src/emu/sound/zsg2.c", + } +end + +--------------------------------------------------- +-- VRC6 +--@src/emu/sound/vrc6.h,SOUNDS += VRC6 +--------------------------------------------------- + +if (SOUNDS["VRC6"]~=null) then + files { + MAME_DIR .. "src/emu/sound/vrc6.c", + } +end + diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua new file mode 100644 index 00000000000..10cb2ea8432 --- /dev/null +++ b/scripts/src/tools.lua @@ -0,0 +1,551 @@ +-------------------------------------------------- +-- romcmp +-------------------------------------------------- + +project("romcmp") +uuid ("1b40275b-194c-497b-8abd-9338775a21b8") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/romcmp.c", +} + +-------------------------------------------------- +-- chdman +-------------------------------------------------- + +project("chdman") +uuid ("7d948868-42db-432a-9bb5-70ce5c5f4620") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/chdman.c", + MAME_DIR .. "src/version.c", +} + +-------------------------------------------------- +-- jedutil +-------------------------------------------------- + +project("jedutil") +uuid ("bda60edb-f7f5-489f-b232-23d33c43dda1") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/jedutil.c", +} + +-------------------------------------------------- +-- unidasm +-------------------------------------------------- + +project("unidasm") +uuid ("65f81d3b-299a-4b08-a3fa-d5241afa9fd1") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "dasm", + "emu", + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/unidasm.c", +} + + +-------------------------------------------------- +-- ldresample +-------------------------------------------------- + +project("ldresample") +uuid ("3401561a-4407-4e13-9c6d-c0801330f7cc") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/ldresample.c", +} + +-------------------------------------------------- +-- ldverify +-------------------------------------------------- + +project("ldverify") +uuid ("3e66560d-b928-4227-928b-eadd0a10f00a") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/ldverify.c", +} + +-------------------------------------------------- +-- regrep +-------------------------------------------------- + +project("regrep") +uuid ("7f6de580-d800-4e8d-bed6-9fc86829584d") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/regrep.c", +} + +-------------------------------------------------- +-- srcclean +--------------------------------------------------- + +project("srcclean") +uuid ("4dd58139-313a-42c5-965d-f378bdeed220") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/srcclean.c", +} + +-------------------------------------------------- +-- src2html +-------------------------------------------------- + +project("src2html") +uuid ("b31e963a-09ef-4696-acbd-e663e35ce6f7") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/src2html.c", +} + +-------------------------------------------------- +-- split +-------------------------------------------------- + +project("split") +uuid ("8ef6ff18-3199-4cc2-afd0-d64033070faa") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/split.c", +} + +-------------------------------------------------- +-- pngcmp +-------------------------------------------------- + +project("pngcmp") +uuid ("61f647d9-b129-409b-9c62-8acf98ed39be") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/pngcmp.c", +} + +-------------------------------------------------- +-- nltool +-------------------------------------------------- + +project("nltool") +uuid ("853a03b7-fa37-41a8-8250-0dc23dd935d6") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/emu", +} + +includeosd() + +files { + MAME_DIR .. "src/tools/nltool.c", +} + +dofile("netlist.lua") + +-------------------------------------------------- +-- castool +-------------------------------------------------- + +project("castool") +uuid ("7d9ed428-e2ba-4448-832d-d882a64d5c22") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "formats", + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/mess/tools/castool/main.c", +} + +-------------------------------------------------- +-- floptool +-------------------------------------------------- + +project("floptool") +uuid ("85d8e3a6-1661-4ac9-8c21-281d20cbaf5b") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "formats", + "emu", + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", +} + +includeosd() + +files { + MAME_DIR .. "src/mess/tools/floptool/main.c", +} + +-------------------------------------------------- +-- imgtool +-------------------------------------------------- + +project("imgtool") +uuid ("f3707807-e587-4297-a5d8-bc98f3d0b1ca") +kind "ConsoleApp" + +options { + "ForceCPP", +} + +configuration { } + targetdir(MAME_DIR) + +links { + "formats", + "emu", + "utils", + "expat", + "zlib", + "flac", + "7z", + "ocore_" .. _OPTIONS["osd"], +} + +includedirs { + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty/zlib", + MAME_DIR .. "src/mess/tools/imgtool", +} + +includeosd() + +files { + MAME_DIR .. "src/mess/tools/imgtool/main.c", + MAME_DIR .. "src/mess/tools/imgtool/stream.c", + MAME_DIR .. "src/mess/tools/imgtool/library.c", + MAME_DIR .. "src/mess/tools/imgtool/modules.c", + MAME_DIR .. "src/mess/tools/imgtool/iflopimg.c", + MAME_DIR .. "src/mess/tools/imgtool/filter.c", + MAME_DIR .. "src/mess/tools/imgtool/filteoln.c", + MAME_DIR .. "src/mess/tools/imgtool/filtbas.c", + MAME_DIR .. "src/mess/tools/imgtool/imgtool.c", + MAME_DIR .. "src/mess/tools/imgtool/imgterrs.c", + MAME_DIR .. "src/mess/tools/imgtool/imghd.c", + MAME_DIR .. "src/mess/tools/imgtool/charconv.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/amiga.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/macbin.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/rsdos.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/os9.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/mac.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/ti99.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/ti990hd.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/concept.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/fat.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/pc_flop.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/pc_hard.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/prodos.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/vzdos.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/thomson.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/macutil.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/cybiko.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/cybikoxt.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/psion.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/bml3.c", + MAME_DIR .. "src/mess/tools/imgtool/modules/hp48.c", +} + diff --git a/scripts/src/video.lua b/scripts/src/video.lua new file mode 100644 index 00000000000..7966798d0b9 --- /dev/null +++ b/scripts/src/video.lua @@ -0,0 +1,725 @@ +--------------------------------------------------------------------------- +-- +-- video.lua +-- +-- Rules for building video cores +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +--------------------------------------------------------------------------- + +-------------------------------------------------- +-- +--@src/emu/video/315_5124.h,VIDEOS += SEGA315_5124 +-------------------------------------------------- + +if (VIDEOS["SEGA315_5124"]~=null) then + files { + MAME_DIR .. "src/emu/video/315_5124.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/315_5313.h,VIDEOS += SEGA315_5313 +-------------------------------------------------- + +if (VIDEOS["SEGA315_5313"]~=null) then + files { + MAME_DIR .. "src/emu/video/315_5313.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/bufsprite.h,VIDEOS += BUFSPRITE +-------------------------------------------------- + +if (VIDEOS["BUFSPRITE"]~=null) then + files { + MAME_DIR .. "src/emu/video/bufsprite.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/cdp1861.h,VIDEOS += CDP1861 +-------------------------------------------------- + +if (VIDEOS["CDP1861"]~=null) then + files { + MAME_DIR .. "src/emu/video/cdp1861.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/cdp1862.h,VIDEOS += CDP1862 +-------------------------------------------------- + +if (VIDEOS["CDP1862"]~=null) then + files { + MAME_DIR .. "src/emu/video/cdp1862.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/crt9007.h,VIDEOS += CRT9007 +-------------------------------------------------- + +if (VIDEOS["CRT9007"]~=null) then + files { + MAME_DIR .. "src/emu/video/crt9007.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/crt9021.h,VIDEOS += CRT9021 +-------------------------------------------------- + +if (VIDEOS["CRT9021"]~=null) then + files { + MAME_DIR .. "src/emu/video/crt9021.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/crt9212.h,VIDEOS += CRT9212 +-------------------------------------------------- + +if (VIDEOS["CRT9212"]~=null) then + files { + MAME_DIR .. "src/emu/video/crt9212.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/dl1416.h,VIDEOS += DL1416 +-------------------------------------------------- + +if (VIDEOS["DL1416"]~=null) then + files { + MAME_DIR .. "src/emu/video/dl1416.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/dm9368.h,VIDEOS += DM9368 +-------------------------------------------------- + +if (VIDEOS["DM9368"]~=null) then + files { + MAME_DIR .. "src/emu/video/dm9368.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/ef9340_1.h,VIDEOS += EF9340_1 +-------------------------------------------------- + +if (VIDEOS["EF9340_1"]~=null) then + files { + MAME_DIR .. "src/emu/video/ef9340_1.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/ef9345.h,VIDEOS += EF9345 +-------------------------------------------------- + +if (VIDEOS["EF9345"]~=null) then + files { + MAME_DIR .. "src/emu/video/ef9345.c", + } +end + +-------------------------------------------------- +--@src/emu/video/epic12.h,VIDEOS += EPIC12 +-------------------------------------------------- + +if (VIDEOS["EPIC12"]~=null) then + files { + MAME_DIR .. "src/emu/video/epic12.c", + MAME_DIR .. "src/emu/video/epic12_blit0.c", + MAME_DIR .. "src/emu/video/epic12_blit1.c", + MAME_DIR .. "src/emu/video/epic12_blit2.c", + MAME_DIR .. "src/emu/video/epic12_blit3.c", + MAME_DIR .. "src/emu/video/epic12_blit4.c", + MAME_DIR .. "src/emu/video/epic12_blit5.c", + MAME_DIR .. "src/emu/video/epic12_blit6.c", + MAME_DIR .. "src/emu/video/epic12_blit7.c", + MAME_DIR .. "src/emu/video/epic12_blit8.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/fixfreq.h,VIDEOS += FIXFREQ +-------------------------------------------------- + +if (VIDEOS["FIXFREQ"]~=null) then + files { + MAME_DIR .. "src/emu/video/fixfreq.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/gf4500.h,VIDEOS += GF4500 +-------------------------------------------------- + +if (VIDEOS["GF4500"]~=null) then + files { + MAME_DIR .. "src/emu/video/gf4500.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/gf7600gs.h,VIDEOS += GF7600GS +-------------------------------------------------- + +if (VIDEOS["GF7600GS"]~=null) then + files { + MAME_DIR .. "src/emu/video/gf7600gs.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/h63484.h,VIDEOS += H63484 +-------------------------------------------------- + +if (VIDEOS["H63484"]~=null) then + files { + MAME_DIR .. "src/emu/video/h63484.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/hd44102.h,VIDEOS += HD44102 +-------------------------------------------------- + +if (VIDEOS["HD44102"]~=null) then + files { + MAME_DIR .. "src/emu/video/hd44102.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/hd44352.h,VIDEOS += HD44352 +-------------------------------------------------- + +if (VIDEOS["HD44352"]~=null) then + files { + MAME_DIR .. "src/emu/video/hd44352.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/hd44780.h,VIDEOS += HD44780 +-------------------------------------------------- + +if (VIDEOS["HD44780"]~=null) then + files { + MAME_DIR .. "src/emu/video/hd44780.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/hd61830.h,VIDEOS += HD61830 +-------------------------------------------------- + +if (VIDEOS["HD61830"]~=null) then + files { + MAME_DIR .. "src/emu/video/hd61830.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/hd63484.h,VIDEOS += HD63484 +-------------------------------------------------- + +if (VIDEOS["HD63484"]~=null) then + files { + MAME_DIR .. "src/emu/video/hd63484.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/hd66421.h,VIDEOS += HD66421 +-------------------------------------------------- + +if (VIDEOS["HD66421"]~=null) then + files { + MAME_DIR .. "src/emu/video/hd66421.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/huc6202.h,VIDEOS += HUC6202 +-------------------------------------------------- + +if (VIDEOS["HUC6202"]~=null) then + files { + MAME_DIR .. "src/emu/video/huc6202.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/huc6260.h,VIDEOS += HUC6260 +-------------------------------------------------- + +if (VIDEOS["HUC6260"]~=null) then + files { + MAME_DIR .. "src/emu/video/huc6260.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/huc6261.h,VIDEOS += HUC6261 +-------------------------------------------------- + +if (VIDEOS["HUC6261"]~=null) then + files { + MAME_DIR .. "src/emu/video/huc6261.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/huc6270.h,VIDEOS += HUC6270 +-------------------------------------------------- + +if (VIDEOS["HUC6270"]~=null) then + files { + MAME_DIR .. "src/emu/video/huc6270.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/huc6272.h,VIDEOS += HUC6272 +-------------------------------------------------- + +if (VIDEOS["HUC6272"]~=null) then + files { + MAME_DIR .. "src/emu/video/huc6272.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/i8244.h,VIDEOS += I8244 +-------------------------------------------------- + +if (VIDEOS["I8244"]~=null) then + files { + MAME_DIR .. "src/emu/video/i8244.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/i8275.h,VIDEOS += I8275 +-------------------------------------------------- + +if (VIDEOS["I8275"]~=null) then + files { + MAME_DIR .. "src/emu/video/i8275.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/m50458.h,VIDEOS += M50458 +-------------------------------------------------- + +if (VIDEOS["M50458"]~=null) then + files { + MAME_DIR .. "src/emu/video/m50458.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/mb90082.h,VIDEOS += MB90082 +-------------------------------------------------- + +if (VIDEOS["MB90082"]~=null) then + files { + MAME_DIR .. "src/emu/video/mb90082.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/mb_vcu.h,VIDEOS += MB_VCU +-------------------------------------------------- + +if (VIDEOS["MB_VCU"]~=null) then + files { + MAME_DIR .. "src/emu/video/mb_vcu.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/mc6845.h,VIDEOS += MC6845 +-------------------------------------------------- + +if (VIDEOS["MC6845"]~=null) then + files { + MAME_DIR .. "src/emu/video/mc6845.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/mc6847.h,VIDEOS += MC6847 +-------------------------------------------------- + +if (VIDEOS["MC6847"]~=null) then + files { + MAME_DIR .. "src/emu/video/mc6847.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/msm6222b.h,VIDEOS += MSM6222B +-------------------------------------------------- + +if (VIDEOS["MSM6222B"]~=null) then + files { + MAME_DIR .. "src/emu/video/msm6222b.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/msm6255.h,VIDEOS += MSM6255 +-------------------------------------------------- + +if (VIDEOS["MSM6255"]~=null) then + files { + MAME_DIR .. "src/emu/video/msm6255.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/mos6566.h,VIDEOS += MOS6566 +-------------------------------------------------- + +if (VIDEOS["MOS6566"]~=null) then + files { + MAME_DIR .. "src/emu/video/mos6566.c", + } +end + + +files { + MAME_DIR .. "src/emu/video/cgapal.c", +} + +-------------------------------------------------- +-- +--@src/emu/video/pc_vga.h,VIDEOS += PC_VGA +-------------------------------------------------- + +if (VIDEOS["PC_VGA"]~=null) then + files { + MAME_DIR .. "src/emu/video/pc_vga.c", + MAME_DIR .. "src/emu/bus/isa/trident.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/polylgcy.h,VIDEOS += POLY +-------------------------------------------------- + +if (VIDEOS["POLY"]~=null) then + files { + MAME_DIR .. "src/emu/video/polylgcy.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/psx.h,VIDEOS += PSX +-------------------------------------------------- + +if (VIDEOS["PSX"]~=null) then + files { + MAME_DIR .. "src/emu/video/psx.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/ramdac.h,VIDEOS += RAMDAC +-------------------------------------------------- + +if (VIDEOS["RAMDAC"]~=null) then + files { + MAME_DIR .. "src/emu/video/ramdac.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/saa5050.h,VIDEOS += SAA5050 +-------------------------------------------------- + +if (VIDEOS["SAA5050"]~=null) then + files { + MAME_DIR .. "src/emu/video/saa5050.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/sed1200.h,VIDEOS += SED1200 +-------------------------------------------------- +if (VIDEOS["SED1200"]~=null) then + files { + MAME_DIR .. "src/emu/video/sed1200.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/sed1330.h,VIDEOS += SED1330 +-------------------------------------------------- +if (VIDEOS["SED1330"]~=null) then + files { + MAME_DIR .. "src/emu/video/sed1330.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/sed1520.h,VIDEOS += SED1520 +-------------------------------------------------- +if (VIDEOS["SED1520"]~=null) then + files { + MAME_DIR .. "src/emu/video/sed1520.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/scn2674.h,VIDEOS += SCN2674 +-------------------------------------------------- +if (VIDEOS["SCN2674"]~=null) then + files { + MAME_DIR .. "src/emu/video/scn2674.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/snes_ppu.h,VIDEOS += SNES_PPU +-------------------------------------------------- +if (VIDEOS["SNES_PPU"]~=null) then + files { + MAME_DIR .. "src/emu/video/snes_ppu.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/stvvdp1.h,VIDEOS += STVVDP +--@src/emu/video/stvvdp2.h,VIDEOS += STVVDP +-------------------------------------------------- + +if (VIDEOS["STVVDP"]~=null) then + files { + MAME_DIR .. "src/emu/video/stvvdp1.c", + MAME_DIR .. "src/emu/video/stvvdp2.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/t6a04.h,VIDEOS += T6A04 +-------------------------------------------------- + +if (VIDEOS["T6A04"]~=null) then + files { + MAME_DIR .. "src/emu/video/t6a04.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/tea1002.h,VIDEOS += TEA1002 +-------------------------------------------------- + +if (VIDEOS["TEA1002"]~=null) then + files { + MAME_DIR .. "src/emu/video/tea1002.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/tlc34076.h,VIDEOS += TLC34076 +-------------------------------------------------- + +if (VIDEOS["TLC34076"]~=null) then + files { + MAME_DIR .. "src/emu/video/tlc34076.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/tms34061.h,VIDEOS += TMS34061 +-------------------------------------------------- + +if (VIDEOS["TMS34061"]~=null) then + files { + MAME_DIR .. "src/emu/video/tms34061.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/tms3556.h,VIDEOS += TMS3556 +-------------------------------------------------- + +if (VIDEOS["TMS3556"]~=null) then + files { + MAME_DIR .. "src/emu/video/tms3556.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/tms9927.h,VIDEOS += TMS9927 +-------------------------------------------------- + +if (VIDEOS["TMS9927"]~=null) then + files { + MAME_DIR .. "src/emu/video/tms9927.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/tms9928a.h,VIDEOS += TMS9928A +-------------------------------------------------- + +if (VIDEOS["TMS9928A"]~=null) then + files { + MAME_DIR .. "src/emu/video/tms9928a.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/upd3301.h,VIDEOS += UPD3301 +-------------------------------------------------- + +if (VIDEOS["UPD3301"]~=null) then + files { + MAME_DIR .. "src/emu/video/upd3301.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/upd7220.h,VIDEOS += UPD7220 +-------------------------------------------------- + +if (VIDEOS["UPD7220"]~=null) then + files { + MAME_DIR .. "src/emu/video/upd7220.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/upd7227.h,VIDEOS += UPD7227 +-------------------------------------------------- + +if (VIDEOS["UPD7227"]~=null) then + files { + MAME_DIR .. "src/emu/video/upd7227.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/vic4567.h,VIDEOS += VIC4567 +-------------------------------------------------- + +if (VIDEOS["VIC4567"]~=null) then + files { + MAME_DIR .. "src/emu/video/vic4567.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/v9938.h,VIDEOS += V9938 +-------------------------------------------------- + +if (VIDEOS["V9938"]~=null) then + files { + MAME_DIR .. "src/emu/video/v9938.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/voodoo.h,VIDEOS += VOODOO +-------------------------------------------------- + +if (VIDEOS["VOODOO"]~=null) then + files { + MAME_DIR .. "src/emu/video/voodoo.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/voodoo_pci.h,VIDEOS += VOODOO_PCI +-------------------------------------------------- + +if (VIDEOS["VOODOO_PCI"]~=null) then + files { + MAME_DIR .. "src/emu/video/voodoo_pci.c", + } +end + +-------------------------------------------------- +-- +--@src/emu/video/crtc_ega.h,VIDEOS += CRTC_EGA +-------------------------------------------------- + +if (VIDEOS["CRTC_EGA"]~=null) then + files { + MAME_DIR .. "src/emu/video/crtc_ega.c", + } +end diff --git a/scripts/target/ldplayer/ldplayer.lua b/scripts/target/ldplayer/ldplayer.lua new file mode 100644 index 00000000000..619f673eb84 --- /dev/null +++ b/scripts/target/ldplayer/ldplayer.lua @@ -0,0 +1,85 @@ +--------------------------------------------------------------------------- +-- +-- ldplayer.lua +-- +-- Small makefile to build a standalone laserdisc player +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +--------------------------------------------------------------------------- + +-------------------------------------------------- +-- specify required CPU cores (none) +-------------------------------------------------- + +CPUS["MCS48"] = true +CPUS["Z80"] = true + + + +-------------------------------------------------- +-- specify required sound cores +-------------------------------------------------- + +SOUNDS["WAVE"] = true + + +-------------------------------------------------- +-- specify available video cores +-------------------------------------------------- + +-------------------------------------------------- +-- specify available machine cores +-------------------------------------------------- + +MACHINES["LDV1000"] = true +MACHINES["LDPR8210"] = true + +-------------------------------------------------- +-- specify available bus cores +-- +-- MIDI is here as dummy bus to allow libbus.a to +-- be created on OSX. +-------------------------------------------------- + +BUSES["MIDI"] = true + +-------------------------------------------------- +-- this is the list of driver libraries that +-- comprise MAME plus mamedriv.o which contains +-- the list of drivers +-------------------------------------------------- + +function createProjects_ldplayer_ldplayer(_target, _subtarget) + project ("drvldplayer") + targetsubdir(_target .."_" .. _subtarget) + kind "StaticLib" + uuid (os.uuid("drvldplayer")) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mame", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "mame/layout", + } + + includeosd() + + files{ + MAME_DIR .. "src/emu/drivers/emudummy.c", + } +end + +function linkProjects_ldplayer_ldplayer(_target, _subtarget) + links { + "drvldplayer", + } +end
\ No newline at end of file diff --git a/scripts/target/mame/mame.lua b/scripts/target/mame/mame.lua new file mode 100644 index 00000000000..aaa698eda48 --- /dev/null +++ b/scripts/target/mame/mame.lua @@ -0,0 +1,3580 @@ +--------------------------------------------------------------------------- +-- +-- mame.lua +-- +-- MAME target makefile +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +--------------------------------------------------------------------------- + +-------------------------------------------------- +-- specify available CPU cores +--------------------------------------------------- + +CPUS["Z80"] = true +CPUS["Z180"] = true +CPUS["I8085"] = true +CPUS["I8089"] = true +CPUS["M6502"] = true +CPUS["H6280"] = true +CPUS["I86"] = true +CPUS["I386"] = true +CPUS["NEC"] = true +CPUS["V30MZ"] = true +CPUS["V60"] = true +CPUS["MCS48"] = true +CPUS["MCS51"] = true +CPUS["MCS96"] = true +CPUS["M6800"] = true +CPUS["M6805"] = true +CPUS["HD6309"] = true +CPUS["M6809"] = true +CPUS["KONAMI"] = true +CPUS["M680X0"] = true +CPUS["T11"] = true +CPUS["S2650"] = true +CPUS["TMS340X0"] = true +CPUS["TMS9900"] = true +CPUS["TMS9995"] = true +CPUS["TMS9900L"] = true +CPUS["Z8000"] = true +CPUS["Z8001"] = true +CPUS["TMS32010"] = true +CPUS["TMS32025"] = true +CPUS["TMS32031"] = true +CPUS["TMS32051"] = true +CPUS["TMS32082"] = true +CPUS["TMS57002"] = true +CPUS["CCPU"] = true +CPUS["ADSP21XX"] = true +CPUS["ASAP"] = true +CPUS["AM29000"] = true +CPUS["UPD7810"] = true +CPUS["ARM"] = true +CPUS["ARM7"] = true +CPUS["JAGUAR"] = true +CPUS["CUBEQCPU"] = true +CPUS["ESRIP"] = true +CPUS["MIPS"] = true +CPUS["PSX"] = true +CPUS["SH2"] = true +CPUS["SH4"] = true +CPUS["DSP16A"] = true +CPUS["DSP32C"] = true +CPUS["PIC16C5X"] = true +CPUS["PIC16C62X"] = true +CPUS["G65816"] = true +CPUS["SPC700"] = true +CPUS["E1"] = true +CPUS["I860"] = true +CPUS["I960"] = true +CPUS["H8"] = true +CPUS["V810"] = true +CPUS["M37710"] = true +CPUS["POWERPC"] = true +CPUS["SE3208"] = true +CPUS["MC68HC11"] = true +CPUS["ADSP21062"] = true +CPUS["DSP56156"] = true +CPUS["RSP"] = true +CPUS["ALPHA8201"] = true +CPUS["COP400"] = true +CPUS["TLCS90"] = true +CPUS["TLCS900"] = true +CPUS["MB88XX"] = true +CPUS["MB86233"] = true +CPUS["MB86235"] = true +CPUS["SSP1601"] = true +CPUS["APEXC"] = true +CPUS["CP1610"] = true +CPUS["F8"] = true +CPUS["LH5801"] = true +CPUS["PDP1"] = true +CPUS["SATURN"] = true +CPUS["SC61860"] = true +CPUS["LR35902"] = true +CPUS["TMS7000"] = true +CPUS["SM8500"] = true +CPUS["MINX"] = true +CPUS["SSEM"] = true +CPUS["AVR8"] = true +CPUS["TMS0980"] = true +CPUS["I4004"] = true +CPUS["SUPERFX"] = true +CPUS["Z8"] = true +CPUS["I8008"] = true +CPUS["SCMP"] = true +CPUS["MN10200"] = true +CPUS["COSMAC"] = true +CPUS["UNSP"] = true +CPUS["HCD62121"] = true +CPUS["PPS4"] = true +CPUS["UPD7725"] = true +CPUS["HD61700"] = true +CPUS["LC8670"] = true +CPUS["SCORE"] = true +CPUS["ES5510"] = true +CPUS["SCUDSP"] = true +CPUS["IE15"] = true +CPUS["8X300"] = true +CPUS["ALTO2"] = true +--CPUS["W65816"] = true +CPUS["ARC"] = true +CPUS["ARCOMPACT"] = true +CPUS["AMIS2000"] = true +CPUS["UCOM4"] = true +CPUS["HMCS40"] = true + +-------------------------------------------------- +-- specify available sound cores +-------------------------------------------------- + +SOUNDS["SAMPLES"] = true +SOUNDS["DAC"] = true +SOUNDS["DMADAC"] = true +SOUNDS["SPEAKER"] = true +SOUNDS["BEEP"] = true +SOUNDS["DISCRETE"] = true +SOUNDS["AY8910"] = true +SOUNDS["YM2151"] = true +SOUNDS["YM2203"] = true +SOUNDS["YM2413"] = true +SOUNDS["YM2608"] = true +SOUNDS["YM2610"] = true +SOUNDS["YM2610B"] = true +SOUNDS["YM2612"] = true +SOUNDS["YM3438"] = true +SOUNDS["YM3812"] = true +SOUNDS["YM3526"] = true +SOUNDS["Y8950"] = true +SOUNDS["YMF262"] = true +SOUNDS["YMF271"] = true +SOUNDS["YMF278B"] = true +SOUNDS["YMZ280B"] = true +SOUNDS["SN76477"] = true +SOUNDS["SN76496"] = true +SOUNDS["POKEY"] = true +SOUNDS["TIA"] = true +SOUNDS["NES_APU"] = true +SOUNDS["AMIGA"] = true +SOUNDS["ASTROCADE"] = true +SOUNDS["NAMCO"] = true +SOUNDS["NAMCO_15XX"] = true +SOUNDS["NAMCO_CUS30"] = true +SOUNDS["NAMCO_52XX"] = true +SOUNDS["NAMCO_63701X"] = true +SOUNDS["T6W28"] = true +SOUNDS["SNKWAVE"] = true +SOUNDS["C140"] = true +SOUNDS["C352"] = true +SOUNDS["TMS36XX"] = true +SOUNDS["TMS3615"] = true +SOUNDS["TMS5110"] = true +SOUNDS["TMS5220"] = true +SOUNDS["VLM5030"] = true +SOUNDS["ADPCM"] = true +SOUNDS["MSM5205"] = true +SOUNDS["MSM5232"] = true +SOUNDS["OKIM6258"] = true +SOUNDS["OKIM6295"] = true +SOUNDS["OKIM6376"] = true +SOUNDS["OKIM9810"] = true +--SOUNDS["UPD7752"] = true +SOUNDS["UPD7759"] = true +SOUNDS["HC55516"] = true +SOUNDS["TC8830F"] = true +SOUNDS["K005289"] = true +SOUNDS["K007232"] = true +SOUNDS["K051649"] = true +SOUNDS["K053260"] = true +SOUNDS["K054539"] = true +SOUNDS["K056800"] = true +SOUNDS["SEGAPCM"] = true +SOUNDS["MULTIPCM"] = true +SOUNDS["SCSP"] = true +SOUNDS["AICA"] = true +SOUNDS["RF5C68"] = true +SOUNDS["RF5C400"] = true +SOUNDS["CEM3394"] = true +SOUNDS["QSOUND"] = true +SOUNDS["QS1000"] = true +SOUNDS["SAA1099"] = true +SOUNDS["IREMGA20"] = true +SOUNDS["ES5503"] = true +SOUNDS["ES5505"] = true +SOUNDS["ES5506"] = true +SOUNDS["BSMT2000"] = true +SOUNDS["GAELCO_CG1V"] = true +SOUNDS["GAELCO_GAE1"] = true +SOUNDS["C6280"] = true +SOUNDS["SP0250"] = true +SOUNDS["SPU"] = true +SOUNDS["CDDA"] = true +SOUNDS["ICS2115"] = true +SOUNDS["I5000_SND"] = true +SOUNDS["ST0016"] = true +SOUNDS["NILE"] = true +SOUNDS["X1_010"] = true +SOUNDS["VRENDER0"] = true +SOUNDS["VOTRAX"] = true +SOUNDS["ES8712"] = true +SOUNDS["CDP1869"] = true +SOUNDS["S14001A"] = true +SOUNDS["WAVE"] = true +SOUNDS["SID6581"] = true +SOUNDS["SID8580"] = true +SOUNDS["SP0256"] = true +SOUNDS["DIGITALKER"] = true +SOUNDS["CDP1863"] = true +SOUNDS["CDP1864"] = true +SOUNDS["ZSG2"] = true +SOUNDS["MOS656X"] = true +SOUNDS["ASC"] = true +SOUNDS["MAS3507D"] = true +SOUNDS["SOCRATES"] = true +SOUNDS["TMC0285"] = true +SOUNDS["TMS5200"] = true +SOUNDS["CD2801"] = true +SOUNDS["CD2802"] = true +SOUNDS["M58817"] = true +SOUNDS["TMC0281"] = true +SOUNDS["TMS5100"] = true +SOUNDS["TMS5110A"] = true +SOUNDS["LMC1992"] = true +SOUNDS["AWACS"] = true +SOUNDS["YMZ770"] = true +SOUNDS["T6721A"] = true +SOUNDS["MOS7360"] = true +--SOUNDS["ESQPUMP"] = true +--SOUNDS["VRC6"] = true +SOUNDS["SB0400"] = true +SOUNDS["AC97"] = true +SOUNDS["ES1373"] = true +SOUNDS["L7A1045"] = true + +-------------------------------------------------- +-- specify available video cores +-------------------------------------------------- + +VIDEOS["SEGA315_5124"] = true +VIDEOS["SEGA315_5313"] = true +VIDEOS["BUFSPRITE"] = true +--VIDEOS["CDP1861"] = true +--VIDEOS["CDP1862"] = true +--VIDEOS["CRT9007"] = true +--VIDEOS["CRT9021"] = true +--VIDEOS["CRT9212"] = true +--VIDEOS["CRTC_EGA"] = true +--VIDEOS["DL1416"] = true +VIDEOS["DM9368"] = true +--VIDEOS["EF9340_1"] = true +--VIDEOS["EF9345"] = true +--VIDEOS["GF4500"] = true +VIDEOS["GF7600GS"] = true +VIDEOS["EPIC12"] = true +VIDEOS["FIXFREQ"] = true +VIDEOS["H63484"] = true +--VIDEOS["HD44102"] = true +--VIDEOS["HD44352"] = true +--VIDEOS["HD44780"] = true +VIDEOS["HD61830"] = true +VIDEOS["HD63484"] = true +--VIDEOS["HD66421"] = true +VIDEOS["HUC6202"] = true +VIDEOS["HUC6260"] = true +--VIDEOS["HUC6261"] = true +VIDEOS["HUC6270"] = true +--VIDEOS["HUC6272"] = true +--VIDEOS["I8244"] = true +VIDEOS["I8275"] = true +VIDEOS["M50458"] = true +VIDEOS["MB90082"] = true +VIDEOS["MB_VCU"] = true +VIDEOS["MC6845"] = true +--VIDEOS["MC6847"] = true +--VIDEOS["MSM6222B"] = true +--VIDEOS["MSM6255"] = true +--VIDEOS["MOS6566"] = true +VIDEOS["PC_VGA"] = true +VIDEOS["POLY"] = true +VIDEOS["PSX"] = true +VIDEOS["RAMDAC"] = true +--VIDEOS["S2636"] = true +VIDEOS["SAA5050"] = true +VIDEOS["SCN2674"] = true +--VIDEOS["SED1200"] = true +--VIDEOS["SED1330"] = true +--VIDEOS["SED1520"] = true +VIDEOS["SNES_PPU"] = true +VIDEOS["STVVDP"] = true +--VIDEOS["T6A04"] = true +VIDEOS["TLC34076"] = true +VIDEOS["TMS34061"] = true +--VIDEOS["TMS3556"] = true +VIDEOS["TMS9927"] = true +VIDEOS["TMS9928A"] = true +--VIDEOS["UPD3301"] = true +--VIDEOS["UPD7220"] = true +--VIDEOS["UPD7227"] = true +VIDEOS["V9938"] = true +--VIDEOS["VIC4567"] = true +VIDEOS["VOODOO"] = true +VIDEOS["VOODOO_PCI"] = true + +-------------------------------------------------- +-- specify available machine cores +-------------------------------------------------- + +MACHINES["AKIKO"] = true +MACHINES["NCR53C7XX"] = true +MACHINES["LSI53C810"] = true +MACHINES["6522VIA"] = true +MACHINES["TPI6525"] = true +MACHINES["RIOT6532"] = true +MACHINES["6821PIA"] = true +MACHINES["6840PTM"] = true +--MACHINES["68561MPCC"] = true +MACHINES["ACIA6850"] = true +MACHINES["68681"] = true +MACHINES["7200FIFO"] = true +--MACHINES["8530SCC"] = true +MACHINES["TTL74123"] = true +MACHINES["TTL74145"] = true +MACHINES["TTL74148"] = true +MACHINES["TTL74153"] = true +MACHINES["TTL74181"] = true +MACHINES["TTL7474"] = true +MACHINES["KBDC8042"] = true +MACHINES["I8257"] = true +MACHINES["AAKARTDEV"] = true +--MACHINES["ACIA6850"] = true +MACHINES["ADC0808"] = true +MACHINES["ADC083X"] = true +MACHINES["ADC1038"] = true +MACHINES["ADC1213X"] = true +MACHINES["AICARTC"] = true +MACHINES["AM53CF96"] = true +MACHINES["AM9517A"] = true +MACHINES["AMIGAFDC"] = true +--MACHINES["AT_KEYBC"] = true +MACHINES["AT28C16"] = true +MACHINES["AT29040"] = true +MACHINES["AT45DBXX"] = true +MACHINES["ATAFLASH"] = true +MACHINES["AY31015"] = true +MACHINES["BANKDEV"] = true +MACHINES["CDP1852"] = true +MACHINES["CDP1871"] = true +--MACHINES["CMOS40105"] = true +MACHINES["CDU76S"] = true +MACHINES["COM8116"] = true +MACHINES["CR589"] = true +--MACHINES["CS4031"] = true +--MACHINES["CS8221"] = true +--MACHINES["DP8390"] = true +MACHINES["DS1204"] = true +MACHINES["DS1302"] = true +--MACHINES["DS1315"] = true +MACHINES["DS2401"] = true +MACHINES["DS2404"] = true +MACHINES["DS75160A"] = true +MACHINES["DS75161A"] = true +MACHINES["E0516"] = true +MACHINES["E05A03"] = true +MACHINES["E05A30"] = true +MACHINES["EEPROMDEV"] = true +MACHINES["ER2055"] = true +MACHINES["F3853"] = true +--MACHINES["HD63450"] = true +--MACHINES["HD64610"] = true +MACHINES["I2CMEM"] = true +--MACHINES["I80130"] = true +--MACHINES["I8089"] = true +MACHINES["I8155"] = true +MACHINES["I8212"] = true +MACHINES["I8214"] = true +MACHINES["I8243"] = true +MACHINES["I8251"] = true +MACHINES["I8255"] = true +--MACHINES["I8257"] = true +--MACHINES["I8271"] = true +MACHINES["I8279"] = true +MACHINES["I8355"] = true +MACHINES["IDE"] = true +MACHINES["IM6402"] = true +MACHINES["INS8154"] = true +MACHINES["INS8250"] = true +MACHINES["INTELFLASH"] = true +MACHINES["JVS"] = true +MACHINES["K033906"] = true +MACHINES["K053252"] = true +MACHINES["K056230"] = true +--MACHINES["KB3600"] = true +--MACHINES["KBDC8042"] = true +--MACHINES["KR2376"] = true +MACHINES["LATCH8"] = true +MACHINES["LC89510"] = true +MACHINES["LDPR8210"] = true +MACHINES["LDSTUB"] = true +MACHINES["LDV1000"] = true +MACHINES["LDVP931"] = true +--MACHINES["LH5810"] = true +MACHINES["LINFLASH"] = true +MACHINES["LPCI"] = true +--MACHINES["LSI53C810"] = true +--MACHINES["M68307"] = true +--MACHINES["M68340"] = true +MACHINES["M6M80011AP"] = true +MACHINES["MATSUCD"] = true +MACHINES["MB14241"] = true +MACHINES["MB3773"] = true +MACHINES["MB8421"] = true +MACHINES["MB87078"] = true +--MACHINES["MB8795"] = true +--MACHINES["MB89352"] = true +MACHINES["MB89371"] = true +MACHINES["MC146818"] = true +MACHINES["MC2661"] = true +MACHINES["MC6843"] = true +MACHINES["MC6846"] = true +MACHINES["MC6852"] = true +MACHINES["MC6854"] = true +--MACHINES["MC68328"] = true +MACHINES["MC68901"] = true +MACHINES["MCCS1850"] = true +MACHINES["M68307"] = true +MACHINES["M68340"] = true +MACHINES["MCF5206E"] = true +MACHINES["MICROTOUCH"] = true +--MACHINES["MIOT6530"] = true +--MACHINES["MM58167"] = true +MACHINES["MM58274C"] = true +MACHINES["MM74C922"] = true +MACHINES["MOS6526"] = true +MACHINES["MOS6529"] = true +MACHINES["MIOT6530"] = true +MACHINES["MOS6551"] = true +--MACHINES["MOS6702"] = true +--MACHINES["MOS8706"] = true +--MACHINES["MOS8722"] = true +--MACHINES["MOS8726"] = true +--MACHINES["MPU401"] = true +MACHINES["MSM5832"] = true +MACHINES["MSM58321"] = true +MACHINES["MSM6242"] = true +--MACHINES["NCR5380"] = true +--MACHINES["NCR5380N"] = true +--MACHINES["NCR5390"] = true +MACHINES["NCR539x"] = true +--MACHINES["NCR53C7XX"] = true +MACHINES["NMC9306"] = true +--MACHINES["NSC810"] = true +MACHINES["NSCSI"] = true +--MACHINES["PC_FDC"] = true +--MACHINES["PC_LPT"] = true +--MACHINES["PCCARD"] = true +MACHINES["PCF8593"] = true +MACHINES["PCI"] = true +MACHINES["PCKEYBRD"] = true +MACHINES["PIC8259"] = true +MACHINES["PIT8253"] = true +MACHINES["PLA"] = true +--MACHINES["PROFILE"] = true +MACHINES["R10696"] = true +MACHINES["R10788"] = true +MACHINES["RA17XX"] = true +--MACHINES["R64H156"] = true +MACHINES["RF5C296"] = true +--MACHINES["RIOT6532"] = true +MACHINES["ROC10937"] = true +MACHINES["RP5C01"] = true +MACHINES["RP5C15"] = true +MACHINES["RP5H01"] = true +MACHINES["RTC4543"] = true +MACHINES["RTC65271"] = true +MACHINES["RTC9701"] = true +MACHINES["S2636"] = true +MACHINES["S3520CF"] = true +MACHINES["S3C2400"] = true +MACHINES["S3C2410"] = true +MACHINES["S3C2440"] = true +--MACHINES["S3C44B0"] = true +MACHINES["SATURN"] = true +MACHINES["SCSI"] = true +MACHINES["SCUDSP"] = true +--MACHINES["SECFLASH"] = true +MACHINES["SERFLASH"] = true +MACHINES["SMC91C9X"] = true +MACHINES["SMPC"] = true +MACHINES["STVCD"] = true +MACHINES["TC0091LVC"] = true +MACHINES["TIMEKPR"] = true +MACHINES["TMP68301"] = true +--MACHINES["TMS5501"] = true +MACHINES["TMS6100"] = true +MACHINES["TMS9901"] = true +MACHINES["TMS9902"] = true +--MACHINES["TPI6525"] = true +--MACHINES["TTL74123"] = true +--MACHINES["TTL74145"] = true +--MACHINES["TTL74148"] = true +--MACHINES["TTL74153"] = true +--MACHINES["TTL74181"] = true +--MACHINES["TTL7474"] = true +MACHINES["UPD1990A"] = true +MACHINES["UPD4992"] = true +MACHINES["UPD4701"] = true +MACHINES["UPD7002"] = true +MACHINES["UPD71071"] = true +MACHINES["UPD765"] = true +MACHINES["V3021"] = true +MACHINES["WD_FDC"] = true +MACHINES["WD11C00_17"] = true +MACHINES["WD17XX"] = true +MACHINES["WD2010"] = true +MACHINES["WD33C93"] = true +MACHINES["X2212"] = true +MACHINES["X76F041"] = true +MACHINES["X76F100"] = true +MACHINES["Z80CTC"] = true +MACHINES["Z80DART"] = true +MACHINES["Z80DMA"] = true +MACHINES["Z80PIO"] = true +MACHINES["Z80STI"] = true +MACHINES["Z8536"] = true +MACHINES["SECFLASH"] = true +MACHINES["PCCARD"] = true +MACHINES["FDC37C665GT"] = true +--MACHINES["SMC92X4"] = true +--MACHINES["TI99_HD"] = true +--MACHINES["STRATA"] = true +MACHINES["STEPPERS"] = true +--MACHINES["CORVUSHD"] = true +--MACHINES["WOZFDC"] = true +--MACHINES["DIABLO_HD"] = true + +-------------------------------------------------- +-- specify available bus cores +-------------------------------------------------- + +--BUSES["A1BUS"] = true +--BUSES["A2BUS"] = true +--BUSES["A7800"] = true +--BUSES["A800"] = true +--BUSES["ABCBUS"] = true +--BUSES["ABCKB"] = true +--BUSES["ADAM"] = true +--BUSES["ADAMNET"] = true +--BUSES["APF"] = true +--BUSES["ARCADIA"] = true +--BUSES["ASTROCADE"] = true +--BUSES["BML3"] = true +--BUSES["BW2"] = true +--BUSES["C64"] = true +--BUSES["CBM2"] = true +--BUSES["CBMIEC"] = true +BUSES["CENTRONICS"] = true +--BUSES["CHANNELF"] = true +--BUSES["COCO"] = true +--BUSES["COLECO"] = true +--BUSES["COMPUCOLOR"] = true +--BUSES["COMX35"] = true +--BUSES["CPC"] = true +--BUSES["CRVISION"] = true +--BUSES["DMV"] = true +--BUSES["ECBBUS"] = true +--BUSES["ECONET"] = true +--BUSES["EP64"] = true +--BUSES["EPSON_SIO"] = true +--BUSES["GAMEBOY"] = true +--BUSES["GBA"] = true +BUSES["GENERIC"] = true +--BUSES["IEEE488"] = true +--BUSES["IMI7000"] = true +--BUSES["INTV"] = true +--BUSES["IQ151"] = true +BUSES["ISA"] = true +--BUSES["ISBX"] = true +--BUSES["KC"] = true +--BUSES["LPCI"] = true +--BUSES["MACPDS"] = true +--BUSES["MIDI"] = true +--BUSES["MEGADRIVE"] = true +--BUSES["MSX_SLOT"] = true +BUSES["NEOGEO"] = true +--BUSES["NES"] = true +--BUSES["NUBUS"] = true +--BUSES["O2"] = true +--BUSES["ORICEXT"] = true +--BUSES["PCE"] = true +--BUSES["PC_JOY"] = true +--BUSES["PC_KBD"] = true +--BUSES["PET"] = true +--BUSES["PLUS4"] = true +--BUSES["PSX_CONTROLLER"] = true +--BUSES["QL"] = true +BUSES["RS232"] = true +--BUSES["S100"] = true +--BUSES["SATURN"] = true +BUSES["SCSI"] = true +--BUSES["SCV"] = true +--BUSES["SEGA8"] = true +--BUSES["SMS_CTRL"] = true +--BUSES["SMS_EXP"] = true +--BUSES["SNES"] = true +--BUSES["SPC1000"] = true +--BUSES["TI99PEB"] = true +--BUSES["TVC"] = true +--BUSES["VBOY"] = true +--BUSES["VC4000"] = true +--BUSES["VCS"] = true +--BUSES["VCS_CTRL"] = true +BUSES["VECTREX"] = true +--BUSES["VIC10"] = true +--BUSES["VIC20"] = true +--BUSES["VIDBRAIN"] = true +--BUSES["VIP"] = true +--BUSES["VTECH_IOEXP"] = true +--BUSES["VTECH_MEMEXP"] = true +--BUSES["WANGPC"] = true +--BUSES["WSWAN"] = true +--BUSES["X68K"] = true +--BUSES["Z88"] = true +--BUSES["ZORRO"] = true + +-------------------------------------------------- +-- this is the list of driver libraries that +-- comprise MAME plus mamedriv.o which contains +-- the list of drivers +-------------------------------------------------- + +function linkProjects_mame_mame(_target, _subtarget) + links { + "acorn", + "alba", + "alliedl", + "alpha", + "amiga", + "aristocr", + "ascii", + "atari", + "atlus", + "barcrest", + "bfm", + "bmc", + "capcom", + "cinemat", + "comad", + "cvs", + "dataeast", + "dgrm", + "dooyong", + "dynax", + "edevices", + "eolith", + "excelent", + "exidy", + "f32", + "funworld", + "fuuki", + "gaelco", + "gameplan", + "gametron", + "gottlieb", + "ibmpc", + "igs", + "irem", + "itech", + "jaleco", + "jpm", + "kaneko", + "konami", + "matic", + "maygay", + "meadows", + "merit", + "metro", + "midcoin", + "midw8080", + "midway", + "namco", + "nasco", + "neogeo", + "nichibut", + "nintendo", + "nix", + "nmk", + "omori", + "olympia", + "orca", + "pacific", + "pacman", + "pce", + "phoenix", + "playmark", + "psikyo", + "ramtek", + "rare", + "sanritsu", + "sega", + "seibu", + "seta", + "sigma", + "snk", + "sony", + "stern", + "subsino", + "sun", + "suna", + "sure", + "taito", + "tatsumi", + "tch", + "tecfri", + "technos", + "tehkan", + "thepit", + "toaplan", + "tong", + "unico", + "univers", + "upl", + "valadon", + "veltmjr", + "venture", + "vsystem", + "yunsung", + "zaccaria", + "misc", + "pinball", + "shared", + } +end + +function createMAMEProjects(_target, _subtarget, _name) + project (_name) + targetsubdir(_target .."_" .. _subtarget) + kind "StaticLib" + uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mame", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "mame/layout", + } + + includeosd() +end + +function createProjects_mame_mame(_target, _subtarget) +-------------------------------------------------- +-- the following files are general components and +-- shared across a number of drivers +-------------------------------------------------- + +createMAMEProjects(_target, _subtarget, "shared") +files { + MAME_DIR .. "src/mame/machine/nmk112.c", + MAME_DIR .. "src/mame/machine/pcshare.c", + MAME_DIR .. "src/mame/machine/segacrpt.c", + MAME_DIR .. "src/mame/machine/segacrp2.c", + MAME_DIR .. "src/mame/machine/ticket.c", + MAME_DIR .. "src/mame/video/avgdvg.c", + MAME_DIR .. "src/mame/audio/dcs.c", + MAME_DIR .. "src/mame/audio/decobsmt.c", + MAME_DIR .. "src/mame/audio/segam1audio.c", +} + +-------------------------------------------------- +-- manufacturer-specific groupings for drivers +-------------------------------------------------- + +createMAMEProjects(_target, _subtarget, "acorn") +files { + MAME_DIR .. "src/mame/drivers/ertictac.c", + MAME_DIR .. "src/mame/drivers/ssfindo.c", + MAME_DIR .. "src/mame/drivers/aristmk5.c", + MAME_DIR .. "src/mame/machine/archimds.c", + MAME_DIR .. "src/mame/video/archimds.c", +} + +createMAMEProjects(_target, _subtarget, "alba") +files { + MAME_DIR .. "src/mame/drivers/albazc.c", + MAME_DIR .. "src/mame/drivers/albazg.c", + MAME_DIR .. "src/mame/drivers/rmhaihai.c", +} + +createMAMEProjects(_target, _subtarget, "alliedl") +files { + MAME_DIR .. "src/mame/drivers/ace.c", + MAME_DIR .. "src/mame/drivers/aleisttl.c", + MAME_DIR .. "src/mame/drivers/clayshoo.c", +} + +createMAMEProjects(_target, _subtarget, "alpha") +files { + MAME_DIR .. "src/mame/drivers/alpha68k.c", + MAME_DIR .. "src/mame/video/alpha68k.c", + MAME_DIR .. "src/mame/drivers/champbas.c", + MAME_DIR .. "src/mame/video/champbas.c", + MAME_DIR .. "src/mame/drivers/equites.c", + MAME_DIR .. "src/mame/video/equites.c", + MAME_DIR .. "src/mame/drivers/meijinsn.c", + MAME_DIR .. "src/mame/drivers/shougi.c", +} + +createMAMEProjects(_target, _subtarget, "amiga") +files { + MAME_DIR .. "src/mame/drivers/alg.c", + MAME_DIR .. "src/mame/machine/amiga.c", + MAME_DIR .. "src/mame/video/amiga.c", + MAME_DIR .. "src/mame/video/amigaaga.c", + MAME_DIR .. "src/mame/drivers/arcadia.c", + MAME_DIR .. "src/mame/drivers/cubo.c", + MAME_DIR .. "src/mame/drivers/mquake.c", + MAME_DIR .. "src/mame/drivers/upscope.c", +} + +createMAMEProjects(_target, _subtarget, "aristocr") +files { + MAME_DIR .. "src/mame/drivers/aristmk4.c", + MAME_DIR .. "src/mame/drivers/aristmk6.c", + MAME_DIR .. "src/mame/drivers/caswin.c", +} + +createMAMEProjects(_target, _subtarget, "ascii") +files { + MAME_DIR .. "src/mame/drivers/big10.c", + MAME_DIR .. "src/mame/drivers/forte2.c", + MAME_DIR .. "src/mame/drivers/pengadvb.c", + MAME_DIR .. "src/mame/drivers/sangho.c", + MAME_DIR .. "src/mame/drivers/sfkick.c", +} + +createMAMEProjects(_target, _subtarget, "atari") +files { + MAME_DIR .. "src/mame/drivers/arcadecl.c", + MAME_DIR .. "src/mame/video/arcadecl.c", + MAME_DIR .. "src/mame/drivers/asteroid.c", + MAME_DIR .. "src/mame/machine/asteroid.c", + MAME_DIR .. "src/mame/audio/asteroid.c", + MAME_DIR .. "src/mame/audio/llander.c", + MAME_DIR .. "src/mame/drivers/atarifb.c", + MAME_DIR .. "src/mame/machine/atarifb.c", + MAME_DIR .. "src/mame/audio/atarifb.c", + MAME_DIR .. "src/mame/video/atarifb.c", + MAME_DIR .. "src/mame/drivers/atarig1.c", + MAME_DIR .. "src/mame/video/atarig1.c", + MAME_DIR .. "src/mame/drivers/atarig42.c", + MAME_DIR .. "src/mame/video/atarig42.c", + MAME_DIR .. "src/mame/drivers/atarigt.c", + MAME_DIR .. "src/mame/video/atarigt.c", + MAME_DIR .. "src/mame/drivers/atarigx2.c", + MAME_DIR .. "src/mame/video/atarigx2.c", + MAME_DIR .. "src/mame/drivers/atarisy1.c", + MAME_DIR .. "src/mame/video/atarisy1.c", + MAME_DIR .. "src/mame/drivers/atarisy2.c", + MAME_DIR .. "src/mame/video/atarisy2.c", + MAME_DIR .. "src/mame/drivers/atarisy4.c", + MAME_DIR .. "src/mame/drivers/atarittl.c", + MAME_DIR .. "src/mame/drivers/atetris.c", + MAME_DIR .. "src/mame/video/atetris.c", + MAME_DIR .. "src/mame/drivers/avalnche.c", + MAME_DIR .. "src/mame/audio/avalnche.c", + MAME_DIR .. "src/mame/drivers/badlands.c", + MAME_DIR .. "src/mame/video/badlands.c", + MAME_DIR .. "src/mame/drivers/bartop52.c", + MAME_DIR .. "src/mame/drivers/batman.c", + MAME_DIR .. "src/mame/video/batman.c", + MAME_DIR .. "src/mame/drivers/beathead.c", + MAME_DIR .. "src/mame/video/beathead.c", + MAME_DIR .. "src/mame/drivers/blstroid.c", + MAME_DIR .. "src/mame/video/blstroid.c", + MAME_DIR .. "src/mame/drivers/boxer.c", + MAME_DIR .. "src/mame/drivers/bsktball.c", + MAME_DIR .. "src/mame/machine/bsktball.c", + MAME_DIR .. "src/mame/audio/bsktball.c", + MAME_DIR .. "src/mame/video/bsktball.c", + MAME_DIR .. "src/mame/drivers/bwidow.c", + MAME_DIR .. "src/mame/audio/bwidow.c", + MAME_DIR .. "src/mame/drivers/bzone.c", + MAME_DIR .. "src/mame/audio/bzone.c", + MAME_DIR .. "src/mame/drivers/canyon.c", + MAME_DIR .. "src/mame/audio/canyon.c", + MAME_DIR .. "src/mame/video/canyon.c", + MAME_DIR .. "src/mame/drivers/cball.c", + MAME_DIR .. "src/mame/drivers/ccastles.c", + MAME_DIR .. "src/mame/video/ccastles.c", + MAME_DIR .. "src/mame/drivers/centiped.c", + MAME_DIR .. "src/mame/video/centiped.c", + MAME_DIR .. "src/mame/drivers/cloak.c", + MAME_DIR .. "src/mame/video/cloak.c", + MAME_DIR .. "src/mame/drivers/cloud9.c", + MAME_DIR .. "src/mame/video/cloud9.c", + MAME_DIR .. "src/mame/drivers/cmmb.c", + MAME_DIR .. "src/mame/drivers/cops.c", + MAME_DIR .. "src/mame/drivers/copsnrob.c", + MAME_DIR .. "src/mame/audio/copsnrob.c", + MAME_DIR .. "src/mame/video/copsnrob.c", + MAME_DIR .. "src/mame/drivers/cyberbal.c", + MAME_DIR .. "src/mame/audio/cyberbal.c", + MAME_DIR .. "src/mame/video/cyberbal.c", + MAME_DIR .. "src/mame/drivers/destroyr.c", + MAME_DIR .. "src/mame/drivers/dragrace.c", + MAME_DIR .. "src/mame/audio/dragrace.c", + MAME_DIR .. "src/mame/video/dragrace.c", + MAME_DIR .. "src/mame/drivers/eprom.c", + MAME_DIR .. "src/mame/video/eprom.c", + MAME_DIR .. "src/mame/drivers/firefox.c", + MAME_DIR .. "src/mame/drivers/firetrk.c", + MAME_DIR .. "src/mame/audio/firetrk.c", + MAME_DIR .. "src/mame/video/firetrk.c", + MAME_DIR .. "src/mame/drivers/flyball.c", + MAME_DIR .. "src/mame/drivers/foodf.c", + MAME_DIR .. "src/mame/video/foodf.c", + MAME_DIR .. "src/mame/drivers/gauntlet.c", + MAME_DIR .. "src/mame/video/gauntlet.c", + MAME_DIR .. "src/mame/drivers/harddriv.c", + MAME_DIR .. "src/mame/machine/harddriv.c", + MAME_DIR .. "src/mame/audio/harddriv.c", + MAME_DIR .. "src/mame/video/harddriv.c", + MAME_DIR .. "src/mame/drivers/irobot.c", + MAME_DIR .. "src/mame/machine/irobot.c", + MAME_DIR .. "src/mame/video/irobot.c", + MAME_DIR .. "src/mame/drivers/jaguar.c", + MAME_DIR .. "src/mame/audio/jaguar.c", + MAME_DIR .. "src/mame/video/jaguar.c", + MAME_DIR .. "src/mame/drivers/jedi.c", + MAME_DIR .. "src/mame/audio/jedi.c", + MAME_DIR .. "src/mame/video/jedi.c", + MAME_DIR .. "src/mame/drivers/klax.c", + MAME_DIR .. "src/mame/video/klax.c", + MAME_DIR .. "src/mame/drivers/liberatr.c", + MAME_DIR .. "src/mame/video/liberatr.c", + MAME_DIR .. "src/mame/drivers/mediagx.c", + MAME_DIR .. "src/mame/drivers/metalmx.c", + MAME_DIR .. "src/mame/drivers/mgolf.c", + MAME_DIR .. "src/mame/drivers/mhavoc.c", + MAME_DIR .. "src/mame/machine/mhavoc.c", + MAME_DIR .. "src/mame/drivers/missile.c", + MAME_DIR .. "src/mame/drivers/nitedrvr.c", + MAME_DIR .. "src/mame/machine/nitedrvr.c", + MAME_DIR .. "src/mame/audio/nitedrvr.c", + MAME_DIR .. "src/mame/video/nitedrvr.c", + MAME_DIR .. "src/mame/drivers/offtwall.c", + MAME_DIR .. "src/mame/video/offtwall.c", + MAME_DIR .. "src/mame/drivers/orbit.c", + MAME_DIR .. "src/mame/audio/orbit.c", + MAME_DIR .. "src/mame/video/orbit.c", + MAME_DIR .. "src/mame/drivers/pong.c", + MAME_DIR .. "src/mame/drivers/nl_pong.c", + MAME_DIR .. "src/mame/drivers/nl_pongd.c", + MAME_DIR .. "src/mame/drivers/poolshrk.c", + MAME_DIR .. "src/mame/audio/poolshrk.c", + MAME_DIR .. "src/mame/video/poolshrk.c", + MAME_DIR .. "src/mame/drivers/quantum.c", + MAME_DIR .. "src/mame/drivers/quizshow.c", + MAME_DIR .. "src/mame/drivers/rampart.c", + MAME_DIR .. "src/mame/video/rampart.c", + MAME_DIR .. "src/mame/drivers/relief.c", + MAME_DIR .. "src/mame/video/relief.c", + MAME_DIR .. "src/mame/drivers/runaway.c", + MAME_DIR .. "src/mame/video/runaway.c", + MAME_DIR .. "src/mame/drivers/sbrkout.c", + MAME_DIR .. "src/mame/drivers/shuuz.c", + MAME_DIR .. "src/mame/video/shuuz.c", + MAME_DIR .. "src/mame/drivers/skullxbo.c", + MAME_DIR .. "src/mame/video/skullxbo.c", + MAME_DIR .. "src/mame/drivers/skydiver.c", + MAME_DIR .. "src/mame/audio/skydiver.c", + MAME_DIR .. "src/mame/video/skydiver.c", + MAME_DIR .. "src/mame/drivers/skyraid.c", + MAME_DIR .. "src/mame/audio/skyraid.c", + MAME_DIR .. "src/mame/video/skyraid.c", + MAME_DIR .. "src/mame/drivers/sprint2.c", + MAME_DIR .. "src/mame/audio/sprint2.c", + MAME_DIR .. "src/mame/video/sprint2.c", + MAME_DIR .. "src/mame/drivers/sprint4.c", + MAME_DIR .. "src/mame/video/sprint4.c", + MAME_DIR .. "src/mame/audio/sprint4.c", + MAME_DIR .. "src/mame/drivers/sprint8.c", + MAME_DIR .. "src/mame/audio/sprint8.c", + MAME_DIR .. "src/mame/video/sprint8.c", + MAME_DIR .. "src/mame/drivers/starshp1.c", + MAME_DIR .. "src/mame/audio/starshp1.c", + MAME_DIR .. "src/mame/video/starshp1.c", + MAME_DIR .. "src/mame/drivers/starwars.c", + MAME_DIR .. "src/mame/machine/starwars.c", + MAME_DIR .. "src/mame/audio/starwars.c", + MAME_DIR .. "src/mame/drivers/subs.c", + MAME_DIR .. "src/mame/machine/subs.c", + MAME_DIR .. "src/mame/audio/subs.c", + MAME_DIR .. "src/mame/video/subs.c", + MAME_DIR .. "src/mame/drivers/tank8.c", + MAME_DIR .. "src/mame/audio/tank8.c", + MAME_DIR .. "src/mame/video/tank8.c", + MAME_DIR .. "src/mame/drivers/tempest.c", + MAME_DIR .. "src/mame/drivers/thunderj.c", + MAME_DIR .. "src/mame/video/thunderj.c", + MAME_DIR .. "src/mame/drivers/tomcat.c", + MAME_DIR .. "src/mame/drivers/toobin.c", + MAME_DIR .. "src/mame/video/toobin.c", + MAME_DIR .. "src/mame/drivers/tourtabl.c", + MAME_DIR .. "src/mame/video/tia.c", + MAME_DIR .. "src/mame/drivers/triplhnt.c", + MAME_DIR .. "src/mame/audio/triplhnt.c", + MAME_DIR .. "src/mame/video/triplhnt.c", + MAME_DIR .. "src/mame/drivers/tunhunt.c", + MAME_DIR .. "src/mame/video/tunhunt.c", + MAME_DIR .. "src/mame/drivers/ultratnk.c", + MAME_DIR .. "src/mame/video/ultratnk.c", + MAME_DIR .. "src/mame/drivers/videopin.c", + MAME_DIR .. "src/mame/audio/videopin.c", + MAME_DIR .. "src/mame/video/videopin.c", + MAME_DIR .. "src/mame/drivers/vindictr.c", + MAME_DIR .. "src/mame/video/vindictr.c", + MAME_DIR .. "src/mame/drivers/wolfpack.c", + MAME_DIR .. "src/mame/video/wolfpack.c", + MAME_DIR .. "src/mame/drivers/xybots.c", + MAME_DIR .. "src/mame/video/xybots.c", + MAME_DIR .. "src/mame/machine/asic65.c", + MAME_DIR .. "src/mame/machine/atari_vg.c", + MAME_DIR .. "src/mame/machine/atarigen.c", + MAME_DIR .. "src/mame/machine/mathbox.c", + MAME_DIR .. "src/mame/machine/slapstic.c", + MAME_DIR .. "src/mame/audio/atarijsa.c", + MAME_DIR .. "src/mame/audio/cage.c", + MAME_DIR .. "src/mame/audio/redbaron.c", + MAME_DIR .. "src/mame/video/atarimo.c", + MAME_DIR .. "src/mame/video/atarirle.c", +} + +createMAMEProjects(_target, _subtarget, "atlus") +files { + MAME_DIR .. "src/mame/drivers/blmbycar.c", + MAME_DIR .. "src/mame/video/blmbycar.c", + MAME_DIR .. "src/mame/drivers/ohmygod.c", + MAME_DIR .. "src/mame/video/ohmygod.c", + MAME_DIR .. "src/mame/drivers/powerins.c", + MAME_DIR .. "src/mame/video/powerins.c", + MAME_DIR .. "src/mame/drivers/bowltry.c", +} + +createMAMEProjects(_target, _subtarget, "barcrest") +files { + MAME_DIR .. "src/mame/drivers/mpu2.c", + MAME_DIR .. "src/mame/drivers/mpu3.c", + MAME_DIR .. "src/mame/drivers/mpu4hw.c", + MAME_DIR .. "src/mame/drivers/mpu4sw.c", + MAME_DIR .. "src/mame/drivers/mpu4.c", + MAME_DIR .. "src/mame/drivers/mpu4mod2sw.c", + MAME_DIR .. "src/mame/drivers/mpu4mod4yam.c", + MAME_DIR .. "src/mame/drivers/mpu4plasma.c", + MAME_DIR .. "src/mame/drivers/mpu4dealem.c", + MAME_DIR .. "src/mame/drivers/mpu4vid.c", + MAME_DIR .. "src/mame/drivers/mpu4avan.c", + MAME_DIR .. "src/mame/drivers/mpu4union.c", + MAME_DIR .. "src/mame/drivers/mpu4concept.c", + MAME_DIR .. "src/mame/drivers/mpu4empire.c", + MAME_DIR .. "src/mame/drivers/mpu4mdm.c", + MAME_DIR .. "src/mame/drivers/mpu4crystal.c", + MAME_DIR .. "src/mame/drivers/mpu4bwb.c", + MAME_DIR .. "src/mame/drivers/mpu4misc.c", + MAME_DIR .. "src/mame/drivers/mpu5hw.c", + MAME_DIR .. "src/mame/drivers/mpu5.c", + MAME_DIR .. "src/mame/video/awpvid.c", + MAME_DIR .. "src/mame/machine/meters.c", +} + +createMAMEProjects(_target, _subtarget, "bfm") +files { + MAME_DIR .. "src/mame/drivers/bfcobra.c", + MAME_DIR .. "src/mame/machine/bfm_comn.c", + MAME_DIR .. "src/mame/drivers/bfm_sc1.c", + MAME_DIR .. "src/mame/drivers/bfm_sc2.c", + MAME_DIR .. "src/mame/video/bfm_adr2.c", + MAME_DIR .. "src/mame/drivers/bfm_sc4.c", + MAME_DIR .. "src/mame/drivers/bfm_sc4h.c", + MAME_DIR .. "src/mame/drivers/bfm_sc5.c", + MAME_DIR .. "src/mame/drivers/bfm_sc5sw.c", + MAME_DIR .. "src/mame/drivers/bfm_ad5.c", + MAME_DIR .. "src/mame/drivers/bfm_ad5sw.c", + MAME_DIR .. "src/mame/drivers/bfm_sc45_helper.c", + MAME_DIR .. "src/mame/drivers/bfm_swp.c", + MAME_DIR .. "src/mame/drivers/bfmsys83.c", + MAME_DIR .. "src/mame/drivers/bfmsys85.c", + MAME_DIR .. "src/mame/machine/sec.c", + MAME_DIR .. "src/mame/machine/bfm_bd1.c", + MAME_DIR .. "src/mame/machine/bfm_bda.c", + MAME_DIR .. "src/mame/video/bfm_dm01.c", + MAME_DIR .. "src/mame/drivers/rastersp.c", +} + +createMAMEProjects(_target, _subtarget, "bmc") +files { + MAME_DIR .. "src/mame/drivers/bmcbowl.c", + MAME_DIR .. "src/mame/drivers/koftball.c", + MAME_DIR .. "src/mame/drivers/popobear.c", + MAME_DIR .. "src/mame/drivers/bmcpokr.c", +} + +createMAMEProjects(_target, _subtarget, "capcom") +files { + MAME_DIR .. "src/mame/drivers/1942.c", + MAME_DIR .. "src/mame/video/1942.c", + MAME_DIR .. "src/mame/drivers/1943.c", + MAME_DIR .. "src/mame/video/1943.c", + MAME_DIR .. "src/mame/drivers/alien.c", + MAME_DIR .. "src/mame/drivers/bionicc.c", + MAME_DIR .. "src/mame/video/bionicc.c", + MAME_DIR .. "src/mame/drivers/supduck.c", + MAME_DIR .. "src/mame/video/tigeroad_spr.c", + MAME_DIR .. "src/mame/drivers/blktiger.c", + MAME_DIR .. "src/mame/video/blktiger.c", + MAME_DIR .. "src/mame/drivers/cbasebal.c", + MAME_DIR .. "src/mame/video/cbasebal.c", + MAME_DIR .. "src/mame/drivers/commando.c", + MAME_DIR .. "src/mame/video/commando.c", + MAME_DIR .. "src/mame/drivers/cps1.c", + MAME_DIR .. "src/mame/video/cps1.c", + MAME_DIR .. "src/mame/drivers/kenseim.c", + MAME_DIR .. "src/mame/drivers/cps2.c", + MAME_DIR .. "src/mame/machine/cps2crpt.c", + MAME_DIR .. "src/mame/drivers/cps3.c", + MAME_DIR .. "src/mame/audio/cps3.c", + MAME_DIR .. "src/mame/drivers/egghunt.c", + MAME_DIR .. "src/mame/drivers/exedexes.c", + MAME_DIR .. "src/mame/video/exedexes.c", + MAME_DIR .. "src/mame/drivers/fcrash.c", + MAME_DIR .. "src/mame/drivers/gng.c", + MAME_DIR .. "src/mame/video/gng.c", + MAME_DIR .. "src/mame/drivers/gunsmoke.c", + MAME_DIR .. "src/mame/video/gunsmoke.c", + MAME_DIR .. "src/mame/drivers/higemaru.c", + MAME_DIR .. "src/mame/video/higemaru.c", + MAME_DIR .. "src/mame/drivers/lastduel.c", + MAME_DIR .. "src/mame/video/lastduel.c", + MAME_DIR .. "src/mame/drivers/lwings.c", + MAME_DIR .. "src/mame/video/lwings.c", + MAME_DIR .. "src/mame/drivers/mitchell.c", + MAME_DIR .. "src/mame/video/mitchell.c", + MAME_DIR .. "src/mame/drivers/sf.c", + MAME_DIR .. "src/mame/video/sf.c", + MAME_DIR .. "src/mame/drivers/sidearms.c", + MAME_DIR .. "src/mame/video/sidearms.c", + MAME_DIR .. "src/mame/drivers/sonson.c", + MAME_DIR .. "src/mame/video/sonson.c", + MAME_DIR .. "src/mame/drivers/srumbler.c", + MAME_DIR .. "src/mame/video/srumbler.c", + MAME_DIR .. "src/mame/drivers/tigeroad.c", + MAME_DIR .. "src/mame/video/tigeroad.c", + MAME_DIR .. "src/mame/machine/tigeroad.c", + MAME_DIR .. "src/mame/drivers/vulgus.c", + MAME_DIR .. "src/mame/video/vulgus.c", + MAME_DIR .. "src/mame/machine/kabuki.c", +} + +createMAMEProjects(_target, _subtarget, "cinemat") +files { + MAME_DIR .. "src/mame/drivers/ataxx.c", + MAME_DIR .. "src/mame/drivers/cinemat.c", + MAME_DIR .. "src/mame/audio/cinemat.c", + MAME_DIR .. "src/mame/video/cinemat.c", + MAME_DIR .. "src/mame/drivers/cchasm.c", + MAME_DIR .. "src/mame/machine/cchasm.c", + MAME_DIR .. "src/mame/audio/cchasm.c", + MAME_DIR .. "src/mame/video/cchasm.c", + MAME_DIR .. "src/mame/drivers/dlair.c", + MAME_DIR .. "src/mame/drivers/dlair2.c", + MAME_DIR .. "src/mame/drivers/embargo.c", + MAME_DIR .. "src/mame/drivers/jack.c", + MAME_DIR .. "src/mame/video/jack.c", + MAME_DIR .. "src/mame/drivers/leland.c", + MAME_DIR .. "src/mame/machine/leland.c", + MAME_DIR .. "src/mame/audio/leland.c", + MAME_DIR .. "src/mame/video/leland.c", +} + +createMAMEProjects(_target, _subtarget, "comad") +files { + MAME_DIR .. "src/mame/drivers/funybubl.c", + MAME_DIR .. "src/mame/video/funybubl.c", + MAME_DIR .. "src/mame/drivers/galspnbl.c", + MAME_DIR .. "src/mame/video/galspnbl.c", + MAME_DIR .. "src/mame/drivers/zerozone.c", + MAME_DIR .. "src/mame/video/zerozone.c", +} + +createMAMEProjects(_target, _subtarget, "cvs") +files { + MAME_DIR .. "src/mame/drivers/cvs.c", + MAME_DIR .. "src/mame/video/cvs.c", + MAME_DIR .. "src/mame/drivers/galaxia.c", + MAME_DIR .. "src/mame/video/galaxia.c", + MAME_DIR .. "src/mame/drivers/quasar.c", + MAME_DIR .. "src/mame/video/quasar.c", +} + +createMAMEProjects(_target, _subtarget, "dataeast") +files { + MAME_DIR .. "src/mame/drivers/actfancr.c", + MAME_DIR .. "src/mame/video/actfancr.c", + MAME_DIR .. "src/mame/drivers/astrof.c", + MAME_DIR .. "src/mame/audio/astrof.c", + MAME_DIR .. "src/mame/drivers/backfire.c", + MAME_DIR .. "src/mame/drivers/battlera.c", + MAME_DIR .. "src/mame/video/battlera.c", + MAME_DIR .. "src/mame/drivers/boogwing.c", + MAME_DIR .. "src/mame/video/boogwing.c", + MAME_DIR .. "src/mame/drivers/brkthru.c", + MAME_DIR .. "src/mame/video/brkthru.c", + MAME_DIR .. "src/mame/drivers/btime.c", + MAME_DIR .. "src/mame/machine/btime.c", + MAME_DIR .. "src/mame/video/btime.c", + MAME_DIR .. "src/mame/drivers/bwing.c", + MAME_DIR .. "src/mame/video/bwing.c", + MAME_DIR .. "src/mame/drivers/cbuster.c", + MAME_DIR .. "src/mame/video/cbuster.c", + MAME_DIR .. "src/mame/drivers/chanbara.c", + MAME_DIR .. "src/mame/drivers/cninja.c", + MAME_DIR .. "src/mame/video/cninja.c", + MAME_DIR .. "src/mame/drivers/cntsteer.c", + MAME_DIR .. "src/mame/drivers/compgolf.c", + MAME_DIR .. "src/mame/video/compgolf.c", + MAME_DIR .. "src/mame/drivers/darkseal.c", + MAME_DIR .. "src/mame/video/darkseal.c", + MAME_DIR .. "src/mame/drivers/dassault.c", + MAME_DIR .. "src/mame/video/dassault.c", + MAME_DIR .. "src/mame/drivers/dblewing.c", + MAME_DIR .. "src/mame/drivers/dec0.c", + MAME_DIR .. "src/mame/machine/dec0.c", + MAME_DIR .. "src/mame/video/dec0.c", + MAME_DIR .. "src/mame/drivers/dec8.c", + MAME_DIR .. "src/mame/video/dec8.c", + MAME_DIR .. "src/mame/machine/deco222.c", + MAME_DIR .. "src/mame/machine/decocpu7.c", + MAME_DIR .. "src/mame/machine/decocpu6.c", + MAME_DIR .. "src/mame/drivers/deco_ld.c", + MAME_DIR .. "src/mame/drivers/deco_mlc.c", + MAME_DIR .. "src/mame/video/deco_mlc.c", + MAME_DIR .. "src/mame/drivers/deco156.c", + MAME_DIR .. "src/mame/machine/deco156.c", + MAME_DIR .. "src/mame/drivers/deco32.c", + MAME_DIR .. "src/mame/video/deco32.c", + MAME_DIR .. "src/mame/video/dvi.c", + MAME_DIR .. "src/mame/video/deco_zoomspr.c", + MAME_DIR .. "src/mame/drivers/decocass.c", + MAME_DIR .. "src/mame/machine/decocass.c", + MAME_DIR .. "src/mame/machine/decocass_tape.c", + MAME_DIR .. "src/mame/video/decocass.c", + MAME_DIR .. "src/mame/drivers/deshoros.c", + MAME_DIR .. "src/mame/drivers/dietgo.c", + MAME_DIR .. "src/mame/video/dietgo.c", + MAME_DIR .. "src/mame/drivers/dreambal.c", + MAME_DIR .. "src/mame/drivers/exprraid.c", + MAME_DIR .. "src/mame/video/exprraid.c", + MAME_DIR .. "src/mame/drivers/firetrap.c", + MAME_DIR .. "src/mame/video/firetrap.c", + MAME_DIR .. "src/mame/drivers/funkyjet.c", + MAME_DIR .. "src/mame/video/funkyjet.c", + MAME_DIR .. "src/mame/drivers/karnov.c", + MAME_DIR .. "src/mame/video/karnov.c", + MAME_DIR .. "src/mame/drivers/kchamp.c", + MAME_DIR .. "src/mame/video/kchamp.c", + MAME_DIR .. "src/mame/drivers/kingobox.c", + MAME_DIR .. "src/mame/video/kingobox.c", + MAME_DIR .. "src/mame/drivers/lemmings.c", + MAME_DIR .. "src/mame/video/lemmings.c", + MAME_DIR .. "src/mame/drivers/liberate.c", + MAME_DIR .. "src/mame/video/liberate.c", + MAME_DIR .. "src/mame/drivers/madalien.c", + MAME_DIR .. "src/mame/audio/madalien.c", + MAME_DIR .. "src/mame/video/madalien.c", + MAME_DIR .. "src/mame/drivers/madmotor.c", + MAME_DIR .. "src/mame/video/madmotor.c", + MAME_DIR .. "src/mame/drivers/metlclsh.c", + MAME_DIR .. "src/mame/video/metlclsh.c", + MAME_DIR .. "src/mame/drivers/mirage.c", + MAME_DIR .. "src/mame/drivers/pcktgal.c", + MAME_DIR .. "src/mame/video/pcktgal.c", + MAME_DIR .. "src/mame/drivers/pktgaldx.c", + MAME_DIR .. "src/mame/video/pktgaldx.c", + MAME_DIR .. "src/mame/drivers/progolf.c", + MAME_DIR .. "src/mame/drivers/rohga.c", + MAME_DIR .. "src/mame/video/rohga.c", + MAME_DIR .. "src/mame/drivers/shootout.c", + MAME_DIR .. "src/mame/video/shootout.c", + MAME_DIR .. "src/mame/drivers/sidepckt.c", + MAME_DIR .. "src/mame/video/sidepckt.c", + MAME_DIR .. "src/mame/drivers/simpl156.c", + MAME_DIR .. "src/mame/video/simpl156.c", + MAME_DIR .. "src/mame/drivers/sshangha.c", + MAME_DIR .. "src/mame/video/sshangha.c", + MAME_DIR .. "src/mame/drivers/stadhero.c", + MAME_DIR .. "src/mame/video/stadhero.c", + MAME_DIR .. "src/mame/drivers/supbtime.c", + MAME_DIR .. "src/mame/video/supbtime.c", + MAME_DIR .. "src/mame/drivers/tryout.c", + MAME_DIR .. "src/mame/video/tryout.c", + MAME_DIR .. "src/mame/drivers/tumbleb.c", + MAME_DIR .. "src/mame/video/tumbleb.c", + MAME_DIR .. "src/mame/drivers/tumblep.c", + MAME_DIR .. "src/mame/video/tumblep.c", + MAME_DIR .. "src/mame/drivers/vaportra.c", + MAME_DIR .. "src/mame/video/vaportra.c", + MAME_DIR .. "src/mame/machine/deco102.c", + MAME_DIR .. "src/mame/machine/decocrpt.c", + MAME_DIR .. "src/mame/machine/deco104.c", + MAME_DIR .. "src/mame/machine/deco146.c", + MAME_DIR .. "src/mame/video/decbac06.c", + MAME_DIR .. "src/mame/video/deco16ic.c", + MAME_DIR .. "src/mame/video/decocomn.c", + MAME_DIR .. "src/mame/video/decospr.c", + MAME_DIR .. "src/mame/video/decmxc06.c", + MAME_DIR .. "src/mame/video/deckarn.c", +} + +createMAMEProjects(_target, _subtarget, "dgrm") +files { + MAME_DIR .. "src/mame/drivers/blackt96.c", + MAME_DIR .. "src/mame/drivers/pokechmp.c", + MAME_DIR .. "src/mame/video/pokechmp.c", +} + +createMAMEProjects(_target, _subtarget, "dooyong") +files { + MAME_DIR .. "src/mame/drivers/dooyong.c", + MAME_DIR .. "src/mame/video/dooyong.c", + MAME_DIR .. "src/mame/drivers/gundealr.c", + MAME_DIR .. "src/mame/video/gundealr.c", +} + +createMAMEProjects(_target, _subtarget, "dynax") +files { + MAME_DIR .. "src/mame/drivers/ddenlovr.c", + MAME_DIR .. "src/mame/drivers/dynax.c", + MAME_DIR .. "src/mame/video/dynax.c", + MAME_DIR .. "src/mame/drivers/hnayayoi.c", + MAME_DIR .. "src/mame/video/hnayayoi.c", + MAME_DIR .. "src/mame/drivers/realbrk.c", + MAME_DIR .. "src/mame/video/realbrk.c", + MAME_DIR .. "src/mame/drivers/royalmah.c", +} + +createMAMEProjects(_target, _subtarget, "edevices") +files { + MAME_DIR .. "src/mame/drivers/diverboy.c", + MAME_DIR .. "src/mame/drivers/fantland.c", + MAME_DIR .. "src/mame/video/fantland.c", + MAME_DIR .. "src/mame/drivers/mwarr.c", + MAME_DIR .. "src/mame/drivers/mugsmash.c", + MAME_DIR .. "src/mame/video/mugsmash.c", + MAME_DIR .. "src/mame/drivers/ppmast93.c", + MAME_DIR .. "src/mame/drivers/pzletime.c", + MAME_DIR .. "src/mame/drivers/stlforce.c", + MAME_DIR .. "src/mame/video/stlforce.c", + MAME_DIR .. "src/mame/drivers/twins.c", +} + +createMAMEProjects(_target, _subtarget, "eolith") +files { + MAME_DIR .. "src/mame/drivers/eolith.c", + MAME_DIR .. "src/mame/video/eolith.c", + MAME_DIR .. "src/mame/drivers/eolith16.c", + MAME_DIR .. "src/mame/drivers/eolithsp.c", + MAME_DIR .. "src/mame/drivers/ghosteo.c", + MAME_DIR .. "src/mame/drivers/vegaeo.c", +} + +createMAMEProjects(_target, _subtarget, "excelent") +files { + MAME_DIR .. "src/mame/drivers/aquarium.c", + MAME_DIR .. "src/mame/video/aquarium.c", + MAME_DIR .. "src/mame/drivers/d9final.c", + MAME_DIR .. "src/mame/drivers/dblcrown.c", + MAME_DIR .. "src/mame/drivers/gcpinbal.c", + MAME_DIR .. "src/mame/video/gcpinbal.c", + MAME_DIR .. "src/mame/video/excellent_spr.c", + MAME_DIR .. "src/mame/drivers/lastbank.c", +} + +createMAMEProjects(_target, _subtarget, "exidy") +files { + MAME_DIR .. "src/mame/drivers/carpolo.c", + MAME_DIR .. "src/mame/machine/carpolo.c", + MAME_DIR .. "src/mame/video/carpolo.c", + MAME_DIR .. "src/mame/drivers/circus.c", + MAME_DIR .. "src/mame/audio/circus.c", + MAME_DIR .. "src/mame/video/circus.c", + MAME_DIR .. "src/mame/drivers/exidy.c", + MAME_DIR .. "src/mame/audio/exidy.c", + MAME_DIR .. "src/mame/video/exidy.c", + MAME_DIR .. "src/mame/audio/targ.c", + MAME_DIR .. "src/mame/drivers/exidy440.c", + MAME_DIR .. "src/mame/audio/exidy440.c", + MAME_DIR .. "src/mame/video/exidy440.c", + MAME_DIR .. "src/mame/drivers/exidyttl.c", + MAME_DIR .. "src/mame/drivers/maxaflex.c", + MAME_DIR .. "src/mame/machine/atari.c", + MAME_DIR .. "src/mame/video/atari.c", + MAME_DIR .. "src/mame/video/antic.c", + MAME_DIR .. "src/mame/video/gtia.c", + MAME_DIR .. "src/mame/drivers/starfire.c", + MAME_DIR .. "src/mame/video/starfire.c", + MAME_DIR .. "src/mame/drivers/vertigo.c", + MAME_DIR .. "src/mame/machine/vertigo.c", + MAME_DIR .. "src/mame/video/vertigo.c", + MAME_DIR .. "src/mame/drivers/victory.c", + MAME_DIR .. "src/mame/video/victory.c", +} + +createMAMEProjects(_target, _subtarget, "f32") +files { + MAME_DIR .. "src/mame/drivers/crospang.c", + MAME_DIR .. "src/mame/video/crospang.c", + MAME_DIR .. "src/mame/drivers/silvmil.c", + MAME_DIR .. "src/mame/drivers/f-32.c", +} + +createMAMEProjects(_target, _subtarget, "funworld") +files { + MAME_DIR .. "src/mame/drivers/4roses.c", + MAME_DIR .. "src/mame/drivers/funworld.c", + MAME_DIR .. "src/mame/video/funworld.c", + MAME_DIR .. "src/mame/drivers/snookr10.c", + MAME_DIR .. "src/mame/video/snookr10.c", +} + +createMAMEProjects(_target, _subtarget, "fuuki") +files { + MAME_DIR .. "src/mame/drivers/fuukifg2.c", + MAME_DIR .. "src/mame/video/fuukifg2.c", + MAME_DIR .. "src/mame/drivers/fuukifg3.c", + MAME_DIR .. "src/mame/video/fuukifg3.c", + MAME_DIR .. "src/mame/video/fuukifg.c", +} + +createMAMEProjects(_target, _subtarget, "gaelco") +files { + MAME_DIR .. "src/mame/drivers/atvtrack.c", + MAME_DIR .. "src/mame/drivers/gaelco.c", + MAME_DIR .. "src/mame/video/gaelco.c", + MAME_DIR .. "src/mame/machine/gaelcrpt.c", + MAME_DIR .. "src/mame/drivers/gaelco2.c", + MAME_DIR .. "src/mame/machine/gaelco2.c", + MAME_DIR .. "src/mame/video/gaelco2.c", + MAME_DIR .. "src/mame/drivers/gaelco3d.c", + MAME_DIR .. "src/mame/video/gaelco3d.c", + MAME_DIR .. "src/mame/machine/gaelco3d.c", + MAME_DIR .. "src/mame/drivers/glass.c", + MAME_DIR .. "src/mame/video/glass.c", + MAME_DIR .. "src/mame/drivers/mastboy.c", + MAME_DIR .. "src/mame/drivers/splash.c", + MAME_DIR .. "src/mame/video/splash.c", + MAME_DIR .. "src/mame/drivers/targeth.c", + MAME_DIR .. "src/mame/video/targeth.c", + MAME_DIR .. "src/mame/drivers/thoop2.c", + MAME_DIR .. "src/mame/video/thoop2.c", + MAME_DIR .. "src/mame/drivers/tokyocop.c", + MAME_DIR .. "src/mame/drivers/wrally.c", + MAME_DIR .. "src/mame/machine/wrally.c", + MAME_DIR .. "src/mame/video/wrally.c", + MAME_DIR .. "src/mame/drivers/xorworld.c", + MAME_DIR .. "src/mame/video/xorworld.c", +} + +createMAMEProjects(_target, _subtarget, "gameplan") +files { + MAME_DIR .. "src/mame/drivers/enigma2.c", + MAME_DIR .. "src/mame/drivers/gameplan.c", + MAME_DIR .. "src/mame/video/gameplan.c", + MAME_DIR .. "src/mame/drivers/toratora.c", +} + +createMAMEProjects(_target, _subtarget, "gametron") +files { + MAME_DIR .. "src/mame/drivers/gatron.c", + MAME_DIR .. "src/mame/video/gatron.c", + MAME_DIR .. "src/mame/drivers/gotya.c", + MAME_DIR .. "src/mame/audio/gotya.c", + MAME_DIR .. "src/mame/video/gotya.c", + MAME_DIR .. "src/mame/drivers/sbugger.c", + MAME_DIR .. "src/mame/video/sbugger.c", +} + +createMAMEProjects(_target, _subtarget, "gottlieb") +files { + MAME_DIR .. "src/mame/drivers/exterm.c", + MAME_DIR .. "src/mame/video/exterm.c", + MAME_DIR .. "src/mame/drivers/gottlieb.c", + MAME_DIR .. "src/mame/audio/gottlieb.c", + MAME_DIR .. "src/mame/video/gottlieb.c", +} + +createMAMEProjects(_target, _subtarget, "ibmpc") +files { + MAME_DIR .. "src/mame/drivers/calchase.c", + MAME_DIR .. "src/mame/drivers/fruitpc.c", + MAME_DIR .. "src/mame/drivers/pangofun.c", + MAME_DIR .. "src/mame/drivers/pcat_dyn.c", + MAME_DIR .. "src/mame/drivers/pcat_nit.c", + MAME_DIR .. "src/mame/drivers/pcxt.c", + MAME_DIR .. "src/mame/drivers/quakeat.c", + MAME_DIR .. "src/mame/drivers/queen.c", + MAME_DIR .. "src/mame/drivers/igspc.c", +} + +createMAMEProjects(_target, _subtarget, "igs") +files { + MAME_DIR .. "src/mame/drivers/cabaret.c", + MAME_DIR .. "src/mame/drivers/ddz.c", + MAME_DIR .. "src/mame/drivers/dunhuang.c", + MAME_DIR .. "src/mame/drivers/goldstar.c", + MAME_DIR .. "src/mame/video/goldstar.c", + MAME_DIR .. "src/mame/drivers/jackie.c", + MAME_DIR .. "src/mame/drivers/igspoker.c", + MAME_DIR .. "src/mame/drivers/igs009.c", + MAME_DIR .. "src/mame/drivers/igs011.c", + MAME_DIR .. "src/mame/drivers/igs017.c", + MAME_DIR .. "src/mame/drivers/igs_m027.c", + MAME_DIR .. "src/mame/drivers/igs_m036.c", + MAME_DIR .. "src/mame/drivers/iqblock.c", + MAME_DIR .. "src/mame/video/iqblock.c", + MAME_DIR .. "src/mame/drivers/lordgun.c", + MAME_DIR .. "src/mame/video/lordgun.c", + MAME_DIR .. "src/mame/drivers/pgm.c", + MAME_DIR .. "src/mame/video/pgm.c", + MAME_DIR .. "src/mame/machine/pgmprot_igs027a_type1.c", + MAME_DIR .. "src/mame/machine/pgmprot_igs027a_type2.c", + MAME_DIR .. "src/mame/machine/pgmprot_igs027a_type3.c", + MAME_DIR .. "src/mame/machine/pgmprot_igs025_igs012.c", + MAME_DIR .. "src/mame/machine/pgmprot_igs025_igs022.c", + MAME_DIR .. "src/mame/machine/pgmprot_igs025_igs028.c", + MAME_DIR .. "src/mame/machine/pgmprot_orlegend.c", + MAME_DIR .. "src/mame/drivers/pgm2.c", + MAME_DIR .. "src/mame/drivers/spoker.c", + MAME_DIR .. "src/mame/machine/igs036crypt.c", + MAME_DIR .. "src/mame/machine/pgmcrypt.c", + MAME_DIR .. "src/mame/machine/igs025.c", + MAME_DIR .. "src/mame/machine/igs022.c", + MAME_DIR .. "src/mame/machine/igs028.c", +} + +createMAMEProjects(_target, _subtarget, "irem") +files { + MAME_DIR .. "src/mame/drivers/m10.c", + MAME_DIR .. "src/mame/video/m10.c", + MAME_DIR .. "src/mame/drivers/m14.c", + MAME_DIR .. "src/mame/drivers/m52.c", + MAME_DIR .. "src/mame/video/m52.c", + MAME_DIR .. "src/mame/drivers/m57.c", + MAME_DIR .. "src/mame/video/m57.c", + MAME_DIR .. "src/mame/drivers/m58.c", + MAME_DIR .. "src/mame/video/m58.c", + MAME_DIR .. "src/mame/drivers/m62.c", + MAME_DIR .. "src/mame/video/m62.c", + MAME_DIR .. "src/mame/drivers/m63.c", + MAME_DIR .. "src/mame/drivers/m72.c", + MAME_DIR .. "src/mame/audio/m72.c", + MAME_DIR .. "src/mame/video/m72.c", + MAME_DIR .. "src/mame/drivers/m90.c", + MAME_DIR .. "src/mame/video/m90.c", + MAME_DIR .. "src/mame/drivers/m92.c", + MAME_DIR .. "src/mame/video/m92.c", + MAME_DIR .. "src/mame/drivers/m107.c", + MAME_DIR .. "src/mame/video/m107.c", + MAME_DIR .. "src/mame/drivers/olibochu.c", + MAME_DIR .. "src/mame/drivers/redalert.c", + MAME_DIR .. "src/mame/audio/redalert.c", + MAME_DIR .. "src/mame/video/redalert.c", + MAME_DIR .. "src/mame/drivers/shisen.c", + MAME_DIR .. "src/mame/video/shisen.c", + MAME_DIR .. "src/mame/drivers/travrusa.c", + MAME_DIR .. "src/mame/video/travrusa.c", + MAME_DIR .. "src/mame/drivers/vigilant.c", + MAME_DIR .. "src/mame/video/vigilant.c", + MAME_DIR .. "src/mame/machine/irem_cpu.c", + MAME_DIR .. "src/mame/audio/irem.c", +} + +createMAMEProjects(_target, _subtarget, "itech") +files { + MAME_DIR .. "src/mame/drivers/capbowl.c", + MAME_DIR .. "src/mame/video/capbowl.c", + MAME_DIR .. "src/mame/drivers/itech8.c", + MAME_DIR .. "src/mame/machine/slikshot.c", + MAME_DIR .. "src/mame/video/itech8.c", + MAME_DIR .. "src/mame/drivers/itech32.c", + MAME_DIR .. "src/mame/video/itech32.c", + MAME_DIR .. "src/mame/drivers/iteagle.c", + MAME_DIR .. "src/mame/machine/iteagle_fpga.c", +} + +createMAMEProjects(_target, _subtarget, "jaleco") +files { + MAME_DIR .. "src/mame/drivers/aeroboto.c", + MAME_DIR .. "src/mame/video/aeroboto.c", + MAME_DIR .. "src/mame/drivers/argus.c", + MAME_DIR .. "src/mame/video/argus.c", + MAME_DIR .. "src/mame/drivers/bestleag.c", + MAME_DIR .. "src/mame/drivers/bigstrkb.c", + MAME_DIR .. "src/mame/video/bigstrkb.c", + MAME_DIR .. "src/mame/drivers/blueprnt.c", + MAME_DIR .. "src/mame/video/blueprnt.c", + MAME_DIR .. "src/mame/drivers/bnstars.c", + MAME_DIR .. "src/mame/drivers/cischeat.c", + MAME_DIR .. "src/mame/video/cischeat.c", + MAME_DIR .. "src/mame/drivers/citycon.c", + MAME_DIR .. "src/mame/video/citycon.c", + MAME_DIR .. "src/mame/drivers/ddayjlc.c", + MAME_DIR .. "src/mame/drivers/exerion.c", + MAME_DIR .. "src/mame/video/exerion.c", + MAME_DIR .. "src/mame/drivers/fcombat.c", + MAME_DIR .. "src/mame/video/fcombat.c", + MAME_DIR .. "src/mame/drivers/ginganin.c", + MAME_DIR .. "src/mame/video/ginganin.c", + MAME_DIR .. "src/mame/drivers/homerun.c", + MAME_DIR .. "src/mame/video/homerun.c", + MAME_DIR .. "src/mame/drivers/megasys1.c", + MAME_DIR .. "src/mame/video/megasys1.c", + MAME_DIR .. "src/mame/drivers/momoko.c", + MAME_DIR .. "src/mame/video/momoko.c", + MAME_DIR .. "src/mame/drivers/ms32.c", + MAME_DIR .. "src/mame/video/ms32.c", + MAME_DIR .. "src/mame/drivers/psychic5.c", + MAME_DIR .. "src/mame/video/psychic5.c", + MAME_DIR .. "src/mame/drivers/pturn.c", + MAME_DIR .. "src/mame/drivers/skyfox.c", + MAME_DIR .. "src/mame/video/skyfox.c", + MAME_DIR .. "src/mame/drivers/tetrisp2.c", + MAME_DIR .. "src/mame/video/tetrisp2.c", + MAME_DIR .. "src/mame/machine/jalcrpt.c", + MAME_DIR .. "src/mame/video/jalblend.c", +} + +createMAMEProjects(_target, _subtarget, "jpm") +files { + MAME_DIR .. "src/mame/drivers/guab.c", + MAME_DIR .. "src/mame/drivers/jpmsys5.c", + MAME_DIR .. "src/mame/drivers/jpmsys5sw.c", + MAME_DIR .. "src/mame/drivers/jpmmps.c", + MAME_DIR .. "src/mame/drivers/jpms80.c", + MAME_DIR .. "src/mame/drivers/jpmsru.c", + MAME_DIR .. "src/mame/drivers/jpmimpct.c", + MAME_DIR .. "src/mame/video/jpmimpct.c", + MAME_DIR .. "src/mame/drivers/jpmimpctsw.c", + MAME_DIR .. "src/mame/drivers/pluto5.c", + MAME_DIR .. "src/mame/drivers/jpmsys7.c", + MAME_DIR .. "src/mame/video/awpvid.c", + MAME_DIR .. "src/mame/machine/meters.c", +} + +createMAMEProjects(_target, _subtarget, "kaneko") +files { + MAME_DIR .. "src/mame/drivers/airbustr.c", + MAME_DIR .. "src/mame/video/airbustr.c", + MAME_DIR .. "src/mame/drivers/djboy.c", + MAME_DIR .. "src/mame/video/djboy.c", + MAME_DIR .. "src/mame/drivers/expro02.c", + MAME_DIR .. "src/mame/drivers/galpanic.c", + MAME_DIR .. "src/mame/video/galpanic.c", + MAME_DIR .. "src/mame/drivers/galpani2.c", + MAME_DIR .. "src/mame/video/galpani2.c", + MAME_DIR .. "src/mame/drivers/galpani3.c", + MAME_DIR .. "src/mame/video/kaneko_grap2.c", + MAME_DIR .. "src/mame/drivers/hvyunit.c", + MAME_DIR .. "src/mame/drivers/jchan.c", + MAME_DIR .. "src/mame/drivers/kaneko16.c", + MAME_DIR .. "src/mame/video/kaneko16.c", + MAME_DIR .. "src/mame/video/kaneko_tmap.c", + MAME_DIR .. "src/mame/video/kaneko_spr.c", + MAME_DIR .. "src/mame/machine/kaneko_hit.c", + MAME_DIR .. "src/mame/machine/kaneko_calc3.c", + MAME_DIR .. "src/mame/machine/kaneko_toybox.c", + MAME_DIR .. "src/mame/drivers/sandscrp.c", + MAME_DIR .. "src/mame/drivers/suprnova.c", + MAME_DIR .. "src/mame/video/suprnova.c", + MAME_DIR .. "src/mame/video/sknsspr.c", +} + +createMAMEProjects(_target, _subtarget, "konami") +files { + MAME_DIR .. "src/mame/drivers/88games.c", + MAME_DIR .. "src/mame/video/88games.c", + MAME_DIR .. "src/mame/drivers/ajax.c", + MAME_DIR .. "src/mame/machine/ajax.c", + MAME_DIR .. "src/mame/video/ajax.c", + MAME_DIR .. "src/mame/drivers/aliens.c", + MAME_DIR .. "src/mame/video/aliens.c", + MAME_DIR .. "src/mame/drivers/asterix.c", + MAME_DIR .. "src/mame/video/asterix.c", + MAME_DIR .. "src/mame/drivers/battlnts.c", + MAME_DIR .. "src/mame/video/battlnts.c", + MAME_DIR .. "src/mame/drivers/bishi.c", + MAME_DIR .. "src/mame/video/bishi.c", + MAME_DIR .. "src/mame/drivers/bladestl.c", + MAME_DIR .. "src/mame/video/bladestl.c", + MAME_DIR .. "src/mame/drivers/blockhl.c", + MAME_DIR .. "src/mame/video/blockhl.c", + MAME_DIR .. "src/mame/drivers/bottom9.c", + MAME_DIR .. "src/mame/video/bottom9.c", + MAME_DIR .. "src/mame/drivers/chqflag.c", + MAME_DIR .. "src/mame/video/chqflag.c", + MAME_DIR .. "src/mame/drivers/circusc.c", + MAME_DIR .. "src/mame/video/circusc.c", + MAME_DIR .. "src/mame/drivers/cobra.c", + MAME_DIR .. "src/mame/drivers/combatsc.c", + MAME_DIR .. "src/mame/video/combatsc.c", + MAME_DIR .. "src/mame/drivers/contra.c", + MAME_DIR .. "src/mame/video/contra.c", + MAME_DIR .. "src/mame/drivers/crimfght.c", + MAME_DIR .. "src/mame/video/crimfght.c", + MAME_DIR .. "src/mame/drivers/dbz.c", + MAME_DIR .. "src/mame/video/dbz.c", + MAME_DIR .. "src/mame/drivers/ddribble.c", + MAME_DIR .. "src/mame/video/ddribble.c", + MAME_DIR .. "src/mame/drivers/djmain.c", + MAME_DIR .. "src/mame/video/djmain.c", + MAME_DIR .. "src/mame/drivers/fastfred.c", + MAME_DIR .. "src/mame/video/fastfred.c", + MAME_DIR .. "src/mame/drivers/fastlane.c", + MAME_DIR .. "src/mame/video/fastlane.c", + MAME_DIR .. "src/mame/drivers/finalizr.c", + MAME_DIR .. "src/mame/video/finalizr.c", + MAME_DIR .. "src/mame/drivers/firebeat.c", + MAME_DIR .. "src/mame/machine/midikbd.c", + MAME_DIR .. "src/mame/drivers/flkatck.c", + MAME_DIR .. "src/mame/video/flkatck.c", + MAME_DIR .. "src/mame/drivers/gberet.c", + MAME_DIR .. "src/mame/video/gberet.c", + MAME_DIR .. "src/mame/drivers/gijoe.c", + MAME_DIR .. "src/mame/video/gijoe.c", + MAME_DIR .. "src/mame/drivers/gradius3.c", + MAME_DIR .. "src/mame/video/gradius3.c", + MAME_DIR .. "src/mame/drivers/gticlub.c", + MAME_DIR .. "src/mame/drivers/gyruss.c", + MAME_DIR .. "src/mame/video/gyruss.c", + MAME_DIR .. "src/mame/drivers/hcastle.c", + MAME_DIR .. "src/mame/video/hcastle.c", + MAME_DIR .. "src/mame/drivers/hexion.c", + MAME_DIR .. "src/mame/video/hexion.c", + MAME_DIR .. "src/mame/drivers/hornet.c", + MAME_DIR .. "src/mame/machine/konppc.c", + MAME_DIR .. "src/mame/drivers/hyperspt.c", + MAME_DIR .. "src/mame/audio/hyprolyb.c", + MAME_DIR .. "src/mame/video/hyperspt.c", + MAME_DIR .. "src/mame/drivers/ironhors.c", + MAME_DIR .. "src/mame/video/ironhors.c", + MAME_DIR .. "src/mame/drivers/jackal.c", + MAME_DIR .. "src/mame/video/jackal.c", + MAME_DIR .. "src/mame/drivers/jailbrek.c", + MAME_DIR .. "src/mame/video/jailbrek.c", + MAME_DIR .. "src/mame/drivers/junofrst.c", + MAME_DIR .. "src/mame/drivers/konamigq.c", + MAME_DIR .. "src/mame/drivers/konamigv.c", + MAME_DIR .. "src/mame/drivers/konamigx.c", + MAME_DIR .. "src/mame/machine/konamigx.c", + MAME_DIR .. "src/mame/video/konamigx.c", + MAME_DIR .. "src/mame/drivers/konamim2.c", + MAME_DIR .. "src/mame/drivers/kontest.c", + MAME_DIR .. "src/mame/drivers/konendev.c", + MAME_DIR .. "src/mame/drivers/ksys573.c", + MAME_DIR .. "src/mame/machine/k573cass.c", + MAME_DIR .. "src/mame/machine/k573dio.c", + MAME_DIR .. "src/mame/machine/k573mcr.c", + MAME_DIR .. "src/mame/machine/k573msu.c", + MAME_DIR .. "src/mame/machine/k573npu.c", + MAME_DIR .. "src/mame/machine/zs01.c", + MAME_DIR .. "src/mame/drivers/labyrunr.c", + MAME_DIR .. "src/mame/video/labyrunr.c", + MAME_DIR .. "src/mame/drivers/lethal.c", + MAME_DIR .. "src/mame/video/lethal.c", + MAME_DIR .. "src/mame/drivers/mainevt.c", + MAME_DIR .. "src/mame/video/mainevt.c", + MAME_DIR .. "src/mame/drivers/megazone.c", + MAME_DIR .. "src/mame/video/megazone.c", + MAME_DIR .. "src/mame/drivers/mikie.c", + MAME_DIR .. "src/mame/video/mikie.c", + MAME_DIR .. "src/mame/drivers/mogura.c", + MAME_DIR .. "src/mame/drivers/moo.c", + MAME_DIR .. "src/mame/video/moo.c", + MAME_DIR .. "src/mame/drivers/mystwarr.c", + MAME_DIR .. "src/mame/video/mystwarr.c", + MAME_DIR .. "src/mame/drivers/nemesis.c", + MAME_DIR .. "src/mame/video/nemesis.c", + MAME_DIR .. "src/mame/drivers/nwk-tr.c", + MAME_DIR .. "src/mame/drivers/overdriv.c", + MAME_DIR .. "src/mame/video/overdriv.c", + MAME_DIR .. "src/mame/drivers/pandoras.c", + MAME_DIR .. "src/mame/video/pandoras.c", + MAME_DIR .. "src/mame/drivers/parodius.c", + MAME_DIR .. "src/mame/video/parodius.c", + MAME_DIR .. "src/mame/drivers/pingpong.c", + MAME_DIR .. "src/mame/video/pingpong.c", + MAME_DIR .. "src/mame/drivers/plygonet.c", + MAME_DIR .. "src/mame/video/plygonet.c", + MAME_DIR .. "src/mame/drivers/pooyan.c", + MAME_DIR .. "src/mame/video/pooyan.c", + MAME_DIR .. "src/mame/drivers/pyson.c", + MAME_DIR .. "src/mame/drivers/qdrmfgp.c", + MAME_DIR .. "src/mame/video/qdrmfgp.c", + MAME_DIR .. "src/mame/drivers/rockrage.c", + MAME_DIR .. "src/mame/video/rockrage.c", + MAME_DIR .. "src/mame/drivers/rocnrope.c", + MAME_DIR .. "src/mame/video/rocnrope.c", + MAME_DIR .. "src/mame/drivers/rollerg.c", + MAME_DIR .. "src/mame/video/rollerg.c", + MAME_DIR .. "src/mame/drivers/rungun.c", + MAME_DIR .. "src/mame/video/rungun.c", + MAME_DIR .. "src/mame/drivers/sbasketb.c", + MAME_DIR .. "src/mame/video/sbasketb.c", + MAME_DIR .. "src/mame/drivers/scobra.c", + MAME_DIR .. "src/mame/drivers/scotrsht.c", + MAME_DIR .. "src/mame/video/scotrsht.c", + MAME_DIR .. "src/mame/drivers/scramble.c", + MAME_DIR .. "src/mame/machine/scramble.c", + MAME_DIR .. "src/mame/audio/scramble.c", + MAME_DIR .. "src/mame/drivers/shaolins.c", + MAME_DIR .. "src/mame/video/shaolins.c", + MAME_DIR .. "src/mame/drivers/simpsons.c", + MAME_DIR .. "src/mame/machine/simpsons.c", + MAME_DIR .. "src/mame/video/simpsons.c", + MAME_DIR .. "src/mame/drivers/spy.c", + MAME_DIR .. "src/mame/video/spy.c", + MAME_DIR .. "src/mame/drivers/surpratk.c", + MAME_DIR .. "src/mame/video/surpratk.c", + MAME_DIR .. "src/mame/drivers/tasman.c", + MAME_DIR .. "src/mame/drivers/tgtpanic.c", + MAME_DIR .. "src/mame/drivers/thunderx.c", + MAME_DIR .. "src/mame/video/thunderx.c", + MAME_DIR .. "src/mame/drivers/timeplt.c", + MAME_DIR .. "src/mame/audio/timeplt.c", + MAME_DIR .. "src/mame/video/timeplt.c", + MAME_DIR .. "src/mame/drivers/tmnt.c", + MAME_DIR .. "src/mame/video/tmnt.c", + MAME_DIR .. "src/mame/drivers/tp84.c", + MAME_DIR .. "src/mame/video/tp84.c", + MAME_DIR .. "src/mame/drivers/trackfld.c", + MAME_DIR .. "src/mame/machine/konami1.c", + MAME_DIR .. "src/mame/audio/trackfld.c", + MAME_DIR .. "src/mame/video/trackfld.c", + MAME_DIR .. "src/mame/drivers/tutankhm.c", + MAME_DIR .. "src/mame/video/tutankhm.c", + MAME_DIR .. "src/mame/drivers/twin16.c", + MAME_DIR .. "src/mame/video/twin16.c", + MAME_DIR .. "src/mame/drivers/twinkle.c", + MAME_DIR .. "src/mame/drivers/ultrsprt.c", + MAME_DIR .. "src/mame/drivers/ultraman.c", + MAME_DIR .. "src/mame/video/ultraman.c", + MAME_DIR .. "src/mame/drivers/vendetta.c", + MAME_DIR .. "src/mame/video/vendetta.c", + MAME_DIR .. "src/mame/drivers/viper.c", + MAME_DIR .. "src/mame/drivers/wecleman.c", + MAME_DIR .. "src/mame/video/wecleman.c", + MAME_DIR .. "src/mame/drivers/xexex.c", + MAME_DIR .. "src/mame/video/xexex.c", + MAME_DIR .. "src/mame/drivers/xmen.c", + MAME_DIR .. "src/mame/video/xmen.c", + MAME_DIR .. "src/mame/drivers/yiear.c", + MAME_DIR .. "src/mame/video/yiear.c", + MAME_DIR .. "src/mame/drivers/zr107.c", + MAME_DIR .. "src/mame/video/konami_helper.c", + MAME_DIR .. "src/mame/video/k007121.c", + MAME_DIR .. "src/mame/video/k007342.c", + MAME_DIR .. "src/mame/video/k007420.c", + MAME_DIR .. "src/mame/video/k037122.c", + MAME_DIR .. "src/mame/video/k051316.c", + MAME_DIR .. "src/mame/video/k051733.c", + MAME_DIR .. "src/mame/video/k051960.c", + MAME_DIR .. "src/mame/video/k052109.c", + MAME_DIR .. "src/mame/video/k053250.c", + MAME_DIR .. "src/mame/video/k053251.c", + MAME_DIR .. "src/mame/video/k054156_k054157_k056832.c", + MAME_DIR .. "src/mame/video/k053244_k053245.c", + MAME_DIR .. "src/mame/video/k053246_k053247_k055673.c", + MAME_DIR .. "src/mame/video/k055555.c", + MAME_DIR .. "src/mame/video/k054000.c", + MAME_DIR .. "src/mame/video/k054338.c", + MAME_DIR .. "src/mame/video/k053936.c", + MAME_DIR .. "src/mame/video/k001006.c", + MAME_DIR .. "src/mame/video/k001005.c", + MAME_DIR .. "src/mame/video/k001604.c", +} + +createMAMEProjects(_target, _subtarget, "matic") +files { + MAME_DIR .. "src/mame/drivers/barata.c", +} + +createMAMEProjects(_target, _subtarget, "maygay") +files { + MAME_DIR .. "src/mame/drivers/maygay1b.c", + MAME_DIR .. "src/mame/drivers/maygay1bsw.c", + MAME_DIR .. "src/mame/drivers/maygayv1.c", + MAME_DIR .. "src/mame/drivers/maygayep.c", + MAME_DIR .. "src/mame/drivers/maygaysw.c", + MAME_DIR .. "src/mame/drivers/mmm.c", +} + +createMAMEProjects(_target, _subtarget, "meadows") +files { + MAME_DIR .. "src/mame/drivers/lazercmd.c", + MAME_DIR .. "src/mame/video/lazercmd.c", + MAME_DIR .. "src/mame/drivers/meadwttl.c", + MAME_DIR .. "src/mame/drivers/meadows.c", + MAME_DIR .. "src/mame/audio/meadows.c", + MAME_DIR .. "src/mame/video/meadows.c", + MAME_DIR .. "src/mame/drivers/warpsped.c", +} + +createMAMEProjects(_target, _subtarget, "merit") +files { + MAME_DIR .. "src/mame/drivers/mgames.c", + MAME_DIR .. "src/mame/drivers/merit.c", + MAME_DIR .. "src/mame/drivers/meritm.c", +} + +createMAMEProjects(_target, _subtarget, "metro") +files { + MAME_DIR .. "src/mame/drivers/hyprduel.c", + MAME_DIR .. "src/mame/video/hyprduel.c", + MAME_DIR .. "src/mame/drivers/metro.c", + MAME_DIR .. "src/mame/video/metro.c", + MAME_DIR .. "src/mame/drivers/rabbit.c", + MAME_DIR .. "src/mame/drivers/tmmjprd.c", +} + +createMAMEProjects(_target, _subtarget, "midcoin") +files { + MAME_DIR .. "src/mame/drivers/wallc.c", + MAME_DIR .. "src/mame/drivers/wink.c", + MAME_DIR .. "src/mame/drivers/24cdjuke.c", +} + +createMAMEProjects(_target, _subtarget, "midw8080") +files { + MAME_DIR .. "src/mame/drivers/8080bw.c", + MAME_DIR .. "src/mame/audio/8080bw.c", + MAME_DIR .. "src/mame/video/8080bw.c", + MAME_DIR .. "src/mame/drivers/m79amb.c", + MAME_DIR .. "src/mame/audio/m79amb.c", + MAME_DIR .. "src/mame/drivers/mw8080bw.c", + MAME_DIR .. "src/mame/machine/mw8080bw.c", + MAME_DIR .. "src/mame/audio/mw8080bw.c", + MAME_DIR .. "src/mame/video/mw8080bw.c", + MAME_DIR .. "src/mame/drivers/rotaryf.c", +} + +createMAMEProjects(_target, _subtarget, "midway") +files { + MAME_DIR .. "src/mame/drivers/astrocde.c", + MAME_DIR .. "src/mame/video/astrocde.c", + MAME_DIR .. "src/mame/audio/gorf.c", + MAME_DIR .. "src/mame/audio/wow.c", + MAME_DIR .. "src/mame/drivers/atlantis.c", + MAME_DIR .. "src/mame/drivers/balsente.c", + MAME_DIR .. "src/mame/machine/balsente.c", + MAME_DIR .. "src/mame/video/balsente.c", + MAME_DIR .. "src/mame/drivers/gridlee.c", + MAME_DIR .. "src/mame/audio/gridlee.c", + MAME_DIR .. "src/mame/video/gridlee.c", + MAME_DIR .. "src/mame/drivers/mcr.c", + MAME_DIR .. "src/mame/machine/mcr.c", + MAME_DIR .. "src/mame/video/mcr.c", + MAME_DIR .. "src/mame/drivers/mcr3.c", + MAME_DIR .. "src/mame/video/mcr3.c", + MAME_DIR .. "src/mame/drivers/mcr68.c", + MAME_DIR .. "src/mame/machine/mcr68.c", + MAME_DIR .. "src/mame/video/mcr68.c", + MAME_DIR .. "src/mame/drivers/midqslvr.c", + MAME_DIR .. "src/mame/drivers/midtunit.c", + MAME_DIR .. "src/mame/machine/midtunit.c", + MAME_DIR .. "src/mame/video/midtunit.c", + MAME_DIR .. "src/mame/drivers/midvunit.c", + MAME_DIR .. "src/mame/video/midvunit.c", + MAME_DIR .. "src/mame/drivers/midwunit.c", + MAME_DIR .. "src/mame/machine/midwunit.c", + MAME_DIR .. "src/mame/drivers/midxunit.c", + MAME_DIR .. "src/mame/machine/midxunit.c", + MAME_DIR .. "src/mame/drivers/midyunit.c", + MAME_DIR .. "src/mame/machine/midyunit.c", + MAME_DIR .. "src/mame/video/midyunit.c", + MAME_DIR .. "src/mame/drivers/midzeus.c", + MAME_DIR .. "src/mame/video/midzeus.c", + MAME_DIR .. "src/mame/video/midzeus2.c", + MAME_DIR .. "src/mame/drivers/mw18w.c", + MAME_DIR .. "src/mame/drivers/mwsub.c", + MAME_DIR .. "src/mame/drivers/omegrace.c", + MAME_DIR .. "src/mame/drivers/pinball2k.c", + MAME_DIR .. "src/mame/drivers/seattle.c", + MAME_DIR .. "src/mame/drivers/sspeedr.c", + MAME_DIR .. "src/mame/video/sspeedr.c", + MAME_DIR .. "src/mame/drivers/tmaster.c", + MAME_DIR .. "src/mame/drivers/vegas.c", + MAME_DIR .. "src/mame/drivers/wmg.c", + MAME_DIR .. "src/mame/drivers/williams.c", + MAME_DIR .. "src/mame/machine/williams.c", + MAME_DIR .. "src/mame/audio/williams.c", + MAME_DIR .. "src/mame/video/williams.c", + MAME_DIR .. "src/mame/machine/midwayic.c", + MAME_DIR .. "src/mame/audio/midway.c", +} + +createMAMEProjects(_target, _subtarget, "namco") +files { + MAME_DIR .. "src/mame/drivers/20pacgal.c", + MAME_DIR .. "src/mame/video/20pacgal.c", + MAME_DIR .. "src/mame/drivers/30test.c", + MAME_DIR .. "src/mame/drivers/baraduke.c", + MAME_DIR .. "src/mame/video/baraduke.c", + MAME_DIR .. "src/mame/drivers/cswat.c", + MAME_DIR .. "src/mame/drivers/dambustr.c", + MAME_DIR .. "src/mame/drivers/gal3.c", + MAME_DIR .. "src/mame/drivers/galaga.c", + MAME_DIR .. "src/mame/audio/galaga.c", + MAME_DIR .. "src/mame/video/galaga.c", + MAME_DIR .. "src/mame/video/bosco.c", + MAME_DIR .. "src/mame/video/digdug.c", + MAME_DIR .. "src/mame/machine/xevious.c", + MAME_DIR .. "src/mame/video/xevious.c", + MAME_DIR .. "src/mame/drivers/galaxian.c", + MAME_DIR .. "src/mame/audio/galaxian.c", + MAME_DIR .. "src/mame/video/galaxian.c", + MAME_DIR .. "src/mame/drivers/galaxold.c", + MAME_DIR .. "src/mame/machine/galaxold.c", + MAME_DIR .. "src/mame/video/galaxold.c", + MAME_DIR .. "src/mame/drivers/gaplus.c", + MAME_DIR .. "src/mame/machine/gaplus.c", + MAME_DIR .. "src/mame/video/gaplus.c", + MAME_DIR .. "src/mame/drivers/kungfur.c", + MAME_DIR .. "src/mame/drivers/mappy.c", + MAME_DIR .. "src/mame/video/mappy.c", + MAME_DIR .. "src/mame/drivers/namcofl.c", + MAME_DIR .. "src/mame/video/namcofl.c", + MAME_DIR .. "src/mame/drivers/namcoic.c", + MAME_DIR .. "src/mame/drivers/namcona1.c", + MAME_DIR .. "src/mame/video/namcona1.c", + MAME_DIR .. "src/mame/drivers/namconb1.c", + MAME_DIR .. "src/mame/video/namconb1.c", + MAME_DIR .. "src/mame/drivers/namcond1.c", + MAME_DIR .. "src/mame/machine/namcond1.c", + MAME_DIR .. "src/mame/video/ygv608.c", + MAME_DIR .. "src/mame/drivers/namcops2.c", + MAME_DIR .. "src/mame/drivers/namcos1.c", + MAME_DIR .. "src/mame/machine/namcos1.c", + MAME_DIR .. "src/mame/video/namcos1.c", + MAME_DIR .. "src/mame/drivers/namcos10.c", + MAME_DIR .. "src/mame/drivers/namcos11.c", + MAME_DIR .. "src/mame/machine/ns11prot.c", + MAME_DIR .. "src/mame/drivers/namcos12.c", + MAME_DIR .. "src/mame/machine/namco_settings.c", + MAME_DIR .. "src/mame/drivers/namcos2.c", + MAME_DIR .. "src/mame/machine/namcos2.c", + MAME_DIR .. "src/mame/video/namcos2.c", + MAME_DIR .. "src/mame/drivers/namcos21.c", + MAME_DIR .. "src/mame/video/namcos21.c", + MAME_DIR .. "src/mame/drivers/namcos22.c", + MAME_DIR .. "src/mame/video/namcos22.c", + MAME_DIR .. "src/mame/drivers/namcos23.c", + MAME_DIR .. "src/mame/drivers/namcos86.c", + MAME_DIR .. "src/mame/video/namcos86.c", + MAME_DIR .. "src/mame/drivers/pacland.c", + MAME_DIR .. "src/mame/video/pacland.c", + MAME_DIR .. "src/mame/drivers/polepos.c", + MAME_DIR .. "src/mame/audio/polepos.c", + MAME_DIR .. "src/mame/video/polepos.c", + MAME_DIR .. "src/mame/drivers/rallyx.c", + MAME_DIR .. "src/mame/video/rallyx.c", + MAME_DIR .. "src/mame/drivers/skykid.c", + MAME_DIR .. "src/mame/video/skykid.c", + MAME_DIR .. "src/mame/drivers/tankbatt.c", + MAME_DIR .. "src/mame/video/tankbatt.c", + MAME_DIR .. "src/mame/drivers/tceptor.c", + MAME_DIR .. "src/mame/video/tceptor.c", + MAME_DIR .. "src/mame/drivers/toypop.c", + MAME_DIR .. "src/mame/video/toypop.c", + MAME_DIR .. "src/mame/drivers/turrett.c", + MAME_DIR .. "src/mame/audio/turrett.c", + MAME_DIR .. "src/mame/video/turrett.c", + MAME_DIR .. "src/mame/drivers/warpwarp.c", + MAME_DIR .. "src/mame/audio/geebee.c", + MAME_DIR .. "src/mame/audio/warpwarp.c", + MAME_DIR .. "src/mame/video/warpwarp.c", + MAME_DIR .. "src/mame/machine/c117.c", + MAME_DIR .. "src/mame/machine/namcoio.c", + MAME_DIR .. "src/mame/machine/namco06.c", + MAME_DIR .. "src/mame/machine/namco50.c", + MAME_DIR .. "src/mame/machine/namco51.c", + MAME_DIR .. "src/mame/machine/namco53.c", + MAME_DIR .. "src/mame/machine/namco62.c", + MAME_DIR .. "src/mame/machine/namcomcu.c", + MAME_DIR .. "src/mame/audio/namco52.c", + MAME_DIR .. "src/mame/audio/namco54.c", + MAME_DIR .. "src/mame/video/c116.c", + MAME_DIR .. "src/mame/video/c45.c", +} + +createMAMEProjects(_target, _subtarget, "nasco") +files { + MAME_DIR .. "src/mame/drivers/crgolf.c", + MAME_DIR .. "src/mame/video/crgolf.c", + MAME_DIR .. "src/mame/drivers/suprgolf.c", +} + +createMAMEProjects(_target, _subtarget, "neogeo") +files { + MAME_DIR .. "src/mame/drivers/neogeo.c", + MAME_DIR .. "src/mame/video/neogeo.c", + MAME_DIR .. "src/mame/drivers/neogeo_noslot.c", + MAME_DIR .. "src/mame/video/neogeo_spr.c", + MAME_DIR .. "src/mame/machine/neoboot.c", + MAME_DIR .. "src/mame/machine/neocrypt.c", + MAME_DIR .. "src/mame/machine/neoprot.c", + MAME_DIR .. "src/mame/machine/ng_memcard.c", +} + +createMAMEProjects(_target, _subtarget, "nichibut") +files { + MAME_DIR .. "src/mame/drivers/armedf.c", + MAME_DIR .. "src/mame/video/armedf.c", + MAME_DIR .. "src/mame/drivers/cclimber.c", + MAME_DIR .. "src/mame/machine/cclimber.c", + MAME_DIR .. "src/mame/audio/cclimber.c", + MAME_DIR .. "src/mame/video/cclimber.c", + MAME_DIR .. "src/mame/drivers/clshroad.c", + MAME_DIR .. "src/mame/video/clshroad.c", + MAME_DIR .. "src/mame/drivers/csplayh5.c", + MAME_DIR .. "src/mame/drivers/cop01.c", + MAME_DIR .. "src/mame/video/cop01.c", + MAME_DIR .. "src/mame/drivers/dacholer.c", + MAME_DIR .. "src/mame/drivers/galivan.c", + MAME_DIR .. "src/mame/video/galivan.c", + MAME_DIR .. "src/mame/drivers/gomoku.c", + MAME_DIR .. "src/mame/audio/gomoku.c", + MAME_DIR .. "src/mame/video/gomoku.c", + MAME_DIR .. "src/mame/drivers/hyhoo.c", + MAME_DIR .. "src/mame/video/hyhoo.c", + MAME_DIR .. "src/mame/drivers/jangou.c", + MAME_DIR .. "src/mame/drivers/magmax.c", + MAME_DIR .. "src/mame/video/magmax.c", + MAME_DIR .. "src/mame/drivers/nbmj8688.c", + MAME_DIR .. "src/mame/video/nbmj8688.c", + MAME_DIR .. "src/mame/drivers/nbmj8891.c", + MAME_DIR .. "src/mame/video/nbmj8891.c", + MAME_DIR .. "src/mame/drivers/nbmj8900.c", + MAME_DIR .. "src/mame/video/nbmj8900.c", + MAME_DIR .. "src/mame/drivers/nbmj8991.c", + MAME_DIR .. "src/mame/video/nbmj8991.c", + MAME_DIR .. "src/mame/drivers/nbmj9195.c", + MAME_DIR .. "src/mame/video/nbmj9195.c", + MAME_DIR .. "src/mame/drivers/nightgal.c", + MAME_DIR .. "src/mame/drivers/niyanpai.c", + MAME_DIR .. "src/mame/video/niyanpai.c", + MAME_DIR .. "src/mame/drivers/pastelg.c", + MAME_DIR .. "src/mame/video/pastelg.c", + MAME_DIR .. "src/mame/drivers/seicross.c", + MAME_DIR .. "src/mame/video/seicross.c", + MAME_DIR .. "src/mame/drivers/terracre.c", + MAME_DIR .. "src/mame/video/terracre.c", + MAME_DIR .. "src/mame/drivers/tubep.c", + MAME_DIR .. "src/mame/video/tubep.c", + MAME_DIR .. "src/mame/drivers/wiping.c", + MAME_DIR .. "src/mame/audio/wiping.c", + MAME_DIR .. "src/mame/video/wiping.c", + MAME_DIR .. "src/mame/machine/nb1413m3.c", + MAME_DIR .. "src/mame/machine/nb1414m4.c", +} + +createMAMEProjects(_target, _subtarget, "nintendo") +files { + MAME_DIR .. "src/mame/drivers/cham24.c", + MAME_DIR .. "src/mame/drivers/dkong.c", + MAME_DIR .. "src/mame/audio/dkong.c", + MAME_DIR .. "src/mame/video/dkong.c", + MAME_DIR .. "src/mame/drivers/mario.c", + MAME_DIR .. "src/mame/audio/mario.c", + MAME_DIR .. "src/mame/video/mario.c", + MAME_DIR .. "src/mame/drivers/multigam.c", + MAME_DIR .. "src/mame/drivers/n8080.c", + MAME_DIR .. "src/mame/audio/n8080.c", + MAME_DIR .. "src/mame/video/n8080.c", + MAME_DIR .. "src/mame/drivers/nss.c", + MAME_DIR .. "src/mame/machine/snes.c", + MAME_DIR .. "src/mame/audio/snes_snd.c", + MAME_DIR .. "src/mame/drivers/playch10.c", + MAME_DIR .. "src/mame/machine/playch10.c", + MAME_DIR .. "src/mame/video/playch10.c", + MAME_DIR .. "src/mame/drivers/popeye.c", + MAME_DIR .. "src/mame/video/popeye.c", + MAME_DIR .. "src/mame/drivers/punchout.c", + MAME_DIR .. "src/mame/video/punchout.c", + MAME_DIR .. "src/mame/drivers/famibox.c", + MAME_DIR .. "src/mame/drivers/sfcbox.c", + MAME_DIR .. "src/mame/drivers/snesb.c", + MAME_DIR .. "src/mame/drivers/spacefb.c", + MAME_DIR .. "src/mame/audio/spacefb.c", + MAME_DIR .. "src/mame/video/spacefb.c", + MAME_DIR .. "src/mame/drivers/vsnes.c", + MAME_DIR .. "src/mame/machine/vsnes.c", + MAME_DIR .. "src/mame/video/vsnes.c", + MAME_DIR .. "src/mame/video/ppu2c0x.c", + + +} + +createMAMEProjects(_target, _subtarget, "nix") +files { + MAME_DIR .. "src/mame/drivers/fitfight.c", + MAME_DIR .. "src/mame/video/fitfight.c", + MAME_DIR .. "src/mame/drivers/pirates.c", + MAME_DIR .. "src/mame/video/pirates.c", +} + +createMAMEProjects(_target, _subtarget, "nmk") +files { + MAME_DIR .. "src/mame/drivers/acommand.c", + MAME_DIR .. "src/mame/drivers/cultures.c", + MAME_DIR .. "src/mame/drivers/ddealer.c", + MAME_DIR .. "src/mame/drivers/jalmah.c", + MAME_DIR .. "src/mame/drivers/macrossp.c", + MAME_DIR .. "src/mame/video/macrossp.c", + MAME_DIR .. "src/mame/drivers/nmk16.c", + MAME_DIR .. "src/mame/machine/nmk004.c", + MAME_DIR .. "src/mame/video/nmk16.c", + MAME_DIR .. "src/mame/drivers/quizdna.c", + MAME_DIR .. "src/mame/video/quizdna.c", + MAME_DIR .. "src/mame/drivers/quizpani.c", + MAME_DIR .. "src/mame/video/quizpani.c", +} + +createMAMEProjects(_target, _subtarget, "olympia") +files { + MAME_DIR .. "src/mame/drivers/dday.c", + MAME_DIR .. "src/mame/video/dday.c", + MAME_DIR .. "src/mame/drivers/lbeach.c", + MAME_DIR .. "src/mame/drivers/monzagp.c", + MAME_DIR .. "src/mame/drivers/portrait.c", + MAME_DIR .. "src/mame/video/portrait.c", + MAME_DIR .. "src/mame/drivers/vega.c", +} + +createMAMEProjects(_target, _subtarget, "omori") +files { + MAME_DIR .. "src/mame/drivers/battlex.c", + MAME_DIR .. "src/mame/video/battlex.c", + MAME_DIR .. "src/mame/drivers/carjmbre.c", + MAME_DIR .. "src/mame/video/carjmbre.c", + MAME_DIR .. "src/mame/drivers/popper.c", + MAME_DIR .. "src/mame/video/popper.c", + MAME_DIR .. "src/mame/drivers/spaceg.c", +} + +createMAMEProjects(_target, _subtarget, "orca") +files { + MAME_DIR .. "src/mame/drivers/espial.c", + MAME_DIR .. "src/mame/video/espial.c", + MAME_DIR .. "src/mame/drivers/funkybee.c", + MAME_DIR .. "src/mame/video/funkybee.c", + MAME_DIR .. "src/mame/drivers/marineb.c", + MAME_DIR .. "src/mame/video/marineb.c", + MAME_DIR .. "src/mame/drivers/vastar.c", + MAME_DIR .. "src/mame/video/vastar.c", + MAME_DIR .. "src/mame/drivers/zodiack.c", + MAME_DIR .. "src/mame/video/zodiack.c", +} + +createMAMEProjects(_target, _subtarget, "pacific") +files { + MAME_DIR .. "src/mame/drivers/mrflea.c", + MAME_DIR .. "src/mame/video/mrflea.c", + MAME_DIR .. "src/mame/drivers/thief.c", + MAME_DIR .. "src/mame/video/thief.c", +} + +createMAMEProjects(_target, _subtarget, "pacman") +files { + MAME_DIR .. "src/mame/drivers/jrpacman.c", + MAME_DIR .. "src/mame/drivers/pacman.c", + MAME_DIR .. "src/mame/video/pacman.c", + MAME_DIR .. "src/mame/machine/acitya.c", + MAME_DIR .. "src/mame/machine/jumpshot.c", + MAME_DIR .. "src/mame/machine/pacplus.c", + MAME_DIR .. "src/mame/machine/theglobp.c", + MAME_DIR .. "src/mame/drivers/pengo.c", +} + +createMAMEProjects(_target, _subtarget, "pce") +files { + MAME_DIR .. "src/mame/drivers/ggconnie.c", + MAME_DIR .. "src/mame/drivers/paranoia.c", + MAME_DIR .. "src/mame/drivers/tourvis.c", + MAME_DIR .. "src/mame/drivers/uapce.c", + MAME_DIR .. "src/mame/machine/pcecommn.c", +} + +createMAMEProjects(_target, _subtarget, "phoenix") +files { + MAME_DIR .. "src/mame/drivers/naughtyb.c", + MAME_DIR .. "src/mame/video/naughtyb.c", + MAME_DIR .. "src/mame/drivers/phoenix.c", + MAME_DIR .. "src/mame/audio/phoenix.c", + MAME_DIR .. "src/mame/video/phoenix.c", + MAME_DIR .. "src/mame/drivers/safarir.c", + MAME_DIR .. "src/mame/audio/pleiads.c", +} + +createMAMEProjects(_target, _subtarget, "playmark") +files { + MAME_DIR .. "src/mame/drivers/drtomy.c", + MAME_DIR .. "src/mame/drivers/playmark.c", + MAME_DIR .. "src/mame/video/playmark.c", + MAME_DIR .. "src/mame/drivers/powerbal.c", + MAME_DIR .. "src/mame/drivers/sderby.c", + MAME_DIR .. "src/mame/video/sderby.c", + MAME_DIR .. "src/mame/drivers/sslam.c", + MAME_DIR .. "src/mame/video/sslam.c", +} + +createMAMEProjects(_target, _subtarget, "psikyo") +files { + MAME_DIR .. "src/mame/drivers/psikyo.c", + MAME_DIR .. "src/mame/video/psikyo.c", + MAME_DIR .. "src/mame/drivers/psikyo4.c", + MAME_DIR .. "src/mame/video/psikyo4.c", + MAME_DIR .. "src/mame/drivers/psikyosh.c", + MAME_DIR .. "src/mame/video/psikyosh.c", +} + +createMAMEProjects(_target, _subtarget, "ramtek") +files { + MAME_DIR .. "src/mame/drivers/hitme.c", + MAME_DIR .. "src/mame/audio/hitme.c", + MAME_DIR .. "src/mame/drivers/ramtek.c", + MAME_DIR .. "src/mame/drivers/starcrus.c", + MAME_DIR .. "src/mame/video/starcrus.c", +} + +createMAMEProjects(_target, _subtarget, "rare") +files { + MAME_DIR .. "src/mame/drivers/btoads.c", + MAME_DIR .. "src/mame/video/btoads.c", + MAME_DIR .. "src/mame/drivers/kinst.c", + MAME_DIR .. "src/mame/drivers/xtheball.c", +} + +createMAMEProjects(_target, _subtarget, "sanritsu") +files { + MAME_DIR .. "src/mame/drivers/appoooh.c", + MAME_DIR .. "src/mame/video/appoooh.c", + MAME_DIR .. "src/mame/drivers/bankp.c", + MAME_DIR .. "src/mame/video/bankp.c", + MAME_DIR .. "src/mame/drivers/chinsan.c", + MAME_DIR .. "src/mame/drivers/drmicro.c", + MAME_DIR .. "src/mame/video/drmicro.c", + MAME_DIR .. "src/mame/drivers/jantotsu.c", + MAME_DIR .. "src/mame/drivers/mayumi.c", + MAME_DIR .. "src/mame/drivers/mermaid.c", + MAME_DIR .. "src/mame/video/mermaid.c", + MAME_DIR .. "src/mame/drivers/mjkjidai.c", + MAME_DIR .. "src/mame/video/mjkjidai.c", +} + +createMAMEProjects(_target, _subtarget, "sega") +files { + MAME_DIR .. "src/mame/drivers/angelkds.c", + MAME_DIR .. "src/mame/video/angelkds.c", + MAME_DIR .. "src/mame/drivers/bingoc.c", + MAME_DIR .. "src/mame/drivers/blockade.c", + MAME_DIR .. "src/mame/audio/blockade.c", + MAME_DIR .. "src/mame/video/blockade.c", + MAME_DIR .. "src/mame/drivers/calorie.c", + MAME_DIR .. "src/mame/drivers/chihiro.c", + MAME_DIR .. "src/mame/video/chihiro.c", + MAME_DIR .. "src/mame/drivers/coolridr.c", + MAME_DIR .. "src/mame/drivers/deniam.c", + MAME_DIR .. "src/mame/video/deniam.c", + MAME_DIR .. "src/mame/drivers/dotrikun.c", + MAME_DIR .. "src/mame/drivers/gpworld.c", + MAME_DIR .. "src/mame/drivers/hikaru.c", + MAME_DIR .. "src/mame/drivers/hshavoc.c", + MAME_DIR .. "src/mame/drivers/kopunch.c", + MAME_DIR .. "src/mame/video/kopunch.c", + MAME_DIR .. "src/mame/drivers/lindbergh.c", + MAME_DIR .. "src/mame/machine/segabb.c", + MAME_DIR .. "src/mame/machine/megadriv.c", + MAME_DIR .. "src/mame/drivers/megadrvb.c", + MAME_DIR .. "src/mame/drivers/megaplay.c", + MAME_DIR .. "src/mame/drivers/megatech.c", + MAME_DIR .. "src/mame/drivers/model1.c", + MAME_DIR .. "src/mame/machine/model1.c", + MAME_DIR .. "src/mame/video/model1.c", + MAME_DIR .. "src/mame/audio/dsbz80.c", + MAME_DIR .. "src/mame/drivers/model2.c", + MAME_DIR .. "src/mame/video/model2.c", + MAME_DIR .. "src/mame/drivers/model3.c", + MAME_DIR .. "src/mame/video/model3.c", + MAME_DIR .. "src/mame/machine/model3.c", + MAME_DIR .. "src/mame/drivers/monacogp.c", + MAME_DIR .. "src/mame/drivers/naomi.c", + MAME_DIR .. "src/mame/machine/dc.c", + MAME_DIR .. "src/mame/video/powervr2.c", + MAME_DIR .. "src/mame/machine/naomi.c", + MAME_DIR .. "src/mame/machine/naomig1.c", + MAME_DIR .. "src/mame/machine/naomibd.c", + MAME_DIR .. "src/mame/machine/naomirom.c", + MAME_DIR .. "src/mame/machine/naomigd.c", + MAME_DIR .. "src/mame/machine/naomim1.c", + MAME_DIR .. "src/mame/machine/naomim2.c", + MAME_DIR .. "src/mame/machine/naomim4.c", + MAME_DIR .. "src/mame/machine/315-5881_crypt.c", + MAME_DIR .. "src/mame/machine/awboard.c", + MAME_DIR .. "src/mame/machine/mie.c", + MAME_DIR .. "src/mame/machine/maple-dc.c", + MAME_DIR .. "src/mame/machine/mapledev.c", + MAME_DIR .. "src/mame/machine/dc-ctrl.c", + MAME_DIR .. "src/mame/machine/jvs13551.c", + MAME_DIR .. "src/mame/drivers/triforce.c", + MAME_DIR .. "src/mame/drivers/puckpkmn.c", + MAME_DIR .. "src/mame/drivers/segac2.c", + MAME_DIR .. "src/mame/drivers/segae.c", + MAME_DIR .. "src/mame/drivers/shtzone.c", + MAME_DIR .. "src/mame/drivers/segacoin.c", + MAME_DIR .. "src/mame/drivers/segag80r.c", + MAME_DIR .. "src/mame/machine/segag80.c", + MAME_DIR .. "src/mame/audio/segag80r.c", + MAME_DIR .. "src/mame/video/segag80r.c", + MAME_DIR .. "src/mame/drivers/segag80v.c", + MAME_DIR .. "src/mame/audio/segag80v.c", + MAME_DIR .. "src/mame/video/segag80v.c", + MAME_DIR .. "src/mame/drivers/segahang.c", + MAME_DIR .. "src/mame/video/segahang.c", + MAME_DIR .. "src/mame/drivers/segajw.c", + MAME_DIR .. "src/mame/drivers/segald.c", + MAME_DIR .. "src/mame/drivers/segaorun.c", + MAME_DIR .. "src/mame/video/segaorun.c", + MAME_DIR .. "src/mame/drivers/segas16a.c", + MAME_DIR .. "src/mame/video/segas16a.c", + MAME_DIR .. "src/mame/drivers/segas16b.c", + MAME_DIR .. "src/mame/video/segas16b.c", + MAME_DIR .. "src/mame/drivers/segas18.c", + MAME_DIR .. "src/mame/video/segas18.c", + MAME_DIR .. "src/mame/drivers/segas24.c", + MAME_DIR .. "src/mame/video/segas24.c", + MAME_DIR .. "src/mame/drivers/segas32.c", + MAME_DIR .. "src/mame/machine/segas32.c", + MAME_DIR .. "src/mame/video/segas32.c", + MAME_DIR .. "src/mame/drivers/segaufo.c", + MAME_DIR .. "src/mame/drivers/segaxbd.c", + MAME_DIR .. "src/mame/video/segaxbd.c", + MAME_DIR .. "src/mame/drivers/segaybd.c", + MAME_DIR .. "src/mame/video/segaybd.c", + MAME_DIR .. "src/mame/drivers/sg1000a.c", + MAME_DIR .. "src/mame/drivers/stactics.c", + MAME_DIR .. "src/mame/video/stactics.c", + MAME_DIR .. "src/mame/drivers/stv.c", + MAME_DIR .. "src/mame/machine/stvprot.c", + MAME_DIR .. "src/mame/machine/315-5838_317-0229_comp.c", + MAME_DIR .. "src/mame/drivers/suprloco.c", + MAME_DIR .. "src/mame/video/suprloco.c", + MAME_DIR .. "src/mame/drivers/system1.c", + MAME_DIR .. "src/mame/video/system1.c", + MAME_DIR .. "src/mame/drivers/system16.c", + MAME_DIR .. "src/mame/video/system16.c", + MAME_DIR .. "src/mame/drivers/timetrv.c", + MAME_DIR .. "src/mame/drivers/turbo.c", + MAME_DIR .. "src/mame/audio/turbo.c", + MAME_DIR .. "src/mame/video/turbo.c", + MAME_DIR .. "src/mame/drivers/vicdual.c", + MAME_DIR .. "src/mame/audio/vicdual.c", + MAME_DIR .. "src/mame/video/vicdual.c", + MAME_DIR .. "src/mame/audio/carnival.c", + MAME_DIR .. "src/mame/audio/depthch.c", + MAME_DIR .. "src/mame/audio/invinco.c", + MAME_DIR .. "src/mame/audio/pulsar.c", + MAME_DIR .. "src/mame/drivers/zaxxon.c", + MAME_DIR .. "src/mame/audio/zaxxon.c", + MAME_DIR .. "src/mame/video/zaxxon.c", + MAME_DIR .. "src/mame/machine/315_5296.c", + MAME_DIR .. "src/mame/machine/fd1089.c", + MAME_DIR .. "src/mame/machine/fd1094.c", + MAME_DIR .. "src/mame/machine/fddebug.c", + MAME_DIR .. "src/mame/machine/mc8123.c", + MAME_DIR .. "src/mame/machine/segaic16.c", + MAME_DIR .. "src/mame/audio/segasnd.c", + MAME_DIR .. "src/mame/video/segaic16.c", + MAME_DIR .. "src/mame/video/segaic16_road.c", + MAME_DIR .. "src/mame/video/sega16sp.c", + MAME_DIR .. "src/mame/video/segaic24.c", + MAME_DIR .. "src/mame/machine/gdrom.c", +} + +createMAMEProjects(_target, _subtarget, "seibu") +files { + MAME_DIR .. "src/mame/drivers/bloodbro.c", + MAME_DIR .. "src/mame/video/bloodbro.c", + MAME_DIR .. "src/mame/drivers/cabal.c", + MAME_DIR .. "src/mame/video/cabal.c", + MAME_DIR .. "src/mame/drivers/cshooter.c", + MAME_DIR .. "src/mame/drivers/dcon.c", + MAME_DIR .. "src/mame/video/dcon.c", + MAME_DIR .. "src/mame/drivers/deadang.c", + MAME_DIR .. "src/mame/video/deadang.c", + MAME_DIR .. "src/mame/drivers/dynduke.c", + MAME_DIR .. "src/mame/video/dynduke.c", + MAME_DIR .. "src/mame/drivers/feversoc.c", + MAME_DIR .. "src/mame/drivers/goal92.c", + MAME_DIR .. "src/mame/video/goal92.c", + MAME_DIR .. "src/mame/drivers/goodejan.c", + MAME_DIR .. "src/mame/drivers/kncljoe.c", + MAME_DIR .. "src/mame/video/kncljoe.c", + MAME_DIR .. "src/mame/drivers/legionna.c", + MAME_DIR .. "src/mame/video/legionna.c", + MAME_DIR .. "src/mame/drivers/mustache.c", + MAME_DIR .. "src/mame/video/mustache.c", + MAME_DIR .. "src/mame/drivers/panicr.c", + MAME_DIR .. "src/mame/drivers/raiden.c", + MAME_DIR .. "src/mame/video/raiden.c", + MAME_DIR .. "src/mame/drivers/raiden2.c", + MAME_DIR .. "src/mame/machine/r2crypt.c", + MAME_DIR .. "src/mame/machine/raiden2cop.c", + MAME_DIR .. "src/mame/drivers/r2dx_v33.c", + MAME_DIR .. "src/mame/drivers/seibuspi.c", + MAME_DIR .. "src/mame/machine/seibuspi.c", + MAME_DIR .. "src/mame/video/seibuspi.c", + MAME_DIR .. "src/mame/drivers/sengokmj.c", + MAME_DIR .. "src/mame/drivers/stfight.c", + MAME_DIR .. "src/mame/machine/stfight.c", + MAME_DIR .. "src/mame/video/stfight.c", + MAME_DIR .. "src/mame/drivers/toki.c", + MAME_DIR .. "src/mame/video/toki.c", + MAME_DIR .. "src/mame/drivers/wiz.c", + MAME_DIR .. "src/mame/video/wiz.c", + MAME_DIR .. "src/mame/machine/seicop.c", + MAME_DIR .. "src/mame/machine/spisprit.c", + MAME_DIR .. "src/mame/audio/seibu.c", + MAME_DIR .. "src/mame/video/seibu_crtc.c", +} + +createMAMEProjects(_target, _subtarget, "seta") +files { + MAME_DIR .. "src/mame/drivers/aleck64.c", + MAME_DIR .. "src/mame/machine/n64.c", + MAME_DIR .. "src/mame/video/n64.c", + MAME_DIR .. "src/mame/video/rdpblend.c", + MAME_DIR .. "src/mame/video/rdpspn16.c", + MAME_DIR .. "src/mame/video/rdptpipe.c", + MAME_DIR .. "src/mame/drivers/hanaawas.c", + MAME_DIR .. "src/mame/video/hanaawas.c", + MAME_DIR .. "src/mame/drivers/jclub2.c", + MAME_DIR .. "src/mame/drivers/macs.c", + MAME_DIR .. "src/mame/drivers/seta.c", + MAME_DIR .. "src/mame/video/seta.c", + MAME_DIR .. "src/mame/drivers/seta2.c", + MAME_DIR .. "src/mame/video/seta2.c", + MAME_DIR .. "src/mame/drivers/speedatk.c", + MAME_DIR .. "src/mame/video/speedatk.c", + MAME_DIR .. "src/mame/drivers/speglsht.c", + MAME_DIR .. "src/mame/drivers/srmp2.c", + MAME_DIR .. "src/mame/video/srmp2.c", + MAME_DIR .. "src/mame/drivers/srmp5.c", + MAME_DIR .. "src/mame/drivers/srmp6.c", + MAME_DIR .. "src/mame/drivers/ssv.c", + MAME_DIR .. "src/mame/video/ssv.c", + MAME_DIR .. "src/mame/video/st0020.c", + MAME_DIR .. "src/mame/machine/st0016.c", + MAME_DIR .. "src/mame/drivers/simple_st0016.c", + MAME_DIR .. "src/mame/video/seta001.c", +} + +createMAMEProjects(_target, _subtarget, "sigma") +files { + MAME_DIR .. "src/mame/drivers/nyny.c", + MAME_DIR .. "src/mame/drivers/r2dtank.c", + MAME_DIR .. "src/mame/drivers/sigmab52.c", + MAME_DIR .. "src/mame/drivers/sigmab98.c", + MAME_DIR .. "src/mame/drivers/spiders.c", + MAME_DIR .. "src/mame/audio/spiders.c", + MAME_DIR .. "src/mame/drivers/sub.c", +} + +createMAMEProjects(_target, _subtarget, "snk") +files { + MAME_DIR .. "src/mame/drivers/bbusters.c", + MAME_DIR .. "src/mame/video/bbusters.c", + MAME_DIR .. "src/mame/drivers/dmndrby.c", + MAME_DIR .. "src/mame/drivers/hng64.c", + MAME_DIR .. "src/mame/video/hng64.c", + MAME_DIR .. "src/mame/audio/hng64.c", + MAME_DIR .. "src/mame/machine/hng64_net.c", + MAME_DIR .. "src/mame/video/hng64_3d.c", + MAME_DIR .. "src/mame/video/hng64_sprite.c", + MAME_DIR .. "src/mame/drivers/lasso.c", + MAME_DIR .. "src/mame/video/lasso.c", + MAME_DIR .. "src/mame/drivers/mainsnk.c", + MAME_DIR .. "src/mame/video/mainsnk.c", + MAME_DIR .. "src/mame/drivers/munchmo.c", + MAME_DIR .. "src/mame/video/munchmo.c", + MAME_DIR .. "src/mame/drivers/prehisle.c", + MAME_DIR .. "src/mame/video/prehisle.c", + MAME_DIR .. "src/mame/drivers/snk6502.c", + MAME_DIR .. "src/mame/audio/snk6502.c", + MAME_DIR .. "src/mame/video/snk6502.c", + MAME_DIR .. "src/mame/drivers/snk.c", + MAME_DIR .. "src/mame/video/snk.c", + MAME_DIR .. "src/mame/drivers/snk68.c", + MAME_DIR .. "src/mame/video/snk68.c", +} + +createMAMEProjects(_target, _subtarget, "sony") +files { + MAME_DIR .. "src/mame/drivers/zn.c", + MAME_DIR .. "src/mame/machine/zndip.c", + MAME_DIR .. "src/mame/machine/cat702.c", +} + +createMAMEProjects(_target, _subtarget, "stern") +files { + MAME_DIR .. "src/mame/drivers/astinvad.c", + MAME_DIR .. "src/mame/drivers/berzerk.c", + MAME_DIR .. "src/mame/drivers/cliffhgr.c", + MAME_DIR .. "src/mame/audio/cliffhgr.c", + MAME_DIR .. "src/mame/drivers/mazerbla.c", + MAME_DIR .. "src/mame/drivers/supdrapo.c", +} + +createMAMEProjects(_target, _subtarget, "subsino") +files { + MAME_DIR .. "src/mame/drivers/lastfght.c", + MAME_DIR .. "src/mame/drivers/subsino.c", + MAME_DIR .. "src/mame/drivers/subsino2.c", + MAME_DIR .. "src/mame/machine/subsino.c", +} + +createMAMEProjects(_target, _subtarget, "sun") +files { + MAME_DIR .. "src/mame/drivers/arabian.c", + MAME_DIR .. "src/mame/video/arabian.c", + MAME_DIR .. "src/mame/drivers/dai3wksi.c", + MAME_DIR .. "src/mame/drivers/ikki.c", + MAME_DIR .. "src/mame/video/ikki.c", + MAME_DIR .. "src/mame/drivers/kangaroo.c", + MAME_DIR .. "src/mame/video/kangaroo.c", + MAME_DIR .. "src/mame/drivers/markham.c", + MAME_DIR .. "src/mame/video/markham.c", + MAME_DIR .. "src/mame/drivers/route16.c", + MAME_DIR .. "src/mame/video/route16.c", + MAME_DIR .. "src/mame/drivers/shanghai.c", + MAME_DIR .. "src/mame/drivers/shangha3.c", + MAME_DIR .. "src/mame/video/shangha3.c", + MAME_DIR .. "src/mame/drivers/strnskil.c", + MAME_DIR .. "src/mame/video/strnskil.c", + MAME_DIR .. "src/mame/drivers/tonton.c", +} + +createMAMEProjects(_target, _subtarget, "suna") +files { + MAME_DIR .. "src/mame/drivers/go2000.c", + MAME_DIR .. "src/mame/drivers/goindol.c", + MAME_DIR .. "src/mame/video/goindol.c", + MAME_DIR .. "src/mame/drivers/suna8.c", + MAME_DIR .. "src/mame/audio/suna8.c", + MAME_DIR .. "src/mame/video/suna8.c", + MAME_DIR .. "src/mame/drivers/suna16.c", + MAME_DIR .. "src/mame/video/suna16.c", +} + +createMAMEProjects(_target, _subtarget, "sure") +files { + MAME_DIR .. "src/mame/drivers/mil4000.c", + +} + +createMAMEProjects(_target, _subtarget, "taito") +files { + MAME_DIR .. "src/mame/drivers/2mindril.c", + MAME_DIR .. "src/mame/drivers/40love.c", + MAME_DIR .. "src/mame/video/40love.c", + MAME_DIR .. "src/mame/drivers/arkanoid.c", + MAME_DIR .. "src/mame/machine/arkanoid.c", + MAME_DIR .. "src/mame/video/arkanoid.c", + MAME_DIR .. "src/mame/drivers/ashnojoe.c", + MAME_DIR .. "src/mame/video/ashnojoe.c", + MAME_DIR .. "src/mame/drivers/asuka.c", + MAME_DIR .. "src/mame/machine/bonzeadv.c", + MAME_DIR .. "src/mame/video/asuka.c", + MAME_DIR .. "src/mame/drivers/bigevglf.c", + MAME_DIR .. "src/mame/machine/bigevglf.c", + MAME_DIR .. "src/mame/video/bigevglf.c", + MAME_DIR .. "src/mame/drivers/bking.c", + MAME_DIR .. "src/mame/video/bking.c", + MAME_DIR .. "src/mame/drivers/bublbobl.c", + MAME_DIR .. "src/mame/machine/bublbobl.c", + MAME_DIR .. "src/mame/video/bublbobl.c", + MAME_DIR .. "src/mame/drivers/buggychl.c", + MAME_DIR .. "src/mame/machine/buggychl.c", + MAME_DIR .. "src/mame/video/buggychl.c", + MAME_DIR .. "src/mame/drivers/capr1.c", + MAME_DIR .. "src/mame/drivers/caprcyc.c", + MAME_DIR .. "src/mame/drivers/cchance.c", + MAME_DIR .. "src/mame/drivers/chaknpop.c", + MAME_DIR .. "src/mame/machine/chaknpop.c", + MAME_DIR .. "src/mame/video/chaknpop.c", + MAME_DIR .. "src/mame/drivers/champbwl.c", + MAME_DIR .. "src/mame/drivers/changela.c", + MAME_DIR .. "src/mame/video/changela.c", + MAME_DIR .. "src/mame/drivers/crbaloon.c", + MAME_DIR .. "src/mame/video/crbaloon.c", + MAME_DIR .. "src/mame/audio/crbaloon.c", + MAME_DIR .. "src/mame/drivers/cyclemb.c", + MAME_DIR .. "src/mame/drivers/darius.c", + MAME_DIR .. "src/mame/video/darius.c", + MAME_DIR .. "src/mame/drivers/darkmist.c", + MAME_DIR .. "src/mame/video/darkmist.c", + MAME_DIR .. "src/mame/drivers/exzisus.c", + MAME_DIR .. "src/mame/video/exzisus.c", + MAME_DIR .. "src/mame/drivers/fgoal.c", + MAME_DIR .. "src/mame/video/fgoal.c", + MAME_DIR .. "src/mame/drivers/flstory.c", + MAME_DIR .. "src/mame/machine/flstory.c", + MAME_DIR .. "src/mame/video/flstory.c", + MAME_DIR .. "src/mame/drivers/galastrm.c", + MAME_DIR .. "src/mame/video/galastrm.c", + MAME_DIR .. "src/mame/drivers/gladiatr.c", + MAME_DIR .. "src/mame/video/gladiatr.c", + MAME_DIR .. "src/mame/drivers/grchamp.c", + MAME_DIR .. "src/mame/audio/grchamp.c", + MAME_DIR .. "src/mame/video/grchamp.c", + MAME_DIR .. "src/mame/drivers/groundfx.c", + MAME_DIR .. "src/mame/video/groundfx.c", + MAME_DIR .. "src/mame/drivers/gsword.c", + MAME_DIR .. "src/mame/machine/tait8741.c", + MAME_DIR .. "src/mame/video/gsword.c", + MAME_DIR .. "src/mame/drivers/gunbustr.c", + MAME_DIR .. "src/mame/video/gunbustr.c", + MAME_DIR .. "src/mame/drivers/halleys.c", + MAME_DIR .. "src/mame/drivers/invqix.c", + MAME_DIR .. "src/mame/drivers/jollyjgr.c", + MAME_DIR .. "src/mame/drivers/ksayakyu.c", + MAME_DIR .. "src/mame/video/ksayakyu.c", + MAME_DIR .. "src/mame/drivers/lgp.c", + MAME_DIR .. "src/mame/drivers/lkage.c", + MAME_DIR .. "src/mame/machine/lkage.c", + MAME_DIR .. "src/mame/video/lkage.c", + MAME_DIR .. "src/mame/drivers/lsasquad.c", + MAME_DIR .. "src/mame/machine/lsasquad.c", + MAME_DIR .. "src/mame/video/lsasquad.c", + MAME_DIR .. "src/mame/drivers/marinedt.c", + MAME_DIR .. "src/mame/drivers/mexico86.c", + MAME_DIR .. "src/mame/machine/mexico86.c", + MAME_DIR .. "src/mame/video/mexico86.c", + MAME_DIR .. "src/mame/drivers/minivadr.c", + MAME_DIR .. "src/mame/drivers/missb2.c", + MAME_DIR .. "src/mame/drivers/mlanding.c", + MAME_DIR .. "src/mame/drivers/msisaac.c", + MAME_DIR .. "src/mame/video/msisaac.c", + MAME_DIR .. "src/mame/drivers/ninjaw.c", + MAME_DIR .. "src/mame/video/ninjaw.c", + MAME_DIR .. "src/mame/drivers/nycaptor.c", + MAME_DIR .. "src/mame/machine/nycaptor.c", + MAME_DIR .. "src/mame/video/nycaptor.c", + MAME_DIR .. "src/mame/drivers/opwolf.c", + MAME_DIR .. "src/mame/machine/opwolf.c", + MAME_DIR .. "src/mame/video/opwolf.c", + MAME_DIR .. "src/mame/drivers/othunder.c", + MAME_DIR .. "src/mame/video/othunder.c", + MAME_DIR .. "src/mame/drivers/pitnrun.c", + MAME_DIR .. "src/mame/machine/pitnrun.c", + MAME_DIR .. "src/mame/video/pitnrun.c", + MAME_DIR .. "src/mame/drivers/qix.c", + MAME_DIR .. "src/mame/machine/qix.c", + MAME_DIR .. "src/mame/audio/qix.c", + MAME_DIR .. "src/mame/video/qix.c", + MAME_DIR .. "src/mame/drivers/rainbow.c", + MAME_DIR .. "src/mame/machine/rainbow.c", + MAME_DIR .. "src/mame/video/rainbow.c", + MAME_DIR .. "src/mame/drivers/rastan.c", + MAME_DIR .. "src/mame/video/rastan.c", + MAME_DIR .. "src/mame/drivers/retofinv.c", + MAME_DIR .. "src/mame/machine/retofinv.c", + MAME_DIR .. "src/mame/video/retofinv.c", + MAME_DIR .. "src/mame/drivers/rollrace.c", + MAME_DIR .. "src/mame/video/rollrace.c", + MAME_DIR .. "src/mame/drivers/sbowling.c", + MAME_DIR .. "src/mame/drivers/slapshot.c", + MAME_DIR .. "src/mame/video/slapshot.c", + MAME_DIR .. "src/mame/drivers/ssrj.c", + MAME_DIR .. "src/mame/video/ssrj.c", + MAME_DIR .. "src/mame/drivers/superchs.c", + MAME_DIR .. "src/mame/video/superchs.c", + MAME_DIR .. "src/mame/drivers/superqix.c", + MAME_DIR .. "src/mame/video/superqix.c", + MAME_DIR .. "src/mame/drivers/taito_b.c", + MAME_DIR .. "src/mame/video/taito_b.c", + MAME_DIR .. "src/mame/drivers/taito_f2.c", + MAME_DIR .. "src/mame/video/taito_f2.c", + MAME_DIR .. "src/mame/drivers/taito_f3.c", + MAME_DIR .. "src/mame/video/taito_f3.c", + MAME_DIR .. "src/mame/audio/taito_en.c", + MAME_DIR .. "src/mame/drivers/taito_h.c", + MAME_DIR .. "src/mame/video/taito_h.c", + MAME_DIR .. "src/mame/drivers/taito_l.c", + MAME_DIR .. "src/mame/video/taito_l.c", + MAME_DIR .. "src/mame/drivers/taito_x.c", + MAME_DIR .. "src/mame/machine/cchip.c", + MAME_DIR .. "src/mame/drivers/taito_z.c", + MAME_DIR .. "src/mame/video/taito_z.c", + MAME_DIR .. "src/mame/drivers/taito_o.c", + MAME_DIR .. "src/mame/video/taito_o.c", + MAME_DIR .. "src/mame/drivers/taitoair.c", + MAME_DIR .. "src/mame/video/taitoair.c", + MAME_DIR .. "src/mame/drivers/taitogn.c", + MAME_DIR .. "src/mame/drivers/taitojc.c", + MAME_DIR .. "src/mame/video/taitojc.c", + MAME_DIR .. "src/mame/drivers/taitopjc.c", + MAME_DIR .. "src/mame/drivers/taitosj.c", + MAME_DIR .. "src/mame/machine/taitosj.c", + MAME_DIR .. "src/mame/video/taitosj.c", + MAME_DIR .. "src/mame/drivers/taitottl.c", + MAME_DIR .. "src/mame/drivers/taitotz.c", + MAME_DIR .. "src/mame/drivers/taitotx.c", + MAME_DIR .. "src/mame/drivers/taitowlf.c", + MAME_DIR .. "src/mame/drivers/tnzs.c", + MAME_DIR .. "src/mame/machine/tnzs.c", + MAME_DIR .. "src/mame/video/tnzs.c", + MAME_DIR .. "src/mame/drivers/topspeed.c", + MAME_DIR .. "src/mame/video/topspeed.c", + MAME_DIR .. "src/mame/drivers/tsamurai.c", + MAME_DIR .. "src/mame/video/tsamurai.c", + MAME_DIR .. "src/mame/drivers/undrfire.c", + MAME_DIR .. "src/mame/video/undrfire.c", + MAME_DIR .. "src/mame/drivers/volfied.c", + MAME_DIR .. "src/mame/machine/volfied.c", + MAME_DIR .. "src/mame/video/volfied.c", + MAME_DIR .. "src/mame/drivers/warriorb.c", + MAME_DIR .. "src/mame/video/warriorb.c", + MAME_DIR .. "src/mame/drivers/wgp.c", + MAME_DIR .. "src/mame/video/wgp.c", + MAME_DIR .. "src/mame/drivers/wyvernf0.c", + MAME_DIR .. "src/mame/audio/taitosnd.c", + MAME_DIR .. "src/mame/audio/taito_zm.c", + MAME_DIR .. "src/mame/audio/t5182.c", + MAME_DIR .. "src/mame/machine/taitoio.c", + MAME_DIR .. "src/mame/video/taito_helper.c", + MAME_DIR .. "src/mame/video/pc080sn.c", + MAME_DIR .. "src/mame/video/pc090oj.c", + MAME_DIR .. "src/mame/video/tc0080vco.c", + MAME_DIR .. "src/mame/video/tc0100scn.c", + MAME_DIR .. "src/mame/video/tc0150rod.c", + MAME_DIR .. "src/mame/video/tc0280grd.c", + MAME_DIR .. "src/mame/video/tc0360pri.c", + MAME_DIR .. "src/mame/video/tc0480scp.c", + MAME_DIR .. "src/mame/video/tc0110pcr.c", + MAME_DIR .. "src/mame/video/tc0180vcu.c", +} + +createMAMEProjects(_target, _subtarget, "tatsumi") +files { + MAME_DIR .. "src/mame/drivers/kingdrby.c", + MAME_DIR .. "src/mame/drivers/lockon.c", + MAME_DIR .. "src/mame/video/lockon.c", + MAME_DIR .. "src/mame/drivers/tatsumi.c", + MAME_DIR .. "src/mame/machine/tatsumi.c", + MAME_DIR .. "src/mame/video/tatsumi.c", + MAME_DIR .. "src/mame/drivers/tx1.c", + MAME_DIR .. "src/mame/machine/tx1.c", + MAME_DIR .. "src/mame/audio/tx1.c", + MAME_DIR .. "src/mame/video/tx1.c", +} + +createMAMEProjects(_target, _subtarget, "tch") +files { + MAME_DIR .. "src/mame/drivers/kickgoal.c", + MAME_DIR .. "src/mame/video/kickgoal.c", + MAME_DIR .. "src/mame/drivers/littlerb.c", + MAME_DIR .. "src/mame/drivers/rltennis.c", + MAME_DIR .. "src/mame/video/rltennis.c", + MAME_DIR .. "src/mame/drivers/speedspn.c", + MAME_DIR .. "src/mame/video/speedspn.c", + MAME_DIR .. "src/mame/drivers/wheelfir.c", +} + +createMAMEProjects(_target, _subtarget, "tecfri") +files { + MAME_DIR .. "src/mame/drivers/ambush.c", + MAME_DIR .. "src/mame/video/ambush.c", + MAME_DIR .. "src/mame/drivers/holeland.c", + MAME_DIR .. "src/mame/video/holeland.c", + MAME_DIR .. "src/mame/drivers/sauro.c", + MAME_DIR .. "src/mame/video/sauro.c", + MAME_DIR .. "src/mame/drivers/speedbal.c", + MAME_DIR .. "src/mame/video/speedbal.c", +} + +createMAMEProjects(_target, _subtarget, "technos") +files { + MAME_DIR .. "src/mame/drivers/battlane.c", + MAME_DIR .. "src/mame/video/battlane.c", + MAME_DIR .. "src/mame/drivers/blockout.c", + MAME_DIR .. "src/mame/video/blockout.c", + MAME_DIR .. "src/mame/drivers/bogeyman.c", + MAME_DIR .. "src/mame/video/bogeyman.c", + MAME_DIR .. "src/mame/drivers/chinagat.c", + MAME_DIR .. "src/mame/drivers/ddragon.c", + MAME_DIR .. "src/mame/video/ddragon.c", + MAME_DIR .. "src/mame/drivers/ddragon3.c", + MAME_DIR .. "src/mame/video/ddragon3.c", + MAME_DIR .. "src/mame/drivers/dogfgt.c", + MAME_DIR .. "src/mame/video/dogfgt.c", + MAME_DIR .. "src/mame/drivers/matmania.c", + MAME_DIR .. "src/mame/video/matmania.c", + MAME_DIR .. "src/mame/drivers/mystston.c", + MAME_DIR .. "src/mame/video/mystston.c", + MAME_DIR .. "src/mame/drivers/renegade.c", + MAME_DIR .. "src/mame/video/renegade.c", + MAME_DIR .. "src/mame/drivers/scregg.c", + MAME_DIR .. "src/mame/drivers/shadfrce.c", + MAME_DIR .. "src/mame/video/shadfrce.c", + MAME_DIR .. "src/mame/drivers/spdodgeb.c", + MAME_DIR .. "src/mame/video/spdodgeb.c", + MAME_DIR .. "src/mame/drivers/ssozumo.c", + MAME_DIR .. "src/mame/video/ssozumo.c", + MAME_DIR .. "src/mame/drivers/tagteam.c", + MAME_DIR .. "src/mame/video/tagteam.c", + MAME_DIR .. "src/mame/drivers/vball.c", + MAME_DIR .. "src/mame/video/vball.c", + MAME_DIR .. "src/mame/drivers/wwfsstar.c", + MAME_DIR .. "src/mame/video/wwfsstar.c", + MAME_DIR .. "src/mame/drivers/xain.c", + MAME_DIR .. "src/mame/video/xain.c", +} + +createMAMEProjects(_target, _subtarget, "tehkan") +files { + MAME_DIR .. "src/mame/video/tecmo_spr.c", + MAME_DIR .. "src/mame/video/tecmo_mix.c", + MAME_DIR .. "src/mame/drivers/bombjack.c", + MAME_DIR .. "src/mame/video/bombjack.c", + MAME_DIR .. "src/mame/drivers/gaiden.c", + MAME_DIR .. "src/mame/video/gaiden.c", + MAME_DIR .. "src/mame/drivers/lvcards.c", + MAME_DIR .. "src/mame/video/lvcards.c", + MAME_DIR .. "src/mame/drivers/pbaction.c", + MAME_DIR .. "src/mame/video/pbaction.c", + MAME_DIR .. "src/mame/drivers/senjyo.c", + MAME_DIR .. "src/mame/audio/senjyo.c", + MAME_DIR .. "src/mame/video/senjyo.c", + MAME_DIR .. "src/mame/drivers/solomon.c", + MAME_DIR .. "src/mame/video/solomon.c", + MAME_DIR .. "src/mame/drivers/spbactn.c", + MAME_DIR .. "src/mame/video/spbactn.c", + MAME_DIR .. "src/mame/drivers/tbowl.c", + MAME_DIR .. "src/mame/video/tbowl.c", + MAME_DIR .. "src/mame/drivers/tecmo.c", + MAME_DIR .. "src/mame/video/tecmo.c", + MAME_DIR .. "src/mame/drivers/tecmo16.c", + MAME_DIR .. "src/mame/video/tecmo16.c", + MAME_DIR .. "src/mame/drivers/tecmosys.c", + MAME_DIR .. "src/mame/machine/tecmosys.c", + MAME_DIR .. "src/mame/video/tecmosys.c", + MAME_DIR .. "src/mame/drivers/tehkanwc.c", + MAME_DIR .. "src/mame/video/tehkanwc.c", + MAME_DIR .. "src/mame/drivers/wc90.c", + MAME_DIR .. "src/mame/video/wc90.c", + MAME_DIR .. "src/mame/drivers/wc90b.c", + MAME_DIR .. "src/mame/video/wc90b.c", +} + +createMAMEProjects(_target, _subtarget, "thepit") +files { + MAME_DIR .. "src/mame/drivers/thepit.c", + MAME_DIR .. "src/mame/video/thepit.c", + MAME_DIR .. "src/mame/drivers/timelimt.c", + MAME_DIR .. "src/mame/video/timelimt.c", +} + +createMAMEProjects(_target, _subtarget, "toaplan") +files { + MAME_DIR .. "src/mame/drivers/mjsister.c", + MAME_DIR .. "src/mame/drivers/slapfght.c", + MAME_DIR .. "src/mame/machine/slapfght.c", + MAME_DIR .. "src/mame/video/slapfght.c", + MAME_DIR .. "src/mame/drivers/snowbros.c", + MAME_DIR .. "src/mame/video/kan_pand.c", + MAME_DIR .. "src/mame/video/kan_panb.c", + MAME_DIR .. "src/mame/drivers/toaplan1.c", + MAME_DIR .. "src/mame/machine/toaplan1.c", + MAME_DIR .. "src/mame/video/toaplan1.c", + MAME_DIR .. "src/mame/drivers/toaplan2.c", + MAME_DIR .. "src/mame/video/toaplan2.c", + MAME_DIR .. "src/mame/video/gp9001.c", + MAME_DIR .. "src/mame/drivers/twincobr.c", + MAME_DIR .. "src/mame/machine/twincobr.c", + MAME_DIR .. "src/mame/video/twincobr.c", + MAME_DIR .. "src/mame/drivers/wardner.c", + MAME_DIR .. "src/mame/video/toaplan_scu.c", +} + +createMAMEProjects(_target, _subtarget, "tong") +files { + MAME_DIR .. "src/mame/drivers/beezer.c", + MAME_DIR .. "src/mame/machine/beezer.c", + MAME_DIR .. "src/mame/video/beezer.c", + MAME_DIR .. "src/mame/audio/beezer.c", +} + +createMAMEProjects(_target, _subtarget, "unico") +files { + MAME_DIR .. "src/mame/drivers/drgnmst.c", + MAME_DIR .. "src/mame/video/drgnmst.c", + MAME_DIR .. "src/mame/drivers/silkroad.c", + MAME_DIR .. "src/mame/video/silkroad.c", + MAME_DIR .. "src/mame/drivers/unico.c", + MAME_DIR .. "src/mame/video/unico.c", +} + +createMAMEProjects(_target, _subtarget, "univers") +files { + MAME_DIR .. "src/mame/drivers/cheekyms.c", + MAME_DIR .. "src/mame/video/cheekyms.c", + MAME_DIR .. "src/mame/drivers/cosmic.c", + MAME_DIR .. "src/mame/video/cosmic.c", + MAME_DIR .. "src/mame/drivers/docastle.c", + MAME_DIR .. "src/mame/machine/docastle.c", + MAME_DIR .. "src/mame/video/docastle.c", + MAME_DIR .. "src/mame/drivers/ladybug.c", + MAME_DIR .. "src/mame/video/ladybug.c", + MAME_DIR .. "src/mame/drivers/mrdo.c", + MAME_DIR .. "src/mame/video/mrdo.c", + MAME_DIR .. "src/mame/drivers/redclash.c", + MAME_DIR .. "src/mame/video/redclash.c", + MAME_DIR .. "src/mame/drivers/superdq.c", +} + +createMAMEProjects(_target, _subtarget, "upl") +files { + MAME_DIR .. "src/mame/drivers/mouser.c", + MAME_DIR .. "src/mame/video/mouser.c", + MAME_DIR .. "src/mame/drivers/ninjakd2.c", + MAME_DIR .. "src/mame/video/ninjakd2.c", + MAME_DIR .. "src/mame/drivers/nova2001.c", + MAME_DIR .. "src/mame/video/nova2001.c", + MAME_DIR .. "src/mame/drivers/xxmissio.c", + MAME_DIR .. "src/mame/video/xxmissio.c", +} + +createMAMEProjects(_target, _subtarget, "valadon") +files { + MAME_DIR .. "src/mame/drivers/bagman.c", + MAME_DIR .. "src/mame/machine/bagman.c", + MAME_DIR .. "src/mame/video/bagman.c", + MAME_DIR .. "src/mame/drivers/tankbust.c", + MAME_DIR .. "src/mame/video/tankbust.c", +} + +createMAMEProjects(_target, _subtarget, "veltmjr") +files { + MAME_DIR .. "src/mame/drivers/cardline.c", + MAME_DIR .. "src/mame/drivers/witch.c", +} + +createMAMEProjects(_target, _subtarget, "venture") +files { + MAME_DIR .. "src/mame/drivers/looping.c", + MAME_DIR .. "src/mame/drivers/spcforce.c", + MAME_DIR .. "src/mame/video/spcforce.c", + MAME_DIR .. "src/mame/drivers/suprridr.c", + MAME_DIR .. "src/mame/video/suprridr.c", +} + +createMAMEProjects(_target, _subtarget, "vsystem") +files { + MAME_DIR .. "src/mame/video/vsystem_spr.c", + MAME_DIR .. "src/mame/video/vsystem_spr2.c", + MAME_DIR .. "src/mame/drivers/aerofgt.c", + MAME_DIR .. "src/mame/video/aerofgt.c", + MAME_DIR .. "src/mame/drivers/crshrace.c", + MAME_DIR .. "src/mame/video/crshrace.c", + MAME_DIR .. "src/mame/drivers/f1gp.c", + MAME_DIR .. "src/mame/video/f1gp.c", + MAME_DIR .. "src/mame/drivers/fromance.c", + MAME_DIR .. "src/mame/video/fromance.c", + MAME_DIR .. "src/mame/drivers/fromanc2.c", + MAME_DIR .. "src/mame/video/fromanc2.c", + MAME_DIR .. "src/mame/drivers/gstriker.c", + MAME_DIR .. "src/mame/video/gstriker.c", + MAME_DIR .. "src/mame/video/mb60553.c", + MAME_DIR .. "src/mame/video/vs920a.c", + MAME_DIR .. "src/mame/drivers/inufuku.c", + MAME_DIR .. "src/mame/video/inufuku.c", + MAME_DIR .. "src/mame/drivers/ojankohs.c", + MAME_DIR .. "src/mame/video/ojankohs.c", + MAME_DIR .. "src/mame/drivers/pipedrm.c", + MAME_DIR .. "src/mame/drivers/rpunch.c", + MAME_DIR .. "src/mame/video/rpunch.c", + MAME_DIR .. "src/mame/drivers/suprslam.c", + MAME_DIR .. "src/mame/video/suprslam.c", + MAME_DIR .. "src/mame/drivers/tail2nos.c", + MAME_DIR .. "src/mame/video/tail2nos.c", + MAME_DIR .. "src/mame/drivers/taotaido.c", + MAME_DIR .. "src/mame/video/taotaido.c", + MAME_DIR .. "src/mame/drivers/welltris.c", + MAME_DIR .. "src/mame/video/welltris.c", +} + +createMAMEProjects(_target, _subtarget, "yunsung") +files { + MAME_DIR .. "src/mame/drivers/nmg5.c", + MAME_DIR .. "src/mame/drivers/paradise.c", + MAME_DIR .. "src/mame/video/paradise.c", + MAME_DIR .. "src/mame/drivers/yunsung8.c", + MAME_DIR .. "src/mame/video/yunsung8.c", + MAME_DIR .. "src/mame/drivers/yunsun16.c", + MAME_DIR .. "src/mame/video/yunsun16.c", +} + +createMAMEProjects(_target, _subtarget, "zaccaria") +files { + MAME_DIR .. "src/mame/drivers/laserbat.c", + MAME_DIR .. "src/mame/audio/laserbat.c", + MAME_DIR .. "src/mame/drivers/seabattl.c", + MAME_DIR .. "src/mame/drivers/zac2650.c", + MAME_DIR .. "src/mame/video/zac2650.c", + MAME_DIR .. "src/mame/drivers/zaccaria.c", + MAME_DIR .. "src/mame/video/zaccaria.c", +} + +-------------------------------------------------- +-- pinball drivers +-------------------------------------------------- + +createMAMEProjects(_target, _subtarget, "pinball") +files { + MAME_DIR .. "src/mame/drivers/allied.c", + MAME_DIR .. "src/mame/drivers/alvg.c", + MAME_DIR .. "src/mame/drivers/atari_s1.c", + MAME_DIR .. "src/mame/drivers/atari_s2.c", + MAME_DIR .. "src/mame/drivers/bingo.c", + MAME_DIR .. "src/mame/drivers/by17.c", + MAME_DIR .. "src/mame/drivers/by35.c", + MAME_DIR .. "src/mame/drivers/by6803.c", + MAME_DIR .. "src/mame/drivers/by68701.c", + MAME_DIR .. "src/mame/drivers/byvid.c", + MAME_DIR .. "src/mame/drivers/capcom.c", + MAME_DIR .. "src/mame/drivers/de_2.c", + MAME_DIR .. "src/mame/drivers/de_3.c", + MAME_DIR .. "src/mame/machine/decopincpu.c", + MAME_DIR .. "src/mame/video/decodmd1.c", + MAME_DIR .. "src/mame/video/decodmd2.c", + MAME_DIR .. "src/mame/video/decodmd3.c", + MAME_DIR .. "src/mame/drivers/de_3b.c", + MAME_DIR .. "src/mame/drivers/flicker.c", + MAME_DIR .. "src/mame/drivers/g627.c", + MAME_DIR .. "src/mame/drivers/gp_1.c", + MAME_DIR .. "src/mame/machine/genpin.c", + MAME_DIR .. "src/mame/drivers/gp_2.c", + MAME_DIR .. "src/mame/drivers/gts1.c", + MAME_DIR .. "src/mame/drivers/gts3.c", + MAME_DIR .. "src/mame/drivers/gts3a.c", + MAME_DIR .. "src/mame/drivers/gts80.c", + MAME_DIR .. "src/mame/drivers/gts80a.c", + MAME_DIR .. "src/mame/drivers/gts80b.c", + MAME_DIR .. "src/mame/drivers/hankin.c", + MAME_DIR .. "src/mame/drivers/icecold.c", + MAME_DIR .. "src/mame/drivers/inder.c", + MAME_DIR .. "src/mame/drivers/jeutel.c", + MAME_DIR .. "src/mame/drivers/jp.c", + MAME_DIR .. "src/mame/drivers/jvh.c", + MAME_DIR .. "src/mame/drivers/kissproto.c", + MAME_DIR .. "src/mame/drivers/ltd.c", + MAME_DIR .. "src/mame/drivers/micropin.c", + MAME_DIR .. "src/mame/drivers/mephisto.c", + MAME_DIR .. "src/mame/drivers/mrgame.c", + MAME_DIR .. "src/mame/drivers/nsm.c", + MAME_DIR .. "src/mame/drivers/peyper.c", + MAME_DIR .. "src/mame/drivers/play_1.c", + MAME_DIR .. "src/mame/drivers/play_2.c", + MAME_DIR .. "src/mame/drivers/play_3.c", + MAME_DIR .. "src/mame/drivers/play_5.c", + MAME_DIR .. "src/mame/drivers/rowamet.c", + MAME_DIR .. "src/mame/drivers/s11.c", + MAME_DIR .. "src/mame/drivers/s11a.c", + MAME_DIR .. "src/mame/drivers/s11b.c", + MAME_DIR .. "src/mame/drivers/s11c.c", + MAME_DIR .. "src/mame/audio/s11c_bg.c", + MAME_DIR .. "src/mame/drivers/s3.c", + MAME_DIR .. "src/mame/drivers/s4.c", + MAME_DIR .. "src/mame/drivers/s6.c", + MAME_DIR .. "src/mame/drivers/s6a.c", + MAME_DIR .. "src/mame/drivers/s7.c", + MAME_DIR .. "src/mame/drivers/s8.c", + MAME_DIR .. "src/mame/drivers/s8a.c", + MAME_DIR .. "src/mame/drivers/s9.c", + MAME_DIR .. "src/mame/drivers/sam.c", + MAME_DIR .. "src/mame/drivers/sleic.c", + MAME_DIR .. "src/mame/drivers/spectra.c", + MAME_DIR .. "src/mame/drivers/spinb.c", + MAME_DIR .. "src/mame/drivers/st_mp100.c", + MAME_DIR .. "src/mame/drivers/st_mp200.c", + MAME_DIR .. "src/mame/drivers/taito.c", + MAME_DIR .. "src/mame/drivers/techno.c", + MAME_DIR .. "src/mame/drivers/vd.c", + MAME_DIR .. "src/mame/drivers/whitestar.c", + MAME_DIR .. "src/mame/drivers/white_mod.c", + MAME_DIR .. "src/mame/drivers/wico.c", + MAME_DIR .. "src/mame/drivers/wpc_95.c", + MAME_DIR .. "src/mame/drivers/wpc_an.c", + MAME_DIR .. "src/mame/drivers/wpc_dcs.c", + MAME_DIR .. "src/mame/drivers/wpc_dot.c", + MAME_DIR .. "src/mame/drivers/wpc_flip1.c", + MAME_DIR .. "src/mame/drivers/wpc_flip2.c", + MAME_DIR .. "src/mame/drivers/wpc_s.c", + MAME_DIR .. "src/mame/machine/wpc.c", + MAME_DIR .. "src/mame/audio/wpcsnd.c", + MAME_DIR .. "src/mame/video/wpc_dmd.c", + MAME_DIR .. "src/mame/machine/wpc_pic.c", + MAME_DIR .. "src/mame/machine/wpc_lamp.c", + MAME_DIR .. "src/mame/machine/wpc_out.c", + MAME_DIR .. "src/mame/machine/wpc_shift.c", + MAME_DIR .. "src/mame/drivers/zac_1.c", + MAME_DIR .. "src/mame/drivers/zac_2.c", + MAME_DIR .. "src/mame/drivers/zac_proto.c", +} + +-------------------------------------------------- +-- remaining drivers +-------------------------------------------------- + +createMAMEProjects(_target, _subtarget, "misc") +files { + MAME_DIR .. "src/mame/drivers/1945kiii.c", + MAME_DIR .. "src/mame/drivers/39in1.c", + MAME_DIR .. "src/mame/drivers/3do.c", + MAME_DIR .. "src/mame/machine/3do.c", + MAME_DIR .. "src/mame/drivers/3x3puzzl.c", + MAME_DIR .. "src/mame/drivers/4enraya.c", + MAME_DIR .. "src/mame/video/4enraya.c", + MAME_DIR .. "src/mame/drivers/4enlinea.c", + MAME_DIR .. "src/mame/drivers/5clown.c", + MAME_DIR .. "src/mame/drivers/a1supply.c", + MAME_DIR .. "src/mame/drivers/acefruit.c", + MAME_DIR .. "src/mame/drivers/aces1.c", + MAME_DIR .. "src/mame/drivers/acesp.c", + MAME_DIR .. "src/mame/drivers/adp.c", + MAME_DIR .. "src/mame/drivers/alinvade.c", + MAME_DIR .. "src/mame/drivers/amaticmg.c", + MAME_DIR .. "src/mame/drivers/ampoker2.c", + MAME_DIR .. "src/mame/video/ampoker2.c", + MAME_DIR .. "src/mame/drivers/amspdwy.c", + MAME_DIR .. "src/mame/video/amspdwy.c", + MAME_DIR .. "src/mame/drivers/amusco.c", + MAME_DIR .. "src/mame/drivers/arachnid.c", + MAME_DIR .. "src/mame/drivers/artmagic.c", + MAME_DIR .. "src/mame/video/artmagic.c", + MAME_DIR .. "src/mame/drivers/astrafr.c", + MAME_DIR .. "src/mame/drivers/astrcorp.c", + MAME_DIR .. "src/mame/drivers/astropc.c", + MAME_DIR .. "src/mame/drivers/atronic.c", + MAME_DIR .. "src/mame/drivers/attckufo.c", + MAME_DIR .. "src/mame/drivers/avt.c", + MAME_DIR .. "src/mame/drivers/aztarac.c", + MAME_DIR .. "src/mame/audio/aztarac.c", + MAME_DIR .. "src/mame/video/aztarac.c", + MAME_DIR .. "src/mame/drivers/bailey.c", + MAME_DIR .. "src/mame/drivers/beaminv.c", + MAME_DIR .. "src/mame/drivers/belatra.c", + MAME_DIR .. "src/mame/drivers/bgt.c", + MAME_DIR .. "src/mame/drivers/bingoman.c", + MAME_DIR .. "src/mame/drivers/bingor.c", + MAME_DIR .. "src/mame/drivers/blitz.c", + MAME_DIR .. "src/mame/drivers/blitz68k.c", + MAME_DIR .. "src/mame/drivers/buster.c", + MAME_DIR .. "src/mame/drivers/calomega.c", + MAME_DIR .. "src/mame/video/calomega.c", + MAME_DIR .. "src/mame/drivers/carrera.c", + MAME_DIR .. "src/mame/drivers/castle.c", + MAME_DIR .. "src/mame/drivers/cave.c", + MAME_DIR .. "src/mame/video/cave.c", + MAME_DIR .. "src/mame/drivers/cavepc.c", + MAME_DIR .. "src/mame/drivers/cv1k.c", + MAME_DIR .. "src/mame/drivers/cb2001.c", + MAME_DIR .. "src/mame/drivers/cdi.c", + MAME_DIR .. "src/mame/video/mcd212.c", + MAME_DIR .. "src/mame/machine/cdi070.c", + MAME_DIR .. "src/mame/machine/cdislave.c", + MAME_DIR .. "src/mame/machine/cdicdic.c", + MAME_DIR .. "src/mame/drivers/cesclass.c", + MAME_DIR .. "src/mame/drivers/chance32.c", + MAME_DIR .. "src/mame/drivers/chicago.c", + MAME_DIR .. "src/mame/drivers/chsuper.c", + MAME_DIR .. "src/mame/drivers/cidelsa.c", + MAME_DIR .. "src/mame/video/cidelsa.c", + MAME_DIR .. "src/mame/drivers/cocoloco.c", + MAME_DIR .. "src/mame/drivers/coinmstr.c", + MAME_DIR .. "src/mame/drivers/coinmvga.c", + MAME_DIR .. "src/mame/drivers/comebaby.c", + MAME_DIR .. "src/mame/drivers/cupidon.c", + MAME_DIR .. "src/mame/drivers/bntyhunt.c", + MAME_DIR .. "src/mame/drivers/coolpool.c", + MAME_DIR .. "src/mame/drivers/megaphx.c", + MAME_DIR .. "src/mame/machine/inder_sb.c", + MAME_DIR .. "src/mame/machine/inder_vid.c", + MAME_DIR .. "src/mame/drivers/corona.c", + MAME_DIR .. "src/mame/drivers/crystal.c", + MAME_DIR .. "src/mame/video/vrender0.c", + MAME_DIR .. "src/mame/drivers/cubeqst.c", + MAME_DIR .. "src/mame/drivers/cybertnk.c", + MAME_DIR .. "src/mame/drivers/dcheese.c", + MAME_DIR .. "src/mame/video/dcheese.c", + MAME_DIR .. "src/mame/drivers/dfruit.c", + MAME_DIR .. "src/mame/drivers/dgpix.c", + MAME_DIR .. "src/mame/drivers/discoboy.c", + MAME_DIR .. "src/mame/drivers/dominob.c", + MAME_DIR .. "src/mame/drivers/dorachan.c", + MAME_DIR .. "src/mame/drivers/dreamwld.c", + MAME_DIR .. "src/mame/drivers/dribling.c", + MAME_DIR .. "src/mame/video/dribling.c", + MAME_DIR .. "src/mame/drivers/drw80pkr.c", + MAME_DIR .. "src/mame/drivers/dwarfd.c", + MAME_DIR .. "src/mame/drivers/dynadice.c", + MAME_DIR .. "src/mame/drivers/ecoinfr.c", + MAME_DIR .. "src/mame/drivers/ecoinf1.c", + MAME_DIR .. "src/mame/drivers/ecoinf2.c", + MAME_DIR .. "src/mame/drivers/ecoinf3.c", + MAME_DIR .. "src/mame/drivers/electra.c", + MAME_DIR .. "src/mame/drivers/epos.c", + MAME_DIR .. "src/mame/video/epos.c", + MAME_DIR .. "src/mame/drivers/esd16.c", + MAME_DIR .. "src/mame/video/esd16.c", + MAME_DIR .. "src/mame/drivers/esh.c", + MAME_DIR .. "src/mame/drivers/esripsys.c", + MAME_DIR .. "src/mame/video/esripsys.c", + MAME_DIR .. "src/mame/drivers/ettrivia.c", + MAME_DIR .. "src/mame/drivers/extrema.c", + MAME_DIR .. "src/mame/drivers/fireball.c", + MAME_DIR .. "src/mame/drivers/flipjack.c", + MAME_DIR .. "src/mame/drivers/flower.c", + MAME_DIR .. "src/mame/audio/flower.c", + MAME_DIR .. "src/mame/video/flower.c", + MAME_DIR .. "src/mame/drivers/fortecar.c", + MAME_DIR .. "src/mame/drivers/fresh.c", + MAME_DIR .. "src/mame/drivers/freekick.c", + MAME_DIR .. "src/mame/video/freekick.c", + MAME_DIR .. "src/mame/drivers/fungames.c", + MAME_DIR .. "src/mame/drivers/funkball.c", + MAME_DIR .. "src/mame/drivers/gambl186.c", + MAME_DIR .. "src/mame/drivers/galaxi.c", + MAME_DIR .. "src/mame/drivers/galgame.c", + MAME_DIR .. "src/mame/drivers/gamecstl.c", + MAME_DIR .. "src/mame/drivers/gammagic.c", + MAME_DIR .. "src/mame/drivers/gamtor.c", + MAME_DIR .. "src/mame/drivers/gei.c", + MAME_DIR .. "src/mame/drivers/globalfr.c", + MAME_DIR .. "src/mame/drivers/globalvr.c", + MAME_DIR .. "src/mame/drivers/gluck2.c", + MAME_DIR .. "src/mame/drivers/goldngam.c", + MAME_DIR .. "src/mame/drivers/goldnpkr.c", + MAME_DIR .. "src/mame/drivers/good.c", + MAME_DIR .. "src/mame/drivers/gotcha.c", + MAME_DIR .. "src/mame/video/gotcha.c", + MAME_DIR .. "src/mame/drivers/gstream.c", + MAME_DIR .. "src/mame/drivers/gumbo.c", + MAME_DIR .. "src/mame/video/gumbo.c", + MAME_DIR .. "src/mame/drivers/gunpey.c", + MAME_DIR .. "src/mame/drivers/hideseek.c", + MAME_DIR .. "src/mame/drivers/hazelgr.c", + MAME_DIR .. "src/mame/drivers/headonb.c", + MAME_DIR .. "src/mame/drivers/highvdeo.c", + MAME_DIR .. "src/mame/drivers/himesiki.c", + MAME_DIR .. "src/mame/video/himesiki.c", + MAME_DIR .. "src/mame/drivers/hitpoker.c", + MAME_DIR .. "src/mame/drivers/homedata.c", + MAME_DIR .. "src/mame/video/homedata.c", + MAME_DIR .. "src/mame/drivers/hotblock.c", + MAME_DIR .. "src/mame/drivers/hotstuff.c", + MAME_DIR .. "src/mame/drivers/ichiban.c", + MAME_DIR .. "src/mame/drivers/imolagp.c", + MAME_DIR .. "src/mame/drivers/intrscti.c", + MAME_DIR .. "src/mame/drivers/istellar.c", + MAME_DIR .. "src/mame/drivers/itgambl2.c", + MAME_DIR .. "src/mame/drivers/itgambl3.c", + MAME_DIR .. "src/mame/drivers/itgamble.c", + MAME_DIR .. "src/mame/drivers/jackpool.c", + MAME_DIR .. "src/mame/drivers/jankenmn.c", + MAME_DIR .. "src/mame/drivers/jokrwild.c", + MAME_DIR .. "src/mame/drivers/jongkyo.c", + MAME_DIR .. "src/mame/drivers/jubilee.c", + MAME_DIR .. "src/mame/drivers/kas89.c", + MAME_DIR .. "src/mame/drivers/kingpin.c", + MAME_DIR .. "src/mame/drivers/koikoi.c", + MAME_DIR .. "src/mame/drivers/kurukuru.c", + MAME_DIR .. "src/mame/drivers/kyugo.c", + MAME_DIR .. "src/mame/video/kyugo.c", + MAME_DIR .. "src/mame/drivers/ladyfrog.c", + MAME_DIR .. "src/mame/video/ladyfrog.c", + MAME_DIR .. "src/mame/drivers/laserbas.c", + MAME_DIR .. "src/mame/drivers/lethalj.c", + MAME_DIR .. "src/mame/video/lethalj.c", + MAME_DIR .. "src/mame/drivers/limenko.c", + MAME_DIR .. "src/mame/drivers/ltcasino.c", + MAME_DIR .. "src/mame/drivers/lucky74.c", + MAME_DIR .. "src/mame/video/lucky74.c", + MAME_DIR .. "src/mame/drivers/luckgrln.c", + MAME_DIR .. "src/mame/drivers/magic10.c", + MAME_DIR .. "src/mame/drivers/magicard.c", + MAME_DIR .. "src/mame/drivers/magicfly.c", + MAME_DIR .. "src/mame/drivers/magictg.c", + MAME_DIR .. "src/mame/drivers/magtouch.c", + MAME_DIR .. "src/mame/drivers/majorpkr.c", + MAME_DIR .. "src/mame/drivers/malzak.c", + MAME_DIR .. "src/mame/video/malzak.c", + MAME_DIR .. "src/mame/drivers/manohman.c", + MAME_DIR .. "src/mame/drivers/mcatadv.c", + MAME_DIR .. "src/mame/video/mcatadv.c", + MAME_DIR .. "src/mame/drivers/mgavegas.c", + MAME_DIR .. "src/mame/drivers/meyc8080.c", + MAME_DIR .. "src/mame/drivers/meyc8088.c", + MAME_DIR .. "src/mame/drivers/micro3d.c", + MAME_DIR .. "src/mame/machine/micro3d.c", + MAME_DIR .. "src/mame/video/micro3d.c", + MAME_DIR .. "src/mame/audio/micro3d.c", + MAME_DIR .. "src/mame/drivers/midas.c", + MAME_DIR .. "src/mame/drivers/miniboy7.c", + MAME_DIR .. "src/mame/drivers/mirax.c", + MAME_DIR .. "src/mame/drivers/mole.c", + MAME_DIR .. "src/mame/drivers/mosaic.c", + MAME_DIR .. "src/mame/video/mosaic.c", + MAME_DIR .. "src/mame/drivers/mpu12wbk.c", + MAME_DIR .. "src/mame/drivers/mrjong.c", + MAME_DIR .. "src/mame/video/mrjong.c", + MAME_DIR .. "src/mame/drivers/multfish.c", + MAME_DIR .. "src/mame/drivers/multfish_boot.c", + MAME_DIR .. "src/mame/drivers/multfish_ref.c", + MAME_DIR .. "src/mame/drivers/murogem.c", + MAME_DIR .. "src/mame/drivers/murogmbl.c", + MAME_DIR .. "src/mame/drivers/neoprint.c", + MAME_DIR .. "src/mame/drivers/neptunp2.c", + MAME_DIR .. "src/mame/drivers/news.c", + MAME_DIR .. "src/mame/video/news.c", + MAME_DIR .. "src/mame/drivers/nexus3d.c", + MAME_DIR .. "src/mame/drivers/norautp.c", + MAME_DIR .. "src/mame/audio/norautp.c", + MAME_DIR .. "src/mame/drivers/nsmpoker.c", + MAME_DIR .. "src/mame/drivers/oneshot.c", + MAME_DIR .. "src/mame/video/oneshot.c", + MAME_DIR .. "src/mame/drivers/onetwo.c", + MAME_DIR .. "src/mame/drivers/othello.c", + MAME_DIR .. "src/mame/drivers/pachifev.c", + MAME_DIR .. "src/mame/drivers/pasha2.c", + MAME_DIR .. "src/mame/drivers/pass.c", + MAME_DIR .. "src/mame/video/pass.c", + MAME_DIR .. "src/mame/drivers/peplus.c", + MAME_DIR .. "src/mame/drivers/photon.c", + MAME_DIR .. "src/mame/video/pk8000.c", + MAME_DIR .. "src/mame/drivers/photon2.c", + MAME_DIR .. "src/mame/drivers/photoply.c", + MAME_DIR .. "src/mame/drivers/pinkiri8.c", + MAME_DIR .. "src/mame/drivers/pipeline.c", + MAME_DIR .. "src/mame/drivers/pkscram.c", + MAME_DIR .. "src/mame/drivers/pntnpuzl.c", + MAME_DIR .. "src/mame/drivers/policetr.c", + MAME_DIR .. "src/mame/video/policetr.c", + MAME_DIR .. "src/mame/drivers/polyplay.c", + MAME_DIR .. "src/mame/audio/polyplay.c", + MAME_DIR .. "src/mame/video/polyplay.c", + MAME_DIR .. "src/mame/drivers/poker72.c", + MAME_DIR .. "src/mame/drivers/potgoldu.c", + MAME_DIR .. "src/mame/drivers/proconn.c", + MAME_DIR .. "src/mame/drivers/psattack.c", + MAME_DIR .. "src/mame/drivers/pse.c", + MAME_DIR .. "src/mame/drivers/quizo.c", + MAME_DIR .. "src/mame/drivers/quizpun2.c", + MAME_DIR .. "src/mame/drivers/rbmk.c", + MAME_DIR .. "src/mame/drivers/rcorsair.c", + MAME_DIR .. "src/mame/drivers/re900.c", + MAME_DIR .. "src/mame/drivers/rgum.c", + MAME_DIR .. "src/mame/drivers/roul.c", + MAME_DIR .. "src/mame/drivers/savquest.c", + MAME_DIR .. "src/mame/drivers/sanremo.c", + MAME_DIR .. "src/mame/drivers/sfbonus.c", + MAME_DIR .. "src/mame/drivers/shangkid.c", + MAME_DIR .. "src/mame/video/shangkid.c", + MAME_DIR .. "src/mame/drivers/skeetsht.c", + MAME_DIR .. "src/mame/drivers/skimaxx.c", + MAME_DIR .. "src/mame/drivers/skyarmy.c", + MAME_DIR .. "src/mame/drivers/skylncr.c", + MAME_DIR .. "src/mame/drivers/sliver.c", + MAME_DIR .. "src/mame/drivers/slotcarn.c", + MAME_DIR .. "src/mame/drivers/smsmcorp.c", + MAME_DIR .. "src/mame/drivers/sothello.c", + MAME_DIR .. "src/mame/drivers/splus.c", + MAME_DIR .. "src/mame/drivers/spool99.c", + MAME_DIR .. "src/mame/drivers/sprcros2.c", + MAME_DIR .. "src/mame/video/sprcros2.c", + MAME_DIR .. "src/mame/drivers/sshot.c", + MAME_DIR .. "src/mame/drivers/ssingles.c", + MAME_DIR .. "src/mame/drivers/sstrangr.c", + MAME_DIR .. "src/mame/drivers/statriv2.c", + MAME_DIR .. "src/mame/drivers/stellafr.c", + MAME_DIR .. "src/mame/drivers/stuntair.c", + MAME_DIR .. "src/mame/drivers/su2000.c", + MAME_DIR .. "src/mame/drivers/summit.c", + MAME_DIR .. "src/mame/drivers/sumt8035.c", + MAME_DIR .. "src/mame/drivers/supercrd.c", + MAME_DIR .. "src/mame/drivers/supertnk.c", + MAME_DIR .. "src/mame/drivers/superwng.c", + MAME_DIR .. "src/mame/drivers/tapatune.c", + MAME_DIR .. "src/mame/drivers/tattack.c", + MAME_DIR .. "src/mame/drivers/taxidriv.c", + MAME_DIR .. "src/mame/video/taxidriv.c", + MAME_DIR .. "src/mame/drivers/tcl.c", + MAME_DIR .. "src/mame/drivers/thayers.c", + MAME_DIR .. "src/mame/drivers/thedeep.c", + MAME_DIR .. "src/mame/video/thedeep.c", + MAME_DIR .. "src/mame/drivers/tiamc1.c", + MAME_DIR .. "src/mame/video/tiamc1.c", + MAME_DIR .. "src/mame/audio/tiamc1.c", + MAME_DIR .. "src/mame/drivers/tickee.c", + MAME_DIR .. "src/mame/drivers/tmspoker.c", + MAME_DIR .. "src/mame/drivers/truco.c", + MAME_DIR .. "src/mame/video/truco.c", + MAME_DIR .. "src/mame/drivers/trucocl.c", + MAME_DIR .. "src/mame/video/trucocl.c", + MAME_DIR .. "src/mame/drivers/trvmadns.c", + MAME_DIR .. "src/mame/drivers/trvquest.c", + MAME_DIR .. "src/mame/drivers/ttchamp.c", + MAME_DIR .. "src/mame/drivers/tugboat.c", + MAME_DIR .. "src/mame/drivers/umipoker.c", + MAME_DIR .. "src/mame/drivers/unkfr.c", + MAME_DIR .. "src/mame/drivers/unkhorse.c", + MAME_DIR .. "src/mame/drivers/usgames.c", + MAME_DIR .. "src/mame/video/usgames.c", + MAME_DIR .. "src/mame/drivers/vamphalf.c", + MAME_DIR .. "src/mame/drivers/vcombat.c", + MAME_DIR .. "src/mame/drivers/vectrex.c", + MAME_DIR .. "src/mame/video/vectrex.c", + MAME_DIR .. "src/mame/machine/vectrex.c", + MAME_DIR .. "src/mame/drivers/videopkr.c", + MAME_DIR .. "src/mame/drivers/vlc.c", + MAME_DIR .. "src/mame/drivers/voyager.c", + MAME_DIR .. "src/mame/drivers/vp101.c", + MAME_DIR .. "src/mame/drivers/vpoker.c", + MAME_DIR .. "src/mame/drivers/vroulet.c", + MAME_DIR .. "src/mame/drivers/wildpkr.c", + MAME_DIR .. "src/mame/drivers/wms.c", + MAME_DIR .. "src/mame/drivers/xtom3d.c", + MAME_DIR .. "src/mame/drivers/xyonix.c", + MAME_DIR .. "src/mame/video/xyonix.c", +} +end + diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua new file mode 100644 index 00000000000..def57c00324 --- /dev/null +++ b/scripts/target/mame/tiny.lua @@ -0,0 +1,146 @@ +--------------------------------------------------------------------------- +-- +-- tiny.lua +-- +-- Small driver-specific example makefile +-- Use make SUBTARGET=tiny to build +-- +-- Copyright Nicola Salmoria and the MAME Team. +-- Visit http://mamedev.org for licensing and usage restrictions. +-- +--------------------------------------------------------------------------- + + +-------------------------------------------------- +-- Specify all the CPU cores necessary for the +-- drivers referenced in tiny.c. +-------------------------------------------------- + +CPUS["Z80"] = true +CPUS["M6502"] = true +CPUS["MCS48"] = true +CPUS["MCS51"] = true +CPUS["M6800"] = true +CPUS["M6809"] = true +CPUS["M680X0"] = true +CPUS["TMS9900"] = true +CPUS["COP400"] = true + +-------------------------------------------------- +-- Specify all the sound cores necessary for the +-- drivers referenced in tiny.c. +-------------------------------------------------- + +SOUNDS["SAMPLES"] = true +SOUNDS["DAC"] = true +SOUNDS["DISCRETE"] = true +SOUNDS["AY8910"] = true +SOUNDS["YM2151"] = true +SOUNDS["ASTROCADE"] = true +SOUNDS["TMS5220"] = true +SOUNDS["OKIM6295"] = true +SOUNDS["HC55516"] = true +SOUNDS["YM3812"] = true +SOUNDS["CEM3394"] = true +SOUNDS["VOTRAX"] = true + +-------------------------------------------------- +-- specify available video cores +-------------------------------------------------- + +-------------------------------------------------- +-- specify available machine cores +-------------------------------------------------- + +MACHINES["6821PIA"] = true +MACHINES["TTL74148"] = true +MACHINES["TTL74153"] = true +MACHINES["TTL7474"] = true +MACHINES["RIOT6532"] = true +MACHINES["PIT8253"] = true +MACHINES["Z80CTC"] = true +MACHINES["68681"] = true +MACHINES["BANKDEV"] = true + + +-------------------------------------------------- +-- specify available bus cores +-------------------------------------------------- + +BUSES["CENTRONICS"] = true + +-------------------------------------------------- +-- This is the list of files that are necessary +-- for building all of the drivers referenced +-- in tiny.c +-------------------------------------------------- + +function createProjects_mame_tiny(_target, _subtarget) + project ("mame_tiny") + targetsubdir(_target .."_" .. _subtarget) + kind "StaticLib" + uuid (os.uuid("drv-mame-tiny")) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mame", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "mame/layout", + } + + includeosd() + + files{ + MAME_DIR .. "src/mame/machine/ticket.c", + MAME_DIR .. "src/mame/drivers/carpolo.c", + MAME_DIR .. "src/mame/machine/carpolo.c", + MAME_DIR .. "src/mame/video/carpolo.c", + MAME_DIR .. "src/mame/drivers/circus.c", + MAME_DIR .. "src/mame/audio/circus.c", + MAME_DIR .. "src/mame/video/circus.c", + MAME_DIR .. "src/mame/drivers/exidy.c", + MAME_DIR .. "src/mame/audio/exidy.c", + MAME_DIR .. "src/mame/video/exidy.c", + MAME_DIR .. "src/mame/audio/exidy440.c", + MAME_DIR .. "src/mame/drivers/starfire.c", + MAME_DIR .. "src/mame/video/starfire.c", + MAME_DIR .. "src/mame/drivers/vertigo.c", + MAME_DIR .. "src/mame/machine/vertigo.c", + MAME_DIR .. "src/mame/video/vertigo.c", + MAME_DIR .. "src/mame/drivers/victory.c", + MAME_DIR .. "src/mame/video/victory.c", + MAME_DIR .. "src/mame/audio/targ.c", + MAME_DIR .. "src/mame/drivers/astrocde.c", + MAME_DIR .. "src/mame/video/astrocde.c", + MAME_DIR .. "src/mame/drivers/gridlee.c", + MAME_DIR .. "src/mame/audio/gridlee.c", + MAME_DIR .. "src/mame/video/gridlee.c", + MAME_DIR .. "src/mame/drivers/williams.c", + MAME_DIR .. "src/mame/machine/williams.c", + MAME_DIR .. "src/mame/audio/williams.c", + MAME_DIR .. "src/mame/video/williams.c", + MAME_DIR .. "src/mame/audio/gorf.c", + MAME_DIR .. "src/mame/audio/wow.c", + MAME_DIR .. "src/mame/drivers/gaelco.c", + MAME_DIR .. "src/mame/video/gaelco.c", + MAME_DIR .. "src/mame/machine/gaelcrpt.c", + MAME_DIR .. "src/mame/drivers/wrally.c", + MAME_DIR .. "src/mame/machine/wrally.c", + MAME_DIR .. "src/mame/video/wrally.c", + MAME_DIR .. "src/mame/drivers/looping.c", + MAME_DIR .. "src/mame/drivers/supertnk.c", + } +end + +function linkProjects_mame_tiny(_target, _subtarget) + links { + "mame_tiny", + } +end
\ No newline at end of file diff --git a/scripts/target/mess/mess.lua b/scripts/target/mess/mess.lua new file mode 100644 index 00000000000..3446f13b47b --- /dev/null +++ b/scripts/target/mess/mess.lua @@ -0,0 +1,2654 @@ +--------------------------------------------------------------------------- +-- +-- mess.mak +-- +-- MESS target makefile +-- +--------------------------------------------------------------------------- + +-------------------------------------------------- +-- specify available CPU cores +-------------------------------------------------- + +CPUS["Z80"] = true +CPUS["Z180"] = true +CPUS["I8085"] = true +CPUS["I8089"] = true +CPUS["M6502"] = true +CPUS["H6280"] = true +CPUS["I86"] = true +CPUS["I386"] = true +CPUS["NEC"] = true +CPUS["V30MZ"] = true +CPUS["V60"] = true +CPUS["MCS48"] = true +CPUS["MCS51"] = true +CPUS["MCS96"] = true +CPUS["M6800"] = true +CPUS["M6805"] = true +CPUS["HD6309"] = true +CPUS["M6809"] = true +CPUS["KONAMI"] = true +CPUS["M680X0"] = true +CPUS["T11"] = true +CPUS["S2650"] = true +CPUS["TMS340X0"] = true +CPUS["TMS9900"] = true +CPUS["TMS9995"] = true +CPUS["TMS9900L"] = true +CPUS["Z8000"] = true +CPUS["Z8001"] = true +CPUS["TMS32010"] = true +CPUS["TMS32025"] = true +CPUS["TMS32031"] = true +CPUS["TMS32051"] = true +CPUS["TMS32082"] = true +CPUS["TMS57002"] = true +CPUS["CCPU"] = true +CPUS["ADSP21XX"] = true +CPUS["ASAP"] = true +CPUS["AM29000"] = true +CPUS["UPD7810"] = true +CPUS["ARM"] = true +CPUS["ARM7"] = true +CPUS["JAGUAR"] = true +CPUS["CUBEQCPU"] = true +CPUS["ESRIP"] = true +CPUS["MIPS"] = true +CPUS["PSX"] = true +CPUS["SH2"] = true +CPUS["SH4"] = true +CPUS["DSP16A"] = true +CPUS["DSP32C"] = true +CPUS["PIC16C5X"] = true +CPUS["PIC16C62X"] = true +CPUS["G65816"] = true +CPUS["SPC700"] = true +CPUS["E1"] = true +CPUS["I860"] = true +CPUS["I960"] = true +CPUS["H8"] = true +CPUS["V810"] = true +CPUS["M37710"] = true +CPUS["POWERPC"] = true +CPUS["SE3208"] = true +CPUS["MC68HC11"] = true +CPUS["ADSP21062"] = true +CPUS["DSP56156"] = true +CPUS["RSP"] = true +CPUS["ALPHA8201"] = true +CPUS["COP400"] = true +CPUS["TLCS90"] = true +CPUS["TLCS900"] = true +CPUS["MB88XX"] = true +CPUS["MB86233"] = true +CPUS["MB86235"] = true +CPUS["SSP1601"] = true +CPUS["APEXC"] = true +CPUS["CP1610"] = true +CPUS["F8"] = true +CPUS["LH5801"] = true +CPUS["PDP1"] = true +CPUS["SATURN"] = true +CPUS["SC61860"] = true +CPUS["LR35902"] = true +CPUS["TMS7000"] = true +CPUS["SM8500"] = true +CPUS["MINX"] = true +CPUS["SSEM"] = true +CPUS["AVR8"] = true +CPUS["TMS0980"] = true +CPUS["I4004"] = true +CPUS["SUPERFX"] = true +CPUS["Z8"] = true +CPUS["I8008"] = true +CPUS["SCMP"] = true +CPUS["MN10200"] = true +CPUS["COSMAC"] = true +CPUS["UNSP"] = true +CPUS["HCD62121"] = true +CPUS["PPS4"] = true +CPUS["UPD7725"] = true +CPUS["HD61700"] = true +CPUS["LC8670"] = true +CPUS["SCORE"] = true +CPUS["ES5510"] = true +CPUS["SCUDSP"] = true +CPUS["IE15"] = true +CPUS["8X300"] = true +CPUS["ALTO2"] = true +--CPUS["W65816"] = true +CPUS["ARC"] = true +CPUS["ARCOMPACT"] = true +CPUS["AMIS2000"] = true +CPUS["UCOM4"] = true +CPUS["HMCS40"] = true + +-------------------------------------------------- +-- specify available sound cores; some of these are +-- only for MAME and so aren't included +-------------------------------------------------- + +--SOUNDS["SAMPLES"] = true +SOUNDS["DAC"] = true +SOUNDS["DMADAC"] = true +SOUNDS["SPEAKER"] = true +SOUNDS["BEEP"] = true +SOUNDS["DISCRETE"] = true +SOUNDS["AY8910"] = true +SOUNDS["YM2151"] = true +SOUNDS["YM2203"] = true +SOUNDS["YM2413"] = true +SOUNDS["YM2608"] = true +SOUNDS["YM2610"] = true +SOUNDS["YM2610B"] = true +SOUNDS["YM2612"] = true +--SOUNDS["YM3438"] = true +SOUNDS["YM3812"] = true +SOUNDS["YM3526"] = true +SOUNDS["Y8950"] = true +SOUNDS["YMF262"] = true +--SOUNDS["YMF271"] = true +--SOUNDS["YMF278B"] = true +--SOUNDS["YMZ280B"] = true +SOUNDS["SN76477"] = true +SOUNDS["SN76496"] = true +SOUNDS["POKEY"] = true +SOUNDS["TIA"] = true +SOUNDS["NES_APU"] = true +SOUNDS["AMIGA"] = true +SOUNDS["ASTROCADE"] = true +--SOUNDS["NAMCO"] = true +--SOUNDS["NAMCO_15XX"] = true +--SOUNDS["NAMCO_CUS30"] = true +--SOUNDS["NAMCO_52XX"] = true +--SOUNDS["NAMCO_63701X"] = true +SOUNDS["T6W28"] = true +--SOUNDS["SNKWAVE"] = true +--SOUNDS["C140"] = true +--SOUNDS["C352"] = true +--SOUNDS["TMS36XX"] = true +--SOUNDS["TMS3615"] = true +SOUNDS["TMS5110"] = true +SOUNDS["TMS5220"] = true +SOUNDS["VLM5030"] = true +--SOUNDS["ADPCM"] = true +SOUNDS["MSM5205"] = true +--SOUNDS["MSM5232"] = true +SOUNDS["OKIM6258"] = true +SOUNDS["OKIM6295"] = true +--SOUNDS["OKIM6376"] = true +--SOUNDS["OKIM9810"] = true +SOUNDS["UPD7752"] = true +SOUNDS["UPD7759"] = true +SOUNDS["HC55516"] = true +--SOUNDS["TC8830F"] = true +--SOUNDS["K005289"] = true +--SOUNDS["K007232"] = true +SOUNDS["K051649"] = true +--SOUNDS["K053260"] = true +--SOUNDS["K054539"] = true +--SOUNDS["K056800"] = true +--SOUNDS["SEGAPCM"] = true +--SOUNDS["MULTIPCM"] = true +SOUNDS["SCSP"] = true +SOUNDS["AICA"] = true +SOUNDS["RF5C68"] = true +--SOUNDS["RF5C400"] = true +--SOUNDS["CEM3394"] = true +SOUNDS["QSOUND"] = true +--SOUNDS["QS1000"] = true +SOUNDS["SAA1099"] = true +--SOUNDS["IREMGA20"] = true +SOUNDS["ES5503"] = true +SOUNDS["ES5505"] = true +SOUNDS["ES5506"] = true +--SOUNDS["BSMT2000"] = true +--SOUNDS["GAELCO_CG1V"] = true +--SOUNDS["GAELCO_GAE1"] = true +SOUNDS["C6280"] = true +--SOUNDS["SP0250"] = true +SOUNDS["SPU"] = true +SOUNDS["CDDA"] = true +--SOUNDS["ICS2115"] = true +--SOUNDS["I5000_SND"] = true +--SOUNDS["ST0016"] = true +--SOUNDS["NILE"] = true +--SOUNDS["X1_010"] = true +--SOUNDS["VRENDER0"] = true +SOUNDS["VOTRAX"] = true +--SOUNDS["ES8712"] = true +SOUNDS["CDP1869"] = true +SOUNDS["S14001A"] = true +SOUNDS["WAVE"] = true +SOUNDS["SID6581"] = true +SOUNDS["SID8580"] = true +SOUNDS["SP0256"] = true +--SOUNDS["DIGITALKER"] = true +SOUNDS["CDP1863"] = true +SOUNDS["CDP1864"] = true +--SOUNDS["ZSG2"] = true +SOUNDS["MOS656X"] = true +SOUNDS["ASC"] = true +--SOUNDS["MAS3507D"] = true +SOUNDS["SOCRATES"] = true +SOUNDS["TMC0285"] = true +SOUNDS["TMS5200"] = true +SOUNDS["CD2801"] = true +SOUNDS["CD2802"] = true +--SOUNDS["M58817"] = true +SOUNDS["TMC0281"] = true +SOUNDS["TMS5100"] = true +SOUNDS["TMS5110A"] = true +SOUNDS["LMC1992"] = true +SOUNDS["AWACS"] = true +--SOUNDS["YMZ770"] = true +SOUNDS["T6721A"] = true +SOUNDS["MOS7360"] = true +SOUNDS["ESQPUMP"] = true +SOUNDS["VRC6"] = true + +-------------------------------------------------- +-- specify available video cores +-------------------------------------------------- + +VIDEOS["SEGA315_5124"] = true +VIDEOS["SEGA315_5313"] = true +--VIDEOS+= BUFSPRITE"] = true +VIDEOS["CDP1861"] = true +VIDEOS["CDP1862"] = true +VIDEOS["CRT9007"] = true +VIDEOS["CRT9021"] = true +VIDEOS["CRT9212"] = true +VIDEOS["CRTC_EGA"] = true +VIDEOS["DL1416"] = true +VIDEOS["DM9368"] = true +VIDEOS["EF9340_1"] = true +VIDEOS["EF9345"] = true +VIDEOS["GF4500"] = true +--VIDEOS+= EPIC12"] = true +--VIDEOS+= FIXFREQ"] = true +--VIDEOS+= H63484"] = true +VIDEOS["HD44102"] = true +VIDEOS["HD44352"] = true +VIDEOS["HD44780"] = true +VIDEOS["HD61830"] = true +--VIDEOS+= HD63484"] = true +VIDEOS["HD66421"] = true +VIDEOS["HUC6202"] = true +VIDEOS["HUC6260"] = true +VIDEOS["HUC6261"] = true +VIDEOS["HUC6270"] = true +VIDEOS["HUC6272"] = true +VIDEOS["I8244"] = true +VIDEOS["I8275"] = true +--VIDEOS+= M50458"] = true +--VIDEOS+= MB90082"] = true +--VIDEOS+= MB_VCU"] = true +VIDEOS["MC6845"] = true +VIDEOS["MC6847"] = true +VIDEOS["MSM6222B"] = true +VIDEOS["MSM6255"] = true +VIDEOS["MOS6566"] = true +VIDEOS["PC_VGA"] = true +--VIDEOS+= POLY"] = true +VIDEOS["PSX"] = true +VIDEOS["RAMDAC"] = true +VIDEOS["S2636"] = true +VIDEOS["SAA5050"] = true +VIDEOS["SED1200"] = true +VIDEOS["SED1330"] = true +VIDEOS["SED1520"] = true +VIDEOS["SNES_PPU"] = true +VIDEOS["STVVDP"] = true +VIDEOS["T6A04"] = true +VIDEOS["TEA1002"] = true +--VIDEOS+= TLC34076"] = true +--VIDEOS+= TMS34061"] = true +VIDEOS["TMS3556"] = true +VIDEOS["TMS9927"] = true +VIDEOS["TMS9928A"] = true +VIDEOS["UPD3301"] = true +VIDEOS["UPD7220"] = true +VIDEOS["UPD7227"] = true +VIDEOS["V9938"] = true +VIDEOS["VIC4567"] = true +--VIDEOS+= VOODOO"] = true +VIDEOS["SCN2674"] = true + +-------------------------------------------------- +-- specify available machine cores +-------------------------------------------------- + +MACHINES["AKIKO"] = true +MACHINES["AUTOCONFIG"] = true +MACHINES["CR511B"] = true +MACHINES["DMAC"] = true +MACHINES["GAYLE"] = true +--MACHINES["NCR53C7XX"] = true +--MACHINES["LSI53C810"] = true +MACHINES["6522VIA"] = true +--MACHINES["TPI6525"] = true +--MACHINES["RIOT6532"] = true +MACHINES["6821PIA"] = true +MACHINES["6840PTM"] = true +MACHINES["68561MPCC"] = true +--MACHINES["ACIA6850"] = true +MACHINES["68681"] = true +MACHINES["7200FIFO"] = true +MACHINES["8530SCC"] = true +--MACHINES["TTL74123"] = true +--MACHINES["TTL74145"] = true +--MACHINES["TTL74148"] = true +--MACHINES["TTL74153"] = true +--MACHINES["TTL74181"] = true +--MACHINES["TTL7474"] = true +--MACHINES["KBDC8042"] = true +--MACHINES["I8257"] = true +MACHINES["AAKARTDEV"] = true +MACHINES["ACIA6850"] = true +MACHINES["ADC0808"] = true +MACHINES["ADC083X"] = true +MACHINES["ADC1038"] = true +MACHINES["ADC1213X"] = true +MACHINES["AICARTC"] = true +MACHINES["AM53CF96"] = true +MACHINES["AM9517A"] = true +MACHINES["AMIGAFDC"] = true +MACHINES["AT_KEYBC"] = true +MACHINES["AT28C16"] = true +MACHINES["AT29040"] = true +MACHINES["AT45DBXX"] = true +MACHINES["ATAFLASH"] = true +MACHINES["AY31015"] = true +MACHINES["BANKDEV"] = true +MACHINES["CDP1852"] = true +MACHINES["CDP1871"] = true +MACHINES["CMOS40105"] = true +--MACHINES["CDU76S"] = true +MACHINES["COM8116"] = true +MACHINES["CR589"] = true +MACHINES["CS4031"] = true +MACHINES["CS8221"] = true +MACHINES["DP8390"] = true +--MACHINES["DS1204"] = true +MACHINES["DS1302"] = true +MACHINES["DS1315"] = true +MACHINES["DS2401"] = true +MACHINES["DS2404"] = true +MACHINES["DS75160A"] = true +MACHINES["DS75161A"] = true +MACHINES["E0516"] = true +MACHINES["E05A03"] = true +MACHINES["E05A30"] = true +MACHINES["EEPROMDEV"] = true +MACHINES["ER2055"] = true +MACHINES["F3853"] = true +MACHINES["HD63450"] = true +MACHINES["HD64610"] = true +MACHINES["I2CMEM"] = true +MACHINES["I80130"] = true +MACHINES["I8089"] = true +MACHINES["I8155"] = true +MACHINES["I8212"] = true +MACHINES["I8214"] = true +MACHINES["I8243"] = true +MACHINES["I8251"] = true +MACHINES["I8255"] = true +MACHINES["I8257"] = true +MACHINES["I8271"] = true +MACHINES["I8279"] = true +MACHINES["I8355"] = true +MACHINES["IDE"] = true +MACHINES["IM6402"] = true +MACHINES["INS8154"] = true +MACHINES["INS8250"] = true +MACHINES["INTELFLASH"] = true +MACHINES["JVS"] = true +MACHINES["K033906"] = true +MACHINES["K053252"] = true +MACHINES["K056230"] = true +MACHINES["KB3600"] = true +MACHINES["KBDC8042"] = true +MACHINES["KR2376"] = true +MACHINES["LATCH8"] = true +MACHINES["LC89510"] = true +MACHINES["LDPR8210"] = true +MACHINES["LDSTUB"] = true +MACHINES["LDV1000"] = true +MACHINES["LDVP931"] = true +MACHINES["LH5810"] = true +MACHINES["LINFLASH"] = true +--MACHINES["LPCI"] = true +MACHINES["LSI53C810"] = true +MACHINES["M68307"] = true +MACHINES["M68340"] = true +MACHINES["M6M80011AP"] = true +MACHINES["MATSUCD"] = true +MACHINES["MB14241"] = true +MACHINES["MB3773"] = true +MACHINES["MB8421"] = true +MACHINES["MB87078"] = true +MACHINES["MB8795"] = true +MACHINES["MB89352"] = true +MACHINES["MB89371"] = true +MACHINES["MC146818"] = true +MACHINES["MC2661"] = true +MACHINES["MC6843"] = true +MACHINES["MC6846"] = true +MACHINES["MC6852"] = true +MACHINES["MC6854"] = true +MACHINES["MC68328"] = true +MACHINES["MC68901"] = true +MACHINES["MCCS1850"] = true +--MACHINES["M68307"] = true +--MACHINES["M68340"] = true +MACHINES["MCF5206E"] = true +MACHINES["MICROTOUCH"] = true +MACHINES["MIOT6530"] = true +MACHINES["MM58167"] = true +MACHINES["MM58274C"] = true +MACHINES["MM74C922"] = true +MACHINES["MOS6526"] = true +MACHINES["MOS6529"] = true +--MACHINES["MIOT6530"] = true +MACHINES["MOS6551"] = true +MACHINES["MOS6702"] = true +MACHINES["MOS8706"] = true +MACHINES["MOS8722"] = true +MACHINES["MOS8726"] = true +MACHINES["MPU401"] = true +MACHINES["MSM5832"] = true +MACHINES["MSM58321"] = true +MACHINES["MSM6242"] = true +MACHINES["NCR5380"] = true +MACHINES["NCR5380N"] = true +MACHINES["NCR5390"] = true +MACHINES["NCR539x"] = true +MACHINES["NCR53C7XX"] = true +MACHINES["NMC9306"] = true +MACHINES["NSC810"] = true +MACHINES["NSCSI"] = true +MACHINES["OMTI5100"] = true +MACHINES["PC_FDC"] = true +MACHINES["PC_LPT"] = true +MACHINES["PCCARD"] = true +MACHINES["PCF8593"] = true +MACHINES["PCKEYBRD"] = true +MACHINES["PIC8259"] = true +MACHINES["PIT8253"] = true +MACHINES["PLA"] = true +--MACHINES["PROFILE"] = true +MACHINES["R64H156"] = true +MACHINES["RF5C296"] = true +MACHINES["RIOT6532"] = true +MACHINES["ROC10937"] = true +MACHINES["RP5C01"] = true +MACHINES["RP5C15"] = true +MACHINES["RP5H01"] = true +MACHINES["RTC4543"] = true +MACHINES["RTC65271"] = true +MACHINES["RTC9701"] = true +--MACHINES["S2636"] = true +MACHINES["S3520CF"] = true +MACHINES["S3C2400"] = true +MACHINES["S3C2410"] = true +MACHINES["S3C2440"] = true +MACHINES["S3C44B0"] = true +MACHINES["SATURN"] = true +--MACHINES["SCSI"] = true +MACHINES["SCUDSP"] = true +MACHINES["SECFLASH"] = true +MACHINES["SEIBU_COP"] = true +--MACHINES["SERFLASH"] = true +MACHINES["SMC91C9X"] = true +MACHINES["SMPC"] = true +MACHINES["STVCD"] = true +MACHINES["TC0091LVC"] = true +MACHINES["TIMEKPR"] = true +MACHINES["TMP68301"] = true +MACHINES["TMS5501"] = true +MACHINES["TMS6100"] = true +MACHINES["TMS9901"] = true +MACHINES["TMS9902"] = true +MACHINES["TPI6525"] = true +MACHINES["TTL74123"] = true +MACHINES["TTL74145"] = true +MACHINES["TTL74148"] = true +MACHINES["TTL74153"] = true +MACHINES["TTL74181"] = true +MACHINES["TTL7474"] = true +MACHINES["UPD1990A"] = true +--MACHINES["UPD4992"] = true +MACHINES["UPD4701"] = true +MACHINES["UPD7002"] = true +MACHINES["UPD71071"] = true +MACHINES["UPD765"] = true +MACHINES["V3021"] = true +MACHINES["WD_FDC"] = true +MACHINES["WD11C00_17"] = true +MACHINES["WD17XX"] = true +MACHINES["WD2010"] = true +MACHINES["WD33C93"] = true +MACHINES["WD7600"] = true +MACHINES["X2212"] = true +MACHINES["X76F041"] = true +MACHINES["X76F100"] = true +MACHINES["YM2148"] = true +MACHINES["Z80CTC"] = true +MACHINES["Z80DART"] = true +MACHINES["Z80DMA"] = true +MACHINES["Z80PIO"] = true +MACHINES["Z80STI"] = true +MACHINES["Z8536"] = true +--MACHINES["SECFLASH"] = true +--MACHINES["PCCARD"] = true +MACHINES["SMC92X4"] = true +MACHINES["HDC9234"] = true +MACHINES["TI99_HD"] = true +MACHINES["STRATA"] = true +MACHINES["STEPPERS"] = true +MACHINES["CORVUSHD"] = true +MACHINES["WOZFDC"] = true +MACHINES["DIABLO_HD"] = true + +-------------------------------------------------- +-- specify available bus cores +-------------------------------------------------- + +BUSES["A1BUS"] = true +BUSES["A2BUS"] = true +BUSES["A7800"] = true +BUSES["A800"] = true +BUSES["A8SIO"] = true +BUSES["ABCBUS"] = true +BUSES["ABCKB"] = true +BUSES["ADAM"] = true +BUSES["ADAMNET"] = true +BUSES["APF"] = true +BUSES["ARCADIA"] = true +BUSES["ASTROCADE"] = true +BUSES["BML3"] = true +BUSES["BW2"] = true +BUSES["C64"] = true +BUSES["CBM2"] = true +BUSES["CBMIEC"] = true +BUSES["CENTRONICS"] = true +BUSES["CHANNELF"] = true +BUSES["COCO"] = true +BUSES["COLECO"] = true +BUSES["COMPUCOLOR"] = true +BUSES["COMX35"] = true +BUSES["CPC"] = true +BUSES["CRVISION"] = true +BUSES["DMV"] = true +BUSES["ECBBUS"] = true +BUSES["ECONET"] = true +BUSES["EP64"] = true +BUSES["EPSON_SIO"] = true +BUSES["GAMEBOY"] = true +BUSES["GAMEGEAR"] = true +BUSES["GBA"] = true +BUSES["GENERIC"] = true +BUSES["IEEE488"] = true +BUSES["IMI7000"] = true +BUSES["INTV"] = true +BUSES["IQ151"] = true +BUSES["ISA"] = true +BUSES["ISBX"] = true +BUSES["KC"] = true +BUSES["LPCI"] = true +BUSES["MACPDS"] = true +BUSES["MIDI"] = true +BUSES["MEGADRIVE"] = true +BUSES["MSX_SLOT"] = true +BUSES["NEOGEO"] = true +BUSES["NES"] = true +BUSES["NES_CTRL"] = true +BUSES["NUBUS"] = true +BUSES["O2"] = true +BUSES["ORICEXT"] = true +BUSES["PCE"] = true +BUSES["PC_JOY"] = true +BUSES["PC_KBD"] = true +BUSES["PET"] = true +BUSES["PLUS4"] = true +BUSES["PSX_CONTROLLER"] = true +BUSES["QL"] = true +BUSES["RS232"] = true +BUSES["S100"] = true +BUSES["SATURN"] = true +BUSES["SCSI"] = true +BUSES["SCV"] = true +BUSES["SEGA8"] = true +BUSES["SMS_CTRL"] = true +BUSES["SMS_EXP"] = true +BUSES["SNES"] = true +BUSES["SNES_CTRL"] = true +BUSES["SPC1000"] = true +BUSES["TI99PEB"] = true +BUSES["TVC"] = true +BUSES["VBOY"] = true +BUSES["VC4000"] = true +BUSES["VCS"] = true +BUSES["VCS_CTRL"] = true +BUSES["VECTREX"] = true +BUSES["VIC10"] = true +BUSES["VIC20"] = true +BUSES["VIDBRAIN"] = true +BUSES["VIP"] = true +BUSES["VTECH_IOEXP"] = true +BUSES["VTECH_MEMEXP"] = true +BUSES["WANGPC"] = true +BUSES["WSWAN"] = true +BUSES["X68K"] = true +BUSES["Z88"] = true +BUSES["ZORRO"] = true + +-------------------------------------------------- +-- this is the list of driver libraries that +-- comprise MESS plus messdriv.*", which contains +-- the list of drivers +-------------------------------------------------- +function linkProjects_mess_mess(_target, _subtarget) + links { + "acorn", + "act", + "adc", + "alesis", + "altos", + "amiga", + "amstrad", + "apf", + "apollo", + "apple", + "applied", + "arcadia", + "ascii", + "at", + "atari", + "att", + "bally", + "bandai", + "banctec", + "be", + "bnpo", + "bondwell", + "booth", + "camputers", + "canon", + "cantab", + "casio", + "cbm", + "cccp", + "cce", + "ccs", + "chromatics", + "coleco", + "cromemco", + "comx", + "concept", + "conitec", + "cybiko", + "dai", + "ddr", + "dec", + "dicksmth", + "dms", + "dragon", + "drc", + "eaca", + "einis", + "elektor", + "elektrka", + "ensoniq", + "enterprise", + "entex", + "epoch", + "epson", + "exidy", + "fairch", + "fidelity", + "fujitsu", + "funtech", + "galaxy", + "gamepark", + "gi", + "grundy", + "hartung", + "heathkit", + "hec2hrp", + "hegener", + "hitachi", + "homebrew", + "homelab", + "hp", + "imp", + "intel", + "interton", + "intv", + "isc", + "kaypro", + "koei", + "kyocera", + "luxor", + "magnavox", + "makerbot", + "marx", + "matsushi", + "mattel", + "mb", + "mchester", + "memotech", + "mgu", + "microkey", + "mit", + "mits", + "mitsubishi", + "morrow", + "mos", + "motorola", + "multitch", + "nakajima", + "nascom", + "ne", + "nec", + "netronic", + "next", + "nintendo", + "nokia", + "northstar", + "novag", + "olivetti", + "omnibyte", + "orion", + "osborne", + "osi", + "palm", + "parker", + "pc", + "pdp1", + "pel", + "philips", + "pitronic", + "poly88", + "psion", + "radio", + "rca", + "rm", + "robotron", + "rockwell", + "roland", + "sage", + "samcoupe", + "samsung", + "sanyo", + "sega", + "sgi", + "sharp", + "siemens", + "sinclair", + "skeleton", + "slicer", + "snk", + "sony", + "sord", + "special", + "sun", + "svi", + "svision", + "swtpc09", + "synertec", + "ta", + "tandberg", + "tangerin", + "tatung", + "teamconc", + "tektroni", + "telenova", + "telercas", + "televideo", + "tem", + "tesla", + "test", + "thomson", + "ti", + "tiger", + "tigertel", + "tiki", + "tomy", + "toshiba", + "trainer", + "trs", + "ultratec", + "unisys", + "veb", + "vidbrain", + "videoton", + "visual", + "votrax", + "vtech", + "wang", + "wavemate", + "xerox", + "xussrpc", + "yamaha", + "zenith", + "zpa", + "zvt", + "messshared", + } + if (_target=="mess") then + links { + "mameshared", + } + end +end + +function createMESSProjects(_target, _subtarget, _name) + project (_name) + targetsubdir(_target .."_" .. _subtarget) + kind "StaticLib" + uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mess", + MAME_DIR .. "src/mame", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "mess/layout", + GEN_DIR .. "mame/layout", + GEN_DIR .. "emu/cpu/m68000", + } + + includeosd() +end + +function createProjects_mess_mess(_target, _subtarget) +-------------------------------------------------- +-- the following files are MAME components and +-- shared across a number of drivers +-- +-- a310.c (MESS), aristmk5.c, ertictac.c (MAME) +-- amiga.c (MESS), alg.c, arcadia.c, cubo.c, mquake.c, upscope.c (MAME) +-- a2600.c (MESS), tourtabl.c (MAME) +-- atari400.c (MESS), bartop52.c, maxaflex.c (MAME) +-- jaguar.c (MAME) +-- astrocde.c (MAME+MESS), g627.c +-- cps1.c (MAME + MESS), cbaseball.c, mitchell.c (MAME) +-- pk8000.c (MESS), photon.c (MAME) +-- nes.c (MESS), cham23.c, famibox.c, multigam.c, playch10.c, vsnes.c (MAME) +-- snes.c (MESS), nss.c, sfcbox.c, snesb.c (MAME) +-- n64.c (MESS), aleck64.c (MAME) +-- megadriv.c, segapico.c (MESS), hshavoc.c, megadrvb.c, megaplay.c, megatech.c, puckpkmn.c, segac2.c, segas18.c (MAME) +-- dccons.c (MESS), naomi.c (MAME) +-- ng_aes.c (MESS), midas.c, neogeo.c, neogeo_noslot.c, neoprint.c (MAME) +-- cdi.c (MESS + MAME) +-- 3do.c (MESS + MAME), konamim2.c (MAME) +-- vectrex.c (MESS + MAME) +-- cps1.c (MESS + MAME) +-------------------------------------------------- +if (_target=="mess") then +createMESSProjects(_target, _subtarget, "mameshared") +files { + MAME_DIR .. "src/mame/machine/archimds.c", + MAME_DIR .. "src/mame/video/archimds.c", + MAME_DIR .. "src/mame/machine/amiga.c", + MAME_DIR .. "src/mame/video/amiga.c", + MAME_DIR .. "src/mame/video/amigaaga.c", + MAME_DIR .. "src/mame/video/tia.c", + MAME_DIR .. "src/mame/machine/atari.c", + MAME_DIR .. "src/mame/video/atari.c", + MAME_DIR .. "src/mame/video/antic.c", + MAME_DIR .. "src/mame/video/gtia.c", + MAME_DIR .. "src/mame/drivers/jaguar.c", + MAME_DIR .. "src/mame/audio/jaguar.c", + MAME_DIR .. "src/mame/video/jaguar.c", + MAME_DIR .. "src/mame/video/astrocde.c", + MAME_DIR .. "src/mame/machine/kabuki.c", + MAME_DIR .. "src/mame/video/pk8000.c", + MAME_DIR .. "src/mame/video/ppu2c0x.c", + MAME_DIR .. "src/mame/machine/snes.c", + MAME_DIR .. "src/mame/audio/snes_snd.c", + MAME_DIR .. "src/mame/machine/n64.c", + MAME_DIR .. "src/mame/video/n64.c", + MAME_DIR .. "src/mame/video/rdpblend.c", + MAME_DIR .. "src/mame/video/rdptpipe.c", + MAME_DIR .. "src/mame/video/rdpspn16.c", + MAME_DIR .. "src/mame/machine/megadriv.c", + MAME_DIR .. "src/mame/drivers/naomi.c", + MAME_DIR .. "src/mame/machine/awboard.c", + MAME_DIR .. "src/mame/machine/dc.c", + MAME_DIR .. "src/mame/machine/dc-ctrl.c", + MAME_DIR .. "src/mame/machine/gdrom.c", + MAME_DIR .. "src/mame/machine/jvs13551.c", + MAME_DIR .. "src/mame/machine/maple-dc.c", + MAME_DIR .. "src/mame/machine/mapledev.c", + MAME_DIR .. "src/mame/machine/mie.c", + MAME_DIR .. "src/mame/machine/naomi.c", + MAME_DIR .. "src/mame/machine/naomibd.c", + MAME_DIR .. "src/mame/machine/naomig1.c", + MAME_DIR .. "src/mame/machine/naomigd.c", + MAME_DIR .. "src/mame/machine/naomim1.c", + MAME_DIR .. "src/mame/machine/naomim2.c", + MAME_DIR .. "src/mame/machine/naomim4.c", + MAME_DIR .. "src/mame/machine/naomirom.c", + MAME_DIR .. "src/mame/machine/315-5881_crypt.c", + MAME_DIR .. "src/mame/video/powervr2.c", + MAME_DIR .. "src/mame/drivers/neogeo.c", + MAME_DIR .. "src/mame/machine/neoboot.c", + MAME_DIR .. "src/mame/machine/neocrypt.c", + MAME_DIR .. "src/mame/machine/neoprot.c", + MAME_DIR .. "src/mame/machine/ng_memcard.c", + MAME_DIR .. "src/mame/video/neogeo.c", + MAME_DIR .. "src/mame/video/neogeo_spr.c", + MAME_DIR .. "src/mame/drivers/cdi.c", + MAME_DIR .. "src/mame/machine/cdi070.c", + MAME_DIR .. "src/mame/machine/cdicdic.c", + MAME_DIR .. "src/mame/machine/cdislave.c", + MAME_DIR .. "src/mame/video/mcd212.c", + MAME_DIR .. "src/mame/drivers/3do.c", + MAME_DIR .. "src/mame/machine/3do.c", + MAME_DIR .. "src/mame/drivers/konamim2.c", + MAME_DIR .. "src/mame/drivers/vectrex.c", + MAME_DIR .. "src/mame/machine/vectrex.c", + MAME_DIR .. "src/mame/video/vectrex.c", + MAME_DIR .. "src/mame/drivers/cps1.c", + MAME_DIR .. "src/mame/video/cps1.c", +} +end +-------------------------------------------------- +-- the following files are general components and +-- shared across a number of drivers +-------------------------------------------------- +createMESSProjects(_target, _subtarget, "messshared") +files { + MAME_DIR .. "src/mess/audio/mea8000.c", + MAME_DIR .. "src/mess/machine/appldriv.c", + MAME_DIR .. "src/mess/machine/applefdc.c", + MAME_DIR .. "src/mess/machine/microdrv.c", + MAME_DIR .. "src/mess/machine/smartmed.c", + MAME_DIR .. "src/mess/machine/sonydriv.c", + MAME_DIR .. "src/mess/machine/teleprinter.c", + MAME_DIR .. "src/mess/machine/z80bin.c", +} +-------------------------------------------------- +-- manufacturer-specific groupings for drivers +-------------------------------------------------- + +createMESSProjects(_target, _subtarget, "acorn") +files { + MAME_DIR .. "src/mess/drivers/a310.c", + MAME_DIR .. "src/mess/drivers/a6809.c", + MAME_DIR .. "src/mess/drivers/acrnsys1.c", + MAME_DIR .. "src/mess/drivers/atom.c", + MAME_DIR .. "src/mess/drivers/bbc.c", + MAME_DIR .. "src/mess/machine/bbc.c", + MAME_DIR .. "src/mess/video/bbc.c", + MAME_DIR .. "src/mess/drivers/bbcbc.c", + MAME_DIR .. "src/mess/drivers/electron.c", + MAME_DIR .. "src/mess/machine/electron.c", + MAME_DIR .. "src/mess/video/electron.c", + MAME_DIR .. "src/mess/drivers/riscpc.c", + MAME_DIR .. "src/mess/drivers/z88.c", + MAME_DIR .. "src/mess/machine/upd65031.c", + MAME_DIR .. "src/mess/video/z88.c", +} + +createMESSProjects(_target, _subtarget, "act") +files { + MAME_DIR .. "src/mess/drivers/apricot.c", + MAME_DIR .. "src/mess/drivers/apricotf.c", + MAME_DIR .. "src/mess/drivers/apricotp.c", + MAME_DIR .. "src/mess/machine/apricotkb.c", + MAME_DIR .. "src/mess/drivers/victor9k.c", + MAME_DIR .. "src/mess/machine/victor9kb.c", + MAME_DIR .. "src/mess/machine/victor9k_fdc.c", +} + +createMESSProjects(_target, _subtarget, "adc") +files { + MAME_DIR .. "src/mess/drivers/super6.c", + MAME_DIR .. "src/mess/drivers/superslave.c", +} + +createMESSProjects(_target, _subtarget, "alesis") +files { + MAME_DIR .. "src/mess/drivers/alesis.c", + MAME_DIR .. "src/mess/audio/alesis.c", + MAME_DIR .. "src/mess/video/alesis.c", +} + +createMESSProjects(_target, _subtarget, "altos") +files { + MAME_DIR .. "src/mess/drivers/altos5.c", +} + +createMESSProjects(_target, _subtarget, "amiga") +files { + MAME_DIR .. "src/mess/drivers/amiga.c", + MAME_DIR .. "src/mess/machine/amigakbd.c", +} + +createMESSProjects(_target, _subtarget, "amstrad") +files { + MAME_DIR .. "src/mess/drivers/amstrad.c", + MAME_DIR .. "src/mess/machine/amstrad.c", + MAME_DIR .. "src/mess/drivers/amstr_pc.c", + MAME_DIR .. "src/mess/drivers/nc.c", + MAME_DIR .. "src/mess/machine/nc.c", + MAME_DIR .. "src/mess/video/nc.c", + MAME_DIR .. "src/mess/drivers/pc1512.c", + MAME_DIR .. "src/mess/machine/pc1512kb.c", + MAME_DIR .. "src/mess/video/pc1512.c", + MAME_DIR .. "src/mess/drivers/pcw.c", + MAME_DIR .. "src/mess/video/pcw.c", + MAME_DIR .. "src/mess/drivers/pcw16.c", + MAME_DIR .. "src/mess/video/pcw16.c", + MAME_DIR .. "src/mess/drivers/pda600.c", +} + +createMESSProjects(_target, _subtarget, "apf") +files { + MAME_DIR .. "src/mess/drivers/apf.c", +} + +createMESSProjects(_target, _subtarget, "apollo") +files { + MAME_DIR .. "src/mess/drivers/apollo.c", + MAME_DIR .. "src/mess/machine/apollo.c", + MAME_DIR .. "src/mess/machine/apollo_dbg.c", + MAME_DIR .. "src/mess/machine/apollo_kbd.c", + MAME_DIR .. "src/mess/video/apollo.c", +} + +createMESSProjects(_target, _subtarget, "apple") +files { + MAME_DIR .. "src/mess/drivers/apple1.c", + MAME_DIR .. "src/mess/machine/apple1.c", + MAME_DIR .. "src/mess/video/apple1.c", + MAME_DIR .. "src/mess/drivers/apple2.c", + MAME_DIR .. "src/mess/drivers/apple2e.c", + MAME_DIR .. "src/mess/machine/apple2.c", + MAME_DIR .. "src/mess/video/apple2.c", + MAME_DIR .. "src/mess/drivers/tk2000.c", + MAME_DIR .. "src/mess/drivers/apple2gs.c", + MAME_DIR .. "src/mess/machine/apple2gs.c", + MAME_DIR .. "src/mess/video/apple2gs.c", + MAME_DIR .. "src/mess/drivers/apple3.c", + MAME_DIR .. "src/mess/machine/apple3.c", + MAME_DIR .. "src/mess/video/apple3.c", + MAME_DIR .. "src/mess/drivers/lisa.c", + MAME_DIR .. "src/mess/machine/lisa.c", + MAME_DIR .. "src/mess/drivers/mac.c", + MAME_DIR .. "src/mess/audio/mac.c", + MAME_DIR .. "src/mess/machine/egret.c", + MAME_DIR .. "src/mess/machine/mac.c", + MAME_DIR .. "src/mess/machine/macadb.c", + MAME_DIR .. "src/mess/machine/macrtc.c", + MAME_DIR .. "src/mess/machine/mackbd.c", + MAME_DIR .. "src/mess/machine/swim.c", + MAME_DIR .. "src/mess/video/mac.c", + MAME_DIR .. "src/mess/drivers/macpci.c", + MAME_DIR .. "src/mess/machine/macpci.c", + MAME_DIR .. "src/mess/machine/cuda.c", +} + +createMESSProjects(_target, _subtarget, "applied") +files { + MAME_DIR .. "src/mess/drivers/mbee.c", + MAME_DIR .. "src/mess/machine/mbee.c", + MAME_DIR .. "src/mess/video/mbee.c", +} + +createMESSProjects(_target, _subtarget, "arcadia") +files { + MAME_DIR .. "src/mess/drivers/arcadia.c", + MAME_DIR .. "src/mess/audio/arcadia.c", + MAME_DIR .. "src/mess/video/arcadia.c", +} + +createMESSProjects(_target, _subtarget, "ascii") +files { + MAME_DIR .. "src/mess/drivers/msx.c", + MAME_DIR .. "src/mess/machine/msx.c", + MAME_DIR .. "src/mess/machine/msx_matsushita.c", + MAME_DIR .. "src/mess/machine/msx_s1985.c", + MAME_DIR .. "src/mess/machine/msx_switched.c", + MAME_DIR .. "src/mess/machine/msx_systemflags.c", +} + +createMESSProjects(_target, _subtarget, "at") +files { + MAME_DIR .. "src/mess/drivers/at.c", + MAME_DIR .. "src/mess/machine/at.c", + MAME_DIR .. "src/mess/drivers/ct486.c", +} + +createMESSProjects(_target, _subtarget, "atari") +files { + MAME_DIR .. "src/mess/drivers/a2600.c", + MAME_DIR .. "src/mess/drivers/a7800.c", + MAME_DIR .. "src/mess/video/maria.c", + MAME_DIR .. "src/mess/drivers/atari400.c", + MAME_DIR .. "src/mess/machine/atarifdc.c", + MAME_DIR .. "src/mess/drivers/atarist.c", + MAME_DIR .. "src/mess/video/atarist.c", + MAME_DIR .. "src/mess/drivers/lynx.c", + MAME_DIR .. "src/mess/audio/lynx.c", + MAME_DIR .. "src/mess/machine/lynx.c", + MAME_DIR .. "src/mess/drivers/portfoli.c", +} + +createMESSProjects(_target, _subtarget, "att") +files { + MAME_DIR .. "src/mess/drivers/unixpc.c", +} + +createMESSProjects(_target, _subtarget, "bally") +files { + MAME_DIR .. "src/mess/drivers/astrocde.c", +} + +createMESSProjects(_target, _subtarget, "banctec") +files { + MAME_DIR .. "src/mess/drivers/banctec.c", +} + +createMESSProjects(_target, _subtarget, "bandai") +files { + MAME_DIR .. "src/mess/drivers/sv8000.c", + MAME_DIR .. "src/mess/drivers/rx78.c", + MAME_DIR .. "src/mess/drivers/wswan.c", + MAME_DIR .. "src/mess/audio/wswan_snd.c", + MAME_DIR .. "src/mess/machine/wswan.c", + MAME_DIR .. "src/mess/video/wswan_video.c", +} + +createMESSProjects(_target, _subtarget, "be") +files { + MAME_DIR .. "src/mess/drivers/bebox.c", + MAME_DIR .. "src/mess/machine/bebox.c", +} + +createMESSProjects(_target, _subtarget, "bnpo") +files { + MAME_DIR .. "src/mess/drivers/b2m.c", + MAME_DIR .. "src/mess/machine/b2m.c", + MAME_DIR .. "src/mess/video/b2m.c", +} + +createMESSProjects(_target, _subtarget, "bondwell") +files { + MAME_DIR .. "src/mess/drivers/bw12.c", + MAME_DIR .. "src/mess/drivers/bw2.c", +} + +createMESSProjects(_target, _subtarget, "booth") +files { + MAME_DIR .. "src/mess/drivers/apexc.c", +} + +createMESSProjects(_target, _subtarget, "camputers") +files { + MAME_DIR .. "src/mess/drivers/camplynx.c", +} + +createMESSProjects(_target, _subtarget, "canon") +files { + MAME_DIR .. "src/mess/drivers/cat.c", + MAME_DIR .. "src/mess/drivers/x07.c", +} + +createMESSProjects(_target, _subtarget, "cantab") +files { + MAME_DIR .. "src/mess/drivers/ace.c", +} + +createMESSProjects(_target, _subtarget, "casio") +files { + MAME_DIR .. "src/mess/drivers/casloopy.c", + MAME_DIR .. "src/mess/drivers/cfx9850.c", + MAME_DIR .. "src/mess/drivers/fp200.c", + MAME_DIR .. "src/mess/drivers/fp1100.c", + MAME_DIR .. "src/mess/drivers/fp6000.c", + MAME_DIR .. "src/mess/drivers/pb1000.c", + MAME_DIR .. "src/mess/drivers/pv1000.c", + MAME_DIR .. "src/mess/drivers/pv2000.c", +} + +createMESSProjects(_target, _subtarget, "cbm") +files { + MAME_DIR .. "src/mess/drivers/c128.c", + MAME_DIR .. "src/mess/drivers/c64.c", + MAME_DIR .. "src/mess/drivers/c64dtv.c", + MAME_DIR .. "src/mess/drivers/c65.c", + MAME_DIR .. "src/mess/drivers/c900.c", + MAME_DIR .. "src/mess/drivers/cbm2.c", + MAME_DIR .. "src/mess/drivers/clcd.c", + MAME_DIR .. "src/mess/drivers/pet.c", + MAME_DIR .. "src/mess/drivers/plus4.c", + MAME_DIR .. "src/mess/drivers/vic10.c", + MAME_DIR .. "src/mess/drivers/vic20.c", + MAME_DIR .. "src/mess/machine/cbm_snqk.c", +} + +createMESSProjects(_target, _subtarget, "cccp") +files { + MAME_DIR .. "src/mess/drivers/argo.c", + MAME_DIR .. "src/mess/drivers/cm1800.c", + MAME_DIR .. "src/mess/drivers/lviv.c", + MAME_DIR .. "src/mess/machine/lviv.c", + MAME_DIR .. "src/mess/video/lviv.c", + MAME_DIR .. "src/mess/drivers/mikro80.c", + MAME_DIR .. "src/mess/machine/mikro80.c", + MAME_DIR .. "src/mess/video/mikro80.c", + MAME_DIR .. "src/mess/drivers/pk8000.c", + MAME_DIR .. "src/mess/drivers/pk8020.c", + MAME_DIR .. "src/mess/machine/pk8020.c", + MAME_DIR .. "src/mess/video/pk8020.c", + MAME_DIR .. "src/mess/drivers/pyl601.c", + MAME_DIR .. "src/mess/drivers/sm1800.c", + MAME_DIR .. "src/mess/drivers/uknc.c", + MAME_DIR .. "src/mess/drivers/unior.c", + MAME_DIR .. "src/mess/drivers/ut88.c", + MAME_DIR .. "src/mess/machine/ut88.c", + MAME_DIR .. "src/mess/video/ut88.c", + MAME_DIR .. "src/mess/drivers/vector06.c", + MAME_DIR .. "src/mess/machine/vector06.c", + MAME_DIR .. "src/mess/video/vector06.c", + MAME_DIR .. "src/mess/drivers/vta2000.c", +} + +createMESSProjects(_target, _subtarget, "cce") +files { + MAME_DIR .. "src/mess/drivers/mc1000.c", +} + +createMESSProjects(_target, _subtarget, "ccs") +files { + MAME_DIR .. "src/mess/drivers/ccs2810.c", + MAME_DIR .. "src/mess/drivers/ccs300.c", +} + +createMESSProjects(_target, _subtarget, "chromatics") +files { + MAME_DIR .. "src/mess/drivers/cgc7900.c", + MAME_DIR .. "src/mess/video/cgc7900.c", +} + +createMESSProjects(_target, _subtarget, "coleco") +files { + MAME_DIR .. "src/mess/drivers/adam.c", + MAME_DIR .. "src/mess/drivers/coleco.c", + MAME_DIR .. "src/mess/machine/coleco.c", +} + +createMESSProjects(_target, _subtarget, "cromemco") +files { + MAME_DIR .. "src/mess/drivers/c10.c", + MAME_DIR .. "src/mess/drivers/mcb216.c", +} + +createMESSProjects(_target, _subtarget, "comx") +files { + MAME_DIR .. "src/mess/drivers/comx35.c", + MAME_DIR .. "src/mess/video/comx35.c", +} + +createMESSProjects(_target, _subtarget, "concept") +files { + MAME_DIR .. "src/mess/drivers/concept.c", + MAME_DIR .. "src/mess/machine/concept.c", +} + +createMESSProjects(_target, _subtarget, "conitec") +files { + MAME_DIR .. "src/mess/drivers/prof180x.c", + MAME_DIR .. "src/mess/drivers/prof80.c", + MAME_DIR .. "src/mess/machine/prof80mmu.c", +} + +createMESSProjects(_target, _subtarget, "cybiko") +files { + MAME_DIR .. "src/mess/drivers/cybiko.c", + MAME_DIR .. "src/mess/machine/cybiko.c", +} + +createMESSProjects(_target, _subtarget, "dai") +files { + MAME_DIR .. "src/mess/drivers/dai.c", + MAME_DIR .. "src/mess/audio/dai_snd.c", + MAME_DIR .. "src/mess/machine/dai.c", + MAME_DIR .. "src/mess/video/dai.c", +} + +createMESSProjects(_target, _subtarget, "ddr") +files { + MAME_DIR .. "src/mess/drivers/ac1.c", + MAME_DIR .. "src/mess/machine/ac1.c", + MAME_DIR .. "src/mess/video/ac1.c", + MAME_DIR .. "src/mess/drivers/bcs3.c", + MAME_DIR .. "src/mess/drivers/c80.c", + MAME_DIR .. "src/mess/drivers/huebler.c", + MAME_DIR .. "src/mess/drivers/jtc.c", + MAME_DIR .. "src/mess/drivers/kramermc.c", + MAME_DIR .. "src/mess/machine/kramermc.c", + MAME_DIR .. "src/mess/video/kramermc.c", + MAME_DIR .. "src/mess/drivers/llc.c", + MAME_DIR .. "src/mess/machine/llc.c", + MAME_DIR .. "src/mess/video/llc.c", + MAME_DIR .. "src/mess/drivers/nanos.c", + MAME_DIR .. "src/mess/drivers/pcm.c", + MAME_DIR .. "src/mess/drivers/vcs80.c", + MAME_DIR .. "src/mess/machine/k7659kb.c", +} + +createMESSProjects(_target, _subtarget, "dec") +files { + MAME_DIR .. "src/mess/drivers/dct11em.c", + MAME_DIR .. "src/mess/drivers/dectalk.c", + MAME_DIR .. "src/mess/drivers/pdp11.c", + MAME_DIR .. "src/mess/drivers/vax11.c", + MAME_DIR .. "src/mess/drivers/rainbow.c", + MAME_DIR .. "src/mess/drivers/vk100.c", + MAME_DIR .. "src/mess/drivers/vt100.c", + MAME_DIR .. "src/mess/drivers/vt220.c", + MAME_DIR .. "src/mess/drivers/vt240.c", + MAME_DIR .. "src/mess/drivers/vt320.c", + MAME_DIR .. "src/mess/drivers/vt520.c", + MAME_DIR .. "src/mess/machine/dec_lk201.c", + MAME_DIR .. "src/mess/machine/rx01.c", + MAME_DIR .. "src/mess/video/vtvideo.c", +} + +createMESSProjects(_target, _subtarget, "dicksmth") +files { + MAME_DIR .. "src/mess/drivers/super80.c", + MAME_DIR .. "src/mess/machine/super80.c", + MAME_DIR .. "src/mess/video/super80.c", +} + +createMESSProjects(_target, _subtarget, "dms") +files { + MAME_DIR .. "src/mess/drivers/dms5000.c", + MAME_DIR .. "src/mess/drivers/dms86.c", + MAME_DIR .. "src/mess/drivers/zsbc3.c", +} + +createMESSProjects(_target, _subtarget, "dragon") +files { + MAME_DIR .. "src/mess/drivers/dgn_beta.c", + MAME_DIR .. "src/mess/machine/dgn_beta.c", + MAME_DIR .. "src/mess/video/dgn_beta.c", +} + +createMESSProjects(_target, _subtarget, "drc") +files { + MAME_DIR .. "src/mess/drivers/zrt80.c", +} + +createMESSProjects(_target, _subtarget, "eaca") +files { + MAME_DIR .. "src/mess/drivers/cgenie.c", + MAME_DIR .. "src/mess/machine/cgenie.c", + MAME_DIR .. "src/mess/video/cgenie.c", +} + +createMESSProjects(_target, _subtarget, "einis") +files { + MAME_DIR .. "src/mess/drivers/pecom.c", + MAME_DIR .. "src/mess/machine/pecom.c", + MAME_DIR .. "src/mess/video/pecom.c", +} + +createMESSProjects(_target, _subtarget, "elektrka") +files { + MAME_DIR .. "src/mess/drivers/bk.c", + MAME_DIR .. "src/mess/machine/bk.c", + MAME_DIR .. "src/mess/video/bk.c", + MAME_DIR .. "src/mess/drivers/dvk_ksm.c", + MAME_DIR .. "src/mess/machine/ms7004.c", + MAME_DIR .. "src/mess/drivers/mk85.c", + MAME_DIR .. "src/mess/drivers/mk90.c", +} + +createMESSProjects(_target, _subtarget, "elektor") +files { + MAME_DIR .. "src/mess/drivers/ec65.c", + MAME_DIR .. "src/mess/drivers/elekscmp.c", + MAME_DIR .. "src/mess/drivers/junior.c", +} + +createMESSProjects(_target, _subtarget, "ensoniq") +files { + MAME_DIR .. "src/mess/drivers/esq1.c", + MAME_DIR .. "src/mess/drivers/esq5505.c", + MAME_DIR .. "src/mess/drivers/esqasr.c", + MAME_DIR .. "src/mess/drivers/esqkt.c", + MAME_DIR .. "src/mess/drivers/esqmr.c", + MAME_DIR .. "src/mess/drivers/mirage.c", + MAME_DIR .. "src/mess/machine/esqpanel.c", + MAME_DIR .. "src/mess/machine/esqvfd.c", +} + +createMESSProjects(_target, _subtarget, "enterprise") +files { + MAME_DIR .. "src/mess/drivers/ep64.c", + MAME_DIR .. "src/mess/audio/dave.c", + MAME_DIR .. "src/mess/video/nick.c", +} + +createMESSProjects(_target, _subtarget, "entex") +files { + MAME_DIR .. "src/mess/drivers/advision.c", + MAME_DIR .. "src/mess/machine/advision.c", + MAME_DIR .. "src/mess/video/advision.c", +} + +createMESSProjects(_target, _subtarget, "epoch") +files { + MAME_DIR .. "src/mess/drivers/gamepock.c", + MAME_DIR .. "src/mess/machine/gamepock.c", + MAME_DIR .. "src/mess/drivers/scv.c", + MAME_DIR .. "src/mess/audio/upd1771.c", +} + +createMESSProjects(_target, _subtarget, "epson") +files { + MAME_DIR .. "src/mess/drivers/hx20.c", + MAME_DIR .. "src/mess/drivers/px4.c", + MAME_DIR .. "src/mess/drivers/px8.c", + MAME_DIR .. "src/mess/drivers/qx10.c", + MAME_DIR .. "src/mess/machine/qx10kbd.c", +} + +createMESSProjects(_target, _subtarget, "exidy") +files { + MAME_DIR .. "src/mess/machine/sorcerer.c", + MAME_DIR .. "src/mess/drivers/sorcerer.c", + MAME_DIR .. "src/mess/machine/micropolis.c", +} + +createMESSProjects(_target, _subtarget, "fairch") +files { + MAME_DIR .. "src/mess/drivers/channelf.c", + MAME_DIR .. "src/mess/audio/channelf.c", + MAME_DIR .. "src/mess/video/channelf.c", +} + +createMESSProjects(_target, _subtarget, "fidelity") +files { + MAME_DIR .. "src/mess/drivers/csc.c", + MAME_DIR .. "src/mess/drivers/fidelz80.c", +} + +createMESSProjects(_target, _subtarget, "fujitsu") +files { + MAME_DIR .. "src/mess/drivers/fmtowns.c", + MAME_DIR .. "src/mess/video/fmtowns.c", + MAME_DIR .. "src/mess/machine/fm_scsi.c", + MAME_DIR .. "src/mess/drivers/fm7.c", + MAME_DIR .. "src/mess/video/fm7.c", +} + +createMESSProjects(_target, _subtarget, "funtech") +files { + MAME_DIR .. "src/mess/drivers/supracan.c", +} + +createMESSProjects(_target, _subtarget, "galaxy") +files { + MAME_DIR .. "src/mess/drivers/galaxy.c", + MAME_DIR .. "src/mess/machine/galaxy.c", + MAME_DIR .. "src/mess/video/galaxy.c", +} + +createMESSProjects(_target, _subtarget, "gamepark") +files { + MAME_DIR .. "src/mess/drivers/gp2x.c", + MAME_DIR .. "src/mess/drivers/gp32.c", +} + +createMESSProjects(_target, _subtarget, "gi") +files { + MAME_DIR .. "src/mess/drivers/hh_pic16.c", +} + +createMESSProjects(_target, _subtarget, "grundy") +files { + MAME_DIR .. "src/mess/drivers/newbrain.c", + MAME_DIR .. "src/mess/video/newbrain.c", +} + +createMESSProjects(_target, _subtarget, "hartung") +files { + MAME_DIR .. "src/mess/drivers/gmaster.c", +} + +createMESSProjects(_target, _subtarget, "heathkit") +files { + MAME_DIR .. "src/mess/drivers/et3400.c", + MAME_DIR .. "src/mess/drivers/h8.c", + MAME_DIR .. "src/mess/drivers/h19.c", + MAME_DIR .. "src/mess/drivers/h89.c", +} + +createMESSProjects(_target, _subtarget, "hegener") +files { + MAME_DIR .. "src/mess/drivers/glasgow.c", + MAME_DIR .. "src/mess/drivers/mephisto.c", + MAME_DIR .. "src/mess/drivers/mmodular.c", + MAME_DIR .. "src/mess/drivers/stratos.c", + MAME_DIR .. "src/mess/machine/mboard.c", +} + +createMESSProjects(_target, _subtarget, "hitachi") +files { + MAME_DIR .. "src/mess/drivers/b16.c", + MAME_DIR .. "src/mess/drivers/bmjr.c", + MAME_DIR .. "src/mess/drivers/bml3.c", + MAME_DIR .. "src/mess/drivers/hh_hmcs40.c", +} + +createMESSProjects(_target, _subtarget, "homebrew") +files { + MAME_DIR .. "src/mess/drivers/4004clk.c", + MAME_DIR .. "src/mess/drivers/68ksbc.c", + MAME_DIR .. "src/mess/drivers/craft.c", + MAME_DIR .. "src/mess/drivers/homez80.c", + MAME_DIR .. "src/mess/drivers/p112.c", + MAME_DIR .. "src/mess/drivers/phunsy.c", + MAME_DIR .. "src/mess/drivers/pimps.c", + MAME_DIR .. "src/mess/drivers/ravens.c", + MAME_DIR .. "src/mess/drivers/sbc6510.c", + MAME_DIR .. "src/mess/drivers/sitcom.c", + MAME_DIR .. "src/mess/drivers/slc1.c", + MAME_DIR .. "src/mess/drivers/uzebox.c", + MAME_DIR .. "src/mess/drivers/z80dev.c", +} + +createMESSProjects(_target, _subtarget, "homelab") +files { + MAME_DIR .. "src/mess/drivers/homelab.c", +} + +createMESSProjects(_target, _subtarget, "hp") +files { + MAME_DIR .. "src/mess/drivers/hp16500.c", + MAME_DIR .. "src/mess/drivers/hp48.c", + MAME_DIR .. "src/mess/machine/hp48.c", + MAME_DIR .. "src/mess/video/hp48.c", + MAME_DIR .. "src/mess/drivers/hp49gp.c", + MAME_DIR .. "src/mess/drivers/hp9845.c", + MAME_DIR .. "src/mess/drivers/hp9k.c", + MAME_DIR .. "src/mess/drivers/hp9k_3xx.c", +} + +createMESSProjects(_target, _subtarget, "hec2hrp") +files { + MAME_DIR .. "src/mess/drivers/hec2hrp.c", + MAME_DIR .. "src/mess/machine/hec2hrp.c", + MAME_DIR .. "src/mess/machine/hecdisk2.c", + MAME_DIR .. "src/mess/video/hec2video.c", + MAME_DIR .. "src/mess/drivers/interact.c", +} + +createMESSProjects(_target, _subtarget, "intel") +files { + MAME_DIR .. "src/mess/drivers/basic52.c", + MAME_DIR .. "src/mess/drivers/imds.c", + MAME_DIR .. "src/mess/drivers/ipc.c", + MAME_DIR .. "src/mess/drivers/ipds.c", + MAME_DIR .. "src/mess/drivers/isbc.c", + MAME_DIR .. "src/mess/machine/isbc_215g.c", + MAME_DIR .. "src/mess/drivers/rex6000.c", + MAME_DIR .. "src/mess/drivers/sdk85.c", + MAME_DIR .. "src/mess/drivers/sdk86.c", + MAME_DIR .. "src/mess/drivers/imds2.c", +} + +createMESSProjects(_target, _subtarget, "imp") +files { + MAME_DIR .. "src/mess/drivers/tim011.c", + MAME_DIR .. "src/mess/drivers/tim100.c", +} + +createMESSProjects(_target, _subtarget, "interton") +files { + MAME_DIR .. "src/mess/drivers/vc4000.c", + MAME_DIR .. "src/mess/audio/vc4000snd.c", + MAME_DIR .. "src/mess/video/vc4000.c", +} + +createMESSProjects(_target, _subtarget, "intv") +files { + MAME_DIR .. "src/mess/drivers/intv.c", + MAME_DIR .. "src/mess/machine/intv.c", + MAME_DIR .. "src/mess/video/intv.c", + MAME_DIR .. "src/mess/video/stic.c", +} + +createMESSProjects(_target, _subtarget, "isc") +files { + MAME_DIR .. "src/mess/drivers/compucolor.c", +} + +createMESSProjects(_target, _subtarget, "kaypro") +files { + MAME_DIR .. "src/mess/drivers/kaypro.c", + MAME_DIR .. "src/mess/machine/kaypro.c", + MAME_DIR .. "src/mess/machine/kay_kbd.c", + MAME_DIR .. "src/mess/video/kaypro.c", +} + +createMESSProjects(_target, _subtarget, "koei") +files { + MAME_DIR .. "src/mess/drivers/pasogo.c", +} + +createMESSProjects(_target, _subtarget, "kyocera") +files { + MAME_DIR .. "src/mess/drivers/kyocera.c", + MAME_DIR .. "src/mess/video/kyocera.c", +} + +createMESSProjects(_target, _subtarget, "luxor") +files { + MAME_DIR .. "src/mess/drivers/abc80.c", + MAME_DIR .. "src/mess/machine/abc80kb.c", + MAME_DIR .. "src/mess/video/abc80.c", + MAME_DIR .. "src/mess/drivers/abc80x.c", + MAME_DIR .. "src/mess/video/abc800.c", + MAME_DIR .. "src/mess/video/abc802.c", + MAME_DIR .. "src/mess/video/abc806.c", + MAME_DIR .. "src/mess/drivers/abc1600.c", + MAME_DIR .. "src/mess/machine/abc1600mac.c", + MAME_DIR .. "src/mess/video/abc1600.c", +} + +createMESSProjects(_target, _subtarget, "magnavox") +files { + MAME_DIR .. "src/mess/drivers/odyssey2.c", +} + +createMESSProjects(_target, _subtarget, "makerbot") +files { + MAME_DIR .. "src/mess/drivers/replicator.c", +} + +createMESSProjects(_target, _subtarget, "marx") +files { + MAME_DIR .. "src/mess/drivers/elecbowl.c", +} + +createMESSProjects(_target, _subtarget, "mattel") +files { + MAME_DIR .. "src/mess/drivers/aquarius.c", + MAME_DIR .. "src/mess/video/aquarius.c", + MAME_DIR .. "src/mess/drivers/juicebox.c", + MAME_DIR .. "src/mess/drivers/hyperscan.c", +} + +createMESSProjects(_target, _subtarget, "matsushi") +files { + MAME_DIR .. "src/mess/drivers/jr100.c", + MAME_DIR .. "src/mess/drivers/jr200.c", + MAME_DIR .. "src/mess/drivers/myb3k.c", +} + +createMESSProjects(_target, _subtarget, "mb") +files { + MAME_DIR .. "src/mess/drivers/mbdtower.c", + MAME_DIR .. "src/mess/drivers/microvsn.c", +} + +createMESSProjects(_target, _subtarget, "mchester") +files { + MAME_DIR .. "src/mess/drivers/ssem.c", +} + +createMESSProjects(_target, _subtarget, "memotech") +files { + MAME_DIR .. "src/mess/drivers/mtx.c", + MAME_DIR .. "src/mess/machine/mtx.c", +} + +createMESSProjects(_target, _subtarget, "mgu") +files { + MAME_DIR .. "src/mess/drivers/irisha.c", +} + +createMESSProjects(_target, _subtarget, "microkey") +files { + MAME_DIR .. "src/mess/drivers/primo.c", + MAME_DIR .. "src/mess/machine/primo.c", + MAME_DIR .. "src/mess/video/primo.c", +} + +createMESSProjects(_target, _subtarget, "mit") +files { + MAME_DIR .. "src/mess/drivers/tx0.c", + MAME_DIR .. "src/mess/video/crt.c", + MAME_DIR .. "src/mess/video/tx0.c", +} + +createMESSProjects(_target, _subtarget, "mits") +files { + MAME_DIR .. "src/mess/drivers/altair.c", + MAME_DIR .. "src/mess/drivers/mits680b.c", +} + +createMESSProjects(_target, _subtarget, "mitsubishi") +files { + MAME_DIR .. "src/mess/drivers/multi8.c", + MAME_DIR .. "src/mess/drivers/multi16.c", +} + +createMESSProjects(_target, _subtarget, "morrow") +files { + MAME_DIR .. "src/mess/drivers/microdec.c", + MAME_DIR .. "src/mess/drivers/mpz80.c", + MAME_DIR .. "src/mess/drivers/tricep.c", +} + +createMESSProjects(_target, _subtarget, "mos") +files { + MAME_DIR .. "src/mess/drivers/kim1.c", +} + +createMESSProjects(_target, _subtarget, "motorola") +files { + MAME_DIR .. "src/mess/drivers/m6805evs.c", + MAME_DIR .. "src/mess/drivers/mekd2.c", +} + +createMESSProjects(_target, _subtarget, "multitch") +files { + MAME_DIR .. "src/mess/drivers/mkit09.c", + MAME_DIR .. "src/mess/drivers/mpf1.c", +} + +createMESSProjects(_target, _subtarget, "nakajima") +files { + MAME_DIR .. "src/mess/drivers/nakajies.c", +} + +createMESSProjects(_target, _subtarget, "nascom") +files { + MAME_DIR .. "src/mess/drivers/nascom1.c", + MAME_DIR .. "src/mess/machine/nascom1.c", + MAME_DIR .. "src/mess/video/nascom1.c", +} + +createMESSProjects(_target, _subtarget, "ne") +files { + MAME_DIR .. "src/mess/drivers/z80ne.c", + MAME_DIR .. "src/mess/machine/z80ne.c", +} + +createMESSProjects(_target, _subtarget, "nec") +files { + MAME_DIR .. "src/mess/drivers/apc.c", + MAME_DIR .. "src/mess/drivers/pce.c", + MAME_DIR .. "src/mess/machine/pce.c", + MAME_DIR .. "src/mess/machine/pce_cd.c", + MAME_DIR .. "src/mess/drivers/pcfx.c", + MAME_DIR .. "src/mess/drivers/pc6001.c", + MAME_DIR .. "src/mess/drivers/pc8401a.c", + MAME_DIR .. "src/mess/video/pc8401a.c", + MAME_DIR .. "src/mess/drivers/pc8001.c", + MAME_DIR .. "src/mess/drivers/pc8801.c", + MAME_DIR .. "src/mess/drivers/pc88va.c", + MAME_DIR .. "src/mess/drivers/pc100.c", + MAME_DIR .. "src/mess/drivers/pc9801.c", + MAME_DIR .. "src/mess/machine/pc9801_26.c", + MAME_DIR .. "src/mess/machine/pc9801_86.c", + MAME_DIR .. "src/mess/machine/pc9801_118.c", + MAME_DIR .. "src/mess/machine/pc9801_cbus.c", + MAME_DIR .. "src/mess/machine/pc9801_kbd.c", + MAME_DIR .. "src/mess/drivers/tk80bs.c", + MAME_DIR .. "src/mess/drivers/hh_ucom4.c", +} + +createMESSProjects(_target, _subtarget, "netronic") +files { + MAME_DIR .. "src/mess/drivers/elf.c", + MAME_DIR .. "src/mess/drivers/exp85.c", +} + +createMESSProjects(_target, _subtarget, "next") +files { + MAME_DIR .. "src/mess/drivers/next.c", + MAME_DIR .. "src/mess/machine/nextkbd.c", + MAME_DIR .. "src/mess/machine/nextmo.c", +} + +createMESSProjects(_target, _subtarget, "nintendo") +files { + MAME_DIR .. "src/mess/drivers/gb.c", + MAME_DIR .. "src/mess/audio/gb.c", + MAME_DIR .. "src/mess/machine/gb.c", + MAME_DIR .. "src/mess/video/gb_lcd.c", + MAME_DIR .. "src/mess/drivers/gba.c", + MAME_DIR .. "src/mess/video/gba.c", + MAME_DIR .. "src/mess/drivers/n64.c", + MAME_DIR .. "src/mess/drivers/nes.c", + MAME_DIR .. "src/mess/machine/nes.c", + MAME_DIR .. "src/mess/video/nes.c", + MAME_DIR .. "src/mess/drivers/pokemini.c", + MAME_DIR .. "src/mess/drivers/snes.c", + MAME_DIR .. "src/mess/machine/snescx4.c", + MAME_DIR .. "src/mess/drivers/vboy.c", + MAME_DIR .. "src/mess/audio/vboy.c", +} + +createMESSProjects(_target, _subtarget, "nokia") +files { + MAME_DIR .. "src/mess/drivers/mikromik.c", + MAME_DIR .. "src/mess/machine/mm1kb.c", + MAME_DIR .. "src/mess/video/mikromik.c", +} + +createMESSProjects(_target, _subtarget, "northstar") +files { + MAME_DIR .. "src/mess/drivers/horizon.c", +} + +createMESSProjects(_target, _subtarget, "novag") +files { + MAME_DIR .. "src/mess/drivers/mk1.c", + MAME_DIR .. "src/mess/drivers/mk2.c", + MAME_DIR .. "src/mess/drivers/ssystem3.c", + MAME_DIR .. "src/mess/video/ssystem3.c", + MAME_DIR .. "src/mess/drivers/supercon.c", +} + +createMESSProjects(_target, _subtarget, "olivetti") +files { + MAME_DIR .. "src/mess/drivers/m20.c", + MAME_DIR .. "src/mess/drivers/m24.c", + MAME_DIR .. "src/mess/machine/m24_kbd.c", +} + +createMESSProjects(_target, _subtarget, "omnibyte") +files { + MAME_DIR .. "src/mess/drivers/msbc1.c", + MAME_DIR .. "src/mess/drivers/ob68k1a.c", +} + +createMESSProjects(_target, _subtarget, "orion") +files { + MAME_DIR .. "src/mess/drivers/orion.c", + MAME_DIR .. "src/mess/machine/orion.c", + MAME_DIR .. "src/mess/video/orion.c", +} + +createMESSProjects(_target, _subtarget, "osborne") +files { + MAME_DIR .. "src/mess/drivers/osborne1.c", + MAME_DIR .. "src/mess/machine/osborne1.c", + MAME_DIR .. "src/mess/drivers/osbexec.c", + MAME_DIR .. "src/mess/drivers/vixen.c", +} + +createMESSProjects(_target, _subtarget, "osi") +files { + MAME_DIR .. "src/mess/drivers/osi.c", + MAME_DIR .. "src/mess/video/osi.c", +} + +createMESSProjects(_target, _subtarget, "palm") +files { + MAME_DIR .. "src/mess/drivers/palm.c", + MAME_DIR .. "src/mess/drivers/palmz22.c", +} + +createMESSProjects(_target, _subtarget, "parker") +files { + MAME_DIR .. "src/mess/drivers/wildfire.c", +} + +createMESSProjects(_target, _subtarget, "pitronic") +files { + MAME_DIR .. "src/mess/drivers/beta.c", +} + +createMESSProjects(_target, _subtarget, "pc") +files { + MAME_DIR .. "src/mess/drivers/asst128.c", + MAME_DIR .. "src/mess/drivers/europc.c", + MAME_DIR .. "src/mess/drivers/genpc.c", + MAME_DIR .. "src/mess/machine/genpc.c", + MAME_DIR .. "src/mess/drivers/ibmpc.c", + MAME_DIR .. "src/mess/drivers/ibmpcjr.c", + MAME_DIR .. "src/mess/drivers/pc.c", + MAME_DIR .. "src/mess/drivers/tandy1t.c", + MAME_DIR .. "src/mess/video/pc_t1t.c", +} + +createMESSProjects(_target, _subtarget, "pdp1") +files { + MAME_DIR .. "src/mess/drivers/pdp1.c", + MAME_DIR .. "src/mess/video/pdp1.c", +} + +createMESSProjects(_target, _subtarget, "pel") +files { + MAME_DIR .. "src/mess/drivers/galeb.c", + MAME_DIR .. "src/mess/video/galeb.c", + MAME_DIR .. "src/mess/drivers/orao.c", + MAME_DIR .. "src/mess/machine/orao.c", + MAME_DIR .. "src/mess/video/orao.c", +} + +createMESSProjects(_target, _subtarget, "philips") +files { + MAME_DIR .. "src/mess/drivers/p2000t.c", + MAME_DIR .. "src/mess/machine/p2000t.c", + MAME_DIR .. "src/mess/video/p2000m.c", + MAME_DIR .. "src/mess/drivers/vg5k.c", +} + +createMESSProjects(_target, _subtarget, "poly88") +files { + MAME_DIR .. "src/mess/drivers/poly88.c", + MAME_DIR .. "src/mess/machine/poly88.c", + MAME_DIR .. "src/mess/video/poly88.c", +} + +createMESSProjects(_target, _subtarget, "psion") +files { + MAME_DIR .. "src/mess/drivers/psion.c", + MAME_DIR .. "src/mess/machine/psion_pack.c", +} + +createMESSProjects(_target, _subtarget, "radio") +files { + MAME_DIR .. "src/mess/drivers/apogee.c", + MAME_DIR .. "src/mess/drivers/mikrosha.c", + MAME_DIR .. "src/mess/drivers/partner.c", + MAME_DIR .. "src/mess/machine/partner.c", + MAME_DIR .. "src/mess/drivers/radio86.c", + MAME_DIR .. "src/mess/machine/radio86.c", +} + +createMESSProjects(_target, _subtarget, "rca") +files { + MAME_DIR .. "src/mess/drivers/microkit.c", + MAME_DIR .. "src/mess/drivers/studio2.c", + MAME_DIR .. "src/mess/drivers/vip.c", +} + +createMESSProjects(_target, _subtarget, "rm") +files { + MAME_DIR .. "src/mess/drivers/rm380z.c", + MAME_DIR .. "src/mess/machine/rm380z.c", + MAME_DIR .. "src/mess/video/rm380z.c", + MAME_DIR .. "src/mess/drivers/rmnimbus.c", + MAME_DIR .. "src/mess/machine/rmnimbus.c", + MAME_DIR .. "src/mess/video/rmnimbus.c", + MAME_DIR .. "src/mess/machine/rmnkbd.c", +} + +createMESSProjects(_target, _subtarget, "robotron") +files { + MAME_DIR .. "src/mess/drivers/a5105.c", + MAME_DIR .. "src/mess/drivers/a51xx.c", + MAME_DIR .. "src/mess/drivers/a7150.c", + MAME_DIR .. "src/mess/drivers/k1003.c", + MAME_DIR .. "src/mess/drivers/k8915.c", + MAME_DIR .. "src/mess/drivers/rt1715.c", + MAME_DIR .. "src/mess/drivers/z1013.c", + MAME_DIR .. "src/mess/drivers/z9001.c", +} + +createMESSProjects(_target, _subtarget, "roland") +files { + MAME_DIR .. "src/mess/drivers/rmt32.c", + MAME_DIR .. "src/mess/drivers/rd110.c", + MAME_DIR .. "src/mess/drivers/rsc55.c", + MAME_DIR .. "src/mess/drivers/tb303.c", +} + +createMESSProjects(_target, _subtarget, "rockwell") +files { + MAME_DIR .. "src/mess/drivers/aim65.c", + MAME_DIR .. "src/mess/machine/aim65.c", + MAME_DIR .. "src/mess/drivers/aim65_40.c", +} + +createMESSProjects(_target, _subtarget, "sage") +files { + MAME_DIR .. "src/mess/drivers/sage2.c", +} + +createMESSProjects(_target, _subtarget, "samcoupe") +files { + MAME_DIR .. "src/mess/drivers/samcoupe.c", + MAME_DIR .. "src/mess/machine/samcoupe.c", + MAME_DIR .. "src/mess/video/samcoupe.c", +} + +createMESSProjects(_target, _subtarget, "samsung") +files { + MAME_DIR .. "src/mess/drivers/spc1000.c", +} + +createMESSProjects(_target, _subtarget, "sanyo") +files { + MAME_DIR .. "src/mess/drivers/mbc200.c", + MAME_DIR .. "src/mess/drivers/mbc55x.c", + MAME_DIR .. "src/mess/machine/mbc55x.c", + MAME_DIR .. "src/mess/video/mbc55x.c", + MAME_DIR .. "src/mess/drivers/phc25.c", +} + +createMESSProjects(_target, _subtarget, "sega") +files { + MAME_DIR .. "src/mess/drivers/dccons.c", + MAME_DIR .. "src/mess/machine/dccons.c", + MAME_DIR .. "src/mess/drivers/megadriv.c", + MAME_DIR .. "src/mess/drivers/saturn.c", + MAME_DIR .. "src/mess/drivers/segapico.c", + MAME_DIR .. "src/mess/drivers/sg1000.c", + MAME_DIR .. "src/mess/drivers/sms.c", + MAME_DIR .. "src/mess/machine/sms.c", + MAME_DIR .. "src/mess/drivers/svmu.c", + MAME_DIR .. "src/mess/machine/mega32x.c", + MAME_DIR .. "src/mess/machine/megacd.c", + MAME_DIR .. "src/mess/machine/megacdcd.c", +} + +createMESSProjects(_target, _subtarget, "sgi") +files { + MAME_DIR .. "src/mess/machine/sgi.c", + MAME_DIR .. "src/mess/drivers/sgi_ip2.c", + MAME_DIR .. "src/mess/drivers/sgi_ip6.c", + MAME_DIR .. "src/mess/drivers/ip20.c", + MAME_DIR .. "src/mess/drivers/ip22.c", + MAME_DIR .. "src/mess/video/newport.c", +} + +createMESSProjects(_target, _subtarget, "sharp") +files { + MAME_DIR .. "src/mess/video/mz700.c", + MAME_DIR .. "src/mess/drivers/mz700.c", + MAME_DIR .. "src/mess/drivers/pc1500.c", + MAME_DIR .. "src/mess/drivers/pocketc.c", + MAME_DIR .. "src/mess/video/pc1401.c", + MAME_DIR .. "src/mess/machine/pc1401.c", + MAME_DIR .. "src/mess/video/pc1403.c", + MAME_DIR .. "src/mess/machine/pc1403.c", + MAME_DIR .. "src/mess/video/pc1350.c", + MAME_DIR .. "src/mess/machine/pc1350.c", + MAME_DIR .. "src/mess/video/pc1251.c", + MAME_DIR .. "src/mess/machine/pc1251.c", + MAME_DIR .. "src/mess/video/pocketc.c", + MAME_DIR .. "src/mess/machine/mz700.c", + MAME_DIR .. "src/mess/drivers/x68k.c", + MAME_DIR .. "src/mess/video/x68k.c", + MAME_DIR .. "src/mess/machine/x68k_hdc.c", + MAME_DIR .. "src/mess/machine/x68k_kbd.c", + MAME_DIR .. "src/mess/drivers/mz80.c", + MAME_DIR .. "src/mess/video/mz80.c", + MAME_DIR .. "src/mess/machine/mz80.c", + MAME_DIR .. "src/mess/drivers/mz2000.c", + MAME_DIR .. "src/mess/drivers/x1.c", + MAME_DIR .. "src/mess/machine/x1.c", + MAME_DIR .. "src/mess/drivers/x1twin.c", + MAME_DIR .. "src/mess/drivers/mz2500.c", + MAME_DIR .. "src/mess/drivers/mz3500.c", + MAME_DIR .. "src/mess/drivers/pce220.c", + MAME_DIR .. "src/mess/machine/pce220_ser.c", + MAME_DIR .. "src/mess/drivers/mz6500.c", + MAME_DIR .. "src/mess/drivers/zaurus.c", +} + +createMESSProjects(_target, _subtarget, "sinclair") +files { + MAME_DIR .. "src/mess/video/spectrum.c", + MAME_DIR .. "src/mess/video/timex.c", + MAME_DIR .. "src/mess/video/zx.c", + MAME_DIR .. "src/mess/drivers/zx.c", + MAME_DIR .. "src/mess/machine/zx.c", + MAME_DIR .. "src/mess/drivers/spectrum.c", + MAME_DIR .. "src/mess/drivers/spec128.c", + MAME_DIR .. "src/mess/drivers/timex.c", + MAME_DIR .. "src/mess/drivers/specpls3.c", + MAME_DIR .. "src/mess/drivers/scorpion.c", + MAME_DIR .. "src/mess/drivers/atm.c", + MAME_DIR .. "src/mess/drivers/pentagon.c", + MAME_DIR .. "src/mess/machine/beta.c", + MAME_DIR .. "src/mess/machine/spec_snqk.c", + MAME_DIR .. "src/mess/drivers/ql.c", + MAME_DIR .. "src/mess/machine/qimi.c", + MAME_DIR .. "src/mess/video/zx8301.c", + MAME_DIR .. "src/mess/machine/zx8302.c", +} + +createMESSProjects(_target, _subtarget, "siemens") +files { + MAME_DIR .. "src/mess/drivers/pcd.c", + MAME_DIR .. "src/mess/machine/pcd_kbd.c", +} + +createMESSProjects(_target, _subtarget, "slicer") +files { + MAME_DIR .. "src/mess/drivers/slicer.c", +} + +createMESSProjects(_target, _subtarget, "snk") +files { + MAME_DIR .. "src/mess/drivers/ng_aes.c", + MAME_DIR .. "src/mess/drivers/ngp.c", + MAME_DIR .. "src/mess/video/k1ge.c", +} + +createMESSProjects(_target, _subtarget, "sony") +files { + MAME_DIR .. "src/mess/drivers/pockstat.c", + MAME_DIR .. "src/mess/drivers/psx.c", + MAME_DIR .. "src/mess/machine/psxcd.c", + MAME_DIR .. "src/mess/drivers/pve500.c", + MAME_DIR .. "src/mess/drivers/smc777.c", +} + +createMESSProjects(_target, _subtarget, "sord") +files { + MAME_DIR .. "src/mess/drivers/m5.c", +} + +createMESSProjects(_target, _subtarget, "special") +files { + MAME_DIR .. "src/mess/drivers/special.c", + MAME_DIR .. "src/mess/audio/specimx_snd.c", + MAME_DIR .. "src/mess/machine/special.c", + MAME_DIR .. "src/mess/video/special.c", +} + +createMESSProjects(_target, _subtarget, "sun") +files { + MAME_DIR .. "src/mess/drivers/sun1.c", + MAME_DIR .. "src/mess/drivers/sun2.c", + MAME_DIR .. "src/mess/drivers/sun3.c", + MAME_DIR .. "src/mess/drivers/sun4.c", +} + +createMESSProjects(_target, _subtarget, "svi") +files { + MAME_DIR .. "src/mess/drivers/svi318.c", + MAME_DIR .. "src/mess/machine/svi318.c", +} + +createMESSProjects(_target, _subtarget, "svision") +files { + MAME_DIR .. "src/mess/drivers/svision.c", + MAME_DIR .. "src/mess/audio/svis_snd.c", +} + +createMESSProjects(_target, _subtarget, "swtpc09") +files { + MAME_DIR .. "src/mess/drivers/swtpc09.c", + MAME_DIR .. "src/mess/machine/swtpc09.c", +} + +createMESSProjects(_target, _subtarget, "synertec") +files { + MAME_DIR .. "src/mess/drivers/sym1.c", +} + +createMESSProjects(_target, _subtarget, "ta") +files { + MAME_DIR .. "src/mess/drivers/alphatro.c", +} + +createMESSProjects(_target, _subtarget, "tandberg") +files { + MAME_DIR .. "src/mess/drivers/tdv2324.c", +} + +createMESSProjects(_target, _subtarget, "tangerin") +files { + MAME_DIR .. "src/mess/drivers/microtan.c", + MAME_DIR .. "src/mess/machine/microtan.c", + MAME_DIR .. "src/mess/video/microtan.c", + MAME_DIR .. "src/mess/drivers/oric.c", +} + +createMESSProjects(_target, _subtarget, "tatung") +files { + MAME_DIR .. "src/mess/drivers/einstein.c", + MAME_DIR .. "src/mess/machine/einstein.c", +} + +createMESSProjects(_target, _subtarget, "teamconc") +files { + MAME_DIR .. "src/mess/drivers/comquest.c", + MAME_DIR .. "src/mess/video/comquest.c", +} + +createMESSProjects(_target, _subtarget, "tektroni") +files { + MAME_DIR .. "src/mess/drivers/tek405x.c", + MAME_DIR .. "src/mess/drivers/tek410x.c", +} + +createMESSProjects(_target, _subtarget, "telenova") +files { + MAME_DIR .. "src/mess/drivers/compis.c", + MAME_DIR .. "src/mess/machine/compiskb.c", +} + +createMESSProjects(_target, _subtarget, "telercas") +files { + MAME_DIR .. "src/mess/drivers/tmc1800.c", + MAME_DIR .. "src/mess/video/tmc1800.c", + MAME_DIR .. "src/mess/drivers/tmc600.c", + MAME_DIR .. "src/mess/video/tmc600.c", + MAME_DIR .. "src/mess/drivers/tmc2000e.c", +} + +createMESSProjects(_target, _subtarget, "televideo") +files { + MAME_DIR .. "src/mess/drivers/ts802.c", + MAME_DIR .. "src/mess/drivers/ts803.c", + MAME_DIR .. "src/mess/drivers/ts816.c", + MAME_DIR .. "src/mess/drivers/tv950.c", +} + +createMESSProjects(_target, _subtarget, "tem") +files { + MAME_DIR .. "src/mess/drivers/tec1.c", +} + +createMESSProjects(_target, _subtarget, "tesla") +files { + MAME_DIR .. "src/mess/drivers/ondra.c", + MAME_DIR .. "src/mess/machine/ondra.c", + MAME_DIR .. "src/mess/video/ondra.c", + MAME_DIR .. "src/mess/drivers/pmd85.c", + MAME_DIR .. "src/mess/machine/pmd85.c", + MAME_DIR .. "src/mess/video/pmd85.c", + MAME_DIR .. "src/mess/drivers/pmi80.c", + MAME_DIR .. "src/mess/drivers/sapi1.c", +} + +createMESSProjects(_target, _subtarget, "test") +files { + MAME_DIR .. "src/mess/drivers/test_t400.c", + MAME_DIR .. "src/mess/drivers/zexall.c", +} + +createMESSProjects(_target, _subtarget, "thomson") +files { + MAME_DIR .. "src/mess/drivers/thomson.c", + MAME_DIR .. "src/mess/machine/thomson.c", + MAME_DIR .. "src/mess/machine/thomflop.c", + MAME_DIR .. "src/mess/video/thomson.c", +} + +createMESSProjects(_target, _subtarget, "ti") +files { + MAME_DIR .. "src/mess/drivers/avigo.c", + MAME_DIR .. "src/mess/video/avigo.c", + MAME_DIR .. "src/mess/drivers/cc40.c", + MAME_DIR .. "src/mess/drivers/evmbug.c", + MAME_DIR .. "src/mess/drivers/exelv.c", + MAME_DIR .. "src/mess/drivers/geneve.c", + MAME_DIR .. "src/mess/drivers/ticalc1x.c", + MAME_DIR .. "src/mess/drivers/tispeak.c", + MAME_DIR .. "src/mess/drivers/ti74.c", + MAME_DIR .. "src/mess/drivers/ti85.c", + MAME_DIR .. "src/mess/machine/ti85.c", + MAME_DIR .. "src/mess/video/ti85.c", + MAME_DIR .. "src/mess/drivers/ti89.c", + MAME_DIR .. "src/mess/drivers/ti99_2.c", + MAME_DIR .. "src/mess/drivers/ti99_4x.c", + MAME_DIR .. "src/mess/drivers/ti99_4p.c", + MAME_DIR .. "src/mess/drivers/ti99_8.c", + MAME_DIR .. "src/mess/drivers/ti990_4.c", + MAME_DIR .. "src/mess/drivers/ti990_10.c", + MAME_DIR .. "src/mess/drivers/tm990189.c", + MAME_DIR .. "src/mess/machine/ti99/990_dk.c", + MAME_DIR .. "src/mess/machine/ti99/990_hd.c", + MAME_DIR .. "src/mess/machine/ti99/990_tap.c", + MAME_DIR .. "src/mess/machine/ti99/datamux.c", + MAME_DIR .. "src/mess/machine/ti99/genboard.c", + MAME_DIR .. "src/mess/machine/ti99/grom.c", + MAME_DIR .. "src/mess/machine/ti99/gromport.c", + MAME_DIR .. "src/mess/machine/ti99/handset.c", + MAME_DIR .. "src/mess/machine/ti99/joyport.c", + MAME_DIR .. "src/mess/machine/ti99/mapper8.c", + MAME_DIR .. "src/mess/machine/ti99/mecmouse.c", + MAME_DIR .. "src/mess/machine/ti99/speech8.c", + MAME_DIR .. "src/mess/machine/ti99/videowrp.c", + MAME_DIR .. "src/mess/video/733_asr.c", + MAME_DIR .. "src/mess/video/911_vdt.c", + MAME_DIR .. "src/mess/drivers/hh_tms1k.c", +} + +createMESSProjects(_target, _subtarget, "tiger") +files { + MAME_DIR .. "src/mess/drivers/gamecom.c", + MAME_DIR .. "src/mess/machine/gamecom.c", + MAME_DIR .. "src/mess/video/gamecom.c", +} + +createMESSProjects(_target, _subtarget, "tigertel") +files { + MAME_DIR .. "src/mess/drivers/gizmondo.c", + MAME_DIR .. "src/mess/machine/docg3.c", +} + +createMESSProjects(_target, _subtarget, "tiki") +files { + MAME_DIR .. "src/mess/drivers/tiki100.c", +} + +createMESSProjects(_target, _subtarget, "tomy") +files { + MAME_DIR .. "src/mess/drivers/tutor.c", +} + +createMESSProjects(_target, _subtarget, "toshiba") +files { + MAME_DIR .. "src/mess/drivers/pasopia.c", + MAME_DIR .. "src/mess/drivers/pasopia7.c", + MAME_DIR .. "src/mess/drivers/paso1600.c", +} + +createMESSProjects(_target, _subtarget, "trainer") +files { + MAME_DIR .. "src/mess/drivers/amico2k.c", + MAME_DIR .. "src/mess/drivers/babbage.c", + MAME_DIR .. "src/mess/drivers/bob85.c", + MAME_DIR .. "src/mess/drivers/cvicny.c", + MAME_DIR .. "src/mess/drivers/dolphunk.c", + MAME_DIR .. "src/mess/drivers/instruct.c", + MAME_DIR .. "src/mess/drivers/mk14.c", + MAME_DIR .. "src/mess/drivers/pro80.c", + MAME_DIR .. "src/mess/drivers/savia84.c", + MAME_DIR .. "src/mess/drivers/selz80.c", + MAME_DIR .. "src/mess/drivers/tk80.c", +} + +createMESSProjects(_target, _subtarget, "trs") +files { + MAME_DIR .. "src/mess/drivers/coco12.c", + MAME_DIR .. "src/mess/drivers/coco3.c", + MAME_DIR .. "src/mess/drivers/dragon.c", + MAME_DIR .. "src/mess/drivers/mc10.c", + MAME_DIR .. "src/mess/machine/6883sam.c", + MAME_DIR .. "src/mess/machine/coco.c", + MAME_DIR .. "src/mess/machine/coco12.c", + MAME_DIR .. "src/mess/machine/coco3.c", + MAME_DIR .. "src/mess/machine/coco_vhd.c", + MAME_DIR .. "src/mess/machine/dragon.c", + MAME_DIR .. "src/mess/machine/dgnalpha.c", + MAME_DIR .. "src/mess/video/gime.c", + MAME_DIR .. "src/mess/drivers/trs80.c", + MAME_DIR .. "src/mess/machine/trs80.c", + MAME_DIR .. "src/mess/video/trs80.c", + MAME_DIR .. "src/mess/drivers/trs80m2.c", + MAME_DIR .. "src/mess/machine/trs80m2kb.c", + MAME_DIR .. "src/mess/drivers/tandy2k.c", + MAME_DIR .. "src/mess/machine/tandy2kb.c", +} + +createMESSProjects(_target, _subtarget, "ultratec") +files { + MAME_DIR .. "src/mess/drivers/minicom.c", +} + +createMESSProjects(_target, _subtarget, "unisys") +files { + MAME_DIR .. "src/mess/drivers/univac.c", +} + +createMESSProjects(_target, _subtarget, "veb") +files { + MAME_DIR .. "src/mess/drivers/chessmst.c", + MAME_DIR .. "src/mess/drivers/kc.c", + MAME_DIR .. "src/mess/machine/kc.c", + MAME_DIR .. "src/mess/machine/kc_keyb.c", + MAME_DIR .. "src/mess/video/kc.c", + MAME_DIR .. "src/mess/drivers/lc80.c", + MAME_DIR .. "src/mess/drivers/mc80.c", + MAME_DIR .. "src/mess/machine/mc80.c", + MAME_DIR .. "src/mess/video/mc80.c", + MAME_DIR .. "src/mess/drivers/poly880.c", + MAME_DIR .. "src/mess/drivers/sc1.c", + MAME_DIR .. "src/mess/drivers/sc2.c", +} + +createMESSProjects(_target, _subtarget, "vidbrain") +files { + MAME_DIR .. "src/mess/drivers/vidbrain.c", + MAME_DIR .. "src/mess/video/uv201.c", +} + +createMESSProjects(_target, _subtarget, "videoton") +files { + MAME_DIR .. "src/mess/drivers/tvc.c", + MAME_DIR .. "src/mess/audio/tvc_snd.c", +} + +createMESSProjects(_target, _subtarget, "visual") +files { + MAME_DIR .. "src/mess/drivers/v1050.c", + MAME_DIR .. "src/mess/machine/v1050kb.c", + MAME_DIR .. "src/mess/video/v1050.c", +} + +createMESSProjects(_target, _subtarget, "votrax") +files { + MAME_DIR .. "src/mess/drivers/votrpss.c", + MAME_DIR .. "src/mess/drivers/votrtnt.c", +} + +createMESSProjects(_target, _subtarget, "vtech") +files { + MAME_DIR .. "src/mess/drivers/crvision.c", + MAME_DIR .. "src/mess/drivers/geniusiq.c", + MAME_DIR .. "src/mess/drivers/laser3k.c", + MAME_DIR .. "src/mess/drivers/lcmate2.c", + MAME_DIR .. "src/mess/drivers/pc4.c", + MAME_DIR .. "src/mess/video/pc4.c", + MAME_DIR .. "src/mess/drivers/pc2000.c", + MAME_DIR .. "src/mess/drivers/pitagjr.c", + MAME_DIR .. "src/mess/drivers/prestige.c", + MAME_DIR .. "src/mess/drivers/vtech1.c", + MAME_DIR .. "src/mess/drivers/vtech2.c", + MAME_DIR .. "src/mess/machine/vtech2.c", + MAME_DIR .. "src/mess/video/vtech2.c", + MAME_DIR .. "src/mess/drivers/socrates.c", + MAME_DIR .. "src/mess/audio/socrates.c", +} + +createMESSProjects(_target, _subtarget, "wang") +files { + MAME_DIR .. "src/mess/drivers/wangpc.c", + MAME_DIR .. "src/mess/machine/wangpckb.c", +} + +createMESSProjects(_target, _subtarget, "wavemate") +files { + MAME_DIR .. "src/mess/drivers/bullet.c", + MAME_DIR .. "src/mess/drivers/jupiter.c", +} + +createMESSProjects(_target, _subtarget, "xerox") +files { + MAME_DIR .. "src/mess/drivers/xerox820.c", + MAME_DIR .. "src/mess/machine/x820kb.c", + MAME_DIR .. "src/mess/drivers/bigbord2.c", + MAME_DIR .. "src/mess/drivers/alto2.c", +} + +createMESSProjects(_target, _subtarget, "xussrpc") +files { + MAME_DIR .. "src/mess/drivers/ec184x.c", + MAME_DIR .. "src/mess/drivers/iskr103x.c", + MAME_DIR .. "src/mess/drivers/mc1502.c", + MAME_DIR .. "src/mess/drivers/poisk1.c", + MAME_DIR .. "src/mess/video/poisk1.c", +} + +createMESSProjects(_target, _subtarget, "yamaha") +files { + MAME_DIR .. "src/mess/drivers/ymmu100.c", + MAME_DIR .. "src/mess/drivers/fb01.c", +} + +createMESSProjects(_target, _subtarget, "zenith") +files { + MAME_DIR .. "src/mess/drivers/z100.c", +} + +createMESSProjects(_target, _subtarget, "zpa") +files { + MAME_DIR .. "src/mess/drivers/iq151.c", +} + +createMESSProjects(_target, _subtarget, "zvt") +files { + MAME_DIR .. "src/mess/drivers/pp01.c", + MAME_DIR .. "src/mess/machine/pp01.c", + MAME_DIR .. "src/mess/video/pp01.c", +} + +createMESSProjects(_target, _subtarget, "skeleton") +files { + MAME_DIR .. "src/mess/drivers/alphasma.c", + MAME_DIR .. "src/mess/drivers/ampro.c", + MAME_DIR .. "src/mess/drivers/amust.c", + MAME_DIR .. "src/mess/drivers/applix.c", + MAME_DIR .. "src/mess/drivers/attache.c", + MAME_DIR .. "src/mess/drivers/ax20.c", + MAME_DIR .. "src/mess/drivers/beehive.c", + MAME_DIR .. "src/mess/drivers/binbug.c", + MAME_DIR .. "src/mess/drivers/besta.c", + MAME_DIR .. "src/mess/drivers/bitgraph.c", + MAME_DIR .. "src/mess/drivers/br8641.c", + MAME_DIR .. "src/mess/drivers/busicom.c", + MAME_DIR .. "src/mess/video/busicom.c", + MAME_DIR .. "src/mess/drivers/chaos.c", + MAME_DIR .. "src/mess/drivers/chesstrv.c", + MAME_DIR .. "src/mess/drivers/cd2650.c", + MAME_DIR .. "src/mess/drivers/cdc721.c", + MAME_DIR .. "src/mess/drivers/codata.c", + MAME_DIR .. "src/mess/drivers/cortex.c", + MAME_DIR .. "src/mess/drivers/cosmicos.c", + MAME_DIR .. "src/mess/drivers/cp1.c", + MAME_DIR .. "src/mess/drivers/cxhumax.c", + MAME_DIR .. "src/mess/drivers/czk80.c", + MAME_DIR .. "src/mess/drivers/d6800.c", + MAME_DIR .. "src/mess/drivers/d6809.c", + MAME_DIR .. "src/mess/drivers/digel804.c", + MAME_DIR .. "src/mess/drivers/dim68k.c", + MAME_DIR .. "src/mess/drivers/dm7000.c", + MAME_DIR .. "src/mess/drivers/dmv.c", + MAME_DIR .. "src/mess/machine/dmv_keyb.c", + MAME_DIR .. "src/mess/drivers/dps1.c", + MAME_DIR .. "src/mess/drivers/dsb46.c", + MAME_DIR .. "src/mess/drivers/dual68.c", + MAME_DIR .. "src/mess/drivers/eacc.c", + MAME_DIR .. "src/mess/drivers/elwro800.c", + MAME_DIR .. "src/mess/drivers/eti660.c", + MAME_DIR .. "src/mess/drivers/excali64.c", + MAME_DIR .. "src/mess/drivers/fanucs15.c", + MAME_DIR .. "src/mess/drivers/fanucspmg.c", + MAME_DIR .. "src/mess/drivers/fc100.c", + MAME_DIR .. "src/mess/drivers/fk1.c", + MAME_DIR .. "src/mess/drivers/ft68m.c", + MAME_DIR .. "src/mess/drivers/gamate.c", + MAME_DIR .. "src/mess/audio/gamate.c", + MAME_DIR .. "src/mess/drivers/gameking.c", + MAME_DIR .. "src/mess/drivers/gimix.c", + MAME_DIR .. "src/mess/drivers/grfd2301.c", + MAME_DIR .. "src/mess/drivers/harriet.c", + MAME_DIR .. "src/mess/drivers/hprot1.c", + MAME_DIR .. "src/mess/drivers/hpz80unk.c", + MAME_DIR .. "src/mess/drivers/ht68k.c", + MAME_DIR .. "src/mess/drivers/hunter2.c", + MAME_DIR .. "src/emu/machine/nsc810.c", + MAME_DIR .. "src/mess/drivers/ibm6580.c", + MAME_DIR .. "src/mess/drivers/ie15.c", + MAME_DIR .. "src/mess/machine/ie15_kbd.c", + MAME_DIR .. "src/mess/drivers/if800.c", + MAME_DIR .. "src/mess/drivers/imsai.c", + MAME_DIR .. "src/mess/drivers/indiana.c", + MAME_DIR .. "src/mess/drivers/itt3030.c", + MAME_DIR .. "src/mess/drivers/jade.c", + MAME_DIR .. "src/mess/drivers/jonos.c", + MAME_DIR .. "src/mess/drivers/konin.c", + MAME_DIR .. "src/mess/drivers/leapster.c", + MAME_DIR .. "src/mess/drivers/lft.c", + MAME_DIR .. "src/mess/drivers/lola8a.c", + MAME_DIR .. "src/mess/drivers/m79152pc.c", + MAME_DIR .. "src/mess/drivers/mccpm.c", + MAME_DIR .. "src/mess/drivers/mes.c", + MAME_DIR .. "src/mess/drivers/mice.c", + MAME_DIR .. "src/mess/drivers/micronic.c", + MAME_DIR .. "src/mess/drivers/mini2440.c", + MAME_DIR .. "src/mess/drivers/mmd1.c", + MAME_DIR .. "src/mess/drivers/mod8.c", + MAME_DIR .. "src/mess/drivers/modellot.c", + MAME_DIR .. "src/mess/drivers/molecular.c", + MAME_DIR .. "src/mess/drivers/ms0515.c", + MAME_DIR .. "src/mess/drivers/ms9540.c", + MAME_DIR .. "src/mess/drivers/mstation.c", + MAME_DIR .. "src/mess/drivers/mx2178.c", + MAME_DIR .. "src/mess/drivers/mycom.c", + MAME_DIR .. "src/mess/drivers/myvision.c", + MAME_DIR .. "src/mess/drivers/ngen.c", + MAME_DIR .. "src/mess/machine/ngen_kb.c", + MAME_DIR .. "src/mess/drivers/octopus.c", + MAME_DIR .. "src/mess/drivers/onyx.c", + MAME_DIR .. "src/mess/drivers/okean240.c", + MAME_DIR .. "src/mess/drivers/p8k.c", + MAME_DIR .. "src/mess/drivers/pegasus.c", + MAME_DIR .. "src/mess/drivers/pencil2.c", + MAME_DIR .. "src/mess/drivers/pes.c", + MAME_DIR .. "src/mess/drivers/pipbug.c", + MAME_DIR .. "src/mess/drivers/plan80.c", + MAME_DIR .. "src/mess/drivers/pm68k.c", + MAME_DIR .. "src/mess/drivers/poly.c", + MAME_DIR .. "src/mess/drivers/pt68k4.c", + MAME_DIR .. "src/mess/drivers/ptcsol.c", + MAME_DIR .. "src/mess/drivers/pulsar.c", + MAME_DIR .. "src/mess/drivers/pv9234.c", + MAME_DIR .. "src/mess/drivers/qtsbc.c", + MAME_DIR .. "src/mess/drivers/rvoice.c", + MAME_DIR .. "src/mess/drivers/sacstate.c", + MAME_DIR .. "src/mess/drivers/sbrain.c", + MAME_DIR .. "src/mess/drivers/seattle.c", + MAME_DIR .. "src/mess/drivers/sh4robot.c", + MAME_DIR .. "src/mess/drivers/softbox.c", + MAME_DIR .. "src/mess/drivers/swtpc.c", + MAME_DIR .. "src/mess/drivers/sys2900.c", + MAME_DIR .. "src/mess/drivers/systec.c", + MAME_DIR .. "src/mess/drivers/tavernie.c", + MAME_DIR .. "src/mess/drivers/tecnbras.c", + MAME_DIR .. "src/mess/drivers/terak.c", + MAME_DIR .. "src/mess/drivers/ti630.c", + MAME_DIR .. "src/mess/drivers/tsispch.c", + MAME_DIR .. "src/mess/drivers/unistar.c", + MAME_DIR .. "src/mess/drivers/v6809.c", + MAME_DIR .. "src/mess/drivers/vector4.c", + MAME_DIR .. "src/mess/drivers/vii.c", + MAME_DIR .. "src/mess/drivers/wicat.c", + MAME_DIR .. "src/mess/drivers/xor100.c", + MAME_DIR .. "src/mess/drivers/xavix.c", + MAME_DIR .. "src/mess/drivers/zorba.c", +} + +end diff --git a/scripts/target/mess/tiny.lua b/scripts/target/mess/tiny.lua new file mode 100644 index 00000000000..8db43cbec27 --- /dev/null +++ b/scripts/target/mess/tiny.lua @@ -0,0 +1,41 @@ +CPUS["Z80"] = true + +SOUNDS["SN76496"] = true + +VIDEOS["TMS9928A"] = true + +BUSES["COLECO"] = true + +function createProjects_mess_tiny(_target, _subtarget) + project ("mess_tiny") + targetsubdir(_target .."_" .. _subtarget) + kind "StaticLib" + uuid (os.uuid("drv-mess-tiny")) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mess", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "mess/layout", + } + + includeosd() + + files{ + MAME_DIR .. "src/mess/drivers/coleco.c", + MAME_DIR .. "src/mess/machine/coleco.c", + } +end + +function linkProjects_mess_tiny(_target, _subtarget) + links { + "mess_tiny", + } +end
\ No newline at end of file diff --git a/scripts/target/ume/tiny.lua b/scripts/target/ume/tiny.lua new file mode 100644 index 00000000000..98b12bf7ffd --- /dev/null +++ b/scripts/target/ume/tiny.lua @@ -0,0 +1,12 @@ +dofile("../mess/tiny.lua") +dofile("../mame/tiny.lua") + +function createProjects_ume_tiny(_target, _subtarget) + createProjects_mess_tiny(_target, _subtarget) + createProjects_mame_tiny(_target, _subtarget) +end + +function linkProjects_ume_tiny(_target, _subtarget) + linkProjects_mess_tiny(_target, _subtarget) + linkProjects_mame_tiny(_target, _subtarget) +end
\ No newline at end of file diff --git a/scripts/target/ume/ume.lua b/scripts/target/ume/ume.lua new file mode 100644 index 00000000000..27b770634e8 --- /dev/null +++ b/scripts/target/ume/ume.lua @@ -0,0 +1,20 @@ +--------------------------------------------------------------------------- +-- +-- ume.lua +-- +-- Universal target makefile +-- +--------------------------------------------------------------------------- + +dofile("../mess/mess.lua") +dofile("../mame/mame.lua") + +function createProjects_ume_ume(_target, _subtarget) + createProjects_mess_mess(_target, _subtarget) + createProjects_mame_mame(_target, _subtarget) +end + +function linkProjects_ume_ume(_target, _subtarget) + linkProjects_mess_mess(_target, _subtarget) + linkProjects_mame_mame(_target, _subtarget) +end
\ No newline at end of file diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua new file mode 100644 index 00000000000..f96c2982633 --- /dev/null +++ b/scripts/toolchain.lua @@ -0,0 +1,720 @@ +-- +-- Copyright 2010-2015 Branimir Karadzic. All rights reserved. +-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause +-- + +local naclToolchain = "" + +newoption { + trigger = "gcc", + value = "GCC", + description = "Choose GCC flavor", + allowed = { + { "android-arm", "Android - ARM" }, + { "android-mips", "Android - MIPS" }, + { "android-x86", "Android - x86" }, + { "asmjs", "Emscripten/asm.js" }, + { "freebsd", "FreeBSD" }, + { "linux-gcc", "Linux (GCC compiler)" }, + { "linux-clang", "Linux (Clang compiler)" }, + { "ios-arm", "iOS - ARM" }, + { "ios-simulator", "iOS - Simulator" }, + { "mingw32-gcc", "MinGW32" }, + { "mingw64-gcc", "MinGW64" }, + { "mingw-clang", "MinGW (clang compiler)" }, + { "nacl", "Native Client" }, + { "nacl-arm", "Native Client - ARM" }, + { "osx", "OSX (GCC compiler)" }, + { "osx-clang", "OSX (Clang compiler)" }, + { "pnacl", "Native Client - PNaCl" }, + { "qnx-arm", "QNX/Blackberry - ARM" }, + { "rpi", "RaspberryPi" }, + }, +} + +newoption { + trigger = "vs", + value = "toolset", + description = "Choose VS toolset", + allowed = { + { "intel-14", "Intel C++ Compiler XE 14.0" }, + { "intel-15", "Intel C++ Compiler XE 15.0" }, + { "vs2012-clang", "Clang 3.6" }, + { "vs2013-clang", "Clang 3.6" }, + { "vs2012-xp", "Visual Studio 2012 targeting XP" }, + { "vs2013-xp", "Visual Studio 2013 targeting XP" }, + { "winphone8", "Windows Phone 8.0" }, + { "winphone81", "Windows Phone 8.1" }, + }, +} + +newoption { + trigger = "with-android", + value = "#", + description = "Set Android platform version (default: android-14).", +} + +newoption { + trigger = "with-ios", + value = "#", + description = "Set iOS target version (default: 8.0).", +} + +function toolchain(_buildDir, _subDir) + + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION) + + local androidPlatform = "android-14" + if _OPTIONS["with-android"] then + androidPlatform = "android-" .. _OPTIONS["with-android"] + end + + local iosPlatform = "" + if _OPTIONS["with-ios"] then + iosPlatform = _OPTIONS["with-ios"] + end + + if _ACTION == "gmake" then + + if nil == _OPTIONS["gcc"] or nil == _OPTIONS["gcc_version"] then + print("GCC flavor and version must be specified!") + os.exit(1) + end + + if "android-arm" == _OPTIONS["gcc"] then + + if not os.getenv("ANDROID_NDK_ARM") or not os.getenv("ANDROID_NDK_ROOT") then + print("Set ANDROID_NDK_ARM and ANDROID_NDK_ROOT envrionment variables.") + end + + premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc" + premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++" + premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-arm") + end + + if "android-mips" == _OPTIONS["gcc"] then + + if not os.getenv("ANDROID_NDK_MIPS") or not os.getenv("ANDROID_NDK_ROOT") then + print("Set ANDROID_NDK_MIPS and ANDROID_NDK_ROOT envrionment variables.") + end + + premake.gcc.cc = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-gcc" + premake.gcc.cxx = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-g++" + premake.gcc.ar = "$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-mips") + end + + if "android-x86" == _OPTIONS["gcc"] then + + if not os.getenv("ANDROID_NDK_X86") or not os.getenv("ANDROID_NDK_ROOT") then + print("Set ANDROID_NDK_X86 and ANDROID_NDK_ROOT envrionment variables.") + end + + premake.gcc.cc = "$(ANDROID_NDK_X86)/bin/i686-linux-android-gcc" + premake.gcc.cxx = "$(ANDROID_NDK_X86)/bin/i686-linux-android-g++" + premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-android-x86") + end + + if "asmjs" == _OPTIONS["gcc"] then + + if not os.getenv("EMSCRIPTEN") then + print("Set EMSCRIPTEN enviroment variables.") + end + + premake.gcc.cc = "$(EMSCRIPTEN)/emcc" + premake.gcc.cxx = "$(EMSCRIPTEN)/em++" + premake.gcc.ar = "$(EMSCRIPTEN)/emar" + premake.gcc.llvm = true + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-asmjs") + end + + if "freebsd" == _OPTIONS["gcc"] then + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-freebsd") + end + + if "ios-arm" == _OPTIONS["gcc"] then + premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" + premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" + premake.gcc.ar = "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ios-arm") + end + + if "ios-simulator" == _OPTIONS["gcc"] then + premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" + premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" + premake.gcc.ar = "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ios-simulator") + end + + if "linux-gcc" == _OPTIONS["gcc"] then + -- Force gcc-4.2 on ubuntu-intrepid + if _OPTIONS["distro"]=="ubuntu-intrepid" then + premake.gcc.cc = "@gcc -V 4.2" + premake.gcc.cxx = "@g++-4.2" + end + premake.gcc.ar = "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-linux") + end + + if "linux-clang" == _OPTIONS["gcc"] then + premake.gcc.cc = "clang" + premake.gcc.cxx = "clang++" + premake.gcc.ar = "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-linux-clang") + end + + if "mingw32-gcc" == _OPTIONS["gcc"] then + if not os.getenv("MINGW32") or not os.getenv("MINGW32") then + print("Set MINGW32 envrionment variable.") + end + premake.gcc.cc = "$(MINGW32)/bin/i686-w64-mingw32-gcc" + premake.gcc.cxx = "$(MINGW32)/bin/i686-w64-mingw32-g++" + premake.gcc.ar = "$(MINGW32)/bin/ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw32-gcc") + end + + if "mingw64-gcc" == _OPTIONS["gcc"] then + if not os.getenv("MINGW64") or not os.getenv("MINGW64") then + print("Set MINGW64 envrionment variable.") + end + premake.gcc.cc = "$(MINGW64)/bin/x86_64-w64-mingw32-gcc" + premake.gcc.cxx = "$(MINGW64)/bin/x86_64-w64-mingw32-g++" + premake.gcc.ar = "$(MINGW64)/bin/ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc") + end + + + if "mingw-clang" == _OPTIONS["gcc"] then + premake.gcc.cc = "$(CLANG)/bin/clang" + premake.gcc.cxx = "$(CLANG)/bin/clang++" + premake.gcc.ar = "$(CLANG)/bin/llvm-ar" + premake.gcc.llvm = true + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw-clang") + end + + if "nacl" == _OPTIONS["gcc"] then + + if not os.getenv("NACL_SDK_ROOT") then + print("Set NACL_SDK_ROOT enviroment variables.") + end + + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_x86_newlib/bin/x86_64-nacl-" + if os.is("macosx") then + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_x86_newlib/bin/x86_64-nacl-" + elseif os.is("linux") then + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_x86_newlib/bin/x86_64-nacl-" + end + + premake.gcc.cc = naclToolchain .. "gcc" + premake.gcc.cxx = naclToolchain .. "g++" + premake.gcc.ar = naclToolchain .. "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-nacl") + end + + if "nacl-arm" == _OPTIONS["gcc"] then + + if not os.getenv("NACL_SDK_ROOT") then + print("Set NACL_SDK_ROOT enviroment variables.") + end + + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_arm_newlib/bin/arm-nacl-" + if os.is("macosx") then + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_arm_newlib/bin/arm-nacl-" + elseif os.is("linux") then + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_arm_newlib/bin/arm-nacl-" + end + + premake.gcc.cc = naclToolchain .. "gcc" + premake.gcc.cxx = naclToolchain .. "g++" + premake.gcc.ar = naclToolchain .. "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-nacl-arm") + end + + if "osx" == _OPTIONS["gcc"] then + if os.is("linux") then + local osxToolchain = "x86_64-apple-darwin13-" + premake.gcc.cc = osxToolchain .. "clang" + premake.gcc.cxx = osxToolchain .. "clang++" + premake.gcc.ar = osxToolchain .. "ar" + end + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx") + end + + if "osx-clang" == _OPTIONS["gcc"] then + premake.gcc.cc = "clang" + premake.gcc.cxx = "clang++" + premake.gcc.ar = "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") + end + + if "pnacl" == _OPTIONS["gcc"] then + + if not os.getenv("NACL_SDK_ROOT") then + print("Set NACL_SDK_ROOT enviroment variables.") + end + + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_pnacl/bin/pnacl-" + if os.is("macosx") then + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_pnacl/bin/pnacl-" + elseif os.is("linux") then + naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_pnacl/bin/pnacl-" + end + + premake.gcc.cc = naclToolchain .. "clang" + premake.gcc.cxx = naclToolchain .. "clang++" + premake.gcc.ar = naclToolchain .. "ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-pnacl") + end + + if "qnx-arm" == _OPTIONS["gcc"] then + + if not os.getenv("QNX_HOST") then + print("Set QNX_HOST enviroment variables.") + end + + premake.gcc.cc = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc" + premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++" + premake.gcc.ar = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-qnx-arm") + end + + if "rpi" == _OPTIONS["gcc"] then + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") + end + elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then + + if (_ACTION .. "-clang") == _OPTIONS["vs"] then + premake.vstudio.toolset = ("LLVM-" .. _ACTION) + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-clang") + end + + if "winphone8" == _OPTIONS["vs"] then + premake.vstudio.toolset = "v110_wp80" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winphone8") + end + + if "winphone81" == _OPTIONS["vs"] then + premake.vstudio.toolset = "v120_wp81" + platforms { "ARM" } + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winphone81") + end + + if "intel-14" == _OPTIONS["vs"] then + premake.vstudio.toolset = "Intel C++ Compiler XE 14.0" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") + end + + if "intel-15" == _OPTIONS["vs"] then + premake.vstudio.toolset = "Intel C++ Compiler XE 15.0" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") + end + + if ("vs2012-xp") == _OPTIONS["vs"] then + premake.vstudio.toolset = ("v110_xp") + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-xp") + end + + if ("vs2013-xp") == _OPTIONS["vs"] then + premake.vstudio.toolset = ("v120_xp") + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-xp") + end + end + + if (_OPTIONS["CC"] ~= nil) then + premake.gcc.cc = _OPTIONS["CC"] + end + if (_OPTIONS["CXX"] ~= nil) then + premake.gcc.cxx = _OPTIONS["CXX"] + end + if (_OPTIONS["LD"] ~= nil) then + premake.gcc.ld = _OPTIONS["LD"] + end + + configuration {} -- reset configuration + + + configuration { "x32", "vs*" } + targetdir (_buildDir .. "win32_" .. _ACTION .. "/bin") + objdir (_buildDir .. "win32_" .. _ACTION .. "/obj") + + configuration { "x64", "vs*" } + defines { "_WIN64" } + targetdir (_buildDir .. "win64_" .. _ACTION .. "/bin") + objdir (_buildDir .. "win64_" .. _ACTION .. "/obj") + + configuration { "ARM", "vs*" } + targetdir (_buildDir .. "arm_" .. _ACTION .. "/bin") + objdir (_buildDir .. "arm_" .. _ACTION .. "/obj") + + configuration { "x32", "vs*-clang" } + targetdir (_buildDir .. "win32_" .. _ACTION .. "-clang/bin") + objdir (_buildDir .. "win32_" .. _ACTION .. "-clang/obj") + + configuration { "x64", "vs*-clang" } + targetdir (_buildDir .. "win64_" .. _ACTION .. "-clang/bin") + objdir (_buildDir .. "win64_" .. _ACTION .. "-clang/obj") + + configuration { "mingw*" } + defines { "WIN32" } + + configuration { "x32", "mingw32-gcc" } + targetdir (_buildDir .. "win32_mingw-gcc" .. "/bin") + objdir (_buildDir .. "win32_mingw-gcc" .. "/obj") + buildoptions { "-m32" } + + configuration { "x64", "mingw64-gcc" } + targetdir (_buildDir .. "win64_mingw-gcc" .. "/bin") + objdir (_buildDir .. "win64_mingw-gcc" .. "/obj") + buildoptions { "-m64" } + + configuration { "mingw-clang" } + linkoptions { + "-Qunused-arguments", + "-Wno-error=unused-command-line-argument-hard-error-in-future", + } + + configuration { "x32", "mingw-clang" } + targetdir (_buildDir .. "win32_mingw-clang/bin") + objdir ( _buildDir .. "win32_mingw-clang/obj") + buildoptions { "-m32" } + buildoptions { + "-isystem$(MINGW32)/i686-w64-mingw32/include/c++", + "-isystem$(MINGW32)/i686-w64-mingw32/include/c++/i686-w64-mingw32", + "-isystem$(MINGW32)/i686-w64-mingw32/include", + } + + configuration { "x64", "mingw-clang" } + targetdir (_buildDir .. "win64_mingw-clang/bin") + objdir (_buildDir .. "win64_mingw-clang/obj") + buildoptions { "-m64" } + buildoptions { + "-isystem$(MINGW64)/x86_64-w64-mingw32/include/c++", + "-isystem$(MINGW64)/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32", + "-isystem$(MINGW64)/x86_64-w64-mingw32/include", + } + + configuration { "linux-gcc", "x32" } + targetdir (_buildDir .. "linux32_gcc" .. "/bin") + objdir (_buildDir .. "linux32_gcc" .. "/obj") + buildoptions { + "-m32", + } + + configuration { "linux-gcc", "x64" } + targetdir (_buildDir .. "linux64_gcc" .. "/bin") + objdir (_buildDir .. "linux64_gcc" .. "/obj") + buildoptions { + "-m64", + } + + configuration { "linux-clang", "x32" } + targetdir (_buildDir .. "linux32_clang" .. "/bin") + objdir (_buildDir .. "linux32_clang" .. "/obj") + buildoptions { + "-m32", + } + + configuration { "linux-clang", "x64" } + targetdir (_buildDir .. "linux64_clang" .. "/bin") + objdir (_buildDir .. "linux64_clang" .. "/obj") + buildoptions { + "-m64", + } + + configuration { "android-*" } + includedirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include", + "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue", + } + linkoptions { + "-nostdlib", + "-static-libgcc", + } + flags { + "NoImportLib", + } + links { + "c", + "dl", + "m", + "android", + "log", + "gnustl_static", + "gcc", + } + buildoptions { + "-fPIC", + "-no-canonical-prefixes", + "-Wa,--noexecstack", + "-fstack-protector", + "-ffunction-sections", + "-Wno-cast-align", + "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0 + "-Wunused-value", + "-Wundef", + } + linkoptions { + "-no-canonical-prefixes", + "-Wl,--no-undefined", + "-Wl,-z,noexecstack", + "-Wl,-z,relro", + "-Wl,-z,now", + } + + + configuration { "android-arm" } + targetdir (_buildDir .. "android-arm" .. "/bin") + objdir (_buildDir .. "android-arm" .. "/obj") + libdirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a", + } + includedirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include", + } + buildoptions { + "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm", + "-mthumb", + "-march=armv7-a", + "-mfloat-abi=softfp", + "-mfpu=neon", + "-Wunused-value", + "-Wundef", + } + linkoptions { + "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm", + "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm/usr/lib/crtbegin_so.o", + "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-arm/usr/lib/crtend_so.o", + "-march=armv7-a", + "-Wl,--fix-cortex-a8", + } + + configuration { "android-mips" } + targetdir (_buildDir .. "android-mips" .. "/bin") + objdir (_buildDir .. "android-mips" .. "/obj") + libdirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips", + } + includedirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/mips/include", + } + buildoptions { + "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips", + "-Wunused-value", + "-Wundef", + } + linkoptions { + "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips", + "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips/usr/lib/crtbegin_so.o", + "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-mips/usr/lib/crtend_so.o", + } + + configuration { "android-x86" } + targetdir (_buildDir .. "android-x86" .. "/bin") + objdir (_buildDir .. "android-x86" .. "/obj") + libdirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86", + } + includedirs { + "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/include", + } + buildoptions { + "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86", + "-march=i686", + "-mtune=atom", + "-mstackrealign", + "-msse3", + "-mfpmath=sse", + "-Wunused-value", + "-Wundef", + } + linkoptions { + "--sysroot=$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86", + "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86/usr/lib/crtbegin_so.o", + "$(ANDROID_NDK_ROOT)/platforms/" .. androidPlatform .. "/arch-x86/usr/lib/crtend_so.o", + } + + + configuration { "asmjs" } + targetdir (_buildDir .. "asmjs" .. "/bin") + objdir (_buildDir .. "asmjs" .. "/obj") + buildoptions { + "-isystem$(EMSCRIPTEN)/system/include", + "-isystem$(EMSCRIPTEN)/system/include/compat", + "-isystem$(EMSCRIPTEN)/system/include/libc", + "-Wno-cast-align", + "-Wno-tautological-compare", + "-Wno-self-assign-field", + "-Wno-format-security", + "-Wno-inline-new-delete", + "-Wno-constant-logical-operand", + "-Wno-absolute-value", + "-Wno-unknown-warning-option", + "-Wno-extern-c-compat", + } + + configuration { "freebsd" } + targetdir (_buildDir .. "freebsd" .. "/bin") + objdir (_buildDir .. "freebsd" .. "/obj") + + configuration { "nacl or nacl-arm or pnacl" } + buildoptions { + "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,... + "-fno-stack-protector", + "-fdiagnostics-show-option", + "-fdata-sections", + "-ffunction-sections", + "-Wunused-value", + } + configuration { "nacl or nacl-arm" } + includedirs { + "$(NACL_SDK_ROOT)/include", + "$(NACL_SDK_ROOT)/include/newlib", + } + + configuration { "pnacl" } + buildoptions { + "-Wno-tautological-undefined-compare", + "-Wno-cast-align", + } + includedirs { + "$(NACL_SDK_ROOT)/include", + "$(NACL_SDK_ROOT)/include/pnacl", + } + + configuration { "x32", "nacl" } + targetdir (_buildDir .. "nacl-x86" .. "/bin") + objdir (_buildDir .. "nacl-x86" .. "/obj") + + configuration { "x32", "nacl", "Debug" } + libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Debug" } + + configuration { "x32", "nacl", "Release" } + libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_32/Release" } + + configuration { "x64", "nacl" } + targetdir (_buildDir .. "nacl-x64" .. "/bin") + objdir (_buildDir .. "nacl-x64" .. "/obj") + + configuration { "x64", "nacl", "Debug" } + libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_64/Debug" } + + configuration { "x64", "nacl", "Release" } + libdirs { "$(NACL_SDK_ROOT)/lib/newlib_x86_64/Release" } + + configuration { "nacl-arm" } + targetdir (_buildDir .. "nacl-arm" .. "/bin") + objdir (_buildDir .. "nacl-arm" .. "/obj") + + configuration { "nacl-arm", "Debug" } + libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Debug" } + + configuration { "nacl-arm", "Release" } + libdirs { "$(NACL_SDK_ROOT)/lib/newlib_arm/Release" } + + configuration { "pnacl" } + targetdir (_buildDir .. "pnacl" .. "/bin") + objdir (_buildDir .. "pnacl" .. "/obj") + + configuration { "pnacl", "Debug" } + libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" } + + configuration { "pnacl", "Release" } + libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" } + + configuration { "osx*", "x32" } + targetdir (_buildDir .. "osx32_clang" .. "/bin") + objdir (_buildDir .. "osx32_clang" .. "/obj") + buildoptions { + "-m32", + } + + configuration { "osx*", "x64" } + targetdir (_buildDir .. "osx64_clang" .. "/bin") + objdir (_buildDir .. "osx64_clang" .. "/obj") + buildoptions { + "-m64", + } + + configuration { "ios-arm" } + targetdir (_buildDir .. "ios-arm" .. "/bin") + objdir (_buildDir .. "ios-arm" .. "/obj") + + configuration { "ios-simulator" } + targetdir (_buildDir .. "ios-simulator" .. "/bin") + objdir (_buildDir .. "ios-simulator" .. "/obj") + + configuration { "qnx-arm" } + targetdir (_buildDir .. "qnx-arm" .. "/bin") + objdir (_buildDir .. "qnx-arm" .. "/obj") + + configuration { "rpi" } + targetdir (_buildDir .. "rpi" .. "/bin") + objdir (_buildDir .. "rpi" .. "/obj") + + configuration {} -- reset configuration + + return true +end + +function strip() + + configuration { "android-arm", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\"" + } + + configuration { "android-mips", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\"" + } + + configuration { "android-x86", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\"" + } + + configuration { "linux-* or rpi", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) strip -s \"$(TARGET)\"" + } + + configuration { "mingw*", "x64", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(MINGW64)/bin/strip -s \"$(TARGET)\"", + } + + configuration { "mingw*", "x32", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) $(MINGW32)/bin/strip -s \"$(TARGET)\"" + } + + configuration { "pnacl" } + postbuildcommands { + "$(SILENT) echo Running pnacl-finalize.", + "$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\"" + } + + configuration { "*nacl*", "Release" } + postbuildcommands { + "$(SILENT) echo Stripping symbols.", + "$(SILENT) " .. naclToolchain .. "strip -s \"$(TARGET)\"" + } + + configuration { "asmjs" } + postbuildcommands { + "$(SILENT) echo Running asmjs finalize.", + "$(SILENT) $(EMSCRIPTEN)/emcc -O2 -s TOTAL_MEMORY=268435456 \"$(TARGET)\" -o \"$(TARGET)\".html" + -- ALLOW_MEMORY_GROWTH + } + + configuration {} -- reset configuration +end + diff --git a/src/build/build.mak b/src/build/build.mak deleted file mode 100644 index e13a8be66d6..00000000000 --- a/src/build/build.mak +++ /dev/null @@ -1,84 +0,0 @@ -########################################################################### -# -# build.mak -# -# MAME build tools makefile -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - -OBJDIRS += \ - $(BUILDOBJ) \ - - - -#------------------------------------------------- -# set of build targets -#------------------------------------------------- - -MAKEDEP_TARGET = $(BUILDOUT)/makedep$(BUILD_EXE) -MAKEMAK_TARGET = $(BUILDOUT)/makemak$(BUILD_EXE) - -MAKEDEP = $(MAKEDEP_TARGET) -MAKEMAK = $(MAKEMAK_TARGET) - -ifneq ($(TERM),cygwin) -ifeq ($(OS),Windows_NT) -MAKEDEP = $(subst /,\,$(MAKEDEP_TARGET)) -MAKEMAK = $(subst /,\,$(MAKEMAK_TARGET)) -endif -endif - -ifneq ($(CROSS_BUILD),1) -BUILD += \ - $(MAKEDEP_TARGET) \ - $(MAKEMAK_TARGET) \ - - - -#------------------------------------------------- -# makedep -#------------------------------------------------- - -MAKEDEPOBJS = \ - $(BUILDOBJ)/makedep.o \ - $(OBJ)/lib/util/astring.o \ - $(OBJ)/lib/util/corealloc.o \ - $(OBJ)/lib/util/corefile.o \ - $(OBJ)/lib/util/unicode.o \ - $(OBJ)/lib/util/tagmap.o \ - -$(MAKEDEP_TARGET): $(MAKEDEPOBJS) $(LIBOCORE) $(ZLIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# makemak -#------------------------------------------------- - -MAKEMAKOBJS = \ - $(BUILDOBJ)/makemak.o \ - $(OBJ)/lib/util/astring.o \ - $(OBJ)/lib/util/corealloc.o \ - $(OBJ)/lib/util/corefile.o \ - $(OBJ)/lib/util/corestr.o \ - $(OBJ)/lib/util/unicode.o \ - $(OBJ)/lib/util/tagmap.o \ - -$(MAKEMAK_TARGET): $(MAKEMAKOBJS) $(LIBOCORE) $(ZLIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - -else -#------------------------------------------------- -# It's a CROSS_BUILD. Ensure the targets exist. -#------------------------------------------------- -$(MAKEDEP_TARGET): - @echo $@ should be built natively. Nothing to do. - -endif # CROSS_BUILD diff --git a/src/build/cc_detection.mak b/src/build/cc_detection.mak deleted file mode 100644 index ed7f486325c..00000000000 --- a/src/build/cc_detection.mak +++ /dev/null @@ -1,16 +0,0 @@ -ifneq (,$(findstring clang,$(CC))) - include $(SRC)/build/flags_clang.mak -else - ifneq (,$(findstring emcc,$(CC))) - # Emscripten compiler is based on clang - include $(SRC)/build/flags_clang.mak - else - TEST_GCC = $(shell gcc --version) - # is it Clang symlinked/renamed to GCC (Xcode 5.0 on OS X)? - ifeq ($(findstring clang,$(TEST_GCC)),clang) - include $(SRC)/build/flags_clang.mak - else - include $(SRC)/build/flags_gcc.mak - endif - endif -endif diff --git a/src/build/flags_clang.mak b/src/build/flags_clang.mak deleted file mode 100644 index bee1edebc19..00000000000 --- a/src/build/flags_clang.mak +++ /dev/null @@ -1,85 +0,0 @@ -CCOMFLAGS += \ - -Wno-cast-align \ - -Wno-tautological-compare - -# caused by obj/sdl64d/emu/cpu/tms57002/tms57002.inc -CCOMFLAGS += -Wno-self-assign-field - -# caused by popmessage(NULL) on older clang versions -#CCOMFLAGS += -Wno-format-security - -ifneq (,$(findstring undefined,$(SANITIZE))) -# TODO: check if linker is clang++ -# produces a lot of messages - disable it for now -CCOMFLAGS += -fno-sanitize=alignment -# these are false positives because of the way our delegates work -CCOMFLAGS += -fno-sanitize=function -endif - -ifneq (,$(findstring memory,$(SANITIZE))) -CCOMFLAGS += -fsanitize-memory-track-origins -fPIE -endif - -ifdef CPP11 -CCOMFLAGS += -Wno-deprecated-register -Wno-c++11-narrowing -endif - -# TODO: needs to use $(CC) -TEST_CLANG := $(shell clang --version) - -ifeq ($(findstring 3.4,$(TEST_CLANG)),3.4) -CCOMFLAGS += -Wno-inline-new-delete - -# caused by src/mame/video/jagblit.inc -CCOMFLAGS += -Wno-constant-logical-operand -endif - -ifeq ($(findstring 3.5,$(TEST_CLANG)),3.5) -CCOMFLAGS += -Wno-inline-new-delete - -# caused by src/mess/drivers/x07.c, src/osd/sdl/window.c, src/emu/sound/disc_mth.inc, src/mame/video/chihiro.c -CCOMFLAGS += -Wno-absolute-value - -# TODO: add proper detection of XCode 6.0.1 -# XCode 6.0.1 is built on a pre-release SVN version of clang 3.5, that doesn't support -Wno-absolute-value yet -CCOMFLAGS += -Wno-unknown-warning-option -# XCode 6.0.1 gives this when using SDL2 in /Library/Frameworks/SDL2.framework/Headers/SDL_syswm.h:150 included from src/osd/sdl/sdlinc.h -CCOMFLAGS += -Wno-extern-c-compat - -ifneq (,$(findstring undefined,$(SANITIZE))) -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=shift -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=object-size -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=vptr -# clang takes forever to compile src/emu/video/psx.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=null -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=signed-integer-overflow -endif -endif - -ifeq ($(findstring 3.6,$(TEST_CLANG)),3.6) -CCOMFLAGS += -Wno-inline-new-delete - -# caused by src/mess/drivers/x07.c, src/osd/sdl/window.c, src/emu/sound/disc_mth.inc, src/mame/video/chihiro.c -CCOMFLAGS += -Wno-absolute-value - -ifneq (,$(findstring undefined,$(SANITIZE))) -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=shift -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=object-size -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=vptr -# clang takes forever to compile src/emu/video/psx.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=null -# clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled -CCOMFLAGS += -fno-sanitize=signed-integer-overflow -endif -endif - -ifeq ($(TARGETOS),emscripten) -CCOMFLAGS += -Qunused-arguments -endif diff --git a/src/build/flags_gcc.mak b/src/build/flags_gcc.mak deleted file mode 100644 index c529b7aa629..00000000000 --- a/src/build/flags_gcc.mak +++ /dev/null @@ -1,21 +0,0 @@ -# TODO: needs to use $(CC) -TEST_GCC := $(shell gcc --version) - -ifeq ($(findstring 4.7.,$(TEST_GCC)),4.7.) - CCOMFLAGS += -Wno-narrowing -Wno-attributes -endif - -ifeq ($(findstring 4.8.,$(TEST_GCC)),4.8.) - CCOMFLAGS += -Wno-narrowing -Wno-attributes - # array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds) - CCOMFLAGS += -Wno-unused-variable -Wno-array-bounds -endif - -ifeq ($(findstring 4.9.,$(TEST_GCC)),4.9.) - CCOMFLAGS += -Wno-narrowing -Wno-attributes - CCOMFLAGS += -Wno-array-bounds -endif - -ifeq ($(findstring arm,$(UNAME)),arm) - CCOMFLAGS += -Wno-cast-align -endif
\ No newline at end of file diff --git a/src/build/verinfo.py b/src/build/verinfo.py index 9841625858a..331992115b2 100644 --- a/src/build/verinfo.py +++ b/src/build/verinfo.py @@ -8,7 +8,7 @@ import sys def parse_args(): def usage(): - sys.stderr.write('Usage: verinfo.py [-b mame|mess|ume] [-r|-p] [-o <outfile>] <srcfile>\n') + sys.stderr.write('Usage: verinfo.py [-b mame|mess|ume|ldplayer] [-r|-p] [-o <outfile>] <srcfile>\n') sys.exit(1) flags = True @@ -24,7 +24,7 @@ def parse_args(): format = 'plist' elif flags and (sys.argv[i] == '-b'): i += 1 - if (i >= len(sys.argv)) or (sys.argv[i] not in ('mame', 'mess', 'ume')): + if (i >= len(sys.argv)) or (sys.argv[i] not in ('mame', 'mess', 'ume', 'ldplayer')): usage() else: target = sys.argv[i] @@ -108,10 +108,10 @@ else: comments = "Multiple Arcade Machine Emulator" company_name = "MAME Team" file_description = "Multiple Arcade Machine Emulator" - internal_name = "MAME" - original_filename = "MAME" - product_name = "MAME" - bundle_identifier = "org.mamedev.mame" + internal_name = "MAME" if build == "mame" else build + original_filename = "MAME" if build == "mame" else build + product_name = "MAME" if build == "mame" else build + bundle_identifier = "org.mamedev." + build legal_copyright = "Copyright Nicola Salmoria and the MAME team" diff --git a/src/emu/bus/a2bus/ezcgi.c b/src/emu/bus/a2bus/ezcgi.c index d7a9cf3d469..3c3a937b781 100644 --- a/src/emu/bus/a2bus/ezcgi.c +++ b/src/emu/bus/a2bus/ezcgi.c @@ -43,7 +43,7 @@ MACHINE_CONFIG_END #define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2 MACHINE_CONFIG_FRAGMENT( ezcgi9938 ) - MCFG_V9938_ADD(TMS_TAG, SCREEN_TAG, 0x30000) // 192K of VRAM + MCFG_V9938_ADD(TMS_TAG, SCREEN_TAG, 0x30000) // 192K of VRAM MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(a2bus_ezcgi_9938_device, tms_irq_w)) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) @@ -57,7 +57,7 @@ MACHINE_CONFIG_FRAGMENT( ezcgi9938 ) MACHINE_CONFIG_END MACHINE_CONFIG_FRAGMENT( ezcgi9958 ) - MCFG_V9958_ADD(TMS_TAG, SCREEN_TAG, 0x30000) // 192K of VRAM + MCFG_V9958_ADD(TMS_TAG, SCREEN_TAG, 0x30000) // 192K of VRAM MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(a2bus_ezcgi_9958_device, tms_irq_w)) MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) @@ -311,4 +311,3 @@ WRITE_LINE_MEMBER( a2bus_ezcgi_9958_device::tms_irq_w ) lower_slot_irq(); } } - diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak deleted file mode 100644 index 2f05a7cc60a..00000000000 --- a/src/emu/bus/bus.mak +++ /dev/null @@ -1,1584 +0,0 @@ -########################################################################### -# -# bus.mak -# -# Rules for building bus cores -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -BUSSRC = $(EMUSRC)/bus -BUSOBJ = $(EMUOBJ)/bus - - -#------------------------------------------------- -# -#@src/emu/bus/a7800/a78_slot.h,BUSES += A7800 -#------------------------------------------------- - -ifneq ($(filter A7800,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/a7800 -BUSOBJS += $(BUSOBJ)/a7800/a78_slot.o -BUSOBJS += $(BUSOBJ)/a7800/rom.o -BUSOBJS += $(BUSOBJ)/a7800/hiscore.o -BUSOBJS += $(BUSOBJ)/a7800/xboard.o -BUSOBJS += $(BUSOBJ)/a7800/cpuwiz.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/a800/a800_slot.h,BUSES += A800 -#------------------------------------------------- - -ifneq ($(filter A800,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/a800 -BUSOBJS += $(BUSOBJ)/a800/a800_slot.o -BUSOBJS += $(BUSOBJ)/a800/rom.o -BUSOBJS += $(BUSOBJ)/a800/oss.o -BUSOBJS += $(BUSOBJ)/a800/sparta.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/a8sio/a8sio.h,BUSES += A8SIO -#------------------------------------------------- - -ifneq ($(filter A8SIO,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/a8sio -BUSOBJS += $(BUSOBJ)/a8sio/a8sio.o -BUSOBJS += $(BUSOBJ)/a8sio/cassette.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/abcbus/abcbus.h,BUSES += ABCBUS -#------------------------------------------------- - -ifneq ($(filter ABCBUS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/abcbus -BUSOBJS += $(BUSOBJ)/abcbus/abcbus.o -BUSOBJS += $(BUSOBJ)/abcbus/abc890.o -BUSOBJS += $(BUSOBJ)/abcbus/dos.o -BUSOBJS += $(BUSOBJ)/abcbus/fd2.o -BUSOBJS += $(BUSOBJ)/abcbus/hdc.o -BUSOBJS += $(BUSOBJ)/abcbus/lux10828.o -BUSOBJS += $(BUSOBJ)/abcbus/lux21046.o -BUSOBJS += $(BUSOBJ)/abcbus/lux21056.o -BUSOBJS += $(BUSOBJ)/abcbus/lux4105.o -BUSOBJS += $(BUSOBJ)/abcbus/uni800.o -BUSOBJS += $(BUSOBJ)/abcbus/sio.o -BUSOBJS += $(BUSOBJ)/abcbus/slutprov.o -BUSOBJS += $(BUSOBJ)/abcbus/turbo.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/adam/exp.h,BUSES += ADAM -#------------------------------------------------- - -ifneq ($(filter ADAM,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/adam -BUSOBJS += $(BUSOBJ)/adam/exp.o -BUSOBJS += $(BUSOBJ)/adam/adamlink.o -BUSOBJS += $(BUSOBJ)/adam/ide.o -BUSOBJS += $(BUSOBJ)/adam/ram.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/adamnet/adamnet.h,BUSES += ADAMNET -#------------------------------------------------- - -ifneq ($(filter ADAMNET,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/adamnet -BUSOBJS += $(BUSOBJ)/adamnet/adamnet.o -BUSOBJS += $(BUSOBJ)/adamnet/ddp.o -BUSOBJS += $(BUSOBJ)/adamnet/fdc.o -BUSOBJS += $(BUSOBJ)/adamnet/kb.o -BUSOBJS += $(BUSOBJ)/adamnet/printer.o -BUSOBJS += $(BUSOBJ)/adamnet/spi.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/apf/slot.h,BUSES += APF -#------------------------------------------------- - -ifneq ($(filter APF,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/apf -BUSOBJS += $(BUSOBJ)/apf/slot.o -BUSOBJS += $(BUSOBJ)/apf/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/arcadia/slot.h,BUSES += ARCADIA -#------------------------------------------------- - -ifneq ($(filter ARCADIA,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/arcadia -BUSOBJS += $(BUSOBJ)/arcadia/slot.o -BUSOBJS += $(BUSOBJ)/arcadia/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/astrocde/slot.h,BUSES += ASTROCADE -#------------------------------------------------- - -ifneq ($(filter ASTROCADE,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/astrocde -BUSOBJS += $(BUSOBJ)/astrocde/slot.o -BUSOBJS += $(BUSOBJ)/astrocde/rom.o -BUSOBJS += $(BUSOBJ)/astrocde/exp.o -BUSOBJS += $(BUSOBJ)/astrocde/ram.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/bw2/exp.h,BUSES += BW2 -#------------------------------------------------- - -ifneq ($(filter BW2,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/bw2 -BUSOBJS += $(BUSOBJ)/bw2/exp.o -BUSOBJS += $(BUSOBJ)/bw2/ramcard.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/c64/exp.h,BUSES += C64 -#@src/emu/bus/c64/user.h,BUSES += C64 -#------------------------------------------------- - -ifneq ($(filter C64,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/c64 -BUSOBJS += $(BUSOBJ)/c64/exp.o -BUSOBJS += $(BUSOBJ)/c64/c128_comal80.o -BUSOBJS += $(BUSOBJ)/c64/comal80.o -BUSOBJS += $(BUSOBJ)/c64/cpm.o -BUSOBJS += $(BUSOBJ)/c64/currah_speech.o -BUSOBJS += $(BUSOBJ)/c64/dela_ep256.o -BUSOBJS += $(BUSOBJ)/c64/dela_ep64.o -BUSOBJS += $(BUSOBJ)/c64/dela_ep7x8.o -BUSOBJS += $(BUSOBJ)/c64/dinamic.o -BUSOBJS += $(BUSOBJ)/c64/dqbb.o -BUSOBJS += $(BUSOBJ)/c64/easy_calc_result.o -BUSOBJS += $(BUSOBJ)/c64/easyflash.o -BUSOBJS += $(BUSOBJ)/c64/epyx_fast_load.o -BUSOBJS += $(BUSOBJ)/c64/exos.o -BUSOBJS += $(BUSOBJ)/c64/fcc.o -BUSOBJS += $(BUSOBJ)/c64/final.o -BUSOBJS += $(BUSOBJ)/c64/final3.o -BUSOBJS += $(BUSOBJ)/c64/fun_play.o -BUSOBJS += $(BUSOBJ)/c64/georam.o -BUSOBJS += $(BUSOBJ)/c64/ide64.o -BUSOBJS += $(BUSOBJ)/c64/ieee488.o -BUSOBJS += $(BUSOBJ)/c64/kingsoft.o -BUSOBJS += $(BUSOBJ)/c64/mach5.o -BUSOBJS += $(BUSOBJ)/c64/magic_desk.o -BUSOBJS += $(BUSOBJ)/c64/magic_formel.o -BUSOBJS += $(BUSOBJ)/c64/magic_voice.o -BUSOBJS += $(BUSOBJ)/c64/midi_maplin.o -BUSOBJS += $(BUSOBJ)/c64/midi_namesoft.o -BUSOBJS += $(BUSOBJ)/c64/midi_passport.o -BUSOBJS += $(BUSOBJ)/c64/midi_sci.o -BUSOBJS += $(BUSOBJ)/c64/midi_siel.o -BUSOBJS += $(BUSOBJ)/c64/mikro_assembler.o -BUSOBJS += $(BUSOBJ)/c64/multiscreen.o -BUSOBJS += $(BUSOBJ)/c64/music64.o -BUSOBJS += $(BUSOBJ)/c64/neoram.o -BUSOBJS += $(BUSOBJ)/c64/ocean.o -BUSOBJS += $(BUSOBJ)/c64/pagefox.o -BUSOBJS += $(BUSOBJ)/c64/partner.o -BUSOBJS += $(BUSOBJ)/c64/prophet64.o -BUSOBJS += $(BUSOBJ)/c64/ps64.o -BUSOBJS += $(BUSOBJ)/c64/reu.o -BUSOBJS += $(BUSOBJ)/c64/rex.o -BUSOBJS += $(BUSOBJ)/c64/rex_ep256.o -BUSOBJS += $(BUSOBJ)/c64/ross.o -BUSOBJS += $(BUSOBJ)/c64/sfx_sound_expander.o -BUSOBJS += $(BUSOBJ)/c64/silverrock.o -BUSOBJS += $(BUSOBJ)/c64/simons_basic.o -BUSOBJS += $(BUSOBJ)/c64/stardos.o -BUSOBJS += $(BUSOBJ)/c64/std.o -BUSOBJS += $(BUSOBJ)/c64/structured_basic.o -BUSOBJS += $(BUSOBJ)/c64/super_explode.o -BUSOBJS += $(BUSOBJ)/c64/super_games.o -BUSOBJS += $(BUSOBJ)/c64/supercpu.o -BUSOBJS += $(BUSOBJ)/c64/sw8k.o -BUSOBJS += $(BUSOBJ)/c64/swiftlink.o -BUSOBJS += $(BUSOBJ)/c64/system3.o -BUSOBJS += $(BUSOBJ)/c64/tdos.o -BUSOBJS += $(BUSOBJ)/c64/turbo232.o -BUSOBJS += $(BUSOBJ)/c64/vizastar.o -BUSOBJS += $(BUSOBJ)/c64/vw64.o -BUSOBJS += $(BUSOBJ)/c64/warp_speed.o -BUSOBJS += $(BUSOBJ)/c64/westermann.o -BUSOBJS += $(BUSOBJ)/c64/xl80.o -BUSOBJS += $(BUSOBJ)/c64/zaxxon.o -BUSOBJS += $(BUSOBJ)/c64/user.o -BUSOBJS += $(BUSOBJ)/c64/4dxh.o -BUSOBJS += $(BUSOBJ)/c64/4ksa.o -BUSOBJS += $(BUSOBJ)/c64/4tba.o -BUSOBJS += $(BUSOBJ)/c64/16kb.o -BUSOBJS += $(BUSOBJ)/c64/bn1541.o -BUSOBJS += $(BUSOBJ)/c64/geocable.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/cbm2/exp.h,BUSES += CBM2 -#@src/emu/bus/cbm2/user.h,BUSES += CBM2 -#------------------------------------------------- - -ifneq ($(filter CBM2,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/cbm2 -BUSOBJS += $(BUSOBJ)/cbm2/exp.o -BUSOBJS += $(BUSOBJ)/cbm2/24k.o -BUSOBJS += $(BUSOBJ)/cbm2/hrg.o -BUSOBJS += $(BUSOBJ)/cbm2/std.o -BUSOBJS += $(BUSOBJ)/cbm2/user.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/cbmiec/cbmiec.h,BUSES += CBMIEC -#------------------------------------------------- - -ifneq ($(filter CBMIEC,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/cbmiec -BUSOBJS += $(BUSOBJ)/cbmiec/cbmiec.o -BUSOBJS += $(BUSOBJ)/cbmiec/c1541.o -BUSOBJS += $(BUSOBJ)/cbmiec/c1571.o -BUSOBJS += $(BUSOBJ)/cbmiec/c1581.o -BUSOBJS += $(BUSOBJ)/cbmiec/c64_nl10.o -BUSOBJS += $(BUSOBJ)/cbmiec/cmdhd.o -BUSOBJS += $(BUSOBJ)/cbmiec/diag264_lb_iec.o -BUSOBJS += $(BUSOBJ)/cbmiec/fd2000.o -BUSOBJS += $(BUSOBJ)/cbmiec/interpod.o -BUSOBJS += $(BUSOBJ)/cbmiec/serialbox.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/chanf/slot.h,BUSES += CHANNELF -#------------------------------------------------- - -ifneq ($(filter CHANNELF,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/chanf -BUSOBJS += $(BUSOBJ)/chanf/slot.o -BUSOBJS += $(BUSOBJ)/chanf/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/comx35/exp.h,BUSES += COMX35 -#------------------------------------------------- - -ifneq ($(filter COMX35,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/comx35 -BUSOBJS += $(BUSOBJ)/comx35/exp.o -BUSOBJS += $(BUSOBJ)/comx35/clm.o -BUSOBJS += $(BUSOBJ)/comx35/expbox.o -BUSOBJS += $(BUSOBJ)/comx35/eprom.o -BUSOBJS += $(BUSOBJ)/comx35/fdc.o -BUSOBJS += $(BUSOBJ)/comx35/joycard.o -BUSOBJS += $(BUSOBJ)/comx35/printer.o -BUSOBJS += $(BUSOBJ)/comx35/ram.o -BUSOBJS += $(BUSOBJ)/comx35/thermal.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/coleco/ctrl.h,BUSES += COLECO -#------------------------------------------------- - -ifneq ($(filter COLECO,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/coleco -BUSOBJS += $(BUSOBJ)/coleco/ctrl.o -BUSOBJS += $(BUSOBJ)/coleco/hand.o -BUSOBJS += $(BUSOBJ)/coleco/sac.o -BUSOBJS += $(BUSOBJ)/coleco/exp.o -BUSOBJS += $(BUSOBJ)/coleco/std.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/crvision/slot.h,BUSES += CRVISION -#------------------------------------------------- - -ifneq ($(filter CRVISION,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/crvision -BUSOBJS += $(BUSOBJ)/crvision/slot.o -BUSOBJS += $(BUSOBJ)/crvision/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/dmv/dmv.h,BUSES += DMV -#------------------------------------------------- - -ifneq ($(filter DMV,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/dmv -BUSOBJS += $(BUSOBJ)/dmv/dmvbus.o -BUSOBJS += $(BUSOBJ)/dmv/k210.o -BUSOBJS += $(BUSOBJ)/dmv/k220.o -BUSOBJS += $(BUSOBJ)/dmv/k230.o -BUSOBJS += $(BUSOBJ)/dmv/k233.o -BUSOBJS += $(BUSOBJ)/dmv/k801.o -BUSOBJS += $(BUSOBJ)/dmv/k803.o -BUSOBJS += $(BUSOBJ)/dmv/k806.o -BUSOBJS += $(BUSOBJ)/dmv/ram.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/ecbbus/ecbbus.h,BUSES += ECBBUS -#------------------------------------------------- - -ifneq ($(filter ECBBUS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/ecbbus -BUSOBJS += $(BUSOBJ)/ecbbus/ecbbus.o -BUSOBJS += $(BUSOBJ)/ecbbus/grip.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/econet/econet.h,BUSES += ECONET -#------------------------------------------------- - -ifneq ($(filter ECONET,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/econet -BUSOBJS += $(BUSOBJ)/econet/econet.o -BUSOBJS += $(BUSOBJ)/econet/e01.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/ep64/exp.h,BUSES += EP64 -#------------------------------------------------- - -ifneq ($(filter EP64,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/ep64 -BUSOBJS += $(BUSOBJ)/ep64/exp.o -BUSOBJS += $(BUSOBJ)/ep64/exdos.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/generic/slot.h,BUSES += GENERIC -#------------------------------------------------- - -ifneq ($(filter GENERIC,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/generic -BUSOBJS += $(BUSOBJ)/generic/slot.o -BUSOBJS += $(BUSOBJ)/generic/carts.o -BUSOBJS += $(BUSOBJ)/generic/ram.o -BUSOBJS += $(BUSOBJ)/generic/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/ieee488/ieee488.h,BUSES += IEEE488 -#------------------------------------------------- - -ifneq ($(filter IEEE488,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/ieee488 -BUSOBJS += $(BUSOBJ)/ieee488/ieee488.o -BUSOBJS += $(BUSOBJ)/ieee488/c2031.o -BUSOBJS += $(BUSOBJ)/ieee488/c2040.o -BUSOBJS += $(BUSOBJ)/ieee488/c2040fdc.o -BUSOBJS += $(BUSOBJ)/ieee488/c8050.o -BUSOBJS += $(BUSOBJ)/ieee488/c8050fdc.o -BUSOBJS += $(BUSOBJ)/ieee488/c8280.o -BUSOBJS += $(BUSOBJ)/ieee488/d9060.o -BUSOBJS += $(BUSOBJ)/ieee488/softbox.o -BUSOBJS += $(BUSOBJ)/ieee488/hardbox.o -BUSOBJS += $(BUSOBJ)/ieee488/shark.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/iq151/iq151.h,BUSES += IQ151 -#------------------------------------------------- - -ifneq ($(filter IQ151,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/iq151 -BUSOBJS += $(BUSOBJ)/iq151/iq151.o -BUSOBJS += $(BUSOBJ)/iq151/disc2.o -BUSOBJS += $(BUSOBJ)/iq151/grafik.o -BUSOBJS += $(BUSOBJ)/iq151/minigraf.o -BUSOBJS += $(BUSOBJ)/iq151/ms151a.o -BUSOBJS += $(BUSOBJ)/iq151/rom.o -BUSOBJS += $(BUSOBJ)/iq151/staper.o -BUSOBJS += $(BUSOBJ)/iq151/video32.o -BUSOBJS += $(BUSOBJ)/iq151/video64.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/isbx/isbx.h,BUSES += IMI7000 -#------------------------------------------------- - -ifneq ($(filter IMI7000,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/imi7000 -BUSOBJS += $(BUSOBJ)/imi7000/imi7000.o -BUSOBJS += $(BUSOBJ)/imi7000/imi5000h.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/intv/slot.h,BUSES += INTV -#------------------------------------------------- - -ifneq ($(filter INTV,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/intv -BUSOBJS += $(BUSOBJ)/intv/slot.o -BUSOBJS += $(BUSOBJ)/intv/rom.o -BUSOBJS += $(BUSOBJ)/intv/voice.o -BUSOBJS += $(BUSOBJ)/intv/ecs.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/isa/isa.h,BUSES += ISA -#------------------------------------------------- - -ifneq ($(filter ISA,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/isa -BUSOBJS += $(BUSOBJ)/isa/isa.o -BUSOBJS += $(BUSOBJ)/isa/isa_cards.o -BUSOBJS += $(BUSOBJ)/isa/mda.o -BUSOBJS += $(BUSOBJ)/isa/wdxt_gen.o -BUSOBJS += $(BUSOBJ)/isa/adlib.o -BUSOBJS += $(BUSOBJ)/isa/com.o -BUSOBJS += $(BUSOBJ)/isa/fdc.o -BUSOBJS += $(BUSOBJ)/isa/mufdc.o -BUSOBJS += $(BUSOBJ)/isa/finalchs.o -BUSOBJS += $(BUSOBJ)/isa/gblaster.o -BUSOBJS += $(BUSOBJ)/isa/gus.o -BUSOBJS += $(BUSOBJ)/isa/sb16.o -BUSOBJS += $(BUSOBJ)/isa/hdc.o -BUSOBJS += $(BUSOBJ)/isa/ibm_mfc.o -BUSOBJS += $(BUSOBJ)/isa/mpu401.o -BUSOBJS += $(BUSOBJ)/isa/sblaster.o -BUSOBJS += $(BUSOBJ)/isa/stereo_fx.o -BUSOBJS += $(BUSOBJ)/isa/ssi2001.o -BUSOBJS += $(BUSOBJ)/isa/ide.o -BUSOBJS += $(BUSOBJ)/isa/xtide.o -BUSOBJS += $(BUSOBJ)/isa/side116.o -BUSOBJS += $(BUSOBJ)/isa/aha1542.o -BUSOBJS += $(BUSOBJ)/isa/wd1002a_wx1.o -BUSOBJS += $(BUSOBJ)/isa/dectalk.o -BUSOBJS += $(BUSOBJ)/isa/pds.o -BUSOBJS += $(BUSOBJ)/isa/omti8621.o -BUSOBJS += $(BUSOBJ)/isa/cga.o -BUSOBJS += $(BUSOBJ)/isa/svga_cirrus.o -BUSOBJS += $(BUSOBJ)/isa/ega.o -BUSOBJS += $(BUSOBJ)/isa/vga.o -BUSOBJS += $(BUSOBJ)/isa/vga_ati.o -BUSOBJS += $(BUSOBJ)/isa/mach32.o -BUSOBJS += $(BUSOBJ)/isa/svga_tseng.o -BUSOBJS += $(BUSOBJ)/isa/svga_s3.o -BUSOBJS += $(BUSOBJ)/isa/s3virge.o -BUSOBJS += $(BUSOBJ)/isa/pc1640_iga.o -BUSOBJS += $(BUSOBJ)/isa/3c503.o -BUSOBJS += $(BUSOBJ)/isa/ne1000.o -BUSOBJS += $(BUSOBJ)/isa/ne2000.o -BUSOBJS += $(BUSOBJ)/isa/3c505.o -BUSOBJS += $(BUSOBJ)/isa/lpt.o -BUSOBJS += $(BUSOBJ)/isa/p1_fdc.o -BUSOBJS += $(BUSOBJ)/isa/p1_hdc.o -BUSOBJS += $(BUSOBJ)/isa/p1_rom.o -BUSOBJS += $(BUSOBJ)/isa/mc1502_fdc.o -BUSOBJS += $(BUSOBJ)/isa/mc1502_rom.o -BUSOBJS += $(BUSOBJ)/isa/xsu_cards.o -BUSOBJS += $(BUSOBJ)/isa/sc499.o -BUSOBJS += $(BUSOBJ)/isa/aga.o -BUSOBJS += $(BUSOBJ)/isa/svga_trident.o -BUSOBJS += $(BUSOBJ)/isa/num9rev.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/isbx/isbx.h,BUSES += ISBX -#------------------------------------------------- - -ifneq ($(filter ISBX,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/isbx -BUSOBJS += $(BUSOBJ)/isbx/isbx.o -BUSOBJS += $(BUSOBJ)/isbx/compis_fdc.o -BUSOBJS += $(BUSOBJ)/isbx/isbc_218a.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/msx_slot/slot.h,BUSES += MSX_SLOT -#------------------------------------------------- - -ifneq ($(filter MSX_SLOT,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/msx_slot -BUSOBJS += $(BUSOBJ)/msx_slot/bunsetsu.o -BUSOBJS += $(BUSOBJ)/msx_slot/cartridge.o -BUSOBJS += $(BUSOBJ)/msx_slot/disk.o -BUSOBJS += $(BUSOBJ)/msx_slot/fs4600.o -BUSOBJS += $(BUSOBJ)/msx_slot/music.o -BUSOBJS += $(BUSOBJ)/msx_slot/panasonic08.o -BUSOBJS += $(BUSOBJ)/msx_slot/rom.o -BUSOBJS += $(BUSOBJ)/msx_slot/ram.o -BUSOBJS += $(BUSOBJ)/msx_slot/ram_mm.o -BUSOBJS += $(BUSOBJ)/msx_slot/slot.o -BUSOBJS += $(BUSOBJ)/msx_slot/sony08.o -OBJDIRS += $(BUSOBJ)/msx_cart -BUSOBJS += $(BUSOBJ)/msx_cart/arc.o -BUSOBJS += $(BUSOBJ)/msx_cart/ascii.o -BUSOBJS += $(BUSOBJ)/msx_cart/bm_012.o -BUSOBJS += $(BUSOBJ)/msx_cart/cartridge.o -BUSOBJS += $(BUSOBJ)/msx_cart/crossblaim.o -BUSOBJS += $(BUSOBJ)/msx_cart/disk.o -BUSOBJS += $(BUSOBJ)/msx_cart/dooly.o -BUSOBJS += $(BUSOBJ)/msx_cart/fmpac.o -BUSOBJS += $(BUSOBJ)/msx_cart/halnote.o -BUSOBJS += $(BUSOBJ)/msx_cart/hfox.o -BUSOBJS += $(BUSOBJ)/msx_cart/holy_quran.o -BUSOBJS += $(BUSOBJ)/msx_cart/konami.o -BUSOBJS += $(BUSOBJ)/msx_cart/korean.o -BUSOBJS += $(BUSOBJ)/msx_cart/majutsushi.o -BUSOBJS += $(BUSOBJ)/msx_cart/msx_audio.o -BUSOBJS += $(BUSOBJ)/msx_cart/msx_audio_kb.o -BUSOBJS += $(BUSOBJ)/msx_cart/msxdos2.o -BUSOBJS += $(BUSOBJ)/msx_cart/nomapper.o -BUSOBJS += $(BUSOBJ)/msx_cart/rtype.o -BUSOBJS += $(BUSOBJ)/msx_cart/superloderunner.o -BUSOBJS += $(BUSOBJ)/msx_cart/super_swangi.o -BUSOBJS += $(BUSOBJ)/msx_cart/yamaha.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/kc/kc.h,BUSES += KC -#------------------------------------------------- - -ifneq ($(filter KC,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/kc -BUSOBJS += $(BUSOBJ)/kc/kc.o -BUSOBJS += $(BUSOBJ)/kc/d002.o -BUSOBJS += $(BUSOBJ)/kc/d004.o -BUSOBJS += $(BUSOBJ)/kc/ram.o -BUSOBJS += $(BUSOBJ)/kc/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/odyssey2/slot.h,BUSES += O2 -#------------------------------------------------- - -ifneq ($(filter O2,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/odyssey2 -BUSOBJS += $(BUSOBJ)/odyssey2/slot.o -BUSOBJS += $(BUSOBJ)/odyssey2/rom.o -BUSOBJS += $(BUSOBJ)/odyssey2/chess.o -BUSOBJS += $(BUSOBJ)/odyssey2/voice.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/pc_joy/pc_joy.h,BUSES += PC_JOY -#------------------------------------------------- - -ifneq ($(filter PC_JOY,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/pc_joy -BUSOBJS += $(BUSOBJ)/pc_joy/pc_joy.o -BUSOBJS += $(BUSOBJ)/pc_joy/pc_joy_sw.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/pc_kbd/pc_kbdc.h,BUSES += PC_KBD -#------------------------------------------------- - -ifneq ($(filter PC_KBD,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/pc_kbd -BUSOBJS += $(BUSOBJ)/pc_kbd/pc_kbdc.o -BUSOBJS += $(BUSOBJ)/pc_kbd/keyboards.o -BUSOBJS += $(BUSOBJ)/pc_kbd/ec1841.o -BUSOBJS += $(BUSOBJ)/pc_kbd/iskr1030.o -BUSOBJS += $(BUSOBJ)/pc_kbd/keytro.o -BUSOBJS += $(BUSOBJ)/pc_kbd/msnat.o -BUSOBJS += $(BUSOBJ)/pc_kbd/pc83.o -BUSOBJS += $(BUSOBJ)/pc_kbd/pcat84.o -BUSOBJS += $(BUSOBJ)/pc_kbd/pcxt83.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/pet/cass.h,BUSES += PET -#@src/emu/bus/pet/exp.h,BUSES += PET -#@src/emu/bus/pet/user.h,BUSES += PET -#------------------------------------------------- - -ifneq ($(filter PET,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/pet -BUSOBJS += $(BUSOBJ)/pet/cass.o -BUSOBJS += $(BUSOBJ)/pet/c2n.o -BUSOBJS += $(BUSOBJ)/pet/diag264_lb_tape.o -BUSOBJS += $(BUSOBJ)/pet/exp.o -BUSOBJS += $(BUSOBJ)/pet/64k.o -BUSOBJS += $(BUSOBJ)/pet/hsg.o -BUSOBJS += $(BUSOBJ)/pet/superpet.o -BUSOBJS += $(BUSOBJ)/pet/user.o -BUSOBJS += $(BUSOBJ)/pet/diag.o -BUSOBJS += $(BUSOBJ)/pet/petuja.o -BUSOBJS += $(BUSOBJ)/pet/cb2snd.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/plus4/exp.h,BUSES += PLUS4 -#@src/emu/bus/plus4/user.h,BUSES += PLUS4 -#------------------------------------------------- - -ifneq ($(filter PLUS4,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/plus4 -BUSOBJS += $(BUSOBJ)/plus4/exp.o -BUSOBJS += $(BUSOBJ)/plus4/c1551.o -BUSOBJS += $(BUSOBJ)/plus4/sid.o -BUSOBJS += $(BUSOBJ)/plus4/std.o -BUSOBJS += $(BUSOBJ)/plus4/user.o -BUSOBJS += $(BUSOBJ)/plus4/diag264_lb_user.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/s100/s100.h,BUSES += S100 -#------------------------------------------------- - -ifneq ($(filter S100,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/s100 -BUSOBJS += $(BUSOBJ)/s100/s100.o -BUSOBJS += $(BUSOBJ)/s100/dj2db.o -BUSOBJS += $(BUSOBJ)/s100/djdma.o -BUSOBJS += $(BUSOBJ)/s100/mm65k16s.o -BUSOBJS += $(BUSOBJ)/s100/nsmdsa.o -BUSOBJS += $(BUSOBJ)/s100/nsmdsad.o -BUSOBJS += $(BUSOBJ)/s100/wunderbus.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/spc1000/exp.h,BUSES += SPC1000 -#------------------------------------------------- - -ifneq ($(filter SPC1000,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/spc1000 -BUSOBJS += $(BUSOBJ)/spc1000/exp.o -BUSOBJS += $(BUSOBJ)/spc1000/fdd.o -BUSOBJS += $(BUSOBJ)/spc1000/vdp.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/tvc/tvc.h,BUSES += TVC -#------------------------------------------------- - -ifneq ($(filter TVC,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/tvc -BUSOBJS += $(BUSOBJ)/tvc/tvc.o -BUSOBJS += $(BUSOBJ)/tvc/hbf.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vc4000/slot.h,BUSES += VC4000 -#------------------------------------------------- - -ifneq ($(filter VC4000,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vc4000 -BUSOBJS += $(BUSOBJ)/vc4000/slot.o -BUSOBJS += $(BUSOBJ)/vc4000/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vcs/vcs_slot.h,BUSES += VCS -#------------------------------------------------- - -ifneq ($(filter VCS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vcs -BUSOBJS += $(BUSOBJ)/vcs/vcs_slot.o -BUSOBJS += $(BUSOBJ)/vcs/rom.o -BUSOBJS += $(BUSOBJ)/vcs/compumat.o -BUSOBJS += $(BUSOBJ)/vcs/dpc.o -BUSOBJS += $(BUSOBJ)/vcs/scharger.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vcs/ctrl.h,BUSES += VCS_CTRL -#------------------------------------------------- - -ifneq ($(filter VCS_CTRL,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vcs_ctrl -BUSOBJS += $(BUSOBJ)/vcs_ctrl/ctrl.o -BUSOBJS += $(BUSOBJ)/vcs_ctrl/joystick.o -BUSOBJS += $(BUSOBJ)/vcs_ctrl/joybooster.o -BUSOBJS += $(BUSOBJ)/vcs_ctrl/keypad.o -BUSOBJS += $(BUSOBJ)/vcs_ctrl/lightpen.o -BUSOBJS += $(BUSOBJ)/vcs_ctrl/paddles.o -BUSOBJS += $(BUSOBJ)/vcs_ctrl/wheel.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vectrex/slot.h,BUSES += VECTREX -#------------------------------------------------- - -ifneq ($(filter VECTREX,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vectrex -BUSOBJS += $(BUSOBJ)/vectrex/slot.o -BUSOBJS += $(BUSOBJ)/vectrex/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vic10/exp.h,BUSES += VIC10 -#------------------------------------------------- - -ifneq ($(filter VIC10,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vic10 -BUSOBJS += $(BUSOBJ)/vic10/exp.o -BUSOBJS += $(BUSOBJ)/vic10/std.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vic20/exp.h,BUSES += VIC20 -#@src/emu/bus/vic20/user.h,BUSES += VIC20 -#------------------------------------------------- - -ifneq ($(filter VIC20,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vic20 -BUSOBJS += $(BUSOBJ)/vic20/exp.o -BUSOBJS += $(BUSOBJ)/vic20/fe3.o -BUSOBJS += $(BUSOBJ)/vic20/megacart.o -BUSOBJS += $(BUSOBJ)/vic20/std.o -BUSOBJS += $(BUSOBJ)/vic20/vic1010.o -BUSOBJS += $(BUSOBJ)/vic20/vic1110.o -BUSOBJS += $(BUSOBJ)/vic20/vic1111.o -BUSOBJS += $(BUSOBJ)/vic20/vic1112.o -BUSOBJS += $(BUSOBJ)/vic20/vic1210.o -BUSOBJS += $(BUSOBJ)/vic20/user.o -BUSOBJS += $(BUSOBJ)/vic20/4cga.o -BUSOBJS += $(BUSOBJ)/vic20/vic1011.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vidbrain/exp.h,BUSES += VIDBRAIN -#------------------------------------------------- - -ifneq ($(filter VIDBRAIN,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vidbrain -BUSOBJS += $(BUSOBJ)/vidbrain/exp.o -BUSOBJS += $(BUSOBJ)/vidbrain/std.o -BUSOBJS += $(BUSOBJ)/vidbrain/money_minder.o -BUSOBJS += $(BUSOBJ)/vidbrain/timeshare.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/vip/byteio.h,BUSES += VIP -#@src/emu/bus/vip/exp.h,BUSES += VIP -#------------------------------------------------- - -ifneq ($(filter VIP,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vip -BUSOBJS += $(BUSOBJ)/vip/byteio.o -BUSOBJS += $(BUSOBJ)/vip/vp620.o -BUSOBJS += $(BUSOBJ)/vip/exp.o -BUSOBJS += $(BUSOBJ)/vip/vp550.o -BUSOBJS += $(BUSOBJ)/vip/vp570.o -BUSOBJS += $(BUSOBJ)/vip/vp575.o -BUSOBJS += $(BUSOBJ)/vip/vp585.o -BUSOBJS += $(BUSOBJ)/vip/vp590.o -BUSOBJS += $(BUSOBJ)/vip/vp595.o -BUSOBJS += $(BUSOBJ)/vip/vp700.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/wangpc/wangpc.h,BUSES += WANGPC -#------------------------------------------------- - -ifneq ($(filter WANGPC,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/wangpc -BUSOBJS += $(BUSOBJ)/wangpc/wangpc.o -BUSOBJS += $(BUSOBJ)/wangpc/emb.o -BUSOBJS += $(BUSOBJ)/wangpc/lic.o -BUSOBJS += $(BUSOBJ)/wangpc/lvc.o -BUSOBJS += $(BUSOBJ)/wangpc/mcc.o -BUSOBJS += $(BUSOBJ)/wangpc/mvc.o -BUSOBJS += $(BUSOBJ)/wangpc/rtc.o -BUSOBJS += $(BUSOBJ)/wangpc/tig.o -BUSOBJS += $(BUSOBJ)/wangpc/wdc.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/z88/z88.h,BUSES += Z88 -#------------------------------------------------- - -ifneq ($(filter Z88,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/z88 -BUSOBJS += $(BUSOBJ)/z88/z88.o -BUSOBJS += $(BUSOBJ)/z88/flash.o -BUSOBJS += $(BUSOBJ)/z88/ram.o -BUSOBJS += $(BUSOBJ)/z88/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/a2bus/a2bus.h,BUSES += A2BUS -#------------------------------------------------- - -ifneq ($(filter A2BUS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/a2bus -BUSOBJS += $(BUSOBJ)/a2bus/a2bus.o -BUSOBJS += $(BUSOBJ)/a2bus/a2lang.o -BUSOBJS += $(BUSOBJ)/a2bus/a2diskii.o -BUSOBJS += $(BUSOBJ)/a2bus/a2mockingboard.o -BUSOBJS += $(BUSOBJ)/a2bus/a2cffa.o -BUSOBJS += $(BUSOBJ)/a2bus/a2memexp.o -BUSOBJS += $(BUSOBJ)/a2bus/a2scsi.o -BUSOBJS += $(BUSOBJ)/a2bus/a2thunderclock.o -BUSOBJS += $(BUSOBJ)/a2bus/a2softcard.o -BUSOBJS += $(BUSOBJ)/a2bus/a2videoterm.o -BUSOBJS += $(BUSOBJ)/a2bus/a2ssc.o -BUSOBJS += $(BUSOBJ)/a2bus/a2swyft.o -BUSOBJS += $(BUSOBJ)/a2bus/a2eauxslot.o -BUSOBJS += $(BUSOBJ)/a2bus/a2themill.o -BUSOBJS += $(BUSOBJ)/a2bus/a2sam.o -BUSOBJS += $(BUSOBJ)/a2bus/a2alfam2.o -BUSOBJS += $(BUSOBJ)/a2bus/laser128.o -BUSOBJS += $(BUSOBJ)/a2bus/a2echoii.o -BUSOBJS += $(BUSOBJ)/a2bus/a2arcadebd.o -BUSOBJS += $(BUSOBJ)/a2bus/a2midi.o -BUSOBJS += $(BUSOBJ)/a2bus/a2vulcan.o -BUSOBJS += $(BUSOBJ)/a2bus/a2zipdrive.o -BUSOBJS += $(BUSOBJ)/a2bus/a2applicard.o -BUSOBJS += $(BUSOBJ)/a2bus/a2hsscsi.o -BUSOBJS += $(BUSOBJ)/a2bus/a2ultraterm.o -BUSOBJS += $(BUSOBJ)/a2bus/a2pic.o -BUSOBJS += $(BUSOBJ)/a2bus/a2estd80col.o -BUSOBJS += $(BUSOBJ)/a2bus/a2eext80col.o -BUSOBJS += $(BUSOBJ)/a2bus/a2eramworks3.o -BUSOBJS += $(BUSOBJ)/a2bus/a2corvus.o -BUSOBJS += $(BUSOBJ)/a2bus/a2diskiing.o -BUSOBJS += $(BUSOBJ)/a2bus/a2mcms.o -BUSOBJS += $(BUSOBJ)/a2bus/a2dx1.o -BUSOBJS += $(BUSOBJ)/a2bus/timemasterho.o -BUSOBJS += $(BUSOBJ)/a2bus/mouse.o -BUSOBJS += $(BUSOBJ)/a2bus/corvfdc01.o -BUSOBJS += $(BUSOBJ)/a2bus/corvfdc02.o -BUSOBJS += $(BUSOBJ)/a2bus/ramcard16k.o -BUSOBJS += $(BUSOBJ)/a2bus/ramcard128k.o -BUSOBJS += $(BUSOBJ)/a2bus/ezcgi.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/nubus/nubus.h,BUSES += NUBUS -#------------------------------------------------- - -ifneq ($(filter NUBUS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/nubus -BUSOBJS += $(BUSOBJ)/nubus/nubus.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_48gc.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_cb264.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_vikbw.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_specpdq.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_m2hires.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_spec8.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_radiustpd.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_m2video.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_asntmc3b.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_image.o -BUSOBJS += $(BUSOBJ)/nubus/nubus_wsportrait.o -BUSOBJS += $(BUSOBJ)/nubus/pds30_cb264.o -BUSOBJS += $(BUSOBJ)/nubus/pds30_procolor816.o -BUSOBJS += $(BUSOBJ)/nubus/pds30_sigmalview.o -BUSOBJS += $(BUSOBJ)/nubus/pds30_30hr.o -BUSOBJS += $(BUSOBJ)/nubus/pds30_mc30.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/centronics/ctronics.h,BUSES += CENTRONICS -#------------------------------------------------- - -ifneq ($(filter CENTRONICS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/centronics -BUSOBJS += $(BUSOBJ)/centronics/ctronics.o -BUSOBJS += $(BUSOBJ)/centronics/comxpl80.o -BUSOBJS += $(BUSOBJ)/centronics/covox.o -BUSOBJS += $(BUSOBJ)/centronics/dsjoy.o -BUSOBJS += $(BUSOBJ)/centronics/epson_ex800.o -BUSOBJS += $(BUSOBJ)/centronics/epson_lx800.o -BUSOBJS += $(BUSOBJ)/centronics/epson_lx810l.o -BUSOBJS += $(BUSOBJ)/centronics/printer.o -BUSOBJS += $(BUSOBJ)/centronics/digiblst.o -$(BUSOBJ)/centronics/epson_ex800.o: $(EMUOBJ)/layout/ex800.lh -$(BUSOBJ)/centronics/epson_lx800.o: $(EMUOBJ)/layout/lx800.lh -$(BUSOBJ)/centronics/epson_lx810l.o: $(EMUOBJ)/layout/lx800.lh -endif - -#------------------------------------------------- -# -#@src/emu/bus/rs232/rs232.h,BUSES += RS232 -#------------------------------------------------- - -ifneq ($(filter RS232,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/rs232 -BUSOBJS += $(BUSOBJ)/rs232/keyboard.o -BUSOBJS += $(BUSOBJ)/rs232/loopback.o -BUSOBJS += $(BUSOBJ)/rs232/null_modem.o -BUSOBJS += $(BUSOBJ)/rs232/printer.o -BUSOBJS += $(BUSOBJ)/rs232/rs232.o -BUSOBJS += $(BUSOBJ)/rs232/ser_mouse.o -BUSOBJS += $(BUSOBJ)/rs232/terminal.o -BUSOBJS += $(BUSOBJ)/rs232/xvd701.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/midi/midi.h,BUSES += MIDI -#------------------------------------------------- - -ifneq ($(filter MIDI,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/midi -BUSOBJS += $(BUSOBJ)/midi/midi.o -BUSOBJS += $(BUSOBJ)/midi/midiinport.o -BUSOBJS += $(BUSOBJ)/midi/midioutport.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/lpci/pci.h,BUSES += LPCI -#------------------------------------------------- - -ifneq ($(filter LPCI,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/lpci -BUSOBJS += $(BUSOBJ)/lpci/pci.o -BUSOBJS += $(BUSOBJ)/lpci/cirrus.o -BUSOBJS += $(BUSOBJ)/lpci/i82371ab.o -BUSOBJS += $(BUSOBJ)/lpci/i82371sb.o -BUSOBJS += $(BUSOBJ)/lpci/i82439tx.o -BUSOBJS += $(BUSOBJ)/lpci/northbridge.o -BUSOBJS += $(BUSOBJ)/lpci/southbridge.o -BUSOBJS += $(BUSOBJ)/lpci/mpc105.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/nes/nes_slot.h,BUSES += NES -#------------------------------------------------- - -ifneq ($(filter NES,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/nes -BUSOBJS += $(BUSOBJ)/nes/nes_slot.o -BUSOBJS += $(BUSOBJ)/nes/nes_carts.o -BUSOBJS += $(BUSOBJ)/nes/2a03pur.o -BUSOBJS += $(BUSOBJ)/nes/act53.o -BUSOBJS += $(BUSOBJ)/nes/aladdin.o -BUSOBJS += $(BUSOBJ)/nes/ave.o -BUSOBJS += $(BUSOBJ)/nes/bandai.o -BUSOBJS += $(BUSOBJ)/nes/benshieng.o -BUSOBJS += $(BUSOBJ)/nes/bootleg.o -BUSOBJS += $(BUSOBJ)/nes/camerica.o -BUSOBJS += $(BUSOBJ)/nes/cne.o -BUSOBJS += $(BUSOBJ)/nes/cony.o -BUSOBJS += $(BUSOBJ)/nes/datach.o -BUSOBJS += $(BUSOBJ)/nes/discrete.o -BUSOBJS += $(BUSOBJ)/nes/disksys.o -BUSOBJS += $(BUSOBJ)/nes/event.o -BUSOBJS += $(BUSOBJ)/nes/ggenie.o -BUSOBJS += $(BUSOBJ)/nes/henggedianzi.o -BUSOBJS += $(BUSOBJ)/nes/hes.o -BUSOBJS += $(BUSOBJ)/nes/hosenkan.o -BUSOBJS += $(BUSOBJ)/nes/irem.o -BUSOBJS += $(BUSOBJ)/nes/jaleco.o -BUSOBJS += $(BUSOBJ)/nes/jy.o -BUSOBJS += $(BUSOBJ)/nes/kaiser.o -BUSOBJS += $(BUSOBJ)/nes/karastudio.o -BUSOBJS += $(BUSOBJ)/nes/konami.o -BUSOBJS += $(BUSOBJ)/nes/legacy.o -BUSOBJS += $(BUSOBJ)/nes/mmc1.o -BUSOBJS += $(BUSOBJ)/nes/mmc2.o -BUSOBJS += $(BUSOBJ)/nes/mmc3.o -BUSOBJS += $(BUSOBJ)/nes/mmc3_clones.o -BUSOBJS += $(BUSOBJ)/nes/mmc5.o -BUSOBJS += $(BUSOBJ)/nes/multigame.o -BUSOBJS += $(BUSOBJ)/nes/namcot.o -BUSOBJS += $(BUSOBJ)/nes/nanjing.o -BUSOBJS += $(BUSOBJ)/nes/ntdec.o -BUSOBJS += $(BUSOBJ)/nes/nxrom.o -BUSOBJS += $(BUSOBJ)/nes/pirate.o -BUSOBJS += $(BUSOBJ)/nes/pt554.o -BUSOBJS += $(BUSOBJ)/nes/racermate.o -BUSOBJS += $(BUSOBJ)/nes/rcm.o -BUSOBJS += $(BUSOBJ)/nes/rexsoft.o -BUSOBJS += $(BUSOBJ)/nes/sachen.o -BUSOBJS += $(BUSOBJ)/nes/somari.o -BUSOBJS += $(BUSOBJ)/nes/sunsoft.o -BUSOBJS += $(BUSOBJ)/nes/sunsoft_dcs.o -BUSOBJS += $(BUSOBJ)/nes/taito.o -BUSOBJS += $(BUSOBJ)/nes/tengen.o -BUSOBJS += $(BUSOBJ)/nes/txc.o -BUSOBJS += $(BUSOBJ)/nes/waixing.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/nes_ctrl/ctrl.h,BUSES += NES_CTRL -#------------------------------------------------- - -ifneq ($(filter NES_CTRL,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/nes_ctrl -BUSOBJS += $(BUSOBJ)/nes_ctrl/ctrl.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/joypad.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/4score.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/arkpaddle.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/bcbattle.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/ftrainer.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/fckeybrd.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/hori.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/konamihs.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/miracle.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/mjpanel.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/pachinko.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/partytap.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/powerpad.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/suborkey.o -BUSOBJS += $(BUSOBJ)/nes_ctrl/zapper.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/snes/snes_slot.h,BUSES += SNES -#------------------------------------------------- - -ifneq ($(filter SNES,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/snes -BUSOBJS += $(BUSOBJ)/snes/snes_slot.o -BUSOBJS += $(BUSOBJ)/snes/snes_carts.o -BUSOBJS += $(BUSOBJ)/snes/bsx.o -BUSOBJS += $(BUSOBJ)/snes/event.o -BUSOBJS += $(BUSOBJ)/snes/rom.o -BUSOBJS += $(BUSOBJ)/snes/rom21.o -BUSOBJS += $(BUSOBJ)/snes/sa1.o -BUSOBJS += $(BUSOBJ)/snes/sdd1.o -BUSOBJS += $(BUSOBJ)/snes/sfx.o -BUSOBJS += $(BUSOBJ)/snes/sgb.o -BUSOBJS += $(BUSOBJ)/snes/spc7110.o -BUSOBJS += $(BUSOBJ)/snes/sufami.o -BUSOBJS += $(BUSOBJ)/snes/upd.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/snes_ctrl/ctrl.h,BUSES += SNES_CTRL -#------------------------------------------------- - -ifneq ($(filter SNES_CTRL,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/snes_ctrl -BUSOBJS += $(BUSOBJ)/snes_ctrl/ctrl.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/bcbattle.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/joypad.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/miracle.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/mouse.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/multitap.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/pachinko.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/sscope.o -BUSOBJS += $(BUSOBJ)/snes_ctrl/twintap.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/vboy/slot.h,BUSES += VBOY -#------------------------------------------------- -ifneq ($(filter VBOY,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vboy -BUSOBJS += $(BUSOBJ)/vboy/slot.o -BUSOBJS += $(BUSOBJ)/vboy/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/megadrive/md_slot.h,BUSES += MEGADRIVE -#------------------------------------------------- - -ifneq ($(filter MEGADRIVE,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/megadrive -BUSOBJS += $(BUSOBJ)/megadrive/md_slot.o -BUSOBJS += $(BUSOBJ)/megadrive/md_carts.o -BUSOBJS += $(BUSOBJ)/megadrive/eeprom.o -BUSOBJS += $(BUSOBJ)/megadrive/ggenie.o -BUSOBJS += $(BUSOBJ)/megadrive/jcart.o -BUSOBJS += $(BUSOBJ)/megadrive/rom.o -BUSOBJS += $(BUSOBJ)/megadrive/sk.o -BUSOBJS += $(BUSOBJ)/megadrive/stm95.o -BUSOBJS += $(BUSOBJ)/megadrive/svp.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/neogeo/neogeo_slot.h,BUSES += NEOGEO -#------------------------------------------------- - -ifneq ($(filter NEOGEO,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/neogeo -BUSOBJS += $(BUSOBJ)/neogeo/neogeo_slot.o -BUSOBJS += $(BUSOBJ)/neogeo/neogeo_intf.o -BUSOBJS += $(BUSOBJ)/neogeo/neogeo_carts.o -BUSOBJS += $(BUSOBJ)/neogeo/neogeo_helper.o -BUSOBJS += $(BUSOBJ)/neogeo/banked_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/mslugx_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/mslugx_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/sma_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/sma_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/cmc_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/cmc_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/pcm2_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/pcm2_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/kof2002_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/kof2002_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/pvc_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/pvc_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/fatfury2_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/fatfury2_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/kof98_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/kof98_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/bootleg_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/bootleg_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/bootleg_hybrid_cart.o -BUSOBJS += $(BUSOBJ)/neogeo/sbp_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/kog_prot.o -BUSOBJS += $(BUSOBJ)/neogeo/rom.o -endif - - -#------------------------------------------------- -# -#@src/emu/bus/saturn/sat_slot.h,BUSES += SATURN -#------------------------------------------------- - -ifneq ($(filter SATURN,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/saturn -BUSOBJS += $(BUSOBJ)/saturn/sat_slot.o -BUSOBJS += $(BUSOBJ)/saturn/bram.o -BUSOBJS += $(BUSOBJ)/saturn/dram.o -BUSOBJS += $(BUSOBJ)/saturn/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/sega8/sega8_slot.h,BUSES += SEGA8 -#------------------------------------------------- - -ifneq ($(filter SEGA8,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/sega8 -BUSOBJS += $(BUSOBJ)/sega8/sega8_slot.o -BUSOBJS += $(BUSOBJ)/sega8/rom.o -BUSOBJS += $(BUSOBJ)/sega8/ccatch.o -BUSOBJS += $(BUSOBJ)/sega8/mgear.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/sms_ctrl/smsctrl.h,BUSES += SMS_CTRL -#------------------------------------------------- - -ifneq ($(filter SMS_CTRL,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/sms_ctrl -BUSOBJS += $(BUSOBJ)/sms_ctrl/smsctrl.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/joypad.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/lphaser.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/paddle.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/rfu.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/sports.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/sportsjp.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/multitap.o -BUSOBJS += $(BUSOBJ)/sms_ctrl/graphic.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/sms_exp/smsexp.h,BUSES += SMS_EXP -#------------------------------------------------- - -ifneq ($(filter SMS_EXP,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/sms_exp -BUSOBJS += $(BUSOBJ)/sms_exp/smsexp.o -BUSOBJS += $(BUSOBJ)/sms_exp/gender.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/ti99_peb/peribox.h,BUSES += TI99PEB -#------------------------------------------------- - -ifneq ($(filter TI99PEB,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/ti99_peb -BUSOBJS += $(BUSOBJ)/ti99_peb/peribox.o -BUSOBJS += $(BUSOBJ)/ti99_peb/bwg.o -BUSOBJS += $(BUSOBJ)/ti99_peb/evpc.o -BUSOBJS += $(BUSOBJ)/ti99_peb/hfdc.o -BUSOBJS += $(BUSOBJ)/ti99_peb/horizon.o -BUSOBJS += $(BUSOBJ)/ti99_peb/hsgpl.o -BUSOBJS += $(BUSOBJ)/ti99_peb/memex.o -BUSOBJS += $(BUSOBJ)/ti99_peb/myarcmem.o -BUSOBJS += $(BUSOBJ)/ti99_peb/pcode.o -BUSOBJS += $(BUSOBJ)/ti99_peb/samsmem.o -BUSOBJS += $(BUSOBJ)/ti99_peb/spchsyn.o -BUSOBJS += $(BUSOBJ)/ti99_peb/ti_32kmem.o -BUSOBJS += $(BUSOBJ)/ti99_peb/ti_fdc.o -BUSOBJS += $(BUSOBJ)/ti99_peb/ti_rs232.o -BUSOBJS += $(BUSOBJ)/ti99_peb/tn_ide.o -BUSOBJS += $(BUSOBJ)/ti99_peb/tn_usbsm.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/gameboy/gb_slot.h,BUSES += GAMEBOY -#------------------------------------------------- - -ifneq ($(filter GAMEBOY,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/gameboy -BUSOBJS += $(BUSOBJ)/gameboy/gb_slot.o -BUSOBJS += $(BUSOBJ)/gameboy/rom.o -BUSOBJS += $(BUSOBJ)/gameboy/mbc.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/gamegear/ggext.h,BUSES += GAMEGEAR -#------------------------------------------------- - -ifneq ($(filter GAMEGEAR,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/gamegear -BUSOBJS += $(BUSOBJ)/gamegear/ggext.o -BUSOBJS += $(BUSOBJ)/gamegear/smsctrladp.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/gba/gba_slot.h,BUSES += GBA -#------------------------------------------------- - -ifneq ($(filter GBA,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/gba -BUSOBJS += $(BUSOBJ)/gba/gba_slot.o -BUSOBJS += $(BUSOBJ)/gba/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/bml3/bml3bus.h,BUSES += BML3 -#------------------------------------------------- -ifneq ($(filter BML3,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/bml3 -BUSOBJS += $(BUSOBJ)/bml3/bml3bus.o -BUSOBJS += $(BUSOBJ)/bml3/bml3mp1802.o -BUSOBJS += $(BUSOBJ)/bml3/bml3mp1805.o -BUSOBJS += $(BUSOBJ)/bml3/bml3kanji.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/coco/cococart.h,BUSES += COCO -#------------------------------------------------- -ifneq ($(filter COCO,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/coco -BUSOBJS += $(BUSOBJ)/coco/cococart.o -BUSOBJS += $(BUSOBJ)/coco/coco_232.o -BUSOBJS += $(BUSOBJ)/coco/coco_orch90.o -BUSOBJS += $(BUSOBJ)/coco/coco_pak.o -BUSOBJS += $(BUSOBJ)/coco/coco_fdc.o -BUSOBJS += $(BUSOBJ)/coco/coco_multi.o -BUSOBJS += $(BUSOBJ)/coco/coco_dwsock.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/cpc/cpcexp.h,BUSES += CPC -#------------------------------------------------- -ifneq ($(filter CPC,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/cpc -BUSOBJS += $(BUSOBJ)/cpc/cpcexp.o -BUSOBJS += $(BUSOBJ)/cpc/cpc_ssa1.o -BUSOBJS += $(BUSOBJ)/cpc/cpc_rom.o -BUSOBJS += $(BUSOBJ)/cpc/cpc_pds.o -BUSOBJS += $(BUSOBJ)/cpc/cpc_rs232.o -BUSOBJS += $(BUSOBJ)/cpc/mface2.o -BUSOBJS += $(BUSOBJ)/cpc/symbfac2.o -BUSOBJS += $(BUSOBJ)/cpc/amdrum.o -BUSOBJS += $(BUSOBJ)/cpc/playcity.o -BUSOBJS += $(BUSOBJ)/cpc/smartwatch.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/epson_sio/epson_sio.h,BUSES += EPSON_SIO -#------------------------------------------------- -ifneq ($(filter EPSON_SIO,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/epson_sio -BUSOBJS += $(BUSOBJ)/epson_sio/epson_sio.o -BUSOBJS += $(BUSOBJ)/epson_sio/pf10.o -BUSOBJS += $(BUSOBJ)/epson_sio/tf20.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/pce/pce_slot.h,BUSES += PCE -#------------------------------------------------- -ifneq ($(filter PCE,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/pce -BUSOBJS += $(BUSOBJ)/pce/pce_slot.o -BUSOBJS += $(BUSOBJ)/pce/pce_rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/scv/slot.h,BUSES += SCV -#------------------------------------------------- -ifneq ($(filter SCV,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/scv -BUSOBJS += $(BUSOBJ)/scv/slot.o -BUSOBJS += $(BUSOBJ)/scv/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/x68k/x68kexp.h,BUSES += X68K -#------------------------------------------------- -ifneq ($(filter X68K,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/x68k -BUSOBJS += $(BUSOBJ)/x68k/x68kexp.o -BUSOBJS += $(BUSOBJ)/x68k/x68k_neptunex.o -BUSOBJS += $(BUSOBJ)/x68k/x68k_scsiext.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/abckb/abckb.h,BUSES += ABCKB -#------------------------------------------------- -ifneq ($(filter ABCKB,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/abckb -BUSOBJS += $(BUSOBJ)/abckb/abckb.o -BUSOBJS += $(BUSOBJ)/abckb/abc77.o -BUSOBJS += $(BUSOBJ)/abckb/abc99.o -BUSOBJS += $(BUSOBJ)/abckb/abc800kb.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/compucolor/compclr_flp.h,BUSES += COMPUCOLOR -#------------------------------------------------- -ifneq ($(filter COMPUCOLOR,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/compucolor -BUSOBJS += $(BUSOBJ)/compucolor/floppy.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/scsi/scsi.h,BUSES += SCSI -#------------------------------------------------- -ifneq ($(filter SCSI,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/scsi -BUSOBJS += $(BUSOBJ)/scsi/scsi.o -BUSOBJS += $(BUSOBJ)/scsi/scsicd.o -BUSOBJS += $(BUSOBJ)/scsi/scsihd.o -BUSOBJS += $(BUSOBJ)/scsi/scsihle.o -BUSOBJS += $(BUSOBJ)/scsi/cdu76s.o -BUSOBJS += $(BUSOBJ)/scsi/acb4070.o -BUSOBJS += $(BUSOBJ)/scsi/d9060hd.o -BUSOBJS += $(BUSOBJ)/scsi/sa1403d.o -BUSOBJS += $(BUSOBJ)/scsi/s1410.o -BUSOBJS += $(BUSOBJ)/scsi/pc9801_sasi.o -BUSOBJS += $(BUSOBJ)/scsi/omti5100.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/macpds/macpds.h,BUSES += MACPDS -#------------------------------------------------- -ifneq ($(filter MACPDS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/macpds -BUSOBJS += $(BUSOBJ)/macpds/macpds.o -BUSOBJS += $(BUSOBJ)/macpds/pds_tpdfpd.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/oricext/oricext.h,BUSES += ORICEXT -#------------------------------------------------- -ifneq ($(filter ORICEXT,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/oricext -BUSOBJS += $(BUSOBJ)/oricext/oricext.o -BUSOBJS += $(BUSOBJ)/oricext/jasmin.o -BUSOBJS += $(BUSOBJ)/oricext/microdisc.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/a1bus/a1bus.h,BUSES += A1BUS -#------------------------------------------------- - -ifneq ($(filter A1BUS,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/a1bus -BUSOBJS += $(BUSOBJ)/a1bus/a1bus.o -BUSOBJS += $(BUSOBJ)/a1bus/a1cassette.o -BUSOBJS += $(BUSOBJ)/a1bus/a1cffa.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/amiga/zorro/zorro.h,BUSES += ZORRO -#------------------------------------------------- - -ifneq ($(filter ZORRO,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/amiga/zorro -BUSOBJS += $(BUSOBJ)/amiga/zorro/zorro.o -BUSOBJS += $(BUSOBJ)/amiga/zorro/cards.o -BUSOBJS += $(BUSOBJ)/amiga/zorro/a2052.o -BUSOBJS += $(BUSOBJ)/amiga/zorro/a2232.o -BUSOBJS += $(BUSOBJ)/amiga/zorro/a590.o -BUSOBJS += $(BUSOBJ)/amiga/zorro/action_replay.o -BUSOBJS += $(BUSOBJ)/amiga/zorro/buddha.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/ql/exp.h,BUSES += QL -#------------------------------------------------- - -ifneq ($(filter QL,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/ql -BUSOBJS += $(BUSOBJ)/ql/exp.o -BUSOBJS += $(BUSOBJ)/ql/cst_qdisc.o -BUSOBJS += $(BUSOBJ)/ql/cst_q_plus4.o -BUSOBJS += $(BUSOBJ)/ql/cumana_fdi.o -BUSOBJS += $(BUSOBJ)/ql/kempston_di.o -BUSOBJS += $(BUSOBJ)/ql/miracle_gold_card.o -BUSOBJS += $(BUSOBJ)/ql/mp_fdi.o -BUSOBJS += $(BUSOBJ)/ql/opd_basic_master.o -BUSOBJS += $(BUSOBJ)/ql/pcml_qdisk.o -BUSOBJS += $(BUSOBJ)/ql/qubide.o -BUSOBJS += $(BUSOBJ)/ql/sandy_superdisk.o -BUSOBJS += $(BUSOBJ)/ql/sandy_superqboard.o -BUSOBJS += $(BUSOBJ)/ql/trumpcard.o -BUSOBJS += $(BUSOBJ)/ql/rom.o -BUSOBJS += $(BUSOBJ)/ql/miracle_hd.o -BUSOBJS += $(BUSOBJ)/ql/std.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/vtech/memexp/memexp.h,BUSES += VTECH_MEMEXP -#------------------------------------------------- - -ifneq ($(filter VTECH_MEMEXP,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vtech/memexp -BUSOBJS += $(BUSOBJ)/vtech/memexp/memexp.o -BUSOBJS += $(BUSOBJ)/vtech/memexp/carts.o -BUSOBJS += $(BUSOBJ)/vtech/memexp/floppy.o -BUSOBJS += $(BUSOBJ)/vtech/memexp/memory.o -BUSOBJS += $(BUSOBJ)/vtech/memexp/rs232.o -BUSOBJS += $(BUSOBJ)/vtech/memexp/wordpro.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/vtech/ioexp/ioexp.h,BUSES += VTECH_IOEXP -#------------------------------------------------- - -ifneq ($(filter VTECH_IOEXP,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/vtech/ioexp -BUSOBJS += $(BUSOBJ)/vtech/ioexp/ioexp.o -BUSOBJS += $(BUSOBJ)/vtech/ioexp/carts.o -BUSOBJS += $(BUSOBJ)/vtech/ioexp/joystick.o -BUSOBJS += $(BUSOBJ)/vtech/ioexp/printer.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/wswan/slot.h,BUSES += WSWAN -#------------------------------------------------- - -ifneq ($(filter WSWAN,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/wswan -BUSOBJS += $(BUSOBJ)/wswan/slot.o -BUSOBJS += $(BUSOBJ)/wswan/rom.o -endif - -#------------------------------------------------- -# -#@src/emu/bus/psx/ctlrport.h,BUSES += PSX_CONTROLLER -#------------------------------------------------- - -ifneq ($(filter PSX_CONTROLLER,$(BUSES)),) -OBJDIRS += $(BUSOBJ)/psx -BUSOBJS += $(BUSOBJ)/psx/ctlrport.o -BUSOBJS += $(BUSOBJ)/psx/analogue.o -BUSOBJS += $(BUSOBJ)/psx/multitap.o -BUSOBJS += $(BUSOBJ)/psx/memcard.o -endif diff --git a/src/emu/bus/scsi/omti5100.c b/src/emu/bus/scsi/omti5100.c index a3f00560f73..0d7ed1567ab 100644 --- a/src/emu/bus/scsi/omti5100.c +++ b/src/emu/bus/scsi/omti5100.c @@ -20,8 +20,8 @@ const rom_entry *omti5100_device::device_rom_region() const omti5100_device::omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : scsihd_device(mconfig, OMTI5100, "OMTI 5100", tag, owner, clock, "omti5100", __FILE__), - m_image0(*this, "image0"), - m_image1(*this, "image1") + m_image0(*this, "image0"), + m_image1(*this, "image1") { } diff --git a/src/emu/cpu/arm7/arm7ops.c b/src/emu/cpu/arm7/arm7ops.c index 40d11d6a79c..f0766610777 100644 --- a/src/emu/cpu/arm7/arm7ops.c +++ b/src/emu/cpu/arm7/arm7ops.c @@ -255,19 +255,31 @@ int arm7_cpu_device::storeInc(UINT32 pat, UINT32 rbv, int mode) int arm7_cpu_device::storeDec(UINT32 pat, UINT32 rbv, int mode) { - int i, result; + int i, result = 0, cnt; - result = 0; + // pre-count the # of registers being stored for (i = 15; i >= 0; i--) { if ((pat >> i) & 1) { + result++; + + // starting address + rbv -= 4; + } + } + + cnt = 0; + for (i = 0; i <= 15; i++) + { + if ((pat >> i) & 1) + { #if ARM7_DEBUG_CORE if (i == 15) /* R15 is plus 12 from address of STM */ LOG(("%08x: StoreDec on R15\n", R15)); #endif - WRITE32(rbv -= 4, GET_MODE_REGISTER(mode, i)); - result++; + WRITE32(rbv + (cnt * 4), GET_MODE_REGISTER(mode, i)); + cnt++; } } return result; @@ -1421,7 +1433,7 @@ void arm7_cpu_device::HandleMemBlock(UINT32 insn) } /* Loading */ else { - /* Storing */ + /* Storing - STM */ if (insn & (1 << eR15)) { #if ARM7_DEBUG_CORE @@ -1461,7 +1473,7 @@ void arm7_cpu_device::HandleMemBlock(UINT32 insn) } else { - /* Decrementing */ + /* Decrementing - but real CPU writes in incrementing order */ if (!(insn & INSN_BDT_P)) { rbp = rbp - (-4); diff --git a/src/emu/cpu/cpu.mak b/src/emu/cpu/cpu.mak deleted file mode 100644 index 7a06931f017..00000000000 --- a/src/emu/cpu/cpu.mak +++ /dev/null @@ -1,2661 +0,0 @@ -########################################################################### -# -# cpu.mak -# -# Rules for building CPU cores -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -CPUSRC = $(EMUSRC)/cpu -CPUOBJ = $(EMUOBJ)/cpu - - -#------------------------------------------------- -# Shared code -#------------------------------------------------- - -OBJDIRS += $(CPUOBJ) -CPUOBJS += $(CPUOBJ)/vtlb.o - - - -#------------------------------------------------- -# Dynamic recompiler objects -#------------------------------------------------- - -DRCOBJ = \ - $(CPUOBJ)/drcbec.o \ - $(CPUOBJ)/drcbeut.o \ - $(CPUOBJ)/drccache.o \ - $(CPUOBJ)/drcfe.o \ - $(CPUOBJ)/drcuml.o \ - $(CPUOBJ)/uml.o \ - $(CPUOBJ)/i386/i386dasm.o \ - $(CPUOBJ)/x86log.o \ - $(CPUOBJ)/drcbex86.o \ - $(CPUOBJ)/drcbex64.o \ - -DRCDEPS = \ - $(CPUSRC)/drcbec.h \ - $(CPUSRC)/drcbeut.h \ - $(CPUSRC)/drccache.h \ - $(CPUSRC)/drcfe.h \ - $(CPUSRC)/drcuml.h \ - $(CPUSRC)/drcumlsh.h \ - $(CPUSRC)/uml.h \ - $(CPUSRC)/drcbex86.h \ - $(CPUSRC)/drcbex64.h \ - $(CPUSRC)/x86emit.h \ - -# fixme - need to make this work for other target architectures (PPC) - -ifndef FORCE_DRC_C_BACKEND -ifeq ($(PTR64),1) -DEFS += -DNATIVE_DRC=drcbe_x64 -else -DEFS += -DNATIVE_DRC=drcbe_x86 -endif -endif - - -$(DRCOBJ): $(DRCDEPS) - - - -#------------------------------------------------- -# Signetics 8X300 / Scientific Micro Systems SMS300 -#@src/emu/cpu/8x300/8x300.h,CPUS += 8X300 -#------------------------------------------------- - -ifneq ($(filter 8X300,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/8x300 -CPUOBJS += $(CPUOBJ)/8x300/8x300.o -DASMOBJS += $(CPUOBJ)/8x300/8x300dasm.o -endif - -$(CPUOBJ)/8x300/8x300.o: $(CPUSRC)/8x300/8x300.c \ - $(CPUSRC)/8x300/8x300.h - - - -#------------------------------------------------- -# ARCangent A4 -#@src/emu/cpu/arc/arc.h,CPUS += ARC -#------------------------------------------------- - -ifneq ($(filter ARC,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/arc -CPUOBJS += $(CPUOBJ)/arc/arc.o -DASMOBJS += $(CPUOBJ)/arc/arcdasm.o -endif - -$(CPUOBJ)/arc/arc.o: $(CPUSRC)/arc/arc.c \ - $(CPUSRC)/arc/arc.h - - - -#------------------------------------------------- -# ARcompact (ARCtangent-A5, ARC 600, ARC 700) -#@src/emu/cpu/arc/arc.h,CPUS += ARCOMPACT -#------------------------------------------------- - -ifneq ($(filter ARCOMPACT,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/arcompact -CPUOBJS += $(CPUOBJ)/arcompact/arcompact.o $(CPUOBJ)/arcompact/arcompact_execute.o -DASMOBJS += $(CPUOBJ)/arcompact/arcompactdasm.o $(CPUOBJ)/arcompact/arcompactdasm_dispatch.o $(CPUOBJ)/arcompact/arcompactdasm_ops.o $(CPUOBJ)/arcompact/arcompact_common.o -endif - -$(CPUOBJ)/arcompact/arcompact.o: $(CPUSRC)/arcompact/arcompact.c \ - $(CPUSRC)/arcompact/arcompact.h \ - $(CPUSRC)/arcompact/arcompact_common.h \ - $(CPUOBJ)/arcompact/arcompact.inc - -$(CPUOBJ)/arcompact/arcompact_execute.o: $(CPUSRC)/arcompact/arcompact_execute.c \ - $(CPUSRC)/arcompact/arcompact.h \ - $(CPUSRC)/arcompact/arcompact_common.h \ - $(CPUOBJ)/arcompact/arcompact.inc - -$(CPUOBJ)/arcompact/arcompactdasm_dispatch.o: $(CPUSRC)/arcompact/arcompactdasm_dispatch.c \ - $(CPUSRC)/arcompact/arcompactdasm_dispatch.h \ - $(CPUSRC)/arcompact/arcompact_common.h - -$(CPUOBJ)/arcompact/arcompactdasm_ops.o: $(CPUSRC)/arcompact/arcompactdasm_ops.c \ - $(CPUSRC)/arcompact/arcompactdasm_ops.h \ - $(CPUSRC)/arcompact/arcompact_common.h - -$(CPUOBJ)/arcompact/arcompact_common.o: $(CPUSRC)/arcompact/arcompact_common.c \ - $(CPUSRC)/arcompact/arcompact_common.h - -# rule to generate the C files -$(CPUOBJ)/arcompact/arcompact.inc: $(CPUSRC)/arcompact/arcompact_make.py - @echo Generating arcompact source .inc files... - $(PYTHON) $(CPUSRC)/arcompact/arcompact_make.py $@ - - - -#------------------------------------------------- -# Acorn ARM series -# -#@src/emu/cpu/arm/arm.h,CPUS += ARM -#@src/emu/cpu/arm7/arm7.h,CPUS += ARM7 -#------------------------------------------------- - -ifneq ($(filter ARM,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/arm -CPUOBJS += $(CPUOBJ)/arm/arm.o -DASMOBJS += $(CPUOBJ)/arm/armdasm.o -endif - -ifneq ($(filter ARM7,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/arm7 -CPUOBJS += $(CPUOBJ)/arm7/arm7.o -CPUOBJS += $(CPUOBJ)/arm7/arm7thmb.o -CPUOBJS += $(CPUOBJ)/arm7/arm7ops.o -DASMOBJS += $(CPUOBJ)/arm7/arm7dasm.o -endif - -$(CPUOBJ)/arm/arm.o: $(CPUSRC)/arm/arm.c \ - $(CPUSRC)/arm/arm.h - -$(CPUOBJ)/arm7/arm7.o: $(CPUSRC)/arm7/arm7.c \ - $(CPUSRC)/arm7/arm7.h \ - $(CPUSRC)/arm7/arm7help.h \ - $(CPUSRC)/arm7/arm7thmb.c \ - $(CPUSRC)/arm7/arm7ops.c \ - $(CPUSRC)/arm7/arm7core.inc \ - $(CPUSRC)/arm7/arm7drc.inc \ - $(CPUSRC)/arm7/arm7tdrc.inc - -$(CPUOBJ)/arm7/arm7ops.o: $(CPUSRC)/arm7/arm7ops.c \ - $(CPUSRC)/arm7/arm7.h \ - $(CPUSRC)/arm7/arm7help.h \ - $(CPUSRC)/arm7/arm7core.h \ - -$(CPUOBJ)/arm7/arm7thmb.o: $(CPUSRC)/arm7/arm7thmb.c \ - $(CPUSRC)/arm7/arm7.h \ - $(CPUSRC)/arm7/arm7help.h \ - $(CPUSRC)/arm7/arm7core.h \ - - - -#------------------------------------------------- -# Advanced Digital Chips SE3208 -#@src/emu/cpu/se3208/se3208.h,CPUS += SE3208 -#------------------------------------------------- - -ifneq ($(filter SE3208,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/se3208 -CPUOBJS += $(CPUOBJ)/se3208/se3208.o -DASMOBJS += $(CPUOBJ)/se3208/se3208dis.o -endif - -$(CPUOBJ)/se3208/se3208.o: $(CPUSRC)/se3208/se3208.c \ - $(CPUSRC)/se3208/se3208.h - - - -#------------------------------------------------- -# American Microsystems, Inc.(AMI) S2000 series -#@src/emu/cpu/amis2000/amis2000.h,CPUS += AMIS2000 -#------------------------------------------------- - -ifneq ($(filter AMIS2000,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/amis2000 -CPUOBJS += $(CPUOBJ)/amis2000/amis2000.o -DASMOBJS += $(CPUOBJ)/amis2000/amis2000d.o -endif - -$(CPUOBJ)/amis2000/amis2000.o: $(CPUSRC)/amis2000/amis2000.h \ - $(CPUSRC)/amis2000/amis2000.c \ - $(CPUSRC)/amis2000/amis2000op.inc - -$(CPUOBJ)/amis2000/amis2000d.o: $(CPUSRC)/amis2000/amis2000.h \ - $(CPUSRC)/amis2000/amis2000d.c - - - -#------------------------------------------------- -# Alpha 8201 -#@src/emu/cpu/alph8201/alph8201.h,CPUS += ALPHA8201 -#------------------------------------------------- - -ifneq ($(filter ALPHA8201,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/alph8201 -CPUOBJS += $(CPUOBJ)/alph8201/alph8201.o -DASMOBJS += $(CPUOBJ)/alph8201/8201dasm.o -endif - -$(CPUOBJ)/alph8201/alph8201.o: $(CPUSRC)/alph8201/alph8201.c \ - $(CPUSRC)/alph8201/alph8201.h - - - -#------------------------------------------------- -# Analog Devices ADSP21xx series -#@src/emu/cpu/adsp2100/adsp2100.h,CPUS += ADSP21XX -#------------------------------------------------- - -ifneq ($(filter ADSP21XX,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/adsp2100 -CPUOBJS += $(CPUOBJ)/adsp2100/adsp2100.o -DASMOBJS += $(CPUOBJ)/adsp2100/2100dasm.o -endif - -$(CPUOBJ)/adsp2100/adsp2100.o: $(CPUSRC)/adsp2100/adsp2100.c \ - $(CPUSRC)/adsp2100/adsp2100.h \ - $(CPUSRC)/adsp2100/2100ops.inc - - - -#------------------------------------------------- -# Analog Devices "Sharc" ADSP21062 -#@src/emu/cpu/sharc/sharc.h,CPUS += ADSP21062 -#------------------------------------------------- - -ifneq ($(filter ADSP21062,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/sharc -CPUOBJS += $(CPUOBJ)/sharc/sharc.o -DASMOBJS += $(CPUOBJ)/sharc/sharcdsm.o -endif - -$(CPUOBJ)/sharc/sharc.o: $(CPUSRC)/sharc/sharc.c \ - $(CPUSRC)/sharc/sharc.h \ - $(CPUSRC)/sharc/sharcops.inc \ - $(CPUSRC)/sharc/sharcops.h \ - $(CPUSRC)/sharc/sharcdsm.c \ - $(CPUSRC)/sharc/sharcdsm.h \ - $(CPUSRC)/sharc/compute.inc \ - $(CPUSRC)/sharc/sharcdma.inc \ - $(CPUSRC)/sharc/sharcmem.inc - - - -#------------------------------------------------- -# APEXC -#@src/emu/cpu/apexc/apexc.h,CPUS += APEXC -#------------------------------------------------- - -ifneq ($(filter APEXC,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/apexc -CPUOBJS += $(CPUOBJ)/apexc/apexc.o -DASMOBJS += $(CPUOBJ)/apexc/apexcdsm.o -endif - -$(CPUOBJ)/apexc/apexc.o: $(CPUSRC)/apexc/apexc.c \ - $(CPUSRC)/apexc/apexc.h - - - -#------------------------------------------------- -# AT&T DSP16A -#@src/emu/cpu/dsp16/dsp16.h,CPUS += DSP16A -#------------------------------------------------- - -ifneq ($(filter DSP16A,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/dsp16 -CPUOBJS += $(CPUOBJ)/dsp16/dsp16.o -DASMOBJS += $(CPUOBJ)/dsp16/dsp16dis.o -endif - -$(CPUOBJ)/dsp16/dsp16.o: $(CPUSRC)/dsp16/dsp16ops.inc \ - $(CPUSRC)/dsp16/dsp16.c \ - $(CPUSRC)/dsp16/dsp16.h - - -#------------------------------------------------- -# AT&T DSP32C -#@src/emu/cpu/dsp32/dsp32.h,CPUS += DSP32C -#------------------------------------------------- - -ifneq ($(filter DSP32C,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/dsp32 -CPUOBJS += $(CPUOBJ)/dsp32/dsp32.o -DASMOBJS += $(CPUOBJ)/dsp32/dsp32dis.o -endif - -$(CPUOBJ)/dsp32/dsp32.o: $(CPUSRC)/dsp32/dsp32.c \ - $(CPUSRC)/dsp32/dsp32.h \ - $(CPUSRC)/dsp32/dsp32ops.inc - - - -#------------------------------------------------- -# Atari custom RISC processor -#@src/emu/cpu/asap/asap.h,CPUS += ASAP -#------------------------------------------------- - -ifneq ($(filter ASAP,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/asap -CPUOBJS += $(CPUOBJ)/asap/asap.o -DASMOBJS += $(CPUOBJ)/asap/asapdasm.o -endif - -$(CPUOBJ)/asap/asap.o: $(CPUSRC)/asap/asap.c \ - $(CPUSRC)/asap/asap.h - - - -#------------------------------------------------- -# AMD Am29000 -#@src/emu/cpu/am29000/am29000.h,CPUS += AM29000 -#------------------------------------------------- - -ifneq ($(filter AM29000,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/am29000 -CPUOBJS += $(CPUOBJ)/am29000/am29000.o -DASMOBJS += $(CPUOBJ)/am29000/am29dasm.o -endif - -$(CPUOBJ)/am29000/am29000.o: $(CPUSRC)/am29000/am29000.c \ - $(CPUSRC)/am29000/am29000.h \ - $(CPUSRC)/am29000/am29ops.h \ - - - -#------------------------------------------------- -# Atari Jaguar custom DSPs -#@src/emu/cpu/jaguar/jaguar.h,CPUS += JAGUAR -#------------------------------------------------- - -ifneq ($(filter JAGUAR,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/jaguar -CPUOBJS += $(CPUOBJ)/jaguar/jaguar.o -DASMOBJS += $(CPUOBJ)/jaguar/jagdasm.o -endif - -$(CPUOBJ)/jaguar/jaguar.o: $(CPUSRC)/jaguar/jaguar.c \ - $(CPUSRC)/jaguar/jaguar.h - - - -#------------------------------------------------- -# Simutrek Cube Quest bit-sliced CPUs -#@src/emu/cpu/cubeqcpu/cubeqcpu.h,CPUS += CUBEQCPU -#------------------------------------------------- - -ifneq ($(filter CUBEQCPU,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/cubeqcpu -CPUOBJS += $(CPUOBJ)/cubeqcpu/cubeqcpu.o -DASMOBJS += $(CPUOBJ)/cubeqcpu/cubedasm.o -endif - -$(CPUOBJ)/cubeqcpu/cubeqcpu.o: $(CPUSRC)/cubeqcpu/cubeqcpu.c \ - $(CPUSRC)/cubeqcpu/cubeqcpu.h - - -#------------------------------------------------- -# Ensoniq ES5510 ('ESP') DSP -#@src/emu/cpu/es5510/es5510.h,CPUS += ES5510 -#------------------------------------------------- - -ifneq ($(filter ES5510,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/es5510 -CPUOBJS += $(CPUOBJ)/es5510/es5510.o -endif - -$(CPUOBJ)/es5510.o: $(CPUSRC)/es5510/es5510.c \ - $(CPUSRC)/es5510/es5510.h - - -#------------------------------------------------- -# Entertainment Sciences AM29116-based RIP -#@src/emu/cpu/esrip/esrip.h,CPUS += ESRIP -#------------------------------------------------- - -ifneq ($(filter ESRIP,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/esrip -CPUOBJS += $(CPUOBJ)/esrip/esrip.o -DASMOBJS += $(CPUOBJ)/esrip/esripdsm.o -endif - -$(CPUOBJ)/esrip/esrip.o: $(CPUSRC)/esrip/esrip.c \ - $(CPUSRC)/esrip/esrip.h - - - -#------------------------------------------------- -# RCA COSMAC -#@src/emu/cpu/cosmac/cosmac.h,CPUS += COSMAC -#------------------------------------------------- - -ifneq ($(filter COSMAC,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/cosmac -CPUOBJS += $(CPUOBJ)/cosmac/cosmac.o -DASMOBJS += $(CPUOBJ)/cosmac/cosdasm.o -endif - -$(CPUOBJ)/cosmac/cosmac.o: $(CPUSRC)/cosmac/cosmac.c \ - $(CPUSRC)/cosmac/cosmac.h - - - -#------------------------------------------------- -# National Semiconductor COP400 family -#@src/emu/cpu/cop400/cop400.h,CPUS += COP400 -#------------------------------------------------- - -ifneq ($(filter COP400,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/cop400 -CPUOBJS += $(CPUOBJ)/cop400/cop400.o -DASMOBJS += $(CPUOBJ)/cop400/cop410ds.o -DASMOBJS += $(CPUOBJ)/cop400/cop420ds.o -DASMOBJS += $(CPUOBJ)/cop400/cop440ds.o -endif - -$(CPUOBJ)/cop400/cop400.o: $(CPUSRC)/cop400/cop400.c \ - $(CPUSRC)/cop400/cop400.h \ - $(CPUSRC)/cop400/cop400op.inc - - - -#------------------------------------------------- -# CP1610 -#@src/emu/cpu/cp1610/cp1610.h,CPUS += CP1610 -#------------------------------------------------- - -ifneq ($(filter CP1610,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/cp1610 -CPUOBJS += $(CPUOBJ)/cp1610/cp1610.o -DASMOBJS += $(CPUOBJ)/cp1610/1610dasm.o -endif - -$(CPUOBJ)/cp1610/cp1610.o: $(CPUSRC)/cp1610/cp1610.c \ - $(CPUSRC)/cp1610/cp1610.h - - - -#------------------------------------------------- -# Cinematronics vector "CPU" -#@src/emu/cpu/ccpu/ccpu.h,CPUS += CCPU -#------------------------------------------------- - -ifneq ($(filter CCPU,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/ccpu -CPUOBJS += $(CPUOBJ)/ccpu/ccpu.o -DASMOBJS += $(CPUOBJ)/ccpu/ccpudasm.o -endif - -$(CPUOBJ)/ccpu/ccpu.o: $(CPUSRC)/ccpu/ccpu.c \ - $(CPUSRC)/ccpu/ccpu.h - - - -#------------------------------------------------- -# DEC T-11 -#@src/emu/cpu/t11/t11.h,CPUS += T11 -#------------------------------------------------- - -ifneq ($(filter T11,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/t11 -CPUOBJS += $(CPUOBJ)/t11/t11.o -DASMOBJS += $(CPUOBJ)/t11/t11dasm.o -endif - -$(CPUOBJ)/t11/t11.o: $(CPUSRC)/t11/t11.c \ - $(CPUSRC)/t11/t11.h \ - $(CPUSRC)/t11/t11ops.inc \ - $(CPUSRC)/t11/t11table.inc - - - -#------------------------------------------------- -# F8 -#@src/emu/cpu/f8/f8.h,CPUS += F8 -#------------------------------------------------- - -ifneq ($(filter F8,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/f8 -CPUOBJS += $(CPUOBJ)/f8/f8.o -DASMOBJS += $(CPUOBJ)/f8/f8dasm.o -endif - -$(CPUOBJ)/f8/f8.o: $(CPUSRC)/f8/f8.c \ - $(CPUSRC)/f8/f8.h - - - -#------------------------------------------------- -# G65816 -#@src/emu/cpu/g65816/g65816.h,CPUS += G65816 -#------------------------------------------------- - -ifneq ($(filter G65816,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/g65816 -CPUOBJS += \ - $(CPUOBJ)/g65816/g65816.o \ - $(CPUOBJ)/g65816/g65816o0.o \ - $(CPUOBJ)/g65816/g65816o1.o \ - $(CPUOBJ)/g65816/g65816o2.o \ - $(CPUOBJ)/g65816/g65816o3.o \ - $(CPUOBJ)/g65816/g65816o4.o -DASMOBJS += $(CPUOBJ)/g65816/g65816ds.o -endif - -G65816DEPS = \ - $(CPUSRC)/g65816/g65816.h \ - $(CPUSRC)/g65816/g65816cm.h \ - $(CPUSRC)/g65816/g65816op.h - -$(CPUOBJ)/g65816/g65816.o: $(CPUSRC)/g65816/g65816.c \ - $(G65816DEPS) - -$(CPUOBJ)/g65816/g65816o0.o: $(CPUSRC)/g65816/g65816o0.c \ - $(G65816DEPS) - -$(CPUOBJ)/g65816/g65816o1.o: $(CPUSRC)/g65816/g65816o1.c \ - $(G65816DEPS) - -$(CPUOBJ)/g65816/g65816o2.o: $(CPUSRC)/g65816/g65816o2.c \ - $(G65816DEPS) - -$(CPUOBJ)/g65816/g65816o3.o: $(CPUSRC)/g65816/g65816o3.c \ - $(G65816DEPS) - -$(CPUOBJ)/g65816/g65816o4.o: $(CPUSRC)/g65816/g65816o4.c \ - $(G65816DEPS) - - - -#------------------------------------------------- -# Hitachi H8 (16/32-bit H8/300, H8/300H, H8S2000 and H8S2600 series) -#@src/emu/cpu/h8/h8.h,CPUS += H8 -#------------------------------------------------- - -ifneq ($(filter H8,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/h8 -CPUOBJS += $(CPUOBJ)/h8/h8.o $(CPUOBJ)/h8/h8h.o $(CPUOBJ)/h8/h8s2000.o $(CPUOBJ)/h8/h8s2600.o \ - $(CPUOBJ)/h8/h83337.o \ - $(CPUOBJ)/h8/h83002.o $(CPUOBJ)/h8/h83006.o $(CPUOBJ)/h8/h83008.o \ - $(CPUOBJ)/h8/h83048.o \ - $(CPUOBJ)/h8/h8s2245.o $(CPUOBJ)/h8/h8s2320.o $(CPUOBJ)/h8/h8s2357.o \ - $(CPUOBJ)/h8/h8s2655.o \ - $(CPUOBJ)/h8/h8_adc.o $(CPUOBJ)/h8/h8_port.o $(CPUOBJ)/h8/h8_intc.o \ - $(CPUOBJ)/h8/h8_timer8.o $(CPUOBJ)/h8/h8_timer16.o $(CPUOBJ)/h8/h8_sci.o -DASMOBJS += -endif - -$(CPUOBJ)/h8/h8.o: $(CPUSRC)/h8/h8.c \ - $(CPUOBJ)/h8/h8.inc \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8h.o: $(CPUSRC)/h8/h8h.c \ - $(CPUOBJ)/h8/h8h.inc \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8s2000.o: $(CPUSRC)/h8/h8s2000.c \ - $(CPUOBJ)/h8/h8s2000.inc \ - $(CPUSRC)/h8/h8s2000.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8s2600.o: $(CPUSRC)/h8/h8s2600.c \ - $(CPUOBJ)/h8/h8s2600.inc \ - $(CPUSRC)/h8/h8s2600.h \ - $(CPUSRC)/h8/h8s2000.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h83337.o: $(CPUSRC)/h8/h83337.c \ - $(CPUSRC)/h8/h83337.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h83002.o: $(CPUSRC)/h8/h83002.c \ - $(CPUSRC)/h8/h83002.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h83006.o: $(CPUSRC)/h8/h83006.c \ - $(CPUSRC)/h8/h83006.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h83008.o: $(CPUSRC)/h8/h83008.c \ - $(CPUSRC)/h8/h83008.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h83048.o: $(CPUSRC)/h8/h83048.c \ - $(CPUSRC)/h8/h83048.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h8s2245.o: $(CPUSRC)/h8/h8s2245.c \ - $(CPUSRC)/h8/h8s2245.h \ - $(CPUSRC)/h8/h8s2000.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h8s2320.o: $(CPUSRC)/h8/h8s2320.c \ - $(CPUSRC)/h8/h8s2320.h \ - $(CPUSRC)/h8/h8s2000.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h8s2357.o: $(CPUSRC)/h8/h8s2357.c \ - $(CPUSRC)/h8/h8s2357.h \ - $(CPUSRC)/h8/h8s2000.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h8s2655.o: $(CPUSRC)/h8/h8s2655.c \ - $(CPUSRC)/h8/h8s2655.h \ - $(CPUSRC)/h8/h8s2600.h \ - $(CPUSRC)/h8/h8s2000.h \ - $(CPUSRC)/h8/h8h.h \ - $(CPUSRC)/h8/h8.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8_timer8.h \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_sci.h - -$(CPUOBJ)/h8/h8_intc.o: $(CPUSRC)/h8/h8_intc.c \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8_adc.o: $(CPUSRC)/h8/h8_adc.c \ - $(CPUSRC)/h8/h8_adc.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8_port.o: $(CPUSRC)/h8/h8_port.c \ - $(CPUSRC)/h8/h8_port.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8_timer16.o: $(CPUSRC)/h8/h8_timer16.c \ - $(CPUSRC)/h8/h8_timer16.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8.h - -$(CPUOBJ)/h8/h8_sci.o: $(CPUSRC)/h8/h8_sci.c \ - $(CPUSRC)/h8/h8_sci.h \ - $(CPUSRC)/h8/h8_intc.h \ - $(CPUSRC)/h8/h8.h - -# rule to generate the C files -$(CPUOBJ)/h8/h8.inc: $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst - @echo Generating H8-300 source file... - $(PYTHON) $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst o $@ - -$(CPUOBJ)/h8/h8h.inc: $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst - @echo Generating H8-300H source file... - $(PYTHON) $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst h $@ - -$(CPUOBJ)/h8/h8s2000.inc: $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst - @echo Generating H8S/2000 source file... - $(PYTHON) $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst s20 $@ - -$(CPUOBJ)/h8/h8s2600.inc: $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst - @echo Generating H8S/2600 source file... - $(PYTHON) $(CPUSRC)/h8/h8make.py $(CPUSRC)/h8/h8.lst s26 $@ - - - -#------------------------------------------------- -# Hitachi HCD62121 -#@src/emu/cpu/hcd62121/hcd62121.h,CPUS += HCD62121 -#------------------------------------------------- - -ifneq ($(filter HCD62121,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/hcd62121 -CPUOBJS += $(CPUOBJ)/hcd62121/hcd62121.o -DASMOBJS += $(CPUOBJ)/hcd62121/hcd62121d.o -endif - -$(CPUOBJ)/hcd62121/hcd62121.o: $(CPUSRC)/hcd62121/hcd62121.c \ - $(CPUSRC)/hcd62121/hcd62121.h \ - $(CPUSRC)/hcd62121/hcd62121_ops.h - - - -#------------------------------------------------- -# Hitachi HMCS40 series -#@src/emu/cpu/hmcs40/hmcs40.h,CPUS += HMCS40 -#------------------------------------------------- - -ifneq ($(filter HMCS40,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/hmcs40 -CPUOBJS += $(CPUOBJ)/hmcs40/hmcs40.o -DASMOBJS += $(CPUOBJ)/hmcs40/hmcs40d.o -endif - -$(CPUOBJ)/hmcs40/hmcs40.o: $(CPUSRC)/hmcs40/hmcs40.h \ - $(CPUSRC)/hmcs40/hmcs40.c \ - $(CPUSRC)/hmcs40/hmcs40op.inc - -$(CPUOBJ)/hmcs40/hmcs40d.o: $(CPUSRC)/hmcs40/hmcs40.h \ - $(CPUSRC)/hmcs40/hmcs40d.c - - - -#------------------------------------------------- -# Hitachi SH1/SH2 -#@src/emu/cpu/sh2/sh2.h,CPUS += SH2 -#------------------------------------------------- - -ifneq ($(filter SH2,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/sh2 -CPUOBJS += $(CPUOBJ)/sh2/sh2.o $(CPUOBJ)/sh2/sh2fe.o $(DRCOBJ) -DASMOBJS += $(CPUOBJ)/sh2/sh2dasm.o -endif - -$(CPUOBJ)/sh2/sh2.o: $(CPUSRC)/sh2/sh2.c \ - $(CPUSRC)/sh2/sh2.h \ - $(CPUSRC)/sh2/sh2comn.c \ - $(CPUSRC)/sh2/sh2drc.c \ - $(CPUSRC)/sh2/sh2comn.h \ - $(DRCDEPS) - -$(CPUOBJ)/sh2/sh2fe.o: $(CPUSRC)/sh2/sh2fe.c \ - $(CPUSRC)/sh2/sh2.h \ - $(CPUSRC)/sh2/sh2comn.h - - - -#------------------------------------------------- -# Hitachi SH4 -#@src/emu/cpu/sh4/sh4.h,CPUS += SH4 -#------------------------------------------------- - -ifneq ($(filter SH4,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/sh4 -CPUOBJS += $(CPUOBJ)/sh4/sh4.o $(CPUOBJ)/sh4/sh4comn.o $(CPUOBJ)/sh4/sh3comn.o $(CPUOBJ)/sh4/sh4tmu.o $(CPUOBJ)/sh4/sh4dmac.o -DASMOBJS += $(CPUOBJ)/sh4/sh4dasm.o -endif - -$(CPUOBJ)/sh4/sh4.o: $(CPUSRC)/sh4/sh4.c \ - $(CPUSRC)/sh4/sh4.h \ - $(CPUSRC)/sh4/sh4regs.h \ - $(CPUSRC)/sh4/sh4comn.h \ - $(CPUSRC)/sh4/sh3comn.h - -$(CPUOBJ)/sh4/sh4comn.o: $(CPUSRC)/sh4/sh4comn.c \ - $(CPUSRC)/sh4/sh4comn.h \ - $(CPUSRC)/sh4/sh4regs.h \ - $(CPUSRC)/sh4/sh4.h - -$(CPUOBJ)/sh4/sh3comn.o: $(CPUSRC)/sh4/sh3comn.c \ - $(CPUSRC)/sh4/sh3comn.h \ - -$(CPUOBJ)/sh4/sh4tmu.o: $(CPUSRC)/sh4/sh4tmu.c \ - $(CPUSRC)/sh4/sh4tmu.h \ - $(CPUSRC)/sh4/sh3comn.c \ - $(CPUSRC)/sh4/sh3comn.h \ - $(CPUSRC)/sh4/sh4.c \ - $(CPUSRC)/sh4/sh4.h \ - $(CPUSRC)/sh4/sh4regs.h \ - $(CPUSRC)/sh4/sh4comn.h \ - $(CPUSRC)/sh4/sh3comn.h - -$(CPUOBJ)/sh4/sh4dmac.o: $(CPUSRC)/sh4/sh4dmac.c \ - $(CPUSRC)/sh4/sh4dmac.h \ - $(CPUSRC)/sh4/sh3comn.c \ - $(CPUSRC)/sh4/sh3comn.h \ - $(CPUSRC)/sh4/sh4.c \ - $(CPUSRC)/sh4/sh4.h \ - $(CPUSRC)/sh4/sh4regs.h \ - $(CPUSRC)/sh4/sh4comn.h \ - $(CPUSRC)/sh4/sh3comn.h - - - -#------------------------------------------------- -# Hudsonsoft 6280 -#@src/emu/cpu/h6280/h6280.h,CPUS += H6280 -#------------------------------------------------- - -ifneq ($(filter H6280,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/h6280 -CPUOBJS += $(CPUOBJ)/h6280/h6280.o -DASMOBJS += $(CPUOBJ)/h6280/6280dasm.o -endif - -$(CPUOBJ)/h6280/h6280.o: $(CPUSRC)/h6280/h6280.c \ - $(CPUSRC)/h6280/h6280.h - - - -#------------------------------------------------- -# Hyperstone E1 series -#@src/emu/cpu/e132xs/e132xs.h,CPUS += E1 -#------------------------------------------------- - -ifneq ($(filter E1,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/e132xs -CPUOBJS += $(CPUOBJ)/e132xs/e132xs.o -DASMOBJS += $(CPUOBJ)/e132xs/32xsdasm.o -endif - -$(CPUOBJ)/e132xs/e132xs.o: $(CPUSRC)/e132xs/e132xs.c \ - $(CPUSRC)/e132xs/e132xs.h \ - $(CPUSRC)/e132xs/e132xsop.inc - - - -#------------------------------------------------- -# 15IE-00-013 CPU ("Microprogrammed Control Device") -#@src/emu/cpu/ie15/ie15.h,CPUS += IE15 -#------------------------------------------------- - -ifneq ($(filter IE15,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/ie15 -CPUOBJS += $(CPUOBJ)/ie15/ie15.o -DASMOBJS += $(CPUOBJ)/ie15/ie15dasm.o -endif - -$(CPUOBJ)/ie15/ie15.o: $(CPUSRC)/ie15/ie15.c \ - $(CPUSRC)/ie15/ie15.h - - -#------------------------------------------------- -# Intel 4004 -#@src/emu/cpu/i4004/i4004.h,CPUS += I4004 -#------------------------------------------------- - -ifneq ($(filter I4004,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i4004 -CPUOBJS += $(CPUOBJ)/i4004/i4004.o -DASMOBJS += $(CPUOBJ)/i4004/4004dasm.o -endif - -$(CPUOBJ)/i4004/i4004.o: $(CPUSRC)/i4004/i4004.c \ - $(CPUSRC)/i4004/i4004.h - - -#------------------------------------------------- -# Intel 8008 -#@src/emu/cpu/i8008/i8008.h,CPUS += I8008 -#------------------------------------------------- - -ifneq ($(filter I8008,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i8008 -CPUOBJS += $(CPUOBJ)/i8008/i8008.o -DASMOBJS += $(CPUOBJ)/i8008/8008dasm.o -endif - -$(CPUOBJ)/i8008/i8008.o: $(CPUSRC)/i8008/i8008.c \ - $(CPUSRC)/i8008/i8008.h - -#------------------------------------------------- -# National Semiconductor SC/MP -#@src/emu/cpu/scmp/scmp.h,CPUS += SCMP -#------------------------------------------------- - -ifneq ($(filter SCMP,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/scmp -CPUOBJS += $(CPUOBJ)/scmp/scmp.o -DASMOBJS += $(CPUOBJ)/scmp/scmpdasm.o -endif - -$(CPUOBJ)/scmp/scmp.o: $(CPUSRC)/scmp/scmp.c \ - $(CPUSRC)/scmp/scmp.h - - -#------------------------------------------------- -# Intel 8080/8085A -#@src/emu/cpu/i8085/i8085.h,CPUS += I8085 -#------------------------------------------------- - -ifneq ($(filter I8085,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i8085 -CPUOBJS += $(CPUOBJ)/i8085/i8085.o -DASMOBJS += $(CPUOBJ)/i8085/8085dasm.o -endif - -$(CPUOBJ)/i8085/i8085.o: $(CPUSRC)/i8085/i8085.c \ - $(CPUSRC)/i8085/i8085.h \ - $(CPUSRC)/i8085/i8085cpu.h - - -#------------------------------------------------- -# Intel 8089 -#@src/emu/cpu/i8085/i8089.h,CPUS += I8089 -#------------------------------------------------- - -ifneq ($(filter I8089,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i8089 -CPUOBJS += $(CPUOBJ)/i8089/i8089.o \ - $(CPUOBJ)/i8089/i8089_channel.o \ - $(CPUOBJ)/i8089/i8089_ops.o -DASMOBJS += $(CPUOBJ)/i8089/i8089_dasm.o -endif - -$(CPUOBJ)/i8089/i8089_ops.o: $(CPUSRC)/i8089/i8089_channel.h -$(CPUOBJ)/i8089/i8089_channel.o: $(CPUSRC)/i8089/i8089_channel.h - -$(CPUOBJ)/i8089/i8089.o: $(CPUSRC)/i8089/i8089.c \ - $(CPUSRC)/i8089/i8089.h - - -#------------------------------------------------- -# Intel MCS-48 (8039 and derivatives) -#@src/emu/cpu/mcs48/mcs48.h,CPUS += MCS48 -#------------------------------------------------- - -ifneq ($(filter MCS48,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mcs48 -CPUOBJS += $(CPUOBJ)/mcs48/mcs48.o -DASMOBJS += $(CPUOBJ)/mcs48/mcs48dsm.o -endif - -$(CPUOBJ)/mcs48/mcs48.o: $(CPUSRC)/mcs48/mcs48.c \ - $(CPUSRC)/mcs48/mcs48.h - - - -#------------------------------------------------- -# Intel 8051 and derivatives -#@src/emu/cpu/mcs51/mcs51.h,CPUS += MCS51 -#------------------------------------------------- - -ifneq ($(filter MCS51,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mcs51 -CPUOBJS += $(CPUOBJ)/mcs51/mcs51.o -DASMOBJS += $(CPUOBJ)/mcs51/mcs51dasm.o -endif - -$(CPUOBJ)/mcs51/mcs51.o: $(CPUSRC)/mcs51/mcs51.c \ - $(CPUSRC)/mcs51/mcs51.h \ - $(CPUSRC)/mcs51/mcs51ops.inc - -#------------------------------------------------- -# Intel MCS-96 -#@src/emu/cpu/mcs96/mcs96.h,CPUS += MCS96 -#------------------------------------------------- - -ifneq ($(filter MCS96,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mcs96 -CPUOBJS += $(CPUOBJ)/mcs96/mcs96.o \ - $(CPUOBJ)/mcs96/i8x9x.o \ - $(CPUOBJ)/mcs96/i8xc196.o -endif - -$(CPUOBJ)/mcs96/mcs96.o: $(CPUOBJ)/mcs96/mcs96.inc \ - $(CPUSRC)/mcs96/mcs96.c \ - $(CPUSRC)/mcs96/mcs96.h - -$(CPUOBJ)/mcs96/i8x9x.o: $(CPUOBJ)/mcs96/i8x9x.inc \ - $(CPUSRC)/mcs96/i8x9x.c \ - $(CPUSRC)/mcs96/i8x9x.h \ - $(CPUSRC)/mcs96/mcs96.h - -$(CPUOBJ)/mcs96/i8xc196.o: $(CPUOBJ)/mcs96/i8xc196.inc \ - $(CPUSRC)/mcs96/i8xc196.c \ - $(CPUSRC)/mcs96/i8xc196.c \ - $(CPUSRC)/mcs96/mcs96.h - -$(CPUOBJ)/mcs96/mcs96.inc: $(CPUSRC)/mcs96/mcs96make.py $(CPUSRC)/mcs96/mcs96ops.lst - @echo Generating mcs96 source file... - $(PYTHON) $(CPUSRC)/mcs96/mcs96make.py mcs96 $(CPUSRC)/mcs96/mcs96ops.lst $@ - -$(CPUOBJ)/mcs96/i8x9x.inc: $(CPUSRC)/mcs96/mcs96make.py $(CPUSRC)/mcs96/mcs96ops.lst - @echo Generating i8x9x source file... - $(PYTHON) $(CPUSRC)/mcs96/mcs96make.py i8x9x $(CPUSRC)/mcs96/mcs96ops.lst $@ - -$(CPUOBJ)/mcs96/i8xc196.inc: $(CPUSRC)/mcs96/mcs96make.py $(CPUSRC)/mcs96/mcs96ops.lst - @echo Generating i8xc196 source file... - $(PYTHON) $(CPUSRC)/mcs96/mcs96make.py i8xc196 $(CPUSRC)/mcs96/mcs96ops.lst $@ - -#------------------------------------------------- -# Intel 80x86 series -#@src/emu/cpu/i86/i86.h,CPUS += I86 -#@src/emu/cpu/i86/i286.h,CPUS += I86 -#@src/emu/cpu/i386/i386.h,CPUS += I386 -#------------------------------------------------- - -ifneq ($(filter I86,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i86 $(CPUOBJ)/i386 -CPUOBJS += $(CPUOBJ)/i86/i86.o -CPUOBJS += $(CPUOBJ)/i86/i186.o -CPUOBJS += $(CPUOBJ)/i86/i286.o -DASMOBJS += $(CPUOBJ)/i386/i386dasm.o -endif - -ifneq ($(filter I386,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i386 -CPUOBJS += $(CPUOBJ)/i386/i386.o -DASMOBJS += $(CPUOBJ)/i386/i386dasm.o -endif - -$(CPUOBJ)/i86/i86.o: $(CPUSRC)/i86/i86.c \ - $(CPUSRC)/i86/i86.h \ - $(CPUSRC)/i86/i86inline.h - -$(CPUOBJ)/i86/i186.o: $(CPUSRC)/i86/i186.c \ - $(CPUSRC)/i86/i86.h \ - $(CPUSRC)/i86/i186.h \ - $(CPUSRC)/i86/i86inline.h - -$(CPUOBJ)/i86/i286.o: $(CPUSRC)/i86/i286.c \ - $(CPUSRC)/i86/i86.h \ - $(CPUSRC)/i86/i286.h \ - $(CPUSRC)/i86/i86inline.h - -$(CPUOBJ)/i386/i386.o: $(CPUSRC)/i386/i386.c \ - $(CPUSRC)/i386/i386.h \ - $(CPUSRC)/i386/i386priv.h \ - $(CPUSRC)/i386/i386op16.inc \ - $(CPUSRC)/i386/i386op32.inc \ - $(CPUSRC)/i386/i386ops.inc \ - $(CPUSRC)/i386/i486ops.inc \ - $(CPUSRC)/i386/pentops.inc \ - $(CPUSRC)/i386/x87ops.inc \ - $(CPUSRC)/i386/i386ops.h \ - $(CPUSRC)/i386/cycles.h - - - -#------------------------------------------------- -# Intel i860 -#@src/emu/cpu/i860/i860.h,CPUS += I860 -#------------------------------------------------- - -ifneq ($(filter I860,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i860 -CPUOBJS += $(CPUOBJ)/i860/i860.o -DASMOBJS += $(CPUOBJ)/i860/i860dis.o -endif - -$(CPUOBJ)/i860/i860.o: $(CPUSRC)/i860/i860.c \ - $(CPUSRC)/i860/i860.h \ - $(CPUSRC)/i860/i860dec.inc - -#------------------------------------------------- -# Intel i960 -#@src/emu/cpu/i960/i960.h,CPUS += I960 -#------------------------------------------------- - -ifneq ($(filter I960,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/i960 -CPUOBJS += $(CPUOBJ)/i960/i960.o -DASMOBJS += $(CPUOBJ)/i960/i960dis.o -endif - -$(CPUOBJ)/i960/i960.o: $(CPUSRC)/i960/i960.c \ - $(CPUSRC)/i960/i960.h - - - -#------------------------------------------------- -# LH5801 -#@src/emu/cpu/lh5801/lh5801.h,CPUS += LH5801 -#------------------------------------------------- - -ifneq ($(filter LH5801,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/lh5801 -CPUOBJS += $(CPUOBJ)/lh5801/lh5801.o -DASMOBJS += $(CPUOBJ)/lh5801/5801dasm.o -endif - -$(CPUOBJ)/lh5801/lh5801.o: $(CPUSRC)/lh5801/lh5801.c \ - $(CPUSRC)/lh5801/5801tbl.inc \ - $(CPUSRC)/lh5801/lh5801.h - - - -#------------------------------------------------- -# Manchester Small-Scale Experimental Machine -#@src/emu/cpu/ssem/ssem.h,CPUS += SSEM -#------------------------------------------------- - -ifneq ($(filter SSEM,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/ssem -CPUOBJS += $(CPUOBJ)/ssem/ssem.o -DASMOBJS += $(CPUOBJ)/ssem/ssemdasm.o -endif - -$(CPUOBJ)/ssem/ssem.o: $(CPUSRC)/ssem/ssem.c \ - $(CPUSRC)/ssem/ssem.h - - - -#------------------------------------------------- -# Fujitsu MB88xx -#@src/emu/cpu/mb88xx/mb88xx.h,CPUS += MB88XX -#------------------------------------------------- - -ifneq ($(filter MB88XX,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mb88xx -CPUOBJS += $(CPUOBJ)/mb88xx/mb88xx.o -DASMOBJS += $(CPUOBJ)/mb88xx/mb88dasm.o -endif - -$(CPUOBJ)/mb88xx/mb88xx.o: $(CPUSRC)/mb88xx/mb88xx.c \ - $(CPUSRC)/mb88xx/mb88xx.h - - - -#------------------------------------------------- -# Fujitsu MB86233 -#@src/emu/cpu/mb86233/mb86233.h,CPUS += MB86233 -#------------------------------------------------- - -ifneq ($(filter MB86233,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mb86233 -CPUOBJS += $(CPUOBJ)/mb86233/mb86233.o -DASMOBJS += $(CPUOBJ)/mb86233/mb86233d.o -endif - -$(CPUOBJ)/mb86233/mb86233.o: $(CPUSRC)/mb86233/mb86233.c \ - $(CPUSRC)/mb86233/mb86233.h - -#------------------------------------------------- -# Fujitsu MB86235 -#@src/emu/cpu/mb86233/mb86235.h,CPUS += MB86235 -#------------------------------------------------- - -ifneq ($(filter MB86235,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mb86235 -CPUOBJS += $(CPUOBJ)/mb86235/mb86235.o -DASMOBJS += $(CPUOBJ)/mb86235/mb86235d.o -endif - -$(CPUOBJ)/mb86233/mb86235.o: $(CPUSRC)/mb86233/mb86235.c \ - $(CPUSRC)/mb86235/mb86235.h - - -#------------------------------------------------- -# Microchip PIC16C5x -#@src/emu/cpu/pic16c5x/pic16c5x.h,CPUS += PIC16C5X -#------------------------------------------------- - -ifneq ($(filter PIC16C5X,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/pic16c5x -CPUOBJS += $(CPUOBJ)/pic16c5x/pic16c5x.o -DASMOBJS += $(CPUOBJ)/pic16c5x/16c5xdsm.o -endif - -$(CPUOBJ)/pic16c5x/pic16c5x.o: $(CPUSRC)/pic16c5x/pic16c5x.c \ - $(CPUSRC)/pic16c5x/pic16c5x.h - - - -#------------------------------------------------- -# Microchip PIC16C62x -#@src/emu/cpu/pic16c62x/pic16c62x.h,CPUS += PIC16C62X -#------------------------------------------------- - -ifneq ($(filter PIC16C62X,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/pic16c62x -CPUOBJS += $(CPUOBJ)/pic16c62x/pic16c62x.o -DASMOBJS += $(CPUOBJ)/pic16c62x/16c62xdsm.o -endif - -$(CPUOBJ)/pic16c62x/pic16c62x.o: $(CPUSRC)/pic16c62x/pic16c62x.c \ - $(CPUSRC)/pic16c62x/pic16c62x.h - - - -#------------------------------------------------- -# MIPS R3000 (MIPS I/II) series -# MIPS R4000 (MIPS III/IV) series -#@src/emu/cpu/mips/mips3.h,CPUS += MIPS -#------------------------------------------------- - -ifneq ($(filter MIPS,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mips -CPUOBJS += $(CPUOBJ)/mips/r3000.o -CPUOBJS += $(CPUOBJ)/mips/mips3com.o $(CPUOBJ)/mips/mips3.o $(CPUOBJ)/mips/mips3fe.o $(CPUOBJ)/mips/mips3drc.o $(DRCOBJ) -DASMOBJS += $(CPUOBJ)/mips/r3kdasm.o -DASMOBJS += $(CPUOBJ)/mips/mips3dsm.o -endif - -$(CPUOBJ)/mips/r3000.o: $(CPUSRC)/mips/r3000.c \ - $(CPUSRC)/mips/r3000.h - -$(CPUOBJ)/mips/mips3.o: $(CPUSRC)/mips/mips3.h $(CPUSRC)/mips/mips3com.h \ - $(CPUSRC)/mips/mips3.c - -$(CPUOBJ)/mips/mips3com.o: $(CPUSRC)/mips/mips3.h \ - $(CPUSRC)/mips/mips3com.h - -$(CPUOBJ)/mips/mips3fe.o: $(CPUSRC)/mips/mips3.h \ - $(CPUSRC)/mips/mips3com.h \ - $(CPUSRC)/mips/mips3fe.h - -$(CPUOBJ)/mips/mips3drc.o: $(CPUSRC)/mips/mips3drc.c \ - $(CPUSRC)/mips/mips3.h \ - $(CPUSRC)/mips/mips3com.h \ - $(CPUSRC)/mips/mips3fe.h \ - $(DRCDEPS) - - - -#------------------------------------------------- -# Sony PlayStation CPU (R3000-based + GTE) -#@src/emu/cpu/psx/psx.h,CPUS += PSX -#------------------------------------------------- - -ifneq ($(filter PSX,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/psx -CPUOBJS += $(CPUOBJ)/psx/psx.o $(CPUOBJ)/psx/gte.o $(CPUOBJ)/psx/dma.o $(CPUOBJ)/psx/irq.o $(CPUOBJ)/psx/mdec.o $(CPUOBJ)/psx/rcnt.o $(CPUOBJ)/psx/sio.o -DASMOBJS += $(CPUOBJ)/psx/psxdasm.o -endif - -$(CPUOBJ)/psx/psx.o: $(CPUSRC)/psx/psx.c \ - $(CPUSRC)/psx/psx.h \ - $(CPUSRC)/psx/dma.h \ - $(CPUSRC)/psx/gte.h \ - $(CPUSRC)/psx/mdec.h \ - $(CPUSRC)/psx/rcnt.h \ - $(CPUSRC)/psx/sio.h - -$(CPUOBJ)/psx/dma.o: $(CPUSRC)/psx/dma.c \ - $(CPUSRC)/psx/dma.h - -$(CPUOBJ)/psx/gte.o: $(CPUSRC)/psx/gte.c \ - $(CPUSRC)/psx/gte.h - -$(CPUOBJ)/psx/mdec.o: $(CPUSRC)/psx/mdec.c \ - $(CPUSRC)/psx/dma.h \ - $(CPUSRC)/psx/mdec.h - -$(CPUOBJ)/psx/sio.o: $(CPUSRC)/psx/sio.c \ - $(CPUSRC)/psx/sio.h - - -#------------------------------------------------- -# Mitsubishi M37702 and M37710 (based on 65C816) -#@src/emu/cpu/m37710/m37710.h,CPUS += M37710 -#------------------------------------------------- - -ifneq ($(filter M37710,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/m37710 -CPUOBJS += \ - $(CPUOBJ)/m37710/m37710.o \ - $(CPUOBJ)/m37710/m37710o0.o \ - $(CPUOBJ)/m37710/m37710o1.o \ - $(CPUOBJ)/m37710/m37710o2.o \ - $(CPUOBJ)/m37710/m37710o3.o -DASMOBJS += $(CPUOBJ)/m37710/m7700ds.o -endif - -M37710DEPS = \ - $(CPUSRC)/m37710/m37710.h \ - $(CPUSRC)/m37710/m37710cm.h \ - $(CPUSRC)/m37710/m37710il.h \ - $(CPUSRC)/m37710/m37710op.h \ - $(CPUSRC)/m37710/m7700ds.h - -$(CPUOBJ)/m37710/m37710.o: $(CPUSRC)/m37710/m37710.c \ - $(M37710DEPS) - -$(CPUOBJ)/m37710/m37710o0.o: $(CPUSRC)/m37710/m37710o0.c \ - $(M37710DEPS) - -$(CPUOBJ)/m37710/m37710o1.o: $(CPUSRC)/m37710/m37710o1.c \ - $(M37710DEPS) - -$(CPUOBJ)/m37710/m37710o2.o: $(CPUSRC)/m37710/m37710o2.c \ - $(M37710DEPS) - -$(CPUOBJ)/m37710/m37710o3.o: $(CPUSRC)/m37710/m37710o3.c \ - $(M37710DEPS) - -$(CPUOBJ)/m37710/m7700ds.o: $(CPUSRC)/m37710/m7700ds.c \ - $(CPUSRC)/m37710/m7700ds.h - - - -#------------------------------------------------- -# Mostek 6502 and its many derivatives -#@src/emu/cpu/m6502/m6502.h,CPUS += M6502 -#@src/emu/cpu/m6502/deco16.h,CPUS += M6502 -#@src/emu/cpu/m6502/m4510.h,CPUS += M6502 -#@src/emu/cpu/m6502/m65ce02.h,CPUS += M6502 -#@src/emu/cpu/m6502/m65c02.h,CPUS += M6502 -#@src/emu/cpu/m6502/r65c02.h,CPUS += M6502 -#@src/emu/cpu/m6502/m65sc02.h,CPUS += M6502 -#@src/emu/cpu/m6502/m6504.h,CPUS += M6502 -#@src/emu/cpu/m6502/m6509.h,CPUS += M6502 -#@src/emu/cpu/m6502/m6510.h,CPUS += M6502 -#@src/emu/cpu/m6502/m6510t.h,CPUS += M6502 -#@src/emu/cpu/m6502/m7501.h,CPUS += M6502 -#@src/emu/cpu/m6502/m8502.h,CPUS += M6502 -#@src/emu/cpu/m6502/n2a03.h,CPUS += M6502 -#@src/emu/cpu/m6502/m740.h,CPUS += M6502 -#@src/emu/cpu/m6502/m3745x.h,CPUS += M6502 -#@src/emu/cpu/m6502/m5074x.h,CPUS += M6502 - -#------------------------------------------------- - -ifneq ($(filter M6502,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/m6502 -CPUOBJS += $(CPUOBJ)/m6502/deco16.o \ - $(CPUOBJ)/m6502/m4510.o \ - $(CPUOBJ)/m6502/m6502.o \ - $(CPUOBJ)/m6502/m65c02.o \ - $(CPUOBJ)/m6502/m65ce02.o \ - $(CPUOBJ)/m6502/m65sc02.o \ - $(CPUOBJ)/m6502/m6504.o \ - $(CPUOBJ)/m6502/m6509.o \ - $(CPUOBJ)/m6502/m6510.o \ - $(CPUOBJ)/m6502/m6510t.o \ - $(CPUOBJ)/m6502/m7501.o \ - $(CPUOBJ)/m6502/m8502.o \ - $(CPUOBJ)/m6502/n2a03.o \ - $(CPUOBJ)/m6502/r65c02.o \ - $(CPUOBJ)/m6502/m740.o \ - $(CPUOBJ)/m6502/m3745x.o \ - $(CPUOBJ)/m6502/m5074x.o \ - -DASMOBJS += -endif - -$(CPUOBJ)/m6502/deco16.o: $(CPUSRC)/m6502/deco16.c \ - $(CPUOBJ)/m6502/deco16.inc \ - $(CPUSRC)/m6502/deco16.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m4510.o: $(CPUSRC)/m6502/m4510.c \ - $(CPUOBJ)/m6502/m4510.inc \ - $(CPUSRC)/m6502/m4510.h \ - $(CPUSRC)/m6502/m65ce02.h \ - $(CPUSRC)/m6502/m65c02.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m6502.o: $(CPUSRC)/m6502/m6502.c \ - $(CPUOBJ)/m6502/m6502.inc \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m65c02.o: $(CPUSRC)/m6502/m65c02.c \ - $(CPUOBJ)/m6502/m65c02.inc \ - $(CPUSRC)/m6502/m65c02.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m65ce02.o: $(CPUSRC)/m6502/m65ce02.c \ - $(CPUOBJ)/m6502/m65ce02.inc \ - $(CPUSRC)/m6502/m65ce02.h \ - $(CPUSRC)/m6502/m65c02.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m65sc02.o: $(CPUSRC)/m6502/m65sc02.c \ - $(CPUSRC)/m6502/m65sc02.h \ - $(CPUSRC)/m6502/r65c02.h \ - $(CPUSRC)/m6502/m65c02.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m6504.o: $(CPUSRC)/m6502/m6504.c \ - $(CPUSRC)/m6502/m6504.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m6509.o: $(CPUSRC)/m6502/m6509.c \ - $(CPUOBJ)/m6502/m6509.inc \ - $(CPUSRC)/m6502/m6509.h - -$(CPUOBJ)/m6502/m6510.o: $(CPUSRC)/m6502/m6510.c \ - $(CPUOBJ)/m6502/m6510.inc \ - $(CPUSRC)/m6502/m6510.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m6510t.o: $(CPUSRC)/m6502/m6510t.c \ - $(CPUSRC)/m6502/m6510t.h \ - $(CPUSRC)/m6502/m6510.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m7501.o: $(CPUSRC)/m6502/m7501.c \ - $(CPUSRC)/m6502/m7501.h \ - $(CPUSRC)/m6502/m6510.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m8502.o: $(CPUSRC)/m6502/m8502.c \ - $(CPUSRC)/m6502/m8502.h \ - $(CPUSRC)/m6502/m6510.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/n2a03.o: $(CPUSRC)/m6502/n2a03.c \ - $(CPUOBJ)/m6502/n2a03.inc \ - $(CPUSRC)/m6502/n2a03.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/r65c02.o: $(CPUSRC)/m6502/r65c02.c \ - $(CPUOBJ)/m6502/r65c02.inc \ - $(CPUSRC)/m6502/r65c02.h \ - $(CPUSRC)/m6502/m65c02.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m740.o: $(CPUSRC)/m6502/m740.c \ - $(CPUOBJ)/m6502/m740.inc \ - $(CPUSRC)/m6502/m740.h \ - $(CPUSRC)/m6502/m6502.h - -$(CPUOBJ)/m6502/m3745x.o: $(CPUSRC)/m6502/m3745x.c \ - $(CPUSRC)/m6502/m3745x.h - -$(CPUOBJ)/m6502/m5074x.o: $(CPUSRC)/m6502/m5074x.c \ - $(CPUSRC)/m6502/m5074x.h - -# rule to generate the C files -$(CPUOBJ)/m6502/deco16.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/odeco16.lst $(CPUSRC)/m6502/ddeco16.lst - @echo Generating deco16 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py deco16_device $(CPUSRC)/m6502/odeco16.lst $(CPUSRC)/m6502/ddeco16.lst $@ - -$(CPUOBJ)/m6502/m4510.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om4510.lst $(CPUSRC)/m6502/dm4510.lst - @echo Generating m4510 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m4510_device $(CPUSRC)/m6502/om4510.lst $(CPUSRC)/m6502/dm4510.lst $@ - -$(CPUOBJ)/m6502/m6502.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om6502.lst $(CPUSRC)/m6502/dm6502.lst - @echo Generating m6502 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m6502_device $(CPUSRC)/m6502/om6502.lst $(CPUSRC)/m6502/dm6502.lst $@ - -$(CPUOBJ)/m6502/m65c02.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om65c02.lst $(CPUSRC)/m6502/dm65c02.lst - @echo Generating m65c02 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m65c02_device $(CPUSRC)/m6502/om65c02.lst $(CPUSRC)/m6502/dm65c02.lst $@ - -$(CPUOBJ)/m6502/m65ce02.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om65ce02.lst $(CPUSRC)/m6502/dm65ce02.lst - @echo Generating m65ce02 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m65ce02_device $(CPUSRC)/m6502/om65ce02.lst $(CPUSRC)/m6502/dm65ce02.lst $@ - -$(CPUOBJ)/m6502/m6509.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om6509.lst $(CPUSRC)/m6502/dm6509.lst - @echo Generating m6509 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m6509_device $(CPUSRC)/m6502/om6509.lst $(CPUSRC)/m6502/dm6509.lst $@ - -$(CPUOBJ)/m6502/m6510.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om6510.lst $(CPUSRC)/m6502/dm6510.lst - @echo Generating m6510 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m6510_device $(CPUSRC)/m6502/om6510.lst $(CPUSRC)/m6502/dm6510.lst $@ - -$(CPUOBJ)/m6502/n2a03.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/on2a03.lst $(CPUSRC)/m6502/dn2a03.lst - @echo Generating n2a03 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py n2a03_device $(CPUSRC)/m6502/on2a03.lst $(CPUSRC)/m6502/dn2a03.lst $@ - -$(CPUOBJ)/m6502/r65c02.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/dr65c02.lst - @echo Generating r65c02 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py r65c02_device - $(CPUSRC)/m6502/dr65c02.lst $@ - -$(CPUOBJ)/m6502/m740.inc: $(CPUSRC)/m6502/m6502make.py $(CPUSRC)/m6502/om740.lst $(CPUSRC)/m6502/dm740.lst - @echo Generating m740 source file... - $(PYTHON) $(CPUSRC)/m6502/m6502make.py m740_device $(CPUSRC)/m6502/om740.lst $(CPUSRC)/m6502/dm740.lst $@ - -#------------------------------------------------- -# Motorola 680x -#@src/emu/cpu/m6800/m6800.h,CPUS += M6800 -#------------------------------------------------- - -ifneq ($(filter M6800,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/m6800 -CPUOBJS += $(CPUOBJ)/m6800/m6800.o -DASMOBJS += $(CPUOBJ)/m6800/6800dasm.o -endif - -$(CPUOBJ)/m6800/m6800.o: $(CPUSRC)/m6800/m6800.c \ - $(CPUSRC)/m6800/m6800.h \ - $(CPUSRC)/m6800/6800ops.inc \ - $(CPUSRC)/m6800/6800tbl.inc - - - -#------------------------------------------------- -# Motorola 6805 -#@src/emu/cpu/m6805/m6805.h,CPUS += M6805 -#------------------------------------------------- - -ifneq ($(filter M6805,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/m6805 -CPUOBJS += $(CPUOBJ)/m6805/m6805.o -DASMOBJS += $(CPUOBJ)/m6805/6805dasm.o -endif - -$(CPUOBJ)/m6805/m6805.o: $(CPUSRC)/m6805/m6805.c \ - $(CPUSRC)/m6805/m6805.h \ - $(CPUSRC)/m6805/6805ops.inc - - - -#------------------------------------------------- -# Motorola 6809 -#@src/emu/cpu/m6809/m6809.h,CPUS += M6809 -#@src/emu/cpu/m6809/hd6309.h,CPUS += M6809 -#@src/emu/cpu/m6809/konami.h,CPUS += M6809 -#------------------------------------------------- - -ifneq ($(filter M6809,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/m6809 -CPUOBJS += $(CPUOBJ)/m6809/m6809.o $(CPUOBJ)/m6809/hd6309.o $(CPUOBJ)/m6809/konami.o -DASMOBJS += $(CPUOBJ)/m6809/6809dasm.o $(CPUOBJ)/m6809/6309dasm.o $(CPUOBJ)/m6809/knmidasm.o -endif - -$(CPUOBJ)/m6809/m6809.o: $(CPUSRC)/m6809/m6809.c \ - $(CPUSRC)/m6809/m6809.h \ - $(CPUSRC)/m6809/m6809inl.h \ - $(CPUOBJ)/m6809/m6809.inc - -$(CPUOBJ)/m6809/hd6309.o: $(CPUSRC)/m6809/hd6309.c \ - $(CPUSRC)/m6809/hd6309.h \ - $(CPUSRC)/m6809/m6809.h \ - $(CPUSRC)/m6809/m6809inl.h \ - $(CPUOBJ)/m6809/hd6309.inc - - -$(CPUOBJ)/m6809/konami.o: $(CPUSRC)/m6809/konami.c \ - $(CPUSRC)/m6809/konami.h \ - $(CPUSRC)/m6809/m6809.h \ - $(CPUSRC)/m6809/m6809inl.h \ - $(CPUOBJ)/m6809/konami.inc - -$(CPUOBJ)/m6809/m6809.inc: $(CPUSRC)/m6809/m6809make.py $(CPUSRC)/m6809/m6809.ops $(CPUSRC)/m6809/base6x09.ops - @echo Generating m6809 source file... - $(PYTHON) $(CPUSRC)/m6809/m6809make.py $(CPUSRC)/m6809/m6809.ops > $@ - -$(CPUOBJ)/m6809/hd6309.inc: $(CPUSRC)/m6809/m6809make.py $(CPUSRC)/m6809/hd6309.ops $(CPUSRC)/m6809/base6x09.ops - @echo Generating hd6309 source file... - $(PYTHON) $(CPUSRC)/m6809/m6809make.py $(CPUSRC)/m6809/hd6309.ops > $@ - -$(CPUOBJ)/m6809/konami.inc: $(CPUSRC)/m6809/m6809make.py $(CPUSRC)/m6809/konami.ops $(CPUSRC)/m6809/base6x09.ops - @echo Generating konami source file... - $(PYTHON) $(CPUSRC)/m6809/m6809make.py $(CPUSRC)/m6809/konami.ops > $@ - - - -#------------------------------------------------- -# Motorola 68HC11 -#@src/emu/cpu/mc68hc11/mc68hc11.h,CPUS += MC68HC11 -#------------------------------------------------- - -ifneq ($(filter MC68HC11,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mc68hc11 -CPUOBJS += $(CPUOBJ)/mc68hc11/mc68hc11.o -DASMOBJS += $(CPUOBJ)/mc68hc11/hc11dasm.o -endif - -$(CPUOBJ)/mc68hc11/mc68hc11.o: $(CPUSRC)/mc68hc11/mc68hc11.c \ - $(CPUSRC)/mc68hc11/mc68hc11.h \ - $(CPUSRC)/mc68hc11/hc11ops.inc \ - $(CPUSRC)/mc68hc11/hc11ops.h - - - -#------------------------------------------------- -# Motorola 68000 series -#@src/emu/cpu/m68000/m68000.h,CPUS += M680X0 -#------------------------------------------------- - -ifneq ($(filter M680X0,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/m68000 -CPUOBJS += $(CPUOBJ)/m68000/m68kcpu.o $(CPUOBJ)/m68000/m68kops.o \ - -DASMOBJS += $(CPUOBJ)/m68000/m68kdasm.o -ifndef M68KMAKE -M68KMAKE = $(BUILDOUT)/m68kmake$(BUILD_EXE) -endif -endif - -# when we compile source files we need to include generated files from the OBJ directory -$(CPUOBJ)/m68000/%.o: $(CPUSRC)/m68000/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -I$(CPUOBJ)/m68000 -c $< -o $@ - -# when we compile generated files we need to include stuff from the src directory -$(CPUOBJ)/m68000/%.o: $(CPUOBJ)/m68000/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -I$(CPUSRC)/m68000 -I$(CPUOBJ)/m68000 -c $< -o $@ - -# rule to generate the C files -$(CPUOBJ)/m68000/m68kops.c: $(M68KMAKE) $(CPUSRC)/m68000/m68k_in.c - @echo Generating M68K source files... - $(M68KMAKE) $(CPUOBJ)/m68000 $(CPUSRC)/m68000/m68k_in.c - -# rule to build the generator -ifneq ($(CROSS_BUILD),1) - -BUILD += $(M68KMAKE) - -$(M68KMAKE): $(CPUOBJ)/m68000/m68kmake.o $(LIBOCORE) - @echo Linking $@... - $(LD) $(LDFLAGS) $(OSDBGLDFLAGS) $^ $(BASELIBS) -o $@ -endif - -# rule to ensure we build the header before building the core CPU file -$(CPUOBJ)/m68000/m68kcpu.o: $(CPUOBJ)/m68000/m68kops.c \ - $(CPUSRC)/m68000/m68kcpu.h $(CPUSRC)/m68000/m68kfpu.inc $(CPUSRC)/m68000/m68kmmu.h - -# m68kcpu.h now includes m68kops.h; m68kops.h won't exist until m68kops.c has been made -$(CPUSRC)/m68000/m68kcpu.h: $(CPUOBJ)/m68000/m68kops.c - - - -#------------------------------------------------- -# Motorola/Freescale dsp56k -#@src/emu/cpu/dsp56k/dsp56k.h,CPUS += DSP56156 -#------------------------------------------------- - -ifneq ($(filter DSP56156,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/dsp56k -CPUOBJS += $(CPUOBJ)/dsp56k/dsp56k.o -CPUOBJS += $(CPUOBJ)/dsp56k/dsp56mem.o -CPUOBJS += $(CPUOBJ)/dsp56k/dsp56pcu.o -DASMOBJS += $(CPUOBJ)/dsp56k/dsp56dsm.o -DASMOBJS += $(CPUOBJ)/dsp56k/opcode.o -DASMOBJS += $(CPUOBJ)/dsp56k/inst.o -DASMOBJS += $(CPUOBJ)/dsp56k/pmove.o -DASMOBJS += $(CPUOBJ)/dsp56k/tables.o -endif - -$(CPUOBJ)/dsp56k/dsp56mem.o: $(CPUSRC)/dsp56k/dsp56mem.c \ - $(CPUSRC)/dsp56k/dsp56mem.h - -$(CPUOBJ)/dsp56k/dsp56pcu.o: $(CPUSRC)/dsp56k/dsp56pcu.c \ - $(CPUSRC)/dsp56k/dsp56pcu.h - -$(CPUOBJ)/dsp56k/dsp56k.o: $(CPUSRC)/dsp56k/dsp56k.c \ - $(CPUSRC)/dsp56k/dsp56k.h \ - $(CPUSRC)/dsp56k/dsp56ops.inc - -$(CPUOBJ)/dsp56k/opcode.o: $(CPUSRC)/dsp56k/opcode.c \ - $(CPUSRC)/dsp56k/opcode.h - -$(CPUOBJ)/dsp56k/inst.o: $(CPUSRC)/dsp56k/inst.c \ - $(CPUSRC)/dsp56k/inst.h - -$(CPUOBJ)/dsp56k/pmove.o: $(CPUSRC)/dsp56k/pmove.c \ - $(CPUSRC)/dsp56k/pmove.h - -$(CPUOBJ)/dsp56k/tables.o: $(CPUSRC)/dsp56k/tables.c \ - $(CPUSRC)/dsp56k/tables.h - -$(CPUOBJ)/dsp56k/dsp56dsm.o: $(CPUSRC)/dsp56k/opcode.c \ - $(CPUSRC)/dsp56k/opcode.h \ - $(CPUSRC)/dsp56k/inst.c \ - $(CPUSRC)/dsp56k/inst.h \ - $(CPUSRC)/dsp56k/pmove.c \ - $(CPUSRC)/dsp56k/pmove.h \ - $(CPUSRC)/dsp56k/tables.c \ - $(CPUSRC)/dsp56k/tables.h - - -#------------------------------------------------- -# PDP-1 -# TX0 -#@src/emu/cpu/pdp1/pdp1.h,CPUS += PDP1 -#@src/emu/cpu/pdp1/tx0.h,CPUS += PDP1 -#------------------------------------------------- - -ifneq ($(filter PDP1,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/pdp1 -CPUOBJS += $(CPUOBJ)/pdp1/pdp1.o -CPUOBJS += $(CPUOBJ)/pdp1/tx0.o -DASMOBJS += $(CPUOBJ)/pdp1/pdp1dasm.o -DASMOBJS += $(CPUOBJ)/pdp1/tx0dasm.o -endif - -$(CPUOBJ)/pdp1/pdp1.o: $(CPUSRC)/pdp1/pdp1.c \ - $(CPUSRC)/pdp1/pdp1.h - -$(CPUOBJ)/pdp1/tx0.o: $(CPUSRC)/pdp1/tx0.h \ - $(CPUSRC)/pdp1/tx0.c - -$(CPUOBJ)/pdp1/tx0dasm.o: $(CPUSRC)/pdp1/tx0.h \ - $(CPUSRC)/pdp1/tx0dasm.c - - -#------------------------------------------------- -# Motorola PowerPC series -#@src/emu/cpu/powerpc/ppc.h,CPUS += POWERPC -#------------------------------------------------- - -ifneq ($(filter POWERPC,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/powerpc -CPUOBJS += $(CPUOBJ)/powerpc/ppccom.o $(CPUOBJ)/powerpc/ppcfe.o $(CPUOBJ)/powerpc/ppcdrc.o $(DRCOBJ) -DASMOBJS += $(CPUOBJ)/powerpc/ppc_dasm.o -endif - -$(CPUOBJ)/powerpc/ppccom.o: $(CPUSRC)/powerpc/ppc.h \ - $(CPUSRC)/powerpc/ppccom.h - -$(CPUOBJ)/powerpc/ppcfe.o: $(CPUSRC)/powerpc/ppc.h \ - $(CPUSRC)/powerpc/ppccom.h \ - $(CPUSRC)/powerpc/ppcfe.h - -$(CPUOBJ)/powerpc/ppcdrc.o: $(CPUSRC)/powerpc/ppcdrc.c \ - $(CPUSRC)/powerpc/ppc.h \ - $(CPUSRC)/powerpc/ppccom.h \ - $(CPUSRC)/powerpc/ppcfe.h \ - $(DRCDEPS) - - - -#------------------------------------------------- -# NEC V-series Intel-compatible -#@src/emu/cpu/nec/nec.h,CPUS += NEC -#@src/emu/cpu/v30mz/v30mz.h,CPUS += V30MZ -#------------------------------------------------- - -ifneq ($(filter NEC,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/nec -CPUOBJS += $(CPUOBJ)/nec/nec.o -CPUOBJS += $(CPUOBJ)/nec/v25.o -CPUOBJS += $(CPUOBJ)/nec/v25sfr.o -CPUOBJS += $(CPUOBJ)/nec/v53.o -DASMOBJS += $(CPUOBJ)/nec/necdasm.o -endif - -ifneq ($(filter V30MZ,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/v30mz $(CPUOBJ)/nec -CPUOBJS += $(CPUOBJ)/v30mz/v30mz.o -DASMOBJS += $(CPUOBJ)/nec/necdasm.o -endif - -$(CPUOBJ)/nec/nec.o: $(CPUSRC)/nec/nec.c \ - $(CPUSRC)/nec/nec.h \ - $(CPUSRC)/nec/necea.h \ - $(CPUSRC)/nec/necinstr.inc \ - $(CPUSRC)/nec/necinstr.h \ - $(CPUSRC)/nec/necmacro.h \ - $(CPUSRC)/nec/necmodrm.h \ - $(CPUSRC)/nec/necpriv.h - -$(CPUOBJ)/nec/v25.o: $(CPUSRC)/nec/v25.c \ - $(CPUSRC)/nec/nec.h \ - $(CPUSRC)/nec/necea.h \ - $(CPUSRC)/nec/necinstr.inc \ - $(CPUSRC)/nec/v25instr.inc \ - $(CPUSRC)/nec/v25instr.h \ - $(CPUSRC)/nec/necmacro.h \ - $(CPUSRC)/nec/necmodrm.h \ - $(CPUSRC)/nec/v25priv.h - -$(CPUOBJ)/nec/v25sfr.o: $(CPUSRC)/nec/v25sfr.c \ - $(CPUSRC)/nec/nec.h \ - $(CPUSRC)/nec/v25priv.h - -$(CPUOBJ)/v30mz/v30mz.o: $(CPUSRC)/v30mz/v30mz.c \ - $(CPUSRC)/v30mz/v30mz.h - - - -#------------------------------------------------- -# NEC V60/V70 -#@src/emu/cpu/v60/v60.h,CPUS += V60 -#------------------------------------------------- - -ifneq ($(filter V60,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/v60 -CPUOBJS += $(CPUOBJ)/v60/v60.o -DASMOBJS += $(CPUOBJ)/v60/v60d.o -endif - -$(CPUOBJ)/v60/v60.o: $(CPUSRC)/v60/am.inc \ - $(CPUSRC)/v60/am1.inc \ - $(CPUSRC)/v60/am2.inc \ - $(CPUSRC)/v60/am3.inc \ - $(CPUSRC)/v60/op12.inc \ - $(CPUSRC)/v60/op2.inc \ - $(CPUSRC)/v60/op3.inc \ - $(CPUSRC)/v60/op4.inc \ - $(CPUSRC)/v60/op5.inc \ - $(CPUSRC)/v60/op6.inc \ - $(CPUSRC)/v60/op7a.inc \ - $(CPUSRC)/v60/optable.inc \ - $(CPUSRC)/v60/v60.c \ - $(CPUSRC)/v60/v60.h \ - $(CPUSRC)/v60/v60d.c - - - -#------------------------------------------------- -# NEC V810 (uPD70732) -#@src/emu/cpu/v810/v810.h,CPUS += V810 -#------------------------------------------------- - -ifneq ($(filter V810,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/v810 -CPUOBJS += $(CPUOBJ)/v810/v810.o -DASMOBJS += $(CPUOBJ)/v810/v810dasm.o -endif - -$(CPUOBJ)/v810/v810.o: $(CPUSRC)/v810/v810.c \ - $(CPUSRC)/v810/v810.h - - -#------------------------------------------------- -# NEC uPD7725 -#@src/emu/cpu/upd7725/upd7725.h,CPUS += UPD7725 -#------------------------------------------------- - -ifneq ($(filter UPD7725,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/upd7725 -CPUOBJS += $(CPUOBJ)/upd7725/upd7725.o -DASMOBJS += $(CPUOBJ)/upd7725/dasm7725.o -endif - -$(CPUOBJ)/upd7725/upd7725.o: $(CPUSRC)/upd7725/upd7725.c \ - $(CPUSRC)/upd7725/upd7725.h - - -#------------------------------------------------- -# NEC uPD7810 series -#@src/emu/cpu/upd7810/upd7810.h,CPUS += UPD7810 -#------------------------------------------------- - -ifneq ($(filter UPD7810,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/upd7810 -CPUOBJS += $(CPUOBJ)/upd7810/upd7810.o -CPUOBJS += $(CPUOBJ)/upd7810/upd7810_opcodes.o -CPUOBJS += $(CPUOBJ)/upd7810/upd7810_table.o -DASMOBJS += $(CPUOBJ)/upd7810/upd7810_dasm.o -endif - -$(CPUOBJ)/upd7810/upd7810_opcodes.o: $(CPUSRC)/upd7810/upd7810_opcodes.c \ - $(CPUSRC)/upd7810/upd7810_macros.h - -$(CPUOBJ)/upd7810/upd7810.o: $(CPUSRC)/upd7810/upd7810.c \ - $(CPUSRC)/upd7810/upd7810.h \ - $(CPUSRC)/upd7810/upd7810_macros.h - - -#------------------------------------------------- -# NEC uCOM-4 series -#@src/emu/cpu/ucom4/ucom4.h,CPUS += UCOM4 -#------------------------------------------------- - -ifneq ($(filter UCOM4,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/ucom4 -CPUOBJS += $(CPUOBJ)/ucom4/ucom4.o -DASMOBJS += $(CPUOBJ)/ucom4/ucom4d.o -endif - -$(CPUOBJ)/ucom4/ucom4.o: $(CPUSRC)/ucom4/ucom4.h \ - $(CPUSRC)/ucom4/ucom4.c \ - $(CPUSRC)/ucom4/ucom4op.inc - -$(CPUOBJ)/ucom4/ucom4d.o: $(CPUSRC)/ucom4/ucom4.h \ - $(CPUSRC)/ucom4/ucom4d.c - - -#------------------------------------------------- -# Nintendo Minx -#@src/emu/cpu/minx/minx.h,CPUS += MINX -#------------------------------------------------- - -ifneq ($(filter MINX,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/minx -CPUOBJS += $(CPUOBJ)/minx/minx.o -DASMOBJS += $(CPUOBJ)/minx/minxd.o -endif - -$(CPUOBJ)/minx/minx.o: $(CPUSRC)/minx/minx.c \ - $(CPUSRC)/minx/minx.h \ - $(CPUSRC)/minx/minxd.c \ - $(CPUSRC)/minx/minxopce.h \ - $(CPUSRC)/minx/minxopcf.h \ - $(CPUSRC)/minx/minxops.h \ - $(CPUSRC)/minx/minxfunc.h - - -#------------------------------------------------- -# Nintendo/SGI RSP (R3000-based + vector processing) -#@src/emu/cpu/rsp/rsp.h,CPUS += RSP -#------------------------------------------------- - -ifneq ($(filter RSP,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/rsp -CPUOBJS += $(CPUOBJ)/rsp/rsp.o $(CPUOBJ)/rsp/rspdrc.o $(CPUOBJ)/rsp/rspfe.o $(CPUOBJ)/rsp/rspcp2.o $(CPUOBJ)/rsp/rspcp2d.o $(DRCOBJ) -DASMOBJS += $(CPUOBJ)/rsp/rsp_dasm.o -endif - -$(CPUOBJ)/rsp/rsp.o: $(CPUSRC)/rsp/rsp.c \ - $(CPUSRC)/rsp/rsp.h \ - $(CPUSRC)/rsp/rspcp2.c \ - $(CPUSRC)/rsp/rspcp2.h - -$(CPUOBJ)/rsp/rspdrc.o: $(CPUSRC)/rsp/rspdrc.c \ - $(CPUSRC)/rsp/rsp.h \ - $(CPUSRC)/rsp/rspfe.h \ - $(DRCDEPS) - -$(CPUOBJ)/rsp/rspcp2.o: $(CPUSRC)/rsp/rspcp2.c \ - $(CPUSRC)/rsp/rspcp2.h \ - $(CPUSRC)/rsp/rspdrc.c \ - $(CPUSRC)/rsp/rsp.c \ - $(CPUSRC)/rsp/rsp.h - -$(CPUOBJ)/rsp/rspcp2d.o: $(CPUSRC)/rsp/rspcp2d.c \ - $(CPUSRC)/rsp/rspcp2d.h \ - $(CPUSRC)/rsp/rspcp2.c \ - $(CPUSRC)/rsp/rspcp2.h \ - $(CPUSRC)/rsp/rspdrc.c \ - $(CPUSRC)/rsp/rsp.c \ - $(CPUSRC)/rsp/rsp.h - -$(CPUOBJ)/rsp/rspfe.o: $(CPUSRC)/rsp/rspfe.c \ - $(CPUSRC)/rsp/rspfe.h - - -#------------------------------------------------- -# Panasonic MN10200 -#@src/emu/cpu/mn10200/mn10200.h,CPUS += MN10200 -#------------------------------------------------- - -ifneq ($(filter MN10200,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/mn10200 -CPUOBJS += $(CPUOBJ)/mn10200/mn10200.o -DASMOBJS += $(CPUOBJ)/mn10200/mn102dis.o -endif - -$(CPUOBJ)/mn10200/mn10200.o: $(CPUSRC)/mn10200/mn10200.c \ - $(CPUSRC)/mn10200/mn10200.h - - -#------------------------------------------------- -# Saturn -#@src/emu/cpu/saturn/saturn.h,CPUS += SATURN -#------------------------------------------------- - -ifneq ($(filter SATURN,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/saturn -CPUOBJS += $(CPUOBJ)/saturn/saturn.o -DASMOBJS += $(CPUOBJ)/saturn/saturnds.o -endif - -$(CPUOBJ)/saturn/saturn.o: $(CPUSRC)/saturn/saturn.c \ - $(CPUSRC)/saturn/sattable.inc \ - $(CPUSRC)/saturn/satops.inc \ - $(CPUSRC)/saturn/saturn.h - - - -#------------------------------------------------- -# Signetics 2650 -#@src/emu/cpu/s2650/s2650.h,CPUS += S2650 -#------------------------------------------------- - -ifneq ($(filter S2650,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/s2650 -CPUOBJS += $(CPUOBJ)/s2650/s2650.o -DASMOBJS += $(CPUOBJ)/s2650/2650dasm.o -endif - -$(CPUOBJ)/s2650/s2650.o: $(CPUSRC)/s2650/s2650.c \ - $(CPUSRC)/s2650/s2650.h \ - $(CPUSRC)/s2650/s2650cpu.h - - - -#------------------------------------------------- -# SC61860 -#@src/emu/cpu/sc61860/sc61860.h,CPUS += SC61860 -#------------------------------------------------- - -ifneq ($(filter SC61860,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/sc61860 -CPUOBJS += $(CPUOBJ)/sc61860/sc61860.o -DASMOBJS += $(CPUOBJ)/sc61860/scdasm.o -endif - -$(CPUOBJ)/sc61860/sc61860.o: $(CPUSRC)/sc61860/sc61860.h \ - $(CPUSRC)/sc61860/scops.inc \ - $(CPUSRC)/sc61860/sctable.inc - - - -#------------------------------------------------- -# SM8500 -#@src/emu/cpu/sm8500/sm8500.h,CPUS += SM8500 -#------------------------------------------------- - -ifneq ($(filter SM8500,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/sm8500 -CPUOBJS += $(CPUOBJ)/sm8500/sm8500.o -DASMOBJS += $(CPUOBJ)/sm8500/sm8500d.o -endif - -$(CPUOBJ)/sm8500/sm8500.o: $(CPUSRC)/sm8500/sm8500.c \ - $(CPUSRC)/sm8500/sm8500.h \ - $(CPUSRC)/sm8500/sm85ops.h - - - -#------------------------------------------------- -# Sony/Nintendo SPC700 -#@src/emu/cpu/spc700/spc700.h,CPUS += SPC700 -#------------------------------------------------- - -ifneq ($(filter SPC700,$(CPUS)),) -SPCD = cpu/spc700 -OBJDIRS += $(CPUOBJ)/spc700 -CPUOBJS += $(CPUOBJ)/spc700/spc700.o -DASMOBJS += $(CPUOBJ)/spc700/spc700ds.o -endif - -$(CPUOBJ)/spc700/spc700.o: $(CPUSRC)/spc700/spc700.c \ - $(CPUSRC)/spc700/spc700.h - - - -#------------------------------------------------- -# SSP1601 -#@src/emu/cpu/ssp1601/ssp1601.h,CPUS += SSP1601 -#------------------------------------------------- - -ifneq ($(filter SSP1601,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/ssp1601 -CPUOBJS += $(CPUOBJ)/ssp1601/ssp1601.o -DASMOBJS += $(CPUOBJ)/ssp1601/ssp1601d.o -endif - -$(CPUOBJ)/ssp1601/ssp1601.o: $(CPUSRC)/ssp1601/ssp1601.c \ - $(CPUSRC)/ssp1601/ssp1601.h - - - -#------------------------------------------------- -# SunPlus u'nSP -#@src/emu/cpu/unsp/unsp.h,CPUS += UNSP -#------------------------------------------------- - -ifneq ($(filter UNSP,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/unsp -CPUOBJS += $(CPUOBJ)/unsp/unsp.o -DASMOBJS += $(CPUOBJ)/unsp/unspdasm.o -endif - -$(CPUOBJ)/unsp/unsp.o: $(CPUSRC)/unsp/unsp.c \ - $(CPUSRC)/unsp/unsp.h - - - -#------------------------------------------------- -# Atmel 8-bit AVR -#@src/emu/cpu/avr8/avr8.h,CPUS += AVR8 -#------------------------------------------------- - -ifneq ($(filter AVR8,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/avr8 -CPUOBJS += $(CPUOBJ)/avr8/avr8.o -DASMOBJS += $(CPUOBJ)/avr8/avr8dasm.o -endif - -$(CPUOBJ)/avr8/avr8.o: $(CPUSRC)/avr8/avr8.c \ - $(CPUSRC)/avr8/avr8.h - - - -#------------------------------------------------- -# Texas Instruments TMS0980 -#@src/emu/cpu/tms0980/tms0980.h,CPUS += TMS0980 -#------------------------------------------------- - -ifneq ($(filter TMS0980,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms0980 -CPUOBJS += $(CPUOBJ)/tms0980/tms0980.o -DASMOBJS += $(CPUOBJ)/tms0980/tms0980d.o -endif - -$(CPUOBJ)/tms0980/tms0980.o: $(CPUSRC)/tms0980/tms0980.h \ - $(CPUSRC)/tms0980/tms0980.c - -$(CPUOBJ)/tms0980/tms0980d.o: $(CPUSRC)/tms0980/tms0980.h \ - $(CPUSRC)/tms0980/tms0980d.c - - - -#------------------------------------------------- -# Texas Instruments TMS7000 series -#@src/emu/cpu/tms7000/tms7000.h,CPUS += TMS7000 -#------------------------------------------------- - -ifneq ($(filter TMS7000,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms7000 -CPUOBJS += $(CPUOBJ)/tms7000/tms7000.o -DASMOBJS += $(CPUOBJ)/tms7000/7000dasm.o -endif - -$(CPUOBJ)/tms7000/tms7000.o: $(CPUSRC)/tms7000/tms7000.h \ - $(CPUSRC)/tms7000/tms7000.c \ - $(CPUSRC)/tms7000/tms70op.inc - -$(CPUOBJ)/tms7000/7000dasm.o: $(CPUSRC)/tms7000/tms7000.h \ - $(CPUSRC)/tms7000/7000dasm.c - - - -#------------------------------------------------- -# Texas Instruments TMS99xx series -#@src/emu/cpu/tms9900/tms9900.h,CPUS += TMS9900 -#@src/emu/cpu/tms9900/tms9980a.h,CPUS += TMS9900 -#@src/emu/cpu/tms9900/tms9995.h,CPUS += TMS9900 - -#------------------------------------------------- - -ifneq ($(filter TMS9900,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms9900 -CPUOBJS += $(CPUOBJ)/tms9900/tms9900.o -CPUOBJS += $(CPUOBJ)/tms9900/tms9980a.o -CPUOBJS += $(CPUOBJ)/tms9900/tms9995.o -CPUOBJS += $(CPUOBJ)/tms9900/ti990_10.o -DASMOBJS += $(CPUOBJ)/tms9900/9900dasm.o -endif - -$(CPUOBJ)/tms9900/tms9900.o: $(CPUSRC)/tms9900/tms9900.c \ - $(CPUSRC)/tms9900/tms9900.h \ - $(CPUSRC)/tms9900/tms99com.h - -$(CPUOBJ)/tms9900/tms9980a.o: $(CPUSRC)/tms9900/tms9980a.c \ - $(CPUSRC)/tms9900/tms9980a.h \ - $(CPUSRC)/tms9900/tms9900.c \ - $(CPUSRC)/tms9900/tms9900.h \ - $(CPUSRC)/tms9900/tms99com.h - -$(CPUOBJ)/tms9900/tms9995.o: $(CPUSRC)/tms9900/tms9995.c \ - $(CPUSRC)/tms9900/tms9995.h \ - $(CPUSRC)/tms9900/tms99com.h - -$(CPUOBJ)/tms9900/ti990_10.o: $(CPUSRC)/tms9900/ti990_10.c \ - $(CPUSRC)/tms9900/ti990_10.h \ - $(CPUSRC)/tms9900/tms99com.h - - -#------------------------------------------------- -# Texas Instruments TMS340x0 graphics controllers -#@src/emu/cpu/tms34010/tms34010.h,CPUS += TMS340X0 -#------------------------------------------------- - -ifneq ($(filter TMS340X0,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms34010 -CPUOBJS += $(CPUOBJ)/tms34010/tms34010.o -DASMOBJS += $(CPUOBJ)/tms34010/34010dsm.o -endif - -$(CPUOBJ)/tms34010/tms34010.o: $(CPUSRC)/tms34010/tms34010.c \ - $(CPUSRC)/tms34010/tms34010.h \ - $(CPUSRC)/tms34010/34010ops.c \ - $(CPUSRC)/tms34010/34010gfx.c \ - $(CPUSRC)/tms34010/34010fld.c \ - $(CPUSRC)/tms34010/34010tbl.c - - - -#------------------------------------------------- -# Texas Instruments TMS3201x DSP -#@src/emu/cpu/tms32010/tms32010.h,CPUS += TMS32010 -#------------------------------------------------- - -ifneq ($(filter TMS32010,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms32010 -CPUOBJS += $(CPUOBJ)/tms32010/tms32010.o -DASMOBJS += $(CPUOBJ)/tms32010/32010dsm.o -endif - -$(CPUOBJ)/tms32010/tms32010.o: $(CPUSRC)/tms32010/tms32010.c \ - $(CPUSRC)/tms32010/tms32010.h - - - -#------------------------------------------------- -# Texas Instruments TMS3202x DSP -#@src/emu/cpu/tms32025/tms32025.h,CPUS += TMS32025 -#------------------------------------------------- - -ifneq ($(filter TMS32025,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms32025 -CPUOBJS += $(CPUOBJ)/tms32025/tms32025.o -DASMOBJS += $(CPUOBJ)/tms32025/32025dsm.o -endif - -$(CPUOBJ)/tms32025/tms32025.o: $(CPUSRC)/tms32025/tms32025.c \ - $(CPUSRC)/tms32025/tms32025.h - - - -#------------------------------------------------- -# Texas Instruments TMS3203x DSP -#@src/emu/cpu/tms32031/tms32031.h,CPUS += TMS32031 -#------------------------------------------------- - -ifneq ($(filter TMS32031,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms32031 -CPUOBJS += $(CPUOBJ)/tms32031/tms32031.o -DASMOBJS += $(CPUOBJ)/tms32031/dis32031.o -endif - -$(CPUOBJ)/tms32031/tms32031.o: $(CPUSRC)/tms32031/tms32031.c \ - $(CPUSRC)/tms32031/tms32031.h \ - $(CPUSRC)/tms32031/32031ops.c - - - -#------------------------------------------------- -# Texas Instruments TMS3205x DSP -#@src/emu/cpu/tms32051/tms32051.h,CPUS += TMS32051 -#------------------------------------------------- - -ifneq ($(filter TMS32051,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms32051 -CPUOBJS += $(CPUOBJ)/tms32051/tms32051.o -DASMOBJS += $(CPUOBJ)/tms32051/dis32051.o -endif - -$(CPUOBJ)/tms32051/tms32051.o: $(CPUSRC)/tms32051/tms32051.c \ - $(CPUSRC)/tms32051/tms32051.h \ - $(CPUSRC)/tms32051/32051ops.c - - - -#------------------------------------------------- -# Texas Instruments TMS3208x DSP -#@src/emu/cpu/tms32082/tms32082.h,CPUS += TMS32082_MP -#------------------------------------------------- - -ifneq ($(filter TMS32082,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms32082 -CPUOBJS += $(CPUOBJ)/tms32082/tms32082.o $(CPUOBJ)/tms32082/mp_ops.o -DASMOBJS += $(CPUOBJ)/tms32082/dis_mp.o $(CPUOBJ)/tms32082/dis_pp.o -endif - -$(CPUOBJ)/tms32082/tms32082.o: $(CPUSRC)/tms32082/tms32082.c \ - $(CPUSRC)/tms32082/mp_ops.c \ - $(CPUSRC)/tms32082/tms32082.h - - - -#------------------------------------------------- -# Texas Instruments TMS57002 DSP -#@src/emu/cpu/tms57002/tms57002.h,CPUS += TMS57002 -#------------------------------------------------- - -ifneq ($(filter TMS57002,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tms57002 -CPUOBJS += $(CPUOBJ)/tms57002/tms57002.o $(CPUOBJ)/tms57002/tms57kdec.o -DASMOBJS += $(CPUOBJ)/tms57002/57002dsm.o -endif - -$(CPUOBJ)/tms57002/tms57002.o: $(CPUSRC)/tms57002/tms57002.c \ - $(CPUSRC)/tms57002/tms57002.h \ - $(CPUOBJ)/tms57002/tms57002.inc - -$(CPUOBJ)/tms57002/tms57kdec.o: $(CPUSRC)/tms57002/tms57kdec.c \ - $(CPUSRC)/tms57002/tms57002.h \ - $(CPUOBJ)/tms57002/tms57002.inc - -$(CPUOBJ)/tms57002/57002dsm.o: $(CPUSRC)/tms57002/57002dsm.c \ - $(CPUOBJ)/tms57002/tms57002.inc - -# rule to generate the C file -$(CPUOBJ)/tms57002/tms57002.inc: $(CPUSRC)/tms57002/tmsmake.py $(CPUSRC)/tms57002/tmsinstr.lst - @echo Generating TMS57002 source file... - $(PYTHON) $(CPUSRC)/tms57002/tmsmake.py $(CPUSRC)/tms57002/tmsinstr.lst $@ - - -#------------------------------------------------- -# Toshiba TLCS-90 Series -#@src/emu/cpu/tlcs90/tlcs90.h,CPUS += TLCS90 -#------------------------------------------------- - -ifneq ($(filter TLCS90,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tlcs90 -CPUOBJS += $(CPUOBJ)/tlcs90/tlcs90.o -#DASMOBJS += $(CPUOBJ)/tlcs90/tlcs90.o -endif - -$(CPUOBJ)/tlcs90/tlcs90.o: $(CPUSRC)/tlcs90/tlcs90.c \ - $(CPUSRC)/tlcs90/tlcs90.h - - - -#------------------------------------------------- -# Toshiba TLCS-900 Series -#@src/emu/cpu/tlcs900/tlcs900.h,CPUS += TLCS900 -#------------------------------------------------- - -ifneq ($(filter TLCS900,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/tlcs900 -CPUOBJS += $(CPUOBJ)/tlcs900/tlcs900.o -DASMOBJS += $(CPUOBJ)/tlcs900/dasm900.o -endif - -$(CPUOBJ)/tlcs900/tlcs900.o: $(CPUSRC)/tlcs900/tlcs900.c \ - $(CPUSRC)/tlcs900/900tbl.inc \ - $(CPUSRC)/tlcs900/tlcs900.h - -$(CPUOBJ)/tlcs900/dasm900.o: $(CPUSRC)/tlcs900/dasm900.c - - - -#------------------------------------------------- -# Zilog Z80 -#@src/emu/cpu/z80/z80.h,CPUS += Z80 -#------------------------------------------------- - -ifneq ($(filter Z80,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/z80 -CPUOBJS += $(CPUOBJ)/z80/z80.o \ - $(CPUOBJ)/z80/z80daisy.o \ - $(CPUOBJ)/z80/tmpz84c011.o \ - $(CPUOBJ)/z80/tmpz84c015.o \ - $(CPUOBJ)/z80/kl5c80a12.o - -DASMOBJS += $(CPUOBJ)/z80/z80dasm.o -endif - -$(CPUOBJ)/z80/z80.o: $(CPUSRC)/z80/z80.c \ - $(CPUSRC)/z80/z80.h - - -#------------------------------------------------- -# Sharp LR35902 (Game Boy CPU) -#@src/emu/cpu/lr35902/lr35902.h,CPUS += LR35902 -#------------------------------------------------- - -ifneq ($(filter LR35902,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/lr35902 -CPUOBJS += $(CPUOBJ)/lr35902/lr35902.o -DASMOBJS += $(CPUOBJ)/lr35902/lr35902d.o -endif - -$(CPUOBJ)/lr35902/lr35902.o: $(CPUSRC)/lr35902/lr35902.c \ - $(CPUSRC)/lr35902/lr35902.h \ - $(CPUSRC)/lr35902/opc_cb.inc \ - $(CPUSRC)/lr35902/opc_main.inc - - - -#------------------------------------------------- -# Zilog Z180 -#@src/emu/cpu/z180/z180.h,CPUS += Z180 -#------------------------------------------------- - -ifneq ($(filter Z180,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/z180 $(CPUOBJ)/z80 -CPUOBJS += $(CPUOBJ)/z180/z180.o $(CPUOBJ)/z80/z80daisy.o -DASMOBJS += $(CPUOBJ)/z180/z180dasm.o -endif - -$(CPUOBJ)/z180/z180.o: $(CPUSRC)/z180/z180.c \ - $(CPUSRC)/z180/z180.h \ - $(CPUSRC)/z180/z180op.inc \ - $(CPUSRC)/z180/z180ops.h \ - $(CPUSRC)/z180/z180tbl.h \ - $(CPUSRC)/z180/z180cb.inc \ - $(CPUSRC)/z180/z180dd.inc \ - $(CPUSRC)/z180/z180ed.inc \ - $(CPUSRC)/z180/z180fd.inc \ - $(CPUSRC)/z180/z180xy.inc - - - -#------------------------------------------------- -# Zilog Z8000 -#@src/emu/cpu/z8000/z8000.h,CPUS += Z8000 -#------------------------------------------------- - -ifneq ($(filter Z8000,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/z8000 -CPUOBJS += $(CPUOBJ)/z8000/z8000.o -DASMOBJS += $(CPUOBJ)/z8000/8000dasm.o -endif - -$(CPUOBJ)/z8000/z8000.o: $(CPUSRC)/z8000/z8000.c \ - $(CPUSRC)/z8000/z8000.h \ - $(CPUSRC)/z8000/z8000cpu.h \ - $(CPUSRC)/z8000/z8000dab.h \ - $(CPUSRC)/z8000/z8000ops.inc \ - $(CPUSRC)/z8000/z8000tbl.inc - - - -#------------------------------------------------- -# Zilog Z8 -#@src/emu/cpu/z8/z8.h,CPUS += Z8 -#------------------------------------------------- - -ifneq ($(filter Z8,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/z8 -CPUOBJS += $(CPUOBJ)/z8/z8.o -DASMOBJS += $(CPUOBJ)/z8/z8dasm.o -endif - -$(CPUOBJ)/z8/z8.o: $(CPUSRC)/z8/z8.c \ - $(CPUSRC)/z8/z8ops.inc \ - $(CPUSRC)/z8/z8.h - - - -#------------------------------------------------- -# Argonaut SuperFX -#@src/emu/cpu/superfx/superfx.h,CPUS += SUPERFX -#------------------------------------------------- - -ifneq ($(filter SUPERFX,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/superfx -CPUOBJS += $(CPUOBJ)/superfx/superfx.o -DASMOBJS += $(CPUOBJ)/superfx/sfx_dasm.o -endif - -$(CPUOBJ)/superfx/superfx.o:$(CPUSRC)/superfx/superfx.c \ - $(CPUSRC)/superfx/superfx.h - -#------------------------------------------------- -# Rockwell PPS-4 -#@src/emu/cpu/pps4/pps4.h,CPUS += PPS4 -#------------------------------------------------- - -ifneq ($(filter PPS4,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/pps4 -CPUOBJS += $(CPUOBJ)/pps4/pps4.o -DASMOBJS += $(CPUOBJ)/pps4/pps4dasm.o -endif - -$(CPUOBJ)/pps4/pps4.o: $(CPUSRC)/pps4/pps4.c \ - $(CPUSRC)/pps4/pps4.h - -#------------------------------------------------- -# Hitachi HD61700 -#@src/emu/cpu/hd61700/hd61700.h,CPUS += HD61700 -#------------------------------------------------- - -ifneq ($(filter HD61700,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/hd61700 -CPUOBJS += $(CPUOBJ)/hd61700/hd61700.o -DASMOBJS += $(CPUOBJ)/hd61700/hd61700d.o -endif - -$(CPUOBJ)/hd61700/hd61700.o: $(CPUSRC)/hd61700/hd61700.c \ - $(CPUSRC)/hd61700/hd61700.h - -#------------------------------------------------- -# Sanyo LC8670 -#@src/emu/cpu/lc8670/lc8670.h,CPUS += LC8670 -#------------------------------------------------- - -ifneq ($(filter LC8670,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/lc8670 -CPUOBJS += $(CPUOBJ)/lc8670/lc8670.o -DASMOBJS += $(CPUOBJ)/lc8670/lc8670dsm.o -endif - -$(CPUOBJ)/lc8670/lc8670.o: $(CPUSRC)/lc8670/lc8670.c \ - $(CPUSRC)/lc8670/lc8670.h - -#------------------------------------------------- -# Sega SCU DSP -#@src/emu/cpu/scudsp/scudsp.h,CPUS += SCUDSP -#------------------------------------------------- - -ifneq ($(filter SCUDSP,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/scudsp -CPUOBJS += $(CPUOBJ)/scudsp/scudsp.o -DASMOBJS += $(CPUOBJ)/scudsp/scudspdasm.o -endif - -$(CPUOBJ)/scudsp/scudsp.o: $(CPUSRC)/scudsp/scudsp.c \ - $(CPUSRC)/scudsp/scudsp.h - - -#------------------------------------------------- -# Sunplus Technology S+core -#@src/emu/cpu/score/score.h,CPUS += SCORE -#------------------------------------------------- - -ifneq ($(filter SCORE,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/score -CPUOBJS += $(CPUOBJ)/score/score.o -DASMOBJS += $(CPUOBJ)/score/scoredsm.o -endif - -$(CPUOBJ)/score/score.o: $(CPUSRC)/score/score.c \ - $(CPUSRC)/score/score.h \ - $(CPUSRC)/score/scorem.h - -$(CPUOBJ)/score/scoredsm.o: $(CPUSRC)/score/scoredsm.c \ - $(CPUSRC)/score/scorem.h - - -#------------------------------------------------- -# Xerox Alto-II -#@src/emu/cpu/alto2/alto2cpu.h,CPUS += ALTO2 -#------------------------------------------------- - -ifneq ($(filter ALTO2,$(CPUS)),) -OBJDIRS += $(CPUOBJ)/alto2 -CPUOBJS += $(CPUOBJ)/alto2/alto2cpu.o \ - $(CPUOBJ)/alto2/a2disk.o \ - $(CPUOBJ)/alto2/a2disp.o \ - $(CPUOBJ)/alto2/a2curt.o \ - $(CPUOBJ)/alto2/a2dht.o \ - $(CPUOBJ)/alto2/a2dvt.o \ - $(CPUOBJ)/alto2/a2dwt.o \ - $(CPUOBJ)/alto2/a2emu.o \ - $(CPUOBJ)/alto2/a2ether.o \ - $(CPUOBJ)/alto2/a2hw.o \ - $(CPUOBJ)/alto2/a2kbd.o \ - $(CPUOBJ)/alto2/a2ksec.o \ - $(CPUOBJ)/alto2/a2kwd.o \ - $(CPUOBJ)/alto2/a2mem.o \ - $(CPUOBJ)/alto2/a2mouse.o \ - $(CPUOBJ)/alto2/a2mrt.o \ - $(CPUOBJ)/alto2/a2part.o \ - $(CPUOBJ)/alto2/a2ram.o \ - $(CPUOBJ)/alto2/a2roms.o - -DASMOBJS += $(CPUOBJ)/alto2/alto2dsm.o -endif - -$(CPUOBJ)/alto2/alto2cpu.o: $(CPUSRC)/alto2/alto2cpu.c \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2disk.o: $(CPUSRC)/alto2/a2disk.c \ - $(CPUSRC)/alto2/a2disk.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2disp.o: $(CPUSRC)/alto2/a2disp.c \ - $(CPUSRC)/alto2/a2disp.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2curt.o: $(CPUSRC)/alto2/a2curt.c \ - $(CPUSRC)/alto2/a2curt.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2dht.o: $(CPUSRC)/alto2/a2dht.c \ - $(CPUSRC)/alto2/a2dht.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2dvt.o: $(CPUSRC)/alto2/a2dvt.c \ - $(CPUSRC)/alto2/a2dvt.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2dwt.o: $(CPUSRC)/alto2/a2dwt.c \ - $(CPUSRC)/alto2/a2dwt.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2emu.o: $(CPUSRC)/alto2/a2emu.c \ - $(CPUSRC)/alto2/a2emu.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2ether.o: $(CPUSRC)/alto2/a2ether.c \ - $(CPUSRC)/alto2/a2ether.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2hw.o: $(CPUSRC)/alto2/a2hw.c \ - $(CPUSRC)/alto2/a2hw.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2kbd.o: $(CPUSRC)/alto2/a2kbd.c \ - $(CPUSRC)/alto2/a2kbd.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2ksec.o: $(CPUSRC)/alto2/a2ksec.c \ - $(CPUSRC)/alto2/a2ksec.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2kwd.o: $(CPUSRC)/alto2/a2kwd.c \ - $(CPUSRC)/alto2/a2kwd.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2mem.o: $(CPUSRC)/alto2/a2mem.c \ - $(CPUSRC)/alto2/a2mem.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2mouse.o: $(CPUSRC)/alto2/a2mouse.c \ - $(CPUSRC)/alto2/a2mouse.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2mrt.o: $(CPUSRC)/alto2/a2mrt.c \ - $(CPUSRC)/alto2/a2mrt.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2part.o: $(CPUSRC)/alto2/a2part.c \ - $(CPUSRC)/alto2/a2part.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2ram.o: $(CPUSRC)/alto2/a2ram.c \ - $(CPUSRC)/alto2/a2ram.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/a2roms.o: $(CPUSRC)/alto2/a2roms.c \ - $(CPUSRC)/alto2/a2roms.h \ - $(CPUSRC)/alto2/alto2cpu.h - -$(CPUOBJ)/alto2/alto2dsm.o: $(CPUSRC)/alto2/alto2dsm.c \ - $(CPUSRC)/alto2/alto2cpu.h - diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c index c279f07aec0..839e1db218c 100644 --- a/src/emu/cpu/hmcs40/hmcs40.c +++ b/src/emu/cpu/hmcs40/hmcs40.c @@ -187,7 +187,7 @@ void hmcs40_cpu_device::device_start() m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hmcs40_cpu_device::simple_timer_cb), this)); reset_prescaler(); - + m_read_r0.resolve_safe(0); m_read_r1.resolve_safe(0); m_read_r2.resolve_safe(0); @@ -196,7 +196,7 @@ void hmcs40_cpu_device::device_start() m_read_r5.resolve_safe(0); m_read_r6.resolve_safe(0); m_read_r7.resolve_safe(0); - + m_write_r0.resolve_safe(); m_write_r1.resolve_safe(); m_write_r2.resolve_safe(); @@ -290,20 +290,20 @@ void hmcs40_cpu_device::device_reset() { m_pc = m_pcmask; m_prev_op = m_op = 0; - + + // clear interrupts + m_cf = 0; + m_ie = 0; + m_iri = m_irt = 0; + m_if[0] = m_if[1] = m_tf = 1; + // clear i/o m_d = m_polarity; for (int i = 0; i < 16; i++) hmcs40_cpu_device::write_d(i, 0); - + for (int i = 0; i < 8; i++) hmcs40_cpu_device::write_r(i, 0); - - // clear interrupts - m_cf = 0; - m_ie = 0; - m_iri = m_irt = 0; - m_if[0] = m_if[1] = m_tf = 1; } @@ -316,7 +316,7 @@ UINT8 hmcs40_cpu_device::read_r(int index) { index &= 7; UINT8 inp = 0; - + switch (index) { case 0: inp = m_read_r0(index, 0xff); break; @@ -328,7 +328,7 @@ UINT8 hmcs40_cpu_device::read_r(int index) case 6: inp = m_read_r6(index, 0xff); break; case 7: inp = m_read_r7(index, 0xff); break; } - + return ((inp ^ m_polarity) | m_r[index]) & 0xf; } @@ -337,7 +337,7 @@ void hmcs40_cpu_device::write_r(int index, UINT8 data) index &= 7; data = (data ^ m_polarity) & 0xf; m_r[index] = data; - + switch (index) { case 0: m_write_r0(index, data, 0xff); break; @@ -354,7 +354,7 @@ void hmcs40_cpu_device::write_r(int index, UINT8 data) int hmcs40_cpu_device::read_d(int index) { index &= 15; - + return ((m_read_d(index, 0xffff) ^ m_polarity) | m_d) >> index & 1; } @@ -362,7 +362,7 @@ void hmcs40_cpu_device::write_d(int index, int state) { index &= 15; state = (((state) ? 1 : 0) ^ m_polarity) & 1; - + m_d = (m_d & ~(1 << index)) | state << index; m_write_d(index, m_d, 0xffff); } @@ -374,7 +374,7 @@ void hmcs40_cpu_device::write_d(int index, int state) UINT8 hmcs43_cpu_device::read_r(int index) { index &= 7; - + if (index >= 2) logerror("%s read from %s port R%d at $%04X\n", tag(), (index >= 4) ? "unknown" : "output", index, m_prev_pc); @@ -394,7 +394,7 @@ void hmcs43_cpu_device::write_r(int index, UINT8 data) int hmcs43_cpu_device::read_d(int index) { index &= 15; - + if (index >= 4) logerror("%s read from output pin D%d at $%04X\n", tag(), index, m_prev_pc); @@ -408,10 +408,10 @@ int hmcs43_cpu_device::read_d(int index) UINT8 hmcs44_cpu_device::read_r(int index) { index &= 7; - + if (index >= 6) logerror("%s read from unknown port R%d at $%04X\n", tag(), index, m_prev_pc); - + return hmcs40_cpu_device::read_r(index); } @@ -432,10 +432,10 @@ void hmcs44_cpu_device::write_r(int index, UINT8 data) UINT8 hmcs45_cpu_device::read_r(int index) { index &= 7; - + if (index >= 6) logerror("%s read from %s port R%d at $%04X\n", tag(), (index == 7) ? "unknown" : "output", index, m_prev_pc); - + return hmcs40_cpu_device::read_r(index); } @@ -460,10 +460,10 @@ void hmcs40_cpu_device::do_interrupt() m_icount--; push_stack(); m_ie = 0; - + // line 0/1 for external interrupt, let's use 2 for t/c interrupt int line = (m_iri) ? m_eint_line : 2; - + // vector $3f, on page 0(timer/counter), or page 1(external) // external interrupt has priority over t/c interrupt m_pc = 0x3f | (m_iri ? 0x40 : 0); @@ -480,7 +480,7 @@ void hmcs40_cpu_device::execute_set_input(int line, int state) if (line != 0 && line != 1) return; state = (state) ? 1 : 0; - + // external interrupt request on rising edge if (state && !m_int[line]) { @@ -490,12 +490,12 @@ void hmcs40_cpu_device::execute_set_input(int line, int state) m_iri = 1; m_if[line] = 1; } - + // clock tc if it is in counter mode if (m_cf && line == 1) increment_tc(); } - + m_int[line] = state; } @@ -511,7 +511,7 @@ TIMER_CALLBACK_MEMBER( hmcs40_cpu_device::simple_timer_cb ) // timer prescaler overflow if (!m_cf) increment_tc(); - + reset_prescaler(); } @@ -519,7 +519,7 @@ void hmcs40_cpu_device::increment_tc() { // increment timer/counter m_tc = (m_tc + 1) & 0xf; - + // timer interrupt request on overflow if (m_tc == 0 && !m_tf) { @@ -554,15 +554,10 @@ void hmcs40_cpu_device::execute_run() while (m_icount > 0) { m_icount--; - + // LPU is handled 1 cycle later if ((m_prev_op & 0x3e0) == 0x340) - { - if ((m_op & 0x1c0) != 0x1c0) - logerror("%s LPU without BR/CAL at $%04X\n", tag(), m_prev_pc); - m_pc = ((m_page << 6) | (m_pc & 0x3f)) & m_pcmask; - } // check/handle interrupt, but not in the middle of a long jump if (m_ie && (m_iri || m_irt) && (m_op & 0x3e0) != 0x340) @@ -571,7 +566,7 @@ void hmcs40_cpu_device::execute_run() // remember previous state m_prev_op = m_op; m_prev_pc = m_pc; - + // fetch next opcode debugger_instruction_hook(this, m_pc); m_op = m_program->read_word(m_pc << 1) & 0x3ff; @@ -582,7 +577,7 @@ void hmcs40_cpu_device::execute_run() switch (m_op) { /* 0x000 */ - + case 0x000: case 0x001: case 0x002: case 0x003: op_xsp(); break; case 0x004: case 0x005: case 0x006: case 0x007: @@ -602,7 +597,7 @@ void hmcs40_cpu_device::execute_run() op_am(); break; case 0x03c: op_lta(); break; - + case 0x040: op_lxa(); break; case 0x045: @@ -626,7 +621,7 @@ void hmcs40_cpu_device::execute_run() case 0x070: case 0x071: case 0x072: case 0x073: case 0x074: case 0x075: case 0x076: case 0x077: case 0x078: case 0x079: case 0x07a: case 0x07b: case 0x07c: case 0x07d: case 0x07e: case 0x07f: op_lai(); break; - + case 0x080: case 0x081: case 0x082: case 0x083: case 0x084: case 0x085: case 0x086: case 0x087: case 0x088: case 0x089: case 0x08a: case 0x08b: case 0x08c: case 0x08d: case 0x08e: case 0x08f: op_ai(); break; @@ -655,10 +650,10 @@ void hmcs40_cpu_device::execute_run() case 0x0f0: case 0x0f1: case 0x0f2: case 0x0f3: case 0x0f4: case 0x0f5: case 0x0f6: case 0x0f7: case 0x0f8: case 0x0f9: case 0x0fa: case 0x0fb: case 0x0fc: case 0x0fd: case 0x0fe: case 0x0ff: op_xamr(); break; - - + + /* 0x100 */ - + case 0x110: case 0x111: op_lmaiy(); break; case 0x114: case 0x115: @@ -682,7 +677,7 @@ void hmcs40_cpu_device::execute_run() case 0x170: case 0x171: case 0x172: case 0x173: case 0x174: case 0x175: case 0x176: case 0x177: case 0x178: case 0x179: case 0x17a: case 0x17b: case 0x17c: case 0x17d: case 0x17e: case 0x17f: op_lti(); break; - + case 0x1a0: op_tif1(); break; case 0x1a1: @@ -706,7 +701,7 @@ void hmcs40_cpu_device::execute_run() /* 0x200 */ - + case 0x200: case 0x201: case 0x202: case 0x203: op_tm(); break; case 0x204: case 0x205: case 0x206: case 0x207: @@ -728,7 +723,7 @@ void hmcs40_cpu_device::execute_run() op_alem(); break; case 0x23c: op_lat(); break; - + case 0x240: op_laspx(); break; case 0x244: @@ -804,8 +799,8 @@ void hmcs40_cpu_device::execute_run() case 0x3f0: case 0x3f1: case 0x3f2: case 0x3f3: case 0x3f4: case 0x3f5: case 0x3f6: case 0x3f7: case 0x3f8: case 0x3f9: case 0x3fa: case 0x3fb: case 0x3fc: case 0x3fd: case 0x3fe: case 0x3ff: op_cal(); break; - - + + default: op_illegal(); break; } /* big switch */ diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h index 6dd5166df87..a7e34173306 100644 --- a/src/emu/cpu/hmcs40/hmcs40.h +++ b/src/emu/cpu/hmcs40/hmcs40.h @@ -182,7 +182,7 @@ protected: int m_eint_line; // which input_line caused an interrupt emu_timer *m_timer; int m_icount; - + UINT16 m_pc; // Program Counter UINT16 m_prev_pc; UINT8 m_page; // LPU prepared page @@ -213,7 +213,7 @@ protected: // misc internal helpers void increment_pc(); - + UINT8 ram_r(); void ram_w(UINT8 data); void pop_stack(); diff --git a/src/emu/cpu/hmcs40/hmcs40d.c b/src/emu/cpu/hmcs40/hmcs40d.c index e16fa8ed618..d01382e0b8d 100644 --- a/src/emu/cpu/hmcs40/hmcs40d.c +++ b/src/emu/cpu/hmcs40/hmcs40d.c @@ -3,7 +3,7 @@ /* Hitachi HMCS40 MCU family disassembler - + NOTE: start offset(basepc) is $3F, not 0 */ @@ -92,42 +92,42 @@ static const UINT8 hmcs40_mnemonic[0x400] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x000 */ - mNOP, mXSP, mXSP, mXSP, mSEM, mSEM, mSEM, mSEM, mLAM, mLAM, mLAM, mLAM, m, m, m, m, + mNOP, mXSP, mXSP, mXSP, mSEM, mSEM, mSEM, mSEM, mLAM, mLAM, mLAM, mLAM, m, m, m, m, mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY, - mLBM, mLBM, mLBM, mLBM, mBLEM, m, m, m, m, m, m, m, m, m, m, m, - mAMC, m, m, m, mAM, m, m, m, m, m, m, m, mLTA, m, m, m, + mLBM, mLBM, mLBM, mLBM, mBLEM, m, m, m, m, m, m, m, m, m, m, m, + mAMC, m, m, m, mAM, m, m, m, m, m, m, m, mLTA, m, m, m, /* 0x040 */ mLXA, m, m, m, m, mDAS, mDAA, m, m, m, m, m, mREC, m, m, mSEC, - mLYA, m, m, m, mIY, m, m, m, mAYY, m, m, m, m, m, m, m, - mLBA, m, m, m, mIB, m, m, m, m, m, m, m, m, m, m, m, + mLYA, m, m, m, mIY, m, m, m, mAYY, m, m, m, m, m, m, m, + mLBA, m, m, m, mIB, m, m, m, m, m, m, m, m, m, m, m, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, /* 0x080 */ mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, - mSED, m, m, m, mTD, m, m, m, m, m, m, m, m, m, m, m, - mSEIF1,mSECF, mSEIF0,m, mSEIE, mSETF, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mSED, m, m, m, mTD, m, m, m, m, m, m, m, m, m, m, m, + mSEIF1,mSECF, mSEIF0,m, mSEIE, mSETF, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x0c0 */ - mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, m, m, m, m, m, m, m, m, + mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, m, m, m, m, m, m, m, m, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, - mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, m, m, m, m, m, m, m, m, + mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, m, m, m, m, m, m, m, m, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x100 */ - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - mLMAIY,mLMAIY,m, m, mLMADY,mLMADY,m, m, mLAY, m, m, m, m, m, m, m, - mOR, m, m, m, mANEM, m, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mLMAIY,mLMAIY,m, m, mLMADY,mLMADY,m, m, mLAY, m, m, m, m, m, m, m, + mOR, m, m, m, mANEM, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x140 */ mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, /* 0x180 */ - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - mTIF1, mTI1, mTIF0, mTI0, m, mTTF, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mTIF1, mTI1, mTIF0, mTI0, m, mTTF, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x1c0 */ mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, @@ -136,42 +136,42 @@ static const UINT8 hmcs40_mnemonic[0x400] = /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x200 */ - mTM, mTM, mTM, mTM, mREM, mREM, mREM, mREM, mXMA, mXMA, mXMA, mXMA, m, m, m, m, + mTM, mTM, mTM, mTM, mREM, mREM, mREM, mREM, mXMA, mXMA, mXMA, mXMA, m, m, m, m, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, - mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, m, m, m, m, m, m, m, m, m, m, - mSMC, m, m, m, mALEM, m, m, m, m, m, m, m, mLAT, m, m, m, + mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, m, m, m, m, m, m, m, m, m, m, + mSMC, m, m, m, mALEM, m, m, m, m, m, m, m, mLAT, m, m, m, /* 0x240 */ mLASPX,m, m, m, mNEGA, m, m, m, m, m, m, m, m, m, m, mTC, - mLASPY,m, m, m, mDY, m, m, m, mSYY, m, m, m, m, m, m, m, - mLAB, m, m, m, m, m, m, mDB, m, m, m, m, m, m, m, m, + mLASPY,m, m, m, mDY, m, m, m, mSYY, m, m, m, m, m, m, m, + mLAB, m, m, m, m, m, m, mDB, m, m, m, m, m, m, m, m, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, /* 0x280 */ mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, - mRED, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - mREIF1,mRECF, mREIF0,m, mREIE, mRETF, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mRED, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mREIF1,mRECF, mREIF0,m, mREIE, mRETF, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x2c0 */ - mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, m, m, m, m, m, m, m, m, + mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, m, m, m, m, m, m, m, m, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, - mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x300 */ - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - mCOMB, m, m, m, mBNEM, m, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + mCOMB, m, m, m, mBNEM, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x340 */ mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mP, mP, mP, mP, mP, mP, mP, mP, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x380 */ - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, - m, m, m, m, mRTNI, m, m, mRTN, m, m, m, m, m, m, m, m, - m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, + m, m, m, m, mRTNI, m, m, mRTN, m, m, m, m, m, m, m, m, + m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, /* 0x3c0 */ mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, @@ -188,7 +188,7 @@ CPU_DISASSEMBLE(hmcs40) char *dst = buffer; UINT8 instr = hmcs40_mnemonic[op]; INT8 bits = s_bits[instr]; - + // special case for (XY) opcode if (bits == 99) { @@ -202,12 +202,12 @@ CPU_DISASSEMBLE(hmcs40) else { dst += sprintf(dst, "%-6s ", s_mnemonics[instr]); - + // opcode parameter if (bits != 0) { UINT8 param = op; - + // reverse bits if (bits < 0) { @@ -215,16 +215,16 @@ CPU_DISASSEMBLE(hmcs40) param >>= (8 + bits); bits = -bits; } - + param &= ((1 << bits) - 1); - + if (bits > 5) dst += sprintf(dst, "$%02X", param); else dst += sprintf(dst, "%d", param); } } - + int pos = s_next_pc[pc & 0x3f] & DASMFLAG_LENGTHMASK; return pos | s_flags[instr] | DASMFLAG_SUPPORTED; } diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.inc index 9732d86f53f..1887c3c0105 100644 --- a/src/emu/cpu/hmcs40/hmcs40op.inc +++ b/src/emu/cpu/hmcs40/hmcs40op.inc @@ -73,19 +73,19 @@ void hmcs40_cpu_device::op_laspy() void hmcs40_cpu_device::op_xamr() { // XAMR m: Exchange A and MR(m) - + // determine MR(Memory Register) location UINT8 address = m_op & 0xf; - + // HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3) // HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4 if (m_family == FAMILY_HMCS42 || m_family == FAMILY_HMCS43) address |= (address < 4) ? (address << 4) : 0x40; - + // HMCS44/45/46/47: all on last file else address |= 0xf0; - + address &= m_datamask; UINT8 old_a = m_a; m_a = m_data->read_byte(address) & 0xf; @@ -657,7 +657,7 @@ void hmcs40_cpu_device::op_p() m_icount--; UINT16 address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f); UINT16 o = m_program->read_word((address & m_prgmask) << 1); - + // destination is determined by the 2 highest bits if (o & 0x100) { diff --git a/src/emu/cpu/i386/i386ops.h b/src/emu/cpu/i386/i386ops.h index c540a7d3c16..31f6b349721 100644 --- a/src/emu/cpu/i386/i386ops.h +++ b/src/emu/cpu/i386/i386ops.h @@ -333,7 +333,7 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] = { 0x3B, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, { 0x3C, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, { 0x3D, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, - { 0x40, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovo_r16_rm16, &i386_device::pentium_cmovo_r32_rm32, false}, + { 0x40, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovo_r16_rm16, &i386_device::pentium_cmovo_r32_rm32, false}, { 0x41, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovno_r16_rm16, &i386_device::pentium_cmovno_r32_rm32, false}, { 0x42, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovb_r16_rm16, &i386_device::pentium_cmovb_r32_rm32, false}, { 0x43, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovae_r16_rm16, &i386_device::pentium_cmovae_r32_rm32, false}, diff --git a/src/emu/cpu/i386/pentops.inc b/src/emu/cpu/i386/pentops.inc index c7a341d9ba7..44269335d11 100644 --- a/src/emu/cpu/i386/pentops.inc +++ b/src/emu/cpu/i386/pentops.inc @@ -1065,10 +1065,10 @@ void i386_device::pentium_movnti_m32_r32() // Opcode 0f c3 void i386_device::i386_cyrix_special() // Opcode 0x0f 3a-3d { /* -0f 3a BB0_RESET (set BB0 pointer = base) -0f 3b BB1_RESET (set BB1 pointer = base) -0f 3c CPU_WRITE (write special CPU memory-mapped register, [ebx] = eax) -0f 3d CPU_READ (read special CPU memory-mapped register, eax, = [ebx]) +0f 3a BB0_RESET (set BB0 pointer = base) +0f 3b BB1_RESET (set BB1 pointer = base) +0f 3c CPU_WRITE (write special CPU memory-mapped register, [ebx] = eax) +0f 3d CPU_READ (read special CPU memory-mapped register, eax, = [ebx]) */ CYCLES(1); @@ -4417,36 +4417,36 @@ void i386_device::sse_predicate_compare_double(UINT8 imm8, XMM_REG d, XMM_REG s) switch (imm8 & 7) { case 0: - d.q[0]=d.f64[0] == s.f64[0] ? 0xffffffffffffffff : 0; - d.q[1]=d.f64[1] == s.f64[1] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] == s.f64[0] ? U64(0xffffffffffffffff) : 0; + d.q[1]=d.f64[1] == s.f64[1] ? U64(0xffffffffffffffff) : 0; break; case 1: - d.q[0]=d.f64[0] < s.f64[0] ? 0xffffffffffffffff : 0; - d.q[1]=d.f64[1] < s.f64[1] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] < s.f64[0] ? U64(0xffffffffffffffff) : 0; + d.q[1]=d.f64[1] < s.f64[1] ? U64(0xffffffffffffffff) : 0; break; case 2: - d.q[0]=d.f64[0] <= s.f64[0] ? 0xffffffffffffffff : 0; - d.q[1]=d.f64[1] <= s.f64[1] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] <= s.f64[0] ? U64(0xffffffffffffffff) : 0; + d.q[1]=d.f64[1] <= s.f64[1] ? U64(0xffffffffffffffff) : 0; break; case 3: - d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffff : 0; - d.q[1]=sse_isdoubleunordered(d.f64[1], s.f64[1]) ? 0xffffffffffffffff : 0; + d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0; + d.q[1]=sse_isdoubleunordered(d.f64[1], s.f64[1]) ? U64(0xffffffffffffffff) : 0; break; case 4: - d.q[0]=d.f64[0] != s.f64[0] ? 0xffffffffffffffff : 0; - d.q[1]=d.f64[1] != s.f64[1] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] != s.f64[0] ? U64(0xffffffffffffffff) : 0; + d.q[1]=d.f64[1] != s.f64[1] ? U64(0xffffffffffffffff) : 0; break; case 5: - d.q[0]=d.f64[0] < s.f64[0] ? 0 : 0xffffffffffffffff; - d.q[1]=d.f64[1] < s.f64[1] ? 0 : 0xffffffffffffffff; + d.q[0]=d.f64[0] < s.f64[0] ? 0 : U64(0xffffffffffffffff); + d.q[1]=d.f64[1] < s.f64[1] ? 0 : U64(0xffffffffffffffff); break; case 6: - d.q[0]=d.f64[0] <= s.f64[0] ? 0 : 0xffffffffffffffff; - d.q[1]=d.f64[1] <= s.f64[1] ? 0 : 0xffffffffffffffff; + d.q[0]=d.f64[0] <= s.f64[0] ? 0 : U64(0xffffffffffffffff); + d.q[1]=d.f64[1] <= s.f64[1] ? 0 : U64(0xffffffffffffffff); break; case 7: - d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffff : 0; - d.q[1]=sse_isdoubleordered(d.f64[1], s.f64[1]) ? 0xffffffffffffffff : 0; + d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0; + d.q[1]=sse_isdoubleordered(d.f64[1], s.f64[1]) ? U64(0xffffffffffffffff) : 0; break; } } @@ -4487,28 +4487,28 @@ void i386_device::sse_predicate_compare_double_scalar(UINT8 imm8, XMM_REG d, XMM switch (imm8 & 7) { case 0: - d.q[0]=d.f64[0] == s.f64[0] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] == s.f64[0] ? U64(0xffffffffffffffff) : 0; break; case 1: - d.q[0]=d.f64[0] < s.f64[0] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] < s.f64[0] ? U64(0xffffffffffffffff) : 0; break; case 2: - d.q[0]=d.f64[0] <= s.f64[0] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] <= s.f64[0] ? U64(0xffffffffffffffff) : 0; break; case 3: - d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffff : 0; + d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0; break; case 4: - d.q[0]=d.f64[0] != s.f64[0] ? 0xffffffffffffffff : 0; + d.q[0]=d.f64[0] != s.f64[0] ? U64(0xffffffffffffffff) : 0; break; case 5: - d.q[0]=d.f64[0] < s.f64[0] ? 0 : 0xffffffffffffffff; + d.q[0]=d.f64[0] < s.f64[0] ? 0 : U64(0xffffffffffffffff); break; case 6: - d.q[0]=d.f64[0] <= s.f64[0] ? 0 : 0xffffffffffffffff; + d.q[0]=d.f64[0] <= s.f64[0] ? 0 : U64(0xffffffffffffffff); break; case 7: - d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffff : 0; + d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0; break; } } diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h index 0ca635c630d..8fef90d8896 100644 --- a/src/emu/cpu/m68000/m68kcpu.h +++ b/src/emu/cpu/m68000/m68kcpu.h @@ -32,7 +32,7 @@ class m68000_base_device; #include <limits.h> -#ifdef SDLMAME_SOLARIS +#if defined(__sun__) && defined(__svr4__) #undef REG_SP #undef REG_PC #undef REG_FP diff --git a/src/emu/cpu/mips/mips3.c b/src/emu/cpu/mips/mips3.c index 2234a4f86a6..1847012f125 100644 --- a/src/emu/cpu/mips/mips3.c +++ b/src/emu/cpu/mips/mips3.c @@ -148,9 +148,12 @@ mips3_device::mips3_device(const machine_config &mconfig, device_type type, cons , m_pfnmask(0) , m_tlbentries(0) , m_bigendian(endianness == ENDIANNESS_BIG) + , m_byte_xor(m_bigendian ? BYTE4_XOR_BE(0) : BYTE4_XOR_LE(0)) + , m_word_xor(m_bigendian ? WORD_XOR_BE(0) : WORD_XOR_LE(0)) , c_icache_size(0) , c_dcache_size(0) , m_vtlb(NULL) + , m_fastram_select(0) , m_debugger_temp(0) , m_cache(CACHE_SIZE + sizeof(internal_mips3_state)) , m_drcuml(NULL) @@ -161,7 +164,6 @@ mips3_device::mips3_device(const machine_config &mconfig, device_type type, cons , m_nocode(NULL) , m_out_of_cycles(NULL) , m_tlb_mismatch(NULL) - , m_fastram_select(0) , m_hotspot_select(0) { memset(m_fpmode, 0, sizeof(m_fpmode)); @@ -996,12 +998,23 @@ offs_t mips3_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op TLB HANDLING ***************************************************************************/ -inline int mips3_device::RBYTE(offs_t address, UINT32 *result) +bool mips3_device::RBYTE(offs_t address, UINT32 *result) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { - *result = (*m_memory.read_byte)(*m_program, (tlbval & ~0xfff) | (address & 0xfff)); + const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) + { + if (tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) + { + continue; + } + UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + *result = fastbase[tlbaddress ^ m_byte_xor]; + return true; + } + *result = (*m_memory.read_byte)(*m_program, tlbaddress); } else { @@ -1014,18 +1027,28 @@ inline int mips3_device::RBYTE(offs_t address, UINT32 *result) generate_tlb_exception(EXCEPTION_TLBLOAD_FILL, address); } *result = 0; - return 0; + return false; } - return 1; + return true; } - -inline int mips3_device::RHALF(offs_t address, UINT32 *result) +bool mips3_device::RHALF(offs_t address, UINT32 *result) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { - *result = (*m_memory.read_word)(*m_program, (tlbval & ~0xfff) | (address & 0xfff)); + const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) + { + if (tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) + { + continue; + } + UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + *result = ((UINT16*)fastbase)[(tlbaddress ^ m_word_xor) >> 1]; + return true; + } + *result = (*m_memory.read_word)(*m_program, tlbaddress); } else { @@ -1038,18 +1061,28 @@ inline int mips3_device::RHALF(offs_t address, UINT32 *result) generate_tlb_exception(EXCEPTION_TLBLOAD_FILL, address); } *result = 0; - return 0; + return false; } - return 1; + return true; } - -inline int mips3_device::RWORD(offs_t address, UINT32 *result) +bool mips3_device::RWORD(offs_t address, UINT32 *result) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { - *result = (*m_memory.read_dword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff)); + const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) + { + if (tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) + { + continue; + } + UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + *result = ((UINT32*)fastbase)[tlbaddress >> 2]; + return true; + } + *result = (*m_memory.read_dword)(*m_program, tlbaddress); } else { @@ -1062,15 +1095,14 @@ inline int mips3_device::RWORD(offs_t address, UINT32 *result) generate_tlb_exception(EXCEPTION_TLBLOAD_FILL, address); } *result = 0; - return 0; + return false; } - return 1; + return true; } - -inline int mips3_device::RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask) +bool mips3_device::RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { *result = (*m_memory.read_dword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), mem_mask); @@ -1086,15 +1118,14 @@ inline int mips3_device::RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem generate_tlb_exception(EXCEPTION_TLBLOAD_FILL, address); } *result = 0; - return 0; + return false; } - return 1; + return true; } - -inline int mips3_device::RDOUBLE(offs_t address, UINT64 *result) +bool mips3_device::RDOUBLE(offs_t address, UINT64 *result) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { *result = (*m_memory.read_qword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff)); @@ -1110,15 +1141,14 @@ inline int mips3_device::RDOUBLE(offs_t address, UINT64 *result) generate_tlb_exception(EXCEPTION_TLBLOAD_FILL, address); } *result = 0; - return 0; + return false; } - return 1; + return true; } - -inline int mips3_device::RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 mem_mask) +bool mips3_device::RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 mem_mask) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { *result = (*m_memory.read_qword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), mem_mask); @@ -1134,18 +1164,28 @@ inline int mips3_device::RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 m generate_tlb_exception(EXCEPTION_TLBLOAD_FILL, address); } *result = 0; - return 0; + return false; } - return 1; + return true; } - -inline void mips3_device::WBYTE(offs_t address, UINT8 data) +void mips3_device::WBYTE(offs_t address, UINT8 data) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - (*m_memory.write_byte)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data); + const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) + { + if (m_fastram[ramnum].readonly == TRUE || tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) + { + continue; + } + UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + fastbase[tlbaddress ^ m_byte_xor] = data; + return; + } + (*m_memory.write_byte)(*m_program, tlbaddress, data); } else { @@ -1164,13 +1204,23 @@ inline void mips3_device::WBYTE(offs_t address, UINT8 data) } } - -inline void mips3_device::WHALF(offs_t address, UINT16 data) +void mips3_device::WHALF(offs_t address, UINT16 data) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - (*m_memory.write_word)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data); + const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) + { + if (m_fastram[ramnum].readonly == TRUE || tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) + { + continue; + } + void *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + ((UINT16*)fastbase)[(tlbaddress ^ m_word_xor) >> 1] = data; + return; + } + (*m_memory.write_word)(*m_program, tlbaddress, data); } else { @@ -1189,13 +1239,23 @@ inline void mips3_device::WHALF(offs_t address, UINT16 data) } } - -inline void mips3_device::WWORD(offs_t address, UINT32 data) +void mips3_device::WWORD(offs_t address, UINT32 data) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - (*m_memory.write_dword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data); + const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) + { + if (m_fastram[ramnum].readonly == TRUE || tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) + { + continue; + } + void *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + ((UINT32*)fastbase)[tlbaddress >> 2] = data; + return; + } + (*m_memory.write_dword)(*m_program, tlbaddress, data); } else { @@ -1214,10 +1274,9 @@ inline void mips3_device::WWORD(offs_t address, UINT32 data) } } - -inline void mips3_device::WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_mask) +void mips3_device::WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_mask) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { (*m_memory.write_dword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data, mem_mask); @@ -1239,14 +1298,12 @@ inline void mips3_device::WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_m } } - -inline void mips3_device::WDOUBLE(offs_t address, UINT64 data) +void mips3_device::WDOUBLE(offs_t address, UINT64 data) { - UINT32 tlbval = m_tlb_table[address >> 12]; - //printf("%08x: %08x\n", (UINT32)address, (UINT32)tlbval); + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - (*m_memory.write_qword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data); + (*m_memory.write_qword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data); } else { @@ -1265,10 +1322,9 @@ inline void mips3_device::WDOUBLE(offs_t address, UINT64 data) } } - -inline void mips3_device::WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem_mask) +void mips3_device::WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem_mask) { - UINT32 tlbval = m_tlb_table[address >> 12]; + const UINT32 tlbval = m_tlb_table[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { (*m_memory.write_qword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data, mem_mask); @@ -1296,7 +1352,7 @@ inline void mips3_device::WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem COP0 (SYSTEM) EXECUTION HANDLING ***************************************************************************/ -inline UINT64 mips3_device::get_cop0_reg(int idx) +UINT64 mips3_device::get_cop0_reg(int idx) { if (idx == COP0_Count) { @@ -1329,7 +1385,7 @@ inline UINT64 mips3_device::get_cop0_reg(int idx) return m_core->cpr[0][idx]; } -inline void mips3_device::set_cop0_reg(int idx, UINT64 val) +void mips3_device::set_cop0_reg(int idx, UINT64 val) { switch (idx) { @@ -1406,7 +1462,7 @@ inline void mips3_device::set_cop0_creg(int idx, UINT64 val) m_core->ccr[0][idx] = val; } -inline void mips3_device::handle_cop0(UINT32 op) +void mips3_device::handle_cop0(UINT32 op) { if ((SR & SR_KSU_MASK) != SR_KSU_KERNEL && !(SR & SR_COP0)) { @@ -1541,7 +1597,7 @@ inline void mips3_device::set_cop1_creg(int idx, UINT64 val) } } -inline void mips3_device::handle_cop1_fr0(UINT32 op) +void mips3_device::handle_cop1_fr0(UINT32 op) { double dtemp; @@ -1900,7 +1956,7 @@ inline void mips3_device::handle_cop1_fr0(UINT32 op) } -inline void mips3_device::handle_cop1_fr1(UINT32 op) +void mips3_device::handle_cop1_fr1(UINT32 op) { double dtemp; @@ -2264,7 +2320,7 @@ inline void mips3_device::handle_cop1_fr1(UINT32 op) COP1X (FPU EXTRA) EXECUTION HANDLING ***************************************************************************/ -inline void mips3_device::handle_cop1x_fr0(UINT32 op) +void mips3_device::handle_cop1x_fr0(UINT32 op) { UINT64 temp64; UINT32 temp; @@ -2342,8 +2398,7 @@ inline void mips3_device::handle_cop1x_fr0(UINT32 op) } } - -inline void mips3_device::handle_cop1x_fr1(UINT32 op) +void mips3_device::handle_cop1x_fr1(UINT32 op) { UINT64 temp64; UINT32 temp; @@ -2447,7 +2502,7 @@ inline void mips3_device::set_cop2_creg(int idx, UINT64 val) m_core->ccr[2][idx] = val; } -inline void mips3_device::handle_cop2(UINT32 op) +void mips3_device::handle_cop2(UINT32 op) { if (!(SR & SR_COP2)) { @@ -2499,6 +2554,159 @@ inline void mips3_device::handle_cop2(UINT32 op) CORE EXECUTION LOOP ***************************************************************************/ +void mips3_device::handle_regimm(UINT32 op) +{ + switch (RTREG) + { + case 0x00: /* BLTZ */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); break; + case 0x01: /* BGEZ */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); break; + case 0x02: /* BLTZL */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x03: /* BGEZL */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x08: /* TGEI */ if ((INT64)RSVAL64 >= SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x09: /* TGEIU */ if (RSVAL64 >= UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x0a: /* TLTI */ if ((INT64)RSVAL64 < SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x0b: /* TLTIU */ if (RSVAL64 >= UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x0c: /* TEQI */ if (RSVAL64 == UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x0e: /* TNEI */ if (RSVAL64 != UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x10: /* BLTZAL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31); break; + case 0x11: /* BGEZAL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31); break; + case 0x12: /* BLTZALL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31) else m_core->pc += 4; break; + case 0x13: /* BGEZALL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31) else m_core->pc += 4; break; + default: /* ??? */ invalid_instruction(op); break; + } +} + +void mips3_device::handle_special(UINT32 op) +{ + switch (op & 63) + { + case 0x00: /* SLL */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 << SHIFT); break; + case 0x01: /* MOVF - R5000*/if (RDREG && GET_FCC((op >> 18) & 7) == ((op >> 16) & 1)) RDVAL64 = RSVAL64; break; + case 0x02: /* SRL */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 >> SHIFT); break; + case 0x03: /* SRA */ if (RDREG) RDVAL64 = (INT32)RTVAL32 >> SHIFT; break; + case 0x04: /* SLLV */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 << (RSVAL32 & 31)); break; + case 0x06: /* SRLV */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 >> (RSVAL32 & 31)); break; + case 0x07: /* SRAV */ if (RDREG) RDVAL64 = (INT32)RTVAL32 >> (RSVAL32 & 31); break; + case 0x08: /* JR */ SETPC(RSVAL32); break; + case 0x09: /* JALR */ SETPCL(RSVAL32,RDREG); break; + case 0x0a: /* MOVZ - R5000 */if (RTVAL64 == 0) { if (RDREG) RDVAL64 = RSVAL64; } break; + case 0x0b: /* MOVN - R5000 */if (RTVAL64 != 0) { if (RDREG) RDVAL64 = RSVAL64; } break; + case 0x0c: /* SYSCALL */ generate_exception(EXCEPTION_SYSCALL, 1); break; + case 0x0d: /* BREAK */ generate_exception(EXCEPTION_BREAK, 1); break; + case 0x0f: /* SYNC */ /* effective no-op */ break; + case 0x10: /* MFHI */ if (RDREG) RDVAL64 = HIVAL64; break; + case 0x11: /* MTHI */ HIVAL64 = RSVAL64; break; + case 0x12: /* MFLO */ if (RDREG) RDVAL64 = LOVAL64; break; + case 0x13: /* MTLO */ LOVAL64 = RSVAL64; break; + case 0x14: /* DSLLV */ if (RDREG) RDVAL64 = RTVAL64 << (RSVAL32 & 63); break; + case 0x16: /* DSRLV */ if (RDREG) RDVAL64 = RTVAL64 >> (RSVAL32 & 63); break; + case 0x17: /* DSRAV */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> (RSVAL32 & 63); break; + case 0x18: /* MULT */ + { + UINT64 temp64 = (INT64)(INT32)RSVAL32 * (INT64)(INT32)RTVAL32; + LOVAL64 = (INT32)temp64; + HIVAL64 = (INT32)(temp64 >> 32); + m_core->icount -= 3; + break; + } + case 0x19: /* MULTU */ + { + UINT64 temp64 = (UINT64)RSVAL32 * (UINT64)RTVAL32; + LOVAL64 = (INT32)temp64; + HIVAL64 = (INT32)(temp64 >> 32); + m_core->icount -= 3; + break; + } + case 0x1a: /* DIV */ + if (RTVAL32) + { + LOVAL64 = (INT32)((INT32)RSVAL32 / (INT32)RTVAL32); + HIVAL64 = (INT32)((INT32)RSVAL32 % (INT32)RTVAL32); + } + m_core->icount -= 35; + break; + case 0x1b: /* DIVU */ + if (RTVAL32) + { + LOVAL64 = (INT32)(RSVAL32 / RTVAL32); + HIVAL64 = (INT32)(RSVAL32 % RTVAL32); + } + m_core->icount -= 35; + break; + case 0x1c: /* DMULT */ + { + UINT64 temp64 = (INT64)RSVAL64 * (INT64)RTVAL64; + LOVAL64 = temp64; + HIVAL64 = (INT64)temp64 >> 63; + m_core->icount -= 7; + break; + } + case 0x1d: /* DMULTU */ + { + UINT64 temp64 = (UINT64)RSVAL64 * (UINT64)RTVAL64; + LOVAL64 = temp64; + HIVAL64 = 0; + m_core->icount -= 7; + break; + } + case 0x1e: /* DDIV */ + if (RTVAL64) + { + LOVAL64 = (INT64)RSVAL64 / (INT64)RTVAL64; + HIVAL64 = (INT64)RSVAL64 % (INT64)RTVAL64; + } + m_core->icount -= 67; + break; + case 0x1f: /* DDIVU */ + if (RTVAL64) + { + LOVAL64 = RSVAL64 / RTVAL64; + HIVAL64 = RSVAL64 % RTVAL64; + } + m_core->icount -= 67; + break; + case 0x20: /* ADD */ + if (ENABLE_OVERFLOWS && RSVAL32 > ~RTVAL32) generate_exception(EXCEPTION_OVERFLOW, 1); + else if (RDREG) RDVAL64 = (INT32)(RSVAL32 + RTVAL32); + break; + case 0x21: /* ADDU */ if (RDREG) RDVAL64 = (INT32)(RSVAL32 + RTVAL32); break; + case 0x22: /* SUB */ + if (ENABLE_OVERFLOWS && RSVAL32 < RTVAL32) generate_exception(EXCEPTION_OVERFLOW, 1); + else if (RDREG) RDVAL64 = (INT32)(RSVAL32 - RTVAL32); + break; + case 0x23: /* SUBU */ if (RDREG) RDVAL64 = (INT32)(RSVAL32 - RTVAL32); break; + case 0x24: /* AND */ if (RDREG) RDVAL64 = RSVAL64 & RTVAL64; break; + case 0x25: /* OR */ if (RDREG) RDVAL64 = RSVAL64 | RTVAL64; break; + case 0x26: /* XOR */ if (RDREG) RDVAL64 = RSVAL64 ^ RTVAL64; break; + case 0x27: /* NOR */ if (RDREG) RDVAL64 = ~(RSVAL64 | RTVAL64); break; + case 0x2a: /* SLT */ if (RDREG) RDVAL64 = (INT64)RSVAL64 < (INT64)RTVAL64; break; + case 0x2b: /* SLTU */ if (RDREG) RDVAL64 = (UINT64)RSVAL64 < (UINT64)RTVAL64; break; + case 0x2c: /* DADD */ + if (ENABLE_OVERFLOWS && RSVAL64 > ~RTVAL64) generate_exception(EXCEPTION_OVERFLOW, 1); + else if (RDREG) RDVAL64 = RSVAL64 + RTVAL64; + break; + case 0x2d: /* DADDU */ if (RDREG) RDVAL64 = RSVAL64 + RTVAL64; break; + case 0x2e: /* DSUB */ + if (ENABLE_OVERFLOWS && RSVAL64 < RTVAL64) generate_exception(EXCEPTION_OVERFLOW, 1); + else if (RDREG) RDVAL64 = RSVAL64 - RTVAL64; + break; + case 0x2f: /* DSUBU */ if (RDREG) RDVAL64 = RSVAL64 - RTVAL64; break; + case 0x30: /* TGE */ if ((INT64)RSVAL64 >= (INT64)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x31: /* TGEU */ if (RSVAL64 >= RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x32: /* TLT */ if ((INT64)RSVAL64 < (INT64)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x33: /* TLTU */ if (RSVAL64 < RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x34: /* TEQ */ if (RSVAL64 == RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x36: /* TNE */ if (RSVAL64 != RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x38: /* DSLL */ if (RDREG) RDVAL64 = RTVAL64 << SHIFT; break; + case 0x3a: /* DSRL */ if (RDREG) RDVAL64 = RTVAL64 >> SHIFT; break; + case 0x3b: /* DSRA */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> SHIFT; break; + case 0x3c: /* DSLL32 */ if (RDREG) RDVAL64 = RTVAL64 << (SHIFT + 32); break; + case 0x3e: /* DSRL32 */ if (RDREG) RDVAL64 = RTVAL64 >> (SHIFT + 32); break; + case 0x3f: /* DSRA32 */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> (SHIFT + 32); break; + default: /* ??? */ invalid_instruction(op); break; + } +} + void mips3_device::execute_run() { if (m_isdrc) @@ -2575,146 +2783,11 @@ void mips3_device::execute_run() switch (op >> 26) { case 0x00: /* SPECIAL */ - switch (op & 63) - { - case 0x00: /* SLL */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 << SHIFT); break; - case 0x01: /* MOVF - R5000*/if (RDREG && GET_FCC((op >> 18) & 7) == ((op >> 16) & 1)) RDVAL64 = RSVAL64; break; - case 0x02: /* SRL */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 >> SHIFT); break; - case 0x03: /* SRA */ if (RDREG) RDVAL64 = (INT32)RTVAL32 >> SHIFT; break; - case 0x04: /* SLLV */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 << (RSVAL32 & 31)); break; - case 0x06: /* SRLV */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 >> (RSVAL32 & 31)); break; - case 0x07: /* SRAV */ if (RDREG) RDVAL64 = (INT32)RTVAL32 >> (RSVAL32 & 31); break; - case 0x08: /* JR */ SETPC(RSVAL32); break; - case 0x09: /* JALR */ SETPCL(RSVAL32,RDREG); break; - case 0x0a: /* MOVZ - R5000 */if (RTVAL64 == 0) { if (RDREG) RDVAL64 = RSVAL64; } break; - case 0x0b: /* MOVN - R5000 */if (RTVAL64 != 0) { if (RDREG) RDVAL64 = RSVAL64; } break; - case 0x0c: /* SYSCALL */ generate_exception(EXCEPTION_SYSCALL, 1); break; - case 0x0d: /* BREAK */ generate_exception(EXCEPTION_BREAK, 1); break; - case 0x0f: /* SYNC */ /* effective no-op */ break; - case 0x10: /* MFHI */ if (RDREG) RDVAL64 = HIVAL64; break; - case 0x11: /* MTHI */ HIVAL64 = RSVAL64; break; - case 0x12: /* MFLO */ if (RDREG) RDVAL64 = LOVAL64; break; - case 0x13: /* MTLO */ LOVAL64 = RSVAL64; break; - case 0x14: /* DSLLV */ if (RDREG) RDVAL64 = RTVAL64 << (RSVAL32 & 63); break; - case 0x16: /* DSRLV */ if (RDREG) RDVAL64 = RTVAL64 >> (RSVAL32 & 63); break; - case 0x17: /* DSRAV */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> (RSVAL32 & 63); break; - case 0x18: /* MULT */ - temp64 = (INT64)(INT32)RSVAL32 * (INT64)(INT32)RTVAL32; - LOVAL64 = (INT32)temp64; - HIVAL64 = (INT32)(temp64 >> 32); - m_core->icount -= 3; - break; - case 0x19: /* MULTU */ - temp64 = (UINT64)RSVAL32 * (UINT64)RTVAL32; - LOVAL64 = (INT32)temp64; - HIVAL64 = (INT32)(temp64 >> 32); - m_core->icount -= 3; - break; - case 0x1a: /* DIV */ - if (RTVAL32) - { - LOVAL64 = (INT32)((INT32)RSVAL32 / (INT32)RTVAL32); - HIVAL64 = (INT32)((INT32)RSVAL32 % (INT32)RTVAL32); - } - m_core->icount -= 35; - break; - case 0x1b: /* DIVU */ - if (RTVAL32) - { - LOVAL64 = (INT32)(RSVAL32 / RTVAL32); - HIVAL64 = (INT32)(RSVAL32 % RTVAL32); - } - m_core->icount -= 35; - break; - case 0x1c: /* DMULT */ - temp64 = (INT64)RSVAL64 * (INT64)RTVAL64; - LOVAL64 = temp64; - HIVAL64 = (INT64)temp64 >> 63; - m_core->icount -= 7; - break; - case 0x1d: /* DMULTU */ - temp64 = (UINT64)RSVAL64 * (UINT64)RTVAL64; - LOVAL64 = temp64; - HIVAL64 = 0; - m_core->icount -= 7; - break; - case 0x1e: /* DDIV */ - if (RTVAL64) - { - LOVAL64 = (INT64)RSVAL64 / (INT64)RTVAL64; - HIVAL64 = (INT64)RSVAL64 % (INT64)RTVAL64; - } - m_core->icount -= 67; - break; - case 0x1f: /* DDIVU */ - if (RTVAL64) - { - LOVAL64 = RSVAL64 / RTVAL64; - HIVAL64 = RSVAL64 % RTVAL64; - } - m_core->icount -= 67; - break; - case 0x20: /* ADD */ - if (ENABLE_OVERFLOWS && RSVAL32 > ~RTVAL32) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RDREG) RDVAL64 = (INT32)(RSVAL32 + RTVAL32); - break; - case 0x21: /* ADDU */ if (RDREG) RDVAL64 = (INT32)(RSVAL32 + RTVAL32); break; - case 0x22: /* SUB */ - if (ENABLE_OVERFLOWS && RSVAL32 < RTVAL32) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RDREG) RDVAL64 = (INT32)(RSVAL32 - RTVAL32); - break; - case 0x23: /* SUBU */ if (RDREG) RDVAL64 = (INT32)(RSVAL32 - RTVAL32); break; - case 0x24: /* AND */ if (RDREG) RDVAL64 = RSVAL64 & RTVAL64; break; - case 0x25: /* OR */ if (RDREG) RDVAL64 = RSVAL64 | RTVAL64; break; - case 0x26: /* XOR */ if (RDREG) RDVAL64 = RSVAL64 ^ RTVAL64; break; - case 0x27: /* NOR */ if (RDREG) RDVAL64 = ~(RSVAL64 | RTVAL64); break; - case 0x2a: /* SLT */ if (RDREG) RDVAL64 = (INT64)RSVAL64 < (INT64)RTVAL64; break; - case 0x2b: /* SLTU */ if (RDREG) RDVAL64 = (UINT64)RSVAL64 < (UINT64)RTVAL64; break; - case 0x2c: /* DADD */ - if (ENABLE_OVERFLOWS && RSVAL64 > ~RTVAL64) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RDREG) RDVAL64 = RSVAL64 + RTVAL64; - break; - case 0x2d: /* DADDU */ if (RDREG) RDVAL64 = RSVAL64 + RTVAL64; break; - case 0x2e: /* DSUB */ - if (ENABLE_OVERFLOWS && RSVAL64 < RTVAL64) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RDREG) RDVAL64 = RSVAL64 - RTVAL64; - break; - case 0x2f: /* DSUBU */ if (RDREG) RDVAL64 = RSVAL64 - RTVAL64; break; - case 0x30: /* TGE */ if ((INT64)RSVAL64 >= (INT64)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x31: /* TGEU */ if (RSVAL64 >= RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x32: /* TLT */ if ((INT64)RSVAL64 < (INT64)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x33: /* TLTU */ if (RSVAL64 < RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x34: /* TEQ */ if (RSVAL64 == RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x36: /* TNE */ if (RSVAL64 != RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x38: /* DSLL */ if (RDREG) RDVAL64 = RTVAL64 << SHIFT; break; - case 0x3a: /* DSRL */ if (RDREG) RDVAL64 = RTVAL64 >> SHIFT; break; - case 0x3b: /* DSRA */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> SHIFT; break; - case 0x3c: /* DSLL32 */ if (RDREG) RDVAL64 = RTVAL64 << (SHIFT + 32); break; - case 0x3e: /* DSRL32 */ if (RDREG) RDVAL64 = RTVAL64 >> (SHIFT + 32); break; - case 0x3f: /* DSRA32 */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> (SHIFT + 32); break; - default: /* ??? */ invalid_instruction(op); break; - } + handle_special(op); break; case 0x01: /* REGIMM */ - switch (RTREG) - { - case 0x00: /* BLTZ */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); break; - case 0x01: /* BGEZ */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); break; - case 0x02: /* BLTZL */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x03: /* BGEZL */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x08: /* TGEI */ if ((INT64)RSVAL64 >= SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x09: /* TGEIU */ if (RSVAL64 >= UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x0a: /* TLTI */ if ((INT64)RSVAL64 < SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x0b: /* TLTIU */ if (RSVAL64 >= UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x0c: /* TEQI */ if (RSVAL64 == UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x0e: /* TNEI */ if (RSVAL64 != UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x10: /* BLTZAL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31); break; - case 0x11: /* BGEZAL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31); break; - case 0x12: /* BLTZALL */ if ((INT64)RSVAL64 < 0) ADDPCL(SIMMVAL,31) else m_core->pc += 4; break; - case 0x13: /* BGEZALL */ if ((INT64)RSVAL64 >= 0) ADDPCL(SIMMVAL,31) else m_core->pc += 4; break; - default: /* ??? */ invalid_instruction(op); break; - } + handle_regimm(op); break; case 0x02: /* J */ ABSPC(LIMMVAL); break; @@ -2784,34 +2857,34 @@ void mips3_device::execute_run() case 0x36: /* LDC2 */ if (RDOUBLE(SIMMVAL+RSVAL32, &temp64)) set_cop2_reg(RTREG, temp64); break; case 0x37: /* LD */ if (RDOUBLE(SIMMVAL+RSVAL32, &temp64) && RTREG) RTVAL64 = temp64; break; case 0x38: /* SC */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) - { - if (temp == m_ll_value) - { - WWORD(SIMMVAL+RSVAL32, RTVAL32); - RTVAL64 = (UINT32)1; - } - else - { - RTVAL64 = (UINT32)0; - } - } - break; + { + if (temp == m_ll_value) + { + WWORD(SIMMVAL+RSVAL32, RTVAL32); + RTVAL64 = (UINT32)1; + } + else + { + RTVAL64 = (UINT32)0; + } + } + break; case 0x39: /* SWC1 */ WWORD(SIMMVAL+RSVAL32, get_cop1_reg32(RTREG)); break; case 0x3a: /* SWC2 */ WWORD(SIMMVAL+RSVAL32, get_cop2_reg(RTREG)); break; case 0x3b: /* SWC3 */ invalid_instruction(op); break; case 0x3c: /* SCD */ if (RDOUBLE(SIMMVAL+RSVAL32, &temp64) && RTREG) - { - if (temp64 == m_lld_value) - { - WDOUBLE(SIMMVAL+RSVAL32, RTVAL64); - RTVAL64 = 1; - } - else - { - RTVAL64 = 0; - } - } - break; + { + if (temp64 == m_lld_value) + { + WDOUBLE(SIMMVAL+RSVAL32, RTVAL64); + RTVAL64 = 1; + } + else + { + RTVAL64 = 0; + } + } + break; case 0x3d: /* SDC1 */ WDOUBLE(SIMMVAL+RSVAL32, get_cop1_reg64(RTREG)); break; case 0x3e: /* SDC2 */ WDOUBLE(SIMMVAL+RSVAL32, get_cop2_reg(RTREG)); break; case 0x3f: /* SD */ WDOUBLE(SIMMVAL+RSVAL32, RTVAL64); break; diff --git a/src/emu/cpu/mips/mips3.h b/src/emu/cpu/mips/mips3.h index 5910669e6bc..29759fe8471 100644 --- a/src/emu/cpu/mips/mips3.h +++ b/src/emu/cpu/mips/mips3.h @@ -194,7 +194,7 @@ enum MIPS3_BADVADDR }; -#define MIPS3_MAX_FASTRAM 4 +#define MIPS3_MAX_FASTRAM 3 #define MIPS3_MAX_HOTSPOTS 16 enum @@ -296,8 +296,9 @@ public: TIMER_CALLBACK_MEMBER(compare_int_callback); + void add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); + void mips3drc_set_options(UINT32 options); - void mips3drc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); void mips3drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles); protected: @@ -326,6 +327,7 @@ protected: virtual UINT32 disasm_max_opcode_bytes() const { return 4; } virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); + private: struct internal_mips3_state { @@ -394,6 +396,8 @@ private: /* memory accesses */ bool m_bigendian; + UINT32 m_byte_xor; + UINT32 m_word_xor; data_accessors m_memory; /* cache memory */ @@ -404,6 +408,16 @@ private: vtlb_state * m_vtlb; mips3_tlb_entry m_tlb[MIPS3_MAX_TLB_ENTRIES]; + /* fast RAM */ + UINT32 m_fastram_select; + struct + { + offs_t start; /* start of the RAM block */ + offs_t end; /* end of the RAM block */ + UINT8 readonly; /* TRUE if read-only */ + void * base; /* base in memory where the RAM lives */ + } m_fastram[MIPS3_MAX_FASTRAM]; + UINT64 m_debugger_temp; /* core state */ @@ -442,16 +456,6 @@ private: uml::code_handle * m_exception[18/*EXCEPTION_COUNT*/]; /* array of exception handlers */ uml::code_handle * m_exception_norecover[18/*EXCEPTION_COUNT*/]; /* array of no-recover exception handlers */ - /* fast RAM */ - UINT32 m_fastram_select; - struct - { - offs_t start; /* start of the RAM block */ - offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ - void * base; /* base in memory where the RAM lives */ - } m_fastram[MIPS3_MAX_FASTRAM]; - /* hotspots */ UINT32 m_hotspot_select; struct @@ -477,25 +481,29 @@ public: private: UINT32 compute_config_register(); UINT32 compute_prid_register(); + void tlb_map_entry(int tlbindex); void tlb_write_common(int tlbindex); - int RBYTE(offs_t address, UINT32 *result); - int RHALF(offs_t address, UINT32 *result); - int RWORD(offs_t address, UINT32 *result); - int RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask); - int RDOUBLE(offs_t address, UINT64 *result); - int RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 mem_mask); + + bool RBYTE(offs_t address, UINT32 *result); + bool RHALF(offs_t address, UINT32 *result); + bool RWORD(offs_t address, UINT32 *result); + bool RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask); + bool RDOUBLE(offs_t address, UINT64 *result); + bool RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 mem_mask); void WBYTE(offs_t address, UINT8 data); void WHALF(offs_t address, UINT16 data); void WWORD(offs_t address, UINT32 data); void WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_mask); void WDOUBLE(offs_t address, UINT64 data); void WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem_mask); + UINT64 get_cop0_reg(int idx); void set_cop0_reg(int idx, UINT64 val); UINT64 get_cop0_creg(int idx); void set_cop0_creg(int idx, UINT64 val); void handle_cop0(UINT32 op); + UINT32 get_cop1_reg32(int idx); UINT64 get_cop1_reg64(int idx); void set_cop1_reg32(int idx, UINT32 val); @@ -506,11 +514,16 @@ private: void handle_cop1_fr1(UINT32 op); void handle_cop1x_fr0(UINT32 op); void handle_cop1x_fr1(UINT32 op); + UINT64 get_cop2_reg(int idx); void set_cop2_reg(int idx, UINT64 val); UINT64 get_cop2_creg(int idx); void set_cop2_creg(int idx, UINT64 val); void handle_cop2(UINT32 op); + + void handle_special(UINT32 op); + void handle_regimm(UINT32 op); + void lwl_be(UINT32 op); void lwr_be(UINT32 op); void ldl_be(UINT32 op); @@ -756,6 +769,7 @@ private: #define MIPS3DRC_STRICT_COP2 0x0008 /* validate all COP2 instructions */ #define MIPS3DRC_FLUSH_PC 0x0010 /* flush the PC value before each memory access */ #define MIPS3DRC_CHECK_OVERFLOWS 0x0020 /* actually check overflows on add/sub instructions */ +#define MIPS3DRC_ACCURATE_DIVZERO 0x0040 /* load correct values into HI/LO on integer divide-by-zero */ #define MIPS3DRC_COMPATIBLE_OPTIONS (MIPS3DRC_STRICT_VERIFY | MIPS3DRC_STRICT_COP1 | MIPS3DRC_STRICT_COP0 | MIPS3DRC_STRICT_COP2 | MIPS3DRC_FLUSH_PC) #define MIPS3DRC_FASTEST_OPTIONS (0) diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c index effe2154468..c1ade211c67 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -160,9 +160,8 @@ void mips3_device::mips3drc_set_options(UINT32 options) region -------------------------------------------------*/ -void mips3_device::mips3drc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) +void mips3_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) { - if (!machine().options().drc()) return; if (m_fastram_select < ARRAY_LENGTH(m_fastram)) { m_fastram[m_fastram_select].start = start; @@ -2054,15 +2053,15 @@ int mips3_device::generate_special(drcuml_block *block, compiler_state *compiler return TRUE; case 0x1a: /* DIV - MIPS I */ - UML_DIVS(block, I0, I1, R32(RSREG), R32(RTREG)); // divs i0,i1,<rsreg>,<rtreg> - UML_DSEXT(block, LO64, I0, SIZE_DWORD); // dsext lo,i0,dword - UML_DSEXT(block, HI64, I1, SIZE_DWORD); // dsext hi,i1,dword + UML_DIVS(block, I0, I1, R32(RSREG), R32(RTREG)); // divs i0,i1,<rsreg>,<rtreg> + UML_DSEXT(block, LO64, I0, SIZE_DWORD); // dsext lo,i0,dword + UML_DSEXT(block, HI64, I1, SIZE_DWORD); // dsext hi,i1,dword return TRUE; case 0x1b: /* DIVU - MIPS I */ - UML_DIVU(block, I0, I1, R32(RSREG), R32(RTREG)); // divu i0,i1,<rsreg>,<rtreg> - UML_DSEXT(block, LO64, I0, SIZE_DWORD); // dsext lo,i0,dword - UML_DSEXT(block, HI64, I1, SIZE_DWORD); // dsext hi,i1,dword + UML_DIVU(block, I0, I1, R32(RSREG), R32(RTREG)); // divu i0,i1,<rsreg>,<rtreg> + UML_DSEXT(block, LO64, I0, SIZE_DWORD); // dsext lo,i0,dword + UML_DSEXT(block, HI64, I1, SIZE_DWORD); // dsext hi,i1,dword return TRUE; case 0x1e: /* DDIV - MIPS III */ diff --git a/src/emu/cpu/nec/v53.c b/src/emu/cpu/nec/v53.c index 0019f5bd959..a99d3bad960 100644 --- a/src/emu/cpu/nec/v53.c +++ b/src/emu/cpu/nec/v53.c @@ -237,9 +237,8 @@ void v53_base_device::install_peripheral_io() if (m_SCTL & 0x02) // uPD71037 mode { - if (IOAG) // 8-bit + if (IOAG) // 8-bit { - } else { @@ -256,9 +255,8 @@ void v53_base_device::install_peripheral_io() UINT16 base = (m_OPHA << 8) | m_IULA; base &= 0xfffe; - if (IOAG) // 8-bit + if (IOAG) // 8-bit { - } else { @@ -272,9 +270,8 @@ void v53_base_device::install_peripheral_io() //printf("installing TCU to %04x\n", base); base &= 0xfffe; - if (IOAG) // 8-bit + if (IOAG) // 8-bit { - } else { @@ -290,9 +287,8 @@ void v53_base_device::install_peripheral_io() UINT16 base = (m_OPHA << 8) | m_SULA; base &= 0xfffe; - if (IOAG) // 8-bit + if (IOAG) // 8-bit { - } else { @@ -333,9 +329,9 @@ WRITE8_MEMBER(v53_base_device::tmu_tct2_w) { m_v53tcu->write(space, 2, data); } WRITE8_MEMBER(v53_base_device::tmu_tmd_w) { m_v53tcu->write(space, 3, data); } -READ8_MEMBER(v53_base_device::tmu_tst0_r) { return m_v53tcu->read(space, 0); } -READ8_MEMBER(v53_base_device::tmu_tst1_r) { return m_v53tcu->read(space, 1); } -READ8_MEMBER(v53_base_device::tmu_tst2_r) { return m_v53tcu->read(space, 2); } +READ8_MEMBER(v53_base_device::tmu_tst0_r) { return m_v53tcu->read(space, 0); } +READ8_MEMBER(v53_base_device::tmu_tst1_r) { return m_v53tcu->read(space, 1); } +READ8_MEMBER(v53_base_device::tmu_tst2_r) { return m_v53tcu->read(space, 2); } @@ -343,7 +339,7 @@ READ8_MEMBER(v53_base_device::tmu_tst2_r) { return m_v53tcu->read(space, 2); } /*** DMA ***/ -// could be wrong / nonexistent +// could be wrong / nonexistent WRITE_LINE_MEMBER(v53_base_device::dreq0_w) { if (!(m_SCTL & 0x02)) @@ -409,20 +405,20 @@ WRITE_LINE_MEMBER(v53_base_device::hack_w) static ADDRESS_MAP_START( v53_internal_port_map, AS_IO, 16, v53_base_device ) AM_RANGE(0xffe0, 0xffe1) AM_WRITE8( BSEL_w, 0x00ff) // 0xffe0 // uPD71037 DMA mode bank selection register AM_RANGE(0xffe0, 0xffe1) AM_WRITE8( BADR_w, 0xff00) // 0xffe1 // uPD71037 DMA mode bank register peripheral mapping (also uses OPHA) -// AM_RANGE(0xffe2, 0xffe3) // (reserved , 0x00ff) // 0xffe2 -// AM_RANGE(0xffe2, 0xffe3) // (reserved , 0xff00) // 0xffe3 -// AM_RANGE(0xffe4, 0xffe5) // (reserved , 0x00ff) // 0xffe4 -// AM_RANGE(0xffe4, 0xffe5) // (reserved , 0xff00) // 0xffe5 -// AM_RANGE(0xffe6, 0xffe7) // (reserved , 0x00ff) // 0xffe6 -// AM_RANGE(0xffe6, 0xffe7) // (reserved , 0xff00) // 0xffe7 -// AM_RANGE(0xffe8, 0xffe9) // (reserved , 0x00ff) // 0xffe8 +// AM_RANGE(0xffe2, 0xffe3) // (reserved , 0x00ff) // 0xffe2 +// AM_RANGE(0xffe2, 0xffe3) // (reserved , 0xff00) // 0xffe3 +// AM_RANGE(0xffe4, 0xffe5) // (reserved , 0x00ff) // 0xffe4 +// AM_RANGE(0xffe4, 0xffe5) // (reserved , 0xff00) // 0xffe5 +// AM_RANGE(0xffe6, 0xffe7) // (reserved , 0x00ff) // 0xffe6 +// AM_RANGE(0xffe6, 0xffe7) // (reserved , 0xff00) // 0xffe7 +// AM_RANGE(0xffe8, 0xffe9) // (reserved , 0x00ff) // 0xffe8 AM_RANGE(0xffe8, 0xffe9) AM_WRITE8( BRC_w , 0xff00) // 0xffe9 // baud rate counter (used for serial peripheral) AM_RANGE(0xffea, 0xffeb) AM_WRITE8( WMB0_w, 0x00ff) // 0xffea // waitstate control AM_RANGE(0xffea, 0xffeb) AM_WRITE8( WCY1_w, 0xff00) // 0xffeb // waitstate control AM_RANGE(0xffec, 0xffed) AM_WRITE8( WCY0_w, 0x00ff) // 0xffec // waitstate control AM_RANGE(0xffec, 0xffed) AM_WRITE8( WAC_w, 0xff00) // 0xffed // waitstate control -// AM_RANGE(0xffee, 0xffef) // (reserved , 0x00ff) // 0xffee -// AM_RANGE(0xffee, 0xffef) // (reserved , 0xff00) // 0xffef +// AM_RANGE(0xffee, 0xffef) // (reserved , 0x00ff) // 0xffee +// AM_RANGE(0xffee, 0xffef) // (reserved , 0xff00) // 0xffef AM_RANGE(0xfff0, 0xfff1) AM_WRITE8( TCKS_w, 0x00ff) // 0xfff0 // timer clocks AM_RANGE(0xfff0, 0xfff1) AM_WRITE8( SBCR_w, 0xff00) // 0xfff1 // internal clock divider, halt behavior etc. AM_RANGE(0xfff2, 0xfff3) AM_WRITE8( REFC_w, 0x00ff) // 0xfff2 // ram refresh control @@ -430,7 +426,7 @@ static ADDRESS_MAP_START( v53_internal_port_map, AS_IO, 16, v53_base_device ) AM_RANGE(0xfff4, 0xfff5) AM_WRITE8( WCY2_w, 0x00ff) // 0xfff4 // waitstate control AM_RANGE(0xfff4, 0xfff5) AM_WRITE8( WCY3_w, 0xff00) // 0xfff5 // waitstate control AM_RANGE(0xfff6, 0xfff7) AM_WRITE8( WCY4_w, 0x00ff) // 0xfff6 // waitstate control -// AM_RANGE(0xfff6, 0xfff7) // (reserved , 0xff00) // 0xfff7 +// AM_RANGE(0xfff6, 0xfff7) // (reserved , 0xff00) // 0xfff7 AM_RANGE(0xfff8, 0xfff9) AM_WRITE8( SULA_w, 0x00ff) // 0xfff8 // peripheral mapping AM_RANGE(0xfff8, 0xfff9) AM_WRITE8( TULA_w, 0xff00) // 0xfff9 // peripheral mapping AM_RANGE(0xfffa, 0xfffb) AM_WRITE8( IULA_w, 0x00ff) // 0xfffa // peripheral mapping @@ -438,7 +434,7 @@ static ADDRESS_MAP_START( v53_internal_port_map, AS_IO, 16, v53_base_device ) AM_RANGE(0xfffc, 0xfffd) AM_WRITE8( OPHA_w, 0x00ff) // 0xfffc // peripheral mapping (upper bits, common) AM_RANGE(0xfffc, 0xfffd) AM_WRITE8( OPSEL_w, 0xff00) // 0xfffd // peripheral enabling AM_RANGE(0xfffe, 0xffff) AM_WRITE8( SCTL_w, 0x00ff) // 0xfffe // peripheral configuration (& byte / word mapping) -// AM_RANGE(0xfffe, 0xffff) // (reserved , 0xff00) // 0xffff +// AM_RANGE(0xfffe, 0xffff) // (reserved , 0xff00) // 0xffff ADDRESS_MAP_END @@ -486,7 +482,7 @@ static MACHINE_CONFIG_FRAGMENT( v53 ) MCFG_PIT8253_OUT0_HANDLER(WRITELINE( v53_base_device, tcu_out0_trampoline_cb )) MCFG_PIT8253_OUT1_HANDLER(WRITELINE( v53_base_device, tcu_out1_trampoline_cb )) MCFG_PIT8253_OUT2_HANDLER(WRITELINE( v53_base_device, tcu_out2_trampoline_cb )) - + MCFG_DEVICE_ADD("upd71071dma", V53_DMAU, 4000000) MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(v53_base_device, hreq_trampoline_cb)) @@ -506,12 +502,12 @@ static MACHINE_CONFIG_FRAGMENT( v53 ) MCFG_AM9517A_OUT_DACK_2_CB(WRITELINE(v53_base_device, dma_dack2_trampoline_w)) MCFG_AM9517A_OUT_DACK_3_CB(WRITELINE(v53_base_device, dma_dack3_trampoline_w)) - + MCFG_PIC8259_ADD( "upd71059pic", WRITELINE(v53_base_device, internal_irq_w), VCC, READ8(v53_base_device,get_pic_ack)) - MCFG_DEVICE_ADD("v53scu", V53_SCU, 0) + MCFG_DEVICE_ADD("v53scu", V53_SCU, 0) MCFG_I8251_TXD_HANDLER(WRITELINE(v53_base_device, scu_txd_trampoline_cb)) MCFG_I8251_DTR_HANDLER(WRITELINE(v53_base_device, scu_dtr_trampoline_cb)) MCFG_I8251_RTS_HANDLER(WRITELINE(v53_base_device, scu_rts_trampoline_cb)) @@ -578,4 +574,3 @@ v53a_device::v53a_device(const machine_config &mconfig, const char *tag, device_ : v53_base_device(mconfig, V53A, "V53A", tag, owner, clock, "v53a", BYTE_XOR_LE(0), 6, 1, V33_TYPE) { } - diff --git a/src/emu/cpu/nec/v53.h b/src/emu/cpu/nec/v53.h index dbaa7778773..05611e5503f 100644 --- a/src/emu/cpu/nec/v53.h +++ b/src/emu/cpu/nec/v53.h @@ -131,7 +131,7 @@ public: UINT8 m_SCTL; UINT8 m_OPSEL; - + UINT8 m_SULA; UINT8 m_TULA; UINT8 m_IULA; @@ -151,10 +151,10 @@ public: template<class _Object> static devcb_base &set_syndet_handler(device_t &device, _Object object) { return downcast<v53_base_device &>(device).m_syndet_handler.set_callback(object); } DECLARE_WRITE_LINE_MEMBER(scu_txd_trampoline_cb) { m_txd_handler(state); } DECLARE_WRITE_LINE_MEMBER(scu_dtr_trampoline_cb) { m_dtr_handler(state); } - DECLARE_WRITE_LINE_MEMBER(scu_rts_trampoline_cb) { m_rts_handler(state); } + DECLARE_WRITE_LINE_MEMBER(scu_rts_trampoline_cb) { m_rts_handler(state); } DECLARE_WRITE_LINE_MEMBER(scu_rxrdy_trampoline_cb) { m_rxrdy_handler(state); } /* should we mask this here based on m_simk? it can mask the interrupt */ DECLARE_WRITE_LINE_MEMBER(scu_txrdy_trampoline_cb) { m_txrdy_handler(state); } /* should we mask this here based on m_simk? it can mask the interrupt */ - DECLARE_WRITE_LINE_MEMBER(scu_txempty_trampoline_cb) { m_txempty_handler(state); } + DECLARE_WRITE_LINE_MEMBER(scu_txempty_trampoline_cb) { m_txempty_handler(state); } DECLARE_WRITE_LINE_MEMBER(scu_syndet_trampoline_cb) { m_syndet_handler(state); } // TCU @@ -165,9 +165,9 @@ public: DECLARE_READ8_MEMBER(tmu_tst2_r); DECLARE_WRITE8_MEMBER(tmu_tct2_w); DECLARE_WRITE8_MEMBER(tmu_tmd_w); -// static void set_clk0(device_t &device, double clk0) { downcast<v53_base_device &>(device).m_clk0 = clk0; } -// static void set_clk1(device_t &device, double clk1) { downcast<v53_base_device &>(device).m_clk1 = clk1; } -// static void set_clk2(device_t &device, double clk2) { downcast<v53_base_device &>(device).m_clk2 = clk2; } +// static void set_clk0(device_t &device, double clk0) { downcast<v53_base_device &>(device).m_clk0 = clk0; } +// static void set_clk1(device_t &device, double clk1) { downcast<v53_base_device &>(device).m_clk1 = clk1; } +// static void set_clk2(device_t &device, double clk2) { downcast<v53_base_device &>(device).m_clk2 = clk2; } template<class _Object> static devcb_base &set_out0_handler(device_t &device, _Object object) { return downcast<v53_base_device &>(device).m_out0_handler.set_callback(object); } template<class _Object> static devcb_base &set_out1_handler(device_t &device, _Object object) { return downcast<v53_base_device &>(device).m_out1_handler.set_callback(object); } template<class _Object> static devcb_base &set_out2_handler(device_t &device, _Object object) { return downcast<v53_base_device &>(device).m_out2_handler.set_callback(object); } @@ -195,7 +195,7 @@ public: DECLARE_WRITE_LINE_MEMBER(hreq_trampoline_cb) { m_out_hreq_cb(state); } DECLARE_WRITE_LINE_MEMBER(eop_trampoline_cb) { m_out_eop_cb(state); } DECLARE_READ8_MEMBER(dma_memr_trampoline_r) { return m_in_memr_cb(space, offset); } - DECLARE_WRITE8_MEMBER(dma_memw_trampoline_w) { m_out_memw_cb(space, offset, data); } + DECLARE_WRITE8_MEMBER(dma_memw_trampoline_w) { m_out_memw_cb(space, offset, data); } DECLARE_READ8_MEMBER(dma_io_0_trampoline_r) { return m_in_ior_0_cb(space, offset); } DECLARE_READ8_MEMBER(dma_io_1_trampoline_r) { return m_in_ior_1_cb(space, offset); } DECLARE_READ8_MEMBER(dma_io_2_trampoline_r) { return m_in_ior_2_cb(space, offset); } @@ -204,10 +204,10 @@ public: DECLARE_WRITE8_MEMBER(dma_io_1_trampoline_w) { m_out_iow_1_cb(space, offset, data); } DECLARE_WRITE8_MEMBER(dma_io_2_trampoline_w) { m_out_iow_2_cb(space, offset, data); } DECLARE_WRITE8_MEMBER(dma_io_3_trampoline_w) { m_out_iow_3_cb(space, offset, data); } - DECLARE_WRITE_LINE_MEMBER(dma_dack0_trampoline_w) { m_out_dack_0_cb(state); } - DECLARE_WRITE_LINE_MEMBER(dma_dack1_trampoline_w) { m_out_dack_1_cb(state); } - DECLARE_WRITE_LINE_MEMBER(dma_dack2_trampoline_w) { m_out_dack_2_cb(state); } - DECLARE_WRITE_LINE_MEMBER(dma_dack3_trampoline_w) { m_out_dack_3_cb(state); } + DECLARE_WRITE_LINE_MEMBER(dma_dack0_trampoline_w) { m_out_dack_0_cb(state); } + DECLARE_WRITE_LINE_MEMBER(dma_dack1_trampoline_w) { m_out_dack_1_cb(state); } + DECLARE_WRITE_LINE_MEMBER(dma_dack2_trampoline_w) { m_out_dack_2_cb(state); } + DECLARE_WRITE_LINE_MEMBER(dma_dack3_trampoline_w) { m_out_dack_3_cb(state); } DECLARE_WRITE_LINE_MEMBER(dreq0_w); @@ -221,7 +221,7 @@ public: void install_peripheral_io(); const address_space_config m_io_space_config; - + const address_space_config *memory_space_config(address_spacenum spacenum) const { switch (spacenum) @@ -260,9 +260,9 @@ protected: devcb_write_line m_syndet_handler; // TCU -// double m_clk0; -// double m_clk1; -// double m_clk2; +// double m_clk0; +// double m_clk1; +// double m_clk2; devcb_write_line m_out0_handler; devcb_write_line m_out1_handler; devcb_write_line m_out2_handler; @@ -285,7 +285,7 @@ protected: devcb_write_line m_out_dack_1_cb; devcb_write_line m_out_dack_2_cb; devcb_write_line m_out_dack_3_cb; - + }; diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c index 6820bad7c74..c39324a0a69 100644 --- a/src/emu/cpu/pic16c5x/pic16c5x.c +++ b/src/emu/cpu/pic16c5x/pic16c5x.c @@ -799,7 +799,7 @@ void pic16c5x_device::device_start() m_program = &space(AS_PROGRAM); m_direct = &m_program->direct(); m_data = &space(AS_DATA); - + m_read_a.resolve_safe(0); m_read_b.resolve_safe(0); m_read_c.resolve_safe(0); diff --git a/src/emu/cpu/pic16c5x/pic16c5x.h b/src/emu/cpu/pic16c5x/pic16c5x.h index 92a62d3f207..779d7a12a5d 100644 --- a/src/emu/cpu/pic16c5x/pic16c5x.h +++ b/src/emu/cpu/pic16c5x/pic16c5x.h @@ -81,7 +81,7 @@ public: * the value if known (available in HEX dumps of the ROM). */ void pic16c5x_set_config(UINT16 data); - + // or with a macro static void set_config_static(device_t &device, UINT16 data) { downcast<pic16c5x_device &>(device).m_temp_config = data; } @@ -155,7 +155,7 @@ private: address_space *m_program; direct_read_data *m_direct; address_space *m_data; - + // i/o handlers devcb_read8 m_read_a; devcb_read8 m_read_b; diff --git a/src/emu/cpu/z80/kl5c80a12.c b/src/emu/cpu/z80/kl5c80a12.c index 4be701168f3..ddf40bd8612 100644 --- a/src/emu/cpu/z80/kl5c80a12.c +++ b/src/emu/cpu/z80/kl5c80a12.c @@ -1,13 +1,13 @@ /*************************************************************************** - Kawasaki LSI - KL5C80A12 CPU (KL5C80A12CFP on hng64.c) + Kawasaki LSI + KL5C80A12 CPU (KL5C80A12CFP on hng64.c) - Binary compatible with Z80, significantly faster opcode timings, operating at up to 10Mhz - Timers / Counters, Parrallel / Serial ports/ MMU, Interrupt Controller + Binary compatible with Z80, significantly faster opcode timings, operating at up to 10Mhz + Timers / Counters, Parrallel / Serial ports/ MMU, Interrupt Controller - (is this different enough to need it's own core?) - (todo: everything, some code currently lives in machine/hng64_net.c but not much) + (is this different enough to need it's own core?) + (todo: everything, some code currently lives in machine/hng64_net.c but not much) ***************************************************************************/ diff --git a/src/emu/cpu/z80/kl5c80a12.h b/src/emu/cpu/z80/kl5c80a12.h index 14fa9cc86dc..6f6683ecb59 100644 --- a/src/emu/cpu/z80/kl5c80a12.h +++ b/src/emu/cpu/z80/kl5c80a12.h @@ -1,13 +1,13 @@ /*************************************************************************** - Kawasaki LSI - KL5C80A12 CPU (KL5C80A12CFP on hng64.c) + Kawasaki LSI + KL5C80A12 CPU (KL5C80A12CFP on hng64.c) - Binary compatible with Z80, significantly faster opcode timings, operating at up to 10Mhz - Timers / Counters, Parrallel / Serial ports/ MMU, Interrupt Controller + Binary compatible with Z80, significantly faster opcode timings, operating at up to 10Mhz + Timers / Counters, Parrallel / Serial ports/ MMU, Interrupt Controller - (is this different enough to need it's own core?) - (todo: everything, some code currently lives in machine/hng64_net.c but not much) + (is this different enough to need it's own core?) + (todo: everything, some code currently lives in machine/hng64_net.c but not much) ***************************************************************************/ diff --git a/src/emu/emu.mak b/src/emu/emu.mak deleted file mode 100644 index 24062a093c0..00000000000 --- a/src/emu/emu.mak +++ /dev/null @@ -1,278 +0,0 @@ -########################################################################### -# -# emu.mak -# -# MAME emulation core makefile -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -EMUSRC = $(SRC)/emu -EMUOBJ = $(OBJ)/emu - -EMUAUDIO = $(EMUOBJ)/audio -EMUBUS = $(EMUOBJ)/bus -EMUDRIVERS = $(EMUOBJ)/drivers -EMULAYOUT = $(EMUOBJ)/layout -EMUMACHINE = $(EMUOBJ)/machine -EMUIMAGEDEV = $(EMUOBJ)/imagedev -EMUVIDEO = $(EMUOBJ)/video - -OBJDIRS += \ - $(EMUOBJ)/cpu \ - $(EMUOBJ)/sound \ - $(EMUOBJ)/debug \ - $(EMUOBJ)/audio \ - $(EMUOBJ)/bus \ - $(EMUOBJ)/drivers \ - $(EMUOBJ)/machine \ - $(EMUOBJ)/layout \ - $(EMUOBJ)/imagedev \ - $(EMUOBJ)/ui \ - $(EMUOBJ)/video \ - -OSDSRC = $(SRC)/osd -OSDOBJ = $(OBJ)/osd - -OBJDIRS += \ - $(OSDOBJ) \ - $(OSDOBJ)/modules \ - $(OSDOBJ)/modules/sound \ - $(OSDOBJ)/modules/debugger \ - - -#------------------------------------------------- -# emulator core objects -#------------------------------------------------- - -EMUOBJS = \ - $(EMUOBJ)/hashfile.o \ - $(EMUOBJ)/addrmap.o \ - $(EMUOBJ)/attotime.o \ - $(EMUOBJ)/audit.o \ - $(EMUOBJ)/cheat.o \ - $(EMUOBJ)/clifront.o \ - $(EMUOBJ)/cliopts.o \ - $(EMUOBJ)/config.o \ - $(EMUOBJ)/crsshair.o \ - $(EMUOBJ)/debugger.o \ - $(EMUOBJ)/devdelegate.o \ - $(EMUOBJ)/devcb.o \ - $(EMUOBJ)/devcpu.o \ - $(EMUOBJ)/devfind.o \ - $(EMUOBJ)/device.o \ - $(EMUOBJ)/didisasm.o \ - $(EMUOBJ)/diexec.o \ - $(EMUOBJ)/digfx.o \ - $(EMUOBJ)/diimage.o \ - $(EMUOBJ)/dimemory.o \ - $(EMUOBJ)/dinetwork.o \ - $(EMUOBJ)/dinvram.o \ - $(EMUOBJ)/dioutput.o \ - $(EMUOBJ)/dirtc.o \ - $(EMUOBJ)/diserial.o \ - $(EMUOBJ)/dislot.o \ - $(EMUOBJ)/disound.o \ - $(EMUOBJ)/dispatch.o \ - $(EMUOBJ)/distate.o \ - $(EMUOBJ)/divideo.o \ - $(EMUOBJ)/drawgfx.o \ - $(EMUOBJ)/driver.o \ - $(EMUOBJ)/drivenum.o \ - $(EMUOBJ)/emualloc.o \ - $(EMUOBJ)/emucore.o \ - $(EMUOBJ)/emuopts.o \ - $(EMUOBJ)/emupal.o \ - $(EMUOBJ)/fileio.o \ - $(EMUOBJ)/hash.o \ - $(EMUOBJ)/image.o \ - $(EMUOBJ)/info.o \ - $(EMUOBJ)/input.o \ - $(EMUOBJ)/ioport.o \ - $(EMUOBJ)/luaengine.o \ - $(EMUOBJ)/mame.o \ - $(EMUOBJ)/machine.o \ - $(EMUOBJ)/mconfig.o \ - $(EMUOBJ)/memarray.o \ - $(EMUOBJ)/memory.o \ - $(EMUOBJ)/network.o \ - $(EMUOBJ)/parameters.o \ - $(EMUOBJ)/output.o \ - $(EMUOBJ)/render.o \ - $(EMUOBJ)/rendfont.o \ - $(EMUOBJ)/rendlay.o \ - $(EMUOBJ)/rendutil.o \ - $(EMUOBJ)/romload.o \ - $(EMUOBJ)/save.o \ - $(EMUOBJ)/schedule.o \ - $(EMUOBJ)/screen.o \ - $(EMUOBJ)/softlist.o \ - $(EMUOBJ)/sound.o \ - $(EMUOBJ)/speaker.o \ - $(EMUOBJ)/sprite.o \ - $(EMUOBJ)/tilemap.o \ - $(EMUOBJ)/timer.o \ - $(EMUOBJ)/uiinput.o \ - $(EMUOBJ)/ui/ui.o \ - $(EMUOBJ)/ui/menu.o \ - $(EMUOBJ)/ui/mainmenu.o \ - $(EMUOBJ)/ui/miscmenu.o \ - $(EMUOBJ)/ui/barcode.o \ - $(EMUOBJ)/ui/cheatopt.o \ - $(EMUOBJ)/ui/devopt.o \ - $(EMUOBJ)/ui/filemngr.o \ - $(EMUOBJ)/ui/filesel.o \ - $(EMUOBJ)/ui/imgcntrl.o \ - $(EMUOBJ)/ui/info.o \ - $(EMUOBJ)/ui/inputmap.o \ - $(EMUOBJ)/ui/selgame.o \ - $(EMUOBJ)/ui/sliders.o \ - $(EMUOBJ)/ui/slotopt.o \ - $(EMUOBJ)/ui/swlist.o \ - $(EMUOBJ)/ui/tapectrl.o \ - $(EMUOBJ)/ui/videoopt.o \ - $(EMUOBJ)/ui/viewgfx.o \ - $(EMUOBJ)/validity.o \ - $(EMUOBJ)/video.o \ - $(EMUOBJ)/debug/debugcmd.o \ - $(EMUOBJ)/debug/debugcon.o \ - $(EMUOBJ)/debug/debugcpu.o \ - $(EMUOBJ)/debug/debughlp.o \ - $(EMUOBJ)/debug/debugvw.o \ - $(EMUOBJ)/debug/dvdisasm.o \ - $(EMUOBJ)/debug/dvmemory.o \ - $(EMUOBJ)/debug/dvbpoints.o \ - $(EMUOBJ)/debug/dvwpoints.o \ - $(EMUOBJ)/debug/dvstate.o \ - $(EMUOBJ)/debug/dvtext.o \ - $(EMUOBJ)/debug/express.o \ - $(EMUOBJ)/debug/textbuf.o \ - $(EMUOBJ)/profiler.o \ - $(EMUOBJ)/webengine.o \ - $(OSDOBJ)/osdnet.o \ - -EMUSOUNDOBJS = \ - $(EMUOBJ)/sound/filter.o \ - $(EMUOBJ)/sound/flt_vol.o \ - $(EMUOBJ)/sound/flt_rc.o \ - $(EMUOBJ)/sound/wavwrite.o \ - $(EMUOBJ)/sound/samples.o \ - -EMUDRIVEROBJS = \ - $(EMUDRIVERS)/empty.o \ - $(EMUDRIVERS)/testcpu.o \ - -EMUMACHINEOBJS = \ - $(EMUMACHINE)/bcreader.o \ - $(EMUMACHINE)/buffer.o \ - $(EMUMACHINE)/clock.o \ - $(EMUMACHINE)/generic.o \ - $(EMUMACHINE)/keyboard.o \ - $(EMUMACHINE)/laserdsc.o \ - $(EMUMACHINE)/latch.o \ - $(EMUMACHINE)/netlist.o \ - $(EMUMACHINE)/nvram.o \ - $(EMUMACHINE)/ram.o \ - $(EMUMACHINE)/legscsi.o \ - $(EMUMACHINE)/terminal.o \ - -EMUIMAGEDEVOBJS = \ - $(EMUIMAGEDEV)/bitbngr.o \ - $(EMUIMAGEDEV)/cassette.o \ - $(EMUIMAGEDEV)/chd_cd.o \ - $(EMUIMAGEDEV)/diablo.o \ - $(EMUIMAGEDEV)/flopdrv.o \ - $(EMUIMAGEDEV)/floppy.o \ - $(EMUIMAGEDEV)/harddriv.o \ - $(EMUIMAGEDEV)/midiin.o \ - $(EMUIMAGEDEV)/midiout.o \ - $(EMUIMAGEDEV)/printer.o \ - $(EMUIMAGEDEV)/snapquik.o \ - - -EMUVIDEOOBJS = \ - $(EMUVIDEO)/generic.o \ - $(EMUVIDEO)/resnet.o \ - $(EMUVIDEO)/rgbutil.o \ - $(EMUVIDEO)/vector.o \ - - -LIBEMUOBJS = $(EMUOBJS) $(EMUSOUNDOBJS) $(EMUDRIVEROBJS) $(EMUMACHINEOBJS) $(EMUIMAGEDEVOBJS) $(EMUVIDEOOBJS) - -$(LIBEMU): $(LIBEMUOBJS) - - - -#------------------------------------------------- -# CPU core objects -#------------------------------------------------- - -include $(EMUSRC)/cpu/cpu.mak - -$(LIBDASM): $(DASMOBJS) - - -#------------------------------------------------- -# sound core objects -#------------------------------------------------- - -include $(EMUSRC)/sound/sound.mak - -#------------------------------------------------- -# netlist core objects -#------------------------------------------------- - -include $(EMUSRC)/netlist/netlist.mak - -#------------------------------------------------- -# video core objects -#------------------------------------------------- - -include $(EMUSRC)/video/video.mak - -#------------------------------------------------- -# machine core objects -#------------------------------------------------- - -include $(EMUSRC)/machine/machine.mak - -#------------------------------------------------- -# bus core objects -#------------------------------------------------- - -include $(EMUSRC)/bus/bus.mak - -#------------------------------------------------- -# core optional library -#------------------------------------------------- - -$(LIBOPTIONAL): $(CPUOBJS) $(SOUNDOBJS) $(VIDEOOBJS) $(MACHINEOBJS) $(NETLISTOBJS) -$(LIBBUS): $(BUSOBJS) - -#------------------------------------------------- -# additional dependencies -#------------------------------------------------- - -$(EMUOBJ)/rendfont.o: $(EMUOBJ)/uismall.fh - -$(EMUOBJ)/video.o: $(EMUSRC)/rendersw.inc - -#------------------------------------------------- -# core layouts -#------------------------------------------------- - -$(EMUOBJ)/rendlay.o: $(EMULAYOUT)/dualhovu.lh \ - $(EMULAYOUT)/dualhsxs.lh \ - $(EMULAYOUT)/dualhuov.lh \ - $(EMULAYOUT)/horizont.lh \ - $(EMULAYOUT)/triphsxs.lh \ - $(EMULAYOUT)/quadhsxs.lh \ - $(EMULAYOUT)/vertical.lh \ - $(EMULAYOUT)/lcd.lh \ - $(EMULAYOUT)/lcd_rot.lh \ - $(EMULAYOUT)/noscreens.lh \ - -$(EMUOBJ)/video.o: $(EMULAYOUT)/snap.lh diff --git a/src/emu/emucore.h b/src/emu/emucore.h index 899ee9fa670..1e5e87be8d1 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -23,7 +23,7 @@ #include <stdarg.h> // some cleanups for Solaris for things defined in stdlib.h -#ifdef SDLMAME_SOLARIS +#if defined(__sun__) && defined(__svr4__) #undef si_status #undef WWORD #endif @@ -373,7 +373,7 @@ ATTR_NORETURN void fatalerror_exitcode(running_machine &machine, int exitcode, c //************************************************************************** // population count -#ifndef SDLMAME_NETBSD +#if !defined(__NetBSD__) inline int popcount(UINT32 val) { int count; diff --git a/src/emu/luaengine.c b/src/emu/luaengine.c index c8bb21eedc3..f31e7c4550d 100644 --- a/src/emu/luaengine.c +++ b/src/emu/luaengine.c @@ -130,7 +130,7 @@ lua_engine::hook::hook() cb = -1; } -#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__) +#if (defined(__sun__) && defined(__svr4__)) || defined(__ANDROID__) #undef _L #endif diff --git a/src/emu/machine.c b/src/emu/machine.c index d70161c697e..4791aa0f590 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -385,7 +385,7 @@ int running_machine::run(bool firstrun) { g_profiler.start(PROFILER_EXTRA); - #ifdef SDLMAME_EMSCRIPTEN + #if defined(EMSCRIPTEN) //break out to our async javascript loop and halt js_set_main_loop(this); #endif @@ -1217,11 +1217,11 @@ astring &running_machine::nvram_filename(astring &result, device_t &device) const char *software = image_parent_basename(&device); if (software!=NULL && strlen(software)>0) { - result.cat('\\').cat(software); + result.cat(PATH_SEPARATOR).cat(software); } astring tag(device.tag()); tag.del(0, 1).replacechr(':', '_'); - result.cat('\\').cat(tag); + result.cat(PATH_SEPARATOR).cat(tag); } return result; } @@ -1344,7 +1344,7 @@ void system_time::full_time::set(struct tm &t) // JAVASCRIPT PORT-SPECIFIC //************************************************************************** -#ifdef SDLMAME_EMSCRIPTEN +#if defined(EMSCRIPTEN) static running_machine * jsmess_machine; @@ -1377,4 +1377,4 @@ sound_manager * js_get_sound() { return &(jsmess_machine->sound()); } -#endif /* SDLMAME_EMSCRIPTEN */ +#endif /* defined(EMSCRIPTEN) */ diff --git a/src/emu/machine/am9517a.c b/src/emu/machine/am9517a.c index 0104ff077d6..15dafeb0362 100644 --- a/src/emu/machine/am9517a.c +++ b/src/emu/machine/am9517a.c @@ -3,15 +3,15 @@ /*************************************************************************** AMD AM9517A - Intel 8237A - NEC uPD71037 + Intel 8237A + NEC uPD71037 - NEC uPD71071 (extended version of above) + NEC uPD71071 (extended version of above) - a variant is used in the V53 CPU which offers subsets of both the - uPD71071 and uPD71037 functionality depending on a mode bit. - - Multimode DMA Controller emulation + a variant is used in the V53 CPU which offers subsets of both the + uPD71071 and uPD71037 functionality depending on a mode bit. + + Multimode DMA Controller emulation Copyright the MESS Team. Visit http://mamedev.org for licensing and usage restrictions. @@ -28,17 +28,17 @@ /* - When the V53 operates in uPD71071 compatible mode there are the following - differences from a real uPD71071 + When the V53 operates in uPD71071 compatible mode there are the following + differences from a real uPD71071 - V53 Real uPD71071 - Software Reqs No Yes - Memory-to-Memory DMA No Yes - DMARQ active level High programmable - DMAAK active level Low programmable - Bus Cycle 4 4 or 3 + V53 Real uPD71071 + Software Reqs No Yes + Memory-to-Memory DMA No Yes + DMARQ active level High programmable + DMAAK active level Low programmable + Bus Cycle 4 4 or 3 - we don't currently handle the differences + we don't currently handle the differences */ @@ -1158,7 +1158,7 @@ READ8_MEMBER(upd71071_v53_device::read) ret = m_command & 0xff; break; case 0x09: // Device control (high) // UPD71071 only? - ret = m_command_high & 0xff; + ret = m_command_high & 0xff; break; case 0x0b: // Status ret = m_status; @@ -1187,14 +1187,14 @@ READ8_MEMBER(upd71071_v53_device::read) WRITE8_MEMBER(upd71071_v53_device::write) { int channel = m_selected_channel; - + switch (offset) { case 0x00: // Initialise // TODO: reset (bit 0) //m_buswidth = data & 0x02; //if (data & 0x01) - // soft_reset(); + // soft_reset(); logerror("DMA: Initialise [%02x]\n", data); break; case 0x01: // Channel @@ -1279,4 +1279,4 @@ WRITE8_MEMBER(upd71071_v53_device::write) } trigger(1); -}
\ No newline at end of file +} diff --git a/src/emu/machine/am9517a.h b/src/emu/machine/am9517a.h index 3a0eb2a6432..3ba47c35f96 100644 --- a/src/emu/machine/am9517a.h +++ b/src/emu/machine/am9517a.h @@ -172,7 +172,7 @@ protected: virtual void device_start(); virtual void device_reset(); - int m_selected_channel; + int m_selected_channel; int m_base; UINT8 m_command_high; diff --git a/src/emu/machine/corvushd.c b/src/emu/machine/corvushd.c index 7d450e3fcaf..1d540d43b8f 100644 --- a/src/emu/machine/corvushd.c +++ b/src/emu/machine/corvushd.c @@ -692,7 +692,7 @@ UINT8 corvus_hdc_t::corvus_get_drive_parameters(UINT8 drv) { // This firmware string and revision were taken from the Corvus firmware // file CORVB184.CLR found on the SSE SoftBox distribution disk. - strcpy((char *) m_buffer.drive_param_response.firmware_desc, "V18.4 -- CONST II - 11/82 "); + strncpy((char *) m_buffer.drive_param_response.firmware_desc, "V18.4 -- CONST II - 11/82 ", sizeof(m_buffer.drive_param_response.firmware_desc)); m_buffer.drive_param_response.firmware_rev = 37; // Controller ROM version diff --git a/src/emu/machine/i8251.c b/src/emu/machine/i8251.c index 59da201a4d5..622605453ca 100644 --- a/src/emu/machine/i8251.c +++ b/src/emu/machine/i8251.c @@ -3,10 +3,10 @@ i8251.c Intel 8251 Universal Synchronous/Asynchronous Receiver Transmitter code - NEC uPD71051 is a clone + NEC uPD71051 is a clone - The V53/V53A use a customized version with only the Asynchronous mode - and a split command / mode register + The V53/V53A use a customized version with only the Asynchronous mode + and a split command / mode register @@ -428,29 +428,29 @@ WRITE8_MEMBER(i8251_device::command_w) /* bit 7: - 0 = normal operation - 1 = hunt mode - bit 6: - 0 = normal operation - 1 = internal reset - bit 5: - 0 = /RTS set to 1 - 1 = /RTS set to 0 - bit 4: - 0 = normal operation - 1 = reset error flag - bit 3: - 0 = normal operation - 1 = send break character - bit 2: - 0 = receive disable - 1 = receive enable - bit 1: - 0 = /DTR set to 1 - 1 = /DTR set to 0 - bit 0: - 0 = transmit disable - 1 = transmit enable + 0 = normal operation + 1 = hunt mode + bit 6: + 0 = normal operation + 1 = internal reset + bit 5: + 0 = /RTS set to 1 + 1 = /RTS set to 0 + bit 4: + 0 = normal operation + 1 = reset error flag + bit 3: + 0 = normal operation + 1 = send break character + bit 2: + 0 = receive disable + 1 = receive enable + bit 1: + 0 = /DTR set to 1 + 1 = /DTR set to 0 + bit 0: + 0 = transmit disable + 1 = transmit enable */ m_rts_handler(!BIT(data, 5)); @@ -484,28 +484,28 @@ WRITE8_MEMBER(i8251_device::mode_w) { /* Asynchronous - bit 7,6: stop bit length - 0 = inhibit - 1 = 1 bit - 2 = 1.5 bits - 3 = 2 bits - bit 5: parity type - 0 = parity odd - 1 = parity even - bit 4: parity test enable - 0 = disable - 1 = enable - bit 3,2: character length - 0 = 5 bits - 1 = 6 bits - 2 = 7 bits - 3 = 8 bits - bit 1,0: baud rate factor - 0 = defines command byte for synchronous or asynchronous - 1 = x1 - 2 = x16 - 3 = x64 - */ + bit 7,6: stop bit length + 0 = inhibit + 1 = 1 bit + 2 = 1.5 bits + 3 = 2 bits + bit 5: parity type + 0 = parity odd + 1 = parity even + bit 4: parity test enable + 0 = disable + 1 = enable + bit 3,2: character length + 0 = 5 bits + 1 = 6 bits + 2 = 7 bits + 3 = 8 bits + bit 1,0: baud rate factor + 0 = defines command byte for synchronous or asynchronous + 1 = x1 + 2 = x16 + 3 = x64 + */ LOG(("I8251: Asynchronous operation\n")); @@ -597,24 +597,24 @@ WRITE8_MEMBER(i8251_device::mode_w) else { /* bit 7: Number of sync characters - 0 = 1 character - 1 = 2 character - bit 6: Synchronous mode - 0 = Internal synchronisation - 1 = External synchronisation - bit 5: parity type - 0 = parity odd - 1 = parity even - bit 4: parity test enable - 0 = disable - 1 = enable - bit 3,2: character length - 0 = 5 bits - 1 = 6 bits - 2 = 7 bits - 3 = 8 bits - bit 1,0 = 0 - */ + 0 = 1 character + 1 = 2 character + bit 6: Synchronous mode + 0 = Internal synchronisation + 1 = External synchronisation + bit 5: parity type + 0 = parity odd + 1 = parity even + bit 4: parity test enable + 0 = disable + 1 = enable + bit 3,2: character length + 0 = 5 bits + 1 = 6 bits + 2 = 7 bits + 3 = 8 bits + bit 1,0 = 0 + */ LOG(("I8251: Synchronous operation\n")); /* setup for sync byte(s) */ diff --git a/src/emu/machine/i8257.c b/src/emu/machine/i8257.c index 791a040295f..404e3066b15 100644 --- a/src/emu/machine/i8257.c +++ b/src/emu/machine/i8257.c @@ -79,7 +79,7 @@ inline void i8257_device::dma_request(int channel, int state) } else { - m_request &= ~(1 << channel); + m_request &= ~(1 << channel); } trigger(1); } diff --git a/src/emu/machine/machine.mak b/src/emu/machine/machine.mak deleted file mode 100644 index 85bfb92139d..00000000000 --- a/src/emu/machine/machine.mak +++ /dev/null @@ -1,1974 +0,0 @@ -########################################################################### -# -# machine.mak -# -# Rules for building machine cores -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -MACHINESRC = $(EMUSRC)/machine -MACHINEOBJ = $(EMUOBJ)/machine - - -#------------------------------------------------- -# -#@src/emu/machine/akiko.h,MACHINES += AKIKO -#------------------------------------------------- - -ifneq ($(filter AKIKO,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/akiko.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/autoconfig.h,MACHINES += AUTOCONFIG -#------------------------------------------------- - -ifneq ($(filter AUTOCONFIG,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/autoconfig.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/cr511b.h,MACHINES += CR511B -#------------------------------------------------- - -ifneq ($(filter CR511B,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/cr511b.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/dmac.h,MACHINES += DMAC -#------------------------------------------------- - -ifneq ($(filter DMAC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/dmac.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/gayle.h,MACHINES += GAYLE -#------------------------------------------------- - -ifneq ($(filter GAYLE,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/gayle.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/40105.h,MACHINES += CMOS40105 -#------------------------------------------------- - -ifneq ($(filter CMOS40105,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/40105.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/53c7xx.h,MACHINES += NCR53C7XX -#------------------------------------------------- - -ifneq ($(filter NCR53C7XX,$(MACHINES)),) -MACHINES += NSCSI -MACHINEOBJS += $(MACHINEOBJ)/53c7xx.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/53c810.h,MACHINES += LSI53C810 -#------------------------------------------------- - -ifneq ($(filter LSI53C810,$(MACHINES)),) -MACHINES += SCSI -MACHINEOBJS += $(MACHINEOBJ)/53c810.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/6522via.h,MACHINES += 6522VIA -#------------------------------------------------- - -ifneq ($(filter 6522VIA,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/6522via.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/6525tpi.h,MACHINES += TPI6525 -#------------------------------------------------- - -ifneq ($(filter TPI6525,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/6525tpi.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/6532riot.h,MACHINES += RIOT6532 -#------------------------------------------------- - -ifneq ($(filter RIOT6532,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/6532riot.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/6821pia.h,MACHINES += 6821PIA -#------------------------------------------------- - -ifneq ($(filter 6821PIA,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/6821pia.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/6840ptm.h,MACHINES += 6840PTM -#------------------------------------------------- - -ifneq ($(filter 6840PTM,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/6840ptm.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/6850acia.h,MACHINES += ACIA6850 -#------------------------------------------------- - -ifneq ($(filter ACIA6850,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/6850acia.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/68561mpcc.h,MACHINES += 68561MPCC -#------------------------------------------------- - -ifneq ($(filter 68561MPCC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/68561mpcc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc68681.h,MACHINES += 68681 -#------------------------------------------------- - -ifneq ($(filter 68681,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc68681.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/7200fifo.h,MACHINES += 7200FIFO -#------------------------------------------------- - -ifneq ($(filter 7200FIFO,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/7200fifo.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/74123.h,MACHINES += TTL74123 -#------------------------------------------------- - -ifneq ($(filter TTL74123,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/74123.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/74145.h,MACHINES += TTL74145 -#------------------------------------------------- - -ifneq ($(filter TTL74145,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/74145.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/74148.h,MACHINES += TTL74148 -#------------------------------------------------- - -ifneq ($(filter TTL74148,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/74148.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/74153.h,MACHINES += TTL74153 -#------------------------------------------------- - -ifneq ($(filter TTL74153,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/74153.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/74181.h,MACHINES += TTL74181 -#------------------------------------------------- - -ifneq ($(filter TTL74181,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/74181.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/7474.h,MACHINES += TTL7474 -#------------------------------------------------- - -ifneq ($(filter TTL7474,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/7474.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/8042kbdc.h,MACHINES += KBDC8042 -#------------------------------------------------- - -ifneq ($(filter KBDC8042,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/8042kbdc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/8530scc.h,MACHINES += 8530SCC -#------------------------------------------------- - -ifneq ($(filter 8530SCC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/8530scc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/aakart.h,MACHINES += AAKARTDEV -#------------------------------------------------- - -ifneq ($(filter AAKARTDEV,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/aakart.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/adc0808.h,MACHINES += ADC0808 -#------------------------------------------------- - -ifneq ($(filter ADC0808,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/adc0808.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/adc083x.h,MACHINES += ADC083X -#------------------------------------------------- - -ifneq ($(filter ADC083X,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/adc083x.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/adc1038.h,MACHINES += ADC1038 -#------------------------------------------------- - -ifneq ($(filter ADC1038,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/adc1038.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/adc1213x.h,MACHINES += ADC1213X -#------------------------------------------------- - -ifneq ($(filter ADC1213X,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/adc1213x.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/aicartc.h,MACHINES += AICARTC -#------------------------------------------------- - -ifneq ($(filter AICARTC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/aicartc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/am53cf96.h,MACHINES += AM53CF96 -#------------------------------------------------- - -ifneq ($(filter AM53CF96,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/am53cf96.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/am9517a.h,MACHINES += AM9517A -#------------------------------------------------- - -ifneq ($(filter AM9517A,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/am9517a.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/amigafdc.h,MACHINES += AMIGAFDC -#------------------------------------------------- - -ifneq ($(filter AMIGAFDC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/amigafdc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/at28c16.h,MACHINES += AT28C16 -#------------------------------------------------- - -ifneq ($(filter AT28C16,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/at28c16.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/at29040a.h,MACHINES += AT29040 -#------------------------------------------------- - -ifneq ($(filter AT29040,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/at29040a.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/at45dbxx.h,MACHINES += AT45DBXX -#------------------------------------------------- - -ifneq ($(filter AT45DBXX,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/at45dbxx.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ataflash.h,MACHINES += ATAFLASH -#------------------------------------------------- - -ifneq ($(filter ATAFLASH,$(MACHINES)),) -MACHINES += IDE -MACHINES += PCCARD -MACHINEOBJS += $(MACHINEOBJ)/ataflash.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ay31015.h,MACHINES += AY31015 -#------------------------------------------------- - -ifneq ($(filter AY31015,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ay31015.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/bankdev.h,MACHINES += BANKDEV -#------------------------------------------------- - -ifneq ($(filter BANKDEV,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/bankdev.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/cdp1852.h,MACHINES += CDP1852 -#------------------------------------------------- - -ifneq ($(filter CDP1852,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/cdp1852.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/cdp1871.h,MACHINES += CDP1871 -#------------------------------------------------- - -ifneq ($(filter CDP1871,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/cdp1871.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/com8116.h,MACHINES += COM8116 -#------------------------------------------------- - -ifneq ($(filter COM8116,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/com8116.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/cr589.h,MACHINES += CR589 -#------------------------------------------------- - -ifneq ($(filter CR589,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/cr589.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/cs4031.h,MACHINES += CS4031 -#------------------------------------------------- - -ifneq ($(filter CS4031,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/cs4031.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/cs8221.h,MACHINES += CS8221 -#------------------------------------------------- - -ifneq ($(filter CS8221,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/cs8221.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds1204.h,MACHINES += DS1204 -#------------------------------------------------- - -ifneq ($(filter DS1204,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds1204.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds1302.h,MACHINES += DS1302 -#------------------------------------------------- - -ifneq ($(filter DS1302,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds1302.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds1315.h,MACHINES += DS1315 -#------------------------------------------------- - -ifneq ($(filter DS1315,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds1315.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds2401.h,MACHINES += DS2401 -#------------------------------------------------- - -ifneq ($(filter DS2401,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds2401.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds2404.h,MACHINES += DS2404 -#------------------------------------------------- - -ifneq ($(filter DS2404,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds2404.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds75160a.h,MACHINES += DS75160A -#------------------------------------------------- - -ifneq ($(filter DS75160A,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds75160a.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ds75161a.h,MACHINES += DS75161A -#------------------------------------------------- - -ifneq ($(filter DS75161A,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ds75161a.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/e0516.h,MACHINES += E0516 -#------------------------------------------------- - -ifneq ($(filter E0516,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/e0516.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/e05a03.h,MACHINES += E05A03 -#------------------------------------------------- - -ifneq ($(filter E05A03,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/e05a03.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/e05a30.h,MACHINES += E05A30 -#------------------------------------------------- - -ifneq ($(filter E05A30,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/e05a30.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/eeprom.h,MACHINES += EEPROMDEV -#@src/emu/machine/eepromser.h,MACHINES += EEPROMDEV -#@src/emu/machine/eeprompar.h,MACHINES += EEPROMDEV -#------------------------------------------------- - -ifneq ($(filter EEPROMDEV,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/eeprom.o -MACHINEOBJS += $(MACHINEOBJ)/eepromser.o -MACHINEOBJS += $(MACHINEOBJ)/eeprompar.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/er2055.h,MACHINES += ER2055 -#------------------------------------------------- - -ifneq ($(filter ER2055,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/er2055.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/f3853.h,MACHINES += F3853 -#------------------------------------------------- - -ifneq ($(filter F3853,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/f3853.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/hd63450.h,MACHINES += HD63450 -#------------------------------------------------- - -ifneq ($(filter HD63450,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/hd63450.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/hd64610.h,MACHINES += HD64610 -#------------------------------------------------- - -ifneq ($(filter HD64610,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/hd64610.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i2cmem.h,MACHINES += I2CMEM -#------------------------------------------------- - -ifneq ($(filter I2CMEM,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i2cmem.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8155.h,MACHINES += I8155 -#------------------------------------------------- - -ifneq ($(filter I8155,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8155.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8212.h,MACHINES += I8212 -#------------------------------------------------- - -ifneq ($(filter I8212,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8212.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8214.h,MACHINES += I8214 -#------------------------------------------------- - -ifneq ($(filter I8214,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8214.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8243.h,MACHINES += I8243 -#------------------------------------------------- - -ifneq ($(filter I8243,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8243.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8251.h,MACHINES += I8251 -#------------------------------------------------- - -ifneq ($(filter I8251,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8251.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8257.h,MACHINES += I8257 -#------------------------------------------------- - -ifneq ($(filter I8257,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8257.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/i8271.h,MACHINES += I8271 -#------------------------------------------------- - -ifneq ($(filter I8271,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8271.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8279.h,MACHINES += I8279 -#------------------------------------------------- - -ifneq ($(filter I8279,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8279.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8355.h,MACHINES += I8355 -#------------------------------------------------- - -ifneq ($(filter I8355,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8355.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i80130.h,MACHINES += I80130 -#------------------------------------------------- - -ifneq ($(filter I80130,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i80130.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/atadev.h,MACHINES += IDE -#@src/emu/machine/ataintf.h,MACHINES += IDE -#------------------------------------------------- - -ifneq ($(filter IDE,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/atadev.o -MACHINEOBJS += $(MACHINEOBJ)/atahle.o -MACHINEOBJS += $(MACHINEOBJ)/ataintf.o -MACHINEOBJS += $(MACHINEOBJ)/atapicdr.o -MACHINEOBJS += $(MACHINEOBJ)/atapihle.o -MACHINEOBJS += $(MACHINEOBJ)/idectrl.o -MACHINEOBJS += $(MACHINEOBJ)/idehd.o -MACHINEOBJS += $(MACHINEOBJ)/vt83c461.o -MACHINES += T10 -endif - -#------------------------------------------------- -# -#@src/emu/machine/im6402.h,MACHINES += IM6402 -#------------------------------------------------- - -ifneq ($(filter IM6402,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/im6402.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ins8154.h,MACHINES += INS8154 -#------------------------------------------------- - -ifneq ($(filter INS8154,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ins8154.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ins8250.h,MACHINES += INS8250 -#------------------------------------------------- - -ifneq ($(filter INS8250,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ins8250.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/intelfsh.h,MACHINES += INTELFLASH -#------------------------------------------------- - -ifneq ($(filter INTELFLASH,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/intelfsh.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/jvsdev.h,MACHINES += JVS -#@src/emu/machine/jvshost.h,MACHINES += JVS -#------------------------------------------------- - -ifneq ($(filter JVS,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/jvsdev.o -MACHINEOBJS += $(MACHINEOBJ)/jvshost.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/k033906.h,MACHINES += K033906 -#------------------------------------------------- - -ifneq ($(filter K033906,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/k033906.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/k053252.h,MACHINES += K053252 -#------------------------------------------------- - -ifneq ($(filter K053252,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/k053252.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/k056230.h,MACHINES += K056230 -#------------------------------------------------- - -ifneq ($(filter K056230,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/k056230.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/kb3600.h,MACHINES += KB3600 -#------------------------------------------------- - -ifneq ($(filter KB3600,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/kb3600.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/kr2376.h,MACHINES += KR2376 -#------------------------------------------------- - -ifneq ($(filter KR2376,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/kr2376.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/latch8.h,MACHINES += LATCH8 -#------------------------------------------------- - -ifneq ($(filter LATCH8,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/latch8.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/lc89510.h,MACHINES += LC89510 -#------------------------------------------------- - -ifneq ($(filter LC89510,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/lc89510.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ldpr8210.h,MACHINES += LDPR8210 -#------------------------------------------------- - -ifneq ($(filter LDPR8210,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ldpr8210.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ldstub.h,MACHINES += LDSTUB -#------------------------------------------------- - -ifneq ($(filter LDSTUB,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ldstub.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ldv1000.h,MACHINES += LDV1000 -#------------------------------------------------- - -ifneq ($(filter LDV1000,$(MACHINES)),) -MACHINES += Z80CTC -MACHINES += I8255 -MACHINEOBJS += $(MACHINEOBJ)/ldv1000.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ldvp931.h,MACHINES += LDVP931 -#------------------------------------------------- - -ifneq ($(filter LDVP931,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ldvp931.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/lh5810.h,MACHINES += LH5810 -#------------------------------------------------- - -ifneq ($(filter LH5810,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/lh5810.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/linflash.h,MACHINES += LINFLASH -#------------------------------------------------- - -ifneq ($(filter LINFLASH,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/linflash.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/m6m80011ap.h,MACHINES += M6M80011AP -#------------------------------------------------- - -ifneq ($(filter M6M80011AP,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/m6m80011ap.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/matsucd.h,MACHINES += MATSUCD -#------------------------------------------------- - -ifneq ($(filter MATSUCD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/matsucd.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb14241.h,MACHINES += MB14241 -#------------------------------------------------- - -ifneq ($(filter MB14241,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb14241.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb3773.h,MACHINES += MB3773 -#------------------------------------------------- - -ifneq ($(filter MB3773,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb3773.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb8421.h,MACHINES += MB8421 -#------------------------------------------------- - -ifneq ($(filter MB8421,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb8421.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb87078.h,MACHINES += MB87078 -#------------------------------------------------- - -ifneq ($(filter MB87078,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb87078.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb8795.h,MACHINES += MB8795 -#------------------------------------------------- - -ifneq ($(filter MB8795,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb8795.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb89352.h,MACHINES += MB89352 -#------------------------------------------------- - -ifneq ($(filter MB89352,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb89352.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mb89371.h,MACHINES += MB89371 -#------------------------------------------------- - -ifneq ($(filter MB89371,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mb89371.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc146818.h,MACHINES += MC146818 -#------------------------------------------------- - -ifneq ($(filter MC146818,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc146818.o $(MACHINEOBJ)/ds128x.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc2661.h,MACHINES += MC2661 -#------------------------------------------------- - -ifneq ($(filter MC2661,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc2661.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc6843.h,MACHINES += MC6843 -#------------------------------------------------- - -ifneq ($(filter MC6843,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc6843.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc6846.h,MACHINES += MC6846 -#------------------------------------------------- - -ifneq ($(filter MC6846,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc6846.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc6852.h,MACHINES += MC6852 -#------------------------------------------------- - -ifneq ($(filter MC6852,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc6852.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc6854.h,MACHINES += MC6854 -#------------------------------------------------- - -ifneq ($(filter MC6854,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc6854.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc68328.h,MACHINES += MC68328 -#------------------------------------------------- - -ifneq ($(filter MC68328,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc68328.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mc68901.h,MACHINES += MC68901 -#------------------------------------------------- - -ifneq ($(filter MC68901,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mc68901.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mccs1850.h,MACHINES += MCCS1850 -#------------------------------------------------- - -ifneq ($(filter MCCS1850,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mccs1850.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/68307.h,MACHINES += M68307 -#------------------------------------------------- - -ifneq ($(filter M68307,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/68307.o -MACHINEOBJS += $(MACHINEOBJ)/68307sim.o -MACHINEOBJS += $(MACHINEOBJ)/68307bus.o -MACHINEOBJS += $(MACHINEOBJ)/68307tmu.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/68340.h,MACHINES += M68340 -#------------------------------------------------- - -ifneq ($(filter M68340,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/68340.o -MACHINEOBJS += $(MACHINEOBJ)/68340sim.o -MACHINEOBJS += $(MACHINEOBJ)/68340dma.o -MACHINEOBJS += $(MACHINEOBJ)/68340ser.o -MACHINEOBJS += $(MACHINEOBJ)/68340tmu.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mcf5206e.h,MACHINES += MCF5206E -#------------------------------------------------- - -ifneq ($(filter MCF5206E,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mcf5206e.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/microtch.h,MACHINES += MICROTOUCH -#------------------------------------------------- - -ifneq ($(filter MICROTOUCH,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/microtch.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mm58274c.h,MACHINES += MM58274C -#------------------------------------------------- - -ifneq ($(filter MM58274C,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mm58274c.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mm74c922.h,MACHINES += MM74C922 -#------------------------------------------------- - -ifneq ($(filter MM74C922,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mm74c922.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos6526.h,MACHINES += MOS6526 -#------------------------------------------------- - -ifneq ($(filter MOS6526,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos6526.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos6529.h,MACHINES += MOS6529 -#------------------------------------------------- - -ifneq ($(filter MOS6529,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos6529.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos6702.h,MACHINES += MOS6702 -#------------------------------------------------- - -ifneq ($(filter MOS6702,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos6702.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos8706.h,MACHINES += MOS8706 -#------------------------------------------------- - -ifneq ($(filter MOS8706,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos8706.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos8722.h,MACHINES += MOS8722 -#------------------------------------------------- - -ifneq ($(filter MOS8722,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos8722.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos8726.h,MACHINES += MOS8726 -#------------------------------------------------- - -ifneq ($(filter MOS8726,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos8726.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos6530.h,MACHINES += MIOT6530 -#------------------------------------------------- - -ifneq ($(filter MIOT6530,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos6530.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mos6551.h,MACHINES += MOS6551 -#------------------------------------------------- - -ifneq ($(filter MOS6551,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mos6551.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/msm5832.h,MACHINES += MSM5832 -#------------------------------------------------- - -ifneq ($(filter MSM5832,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/msm5832.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/msm58321.h,MACHINES += MSM58321 -#------------------------------------------------- - -ifneq ($(filter MSM58321,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/msm58321.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/msm6242.h,MACHINES += MSM6242 -#------------------------------------------------- - -ifneq ($(filter MSM6242,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/msm6242.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ncr539x.h,MACHINES += NCR539x -#------------------------------------------------- - -ifneq ($(filter NCR539x,$(MACHINES)),) -MACHINES += SCSI -MACHINEOBJS += $(MACHINEOBJ)/ncr539x.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/nmc9306.h,MACHINES += NMC9306 -#------------------------------------------------- - -ifneq ($(filter NMC9306,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/nmc9306.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/nscsi_bus.h,MACHINES += NSCSI -#@src/emu/machine/nscsi_cb.h,MACHINES += NSCSI -#@src/emu/machine/nscsi_cd.h,MACHINES += NSCSI -#@src/emu/machine/nscsi_hd.h,MACHINES += NSCSI -#@src/emu/machine/nscsi_s1410.h,MACHINES += NSCSI -#------------------------------------------------- - -ifneq ($(filter NSCSI,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/nscsi_bus.o -MACHINEOBJS += $(MACHINEOBJ)/nscsi_cb.o -MACHINEOBJS += $(MACHINEOBJ)/nscsi_cd.o -MACHINEOBJS += $(MACHINEOBJ)/nscsi_hd.o -MACHINEOBJS += $(MACHINEOBJ)/nscsi_s1410.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pcf8593.h,MACHINES += PCF8593 -#------------------------------------------------- - -ifneq ($(filter PCF8593,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pcf8593.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/lpci.h,MACHINES += LPCI -#------------------------------------------------- - -ifneq ($(filter LPCI,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/lpci.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pci.h,MACHINES += PCI -#------------------------------------------------- - -ifneq ($(filter PCI,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pci.o -MACHINEOBJS += $(MACHINEOBJ)/pci-usb.o -MACHINEOBJS += $(MACHINEOBJ)/pci-sata.o -MACHINEOBJS += $(MACHINEOBJ)/pci-apic.o -MACHINEOBJS += $(MACHINEOBJ)/pci-smbus.o -MACHINEOBJS += $(MACHINEOBJ)/i82541.o -MACHINEOBJS += $(MACHINEOBJ)/i82875p.o -MACHINEOBJS += $(MACHINEOBJ)/i6300esb.o -MACHINEOBJS += $(MACHINEOBJ)/lpc.o -MACHINEOBJS += $(MACHINEOBJ)/lpc-acpi.o -MACHINEOBJS += $(MACHINEOBJ)/lpc-rtc.o -MACHINEOBJS += $(MACHINEOBJ)/lpc-pit.o -MACHINEOBJS += $(MACHINEOBJ)/vrc4373.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pckeybrd.h,MACHINES += PCKEYBRD -#------------------------------------------------- - -ifneq ($(filter PCKEYBRD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pckeybrd.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pic8259.h,MACHINES += PIC8259 -#------------------------------------------------- - -ifneq ($(filter PIC8259,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pic8259.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pit8253.h,MACHINES += PIT8253 -#------------------------------------------------- - -ifneq ($(filter PIT8253,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pit8253.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pla.h,MACHINES += PLA -#------------------------------------------------- - -ifneq ($(filter PLA,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pla.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/r10696.h,MACHINES += R10696 -#------------------------------------------------- - -ifneq ($(filter R10696,$(MACHINES)),) -MACHINEOBJS+= $(MACHINEOBJ)/r10696.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/r10788.h,MACHINES += R10788 -#------------------------------------------------- - -ifneq ($(filter R10788,$(MACHINES)),) -MACHINEOBJS+= $(MACHINEOBJ)/r10788.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ra17xx.h,MACHINES += RA17XX -#------------------------------------------------- - -ifneq ($(filter RA17XX,$(MACHINES)),) -MACHINEOBJS+= $(MACHINEOBJ)/ra17xx.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rf5c296.h,MACHINES += RF5C296 -#------------------------------------------------- - -ifneq ($(filter RF5C296,$(MACHINES)),) -MACHINES += PCCARD -MACHINEOBJS += $(MACHINEOBJ)/rf5c296.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/roc10937.h,MACHINES += ROC10937 -#------------------------------------------------- - -ifneq ($(filter ROC10937,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/roc10937.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rp5c01.h,MACHINES += RP5C01 -#------------------------------------------------- - -ifneq ($(filter RP5C01,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/rp5c01.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rp5c15.h,MACHINES += RP5C15 -#------------------------------------------------- - -ifneq ($(filter RP5C15,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/rp5c15.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rp5h01.h,MACHINES += RP5H01 -#------------------------------------------------- - -ifneq ($(filter RP5H01,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/rp5h01.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/64h156.h,MACHINES += RP5C15 -#------------------------------------------------- - -ifneq ($(filter R64H156,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/64h156.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rtc4543.h,MACHINES += RTC4543 -#------------------------------------------------- - -ifneq ($(filter RTC4543,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/rtc4543.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rtc65271.h,MACHINES += RTC65271 -#------------------------------------------------- - -ifneq ($(filter RTC65271,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/rtc65271.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/rtc9701.h,MACHINES += RTC9701 -#------------------------------------------------- - -ifneq ($(filter RTC9701,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/rtc9701.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/s2636.h,MACHINES += S2636 -#------------------------------------------------- - -ifneq ($(filter S2636,$(MACHINES)),) -MACHINEOBJS+= $(MACHINEOBJ)/s2636.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/s3520cf.h,MACHINES += S3520CF -#------------------------------------------------- - -ifneq ($(filter S3520CF,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/s3520cf.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/s3c2400.h,MACHINES += S3C2400 -#------------------------------------------------- - -ifneq ($(filter S3C2400,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/s3c2400.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/s3c2410.h,MACHINES += S3C2410 -#------------------------------------------------- - -ifneq ($(filter S3C2410,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/s3c2410.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/s3c44b0.h,MACHINES += S3C44B0 -#------------------------------------------------- - -ifneq ($(filter S3C44B0,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/s3c44b0.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/s3c2440.h,MACHINES += S3C2440 -#------------------------------------------------- - -ifneq ($(filter S3C2440,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/s3c2440.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/saturn.h,MACHINES += SATURN -#------------------------------------------------- - -ifneq ($(filter SATURN,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/saturn.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/serflash.h,MACHINES += SERFLASH -#------------------------------------------------- - -ifneq ($(filter SERFLASH,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/serflash.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/smc91c9x.h,MACHINES += SMC91C9X -#------------------------------------------------- - -ifneq ($(filter SMC91C9X,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/smc91c9x.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/smpc.h,MACHINES += SMPC -#------------------------------------------------- - -ifneq ($(filter SMPC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/smpc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/stvcd.h,MACHINES += STVCD -#------------------------------------------------- - -ifneq ($(filter STVCD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/stvcd.o -endif - -#------------------------------------------------- -# -# -#------------------------------------------------- - -ifneq ($(filter SCSI,$(BUSES)),) -MACHINES += T10 -endif - -ifneq ($(filter T10,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/t10mmc.o -MACHINEOBJS += $(MACHINEOBJ)/t10sbc.o -MACHINEOBJS += $(MACHINEOBJ)/t10spc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/tc009xlvc.h,MACHINES += TC0091LVC -#------------------------------------------------- - -ifneq ($(filter TC0091LVC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/tc009xlvc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/timekpr.h,MACHINES += TIMEKPR -#------------------------------------------------- - -ifneq ($(filter TIMEKPR,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/timekpr.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/tmp68301.h,MACHINES += TMP68301 -#------------------------------------------------- - -ifneq ($(filter TMP68301,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/tmp68301.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/tms5501.h,MACHINES += TMS5501 -#------------------------------------------------- - -ifneq ($(filter TMS5501,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/tms5501.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/tms6100.h,MACHINES += TMS6100 -#------------------------------------------------- - -ifneq ($(filter TMS6100,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/tms6100.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/tms9901.h,MACHINES += TMS9901 -#------------------------------------------------- - -ifneq ($(filter TMS9901,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/tms9901.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/tms9902.h,MACHINES += TMS9902 -#------------------------------------------------- - -ifneq ($(filter TMS9902,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/tms9902.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/upd1990a.h,MACHINES += UPD1990A -#------------------------------------------------- - -ifneq ($(filter UPD1990A,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/upd1990a.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/upd4992.h,MACHINES += UPD4992 -#------------------------------------------------- - -ifneq ($(filter UPD4992,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/upd4992.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/upd4701.h,MACHINES += UPD4701 -#------------------------------------------------- - -ifneq ($(filter UPD4701,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/upd4701.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/upd7002.h,MACHINES += UPD7002 -#------------------------------------------------- - -ifneq ($(filter UPD7002,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/upd7002.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/upd71071.h,MACHINES += UPD71071 -#------------------------------------------------- - -ifneq ($(filter UPD71071,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/upd71071.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/upd765.h,MACHINES += UPD765 -#------------------------------------------------- - -ifneq ($(filter UPD765,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/upd765.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/v3021.h,MACHINES += V3021 -#------------------------------------------------- - -ifneq ($(filter V3021,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/v3021.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wd_fdc.h,MACHINES += WD_FDC -#------------------------------------------------- - -ifneq ($(filter WD_FDC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/wd_fdc.o -MACHINEOBJS += $(MACHINEOBJ)/fdc_pll.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wd11c00_17.h,MACHINES += WD11C00_17 -#------------------------------------------------- - -ifneq ($(filter WD11C00_17,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/wd11c00_17.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wd17xx.h,MACHINES += WD17XX -#------------------------------------------------- - -ifneq ($(filter WD17XX,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/wd17xx.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wd2010.h,MACHINES += WD2010 -#------------------------------------------------- - -ifneq ($(filter WD2010,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/wd2010.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wd33c93.h,MACHINES += WD33C93 -#------------------------------------------------- - -ifneq ($(filter WD33C93,$(MACHINES)),) -MACHINES += SCSI -MACHINEOBJS += $(MACHINEOBJ)/wd33c93.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wd7600.h,MACHINES += WD7600 -#------------------------------------------------- - -ifneq ($(filter WD7600,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/wd7600.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/x2212.h,MACHINES += X2212 -#------------------------------------------------- - -ifneq ($(filter X2212,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/x2212.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/x76f041.h,MACHINES += X76F041 -#------------------------------------------------- - -ifneq ($(filter X76F041,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/x76f041.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/x76f100.h,MACHINES += X76F100 -#------------------------------------------------- - -ifneq ($(filter X76F100,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/x76f100.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ym2148.h,MACHINES += YM2148 -#------------------------------------------------- - -ifneq ($(filter YM2148,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ym2148.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/z80ctc.h,MACHINES += Z80CTC -#------------------------------------------------- - -ifneq ($(filter Z80CTC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/z80ctc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/z80dart.h,MACHINES += Z80DART -#------------------------------------------------- - -ifneq ($(filter Z80DART,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/z80dart.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/z80dma.h,MACHINES += Z80DMA -#------------------------------------------------- - -ifneq ($(filter Z80DMA,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/z80dma.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/z80pio.h,MACHINES += Z80PIO -#------------------------------------------------- - -ifneq ($(filter Z80PIO,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/z80pio.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/z80sti.h,MACHINES += Z80STI -#------------------------------------------------- - -ifneq ($(filter Z80STI,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/z80sti.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/z8536.h,MACHINES += Z8536 -#------------------------------------------------- - -ifneq ($(filter Z8536,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/z8536.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pccard.h,MACHINES += PCCARD -#------------------------------------------------- - -ifneq ($(filter PCCARD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pccard.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/i8255.h,MACHINES += I8255 -#------------------------------------------------- - -ifneq ($(filter I8255,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/i8255.o -MACHINEOBJS += $(MACHINEOBJ)/mb89363b.o -endif - -$(MACHINEOBJ)/s3c2400.o: $(MACHINESRC)/s3c24xx.inc -$(MACHINEOBJ)/s3c2410.o: $(MACHINESRC)/s3c24xx.inc -$(MACHINEOBJ)/s3c2440.o: $(MACHINESRC)/s3c24xx.inc - -#------------------------------------------------- -# -#@src/emu/machine/ncr5380.h,MACHINES += NCR5380 -#------------------------------------------------- - -ifneq ($(filter NCR5380,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ncr5380.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ncr5380n.h,MACHINES += NCR5380N -#------------------------------------------------- - -ifneq ($(filter NCR5380N,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ncr5380n.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ncr5389.h,MACHINES += NCR5390 -#------------------------------------------------- - -ifneq ($(filter NCR5390,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ncr5390.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mm58167.h,MACHINES += MM58167 -#------------------------------------------------- - -ifneq ($(filter MM58167,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mm58167.o -endif - - -#------------------------------------------------- -# -#@src/emu/machine/dp8390.h,MACHINES += DP8390 -#------------------------------------------------- - -ifneq ($(filter DP8390,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/dp8390.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pc_lpt.h,MACHINES += PC_LPT -#------------------------------------------------- - -ifneq ($(filter PC_LPT,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pc_lpt.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/pc_fdc.h,MACHINES += PC_FDC -#------------------------------------------------- - -ifneq ($(filter PC_FDC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/pc_fdc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/mpu401.h,MACHINES += MPU401 -#------------------------------------------------- - -ifneq ($(filter MPU401,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/mpu401.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/at_keybc.h,MACHINES += AT_KEYBC -#------------------------------------------------- - -ifneq ($(filter AT_KEYBC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/at_keybc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/smc92x4.h,MACHINES += SMC92X4 -#------------------------------------------------- - -ifneq ($(filter SMC92X4,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/smc92x4.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/hdc9234.h,MACHINES += HDC9234 -#------------------------------------------------- - -ifneq ($(filter HDC9234,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/hdc9234.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/ti99_hd.h,MACHINES += TI99_HD -#------------------------------------------------- - -ifneq ($(filter TI99_HD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/ti99_hd.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/strata.h,MACHINES += STRATA -#------------------------------------------------- - -ifneq ($(filter STRATA,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/strata.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/steppers.h,MACHINES += STEPPERS -#------------------------------------------------- - -ifneq ($(filter STEPPERS,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/steppers.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/corvushd.h,MACHINES += CORVUSHD -#------------------------------------------------- -ifneq ($(filter CORVUSHD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/corvushd.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/wozfdc.h,MACHINES += WOZFDC -#------------------------------------------------- -ifneq ($(filter WOZFDC,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/wozfdc.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/diablo_hd.h,MACHINES += DIABLO_HD -#------------------------------------------------- -ifneq ($(filter DIABLO_HD,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/diablo_hd.o -endif - -#------------------------------------------------- -# -#@src/emu/machine/fdc37c665gt.h,MACHINES += FDC37C665GT -#------------------------------------------------- - -ifneq ($(filter FDC37C665GT,$(MACHINES)),) -MACHINEOBJS += $(MACHINEOBJ)/fdc37c665gt.o -endif diff --git a/src/emu/machine/mcf5206e.c b/src/emu/machine/mcf5206e.c index d7b99c42483..f19684f71a0 100644 --- a/src/emu/machine/mcf5206e.c +++ b/src/emu/machine/mcf5206e.c @@ -860,7 +860,7 @@ void mcf5206e_peripheral_device::device_start() init_regs(true); m_timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) ); - + save_item(NAME(m_ICR)); save_item(NAME(m_CSAR)); save_item(NAME(m_CSMR)); diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c index 9795e075b4a..4594ea0397f 100644 --- a/src/emu/machine/tmp68301.c +++ b/src/emu/machine/tmp68301.c @@ -123,7 +123,7 @@ void tmp68301_device::device_start() m_in_parallel_cb.resolve_safe(0); m_out_parallel_cb.resolve_safe(); - + save_item(NAME(m_regs)); save_item(NAME(m_IE)); save_item(NAME(m_irq_vector)); diff --git a/src/emu/machine/upd71071.c b/src/emu/machine/upd71071.c index 62214ef9e91..0a4484b607f 100644 --- a/src/emu/machine/upd71071.c +++ b/src/emu/machine/upd71071.c @@ -1,7 +1,7 @@ /* - am9517a.c is a more complete implementation of this, the uPD71071 appears to be a clone of it + am9517a.c is a more complete implementation of this, the uPD71071 appears to be a clone of it NEC uPD71071 DMA Controller Used on the Fujitsu FM-Towns @@ -31,8 +31,8 @@ Self-explanatory, I hope. :) NOTE: Datasheet clearly shows this as 24-bit, with register 7 unused. But the FM-Towns definitely uses reg 7 as bits 24-31. - The documentation on the V53A manual doesn't show these bits either, maybe it's - an external connection on the FMT? might be worth checking overflow behavior etc. + The documentation on the V53A manual doesn't show these bits either, maybe it's + an external connection on the FMT? might be worth checking overflow behavior etc. 0x08: 0x09: Device Control register (16-bit) @@ -77,8 +77,8 @@ 0x0f: Mask register bit 0-3: DMARQ mask bits 1 and 0 only in MTM transfers - - Note, the uPD71071 compatible mode of the V53 CPU differs from a real uPD71071 in the following ways + + Note, the uPD71071 compatible mode of the V53 CPU differs from a real uPD71071 in the following ways diff --git a/src/emu/machine/vrc4373.c b/src/emu/machine/vrc4373.c index b1e5c6e8928..63c2365716b 100644 --- a/src/emu/machine/vrc4373.c +++ b/src/emu/machine/vrc4373.c @@ -13,17 +13,17 @@ ADDRESS_MAP_END // cpu i/f map DEVICE_ADDRESS_MAP_START(cpu_map, 32, vrc4373_device) - AM_RANGE(0x00000000, 0x0000007b) AM_READWRITE( vrc4373_device::cpu_if_r, vrc4373_device::cpu_if_w) + AM_RANGE(0x00000000, 0x0000007b) AM_READWRITE( cpu_if_r, cpu_if_w) ADDRESS_MAP_END // Target Window 1 map DEVICE_ADDRESS_MAP_START(target1_map, 32, vrc4373_device) - AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( vrc4373_device::target1_r, vrc4373_device::target1_w) + AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( target1_r, target1_w) ADDRESS_MAP_END // Target Window 2 map DEVICE_ADDRESS_MAP_START(target2_map, 32, vrc4373_device) - AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( vrc4373_device::target2_r, vrc4373_device::target2_w) + AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( target2_r, target2_w) ADDRESS_MAP_END vrc4373_device::vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -111,7 +111,7 @@ void vrc4373_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_ if (LOG_NILE) logerror("%s: map_extra Master Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci2_laddr); } - // PCI IO Window + // PCI IO Window if (m_cpu_regs[NREG_PCIMIOW]&0x1000) { winStart = m_cpu_regs[NREG_PCIMIOW]&0xff000000; winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMIOW]>>13)&0x7f)<<24))); @@ -122,7 +122,7 @@ void vrc4373_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_ logerror("%s: map_extra IO Window start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci_io_laddr); } // PCI Target Window 1 - if (m_cpu_regs[NREG_PCITW1]&0x1000) { + if (m_cpu_regs[NREG_PCITW1]&0x1000) { winStart = m_cpu_regs[NREG_PCITW1]&0xffe00000; winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW1]>>13)&0x7f)<<21))); winSize = winEnd - winStart + 1; @@ -242,7 +242,7 @@ WRITE32_MEMBER (vrc4373_device::target2_w) logerror("%06X:nile target2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); } -// CPU I/F +// CPU I/F READ32_MEMBER (vrc4373_device::cpu_if_r) { UINT32 result = m_cpu_regs[offset]; @@ -290,7 +290,7 @@ WRITE32_MEMBER(vrc4373_device::cpu_if_w) case NREG_PCICAR: // Bits in reserved area are used for device selection of type 0 config transactions // Assuming 23:11 get mapped into device number for configuration - if ((data&0x3) == 0x0) { + if ((data&0x3) == 0x0) { // Type 0 transaction modData = 0; // Select the device based on one hot bit @@ -341,4 +341,3 @@ WRITE32_MEMBER(vrc4373_device::cpu_if_w) } } - diff --git a/src/emu/machine/vrc4373.h b/src/emu/machine/vrc4373.h index 17fa5de7e9c..998bea71832 100644 --- a/src/emu/machine/vrc4373.h +++ b/src/emu/machine/vrc4373.h @@ -10,13 +10,13 @@ downcast<vrc4373_device *>(device)->set_cpu_tag(_cpu_tag); #define VRC4373_PAGESHIFT 12 - + /* NILE 3 registers 0x000-0x0ff */ -#define NREG_BMCR (0x000/4) -#define NREG_SIMM1 (0x004/4) -#define NREG_SIMM2 (0x008/4) -#define NREG_SIMM3 (0x00C/4) -#define NREG_SIMM4 (0x010/4) +#define NREG_BMCR (0x000/4) +#define NREG_SIMM1 (0x004/4) +#define NREG_SIMM2 (0x008/4) +#define NREG_SIMM3 (0x00C/4) +#define NREG_SIMM4 (0x010/4) #define NREG_PCIMW1 (0x014/4) #define NREG_PCIMW2 (0x018/4) #define NREG_PCITW1 (0x01C/4) @@ -57,7 +57,7 @@ public: void set_cpu_tag(const char *tag); virtual DECLARE_ADDRESS_MAP(config_map, 32); - + DECLARE_READ32_MEMBER( pcictrl_r); DECLARE_WRITE32_MEMBER( pcictrl_w); //cpu bus registers @@ -76,7 +76,7 @@ public: virtual DECLARE_ADDRESS_MAP(target1_map, 32); DECLARE_READ32_MEMBER (target1_r); DECLARE_WRITE32_MEMBER(target1_w); - + virtual DECLARE_ADDRESS_MAP(target2_map, 32); DECLARE_READ32_MEMBER (target2_r); DECLARE_WRITE32_MEMBER(target2_w); diff --git a/src/emu/mame.c b/src/emu/mame.c index 3d8380d8666..b2df26d661b 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -286,11 +286,11 @@ void CLIB_DECL popmessage(const char *format, ...) // pop it in the UI machine_manager::instance()->machine()->ui().popup_time(temp.len() / 40 + 2, "%s", temp.cstr()); - + /* // also write to error.log logerror("popmessage: %s\n", temp.cstr()); - + #ifdef MAME_DEBUG // and to command-line in a DEBUG build osd_printf_info("popmessage: %s\n", temp.cstr()); diff --git a/src/emu/netlist/netlist.mak b/src/emu/netlist/netlist.mak deleted file mode 100644 index b3d1c7a4817..00000000000 --- a/src/emu/netlist/netlist.mak +++ /dev/null @@ -1,70 +0,0 @@ -########################################################################### -# -# netlist.mak -# -# Rules for building netlist core and devices -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -NETLISTSRC = $(EMUSRC)/netlist -NETLISTOBJ = $(EMUOBJ)/netlist - -#------------------------------------------------- -# Netlist dirs and files -#------------------------------------------------- - -OBJDIRS += \ - $(NETLISTOBJ) \ - $(NETLISTOBJ)/devices \ - $(NETLISTOBJ)/analog \ - -NETLISTOBJS+= \ - $(NETLISTOBJ)/nl_base.o \ - $(NETLISTOBJ)/nl_parser.o \ - $(NETLISTOBJ)/nl_setup.o \ - $(NETLISTOBJ)/nl_factory.o \ - $(NETLISTOBJ)/pstring.o \ - $(NETLISTOBJ)/pstate.o \ - $(NETLISTOBJ)/analog/nld_bjt.o \ - $(NETLISTOBJ)/analog/nld_fourterm.o \ - $(NETLISTOBJ)/analog/nld_solver.o \ - $(NETLISTOBJ)/analog/nld_switches.o \ - $(NETLISTOBJ)/analog/nld_twoterm.o \ - $(NETLISTOBJ)/analog/nld_opamps.o \ - $(NETLISTOBJ)/devices/nld_4020.o \ - $(NETLISTOBJ)/devices/nld_4066.o \ - $(NETLISTOBJ)/devices/nld_7400.o \ - $(NETLISTOBJ)/devices/nld_7402.o \ - $(NETLISTOBJ)/devices/nld_7404.o \ - $(NETLISTOBJ)/devices/nld_7408.o \ - $(NETLISTOBJ)/devices/nld_7410.o \ - $(NETLISTOBJ)/devices/nld_7411.o \ - $(NETLISTOBJ)/devices/nld_7420.o \ - $(NETLISTOBJ)/devices/nld_7425.o \ - $(NETLISTOBJ)/devices/nld_7427.o \ - $(NETLISTOBJ)/devices/nld_7430.o \ - $(NETLISTOBJ)/devices/nld_7432.o \ - $(NETLISTOBJ)/devices/nld_7437.o \ - $(NETLISTOBJ)/devices/nld_7448.o \ - $(NETLISTOBJ)/devices/nld_7450.o \ - $(NETLISTOBJ)/devices/nld_7474.o \ - $(NETLISTOBJ)/devices/nld_7483.o \ - $(NETLISTOBJ)/devices/nld_7486.o \ - $(NETLISTOBJ)/devices/nld_7490.o \ - $(NETLISTOBJ)/devices/nld_7493.o \ - $(NETLISTOBJ)/devices/nld_74107.o \ - $(NETLISTOBJ)/devices/nld_74123.o \ - $(NETLISTOBJ)/devices/nld_74153.o \ - $(NETLISTOBJ)/devices/nld_74ls629.o \ - $(NETLISTOBJ)/devices/nld_9316.o \ - $(NETLISTOBJ)/devices/nld_ne555.o \ - $(NETLISTOBJ)/devices/nld_r2r_dac.o \ - $(NETLISTOBJ)/devices/nld_legacy.o \ - $(NETLISTOBJ)/devices/net_lib.o \ - $(NETLISTOBJ)/devices/nld_log.o \ - $(NETLISTOBJ)/devices/nld_system.o \ - diff --git a/src/emu/netlist/plists.h b/src/emu/netlist/plists.h index e3d3a99d184..8f8987d414c 100644 --- a/src/emu/netlist/plists.h +++ b/src/emu/netlist/plists.h @@ -199,7 +199,7 @@ private: // pnamedlist_t: a simple list // ---------------------------------------------------------------------------------------- -#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__) +#if (defined(__sun__) && defined(__svr4__)) || defined(__ANDROID__) #undef _C #endif diff --git a/src/emu/render.c b/src/emu/render.c index 46ae77e8909..af95b896cf5 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -2494,13 +2494,13 @@ float render_manager::ui_aspect(render_container *rc) orient = orientation_add(m_ui_target->orientation(), m_ui_container->orientation()); // based on the orientation of the target, compute height/width or width/height if (!(orient & ORIENTATION_SWAP_XY)) - aspect = (float)m_ui_target->height() / (float)m_ui_target->width(); + aspect = (float)m_ui_target->height() / (float)m_ui_target->width(); else - aspect = (float)m_ui_target->width() / (float)m_ui_target->height(); + aspect = (float)m_ui_target->width() / (float)m_ui_target->height(); // if we have a valid pixel aspect, apply that and return if (m_ui_target->pixel_aspect() != 0.0f) - return (aspect / m_ui_target->pixel_aspect()); + return (aspect / m_ui_target->pixel_aspect()); } else { // single screen container diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c index a880a226361..1c5d1645fcb 100644 --- a/src/emu/sound/aica.c +++ b/src/emu/sound/aica.c @@ -1079,10 +1079,14 @@ INT32 aica_device::UpdateSlot(AICA_SLOT *slot) UINT32 addr1,addr2,addr_select; // current and next sample addresses UINT32 *addr[2] = {&addr1, &addr2}; // used for linear interpolation UINT32 *slot_addr[2] = {&(slot->cur_addr), &(slot->nxt_addr)}; // + UINT32 chanlea = LEA(slot); if(SSCTL(slot)!=0) //no FM or noise yet return 0; + if(PCMS(slot) == 3) // Red Dog music relies on this + chanlea = (chanlea + 3) & ~3; + if(PLFOS(slot)!=0) { step=step*AICAPLFO_Step(&(slot->PLFO)); @@ -1130,7 +1134,7 @@ INT32 aica_device::UpdateSlot(AICA_SLOT *slot) int cur_sample; //current ADPCM sample int nxt_sample; //next ADPCM sample INT32 fpart=slot->cur_addr&((1<<SHIFT)-1); - UINT32 steps_to_go = addr2, curstep = slot->curstep; + UINT32 steps_to_go = addr1 > addr2 ? chanlea : addr2, curstep = slot->curstep; if (slot->adbase) { @@ -1186,19 +1190,19 @@ INT32 aica_device::UpdateSlot(AICA_SLOT *slot) switch(LPCTL(slot)) { case 0: //no loop - if(*addr[addr_select]>=LSA(slot) && *addr[addr_select]>=LEA(slot)) + if(*addr[addr_select]>=LSA(slot) && *addr[addr_select]>=chanlea) { StopSlot(slot,0); } break; case 1: //normal loop - if(*addr[addr_select]>=LEA(slot)) + if(*addr[addr_select]>=chanlea) { slot->lpend = 1; - rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT); + rem_addr = *slot_addr[addr_select] - (chanlea<<SHIFT); *slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr; - if(PCMS(slot)>=2) + if(PCMS(slot)>=2 && addr_select == 0) { // restore the state @ LSA - the sampler will naturally walk to (LSA + remainder) slot->adbase = &m_AICARAM[SA(slot)+(LSA(slot)/2)]; diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h index d3972c0e444..9848cdf5f93 100644 --- a/src/emu/sound/discrete.h +++ b/src/emu/sound/discrete.h @@ -4127,7 +4127,8 @@ enum { #define IS_VALUE_A_NODE(val) (((val) > NODE_START) && ((val) <= NODE_END)) - +// Optional node such as used in CR_FILTER +#define OPT_NODE(val) (int) val /************************************* * * Enumerated values for Node types @@ -4655,8 +4656,8 @@ discrete_base_node *discrete_create_node(discrete_device * pdev, const discrete_ #define DISCRETE_FILTER2(NODE,ENAB,INP0,FREQ,DAMP,TYPE) DSC_SND_ENTRY( NODE, dst_filter2 , DSS_NODE , 5, DSE( ENAB,INP0,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,FREQ,DAMP,TYPE ), NULL, "DISCRETE_FILTER2" ), /* Component specific */ #define DISCRETE_SALLEN_KEY_FILTER(NODE,ENAB,INP0,TYPE,INFO) DSC_SND_ENTRY( NODE, dst_sallen_key , DSS_NODE , 3, DSE( ENAB,INP0,NODE_NC ), DSE( ENAB,INP0,TYPE ), INFO, "DISCRETE_SALLEN_KEY_FILTER" ), -#define DISCRETE_CRFILTER(NODE,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_crfilter , DSS_NODE , 3, DSE( INP0,RVAL,CVAL ), DSE( INP0,RVAL,CVAL ), NULL, "DISCRETE_CRFILTER" ), -#define DISCRETE_CRFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) DSC_SND_ENTRY( NODE, dst_crfilter , DSS_NODE , 4, DSE( INP0,RVAL,CVAL,VREF ), DSE( INP0,RVAL,CVAL,VREF ), NULL, "DISCRETE_CRFILTER_VREF" ), +#define DISCRETE_CRFILTER(NODE,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_crfilter , DSS_NODE , 3, DSE( INP0,OPT_NODE(RVAL),OPT_NODE(CVAL) ), DSE( INP0,RVAL,CVAL ), NULL, "DISCRETE_CRFILTER" ), +#define DISCRETE_CRFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) DSC_SND_ENTRY( NODE, dst_crfilter , DSS_NODE , 4, DSE( INP0,OPT_NODE(RVAL),OPT_NODE(CVAL),VREF ), DSE( INP0,RVAL,CVAL,VREF ), NULL, "DISCRETE_CRFILTER_VREF" ), #define DISCRETE_OP_AMP_FILTER(NODE,ENAB,INP0,INP1,TYPE,INFO) DSC_SND_ENTRY( NODE, dst_op_amp_filt , DSS_NODE , 4, DSE( ENAB,INP0,INP1,NODE_NC ), DSE( ENAB,INP0,INP1,TYPE ), INFO, "DISCRETE_OP_AMP_FILTER" ), #define DISCRETE_RC_CIRCUIT_1(NODE,INP0,INP1,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_rc_circuit_1, DSS_NODE , 4, DSE( INP0,INP1,NODE_NC,NODE_NC ), DSE( INP0,INP1,RVAL,CVAL ), NULL, "DISCRETE_RC_CIRCUIT_1" ), #define DISCRETE_RCDISC(NODE,ENAB,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_rcdisc , DSS_NODE , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL,CVAL ), NULL, "DISCRETE_RCDISC" ), @@ -4665,8 +4666,8 @@ discrete_base_node *discrete_create_node(discrete_device * pdev, const discrete_ #define DISCRETE_RCDISC4(NODE,ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE) DSC_SND_ENTRY( NODE, dst_rcdisc4 , DSS_NODE , 8, DSE( ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE ), NULL, "DISCRETE_RCDISC4" ), #define DISCRETE_RCDISC5(NODE,ENAB,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_rcdisc5 , DSS_NODE , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL,CVAL ), NULL, "DISCRETE_RCDISC5" ), #define DISCRETE_RCDISC_MODULATED(NODE,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP) DSC_SND_ENTRY( NODE, dst_rcdisc_mod, DSS_NODE , 8, DSE( INP0,INP1,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP ), NULL, "DISCRETE_RCDISC_MODULATED" ), -#define DISCRETE_RCFILTER(NODE,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_rcfilter , DSS_NODE , 3, DSE( INP0,RVAL,CVAL ), DSE( INP0,RVAL,CVAL ), NULL, "DISCRETE_RCFILTER" ), -#define DISCRETE_RCFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) DSC_SND_ENTRY( NODE, dst_rcfilter , DSS_NODE , 4, DSE( INP0,RVAL,CVAL,VREF ), DSE( INP0,RVAL,CVAL,VREF ), NULL, "DISCRETE_RCFILTER_VREF" ), +#define DISCRETE_RCFILTER(NODE,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, dst_rcfilter , DSS_NODE , 3, DSE( INP0,OPT_NODE(RVAL),OPT_NODE(CVAL) ), DSE( INP0,RVAL,CVAL ), NULL, "DISCRETE_RCFILTER" ), +#define DISCRETE_RCFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) DSC_SND_ENTRY( NODE, dst_rcfilter , DSS_NODE , 4, DSE( INP0,OPT_NODE(RVAL),OPT_NODE(CVAL),VREF ), DSE( INP0,RVAL,CVAL,VREF ), NULL, "DISCRETE_RCFILTER_VREF" ), #define DISCRETE_RCFILTER_SW(NODE,ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4) DSC_SND_ENTRY( NODE, dst_rcfilter_sw, DSS_NODE , 8, DSE( ENAB,INP0,SW,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4 ), NULL, "DISCRETE_RCFILTER_SW" ), #define DISCRETE_RCINTEGRATE(NODE,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE) DSC_SND_ENTRY( NODE, dst_rcintegrate , DSS_NODE , 7, DSE( INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE ), NULL, "DISCRETE_RCINTEGRATE" ), /* For testing - seem to be buggered. Use versions not ending in N. */ diff --git a/src/emu/sound/es1373.h b/src/emu/sound/es1373.h index b2ee13f1feb..46a2e4180d3 100644 --- a/src/emu/sound/es1373.h +++ b/src/emu/sound/es1373.h @@ -9,26 +9,26 @@ MCFG_PCI_DEVICE_ADD(_tag, ES1373, 0x12741371, 0x04, 0x040100, 0x12741371) /* Ensonic ES1373 registers 0x00-0x3f */ -#define ES_INT_CS_CTRL (0x00/4) -#define ES_INT_CS_STATUS (0x04/4) -#define ES_UART_DATA (0x08/4) -#define ES_UART_STATUS (0x09/4) -#define ES_UART_CTRL (0x09/4) -#define ES_UART_RSVD (0x0A/4) -#define ES_MEM_PAGE (0x0C/4) -#define ES_SRC_IF (0x10/4) -#define ES_CODEC (0x14/4) -#define ES_LEGACY (0x18/4) -#define ES_CHAN_CTRL (0x1C/4) -#define ES_SERIAL_CTRL (0x20/4) -#define ES_DAC1_CNT (0x24/4) -#define ES_DAC2_CNT (0x28/4) -#define ES_ADC_CNT (0x2C/4) -#define ES_ADC_CNT (0x2C/4) -#define ES_HOST_IF0 (0x30/4) -#define ES_HOST_IF1 (0x34/4) -#define ES_HOST_IF2 (0x38/4) -#define ES_HOST_IF3 (0x3C/4) +#define ES_INT_CS_CTRL (0x00/4) +#define ES_INT_CS_STATUS (0x04/4) +#define ES_UART_DATA (0x08/4) +#define ES_UART_STATUS (0x09/4) +#define ES_UART_CTRL (0x09/4) +#define ES_UART_RSVD (0x0A/4) +#define ES_MEM_PAGE (0x0C/4) +#define ES_SRC_IF (0x10/4) +#define ES_CODEC (0x14/4) +#define ES_LEGACY (0x18/4) +#define ES_CHAN_CTRL (0x1C/4) +#define ES_SERIAL_CTRL (0x20/4) +#define ES_DAC1_CNT (0x24/4) +#define ES_DAC2_CNT (0x28/4) +#define ES_ADC_CNT (0x2C/4) +#define ES_ADC_CNT (0x2C/4) +#define ES_HOST_IF0 (0x30/4) +#define ES_HOST_IF1 (0x34/4) +#define ES_HOST_IF2 (0x38/4) +#define ES_HOST_IF3 (0x3C/4) struct frame_reg { UINT32 pci_addr; diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c index 806792ccc17..cec4ebd6bc4 100644 --- a/src/emu/sound/flt_rc.c +++ b/src/emu/sound/flt_rc.c @@ -37,7 +37,7 @@ void filter_rc_device::device_start() { m_stream = stream_alloc(1, 1, machine().sample_rate()); recalc(); - + save_item(NAME(m_k)); save_item(NAME(m_memory)); save_item(NAME(m_type)); diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c index c408a6a93f2..b34959cd529 100644 --- a/src/emu/sound/iremga20.c +++ b/src/emu/sound/iremga20.c @@ -80,6 +80,7 @@ void iremga20_device::device_start() save_item(NAME(m_channel[i].size), i); save_item(NAME(m_channel[i].start), i); save_item(NAME(m_channel[i].pos), i); + save_item(NAME(m_channel[i].frac), i); save_item(NAME(m_channel[i].end), i); save_item(NAME(m_channel[i].volume), i); save_item(NAME(m_channel[i].pan), i); diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.c b/src/emu/sound/l7a1045_l6028_dsp_a.c new file mode 100644 index 00000000000..13df8251c37 --- /dev/null +++ b/src/emu/sound/l7a1045_l6028_dsp_a.c @@ -0,0 +1,341 @@ +/*************************************************************************** + + L7A1045 L6028 DSP-A + (QFP120 package) + + this is the audio chip used on the following + SNK Hyper NeoGeo 64 (arcade platform) + AKAI MPC3000 (synth) + + both are driven by a V53, the MPC3000 isn't dumped. + + appears to write a register number and channel/voice using + l7a1045_sound_select_w (offset 0) + format: + + ---- rrrr ---c cccc + r = register, c = channel + + the channel select appears to address 32 different voices (5-bits) + the register select appears to use 4-bits with 0x0 to 0xa being valid + + the registers data is written / read using offsets 1,2,3 after + setting the register + channel, this gives 3 16-bit values for + each register. + + register format: + + offset 3 offset 2 offset 1 + fedcba9876543210 | fedcba9876543210 | fedcba9876543210 + + 0 ---------------- ---------------- ---------------- + + 1 ---------------- ---------------- ---------------- + + 2 ---------------- ---------------- ---------------- + + 3 ---------------- ---------------- ---------------- + + 4 ---------------- ---------------- ---------------- + + 5 ---------------- ---------------- ---------------- + + 6 ---------------- ---------------- ---------------- + + 7 ---------------- ---------------- ---------------- + + 8 ---------------- ---------------- ---------------- (read only?) + + 9 ---------------- ---------------- ---------------- (read only?) + + a ---------------- ---------------- ---------------- + + Registers are not yet understood. + + probably sample start, end, loop positions, panning etc. + like CPS3, Qsound etc. + + case 0x00: + case 0x01: + case 0x02: + case 0x03: // 00003fffffff (startup only?) + case 0x04: // doesn't use 6 + case 0x05: // 00003fffffff (mostly, often) + case 0x06: // 00007ff0ffff mostly + case 0x07: // 0000000f0708 etc. (low values) + case 0x08: // doesn't write to 2/4/6 with this set?? + case 0x09: // doesn't write to 2/4/6 with this set?? + case 0x0a: // random looking values + + Some of the other ports on the HNG64 sound CPU may also be tied + to this chip, this isn't yet clear. + + Sample data format TBA + +***************************************************************************/ + +#include "emu.h" +#include "l7a1045_l6028_dsp_a.h" + + +// device type definition +const device_type L7A1045 = &device_creator<l7a1045_sound_device>; + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// l7a1045_sound_device - constructor +//------------------------------------------------- + +l7a1045_sound_device::l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, L7A1045, "L7A1045 L6028 DSP-A", tag, owner, clock, "l7a1045_custom", __FILE__), + device_sound_interface(mconfig, *this), + m_stream(NULL) + /*m_key(0), + m_base(NULL)*/ +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void l7a1045_sound_device::device_start() +{ + /* Allocate the stream */ + m_stream = stream_alloc(0, 2, clock() / 384); +} + + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void l7a1045_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +{ + /* Clear the buffers */ + memset(outputs[0], 0, samples*sizeof(*outputs[0])); + memset(outputs[1], 0, samples*sizeof(*outputs[1])); +} + + +WRITE16_MEMBER( l7a1045_sound_device::l7a1045_sound_w ) +{ + m_stream->update(); + + switch (offset) + { + case 0x00:l7a1045_sound_select_w(space, offset, data, mem_mask); break; + case 0x01:l7a1045_sound_data_02_w(space, offset, data, mem_mask); break; + case 0x02:l7a1045_sound_data_04_w(space, offset, data, mem_mask); break; + case 0x03:l7a1045_sound_data_06_w(space, offset, data, mem_mask); break; + } + +} + + +READ16_MEMBER( l7a1045_sound_device::l7a1045_sound_r ) +{ + m_stream->update(); + + switch (offset) + { + case 0x00: + case 0x01: + printf("%08x: l7a1045_sound_r unknown offset %02x\n", space.device().safe_pc(), offset * 2); + return 0x0000; + + case 0x02: return l7a1045_sound_port_0004_r(space, offset, mem_mask); + case 0x03: return l7a1045_sound_port_0006_r(space, offset, mem_mask); + } + return 0x000; +} + + +WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_select_w) +{ + // I'm guessing these addresses are the sound chip / DSP? + + // ---- ---- 000c cccc + // c = channel + + if (ACCESSING_BITS_0_7) + { + m_audiochannel = data; + if (m_audiochannel & 0xe0) printf("%08x: l7a1045_sound_select_w unknown channel %01x\n", space.device().safe_pc(), m_audiochannel & 0xff); + m_audiochannel &= 0x1f; + } + + if (ACCESSING_BITS_8_15) + { + m_audioregister = (data >> 8); + if (m_audioregister >0x0a) printf("%08x: l7a1045_sound_select_w unknown register %01x\n", space.device().safe_pc(), m_audioregister & 0xff); + m_audioregister &= 0x0f; + } + +} + +WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of various registers? +{ + m_audiodat[m_audioregister][m_audiochannel].dat[2] = data; + + // write with registers 00, 01, 04, 06, 05, 03, 07, 02 on startup + // groups writes of register 0a per channel + + // register 08 / 09 not written? + switch (m_audioregister) + { + default: + + case 0x08: + case 0x09: + printf("%08x: unexpected write port 0x0002 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + case 0x00: + case 0x01: + case 0x04: + case 0x06: + case 0x05: + case 0x03: + case 0x02: + case 0x07: + + case 0x0a: + // printf("%08x: write port 0x0002 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + } + +} + +WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w) // lower? word of various registers? +{ + m_audiodat[m_audioregister][m_audiochannel].dat[1] = data; + + // write with registers 00, 04, 06, 05, 03, 07, 02, 01 on startup + // groups writes of register 0a per channel + + // register 08 / 09 not written? + + switch (m_audioregister) + { + default: + + case 0x08: + case 0x09: + printf("%08x: unexpected write port 0x0004 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + case 0x00: + case 0x04: + case 0x06: + case 0x05: + case 0x03: + case 0x07: + case 0x01: + case 0x02: + + case 0x0a: + //printf("%08x: write port 0x0004 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + } + +} +WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w) // other part? of various registers.. less used than 02/04, maybe flags? +{ + // 00 / 01 written at startup + // nothing else used? + + m_audiodat[m_audioregister][m_audiochannel].dat[0] = data; + switch (m_audioregister) + { + default: + + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0a: + printf("%08x: unexpected write port 0x0006 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + case 0x00: + case 0x01: + //printf("%08x: unexpected write port 0x0006 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + } +} + + +READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0004_r) +{ + // it writes the channel select before reading this.. so either it works on channels, or the command.. + + // buriki reads registers 03/05/00 these at the moment, others don't + // also reads 06 + + switch (m_audioregister) + { + default: + + case 0x01: + case 0x02: + case 0x04: + case 0x07: + case 0x08: + case 0x09: + case 0x0a: + printf("%08x: unexpected read port 0x0004 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + case 0x03: + case 0x05: + case 0x00: + case 0x06: + //printf("%08x: read port 0x0004 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + + } + return 0; +} + +READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0006_r) +{ + // it writes the channel select before reading this.. so either it works on channels, or the command.. + + // buriki reads register 00 + + switch (m_audioregister) + { + default: + + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + case 0x06: + case 0x07: + case 0x08: + case 0x09: + case 0x0a: + printf("%08x: unexpected read port 0x0006 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + + case 0x00: + //printf("%08x: read port 0x0006 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); + break; + } + return rand(); +} diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.h b/src/emu/sound/l7a1045_l6028_dsp_a.h new file mode 100644 index 00000000000..d37b7945346 --- /dev/null +++ b/src/emu/sound/l7a1045_l6028_dsp_a.h @@ -0,0 +1,68 @@ +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +struct l7a1045_voice +{ + /* + l7a1045_voice() : + pos(0), + frac(0) + { + memset(regs, 0, sizeof(UINT32)*8); + } + + UINT32 regs[8]; + UINT32 pos; + UINT32 frac; + */ +}; + +// ======================> l7a1045_sound_device + +class l7a1045_sound_device : public device_t, + public device_sound_interface +{ +public: + l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ~l7a1045_sound_device() { } + +// void set_base(INT8* base) { m_base = base; } + + DECLARE_WRITE16_MEMBER( l7a1045_sound_w ); + DECLARE_READ16_MEMBER( l7a1045_sound_r ); + +protected: + // device-level overrides + virtual void device_start(); + + // sound stream update overrides + virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); + +private: + sound_stream *m_stream; +// l7a1045_voice m_voice[32]; +// UINT16 m_key; +// INT8* m_base; + + UINT8 m_audiochannel; + UINT8 m_audioregister; + + struct l7a1045_48bit_data { + UINT16 dat[3]; + }; + + l7a1045_48bit_data m_audiodat[0x10][0x20]; + + DECLARE_WRITE16_MEMBER(l7a1045_sound_select_w); + DECLARE_WRITE16_MEMBER(l7a1045_sound_data_02_w); + DECLARE_WRITE16_MEMBER(l7a1045_sound_data_04_w); + DECLARE_WRITE16_MEMBER(l7a1045_sound_data_06_w); + + DECLARE_READ16_MEMBER(l7a1045_sound_port_0004_r); + DECLARE_READ16_MEMBER(l7a1045_sound_port_0006_r); + + +}; + +extern const device_type L7A1045; diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c index 3370ee460e8..b18894e71a3 100644 --- a/src/emu/sound/okim9810.c +++ b/src/emu/sound/okim9810.c @@ -115,11 +115,11 @@ void okim9810_device::device_start() save_item(NAME(m_global_volume)); save_item(NAME(m_filter_type)); save_item(NAME(m_output_level)); - + for (int i = 0; i < OKIM9810_VOICES; i++) { okim_voice *voice = get_voice(i); - + save_item(NAME(voice->m_adpcm.m_signal), i); save_item(NAME(voice->m_adpcm.m_step), i); save_item(NAME(voice->m_adpcm2.m_signal), i); diff --git a/src/emu/sound/okim9810.h b/src/emu/sound/okim9810.h index 823a8e25f59..4d1f3da7b71 100644 --- a/src/emu/sound/okim9810.h +++ b/src/emu/sound/okim9810.h @@ -135,7 +135,7 @@ protected: }; okim_voice *get_voice(int which); - + // internal state const address_space_config m_space_config; diff --git a/src/emu/sound/sound.mak b/src/emu/sound/sound.mak deleted file mode 100644 index 10367590e1b..00000000000 --- a/src/emu/sound/sound.mak +++ /dev/null @@ -1,931 +0,0 @@ -########################################################################### -# -# sound.mak -# -# Rules for building sound cores -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -SOUNDSRC = $(EMUSRC)/sound -SOUNDOBJ = $(EMUOBJ)/sound - -#------------------------------------------------- -# DACs -#@src/emu/sound/dac.h,SOUNDS += DAC -#@src/emu/sound/dmadac.h,SOUNDS += DMADAC -#@src/emu/sound/speaker.h,SOUNDS += SPEAKER -#@src/emu/sound/beep.h,SOUNDS += BEEP -#------------------------------------------------- - -ifneq ($(filter DAC,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/dac.o -endif - -ifneq ($(filter DMADAC,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/dmadac.o -endif - -ifneq ($(filter SPEAKER,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/speaker.o -endif - -ifneq ($(filter BEEP,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/beep.o -endif - - - -#------------------------------------------------- -# CD audio -#@src/emu/sound/cdda.h,SOUNDS += CDDA -#------------------------------------------------- - -ifneq ($(filter CDDA,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/cdda.o -endif - - - -#------------------------------------------------- -# Discrete component audio -#@src/emu/sound/discrete.h,SOUNDS += DISCRETE -#------------------------------------------------- - -ifneq ($(filter DISCRETE,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/discrete.o -endif - -$(SOUNDOBJ)/discrete.o: $(SOUNDSRC)/discrete.c \ - $(SOUNDSRC)/discrete.h \ - $(SOUNDSRC)/disc_dev.inc \ - $(SOUNDSRC)/disc_sys.inc \ - $(SOUNDSRC)/disc_flt.inc \ - $(SOUNDSRC)/disc_inp.inc \ - $(SOUNDSRC)/disc_mth.inc \ - $(SOUNDSRC)/disc_wav.inc - - -#------------------------------------------------- -# AC97 -#@src/emu/sound/pic-ac97.h,SOUNDS += AC97 -#------------------------------------------------- - -ifneq ($(filter AC97,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/pci-ac97.o -endif - - - -#------------------------------------------------- -# Apple custom sound chips -#@src/emu/sound/asc.h,SOUNDS += ASC -#@src/emu/sound/awacs.h,SOUNDS += AWACS -#------------------------------------------------- - -ifneq ($(filter ASC,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/asc.o -endif - -ifneq ($(filter AWACS,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/awacs.o -endif - - -#------------------------------------------------- -# Atari custom sound chips -#@src/emu/sound/pokey.h,SOUNDS += POKEY -#@src/emu/sound/tiaintf.h,SOUNDS += TIA -#------------------------------------------------- - -ifneq ($(filter POKEY,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/pokey.o -endif - -ifneq ($(filter TIA,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/tiasound.o $(SOUNDOBJ)/tiaintf.o -endif - - - -#------------------------------------------------- -# Amiga audio hardware -#@src/emu/sound/amiga.h,SOUNDS += AMIGA -#------------------------------------------------- - -ifneq ($(filter AMIGA,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/amiga.o -endif - - - -#------------------------------------------------- -# Bally Astrocade sound system -#@src/emu/sound/astrocde.h,SOUNDS += ASTROCADE -#------------------------------------------------- - -ifneq ($(filter ASTROCADE,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/astrocde.o -endif - - - -#------------------------------------------------- -#------------------------------------------------- -# AC97 -#@src/emu/sound/pic-ac97.h,SOUNDS += AC97 -#------------------------------------------------- - -ifneq ($(filter AC97,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/pci-ac97.o -endif -# CEM 3394 analog synthesizer chip -#@src/emu/sound/cem3394.h,SOUNDS += CEM3394 -#------------------------------------------------- - -ifneq ($(filter CEM3394,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/cem3394.o -endif - - - -#------------------------------------------------- -# Creative Labs SB0400 Audigy2 Value -#@src/emu/sound/sb0400.h,SOUNDS += AC97 -#------------------------------------------------- - -ifneq ($(filter SB0400,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/sb0400.o -endif - -#------------------------------------------------- -# Creative Labs Ensonic AudioPCI97 ES1373 -#@src/emu/sound/es1373.h,SOUNDS += ES1373 -#------------------------------------------------- - -ifneq ($(filter ES1373,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/es1373.o -endif - - - -#------------------------------------------------- -# Data East custom sound chips -#@src/emu/sound/bsmt2000.h,SOUNDS += BSMT2000 -#------------------------------------------------- - -ifneq ($(filter BSMT2000,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/bsmt2000.o -endif - - - -#------------------------------------------------- -# Ensoniq 5503 (Apple IIgs) -#@src/emu/sound/es5503.h,SOUNDS += ES5503 -#------------------------------------------------- - -ifneq ($(filter ES5503,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/es5503.o -endif - - - -#------------------------------------------------- -# Ensoniq 5505/5506 -#@src/emu/sound/es5506.h,SOUNDS += ES5505 -#------------------------------------------------- - -ifneq ($(filter ES5505 ES5506,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/es5506.o -endif - - -#------------------------------------------------- -# Ensoniq "pump" device, interfaces 5505/5506 with 5510 -#@src/emu/sound/esqpump.h,SOUNDS += ESQPUMP -#------------------------------------------------- - -ifneq ($(filter ESQPUMP,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/esqpump.o -endif - - -#------------------------------------------------- -# Excellent Systems ADPCM sound chip -#@src/emu/sound/es8712.h,SOUNDS += ES8712 -#------------------------------------------------- - -ifneq ($(filter ES8712,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/es8712.o -endif - - - -#------------------------------------------------- -# Gaelco custom sound chips -#@src/emu/sound/gaelco.h,SOUNDS += GAELCO_CG1V -#------------------------------------------------- - -ifneq ($(filter GAELCO_CG1V GAELCO_GAE1,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/gaelco.o -endif - - -#------------------------------------------------- -# RCA CDP1863 -#@src/emu/sound/cdp1863.h,SOUNDS += CDP1863 -#------------------------------------------------- - -ifneq ($(filter CDP1863,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/cdp1863.o -endif - - - -#------------------------------------------------- -# RCA CDP1864 -#@src/emu/sound/cdp1864.h,SOUNDS += CDP1864 -#------------------------------------------------- - -ifneq ($(filter CDP1864,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/cdp1864.o -endif - - - -#------------------------------------------------- -# RCA CDP1869 -#@src/emu/sound/cdp1869.h,SOUNDS += CDP1869 -#------------------------------------------------- - -ifneq ($(filter CDP1869,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/cdp1869.o -endif - - - -#------------------------------------------------- -# GI AY-8910 -#@src/emu/sound/ay8910.h,SOUNDS += AY8910 -#------------------------------------------------- - -ifneq ($(filter AY8910,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ay8910.o -endif - - - -#------------------------------------------------- -# Harris HC55516 CVSD -#@src/emu/sound/hc55516.h,SOUNDS += HC55516 -#------------------------------------------------- - -ifneq ($(filter HC55516,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/hc55516.o -endif - - - -#------------------------------------------------- -# Hudsonsoft C6280 sound chip -#@src/emu/sound/c6280.h,SOUNDS += C6280 -#------------------------------------------------- - -ifneq ($(filter C6280,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/c6280.o -endif - - - -#------------------------------------------------- -# ICS2115 sound chip -#@src/emu/sound/ics2115.h,SOUNDS += ICS2115 -#------------------------------------------------- - -ifneq ($(filter ICS2115,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ics2115.o -endif - - - -#------------------------------------------------- -# Imagetek I5000 sound -#@src/emu/sound/i5000.h,SOUNDS += I5000_SND -#------------------------------------------------- - -ifneq ($(filter I5000_SND,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/i5000.o -endif - - - -#------------------------------------------------- -# Irem custom sound chips -#@src/emu/sound/iremga20.h,SOUNDS += IREMGA20 -#------------------------------------------------- - -ifneq ($(filter IREMGA20,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/iremga20.o -endif - - - -#------------------------------------------------- -# Konami custom sound chips -#@src/emu/sound/k005289.h,SOUNDS += K005289 -#@src/emu/sound/k007232.h,SOUNDS += K007232 -#@src/emu/sound/k051649.h,SOUNDS += K051649 -#@src/emu/sound/k053260.h,SOUNDS += K053260 -#@src/emu/sound/k054539.h,SOUNDS += K054539 -#@src/emu/sound/k056800.h,SOUNDS += K056800 -#------------------------------------------------- - -ifneq ($(filter K005289,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/k005289.o -endif - -ifneq ($(filter K007232,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/k007232.o -endif - -ifneq ($(filter K051649,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/k051649.o -endif - -ifneq ($(filter K053260,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/k053260.o -endif - -ifneq ($(filter K054539,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/k054539.o -endif - -ifneq ($(filter K056800,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/k056800.o -endif - - - -#------------------------------------------------- -# LMC1992 mixer chip -#@src/emu/sound/lmc1992.h,SOUNDS += LMC1992 -#------------------------------------------------- - -ifneq ($(filter LMC1992,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/lmc1992.o -endif - - - -#------------------------------------------------- -# MAS 3507D MPEG 1/2 Layer 2/3 Audio Decoder -#@src/emu/sound/mas3507d.h,SOUNDS += MAS3507D -#------------------------------------------------- - -ifneq ($(filter MAS3507D,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/mas3507d.o -endif - - - -#------------------------------------------------- -# MOS 6560VIC -#@src/emu/sound/mos6560.h,SOUNDS += MOS656X -#------------------------------------------------- - -ifneq ($(filter MOS656X,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/mos6560.o -endif - - - -#------------------------------------------------- -# MOS 7360 TED -#@src/emu/sound/mos7360.h,SOUNDS += MOS7360 -#------------------------------------------------- - -ifneq ($(filter MOS7360,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/mos7360.o -endif - - - -#------------------------------------------------- -# Namco custom sound chips -#@src/emu/sound/namco.h,SOUNDS += NAMCO -#@src/emu/sound/n63701x.h,SOUNDS += NAMCO_63701X -#@src/emu/sound/c140.h,SOUNDS += C140 -#@src/emu/sound/c352.h,SOUNDS += C352 -#------------------------------------------------- - -ifneq ($(filter NAMCO NAMCO_15XX NAMCO_CUS30,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/namco.o -endif - -ifneq ($(filter NAMCO_63701X,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/n63701x.o -endif - -ifneq ($(filter C140,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/c140.o -endif - -ifneq ($(filter C352,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/c352.o -endif - - - -#------------------------------------------------- -# National Semiconductor Digitalker -#@src/emu/sound/digitalk.h,SOUNDS += DIGITALKER -#------------------------------------------------- - -ifneq ($(filter DIGITALKER,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/digitalk.o -endif - - - -#------------------------------------------------- -# Nintendo custom sound chips -#@src/emu/sound/nes_apu.h,SOUNDS += NES_APU -#------------------------------------------------- - -ifneq ($(filter NES_APU,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/nes_apu.o -endif - - - -#------------------------------------------------- -# NEC uPD7759 ADPCM sample player -#@src/emu/sound/upd7759.h,SOUNDS += UPD7759 -#------------------------------------------------- - -ifneq ($(filter UPD7759,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/upd7759.o -endif - - - -#------------------------------------------------- -# OKI ADPCM sample players -#@src/emu/sound/okim6258.h,SOUNDS += OKIM6258 -#@src/emu/sound/msm5205.h,SOUNDS += MSM5205 -#@src/emu/sound/msm5232.h,SOUNDS += MSM5232 -#@src/emu/sound/okim6376.h,SOUNDS += OKIM6376 -#@src/emu/sound/okim6295.h,SOUNDS += OKIM6295 -#@src/emu/sound/okim9810.h,SOUNDS += OKIM9810 -#------------------------------------------------- - -ifneq ($(filter OKIM6258 OKIM6295 OKIM9810 I5000_SND,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/okiadpcm.o -endif - -ifneq ($(filter MSM5205 MSM6585,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/msm5205.o -endif - -ifneq ($(filter MSM5232,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/msm5232.o -endif - -ifneq ($(filter OKIM6376,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/okim6376.o -endif - -ifneq ($(filter OKIM6295,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/okim6295.o -endif - -ifneq ($(filter OKIM6258,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/okim6258.o -endif - -ifneq ($(filter OKIM9810,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/okim9810.o -endif - - - -#------------------------------------------------- -# Philips SAA1099 -#@src/emu/sound/saa1099.h,SOUNDS += SAA1099 -#------------------------------------------------- - -ifneq ($(filter SAA1099,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/saa1099.o -endif - - - -#------------------------------------------------- -# AdMOS QS1000 -#@src/emu/sound/qs1000.h,SOUNDS += QS1000 -#------------------------------------------------- - -ifneq ($(filter QS1000,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/qs1000.o -endif - - - -#------------------------------------------------- -# QSound sample player -#@src/emu/sound/qsound.h,SOUNDS += QSOUND -#------------------------------------------------- - -ifneq ($(filter QSOUND,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/qsound.o $(CPUOBJ)/dsp16/dsp16.o $(CPUOBJ)/dsp16/dsp16dis.o -endif - - - -#------------------------------------------------- -# Ricoh sample players -#@src/emu/sound/rf5c68.h,SOUNDS += RF5C68 -#@src/emu/sound/rf5c400.h,SOUNDS += RF5C400 -#------------------------------------------------- - -ifneq ($(filter RF5C68,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/rf5c68.o -endif - -ifneq ($(filter RF5C400,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/rf5c400.o -endif - - - -#------------------------------------------------- -# Sega custom sound chips -#@src/emu/sound/segapcm.h,SOUNDS += SEGAPCM -#@src/emu/sound/multipcm.h,SOUNDS += MULTIPCM -#@src/emu/sound/scsp.h,SOUNDS += SCSP -#@src/emu/sound/aica.h,SOUNDS += AICA -#------------------------------------------------- - -ifneq ($(filter SEGAPCM,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/segapcm.o -endif - -ifneq ($(filter MULTIPCM,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/multipcm.o -endif - -ifneq ($(filter SCSP,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/scsp.o $(SOUNDOBJ)/scspdsp.o -endif - -ifneq ($(filter AICA,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/aica.o $(SOUNDOBJ)/aicadsp.o -endif - -#------------------------------------------------- -# Seta custom sound chips -#@src/emu/sound/st0016.h,SOUNDS += ST0016 -#@src/emu/sound/nile.h,SOUNDS += NILE -#@src/emu/sound/x1_010.h,SOUNDS += X1_010 -#------------------------------------------------- - -ifneq ($(filter ST0016,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/st0016.o -endif - -ifneq ($(filter NILE,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/nile.o -endif - -ifneq ($(filter X1_010,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/x1_010.o -endif - - - -#------------------------------------------------- -# SID custom sound chips -#@src/emu/sound/mos6581.h,SOUNDS += SID6581 -#------------------------------------------------- - -ifneq ($(filter SID6581 SID8580,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/mos6581.o $(SOUNDOBJ)/sid.o $(SOUNDOBJ)/sidenvel.o $(SOUNDOBJ)/sidvoice.o -endif - - -#------------------------------------------------- -# SNK(?) custom stereo sn76489a clone -#@src/emu/sound/t6w28.h,SOUNDS += T6W28 -#------------------------------------------------- - -ifneq ($(filter T6W28,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/t6w28.o -endif - - - -#------------------------------------------------- -# SNK custom wave generator -#@src/emu/sound/snkwave.h,SOUNDS += SNKWAVE -#------------------------------------------------- - -ifneq ($(filter SNKWAVE,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/snkwave.o -endif - - - -#------------------------------------------------- -# Sony custom sound chips -#@src/emu/sound/spu.h,SOUNDS += SPU -#------------------------------------------------- - -ifneq ($(filter SPU,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/spu.o $(SOUNDOBJ)/spu_tables.o $(SOUNDOBJ)/spureverb.o -endif - - -#------------------------------------------------- -# SP0256 speech synthesizer -#@src/emu/sound/sp0256.h,SOUNDS += SP0256 -#------------------------------------------------- - -ifneq ($(filter SP0256,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/sp0256.o -endif - - - -#------------------------------------------------- -# SP0250 speech synthesizer -#@src/emu/sound/sp0250.h,SOUNDS += SP0250 -#------------------------------------------------- - -ifneq ($(filter SP0250,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/sp0250.o -endif - - -#------------------------------------------------- -# S14001A speech synthesizer -#@src/emu/sound/s14001a.h,SOUNDS += S14001A -#------------------------------------------------- - -ifneq ($(filter S14001A,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/s14001a.o -endif - - - -#------------------------------------------------- -# Texas Instruments SN76477 analog chip -#@src/emu/sound/sn76477.h,SOUNDS += SN76477 -#------------------------------------------------- - -ifneq ($(filter SN76477,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/sn76477.o -endif - - - -#------------------------------------------------- -# Texas Instruments SN76496 -#@src/emu/sound/sn76496.h,SOUNDS += SN76496 -#------------------------------------------------- - -ifneq ($(filter SN76496,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/sn76496.o -endif - - - -#------------------------------------------------- -# Texas Instruments TMS36xx doorbell chime -#@src/emu/sound/tms36xx.h,SOUNDS += TMS36XX -#------------------------------------------------- - -ifneq ($(filter TMS36XX,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/tms36xx.o -endif - - - -#------------------------------------------------- -# Texas Instruments TMS3615 Octave Multiple Tone Synthesizer -#@src/emu/sound/tms3615.h,SOUNDS += TMS3615 -#------------------------------------------------- - -ifneq ($(filter TMS3615,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/tms3615.o -endif - - - -#------------------------------------------------- -# Texas Instruments TMS5100-series speech synthesizers -#@src/emu/sound/tms5110.h,SOUNDS += TMS5110 -#------------------------------------------------- - -ifneq ($(filter TMS5110,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/tms5110.o -endif - -$(SOUNDOBJ)/tms5110.o: $(SOUNDSRC)/tms5110r.inc - - - -#------------------------------------------------- -# Texas Instruments TMS5200-series speech synthesizers -#@src/emu/sound/tms5220.h,SOUNDS += TMS5220 -#------------------------------------------------- -ifneq ($(filter TMS5220,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/tms5220.o $(EMUMACHINE)/spchrom.o -endif - -$(SOUNDOBJ)/tms5220.o: $(SOUNDSRC)/tms5110r.inc - - - -#------------------------------------------------- -# Toshiba T6721A voice synthesizer -#@src/emu/sound/t6721a.h,SOUNDS += T6721A -#------------------------------------------------- - -ifneq ($(filter T6721A,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/t6721a.o -endif - - - -#------------------------------------------------- -# Toshiba TC8830F sample player/recorder -#@src/emu/sound/tc8830f.h,SOUNDS += TC8830F -#------------------------------------------------- - -ifneq ($(filter TC8830F,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/tc8830f.o -endif - - -#------------------------------------------------- -# NEC uPD7752 -#@src/emu/sound/upd7752.h,SOUNDS += UPD7752 -#------------------------------------------------- - -ifneq ($(filter UPD7752,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/upd7752.o -endif - - -#------------------------------------------------- -# VLM5030 speech synthesizer -#@src/emu/sound/vlm5030.h,SOUNDS += VLM5030 -#------------------------------------------------- - -ifneq ($(filter VLM5030,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/vlm5030.o -endif - -$(SOUNDOBJ)/vlm5030.o: $(SOUNDSRC)/tms5110r.inc - - - -#------------------------------------------------- -# Votrax speech synthesizer -#@src/emu/sound/votrax.h,SOUNDS += VOTRAX -#------------------------------------------------- - -ifneq ($(filter VOTRAX,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/votrax.o $(SOUNDOBJ)/samples.o -endif - - - -#------------------------------------------------- -# VRender0 custom sound chip -#@src/emu/sound/vrender0.h,SOUNDS += VRENDER0 -#------------------------------------------------- - -ifneq ($(filter VRENDER0,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/vrender0.o -endif - - - -#------------------------------------------------- -# WAVE file (used for MESS cassette) -#@src/emu/sound/wave.h,SOUNDS += WAVE -#------------------------------------------------- - -ifneq ($(filter WAVE,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/wave.o -endif - - - -#------------------------------------------------- -# Yamaha FM synthesizers -#@src/emu/sound/2151intf.h,SOUNDS += YM2151 -#@src/emu/sound/2203intf.h,SOUNDS += YM2203 -#@src/emu/sound/2413intf.h,SOUNDS += YM2413 -#@src/emu/sound/2608intf.h,SOUNDS += YM2608 -#@src/emu/sound/2610intf.h,SOUNDS += YM2610 -#@src/emu/sound/2612intf.h,SOUNDS += YM2612 -#@src/emu/sound/3812intf.h,SOUNDS += YM3812 -#@src/emu/sound/3526intf.h,SOUNDS += YM3526 -#@src/emu/sound/8950intf.h,SOUNDS += Y8950 -#@src/emu/sound/ymf262.h,SOUNDS += YMF262 -#@src/emu/sound/ymf271.h,SOUNDS += YMF271 -#@src/emu/sound/ymf278b.h,SOUNDS += YMF278B -#------------------------------------------------- - -ifneq ($(filter YM2151,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/2151intf.o $(SOUNDOBJ)/ym2151.o -endif - -ifneq ($(filter YM2203,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/2203intf.o $(SOUNDOBJ)/ay8910.o $(SOUNDOBJ)/fm.o -endif - -ifneq ($(filter YM2413,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/2413intf.o $(SOUNDOBJ)/ym2413.o -endif - -ifneq ($(filter YM2608,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/2608intf.o $(SOUNDOBJ)/ay8910.o $(SOUNDOBJ)/fm.o $(SOUNDOBJ)/ymdeltat.o -endif - -ifneq ($(filter YM2610 YM2610B,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/2610intf.o $(SOUNDOBJ)/ay8910.o $(SOUNDOBJ)/fm.o $(SOUNDOBJ)/ymdeltat.o -endif - -ifneq ($(filter YM2612 YM3438,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/2612intf.o $(SOUNDOBJ)/ay8910.o $(SOUNDOBJ)/fm2612.o -endif - -ifneq ($(filter YM3812,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/3812intf.o $(SOUNDOBJ)/fmopl.o $(SOUNDOBJ)/ymdeltat.o -endif - -ifneq ($(filter YM3526,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/3526intf.o $(SOUNDOBJ)/fmopl.o $(SOUNDOBJ)/ymdeltat.o -endif - -ifneq ($(filter Y8950,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/8950intf.o $(SOUNDOBJ)/fmopl.o $(SOUNDOBJ)/ymdeltat.o -endif - -ifneq ($(filter YMF262,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ymf262.o $(SOUNDOBJ)/262intf.o -endif - -ifneq ($(filter YMF271,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ymf271.o -endif - -ifneq ($(filter YMF278B,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ymf278b.o -endif - - - -#------------------------------------------------- -# Yamaha YMZ280B ADPCM -#@src/emu/sound/ymz280b.h,SOUNDS += YMZ280B -#------------------------------------------------- - -ifneq ($(filter YMZ280B,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ymz280b.o -endif - -#------------------------------------------------- -# Yamaha YMZ770 AMM -#@src/emu/sound/ymz770.h,SOUNDS += YMZ770 -#------------------------------------------------- - -ifneq ($(filter YMZ770,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/ymz770.o $(SOUNDOBJ)/mpeg_audio.o -endif - -#------------------------------------------------- -# ZOOM ZSG-2 -#@src/emu/sound/zsg2.h,SOUNDS += ZSG2 -#------------------------------------------------- - -ifneq ($(filter ZSG2,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/zsg2.o -endif - -#------------------------------------------------- -# VRC6 -#@src/emu/sound/vrc6.h,SOUNDS += VRC6 -#------------------------------------------------- - -ifneq ($(filter VRC6,$(SOUNDS)),) -SOUNDOBJS += $(SOUNDOBJ)/vrc6.o -endif - diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c index 46e3ccf4129..59cc39d7f84 100644 --- a/src/emu/sound/tms5220.c +++ b/src/emu/sound/tms5220.c @@ -322,6 +322,7 @@ static INT16 clip_analog(INT16 cliptemp); #define TMS5220_IS_CD2501E TMS5220_IS_5200 #define TMS5220_HAS_RATE_CONTROL ((m_variant == TMS5220_IS_5220C) || (m_variant == TMS5220_IS_CD2501ECD)) +#define TMS5220_IS_52xx ((m_variant == TMS5220_IS_5220C) || (m_variant == TMS5220_IS_5200) || (m_variant == TMS5220_IS_5220) || (m_variant == TMS5220_IS_CD2501ECD)) static const UINT8 reload_table[4] = { 0, 2, 4, 6 }; //sample count reload for 5220c and cd2501ecd only; 5200 and 5220 always reload with 0; keep in mind this is loaded on IP=0 PC=12 subcycle=1 so it immediately will increment after one sample, effectively being 1,3,5,7 as in the comments above. @@ -405,6 +406,12 @@ void tms5220_device::register_for_save_states() save_item(NAME(m_digital_select)); save_item(NAME(m_io_ready)); + + save_item(NAME(m_true_timing)); + + save_item(NAME(m_rs_ws)); + save_item(NAME(m_read_latch)); + save_item(NAME(m_write_latch)); } @@ -468,7 +475,7 @@ void tms5220_device::data_write(int data) #ifdef DEBUG_FIFO logerror("data_write: Added byte to FIFO (current count=%2d)\n", m_fifo_count); #endif - update_status_and_ints(); + update_fifo_status_and_ints(); if ((m_talk_status == 0) && (m_buffer_low == 0)) // we just unset buffer low with that last write, and talk status *was* zero... { int i; @@ -508,7 +515,7 @@ void tms5220_device::data_write(int data) /********************************************************************************************** - update_status_and_ints -- check to see if the various flags should be on or off + update_fifo_status_and_ints -- check to see if the various flags should be on or off Description of flags, and their position in the status register: From the data sheet: bit D0(bit 7) = TS - Talk Status is active (high) when the VSP is processing speech data. @@ -529,10 +536,10 @@ void tms5220_device::data_write(int data) ***********************************************************************************************/ -void tms5220_device::update_status_and_ints() +void tms5220_device::update_fifo_status_and_ints() { - /* update flags and set ints if needed */ - + /* update 52xx fifo flags and set ints if needed */ + if (!TMS5220_IS_52xx) return; // bail out if not a 52xx chip update_ready_state(); /* BL is set if neither byte 9 nor 8 of the fifo are in use; this @@ -599,7 +606,7 @@ int tms5220_device::extract_bits(int count) m_fifo[m_fifo_head] = 0; // zero the newly depleted fifo head byte m_fifo_head = (m_fifo_head + 1) % FIFO_SIZE; m_fifo_bits_taken = 0; - update_status_and_ints(); + update_fifo_status_and_ints(); } } } @@ -791,7 +798,7 @@ void tms5220_device::process(INT16 *buffer, unsigned int size) { m_talk_status = m_speak_external = 0; set_interrupt_state(1); - update_status_and_ints(); + update_fifo_status_and_ints(); } /* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it. @@ -1244,7 +1251,7 @@ void tms5220_device::process_command(unsigned char cmd) } /* update the buffer low state */ - update_status_and_ints(); + update_fifo_status_and_ints(); } /****************************************************************************************** @@ -1273,7 +1280,7 @@ void tms5220_device::parse_frame() else // non-5220C and 5220C in fixed rate mode m_IP = reload_table[m_c_variant_rate&0x3]; - update_status_and_ints(); + update_fifo_status_and_ints(); if (!m_talk_status) goto ranout; // attempt to extract the energy index @@ -1282,7 +1289,7 @@ void tms5220_device::parse_frame() printbits(m_new_frame_energy_idx,m_coeff->energy_bits); fprintf(stderr," "); #endif - update_status_and_ints(); + update_fifo_status_and_ints(); if (!m_talk_status) goto ranout; // if the energy index is 0 or 15, we're done if ((m_new_frame_energy_idx == 0) || (m_new_frame_energy_idx == 15)) @@ -1302,7 +1309,7 @@ void tms5220_device::parse_frame() printbits(m_new_frame_pitch_idx,m_coeff->pitch_bits); fprintf(stderr," "); #endif - update_status_and_ints(); + update_fifo_status_and_ints(); if (!m_talk_status) goto ranout; // if this is a repeat frame, just do nothing, it will reuse the old coefficients if (rep_flag) @@ -1316,7 +1323,7 @@ void tms5220_device::parse_frame() printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]); fprintf(stderr," "); #endif - update_status_and_ints(); + update_fifo_status_and_ints(); if (!m_talk_status) goto ranout; } @@ -1335,7 +1342,7 @@ void tms5220_device::parse_frame() printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]); fprintf(stderr," "); #endif - update_status_and_ints(); + update_fifo_status_and_ints(); if (!m_talk_status) goto ranout; } #ifdef VERBOSE @@ -1361,6 +1368,7 @@ void tms5220_device::parse_frame() void tms5220_device::set_interrupt_state(int state) { + if (!TMS5220_IS_52xx) return; // bail out if not a 52xx chip, since there's no int pin #ifdef DEBUG_PIN_READS logerror("irq pin set to state %d\n", state); #endif diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h index c73ddb71c89..6aab4638a13 100644 --- a/src/emu/sound/tms5220.h +++ b/src/emu/sound/tms5220.h @@ -73,7 +73,7 @@ protected: private: void register_for_save_states(); void data_write(int data); - void update_status_and_ints(); + void update_fifo_status_and_ints(); int extract_bits(int count); int status_read(); int ready_read(); diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c index b968937cbea..8d119e131f6 100644 --- a/src/emu/ui/ui.c +++ b/src/emu/ui/ui.c @@ -319,7 +319,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer) if (!first_time || (str > 0 && str < 60*5) || &machine().system() == &GAME_NAME(___empty) || (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) show_gameinfo = show_warnings = show_disclaimer = show_mandatory_fileman = FALSE; - #ifdef SDLMAME_EMSCRIPTEN + #if defined(EMSCRIPTEN) // also disable for the JavaScript port since the startup screens do not run asynchronously show_gameinfo = show_warnings = show_disclaimer = FALSE; #endif diff --git a/src/emu/video.c b/src/emu/video.c index 11dc4545540..f332e75eac7 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -153,7 +153,7 @@ video_manager::video_manager(running_machine &machine) filename = machine.options().avi_write(); if (filename[0] != 0) begin_recording(filename, MF_AVI); - + #ifdef MAME_DEBUG m_dummy_recording = machine.options().dummy_write(); #endif diff --git a/src/emu/video.h b/src/emu/video.h index c5ca9c9e27b..31e115870ef 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -176,9 +176,9 @@ private: attotime m_avi_frame_period; // period of a single movie frame attotime m_avi_next_frame_time; // time of next frame UINT32 m_avi_frame; // current movie frame number - + // movie recording - dummy - bool m_dummy_recording; // indicates if snapshot should be created of every frame + bool m_dummy_recording; // indicates if snapshot should be created of every frame static const UINT8 s_skiptable[FRAMESKIP_LEVELS][FRAMESKIP_LEVELS]; diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c index ffcb01d99ad..2e1667d991f 100644 --- a/src/emu/video/tms34061.c +++ b/src/emu/video/tms34061.c @@ -60,7 +60,7 @@ void tms34061_device::device_start() /* allocate memory for VRAM */ m_vram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2); - + /* allocate memory for latch RAM */ m_latchram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2); @@ -93,7 +93,7 @@ void tms34061_device::device_start() /* start vertical interrupt timer */ m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tms34061_device::interrupt), this)); - + save_item(NAME(m_regs)); save_item(NAME(m_xmask)); save_item(NAME(m_yshift)); diff --git a/src/emu/video/video.mak b/src/emu/video/video.mak deleted file mode 100644 index 28aeacf9e07..00000000000 --- a/src/emu/video/video.mak +++ /dev/null @@ -1,618 +0,0 @@ -########################################################################### -# -# video.mak -# -# Rules for building video cores -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -VIDEOSRC = $(EMUSRC)/video -VIDEOOBJ = $(EMUOBJ)/video - - -#------------------------------------------------- -# -#@src/emu/video/315_5124.h,VIDEOS += SEGA315_5124 -#------------------------------------------------- - -ifneq ($(filter SEGA315_5124,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/315_5124.o -endif - -#------------------------------------------------- -# -#@src/emu/video/315_5313.h,VIDEOS += SEGA315_5313 -#------------------------------------------------- - -ifneq ($(filter SEGA315_5313,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/315_5313.o -endif - -#------------------------------------------------- -# -#@src/emu/video/bufsprite.h,VIDEOS += BUFSPRITE -#------------------------------------------------- - -ifneq ($(filter BUFSPRITE,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/bufsprite.o -endif - -#------------------------------------------------- -# -#@src/emu/video/cdp1861.h,VIDEOS += CDP1861 -#------------------------------------------------- - -ifneq ($(filter CDP1861,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/cdp1861.o -endif - -#------------------------------------------------- -# -#@src/emu/video/cdp1862.h,VIDEOS += CDP1862 -#------------------------------------------------- - -ifneq ($(filter CDP1862,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/cdp1862.o -endif - -#------------------------------------------------- -# -#@src/emu/video/crt9007.h,VIDEOS += CRT9007 -#------------------------------------------------- - -ifneq ($(filter CRT9007,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/crt9007.o -endif - -#------------------------------------------------- -# -#@src/emu/video/crt9021.h,VIDEOS += CRT9021 -#------------------------------------------------- - -ifneq ($(filter CRT9021,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/crt9021.o -endif - -#------------------------------------------------- -# -#@src/emu/video/crt9212.h,VIDEOS += CRT9212 -#------------------------------------------------- - -ifneq ($(filter CRT9212,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/crt9212.o -endif - -#------------------------------------------------- -# -#@src/emu/video/dl1416.h,VIDEOS += DL1416 -#------------------------------------------------- - -ifneq ($(filter DL1416,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/dl1416.o -endif - -#------------------------------------------------- -# -#@src/emu/video/dm9368.h,VIDEOS += DM9368 -#------------------------------------------------- - -ifneq ($(filter DM9368,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/dm9368.o -endif - -#------------------------------------------------- -# -#@src/emu/video/ef9340_1.h,VIDEOS += EF9340_1 -#------------------------------------------------- - -ifneq ($(filter EF9340_1,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/ef9340_1.o -endif - -#------------------------------------------------- -# -#@src/emu/video/ef9345.h,VIDEOS += EF9345 -#------------------------------------------------- - -ifneq ($(filter EF9345,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/ef9345.o -endif - -#------------------------------------------------- -#@src/emu/video/epic12.h,VIDEOS += EPIC12 -#------------------------------------------------- - -ifneq ($(filter EPIC12,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/epic12.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit0.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit1.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit2.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit3.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit4.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit5.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit6.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit7.o -VIDEOOBJS+= $(VIDEOOBJ)/epic12_blit8.o - -$(VIDEOOBJ)/epic12o: $(VIDEOSRC)/epic12.h - -$(VIDEOOBJ)/epic12_blit0.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit1.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit2.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit3.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit4.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit5.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit6.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit7.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc -$(VIDEOOBJ)/epic12_blit8.o: $(VIDEOSRC)/epic12.h $(VIDEOSRC)/epic12in.inc - -$(VIDEOSRC)/epic12in.inc: $(VIDEOSRC)/epic12pixel.inc - -endif - -#------------------------------------------------- -# -#@src/emu/video/fixfreq.h,VIDEOS += FIXFREQ -#------------------------------------------------- - -ifneq ($(filter FIXFREQ,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/fixfreq.o -endif - -#------------------------------------------------- -# -#@src/emu/video/gf4500.h,VIDEOS += GF4500 -#------------------------------------------------- - -ifneq ($(filter GF4500,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/gf4500.o -endif - -#------------------------------------------------- -# -#@src/emu/video/gf7600gs.h,VIDEOS += GF7600GS -#------------------------------------------------- - -ifneq ($(filter GF7600GS,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/gf7600gs.o -endif - -#------------------------------------------------- -# -#@src/emu/video/h63484.h,VIDEOS += H63484 -#------------------------------------------------- - -ifneq ($(filter H63484,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/h63484.o -endif - -#------------------------------------------------- -# -#@src/emu/video/hd44102.h,VIDEOS += HD44102 -#------------------------------------------------- - -ifneq ($(filter HD44102,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/hd44102.o -endif - -#------------------------------------------------- -# -#@src/emu/video/hd44352.h,VIDEOS += HD44352 -#------------------------------------------------- - -ifneq ($(filter HD44352,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/hd44352.o -endif - -#------------------------------------------------- -# -#@src/emu/video/hd44780.h,VIDEOS += HD44780 -#------------------------------------------------- - -ifneq ($(filter HD44780,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/hd44780.o -endif - -#------------------------------------------------- -# -#@src/emu/video/hd61830.h,VIDEOS += HD61830 -#------------------------------------------------- - -ifneq ($(filter HD61830,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/hd61830.o -endif - -#------------------------------------------------- -# -#@src/emu/video/hd63484.h,VIDEOS += HD63484 -#------------------------------------------------- - -ifneq ($(filter HD63484,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/hd63484.o -endif - -#------------------------------------------------- -# -#@src/emu/video/hd66421.h,VIDEOS += HD66421 -#------------------------------------------------- - -ifneq ($(filter HD66421,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/hd66421.o -endif - -#------------------------------------------------- -# -#@src/emu/video/huc6202.h,VIDEOS += HUC6202 -#------------------------------------------------- - -ifneq ($(filter HUC6202,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/huc6202.o -endif - -#------------------------------------------------- -# -#@src/emu/video/huc6260.h,VIDEOS += HUC6260 -#------------------------------------------------- - -ifneq ($(filter HUC6260,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/huc6260.o -endif - -#------------------------------------------------- -# -#@src/emu/video/huc6261.h,VIDEOS += HUC6261 -#------------------------------------------------- - -ifneq ($(filter HUC6261,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/huc6261.o -endif - -#------------------------------------------------- -# -#@src/emu/video/huc6270.h,VIDEOS += HUC6270 -#------------------------------------------------- - -ifneq ($(filter HUC6270,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/huc6270.o -endif - -#------------------------------------------------- -# -#@src/emu/video/huc6272.h,VIDEOS += HUC6272 -#------------------------------------------------- - -ifneq ($(filter HUC6272,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/huc6272.o -endif - -#------------------------------------------------- -# -#@src/emu/video/i8244.h,VIDEOS += I8244 -#------------------------------------------------- - -ifneq ($(filter I8244,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/i8244.o -endif - -#------------------------------------------------- -# -#@src/emu/video/i8275.h,VIDEOS += I8275 -#------------------------------------------------- - -ifneq ($(filter I8275,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/i8275.o -endif - -#------------------------------------------------- -# -#@src/emu/video/m50458.h,VIDEOS += M50458 -#------------------------------------------------- - -ifneq ($(filter M50458,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/m50458.o -endif - -#------------------------------------------------- -# -#@src/emu/video/mb90082.h,VIDEOS += MB90082 -#------------------------------------------------- - -ifneq ($(filter MB90082,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/mb90082.o -endif - -#------------------------------------------------- -# -#@src/emu/video/mb_vcu.h,VIDEOS += MB_VCU -#------------------------------------------------- - -ifneq ($(filter MB_VCU,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/mb_vcu.o -endif - -#------------------------------------------------- -# -#@src/emu/video/mc6845.h,VIDEOS += MC6845 -#------------------------------------------------- - -ifneq ($(filter MC6845,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/mc6845.o -endif - -#------------------------------------------------- -# -#@src/emu/video/mc6847.h,VIDEOS += MC6847 -#------------------------------------------------- - -ifneq ($(filter MC6847,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/mc6847.o -endif - -#------------------------------------------------- -# -#@src/emu/video/msm6222b.h,VIDEOS += MSM6222B -#------------------------------------------------- - -ifneq ($(filter MSM6222B,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/msm6222b.o -endif - -#------------------------------------------------- -# -#@src/emu/video/msm6255.h,VIDEOS += MSM6255 -#------------------------------------------------- - -ifneq ($(filter MSM6255,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/msm6255.o -endif - -#------------------------------------------------- -# -#@src/emu/video/mos6566.h,VIDEOS += MOS6566 -#------------------------------------------------- - -ifneq ($(filter MOS6566,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/mos6566.o -endif - - -VIDEOOBJS+= $(VIDEOOBJ)/cgapal.o - -#------------------------------------------------- -# - -#@src/emu/video/pc_vga.h,VIDEOS += PC_VGA -#------------------------------------------------- - -ifneq ($(filter PC_VGA,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/pc_vga.o -VIDEOOBJS+= $(BUSOBJ)/isa/trident.o -endif - -#------------------------------------------------- -# -#@src/emu/video/polylgcy.h,VIDEOS += POLY -#------------------------------------------------- - -ifneq ($(filter POLY,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/polylgcy.o -endif - -#------------------------------------------------- -# -#@src/emu/video/psx.h,VIDEOS += PSX -#------------------------------------------------- - -ifneq ($(filter PSX,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/psx.o -endif - -#------------------------------------------------- -# -#@src/emu/video/ramdac.h,VIDEOS += RAMDAC -#------------------------------------------------- - -ifneq ($(filter RAMDAC,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/ramdac.o -endif - -#------------------------------------------------- -# -#@src/emu/video/saa5050.h,VIDEOS += SAA5050 -#------------------------------------------------- - -ifneq ($(filter SAA5050,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/saa5050.o -endif - -#------------------------------------------------- -# -#@src/emu/video/sed1200.h,VIDEOS += SED1200 -#------------------------------------------------- -ifneq ($(filter SED1200,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/sed1200.o -endif - -#------------------------------------------------- -# -#@src/emu/video/sed1330.h,VIDEOS += SED1330 -#------------------------------------------------- -ifneq ($(filter SED1330,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/sed1330.o -endif - -#------------------------------------------------- -# -#@src/emu/video/sed1520.h,VIDEOS += SED1520 -#------------------------------------------------- -ifneq ($(filter SED1520,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/sed1520.o -endif - -#------------------------------------------------- -# -#@src/emu/video/scn2674.h,VIDEOS += SCN2674 -#------------------------------------------------- -ifneq ($(filter SCN2674,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/scn2674.o -endif - -#------------------------------------------------- -# -#@src/emu/video/snes_ppu.h,VIDEOS += SNES_PPU -#------------------------------------------------- -ifneq ($(filter SNES_PPU,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/snes_ppu.o -endif - -#------------------------------------------------- -# -#@src/emu/video/stvvdp1.h,VIDEOS += STVVDP -#@src/emu/video/stvvdp2.h,VIDEOS += STVVDP -#------------------------------------------------- - -ifneq ($(filter STVVDP,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/stvvdp1.o \ - $(VIDEOOBJ)/stvvdp2.o -endif - -#------------------------------------------------- -# -#@src/emu/video/t6a04.h,VIDEOS += T6A04 -#------------------------------------------------- - -ifneq ($(filter T6A04,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/t6a04.o -endif - -#------------------------------------------------- -# -#@src/emu/video/tea1002.h,VIDEOS += TEA1002 -#------------------------------------------------- - -ifneq ($(filter TEA1002,$(VIDEOS)),) -VIDEOOBJS += $(VIDEOOBJ)/tea1002.o -endif - -#------------------------------------------------- -# -#@src/emu/video/tlc34076.h,VIDEOS += TLC34076 -#------------------------------------------------- - -ifneq ($(filter TLC34076,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/tlc34076.o -endif - -#------------------------------------------------- -# -#@src/emu/video/tms34061.h,VIDEOS += TMS34061 -#------------------------------------------------- - -ifneq ($(filter TMS34061,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/tms34061.o -endif - -#------------------------------------------------- -# -#@src/emu/video/tms3556.h,VIDEOS += TMS3556 -#------------------------------------------------- - -ifneq ($(filter TMS3556,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/tms3556.o -endif - -#------------------------------------------------- -# -#@src/emu/video/tms9927.h,VIDEOS += TMS9927 -#------------------------------------------------- - -ifneq ($(filter TMS9927,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/tms9927.o -endif - -#------------------------------------------------- -# -#@src/emu/video/tms9928a.h,VIDEOS += TMS9928A -#------------------------------------------------- - -ifneq ($(filter TMS9928A,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/tms9928a.o -endif - -#------------------------------------------------- -# -#@src/emu/video/upd3301.h,VIDEOS += UPD3301 -#------------------------------------------------- - -ifneq ($(filter UPD3301,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/upd3301.o -endif - -#------------------------------------------------- -# -#@src/emu/video/upd7220.h,VIDEOS += UPD7220 -#------------------------------------------------- - -ifneq ($(filter UPD7220,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/upd7220.o -endif - -#------------------------------------------------- -# -#@src/emu/video/upd7227.h,VIDEOS += UPD7227 -#------------------------------------------------- - -ifneq ($(filter UPD7227,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/upd7227.o -endif - -#------------------------------------------------- -# -#@src/emu/video/vic4567.h,VIDEOS += VIC4567 -#------------------------------------------------- - -ifneq ($(filter VIC4567,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/vic4567.o -endif - -#------------------------------------------------- -# -#@src/emu/video/v9938.h,VIDEOS += V9938 -#------------------------------------------------- - -ifneq ($(filter V9938,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/v9938.o -endif - -#------------------------------------------------- -# -#@src/emu/video/voodoo.h,VIDEOS += VOODOO -#------------------------------------------------- - -ifneq ($(filter VOODOO,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/voodoo.o -endif - - -#------------------------------------------------- -# -#@src/emu/video/voodoo_pci.h,VIDEOS += VOODOO_PCI -#------------------------------------------------- - -ifneq ($(filter VOODOO_PCI,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/voodoo_pci.o -endif - - -#------------------------------------------------- -# -#@src/emu/video/crtc_ega.h,VIDEOS += CRTC_EGA -#------------------------------------------------- - -ifneq ($(filter CRTC_EGA,$(VIDEOS)),) -VIDEOOBJS+= $(VIDEOOBJ)/crtc_ega.o -endif diff --git a/src/emu/video/voodoo_pci.c b/src/emu/video/voodoo_pci.c index 2b7a6f07433..e1e02e2260e 100644 --- a/src/emu/video/voodoo_pci.c +++ b/src/emu/video/voodoo_pci.c @@ -56,7 +56,7 @@ void voodoo_pci_device::map_extra(UINT64 memory_window_start, UINT64 memory_wind return; if(UINT32(bi.adr) == UINT32(~(bi.size - 1))) return; - + UINT64 start; address_space *space; if(bi.flags & M_IO) { diff --git a/src/ldplayer/ldplayer.mak b/src/ldplayer/ldplayer.mak deleted file mode 100644 index ed9dc801b53..00000000000 --- a/src/ldplayer/ldplayer.mak +++ /dev/null @@ -1,77 +0,0 @@ -########################################################################### -# -# ldplayer.mak -# -# Small makefile to build a standalone laserdisc player -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - -# add some additional include libraries for the mame files -INCPATH += \ - -I$(SRC)/mame \ - -LDPSRC = $(SRC)/ldplayer -LDPOBJ = $(OBJ)/ldplayer - -LAYOUT = $(LDPOBJ)/layout - -OBJDIRS += \ - $(LDPOBJ) \ - $(LAYOUT) \ - - - -#------------------------------------------------- -# specify required CPU cores (none) -#------------------------------------------------- - -CPUS += MCS48 -CPUS += Z80 - - - -#------------------------------------------------- -# specify required sound cores -#------------------------------------------------- - -SOUNDS += WAVE - - -#------------------------------------------------- -# specify available video cores -#------------------------------------------------- - -#------------------------------------------------- -# specify available machine cores -#------------------------------------------------- - -MACHINES += LDV1000 -MACHINES += LDPR8210 - -#------------------------------------------------- -# specify available bus cores -# -# MIDI is here as dummy bus to allow libbus.a to -# be created on OSX. -#------------------------------------------------- - -BUSES += MIDI - -#------------------------------------------------- -# this is the list of driver libraries that -# comprise MAME plus mamedriv.o which contains -# the list of drivers -#------------------------------------------------- - -DRVLIBS = \ - $(EMUDRIVERS)/emudummy.o - - -#------------------------------------------------- -# layout dependencies -#------------------------------------------------- - -$(LDPOBJ)/ldplayer.o: $(LAYOUT)/pr8210.lh diff --git a/src/lib/formats/d88_dsk.c b/src/lib/formats/d88_dsk.c index abb2eac3079..23363acdcc1 100644 --- a/src/lib/formats/d88_dsk.c +++ b/src/lib/formats/d88_dsk.c @@ -27,8 +27,8 @@ * */ - #include <assert.h> - + #include <assert.h> + #include "flopimg.h" #include "imageutl.h" diff --git a/src/lib/formats/flex_dsk.c b/src/lib/formats/flex_dsk.c index 34aa965643d..f4934d8e436 100644 --- a/src/lib/formats/flex_dsk.c +++ b/src/lib/formats/flex_dsk.c @@ -4,7 +4,7 @@ * Created on: 24/06/2014 */ - #include "emu.h" // logerror + #include "emu.h" // logerror #include "flex_dsk.h" flex_format::flex_format() diff --git a/src/lib/formats/fmtowns_dsk.c b/src/lib/formats/fmtowns_dsk.c index 83bfd2fbd51..6baede6fb07 100644 --- a/src/lib/formats/fmtowns_dsk.c +++ b/src/lib/formats/fmtowns_dsk.c @@ -6,8 +6,8 @@ * Created on: 23/03/2014 */ - #include <assert.h> - + #include <assert.h> + #include "formats/fmtowns_dsk.h" fmtowns_format::fmtowns_format() : wd177x_format(formats) diff --git a/src/lib/formats/nfd_dsk.c b/src/lib/formats/nfd_dsk.c index 083d59417b2..7702d3814a5 100644 --- a/src/lib/formats/nfd_dsk.c +++ b/src/lib/formats/nfd_dsk.c @@ -77,8 +77,8 @@ *********************************************************************/ - #include <assert.h> - + #include <assert.h> + #include "nfd_dsk.h" nfd_format::nfd_format() diff --git a/src/lib/lib.mak b/src/lib/lib.mak deleted file mode 100644 index 1b5dbffe923..00000000000 --- a/src/lib/lib.mak +++ /dev/null @@ -1,689 +0,0 @@ -########################################################################### -# -# lib.mak -# -# MAME dependent library makefile -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - - -LIBSRC = $(SRC)/lib -LIBOBJ = $(OBJ)/lib - -OBJDIRS += \ - $(LIBOBJ)/util \ - $(LIBOBJ)/expat \ - $(LIBOBJ)/formats \ - $(LIBOBJ)/zlib \ - $(LIBOBJ)/softfloat \ - $(LIBOBJ)/libjpeg \ - $(LIBOBJ)/libflac \ - $(LIBOBJ)/lib7z \ - $(LIBOBJ)/portmidi \ - $(LIBOBJ)/portmidi/pm_common \ - $(LIBOBJ)/portmidi/pm_linux \ - $(LIBOBJ)/portmidi/pm_mac \ - $(LIBOBJ)/portmidi/pm_win \ - $(LIBOBJ)/portmidi/porttime \ - $(LIBOBJ)/lua \ - $(LIBOBJ)/lua/lsqlite3 \ - $(LIBOBJ)/mongoose \ - $(LIBOBJ)/jsoncpp \ - $(LIBOBJ)/sqlite3 \ - $(LIBOBJ)/bgfx \ - $(LIBOBJ)/bgfx/common \ - $(LIBOBJ)/bgfx/common/entry \ - $(LIBOBJ)/bgfx/common/font \ - $(LIBOBJ)/bgfx/common/imgui \ - $(LIBOBJ)/bgfx/common/nanovg \ - -#------------------------------------------------- -# utility library objects -#------------------------------------------------- - -UTILOBJS = \ - $(OSDOBJ)/osdcore.o \ - $(LIBOBJ)/util/astring.o \ - $(LIBOBJ)/util/avhuff.o \ - $(LIBOBJ)/util/aviio.o \ - $(LIBOBJ)/util/bitmap.o \ - $(LIBOBJ)/util/cdrom.o \ - $(LIBOBJ)/util/chd.o \ - $(LIBOBJ)/util/chdcd.o \ - $(LIBOBJ)/util/chdcodec.o \ - $(LIBOBJ)/util/corealloc.o \ - $(LIBOBJ)/util/corefile.o \ - $(LIBOBJ)/util/corestr.o \ - $(LIBOBJ)/util/coreutil.o \ - $(LIBOBJ)/util/cstrpool.o \ - $(LIBOBJ)/util/delegate.o \ - $(LIBOBJ)/util/flac.o \ - $(LIBOBJ)/util/harddisk.o \ - $(LIBOBJ)/util/hashing.o \ - $(LIBOBJ)/util/huffman.o \ - $(LIBOBJ)/util/jedparse.o \ - $(LIBOBJ)/util/md5.o \ - $(LIBOBJ)/util/opresolv.o \ - $(LIBOBJ)/util/options.o \ - $(LIBOBJ)/util/palette.o \ - $(LIBOBJ)/util/plaparse.o \ - $(LIBOBJ)/util/png.o \ - $(LIBOBJ)/util/pool.o \ - $(LIBOBJ)/util/sha1.o \ - $(LIBOBJ)/util/tagmap.o \ - $(LIBOBJ)/util/unicode.o \ - $(LIBOBJ)/util/unzip.o \ - $(LIBOBJ)/util/un7z.o \ - $(LIBOBJ)/util/vbiparse.o \ - $(LIBOBJ)/util/xmlfile.o \ - $(LIBOBJ)/util/zippath.o \ - -$(OBJ)/libutil.a: $(UTILOBJS) - - - -#------------------------------------------------- -# expat library objects -#------------------------------------------------- - -EXPATOBJS = \ - $(LIBOBJ)/expat/xmlparse.o \ - $(LIBOBJ)/expat/xmlrole.o \ - $(LIBOBJ)/expat/xmltok.o - -$(OBJ)/libexpat.a: $(EXPATOBJS) - -$(LIBOBJ)/expat/%.o: $(3RDPARTY)/expat/lib/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -c $< -o $@ - - - -#------------------------------------------------- -# formats library objects -#------------------------------------------------- - -FORMATSOBJS = \ - $(LIBOBJ)/formats/cassimg.o \ - $(LIBOBJ)/formats/flopimg.o \ - $(LIBOBJ)/formats/imageutl.o \ - $(LIBOBJ)/formats/ioprocs.o \ - $(LIBOBJ)/formats/basicdsk.o \ - $(LIBOBJ)/formats/a26_cas.o \ - $(LIBOBJ)/formats/a5105_dsk.o \ - $(LIBOBJ)/formats/abc800_dsk.o \ - $(LIBOBJ)/formats/ace_tap.o \ - $(LIBOBJ)/formats/adam_cas.o \ - $(LIBOBJ)/formats/adam_dsk.o \ - $(LIBOBJ)/formats/ami_dsk.o \ - $(LIBOBJ)/formats/ap2_dsk.o \ - $(LIBOBJ)/formats/apf_apt.o \ - $(LIBOBJ)/formats/apridisk.o \ - $(LIBOBJ)/formats/apollo_dsk.o \ - $(LIBOBJ)/formats/ap_dsk35.o \ - $(LIBOBJ)/formats/applix_dsk.o \ - $(LIBOBJ)/formats/asst128_dsk.o \ - $(LIBOBJ)/formats/atari_dsk.o \ - $(LIBOBJ)/formats/atarist_dsk.o \ - $(LIBOBJ)/formats/atom_tap.o \ - $(LIBOBJ)/formats/bw2_dsk.o \ - $(LIBOBJ)/formats/bw12_dsk.o \ - $(LIBOBJ)/formats/cbm_crt.o \ - $(LIBOBJ)/formats/cbm_tap.o \ - $(LIBOBJ)/formats/ccvf_dsk.o \ - $(LIBOBJ)/formats/cgen_cas.o \ - $(LIBOBJ)/formats/coco_cas.o \ - $(LIBOBJ)/formats/coco_dsk.o \ - $(LIBOBJ)/formats/comx35_dsk.o \ - $(LIBOBJ)/formats/concept_dsk.o \ - $(LIBOBJ)/formats/coupedsk.o \ - $(LIBOBJ)/formats/cpis_dsk.o \ - $(LIBOBJ)/formats/cqm_dsk.o \ - $(LIBOBJ)/formats/csw_cas.o \ - $(LIBOBJ)/formats/d64_dsk.o \ - $(LIBOBJ)/formats/d67_dsk.o \ - $(LIBOBJ)/formats/d71_dsk.o \ - $(LIBOBJ)/formats/d80_dsk.o \ - $(LIBOBJ)/formats/d81_dsk.o \ - $(LIBOBJ)/formats/d82_dsk.o \ - $(LIBOBJ)/formats/d88_dsk.o \ - $(LIBOBJ)/formats/dcp_dsk.o \ - $(LIBOBJ)/formats/dfi_dsk.o \ - $(LIBOBJ)/formats/dim_dsk.o \ - $(LIBOBJ)/formats/dip_dsk.o \ - $(LIBOBJ)/formats/dmk_dsk.o \ - $(LIBOBJ)/formats/dmv_dsk.o \ - $(LIBOBJ)/formats/dsk_dsk.o \ - $(LIBOBJ)/formats/ep64_dsk.o \ - $(LIBOBJ)/formats/esq8_dsk.o \ - $(LIBOBJ)/formats/esq16_dsk.o \ - $(LIBOBJ)/formats/excali64_dsk.o\ - $(LIBOBJ)/formats/fc100_cas.o \ - $(LIBOBJ)/formats/fdi_dsk.o \ - $(LIBOBJ)/formats/fdd_dsk.o \ - $(LIBOBJ)/formats/flex_dsk.o \ - $(LIBOBJ)/formats/fm7_cas.o \ - $(LIBOBJ)/formats/fmsx_cas.o \ - $(LIBOBJ)/formats/fmtowns_dsk.o \ - $(LIBOBJ)/formats/g64_dsk.o \ - $(LIBOBJ)/formats/gtp_cas.o \ - $(LIBOBJ)/formats/hect_dsk.o \ - $(LIBOBJ)/formats/hect_tap.o \ - $(LIBOBJ)/formats/iq151_dsk.o \ - $(LIBOBJ)/formats/imd_dsk.o \ - $(LIBOBJ)/formats/ipf_dsk.o \ - $(LIBOBJ)/formats/kaypro_dsk.o \ - $(LIBOBJ)/formats/kc_cas.o \ - $(LIBOBJ)/formats/kc85_dsk.o \ - $(LIBOBJ)/formats/kim1_cas.o \ - $(LIBOBJ)/formats/lviv_lvt.o \ - $(LIBOBJ)/formats/m20_dsk.o \ - $(LIBOBJ)/formats/m5_dsk.o \ - $(LIBOBJ)/formats/mbee_cas.o \ - $(LIBOBJ)/formats/mm_dsk.o \ - $(LIBOBJ)/formats/msx_dsk.o \ - $(LIBOBJ)/formats/mfi_dsk.o \ - $(LIBOBJ)/formats/mz_cas.o \ - $(LIBOBJ)/formats/nanos_dsk.o \ - $(LIBOBJ)/formats/naslite_dsk.o \ - $(LIBOBJ)/formats/nes_dsk.o \ - $(LIBOBJ)/formats/nfd_dsk.o \ - $(LIBOBJ)/formats/orao_cas.o \ - $(LIBOBJ)/formats/oric_dsk.o \ - $(LIBOBJ)/formats/oric_tap.o \ - $(LIBOBJ)/formats/p6001_cas.o \ - $(LIBOBJ)/formats/pasti_dsk.o \ - $(LIBOBJ)/formats/pc_dsk.o \ - $(LIBOBJ)/formats/pc98_dsk.o \ - $(LIBOBJ)/formats/pc98fdi_dsk.o \ - $(LIBOBJ)/formats/phc25_cas.o \ - $(LIBOBJ)/formats/pmd_cas.o \ - $(LIBOBJ)/formats/primoptp.o \ - $(LIBOBJ)/formats/pyldin_dsk.o \ - $(LIBOBJ)/formats/ql_dsk.o \ - $(LIBOBJ)/formats/rk_cas.o \ - $(LIBOBJ)/formats/rx50_dsk.o \ - $(LIBOBJ)/formats/sc3000_bit.o \ - $(LIBOBJ)/formats/sf7000_dsk.o \ - $(LIBOBJ)/formats/smx_dsk.o \ - $(LIBOBJ)/formats/sol_cas.o \ - $(LIBOBJ)/formats/sorc_dsk.o \ - $(LIBOBJ)/formats/sorc_cas.o \ - $(LIBOBJ)/formats/sord_cas.o \ - $(LIBOBJ)/formats/spc1000_cas.o \ - $(LIBOBJ)/formats/st_dsk.o \ - $(LIBOBJ)/formats/svi_cas.o \ - $(LIBOBJ)/formats/svi_dsk.o \ - $(LIBOBJ)/formats/tandy2k_dsk.o \ - $(LIBOBJ)/formats/td0_dsk.o \ - $(LIBOBJ)/formats/thom_cas.o \ - $(LIBOBJ)/formats/thom_dsk.o \ - $(LIBOBJ)/formats/ti99_dsk.o \ - $(LIBOBJ)/formats/tiki100_dsk.o \ - $(LIBOBJ)/formats/trd_dsk.o \ - $(LIBOBJ)/formats/trs_cas.o \ - $(LIBOBJ)/formats/trs_dsk.o \ - $(LIBOBJ)/formats/tvc_cas.o \ - $(LIBOBJ)/formats/tvc_dsk.o \ - $(LIBOBJ)/formats/tzx_cas.o \ - $(LIBOBJ)/formats/uef_cas.o \ - $(LIBOBJ)/formats/upd765_dsk.o \ - $(LIBOBJ)/formats/victor9k_dsk.o\ - $(LIBOBJ)/formats/vg5k_cas.o \ - $(LIBOBJ)/formats/vt_cas.o \ - $(LIBOBJ)/formats/vt_dsk.o \ - $(LIBOBJ)/formats/vtech1_dsk.o \ - $(LIBOBJ)/formats/wavfile.o \ - $(LIBOBJ)/formats/wd177x_dsk.o \ - $(LIBOBJ)/formats/x07_cas.o \ - $(LIBOBJ)/formats/x1_tap.o \ - $(LIBOBJ)/formats/xdf_dsk.o \ - $(LIBOBJ)/formats/z80ne_dsk.o \ - $(LIBOBJ)/formats/zx81_p.o \ - $(LIBOBJ)/formats/hxcmfm_dsk.o \ - $(LIBOBJ)/formats/itt3030_dsk.o \ - -$(OBJ)/libformats.a: $(FORMATSOBJS) - - - -#------------------------------------------------- -# zlib library objects -#------------------------------------------------- - -ifdef DEBUG -ZLIBOPTS=-Dverbose=-1 -endif - -ZLIBOPTS += -DZLIB_CONST -Wno-strict-prototypes - -ZLIBOBJS = \ - $(LIBOBJ)/zlib/adler32.o \ - $(LIBOBJ)/zlib/compress.o \ - $(LIBOBJ)/zlib/crc32.o \ - $(LIBOBJ)/zlib/deflate.o \ - $(LIBOBJ)/zlib/inffast.o \ - $(LIBOBJ)/zlib/inflate.o \ - $(LIBOBJ)/zlib/infback.o \ - $(LIBOBJ)/zlib/inftrees.o \ - $(LIBOBJ)/zlib/trees.o \ - $(LIBOBJ)/zlib/uncompr.o \ - $(LIBOBJ)/zlib/zutil.o - - - -$(OBJ)/libz.a: $(ZLIBOBJS) - -$(LIBOBJ)/zlib/%.o: $(3RDPARTY)/zlib/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) $(ZLIBOPTS) -c $< -o $@ - - - -#------------------------------------------------- -# SoftFloat library objects -#------------------------------------------------- - -PROCESSOR_H = $(3RDPARTY)/softfloat/processors/mamesf.h -SOFTFLOAT_MACROS = $(3RDPARTY)/softfloat/softfloat/bits64/softfloat-macros - -SOFTFLOATOBJS = \ - $(LIBOBJ)/softfloat/softfloat.o \ - $(LIBOBJ)/softfloat/fsincos.o \ - $(LIBOBJ)/softfloat/fyl2x.o - -$(OBJ)/libsoftfloat.a: $(SOFTFLOATOBJS) - -$(LIBOBJ)/softfloat/softfloat.o: $(3RDPARTY)/softfloat/softfloat.c $(3RDPARTY)/softfloat/softfloat.h $(3RDPARTY)/softfloat/softfloat-macros $(3RDPARTY)/softfloat/softfloat-specialize -$(LIBOBJ)/softfloat/fsincos.o: $(3RDPARTY)/softfloat/fsincos.c $(3RDPARTY)/softfloat/fpu_constant.h $(3RDPARTY)/softfloat/softfloat.h $(3RDPARTY)/softfloat/softfloat-macros $(3RDPARTY)/softfloat/softfloat-specialize - -$(LIBOBJ)/softfloat/%.o: $(3RDPARTY)/softfloat/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ - -#------------------------------------------------- -# libJPEG library objects -#------------------------------------------------- - -LIBJPEGOBJS= \ - $(LIBOBJ)/libjpeg/jaricom.o \ - $(LIBOBJ)/libjpeg/jcapimin.o \ - $(LIBOBJ)/libjpeg/jcapistd.o \ - $(LIBOBJ)/libjpeg/jcarith.o \ - $(LIBOBJ)/libjpeg/jccoefct.o \ - $(LIBOBJ)/libjpeg/jccolor.o \ - $(LIBOBJ)/libjpeg/jcdctmgr.o \ - $(LIBOBJ)/libjpeg/jchuff.o \ - $(LIBOBJ)/libjpeg/jcinit.o \ - $(LIBOBJ)/libjpeg/jcmainct.o \ - $(LIBOBJ)/libjpeg/jcmarker.o \ - $(LIBOBJ)/libjpeg/jcmaster.o \ - $(LIBOBJ)/libjpeg/jcomapi.o \ - $(LIBOBJ)/libjpeg/jcparam.o \ - $(LIBOBJ)/libjpeg/jcprepct.o \ - $(LIBOBJ)/libjpeg/jcsample.o \ - $(LIBOBJ)/libjpeg/jctrans.o \ - $(LIBOBJ)/libjpeg/jdapimin.o \ - $(LIBOBJ)/libjpeg/jdapistd.o \ - $(LIBOBJ)/libjpeg/jdarith.o \ - $(LIBOBJ)/libjpeg/jdatadst.o \ - $(LIBOBJ)/libjpeg/jdatasrc.o \ - $(LIBOBJ)/libjpeg/jdcoefct.o \ - $(LIBOBJ)/libjpeg/jdcolor.o \ - $(LIBOBJ)/libjpeg/jddctmgr.o \ - $(LIBOBJ)/libjpeg/jdhuff.o \ - $(LIBOBJ)/libjpeg/jdinput.o \ - $(LIBOBJ)/libjpeg/jdmainct.o \ - $(LIBOBJ)/libjpeg/jdmarker.o \ - $(LIBOBJ)/libjpeg/jdmaster.o \ - $(LIBOBJ)/libjpeg/jdmerge.o \ - $(LIBOBJ)/libjpeg/jdpostct.o \ - $(LIBOBJ)/libjpeg/jdsample.o \ - $(LIBOBJ)/libjpeg/jdtrans.o \ - $(LIBOBJ)/libjpeg/jerror.o \ - $(LIBOBJ)/libjpeg/jfdctflt.o \ - $(LIBOBJ)/libjpeg/jfdctfst.o \ - $(LIBOBJ)/libjpeg/jfdctint.o \ - $(LIBOBJ)/libjpeg/jidctflt.o \ - $(LIBOBJ)/libjpeg/jidctfst.o \ - $(LIBOBJ)/libjpeg/jidctint.o \ - $(LIBOBJ)/libjpeg/jquant1.o \ - $(LIBOBJ)/libjpeg/jquant2.o \ - $(LIBOBJ)/libjpeg/jutils.o \ - $(LIBOBJ)/libjpeg/jmemmgr.o \ - $(LIBOBJ)/libjpeg/jmemansi.o \ - -$(OBJ)/libjpeg.a: $(LIBJPEGOBJS) - -$(LIBOBJ)/libjpeg/%.o: $(3RDPARTY)/libjpeg/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -I$(3RDPARTY)/libjpeg -c $< -o $@ - - - -#------------------------------------------------- -# libflac library objects -#------------------------------------------------- - -ifeq ($(TARGETOS),macosx) -ifdef BIGENDIAN -ARCHFLAGS = -DWORDS_BIGENDIAN=1 -else -ARCHFLAGS = -DWORDS_BIGENDIAN=0 -endif -else -ARCHFLAGS = -DWORDS_BIGENDIAN=0 -endif - -FLACOPTS=-DFLAC__NO_ASM -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFLAC__HAS_OGG=0 -Wno-unused-function $(ARCHFLAGS) -O0 -ifdef MSVC_BUILD - # vconv will convert the \" to just a " - FLACOPTS += -DVERSION=\\\"1.2.1\\\" -else - FLACOPTS += -DVERSION=\"1.2.1\" -endif - -LIBFLACOBJS = \ - $(LIBOBJ)/libflac/bitmath.o \ - $(LIBOBJ)/libflac/bitreader.o \ - $(LIBOBJ)/libflac/bitwriter.o \ - $(LIBOBJ)/libflac/cpu.o \ - $(LIBOBJ)/libflac/crc.o \ - $(LIBOBJ)/libflac/fixed.o \ - $(LIBOBJ)/libflac/float.o \ - $(LIBOBJ)/libflac/format.o \ - $(LIBOBJ)/libflac/lpc.o \ - $(LIBOBJ)/libflac/md5.o \ - $(LIBOBJ)/libflac/memory.o \ - $(LIBOBJ)/libflac/stream_decoder.o \ - $(LIBOBJ)/libflac/stream_encoder.o \ - $(LIBOBJ)/libflac/stream_encoder_framing.o \ - $(LIBOBJ)/libflac/window.o - -$(OBJ)/libflac.a: $(LIBFLACOBJS) - -$(LIBOBJ)/libflac/%.o: $(3RDPARTY)/libflac/src/libFLAC/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CONLYFLAGS) $(CCOMFLAGS) $(FLACOPTS) -I$(3RDPARTY)/libflac/include -I$(3RDPARTY)/libflac/src/libFLAC/include -c $< -o $@ - - - -#------------------------------------------------- -# lib7z library objects -#------------------------------------------------- - -7ZOPTS=-D_7ZIP_PPMD_SUPPPORT -D_7ZIP_ST - -LIB7ZOBJS = \ - $(LIBOBJ)/lib7z/7zBuf.o \ - $(LIBOBJ)/lib7z/7zBuf2.o \ - $(LIBOBJ)/lib7z/7zCrc.o \ - $(LIBOBJ)/lib7z/7zCrcOpt.o \ - $(LIBOBJ)/lib7z/7zDec.o \ - $(LIBOBJ)/lib7z/7zIn.o \ - $(LIBOBJ)/lib7z/CpuArch.o \ - $(LIBOBJ)/lib7z/LzmaDec.o \ - $(LIBOBJ)/lib7z/Lzma2Dec.o \ - $(LIBOBJ)/lib7z/LzmaEnc.o \ - $(LIBOBJ)/lib7z/Lzma2Enc.o \ - $(LIBOBJ)/lib7z/LzFind.o \ - $(LIBOBJ)/lib7z/Bra.o \ - $(LIBOBJ)/lib7z/Bra86.o \ - $(LIBOBJ)/lib7z/Bcj2.o \ - $(LIBOBJ)/lib7z/Ppmd7.o \ - $(LIBOBJ)/lib7z/Ppmd7Dec.o \ - $(LIBOBJ)/lib7z/7zStream.o \ - -$(OBJ)/lib7z.a: $(LIB7ZOBJS) - -$(LIBOBJ)/lib7z/%.o: $(3RDPARTY)/lzma/C/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(7ZOPTS) $(CCOMFLAGS) $(CONLYFLAGS) -I$(3RDPARTY)/lzma/C -c $< -o $@ - -#------------------------------------------------- -# portmidi library objects -#------------------------------------------------- - -PMOPTS = - -# common objects -LIBPMOBJS = \ - $(LIBOBJ)/portmidi/pm_common/portmidi.o \ - $(LIBOBJ)/portmidi/pm_common/pmutil.o \ - $(LIBOBJ)/portmidi/porttime/porttime.o \ - -ifeq ($(TARGETOS),linux) -PMOPTS = -DPMALSA=1 - -LIBPMOBJS += \ - $(LIBOBJ)/portmidi/pm_linux/pmlinux.o \ - $(LIBOBJ)/portmidi/pm_linux/pmlinuxalsa.o \ - $(LIBOBJ)/portmidi/pm_linux/finddefault.o \ - $(LIBOBJ)/portmidi/porttime/ptlinux.o -endif - -ifeq ($(TARGETOS),macosx) -LIBPMOBJS += \ - $(LIBOBJ)/portmidi/pm_mac/pmmac.o \ - $(LIBOBJ)/portmidi/pm_mac/pmmacosxcm.o \ - $(LIBOBJ)/portmidi/pm_mac/finddefault.o \ - $(LIBOBJ)/portmidi/pm_mac/readbinaryplist.o \ - $(LIBOBJ)/portmidi/pm_mac/osxsupport.o \ - $(LIBOBJ)/portmidi/porttime/ptmacosx_mach.o -endif - -ifeq ($(TARGETOS),win32) -LIBPMOBJS += \ - $(LIBOBJ)/portmidi/pm_win/pmwin.o \ - $(LIBOBJ)/portmidi/pm_win/pmwinmm.o \ - $(LIBOBJ)/portmidi/porttime/ptwinmm.o -endif - -$(OBJ)/libportmidi.a: $(LIBPMOBJS) - -$(LIBOBJ)/portmidi/%.o: $(3RDPARTY)/portmidi/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(PMOPTS) $(CCOMFLAGS) $(CONLYFLAGS) $(INCPATH) -I$(3RDPARTY)/portmidi/pm_common -I$(3RDPARTY)/portmidi/porttime -c $< -o $@ - -ifeq ($(TARGETOS),macosx) -$(LIBOBJ)/portmidi/%.o: $(3RDPARTY)/portmidi/%.m | $(OSPREBUILD) - @echo Objective-C compiling $<... - $(CC) $(CDEFS) $(COBJFLAGS) $(CCOMFLAGS) $(INCPATH) -c $< -o $@ -endif - -#------------------------------------------------- -# LUA library objects -#------------------------------------------------- - -LUAOBJS = \ - $(LIBOBJ)/lua/lapi.o \ - $(LIBOBJ)/lua/lcode.o \ - $(LIBOBJ)/lua/lctype.o \ - $(LIBOBJ)/lua/ldebug.o \ - $(LIBOBJ)/lua/ldo.o \ - $(LIBOBJ)/lua/ldump.o \ - $(LIBOBJ)/lua/lfunc.o \ - $(LIBOBJ)/lua/lgc.o \ - $(LIBOBJ)/lua/llex.o \ - $(LIBOBJ)/lua/lmem.o \ - $(LIBOBJ)/lua/lobject.o \ - $(LIBOBJ)/lua/lopcodes.o \ - $(LIBOBJ)/lua/lparser.o \ - $(LIBOBJ)/lua/lstate.o \ - $(LIBOBJ)/lua/lstring.o \ - $(LIBOBJ)/lua/ltable.o \ - $(LIBOBJ)/lua/ltm.o \ - $(LIBOBJ)/lua/lundump.o \ - $(LIBOBJ)/lua/lvm.o \ - $(LIBOBJ)/lua/lzio.o \ - $(LIBOBJ)/lua/lauxlib.o \ - $(LIBOBJ)/lua/lbaselib.o \ - $(LIBOBJ)/lua/lbitlib.o \ - $(LIBOBJ)/lua/lcorolib.o \ - $(LIBOBJ)/lua/ldblib.o \ - $(LIBOBJ)/lua/liolib.o \ - $(LIBOBJ)/lua/lmathlib.o \ - $(LIBOBJ)/lua/loslib.o \ - $(LIBOBJ)/lua/lstrlib.o \ - $(LIBOBJ)/lua/ltablib.o \ - $(LIBOBJ)/lua/loadlib.o \ - $(LIBOBJ)/lua/linit.o \ - $(LIBOBJ)/lua/lutf8lib.o \ - $(LIBOBJ)/lua/lsqlite3/lsqlite3.o \ - -$(OBJ)/liblua.a: $(LUAOBJS) - -LUA_FLAGS = -ifeq ($(TARGETOS),linux) -LUA_FLAGS += -DLUA_USE_POSIX -endif - -ifeq ($(TARGETOS),macosx) -LUA_FLAGS += -DLUA_USE_POSIX -endif - -$(LIBOBJ)/lua/%.o: $(3RDPARTY)/lua/src/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -DLUA_COMPAT_ALL $(LUA_FLAGS) -c $< -o $@ - -$(LIBOBJ)/lua/lsqlite3/%.o: $(3RDPARTY)/lsqlite3/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -DLUA_COMPAT_ALL -I$(3RDPARTY)/lua/src -I$(3RDPARTY) $(LUA_FLAGS) -c $< -o $@ - -#------------------------------------------------- -# web library objects -#------------------------------------------------- - -WEBOBJS = \ - $(LIBOBJ)/mongoose/mongoose.o \ - $(LIBOBJ)/jsoncpp/json_reader.o \ - $(LIBOBJ)/jsoncpp/json_value.o \ - $(LIBOBJ)/jsoncpp/json_writer.o \ - -$(OBJ)/libweb.a: $(WEBOBJS) - -$(LIBOBJ)/jsoncpp/%.o: $(3RDPARTY)/jsoncpp/src/lib_json/%.cpp | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -I$(3RDPARTY)/jsoncpp/include -c $< -o $@ - -$(LIBOBJ)/mongoose/%.o: $(3RDPARTY)/mongoose/%.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -I$(3RDPARTY)/mongoose -DNS_STACK_SIZE=0 -DMONGOOSE_ENABLE_THREADS -c $< -o $@ - -#------------------------------------------------- -# SQLite3 library objects -#------------------------------------------------- - -SQLITEOBJS = \ - $(LIBOBJ)/sqlite3/sqlite3.o \ - -$(OBJ)/libsqlite3.a: $(SQLITEOBJS) - -SQLITE3_FLAGS = -ifdef SANITIZE -ifneq (,$(findstring thread,$(SANITIZE))) -SQLITE3_FLAGS += -fPIC -endif -ifneq (,$(findstring memory,$(SANITIZE))) -SQLITE3_FLAGS += -fPIC -endif -endif - -ifeq ($(TARGETOS),linux) -LIBS += -ldl -endif - -$(LIBOBJ)/sqlite3/sqlite3.o: $(3RDPARTY)/sqlite3/sqlite3.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -Wno-bad-function-cast -Wno-undef -I$(3RDPARTY)/sqlite3 $(SQLITE3_FLAGS) -c $< -o $@ - -#------------------------------------------------- -# BGFX library objects -#------------------------------------------------- - -BGFXOBJS = \ - $(LIBOBJ)/bgfx/bgfx.o \ - $(LIBOBJ)/bgfx/glcontext_egl.o \ - $(LIBOBJ)/bgfx/glcontext_glx.o \ - $(LIBOBJ)/bgfx/glcontext_ppapi.o \ - $(LIBOBJ)/bgfx/glcontext_wgl.o \ - $(LIBOBJ)/bgfx/image.o \ - $(LIBOBJ)/bgfx/renderer_d3d12.o \ - $(LIBOBJ)/bgfx/renderer_d3d11.o \ - $(LIBOBJ)/bgfx/renderer_d3d9.o \ - $(LIBOBJ)/bgfx/renderer_gl.o \ - $(LIBOBJ)/bgfx/renderer_null.o \ - $(LIBOBJ)/bgfx/renderer_vk.o \ - $(LIBOBJ)/bgfx/renderdoc.o \ - $(LIBOBJ)/bgfx/vertexdecl.o \ - $(LIBOBJ)/bgfx/common/bgfx_utils.o \ - $(LIBOBJ)/bgfx/common/bounds.o \ - $(LIBOBJ)/bgfx/common/camera.o \ - $(LIBOBJ)/bgfx/common/cube_atlas.o \ - $(LIBOBJ)/bgfx/common/font/font_manager.o \ - $(LIBOBJ)/bgfx/common/font/text_buffer_manager.o \ - $(LIBOBJ)/bgfx/common/font/text_metrics.o \ - $(LIBOBJ)/bgfx/common/font/utf8.o \ - $(LIBOBJ)/bgfx/common/imgui/imgui.o \ - $(LIBOBJ)/bgfx/common/nanovg/nanovg.o \ - $(LIBOBJ)/bgfx/common/nanovg/nanovg_bgfx.o \ -# $(LIBOBJ)/bgfx/common/entry/cmd.o \ -# $(LIBOBJ)/bgfx/common/entry/dbg.o \ -# $(LIBOBJ)/bgfx/common/entry/entry.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_android.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_asmjs.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_linux.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_nacl.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_qnx.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_sdl.o \ -# $(LIBOBJ)/bgfx/common/entry/entry_windows.o \ -# $(LIBOBJ)/bgfx/common/entry/input.o \ - -ifeq ($(TARGETOS),macosx) - BGFXOBJS += $(LIBOBJ)/bgfx/glcontext_eagl.o - BGFXOBJS += $(LIBOBJ)/bgfx/glcontext_nsgl.o -endif - -$(OBJ)/libbgfx.a: $(BGFXOBJS) - -BGFXINC = -I$(3RDPARTY)/bgfx/include -I$(3RDPARTY)/bgfx/3rdparty -I$(3RDPARTY)/bx/include -I$(3RDPARTY)/bgfx/3rdparty/khronos -ifdef MSVC_BUILD - BGFXINC += -I$(3RDPARTY)/bx/include/compat/msvc /EHsc -else - ifeq ($(TARGETOS),win32) - BGFXINC += -I$(3RDPARTY)/bx/include/compat/mingw - ifeq ($(PTR64),1) - BGFXINC += -L$(3RDPARTY)/dxsdk/lib/x64 -D_WIN32_WINNT=0x601 - else - BGFXINC += -L$(3RDPARTY)/dxsdk/lib/x86 -D_WIN32_WINNT=0x601 - endif - endif - ifeq ($(TARGETOS),freebsd) - BGFXINC += -I$(3RDPARTY)/bx/include/compat/freebsd - endif - ifeq ($(TARGETOS),macosx) - BGFXINC += -I$(3RDPARTY)/bx/include/compat/osx - endif -endif - -ifeq ($(TARGETOS),win32) -BGFXINC += -I$(3RDPARTY)/dxsdk/Include -endif - -$(LIBOBJ)/bgfx/%.o: $(3RDPARTY)/bgfx/src/%.cpp | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(BGFXINC) -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -c $< -o $@ - -$(LIBOBJ)/bgfx/common/%.o: $(3RDPARTY)/bgfx/examples/common/%.cpp | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CCOMFLAGS) $(BGFXINC) -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -c $< -o $@ - -ifeq ($(TARGETOS),macosx) -$(LIBOBJ)/bgfx/%.o: $(3RDPARTY)/bgfx/src/%.mm | $(OSPREBUILD) - @echo Objective-C compiling $<... - $(CC) $(CDEFS) $(COBJFLAGS) $(CCOMFLAGS) $(BGFXINC) -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -c $< -o $@ - -endif diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c index 8b51a0c9380..591a17647eb 100644 --- a/src/mame/audio/dcs.c +++ b/src/mame/audio/dcs.c @@ -927,6 +927,7 @@ void dcs2_audio_device::device_start() if (m_dram_in_mb != 0) { m_sounddata = auto_alloc_array(machine(), UINT16, m_dram_in_mb << (20-1)); + save_pointer(NAME(m_sounddata), m_dram_in_mb << (20-1)); m_sounddata_words = (m_dram_in_mb << 20) / 2; } else diff --git a/src/mame/audio/hng64.c b/src/mame/audio/hng64.c index 2cc54a21ed2..796fa4e1901 100644 --- a/src/mame/audio/hng64.c +++ b/src/mame/audio/hng64.c @@ -191,95 +191,24 @@ ADDRESS_MAP_END WRITE16_MEMBER(hng64_state::hng64_sound_port_0008_w) { -// logerror("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask); +// logerror("hng64_sound_port_0008_w %04x %04x\n", data, mem_mask); // seems to one or more of the DMARQ on the V53, writes here when it expects DMA channel 3 to transfer ~0x20 bytes just after startup - + printf("transfer\n"); m_audiocpu->dreq3_w(data&1); -// m_audiocpu->hack_w(1); +// m_audiocpu->hack_w(1); } -READ16_MEMBER(hng64_state::hng64_sound_port_0004_r) -{ - // it writes the channel select before reading this.. so either it works on channels, or the command.. - // read in irq5 - printf("%08x: hng64_sound_port_0004_r mask (%04x) chn %04x\n", space.device().safe_pc(), mem_mask, m_audiochannel); - return rand(); -} - -READ16_MEMBER(hng64_state::hng64_sound_port_0006_r) -{ - // it writes the channel select before reading this.. so either it works on channels, or the command.. - // read in irq5 - printf("%08x: hng64_sound_port_0006_r mask (%04x) chn %04x\n", space.device().safe_pc(), mem_mask, m_audiochannel); - return rand(); -} READ16_MEMBER(hng64_state::hng64_sound_port_0008_r) { // read in irq5 logerror("%08x: hng64_sound_port_0008_r mask (%04x)\n", space.device().safe_pc(), mem_mask); - return rand(); -} - -WRITE16_MEMBER(hng64_state::hng64_sound_select_w) -{ - // I'm guessing these addresses are the sound chip / DSP? - - // ---- ---- 000c cccc - // c = channel - - if (data & 0x00e0) printf("hng64_sound_select_w unknown channel %02x\n", data & 0x00ff); - - UINT8 command = data >> 8; - - switch (command) - { - case 0x00: - case 0x01: - case 0x02: - case 0x03: // 00003fffffff (startup only?) - case 0x04: // doesn't use 6 - case 0x05: // 00003fffffff (mostly, often) - case 0x06: // 00007ff0ffff mostly - case 0x07: // 0000000f0708 etc. (low values) - case 0x08: // doesn't write to 2/4/6 with this set?? - case 0x09: // doesn't write to 2/4/6 with this set?? - case 0x0a: // random looking values - - break; - - default: - printf("hng64_sound_select_w unrecognized command %02x\n", command); - break; - } - - COMBINE_DATA(&m_audiochannel); -} - -WRITE16_MEMBER(hng64_state::hng64_sound_data_02_w) -{ - m_audiodat[m_audiochannel].dat[2] = data; - -// if ((m_audiochannel & 0xff00) == 0x0a00) -// printf("write port 0x0002 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]); + return 0; } -WRITE16_MEMBER(hng64_state::hng64_sound_data_04_w) -{ - m_audiodat[m_audiochannel].dat[1] = data; -// if ((m_audiochannel & 0xff00) == 0x0a00) -// printf("write port 0x0004 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]); -} -WRITE16_MEMBER(hng64_state::hng64_sound_data_06_w) -{ - m_audiodat[m_audiochannel].dat[0] = data; - -// if ((m_audiochannel & 0xff00) == 0x0a00) -// printf("write port 0x0006 chansel %04x data %04x (%04x%04x%04x)\n", m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]); -} // but why not just use the V33/V53 XA mode?? WRITE16_MEMBER(hng64_state::hng64_sound_bank_w) @@ -325,63 +254,57 @@ WRITE16_MEMBER(hng64_state::hng64_sound_port_000c_w) } -WRITE16_MEMBER(hng64_state::hng64_sound_port_0102_w) -{ - logerror("hng64_port 0x0102 %04x\n", data); -} - WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w) { logerror("hng64_port 0x0080 %04x\n", data); } -READ16_MEMBER(hng64_state::hng64_sound_port_0106_r) -{ - // read in irq5 - logerror("%08x: hng64_sound_port_0106_r mask (%04x)\n", space.device().safe_pc(), mem_mask); - return rand(); -} - -WRITE16_MEMBER(hng64_state::hng64_sound_port_010a_w) -{ - logerror("%08x: hng64_port hng64_sound_port_010a_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); -} - -WRITE16_MEMBER(hng64_state::hng64_sound_port_0108_w) -{ - logerror("%08x: hng64_port hng64_sound_port_0108_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); -} - -WRITE16_MEMBER(hng64_state::hng64_sound_port_0100_w) +WRITE16_MEMBER(hng64_state::sound_comms_w) { - logerror("%08x: hng64_port hng64_sound_port_0100_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); + switch(offset*2) + { + case 0x0: + COMBINE_DATA(&sound_latch[0]); + return; + case 0x2: + COMBINE_DATA(&sound_latch[1]); + return; + case 0xa: + /* correct? */ + m_audiocpu->set_input_line(5, CLEAR_LINE); + if(data) + printf("IRQ ACK %02x?\n",data); + return; + } + + printf("SOUND W %02x %04x\n",offset*2,data); } -READ16_MEMBER(hng64_state::hng64_sound_port_0104_r) +READ16_MEMBER(hng64_state::sound_comms_r) { - // read in irq5 - logerror("%08x: hng64_sound_port_0104_r mask (%04x)\n", space.device().safe_pc(), mem_mask); - return rand(); + switch(offset*2) + { + case 0x04: + return main_latch[0]; + case 0x06: + return main_latch[1]; + } + printf("SOUND R %02x\n",offset*2); + + return 0; } static ADDRESS_MAP_START( hng_sound_io, AS_IO, 16, hng64_state ) - AM_RANGE(0x0000, 0x0001) AM_WRITE( hng64_sound_select_w ) - AM_RANGE(0x0002, 0x0003) AM_WRITE( hng64_sound_data_02_w ) - AM_RANGE(0x0004, 0x0005) AM_READWRITE( hng64_sound_port_0004_r, hng64_sound_data_04_w ) - AM_RANGE(0x0006, 0x0007) AM_READWRITE( hng64_sound_port_0006_r, hng64_sound_data_06_w ) + AM_RANGE(0x0000, 0x0007) AM_DEVREADWRITE("l7a1045", l7a1045_sound_device, l7a1045_sound_r, l7a1045_sound_w ) + AM_RANGE(0x0008, 0x0009) AM_READWRITE( hng64_sound_port_0008_r, hng64_sound_port_0008_w ) AM_RANGE(0x000a, 0x000b) AM_WRITE( hng64_sound_port_000a_w ) AM_RANGE(0x000c, 0x000d) AM_WRITE( hng64_sound_port_000c_w ) AM_RANGE(0x0080, 0x0081) AM_WRITE( hng64_sound_port_0080_w ) - AM_RANGE(0x0100, 0x0101) AM_WRITE( hng64_sound_port_0100_w ) - AM_RANGE(0x0102, 0x0103) AM_WRITE( hng64_sound_port_0102_w ) // gets values of 0x0080 / 0x0081 / 0x0000 / 0x0001 depending on return from 0x0106 in irq5? - AM_RANGE(0x0104, 0x0105) AM_READ( hng64_sound_port_0104_r ) - AM_RANGE(0x0106, 0x0107) AM_READ( hng64_sound_port_0106_r ) - AM_RANGE(0x0108, 0x0109) AM_WRITE( hng64_sound_port_0108_w ) - AM_RANGE(0x010a, 0x010b) AM_WRITE( hng64_sound_port_010a_w ) + AM_RANGE(0x0100, 0x010f) AM_READWRITE( sound_comms_r,sound_comms_w ) AM_RANGE(0x0200, 0x021f) AM_WRITE( hng64_sound_bank_w ) // ?? @@ -414,20 +337,41 @@ WRITE_LINE_MEMBER(hng64_state::tcu_tm0_cb) WRITE_LINE_MEMBER(hng64_state::tcu_tm1_cb) { // these are very active, maybe they feed back into the v53 via one of the IRQ pins? TM2 toggles more rapidly than TM1 -// logerror("tcu_tm1_cb %02x\n", state); - m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger +// logerror("tcu_tm1_cb %02x\n", state); + //m_audiocpu->set_input_line(5, state? ASSERT_LINE:CLEAR_LINE); // not accurate, just so we have a trigger + /* Almost likely wrong */ + m_audiocpu->set_input_line(2, state? ASSERT_LINE :CLEAR_LINE); + } WRITE_LINE_MEMBER(hng64_state::tcu_tm2_cb) { // these are very active, maybe they feed back into the v53 via one of the IRQ pins? TM2 toggles more rapidly than TM1 -// logerror("tcu_tm2_cb %02x\n", state); +// logerror("tcu_tm2_cb %02x\n", state); // NOT ACCURATE, just so that all the interrupts get triggered for now. - static int i = 0; - m_audiocpu->set_input_line(i, state? ASSERT_LINE:CLEAR_LINE); - i++; - if (i == 3) i = 0; + #if 0 + static int i; + if(machine().input().code_pressed_once(KEYCODE_Z)) + i++; + + if(machine().input().code_pressed_once(KEYCODE_X)) + i--; + + if(i < 0) + i = 0; + if(i > 7) + i = 7; + + printf("trigger %02x %d\n",i,state); + + //if(machine().input().code_pressed_once(KEYCODE_C)) + { + m_audiocpu->set_input_line(i, state? ASSERT_LINE :CLEAR_LINE); + } + //i++; + //if (i == 3) i = 0; + #endif } @@ -444,6 +388,10 @@ MACHINE_CONFIG_FRAGMENT( hng64_audio ) MCFG_V53_TCU_OUT1_HANDLER(WRITELINE(hng64_state, tcu_tm1_cb)) MCFG_V53_TCU_OUT2_HANDLER(WRITELINE(hng64_state, tcu_tm2_cb)) -MACHINE_CONFIG_END + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - + MCFG_SOUND_ADD("l7a1045", L7A1045, 16000000 ) // ?? + MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(0, "rspeaker", 1.0) + +MACHINE_CONFIG_END diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c index 4704d27ce10..295b924d51d 100644 --- a/src/mame/drivers/argus.c +++ b/src/mame/drivers/argus.c @@ -548,7 +548,7 @@ static MACHINE_CONFIG_START( argus, argus_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", argus) MCFG_PALETTE_ADD("palette", 896) - + MCFG_DEVICE_ADD("blend", JALECO_BLEND, 0) MCFG_VIDEO_START_OVERRIDE(argus_state,argus) @@ -594,7 +594,7 @@ static MACHINE_CONFIG_START( valtric, argus_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", valtric) MCFG_PALETTE_ADD("palette", 768) - + MCFG_DEVICE_ADD("blend", JALECO_BLEND, 0) MCFG_VIDEO_START_OVERRIDE(argus_state,valtric) @@ -640,7 +640,7 @@ static MACHINE_CONFIG_START( butasan, argus_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", butasan) MCFG_PALETTE_ADD("palette", 768) - + MCFG_DEVICE_ADD("blend", JALECO_BLEND, 0) MCFG_VIDEO_START_OVERRIDE(argus_state,butasan) diff --git a/src/mame/drivers/astrcorp.c b/src/mame/drivers/astrcorp.c index 8ee006d0f17..3c02d436ebd 100644 --- a/src/mame/drivers/astrcorp.c +++ b/src/mame/drivers/astrcorp.c @@ -1159,130 +1159,130 @@ DRIVER_INIT_MEMBER(astrocorp_state,astoneag) for (i = 0x25100/2; i < 0x25200/2; i++) { x = 0x0000; - if ( (i & 0x0001) ) x |= 0x0200; - if ( (i & 0x0004) && !(i & 0x0001) ) x |= 0x0080; - if ( (i & 0x0040) || (i & 0x0001) ) x |= 0x0040; - if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0020; - if ( !(i & 0x0020) || (i & 0x0001) ) x |= 0x0010; - if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0008; - if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0004; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0002; - if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0001; + if ( (i & 0x0001) ) x |= 0x0200; + if ( (i & 0x0004) && !(i & 0x0001) ) x |= 0x0080; + if ( (i & 0x0040) || (i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0020) || (i & 0x0001) ) x |= 0x0010; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0004; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0001; rom[i] ^= x; } /* - for (i = 0x25300/2; i < 0x25400/2; i++) - { - x = 0x1300; - rom[i] ^= x; - } + for (i = 0x25300/2; i < 0x25400/2; i++) + { + x = 0x1300; + rom[i] ^= x; + } */ for (i = 0x25400/2; i < 0x25500/2; i++) { x = 0x4200; - if ( (i & 0x0001) ) x |= 0x0400; - if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0080; - if ( !(i & 0x0010) || (i & 0x0001) ) x |= 0x0040; - if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0020; - if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0004; - if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; - if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0001; + if ( (i & 0x0001) ) x |= 0x0400; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0080; + if ( !(i & 0x0010) || (i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0001; rom[i] ^= x; } for (i = 0x25500/2; i < 0x25600/2; i++) { x = 0x4200; - if ( (i & 0x0001) ) x |= 0x0400; - if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0080; - if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0040; - if ( !(i & 0x0002) && !(i & 0x0001) ) x |= 0x0020; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0010; - if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0008; - if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0004; - if ( (i & 0x0004) && !(i & 0x0001) ) x |= 0x0002; - if ( (i & 0x0001) ) x |= 0x0001; + if ( (i & 0x0001) ) x |= 0x0400; + if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0080; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0040; + if ( !(i & 0x0002) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0010; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0004) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0001) ) x |= 0x0001; rom[i] ^= x; } /* - for (i = 0x25700/2; i < 0x25800/2; i++) - { - x = 0x6800; - if ( !(i & 0x0001) ) x |= 0x8000; + for (i = 0x25700/2; i < 0x25800/2; i++) + { + x = 0x6800; + if ( !(i & 0x0001) ) x |= 0x8000; - if ( !(i & 0x0040) || ((i & 0x0001) || !(i & 0x0001)) ) x |= 0x0100; + if ( !(i & 0x0040) || ((i & 0x0001) || !(i & 0x0001)) ) x |= 0x0100; - rom[i] ^= x; - } + rom[i] ^= x; + } */ for (i = 0x25800/2; i < 0x25900/2; i++) { x = 0x8300; - if ( (i & 0x0040) || (i & 0x0001) ) x |= 0x2000; - if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0080; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0040; - if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0020; - if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0008; - if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0004; - if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0001; + if ( (i & 0x0040) || (i & 0x0001) ) x |= 0x2000; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0080; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0010) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0001; rom[i] ^= x; } -// for (i = 0x25900/2; i < 0x25a00/2; i++) +// for (i = 0x25900/2; i < 0x25a00/2; i++) for (i = 0x25c00/2; i < 0x25d00/2; i++) { // changed from 25400 -// x = 0x4200; +// x = 0x4200; x = 0x4000; -// if ( (i & 0x0001) ) x |= 0x0400; - if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0080; - if ( !(i & 0x0010) || (i & 0x0001) ) x |= 0x0040; - if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0020; - if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0004; - if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; - if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0001; +// if ( (i & 0x0001) ) x |= 0x0400; + if ( (i & 0x0020) && !(i & 0x0001) ) x |= 0x0080; + if ( !(i & 0x0010) || (i & 0x0001) ) x |= 0x0040; + if ( (i & 0x0040) && !(i & 0x0001) ) x |= 0x0020; + if ( !(i & 0x0004) || (i & 0x0001) ) x |= 0x0010; + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0004; + if ( (i & 0x0008) && !(i & 0x0001) ) x |= 0x0002; + if ( (i & 0x0002) || (i & 0x0001) ) x |= 0x0001; rom[i] ^= x; } /* - for (i = 0x25d00/2; i < 0x25e00/2; i++) - { - x = 0x4000; - if ( !(i & 0x0040) ) x |= 0x0800; - - if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0100; // almost!! - - if ( ((i & 0x0040)&&((i & 0x0020)||(i & 0x0010))) || !(i & 0x0001) ) x |= 0x0200; // almost!! - if ( (!(i & 0x0040) || !(i & 0x0008)) && !(i & 0x0001) ) x |= 0x0008; - if ( (i & 0x0040) || !(i & 0x0020) || (i & 0x0001) ) x |= 0x0001; // almost!! - rom[i] ^= x; - } + for (i = 0x25d00/2; i < 0x25e00/2; i++) + { + x = 0x4000; + if ( !(i & 0x0040) ) x |= 0x0800; + + if ( !(i & 0x0040) && !(i & 0x0001) ) x |= 0x0100; // almost!! + + if ( ((i & 0x0040)&&((i & 0x0020)||(i & 0x0010))) || !(i & 0x0001) ) x |= 0x0200; // almost!! + if ( (!(i & 0x0040) || !(i & 0x0008)) && !(i & 0x0001) ) x |= 0x0008; + if ( (i & 0x0040) || !(i & 0x0020) || (i & 0x0001) ) x |= 0x0001; // almost!! + rom[i] ^= x; + } */ /* - for (i = 0x25e00/2; i < 0x25f00/2; i++) - { - x = 0xa600; + for (i = 0x25e00/2; i < 0x25f00/2; i++) + { + x = 0xa600; - if ( (i & 0x0040) && (i & 0x0001) ) x |= 0x4000; - if ( (i & 0x0040) && (i & 0x0001) ) x |= 0x0800; - if ( !(i & 0x0001) ) x |= 0x0100; + if ( (i & 0x0040) && (i & 0x0001) ) x |= 0x4000; + if ( (i & 0x0040) && (i & 0x0001) ) x |= 0x0800; + if ( !(i & 0x0001) ) x |= 0x0100; - if ( ( (i & 0x0040) && (i & 0x0008) && !(i & 0x0001)) || - ( !(i & 0x0040) && ((i & 0x0004) ^ (i & 0x0002)) && !(i & 0x0001) ) ) x |= 0x0002; // almost!! + if ( ( (i & 0x0040) && (i & 0x0008) && !(i & 0x0001)) || + ( !(i & 0x0040) && ((i & 0x0004) ^ (i & 0x0002)) && !(i & 0x0001) ) ) x |= 0x0002; // almost!! - if ( !(i & 0x0040) || !(i & 0x0002) || (i & 0x0001) ) x |= 0x0001; - rom[i] ^= x; - } + if ( !(i & 0x0040) || !(i & 0x0002) || (i & 0x0001) ) x |= 0x0001; + rom[i] ^= x; + } */ for (i = 0x26f00/2; i < 0x27000/2; i++) diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c index 1ac68036d78..bc8b2ce317c 100644 --- a/src/mame/drivers/cabal.c +++ b/src/mame/drivers/cabal.c @@ -475,7 +475,7 @@ static MACHINE_CONFIG_START( cabal, cabal_state ) MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ MCFG_CPU_PROGRAM_MAP(sound_map) - + MCFG_MACHINE_START_OVERRIDE(cabal_state,cabal) /* video hardware */ diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c index 2e23106f9ae..196e48cb9a1 100644 --- a/src/mame/drivers/capbowl.c +++ b/src/mame/drivers/capbowl.c @@ -293,7 +293,7 @@ INPUT_PORTS_END void capbowl_state::machine_start() { m_update_timer = timer_alloc(TIMER_UPDATE); - + save_item(NAME(m_blitter_addr)); save_item(NAME(m_last_trackball_val)); } diff --git a/src/mame/drivers/cocoloco.c b/src/mame/drivers/cocoloco.c index 8932025cc9b..e50969abada 100644 --- a/src/mame/drivers/cocoloco.c +++ b/src/mame/drivers/cocoloco.c @@ -192,21 +192,21 @@ public: required_device<cpu_device> m_maincpu; required_device<palette_device> m_palette; - + UINT8 *m_videoram; UINT8 m_videobank; - + DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(vbank_w); DECLARE_WRITE8_MEMBER(vram_clear_w); DECLARE_WRITE8_MEMBER(coincounter_w); - + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - + virtual void video_start(); DECLARE_PALETTE_INIT(cocoloco); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c index d730dd6640e..f0ea66d2582 100644 --- a/src/mame/drivers/cps2.c +++ b/src/mame/drivers/cps2.c @@ -6787,6 +6787,28 @@ ROM_END ROM_START( spf2t ) ROM_REGION(CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_WORD_SWAP( "pzfe.03", 0x000000, 0x80000, CRC(2af51954) SHA1(51f8797918391e772cf3cc27074ed6ca419806bd) ) + ROM_LOAD16_WORD_SWAP( "pzf.04", 0x080000, 0x80000, CRC(b80649e2) SHA1(5bfccd656aea7ff82e9a20bb5856f4ab99b5a007) ) // marked pzfe.04 but same as pzf.04 + + ROM_REGION( 0xC00000, "gfx", 0 ) + ROM_FILL( 0x000000, 0x800000, 0 ) + ROMX_LOAD( "pzf.14m", 0x800000, 0x100000, CRC(2d4881cb) SHA1(fd3baa183c25bed153b19c251980e2fb761600e2) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "pzf.16m", 0x800002, 0x100000, CRC(4b0fd1be) SHA1(377aafdcdb7a866b1c8487670e3598d8197976e4) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "pzf.18m", 0x800004, 0x100000, CRC(e43aac33) SHA1(d041e0688c3807d3363861a7f216de43b34d846c) , ROM_GROUPWORD | ROM_SKIP(6) ) + ROMX_LOAD( "pzf.20m", 0x800006, 0x100000, CRC(7f536ff1) SHA1(905b9d62ef7bef47297c7f4a4dd697aed6df38a5) , ROM_GROUPWORD | ROM_SKIP(6) ) + + ROM_REGION(QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "pzf.01", 0x00000, 0x08000, CRC(600fb2a3) SHA1(1fab1c2a23bf6ad8309d29ddbbc29435a8aeea13) ) + ROM_CONTINUE( 0x10000, 0x18000 ) + ROM_LOAD( "pzf.02", 0x28000, 0x20000, CRC(496076e0) SHA1(1ee4e135140afd0e8e03231e570cd77d140f6367) ) + + ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */ + ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) ) + ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) ) +ROM_END + +ROM_START( spf2tu ) + ROM_REGION(CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_WORD_SWAP( "pzfu.03a", 0x000000, 0x80000, CRC(346e62ef) SHA1(9db5ea0aac2d459be957f8b6e2e0d18421587d4d) ) ROM_LOAD16_WORD_SWAP( "pzf.04", 0x080000, 0x80000, CRC(b80649e2) SHA1(5bfccd656aea7ff82e9a20bb5856f4ab99b5a007) ) @@ -6807,6 +6829,7 @@ ROM_START( spf2t ) ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) ) ROM_END + ROM_START( spf2xj ) ROM_REGION(CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_WORD_SWAP( "pzfj.03a", 0x000000, 0x80000, CRC(2070554a) SHA1(fa818e6bd2e11667345d3d8f2397b60802ef72f9) ) @@ -8804,7 +8827,8 @@ GAME( 1996, sfz2al, 0, cps2, cps2_2p6b, cps_state, cps2, ROT0, GAME( 1996, sfz2alj, sfz2al, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Japan 960805)", GAME_SUPPORTS_SAVE ) GAME( 1996, sfz2alh, sfz2al, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Hispanic 960813)", GAME_SUPPORTS_SAVE ) GAME( 1996, sfz2alb, sfz2al, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Zero 2 Alpha (Brazil 960813)", GAME_SUPPORTS_SAVE ) -GAME( 1996, spf2t, 0, cps2, cps2_2p2b, cps_state, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2t, 0, cps2, cps2_2p2b, cps_state, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Euro 960529)", GAME_SUPPORTS_SAVE ) +GAME( 1996, spf2tu, spf2t, cps2, cps2_2p2b, cps_state, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", GAME_SUPPORTS_SAVE ) GAME( 1996, spf2xj, spf2t, cps2, cps2_2p2b, cps_state, cps2, ROT0, "Capcom", "Super Puzzle Fighter II X (Japan 960531)", GAME_SUPPORTS_SAVE ) GAME( 1996, spf2ta, spf2t, cps2, cps2_2p2b, cps_state, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Asia 960529)", GAME_SUPPORTS_SAVE ) GAME( 1996, spf2th, spf2t, cps2, cps2_2p2b, cps_state, cps2, ROT0, "Capcom", "Super Puzzle Fighter II Turbo (Hispanic 960531)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 7570f3ea052..a565d8b502c 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -1564,14 +1564,14 @@ static ADDRESS_MAP_START( cdracula_io_map, AS_IO, 8, dynax_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE( 0x01, 0x07 ) AM_WRITE(cdracula_blitter_rev2_w) // Blitter + Destination Layers AM_RANGE( 0x10, 0x10 ) AM_DEVREADWRITE("oki", okim6295_device, read, write) - AM_RANGE( 0x11, 0x11 ) AM_NOP // unpopulated oki + AM_RANGE( 0x11, 0x11 ) AM_NOP // unpopulated oki // AM_RANGE( 0x12, 0x12 ) AM_WRITENOP // CRT Controller // AM_RANGE( 0x13, 0x13 ) AM_WRITENOP // CRT Controller AM_RANGE( 0x20, 0x20 ) AM_READ_PORT("P1") // P1 AM_RANGE( 0x21, 0x21 ) AM_READ_PORT("P2") // P2 AM_RANGE( 0x22, 0x22 ) AM_READ_PORT("COINS") // Coins AM_RANGE( 0x30, 0x30 ) AM_WRITE(dynax_layer_enable_w) // Layers Enable -// AM_RANGE( 0x31, 0x31 ) AM_WRITE(dynax_rombank_w) // BANK ROM Select +// AM_RANGE( 0x31, 0x31 ) AM_WRITE(dynax_rombank_w) // BANK ROM Select AM_RANGE( 0x32, 0x32 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen AM_RANGE( 0x33, 0x33 ) AM_WRITE(dynax_blit_flags_w) // Flags + Do Blit AM_RANGE( 0x34, 0x34 ) AM_WRITE(dynax_blit_palette01_w) // Layers Palettes (Low Bits) @@ -2042,7 +2042,7 @@ static INPUT_PORTS_START( cdracula ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW1") // port $61 -> c217 + PORT_START("DSW1") // port $61 -> c217 PORT_DIPNAME( 0x03, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION( "SW1:1,2" ) PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) // 44 PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) // 47 @@ -2062,9 +2062,9 @@ static INPUT_PORTS_START( cdracula ) PORT_DIPNAME( 0x40, 0x40, "Unknown 1-7" ) PORT_DIPLOCATION( "SW1:7" ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_DIPLOCATION( "SW1:8" ) + PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_DIPLOCATION( "SW1:8" ) - PORT_START("DSW2") // port $60 -> c216 + PORT_START("DSW2") // port $60 -> c216 PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW2:1,2" ) PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) @@ -3190,7 +3190,7 @@ static INPUT_PORTS_START( jantouki ) PORT_DIPSETTING( 0x00, "12:00" ) PORT_DIPNAME( 0x08, 0x00, "Nudity" ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPSETTING( 0x08, DEF_STR( No ) ) // Moles On Gal's Face + PORT_DIPSETTING( 0x08, DEF_STR( No ) ) // Moles On Gal's Face PORT_DIPNAME( 0x10, 0x10, "Buy Screen Bonus Points" ) /* Sets your points to 100 every time you arrive at the screen for buying special items. */ PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -3363,7 +3363,7 @@ static INPUT_PORTS_START( mjembase ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x00, "Nudity" ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPSETTING( 0x80, DEF_STR( No ) ) // Moles On Gal's Face + PORT_DIPSETTING( 0x80, DEF_STR( No ) ) // Moles On Gal's Face PORT_START("FAKE") /* IN10 - Fake DSW */ PORT_DIPNAME( 0xff, 0xff, "Allow Bets" ) @@ -3500,7 +3500,7 @@ static INPUT_PORTS_START( mjelct3 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x00, "Nudity" ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPSETTING( 0x80, DEF_STR( No ) ) // Moles On Gal's Face + PORT_DIPSETTING( 0x80, DEF_STR( No ) ) // Moles On Gal's Face PORT_START("FAKE") /* IN10 - Fake DSW */ PORT_DIPNAME( 0xff, 0xff, "Allow Bets" ) @@ -4354,7 +4354,7 @@ static MACHINE_CONFIG_START( cdracula, dynax_state ) MCFG_MACHINE_START_OVERRIDE(dynax_state,dynax) MCFG_MACHINE_RESET_OVERRIDE(dynax_state,dynax) -// MCFG_NVRAM_ADD_0FILL("nvram") // no battery +// MCFG_NVRAM_ADD_0FILL("nvram") // no battery /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c index f1856cdb40a..804a3228031 100644 --- a/src/mame/drivers/fgoal.c +++ b/src/mame/drivers/fgoal.c @@ -339,7 +339,7 @@ GFXDECODE_END void fgoal_state::machine_start() { m_interrupt_timer = timer_alloc(TIMER_INTERRUPT); - + save_item(NAME(m_xpos)); save_item(NAME(m_ypos)); save_item(NAME(m_current_color)); diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c index bd64e087f4a..4d06d03db9f 100644 --- a/src/mame/drivers/flyball.c +++ b/src/mame/drivers/flyball.c @@ -61,10 +61,10 @@ public: /* misc */ UINT8 m_potmask; UINT8 m_potsense; - + emu_timer *m_pot_clear_timer; emu_timer *m_quarter_timer; - + DECLARE_READ8_MEMBER(input_r); DECLARE_READ8_MEMBER(scanline_r); DECLARE_READ8_MEMBER(potsense_r); @@ -75,17 +75,17 @@ public: DECLARE_WRITE8_MEMBER(pitcher_vert_w); DECLARE_WRITE8_MEMBER(pitcher_horz_w); DECLARE_WRITE8_MEMBER(misc_w); - + TILEMAP_MAPPER_MEMBER(get_memory_offset); TILE_GET_INFO_MEMBER(get_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(flyball); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + TIMER_CALLBACK_MEMBER(joystick_callback); TIMER_CALLBACK_MEMBER(quarter_callback); @@ -428,7 +428,7 @@ void flyball_state::machine_start() for (int i = 0; i < len; i++) buf[i ^ 0x1ff] = ROM[i]; memcpy(ROM, buf, len); - + m_pot_clear_timer = timer_alloc(TIMER_POT_CLEAR); m_quarter_timer = timer_alloc(TIMER_QUARTER); diff --git a/src/mame/drivers/gambl186.c b/src/mame/drivers/gambl186.c index 29ae8501fb2..1873fc1fb02 100644 --- a/src/mame/drivers/gambl186.c +++ b/src/mame/drivers/gambl186.c @@ -20,8 +20,9 @@ U3 Max691cpe U300 Nec D7759GC (10Mhz xtal near it) - -code doesn't make much sense, wrong mapping? bad? +TODO: +- No idea about how to surpass the "No Funzione" (sic) screen. According to the bad settings almost + surely it wants EEPROM hooked up (i/o at 0x680/0x682?) */ @@ -29,6 +30,7 @@ code doesn't make much sense, wrong mapping? bad? #include "emu.h" #include "cpu/i86/i186.h" +#include "video/pc_vga.h" class gambl186_state : public driver_device @@ -38,25 +40,317 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - UINT32 screen_update_gambl186(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) - { - return 0; - } required_device<cpu_device> m_maincpu; + + DECLARE_READ16_MEMBER(unk_r); }; static ADDRESS_MAP_START( gambl186_map, AS_PROGRAM, 16, gambl186_state ) - AM_RANGE(0x80000, 0xfffff) AM_ROM AM_REGION("user1",0) + AM_RANGE(0x00000, 0x0ffff) AM_RAM + AM_RANGE(0x40000, 0x4ffff) AM_ROM AM_REGION("data",0) // TODO: way bigger than this, banked? + AM_RANGE(0xa0000, 0xbffff) AM_DEVREADWRITE8("vga", cirrus_vga_device, mem_r, mem_w, 0xffff) + AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("ipl",0) ADDRESS_MAP_END +READ16_MEMBER(gambl186_state::unk_r) +{ + return machine().rand(); +} + static ADDRESS_MAP_START( gambl186_io, AS_IO, 16, gambl186_state ) + AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", cirrus_vga_device, port_03b0_r, port_03b0_w, 0xffff) + AM_RANGE(0x03c0, 0x03cf) AM_DEVREADWRITE8("vga", cirrus_vga_device, port_03c0_r, port_03c0_w, 0xffff) + AM_RANGE(0x03d0, 0x03df) AM_DEVREADWRITE8("vga", cirrus_vga_device, port_03d0_r, port_03d0_w, 0xffff) + AM_RANGE(0x0400, 0x0401) AM_WRITENOP // sound + AM_RANGE(0x0500, 0x0501) AM_READ_PORT("IN0") + AM_RANGE(0x0502, 0x0503) AM_READ_PORT("IN1") + AM_RANGE(0x0504, 0x0505) AM_READ_PORT("IN2") + + //AM_RANGE(0x0500, 0x050f) AM_READ(unk_r) + AM_RANGE(0x0580, 0x0581) AM_READ_PORT("DSW0") + AM_RANGE(0x0582, 0x0583) AM_READ_PORT("DSW1") + AM_RANGE(0x0584, 0x0585) AM_READ_PORT("DSW2") AM_WRITENOP // ??? + AM_RANGE(0x0600, 0x0603) AM_WRITENOP // lamps + AM_RANGE(0x0680, 0x0683) AM_READ(unk_r) // ??? ADDRESS_MAP_END static INPUT_PORTS_START( gambl186 ) + PORT_START("IN0") + PORT_DIPNAME( 0x01, 0x01, "0-1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_START1 ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("-") // Unknown meaning + + PORT_START("IN1") + PORT_DIPNAME( 0x01, 0x01, "1-1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "1-2" ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_DIPNAME( 0x01, 0x01, "2-1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + /* TODO: order isn't honored */ + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN4 ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN5 ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN6 ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + + PORT_START("DSW0") + PORT_DIPNAME( 0x01, 0x01, "0-1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "0-2" ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, "1-1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "1-2" ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "2-1" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "2-2" ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_SERVICE(0x1000, IP_ACTIVE_LOW ) + + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, "Bookkeeping" ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + INPUT_PORTS_END @@ -66,46 +360,38 @@ static MACHINE_CONFIG_START( gambl186, gambl186_state ) MCFG_CPU_PROGRAM_MAP(gambl186_map) MCFG_CPU_IO_MAP(gambl186_io) - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_SIZE(512, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 255) - MCFG_SCREEN_UPDATE_DRIVER(gambl186_state, screen_update_gambl186) - - MCFG_PALETTE_ADD("palette", 0x100) - + MCFG_FRAGMENT_ADD( pcvideo_cirrus_vga ) MACHINE_CONFIG_END ROM_START( gambl186 ) - ROM_REGION( 0x100000, "user1", 0 ) + ROM_REGION( 0x100000, "data", 0 ) ROM_LOAD16_BYTE( "ie398.u11", 0x00000, 0x80000, CRC(86ad7cab) SHA1(b701c3701db630d218a9b1700f216f795a1b1272) ) ROM_LOAD16_BYTE( "io398.u12", 0x00001, 0x80000, CRC(0a036f34) SHA1(63d0b87c7d4c902413f28c0b55d78e5fda511f4f) ) - ROM_REGION( 0x40000, "vidbios", 0 ) + ROM_REGION( 0x40000, "ipl", 0 ) ROM_LOAD16_BYTE( "se403p.u9", 0x00000, 0x20000, CRC(1021cc20) SHA1(d9bb67676b05458ff813d608431ff06946ab7721) ) ROM_LOAD16_BYTE( "so403p.u10", 0x00001, 0x20000, CRC(af9746c9) SHA1(3f1ab8110cc5eadec661181779799693ad695e21) ) - ROM_REGION( 0x200000, "snd", 0 ) + ROM_REGION( 0x20000, "snd", 0 ) ROM_LOAD( "347.u302", 0x00000, 0x20000, CRC(7ce8f490) SHA1(2f856e31d189e9d46ba6b322133d99133e0b52ac) ) ROM_END ROM_START( gambl186a ) - ROM_REGION( 0x100000, "user1", 0 ) + ROM_REGION( 0x100000, "data", 0 ) ROM_LOAD16_BYTE( "ie399.u11", 0x00000, 0x80000, CRC(2a7bce20) SHA1(fbabaaa0d72b5dfccd33f5194d13009bdc44b5a7) ) ROM_LOAD16_BYTE( "io399.u12", 0x00001, 0x80000, CRC(9212f52b) SHA1(d970c59c1e0f5f7e94c1b632398bcfae278c143d) ) - ROM_REGION( 0x40000, "vidbios", 0 ) + ROM_REGION( 0x40000, "ipl", 0 ) ROM_LOAD16_BYTE( "se403p.u9", 0x00000, 0x20000, CRC(1021cc20) SHA1(d9bb67676b05458ff813d608431ff06946ab7721) ) ROM_LOAD16_BYTE( "so403p.u10", 0x00001, 0x20000, CRC(af9746c9) SHA1(3f1ab8110cc5eadec661181779799693ad695e21) ) - ROM_REGION( 0x200000, "snd", 0 ) - ROM_LOAD( "347.u302", 0x00000, 0x20000, CRC(7ce8f490) SHA1(2f856e31d189e9d46ba6b322133d99133e0b52ac) ) // xxx.u302 + ROM_REGION( 0x20000, "snd", 0 ) + ROM_LOAD( "347.u302", 0x00000, 0x20000, CRC(7ce8f490) SHA1(2f856e31d189e9d46ba6b322133d99133e0b52ac) ) ROM_END -GAME( 199?, gambl186, 0, gambl186, gambl186, driver_device, 0, ROT0, "<unknown>", "unknown 186 based gambling game (V398)", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 1999, gambl186, 0, gambl186, gambl186, driver_device, 0, ROT0, "<unknown>", "unknown 186 based gambling game (V398)", GAME_NOT_WORKING | GAME_NO_SOUND ) GAME( 199?, gambl186a, gambl186, gambl186, gambl186, driver_device, 0, ROT0, "<unknown>", "unknown 186 based gambling game (V399)", GAME_NOT_WORKING | GAME_NO_SOUND ) diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c index f1868c108a5..7daa0f8d626 100644 --- a/src/mame/drivers/goldstar.c +++ b/src/mame/drivers/goldstar.c @@ -2993,8 +2993,8 @@ static INPUT_PORTS_START( ns8linew ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 1C_6C ) ) // manual says 1c/8c - PORT_DIPSETTING( 0x28, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x20, DEF_STR( 1C_6C ) ) // manual says 1c/8c + PORT_DIPSETTING( 0x28, "1 Coin/10 Credits" ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") /* not checked */ PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -3375,12 +3375,12 @@ static INPUT_PORTS_START( bingowng ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) -/* On a W-4 PCB these are used as: "Special Odds-Prohibition Of Winning...(Odds B)" - see DSW2-7 - PORT_DIPNAME( 0x80, 0x00, "Special Odds" ) PORT_DIPLOCATION("DSW1:7,8") - PORT_DIPSETTING( 0x00, "None" ) - PORT_DIPSETTING( 0x40, "x300 (x1000)" ) - PORT_DIPSETTING( 0x80, "x500 (x5000" ) - PORT_DIPSETTING( 0xc0, "x1000 (x10000) +/* On a W-4 PCB these are used as: "Special Odds-Prohibition Of Winning...(Odds B)" - see DSW2-7 + PORT_DIPNAME( 0x80, 0x00, "Special Odds" ) PORT_DIPLOCATION("DSW1:7,8") + PORT_DIPSETTING( 0x00, "None" ) + PORT_DIPSETTING( 0x40, "x300 (x1000)" ) + PORT_DIPSETTING( 0x80, "x500 (x5000" ) + PORT_DIPSETTING( 0xc0, "x1000 (x10000) */ PORT_START("DSW2") @@ -3406,13 +3406,13 @@ static INPUT_PORTS_START( bingowng ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) -/* On a W-4 PCB these are used as: - PORT_DIPNAME( 0x40, 0x40, "Odds" ) PORT_DIPLOCATION("DSW2:7") - PORT_DIPSETTING( 0x40, "Type A" ) - PORT_DIPSETTING( 0x00, "Type B" ) - PORT_DIPNAME( 0x80, 0x80, "Type Of W-Up Game" ) PORT_DIPLOCATION("DSW2:8") - PORT_DIPSETTING( 0x80, "Slots" ) - PORT_DIPSETTING( 0x00, "Big/Small Card" ) +/* On a W-4 PCB these are used as: + PORT_DIPNAME( 0x40, 0x40, "Odds" ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x40, "Type A" ) + PORT_DIPSETTING( 0x00, "Type B" ) + PORT_DIPNAME( 0x80, 0x80, "Type Of W-Up Game" ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x80, "Slots" ) + PORT_DIPSETTING( 0x00, "Big/Small Card" ) */ /* On a W-4 PCB DSW3 & DSW4 are reversed and all dips on DSW4 are set to off! */ @@ -3672,7 +3672,7 @@ static INPUT_PORTS_START( schery97 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Key Out / Attendant") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats") // doesn't work in v352c4 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats") // doesn't work in v352c4 PORT_START("DSW1") PORT_DIPNAME( 0x07, 0x03, "Game Level (Difficulty)" ) PORT_DIPLOCATION("DSW1:1,2,3") /* OK */ @@ -4335,14 +4335,14 @@ static INPUT_PORTS_START( roypok96a ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x00, "Unused - leave off" ) PORT_DIPLOCATION("DSW5:6") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x20, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x00, "Reset Remaining Score To Zero" ) PORT_DIPLOCATION("DSW5:7") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) PORT_DIPNAME( 0x80, 0x00, "Count Game To Issue Ticket" ) PORT_DIPLOCATION("DSW5:8") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) INPUT_PORTS_END @@ -4472,7 +4472,7 @@ static INPUT_PORTS_START( pokonl97 ) PORT_DIPNAME( 0x10, 0x10, "Auto Ticket Dispense" ) PORT_DIPLOCATION("DSW4:5") /* not checked */ PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0xe0, 0xe0, "Ticket Dispense Mode" ) PORT_DIPLOCATION("DSW4:6,7,8") + PORT_DIPNAME( 0xe0, 0xe0, "Ticket Dispense Mode" ) PORT_DIPLOCATION("DSW4:6,7,8") PORT_DIPSETTING( 0xe0, "Continuous" ) PORT_DIPSETTING( 0xc0, "Max 1 Ticket Per Game" ) PORT_DIPSETTING( 0xa0, "Max 2 Ticket Per Game" ) diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c index 805f60d1cae..6b0fddf74d1 100644 --- a/src/mame/drivers/hexion.c +++ b/src/mame/drivers/hexion.c @@ -115,6 +115,7 @@ static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state ) AM_RANGE(0xa000, 0xbfff) AM_RAM AM_RANGE(0xc000, 0xdffe) AM_READWRITE(hexion_bankedram_r, hexion_bankedram_w) AM_RANGE(0xdfff, 0xdfff) AM_WRITE(hexion_bankctrl_w) + AM_RANGE(0xe000, 0xe000) AM_NOP AM_RANGE(0xe800, 0xe87f) AM_DEVREADWRITE("k051649", k051649_device, k051649_waveform_r, k051649_waveform_w) AM_RANGE(0xe880, 0xe889) AM_DEVWRITE("k051649", k051649_device, k051649_frequency_w) AM_RANGE(0xe88a, 0xe88e) AM_DEVWRITE("k051649", k051649_device, k051649_volume_w) @@ -134,7 +135,32 @@ static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state ) AM_RANGE(0xf540, 0xf540) AM_READ(watchdog_reset_r) ADDRESS_MAP_END - +static ADDRESS_MAP_START( hexionb_map, AS_PROGRAM, 8, hexion_state ) + AM_RANGE(0x0000, 0x7fff) AM_ROM + AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") + AM_RANGE(0xa000, 0xbfff) AM_RAM + AM_RANGE(0xc000, 0xdffe) AM_READWRITE(hexion_bankedram_r, hexion_bankedram_w) + AM_RANGE(0xdfff, 0xdfff) AM_WRITE(hexion_bankctrl_w) + AM_RANGE(0xe000, 0xe000) AM_NOP + AM_RANGE(0xe800, 0xe87f) AM_NOP // all the code to use the k051649 is still present + AM_RANGE(0xe880, 0xe889) AM_NOP // but the bootleg has an additional M6295 @ 0xf5c0 instead + AM_RANGE(0xe88a, 0xe88e) AM_NOP + AM_RANGE(0xe88f, 0xe88f) AM_NOP + AM_RANGE(0xe8e0, 0xe8ff) AM_NOP + AM_RANGE(0xf000, 0xf00f) AM_DEVREADWRITE("k053252", k053252_device, read, write) + AM_RANGE(0xf200, 0xf200) AM_DEVWRITE("oki", okim6295_device, write) + AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW1") + AM_RANGE(0xf401, 0xf401) AM_READ_PORT("DSW2") + AM_RANGE(0xf402, 0xf402) AM_READ_PORT("P1") + AM_RANGE(0xf403, 0xf403) AM_READ_PORT("P2") + AM_RANGE(0xf440, 0xf440) AM_READ_PORT("DSW3") + AM_RANGE(0xf441, 0xf441) AM_READ_PORT("SYSTEM") + AM_RANGE(0xf480, 0xf480) AM_WRITE(hexion_bankswitch_w) + AM_RANGE(0xf4c0, 0xf4c0) AM_WRITE(coincntr_w) + AM_RANGE(0xf500, 0xf500) AM_WRITE(hexion_gfxrom_select_w) + AM_RANGE(0xf540, 0xf540) AM_READ(watchdog_reset_r) + AM_RANGE(0xf5c0, 0xf5c0) AM_DEVWRITE("oki2", okim6295_device, write) +ADDRESS_MAP_END static INPUT_PORTS_START( hexion ) PORT_START("DSW1") @@ -240,6 +266,15 @@ static MACHINE_CONFIG_START( hexion, hexion_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( hexionb, hexion ) + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_PROGRAM_MAP(hexionb_map) + + MCFG_DEVICE_REMOVE("k051649") + + MCFG_OKIM6295_ADD("oki2", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) +MACHINE_CONFIG_END /*************************************************************************** @@ -266,5 +301,27 @@ ROM_START( hexion ) ROM_LOAD( "122a02.13b", 0x0200, 0x0100, CRC(5734305c) SHA1(c72e59acf79a4db1a5a9d827eef899c0675336f2) ) ROM_END +ROM_START( hexionb ) + ROM_REGION( 0x34800, "maincpu", 0 ) /* ROMs + space for additional RAM */ + ROM_LOAD( "hexionb.u2", 0x00000, 0x20000, CRC(93edc5d4) SHA1(d14c5be85a67eebddda9103bdf19de8c3c05d3af) ) + ROM_RELOAD( 0x10000, 0x20000 ) /* banked at 8000-9fff */ + + ROM_REGION( 0x80000, "gfx1", 0 ) /* addressable by the main CPU */ + ROM_LOAD( "hexionb.u30", 0x00000, 0x40000, CRC(22ae55e3) SHA1(41bdc990f69416b639542e2186a3610c16389063) ) + ROM_LOAD( "hexionb.u29", 0x40000, 0x40000, CRC(438f4388) SHA1(9e23805c9642a237daeaf106187d1e1e0692434d) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* OKIM6295 samples */ + ROM_LOAD( "hexionb.u16", 0x0000, 0x40000, CRC(bcc831bf) SHA1(c3382065dd0069a4dc0bde2d9931ec85b0bffc73) ) + + ROM_REGION( 0x40000, "oki2", 0 ) /* OKIM6295 samples */ + ROM_LOAD( "hexionb.u18", 0x0000, 0x40000, CRC(c179d315) SHA1(b39d5ec8a90b7ae06763191b8324f32fe1d0ca9b) ) + + ROM_REGION( 0x0300, "proms", 0 ) + ROM_LOAD( "122a04.10b", 0x0000, 0x0100, CRC(506eb8c6) SHA1(3bff7cf286942d8bdbc3998245c3de20981fbecb) ) + ROM_LOAD( "122a03.11b", 0x0100, 0x0100, CRC(590c4f64) SHA1(db4b34f8c5fdfea034a94d65873f6fb842f123e9) ) + ROM_LOAD( "122a02.13b", 0x0200, 0x0100, CRC(5734305c) SHA1(c72e59acf79a4db1a5a9d827eef899c0675336f2) ) +ROM_END + +GAME( 1992, hexion, 0, hexion, hexion, driver_device, 0, ROT0, "Konami", "Hexion (Japan ver JAB)", 0 ) +GAME( 1992, hexionb,hexion, hexionb,hexion, driver_device, 0, ROT0, "bootleg (Impeuropex Corp.)", "Hexion (Asia ver AAA, bootleg)", 0 ) // we're missing an original Asia AAA -GAME( 1992, hexion, 0, hexion, hexion, driver_device, 0, ROT0, "Konami", "Hexion (Japan ver JAB)", 0 ) diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c index 7749e0aa4eb..d3e9a96b7b7 100644 --- a/src/mame/drivers/hng64.c +++ b/src/mame/drivers/hng64.c @@ -918,10 +918,47 @@ WRITE32_MEMBER(hng64_state::hng64_sprite_clear_odd_w) WRITE32_MEMBER(hng64_state::hng64_vregs_w) { -// printf("hng64_vregs_w %02x, %08x %08x\n", offset * 4, data, mem_mask); +// printf("hng64_vregs_w %02x, %08x %08x\n", offset * 4, data, mem_mask); COMBINE_DATA(&m_videoregs[offset]); } +READ16_MEMBER(hng64_state::main_sound_comms_r) +{ + switch(offset *2) + { + case 0x04: + return sound_latch[0]; + case 0x06: + return sound_latch[1]; + default: + printf("%08x R\n",offset*2); + break; + } + return 0; +} + +WRITE16_MEMBER(hng64_state::main_sound_comms_w) +{ + switch(offset * 2) + { + case 0x00: + COMBINE_DATA(&main_latch[0]); + break; + case 0x02: + COMBINE_DATA(&main_latch[1]); + break; + case 0x08: + m_audiocpu->set_input_line(5, ASSERT_LINE); + if(data != 1) + printf("IRQ send %02x?\n",data); + break; + default: + printf("%02x %04x\n",offset*2,data); + break; + } +} + + static ADDRESS_MAP_START( hng_map, AS_PROGRAM, 32, hng64_state ) AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("mainram") @@ -963,9 +1000,7 @@ static ADDRESS_MAP_START( hng_map, AS_PROGRAM, 32, hng64_state ) AM_RANGE(0x60200000, 0x603fffff) AM_READWRITE(hng64_soundram_r, hng64_soundram_w) // program + data for V53A gets uploaded here // These are sound ports of some sort -// AM_RANGE(0x68000000, 0x68000003) AM_WRITENOP // ?? -// AM_RANGE(0x68000004, 0x68000007) AM_READNOP // ?? -// AM_RANGE(0x68000008, 0x6800000b) AM_WRITENOP // ?? + AM_RANGE(0x68000000, 0x6800000f) AM_READWRITE16(main_sound_comms_r,main_sound_comms_w,0xffffffff) AM_RANGE(0x6f000000, 0x6f000003) AM_WRITE(hng64_soundcpu_enable_w) // Communications @@ -1490,10 +1525,10 @@ void hng64_state::machine_start() /* set the fastest DRC options */ m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); - /* configure fast RAM regions for DRC */ - m_maincpu->mips3drc_add_fastram(0x00000000, 0x00ffffff, FALSE, m_mainram); - m_maincpu->mips3drc_add_fastram(0x04000000, 0x05ffffff, TRUE, m_cart); - m_maincpu->mips3drc_add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); + /* configure fast RAM regions */ + m_maincpu->add_fastram(0x00000000, 0x00ffffff, FALSE, m_mainram); + m_maincpu->add_fastram(0x04000000, 0x05ffffff, TRUE, m_cart); + m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); m_comm_rom = memregion("user2")->base(); m_comm_ram = auto_alloc_array(machine(),UINT8,0x10000); @@ -1503,7 +1538,7 @@ void hng64_state::machine_start() { m_videoregs[i] = 0xdeadbeef; } - + } @@ -1569,8 +1604,7 @@ MACHINE_CONFIG_END ROM_REGION( 0x0100000, "user2", 0 ) /* KL5C80 BIOS */ \ ROM_LOAD ( "from1.bin", 0x000000, 0x080000, CRC(6b933005) SHA1(e992747f46c48b66e5509fe0adf19c91250b00c7) ) \ ROM_REGION( 0x0100000, "fpga", 0 ) /* FPGA data */ \ - ROM_LOAD ( "rom1.bin", 0x000000, 0x01ff32, CRC(4a6832dc) SHA1(ae504f7733c2f40450157cd1d3b85bc83fac8569) ) \ - + ROM_LOAD ( "rom1.bin", 0x000000, 0x01ff32, CRC(4a6832dc) SHA1(ae504f7733c2f40450157cd1d3b85bc83fac8569) ) ROM_START( hng64 ) /* BIOS */ diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c index bd6725d711a..9759df963e2 100644 --- a/src/mame/drivers/hotblock.c +++ b/src/mame/drivers/hotblock.c @@ -57,7 +57,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<palette_device> m_palette; - + /* memory pointers */ required_shared_ptr<UINT8> m_vram; @@ -67,15 +67,15 @@ public: /* memory */ UINT8 m_pal[0x10000]; - + DECLARE_READ8_MEMBER(video_read); DECLARE_READ8_MEMBER(port4_r); DECLARE_WRITE8_MEMBER(port4_w); DECLARE_WRITE8_MEMBER(port0_w); DECLARE_WRITE8_MEMBER(video_write); - + virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/drivers/iteagle.c b/src/mame/drivers/iteagle.c index dfcf369441e..9d541054843 100644 --- a/src/mame/drivers/iteagle.c +++ b/src/mame/drivers/iteagle.c @@ -105,9 +105,9 @@ class iteagle_state : public driver_device public: iteagle_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + m_maincpu(*this, "maincpu") {} - + required_device<mips3_device> m_maincpu; virtual void machine_start(); @@ -129,7 +129,7 @@ static MACHINE_CONFIG_START( gtfore, iteagle_state ) MCFG_CPU_ADD("maincpu", VR4310LE, 166666666) MCFG_MIPS3_ICACHE_SIZE(16384) MCFG_MIPS3_DCACHE_SIZE(16384) - + MCFG_PCI_ROOT_ADD( ":pci") MCFG_VRC4373_ADD( ":pci:00.0", ":maincpu") MCFG_ITEAGLE_FPGA_ADD( ":pci:06.0") @@ -144,7 +144,7 @@ static MACHINE_CONFIG_START( gtfore, iteagle_state ) MCFG_SCREEN_SIZE(640, 350) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349) MCFG_SCREEN_UPDATE_DEVICE(":pci:09.0", voodoo_pci_device, screen_update) - + MACHINE_CONFIG_END @@ -167,7 +167,7 @@ static INPUT_PORTS_START( iteagle ) PORT_DIPNAME( 0x0F00, 0x0000, "GAME" ) PORT_DIPNAME( 0x00F0, 0x0000, "MAJOR" ) PORT_DIPNAME( 0x000F, 0x0000, "MINOR" ) - + INPUT_PORTS_END static INPUT_PORTS_START( gtfore05 ) @@ -263,7 +263,7 @@ ROM_START( gtfore02 ) DISK_REGION( ":pci:06.1:ide:0:hdd:image" ) DISK_IMAGE( "golf_fore_2002_v2.01.04_umv", 0, SHA1(e902b91bd739daee0b95b10e5cf33700dd63a76b) ) /* Labeled Golf Fore! V2.01.04 UMV */ //DISK_REGION( "ide:1:cdrom" ) // program CD-ROM - + ROM_END ROM_START( gtfore02o ) diff --git a/src/mame/drivers/jankenmn.c b/src/mame/drivers/jankenmn.c index c28b74a276c..fe874996a79 100644 --- a/src/mame/drivers/jankenmn.c +++ b/src/mame/drivers/jankenmn.c @@ -153,11 +153,11 @@ public: m_maincpu(*this, "maincpu") { } required_device<cpu_device> m_maincpu; - + DECLARE_WRITE8_MEMBER(lamps1_w); DECLARE_WRITE8_MEMBER(lamps2_w); DECLARE_WRITE8_MEMBER(lamps3_w); - + DECLARE_CUSTOM_INPUT_MEMBER(hopper_status_r); }; diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c index 5a32033f88c..14be78b6dbb 100644 --- a/src/mame/drivers/jchan.c +++ b/src/mame/drivers/jchan.c @@ -228,9 +228,9 @@ public: DECLARE_DRIVER_INIT(jchan); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + TIMER_DEVICE_CALLBACK_MEMBER(vblank); }; @@ -290,7 +290,7 @@ void jchan_state::video_start() m_spritegen1->skns_sprite_kludge(0,0); m_spritegen2->skns_sprite_kludge(0,0); - + save_item(NAME(m_irq_sub_enable)); save_pointer(NAME(m_sprite_ram32_1), 0x4000/4); save_pointer(NAME(m_sprite_ram32_2), 0x4000/4); diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c index 538671d705d..36f18235a0b 100644 --- a/src/mame/drivers/junofrst.c +++ b/src/mame/drivers/junofrst.c @@ -105,11 +105,11 @@ public: required_device<filter_rc_device> m_filter_0_0; required_device<filter_rc_device> m_filter_0_1; required_device<filter_rc_device> m_filter_0_2; - + UINT8 m_blitterdata[4]; int m_i8039_status; int m_last_irq; - + DECLARE_WRITE8_MEMBER(blitter_w); DECLARE_WRITE8_MEMBER(bankselect_w); DECLARE_WRITE8_MEMBER(sh_irqtrigger_w); diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c index f613c7f8a0d..c87d33efb6f 100644 --- a/src/mame/drivers/kinst.c +++ b/src/mame/drivers/kinst.c @@ -203,10 +203,10 @@ void kinst_state::machine_start() /* set the fastest DRC options */ m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS); - /* configure fast RAM regions for DRC */ - m_maincpu->mips3drc_add_fastram(0x08000000, 0x087fffff, FALSE, m_rambase2); - m_maincpu->mips3drc_add_fastram(0x00000000, 0x0007ffff, FALSE, m_rambase); - m_maincpu->mips3drc_add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); + /* configure fast RAM regions */ + m_maincpu->add_fastram(0x08000000, 0x087fffff, FALSE, m_rambase2); + m_maincpu->add_fastram(0x00000000, 0x0007ffff, FALSE, m_rambase); + m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); } diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c index 49c16091bbd..b4d3cf0a7c1 100644 --- a/src/mame/drivers/m107.c +++ b/src/mame/drivers/m107.c @@ -43,12 +43,12 @@ confirmed for m107 games as well. void m107_state::machine_start() { - // TODO: state save registrations + save_item(NAME(m_sound_status)); } /*****************************************************************************/ -TIMER_DEVICE_CALLBACK_MEMBER(m107_state::m107_scanline_interrupt) +TIMER_DEVICE_CALLBACK_MEMBER(m107_state::scanline_interrupt) { int scanline = param; @@ -69,7 +69,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(m107_state::m107_scanline_interrupt) /*****************************************************************************/ -WRITE16_MEMBER(m107_state::m107_coincounter_w) +WRITE16_MEMBER(m107_state::coincounter_w) { if (ACCESSING_BITS_0_7) { @@ -78,7 +78,7 @@ WRITE16_MEMBER(m107_state::m107_coincounter_w) } } -WRITE16_MEMBER(m107_state::m107_bankswitch_w) +WRITE16_MEMBER(m107_state::bankswitch_w) { if (ACCESSING_BITS_0_7) { @@ -88,36 +88,36 @@ WRITE16_MEMBER(m107_state::m107_bankswitch_w) } } -WRITE16_MEMBER(m107_state::m107_soundlatch_w) +WRITE16_MEMBER(m107_state::soundlatch_w) { m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, ASSERT_LINE); soundlatch_byte_w(space, 0, data & 0xff); // logerror("soundlatch_byte_w %02x\n",data); } -READ16_MEMBER(m107_state::m107_sound_status_r) +READ16_MEMBER(m107_state::sound_status_r) { return m_sound_status; } -READ16_MEMBER(m107_state::m107_soundlatch_r) +READ16_MEMBER(m107_state::soundlatch_r) { m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, CLEAR_LINE); return soundlatch_byte_r(space, offset) | 0xff00; } -WRITE16_MEMBER(m107_state::m107_sound_irq_ack_w) +WRITE16_MEMBER(m107_state::sound_irq_ack_w) { m_soundcpu->set_input_line(NEC_INPUT_LINE_INTP1, CLEAR_LINE); } -WRITE16_MEMBER(m107_state::m107_sound_status_w) +WRITE16_MEMBER(m107_state::sound_status_w) { COMBINE_DATA(&m_sound_status); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_3); } -WRITE16_MEMBER(m107_state::m107_sound_reset_w) +WRITE16_MEMBER(m107_state::sound_reset_w) { m_soundcpu->set_input_line(INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE); } @@ -127,7 +127,7 @@ WRITE16_MEMBER(m107_state::m107_sound_reset_w) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, m107_state ) AM_RANGE(0x00000, 0x9ffff) AM_ROM AM_RANGE(0xa0000, 0xbffff) AM_ROMBANK("bank1") - AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(m107_vram_w) AM_SHARE("vram_data") + AM_RANGE(0xd0000, 0xdffff) AM_RAM_WRITE(vram_w) AM_SHARE("vram_data") AM_RANGE(0xe0000, 0xeffff) AM_RAM /* System ram */ AM_RANGE(0xf8000, 0xf8fff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0xf9000, 0xf9fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") @@ -139,15 +139,15 @@ static ADDRESS_MAP_START( main_portmap, AS_IO, 16, m107_state ) AM_RANGE(0x02, 0x03) AM_READ_PORT("COINS_DSW3") AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW") AM_RANGE(0x06, 0x07) AM_READ_PORT("P3_P4") - AM_RANGE(0x08, 0x09) AM_READ(m107_sound_status_r) /* answer from sound CPU */ - AM_RANGE(0x00, 0x01) AM_WRITE(m107_soundlatch_w) - AM_RANGE(0x02, 0x03) AM_WRITE(m107_coincounter_w) + AM_RANGE(0x08, 0x09) AM_READ(sound_status_r) /* answer from sound CPU */ + AM_RANGE(0x00, 0x01) AM_WRITE(soundlatch_w) + AM_RANGE(0x02, 0x03) AM_WRITE(coincounter_w) AM_RANGE(0x04, 0x05) AM_WRITENOP /* ??? 0008 */ - AM_RANGE(0x80, 0x9f) AM_WRITE(m107_control_w) + AM_RANGE(0x80, 0x9f) AM_WRITE(control_w) AM_RANGE(0xa0, 0xaf) AM_WRITENOP /* Written with 0's in interrupt */ - AM_RANGE(0xb0, 0xb1) AM_WRITE(m107_spritebuffer_w) + AM_RANGE(0xb0, 0xb1) AM_WRITE(spritebuffer_w) AM_RANGE(0xc0, 0xc3) AM_READNOP /* Only wpksoc: ticket related? */ - AM_RANGE(0xc0, 0xc1) AM_WRITE(m107_sound_reset_w) + AM_RANGE(0xc0, 0xc1) AM_WRITE(sound_reset_w) ADDRESS_MAP_END /* same as M107 but with an extra i/o board */ @@ -182,8 +182,8 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, m107_state ) AM_RANGE(0xa0000, 0xa3fff) AM_RAM AM_RANGE(0xa8000, 0xa803f) AM_DEVREADWRITE8("irem", iremga20_device, irem_ga20_r, irem_ga20_w, 0x00ff) AM_RANGE(0xa8040, 0xa8043) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff) - AM_RANGE(0xa8044, 0xa8045) AM_READWRITE(m107_soundlatch_r, m107_sound_irq_ack_w) - AM_RANGE(0xa8046, 0xa8047) AM_WRITE(m107_sound_status_w) + AM_RANGE(0xa8044, 0xa8045) AM_READWRITE(soundlatch_r, sound_irq_ack_w) + AM_RANGE(0xa8046, 0xa8047) AM_WRITE(sound_status_w) AM_RANGE(0xffff0, 0xfffff) AM_ROM AM_REGION("soundcpu", 0x1fff0) ADDRESS_MAP_END @@ -765,7 +765,7 @@ static MACHINE_CONFIG_START( firebarr, m107_state ) MCFG_V25_CONFIG(rtypeleo_decryption_table) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m107_state, m107_scanline_interrupt, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m107_state, scanline_interrupt, "screen", 0, 1) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -773,7 +773,7 @@ static MACHINE_CONFIG_START( firebarr, m107_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_VISIBLE_AREA(80, 511-112, 8, 247) /* 320 x 240 */ - MCFG_SCREEN_UPDATE_DRIVER(m107_state, screen_update_m107) + MCFG_SCREEN_UPDATE_DRIVER(m107_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", firebarr) @@ -996,7 +996,7 @@ DRIVER_INIT_MEMBER(m107_state,dsoccr94) UINT8 *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); - m_maincpu->space(AS_IO).install_write_handler(0x06, 0x07, write16_delegate(FUNC(m107_state::m107_bankswitch_w),this)); + m_maincpu->space(AS_IO).install_write_handler(0x06, 0x07, write16_delegate(FUNC(m107_state::bankswitch_w),this)); m_irq_vectorbase = 0x80; m_spritesystem = 0; @@ -1010,10 +1010,10 @@ DRIVER_INIT_MEMBER(m107_state,wpksoc) /***************************************************************************/ -GAME( 1993, airass, 0, airass, firebarr, m107_state, firebarr, ROT270, "Irem", "Air Assault (World)", GAME_NO_COCKTAIL ) // possible location test, but sound code is newer than Japan version -GAME( 1993, firebarr, airass, firebarr, firebarr, m107_state, firebarr, ROT270, "Irem", "Fire Barrel (Japan)", GAME_NO_COCKTAIL ) +GAME( 1993, airass, 0, airass, firebarr, m107_state, firebarr, ROT270, "Irem", "Air Assault (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // possible location test, but sound code is newer than Japan version +GAME( 1993, firebarr, airass, firebarr, firebarr, m107_state, firebarr, ROT270, "Irem", "Fire Barrel (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1994, dsoccr94, 0, dsoccr94, dsoccr94, m107_state, dsoccr94, ROT0, "Irem (Data East Corporation license)", "Dream Soccer '94 (World, M107 hardware)", GAME_NO_COCKTAIL ) +GAME( 1994, dsoccr94, 0, dsoccr94, dsoccr94, m107_state, dsoccr94, ROT0, "Irem (Data East Corporation license)", "Dream Soccer '94 (World, M107 hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1995, wpksoc, 0, wpksoc, wpksoc, m107_state, wpksoc, ROT0, "Jaleco", "World PK Soccer", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_MECHANICAL ) -GAME( 1994, kftgoal, wpksoc, wpksoc, wpksoc, m107_state, wpksoc, ROT0, "Jaleco", "Kick for the Goal", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_MECHANICAL ) +GAME( 1995, wpksoc, 0, wpksoc, wpksoc, m107_state, wpksoc, ROT0, "Jaleco", "World PK Soccer", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_MECHANICAL | GAME_SUPPORTS_SAVE ) +GAME( 1994, kftgoal, wpksoc, wpksoc, wpksoc, m107_state, wpksoc, ROT0, "Jaleco", "Kick for the Goal", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_MECHANICAL | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c index e26226b702e..1705eeaf3e9 100644 --- a/src/mame/drivers/m72.c +++ b/src/mame/drivers/m72.c @@ -96,25 +96,16 @@ other supported games as well. - - - /***************************************************************************/ void m72_state::machine_start() { - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::m72_scanline_interrupt),this)); - - save_item(NAME(m_mcu_sample_addr)); - save_item(NAME(m_mcu_snd_cmd_latch)); + m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::scanline_interrupt),this)); } MACHINE_START_MEMBER(m72_state,kengo) { m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::kengo_scanline_interrupt),this)); - - save_item(NAME(m_mcu_sample_addr)); - save_item(NAME(m_mcu_snd_cmd_latch)); } TIMER_CALLBACK_MEMBER(m72_state::synch_callback) @@ -144,7 +135,7 @@ MACHINE_RESET_MEMBER(m72_state,kengo) m_scanline_timer->adjust(m_screen->time_until_pos(0)); } -TIMER_CALLBACK_MEMBER(m72_state::m72_scanline_interrupt) +TIMER_CALLBACK_MEMBER(m72_state::scanline_interrupt) { int scanline = param; @@ -200,9 +191,6 @@ TIMER_CALLBACK_MEMBER(m72_state::kengo_scanline_interrupt) Protection emulation -Currently only available for lohtb2, since this is the only game -with a dumped 8751. - The protection device does * provide startup code @@ -221,7 +209,7 @@ TIMER_CALLBACK_MEMBER(m72_state::delayed_ram16_w) } -WRITE16_MEMBER(m72_state::m72_main_mcu_sound_w) +WRITE16_MEMBER(m72_state::main_mcu_sound_w) { if (data & 0xfff0) logerror("sound_w: %04x %04x\n", mem_mask, data); @@ -233,7 +221,7 @@ WRITE16_MEMBER(m72_state::m72_main_mcu_sound_w) } } -WRITE16_MEMBER(m72_state::m72_main_mcu_w) +WRITE16_MEMBER(m72_state::main_mcu_w) { UINT16 val = m_protection_ram[offset]; @@ -255,7 +243,7 @@ WRITE16_MEMBER(m72_state::m72_main_mcu_w) machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), (offset<<16) | val, m_protection_ram); } -WRITE8_MEMBER(m72_state::m72_mcu_data_w) +WRITE8_MEMBER(m72_state::mcu_data_w) { UINT16 val; if (offset&1) val = (m_protection_ram[offset/2] & 0x00ff) | (data << 8); @@ -264,7 +252,7 @@ WRITE8_MEMBER(m72_state::m72_mcu_data_w) machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), ((offset >>1 ) << 16) | val, m_protection_ram); } -READ8_MEMBER(m72_state::m72_mcu_data_r) +READ8_MEMBER(m72_state::mcu_data_r) { UINT8 ret; @@ -279,38 +267,38 @@ READ8_MEMBER(m72_state::m72_mcu_data_r) return ret; } -INTERRUPT_GEN_MEMBER(m72_state::m72_mcu_int) +INTERRUPT_GEN_MEMBER(m72_state::mcu_int) { //m_mcu_snd_cmd_latch |= 0x11; /* 0x10 is special as well - FIXME */ m_mcu_snd_cmd_latch = 0x11;// | (machine.rand() & 1); /* 0x10 is special as well - FIXME */ device.execute().set_input_line(1, ASSERT_LINE); } -READ8_MEMBER(m72_state::m72_mcu_sample_r) +READ8_MEMBER(m72_state::mcu_sample_r) { UINT8 sample; sample = memregion("samples")->base()[m_mcu_sample_addr++]; return sample; } -WRITE8_MEMBER(m72_state::m72_mcu_ack_w) +WRITE8_MEMBER(m72_state::mcu_ack_w) { m_mcu->set_input_line(1, CLEAR_LINE); m_mcu_snd_cmd_latch = 0; } -READ8_MEMBER(m72_state::m72_mcu_snd_r) +READ8_MEMBER(m72_state::mcu_snd_r) { return m_mcu_snd_cmd_latch; } -READ8_MEMBER(m72_state::m72_mcu_port_r) +READ8_MEMBER(m72_state::mcu_port_r) { logerror("port read: %02x\n", offset); return 0; } -WRITE8_MEMBER(m72_state::m72_mcu_port_w) +WRITE8_MEMBER(m72_state::mcu_port_w) { if (offset == 1) { @@ -322,25 +310,19 @@ WRITE8_MEMBER(m72_state::m72_mcu_port_w) } -WRITE8_MEMBER(m72_state::m72_mcu_low_w) +WRITE8_MEMBER(m72_state::mcu_low_w) { m_mcu_sample_addr = (m_mcu_sample_addr & 0xffe000) | (data<<5); logerror("low: %02x %02x %08x\n", offset, data, m_mcu_sample_addr); } -WRITE8_MEMBER(m72_state::m72_mcu_high_w) +WRITE8_MEMBER(m72_state::mcu_high_w) { m_mcu_sample_addr = (m_mcu_sample_addr & 0x1fff) | (data<<(8+5)); logerror("high: %02x %02x %08x\n", offset, data, m_mcu_sample_addr); } -WRITE8_MEMBER(m72_state::m72_snd_cpu_sample_w) -{ - //m_dac->write_signed8(data); - m_dac->write_unsigned8(data); -} - -READ8_MEMBER(m72_state::m72_snd_cpu_sample_r) +READ8_MEMBER(m72_state::snd_cpu_sample_r) { return m_mcu_sample_latch; } @@ -353,15 +335,20 @@ DRIVER_INIT_MEMBER(m72_state,m72_8751) m_protection_ram = auto_alloc_array(machine(), UINT16, 0x10000/2); program.install_read_bank(0xb0000, 0xbffff, "bank1"); - program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::m72_main_mcu_w),this)); - membank("bank1")->set_base(m_protection_ram); + program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::main_mcu_w),this)); + membank("bank1")->configure_entry(0, m_protection_ram); + + save_pointer(NAME(m_protection_ram), 0x10000/2); + save_item(NAME(m_mcu_sample_latch)); + save_item(NAME(m_mcu_sample_addr)); + save_item(NAME(m_mcu_snd_cmd_latch)); //io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::loht_sample_trigger_w),this)); - io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::m72_main_mcu_sound_w),this)); + io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::main_mcu_sound_w),this)); /* sound cpu */ - sndio.install_write_handler(0x82, 0x82, 0xff, 0, write8_delegate(FUNC(m72_state::m72_snd_cpu_sample_w),this)); - sndio.install_read_handler (0x84, 0x84, 0xff, 0, read8_delegate(FUNC(m72_state::m72_snd_cpu_sample_r),this)); + sndio.install_write_handler(0x82, 0x82, 0xff, 0, write8_delegate(FUNC(dac_device::write_unsigned8),(dac_device*)m_dac)); + sndio.install_read_handler (0x84, 0x84, 0xff, 0, read8_delegate(FUNC(m72_state::snd_cpu_sample_r),this)); /* lohtb2 */ #if 0 @@ -697,7 +684,9 @@ void m72_state::install_protection_handler(const UINT8 *code,const UINT8 *crc) m_maincpu->space(AS_PROGRAM).install_read_bank(0xb0000, 0xb0fff, "bank1"); m_maincpu->space(AS_PROGRAM).install_read_handler(0xb0ffa, 0xb0ffb, read16_delegate(FUNC(m72_state::protection_r),this)); m_maincpu->space(AS_PROGRAM).install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::protection_w),this)); - membank("bank1")->set_base(m_protection_ram); + membank("bank1")->configure_entry(0, m_protection_ram); + + save_pointer(NAME(m_protection_ram), 0x1000/2); } DRIVER_INIT_MEMBER(m72_state,bchopper) @@ -808,10 +797,10 @@ static ADDRESS_MAP_START( NAME##_map, AS_PROGRAM, 16 , m72_state ) \ AM_RANGE(0x00000, ROMSIZE-1) AM_ROM \ AM_RANGE(WORKRAM, WORKRAM+0x3fff) AM_RAM /* work RAM */ \ AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") \ - AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") \ - AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") \ - AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") \ - AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") \ + AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") \ + AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") \ + AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") \ + AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") \ AM_RANGE(0xe0000, 0xeffff) AM_READWRITE(soundram_r, soundram_w) \ AM_RANGE(0xffff0, 0xfffff) AM_ROM \ ADDRESS_MAP_END @@ -828,10 +817,10 @@ static ADDRESS_MAP_START( xmultipl_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0x9c000, 0x9ffff) AM_RAM /* work RAM */ AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */ AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") - AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") - AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END @@ -840,22 +829,22 @@ static ADDRESS_MAP_START( dbreed_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0x88000, 0x8bfff) AM_RAM /* work RAM */ AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */ AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") - AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") - AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END static ADDRESS_MAP_START( rtype2_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0x00000, 0x7ffff) AM_ROM - AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w) - AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) + AM_RANGE(0xb0000, 0xb0001) AM_WRITE(irq_line_w) + AM_RANGE(0xbc000, 0xbc001) AM_WRITE(dmaon_w) AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") - AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") - AM_RANGE(0xd8000, 0xd8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0xd8000, 0xd8bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END @@ -863,16 +852,16 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( majtitle_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0x00000, 0x7ffff) AM_ROM AM_RANGE(0xa0000, 0xa03ff) AM_RAM AM_SHARE("majtitle_rowscr") - AM_RANGE(0xa4000, 0xa4bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") - AM_RANGE(0xac000, 0xaffff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0xb0000, 0xbffff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") /* larger than the other games */ + AM_RANGE(0xa4000, 0xa4bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xac000, 0xaffff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0xb0000, 0xbffff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") /* larger than the other games */ AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0xc8000, 0xc83ff) AM_RAM AM_SHARE("spriteram2") - AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") AM_RANGE(0xd0000, 0xd3fff) AM_RAM /* work RAM */ - AM_RANGE(0xe0000, 0xe0001) AM_WRITE(m72_irq_line_w) + AM_RANGE(0xe0000, 0xe0001) AM_WRITE(irq_line_w) AM_RANGE(0xe4000, 0xe4001) AM_WRITEONLY /* playfield enable? 1 during screen transitions, 0 otherwise */ - AM_RANGE(0xec000, 0xec001) AM_WRITE(m72_dmaon_w) + AM_RANGE(0xec000, 0xec001) AM_WRITE(dmaon_w) AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END @@ -881,37 +870,37 @@ static ADDRESS_MAP_START( hharry_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0xa0000, 0xa3fff) AM_RAM /* work RAM */ AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */ AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") - AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") - AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END static ADDRESS_MAP_START( hharryu_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0x00000, 0x7ffff) AM_ROM - AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") - AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") - AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w) - AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) + AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xb0000, 0xb0001) AM_WRITE(irq_line_w) + AM_RANGE(0xbc000, 0xbc001) AM_WRITE(dmaon_w) AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */ AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END static ADDRESS_MAP_START( kengo_map, AS_PROGRAM, 16, m72_state ) AM_RANGE(0x00000, 0x7ffff) AM_ROM - AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram") - AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2") - AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w) + AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram") + AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2") + AM_RANGE(0xb0000, 0xb0001) AM_WRITE(irq_line_w) AM_RANGE(0xb4000, 0xb4001) AM_WRITENOP /* ??? */ - AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w) + AM_RANGE(0xbc000, 0xbc001) AM_WRITE(dmaon_w) AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0x80000, 0x83fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0x84000, 0x87fff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0x80000, 0x83fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0x84000, 0x87fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") AM_RANGE(0xe0000, 0xe3fff) AM_RAM /* work RAM */ AM_RANGE(0xffff0, 0xfffff) AM_ROM ADDRESS_MAP_END @@ -921,14 +910,14 @@ static ADDRESS_MAP_START( m72_portmap, AS_IO, 16, m72_state ) AM_RANGE(0x02, 0x03) AM_READ_PORT("IN1") AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW") AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w) - AM_RANGE(0x02, 0x03) AM_WRITE(m72_port02_w) /* coin counters, reset sound cpu, other stuff? */ - AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w) - AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w) + AM_RANGE(0x02, 0x03) AM_WRITE(port02_w) /* coin counters, reset sound cpu, other stuff? */ + AM_RANGE(0x04, 0x05) AM_WRITE(dmaon_w) + AM_RANGE(0x06, 0x07) AM_WRITE(irq_line_w) //AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */ - AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) - AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) - AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) - AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) + AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w) + AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w) + AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w) + AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w) /* { 0xc0, 0xc0 trigger sample, filled by init_ function */ ADDRESS_MAP_END @@ -939,10 +928,10 @@ static ADDRESS_MAP_START( rtype2_portmap, AS_IO, 16, m72_state ) AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w) AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */ - AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) - AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) - AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) - AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) + AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w) + AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w) + AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w) + AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w) ADDRESS_MAP_END static ADDRESS_MAP_START( poundfor_portmap, AS_IO, 16, m72_state ) @@ -952,10 +941,10 @@ static ADDRESS_MAP_START( poundfor_portmap, AS_IO, 16, m72_state ) AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w) AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */ - AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) - AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) - AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) - AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) + AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w) + AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w) + AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w) + AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w) ADDRESS_MAP_END static ADDRESS_MAP_START( majtitle_portmap, AS_IO, 16, m72_state ) @@ -965,10 +954,10 @@ static ADDRESS_MAP_START( majtitle_portmap, AS_IO, 16, m72_state ) AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w) AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */ - AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) - AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) - AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) - AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) + AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w) + AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w) + AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w) + AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w) AM_RANGE(0x8e, 0x8f) AM_WRITE(majtitle_gfx_ctrl_w) ADDRESS_MAP_END @@ -978,13 +967,13 @@ static ADDRESS_MAP_START( hharry_portmap, AS_IO, 16, m72_state ) AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW") AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w) AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) /* coin counters, reset sound cpu, other stuff? */ - AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w) - AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w) + AM_RANGE(0x04, 0x05) AM_WRITE(dmaon_w) + AM_RANGE(0x06, 0x07) AM_WRITE(irq_line_w) AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */ - AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) - AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) - AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) - AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) + AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w) + AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w) + AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w) + AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w) ADDRESS_MAP_END static ADDRESS_MAP_START( kengo_portmap, AS_IO, 16, m72_state ) @@ -993,10 +982,10 @@ static ADDRESS_MAP_START( kengo_portmap, AS_IO, 16, m72_state ) AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW") AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w) AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w) - AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w) - AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w) - AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w) - AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w) + AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w) + AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w) + AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w) + AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w) // AM_RANGE(0x8c, 0x8f) AM_WRITENOP /* ??? */ ADDRESS_MAP_END @@ -1048,14 +1037,14 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, m72_state ) /* External access */ - AM_RANGE(0x0000, 0x0000) AM_READWRITE(m72_mcu_sample_r, m72_mcu_low_w) - AM_RANGE(0x0001, 0x0001) AM_WRITE(m72_mcu_high_w) - AM_RANGE(0x0002, 0x0002) AM_READWRITE(m72_mcu_snd_r, m72_mcu_ack_w) + AM_RANGE(0x0000, 0x0000) AM_READWRITE(mcu_sample_r, mcu_low_w) + AM_RANGE(0x0001, 0x0001) AM_WRITE(mcu_high_w) + AM_RANGE(0x0002, 0x0002) AM_READWRITE(mcu_snd_r, mcu_ack_w) /* shared at b0000 - b0fff on the main cpu */ - AM_RANGE(0xc000, 0xcfff) AM_READWRITE(m72_mcu_data_r,m72_mcu_data_w ) + AM_RANGE(0xc000, 0xcfff) AM_READWRITE(mcu_data_r,mcu_data_w ) /* Ports */ - AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(m72_mcu_port_r, m72_mcu_port_w) + AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(mcu_port_r, mcu_port_w) ADDRESS_MAP_END #define COIN_MODE_1 \ @@ -1785,7 +1774,7 @@ static MACHINE_CONFIG_START( m72_base, m72_state ) MCFG_CPU_ADD("soundcpu",Z80, SOUND_CLOCK) MCFG_CPU_PROGRAM_MAP(sound_ram_map) MCFG_CPU_IO_MAP(sound_portmap) - + /* video hardware */ MCFG_GFXDECODE_ADD("gfxdecode", "palette", m72) @@ -1793,7 +1782,7 @@ static MACHINE_CONFIG_START( m72_base, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,m72) @@ -1811,7 +1800,7 @@ static MACHINE_CONFIG_DERIVED( m72_8751, m72_base ) MCFG_CPU_ADD("mcu",I8751, XTAL_8MHz) /* Uses its own XTAL */ MCFG_CPU_IO_MAP(mcu_io_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", m72_state, m72_mcu_int) + MCFG_CPU_VBLANK_INT_DRIVER("screen", m72_state, mcu_int) MACHINE_CONFIG_END @@ -1834,7 +1823,7 @@ static MACHINE_CONFIG_DERIVED( xmultiplm72, m72_8751 ) MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */ /* IRQs are generated by main Z80 and YM2151 */ - + MCFG_MACHINE_RESET_OVERRIDE(m72_state,xmultipl) MACHINE_CONFIG_END @@ -1852,7 +1841,7 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( dkgenm72, m72 ) // dervices from 'm72' because we use 'fake nmi' on the soundcpu - + MCFG_MACHINE_RESET_OVERRIDE(m72_state,xmultipl) MACHINE_CONFIG_END @@ -1871,7 +1860,7 @@ static MACHINE_CONFIG_DERIVED( xmultipl, m72 ) MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */ /* IRQs are generated by main Z80 and YM2151 */ - + MCFG_MACHINE_RESET_OVERRIDE(m72_state,xmultipl) MCFG_VIDEO_START_OVERRIDE(m72_state,xmultipl) @@ -1926,7 +1915,7 @@ static MACHINE_CONFIG_START( rtype2, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,rtype2) @@ -1948,7 +1937,7 @@ static MACHINE_CONFIG_START( dbreed, m72_state ) MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */ /* IRQs are generated by main Z80 and YM2151 */ - + MCFG_MACHINE_RESET_OVERRIDE(m72_state,xmultipl) /* video hardware */ @@ -1957,7 +1946,7 @@ static MACHINE_CONFIG_START( dbreed, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,hharry) @@ -1979,7 +1968,7 @@ static MACHINE_CONFIG_START( hharry, m72_state ) MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */ /* IRQs are generated by main Z80 and YM2151 */ - + MCFG_MACHINE_RESET_OVERRIDE(m72_state,xmultipl) /* video hardware */ @@ -1988,7 +1977,7 @@ static MACHINE_CONFIG_START( hharry, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,hharry) @@ -2011,7 +2000,7 @@ static MACHINE_CONFIG_START( hharryu, m72_state ) MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */ /* IRQs are generated by main Z80 and YM2151 */ - + MCFG_MACHINE_RESET_OVERRIDE(m72_state,xmultipl) /* video hardware */ @@ -2020,7 +2009,7 @@ static MACHINE_CONFIG_START( hharryu, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,hharryu) @@ -2049,7 +2038,7 @@ static MACHINE_CONFIG_START( poundfor, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,poundfor) @@ -2080,7 +2069,7 @@ static MACHINE_CONFIG_START( cosmccop, m72_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256) - MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72) + MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_VIDEO_START_OVERRIDE(m72_state,poundfor) @@ -3502,51 +3491,51 @@ ROM_END // the program roms failing their tests. This is why we still have simulation code for many games // despite having Japanese version MCU roms for several of them. See notes next to the sets -GAME( 1987, rtype, 0, rtype, rtype, driver_device, 0, ROT0, "Irem", "R-Type (World)", GAME_NO_COCKTAIL ) -GAME( 1987, rtypej, rtype, rtype, rtype, driver_device, 0, ROT0, "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL ) -GAME( 1987, rtypejp, rtype, rtype, rtypep, driver_device, 0, ROT0, "Irem", "R-Type (Japan prototype)", GAME_NO_COCKTAIL ) -GAME( 1987, rtypeu, rtype, rtype, rtype, driver_device, 0, ROT0, "Irem (Nintendo of America license)", "R-Type (US)", GAME_NO_COCKTAIL ) -GAME( 1987, rtypeb, rtype, rtype, rtype, driver_device, 0, ROT0, "bootleg", "R-Type (World bootleg)", GAME_NO_COCKTAIL ) +GAME( 1987, rtype, 0, rtype, rtype, driver_device, 0, ROT0, "Irem", "R-Type (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1987, rtypej, rtype, rtype, rtype, driver_device, 0, ROT0, "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1987, rtypejp, rtype, rtype, rtypep, driver_device, 0, ROT0, "Irem", "R-Type (Japan prototype)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1987, rtypeu, rtype, rtype, rtype, driver_device, 0, ROT0, "Irem (Nintendo of America license)", "R-Type (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1987, rtypeb, rtype, rtype, rtype, driver_device, 0, ROT0, "bootleg", "R-Type (World bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1987, bchopper, 0, m72, bchopper, m72_state, bchopper, ROT0, "Irem", "Battle Chopper", GAME_NO_COCKTAIL ) -GAME( 1987, mrheli, bchopper, m72_8751, bchopper, m72_state, m72_8751, ROT0, "Irem", "Mr. HELI no Daibouken (Japan)", GAME_NO_COCKTAIL ) +GAME( 1987, bchopper, 0, m72, bchopper, m72_state, bchopper, ROT0, "Irem", "Battle Chopper", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1987, mrheli, bchopper, m72_8751, bchopper, m72_state, m72_8751, ROT0, "Irem", "Mr. HELI no Daibouken (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1988, nspirit, 0, m72, nspirit, m72_state, nspirit, ROT0, "Irem", "Ninja Spirit", GAME_NO_COCKTAIL ) // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?) -GAME( 1988, nspiritj, nspirit, m72_8751, nspirit, m72_state, m72_8751, ROT0, "Irem", "Saigo no Nindou (Japan)", GAME_NO_COCKTAIL ) // waits for japan warning screen, works with our mcu dump, corrupt warning screen due to priority / mixing errors (Japan Version) +GAME( 1988, nspirit, 0, m72, nspirit, m72_state, nspirit, ROT0, "Irem", "Ninja Spirit", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?) +GAME( 1988, nspiritj, nspirit, m72_8751, nspirit, m72_state, m72_8751, ROT0, "Irem", "Saigo no Nindou (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // waits for japan warning screen, works with our mcu dump, corrupt warning screen due to priority / mixing errors (Japan Version) -GAME( 1988, imgfight, 0, m72, imgfight, m72_state, imgfight, ROT270, "Irem", "Image Fight (World, revision A)", 0 ) // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?) -GAME( 1988, imgfightj, imgfight, m72_8751, imgfight, m72_state, m72_8751, ROT270, "Irem", "Image Fight (Japan)", 0 ) // waits for japan warning screen, works with our mcu dump, can't actually see warning screen due to priority / mixing errors, check tilemap viewer (Japan Version) +GAME( 1988, imgfight, 0, m72, imgfight, m72_state, imgfight, ROT270, "Irem", "Image Fight (World, revision A)", GAME_SUPPORTS_SAVE ) // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?) +GAME( 1988, imgfightj, imgfight, m72_8751, imgfight, m72_state, m72_8751, ROT270, "Irem", "Image Fight (Japan)", GAME_SUPPORTS_SAVE ) // waits for japan warning screen, works with our mcu dump, can't actually see warning screen due to priority / mixing errors, check tilemap viewer (Japan Version) -GAME( 1989, loht, 0, m72, loht, m72_state, loht, ROT0, "Irem", "Legend of Hero Tonma", GAME_NO_COCKTAIL ) // fails rom check if used with Japan MCU rom (World version?) -GAME( 1989, lohtj, loht, m72_8751, loht, m72_state, m72_8751, ROT0, "Irem", "Legend of Hero Tonma (Japan)", GAME_NO_COCKTAIL ) // waits for japan warning screen, works with our mcu dump (Japan Version) -GAME( 1989, lohtb2, loht, m72_8751, loht, m72_state, m72_8751, ROT0, "bootleg", "Legend of Hero Tonma (Japan, bootleg with i8751)", GAME_NO_COCKTAIL ) // works like above, mcu code is the same as the real code, probably just an alt revision on a bootleg board -GAME( 1989, lohtb, loht, m72, loht, driver_device, 0, ROT0, "bootleg", "Legend of Hero Tonma (unprotected bootleg)", GAME_NOT_WORKING| GAME_NO_COCKTAIL ) +GAME( 1989, loht, 0, m72, loht, m72_state, loht, ROT0, "Irem", "Legend of Hero Tonma", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // fails rom check if used with Japan MCU rom (World version?) +GAME( 1989, lohtj, loht, m72_8751, loht, m72_state, m72_8751, ROT0, "Irem", "Legend of Hero Tonma (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // waits for japan warning screen, works with our mcu dump (Japan Version) +GAME( 1989, lohtb2, loht, m72_8751, loht, m72_state, m72_8751, ROT0, "bootleg", "Legend of Hero Tonma (Japan, bootleg with i8751)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // works like above, mcu code is the same as the real code, probably just an alt revision on a bootleg board +GAME( 1989, lohtb, loht, m72, loht, driver_device, 0, ROT0, "bootleg", "Legend of Hero Tonma (unprotected bootleg)", GAME_NOT_WORKING| GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1989, xmultipl, 0, xmultipl, xmultipl, driver_device, 0, ROT0, "Irem", "X Multiply (World, M81)", GAME_NO_COCKTAIL ) -GAME( 1989, xmultiplm72, xmultipl, xmultiplm72, xmultipl, m72_state, m72_8751, ROT0, "Irem", "X Multiply (Japan, M72)", GAME_NO_COCKTAIL ) +GAME( 1989, xmultipl, 0, xmultipl, xmultipl, driver_device, 0, ROT0, "Irem", "X Multiply (World, M81)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1989, xmultiplm72, xmultipl, xmultiplm72, xmultipl, m72_state, m72_8751, ROT0, "Irem", "X Multiply (Japan, M72)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1989, dbreed, 0, dbreed, dbreed, driver_device, 0, ROT0, "Irem", "Dragon Breed (M81 PCB version)", GAME_NO_COCKTAIL ) -GAME( 1989, dbreedm72, dbreed, dbreedm72, dbreed, m72_state, dbreedm72, ROT0, "Irem", "Dragon Breed (M72 PCB version)", GAME_NO_COCKTAIL ) +GAME( 1989, dbreed, 0, dbreed, dbreed, driver_device, 0, ROT0, "Irem", "Dragon Breed (M81 PCB version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1989, dbreedm72, dbreed, dbreedm72, dbreed, m72_state, dbreedm72, ROT0, "Irem", "Dragon Breed (M72 PCB version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1989, rtype2, 0, rtype2, rtype2, driver_device, 0, ROT0, "Irem", "R-Type II", GAME_NO_COCKTAIL ) -GAME( 1989, rtype2j, rtype2, rtype2, rtype2, driver_device, 0, ROT0, "Irem", "R-Type II (Japan)", GAME_NO_COCKTAIL ) -GAME( 1989, rtype2jc, rtype2, rtype2, rtype2, driver_device, 0, ROT0, "Irem", "R-Type II (Japan, revision C)", GAME_NO_COCKTAIL ) +GAME( 1989, rtype2, 0, rtype2, rtype2, driver_device, 0, ROT0, "Irem", "R-Type II", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1989, rtype2j, rtype2, rtype2, rtype2, driver_device, 0, ROT0, "Irem", "R-Type II (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1989, rtype2jc, rtype2, rtype2, rtype2, driver_device, 0, ROT0, "Irem", "R-Type II (Japan, revision C)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1990, majtitle, 0, majtitle, rtype2, driver_device, 0, ROT0, "Irem", "Major Title (World)", GAME_NO_COCKTAIL ) -GAME( 1990, majtitlej, majtitle, majtitle, rtype2, driver_device, 0, ROT0, "Irem", "Major Title (Japan)", GAME_NO_COCKTAIL ) +GAME( 1990, majtitle, 0, majtitle, rtype2, driver_device, 0, ROT0, "Irem", "Major Title (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1990, majtitlej, majtitle, majtitle, rtype2, driver_device, 0, ROT0, "Irem", "Major Title (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1990, hharry, 0, hharry, hharry, driver_device, 0, ROT0, "Irem", "Hammerin' Harry (World)", GAME_NO_COCKTAIL ) -GAME( 1990, hharryu, hharry, hharryu, hharry, driver_device, 0, ROT0, "Irem America", "Hammerin' Harry (US)", GAME_NO_COCKTAIL ) -GAME( 1990, dkgensan, hharry, hharryu, hharry, driver_device, 0, ROT0, "Irem", "Daiku no Gensan (Japan, M82)", GAME_NO_COCKTAIL ) -GAME( 1990, dkgensanm72, hharry, dkgenm72, hharry, m72_state, dkgenm72, ROT0, "Irem", "Daiku no Gensan (Japan, M72)", GAME_NO_COCKTAIL ) +GAME( 1990, hharry, 0, hharry, hharry, driver_device, 0, ROT0, "Irem", "Hammerin' Harry (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1990, hharryu, hharry, hharryu, hharry, driver_device, 0, ROT0, "Irem America", "Hammerin' Harry (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1990, dkgensan, hharry, hharryu, hharry, driver_device, 0, ROT0, "Irem", "Daiku no Gensan (Japan, M82)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1990, dkgensanm72, hharry, dkgenm72, hharry, m72_state, dkgenm72, ROT0, "Irem", "Daiku no Gensan (Japan, M72)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1990, poundfor, 0, poundfor, poundfor, driver_device, 0, ROT270, "Irem", "Pound for Pound (World)", GAME_NO_COCKTAIL ) -GAME( 1990, poundforj, poundfor, poundfor, poundfor, driver_device, 0, ROT270, "Irem", "Pound for Pound (Japan)", GAME_NO_COCKTAIL ) -GAME( 1990, poundforu, poundfor, poundfor, poundfor, driver_device, 0, ROT270, "Irem America", "Pound for Pound (US)", GAME_NO_COCKTAIL ) +GAME( 1990, poundfor, 0, poundfor, poundfor, driver_device, 0, ROT270, "Irem", "Pound for Pound (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1990, poundforj, poundfor, poundfor, poundfor, driver_device, 0, ROT270, "Irem", "Pound for Pound (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1990, poundforu, poundfor, poundfor, poundfor, driver_device, 0, ROT270, "Irem America", "Pound for Pound (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1990, airduel, 0, m72, airduel, m72_state, airduel, ROT270, "Irem", "Air Duel (Japan)", 0 ) +GAME( 1990, airduel, 0, m72, airduel, m72_state, airduel, ROT270, "Irem", "Air Duel (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1991, cosmccop, 0, cosmccop, gallop, driver_device, 0, ROT0, "Irem", "Cosmic Cop (World)", GAME_NO_COCKTAIL ) -GAME( 1991, gallop, cosmccop, m72, gallop, m72_state, gallop, ROT0, "Irem", "Gallop - Armed Police Unit (Japan)", GAME_NO_COCKTAIL ) +GAME( 1991, cosmccop, 0, cosmccop, gallop, driver_device, 0, ROT0, "Irem", "Cosmic Cop (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) +GAME( 1991, gallop, cosmccop, m72, gallop, m72_state, gallop, ROT0, "Irem", "Gallop - Armed Police Unit (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) -GAME( 1991, kengo, 0, kengo, kengo, driver_device, 0, ROT0, "Irem", "Ken-Go", GAME_NO_COCKTAIL ) +GAME( 1991, kengo, 0, kengo, kengo, driver_device, 0, ROT0, "Irem", "Ken-Go", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c index d58ca5a2213..27134b2843b 100644 --- a/src/mame/drivers/madalien.c +++ b/src/mame/drivers/madalien.c @@ -437,7 +437,7 @@ ROM_START( madalienb ) ROM_LOAD( "mc-1.3k", 0x0000, 0x0400, BAD_DUMP CRC(2710c47e) SHA1(337e4f160c7db143ec3bfae3e08e8789b9e41cc5) ) // taken from chwy, see below, tile 2 is mismatched with the 2 roms from the actual PCB. ROM_LOAD( "me-1.3l", 0x0400, 0x0400, CRC(7328a425) SHA1(327adc8b0e25d93f1ae98a44c26d0aaaac1b1a9c) ) ROM_LOAD( "md-1.3m", 0x0800, 0x0400, CRC(b5329929) SHA1(86890e1b7cc8cb31fc0dcbc2d3cff02e4cf95619) ) - + /* for reference, this is the data used by Highway Chase on the cassette system when extracted ROM_REGION( 0x0400, "user1", 0 ) // background tile map ROM_LOAD( "rom1", 0x0000, 0x0400, CRC(9b04c446) SHA1(918013f3c0244ab6a670b9d1b6b642298e2c5ab8) ) diff --git a/src/mame/drivers/mainsnk.c b/src/mame/drivers/mainsnk.c index e7e8603601b..68297d6b886 100644 --- a/src/mame/drivers/mainsnk.c +++ b/src/mame/drivers/mainsnk.c @@ -11,11 +11,11 @@ Notes: The game uses 2 joysticks (with button on top) and 2 buttons per player. Left stick up: left straight punch to enemy's face - left: swey to left + left: sway to left Right stick up: right straight punch to enemy's face - right: swey to right + right: sway to right Left + Right stick combinations L down + R up: right straight punch to enemy's body @@ -112,6 +112,12 @@ cc_p14.j2 8192 0xedc6a1eb M5L2764k #include "sound/ay8910.h" #include "includes/mainsnk.h" + +void mainsnk_state::machine_start() +{ + save_item(NAME(m_sound_cpu_busy)); +} + WRITE8_MEMBER(mainsnk_state::sound_command_w) { m_sound_cpu_busy = 1; @@ -119,18 +125,13 @@ WRITE8_MEMBER(mainsnk_state::sound_command_w) m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } -READ8_MEMBER(mainsnk_state::sound_command_r) -{ - return soundlatch_byte_r(space, 0); -} - READ8_MEMBER(mainsnk_state::sound_ack_r) { m_sound_cpu_busy = 0; return 0xff; } -CUSTOM_INPUT_MEMBER(mainsnk_state::mainsnk_sound_r) +CUSTOM_INPUT_MEMBER(mainsnk_state::sound_r) { return (m_sound_cpu_busy) ? 0x01 : 0x00; } @@ -145,18 +146,18 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, mainsnk_state ) AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3") AM_RANGE(0xc400, 0xc400) AM_READ_PORT("DSW1") AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW2") - AM_RANGE(0xc600, 0xc600) AM_WRITE(mainsnk_c600_w) + AM_RANGE(0xc600, 0xc600) AM_WRITE(c600_w) AM_RANGE(0xc700, 0xc700) AM_WRITE(sound_command_w) - AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(mainsnk_bgram_w) AM_SHARE("bgram") + AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(bgram_w) AM_SHARE("bgram") AM_RANGE(0xdc00, 0xe7ff) AM_RAM AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("spriteram") - AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(mainsnk_fgram_w) AM_SHARE("fgram") // + work RAM + AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(fgram_w) AM_SHARE("fgram") // + work RAM ADDRESS_MAP_END static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, mainsnk_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0xa000, 0xa000) AM_READ(sound_command_r) + AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) AM_RANGE(0xc000, 0xc000) AM_READ(sound_ack_r) AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ay1", ay8910_device, address_data_w) AM_RANGE(0xe002, 0xe003) AM_WRITENOP // ? always FFFF, snkwave leftover? @@ -177,7 +178,7 @@ static INPUT_PORTS_START( mainsnk ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mainsnk_state,mainsnk_sound_r, NULL) /* sound CPU status */ + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mainsnk_state, sound_r, NULL) /* sound CPU status */ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) @@ -271,7 +272,7 @@ static INPUT_PORTS_START( canvas ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mainsnk_state,mainsnk_sound_r, NULL) /* sound CPU status */ + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mainsnk_state, sound_r, NULL) /* sound CPU status */ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) @@ -399,7 +400,7 @@ static MACHINE_CONFIG_START( mainsnk, mainsnk_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(36*8, 28*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1) - MCFG_SCREEN_UPDATE_DRIVER(mainsnk_state, screen_update_mainsnk) + MCFG_SCREEN_UPDATE_DRIVER(mainsnk_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", mainsnk) @@ -483,5 +484,5 @@ ROM_START( canvas ) ROM_END -GAME( 1984, mainsnk, 0, mainsnk, mainsnk, driver_device, 0, ROT0, "SNK", "Main Event (1984)", 0) -GAME( 1985, canvas, 0, mainsnk, canvas, driver_device, 0, ROT0, "SNK", "Canvas Croquis", 0) +GAME( 1984, mainsnk, 0, mainsnk, mainsnk, driver_device, 0, ROT0, "SNK", "Main Event (1984)", GAME_SUPPORTS_SAVE ) +GAME( 1985, canvas, 0, mainsnk, canvas, driver_device, 0, ROT0, "SNK", "Canvas Croquis", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c index 5baa1d7c4d0..b8e72700fd2 100644 --- a/src/mame/drivers/mgolf.c +++ b/src/mame/drivers/mgolf.c @@ -47,18 +47,18 @@ public: DECLARE_READ8_MEMBER(dial_r); DECLARE_READ8_MEMBER(misc_r); DECLARE_WRITE8_MEMBER(wram_w); - + TILE_GET_INFO_MEMBER(get_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(mgolf); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + TIMER_CALLBACK_MEMBER(interrupt_callback); - + void update_plunger( ); double calc_plunger_pos(); @@ -343,7 +343,7 @@ GFXDECODE_END void mgolf_state::machine_start() { m_interrupt_timer = timer_alloc(TIMER_INTERRUPT); - + save_item(NAME(m_prev)); save_item(NAME(m_mask)); save_item(NAME(m_time_pushed)); diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c index f6b9b707959..47c2ab5ad4d 100644 --- a/src/mame/drivers/mirax.c +++ b/src/mame/drivers/mirax.c @@ -93,7 +93,7 @@ Stephh's notes (based on the games Z80 code and some tests) : * different stages names : . stages 1 to 10 : "LUXORI" instead of "MIRAX" . stages 71 to 80 : "DESCOM" instead of "DESBOM" - futhermore, for all stages, it's written "UNIT" instead of "CITY" + furthermore, for all stages, it's written "UNIT" instead of "CITY" - Same ingame bug as in 'mirax' when you reach level 100 (of course, it will display "LUXORI UNIT" instead of "MIRAX CITY" on "presentation" screen). @@ -110,40 +110,46 @@ class mirax_state : public driver_device public: mirax_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_colorram(*this, "colorram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_colorram(*this, "colorram") { } + + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_colorram; + UINT8 m_nAyCtrl; UINT8 m_nmi_mask; UINT8 m_flipscreen_x; UINT8 m_flipscreen_y; + DECLARE_WRITE8_MEMBER(audio_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); - DECLARE_WRITE8_MEMBER(mirax_sound_cmd_w); - DECLARE_WRITE8_MEMBER(mirax_coin_counter0_w); - DECLARE_WRITE8_MEMBER(mirax_coin_counter1_w); - DECLARE_WRITE8_MEMBER(mirax_flip_screen_w); + DECLARE_WRITE8_MEMBER(sound_cmd_w); + DECLARE_WRITE8_MEMBER(coin_counter0_w); + DECLARE_WRITE8_MEMBER(coin_counter1_w); + DECLARE_WRITE8_MEMBER(flip_screen_w); DECLARE_WRITE8_MEMBER(ay1_sel); DECLARE_WRITE8_MEMBER(ay2_sel); + DECLARE_DRIVER_INIT(mirax); DECLARE_PALETTE_INIT(mirax); - virtual void sound_start(); - UINT32 screen_update_mirax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(mirax_vblank_irq); + virtual void machine_start(); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + INTERRUPT_GEN_MEMBER(vblank_irq); }; @@ -207,32 +213,29 @@ void mirax_state::draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, void mirax_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *spriteram = m_spriteram; - int count; - - for(count=0;count<0x200;count+=4) + for(int count=0;count<0x200;count+=4) { int spr_offs,x,y,color,fx,fy; - if(spriteram[count] == 0x00 || spriteram[count+3] == 0x00) + if(m_spriteram[count] == 0x00 || m_spriteram[count+3] == 0x00) continue; - spr_offs = (spriteram[count+1] & 0x3f); - color = spriteram[count+2] & 0x7; - fx = (m_flipscreen_x) ^ ((spriteram[count+1] & 0x40) >> 6); //<- guess - fy = (m_flipscreen_y) ^ ((spriteram[count+1] & 0x80) >> 7); + spr_offs = (m_spriteram[count+1] & 0x3f); + color = m_spriteram[count+2] & 0x7; + fx = (m_flipscreen_x) ^ ((m_spriteram[count+1] & 0x40) >> 6); //<- guess + fy = (m_flipscreen_y) ^ ((m_spriteram[count+1] & 0x80) >> 7); - spr_offs += (spriteram[count+2] & 0xe0)<<1; - spr_offs += (spriteram[count+2] & 0x10)<<5; + spr_offs += (m_spriteram[count+2] & 0xe0)<<1; + spr_offs += (m_spriteram[count+2] & 0x10)<<5; - y = (m_flipscreen_y) ? spriteram[count] : 0x100 - spriteram[count] - 16; - x = (m_flipscreen_x) ? 240 - spriteram[count+3] : spriteram[count+3]; + y = (m_flipscreen_y) ? m_spriteram[count] : 0x100 - m_spriteram[count] - 16; + x = (m_flipscreen_x) ? 240 - m_spriteram[count+3] : m_spriteram[count+3]; m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,spr_offs,color,fx,fy,x,y,0); } } -UINT32 mirax_state::screen_update_mirax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 mirax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { draw_tilemap(bitmap,cliprect,1); draw_sprites(bitmap,cliprect); @@ -241,9 +244,14 @@ UINT32 mirax_state::screen_update_mirax(screen_device &screen, bitmap_ind16 &bit } -void mirax_state::sound_start() +void mirax_state::machine_start() { m_nAyCtrl = 0x00; + + save_item(NAME(m_nAyCtrl)); + save_item(NAME(m_nmi_mask)); + save_item(NAME(m_flipscreen_x)); + save_item(NAME(m_flipscreen_y)); } WRITE8_MEMBER(mirax_state::audio_w) @@ -272,25 +280,25 @@ WRITE8_MEMBER(mirax_state::nmi_mask_w) printf("Warning: %02x written at $f501\n",data); } -WRITE8_MEMBER(mirax_state::mirax_sound_cmd_w) +WRITE8_MEMBER(mirax_state::sound_cmd_w) { soundlatch_byte_w(space, 0, data & 0xff); m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } -WRITE8_MEMBER(mirax_state::mirax_coin_counter0_w) +WRITE8_MEMBER(mirax_state::coin_counter0_w) { coin_counter_w(machine(), 0, data & 1); } -WRITE8_MEMBER(mirax_state::mirax_coin_counter1_w) +WRITE8_MEMBER(mirax_state::coin_counter1_w) { coin_counter_w(machine(), 1, data & 1); } /* One address flips X, the other flips Y, but I can't tell which is which - Since the value is the same for the 2 addresses, it doesn't really matter */ -WRITE8_MEMBER(mirax_state::mirax_flip_screen_w) +WRITE8_MEMBER(mirax_state::flip_screen_w) { if (offset == 0) m_flipscreen_x = data & 0x01; @@ -310,11 +318,11 @@ static ADDRESS_MAP_START( mirax_main_map, AS_PROGRAM, 8, mirax_state ) AM_RANGE(0xf200, 0xf200) AM_READ_PORT("DSW1") AM_RANGE(0xf300, 0xf300) AM_READNOP //watchdog? value is always read then discarded AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW2") - AM_RANGE(0xf500, 0xf500) AM_WRITE(mirax_coin_counter0_w) + AM_RANGE(0xf500, 0xf500) AM_WRITE(coin_counter0_w) AM_RANGE(0xf501, 0xf501) AM_WRITE(nmi_mask_w) - AM_RANGE(0xf502, 0xf502) AM_WRITE(mirax_coin_counter1_w) // only used in 'miraxa' - see notes - AM_RANGE(0xf506, 0xf507) AM_WRITE(mirax_flip_screen_w) - AM_RANGE(0xf800, 0xf800) AM_WRITE(mirax_sound_cmd_w) + AM_RANGE(0xf502, 0xf502) AM_WRITE(coin_counter1_w) // only used in 'miraxa' - see notes + AM_RANGE(0xf506, 0xf507) AM_WRITE(flip_screen_w) + AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_cmd_w) // AM_RANGE(0xf900, 0xf900) //sound cmd mirror? ack? ADDRESS_MAP_END @@ -455,7 +463,7 @@ static GFXDECODE_START( mirax ) GFXDECODE_END -INTERRUPT_GEN_MEMBER(mirax_state::mirax_vblank_irq) +INTERRUPT_GEN_MEMBER(mirax_state::vblank_irq) { if(m_nmi_mask) device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -464,7 +472,7 @@ INTERRUPT_GEN_MEMBER(mirax_state::mirax_vblank_irq) static MACHINE_CONFIG_START( mirax, mirax_state ) MCFG_CPU_ADD("maincpu", Z80, 12000000/4) // ceramic potted module, encrypted z80 MCFG_CPU_PROGRAM_MAP(mirax_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", mirax_state, mirax_vblank_irq) + MCFG_CPU_VBLANK_INT_DRIVER("screen", mirax_state, vblank_irq) MCFG_CPU_ADD("audiocpu", Z80, 12000000/4) MCFG_CPU_PROGRAM_MAP(mirax_sound_map) @@ -476,7 +484,7 @@ static MACHINE_CONFIG_START( mirax, mirax_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(mirax_state, screen_update_mirax) + MCFG_SCREEN_UPDATE_DRIVER(mirax_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x40) @@ -572,5 +580,5 @@ DRIVER_INIT_MEMBER(mirax_state,mirax) m_flipscreen_y = 0; } -GAME( 1985, mirax, 0, mirax, mirax, mirax_state, mirax, ROT90, "Current Technologies", "Mirax (set 1)", 0 ) -GAME( 1985, miraxa, mirax, mirax, miraxa, mirax_state, mirax, ROT90, "Current Technologies", "Mirax (set 2)", 0 ) +GAME( 1985, mirax, 0, mirax, mirax, mirax_state, mirax, ROT90, "Current Technologies", "Mirax (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1985, miraxa, mirax, mirax, miraxa, mirax_state, mirax, ROT90, "Current Technologies", "Mirax (set 2)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/namcops2.c b/src/mame/drivers/namcops2.c index 7e1e5b11c66..09a76e62403 100644 --- a/src/mame/drivers/namcops2.c +++ b/src/mame/drivers/namcops2.c @@ -310,6 +310,54 @@ ROM_START( sukuinuf ) DISK_IMAGE_READONLY( "hm-in2", 0, SHA1(4e2d95798a2bcc6f93bc82c364379a3936d68986) ) ROM_END +ROM_START( taiko7 ) + ROM_REGION(0x200000, "bios", 0) + SYSTEM246_BIOS + + ROM_REGION(0x840000, "key", ROMREGION_ERASE00) + ROM_LOAD( "tk71.ic002", 0x000000, 0x800000, CRC(0560e525) SHA1(3ae378de908ec2f6472867d4d0c3c19eb51cf8bc) ) + ROM_LOAD( "tk71_spr.ic002", 0x800000, 0x040000, CRC(245233a5) SHA1(a5dd1eb0350d454396984241c1178ec708a7de55) ) + + DISK_REGION("dvd") + DISK_IMAGE_READONLY( "tk71dvd0", 0, SHA1(622ffc8f71f50e93069a8e91b56a7e63cf98b5ae) ) +ROM_END + +ROM_START( taiko8 ) + ROM_REGION(0x200000, "bios", 0) + SYSTEM246_BIOS + + ROM_REGION(0x840000, "key", ROMREGION_ERASE00) + ROM_LOAD( "tk81001-na-a.ic002", 0x000000, 0x800000, CRC(205410cf) SHA1(8379771d82c9d8b09ad593e28872107ecc0100ad) ) + ROM_LOAD( "tk81001-na-a_spr.ic002", 0x800000, 0x040000, CRC(590c8d80) SHA1(30622142428e37b8c3b91dee7fdd147d593b4d6f) ) + + DISK_REGION("dvd") + DISK_IMAGE_READONLY( "tk8100-1-na-dvd0-a", 0, SHA1(81a2a9d7164495af825ad038fbf6f696e755ab9c) ) +ROM_END + +ROM_START( zoidsinf ) + ROM_REGION(0x200000, "bios", 0) + SYSTEM246_BIOS + + ROM_REGION(0x840000, "key", ROMREGION_ERASE00) + ROM_LOAD( "b3900076a.ic002", 0x000000, 0x800000, CRC(4cdc2e4f) SHA1(7c53e519683903e5ae53823b7d0644323be23680) ) + ROM_LOAD( "b3900076a_spr.ic002", 0x800000, 0x040000, CRC(7a7bf195) SHA1(0970251ba203720b2b769d6195bff06b41931b17) ) + + DISK_REGION("dvd") + DISK_IMAGE_READONLY( "zoidsinf", 0, SHA1(aca35eb554bf906898b3ebc27e65f652a72d63f8) ) +ROM_END + +ROM_START( zoidiexp ) + ROM_REGION(0x200000, "bios", 0) + SYSTEM246_BIOS + + ROM_REGION(0x840000, "key", ROMREGION_ERASE00) + ROM_LOAD( "b3900107a.ic002", 0x000000, 0x800000, CRC(1729af4a) SHA1(df5fb0841f4a81aae68382f731b96437572cdffd) ) + ROM_LOAD( "b3900107a_spr.ic002", 0x800000, 0x040000, CRC(b3d56cd4) SHA1(1e0afeba4881892682d1f91be8e0b880ee7a7fcb) ) + + DISK_REGION("dvd") + DISK_IMAGE_READONLY( "zoidsinf-ex-plus-ver2-10", 0, SHA1(6671afc45c8b506a15e5b4b09645b956ab4cfe99) ) +ROM_END + ROM_START( taiko9 ) ROM_REGION(0x200000, "bios", 0) SYSTEM256_BIOS @@ -693,9 +741,12 @@ GAME(2003, zgundm, sys246, system246, system246, driver_device, 0, ROT0, "Ca GAME(2004, fghtjam, sys246, system246, system246, driver_device, 0, ROT0, "Capcom / Namco", "Capcom Fighting Jam (JAM1 Ver. A)", GAME_IS_SKELETON) GAME(2004, sukuinuf, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Quiz and Variety Suku Suku Inufuku 2 (IN2 Ver. A)", GAME_IS_SKELETON) GAME(2004, zgundmdx, sys246, system246, system246, driver_device, 0, ROT0, "Capcom / Banpresto", "Mobile Suit Z-Gundam: A.E.U.G. vs Titans DX (ZDX1 Ver. A)", GAME_IS_SKELETON) +GAME(2004, zoidsinf, sys246, system246, system246, driver_device, 0, ROT0, "Tomy / Taito", "Zoids Infinity", GAME_IS_SKELETON) GAME(2005, gundzaft, sys246, system246, system246, driver_device, 0, ROT0, "Capcom / Banpresto", "Gundam Seed: Federation vs. Z.A.F.T. (SED1 Ver. A)", GAME_IS_SKELETON) GAME(2005, soulclb3, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Soul Calibur III (SC31001-NA-A)", GAME_IS_SKELETON) GAME(2005, soulclb3a,soulclb3, system246, system246, driver_device, 0, ROT0, "Namco", "Soul Calibur III (SC31002-NA-A)", GAME_IS_SKELETON) +GAME(2005, taiko7, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Taiko No Tatsujin 7 (TK71-NA-A)", GAME_IS_SKELETON) +GAME(2006, taiko8, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Taiko No Tatsujin 8 (TK8100-1-NA-A)", GAME_IS_SKELETON) GAME(2006, qgundam, sys246, system246, system246, driver_device, 0, ROT0, "Namco", "Quiz Mobile Suit Gundam: Monsenshi (QG1 Ver. A)", GAME_IS_SKELETON) GAME(2008, fateulc, sys246, system246, system246, driver_device, 0, ROT0, "Capcom / Namco", "Fate: Unlimited Codes (FUD1 ver. A)", GAME_IS_SKELETON) GAME(2008, fateulcb, fateulc, system246, system246, driver_device, 0, ROT0, "bootleg", "Fate: Unlimited Codes (bootleg)", GAME_IS_SKELETON) @@ -709,6 +760,7 @@ GAME(2005, superdbz, sys256, system256, system246, driver_device, 0, ROT0, "Ba GAME(2006, kinniku, sys256, system256, system246, driver_device, 0, ROT0, "Namco", "Kinnikuman Muscle Grand Prix (KN1 Ver. A)", GAME_IS_SKELETON) GAME(2006, taiko9, sys256, system256, system246, driver_device, 0, ROT0, "Namco", "Taiko No Tatsujin 9 (TK91001-NA-A)", GAME_IS_SKELETON) GAME(2006, yuyuhaku, sys256, system256, system246, driver_device, 0, ROT0, "Banpresto", "The Battle of Yu Yu Hakusho: Shitou! Ankoku Bujutsukai!", GAME_IS_SKELETON) +GAME(2006, zoidiexp, sys246, system246, system246, driver_device, 0, ROT0, "Tomy / Taito", "Zoids Infinity EX Plus (ver. 2.10)", GAME_IS_SKELETON) GAME(2007, kinniku2, sys256, system256, system246, driver_device, 0, ROT0, "Namco", "Kinnikuman Muscle Grand Prix 2 (KN2 Ver. A)", GAME_IS_SKELETON) GAME(2007, taiko10, sys256, system256, system246, driver_device, 0, ROT0, "Namco", "Taiko No Tatsujin 10 (T101001-NA-A)", GAME_IS_SKELETON) GAME(2008, gdvsgd, sys256, system256, system246, driver_device, 0, ROT0, "Capcom / Bandai", "Gundam vs. Gundam (GVS1 Ver. A)", GAME_IS_SKELETON) diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c index 6f7088672df..d3d2d988edd 100644 --- a/src/mame/drivers/namcos23.c +++ b/src/mame/drivers/namcos23.c @@ -3223,7 +3223,7 @@ void namcos23_state::machine_start() m_c361.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos23_state::c361_timer_cb),this)); m_c361.timer->adjust(attotime::never); - m_maincpu->mips3drc_add_fastram(0, m_mainram.bytes()-1, FALSE, reinterpret_cast<UINT32 *>(memshare("mainram")->ptr())); + m_maincpu->add_fastram(0, m_mainram.bytes()-1, FALSE, reinterpret_cast<UINT32 *>(memshare("mainram")->ptr())); } diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index 7f013ab6ebf..b0150583590 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -27,6 +27,21 @@ Compatibility list (as per 26-jun-2013) - puyofev: hangs after pressing start (bp 0C03F490, similar if not same snippet as Tetris 4d on DC). - vtennisg: crashes after stage screen. +(25-mar-2015) +- sl2007: +0C04697A: MOV.L @($28,R14),R0 ;8c167734 +0C04697C: TST R0,R0 +0C04697E: BT $0C046998 +0C046980: BRA $0C046990 +0C04698E: BT $0C046998 +0C046990: MOV.L @($28,R14),R3 +0C046992: MOV #$FD,R5 +0C046994: JSR R3 +0C046608: NOP +0C04660A: BRA $0C04660A ;tight loops there, NOP-ing this opcode makes to go further, perhaps not supposed to go here in the first place? +0C046608: NOP + + TODO (general): - all games that uses YUV just updates one frame then dies, why? - Some SH to ARM sound streaming doesn't work (used by ADX compression system) diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index 52918dd89b1..9357761b511 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -238,9 +238,9 @@ . NEO-AEG CHA42G-3 . NEO-AEG CHA42G-4 . NEO-AEG CHA256 - . NEO-AEG CHA256 B + . NEO-AEG CHA256 B . NEO-AEG CHA256[B] - . NEO-AEG CHA256BY + . NEO-AEG CHA256BY . NEO-AEG CHA256RY . NEO-AEG CHA512Y . NEO-AEG CHAFIO (1999.8.10) - used with NEO-CMC 90G06C7042 or NEO-CMC 90G06C7050 @@ -263,7 +263,7 @@ . NEO-AEG PROG4096 B . NEO-AEG PROGGS . NEO-AEG PROGTOP2 - . NEO-AEG PROGTOP2Y + . NEO-AEG PROGTOP2Y . NEO-AEG PROGEOP (1999.4.2) . NEO-AEG PROGLBA (1999.7.6) . NEO-AEG PROGRK @@ -310,16 +310,16 @@ GIGA PROG Board 1.0 GIGA PROG Board 1.5 - - Unofficial pcb's from NEOBITZ: - - MVS CHA: - CHARBITZ1 2013.12.01 - - MVS PROG: - PROGBITZ1 2013.12.01 - - + + Unofficial pcb's from NEOBITZ: + + MVS CHA: + CHARBITZ1 2013.12.01 + + MVS PROG: + PROGBITZ1 2013.12.01 + + Neo-Geo game PCB infos by Johnboy diff --git a/src/mame/drivers/neogeo_noslot.c b/src/mame/drivers/neogeo_noslot.c index dea6d008728..9c839f06fd8 100644 --- a/src/mame/drivers/neogeo_noslot.c +++ b/src/mame/drivers/neogeo_noslot.c @@ -1237,7 +1237,7 @@ ROM_END ID-0023 . NGM-023 NEO-MVS PROG42G / NEO-MVS CHA42G - NEO-MVS PROGTOP / NEO-MVS CHA-256 + NEO-MVS PROGTOP / NEO-MVS CHA-256 Boards used for the Korean release . NGH-023 NEO-AEG PROG42G-1 / NEO-AEG CHA42G-1 @@ -1915,7 +1915,7 @@ ROM_START( aof ) /* MVS AND AES VERSION */ ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "044-p1.p1", 0x000000, 0x080000, CRC(ca9f7a6d) SHA1(4d28ef86696f7e832510a66d3e8eb6c93b5b91a1) ) /* TC534200 */ /* also found sets with ep1 or p1 on eprom. */ - + NEO_SFIX_128K( "044-s1.s1", CRC(89903f39) SHA1(a04a0c244a5d5c7a595fcf649107969635a6a8b6) ) /* TC531000 */ NEO_BIOS_AUDIO_128K( "044-m1.m1", CRC(0987e4bb) SHA1(8fae4b7fac09d46d4727928e609ed9d3711dbded) ) /* TC531001 */ @@ -1950,7 +1950,7 @@ ROM_START( samsho ) /* MVS VERSION */ ROM_LOAD16_WORD_SWAP( "045-p1.p1", 0x000000, 0x100000, CRC(dfe51bf0) SHA1(2243af3770a516ae698b69bcd9daf53632d9128d) ) /* TC538200 */ ROM_LOAD16_WORD_SWAP( "045-pg2.sp2", 0x100000, 0x100000, CRC(46745b94) SHA1(d9e959fd1f88c9402915c1d0dcdb4a9e3d49cdcb) ) /* TC538200 */ /* also found set with ep1 / ep2 on eprom and sp2 on maskrom; same rom data as samshoh is used. */ - + NEO_SFIX_128K( "045-s1.s1", CRC(9142a4d3) SHA1(54088e99fcfd75fd0f94852890a56350066a05a3) ) /* TC531000 */ NEO_BIOS_AUDIO_128K( "045-m1.m1", CRC(95170640) SHA1(125c502db0693e8d11cef619b090081c14a9a300) ) /* TC531001 */ @@ -2271,7 +2271,7 @@ ROM_START( wh1h ) /* AES VERSION */ ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "053-p1.p1", 0x000000, 0x080000, CRC(95b574cb) SHA1(b7b7af6a04c3d902e7f8852897741ecaf0b1062c) ) /* TC534200 */ ROM_LOAD16_WORD_SWAP( "053-p2.p2", 0x080000, 0x080000, CRC(f198ed45) SHA1(24ccc091e97f63796562bb5b30df51f39bd504ef) ) /* TC534200 */ - + NEO_SFIX_128K( "053-s1.s1", CRC(8c2c2d6b) SHA1(87fa79611c6f8886dcc8766814829c669c65b40f) ) /* TC531000 */ NEO_BIOS_AUDIO_128K( "053-m1.m1", CRC(1bd9d04b) SHA1(65cd7b002123ed1a3111e3d942608d0082799ff3) ) /* TC531001 */ @@ -2615,7 +2615,7 @@ ROM_START( ssideki2 ) /* MVS AND AES VERSION */ ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "061-p1.p1", 0x000000, 0x100000, CRC(5969e0dc) SHA1(78abea880c125ec5a85bef6404478512a34b5513) ) /* mask rom TC538200 */ /* also found MVS sets with ep1 / ep2 on eprom; correct chip label unknown. */ - + NEO_SFIX_128K( "061-s1.s1", CRC(226d1b68) SHA1(de010f6fda3ddadb181fe37daa6105f22e78b970) ) /* mask rom TC531000 */ NEO_BIOS_AUDIO_128K( "061-m1.m1", CRC(156f6951) SHA1(49686f615f109a02b4f23931f1c84fee13872ffd) ) /* mask rom TC531001 */ @@ -2679,7 +2679,7 @@ ROM_START( samsho2 ) /* MVS AND AES VERSION */ ROM_LOAD16_WORD_SWAP( "063-p1.p1", 0x100000, 0x100000, CRC(22368892) SHA1(0997f8284aa0f57a333be8a0fdea777d0d01afd6) ) /* TC5316200 */ ROM_CONTINUE( 0x000000, 0x100000 ) /* also found MVS sets with ep1 / ep2 on eprom and p1 / sp2 on maskrom; correct chip label unknown */ - + NEO_SFIX_128K( "063-s1.s1", CRC(64a5cd66) SHA1(12cdfb27bf9ccd5a8df6ddd4628ef7cf2c6d4964) ) /* TC531000 */ NEO_BIOS_AUDIO_128K( "063-m1.m1", CRC(56675098) SHA1(90429fc40d056d480d0e2bbefbc691d9fa260fc4) ) /* TC531001 */ @@ -2965,7 +2965,7 @@ ROM_END BANK 3 NOT USED ****************************************/ - ROM_START( b2b ) + ROM_START( b2b ) ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "071.p1", 0x000000, 0x080000, CRC(7687197d) SHA1(4bb9cb7819807f7a7e1f85f1c4faac4a2f8761e8) ) @@ -4252,7 +4252,7 @@ ROM_START( kof96 ) /* MVS VERSION */ ROM_LOAD16_WORD_SWAP( "214-p1.p1", 0x000000, 0x100000, CRC(52755d74) SHA1(4232d627f1d2e6ea9fc8cf01571d77d4d5b8a1bb) ) /* TC538200 */ ROM_LOAD16_WORD_SWAP( "214-p2.sp2", 0x100000, 0x200000, CRC(002ccb73) SHA1(3ae8df682c75027ca82db25491021eeba00a267e) ) /* TC5316200 */ /* also found sets with ep1 / ep2 / ep3 / ep4 on eprom and 214-P5 on TC5316200; correct chip labels for eproms is unknown */ - + NEO_SFIX_128K( "214-s1.s1", CRC(1254cbdb) SHA1(fce5cf42588298711a3633e9c9c1d4dcb723ac76) ) /* TC531000 */ NEO_BIOS_AUDIO_128K( "214-m1.m1", CRC(dabc427c) SHA1(b76722ed142ee7addceb4757424870dbd003e8b3) ) /* TC531001 */ @@ -5013,9 +5013,9 @@ ROM_START( lastblad ) /* MVS VERSION */ ROM_REGION( 0x500000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "234-p1.p1", 0x000000, 0x100000, CRC(e123a5a3) SHA1(a3ddabc00feeb54272b145246612ad4632b0e413) ) /* TC538200 */ ROM_LOAD16_WORD_SWAP( "234-p2.sp2", 0x100000, 0x400000, CRC(0fdc289e) SHA1(1ff31c0b0f4f9ddbedaf4bcf927faaae81892ec7) ) /* TC5332205 */ - /* also found sets with p1 / sp2 / ep1 / ep2 / m1 on eprom with sticker */ + /* also found sets with p1 / sp2 / ep1 / ep2 / m1 on eprom with sticker */ /* chip label is 0234-P1, 0234-SP2, 0234-EP1, 0234-EP2 and 0234-M1 */ - + NEO_SFIX_128K( "234-s1.s1", CRC(95561412) SHA1(995de272f572fd08d909d3d0af4251b9957b3640) ) /* TC531000 */ NEO_BIOS_AUDIO_128K( "234-m1.m1", CRC(087628ea) SHA1(48dcf739bb16699af4ab8ed632b7dcb25e470e06) ) /* TC531001 */ @@ -6193,7 +6193,7 @@ ROM_START( mslug3 ) /* Original Version - Encrypted Code & GFX */ /* revision 20 /* The SMA for this release has a green colour marking; the older revision has a white colour marking */ ROM_LOAD16_WORD_SWAP( "256-pg1.p1", 0x100000, 0x400000, CRC(b07edfd5) SHA1(dcbd9e500bfae98d754e55cdbbbbf9401013f8ee) ) /* TC5332202 */ ROM_LOAD16_WORD_SWAP( "256-pg2.p2", 0x500000, 0x400000, CRC(6097c26b) SHA1(248ec29d21216f29dc6f5f3f0e1ad1601b3501b6) ) /* TC5332202 */ - + ROM_Y_ZOOM /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ @@ -6230,7 +6230,7 @@ ROM_START( mslug3h ) /* Original Version - Encrypted GFX */ /* revision 2000.3.1 ROM_LOAD16_WORD_SWAP( "256-ph2.sp2", 0x100000, 0x400000, CRC(1f3d8ce8) SHA1(08b05a8abfb86ec09a5e758d6273acf1489961f9) ) /* also found AES set with p1 / p2 on maskrom on NEO-AEG PROGLBA (NEO-SMA); chip labels is 256-PG1 and 256-PG2 */ /* The SMA for this release has a pink color marking */ - + ROM_Y_ZOOM /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ @@ -6748,7 +6748,7 @@ ROM_START( pnyaa ) /* Encrypted Set */ /* MVS ONLY RELEASE */ ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "267-p1.p1", 0x000000, 0x100000, CRC(112fe2c0) SHA1(01420e051f0bdbd4f68ce306a3738161b96f8ba8) ) /* mask rom TC538200 */ /* also found set with p1 and m1 on eprom with sticker; chip labels is PN 2.02 and M1 */ - + ROM_Y_ZOOM /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ @@ -6820,7 +6820,7 @@ ROM_START( mslug5h ) /* Encrypted Set */ /* AES release of the game but is also ROM_LOAD32_WORD_SWAP( "268-p1c.p1", 0x000000, 0x400000, CRC(3636690a) SHA1(e0da714b4bdc6efffe1250ded02ebddb3ab6d7b3) ) ROM_LOAD32_WORD_SWAP( "268-p2c.p2", 0x000002, 0x400000, CRC(8dfc47a2) SHA1(27d618cfbd0107a4d2a836797e967b39d2eb4851) ) /* also found AES set with p1 / p2 on maskrom; chip labels is 268-P1CR2 and 268-P2CR2 */ - + ROM_Y_ZOOM /* The Encrypted Boards do not have an s1 rom, data for it comes from the Cx ROMs */ diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c index 0ed984c085a..735a7b3be11 100644 --- a/src/mame/drivers/niyanpai.c +++ b/src/mame/drivers/niyanpai.c @@ -44,59 +44,17 @@ Memo: #include "includes/niyanpai.h" -void niyanpai_state::niyanpai_soundbank_w(int data) +WRITE8_MEMBER(niyanpai_state::soundbank_w) { - UINT8 *SNDROM = memregion("audiocpu")->base(); - - membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]); -} - -READ8_MEMBER(niyanpai_state::niyanpai_sound_r) -{ - return soundlatch_byte_r(space, 0); -} - -WRITE16_MEMBER(niyanpai_state::niyanpai_sound_w) -{ - soundlatch_byte_w(space, 0, ((data >> 8) & 0xff)); + membank("soundbank")->set_entry(data & 0x03); } -WRITE8_MEMBER(niyanpai_state::niyanpai_soundclr_w) +WRITE8_MEMBER(niyanpai_state::soundlatch_clear_w) { - soundlatch_clear_byte_w(space, 0, 0); + if (!(data & 0x01)) soundlatch_clear_byte_w(space, 0, 0); } -READ8_MEMBER(niyanpai_state::cpu_portd_r) -{ - return niyanpai_sound_r(space, 0); -} - -WRITE8_MEMBER(niyanpai_state::cpu_porta_w) -{ - niyanpai_soundbank_w(data & 0x03); -} - -WRITE8_MEMBER(niyanpai_state::cpu_portb_w) -{ - m_dac1->write_unsigned8(data); -} - -WRITE8_MEMBER(niyanpai_state::cpu_portc_w) -{ - m_dac2->write_unsigned8(data); -} - -WRITE8_MEMBER(niyanpai_state::cpu_porte_w) -{ - if (!(data & 0x01)) niyanpai_soundclr_w(space, 0, 0); -} - - -void niyanpai_state::machine_reset() -{ -} - DRIVER_INIT_MEMBER(niyanpai_state,niyanpai) { UINT8 *SNDROM = memregion("audiocpu")->base(); @@ -105,30 +63,32 @@ DRIVER_INIT_MEMBER(niyanpai_state,niyanpai) SNDROM[0x0213] = 0x00; // DI -> NOP // initialize sound rom bank - niyanpai_soundbank_w(0); + membank("soundbank")->configure_entries(0, 3, memregion("audiocpu")->base() + 0x8000, 0x8000); + membank("soundbank")->set_entry(0); // initialize out coin flag (musobana) m_musobana_outcoin_flag = 1; } -READ16_MEMBER(niyanpai_state::niyanpai_dipsw_r) +READ16_MEMBER(niyanpai_state::dipsw_r) { - UINT8 dipsw_a, dipsw_b; - - dipsw_a = (((ioport("DSWA")->read() & 0x01) << 7) | ((ioport("DSWA")->read() & 0x02) << 5) | - ((ioport("DSWA")->read() & 0x04) << 3) | ((ioport("DSWA")->read() & 0x08) << 1) | - ((ioport("DSWA")->read() & 0x10) >> 1) | ((ioport("DSWA")->read() & 0x20) >> 3) | - ((ioport("DSWA")->read() & 0x40) >> 5) | ((ioport("DSWA")->read() & 0x80) >> 7)); + UINT8 dipsw_a = ioport("DSWA")->read(); + UINT8 dipsw_b = ioport("DSWB")->read(); - dipsw_b = (((ioport("DSWB")->read() & 0x01) << 7) | ((ioport("DSWB")->read() & 0x02) << 5) | - ((ioport("DSWB")->read() & 0x04) << 3) | ((ioport("DSWB")->read() & 0x08) << 1) | - ((ioport("DSWB")->read() & 0x10) >> 1) | ((ioport("DSWB")->read() & 0x20) >> 3) | - ((ioport("DSWB")->read() & 0x40) >> 5) | ((ioport("DSWB")->read() & 0x80) >> 7)); + dipsw_a = BITSWAP8(dipsw_a,0,1,2,3,4,5,6,7); + dipsw_b = BITSWAP8(dipsw_b,0,1,2,3,4,5,6,7); return ((dipsw_a << 8) | dipsw_b); } +MACHINE_START_MEMBER(niyanpai_state, musobana) +{ + save_item(NAME(m_motor_on)); + save_item(NAME(m_musobana_inputport)); + save_item(NAME(m_musobana_outcoin_flag)); +} + READ16_MEMBER(niyanpai_state::musobana_inputport_0_r) { int portdata; @@ -177,33 +137,33 @@ static ADDRESS_MAP_START( niyanpai_map, AS_PROGRAM, 16, niyanpai_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x040000, 0x040fff) AM_RAM AM_SHARE("nvram") - AM_RANGE(0x0a0000, 0x0a08ff) AM_READWRITE(niyanpai_palette_r,niyanpai_palette_w) + AM_RANGE(0x0a0000, 0x0a08ff) AM_READWRITE(palette_r,palette_w) AM_RANGE(0x0a0900, 0x0a11ff) AM_RAM // palette work ram? AM_RANGE(0x0bf800, 0x0bffff) AM_RAM - AM_RANGE(0x200000, 0x200001) AM_WRITE(niyanpai_sound_w) + AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) AM_RANGE(0x200200, 0x200201) AM_WRITENOP // unknown AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown AM_RANGE(0x240200, 0x2403ff) AM_WRITENOP // unknown - AM_RANGE(0x240400, 0x240403) AM_READ8(niyanpai_blitter_0_r, 0x00ff) - AM_RANGE(0x240400, 0x24041f) AM_WRITE8(niyanpai_blitter_0_w, 0x00ff) - AM_RANGE(0x240420, 0x24043f) AM_WRITE8(niyanpai_clut_0_w, 0x00ff) - AM_RANGE(0x240600, 0x240603) AM_READ8(niyanpai_blitter_1_r, 0x00ff) - AM_RANGE(0x240600, 0x24061f) AM_WRITE8(niyanpai_blitter_1_w, 0x00ff) - AM_RANGE(0x240620, 0x24063f) AM_WRITE8(niyanpai_clut_1_w, 0x00ff) - AM_RANGE(0x240800, 0x240803) AM_READ8(niyanpai_blitter_2_r, 0x00ff) - AM_RANGE(0x240800, 0x24081f) AM_WRITE8(niyanpai_blitter_2_w, 0x00ff) - AM_RANGE(0x240820, 0x24083f) AM_WRITE8(niyanpai_clut_2_w, 0x00ff) - AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r) + AM_RANGE(0x240400, 0x240403) AM_READ8(blitter_0_r, 0x00ff) + AM_RANGE(0x240400, 0x24041f) AM_WRITE8(blitter_0_w, 0x00ff) + AM_RANGE(0x240420, 0x24043f) AM_WRITE8(clut_0_w, 0x00ff) + AM_RANGE(0x240600, 0x240603) AM_READ8(blitter_1_r, 0x00ff) + AM_RANGE(0x240600, 0x24061f) AM_WRITE8(blitter_1_w, 0x00ff) + AM_RANGE(0x240620, 0x24063f) AM_WRITE8(clut_1_w, 0x00ff) + AM_RANGE(0x240800, 0x240803) AM_READ8(blitter_2_r, 0x00ff) + AM_RANGE(0x240800, 0x24081f) AM_WRITE8(blitter_2_w, 0x00ff) + AM_RANGE(0x240820, 0x24083f) AM_WRITE8(clut_2_w, 0x00ff) + AM_RANGE(0x280000, 0x280001) AM_READ(dipsw_r) AM_RANGE(0x280200, 0x280201) AM_READ_PORT("P1_P2") AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM") - AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(niyanpai_clutsel_0_w, 0x00ff) - AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(niyanpai_clutsel_1_w, 0x00ff) - AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(niyanpai_clutsel_2_w, 0x00ff) + AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(clutsel_0_w, 0x00ff) + AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(clutsel_1_w, 0x00ff) + AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(clutsel_2_w, 0x00ff) AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers ADDRESS_MAP_END @@ -212,34 +172,34 @@ static ADDRESS_MAP_START( musobana_map, AS_PROGRAM, 16, niyanpai_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x040000, 0x040fff) AM_RAM - AM_RANGE(0x0a0000, 0x0a08ff) AM_READWRITE(niyanpai_palette_r,niyanpai_palette_w) + AM_RANGE(0x0a0000, 0x0a08ff) AM_READWRITE(palette_r,palette_w) AM_RANGE(0x0a0900, 0x0a11ff) AM_RAM // palette work ram? AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram") AM_RANGE(0x0bf800, 0x0bffff) AM_RAM - AM_RANGE(0x200000, 0x200001) AM_WRITE(niyanpai_sound_w) + AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown AM_RANGE(0x240200, 0x2403ff) AM_WRITENOP // unknown - AM_RANGE(0x240400, 0x240403) AM_READ8(niyanpai_blitter_0_r, 0x00ff) - AM_RANGE(0x240400, 0x24041f) AM_WRITE8(niyanpai_blitter_0_w, 0x00ff) - AM_RANGE(0x240420, 0x24043f) AM_WRITE8(niyanpai_clut_0_w, 0x00ff) + AM_RANGE(0x240400, 0x240403) AM_READ8(blitter_0_r, 0x00ff) + AM_RANGE(0x240400, 0x24041f) AM_WRITE8(blitter_0_w, 0x00ff) + AM_RANGE(0x240420, 0x24043f) AM_WRITE8(clut_0_w, 0x00ff) - AM_RANGE(0x240600, 0x240603) AM_READ8(niyanpai_blitter_1_r, 0x00ff) - AM_RANGE(0x240600, 0x24061f) AM_WRITE8(niyanpai_blitter_1_w, 0x00ff) - AM_RANGE(0x240620, 0x24063f) AM_WRITE8(niyanpai_clut_1_w, 0x00ff) + AM_RANGE(0x240600, 0x240603) AM_READ8(blitter_1_r, 0x00ff) + AM_RANGE(0x240600, 0x24061f) AM_WRITE8(blitter_1_w, 0x00ff) + AM_RANGE(0x240620, 0x24063f) AM_WRITE8(clut_1_w, 0x00ff) - AM_RANGE(0x240800, 0x240803) AM_READ8(niyanpai_blitter_2_r, 0x00ff) - AM_RANGE(0x240800, 0x24081f) AM_WRITE8(niyanpai_blitter_2_w, 0x00ff) - AM_RANGE(0x240820, 0x24083f) AM_WRITE8(niyanpai_clut_2_w, 0x00ff) - AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(niyanpai_clutsel_0_w, 0x00ff) - AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(niyanpai_clutsel_1_w, 0x00ff) - AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(niyanpai_clutsel_2_w, 0x00ff) + AM_RANGE(0x240800, 0x240803) AM_READ8(blitter_2_r, 0x00ff) + AM_RANGE(0x240800, 0x24081f) AM_WRITE8(blitter_2_w, 0x00ff) + AM_RANGE(0x240820, 0x24083f) AM_WRITE8(clut_2_w, 0x00ff) + AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(clutsel_0_w, 0x00ff) + AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(clutsel_1_w, 0x00ff) + AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(clutsel_2_w, 0x00ff) - AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r) + AM_RANGE(0x280000, 0x280001) AM_READ(dipsw_r) AM_RANGE(0x280200, 0x280201) AM_READ(musobana_inputport_0_r) AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM") @@ -250,36 +210,36 @@ static ADDRESS_MAP_START( mhhonban_map, AS_PROGRAM, 16, niyanpai_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x040000, 0x040fff) AM_RAM - AM_RANGE(0x060000, 0x0608ff) AM_READWRITE(niyanpai_palette_r,niyanpai_palette_w) + AM_RANGE(0x060000, 0x0608ff) AM_READWRITE(palette_r,palette_w) AM_RANGE(0x060900, 0x0611ff) AM_RAM // palette work ram? AM_RANGE(0x07f800, 0x07ffff) AM_RAM AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram") AM_RANGE(0x0bf000, 0x0bffff) AM_RAM - AM_RANGE(0x200000, 0x200001) AM_WRITE(niyanpai_sound_w) + AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown AM_RANGE(0x240200, 0x2403ff) AM_WRITENOP // unknown - AM_RANGE(0x240400, 0x240403) AM_READ8(niyanpai_blitter_0_r, 0x00ff) - AM_RANGE(0x240400, 0x24041f) AM_WRITE8(niyanpai_blitter_0_w, 0x00ff) - AM_RANGE(0x240420, 0x24043f) AM_WRITE8(niyanpai_clut_0_w, 0x00ff) + AM_RANGE(0x240400, 0x240403) AM_READ8(blitter_0_r, 0x00ff) + AM_RANGE(0x240400, 0x24041f) AM_WRITE8(blitter_0_w, 0x00ff) + AM_RANGE(0x240420, 0x24043f) AM_WRITE8(clut_0_w, 0x00ff) - AM_RANGE(0x240600, 0x240603) AM_READ8(niyanpai_blitter_1_r, 0x00ff) - AM_RANGE(0x240600, 0x24061f) AM_WRITE8(niyanpai_blitter_1_w, 0x00ff) - AM_RANGE(0x240620, 0x24063f) AM_WRITE8(niyanpai_clut_1_w, 0x00ff) + AM_RANGE(0x240600, 0x240603) AM_READ8(blitter_1_r, 0x00ff) + AM_RANGE(0x240600, 0x24061f) AM_WRITE8(blitter_1_w, 0x00ff) + AM_RANGE(0x240620, 0x24063f) AM_WRITE8(clut_1_w, 0x00ff) - AM_RANGE(0x240800, 0x240803) AM_READ8(niyanpai_blitter_2_r, 0x00ff) - AM_RANGE(0x240800, 0x24081f) AM_WRITE8(niyanpai_blitter_2_w, 0x00ff) - AM_RANGE(0x240820, 0x24083f) AM_WRITE8(niyanpai_clut_2_w, 0x00ff) + AM_RANGE(0x240800, 0x240803) AM_READ8(blitter_2_r, 0x00ff) + AM_RANGE(0x240800, 0x24081f) AM_WRITE8(blitter_2_w, 0x00ff) + AM_RANGE(0x240820, 0x24083f) AM_WRITE8(clut_2_w, 0x00ff) - AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(niyanpai_clutsel_0_w, 0x00ff) - AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(niyanpai_clutsel_1_w, 0x00ff) - AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(niyanpai_clutsel_2_w, 0x00ff) + AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(clutsel_0_w, 0x00ff) + AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(clutsel_1_w, 0x00ff) + AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(clutsel_2_w, 0x00ff) - AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r) + AM_RANGE(0x280000, 0x280001) AM_READ(dipsw_r) AM_RANGE(0x280200, 0x280201) AM_READ(musobana_inputport_0_r) AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM") @@ -290,35 +250,35 @@ static ADDRESS_MAP_START( zokumahj_map, AS_PROGRAM, 16, niyanpai_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x0ff000, 0x0fffff) AM_RAM - AM_RANGE(0x0e0000, 0x0e08ff) AM_READWRITE(niyanpai_palette_r,niyanpai_palette_w) + AM_RANGE(0x0e0000, 0x0e08ff) AM_READWRITE(palette_r,palette_w) AM_RANGE(0x0e0900, 0x0e11ff) AM_RAM // palette work ram? AM_RANGE(0x0a8000, 0x0a87ff) AM_RAM AM_SHARE("nvram") AM_RANGE(0x0c0000, 0x0cffff) AM_RAM - AM_RANGE(0x200000, 0x200001) AM_WRITE(niyanpai_sound_w) + AM_RANGE(0x200000, 0x200001) AM_WRITE8(soundlatch_byte_w, 0xff00) AM_RANGE(0x200200, 0x200201) AM_WRITE(musobana_inputport_w) // inputport select AM_RANGE(0x240000, 0x240009) AM_WRITENOP // unknown AM_RANGE(0x240200, 0x2403ff) AM_WRITENOP // unknown - AM_RANGE(0x240400, 0x240403) AM_READ8(niyanpai_blitter_0_r, 0x00ff) - AM_RANGE(0x240400, 0x24041f) AM_WRITE8(niyanpai_blitter_0_w, 0x00ff) - AM_RANGE(0x240420, 0x24043f) AM_WRITE8(niyanpai_clut_0_w, 0x00ff) + AM_RANGE(0x240400, 0x240403) AM_READ8(blitter_0_r, 0x00ff) + AM_RANGE(0x240400, 0x24041f) AM_WRITE8(blitter_0_w, 0x00ff) + AM_RANGE(0x240420, 0x24043f) AM_WRITE8(clut_0_w, 0x00ff) - AM_RANGE(0x240600, 0x240603) AM_READ8(niyanpai_blitter_1_r, 0x00ff) - AM_RANGE(0x240600, 0x24061f) AM_WRITE8(niyanpai_blitter_1_w, 0x00ff) - AM_RANGE(0x240620, 0x24063f) AM_WRITE8(niyanpai_clut_1_w, 0x00ff) + AM_RANGE(0x240600, 0x240603) AM_READ8(blitter_1_r, 0x00ff) + AM_RANGE(0x240600, 0x24061f) AM_WRITE8(blitter_1_w, 0x00ff) + AM_RANGE(0x240620, 0x24063f) AM_WRITE8(clut_1_w, 0x00ff) - AM_RANGE(0x240800, 0x240803) AM_READ8(niyanpai_blitter_2_r, 0x00ff) - AM_RANGE(0x240800, 0x24081f) AM_WRITE8(niyanpai_blitter_2_w, 0x00ff) - AM_RANGE(0x240820, 0x24083f) AM_WRITE8(niyanpai_clut_2_w, 0x00ff) + AM_RANGE(0x240800, 0x240803) AM_READ8(blitter_2_r, 0x00ff) + AM_RANGE(0x240800, 0x24081f) AM_WRITE8(blitter_2_w, 0x00ff) + AM_RANGE(0x240820, 0x24083f) AM_WRITE8(clut_2_w, 0x00ff) - AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(niyanpai_clutsel_0_w, 0x00ff) - AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(niyanpai_clutsel_1_w, 0x00ff) - AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(niyanpai_clutsel_2_w, 0x00ff) + AM_RANGE(0x240a00, 0x240a01) AM_WRITE8(clutsel_0_w, 0x00ff) + AM_RANGE(0x240c00, 0x240c01) AM_WRITE8(clutsel_1_w, 0x00ff) + AM_RANGE(0x240e00, 0x240e01) AM_WRITE8(clutsel_2_w, 0x00ff) - AM_RANGE(0x280000, 0x280001) AM_READ(niyanpai_dipsw_r) + AM_RANGE(0x280000, 0x280001) AM_READ(dipsw_r) AM_RANGE(0x280200, 0x280201) AM_READ(musobana_inputport_0_r) AM_RANGE(0x280400, 0x280401) AM_READ_PORT("SYSTEM") @@ -329,7 +289,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( niyanpai_sound_map, AS_PROGRAM, 8, niyanpai_state ) AM_RANGE(0x0000, 0x77ff) AM_ROM AM_RANGE(0x7800, 0x7fff) AM_RAM - AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1") + AM_RANGE(0x8000, 0xffff) AM_ROMBANK("soundbank") ADDRESS_MAP_END static ADDRESS_MAP_START( niyanpai_sound_io_map, AS_IO, 8, niyanpai_state ) @@ -755,7 +715,7 @@ static INPUT_PORTS_START( zokumahj ) // I don't have manual for this game. INPUT_PORTS_END -INTERRUPT_GEN_MEMBER(niyanpai_state::niyanpai_interrupt) +INTERRUPT_GEN_MEMBER(niyanpai_state::interrupt) { m_tmp68301->external_interrupt_0(); } @@ -771,7 +731,7 @@ static MACHINE_CONFIG_START( niyanpai, niyanpai_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 12288000/2) /* TMP68301, 6.144 MHz */ MCFG_CPU_PROGRAM_MAP(niyanpai_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", niyanpai_state, niyanpai_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", niyanpai_state, interrupt) MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("tmp68301",tmp68301_device,irq_callback) MCFG_DEVICE_ADD("tmp68301", TMP68301, 0) @@ -781,11 +741,11 @@ static MACHINE_CONFIG_START( niyanpai, niyanpai_state ) MCFG_CPU_CONFIG(daisy_chain_sound) MCFG_CPU_PROGRAM_MAP(niyanpai_sound_map) MCFG_CPU_IO_MAP(niyanpai_sound_io_map) - MCFG_TMPZ84C011_PORTD_READ_CB(READ8(niyanpai_state, cpu_portd_r)) - MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(niyanpai_state, cpu_porta_w)) - MCFG_TMPZ84C011_PORTB_WRITE_CB(WRITE8(niyanpai_state, cpu_portb_w)) - MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(niyanpai_state, cpu_portc_w)) - MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(niyanpai_state, cpu_porte_w)) + MCFG_TMPZ84C011_PORTD_READ_CB(READ8(niyanpai_state, soundlatch_byte_r)) + MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(niyanpai_state, soundbank_w)) + MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac1", dac_device, write_unsigned8)) + MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac2", dac_device, write_unsigned8)) + MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(niyanpai_state, soundlatch_clear_w)) MCFG_TMPZ84C011_ZC0_CB(DEVWRITELINE("audiocpu", tmpz84c011_device, trg3)) MCFG_NVRAM_ADD_0FILL("nvram") @@ -796,7 +756,7 @@ static MACHINE_CONFIG_START( niyanpai, niyanpai_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(1024, 512) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(niyanpai_state, screen_update_niyanpai) + MCFG_SCREEN_UPDATE_DRIVER(niyanpai_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 256*3) @@ -819,16 +779,18 @@ static MACHINE_CONFIG_DERIVED( musobana, niyanpai ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(musobana_map) + + MCFG_MACHINE_START_OVERRIDE(niyanpai_state, musobana) MACHINE_CONFIG_END -static MACHINE_CONFIG_DERIVED( mhhonban, niyanpai ) +static MACHINE_CONFIG_DERIVED( mhhonban, musobana ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(mhhonban_map) MACHINE_CONFIG_END -static MACHINE_CONFIG_DERIVED( zokumahj, niyanpai ) +static MACHINE_CONFIG_DERIVED( zokumahj, musobana ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") @@ -930,8 +892,8 @@ ROM_START( zokumahj ) ROM_END -GAME( 1996, niyanpai, 0, niyanpai, niyanpai, niyanpai_state, niyanpai, ROT0, "Nichibutsu", "Niyanpai (Japan)", 0 ) -GAME( 1995, musobana, 0, musobana, musobana, niyanpai_state, niyanpai, ROT0, "Nichibutsu / Yubis", "Musoubana (Japan)", 0 ) -GAME( 1994, 4psimasy, 0, musobana, 4psimasy, niyanpai_state, niyanpai, ROT0, "Sphinx / AV Japan", "Mahjong 4P Simasyo (Japan)", 0 ) -GAME( 199?, mhhonban, 0, mhhonban, mhhonban, niyanpai_state, niyanpai, ROT0, "Nichibutsu?", "Mahjong Housoukyoku Honbanchuu (Japan)", 0 ) -GAME( 199?, zokumahj, mhhonban, zokumahj, zokumahj, niyanpai_state, niyanpai, ROT0, "Nichibutsu?", "Zoku Mahjong Housoukyoku (Japan)", 0 ) +GAME( 1996, niyanpai, 0, niyanpai, niyanpai, niyanpai_state, niyanpai, ROT0, "Nichibutsu", "Niyanpai (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1995, musobana, 0, musobana, musobana, niyanpai_state, niyanpai, ROT0, "Nichibutsu / Yubis", "Musoubana (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1994, 4psimasy, 0, musobana, 4psimasy, niyanpai_state, niyanpai, ROT0, "Sphinx / AV Japan", "Mahjong 4P Simasyo (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 199?, mhhonban, 0, mhhonban, mhhonban, niyanpai_state, niyanpai, ROT0, "Nichibutsu?", "Mahjong Housoukyoku Honbanchuu (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 199?, zokumahj, mhhonban, zokumahj, zokumahj, niyanpai_state, niyanpai, ROT0, "Nichibutsu?", "Zoku Mahjong Housoukyoku (Japan)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c index 845baa07d02..32615fc1086 100644 --- a/src/mame/drivers/nmk16.c +++ b/src/mame/drivers/nmk16.c @@ -7072,7 +7072,6 @@ ROM_START( grdnstrmj ) ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END - ROM_START( grdnstrmv ) /* Apples Industries license - Vertical version */ ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "afega2.u112", 0x000000, 0x040000, CRC(16d41050) SHA1(79b6621dccb286e5adf60c40690083a37746a4f9) ) @@ -7105,7 +7104,6 @@ DRIVER_INIT_MEMBER(nmk16_state,grdnstrmg) } - ROM_START( grdnstrmg ) /* Germany */ ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "gs5_c1.uc1", 0x000001, 0x040000, CRC(c0263e4a) SHA1(8cae60bd59730aaba215f825016a780eced3a12d) ) @@ -7135,9 +7133,6 @@ ROM_START( grdnstrmg ) /* Germany */ ROM_LOAD( "gs2_s2.uc18", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) // ROM_END - - - ROM_START( redfoxwp2 ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "u112", 0x000000, 0x040000, CRC(3f31600b) SHA1(6c56e36178effb60ec27dfcd205393e2cfac4ed6) ) /* No label */ @@ -7160,7 +7155,6 @@ ROM_START( redfoxwp2 ) ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END - DRIVER_INIT_MEMBER(nmk16_state,redfoxwp2a) { // todo collapse to one bitswap @@ -7169,7 +7163,6 @@ DRIVER_INIT_MEMBER(nmk16_state,redfoxwp2a) decryptcode( machine(),23, 22, 21, 20, 19, 18, /* */ 16, 17, /* */ 15,14,13,12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } - ROM_START( redfoxwp2a ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "afega_4.u112", 0x000000, 0x040000, CRC(e6e6682a) SHA1(1a70ca3881b4ecc6d329814ff1fdafce16550ca2) ) @@ -7411,7 +7404,7 @@ Notes: ***************************************************************************/ -ROM_START( hotbubl ) +ROM_START( hotbubl ) /* Korean release - Nude images of women for backgrounds */ ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "c1.uc1", 0x00001, 0x40000, CRC(7bb240e9) SHA1(99048fa275182c3da3bfb0dedd790f4b5858bd92) ) ROM_LOAD16_BYTE( "c2.uc9", 0x00000, 0x40000, CRC(7917b95d) SHA1(0344bae9c373c5943e7693720e5e531bc2e0d7ee) ) @@ -7439,8 +7432,35 @@ ROM_START( hotbubl ) ROM_LOAD( "s2.uc18", 0x00000, 0x40000, CRC(401c980f) SHA1(e47710c47cfeecce3ccf87f845b219a9c9f21ee3) ) ROM_END +ROM_START( hotbubla ) /* Korean release - Nude images replaced with pictures of satellite dishes */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ + ROM_LOAD16_BYTE( "6_c1.uc1", 0x00001, 0x40000, CRC(7c65bf47) SHA1(fe578d3336c5f437bfd1bc81bfe3763b12f3e63f) ) + ROM_LOAD16_BYTE( "7_c2.uc9", 0x00000, 0x40000, CRC(74eb11c3) SHA1(88aeb02c4088706a56b4c930ffe6fdfbc99031c6) ) -ROM_START( dolmen ) + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 Code */ + ROM_LOAD( "1_s1.uc14", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) /* same as the other games on this driver */ + + ROM_REGION( 0x100000, "sprites", 0 ) /* Sprites, 16x16x4 */ + ROM_LOAD16_BYTE( "8_br1.uc3", 0x000000, 0x040000, CRC(7e132eff) SHA1(f3ec5750c73017f0a2eb87f6f39ab49e59d39711) ) + ROM_LOAD16_BYTE( "9_br3.uc10", 0x000001, 0x040000, CRC(22707728) SHA1(8a27aa2d1b6f902276c02bd7098526243661cff8) ) + + ROM_REGION( 0x300000, "bgtile", 0 ) /* Layer 0, 16x16x8 */ + ROM_LOAD( "5_cr6.uc16", 0x100000, 0x080000, CRC(324429c5) SHA1(8cf90abf32697b269d4ec03b5b20bf4046fa53aa) ) + ROM_LOAD( "5_cr7.uc19", 0x080000, 0x080000, CRC(d293f1d0) SHA1(33c40c67bda477a2112cca4bfe9661edbcdf7689) ) + ROM_LOAD( "2_cr5.uc15", 0x000000, 0x080000, CRC(dd7e92de) SHA1(954f18887ac7737abce363985255a747c0de1fa2) ) + + ROM_LOAD( "9_cr2.uc7", 0x280000, 0x080000, CRC(c5516087) SHA1(ae3692ecd7cd96b5d3653afb4c3a3b8f5931cbad) ) + ROM_LOAD( "10_cr3.uc12", 0x200000, 0x080000, CRC(312c38d8) SHA1(1e706b3e8b381083575ef4a01c615408940d5d0f) ) + ROM_LOAD( "8_cr1.uc6", 0x180000, 0x080000, CRC(7e2840b4) SHA1(333bf5631ee033ce528348d26888854eb1b063a0) ) + + ROM_REGION( 0x10000, "fgtile", 0 ) /* Layer 1, 8x8x4 */ + ROM_LOAD( "2_t1.uc2", 0x00000, 0x10000, CRC(ce683a93) SHA1(aeee2671051f1badf2255375cd7c5fa847d1746c) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */ + ROM_LOAD( "1_s2.uc18", 0x00000, 0x40000, CRC(401c980f) SHA1(e47710c47cfeecce3ccf87f845b219a9c9f21ee3) ) +ROM_END + +ROM_START( dolmen ) /* Original source of the caveman concept for Bubble 2000 / Hot Bubble, much earlier and completely different hardware */ ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "afega8.uj3", 0x00000, 0x20000, CRC(f1b73e4c) SHA1(fe5bbd1e91d1a81744c373effbd96adbbc896133) ) ROM_LOAD16_BYTE( "afega7.uj2", 0x00001, 0x20000, CRC(c91bda0b) SHA1(8c09e3020e72e8ab2ca3a3dad708d64f9bf75a4f) ) @@ -7642,7 +7662,6 @@ ROM_START( spec2kh ) ROM_LOAD( "yonatech3.u106", 0x00000, 0x80000, CRC(6644c404) SHA1(b7ad3f9f08971432d024ef8be3fa3140f0bbae67) ) ROM_END - ROM_START( spec2k ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "u124", 0x00000, 0x40000, CRC(dbd6f65d) SHA1(0fad9836689fcbee60904ccad59a2a5be09f3139) ) @@ -7819,7 +7838,8 @@ GAME( 1998, grdnstrmg,grdnstrm, grdnstrmk,grdnstrk, nmk16_state, grdnstrmg,ROT // is there a 'bubble 2000' / 'hot bubble' version with Afega copyright, or is the only Afega release dolmen above, this seems like a sequel, not a clone? GAME( 1998, bubl2000, 0, popspops, bubl2000, nmk16_state, bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000", 0 ) // on a tuning board (bootleg?) -GAME( 1998, hotbubl, bubl2000, popspops, bubl2000, nmk16_state, bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble" , 0 ) // on an afega board .. +GAME( 1998, hotbubl, bubl2000, popspops, bubl2000, nmk16_state, bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea, with adult pictures)" , 0 ) // on an afega board .. +GAME( 1998, hotbubla, bubl2000, popspops, bubl2000, nmk16_state, bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea)" , 0 ) // on an afega board .. GAME( 1999, popspops, 0, popspops, popspops, nmk16_state, grdnstrm, ROT0, "Afega", "Pop's Pop's", 0 ) diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index a08aa36bb8c..bdb91cb46a0 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -660,7 +660,7 @@ GFXDECODE_END void paradise_state::machine_start() { int bank_n = memregion("maincpu")->bytes() / 0x4000; - + membank("prgbank")->configure_entries(0, bank_n, memregion("maincpu")->base(), 0x4000); save_item(NAME(m_palbank)); diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 0f2eb061219..bd3e86bbad0 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -5642,7 +5642,8 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) ROM_LOAD( "mxo-cg2399.u75", 0x18000, 0x8000, CRC(bd7669d5) SHA1(4343a9764fd563e2e1cdd8558f2f53f77006b159) ) ROM_REGION( 0x200, "proms", 0 ) - ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) + ROM_LOAD( "capx2399.u43", 0x0000, 0x0200, NO_DUMP ) /* Should be CAPX2399 */ + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) /* Wrong!! Should be CAPX2399 */ ROM_END ROM_START( pex0055pc ) /* Superboard : Deuces Wild Poker (X000055P+XP000028) */ @@ -5686,13 +5687,14 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) ROM_LOAD( "x000055p.u66", 0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */ ROM_REGION( 0x020000, "gfx1", 0 ) - ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */ - ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) ) - ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) ) - ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) ) + ROM_LOAD( "mro-cg2389.u72", 0x00000, 0x8000, CRC(912d639f) SHA1(f66f5db847816754c4f1fbeb1171c4e6c1331039) ) /* The Wild Wild West Casino card backs */ + ROM_LOAD( "mgo-cg2389.u73", 0x08000, 0x8000, CRC(87de1a4e) SHA1(4f8524eba297771d3292dd2fca9008546d0e3066) ) + ROM_LOAD( "mbo-cg2389.u74", 0x10000, 0x8000, CRC(7c248712) SHA1(4c2cfd7f46fa757438706095137ccf230c30f3a4) ) + ROM_LOAD( "mxo-cg2389.u75", 0x18000, 0x8000, CRC(4fdb7daf) SHA1(131d0a5c33f75f859522a4307c0e23273d5d4cb6) ) ROM_REGION( 0x200, "proms", 0 ) - ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) + ROM_LOAD( "capx2389.u43", 0x0000, 0x0200, NO_DUMP ) /* Should be CAPX2389, but 2 PCBs had CAPX1321 */ + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) /* Wrong!! Should be CAPX2389 */ ROM_END ROM_START( pex0055pe ) /* Superboard : Deuces Wild Poker (X000055P+XP000038) */ @@ -5930,7 +5932,7 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) Programs Available: PP0055, X000055P, PP0723 */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xp000098.u67", 0x00000, 0x10000, CRC(12257ad8) SHA1(8f613377519850f8f711ccb827685dece018c735) ) + ROM_LOAD( "xp000098.u67", 0x00000, 0x10000, CRC(12257ad8) SHA1(8f613377519850f8f711ccb827685dece018c735) ) /* 01/29/98 @ IGT L98-0643 */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "x000055p.u66", 0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */ @@ -8020,7 +8022,7 @@ Black Jack as in Jack of Spades/Clubs, not 21 With With PayTable Js+ 2PR STR FL FH 4K SF 4K 4K 4A 4K 4K 4A RF (Bonus) ----------------------------------------------------------------------------- P870BB 1 1 3 4 7 9 50 25 80 160 160 400 400 400 800 - % Range: 95.4-97.4% Optimum: 99.4% Hit Frequency: ???% + % Range: 95.4-97.4% Optimum: 99.4% Hit Frequency: 43.2% Programs Available: X002272P */ ROM_REGION( 0x10000, "maincpu", 0 ) @@ -8047,7 +8049,7 @@ Black Jack as in Jack of Spades/Clubs, not 21 With With PayTable Js+ 2PR STR FL FH 4K SF 4K 4K 4A 4K 4K 4A RF (Bonus) ----------------------------------------------------------------------------- P873BB 1 1 3 4 5 8 50 25 80 160 160 400 400 400 800 - % Range: 92.0-94.0% Optimum: 96.0% Hit Frequency: ???% + % Range: 92.0-94.0% Optimum: 96.0% Hit Frequency: 44.8% Programs Available: X002275P */ ROM_REGION( 0x10000, "maincpu", 0 ) @@ -8074,7 +8076,7 @@ Black Jack as in Jack of Spades/Clubs, not 21 With With PayTable Js+ 2PR STR FL FH 4K SF 4K 4K 4A 4K 4K 4A RF (Bonus) ----------------------------------------------------------------------------- P874BB 1 1 3 4 5 7 50 25 80 160 160 400 400 400 800 - % Range: 91.0-93.0% Optimum: 95.0% Hit Frequency: ???% + % Range: 91.0-93.0% Optimum: 95.0% Hit Frequency: 44.9% Programs Available: X002276P */ ROM_REGION( 0x10000, "maincpu", 0 ) @@ -9075,7 +9077,7 @@ Double Bonus Poker P324A 100.20% Double Deuce Poker P236A 99.60% */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00002.u67", 0x00000, 0x10000, CRC(d5624ac8) SHA1(6b778b0e7ddb81123c6038920b3447e05a0556b2) ) /* Linkable Progressive */ + ROM_LOAD( "xmp00002.u67", 0x00000, 0x10000, CRC(d5624ac8) SHA1(6b778b0e7ddb81123c6038920b3447e05a0556b2) ) /* 09/07/95 @ IGT L95-2183 - Linkable Progressive */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "xm00004p.u66", 0x00000, 0x10000, CRC(bafd160f) SHA1(7454fbf992d4d0668ef375b76ce2cae3324a5f75) ) @@ -9104,7 +9106,7 @@ Double Bonus Poker P434A 96.40% */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xmp00004.u67", 0x00000, 0x10000, CRC(83184999) SHA1(b8483917b338be4fd3641b3990eea37072d36885) ) /* Linkable Progressive */ - /* Also known to be found with XMP00024 programs */ + /* Also known to be found with XMP00024 program */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "xm00005p.u66", 0x00000, 0x10000, CRC(c832eac7) SHA1(747d57de602b44ae1276fe1009db1b6de0d2c64c) ) @@ -9162,12 +9164,13 @@ Double Bonus Poker P325A 97.80% */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xmp00006.u67", 0x00000, 0x10000, CRC(d61f1677) SHA1(2eca1315d6aa310a54de2dfa369e443a07495b76) ) /* 07/25/96 @ IGT L96-2041 - Linkable Progressive */ + /* Also known to be found with XMP00002 program */ ROM_REGION( 0x10000, "user1", 0 ) - ROM_LOAD( "xm00007p.u66", 0x00000, 0x10000, CRC(85a76416) SHA1(1bc3b9c2f687e68a085bfc5cf86d99fbd18cb9c7) ) + ROM_LOAD( "xm00007p.u66", 0x00000, 0x10000, CRC(85a76416) SHA1(1bc3b9c2f687e68a085bfc5cf86d99fbd18cb9c7) ) /* 03/09/96 @ IGT L96-0737 */ ROM_REGION( 0x020000, "gfx1", 0 ) - ROM_LOAD( "mro-cg2233.u77", 0x00000, 0x8000, CRC(8758866a) SHA1(49146560a7e79593a2ac0378dc3b300b96ef1015) ) + ROM_LOAD( "mro-cg2233.u77", 0x00000, 0x8000, CRC(8758866a) SHA1(49146560a7e79593a2ac0378dc3b300b96ef1015) ) /* 03/07/96 @ IGT L96-0686 */ ROM_LOAD( "mgo-cg2233.u78", 0x08000, 0x8000, CRC(45ac6cfd) SHA1(25ff276320fe51c56aea0cff099be17e4ce8f404) ) ROM_LOAD( "mbo-cg2233.u79", 0x10000, 0x8000, CRC(9e9d702f) SHA1(75bb9adb49095b7cb87d2615bcf725e4a4774e25) ) ROM_LOAD( "mxo-cg2233.u80", 0x18000, 0x8000, CRC(2f05ebcb) SHA1(90d00ee4ce2dcbfbe33e221efe4db45a4e484baa) ) @@ -9221,7 +9224,7 @@ Jacks or Better BB 97.80% Double Aces & Faces ????? 99.30% */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00002.u67", 0x00000, 0x10000, CRC(d5624ac8) SHA1(6b778b0e7ddb81123c6038920b3447e05a0556b2) ) /* Linkable Progressive */ + ROM_LOAD( "xmp00002.u67", 0x00000, 0x10000, CRC(d5624ac8) SHA1(6b778b0e7ddb81123c6038920b3447e05a0556b2) ) /* 09/07/95 @ IGT L95-2183 - Linkable Progressive */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "xm00009p.u66", 0x00000, 0x10000, CRC(e133d0bb) SHA1(7ed4fa335e230c28e6fc66f0c990bc7ead2b279d) ) @@ -9255,7 +9258,7 @@ Joker Poker P17A 95.50% ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xmp00025.u67", 0x00000, 0x10000, CRC(5d39ff71) SHA1(0a5f67e61ae0e8a08cc551ab4271ffc97c343ae3) ) /* International multi currency version - Auto Hold always on */ /* Also compatible with XMP00002, XMP00003, XMP00004, XMP00006 and XMP00024 programs */ - + ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "xm00013p.u66", 0x00000, 0x10000, CRC(4fde73f9) SHA1(f8eb6fb0585e8df9a7eb2ddc65bb20b120753d7a) ) @@ -9341,7 +9344,7 @@ The CG2298 graphics can support the following XnnnnnnP Data game types: */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00017.u67", 0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) ) + ROM_LOAD( "xmp00017.u67", 0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) ) /* 09/17/97 @ IGT L97-2154 */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "x000055p.u66", 0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */ @@ -9375,7 +9378,7 @@ The CG2352 set supersedes CG2298. It's currently not known what has changed betw */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00017.u67", 0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) ) + ROM_LOAD( "xmp00017.u67", 0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) ) /* 09/17/97 @ IGT L97-2154 */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "x000430p.u66", 0x00000, 0x10000, CRC(905571e3) SHA1(fd506516fed22842df8e9dbb3683dcb4c459719b) ) /* Dueces Joker Wild Poker */ @@ -9412,7 +9415,7 @@ The CG2426 set supersedes both CG2298 & CG2352 and adds graphics support for the */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00017.u67", 0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) ) + ROM_LOAD( "xmp00017.u67", 0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) ) /* 09/17/97 @ IGT L97-2154 */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "x002272p.u66", 0x00000, 0x10000, CRC(ee4f27b9) SHA1(1ee105430358ea27badd943bb6b18663e4029388) ) /* Black Jack Bonus Poker */ @@ -9430,7 +9433,7 @@ The CG2426 set supersedes both CG2298 & CG2352 and adds graphics support for the ROM_LOAD( "x002307p.u66", 0x00000, 0x10000, CRC(c6d5db70) SHA1(017e1e382fb789e4cd8b410362ad5e82b61f61db) ) /* Triple Double Bonus Poker */ ROM_REGION( 0x040000, "gfx1", 0 ) - ROM_LOAD( "mro-cg2426.u77", 0x00000, 0x10000, CRC(e7622901) SHA1(f653aaf02de840aef56d3efd7680572356e94da7) ) + ROM_LOAD( "mro-cg2426.u77", 0x00000, 0x10000, CRC(e7622901) SHA1(f653aaf02de840aef56d3efd7680572356e94da7) ) /* 05/29/98 @ IGT L98-1765 */ ROM_LOAD( "mgo-cg2426.u78", 0x10000, 0x10000, CRC(5c8388a0) SHA1(c883bf7969850d07f37fa0fd58f82cda4cf15654) ) ROM_LOAD( "mbo-cg2426.u79", 0x20000, 0x10000, CRC(dc6e39aa) SHA1(7a7188757f5be25521a023d1315cfd7c395b6c25) ) ROM_LOAD( "mxo-cg2426.u80", 0x30000, 0x10000, CRC(a32f42a2) SHA1(87ddc4dda7c198ed62a2a065507efe4d3a016236) ) @@ -9488,7 +9491,7 @@ ROM_START( pexmp030 ) /* Superboard : 5-in-1 Wingboard (XMP00030) */ ROM_LOAD( "x002440p.u66", 0x00000, 0x10000, CRC(2ecb28cc) SHA1(a7b902bdfbf8f5ceedc778b8408c39ee279a1a1d) ) /* Deuces Wild Poker */ ROM_REGION( 0x040000, "gfx1", 0 ) - ROM_LOAD( "mro-cg2426.u77", 0x00000, 0x10000, CRC(e7622901) SHA1(f653aaf02de840aef56d3efd7680572356e94da7) ) + ROM_LOAD( "mro-cg2426.u77", 0x00000, 0x10000, CRC(e7622901) SHA1(f653aaf02de840aef56d3efd7680572356e94da7) ) /* 05/29/98 @ IGT L98-1765 */ ROM_LOAD( "mgo-cg2426.u78", 0x10000, 0x10000, CRC(5c8388a0) SHA1(c883bf7969850d07f37fa0fd58f82cda4cf15654) ) ROM_LOAD( "mbo-cg2426.u79", 0x20000, 0x10000, CRC(dc6e39aa) SHA1(7a7188757f5be25521a023d1315cfd7c395b6c25) ) ROM_LOAD( "mxo-cg2426.u80", 0x30000, 0x10000, CRC(a32f42a2) SHA1(87ddc4dda7c198ed62a2a065507efe4d3a016236) ) @@ -9720,9 +9723,9 @@ GAMEL(1995, pex0053p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex0054p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000054P+XP000038) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1995, pex0055p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000019) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1995, pex0055pa, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000022) Deuces Wild Poker (The Orleans)", 0, layout_pe_poker ) -GAMEL(1995, pex0055pb, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000023) Deuces Wild Poker (The Fun Ships)", 0, layout_pe_poker ) +GAMEL(1995, pex0055pb, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000023) Deuces Wild Poker (The Fun Ships)", GAME_WRONG_COLORS, layout_pe_poker ) /* CAP2399 not dumped */ GAMEL(1995, pex0055pc, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000028) Deuces Wild Poker (Horseshoe)", 0, layout_pe_poker ) -GAMEL(1995, pex0055pd, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000035) Deuces Wild Poker", 0, layout_pe_poker ) +GAMEL(1995, pex0055pd, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000035) Deuces Wild Poker (The Wild Wild West Casino)", GAME_WRONG_COLORS, layout_pe_poker ) /* CAP2389 not dumped */ GAMEL(1995, pex0055pe, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000038) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1995, pex0055pf, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000040) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1995, pex0055pg, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000053) Deuces Wild Poker", 0, layout_pe_poker ) diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c index ac791c1b52f..7467d262c91 100644 --- a/src/mame/drivers/playmark.c +++ b/src/mame/drivers/playmark.c @@ -1375,7 +1375,7 @@ static MACHINE_CONFIG_START( hrdtimes, playmark_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", playmark_state, irq6_line_hold) MCFG_CPU_ADD("audiocpu", PIC16C57, XTAL_24MHz/2) /* verified on pcb */ -// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead +// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead MCFG_PIC16C5x_READ_B_CB(READ8(playmark_state, playmark_snd_command_r)) MCFG_PIC16C5x_WRITE_B_CB(WRITE8(playmark_state, playmark_oki_w)) MCFG_PIC16C5x_READ_C_CB(READ8(playmark_state, playmark_snd_flag_r)) @@ -1416,7 +1416,7 @@ static MACHINE_CONFIG_START( hotmind, playmark_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", playmark_state, irq6_line_hold) // irq 2 and 6 point to the same location on hotmind MCFG_CPU_ADD("audiocpu", PIC16C57, XTAL_24MHz/2) /* verified on pcb */ -// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead +// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead MCFG_PIC16C5x_READ_B_CB(READ8(playmark_state, playmark_snd_command_r)) MCFG_PIC16C5x_WRITE_B_CB(WRITE8(playmark_state, playmark_oki_w)) MCFG_PIC16C5x_READ_C_CB(READ8(playmark_state, playmark_snd_flag_r)) @@ -1462,7 +1462,7 @@ static MACHINE_CONFIG_START( luckboomh, playmark_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", playmark_state, irq6_line_hold) MCFG_CPU_ADD("audiocpu", PIC16C57, XTAL_24MHz/2) /* verified on pcb */ -// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead +// MCFG_PIC16C5x_WRITE_A_CB(WRITE8(playmark_state, playmark_oki_banking_w)) // Banking data output but not wired. Port C is wired to the OKI banking instead MCFG_PIC16C5x_READ_B_CB(READ8(playmark_state, playmark_snd_command_r)) MCFG_PIC16C5x_WRITE_B_CB(WRITE8(playmark_state, playmark_oki_w)) MCFG_PIC16C5x_READ_C_CB(READ8(playmark_state, playmark_snd_flag_r)) diff --git a/src/mame/drivers/portrait.c b/src/mame/drivers/portrait.c index c2fb068dc03..19b7840d8a9 100644 --- a/src/mame/drivers/portrait.c +++ b/src/mame/drivers/portrait.c @@ -86,11 +86,10 @@ DM81LS95 = TriState buffer #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/mcs48/mcs48.h" -#include "sound/tms5220.h" #include "machine/nvram.h" #include "includes/portrait.h" -WRITE8_MEMBER(portrait_state::portrait_ctrl_w) +WRITE8_MEMBER(portrait_state::ctrl_w) { /* bits 4 and 5 are unknown */ @@ -106,30 +105,30 @@ WRITE8_MEMBER(portrait_state::portrait_ctrl_w) output_set_value("photo", (data >> 7) & 1); } -WRITE8_MEMBER(portrait_state::portrait_positive_scroll_w) +WRITE8_MEMBER(portrait_state::positive_scroll_w) { m_scroll = data; } -WRITE8_MEMBER(portrait_state::portrait_negative_scroll_w) +WRITE8_MEMBER(portrait_state::negative_scroll_w) { m_scroll = - (data ^ 0xff); } static ADDRESS_MAP_START( portrait_map, AS_PROGRAM, 8, portrait_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(portrait_bgvideo_write) AM_SHARE("bgvideoram") - AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(portrait_fgvideo_write) AM_SHARE("fgvideoram") + AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(bgvideo_write) AM_SHARE("bgvideoram") + AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(fgvideo_write) AM_SHARE("fgvideoram") AM_RANGE(0x9000, 0x91ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x9200, 0x97ff) AM_RAM AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_byte_w) AM_RANGE(0xa010, 0xa010) AM_WRITENOP // ? AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1") AM_RANGE(0xa004, 0xa004) AM_READ_PORT("DSW2") - AM_RANGE(0xa008, 0xa008) AM_READ_PORT("SYSTEM") AM_WRITE(portrait_ctrl_w) + AM_RANGE(0xa008, 0xa008) AM_READ_PORT("SYSTEM") AM_WRITE(ctrl_w) AM_RANGE(0xa010, 0xa010) AM_READ_PORT("INPUTS") - AM_RANGE(0xa018, 0xa018) AM_READNOP AM_WRITE(portrait_positive_scroll_w) - AM_RANGE(0xa019, 0xa019) AM_WRITE(portrait_negative_scroll_w) + AM_RANGE(0xa018, 0xa018) AM_READNOP AM_WRITE(positive_scroll_w) + AM_RANGE(0xa019, 0xa019) AM_WRITE(negative_scroll_w) AM_RANGE(0xa800, 0xa83f) AM_RAM AM_SHARE("nvram") AM_RANGE(0xffff, 0xffff) AM_READNOP ADDRESS_MAP_END @@ -257,7 +256,7 @@ static MACHINE_CONFIG_START( portrait, portrait_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 64*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 54*8-1, 0*8, 40*8-1) - MCFG_SCREEN_UPDATE_DRIVER(portrait_state, screen_update_portrait) + MCFG_SCREEN_UPDATE_DRIVER(portrait_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", portrait) @@ -381,5 +380,5 @@ ROM_END -GAME( 1983, portrait, 0, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 1)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS ) -GAME( 1983, portraita,portrait, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 2)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS ) +GAME( 1983, portrait, 0, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 1)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) +GAME( 1983, portraita,portrait, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 2)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/powerins.c b/src/mame/drivers/powerins.c index bb41ed749d4..24875b035d0 100644 --- a/src/mame/drivers/powerins.c +++ b/src/mame/drivers/powerins.c @@ -18,7 +18,7 @@ Set 3 Note: - To enter test mode press F2 (Test) Use 9 (Service Coin) to change page. -- In powerina there is a hidden test mode screen because it's a bootleg +- In powerinsa there is a hidden test mode screen because it's a bootleg without a sound CPU. Set 18ff08 to 4 during test mode that calls the data written to $10001e "sound code". @@ -43,71 +43,40 @@ TODO: ***************************************************************************/ -WRITE16_MEMBER(powerins_state::powerins_okibank_w) +WRITE8_MEMBER(powerins_state::powerinsa_okibank_w) { - if (ACCESSING_BITS_0_7) - { - UINT8 *RAM = memregion("oki1")->base(); - int new_bank = data & 0x7; - - if (new_bank != m_oki_bank) - { - m_oki_bank = new_bank; - memcpy(&RAM[0x30000],&RAM[0x40000 + 0x10000*new_bank],0x10000); - } - } + membank("okibank")->set_entry(data & 7); } -WRITE16_MEMBER(powerins_state::powerins_soundlatch_w) -{ - if (ACCESSING_BITS_0_7) - soundlatch_byte_w(space, 0, data & 0xff); -} - -READ8_MEMBER(powerins_state::powerinb_fake_ym2203_r) +READ8_MEMBER(powerins_state::powerinsb_fake_ym2203_r) { return 0x01; } static ADDRESS_MAP_START( powerins_map, AS_PROGRAM, 16, powerins_state ) - AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM + AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x100000, 0x100001) AM_READ_PORT("SYSTEM") AM_RANGE(0x100002, 0x100003) AM_READ_PORT("P1_P2") AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW1") AM_RANGE(0x10000a, 0x10000b) AM_READ_PORT("DSW2") - AM_RANGE(0x100014, 0x100015) AM_WRITE(powerins_flipscreen_w) // Flip Screen - AM_RANGE(0x100016, 0x100017) AM_WRITENOP // ? always 1 - AM_RANGE(0x100018, 0x100019) AM_WRITE(powerins_tilebank_w) // Tiles Banking (VRAM 0) - AM_RANGE(0x10001e, 0x10001f) AM_WRITE(powerins_soundlatch_w) // Sound Latch - AM_RANGE(0x100030, 0x100031) AM_WRITE(powerins_okibank_w) // Sound - AM_RANGE(0x120000, 0x120fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0x130000, 0x130007) AM_RAM AM_SHARE("vctrl_0") // VRAM 0 Control - AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(powerins_vram_0_w) AM_SHARE("vram_0") // VRAM 0 - AM_RANGE(0x170000, 0x170fff) AM_RAM_WRITE(powerins_vram_1_w) AM_SHARE("vram_1") // VRAM 1 - AM_RANGE(0x171000, 0x171fff) AM_WRITE(powerins_vram_1_w) // Mirror of VRAM 1? - AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("spriteram") // RAM + Sprites + AM_RANGE(0x100014, 0x100015) AM_WRITE8(flipscreen_w, 0x00ff) + AM_RANGE(0x100016, 0x100017) AM_WRITENOP // ? always 1 + AM_RANGE(0x100018, 0x100019) AM_WRITE8(tilebank_w, 0x00ff) + AM_RANGE(0x10001e, 0x10001f) AM_WRITE8(soundlatch_byte_w, 0x00ff) + AM_RANGE(0x120000, 0x120fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") + AM_RANGE(0x130000, 0x130007) AM_RAM AM_SHARE("vctrl_0") + AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") + AM_RANGE(0x170000, 0x170fff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") + AM_RANGE(0x171000, 0x171fff) AM_WRITE(vram_1_w) + AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("spriteram") ADDRESS_MAP_END -/* powerina: same as the original one but without the sound cpu (and inferior sound HW) */ -static ADDRESS_MAP_START( powerina_map, AS_PROGRAM, 16, powerins_state ) - AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM - AM_RANGE(0x100000, 0x100001) AM_READ_PORT("SYSTEM") - AM_RANGE(0x100002, 0x100003) AM_READ_PORT("P1_P2") - AM_RANGE(0x100008, 0x100009) AM_READ_PORT("DSW1") - AM_RANGE(0x10000a, 0x10000b) AM_READ_PORT("DSW2") - AM_RANGE(0x100014, 0x100015) AM_WRITE(powerins_flipscreen_w) // Flip Screen - AM_RANGE(0x100016, 0x100017) AM_WRITENOP // ? always 1 - AM_RANGE(0x100018, 0x100019) AM_WRITE(powerins_tilebank_w) // Tiles Banking (VRAM 0) - AM_RANGE(0x10001e, 0x10001f) AM_WRITENOP // Sound Latch, NOPed since there is no sound cpu - AM_RANGE(0x100030, 0x100031) AM_WRITE(powerins_okibank_w) // Sound - AM_RANGE(0x10003e, 0x10003f) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) // (used by powerina) - AM_RANGE(0x120000, 0x120fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette - AM_RANGE(0x130000, 0x130007) AM_RAM AM_SHARE("vctrl_0") // VRAM 0 Control - AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE(powerins_vram_0_w) AM_SHARE("vram_0") // VRAM 0 - AM_RANGE(0x170000, 0x170fff) AM_RAM_WRITE(powerins_vram_1_w) AM_SHARE("vram_1") // VRAM 1 - AM_RANGE(0x171000, 0x171fff) AM_WRITE(powerins_vram_1_w) // Mirror of VRAM 1? - AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("spriteram") // RAM + Sprites +/* powerinsa: same as the original one but without the sound cpu (and inferior sound HW) */ +static ADDRESS_MAP_START( powerinsa_map, AS_PROGRAM, 16, powerins_state ) + AM_IMPORT_FROM(powerins_map) + AM_RANGE(0x100030, 0x100031) AM_WRITE8(powerinsa_okibank_w, 0x00ff) + AM_RANGE(0x10003e, 0x10003f) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff) ADDRESS_MAP_END static ADDRESS_MAP_START( powerins_sound_map, AS_PROGRAM, 8, powerins_state ) @@ -126,15 +95,20 @@ static ADDRESS_MAP_START( powerins_sound_io_map, AS_IO, 8, powerins_state ) AM_RANGE(0x90, 0x97) AM_DEVWRITE("nmk112", nmk112_device, okibank_w) ADDRESS_MAP_END -static ADDRESS_MAP_START( powerinb_sound_io_map, AS_IO, 8, powerins_state ) +static ADDRESS_MAP_START( powerinsb_sound_io_map, AS_IO, 8, powerins_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(powerinb_fake_ym2203_r) AM_WRITENOP + AM_RANGE(0x00, 0x00) AM_READ(powerinsb_fake_ym2203_r) AM_WRITENOP AM_RANGE(0x01, 0x01) AM_NOP AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki1", okim6295_device, read, write) AM_RANGE(0x88, 0x88) AM_DEVREADWRITE("oki2", okim6295_device, read, write) AM_RANGE(0x90, 0x97) AM_DEVWRITE("nmk112", nmk112_device, okibank_w) ADDRESS_MAP_END +static ADDRESS_MAP_START( powerinsa_oki_map, AS_0, 8, powerins_state ) + AM_RANGE(0x00000, 0x2ffff) AM_ROM + AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank") +ADDRESS_MAP_END + /*************************************************************************** @@ -311,14 +285,9 @@ GFXDECODE_END ***************************************************************************/ -void powerins_state::machine_reset() -{ - m_oki_bank = -1; // samples bank "unitialised" -} - -WRITE_LINE_MEMBER(powerins_state::irqhandler) +MACHINE_START_MEMBER(powerins_state, powerinsa) { - m_soundcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); + membank("okibank")->configure_entries(0, 5, memregion("oki1")->base() + 0x30000, 0x10000); } static MACHINE_CONFIG_START( powerins, powerins_state ) @@ -339,7 +308,7 @@ static MACHINE_CONFIG_START( powerins, powerins_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 256) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0+16, 256-16-1) - MCFG_SCREEN_UPDATE_DRIVER(powerins_state, screen_update_powerins) + MCFG_SCREEN_UPDATE_DRIVER(powerins_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", powerins) @@ -357,7 +326,7 @@ static MACHINE_CONFIG_START( powerins, powerins_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) MCFG_SOUND_ADD("ym2203", YM2203, 12000000 / 8) - MCFG_YM2203_IRQ_HANDLER(WRITELINE(powerins_state, irqhandler)) + MCFG_YM2203_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0) MCFG_DEVICE_ADD("nmk112", NMK112, 0) @@ -365,19 +334,22 @@ static MACHINE_CONFIG_START( powerins, powerins_state ) MCFG_NMK112_ROM1("oki2") MACHINE_CONFIG_END -static MACHINE_CONFIG_DERIVED( powerina, powerins ) +static MACHINE_CONFIG_DERIVED( powerinsa, powerins ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(powerina_map) + MCFG_CPU_PROGRAM_MAP(powerinsa_map) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_REFRESH_RATE(60) MCFG_DEVICE_REMOVE("soundcpu") + MCFG_MACHINE_START_OVERRIDE(powerins_state, powerinsa) + MCFG_OKIM6295_REPLACE("oki1", 990000, OKIM6295_PIN7_LOW) // pin7 not verified + MCFG_DEVICE_ADDRESS_MAP(AS_0, powerinsa_oki_map) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_DEVICE_REMOVE("oki2") @@ -385,7 +357,7 @@ static MACHINE_CONFIG_DERIVED( powerina, powerins ) MCFG_DEVICE_REMOVE("nmk112") MACHINE_CONFIG_END -static MACHINE_CONFIG_DERIVED( powerinb, powerins ) +static MACHINE_CONFIG_DERIVED( powerinsb, powerins ) /* basic machine hardware */ @@ -393,7 +365,7 @@ static MACHINE_CONFIG_DERIVED( powerinb, powerins ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_CPU_MODIFY("soundcpu") /* 6 MHz */ - MCFG_CPU_IO_MAP(powerinb_sound_io_map) + MCFG_CPU_IO_MAP(powerinsb_sound_io_map) MCFG_CPU_PERIODIC_INT_DRIVER(powerins_state, irq0_line_hold, 120) // YM2203 rate is at 150?? MCFG_DEVICE_REMOVE("ym2203") // Sound code talks to one, but it's not fitted on the board @@ -590,9 +562,8 @@ ROM_START( powerinsa ) ROM_LOAD( "rom8", 0x400000, 0x200000, CRC(b02fdd6d) SHA1(1e2c52b4e9999f0b564fcf13ff41b097ad7d0c39) ) ROM_LOAD( "rom7", 0x600000, 0x200000, CRC(92ab9996) SHA1(915ec8f383cc3652c3816a9b56ee54e22e104a5c) ) - ROM_REGION( 0x090000, "oki1", 0 ) /* 8 bit adpcm (banked) */ - ROM_LOAD( "rom5", 0x000000, 0x030000, CRC(88579c8f) SHA1(13083934ab294c9b08d3e36f55c00a6a2e5a0507) ) - ROM_CONTINUE( 0x040000, 0x050000 ) + ROM_REGION( 0x080000, "oki1", 0 ) /* 8 bit adpcm (banked) */ + ROM_LOAD( "rom5", 0x000000, 0x080000, CRC(88579c8f) SHA1(13083934ab294c9b08d3e36f55c00a6a2e5a0507) ) ROM_END /*************************************************************************** @@ -701,7 +672,7 @@ ROM_END /* all supported sets give a 93.10.20 date */ -GAME( 1993, powerins, 0, powerins, powerins, driver_device, 0, ROT0, "Atlus", "Power Instinct (USA)", 0 ) -GAME( 1993, powerinsj, powerins, powerins, powerinj, driver_device, 0, ROT0, "Atlus", "Gouketsuji Ichizoku (Japan)", 0 ) -GAME( 1993, powerinsa, powerins, powerina, powerins, driver_device, 0, ROT0, "bootleg", "Power Instinct (USA, bootleg set 1)", 0 ) -GAME( 1993, powerinsb, powerins, powerinb, powerins, driver_device, 0, ROT0, "bootleg", "Power Instinct (USA, bootleg set 2)", 0 ) +GAME( 1993, powerins, 0, powerins, powerins, driver_device, 0, ROT0, "Atlus", "Power Instinct (USA)", GAME_SUPPORTS_SAVE ) +GAME( 1993, powerinsj, powerins, powerins, powerinj, driver_device, 0, ROT0, "Atlus", "Gouketsuji Ichizoku (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1993, powerinsa, powerins, powerinsa, powerins, driver_device, 0, ROT0, "bootleg", "Power Instinct (USA, bootleg set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1993, powerinsb, powerins, powerinsb, powerins, driver_device, 0, ROT0, "bootleg", "Power Instinct (USA, bootleg set 2)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c index 5e3b696e63d..537c5517a33 100644 --- a/src/mame/drivers/ppmast93.c +++ b/src/mame/drivers/ppmast93.c @@ -131,7 +131,6 @@ Dip locations added based on the notes above. #include "emu.h" #include "cpu/z80/z80.h" -#include "sound/3812intf.h" #include "sound/2413intf.h" #include "sound/dac.h" @@ -141,75 +140,80 @@ class ppmast93_state : public driver_device public: ppmast93_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_bgram(*this, "bgram"), - m_fgram(*this, "fgram"), m_maincpu(*this, "maincpu"), m_dac(*this, "dac"), - m_gfxdecode(*this, "gfxdecode") { } + m_ymsnd(*this, "ymsnd"), + m_gfxdecode(*this, "gfxdecode"), + m_bgram(*this, "bgram"), + m_fgram(*this, "fgram") { } - tilemap_t *m_fg_tilemap; - tilemap_t *m_bg_tilemap; - required_shared_ptr<UINT8> m_bgram; - required_shared_ptr<UINT8> m_fgram; - DECLARE_WRITE8_MEMBER(ppmast93_fgram_w); - DECLARE_WRITE8_MEMBER(ppmast93_bgram_w); - DECLARE_WRITE8_MEMBER(ppmast93_port4_w); - DECLARE_WRITE8_MEMBER(ppmast_sound_w); - TILE_GET_INFO_MEMBER(get_ppmast93_bg_tile_info); - TILE_GET_INFO_MEMBER(get_ppmast93_fg_tile_info); - virtual void video_start(); - UINT32 screen_update_ppmast93(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device<cpu_device> m_maincpu; required_device<dac_device> m_dac; + required_device<ym2413_device> m_ymsnd; required_device<gfxdecode_device> m_gfxdecode; -}; + required_shared_ptr<UINT8> m_bgram; + required_shared_ptr<UINT8> m_fgram; + tilemap_t *m_fg_tilemap; + tilemap_t *m_bg_tilemap; + + DECLARE_WRITE8_MEMBER(fgram_w); + DECLARE_WRITE8_MEMBER(bgram_w); + DECLARE_WRITE8_MEMBER(port4_w); + DECLARE_WRITE8_MEMBER(sound_w); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + + virtual void machine_start(); + virtual void video_start(); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; -WRITE8_MEMBER(ppmast93_state::ppmast93_fgram_w) +void ppmast93_state::machine_start() +{ + membank("cpubank")->configure_entries(0, 8, memregion("maincpu")->base(), 0x4000); +} + +WRITE8_MEMBER(ppmast93_state::fgram_w) { m_fgram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset/2); } -WRITE8_MEMBER(ppmast93_state::ppmast93_bgram_w) +WRITE8_MEMBER(ppmast93_state::bgram_w) { m_bgram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset/2); } -WRITE8_MEMBER(ppmast93_state::ppmast93_port4_w) +WRITE8_MEMBER(ppmast93_state::port4_w) { - UINT8 *rom = memregion("maincpu")->base(); - int bank; - coin_counter_w(machine(), 0, data & 0x08); coin_counter_w(machine(), 1, data & 0x10); - bank = data & 0x07; - membank("bank1")->set_base(&rom[0x10000+(bank*0x4000)]); + membank("cpubank")->set_entry(data & 0x07); } static ADDRESS_MAP_START( ppmast93_cpu1_map, AS_PROGRAM, 8, ppmast93_state ) - AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITENOP AM_REGION("maincpu", 0x10000) - AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") - AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ppmast93_bgram_w) AM_SHARE("bgram") + AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITENOP + AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("cpubank") + AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(bgram_w) AM_SHARE("bgram") AM_RANGE(0xd800, 0xdfff) AM_WRITENOP - AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(ppmast93_fgram_w) AM_SHARE("fgram") + AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(fgram_w) AM_SHARE("fgram") AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( ppmast93_cpu1_io, AS_IO, 8, ppmast93_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") + AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(soundlatch_byte_w) AM_RANGE(0x02, 0x02) AM_READ_PORT("P2") - AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM") + AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM") AM_WRITE(port4_w) AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW1") AM_RANGE(0x08, 0x08) AM_READ_PORT("DSW2") - - AM_RANGE(0x00, 0x00) AM_WRITE(soundlatch_byte_w) - AM_RANGE(0x04, 0x04) AM_WRITE(ppmast93_port4_w) ADDRESS_MAP_END static ADDRESS_MAP_START( ppmast93_cpu2_map, AS_PROGRAM, 8, ppmast93_state ) @@ -219,19 +223,19 @@ static ADDRESS_MAP_START( ppmast93_cpu2_map, AS_PROGRAM, 8, ppmast93_state ) ADDRESS_MAP_END -WRITE8_MEMBER(ppmast93_state::ppmast_sound_w) +WRITE8_MEMBER(ppmast93_state::sound_w) { switch(offset&0xff) { case 0: - case 1: machine().device<ym2413_device>("ymsnd")->write(space,offset,data); break; + case 1: m_ymsnd->write(space,offset,data); break; case 2: m_dac->write_unsigned8(data);break; default: logerror("%x %x - %x\n",offset,data,space.device().safe_pcbase()); } } static ADDRESS_MAP_START( ppmast93_cpu2_io, AS_IO, 8, ppmast93_state ) - AM_RANGE(0x0000, 0xffff) AM_ROM AM_WRITE(ppmast_sound_w) AM_REGION("sub", 0x20000) + AM_RANGE(0x0000, 0xffff) AM_ROM AM_WRITE(sound_w) AM_REGION("sub", 0x20000) ADDRESS_MAP_END static INPUT_PORTS_START( ppmast93 ) @@ -332,7 +336,7 @@ static GFXDECODE_START( ppmast93 ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) GFXDECODE_END -TILE_GET_INFO_MEMBER(ppmast93_state::get_ppmast93_bg_tile_info) +TILE_GET_INFO_MEMBER(ppmast93_state::get_bg_tile_info) { int code = (m_bgram[tile_index*2+1] << 8) | m_bgram[tile_index*2]; SET_TILE_INFO_MEMBER(0, @@ -341,7 +345,7 @@ TILE_GET_INFO_MEMBER(ppmast93_state::get_ppmast93_bg_tile_info) 0); } -TILE_GET_INFO_MEMBER(ppmast93_state::get_ppmast93_fg_tile_info) +TILE_GET_INFO_MEMBER(ppmast93_state::get_fg_tile_info) { int code = (m_fgram[tile_index*2+1] << 8) | m_fgram[tile_index*2]; SET_TILE_INFO_MEMBER(0, @@ -352,13 +356,13 @@ TILE_GET_INFO_MEMBER(ppmast93_state::get_ppmast93_fg_tile_info) void ppmast93_state::video_start() { - m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ppmast93_state::get_ppmast93_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32, 32); - m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ppmast93_state::get_ppmast93_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32, 32); + m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ppmast93_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32, 32); + m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(ppmast93_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32, 32); m_fg_tilemap->set_transparent_pen(0); } -UINT32 ppmast93_state::screen_update_ppmast93(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 ppmast93_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); @@ -370,7 +374,7 @@ static MACHINE_CONFIG_START( ppmast93, ppmast93_state ) MCFG_CPU_ADD("maincpu", Z80,5000000) /* 5 MHz */ MCFG_CPU_PROGRAM_MAP(ppmast93_cpu1_map) MCFG_CPU_IO_MAP(ppmast93_cpu1_io) - MCFG_CPU_VBLANK_INT_DRIVER("screen", ppmast93_state, irq0_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", ppmast93_state, irq0_line_hold) MCFG_CPU_ADD("sub", Z80,5000000) /* 5 MHz */ MCFG_CPU_PROGRAM_MAP(ppmast93_cpu2_map) @@ -383,7 +387,7 @@ static MACHINE_CONFIG_START( ppmast93, ppmast93_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1) - MCFG_SCREEN_UPDATE_DRIVER(ppmast93_state, screen_update_ppmast93) + MCFG_SCREEN_UPDATE_DRIVER(ppmast93_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", ppmast93) @@ -402,8 +406,8 @@ static MACHINE_CONFIG_START( ppmast93, ppmast93_state ) MACHINE_CONFIG_END ROM_START( ppmast93 ) - ROM_REGION( 0x30000, "maincpu", 0 ) - ROM_LOAD( "2.up7", 0x10000, 0x20000, CRC(8854d8db) SHA1(9d93ddfb44d533772af6519747a6cb50b42065cd) ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "2.up7", 0x00000, 0x20000, CRC(8854d8db) SHA1(9d93ddfb44d533772af6519747a6cb50b42065cd) ) ROM_REGION( 0x30000, "sub", 0 ) ROM_LOAD( "1.ue7", 0x10000, 0x20000, CRC(8e26939e) SHA1(e62441e523f5be6a3889064cc5e0f44545260e93) ) @@ -418,4 +422,4 @@ ROM_START( ppmast93 ) ROM_LOAD( "prom1.ug26", 0x200, 0x100, CRC(d979c64e) SHA1(172c9579013d58e35a5b4f732e360811ac36295e) ) ROM_END -GAME( 1993, ppmast93, 0, ppmast93, ppmast93, driver_device, 0, ROT0, "Electronic Devices S.R.L.", "Ping Pong Masters '93", GAME_IMPERFECT_SOUND ) +GAME( 1993, ppmast93, 0, ppmast93, ppmast93, driver_device, 0, ROT0, "Electronic Devices S.R.L.", "Ping Pong Masters '93", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c index 5998e87ba85..b7da83ebe5c 100644 --- a/src/mame/drivers/psychic5.c +++ b/src/mame/drivers/psychic5.c @@ -318,14 +318,14 @@ The first sprite data is located at f20b,then f21b and so on. MACHINE_START_MEMBER(psychic5_state, psychic5) { membank("mainbank")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); - + save_item(NAME(m_bank_latch)); } MACHINE_START_MEMBER(psychic5_state, bombsa) { membank("mainbank")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); - + save_item(NAME(m_bank_latch)); } @@ -707,7 +707,7 @@ static MACHINE_CONFIG_START( psychic5, psychic5_state ) MCFG_CPU_IO_MAP(psychic5_soundport_map) MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* Allow time for 2nd cpu to interleave */ - + MCFG_MACHINE_START_OVERRIDE(psychic5_state,psychic5) /* video hardware */ @@ -763,7 +763,7 @@ static MACHINE_CONFIG_START( bombsa, psychic5_state ) MCFG_CPU_IO_MAP(bombsa_soundport_map) MCFG_QUANTUM_TIME(attotime::from_hz(600)) - + MCFG_MACHINE_START_OVERRIDE(psychic5_state,bombsa) /* video hardware */ diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c index aeddf8a66a3..894102ea23c 100644 --- a/src/mame/drivers/pturn.c +++ b/src/mame/drivers/pturn.c @@ -123,14 +123,14 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); - + DECLARE_DRIVER_INIT(pturn); virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + INTERRUPT_GEN_MEMBER(sub_intgen); INTERRUPT_GEN_MEMBER(main_intgen); }; @@ -174,7 +174,7 @@ void pturn_state::video_start() m_fgmap->set_transparent_pen(0); m_bgmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pturn_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8, 8,32,32*8); m_bgmap->set_transparent_pen(0); - + save_item(NAME(m_bgbank)); save_item(NAME(m_fgbank)); save_item(NAME(m_bgpalette)); diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c index 1c2cb63a56b..7d335f9c0fb 100644 --- a/src/mame/drivers/re900.c +++ b/src/mame/drivers/re900.c @@ -101,18 +101,18 @@ public: UINT8 m_ledant; UINT8 m_player; UINT8 m_stat_a; - + // common DECLARE_READ8_MEMBER(rom_r); DECLARE_WRITE8_MEMBER(cpu_port_0_w); DECLARE_WRITE8_MEMBER(watchdog_reset_w); - + // re900 specific DECLARE_READ8_MEMBER(re_psg_portA_r); DECLARE_READ8_MEMBER(re_psg_portB_r); DECLARE_WRITE8_MEMBER(re_mux_port_A_w); DECLARE_WRITE8_MEMBER(re_mux_port_B_w); - + DECLARE_DRIVER_INIT(re900); }; @@ -432,7 +432,7 @@ DRIVER_INIT_MEMBER(re900_state,re900) m_player = 1; m_stat_a = 1; m_psg_pa = m_psg_pb = m_mux_data = m_ledant = 0; - + save_item(NAME(m_psg_pa)); save_item(NAME(m_psg_pb)); save_item(NAME(m_mux_data)); diff --git a/src/mame/drivers/rltennis.c b/src/mame/drivers/rltennis.c index 40f3558cddc..4523bd4c6dc 100644 --- a/src/mame/drivers/rltennis.c +++ b/src/mame/drivers/rltennis.c @@ -157,7 +157,7 @@ void rltennis_state::machine_start() m_samples_2 = memregion("samples2")->base(); m_gfx = memregion("gfx1")->base(); m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rltennis_state::sample_player),this)); - + save_item(NAME(m_data760000)); save_item(NAME(m_data740000)); save_item(NAME(m_dac_counter)); diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c index 63463470401..c90646ca5aa 100644 --- a/src/mame/drivers/rmhaihai.c +++ b/src/mame/drivers/rmhaihai.c @@ -39,17 +39,23 @@ class rmhaihai_state : public driver_device public: rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_colorram(*this, "colorram"), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_msm(*this, "msm"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode"), + m_colorram(*this, "colorram"), + m_videoram(*this, "videoram") { } + + required_device<cpu_device> m_maincpu; + required_device<msm5205_device> m_msm; + required_device<gfxdecode_device> m_gfxdecode; - int m_gfxbank; required_shared_ptr<UINT8> m_colorram; required_shared_ptr<UINT8> m_videoram; + tilemap_t *m_bg_tilemap; int m_keyboard_cmd; + int m_gfxbank; + DECLARE_WRITE8_MEMBER(rmhaihai_videoram_w); DECLARE_WRITE8_MEMBER(rmhaihai_colorram_w); DECLARE_READ8_MEMBER(keyboard_r); @@ -58,14 +64,15 @@ public: DECLARE_WRITE8_MEMBER(ctrl_w); DECLARE_WRITE8_MEMBER(themj_rombank_w); DECLARE_WRITE8_MEMBER(adpcm_w); + DECLARE_DRIVER_INIT(rmhaihai); - TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start(); + DECLARE_MACHINE_START(themj); DECLARE_MACHINE_RESET(themj); - UINT32 screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<msm5205_device> m_msm; - required_device<gfxdecode_device> m_gfxdecode; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); }; @@ -95,9 +102,12 @@ void rmhaihai_state::video_start() { m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(rmhaihai_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + save_item(NAME(m_keyboard_cmd)); + save_item(NAME(m_gfxbank)); } -UINT32 rmhaihai_state::screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 rmhaihai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -190,16 +200,21 @@ WRITE8_MEMBER(rmhaihai_state::ctrl_w) WRITE8_MEMBER(rmhaihai_state::themj_rombank_w) { - UINT8 *rom = memregion("maincpu")->base() + 0x10000; - int bank = data & 0x03; -logerror("banksw %d\n",bank); - membank("bank1")->set_base(rom + bank*0x4000); - membank("bank2")->set_base(rom + bank*0x4000 + 0x2000); + logerror("banksw %d\n", data & 0x03); + membank("bank1")->set_entry(data & 0x03); + membank("bank2")->set_entry(data & 0x03); +} + +MACHINE_START_MEMBER(rmhaihai_state,themj) +{ + membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); + membank("bank2")->configure_entries(0, 4, memregion("maincpu")->base() + 0x12000, 0x4000); } MACHINE_RESET_MEMBER(rmhaihai_state,themj) { - themj_rombank_w(m_maincpu->space(AS_IO), 0, 0); + membank("bank1")->set_entry(0); + membank("bank2")->set_entry(0); } @@ -465,7 +480,7 @@ static MACHINE_CONFIG_START( rmhaihai, rmhaihai_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(4*8, 60*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update_rmhaihai) + MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", rmhaihai) @@ -503,6 +518,7 @@ static MACHINE_CONFIG_DERIVED( themj, rmhaihai ) MCFG_CPU_PROGRAM_MAP(themj_map) MCFG_CPU_IO_MAP(themj_io_map) + MCFG_MACHINE_START_OVERRIDE(rmhaihai_state,themj) MCFG_MACHINE_RESET_OVERRIDE(rmhaihai_state,themj) /* video hardware */ @@ -678,8 +694,8 @@ DRIVER_INIT_MEMBER(rmhaihai_state,rmhaihai) } -GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan)", 0 ) -GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", 0 ) -GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", 0 ) -GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", 0 ) -GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", 0 ) +GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c index 0427f280b42..5137479466e 100644 --- a/src/mame/drivers/route16.c +++ b/src/mame/drivers/route16.c @@ -6,7 +6,7 @@ Notes: Route 16 and Stratovox use identical hardware with the following exceptions: Stratovox has a DAC for voice. - Route 16 has the added ability to turn off each bitplane indiviaually. + Route 16 has the added ability to turn off each bitplane individually. This looks like an afterthought, as one of the same bits that control the palette selection is doubly utilized as the bitmap enable bit. @@ -86,18 +86,6 @@ -READ8_MEMBER(route16_state::sharedram_r) -{ - return m_sharedram[offset]; -} - - -WRITE8_MEMBER(route16_state::sharedram_w) -{ - m_sharedram[offset] = data; -} - - WRITE8_MEMBER(route16_state::route16_sharedram_w) { m_sharedram[offset] = data; @@ -214,9 +202,9 @@ WRITE8_MEMBER(route16_state::speakres_out2_w) static ADDRESS_MAP_START( route16_cpu1_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM /*AM_RANGE(0x3000, 0x3001) AM_NOP protection device */ - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, route16_sharedram_w) AM_SHARE("sharedram") - AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) - AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(route16_sharedram_w) AM_SHARE("sharedram") + AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w) + AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w) AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1") ADDRESS_MAP_END @@ -224,9 +212,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( routex_cpu1_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, route16_sharedram_w) AM_SHARE("sharedram") - AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) - AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(route16_sharedram_w) AM_SHARE("sharedram") + AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w) + AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w) AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_RANGE(0x6400, 0x6400) AM_READ(routex_prot_read) AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1") @@ -235,9 +223,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( stratvox_cpu1_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram") - AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) - AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram") + AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w) + AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w) AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1") ADDRESS_MAP_END @@ -245,9 +233,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( speakres_cpu1_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram") - AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) - AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram") + AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w) + AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w) AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_WRITE(speakres_out2_w) AM_RANGE(0x6000, 0x6000) AM_READ(speakres_in3_r) AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1") @@ -256,9 +244,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( ttmahjng_cpu1_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram") - AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w) - AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0") AM_WRITE(route16_out1_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram") + AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w) + AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0") AM_WRITE(out1_w) AM_RANGE(0x5800, 0x5800) AM_READWRITE(ttmahjng_input_port_matrix_r, ttmahjng_input_port_matrix_w) AM_RANGE(0x6800, 0x6800) AM_DEVWRITE("ay8910", ay8910_device, data_w) AM_RANGE(0x6900, 0x6900) AM_DEVWRITE("ay8910", ay8910_device, address_w) @@ -268,7 +256,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( route16_cpu2_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x1fff) AM_ROM - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, route16_sharedram_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(route16_sharedram_w) AM_SHARE("sharedram") AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram2") ADDRESS_MAP_END @@ -276,7 +264,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( stratvox_cpu2_map, AS_PROGRAM, 8, route16_state ) AM_RANGE(0x0000, 0x1fff) AM_ROM AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("dac", dac_device, write_unsigned8) - AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) + AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram") AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram2") ADDRESS_MAP_END @@ -552,6 +540,16 @@ static INPUT_PORTS_START( ttmahjng ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END +MACHINE_START_MEMBER(route16_state, speakres) +{ + save_item(NAME(m_speakres_vrx)); +} + +MACHINE_START_MEMBER(route16_state, ttmahjng) +{ + save_item(NAME(m_ttmahjng_port_select)); +} + static MACHINE_CONFIG_START( route16, route16_state ) @@ -596,6 +594,7 @@ static MACHINE_CONFIG_DERIVED( stratvox, route16 ) MCFG_CPU_MODIFY("cpu2") MCFG_CPU_PROGRAM_MAP(stratvox_cpu2_map) + /* video hardware */ MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_stratvox) @@ -630,6 +629,8 @@ static MACHINE_CONFIG_DERIVED( speakres, stratvox ) /* basic machine hardware */ MCFG_CPU_MODIFY("cpu1") MCFG_CPU_PROGRAM_MAP(speakres_cpu1_map) + + MCFG_MACHINE_START_OVERRIDE(route16_state, speakres) MACHINE_CONFIG_END @@ -646,6 +647,8 @@ static MACHINE_CONFIG_DERIVED( ttmahjng, route16 ) MCFG_CPU_PROGRAM_MAP(ttmahjng_cpu1_map) MCFG_CPU_IO_MAP(0) + MCFG_MACHINE_START_OVERRIDE(route16_state, ttmahjng) + /* video hardware */ MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_ttmahjng) @@ -969,14 +972,14 @@ DRIVER_INIT_MEMBER(route16_state,route16a) * *************************************/ -GAME( 1981, route16, 0, route16, route16, route16_state, route16, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 1)", 0 ) -GAME( 1981, route16a, route16, route16, route16, route16_state, route16a, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 2)", 0 ) -GAME( 1981, route16b, route16, route16, route16, driver_device, 0, ROT270, "bootleg", "Route 16 (bootleg)", 0 ) -GAME( 1981, routex, route16, routex, route16, driver_device, 0, ROT270, "bootleg", "Route X (bootleg)", 0 ) -GAME( 1980, speakres, 0, speakres, speakres, driver_device, 0, ROT270, "Sun Electronics", "Speak & Rescue", 0 ) -GAME( 1980, speakresb,speakres, speakres, speakres, driver_device, 0, ROT270, "bootleg", "Speak & Rescue (bootleg)", 0 ) -GAME( 1980, stratvox, speakres, stratvox, stratvox, driver_device, 0, ROT270, "Sun Electronics (Taito license)", "Stratovox", 0 ) -GAME( 1980, stratvoxb,speakres, stratvox, stratvox, driver_device, 0, ROT270, "bootleg", "Stratovox (bootleg)", 0 ) -GAME( 1980, spacecho, speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg", "Space Echo (set 1)", 0 ) -GAME( 1980, spacecho2,speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg", "Space Echo (set 2)", 0 ) -GAME( 1981, ttmahjng, 0, ttmahjng, ttmahjng, driver_device, 0, ROT0, "Taito", "T.T Mahjong", 0 ) +GAME( 1981, route16, 0, route16, route16, route16_state, route16, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1981, route16a, route16, route16, route16, route16_state, route16a, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1981, route16b, route16, route16, route16, driver_device, 0, ROT270, "bootleg", "Route 16 (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1981, routex, route16, routex, route16, driver_device, 0, ROT270, "bootleg", "Route X (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1980, speakres, 0, speakres, speakres, driver_device, 0, ROT270, "Sun Electronics", "Speak & Rescue", GAME_SUPPORTS_SAVE ) +GAME( 1980, speakresb,speakres, speakres, speakres, driver_device, 0, ROT270, "bootleg", "Speak & Rescue (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1980, stratvox, speakres, stratvox, stratvox, driver_device, 0, ROT270, "Sun Electronics (Taito license)", "Stratovox", GAME_SUPPORTS_SAVE ) +GAME( 1980, stratvoxb,speakres, stratvox, stratvox, driver_device, 0, ROT270, "bootleg", "Stratovox (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1980, spacecho, speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg", "Space Echo (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1980, spacecho2,speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg", "Space Echo (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1981, ttmahjng, 0, ttmahjng, ttmahjng, driver_device, 0, ROT0, "Taito", "T.T Mahjong", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c index 153ddbd73b6..baf5c66adbf 100644 --- a/src/mame/drivers/sandscrp.c +++ b/src/mame/drivers/sandscrp.c @@ -102,7 +102,7 @@ public: UINT8 m_vblank_irq; UINT8 m_latch1_full; UINT8 m_latch2_full; - + DECLARE_READ16_MEMBER(irq_cause_r); DECLARE_WRITE16_MEMBER(irq_cause_w); DECLARE_WRITE16_MEMBER(coincounter_w); @@ -114,12 +114,12 @@ public: DECLARE_READ8_MEMBER(latchstatus_r); DECLARE_READ8_MEMBER(soundlatch_r); DECLARE_WRITE8_MEMBER(soundlatch_w); - + virtual void machine_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); - + INTERRUPT_GEN_MEMBER(interrupt); void update_irq_state(); }; @@ -150,7 +150,7 @@ UINT32 sandscrp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap void sandscrp_state::machine_start() { membank("bank1")->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000); - + save_item(NAME(m_sprite_irq)); save_item(NAME(m_unknown_irq)); save_item(NAME(m_vblank_irq)); diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c index aea64789de4..ead37d0d5f1 100644 --- a/src/mame/drivers/scobra.c +++ b/src/mame/drivers/scobra.c @@ -1253,4 +1253,3 @@ GAME( 1981, hustlerb4, hustler, hustlerb4, hustler, driver_device, 0, GAME( 1982, mimonkey, 0, mimonkey, mimonkey, scramble_state, mimonkey, ROT90, "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE ) GAME( 1982, mimonsco, mimonkey, mimonkey, mimonsco, scramble_state, mimonsco, ROT90, "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE ) - diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c index 1b846ac620c..240ed6de3ad 100644 --- a/src/mame/drivers/seattle.c +++ b/src/mame/drivers/seattle.c @@ -566,9 +566,9 @@ void seattle_state::machine_start() /* set the fastest DRC options, but strict verification */ m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); - /* configure fast RAM regions for DRC */ - m_maincpu->mips3drc_add_fastram(0x00000000, 0x007fffff, FALSE, m_rambase); - m_maincpu->mips3drc_add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); + /* configure fast RAM regions */ + m_maincpu->add_fastram(0x00000000, 0x007fffff, FALSE, m_rambase); + m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); /* register for save states */ save_item(NAME(m_galileo.reg)); diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c index 631dff9883b..43b3986b6bd 100644 --- a/src/mame/drivers/segas32.c +++ b/src/mame/drivers/segas32.c @@ -4192,37 +4192,67 @@ ROM_START( scross ) ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */ ROM_LOAD32_WORD_x2( "epr-15093.ic37", 0x000000, 0x040000, CRC(2adc7a4b) SHA1(dca71f00d94898c0758394704d819e13482bf120) ) ROM_LOAD32_WORD_x2( "epr-15094.ic40", 0x000002, 0x040000, CRC(bbb0ae73) SHA1(0d8837706405f301adf8fa85c8d4813d7600af98) ) - ROM_LOAD32_WORD( "epr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) ) - ROM_LOAD32_WORD( "epr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) ) + ROM_LOAD32_WORD( "mpr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) ) + ROM_LOAD32_WORD( "mpr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) ) ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */ ROM_LOAD_x4( "epr-15192.ic31", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) ) ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */ - /* 1ST AND 2ND HALF IDENTICAL (all roms) */ - ROM_LOAD16_BYTE( "epr-15020.ic3", 0x000000, 0x200000, CRC(65afea2f) SHA1(ad573727398bfac8e94f321be84b60e5690bfba6) ) - ROM_LOAD16_BYTE( "epr-15021.ic11", 0x000001, 0x200000, CRC(27bc6969) SHA1(d6bb446becb2d36b73bca5055357a43b837afc0a) ) + ROM_LOAD16_BYTE( "mpr-15020.ic3", 0x000000, 0x100000, CRC(de47006a) SHA1(dbef7b9ff8c39992b8596d38985e65c627d6fa79) ) + ROM_LOAD16_BYTE( "mpr-15021.ic11", 0x000001, 0x100000, CRC(3677db02) SHA1(7aeeb85f1632253fcdc8f7881512066e97837e5e) ) ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */ - /* 1ST AND 2ND HALF IDENTICAL (all roms) */ - ROMX_LOAD( "epr-15022.ic14", 0x000000, 0x200000, CRC(09ca9608) SHA1(cbd0138c1c7811d42b051fed6a7e3526cc4e457f) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15024.ic15", 0x000002, 0x200000, CRC(0dc920eb) SHA1(d24d637aa0dcd3bae779ef7e12663df81667dbf7) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15026.ic10", 0x000004, 0x200000, CRC(67637c37) SHA1(7c250e7e9dd5c07da4fa35bacdfcecd5e8fa4ec7) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15028.ic38", 0x000006, 0x200000, CRC(9929abdc) SHA1(34b6624ddd3a0aedec0a2b433643a37f745ec66d) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15023.ic22", 0x800000, 0x200000, CRC(0e42a2bb) SHA1(503214caf5fa9a2324b61e04f378fd1a790322df) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15025.ic23", 0x800002, 0x200000, CRC(0c677fc6) SHA1(fc2207008417072e7ee91f722797d827e150ce2d) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15027.ic18", 0x800004, 0x200000, CRC(d6d077f9) SHA1(928cefae9ae58239fbffb1dcee282c6ac1e661fe) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15029.ic41", 0x800006, 0x200000, CRC(707af749) SHA1(fae5325c983df3cf198878220ad88d47339ac512) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15022.ic14", 0x000000, 0x100000, CRC(baee6fd5) SHA1(ddf022c61f0805af45a84c65eb5d01006c153c07) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15024.ic15", 0x000002, 0x100000, CRC(b9f339e2) SHA1(4b9a392459132a19d62928ef3939e1f2356e3994) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15026.ic10", 0x000004, 0x100000, CRC(b72e8df6) SHA1(a7a87f79814b022985121e163c7f88244c50e427) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15028.ic38", 0x000006, 0x100000, CRC(183f6eb0) SHA1(5a2172d5afd696af361ff9f8a92f5911e05c578d) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15023.ic22", 0x800000, 0x100000, CRC(230735ed) SHA1(36075504e27b8a32d63fa3b8abd7037d17440ebf) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15025.ic23", 0x800002, 0x100000, CRC(da4315cb) SHA1(3910c5654e34b17851d6d93615e3404b3b397fea) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15027.ic18", 0x800004, 0x100000, CRC(b765efb8) SHA1(61f3865f92b36ca4b3cd20c0716a7121755eea73) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15029.ic41", 0x800006, 0x100000, CRC(cf8e3b2b) SHA1(c158810d9d82b10a753bc739d1f56572042dac0b) , ROM_SKIP(6)|ROM_GROUPWORD ) ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */ - /* 1ST AND 2ND HALF IDENTICAL (all roms, are these OK?) */ - ROM_LOAD("epr-15031.ic1", 0x000000, 0x200000, CRC(663a7fd2) SHA1(b4393a687225b075db21960d19a6ddd7a9d7d086) ) - ROM_LOAD("epr-15032.ic2", 0x200000, 0x200000, CRC(cb709f3d) SHA1(3962c8b5907d1f8f611f58ddac693cc47364a79c) ) + ROM_LOAD( "mpr-15031.ic1", 0x000000, 0x100000, CRC(6af139dc) SHA1(2378c2ad0c52c114eb93206a6fbee723c038d030) ) + ROM_LOAD( "mpr-15032.ic2", 0x200000, 0x100000, CRC(915d6096) SHA1(e1f670949b1254f5a3c3131993ca9b3baa4d9f6b) ) ROM_REGION( 0x20000, "user2", 0 ) /* comms board? - might not belong to this game, just going based on epr number */ ROM_LOAD( "epr-15033.ic17", 0x00000, 0x20000, CRC(dc19ac00) SHA1(16bbb5af034e5419673e637be30283b73ab7b290) ) ROM_END +ROM_START( scrossa ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */ + // 37/40 were missing labels + ROM_LOAD32_WORD_x2( "ic37", 0x000000, 0x040000, CRC(240a7655) SHA1(7cfdce002fb4783e8c1debf206922d88647c106e) ) + ROM_LOAD32_WORD_x2( "ic40", 0x000002, 0x040000, CRC(3a073060) SHA1(c92c8d8921d94d85c8484c103cbf9cd6ad651333) ) + ROM_LOAD32_WORD( "mpr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) ) + ROM_LOAD32_WORD( "mpr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) ) + + ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */ + ROM_LOAD_x4( "epr-15192.ic31", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) ) + + ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */ + ROM_LOAD16_BYTE( "mpr-15020.ic3", 0x000000, 0x100000, CRC(de47006a) SHA1(dbef7b9ff8c39992b8596d38985e65c627d6fa79) ) + ROM_LOAD16_BYTE( "mpr-15021.ic11", 0x000001, 0x100000, CRC(3677db02) SHA1(7aeeb85f1632253fcdc8f7881512066e97837e5e) ) + + ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */ + ROMX_LOAD( "mpr-15022.ic14", 0x000000, 0x100000, CRC(baee6fd5) SHA1(ddf022c61f0805af45a84c65eb5d01006c153c07) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15024.ic15", 0x000002, 0x100000, CRC(b9f339e2) SHA1(4b9a392459132a19d62928ef3939e1f2356e3994) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15026.ic10", 0x000004, 0x100000, CRC(b72e8df6) SHA1(a7a87f79814b022985121e163c7f88244c50e427) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15028.ic38", 0x000006, 0x100000, CRC(183f6eb0) SHA1(5a2172d5afd696af361ff9f8a92f5911e05c578d) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15023.ic22", 0x800000, 0x100000, CRC(230735ed) SHA1(36075504e27b8a32d63fa3b8abd7037d17440ebf) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15025.ic23", 0x800002, 0x100000, CRC(da4315cb) SHA1(3910c5654e34b17851d6d93615e3404b3b397fea) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15027.ic18", 0x800004, 0x100000, CRC(b765efb8) SHA1(61f3865f92b36ca4b3cd20c0716a7121755eea73) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15029.ic41", 0x800006, 0x100000, CRC(cf8e3b2b) SHA1(c158810d9d82b10a753bc739d1f56572042dac0b) , ROM_SKIP(6)|ROM_GROUPWORD ) + + ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */ + ROM_LOAD( "mpr-15031.ic1", 0x000000, 0x100000, CRC(6af139dc) SHA1(2378c2ad0c52c114eb93206a6fbee723c038d030) ) + ROM_LOAD( "mpr-15032.ic2", 0x200000, 0x100000, CRC(915d6096) SHA1(e1f670949b1254f5a3c3131993ca9b3baa4d9f6b) ) + + ROM_REGION( 0x20000, "user2", 0 ) /* comms board confirmed */ + ROM_LOAD( "epr-15033.ic17", 0x00000, 0x20000, CRC(dc19ac00) SHA1(16bbb5af034e5419673e637be30283b73ab7b290) ) +ROM_END + /************************************************************************************************************************** Stadium Cross (US) - Multi-32 not protected @@ -4239,25 +4269,22 @@ ROM_START( scrossu ) ROM_LOAD_x4( "epr-15192.ic31", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) ) ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */ - /* 1ST AND 2ND HALF IDENTICAL (all roms) */ - ROM_LOAD16_BYTE( "epr-15020.ic3", 0x000000, 0x200000, CRC(65afea2f) SHA1(ad573727398bfac8e94f321be84b60e5690bfba6) ) - ROM_LOAD16_BYTE( "epr-15021.ic11", 0x000001, 0x200000, CRC(27bc6969) SHA1(d6bb446becb2d36b73bca5055357a43b837afc0a) ) + ROM_LOAD16_BYTE( "mpr-15020.ic3", 0x000000, 0x100000, CRC(de47006a) SHA1(dbef7b9ff8c39992b8596d38985e65c627d6fa79) ) + ROM_LOAD16_BYTE( "mpr-15021.ic11", 0x000001, 0x100000, CRC(3677db02) SHA1(7aeeb85f1632253fcdc8f7881512066e97837e5e) ) ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */ - /* 1ST AND 2ND HALF IDENTICAL (all roms) */ - ROMX_LOAD( "epr-15022.ic14", 0x000000, 0x200000, CRC(09ca9608) SHA1(cbd0138c1c7811d42b051fed6a7e3526cc4e457f) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15024.ic15", 0x000002, 0x200000, CRC(0dc920eb) SHA1(d24d637aa0dcd3bae779ef7e12663df81667dbf7) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15026.ic10", 0x000004, 0x200000, CRC(67637c37) SHA1(7c250e7e9dd5c07da4fa35bacdfcecd5e8fa4ec7) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15028.ic38", 0x000006, 0x200000, CRC(9929abdc) SHA1(34b6624ddd3a0aedec0a2b433643a37f745ec66d) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15023.ic22", 0x800000, 0x200000, CRC(0e42a2bb) SHA1(503214caf5fa9a2324b61e04f378fd1a790322df) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15025.ic23", 0x800002, 0x200000, CRC(0c677fc6) SHA1(fc2207008417072e7ee91f722797d827e150ce2d) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15027.ic18", 0x800004, 0x200000, CRC(d6d077f9) SHA1(928cefae9ae58239fbffb1dcee282c6ac1e661fe) , ROM_SKIP(6)|ROM_GROUPWORD ) - ROMX_LOAD( "epr-15029.ic41", 0x800006, 0x200000, CRC(707af749) SHA1(fae5325c983df3cf198878220ad88d47339ac512) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15022.ic14", 0x000000, 0x100000, CRC(baee6fd5) SHA1(ddf022c61f0805af45a84c65eb5d01006c153c07) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15024.ic15", 0x000002, 0x100000, CRC(b9f339e2) SHA1(4b9a392459132a19d62928ef3939e1f2356e3994) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15026.ic10", 0x000004, 0x100000, CRC(b72e8df6) SHA1(a7a87f79814b022985121e163c7f88244c50e427) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15028.ic38", 0x000006, 0x100000, CRC(183f6eb0) SHA1(5a2172d5afd696af361ff9f8a92f5911e05c578d) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15023.ic22", 0x800000, 0x100000, CRC(230735ed) SHA1(36075504e27b8a32d63fa3b8abd7037d17440ebf) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15025.ic23", 0x800002, 0x100000, CRC(da4315cb) SHA1(3910c5654e34b17851d6d93615e3404b3b397fea) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15027.ic18", 0x800004, 0x100000, CRC(b765efb8) SHA1(61f3865f92b36ca4b3cd20c0716a7121755eea73) , ROM_SKIP(6)|ROM_GROUPWORD ) + ROMX_LOAD( "mpr-15029.ic41", 0x800006, 0x100000, CRC(cf8e3b2b) SHA1(c158810d9d82b10a753bc739d1f56572042dac0b) , ROM_SKIP(6)|ROM_GROUPWORD ) ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */ - /* 1ST AND 2ND HALF IDENTICAL (all roms, are these OK?) */ - ROM_LOAD("epr-15031.ic1", 0x000000, 0x200000, CRC(663a7fd2) SHA1(b4393a687225b075db21960d19a6ddd7a9d7d086) ) - ROM_LOAD("epr-15032.ic2", 0x200000, 0x200000, CRC(cb709f3d) SHA1(3962c8b5907d1f8f611f58ddac693cc47364a79c) ) + ROM_LOAD( "mpr-15031.ic1", 0x000000, 0x100000, CRC(6af139dc) SHA1(2378c2ad0c52c114eb93206a6fbee723c038d030) ) + ROM_LOAD( "mpr-15032.ic2", 0x200000, 0x100000, CRC(915d6096) SHA1(e1f670949b1254f5a3c3131993ca9b3baa4d9f6b) ) ROM_END @@ -4960,6 +4987,7 @@ GAME( 1992, orunners, 0, multi32, orunners, segas32_state, orunners GAME( 1992, orunnersu, orunners, multi32, orunners, segas32_state, orunners, ROT0, "Sega", "OutRunners (US)", GAME_IMPERFECT_GRAPHICS ) GAME( 1992, orunnersj, orunners, multi32, orunners, segas32_state, orunners, ROT0, "Sega", "OutRunners (Japan)", GAME_IMPERFECT_GRAPHICS ) GAME( 1992, scross, 0, multi32, scross, segas32_state, scross, ROT0, "Sega", "Stadium Cross (World)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1992, scrossa, scross, multi32, scross, segas32_state, scross, ROT0, "Sega", "Stadium Cross (World, alt)", GAME_IMPERFECT_GRAPHICS ) GAME( 1992, scrossu, scross, multi32, scross, segas32_state, scross, ROT0, "Sega", "Stadium Cross (US)", GAME_IMPERFECT_GRAPHICS ) GAME( 1992, titlef, 0, multi32, titlef, segas32_state, titlef, ROT0, "Sega", "Title Fight (World)", GAME_IMPERFECT_GRAPHICS ) GAME( 1992, titlefu, titlef, multi32, titlef, segas32_state, titlef, ROT0, "Sega", "Title Fight (US)", GAME_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c index 3f8f54a15ec..a0f14e724b9 100644 --- a/src/mame/drivers/seibuspi.c +++ b/src/mame/drivers/seibuspi.c @@ -2857,6 +2857,38 @@ ROM_START( rdftj ) ROM_LOAD("flash0_blank_region01.u1053", 0x000000, 0x100000, CRC(7ae7ab76) SHA1(a2b196f470bf64af94002fc4e2640fadad00418f) ) ROM_END +ROM_START( rdftja ) /* SXX2C ROM SUB4 cart */ + ROM_REGION32_LE( 0x200000, "maincpu", 0 ) /* i386 program */ + ROM_LOAD32_BYTE("seibu1.u0211", 0x000000, 0x080000, CRC(b70afcc2) SHA1(70ac545a9fc30df310254997674878fbc2c2d718) ) // socket is silkscreened on pcb PRG0 + ROM_LOAD32_BYTE("raiden-f_prg2.u0212", 0x000001, 0x080000, CRC(58ccb10c) SHA1(0cce4057bfada78121d9586574b98d46cdd7dd46) ) // socket is silkscreened on pcb PRG1 + ROM_LOAD32_WORD("raiden-f_prg34.u0219", 0x000002, 0x100000, CRC(63f01d17) SHA1(74dbd0417b974583da87fc6c7a081b03fd4e16b8) ) // socket is silkscreened on pcb PRG23 + + ROM_REGION( 0x40000, "audiocpu", ROMREGION_ERASE00 ) /* 256K RAM, ROM from Z80 point-of-view */ + + ROM_REGION( 0x30000, "gfx1", ROMREGION_ERASEFF ) /* text layer roms */ + ROM_LOAD24_WORD("raiden-f_fix.u0425", 0x000000, 0x20000, CRC(2be2936b) SHA1(9e719f7328a52af220b6f084c1e0990ca6e2d533) ) // socket is silkscreened on pcb FIX01 + ROM_LOAD24_BYTE("seibu_7.u048", 0x000002, 0x10000, CRC(4d87e1ea) SHA1(3230e9b643fad773e61ab8ce09c0cd7d4d0558e3) ) // socket is silkscreened on pcb FIXP + + ROM_REGION( 0x600000, "gfx2", ROMREGION_ERASEFF ) /* background layer roms */ + ROM_LOAD24_WORD("gun_dogs_bg1-d.u0415", 0x000000, 0x200000, CRC(6a68054c) SHA1(5cbfc4ac90045f1401c2dda7a51936558c9de07e) ) // pads are silkscreened on pcb BG12 + ROM_LOAD24_BYTE("gun_dogs_bg1-p.u0410", 0x000002, 0x100000, CRC(3400794a) SHA1(719808f7442bac612cefd7b7fffcd665e6337ad0) ) // pads are silkscreened on pcb BG12P + ROM_LOAD24_WORD("gun_dogs_bg2-d.u0424", 0x300000, 0x200000, CRC(61cd2991) SHA1(bb608e3948bf9ea35b5e1615d2ba6858d029dcbe) ) // pads are silkscreened on pcb BG3 + ROM_LOAD24_BYTE("gun_dogs_bg2-p.u049", 0x300002, 0x100000, CRC(502d5799) SHA1(c3a0e1a4f5a7b35572ae1ff31315da4ed08aa2fe) ) // pads are silkscreened on pcb BG3P + + ROM_REGION( 0xc00000, "gfx3", 0 ) /* sprites */ + ROM_LOAD("gun_dogs_obj-1.u0322", 0x000000, 0x400000, CRC(59d86c99) SHA1(d3c9241e7b51fe21f8351051b063f91dc69bf905) ) // pads are silkscreened on pcb OBJ1 + ROM_LOAD("gun_dogs_obj-2.u0324", 0x400000, 0x400000, CRC(1ceb0b6f) SHA1(97225a9b3e7be18080aa52f6570af2cce8f25c06) ) // pads are silkscreened on pcb OBJ2 + ROM_LOAD("gun_dogs_obj-3.u0323", 0x800000, 0x400000, CRC(36e93234) SHA1(51917a80b7da5c32a9434a1076fc2916d62e6a3e) ) // pads are silkscreened on pcb OBJ3 + + ROM_REGION32_LE( 0xa00000, "sound01", ROMREGION_ERASE00 ) /* sound roms */ + ROM_LOAD32_WORD("raiden-f_pcm2.u0217", 0x000000, 0x100000, CRC(3f8d4a48) SHA1(30664a2908daaeaee58f7e157516b522c952e48d) ) // pads are silkscreened SOUND0 + ROM_CONTINUE( 0x400000, 0x100000 ) + /* SOUND1 socket is unpopulated */ + + ROM_REGION( 0x100000, "soundflash1", 0 ) /* on SPI motherboard */ + ROM_LOAD("flash0_blank_region01.u1053", 0x000000, 0x100000, CRC(7ae7ab76) SHA1(a2b196f470bf64af94002fc4e2640fadad00418f) ) +ROM_END + ROM_START( rdftau ) ROM_REGION32_LE( 0x200000, "maincpu", 0 ) /* i386 program */ ROM_LOAD32_BYTE("1.u0211", 0x000000, 0x80000, CRC(6339c60d) SHA1(871d5bc9fc695651ceb6fcfdab32084320fe239d) ) @@ -2993,7 +3025,7 @@ ROM_START( rdfta ) ROM_LOAD("flash0_blank_region82.u1053", 0x000000, 0x100000, CRC(4f463a87) SHA1(0e27904745da61a3ba7c48c5b4c7d45989bbd05b) ) ROM_END -ROM_START( rdftadi ) // Dream Island license +ROM_START( rdftadi ) // Dream Island license - SXX2C ROM SUB4 cart ROM_REGION32_LE( 0x200000, "maincpu", 0 ) /* i386 program */ ROM_LOAD32_BYTE("seibu__1.u0211", 0x000000, 0x080000, CRC(fc0e2885) SHA1(79621155d992d504e993bd3ee0d6ff3903bd5415) ) // socket is silkscreened on pcb PRG0 ROM_LOAD32_BYTE("raiden-f_prg2.u0212", 0x000001, 0x080000, CRC(58ccb10c) SHA1(0cce4057bfada78121d9586574b98d46cdd7dd46) ) // socket is silkscreened on pcb PRG1 @@ -3025,7 +3057,7 @@ ROM_START( rdftadi ) // Dream Island license ROM_LOAD("flash0_blank_region24.u1053", 0x000000, 0x100000, CRC(72a33dc4) SHA1(65a52f576ca4d240418fedd9a4922edcd6c0c8d1) ) ROM_END -ROM_START( rdftam ) // Metrotainment license +ROM_START( rdftam ) // Metrotainment license - SXX2C ROM SUB4 cart ROM_REGION32_LE( 0x200000, "maincpu", 0 ) /* i386 program */ ROM_LOAD32_BYTE("seibu_1.u0211", 0x000000, 0x080000, CRC(156d8db0) SHA1(93662b3ee494e37a56428a7aa3dad7a957835950) ) // socket is silkscreened on pcb PRG0 ROM_LOAD32_BYTE("raiden-f_prg2.u0212", 0x000001, 0x080000, CRC(58ccb10c) SHA1(0cce4057bfada78121d9586574b98d46cdd7dd46) ) // socket is silkscreened on pcb PRG1 @@ -3767,6 +3799,7 @@ GAME( 1996, ejanhs, 0, ejanhs, spi_ejanhs, seibuspi_state, ejanhs, GAME( 1996, rdft, 0, spi, spi_3button, seibuspi_state, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1996, rdftj, rdft, spi, spi_3button, seibuspi_state, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) +GAME( 1996, rdftja, rdft, spi, spi_3button, seibuspi_state, rdft, ROT270, "Seibu Kaihatsu", "Raiden Fighters (Japan set 3)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1996, rdftu, rdft, spi, spi_3button, seibuspi_state, rdft, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters (US)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1996, rdftam, rdft, spi, spi_3button, seibuspi_state, rdft, ROT270, "Seibu Kaihatsu (Metrotainment license)", "Raiden Fighters (Hong Kong)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1996, rdftadi, rdft, spi, spi_3button, seibuspi_state, rdft, ROT270, "Seibu Kaihatsu (Dream Island license)", "Raiden Fighters (Korea)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c index 0a381a64337..437fbf152bd 100644 --- a/src/mame/drivers/seicross.c +++ b/src/mame/drivers/seicross.c @@ -86,8 +86,7 @@ WRITE8_MEMBER(seicross_state::portB_w) m_irq_mask = data & 1; /* bit 1 flips screen */ - flip_screen_set(data & 2); - + /* bit 2 resets the microcontroller */ if (((m_portb & 4) == 0) && (data & 4)) { diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 3b2ba24c92d..6f15171f214 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -53,6 +53,7 @@ P0-081A (BP933KA) 93 Mobile Suit Gundam Banpresto P0-083A (BP931) 93 Ultra Toukon Densetsu Banpresto / Tsuburaya Prod. P0-092A 93 Daioh Athena P0-072-2 (prototype) 93 Daioh(prototype) Athena +? (93111A) 93 Daioh(conversion) Athena P0-096A (BP934KA) 93 Kamen Rider Banpresto P0-097A 93 Oishii Puzzle .. Sunsoft + Atlus bootleg 9? Triple Fun (4) bootleg (Comad?) @@ -7796,7 +7797,7 @@ static MACHINE_CONFIG_START( downtown, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on pcb */ @@ -7857,7 +7858,7 @@ static MACHINE_CONFIG_START( usclssic, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -7912,7 +7913,7 @@ static MACHINE_CONFIG_START( calibr50, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on pcb */ @@ -7956,7 +7957,7 @@ static MACHINE_CONFIG_START( metafox, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8040,7 +8041,7 @@ static MACHINE_CONFIG_START( blandia, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8078,7 +8079,7 @@ static MACHINE_CONFIG_START( blandiap, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8196,7 +8197,7 @@ static MACHINE_CONFIG_START( daioh, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on PCB */ @@ -8235,7 +8236,7 @@ static MACHINE_CONFIG_START( daiohp, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(57.42) /* verified on PCB */ @@ -8279,7 +8280,7 @@ static MACHINE_CONFIG_START( drgnunit, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8317,7 +8318,7 @@ static MACHINE_CONFIG_START( qzkklgy2, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8368,7 +8369,7 @@ static MACHINE_CONFIG_START( setaroul, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + MCFG_NVRAM_ADD_RANDOM_FILL("nvram") /* video hardware */ @@ -8412,7 +8413,7 @@ static MACHINE_CONFIG_START( eightfrc, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8456,7 +8457,7 @@ static MACHINE_CONFIG_START( extdwnhl, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8522,7 +8523,7 @@ static MACHINE_CONFIG_START( gundhara, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8568,7 +8569,7 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8605,7 +8606,7 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8651,7 +8652,7 @@ static MACHINE_CONFIG_START( kamenrid, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8820,7 +8821,7 @@ static MACHINE_CONFIG_START( madshark, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8866,7 +8867,7 @@ static MACHINE_CONFIG_START( magspeed, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8915,7 +8916,7 @@ static MACHINE_CONFIG_START( msgundam, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(56.66) /* between 56 and 57 to match a real PCB's game speed */ @@ -8956,7 +8957,7 @@ static MACHINE_CONFIG_START( oisipuzl, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -8996,7 +8997,7 @@ static MACHINE_CONFIG_START( triplfun, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9077,7 +9078,7 @@ static MACHINE_CONFIG_START( rezon, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9313,7 +9314,7 @@ static MACHINE_CONFIG_START( utoukond, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9365,7 +9366,7 @@ static MACHINE_CONFIG_START( wrofaero, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9411,7 +9412,7 @@ static MACHINE_CONFIG_START( zingzip, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9519,7 +9520,7 @@ static MACHINE_CONFIG_START( crazyfgt, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9585,7 +9586,7 @@ static MACHINE_CONFIG_START( inttoote, seta_state ) MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode") MCFG_SETA001_SPRITE_PALETTE("palette") MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback) - + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -9924,7 +9925,6 @@ ROM_START( metafox ) ROM_LOAD( "up001014", 0x080000, 0x080000, CRC(fca6315e) SHA1(cef2385ec43f8b7a2d655b42c18ef44e46ff7364) ) ROM_END - ROM_START( drgnunit ) ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "prg-e.bin", 0x000000, 0x020000, CRC(728447df) SHA1(8bdc52a4cc5f36794a47f963545bdaa26c9acd6b) ) @@ -10009,8 +10009,6 @@ ROM_START( thunderlbl ) ROM_LOAD16_BYTE( "22.a3", 0x040001, 0x020000, CRC(79c707be) SHA1(f67fa40c8f6ab0fbce44997fdfbf699fea1f0df6) ) ROM_END - - /* Wiggie Waggie & Super Bar run on a bootleg SETA board with an OKI M6295 replacing the X1-010 sound chip. @@ -10269,8 +10267,6 @@ ROM_START( blockcarb ) ROM_LOAD( "tl8.bin", 0x000000, 0x010000, CRC(d09d7c7a) SHA1(8e8532be08818c855d9c3ce45716eb07cfab5767) ) //cpu prg ROM_END - - ROM_START( qzkklogy ) ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "3.u27", 0x000000, 0x020000, CRC(b8c27cde) SHA1(4c36076801b6c915888b925c1e37d772bab1bb02) ) @@ -10467,6 +10463,39 @@ ROM_START( daiohp ) /* Found on the same P0-072-2 PCB as the Blandia prototype * ROM_LOAD( "sc.u116", 0x000A00, 0x104, CRC(e57bfde9) SHA1(33632d007c8e48d756fc920985f82ae32dcd63e6) ) ROM_END +ROM_START( daiohc ) /* Found on a 93111A PCB - same PCB as War of Areo & J. J. Squawkers */ + ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */ + ROM_LOAD16_BYTE( "15.u3", 0x000000, 0x040000, CRC(14616abb) SHA1(1ff5331b0de60230baa4ced58bec6a954cb599d5) ) + ROM_CONTINUE ( 0x100000, 0x040000 ) + ROM_LOAD16_BYTE( "14.u4", 0x000001, 0x040000, CRC(a029f991) SHA1(5d341fe5b3ac3bdda1d8e7cc8e6a260f04d00aa1) ) + ROM_CONTINUE ( 0x100001, 0x040000 ) + + ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */ + ROM_LOAD( "9.u9", 0x000000, 0x080000, CRC(4444cbd4) SHA1(e039cd7e7093d399bc39aa4d355a03250e087fb3) ) /* connects to U63 & U64 through a riser card */ + ROM_LOAD( "10.u10", 0x080000, 0x080000, CRC(1d88d20b) SHA1(3cf95041d0876a4ef378651783e53cee1994ed3d) ) + ROM_LOAD( "11.u11", 0x100000, 0x080000, CRC(3e41de61) SHA1(7d3ddf3780bbe99b13937d75cbdbfb58449301a6) ) + ROM_LOAD( "12.u12", 0x180000, 0x080000, CRC(f35e3341) SHA1(9260460e1823d157201de02557c7136ef898cfb3) ) + + ROM_REGION( 0x200000, "gfx2", 0 ) /* Layer 1 */ + ROM_LOAD( "5.u5", 0x000000, 0x080000, CRC(aaa5e41e) SHA1(fe362ec083cb13732ea07003a4a1a9c63d382f4b) ) /* connects to U66 through a riser card */ + ROM_LOAD( "6.u6", 0x080000, 0x080000, CRC(9ad8b4b4) SHA1(b6e4cff160ae0efe6f3fd0df9a8a618957c3ce61) ) + ROM_LOAD( "7.u7", 0x100000, 0x080000, CRC(babf194a) SHA1(ef838aab2d651c10553fb87552c67f289a8ac83d) ) + ROM_LOAD( "8.u8", 0x180000, 0x080000, CRC(2db65290) SHA1(4f4d65e984fad7bb1d886de67bc50645798282bb) ) + + ROM_REGION( 0x200000, "gfx3", 0 ) /* Layer 2 */ + ROM_LOAD( "1.u1", 0x000000, 0x080000, CRC(30f81f99) SHA1(9c164c798c7e869e92505d9d85f06f4a1c9a9528) ) /* connects to U68 through a riser card */ + ROM_LOAD( "2.u2", 0x080000, 0x080000, CRC(3b3e0f4e) SHA1(740afe4eefea480f941dd80a03392592d8d4b084) ) + ROM_LOAD( "3.u3", 0x100000, 0x080000, CRC(c5eef1c1) SHA1(d4b3188b39bad5c7a2c7b7dbc91a79c7ee80a3a1) ) + ROM_LOAD( "4.u4", 0x180000, 0x080000, CRC(851115b6) SHA1(b8e1e22231d131085c90afcf30ff35a2866edff5) ) + + ROM_REGION( 0x100000, "x1snd", 0 ) /* Samples */ + ROM_LOAD( "data.u69", 0x000000, 0x080000, CRC(21e4f093) SHA1(f0420d158dc5d182e41b6fb2ea3af6baf88bacb8) ) + ROM_LOAD( "data.u70", 0x080000, 0x080000, CRC(593c3c58) SHA1(475fb530a6d23269cb0aea6e294291c7463b57a2) ) + + ROM_REGION( 0x200, "gals", 0 ) + ROM_LOAD( "gal.u14", 0x000000, 0x117, CRC(b972b479) SHA1(50da73b4cc7b9c0ff8fb19b2c34d05a4dbc8f0cb) ) +ROM_END + ROM_START( msgundam ) ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_WORD_SWAP( "fa003002.u25", 0x000000, 0x080000, CRC(1cc72d4c) SHA1(5043d693b5a8116a077d5b6997b658cb287e2aa7) ) @@ -11592,6 +11621,7 @@ GAME( 1993, atehate, 0, atehate, atehate, driver_device, 0, ROT GAME( 1993, daioh, 0, daioh, daioh, driver_device, 0, ROT270, "Athena", "Daioh", 0 ) GAME( 1993, daioha, daioh, daioh, daioh, driver_device, 0, ROT270, "Athena", "Daioh (earlier)", 0 ) GAME( 1993, daiohp, daioh, daiohp, daiohp, driver_device, 0, ROT270, "Athena", "Daioh (prototype)", 0 ) +GAME( 1993, daiohc, daioh, wrofaero, daioh, driver_device, 0, ROT270, "Athena", "Daioh (93111A PCB conversion)", 0 ) GAME( 1993, jjsquawk, 0, jjsquawk, jjsquawk, driver_device, 0, ROT0, "Athena / Able", "J. J. Squawkers", GAME_IMPERFECT_SOUND ) GAME( 1993, jjsquawkb,jjsquawk, jjsquawb, jjsquawk, driver_device, 0, ROT0, "bootleg", "J. J. Squawkers (bootleg)", GAME_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c index 93d469a6e2a..9341a7c9392 100644 --- a/src/mame/drivers/seta2.c +++ b/src/mame/drivers/seta2.c @@ -585,7 +585,7 @@ void funcube_touchscreen_device::device_start() emu_timer *tm = timer_alloc(0); tm->adjust(attotime::from_ticks(1, clock()), 0, attotime::from_ticks(1, clock())); m_tx_cb.resolve_safe(); - + save_item(NAME(m_button_state)); save_item(NAME(m_serial_pos)); save_item(NAME(m_serial)); diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c index e48adda2f6c..f438caacd98 100644 --- a/src/mame/drivers/shougi.c +++ b/src/mame/drivers/shougi.c @@ -107,7 +107,7 @@ public: int m_r; //UINT8 *m_cpu_sharedram; //UINT8 m_cpu_sharedram_control_val; - + DECLARE_WRITE8_MEMBER(cpu_sharedram_sub_w); DECLARE_WRITE8_MEMBER(cpu_sharedram_main_w); DECLARE_READ8_MEMBER(cpu_sharedram_r); @@ -118,12 +118,12 @@ public: DECLARE_WRITE8_MEMBER(nmi_disable_and_clear_line_w); DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_READ8_MEMBER(dummy_r); - + DECLARE_PALETTE_INIT(shougi); virtual void machine_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + INTERRUPT_GEN_MEMBER(vblank_nmi); }; diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c index ef18f2bd45f..9b80a8d4d14 100644 --- a/src/mame/drivers/sidearms.c +++ b/src/mame/drivers/sidearms.c @@ -43,12 +43,12 @@ Notes: void sidearms_state::machine_start() { - membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x8000, 0x4000); + membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x8000, 0x4000); } WRITE8_MEMBER(sidearms_state::bankswitch_w) { - membank("bank1")->set_entry(data & 0x07); + membank("bank1")->set_entry(data & 0x07); } @@ -119,7 +119,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(sidearms_state::whizz_bankswitch_w) { - int bank = 0; + int bank = 0; switch (data & 0xC0) { case 0x00 : bank = 0; break; @@ -127,7 +127,7 @@ WRITE8_MEMBER(sidearms_state::whizz_bankswitch_w) case 0x80 : bank = 1; break; case 0xC0 : bank = 3; break; } - membank("bank1")->set_entry(bank); + membank("bank1")->set_entry(bank); } static ADDRESS_MAP_START( whizz_map, AS_PROGRAM, 8, sidearms_state ) diff --git a/src/mame/drivers/simple_st0016.c b/src/mame/drivers/simple_st0016.c index c6268e13c27..ebf65b0b8ab 100644 --- a/src/mame/drivers/simple_st0016.c +++ b/src/mame/drivers/simple_st0016.c @@ -33,7 +33,7 @@ Dips verified for Neratte Chu (nratechu) from manual void st0016_state::machine_start() { - membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); + membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); } static ADDRESS_MAP_START( st0016_mem, AS_PROGRAM, 8, st0016_state ) @@ -81,8 +81,8 @@ WRITE8_MEMBER(st0016_state::mux_select_w) WRITE8_MEMBER(st0016_state::st0016_rom_bank_w) { - membank("bank1")->set_entry(data); - // st0016_rom_bank = data; + membank("bank1")->set_entry(data); + // st0016_rom_bank = data; } static ADDRESS_MAP_START( st0016_io, AS_IO, 8, st0016_state ) diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c index 0b48fd943cd..f8b3b8a4d70 100644 --- a/src/mame/drivers/sothello.c +++ b/src/mame/drivers/sothello.c @@ -72,7 +72,7 @@ public: DECLARE_READ8_MEMBER(subcpu_status_r); DECLARE_WRITE8_MEMBER(msm_cfg_w); - virtual void machine_start(); + virtual void machine_start(); virtual void machine_reset(); TIMER_CALLBACK_MEMBER(subcpu_suspend); TIMER_CALLBACK_MEMBER(subcpu_resume); @@ -101,7 +101,7 @@ public: void sothello_state::machine_start() { - membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x4000); + membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x4000); } WRITE8_MEMBER(sothello_state::bank_w) @@ -114,7 +114,7 @@ WRITE8_MEMBER(sothello_state::bank_w) case 4: bank=2; break; case 8: bank=3; break; } - membank("bank1")->set_entry(bank); + membank("bank1")->set_entry(bank); } TIMER_CALLBACK_MEMBER(sothello_state::subcpu_suspend) diff --git a/src/mame/drivers/speglsht.c b/src/mame/drivers/speglsht.c index 56197f2f321..4c8a7dd0cf8 100644 --- a/src/mame/drivers/speglsht.c +++ b/src/mame/drivers/speglsht.c @@ -134,7 +134,7 @@ public: DECLARE_READ32_MEMBER(irq_ack_clear); DECLARE_DRIVER_INIT(speglsht); DECLARE_MACHINE_RESET(speglsht); - virtual void machine_start(); + virtual void machine_start(); DECLARE_VIDEO_START(speglsht); UINT32 screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device<palette_device> m_palette; @@ -160,13 +160,13 @@ ADDRESS_MAP_END void speglsht_state::machine_start() { - membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); + membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); } // common rombank? should go in machine/st0016 with larger address space exposed? WRITE8_MEMBER(speglsht_state::st0016_rom_bank_w) { - membank("bank1")->set_entry(data); + membank("bank1")->set_entry(data); } diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c index 59d25836aea..028cc836540 100644 --- a/src/mame/drivers/spool99.c +++ b/src/mame/drivers/spool99.c @@ -101,36 +101,41 @@ class spool99_state : public driver_device public: spool99_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_main(*this, "mainram"), - m_vram(*this, "vram"), - m_cram(*this, "cram"), m_maincpu(*this, "maincpu"), m_eeprom(*this, "eeprom"), m_oki(*this, "oki"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode"), + m_main(*this, "mainram"), + m_vram(*this, "vram"), + m_cram(*this, "cram") { } + + required_device<cpu_device> m_maincpu; + required_device<eeprom_serial_93cxx_device> m_eeprom; + required_device<okim6295_device> m_oki; + required_device<gfxdecode_device> m_gfxdecode; required_shared_ptr<UINT8> m_main; required_shared_ptr<UINT8> m_vram; required_shared_ptr<UINT8> m_cram; + tilemap_t *m_sc0_tilemap; - DECLARE_WRITE8_MEMBER(spool99_vram_w); - DECLARE_WRITE8_MEMBER(spool99_cram_w); + + DECLARE_WRITE8_MEMBER(vram_w); + DECLARE_WRITE8_MEMBER(cram_w); DECLARE_READ8_MEMBER(spool99_io_r); DECLARE_READ8_MEMBER(vcarn_io_r); DECLARE_WRITE8_MEMBER(eeprom_resetline_w); DECLARE_WRITE8_MEMBER(eeprom_clockline_w); DECLARE_WRITE8_MEMBER(eeprom_dataline_w); + DECLARE_DRIVER_INIT(spool99); - TILE_GET_INFO_MEMBER(get_spool99_tile_info); virtual void video_start(); - UINT32 screen_update_spool99(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<eeprom_serial_93cxx_device> m_eeprom; - required_device<okim6295_device> m_oki; - required_device<gfxdecode_device> m_gfxdecode; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + TILE_GET_INFO_MEMBER(get_tile_info); }; -TILE_GET_INFO_MEMBER(spool99_state::get_spool99_tile_info) +TILE_GET_INFO_MEMBER(spool99_state::get_tile_info) { int code = ((m_vram[tile_index*2+1]<<8) | (m_vram[tile_index*2+0])); int color = m_cram[tile_index*2+0]; @@ -143,22 +148,22 @@ TILE_GET_INFO_MEMBER(spool99_state::get_spool99_tile_info) void spool99_state::video_start() { - m_sc0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(spool99_state::get_spool99_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_sc0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(spool99_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } -UINT32 spool99_state::screen_update_spool99(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 spool99_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; } -WRITE8_MEMBER(spool99_state::spool99_vram_w) +WRITE8_MEMBER(spool99_state::vram_w) { m_vram[offset] = data; m_sc0_tilemap->mark_tile_dirty(offset/2); } -WRITE8_MEMBER(spool99_state::spool99_cram_w) +WRITE8_MEMBER(spool99_state::cram_w) { m_cram[offset] = data; m_sc0_tilemap->mark_tile_dirty(offset/2); @@ -229,8 +234,8 @@ static ADDRESS_MAP_START( spool99_map, AS_PROGRAM, 8, spool99_state ) AM_RANGE(0xb000, 0xb3ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_RANGE(0xb800, 0xdfff) AM_RAM - AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_SHARE("vram") - AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_SHARE("cram") + AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vram_w) AM_SHARE("vram") + AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(cram_w) AM_SHARE("cram") ADDRESS_MAP_END READ8_MEMBER(spool99_state::vcarn_io_r) @@ -276,8 +281,8 @@ static ADDRESS_MAP_START( vcarn_map, AS_PROGRAM, 8, spool99_state ) AM_RANGE(0xb000, 0xdfff) AM_RAM // AM_RANGE(0xdf00, 0xdfff) AM_READWRITE(vcarn_io_r,vcarn_io_w) AM_SHARE("vcarn_io") - AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_SHARE("vram") - AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_SHARE("cram") + AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vram_w) AM_SHARE("vram") + AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(cram_w) AM_SHARE("cram") ADDRESS_MAP_END @@ -360,7 +365,7 @@ static MACHINE_CONFIG_START( spool99, spool99_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(7*8, 55*8-1, 1*8, 31*8-1) //384x240,raw guess - MCFG_SCREEN_UPDATE_DRIVER(spool99_state, screen_update_spool99) + MCFG_SCREEN_UPDATE_DRIVER(spool99_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x200) @@ -455,8 +460,8 @@ DRIVER_INIT_MEMBER(spool99_state,spool99) -GAME( 1998, spool99, 0, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.36)", 0 ) -GAME( 1998, spool99a, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.33)", 0 ) -GAME( 1998, spool99b, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.31)", 0 ) -GAME( 1998, spool99c, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.26)", 0 ) -GAME( 1998, vcarn, 0, vcarn, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Video Carnival 1999 / Super Royal Card (Version 0.11)", 0 ) //MAME screen says '98, PCB screen says '99? +GAME( 1998, spool99, 0, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.36)", GAME_SUPPORTS_SAVE ) +GAME( 1998, spool99a, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.33)", GAME_SUPPORTS_SAVE ) +GAME( 1998, spool99b, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.31)", GAME_SUPPORTS_SAVE ) +GAME( 1998, spool99c, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.26)", GAME_SUPPORTS_SAVE ) +GAME( 1998, vcarn, 0, vcarn, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Video Carnival 1999 / Super Royal Card (Version 0.11)", GAME_SUPPORTS_SAVE ) //MAME screen says '98, PCB screen says '99? diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index 85b7be44059..c0903ff5d4c 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -83,7 +83,7 @@ void srmp2_state::machine_start() MACHINE_START_MEMBER(srmp2_state,srmp2) { machine_start(); - + m_iox.reset = 0x1f; m_iox.ff_event = -1; m_iox.ff_1 = 0x00; @@ -92,14 +92,14 @@ MACHINE_START_MEMBER(srmp2_state,srmp2) m_iox.protcheck[1] = -1; m_iox.protlatch[1] = -1; m_iox.protcheck[2] = -1; m_iox.protlatch[2] = -1; m_iox.protcheck[3] = -1; m_iox.protlatch[3] = -1; - + save_item(NAME(m_color_bank)); } MACHINE_START_MEMBER(srmp2_state,srmp3) { machine_start(); - + m_iox.reset = 0xc8; m_iox.ff_event = 0xef; m_iox.ff_1 = -1; @@ -107,16 +107,16 @@ MACHINE_START_MEMBER(srmp2_state,srmp3) m_iox.protcheck[1] = 0x4c; m_iox.protlatch[1] = 0x00; m_iox.protcheck[2] = 0x1c; m_iox.protlatch[2] = 0x04; m_iox.protcheck[3] = 0x45; m_iox.protlatch[3] = 0x00; - - membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000); - + + membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000); + save_item(NAME(m_gfx_bank)); } MACHINE_START_MEMBER(srmp2_state,rmgoldyh) { machine_start(); - + m_iox.reset = 0xc8; m_iox.ff_event = 0xff; m_iox.ff_1 = -1; @@ -125,15 +125,15 @@ MACHINE_START_MEMBER(srmp2_state,rmgoldyh) m_iox.protcheck[2] = -1; m_iox.protlatch[2] = -1; m_iox.protcheck[3] = -1; m_iox.protlatch[3] = -1; - membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000); - + membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000); + save_item(NAME(m_gfx_bank)); } MACHINE_START_MEMBER(srmp2_state,mjyuugi) { machine_start(); - + m_iox.reset = 0x1f; m_iox.ff_event = -1; m_iox.ff_1 = 0x00; diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c index ab4bf6885dc..04a278cf138 100644 --- a/src/mame/drivers/srmp5.c +++ b/src/mame/drivers/srmp5.c @@ -114,7 +114,7 @@ public: DECLARE_READ8_MEMBER(cmd1_r); DECLARE_READ8_MEMBER(cmd2_r); DECLARE_READ8_MEMBER(cmd_stat8_r); - virtual void machine_start(); + virtual void machine_start(); DECLARE_DRIVER_INIT(srmp5); UINT32 screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -240,7 +240,7 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit void srmp5_state::machine_start() { - membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); + membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); } WRITE32_MEMBER(srmp5_state::bank_w) @@ -400,7 +400,7 @@ READ8_MEMBER(srmp5_state::cmd_stat8_r) // common rombank? should go in machine/st0016 with larger address space exposed? WRITE8_MEMBER(srmp5_state::st0016_rom_bank_w) { - membank("bank1")->set_entry(data); + membank("bank1")->set_entry(data); } diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index e3c5c3860f5..ac2d05af386 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -107,7 +107,7 @@ public: DECLARE_WRITE16_MEMBER(paletteram_w); DECLARE_READ16_MEMBER(srmp6_irq_ack_r); DECLARE_DRIVER_INIT(INIT); - virtual void machine_start(); + virtual void machine_start(); virtual void video_start(); UINT32 screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_palette(); @@ -309,7 +309,7 @@ UINT32 srmp6_state::screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bit void srmp6_state::machine_start() { - membank("bank1")->configure_entries(0, 16, memregion("nile")->base(), 0x200000); + membank("bank1")->configure_entries(0, 16, memregion("nile")->base(), 0x200000); } WRITE16_MEMBER(srmp6_state::srmp6_input_select_w) @@ -340,8 +340,8 @@ WRITE16_MEMBER(srmp6_state::video_regs_w) { case 0x5e/2: // bank switch, used by ROM check { - LOG(("%x\n",data)); - membank("bank1")->set_entry(data & 0x0f); + LOG(("%x\n",data)); + membank("bank1")->set_entry(data & 0x0f); break; } diff --git a/src/mame/drivers/srumbler.c b/src/mame/drivers/srumbler.c index be87dc9acf9..21c252d60e2 100644 --- a/src/mame/drivers/srumbler.c +++ b/src/mame/drivers/srumbler.c @@ -32,25 +32,25 @@ WRITE8_MEMBER(srumbler_state::bankswitch_w) for (int i = 0x05;i < 0x10;i++) { - /* bit 2 of prom1 selects ROM or RAM - not supported */ + /* bit 2 of prom1 selects ROM or RAM - not supported */ int bank = ((prom1[i] & 0x03) << 4) | (prom2[i] & 0x0f); - char bankname[10]; + char bankname[10]; sprintf(bankname, "%04x", i*0x1000); - membank(bankname)->set_entry(bank); + membank(bankname)->set_entry(bank); } } void srumbler_state::machine_start() { - for (int i = 0x05; i < 0x10; i++) + for (int i = 0x05; i < 0x10; i++) { - char bankname[10]; + char bankname[10]; sprintf(bankname, "%04x", i*0x1000); - membank(bankname)->configure_entries(0, 64, memregion("user1")->base(), 0x1000); + membank(bankname)->configure_entries(0, 64, memregion("user1")->base(), 0x1000); } - /* initialize banked ROM pointers */ + /* initialize banked ROM pointers */ bankswitch_w(m_maincpu->space(AS_PROGRAM), 0, 0); } diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c index e30b534f7ad..35e002d6aa9 100644 --- a/src/mame/drivers/sstrangr.c +++ b/src/mame/drivers/sstrangr.c @@ -24,13 +24,13 @@ public: required_device<cpu_device> m_maincpu; required_shared_ptr<UINT8> m_ram; - + UINT8 m_flip_screen; - + DECLARE_WRITE8_MEMBER(port_w); - + virtual void video_start(); - + UINT32 screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c index 70895a60be9..8ebeae48d5a 100644 --- a/src/mame/drivers/ssv.c +++ b/src/mame/drivers/ssv.c @@ -2491,7 +2491,7 @@ void ssv_state::init(int interrupt_ultrax) ( (i & 1) ? (8 << 16) : 0 ) ; enable_video(1); m_interrupt_ultrax = interrupt_ultrax; - + save_item(NAME(m_requested_int)); save_item(NAME(m_irq_enable)); } diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c index fdcf4dc3db6..d0c2eecb918 100644 --- a/src/mame/drivers/stactics.c +++ b/src/mame/drivers/stactics.c @@ -135,7 +135,7 @@ CUSTOM_INPUT_MEMBER(stactics_state::get_rng) * *************************************/ -WRITE8_MEMBER(stactics_state::stactics_coin_lockout_w) +WRITE8_MEMBER(stactics_state::coinlockout_w) { coin_lockout_w(machine(), offset, ~data & 0x01); } @@ -148,7 +148,7 @@ WRITE8_MEMBER(stactics_state::stactics_coin_lockout_w) * *************************************/ -INTERRUPT_GEN_MEMBER(stactics_state::stactics_interrupt) +INTERRUPT_GEN_MEMBER(stactics_state::interrupt) { move_motor(); @@ -168,22 +168,22 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, stactics_state ) AM_RANGE(0x4000, 0x40ff) AM_MIRROR(0x0700) AM_RAM AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_READ_PORT("IN0") AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ_PORT("IN1") - AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x0f08) AM_WRITE(stactics_coin_lockout_w) + AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x0f08) AM_WRITE(coinlockout_w) AM_RANGE(0x6002, 0x6005) AM_MIRROR(0x0f08) AM_WRITENOP AM_RANGE(0x6006, 0x6007) AM_MIRROR(0x0f08) AM_WRITEONLY AM_SHARE("paletteram") - /* AM_RANGE(0x6010, 0x6017) AM_MIRROR(0x0f08) AM_WRITE(stactics_sound_w) */ + /* AM_RANGE(0x6010, 0x6017) AM_MIRROR(0x0f08) AM_WRITE(sound_w) */ AM_RANGE(0x6016, 0x6016) AM_MIRROR(0x0f08) AM_WRITEONLY AM_SHARE("motor_on") /* Note: This overlaps rocket sound */ AM_RANGE(0x6020, 0x6027) AM_MIRROR(0x0f08) AM_WRITEONLY AM_SHARE("lamps") - AM_RANGE(0x6030, 0x6030) AM_MIRROR(0x0f0f) AM_WRITE(stactics_speed_latch_w) - AM_RANGE(0x6040, 0x6040) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_trigger_w) - AM_RANGE(0x6050, 0x6050) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_flag_clear_w) + AM_RANGE(0x6030, 0x6030) AM_MIRROR(0x0f0f) AM_WRITE(speed_latch_w) + AM_RANGE(0x6040, 0x6040) AM_MIRROR(0x0f0f) AM_WRITE(shot_trigger_w) + AM_RANGE(0x6050, 0x6050) AM_MIRROR(0x0f0f) AM_WRITE(shot_flag_clear_w) AM_RANGE(0x6060, 0x606f) AM_MIRROR(0x0f00) AM_WRITEONLY AM_SHARE("display_buffer") AM_RANGE(0x6070, 0x609f) AM_MIRROR(0x0f00) AM_WRITENOP - /* AM_RANGE(0x60a0, 0x60ef) AM_MIRROR(0x0f00) AM_WRITE(stactics_sound2_w) */ + /* AM_RANGE(0x60a0, 0x60ef) AM_MIRROR(0x0f00) AM_WRITE(sound2_w) */ AM_RANGE(0x60f0, 0x60ff) AM_MIRROR(0x0f00) AM_WRITENOP AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_READ_PORT("IN2") AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_READ_PORT("IN3") - AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x0800) AM_WRITE(stactics_scroll_ram_w) + AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x0800) AM_WRITE(scroll_ram_w) AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0fff) AM_READ(vert_pos_r) AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0fff) AM_READ(horiz_pos_r) AM_RANGE(0xb000, 0xbfff) AM_RAM AM_SHARE("videoram_b") @@ -210,7 +210,7 @@ static INPUT_PORTS_START( stactics ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,get_motor_not_ready, NULL) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_motor_not_ready, NULL) PORT_START("IN1") /* IN1 */ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) ) @@ -239,8 +239,8 @@ static INPUT_PORTS_START( stactics ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("IN2") /* IN2 */ - PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,get_rng, NULL) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_frame_count_d3, NULL) + PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_rng, NULL) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_frame_count_d3, NULL) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) @@ -250,7 +250,7 @@ static INPUT_PORTS_START( stactics ) PORT_START("IN3") /* IN3 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_shot_standby, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_shot_standby, NULL) PORT_DIPNAME( 0x04, 0x04, "Number of Barriers" ) PORT_DIPSETTING( 0x04, "4" ) PORT_DIPSETTING( 0x00, "6" ) @@ -262,7 +262,7 @@ static INPUT_PORTS_START( stactics ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_not_shot_arrive, NULL) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_not_shot_arrive, NULL) PORT_START("FAKE") /* FAKE */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY @@ -282,6 +282,9 @@ void stactics_state::machine_start() m_vert_pos = 0; m_horiz_pos = 0; *m_motor_on = 0; + + save_item(NAME(m_vert_pos)); + save_item(NAME(m_horiz_pos)); } @@ -297,7 +300,7 @@ static MACHINE_CONFIG_START( stactics, stactics_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", I8080, 1933560) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", stactics_state, stactics_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", stactics_state, interrupt) /* video hardware */ @@ -342,4 +345,4 @@ ROM_END * *************************************/ -GAMEL( 1981, stactics, 0, stactics, stactics, driver_device, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_NO_SOUND, layout_stactics ) +GAMEL( 1981, stactics, 0, stactics, stactics, driver_device, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_stactics ) diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c index 11a3100c313..6927e1c1c55 100644 --- a/src/mame/drivers/sub.c +++ b/src/mame/drivers/sub.c @@ -139,15 +139,15 @@ public: required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_spriteram2; required_shared_ptr<UINT8> m_scrolly; - + UINT8 m_nmi_en; - + DECLARE_WRITE8_MEMBER(to_sound_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); - + virtual void machine_start(); DECLARE_PALETTE_INIT(sub); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_irq); }; diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c index 2677c793f41..ae94711dba2 100644 --- a/src/mame/drivers/suna16.c +++ b/src/mame/drivers/suna16.c @@ -215,7 +215,7 @@ ADDRESS_MAP_END MACHINE_START_MEMBER(suna16_state,bestbest) { - save_item(NAME(m_prot)); + save_item(NAME(m_prot)); } @@ -294,8 +294,8 @@ ADDRESS_MAP_END MACHINE_START_MEMBER(suna16_state, bssoccer) { - membank("bank1")->configure_entries(0, 8, memregion("pcm1")->base() + 0x1000, 0x10000); - membank("bank2")->configure_entries(0, 8, memregion("pcm2")->base() + 0x1000, 0x10000); + membank("bank1")->configure_entries(0, 8, memregion("pcm1")->base() + 0x1000, 0x10000); + membank("bank2")->configure_entries(0, 8, memregion("pcm2")->base() + 0x1000, 0x10000); } /* Bank Switching */ @@ -304,16 +304,16 @@ WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w) { const int bank = data & 7; if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data); - printf("%d %d\n", 1, bank); - membank("bank1")->set_entry(bank); + printf("%d %d\n", 1, bank); + membank("bank1")->set_entry(bank); } WRITE8_MEMBER(suna16_state::bssoccer_pcm_2_bankswitch_w) { const int bank = data & 7; if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data); - printf("%d %d\n", 2, bank); - membank("bank2")->set_entry(bank); + printf("%d %d\n", 2, bank); + membank("bank2")->set_entry(bank); } @@ -378,7 +378,7 @@ WRITE8_MEMBER(suna16_state::uballoon_pcm_1_bankswitch_w) { const int bank = data & 1; if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data); - membank("bank1")->set_entry(bank); + membank("bank1")->set_entry(bank); } /* Memory maps: Yes, *no* RAM */ @@ -398,8 +398,8 @@ ADDRESS_MAP_END MACHINE_START_MEMBER(suna16_state,uballoon) { - membank("bank1")->configure_entries(0, 2, memregion("pcm1")->base() + 0x400, 0x10000); - + membank("bank1")->configure_entries(0, 2, memregion("pcm1")->base() + 0x400, 0x10000); + save_item(NAME(m_prot)); } @@ -828,7 +828,7 @@ static MACHINE_CONFIG_START( bssoccer, suna16_state ) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_MACHINE_START_OVERRIDE(suna16_state,bssoccer) + MCFG_MACHINE_START_OVERRIDE(suna16_state,bssoccer) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -887,7 +887,7 @@ static MACHINE_CONFIG_START( uballoon, suna16_state ) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_MACHINE_START_OVERRIDE(suna16_state,uballoon) + MCFG_MACHINE_START_OVERRIDE(suna16_state,uballoon) MCFG_MACHINE_RESET_OVERRIDE(suna16_state,uballoon) /* video hardware */ @@ -992,7 +992,7 @@ static MACHINE_CONFIG_START( bestbest, suna16_state ) /* 2nd PCM Z80 missing */ MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - + MCFG_MACHINE_START_OVERRIDE(suna16_state, bestbest) /* video hardware */ diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c index b6d128d8dea..a2d9412c31c 100644 --- a/src/mame/drivers/suna8.c +++ b/src/mame/drivers/suna8.c @@ -735,7 +735,7 @@ static ADDRESS_MAP_START( brickzn11_map, AS_PROGRAM, 8, suna8_state ) AM_RANGE(0xc060, 0xc060) AM_WRITE(brickzn_rombank_w ) // ROM Bank AM_RANGE(0xc080, 0xc080) AM_WRITE(brickzn_leds_w ) // Leds AM_RANGE(0xc0a0, 0xc0a0) AM_WRITE(brickzn_palbank_w ) // Palette RAM Bank -// AM_RANGE(0xc0c0, 0xc0c0) AM_WRITE(brickzn_prot2_w ) // Protection 2 +// AM_RANGE(0xc0c0, 0xc0c0) AM_WRITE(brickzn_prot2_w ) // Protection 2 AM_RANGE(0xc100, 0xc100) AM_READ_PORT("P1") // P1 (Buttons) AM_RANGE(0xc101, 0xc101) AM_READ_PORT("P2") // P2 (Buttons) @@ -771,13 +771,13 @@ WRITE8_MEMBER(suna8_state::brickzn_multi_w) else if (protselect == 0x90) { /* - 0d brick hit NO! 25? - 2c side wall hit OK - 3b paddle hit OK - 44 death OK? - 53 death OK? - 56 coin in OK? - 70 monster hit NO? 58? + 0d brick hit NO! 25? + 2c side wall hit OK + 3b paddle hit OK + 44 death OK? + 53 death OK? + 56 coin in OK? + 70 monster hit NO? 58? */ UINT8 remap = (m_remap_sound ? BITSWAP8(data, 7,6,3,4,5,2,1,0) : data); @@ -1975,7 +1975,7 @@ MACHINE_CONFIG_END MACHINE_RESET_MEMBER(suna8_state,brickzn) { m_protection_val = m_prot2 = m_prot2_prev = 0xff; - m_paletteram_enab = 1; // for brickzn11 + m_paletteram_enab = 1; // for brickzn11 m_remap_sound = 0; membank("bank1")->set_entry(0); } @@ -2015,12 +2015,12 @@ static MACHINE_CONFIG_START( brickzn11, suna8_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) // 3MHz (measured) + MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) // 3MHz (measured) MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) // 1.5MHz (measured) + MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) // 1.5MHz (measured) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33) diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c index 84c58873ec1..2507d625d67 100644 --- a/src/mame/drivers/supdrapo.c +++ b/src/mame/drivers/supdrapo.c @@ -82,13 +82,13 @@ public: required_device<cpu_device> m_maincpu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; - + required_shared_ptr<UINT8> m_col_line; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_char_bank; - + UINT8 m_wdog; - + DECLARE_READ8_MEMBER(rng_r); DECLARE_WRITE8_MEMBER(wdog8000_w); DECLARE_WRITE8_MEMBER(debug8004_w); @@ -97,12 +97,12 @@ public: DECLARE_WRITE8_MEMBER(payout_w); DECLARE_WRITE8_MEMBER(ay8910_outputa_w); DECLARE_WRITE8_MEMBER(ay8910_outputb_w); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(supdrapo); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c index 6e865850a85..38d3876e052 100644 --- a/src/mame/drivers/supertnk.c +++ b/src/mame/drivers/supertnk.c @@ -124,7 +124,7 @@ public: DECLARE_WRITE8_MEMBER(supertnk_bitplane_select_0_w); DECLARE_WRITE8_MEMBER(supertnk_bitplane_select_1_w); DECLARE_DRIVER_INIT(supertnk); - virtual void machine_start(); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); UINT32 screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -135,7 +135,7 @@ public: void supertnk_state::machine_start() { - membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x1000); + membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x1000); } @@ -148,14 +148,14 @@ void supertnk_state::machine_start() WRITE8_MEMBER(supertnk_state::supertnk_bankswitch_0_w) { m_rom_bank = (m_rom_bank & 0x02) | ((data << 0) & 0x01); - membank("bank1")->set_entry(m_rom_bank); + membank("bank1")->set_entry(m_rom_bank); } WRITE8_MEMBER(supertnk_state::supertnk_bankswitch_1_w) { m_rom_bank = (m_rom_bank & 0x01) | ((data << 1) & 0x02); - membank("bank1")->set_entry(m_rom_bank); + membank("bank1")->set_entry(m_rom_bank); } diff --git a/src/mame/drivers/superwng.c b/src/mame/drivers/superwng.c index 3b5c5f541de..364abd14ece 100644 --- a/src/mame/drivers/superwng.c +++ b/src/mame/drivers/superwng.c @@ -10,7 +10,7 @@ Hardware a bit (interrupts, sound) similar to mouser as well TODO: - unused rom 6.8s (located on the pcb near the gfx rom 7.8p, but contains data (similar to the one in roms 4.5p and 5.5r) - + The game currently crashes after the bonus round rather than moving on to the next level, it writes 01 to 0xa187 which is probably ROM bank, however banking the ROM in there results in the game crashing anyway, and looking @@ -101,7 +101,7 @@ WRITE8_MEMBER(superwng_state::superwng_unk_a187_w) WRITE8_MEMBER(superwng_state::superwng_unk_a185_w) { -// printf("superwng_unk_a185_w %02x\n", data); +// printf("superwng_unk_a185_w %02x\n", data); } TILE_GET_INFO_MEMBER(superwng_state::get_bg_tile_info) @@ -456,7 +456,7 @@ void superwng_state::machine_start() save_item(NAME(m_tile_bank)); save_item(NAME(m_sound_byte)); save_item(NAME(m_nmi_enable)); - membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base()+0x4000, 0x4000); + membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base()+0x4000, 0x4000); } void superwng_state::machine_reset() diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index 368fe3ded91..21faaaadf9c 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -60,7 +60,7 @@ public: UINT8 m_palette_switch; UINT8 m_bg_vreg_test; UINT8 m_toggle; - + DECLARE_READ8_MEMBER(videoram_r); DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_READ8_MEMBER(bg_vram_r); @@ -78,14 +78,14 @@ public: DECLARE_WRITE8_MEMBER(writeA); DECLARE_WRITE8_MEMBER(writeB); DECLARE_WRITE_LINE_MEMBER(adpcm_int); - + TILE_GET_INFO_MEMBER(get_tile_info); DECLARE_DRIVER_INIT(suprgolf); - virtual void machine_start(); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -109,7 +109,7 @@ void suprgolf_state::video_start() m_fg_fb = auto_alloc_array(machine(), UINT16, 0x2000*0x20); m_tilemap->set_transparent_pen(15); - + save_item(NAME(m_bg_bank)); save_item(NAME(m_vreg_bank)); save_item(NAME(m_vreg_pen)); @@ -267,9 +267,9 @@ WRITE8_MEMBER(suprgolf_state::bg_vram_w) void suprgolf_state::machine_start() { - membank("bank1")->configure_entries(0, 16, memregion("user2")->base(), 0x4000); - membank("bank2")->configure_entries(0, 64, memregion("user1")->base(), 0x4000); - + membank("bank1")->configure_entries(0, 16, memregion("user2")->base(), 0x4000); + membank("bank2")->configure_entries(0, 64, memregion("user1")->base(), 0x4000); + save_item(NAME(m_rom_bank)); save_item(NAME(m_msm5205next)); save_item(NAME(m_msm_nmi_mask)); @@ -293,11 +293,11 @@ READ8_MEMBER(suprgolf_state::rom_bank_select_r) WRITE8_MEMBER(suprgolf_state::rom_bank_select_w) { - m_rom_bank = data; + m_rom_bank = data; - //popmessage("%08x %02x",((data & 0x3f) * 0x4000),data); - //osd_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,space.device().safe_pcbase()); - membank("bank2")->set_entry(data & 0x3f); + //popmessage("%08x %02x",((data & 0x3f) * 0x4000),data); + //osd_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,space.device().safe_pcbase()); + membank("bank2")->set_entry(data & 0x3f); m_msm_nmi_mask = data & 0x40; flip_screen_set(data & 0x80); @@ -305,9 +305,9 @@ WRITE8_MEMBER(suprgolf_state::rom_bank_select_w) WRITE8_MEMBER(suprgolf_state::rom2_bank_select_w) { - //osd_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,space.device().safe_pcbase()); - membank("bank1")->set_entry(data & 0x0f); - + //osd_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,space.device().safe_pcbase()); + membank("bank1")->set_entry(data & 0x0f); + if(data & 0xf0) printf("Rom bank select 2 with data %02x activated\n",data); } diff --git a/src/mame/drivers/suprslam.c b/src/mame/drivers/suprslam.c index 05a7a9f67da..3b7ef920770 100644 --- a/src/mame/drivers/suprslam.c +++ b/src/mame/drivers/suprslam.c @@ -115,7 +115,7 @@ WRITE8_MEMBER(suprslam_state::pending_command_clear_w) WRITE8_MEMBER(suprslam_state::suprslam_sh_bankswitch_w) { - membank("bank1")->set_entry(data & 0x03); + membank("bank1")->set_entry(data & 0x03); } /*** MEMORY MAPS *************************************************************/ @@ -285,7 +285,7 @@ void suprslam_state::machine_start() save_item(NAME(m_bg_bank)); save_item(NAME(m_pending_command)); - membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000, 0x8000); + membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000, 0x8000); } void suprslam_state::machine_reset() diff --git a/src/mame/drivers/tankbust.c b/src/mame/drivers/tankbust.c index d0f4766475e..4f46ce7bf3c 100644 --- a/src/mame/drivers/tankbust.c +++ b/src/mame/drivers/tankbust.c @@ -24,9 +24,9 @@ To do: void tankbust_state::machine_start() { - membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000); - membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x18000, 0x2000); - + membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000); + membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x18000, 0x2000); + save_item(NAME(m_latch)); save_item(NAME(m_timer1)); save_item(NAME(m_e0xx_data)); @@ -107,7 +107,7 @@ WRITE8_MEMBER(tankbust_state::e0xx_w) case 7: /* 0xe007 bankswitch */ /* bank 1 at 0x6000-9fff = from 0x10000 when bit0=0 else from 0x14000 */ - membank("bank1")->set_entry(data & 1); + membank("bank1")->set_entry(data & 1); /* bank 2 at 0xa000-bfff = from 0x18000 when bit0=0 else from 0x1a000 */ membank("bank2")->set_entry(data & 1); /* verified (the game will reset after the "game over" otherwise) */ diff --git a/src/mame/drivers/taotaido.c b/src/mame/drivers/taotaido.c index b011913e1ce..242f16cf8fa 100644 --- a/src/mame/drivers/taotaido.c +++ b/src/mame/drivers/taotaido.c @@ -76,7 +76,7 @@ zooming might be wrong void taotaido_state::machine_start() { membank("soundbank")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x8000); - + save_item(NAME(m_pending_command)); } diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c index 6f642fdd28a..1a6aefe439d 100644 --- a/src/mame/drivers/tbowl.c +++ b/src/mame/drivers/tbowl.c @@ -418,7 +418,7 @@ void tbowl_state::machine_start() { membank("mainbank")->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x800); membank("subbank")->configure_entries(0, 32, memregion("sub")->base() + 0x10000, 0x800); - + save_item(NAME(m_adpcm_pos)); save_item(NAME(m_adpcm_end)); save_item(NAME(m_adpcm_data)); diff --git a/src/mame/drivers/tgtpanic.c b/src/mame/drivers/tgtpanic.c index 73d58364756..b53dbf6d4d8 100644 --- a/src/mame/drivers/tgtpanic.c +++ b/src/mame/drivers/tgtpanic.c @@ -24,15 +24,15 @@ public: required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; - + required_shared_ptr<UINT8> m_ram; - + UINT8 m_color; - + DECLARE_WRITE8_MEMBER(color_w); - + virtual void machine_start(); - + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/drivers/thepit.c b/src/mame/drivers/thepit.c index feaf088e9df..e121e3a881f 100644 --- a/src/mame/drivers/thepit.c +++ b/src/mame/drivers/thepit.c @@ -170,13 +170,17 @@ Player 2 and Player 1 share the same controls ! #define VBEND (16) #define VBSTART (224+16) +void thepit_state::machine_start() +{ + save_item(NAME(m_nmi_mask)); +} -READ8_MEMBER(thepit_state::thepit_colorram_r) +READ8_MEMBER(thepit_state::intrepid_colorram_mirror_r) { return m_colorram[offset]; } -WRITE8_MEMBER(thepit_state::thepit_sound_enable_w) +WRITE8_MEMBER(thepit_state::sound_enable_w) { machine().sound().system_enable(data); } @@ -190,62 +194,62 @@ WRITE8_MEMBER(thepit_state::nmi_mask_w) static ADDRESS_MAP_START( thepit_main_map, AS_PROGRAM, 8, thepit_state ) AM_RANGE(0x0000, 0x4fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_colorram_w) AM_SHARE("colorram") - AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_videoram_w) AM_SHARE("videoram") + AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") + AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("attributesram") AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x9860, 0x98ff) AM_RAM - AM_RANGE(0xa000, 0xa000) AM_READ(thepit_input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics + AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_mask_w) AM_RANGE(0xb001, 0xb001) AM_WRITENOP // Unused, but initialized AM_RANGE(0xb002, 0xb002) AM_WRITENOP // coin_lockout_w - AM_RANGE(0xb003, 0xb003) AM_WRITE(thepit_sound_enable_w) + AM_RANGE(0xb003, 0xb003) AM_WRITE(sound_enable_w) AM_RANGE(0xb004, 0xb005) AM_WRITENOP // Unused, but initialized - AM_RANGE(0xb006, 0xb006) AM_WRITE(thepit_flip_screen_x_w) - AM_RANGE(0xb007, 0xb007) AM_WRITE(thepit_flip_screen_y_w) + AM_RANGE(0xb006, 0xb006) AM_WRITE(flip_screen_x_w) + AM_RANGE(0xb007, 0xb007) AM_WRITE(flip_screen_y_w) AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) ADDRESS_MAP_END static ADDRESS_MAP_START( desertdan_main_map, AS_PROGRAM, 8, thepit_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_colorram_w) AM_SHARE("colorram") - AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(thepit_videoram_w) AM_SHARE("videoram") + AM_RANGE(0x8800, 0x8bff) AM_MIRROR(0x0400) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") + AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("attributesram") AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x9860, 0x98ff) AM_RAM - AM_RANGE(0xa000, 0xa000) AM_READ(thepit_input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics + AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) AM_WRITENOP // Not hooked up according to the schematics AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_mask_w) AM_RANGE(0xb001, 0xb001) AM_WRITENOP // Unused, but initialized AM_RANGE(0xb002, 0xb002) AM_WRITENOP // coin_lockout_w - AM_RANGE(0xb003, 0xb003) AM_WRITE(thepit_sound_enable_w) + AM_RANGE(0xb003, 0xb003) AM_WRITE(sound_enable_w) AM_RANGE(0xb004, 0xb005) AM_WRITENOP // Unused, but initialized - AM_RANGE(0xb006, 0xb006) AM_WRITE(thepit_flip_screen_x_w) - AM_RANGE(0xb007, 0xb007) AM_WRITE(thepit_flip_screen_y_w) + AM_RANGE(0xb006, 0xb006) AM_WRITE(flip_screen_x_w) + AM_RANGE(0xb007, 0xb007) AM_WRITE(flip_screen_y_w) AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) ADDRESS_MAP_END static ADDRESS_MAP_START( intrepid_main_map, AS_PROGRAM, 8, thepit_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x87ff) AM_RAM - AM_RANGE(0x8c00, 0x8fff) AM_READ(thepit_colorram_r) AM_WRITE(thepit_colorram_w) /* mirror for intrepi2 */ - AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(thepit_videoram_w) AM_SHARE("videoram") - AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(thepit_colorram_w) AM_SHARE("colorram") + AM_RANGE(0x8c00, 0x8fff) AM_READ(intrepid_colorram_mirror_r) AM_WRITE(colorram_w) /* mirror for intrepi2 */ + AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") + AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") AM_RANGE(0x9800, 0x983f) AM_MIRROR(0x0700) AM_RAM AM_SHARE("attributesram") AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("spriteram") AM_RANGE(0x9860, 0x98ff) AM_RAM - AM_RANGE(0xa000, 0xa000) AM_READ(thepit_input_port_0_r) + AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN1") AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_mask_w) AM_RANGE(0xb001, 0xb001) AM_WRITENOP // Unused, but initialized AM_RANGE(0xb002, 0xb002) AM_WRITENOP // coin_lockout_w - AM_RANGE(0xb003, 0xb003) AM_WRITE(thepit_sound_enable_w) + AM_RANGE(0xb003, 0xb003) AM_WRITE(sound_enable_w) AM_RANGE(0xb004, 0xb004) AM_WRITENOP // Unused, but initialized AM_RANGE(0xb005, 0xb005) AM_WRITE(intrepid_graphics_bank_w) - AM_RANGE(0xb006, 0xb006) AM_WRITE(thepit_flip_screen_x_w) - AM_RANGE(0xb007, 0xb007) AM_WRITE(thepit_flip_screen_y_w) + AM_RANGE(0xb006, 0xb006) AM_WRITE(flip_screen_x_w) + AM_RANGE(0xb007, 0xb007) AM_WRITE(flip_screen_y_w) AM_RANGE(0xb800, 0xb800) AM_READWRITE(watchdog_reset_r, soundlatch_byte_w) ADDRESS_MAP_END @@ -266,32 +270,32 @@ static ADDRESS_MAP_START( audio_io_map, AS_IO, 8, thepit_state ) ADDRESS_MAP_END -#define IN0_REAL\ +static INPUT_PORTS_START( in0_real) PORT_START("IN0")\ - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY\ - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY\ - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY\ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY\ - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )\ - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )\ - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\ + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) +INPUT_PORTS_END - -#define IN2_FAKE\ +static INPUT_PORTS_START( in2_fake ) PORT_START("IN2")\ - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL\ - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL\ - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL\ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL\ - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL\ - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )\ - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )\ + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - +INPUT_PORTS_END static INPUT_PORTS_START( thepit ) - IN0_REAL + PORT_INCLUDE(in0_real) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -330,12 +334,12 @@ static INPUT_PORTS_START( thepit ) /* Since the real inputs are multiplexed, we used this fake port to read the 2nd player controls when the screen is flipped */ - IN2_FAKE + PORT_INCLUDE(in2_fake) INPUT_PORTS_END static INPUT_PORTS_START( desertdn ) - IN0_REAL + PORT_INCLUDE(in0_real) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -373,12 +377,12 @@ static INPUT_PORTS_START( desertdn ) /* Since the real inputs are multiplexed, we used this fake port to read the 2nd player controls when the screen is flipped */ - IN2_FAKE + PORT_INCLUDE(in2_fake) INPUT_PORTS_END static INPUT_PORTS_START( roundup ) - IN0_REAL + PORT_INCLUDE(in0_real) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -416,7 +420,7 @@ static INPUT_PORTS_START( roundup ) /* Since the real inputs are multiplexed, we used this fake port to read the 2nd player controls when the screen is flipped */ - IN2_FAKE + PORT_INCLUDE(in2_fake) INPUT_PORTS_END @@ -431,7 +435,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( intrepid ) - IN0_REAL + PORT_INCLUDE(in0_real) /* The bit at 0x80 in IN0 Starts a timer, which, after it runs down, doesn't seem to do anything. See $0105 */ PORT_START("IN1") @@ -471,12 +475,12 @@ static INPUT_PORTS_START( intrepid ) /* Since the real inputs are multiplexed, we used this fake port to read the 2nd player controls when the screen is flipped */ - IN2_FAKE + PORT_INCLUDE(in2_fake) INPUT_PORTS_END static INPUT_PORTS_START( dockman ) - IN0_REAL + PORT_INCLUDE(in0_real) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -514,12 +518,12 @@ static INPUT_PORTS_START( dockman ) /* Since the real inputs are multiplexed, we used this fake port to read the 2nd player controls when the screen is flipped */ - IN2_FAKE + PORT_INCLUDE(in2_fake) INPUT_PORTS_END static INPUT_PORTS_START( suprmous ) - IN0_REAL + PORT_INCLUDE(in0_real) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -558,7 +562,7 @@ static INPUT_PORTS_START( suprmous ) /* Since the real inputs are multiplexed, we used this fake port to read the 2nd player controls when the screen is flipped */ - IN2_FAKE + PORT_INCLUDE(in2_fake) INPUT_PORTS_END @@ -626,7 +630,7 @@ static INPUT_PORTS_START( rtriv ) INPUT_PORTS_END -static const gfx_layout thepit_charlayout = +static const gfx_layout charlayout = { 8,8, 256, @@ -638,7 +642,7 @@ static const gfx_layout thepit_charlayout = }; -static const gfx_layout thepit_spritelayout = +static const gfx_layout spritelayout = { 16,16, 64, @@ -675,15 +679,15 @@ static const gfx_layout suprmous_spritelayout = static GFXDECODE_START( thepit ) - GFXDECODE_ENTRY( "gfx1", 0, thepit_charlayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx1", 0, thepit_spritelayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 8 ) GFXDECODE_END static GFXDECODE_START( intrepid ) - GFXDECODE_ENTRY( "gfx1", 0x0000, thepit_charlayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx1", 0x0000, thepit_spritelayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx1", 0x0800, thepit_charlayout, 0, 8 ) - GFXDECODE_ENTRY( "gfx1", 0x0800, thepit_spritelayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, spritelayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0x0800, charlayout, 0, 8 ) + GFXDECODE_ENTRY( "gfx1", 0x0800, spritelayout, 0, 8 ) GFXDECODE_END static GFXDECODE_START( suprmous ) @@ -717,7 +721,7 @@ static MACHINE_CONFIG_START( thepit, thepit_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(thepit_state, screen_update_thepit) + MCFG_SCREEN_UPDATE_DRIVER(thepit_state, screen_update) MCFG_SCREEN_PALETTE("palette") /* sound hardware */ @@ -1246,35 +1250,39 @@ DRIVER_INIT_MEMBER(thepit_state,rtriv) { // Set-up the weirdest questions read ever done m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x4fff, read8_delegate(FUNC(thepit_state::rtriv_question_r),this)); + + save_item(NAME(m_question_address)); + save_item(NAME(m_question_rom)); + save_item(NAME(m_remap_address)); } -GAME( 1981, roundup, 0, thepit, roundup, driver_device, 0, ROT90, "Taito Corporation (Amenip/Centuri license)", "Round-Up", 0 ) -GAME( 1981, fitter, roundup, thepit, fitter, driver_device, 0, ROT90, "Taito Corporation", "Fitter", 0 ) -GAME( 1981, fitterbl, roundup, thepit, fitter, driver_device, 0, ROT90, "bootleg", "Fitter (bootleg of Round-Up)", 0 ) -GAME( 1981, ttfitter, roundup, thepit, fitter, driver_device, 0, ROT90, "Taito Corporation", "T.T. Fitter (Japan)", 0 ) +GAME( 1981, roundup, 0, thepit, roundup, driver_device, 0, ROT90, "Taito Corporation (Amenip/Centuri license)", "Round-Up", GAME_SUPPORTS_SAVE ) +GAME( 1981, fitter, roundup, thepit, fitter, driver_device, 0, ROT90, "Taito Corporation", "Fitter", GAME_SUPPORTS_SAVE ) +GAME( 1981, fitterbl, roundup, thepit, fitter, driver_device, 0, ROT90, "bootleg", "Fitter (bootleg of Round-Up)", GAME_SUPPORTS_SAVE ) +GAME( 1981, ttfitter, roundup, thepit, fitter, driver_device, 0, ROT90, "Taito Corporation", "T.T. Fitter (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1982, thepit, 0, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics", "The Pit", 0 ) // AW == Andy Walker -GAME( 1982, thepitu1, thepit, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics (Centuri license)", "The Pit (US set 1)", 0 ) -GAME( 1982, thepitu2, thepit, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics (Centuri license)", "The Pit (US set 2)", 0 ) // Bally PCB -GAME( 1982, thepitj, thepit, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics (Taito license)", "The Pit (Japan)", 0 ) +GAME( 1982, thepit, 0, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics", "The Pit", GAME_SUPPORTS_SAVE ) // AW == Andy Walker +GAME( 1982, thepitu1, thepit, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics (Centuri license)", "The Pit (US set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1982, thepitu2, thepit, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics (Centuri license)", "The Pit (US set 2)", GAME_SUPPORTS_SAVE ) // Bally PCB +GAME( 1982, thepitj, thepit, thepit, thepit, driver_device, 0, ROT90, "Zilec Electronics (Taito license)", "The Pit (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1982, dockman, 0, intrepid, dockman, driver_device, 0, ROT90, "Taito Corporation", "Dock Man", 0 ) -GAME( 1982, portman, dockman, intrepid, dockman, driver_device, 0, ROT90, "Taito Corporation (Nova Games Ltd. license)", "Port Man", 0 ) +GAME( 1982, dockman, 0, intrepid, dockman, driver_device, 0, ROT90, "Taito Corporation", "Dock Man", GAME_SUPPORTS_SAVE ) +GAME( 1982, portman, dockman, intrepid, dockman, driver_device, 0, ROT90, "Taito Corporation (Nova Games Ltd. license)", "Port Man", GAME_SUPPORTS_SAVE ) -GAME( 1982, suprmous, 0, suprmous, suprmous, driver_device, 0, ROT90, "Taito Corporation", "Super Mouse", 0 ) -GAME( 1982, funnymou, suprmous, suprmous, suprmous, driver_device, 0, ROT90, "Taito Corporation (Chuo Co. Ltd license)", "Funny Mouse (Japan)", 0 ) // Taito PCB +GAME( 1982, suprmous, 0, suprmous, suprmous, driver_device, 0, ROT90, "Taito Corporation", "Super Mouse", GAME_SUPPORTS_SAVE ) +GAME( 1982, funnymou, suprmous, suprmous, suprmous, driver_device, 0, ROT90, "Taito Corporation (Chuo Co. Ltd license)", "Funny Mouse (Japan)", GAME_SUPPORTS_SAVE ) // Taito PCB -GAME( 1982, machomou, 0, suprmous, suprmous, driver_device, 0, ROT90, "Techstar", "Macho Mouse", 0 ) +GAME( 1982, machomou, 0, suprmous, suprmous, driver_device, 0, ROT90, "Techstar", "Macho Mouse", GAME_SUPPORTS_SAVE ) -GAME( 1982, desertdn, 0, desertdn, desertdn, driver_device, 0, ROT0, "Video Optics", "Desert Dan", 0 ) +GAME( 1982, desertdn, 0, desertdn, desertdn, driver_device, 0, ROT0, "Video Optics", "Desert Dan", GAME_SUPPORTS_SAVE ) -GAME( 1983, intrepid, 0, intrepid, intrepid, driver_device, 0, ROT90, "Nova Games Ltd.", "Intrepid (set 1)", 0 ) -GAME( 1983, intrepid2,intrepid, intrepid, intrepid, driver_device, 0, ROT90, "Nova Games Ltd.", "Intrepid (set 2)", 0 ) -GAME( 1984, intrepidb,intrepid, intrepid, intrepid, driver_device, 0, ROT90, "bootleg (Elsys)", "Intrepid (Elsys bootleg, set 1)", 0 ) -GAME( 1984, intrepidb3,intrepid,intrepid, intrepid, driver_device, 0, ROT90, "bootleg (Elsys)", "Intrepid (Elsys bootleg, set 2)", 0 ) -GAME( 1984, intrepidb2,intrepid,intrepid, intrepid, driver_device, 0, ROT90, "bootleg (Loris)", "Intrepid (Loris bootleg)", 0 ) +GAME( 1983, intrepid, 0, intrepid, intrepid, driver_device, 0, ROT90, "Nova Games Ltd.", "Intrepid (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1983, intrepid2,intrepid, intrepid, intrepid, driver_device, 0, ROT90, "Nova Games Ltd.", "Intrepid (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1984, intrepidb,intrepid, intrepid, intrepid, driver_device, 0, ROT90, "bootleg (Elsys)", "Intrepid (Elsys bootleg, set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1984, intrepidb3,intrepid,intrepid, intrepid, driver_device, 0, ROT90, "bootleg (Elsys)", "Intrepid (Elsys bootleg, set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1984, intrepidb2,intrepid,intrepid, intrepid, driver_device, 0, ROT90, "bootleg (Loris)", "Intrepid (Loris bootleg)", GAME_SUPPORTS_SAVE ) -GAME( 1984, zaryavos, 0, intrepid, intrepid, driver_device, 0, ROT90, "Nova Games of Canada", "Zarya Vostoka", GAME_NOT_WORKING ) +GAME( 1984, zaryavos, 0, intrepid, intrepid, driver_device, 0, ROT90, "Nova Games of Canada", "Zarya Vostoka", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) -GAME( 198?, rtriv, 0, intrepid, rtriv, thepit_state, rtriv, ROT90, "Romar", "Romar Triv", GAME_WRONG_COLORS ) +GAME( 198?, rtriv, 0, intrepid, rtriv, thepit_state, rtriv, ROT90, "Romar", "Romar Triv", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c index 77a82af1ec2..db00ce1cb0d 100644 --- a/src/mame/drivers/thunderx.c +++ b/src/mame/drivers/thunderx.c @@ -317,7 +317,7 @@ WRITE8_MEMBER(thunderx_state::thunderx_1f98_w) WRITE8_MEMBER(thunderx_state::scontra_bankswitch_w) { // bits 0-3 select ROM bank at 6000-7fff - m_rombank->set_entry(data & 0x0f); + m_rombank->set_entry(data & 0x0f); // bit 4 selects work RAM or palette RAM at 5800-5fff m_bank5800->set_bank((data & 0x10) >> 4); diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 5d7bf8b8c74..e3cb8ce25cb 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -5370,7 +5370,7 @@ GAME( 1996, bgaregganv, bgaregga, bgaregga, bgareggahk, toaplan2_state, bgaregga GAME( 1996, bgareggat2, bgaregga, bgaregga, bgaregga, toaplan2_state, bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Europe / USA / Japan / Asia) (Sat Mar 2 1996)" , GAME_SUPPORTS_SAVE ) // displays Type 2 only when set to Europe GAME( 1996, bgareggacn, bgaregga, bgaregga, bgareggacn, toaplan2_state, bgaregga, ROT270, "Raizing / Eighting", "Battle Garegga - Type 2 (Denmark / China) (Tue Apr 2 1996)", GAME_SUPPORTS_SAVE ) // displays Type 2 only when set to Denmark GAME( 1996, bgareggabl, bgaregga, bgareggabl,bgareggacn, toaplan2_state,bgaregga, ROT270, "bootleg", "1945 Part-2 (Chinese hack of Battle Garegga)", GAME_SUPPORTS_SAVE ) -GAME( 1996, bgareggabla,bgaregga, bgareggabl,bgareggacn, toaplan2_state,bgaregga, ROT270, "bootleg", "Thunder Deity Biography (Chinese hack of Battle Garegga)", GAME_SUPPORTS_SAVE ) +GAME( 1996, bgareggabla,bgaregga, bgareggabl,bgareggacn, toaplan2_state,bgaregga, ROT270, "bootleg", "Lei Shen Zhuan Thunder Deity Biography (Chinese hack of Battle Garegga)", GAME_SUPPORTS_SAVE ) // these are all based on Version B, even if only the Japan version states 'version B' GAME( 1998, batrider, 0, batrider, batrider, toaplan2_state, batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Europe) (Fri Feb 13 1998)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/tryout.c b/src/mame/drivers/tryout.c index 2b6db01e5f9..8b2259c7b43 100644 --- a/src/mame/drivers/tryout.c +++ b/src/mame/drivers/tryout.c @@ -45,12 +45,12 @@ WRITE8_MEMBER(tryout_state::sound_irq_ack_w) void tryout_state::machine_start() { - membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x2000); + membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x2000); } WRITE8_MEMBER(tryout_state::bankswitch_w) { - membank("bank1")->set_entry(data & 0x01); + membank("bank1")->set_entry(data & 0x01); } static ADDRESS_MAP_START( main_cpu, AS_PROGRAM, 8, tryout_state ) diff --git a/src/mame/drivers/tsamurai.c b/src/mame/drivers/tsamurai.c index 3020a719c31..9cda0ce3a86 100644 --- a/src/mame/drivers/tsamurai.c +++ b/src/mame/drivers/tsamurai.c @@ -711,7 +711,7 @@ static MACHINE_CONFIG_START( tsamurai, tsamurai_state ) MCFG_CPU_ADD("audio2", Z80, XTAL_24MHz/8) MCFG_CPU_PROGRAM_MAP(sound2_map) - + MCFG_MACHINE_START_OVERRIDE(tsamurai_state,tsamurai) /* video hardware */ @@ -752,7 +752,7 @@ static MACHINE_CONFIG_START( vsgongf, tsamurai_state ) MCFG_CPU_PROGRAM_MAP(sound_vsgongf_map) MCFG_CPU_IO_MAP(vsgongf_audio_io_map) MCFG_CPU_PERIODIC_INT_DRIVER(tsamurai_state, vsgongf_sound_interrupt, 3*60) - + MCFG_MACHINE_START_OVERRIDE(tsamurai_state,vsgongf) /* video hardware */ @@ -797,7 +797,7 @@ static MACHINE_CONFIG_START( m660, tsamurai_state ) MCFG_CPU_PROGRAM_MAP(sound3_m660_map) MCFG_CPU_IO_MAP(sound3_m660_io_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", tsamurai_state, nmi_line_pulse) - + MCFG_MACHINE_START_OVERRIDE(tsamurai_state,m660) /* video hardware */ diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c index 1566f15d97b..21e0f2e81c9 100644 --- a/src/mame/drivers/ttchamp.c +++ b/src/mame/drivers/ttchamp.c @@ -51,20 +51,23 @@ Dumped by tirino73 -- works in a very similar way to 'Spider' (twins.c) +- works in a very similar way to 'Spider' (twins.c) including the blitter (seems to be doubled up hardware tho, twice as many layers?) -- need to work out how it selects between upper/lower - program roms as blitter source -- PIC is not for sound, what is is for? -- eeprom? (I don't see one, maybe PIC is used for settings?) -- more than one layer -- layer clearing +- Convert this to a blitter device, and share it with twins.c +- A bunch of spurious RAM writes to ROM area (genuine bug? left-overs?) + +Notes +I think the PIC is used to interface with battry backed RAM instead of an EEPROM, +we currently simulate this as the PIC is read protected. + + */ #include "emu.h" #include "cpu/nec/nec.h" #include "sound/okim6295.h" +#include "machine/nvram.h" class ttchamp_state : public driver_device { @@ -85,11 +88,14 @@ public: DECLARE_WRITE16_MEMBER(port20_w); DECLARE_WRITE16_MEMBER(port62_w); - + DECLARE_READ16_MEMBER(port1e_r); + DECLARE_READ16_MEMBER(ttchamp_pic_r); + DECLARE_WRITE16_MEMBER(ttchamp_pic_w); UINT16 m_port10; + UINT8 m_rombank; DECLARE_DRIVER_INIT(ttchamp); @@ -99,11 +105,26 @@ public: DECLARE_WRITE16_MEMBER(ttchamp_mem_w); UINT16 m_videoram0[0x10000 / 2]; -// UINT16 m_videoram1[0x10000 / 2]; UINT16 m_videoram2[0x10000 / 2]; + enum picmode + { + PIC_IDLE = 0, + PIC_SET_READADDRESS = 1, + PIC_SET_WRITEADDRESS = 2, + PIC_SET_WRITELATCH = 3, + PIC_SET_READLATCH = 4, + + } picmodex; + + int m_pic_readaddr; + int m_pic_writeaddr; + int m_pic_latched; + int m_pic_writelatched; + + UINT8* m_bakram; UINT16 m_mainram[0x10000 / 2]; @@ -126,11 +147,16 @@ void ttchamp_state::machine_start() { m_rom16 = (UINT16*)memregion("maincpu")->base(); m_rom8 = memregion("maincpu")->base(); + + picmodex = PIC_IDLE; + + m_bakram = auto_alloc_array(machine(), UINT8, 0x100); + machine().device<nvram_device>("backram")->set_base(m_bakram, 0x100); + } void ttchamp_state::video_start() { - } UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -143,7 +169,7 @@ UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 bitmap.fill(m_palette->black_pen()); UINT8 *videoramfg; UINT8* videorambg; - + count=0; videorambg = (UINT8*)m_videoram0; videoramfg = (UINT8*)m_videoram2; @@ -156,21 +182,21 @@ UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 count++; } } - + /* count=0; videoram = (UINT8*)m_videoram1; for (y=0;y<yyy;y++) { - for(x=0;x<xxx;x++) - { - UINT8 pix = videoram[BYTE_XOR_LE(count)]; - if (pix) bitmap.pix16(y, x) = pix+0x200; - count++; - } + for(x=0;x<xxx;x++) + { + UINT8 pix = videoram[BYTE_XOR_LE(count)]; + if (pix) bitmap.pix16(y, x) = pix+0x200; + count++; + } } */ - + count=0; for (y=0;y<yyy;y++) { @@ -204,7 +230,7 @@ UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 count++; } } - + #if 0 for (int i = 0; i < 0x8000; i++) { @@ -212,11 +238,11 @@ UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 // I think it actually does more blit operations with // different bits of m_port10 set to redraw the backgrounds using the video ram data as a source rather than ROM - notice the garbage you see behind 'sprites' right now // this method also removes the text layer, which we don't want - // m_videoram1[i] = 0x0000; - // m_videoram2[i] = 0x0000; + // m_videoram1[i] = 0x0000; + // m_videoram2[i] = 0x0000; } #endif - + return 0; } @@ -233,6 +259,79 @@ WRITE16_MEMBER(ttchamp_state::paldat_w) m_palette->set_pen_color(m_paloff & 0x3ff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); } +READ16_MEMBER(ttchamp_state::ttchamp_pic_r) +{ +// printf("%06x: read from PIC (%04x)\n", space.device().safe_pc(),mem_mask); + if (picmodex == PIC_SET_READLATCH) + { +// printf("read data %02x from %02x\n", m_pic_latched, m_pic_readaddr); + picmodex = PIC_IDLE; + + return m_pic_latched << 8; + + } + return 0x00; + +} + +WRITE16_MEMBER(ttchamp_state::ttchamp_pic_w) +{ +// printf("%06x: write to PIC %04x (%04x) (%d)\n", space.device().safe_pc(),data,mem_mask, picmodex); + if (picmodex == PIC_IDLE) + { + if (data == 0x11) + { + picmodex = PIC_SET_READADDRESS; +// printf("state = SET_READADDRESS\n"); + } + else if (data == 0x12) + { + picmodex = PIC_SET_WRITELATCH; +// printf("latch write data.. \n" ); + } + else if (data == 0x20) + { + picmodex = PIC_SET_WRITEADDRESS; +// printf("state = PIC_SET_WRITEADDRESS\n"); + } + else if (data == 0x21) // write latched data + { + picmodex = PIC_IDLE; + m_bakram[m_pic_writeaddr] = m_pic_writelatched; + // printf("wrote %02x to %02x\n", m_pic_writelatched, m_pic_writeaddr); + } + else if (data == 0x22) // next data to latch + { + // why does it read twice as many addresses, forcing us to shift the + // address by 1 to give correct results? maybe it can read 'previous' data' too? + m_pic_latched = m_bakram[m_pic_readaddr>>1]; + +// printf("latch read data %02x from %02x\n",m_pic_latched, m_pic_readaddr ); + picmodex = PIC_SET_READLATCH; // waiting to read... + } + else + { +// printf("unknown\n"); + } + } + else if (picmodex == PIC_SET_READADDRESS) + { + m_pic_readaddr = data; + picmodex = PIC_IDLE; + } + else if (picmodex == PIC_SET_WRITEADDRESS) + { + m_pic_writeaddr = data; + picmodex = PIC_IDLE; + } + else if (picmodex == PIC_SET_WRITELATCH) + { + m_pic_writelatched = data; + picmodex = PIC_IDLE; + } + +} + READ16_MEMBER(ttchamp_state::ttchamp_mem_r) { @@ -289,18 +388,19 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) if (m_spritesinit == 1) { - // printf("%06x: spider_blitter_w %08x %04x %04x (init?) (base?)\n", space.device().safe_pc(), offset * 2, data, mem_mask); + // printf("%06x: spider_blitter_w %08x %04x %04x (init?) (base?)\n", space.device().safe_pc(), offset * 2, data, mem_mask); m_spritesinit = 2; m_spritesaddr = offset; + } else if (m_spritesinit == 2) { - // printf("%06x: spider_blitter_w %08x %04x %04x (init2) (width?)\n", space.device().safe_pc(), offset * 2, data, mem_mask); + // printf("%06x: spider_blitter_w %08x %04x %04x (init2) (width?)\n", space.device().safe_pc(), offset * 2, data, mem_mask); m_spriteswidth = offset & 0xff; + //printf("%08x\n",(offset*2) & 0xfff00); - m_spritesinit = 0; - + m_spritesinit = 3; } else { @@ -314,37 +414,53 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) } else if ((offset >= 0x30000 / 2) && (offset < 0x40000 / 2)) { + if(m_spritesinit != 3) + { + printf("blitter bus write but blitter unselected? %08x %04x\n",offset*2,data); + return; + } + + m_spritesinit = 0; + // 0x30000-0x3ffff used, on Spider it's 0x20000-0x2ffff offset &= 0x7fff; UINT8 *src = m_rom8; - if (m_port10 & 2) // NO, wrong for the portraits + if (m_rombank) src += 0x100000; - // printf("%06x: spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", space.device().safe_pc(), offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); + // printf("%06x: spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", space.device().safe_pc(), offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); offset &= 0x7fff; for (int i = 0; i < m_spriteswidth; i++) { - if ((m_port10 & 0xf) == 0x01) // this is set when moving objects are cleared, although not screen clears? + if (m_port10 & 0x30) // this is set when moving objects are cleared, although not screen clears? { - vram[offset] = 0x0000; + /* guess: assume that bit 4 is for layer 0 and bit 5 for layer 1 + (according to 0x21 setted at the "Clubs League" color fade-out) + */ + if(m_port10 & 0x10) + m_videoram0[offset] = 0x0000; + if(m_port10 & 0x20) + m_videoram2[offset] = 0x0000; + offset++; } else { UINT8 data; - + data = (src[(m_spritesaddr * 2) + 1]); + //data |= vram[offset] >> 8; - if (data) + /* bit 1 actually enables transparent pen */ + if (data || (m_port10 & 2) == 0) vram[offset] = (vram[offset] & 0x00ff) | data << 8; - data = src[(m_spritesaddr * 2)]; - if (data) + if (data || (m_port10 & 2) == 0) vram[offset] = (vram[offset] & 0xff00) | data; @@ -369,8 +485,10 @@ static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) ADDRESS_MAP_END +/* Re-use same parameters as before (one-shot) */ READ16_MEMBER(ttchamp_state::port1e_r) { + m_spritesinit = 3; return 0xff; } @@ -380,45 +498,33 @@ READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r) return 0xff; } +/* blitter mode select */ WRITE16_MEMBER(ttchamp_state::port10_w) { - UINT8 res; + /* + --xx ---- fill enable + ---- --x- opacity enable (Gamart logo) + ---- ---x layer select + */ COMBINE_DATA(&m_port10); - - res = m_port10 & 0xf0; - /* Assume that both bits clears layers. */ - if(res == 0x30) - { - for (int i = 0; i < 0x8000; i++) - { - m_videoram0[i] = 0x0000; - m_videoram2[i] = 0x0000; - } - } - else if(res != 0) - printf("Check me, i/o 0x10 used with %02x\n",res); } +/* selects upper bank for the blitter */ WRITE16_MEMBER(ttchamp_state::port20_w) { - printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); - // seems to somehow be tied to layer clear - // might also depend on layer selected with 0x10 tho? written after it - /*for (int i = 0; i < 0x8000; i++) - { - // m_videoram0[i] = 0x0000; - m_videoram2[i] = 0x0000; - }*/ - + //printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); + m_rombank = 1; } +/* selects lower bank for the blitter */ WRITE16_MEMBER(ttchamp_state::port62_w) { - printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); + //printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); + m_rombank = 0; } static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) - AM_RANGE(0x0000, 0x0001) AM_WRITENOP // startup only + AM_RANGE(0x0000, 0x0001) AM_WRITENOP // startup only, nmi enable? AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM") AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2") @@ -435,7 +541,7 @@ static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) AM_RANGE(0x0020, 0x0021) AM_WRITE(port20_w) -// AM_RANGE(0x0034, 0x0035) AM_READ(peno_rand) AM_WRITENOP // eeprom (PIC?) / settings? + AM_RANGE(0x0034, 0x0035) AM_READWRITE(ttchamp_pic_r, ttchamp_pic_w) AM_RANGE(0x0062, 0x0063) AM_WRITE(port62_w) @@ -530,6 +636,8 @@ static MACHINE_CONFIG_START( ttchamp, ttchamp_state ) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x400) + + MCFG_NVRAM_ADD_0FILL("backram") MCFG_SPEAKER_STANDARD_MONO("mono") @@ -568,10 +676,8 @@ ROM_END DRIVER_INIT_MEMBER(ttchamp_state,ttchamp) { -// UINT8 *ROM1 = memregion("user1")->base(); -// membank("bank1")->set_base(&ROM1[0x100000]); -// membank("bank2")->set_base(&ROM1[0x180000]); } -GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions", GAME_NOT_WORKING ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' -GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", GAME_NOT_WORKING ) // this only has Palencia Elektronik advertising boards +// only the graphics differ between the two sets, code section is the same +GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions", 0 ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' +GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", 0 ) // this only has Palencia Elektronik advertising boards diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c index 50c9690c31c..9c4d965ac3d 100644 --- a/src/mame/drivers/tugboat.c +++ b/src/mame/drivers/tugboat.c @@ -49,7 +49,7 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; - + required_shared_ptr<UINT8> m_ram; UINT8 m_hd46505_0_reg[18]; @@ -58,18 +58,18 @@ public: int m_reg1; int m_ctrl; emu_timer *m_interrupt_timer; - + DECLARE_WRITE8_MEMBER(hd46505_0_w); DECLARE_WRITE8_MEMBER(hd46505_1_w); DECLARE_WRITE8_MEMBER(score_w); DECLARE_READ8_MEMBER(input_r); DECLARE_WRITE8_MEMBER(ctrl_w); - + virtual void machine_start(); virtual void video_start(); virtual void machine_reset(); DECLARE_PALETTE_INIT(tugboat); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_tilemap(bitmap_ind16 &bitmap,const rectangle &cliprect, int addr,int gfx0,int gfx1,int transparency); @@ -82,7 +82,7 @@ protected: void tugboat_state::machine_start() { m_interrupt_timer = timer_alloc(TIMER_INTERRUPT); - + save_item(NAME(m_hd46505_0_reg)); save_item(NAME(m_hd46505_1_reg)); save_item(NAME(m_reg0)); diff --git a/src/mame/drivers/tunhunt.c b/src/mame/drivers/tunhunt.c index 31512cab0b3..dedf819a395 100644 --- a/src/mame/drivers/tunhunt.c +++ b/src/mame/drivers/tunhunt.c @@ -55,7 +55,7 @@ * *************************************/ -WRITE8_MEMBER(tunhunt_state::tunhunt_control_w) +WRITE8_MEMBER(tunhunt_state::control_w) { /* 0x01 coin counter#2 "right counter" @@ -81,7 +81,7 @@ WRITE8_MEMBER(tunhunt_state::tunhunt_control_w) * *************************************/ -READ8_MEMBER(tunhunt_state::tunhunt_button_r) +READ8_MEMBER(tunhunt_state::button_r) { int data = ioport("IN0")->read(); return ((data>>offset)&1)?0x00:0x80; @@ -135,11 +135,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, tunhunt_state ) AM_RANGE(0x1800, 0x1800) AM_WRITEONLY /* SHEL0H */ AM_RANGE(0x1a00, 0x1a00) AM_WRITEONLY /* SHEL1H */ AM_RANGE(0x1c00, 0x1c00) AM_WRITEONLY /* MOBJV */ - AM_RANGE(0x1e00, 0x1eff) AM_WRITE(tunhunt_videoram_w) AM_SHARE("videoram") /* ALPHA */ + AM_RANGE(0x1e00, 0x1eff) AM_WRITE(videoram_w) AM_SHARE("videoram") /* ALPHA */ AM_RANGE(0x2000, 0x2000) AM_WRITENOP /* watchdog */ - AM_RANGE(0x2000, 0x2007) AM_READ(tunhunt_button_r) + AM_RANGE(0x2000, 0x2007) AM_READ(button_r) AM_RANGE(0x2400, 0x2400) AM_WRITENOP /* INT ACK */ - AM_RANGE(0x2800, 0x2800) AM_WRITE(tunhunt_control_w) + AM_RANGE(0x2800, 0x2800) AM_WRITE(control_w) AM_RANGE(0x2c00, 0x2fff) AM_WRITEONLY AM_SHARE("spriteram") AM_RANGE(0x3000, 0x300f) AM_DEVREADWRITE("pokey1", pokey_device, read, write) AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE("pokey2", pokey_device, read, write) @@ -277,7 +277,7 @@ static MACHINE_CONFIG_START( tunhunt, tunhunt_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(256, 256-16) MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 255-16) - MCFG_SCREEN_UPDATE_DRIVER(tunhunt_state, screen_update_tunhunt) + MCFG_SCREEN_UPDATE_DRIVER(tunhunt_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", tunhunt) @@ -390,5 +390,5 @@ ROM_END *************************************/ /* rom parent machine inp init */ -GAME( 1979,tunhunt, 0, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari", "Tunnel Hunt", 0 ) -GAME( 1981,tunhuntc, tunhunt, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari (Centuri license)", "Tunnel Hunt (Centuri)", 0 ) +GAME( 1979,tunhunt, 0, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari", "Tunnel Hunt", GAME_SUPPORTS_SAVE ) +GAME( 1981,tunhuntc, tunhunt, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari (Centuri license)", "Tunnel Hunt (Centuri)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c index 6ee893004dc..8f58e5b4b91 100644 --- a/src/mame/drivers/twins.c +++ b/src/mame/drivers/twins.c @@ -52,6 +52,9 @@ It is possible the Twins PCB has them too and doesn't use them. Twins (set 2) is significantly changed hardware, uses a regular RAMDAC hookup for plaette etc. +To access Service Mode in Spider you must boot with P1 Left and P1 Right held down, +this requires the -joystick_contradictory switch on the commandline. + */ @@ -123,15 +126,15 @@ void twins_state::machine_start() READ16_MEMBER(twins_state::twins_port4_r) { // doesn't work?? -// printf("%08x: twins_port4_r %04x\n", space.device().safe_pc(), mem_mask); -// return m_i2cmem->read_sda();// | 0xfffe; +// printf("%08x: twins_port4_r %04x\n", space.device().safe_pc(), mem_mask); +// return m_i2cmem->read_sda();// | 0xfffe; return 0x0001; } WRITE16_MEMBER(twins_state::twins_port4_w) { -// printf("%08x: twins_port4_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); +// printf("%08x: twins_port4_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); int i2c_clk = BIT(data, 1); int i2c_mem = BIT(data, 0); m_i2cmem->write_scl(i2c_clk); @@ -165,7 +168,7 @@ WRITE16_MEMBER(twins_state::twins_pal_w) /* ??? weird ..*/ WRITE16_MEMBER(twins_state::porte_paloff0_w) { -// printf("porte_paloff0_w %04x\n", data); +// printf("porte_paloff0_w %04x\n", data); m_paloff = 0; } @@ -205,14 +208,14 @@ WRITE16_MEMBER(twins_state::spider_blitter_w) if (m_spritesinit == 1) { - // printf("spider_blitter_w %08x %04x %04x (init?) (base?)\n", offset * 2, data, mem_mask); + // printf("spider_blitter_w %08x %04x %04x (init?) (base?)\n", offset * 2, data, mem_mask); m_spritesinit = 2; m_spritesaddr = offset; } else if (m_spritesinit == 2) { - // printf("spider_blitter_w %08x %04x %04x (init2) (width?)\n", offset * 2, data, mem_mask); + // printf("spider_blitter_w %08x %04x %04x (init2) (width?)\n", offset * 2, data, mem_mask); m_spriteswidth = offset & 0xff; if (m_spriteswidth == 0) m_spriteswidth = 80; @@ -234,26 +237,26 @@ WRITE16_MEMBER(twins_state::spider_blitter_w) { UINT8 *src = m_rom8; - // printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); + // printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); offset &= 0x7fff; for (int i = 0; i < m_spriteswidth; i++) { UINT8 data; - + data = (src[(m_spritesaddr * 2) + 1]); - + if (data) vram[offset] = (vram[offset] & 0x00ff) | data << 8; data = src[(m_spritesaddr*2)]; - + if (data) vram[offset] = (vram[offset] & 0xff00) | data; - m_spritesaddr ++; + m_spritesaddr ++; offset++; offset &= 0x7fff; @@ -386,7 +389,7 @@ static MACHINE_CONFIG_START( twins, twins_state ) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) MCFG_SCREEN_UPDATE_DRIVER(twins_state, screen_update_twins) MCFG_SCREEN_PALETTE("palette") - + MCFG_24C02_ADD("i2cmem") MCFG_PALETTE_ADD("palette", 0x100) @@ -447,7 +450,7 @@ static MACHINE_CONFIG_START( twinsa, twins_state ) MCFG_PALETTE_ADD("palette", 256) MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette") MCFG_RAMDAC_SPLIT_READ(0) - + MCFG_24C02_ADD("i2cmem") MCFG_VIDEO_START_OVERRIDE(twins_state,twinsa) @@ -477,9 +480,9 @@ WRITE16_MEMBER(twins_state::spider_pal_w) } else { - // printf("first palette write %04x\n", data); + // printf("first palette write %04x\n", data); } - + m_paloff++; if (m_paloff == 0x101) @@ -503,14 +506,17 @@ WRITE16_MEMBER(twins_state::spider_port_1c_w) { // done before the 'sprite' read / writes // might clear a buffer? - + // game is only animating sprites at 30fps, maybe there's some double buffering too? +// data written is always 00, only seems to want the upper layer to be cleared +// otherwise you get garbage sprites between rounds and the bg incorrectly wiped + UINT16* vram; - if (m_videorambank & 1) +// if (m_videorambank & 1) vram = m_videoram2; - else - vram = m_videoram; +// else +// vram = m_videoram; for (int i = 0; i < 0x8000; i++) { @@ -575,7 +581,7 @@ static MACHINE_CONFIG_START( spider, twins_state ) MCFG_PALETTE_ADD("palette", 0x100) MCFG_VIDEO_START_OVERRIDE(twins_state,twins) - + MCFG_24C02_ADD("i2cmem") /* sound hardware */ diff --git a/src/mame/drivers/unkhorse.c b/src/mame/drivers/unkhorse.c index beb3d7ddcdd..d7e8679fb09 100644 --- a/src/mame/drivers/unkhorse.c +++ b/src/mame/drivers/unkhorse.c @@ -30,25 +30,37 @@ class horse_state : public driver_device public: horse_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_video_ram(*this, "video_ram"), - m_color_ram(*this, "color_ram"), m_maincpu(*this, "maincpu"), - m_dac(*this, "dac") { } + m_dac(*this, "dac"), + m_video_ram(*this, "video_ram"), + m_color_ram(*this, "color_ram") { } + + required_device<cpu_device> m_maincpu; + required_device<dac_device> m_dac; required_shared_ptr<UINT8> m_video_ram; required_shared_ptr<UINT8> m_color_ram; + UINT8 m_output; - DECLARE_READ8_MEMBER(horse_input_r); - DECLARE_WRITE8_MEMBER(horse_output_w); - DECLARE_WRITE_LINE_MEMBER(horse_timer_out); + + DECLARE_READ8_MEMBER(input_r); + DECLARE_WRITE8_MEMBER(output_w); + DECLARE_WRITE_LINE_MEMBER(timer_out); + + virtual void machine_start(); DECLARE_PALETTE_INIT(horse); - UINT32 screen_update_horse(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(horse_interrupt); - required_device<cpu_device> m_maincpu; - required_device<dac_device> m_dac; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + INTERRUPT_GEN_MEMBER(interrupt); }; +void horse_state::machine_start() +{ + save_item(NAME(m_output)); +} + /*************************************************************************** Video @@ -62,7 +74,7 @@ PALETTE_INIT_MEMBER(horse_state, horse) palette.set_pen_color(i, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0)); } -UINT32 horse_state::screen_update_horse(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 horse_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -98,7 +110,7 @@ static ADDRESS_MAP_START( horse_io_map, AS_IO, 8, horse_state ) ADDRESS_MAP_END -READ8_MEMBER(horse_state::horse_input_r) +READ8_MEMBER(horse_state::input_r) { switch (m_output >> 6 & 3) { @@ -111,7 +123,7 @@ READ8_MEMBER(horse_state::horse_input_r) return 0xff; } -WRITE8_MEMBER(horse_state::horse_output_w) +WRITE8_MEMBER(horse_state::output_w) { m_output = data; @@ -120,7 +132,7 @@ WRITE8_MEMBER(horse_state::horse_output_w) // other bits: ? } -WRITE_LINE_MEMBER(horse_state::horse_timer_out) +WRITE_LINE_MEMBER(horse_state::timer_out) { m_dac->write_signed8(state ? 0x7f : 0); } @@ -182,7 +194,7 @@ INPUT_PORTS_END ***************************************************************************/ -INTERRUPT_GEN_MEMBER(horse_state::horse_interrupt) +INTERRUPT_GEN_MEMBER(horse_state::interrupt) { device.execute().set_input_line(I8085_RST75_LINE, ASSERT_LINE); device.execute().set_input_line(I8085_RST75_LINE, CLEAR_LINE); @@ -194,13 +206,13 @@ static MACHINE_CONFIG_START( horse, horse_state ) MCFG_CPU_ADD("maincpu", I8085A, XTAL_12MHz / 2) MCFG_CPU_PROGRAM_MAP(horse_map) MCFG_CPU_IO_MAP(horse_io_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", horse_state, horse_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", horse_state, interrupt) MCFG_DEVICE_ADD("i8155", I8155, XTAL_12MHz / 2) - MCFG_I8155_IN_PORTA_CB(READ8(horse_state, horse_input_r)) - MCFG_I8155_OUT_PORTB_CB(WRITE8(horse_state, horse_output_w)) + MCFG_I8155_IN_PORTA_CB(READ8(horse_state, input_r)) + MCFG_I8155_OUT_PORTB_CB(WRITE8(horse_state, output_w)) //port C output (but unused) - MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(horse_state, horse_timer_out)) + MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(horse_state, timer_out)) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -208,7 +220,7 @@ static MACHINE_CONFIG_START( horse, horse_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(horse_state, screen_update_horse) + MCFG_SCREEN_UPDATE_DRIVER(horse_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 8) @@ -240,4 +252,4 @@ ROM_START( unkhorse ) ROM_END -GAME( 1981?, unkhorse, 0, horse, horse, driver_device, 0, ROT270, "<unknown>", "unknown Japanese horse gambling game", 0 ) // copyright not shown, datecodes on pcb suggests early-1981 +GAME( 1981?, unkhorse, 0, horse, horse, driver_device, 0, ROT270, "<unknown>", "unknown Japanese horse gambling game", GAME_SUPPORTS_SAVE ) // copyright not shown, datecodes on pcb suggests early-1981 diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c index e918370cb66..7110df01a46 100644 --- a/src/mame/drivers/usgames.c +++ b/src/mame/drivers/usgames.c @@ -32,12 +32,12 @@ Sound: AY-3-8912 void usgames_state::machine_start() { - membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000); + membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000); } WRITE8_MEMBER(usgames_state::usgames_rombank_w) { - membank("bank1")->set_entry(data); + membank("bank1")->set_entry(data); } WRITE8_MEMBER(usgames_state::lamps1_w) diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c index b4195254753..41476df94f6 100644 --- a/src/mame/drivers/vamphalf.c +++ b/src/mame/drivers/vamphalf.c @@ -2754,10 +2754,10 @@ DRIVER_INIT_MEMBER(vamphalf_state,yorijori) m_semicom_prot_data[0] = 2; m_semicom_prot_data[1] = 1; -// UINT8 *romx = (UINT8 *)memregion("user1")->base(); +// UINT8 *romx = (UINT8 *)memregion("user1")->base(); // prevent code dying after a trap 33 by patching it out, why? -// romx[BYTE4_XOR_BE(0x8ff0)] = 3; -// romx[BYTE4_XOR_BE(0x8ff1)] = 0; +// romx[BYTE4_XOR_BE(0x8ff0)] = 3; +// romx[BYTE4_XOR_BE(0x8ff1)] = 0; // Configure the QS1000 ROM banking. Care must be taken not to overlap the 256b internal RAM machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "data"); diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c index 2594138895b..ba3ebe5ee0f 100644 --- a/src/mame/drivers/vegas.c +++ b/src/mame/drivers/vegas.c @@ -595,9 +595,9 @@ void vegas_state::machine_start() /* set the fastest DRC options, but strict verification */ m_maincpu->mips3drc_set_options(MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); - /* configure fast RAM regions for DRC */ - m_maincpu->mips3drc_add_fastram(0x00000000, m_rambase.bytes() - 1, FALSE, m_rambase); - m_maincpu->mips3drc_add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); + /* configure fast RAM regions */ + m_maincpu->add_fastram(0x00000000, m_rambase.bytes() - 1, FALSE, m_rambase); + m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); /* register for save states */ save_item(NAME(m_nile_irq_state)); diff --git a/src/mame/drivers/vigilant.c b/src/mame/drivers/vigilant.c index 242d6a2b362..62ea412c426 100644 --- a/src/mame/drivers/vigilant.c +++ b/src/mame/drivers/vigilant.c @@ -24,12 +24,12 @@ Buccaneers has a 5.6888 Mhz and a 18.432 Mhz OSC void vigilant_state::machine_start() { - membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); + membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); } WRITE8_MEMBER(vigilant_state::vigilant_bank_select_w) { - membank("bank1")->set_entry(data & 0x07); + membank("bank1")->set_entry(data & 0x07); } /*************************************************************************** diff --git a/src/mame/drivers/wc90b.c b/src/mame/drivers/wc90b.c index ddac4ad9c7f..e7d9f51ebcd 100644 --- a/src/mame/drivers/wc90b.c +++ b/src/mame/drivers/wc90b.c @@ -325,7 +325,7 @@ void wc90b_state::machine_start() membank("mainbank")->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x800); membank("subbank")->configure_entries(0, 32, memregion("sub")->base() + 0x10000, 0x800); membank("audiobank")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x8000, 0x4000); - + save_item(NAME(m_msm5205next)); save_item(NAME(m_toggle)); } diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c index dbb3a9fb604..b13d6d334f0 100644 --- a/src/mame/drivers/xain.c +++ b/src/mame/drivers/xain.c @@ -555,9 +555,9 @@ void xain_state::machine_start() membank("bank2")->configure_entries(0, 2, memregion("sub")->base() + 0x4000, 0xc000); membank("bank1")->set_entry(0); membank("bank2")->set_entry(0); - + save_item(NAME(m_vblank)); - + if (m_mcu) { save_item(NAME(m_from_main)); diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c index 51f93712eca..6d67b7afa65 100644 --- a/src/mame/drivers/xtheball.c +++ b/src/mame/drivers/xtheball.c @@ -30,21 +30,21 @@ public: required_device<cpu_device> m_maincpu; required_device<tlc34076_device> m_tlc34076; - + required_shared_ptr<UINT16> m_vram_bg; required_shared_ptr<UINT16> m_vram_fg; - + required_ioport m_analog_x; required_ioport m_analog_y; - + UINT8 m_bitvals[32]; - + DECLARE_WRITE16_MEMBER(bit_controls_w); DECLARE_READ16_MEMBER(analogx_r); DECLARE_READ16_MEMBER(analogy_watchdog_r); - + virtual void machine_start(); - + TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg); TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg); TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update); diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c index f47ccbdb383..26ff27e3248 100644 --- a/src/mame/drivers/zn.c +++ b/src/mame/drivers/zn.c @@ -4841,9 +4841,9 @@ GAME( 1999, sfex2p, cpzn2, coh3002c, zn6b, driver_device, 0, ROT0, "Capcom GAME( 1999, sfex2pa, sfex2p, coh3002c, zn6b, driver_device, 0, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Asia 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1999, sfex2ph, sfex2p, coh3002c, zn6b, driver_device, 0, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Hispanic 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1999, sfex2pj, sfex2p, coh3002c, zn6b, driver_device, 0, ROT0, "Capcom / Arika", "Street Fighter EX2 Plus (Japan 990611)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) -GAME( 1999, strider2, cpzn2, coh3002c, zn, driver_device, 0, ROT0, "Capcom", "Strider 2 (USA 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) -GAME( 1999, strider2a, strider2, coh3002c, zn, driver_device, 0, ROT0, "Capcom", "Strider 2 (Asia 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) -GAME( 1999, shiryu2, strider2, coh3002c, zn, driver_device, 0, ROT0, "Capcom", "Strider Hiryu 2 (Japan 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) +GAME( 1999, strider2, cpzn2, coh3002c, zn, driver_device, 0, ROT0, "Capcom", "Strider 2 (USA 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // random hangs / crashes +GAME( 1999, strider2a, strider2, coh3002c, zn, driver_device, 0, ROT0, "Capcom", "Strider 2 (Asia 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1999, shiryu2, strider2, coh3002c, zn, driver_device, 0, ROT0, "Capcom", "Strider Hiryu 2 (Japan 991213)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* Atari */ diff --git a/src/mame/includes/argus.h b/src/mame/includes/argus.h index 35710c2655f..6cf9cf2fd60 100644 --- a/src/mame/includes/argus.h +++ b/src/mame/includes/argus.h @@ -42,12 +42,12 @@ public: UINT8 m_bg_status; UINT8 m_flipscreen; UINT16 m_palette_intensity; - + // argus specific UINT8 *m_dummy_bg0ram; int m_lowbitscroll; int m_prvscrollx; - + // butasan specific UINT8 *m_butasan_txram; UINT8 *m_butasan_bg0ram; @@ -57,17 +57,17 @@ public: UINT8 m_butasan_page_latch; UINT8 m_butasan_bg1_status; UINT8 m_butasan_unknown; - + // valtric specific UINT8 m_valtric_mosaic; bitmap_rgb32 m_mosaicbitmap; UINT8 m_valtric_unknown; int m_mosaic; - + tilemap_t *m_tx_tilemap; tilemap_t *m_bg0_tilemap; tilemap_t *m_bg1_tilemap; - + // common DECLARE_WRITE8_MEMBER(bankselect_w); DECLARE_WRITE8_MEMBER(valtric_mosaic_w); @@ -94,7 +94,7 @@ public: DECLARE_WRITE8_MEMBER(valtric_bg_status_w); DECLARE_WRITE8_MEMBER(valtric_paletteram_w); DECLARE_WRITE8_MEMBER(valtric_unknown_w); - + TILE_GET_INFO_MEMBER(argus_get_tx_tile_info); TILE_GET_INFO_MEMBER(argus_get_bg0_tile_info); TILE_GET_INFO_MEMBER(argus_get_bg1_tile_info); @@ -103,7 +103,7 @@ public: TILE_GET_INFO_MEMBER(butasan_get_tx_tile_info); TILE_GET_INFO_MEMBER(butasan_get_bg0_tile_info); TILE_GET_INFO_MEMBER(butasan_get_bg1_tile_info); - + virtual void machine_start(); DECLARE_VIDEO_START(argus); DECLARE_VIDEO_RESET(argus); @@ -111,28 +111,28 @@ public: DECLARE_VIDEO_RESET(valtric); DECLARE_VIDEO_START(butasan); DECLARE_VIDEO_RESET(butasan); - + UINT32 screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - + TIMER_DEVICE_CALLBACK_MEMBER(scanline); TIMER_DEVICE_CALLBACK_MEMBER(butasan_scanline); - + void reset_common(); void change_palette(int color, int lo_offs, int hi_offs); void change_bg_palette(int color, int lo_offs, int hi_offs); void bg_setting(); - + // argus specific void argus_bg0_scroll_handle(); void argus_write_dummy_rams(int dramoffs, int vromoffs); void argus_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority); - + // butasan specific void butasan_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); void butasan_log_vram(); - + // valtric specific void valtric_draw_mosaic(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void valtric_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/bbusters.h b/src/mame/includes/bbusters.h index 9e7dd060368..abcb8c1c8b8 100644 --- a/src/mame/includes/bbusters.h +++ b/src/mame/includes/bbusters.h @@ -23,7 +23,7 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<buffered_spriteram16_device> m_spriteram; optional_device<buffered_spriteram16_device> m_spriteram2; - + optional_shared_ptr<UINT16> m_eprom_data; required_shared_ptr<UINT16> m_ram; required_shared_ptr<UINT16> m_videoram; @@ -53,15 +53,15 @@ public: DECLARE_WRITE16_MEMBER(video_w); DECLARE_WRITE16_MEMBER(pf1_w); DECLARE_WRITE16_MEMBER(pf2_w); - + TILE_GET_INFO_MEMBER(get_tile_info); TILE_GET_INFO_MEMBER(get_pf1_tile_info); TILE_GET_INFO_MEMBER(get_pf2_tile_info); - + virtual void machine_start(); DECLARE_VIDEO_START(bbuster); DECLARE_VIDEO_START(mechatt); - + UINT32 screen_update_bbuster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_mechatt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_bbuster(screen_device &screen, bool state); diff --git a/src/mame/includes/cabal.h b/src/mame/includes/cabal.h index 6bd2ff2ebcd..244e294f30d 100644 --- a/src/mame/includes/cabal.h +++ b/src/mame/includes/cabal.h @@ -38,7 +38,7 @@ public: int m_sound_command1; int m_sound_command2; int m_last[4]; - + // common DECLARE_WRITE16_MEMBER(flipscreen_w); DECLARE_WRITE16_MEMBER(background_videoram_w); @@ -57,19 +57,19 @@ public: DECLARE_WRITE8_MEMBER(cabalbl_coin_w); DECLARE_WRITE8_MEMBER(cabalbl_1_adpcm_w); DECLARE_WRITE8_MEMBER(cabalbl_2_adpcm_w); - + DECLARE_DRIVER_INIT(cabal); DECLARE_DRIVER_INIT(cabalbl2); DECLARE_MACHINE_START(cabal); DECLARE_MACHINE_START(cabalbl); DECLARE_MACHINE_RESET(cabalbl); virtual void video_start(); - + TILE_GET_INFO_MEMBER(get_back_tile_info); TILE_GET_INFO_MEMBER(get_text_tile_info); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - + void seibu_sound_bootleg(const char *cpu,int length); }; diff --git a/src/mame/includes/capbowl.h b/src/mame/includes/capbowl.h index 99ff693862a..25c51ee4acd 100644 --- a/src/mame/includes/capbowl.h +++ b/src/mame/includes/capbowl.h @@ -37,7 +37,7 @@ public: /* input-related */ UINT8 m_last_trackball_val[2]; - + emu_timer *m_update_timer; // common @@ -47,21 +47,21 @@ public: DECLARE_WRITE8_MEMBER(sndcmd_w); DECLARE_WRITE8_MEMBER(tms34061_w); DECLARE_READ8_MEMBER(tms34061_r); - + // capbowl specific DECLARE_WRITE8_MEMBER(capbowl_rom_select_w); - + // bowlrama specific DECLARE_WRITE8_MEMBER(bowlrama_blitter_w); DECLARE_READ8_MEMBER(bowlrama_blitter_r); - + DECLARE_DRIVER_INIT(capbowl); virtual void machine_start(); virtual void machine_reset(); - + INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(update); - + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); inline rgb_t pen_for_pixel( UINT8 *src, UINT8 pix ); diff --git a/src/mame/includes/fgoal.h b/src/mame/includes/fgoal.h index b6257ba6153..c5076c17558 100644 --- a/src/mame/includes/fgoal.h +++ b/src/mame/includes/fgoal.h @@ -15,7 +15,7 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_video_ram(*this, "video_ram") { } + m_video_ram(*this, "video_ram") { } /* devices */ required_device<cpu_device> m_maincpu; @@ -58,7 +58,7 @@ public: DECLARE_WRITE8_MEMBER(xpos_w); DECLARE_CUSTOM_INPUT_MEMBER(_80_r); - + TIMER_CALLBACK_MEMBER(interrupt_callback); virtual void machine_start(); diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index c8c43c858c9..9ae7d6d034b 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -1,6 +1,7 @@ #include "machine/msm6242.h" #include "cpu/mips/mips3.h" #include "cpu/nec/v53.h" +#include "sound/l7a1045_l6028_dsp_a.h" enum { @@ -125,7 +126,7 @@ public: m_generic_paletteram_32(*this, "paletteram") { } - + required_device<mips3_device> m_maincpu; required_device<v53a_device> m_audiocpu; required_device<cpu_device> m_comm; @@ -362,21 +363,7 @@ public: DECLARE_WRITE_LINE_MEMBER(tcu_tm1_cb); DECLARE_WRITE_LINE_MEMBER(tcu_tm2_cb); - UINT16 m_audiochannel; - - struct hng64_48bit_data { - UINT16 dat[3]; - }; - - hng64_48bit_data m_audiodat[0x10000]; - DECLARE_WRITE16_MEMBER(hng64_sound_select_w); - DECLARE_WRITE16_MEMBER(hng64_sound_data_02_w); - DECLARE_WRITE16_MEMBER(hng64_sound_data_04_w); - DECLARE_WRITE16_MEMBER(hng64_sound_data_06_w); - - DECLARE_READ16_MEMBER(hng64_sound_port_0004_r); - DECLARE_READ16_MEMBER(hng64_sound_port_0006_r); DECLARE_READ16_MEMBER(hng64_sound_port_0008_r); DECLARE_WRITE16_MEMBER(hng64_sound_port_0008_w); @@ -394,5 +381,9 @@ public: DECLARE_WRITE16_MEMBER(hng64_sound_port_010a_w); DECLARE_WRITE16_MEMBER(hng64_sound_bank_w); + DECLARE_READ16_MEMBER(main_sound_comms_r); + DECLARE_WRITE16_MEMBER(main_sound_comms_w); + DECLARE_READ16_MEMBER(sound_comms_r); + DECLARE_WRITE16_MEMBER(sound_comms_w); + UINT16 main_latch[2],sound_latch[2]; }; - diff --git a/src/mame/includes/ironhors.h b/src/mame/includes/ironhors.h index 0218f440fc2..5df3f1f5e66 100644 --- a/src/mame/includes/ironhors.h +++ b/src/mame/includes/ironhors.h @@ -48,21 +48,21 @@ public: DECLARE_WRITE8_MEMBER(flipscreen_w); DECLARE_WRITE8_MEMBER(filter_w); DECLARE_READ8_MEMBER(farwest_soundlatch_r); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(farwest_get_bg_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(ironhors); DECLARE_VIDEO_START(farwest); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - + TIMER_DEVICE_CALLBACK_MEMBER(irq); TIMER_DEVICE_CALLBACK_MEMBER(farwest_irq); }; diff --git a/src/mame/includes/m107.h b/src/mame/includes/m107.h index 5ede569f099..d7262b13b03 100644 --- a/src/mame/includes/m107.h +++ b/src/mame/includes/m107.h @@ -9,7 +9,6 @@ struct pf_layer_info { tilemap_t * tmap; UINT16 vram_base; - UINT16 control[4]; }; class m107_state : public driver_device @@ -17,52 +16,60 @@ class m107_state : public driver_device public: m107_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_vram_data(*this, "vram_data"), m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_spriteram(*this, "spriteram"), + m_vram_data(*this, "vram_data") { } - required_shared_ptr<UINT16> m_spriteram; - required_shared_ptr<UINT16> m_vram_data; required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + required_shared_ptr<UINT16> m_spriteram; + required_shared_ptr<UINT16> m_vram_data; + + // driver init UINT8 m_irq_vectorbase; - int m_sound_status; UINT8 m_spritesystem; + + int m_sound_status; UINT8 m_sprite_display; UINT16 m_raster_irq_position; pf_layer_info m_pf_layer[4]; UINT16 m_control[0x10]; UINT16 *m_buffered_spriteram; - DECLARE_WRITE16_MEMBER(m107_coincounter_w); - DECLARE_WRITE16_MEMBER(m107_bankswitch_w); - DECLARE_WRITE16_MEMBER(m107_soundlatch_w); - DECLARE_READ16_MEMBER(m107_sound_status_r); - DECLARE_READ16_MEMBER(m107_soundlatch_r); - DECLARE_WRITE16_MEMBER(m107_sound_irq_ack_w); - DECLARE_WRITE16_MEMBER(m107_sound_status_w); - DECLARE_WRITE16_MEMBER(m107_sound_reset_w); + + DECLARE_WRITE16_MEMBER(coincounter_w); + DECLARE_WRITE16_MEMBER(bankswitch_w); + DECLARE_WRITE16_MEMBER(soundlatch_w); + DECLARE_READ16_MEMBER(sound_status_r); + DECLARE_READ16_MEMBER(soundlatch_r); + DECLARE_WRITE16_MEMBER(sound_irq_ack_w); + DECLARE_WRITE16_MEMBER(sound_status_w); + DECLARE_WRITE16_MEMBER(sound_reset_w); DECLARE_WRITE16_MEMBER(wpksoc_output_w); - DECLARE_WRITE16_MEMBER(m107_vram_w); - DECLARE_WRITE16_MEMBER(m107_control_w); - DECLARE_WRITE16_MEMBER(m107_spritebuffer_w); + DECLARE_WRITE16_MEMBER(vram_w); + DECLARE_WRITE16_MEMBER(control_w); + DECLARE_WRITE16_MEMBER(spritebuffer_w); + + TILE_GET_INFO_MEMBER(get_pf_tile_info); + + TIMER_DEVICE_CALLBACK_MEMBER(scanline_interrupt); + DECLARE_DRIVER_INIT(firebarr); DECLARE_DRIVER_INIT(dsoccr94); DECLARE_DRIVER_INIT(wpksoc); - TILE_GET_INFO_MEMBER(get_pf_tile_info); virtual void machine_start(); virtual void video_start(); - UINT32 screen_update_m107(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(m107_scanline_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void m107_update_scroll_positions(); - void m107_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int laynum, int category,int opaque); - void m107_screenrefresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void update_scroll_positions(); + void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int laynum, int category,int opaque); + void screenrefresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h index 2739ce96592..fc6c6cfdfc3 100644 --- a/src/mame/includes/m72.h +++ b/src/mame/includes/m72.h @@ -11,12 +11,6 @@ class m72_state : public driver_device public: m72_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_videoram1(*this, "videoram1"), - m_videoram2(*this, "videoram2"), - m_majtitle_rowscrollram(*this, "majtitle_rowscr"), - m_spriteram2(*this, "spriteram2"), - m_soundram(*this, "soundram"), m_maincpu(*this, "maincpu"), m_soundcpu(*this, "soundcpu"), m_mcu(*this, "mcu"), @@ -25,16 +19,15 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), + m_spriteram(*this, "spriteram"), + m_videoram1(*this, "videoram1"), + m_videoram2(*this, "videoram2"), + m_majtitle_rowscrollram(*this, "majtitle_rowscr"), + m_spriteram2(*this, "spriteram2"), + m_soundram(*this, "soundram"), m_generic_paletteram_16(*this, "paletteram"), m_generic_paletteram2_16(*this, "paletteram2") { } - required_shared_ptr<UINT16> m_spriteram; - required_shared_ptr<UINT16> m_videoram1; - required_shared_ptr<UINT16> m_videoram2; - optional_shared_ptr<UINT16> m_majtitle_rowscrollram; - optional_shared_ptr<UINT16> m_spriteram2; - optional_shared_ptr<UINT8> m_soundram; - required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; optional_device<cpu_device> m_mcu; @@ -43,19 +36,21 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + + required_shared_ptr<UINT16> m_spriteram; + required_shared_ptr<UINT16> m_videoram1; + required_shared_ptr<UINT16> m_videoram2; + optional_shared_ptr<UINT16> m_majtitle_rowscrollram; + optional_shared_ptr<UINT16> m_spriteram2; + optional_shared_ptr<UINT8> m_soundram; required_shared_ptr<UINT16> m_generic_paletteram_16; required_shared_ptr<UINT16> m_generic_paletteram2_16; UINT16 *m_protection_ram; emu_timer *m_scanline_timer; UINT8 m_irq_base; - UINT8 m_mcu_snd_cmd_latch; - UINT8 m_mcu_sample_latch; - UINT32 m_mcu_sample_addr; const UINT8 *m_protection_code; const UINT8 *m_protection_crc; - int m_prev[4]; - int m_diff[4]; UINT32 m_raster_irq_position; UINT16 *m_buffered_spriteram; tilemap_t *m_fg_tilemap; @@ -65,19 +60,53 @@ public: INT32 m_scrollx2; INT32 m_scrolly2; INT32 m_video_off; + + //poundfor specific + int m_prev[4]; + int m_diff[4]; + + // majtitle specific int m_majtitle_rowscroll; - DECLARE_WRITE16_MEMBER(m72_main_mcu_sound_w); - DECLARE_WRITE16_MEMBER(m72_main_mcu_w); - DECLARE_WRITE8_MEMBER(m72_mcu_data_w); - DECLARE_READ8_MEMBER(m72_mcu_data_r); - DECLARE_READ8_MEMBER(m72_mcu_sample_r); - DECLARE_WRITE8_MEMBER(m72_mcu_ack_w); - DECLARE_READ8_MEMBER(m72_mcu_snd_r); - DECLARE_READ8_MEMBER(m72_mcu_port_r); - DECLARE_WRITE8_MEMBER(m72_mcu_port_w); - DECLARE_WRITE8_MEMBER(m72_mcu_low_w); - DECLARE_WRITE8_MEMBER(m72_mcu_high_w); - DECLARE_READ8_MEMBER(m72_snd_cpu_sample_r); + + // m72_i8751 specific + UINT8 m_mcu_snd_cmd_latch; + UINT8 m_mcu_sample_latch; + UINT32 m_mcu_sample_addr; + + // common + DECLARE_READ16_MEMBER(palette1_r); + DECLARE_READ16_MEMBER(palette2_r); + DECLARE_WRITE16_MEMBER(palette1_w); + DECLARE_WRITE16_MEMBER(palette2_w); + DECLARE_WRITE16_MEMBER(videoram1_w); + DECLARE_WRITE16_MEMBER(videoram2_w); + DECLARE_READ16_MEMBER(soundram_r); + DECLARE_WRITE16_MEMBER(soundram_w); + + // m72_i8751 specific + DECLARE_WRITE16_MEMBER(main_mcu_sound_w); + DECLARE_WRITE16_MEMBER(main_mcu_w); + DECLARE_WRITE8_MEMBER(mcu_data_w); + DECLARE_READ8_MEMBER(mcu_data_r); + DECLARE_READ8_MEMBER(mcu_sample_r); + DECLARE_WRITE8_MEMBER(mcu_ack_w); + DECLARE_READ8_MEMBER(mcu_snd_r); + DECLARE_READ8_MEMBER(mcu_port_r); + DECLARE_WRITE8_MEMBER(mcu_port_w); + DECLARE_WRITE8_MEMBER(mcu_low_w); + DECLARE_WRITE8_MEMBER(mcu_high_w); + DECLARE_READ8_MEMBER(snd_cpu_sample_r); + DECLARE_WRITE16_MEMBER(irq_line_w); + DECLARE_WRITE16_MEMBER(scrollx1_w); + DECLARE_WRITE16_MEMBER(scrollx2_w); + DECLARE_WRITE16_MEMBER(scrolly1_w); + DECLARE_WRITE16_MEMBER(scrolly2_w); + DECLARE_WRITE16_MEMBER(dmaon_w); + DECLARE_WRITE16_MEMBER(port02_w); + DECLARE_READ16_MEMBER(protection_r); + DECLARE_WRITE16_MEMBER(protection_w); + + // game specific DECLARE_WRITE16_MEMBER(bchopper_sample_trigger_w); DECLARE_WRITE16_MEMBER(nspirit_sample_trigger_w); DECLARE_WRITE16_MEMBER(imgfight_sample_trigger_w); @@ -86,42 +115,17 @@ public: DECLARE_WRITE16_MEMBER(airduel_sample_trigger_w); DECLARE_WRITE16_MEMBER(dkgenm72_sample_trigger_w); DECLARE_WRITE16_MEMBER(gallop_sample_trigger_w); - DECLARE_READ16_MEMBER(protection_r); - DECLARE_WRITE16_MEMBER(protection_w); - DECLARE_READ16_MEMBER(soundram_r); - DECLARE_WRITE16_MEMBER(soundram_w); DECLARE_READ16_MEMBER(poundfor_trackball_r); - DECLARE_READ16_MEMBER(m72_palette1_r); - DECLARE_READ16_MEMBER(m72_palette2_r); - DECLARE_WRITE16_MEMBER(m72_palette1_w); - DECLARE_WRITE16_MEMBER(m72_palette2_w); - DECLARE_WRITE16_MEMBER(m72_videoram1_w); - DECLARE_WRITE16_MEMBER(m72_videoram2_w); - DECLARE_WRITE16_MEMBER(m72_irq_line_w); - DECLARE_WRITE16_MEMBER(m72_scrollx1_w); - DECLARE_WRITE16_MEMBER(m72_scrollx2_w); - DECLARE_WRITE16_MEMBER(m72_scrolly1_w); - DECLARE_WRITE16_MEMBER(m72_scrolly2_w); - DECLARE_WRITE16_MEMBER(m72_dmaon_w); - DECLARE_WRITE16_MEMBER(m72_port02_w); DECLARE_WRITE16_MEMBER(rtype2_port02_w); DECLARE_WRITE16_MEMBER(majtitle_gfx_ctrl_w); - DECLARE_WRITE8_MEMBER(m72_snd_cpu_sample_w); - DECLARE_DRIVER_INIT(dkgenm72); - DECLARE_DRIVER_INIT(bchopper); - DECLARE_DRIVER_INIT(gallop); - DECLARE_DRIVER_INIT(m72_8751); - DECLARE_DRIVER_INIT(dbreedm72); - DECLARE_DRIVER_INIT(airduel); - DECLARE_DRIVER_INIT(nspirit); - DECLARE_DRIVER_INIT(loht); - DECLARE_DRIVER_INIT(imgfight); - TILE_GET_INFO_MEMBER(m72_get_bg_tile_info); - TILE_GET_INFO_MEMBER(m72_get_fg_tile_info); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(hharry_get_bg_tile_info); TILE_GET_INFO_MEMBER(rtype2_get_bg_tile_info); TILE_GET_INFO_MEMBER(rtype2_get_fg_tile_info); TILEMAP_MAPPER_MEMBER(majtitle_scan_rows); + void machine_start(); void machine_reset(); DECLARE_VIDEO_START(m72); @@ -134,19 +138,31 @@ public: DECLARE_VIDEO_START(poundfor); DECLARE_MACHINE_START(kengo); DECLARE_MACHINE_RESET(kengo); - UINT32 screen_update_m72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_majtitle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(m72_mcu_int); + DECLARE_DRIVER_INIT(dkgenm72); + DECLARE_DRIVER_INIT(bchopper); + DECLARE_DRIVER_INIT(gallop); + DECLARE_DRIVER_INIT(m72_8751); + DECLARE_DRIVER_INIT(dbreedm72); + DECLARE_DRIVER_INIT(airduel); + DECLARE_DRIVER_INIT(nspirit); + DECLARE_DRIVER_INIT(loht); + DECLARE_DRIVER_INIT(imgfight); + + INTERRUPT_GEN_MEMBER(mcu_int); INTERRUPT_GEN_MEMBER(fake_nmi); TIMER_CALLBACK_MEMBER(synch_callback); - TIMER_CALLBACK_MEMBER(m72_scanline_interrupt); + TIMER_CALLBACK_MEMBER(scanline_interrupt); TIMER_CALLBACK_MEMBER(kengo_scanline_interrupt); TIMER_CALLBACK_MEMBER(delayed_ram16_w); - inline void m72_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum); + + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_majtitle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline void get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum); inline void rtype2_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum); void register_savestate(); inline void changecolor(int color,int r,int g,int b); - void m72_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); int find_sample(int num); void copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes); diff --git a/src/mame/includes/mainsnk.h b/src/mame/includes/mainsnk.h index 40cffa04322..18628239539 100644 --- a/src/mame/includes/mainsnk.h +++ b/src/mame/includes/mainsnk.h @@ -3,38 +3,44 @@ class mainsnk_state : public driver_device public: mainsnk_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_bgram(*this, "bgram"), - m_spriteram(*this, "spriteram"), - m_fgram(*this, "fgram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_bgram(*this, "bgram"), + m_spriteram(*this, "spriteram"), + m_fgram(*this, "fgram") { } + + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; - tilemap_t *m_tx_tilemap; - tilemap_t *m_bg_tilemap; required_shared_ptr<UINT8> m_bgram; required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_fgram; + tilemap_t *m_tx_tilemap; + tilemap_t *m_bg_tilemap; int m_sound_cpu_busy; UINT32 m_bg_tile_offset; + DECLARE_WRITE8_MEMBER(sound_command_w); - DECLARE_READ8_MEMBER(sound_command_r); DECLARE_READ8_MEMBER(sound_ack_r); - DECLARE_WRITE8_MEMBER(mainsnk_c600_w); - DECLARE_WRITE8_MEMBER(mainsnk_fgram_w); - DECLARE_WRITE8_MEMBER(mainsnk_bgram_w); - DECLARE_CUSTOM_INPUT_MEMBER(mainsnk_sound_r); + DECLARE_WRITE8_MEMBER(c600_w); + DECLARE_WRITE8_MEMBER(fgram_w); + DECLARE_WRITE8_MEMBER(bgram_w); + + DECLARE_CUSTOM_INPUT_MEMBER(sound_r); + TILEMAP_MAPPER_MEMBER(marvins_tx_scan_cols); TILE_GET_INFO_MEMBER(get_tx_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); + + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(mainsnk); - UINT32 screen_update_mainsnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int scrollx, int scrolly ); - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/mame/includes/mosaic.h b/src/mame/includes/mosaic.h index 75c90a19f0b..c28bda1a7ca 100644 --- a/src/mame/includes/mosaic.h +++ b/src/mame/includes/mosaic.h @@ -17,7 +17,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<gfxdecode_device> m_gfxdecode; - + /* memory pointers */ required_shared_ptr<UINT8> m_fgvideoram; required_shared_ptr<UINT8> m_bgvideoram; @@ -28,20 +28,20 @@ public: /* misc */ int m_prot_val; - + DECLARE_WRITE8_MEMBER(protection_w); DECLARE_READ8_MEMBER(protection_r); DECLARE_WRITE8_MEMBER(gfire2_protection_w); DECLARE_READ8_MEMBER(gfire2_protection_r); DECLARE_WRITE8_MEMBER(fgvideoram_w); DECLARE_WRITE8_MEMBER(bgvideoram_w); - + TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h index e6102b3a5ba..fed6fe4fef9 100644 --- a/src/mame/includes/n64.h +++ b/src/mame/includes/n64.h @@ -120,6 +120,8 @@ public: UINT32 cart_length; bool dd_present; + bool disk_present; + bool cart_present; void poll_reset_button(bool button); @@ -186,9 +188,14 @@ private: UINT32 sp_semaphore; // Disk Drive (DD) registers and functions + void dd_set_zone_and_track_offset(); + void dd_update_bm(); + void dd_write_sector(); + void dd_read_sector(); + void dd_read_C2(); UINT32 dd_buffer[256]; - UINT32 dd_sector_data[32]; // ? - UINT32 dd_ram_seq_data[32]; // ? + UINT32 dd_sector_data[64]; + UINT32 dd_ram_seq_data[16]; UINT32 dd_data_reg; UINT32 dd_status_reg; UINT32 dd_track_reg; @@ -196,7 +203,18 @@ private: UINT32 dd_sector_err_reg; UINT32 dd_seq_status_reg; UINT32 dd_seq_ctrl_reg; + UINT32 dd_sector_reg; + UINT32 dd_reset_reg; + UINT32 dd_current_reg; + bool dd_bm_reset_held; + bool dd_write; UINT8 dd_int; + UINT8 dd_start_block; + UINT8 dd_start_sector; + UINT8 dd_sectors_per_block; + UINT8 dd_sector_size; + UINT8 dd_zone; + UINT32 dd_track_offset; // Peripheral Interface (PI) registers and functions void pi_dma(); @@ -275,6 +293,65 @@ extern const device_type N64PERIPH; #define DP_STATUS_FREEZE 0x02 #define DP_STATUS_FLUSH 0x04 +#define DD_ASIC_STATUS_DISK_CHANGE 0x00010000 +#define DD_ASIC_STATUS_MECHA_ERR 0x00020000 +#define DD_ASIC_STATUS_WRPROTECT_ERR 0x00040000 +#define DD_ASIC_STATUS_HEAD_RETRACT 0x00080000 +#define DD_ASIC_STATUS_MOTOR_OFF 0x00100000 +#define DD_ASIC_STATUS_RESET 0x00400000 +#define DD_ASIC_STATUS_BUSY 0x00800000 +#define DD_ASIC_STATUS_DISK 0x01000000 +#define DD_ASIC_STATUS_MECHA_INT 0x02000000 +#define DD_ASIC_STATUS_BM_INT 0x04000000 +#define DD_ASIC_STATUS_BM_ERROR 0x08000000 +#define DD_ASIC_STATUS_C2_XFER 0x10000000 +#define DD_ASIC_STATUS_DREQ 0x40000000 + +#define DD_TRACK_INDEX_LOCK 0x60000000 + +#define DD_BM_MECHA_INT_RESET 0x01000000 +#define DD_BM_XFERBLOCKS 0x02000000 +#define DD_BM_DISABLE_C1 0x04000000 +#define DD_BM_DISABLE_OR_CHK 0x08000000 +#define DD_BM_RESET 0x10000000 +#define DD_BM_INT_MASK 0x20000000 +#define DD_BM_MODE 0x40000000 +#define DD_BM_START 0x80000000 + +#define DD_BMST_RUNNING 0x80000000 +#define DD_BMST_ERROR 0x04000000 +#define DD_BMST_MICRO_STATUS 0x02000000 +#define DD_BMST_BLOCKS 0x01000000 +#define DD_BMST_C1_CORRECT 0x00800000 +#define DD_BMST_C1_DOUBLE 0x00400000 +#define DD_BMST_C1_SINGLE 0x00200000 +#define DD_BMST_C1_ERROR 0x00010000 + +#define DD_ASIC_ERR_AM_FAIL 0x80000000 +#define DD_ASIC_ERR_MICRO_FAIL 0x40000000 +#define DD_ASIC_ERR_SPINDLE_FAIL 0x20000000 +#define DD_ASIC_ERR_OVER_RUN 0x10000000 +#define DD_ASIC_ERR_OFFTRACK 0x08000000 +#define DD_ASIC_ERR_NO_DISK 0x04000000 +#define DD_ASIC_ERR_CLOCK_UNLOCK 0x02000000 +#define DD_ASIC_ERR_SELF_STOP 0x01000000 + +#define DD_SEQ_MICRO_INT_MASK 0x80000000 +#define DD_SEQ_MICRO_PC_ENABLE 0x40000000 + +#define SECTORS_PER_BLOCK 85 +#define BLOCKS_PER_TRACK 2 + +const unsigned int ddZoneSecSize[16] = {232,216,208,192,176,160,144,128, + 216,208,192,176,160,144,128,112}; +const unsigned int ddZoneTrackSize[16] = {158,158,149,149,149,149,149,114, + 158,158,149,149,149,149,149,114}; +const unsigned int ddStartOffset[16] = + {0x0,0x5F15E0,0xB79D00,0x10801A0,0x1523720,0x1963D80,0x1D414C0,0x20BBCE0, + 0x23196E0,0x28A1E00,0x2DF5DC0,0x3299340,0x36D99A0,0x3AB70E0,0x3E31900,0x4149200}; + + + extern UINT32 *n64_sram; extern UINT32 *rdram; extern UINT32 *rsp_imem; diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h index ab7c9cab80b..467f269dd8d 100644 --- a/src/mame/includes/niyanpai.h +++ b/src/mame/includes/niyanpai.h @@ -19,9 +19,14 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - int m_musobana_inputport; - int m_musobana_outcoin_flag; + required_device<cpu_device> m_maincpu; + required_device<tmp68301_device> m_tmp68301; + required_device<dac_device> m_dac1; + required_device<dac_device> m_dac2; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + // common int m_scrollx[VRAM_MAX]; int m_scrolly[VRAM_MAX]; int m_blitter_destx[VRAM_MAX]; @@ -45,55 +50,53 @@ public: UINT16 *m_palette_ptr; UINT8 *m_clut[VRAM_MAX]; int m_flipscreen_old[VRAM_MAX]; - DECLARE_READ8_MEMBER(niyanpai_sound_r); - DECLARE_WRITE16_MEMBER(niyanpai_sound_w); - DECLARE_WRITE8_MEMBER(niyanpai_soundclr_w); - - DECLARE_READ8_MEMBER(cpu_portd_r); - DECLARE_WRITE8_MEMBER(cpu_porta_w); - DECLARE_WRITE8_MEMBER(cpu_portb_w); - DECLARE_WRITE8_MEMBER(cpu_portc_w); - DECLARE_WRITE8_MEMBER(cpu_porte_w); - - DECLARE_READ16_MEMBER(niyanpai_dipsw_r); + emu_timer *m_blitter_timer; + + // musobana and derived machine configs + int m_musobana_inputport; + int m_musobana_outcoin_flag; + UINT8 m_motor_on; + + // common + DECLARE_WRITE8_MEMBER(soundbank_w); + DECLARE_WRITE8_MEMBER(soundlatch_clear_w); + DECLARE_READ16_MEMBER(dipsw_r); + DECLARE_READ16_MEMBER(palette_r); + DECLARE_WRITE16_MEMBER(palette_w); + DECLARE_WRITE8_MEMBER(blitter_0_w); + DECLARE_WRITE8_MEMBER(blitter_1_w); + DECLARE_WRITE8_MEMBER(blitter_2_w); + DECLARE_READ8_MEMBER(blitter_0_r); + DECLARE_READ8_MEMBER(blitter_1_r); + DECLARE_READ8_MEMBER(blitter_2_r); + DECLARE_WRITE8_MEMBER(clut_0_w); + DECLARE_WRITE8_MEMBER(clut_1_w); + DECLARE_WRITE8_MEMBER(clut_2_w); + DECLARE_WRITE8_MEMBER(clutsel_0_w); + DECLARE_WRITE8_MEMBER(clutsel_1_w); + DECLARE_WRITE8_MEMBER(clutsel_2_w); + DECLARE_WRITE16_MEMBER(tmp68301_parallel_port_w); + + // musobana and derived machine configs DECLARE_READ16_MEMBER(musobana_inputport_0_r); DECLARE_WRITE16_MEMBER(musobana_inputport_w); - DECLARE_READ16_MEMBER(niyanpai_palette_r); - DECLARE_WRITE16_MEMBER(niyanpai_palette_w); - DECLARE_WRITE8_MEMBER(niyanpai_blitter_0_w); - DECLARE_WRITE8_MEMBER(niyanpai_blitter_1_w); - DECLARE_WRITE8_MEMBER(niyanpai_blitter_2_w); - DECLARE_READ8_MEMBER(niyanpai_blitter_0_r); - DECLARE_READ8_MEMBER(niyanpai_blitter_1_r); - DECLARE_READ8_MEMBER(niyanpai_blitter_2_r); - DECLARE_WRITE8_MEMBER(niyanpai_clut_0_w); - DECLARE_WRITE8_MEMBER(niyanpai_clut_1_w); - DECLARE_WRITE8_MEMBER(niyanpai_clut_2_w); - DECLARE_WRITE8_MEMBER(niyanpai_clutsel_0_w); - DECLARE_WRITE8_MEMBER(niyanpai_clutsel_1_w); - DECLARE_WRITE8_MEMBER(niyanpai_clutsel_2_w); + DECLARE_CUSTOM_INPUT_MEMBER(musobana_outcoin_flag_r); + DECLARE_DRIVER_INIT(niyanpai); - DECLARE_WRITE16_MEMBER(tmp68301_parallel_port_w); - UINT8 m_motor_on; - virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update_niyanpai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(niyanpai_interrupt); - int niyanpai_blitter_r(int vram, int offset); - void niyanpai_blitter_w(int vram, int offset, UINT8 data); - void niyanpai_clutsel_w(int vram, UINT8 data); - void niyanpai_clut_w(int vram, int offset, UINT8 data); - void niyanpai_vramflip(int vram); + DECLARE_MACHINE_START(musobana); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + int blitter_r(int vram, int offset); + void blitter_w(int vram, int offset, UINT8 data); + void clutsel_w(int vram, UINT8 data); + void clut_w(int vram, int offset, UINT8 data); + void vramflip(int vram); void update_pixel(int vram, int x, int y); - void niyanpai_gfxdraw(int vram); - void niyanpai_soundbank_w(int data); - required_device<cpu_device> m_maincpu; - required_device<tmp68301_device> m_tmp68301; - required_device<dac_device> m_dac1; - required_device<dac_device> m_dac2; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; + void gfxdraw(int vram); + + INTERRUPT_GEN_MEMBER(interrupt); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); diff --git a/src/mame/includes/paradise.h b/src/mame/includes/paradise.h index a9e572def9f..af4dbc285df 100644 --- a/src/mame/includes/paradise.h +++ b/src/mame/includes/paradise.h @@ -54,10 +54,10 @@ public: DECLARE_WRITE8_MEMBER(vram_2_w); DECLARE_WRITE8_MEMBER(pixmap_w); DECLARE_WRITE8_MEMBER(priority_w); - + // paradise specific DECLARE_WRITE8_MEMBER(paradise_okibank_w); - + // torus specific DECLARE_WRITE8_MEMBER(torus_coin_counter_w); diff --git a/src/mame/includes/pooyan.h b/src/mame/includes/pooyan.h index cbf490442a6..08ed9f48d3e 100644 --- a/src/mame/includes/pooyan.h +++ b/src/mame/includes/pooyan.h @@ -32,16 +32,16 @@ public: DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(colorram_w); DECLARE_WRITE8_MEMBER(flipscreen_w); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(pooyan); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - + INTERRUPT_GEN_MEMBER(interrupt); }; diff --git a/src/mame/includes/portrait.h b/src/mame/includes/portrait.h index a348552c30a..71ed30034e8 100644 --- a/src/mame/includes/portrait.h +++ b/src/mame/includes/portrait.h @@ -5,34 +5,40 @@ class portrait_state : public driver_device public: portrait_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_tms(*this, "tms"), m_bgvideoram(*this, "bgvideoram"), m_fgvideoram(*this, "fgvideoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_spriteram(*this, "spriteram") { } + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; required_device<tms5200_device> m_tms; + required_shared_ptr<UINT8> m_bgvideoram; required_shared_ptr<UINT8> m_fgvideoram; + required_shared_ptr<UINT8> m_spriteram; + int m_scroll; tilemap_t *m_foreground; tilemap_t *m_background; - required_shared_ptr<UINT8> m_spriteram; - DECLARE_WRITE8_MEMBER(portrait_ctrl_w); - DECLARE_WRITE8_MEMBER(portrait_positive_scroll_w); - DECLARE_WRITE8_MEMBER(portrait_negative_scroll_w); - DECLARE_WRITE8_MEMBER(portrait_bgvideo_write); - DECLARE_WRITE8_MEMBER(portrait_fgvideo_write); + + DECLARE_WRITE8_MEMBER(ctrl_w); + DECLARE_WRITE8_MEMBER(positive_scroll_w); + DECLARE_WRITE8_MEMBER(negative_scroll_w); + DECLARE_WRITE8_MEMBER(bgvideo_write); + DECLARE_WRITE8_MEMBER(fgvideo_write); + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); + virtual void video_start(); DECLARE_PALETTE_INIT(portrait); - UINT32 screen_update_portrait(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline void get_tile_info( tile_data &tileinfo, int tile_index, const UINT8 *source ); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; }; diff --git a/src/mame/includes/powerins.h b/src/mame/includes/powerins.h index 0b2cc17ee9c..e2b31c917a0 100644 --- a/src/mame/includes/powerins.h +++ b/src/mame/includes/powerins.h @@ -6,45 +6,44 @@ public: powerins_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), m_vctrl_0(*this, "vctrl_0"), m_vram_0(*this, "vram_0"), m_vram_1(*this, "vram_1"), - m_spriteram(*this, "spriteram"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette") - { } + m_spriteram(*this, "spriteram") { } required_device<cpu_device> m_maincpu; - optional_device<cpu_device> m_soundcpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + required_shared_ptr<UINT16> m_vctrl_0; required_shared_ptr<UINT16> m_vram_0; required_shared_ptr<UINT16> m_vram_1; required_shared_ptr<UINT16> m_spriteram; - required_device<gfxdecode_device> m_gfxdecode; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; - UINT16 *m_vctrl_1; tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; - int m_oki_bank; int m_tile_bank; - DECLARE_WRITE16_MEMBER(powerins_okibank_w); - DECLARE_WRITE16_MEMBER(powerins_soundlatch_w); - DECLARE_READ8_MEMBER(powerinb_fake_ym2203_r); - DECLARE_WRITE16_MEMBER(powerins_flipscreen_w); - DECLARE_WRITE16_MEMBER(powerins_tilebank_w); - DECLARE_WRITE16_MEMBER(powerins_vram_0_w); - DECLARE_WRITE16_MEMBER(powerins_vram_1_w); + + DECLARE_WRITE8_MEMBER(powerinsa_okibank_w); + DECLARE_WRITE8_MEMBER(flipscreen_w); + DECLARE_WRITE8_MEMBER(tilebank_w); + DECLARE_WRITE16_MEMBER(vram_0_w); + DECLARE_WRITE16_MEMBER(vram_1_w); + DECLARE_READ8_MEMBER(powerinsb_fake_ym2203_r); + + DECLARE_MACHINE_START(powerinsa); + TILE_GET_INFO_MEMBER(get_tile_info_0); - TILEMAP_MAPPER_MEMBER(powerins_get_memory_offset_0); TILE_GET_INFO_MEMBER(get_tile_info_1); - virtual void machine_reset(); + TILEMAP_MAPPER_MEMBER(get_memory_offset_0); + virtual void video_start(); - UINT32 screen_update_powerins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(irqhandler); }; diff --git a/src/mame/includes/psychic5.h b/src/mame/includes/psychic5.h index b422db24962..d3d8e9dc320 100644 --- a/src/mame/includes/psychic5.h +++ b/src/mame/includes/psychic5.h @@ -21,14 +21,14 @@ public: m_ps5_palette_ram_tx(*this, "palette_ram_tx") { } - + required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; optional_device<address_map_bank_device> m_vrambank; optional_device<jaleco_blend_device> m_blend; - + required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_fg_videoram; required_shared_ptr<UINT8> m_bg_videoram; @@ -78,7 +78,7 @@ public: DECLARE_VIDEO_START(psychic5); DECLARE_VIDEO_START(bombsa); DECLARE_VIDEO_RESET(psychic5); - + TIMER_DEVICE_CALLBACK_MEMBER(scanline); UINT32 screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/realbrk.h b/src/mame/includes/realbrk.h index 4adbdbfe9d0..dca2c50ba7e 100644 --- a/src/mame/includes/realbrk.h +++ b/src/mame/includes/realbrk.h @@ -71,6 +71,6 @@ public: UINT32 screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer); - + INTERRUPT_GEN_MEMBER(interrupt); }; diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h index fb02b1a41b5..fa8fa4c117d 100644 --- a/src/mame/includes/rltennis.h +++ b/src/mame/includes/rltennis.h @@ -18,7 +18,7 @@ public: required_device<cpu_device> m_maincpu; required_device<dac_device> m_dac_1; required_device<dac_device> m_dac_2; - + UINT16 m_blitter[RLT_NUM_BLITTER_REGS]; INT32 m_data760000; INT32 m_data740000; @@ -41,7 +41,7 @@ public: virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(interrupt); diff --git a/src/mame/includes/route16.h b/src/mame/includes/route16.h index 61543fd3d6d..cf736855753 100644 --- a/src/mame/includes/route16.h +++ b/src/mame/includes/route16.h @@ -11,27 +11,33 @@ public: m_videoram2(*this, "videoram2"){ } optional_device<sn76477_device> m_sn; + required_shared_ptr<UINT8> m_sharedram; - UINT8 m_ttmahjng_port_select; - int m_speakres_vrx; required_shared_ptr<UINT8> m_videoram1; required_shared_ptr<UINT8> m_videoram2; + + UINT8 m_ttmahjng_port_select; + int m_speakres_vrx; UINT8 m_flipscreen; UINT8 m_palette_1; UINT8 m_palette_2; - DECLARE_READ8_MEMBER(sharedram_r); - DECLARE_WRITE8_MEMBER(sharedram_w); + + DECLARE_WRITE8_MEMBER(out0_w); + DECLARE_WRITE8_MEMBER(out1_w); DECLARE_WRITE8_MEMBER(route16_sharedram_w); + DECLARE_READ8_MEMBER(routex_prot_read); DECLARE_WRITE8_MEMBER(ttmahjng_input_port_matrix_w); DECLARE_READ8_MEMBER(ttmahjng_input_port_matrix_r); DECLARE_READ8_MEMBER(speakres_in3_r); DECLARE_WRITE8_MEMBER(speakres_out2_w); - DECLARE_READ8_MEMBER(routex_prot_read); - DECLARE_WRITE8_MEMBER(route16_out0_w); - DECLARE_WRITE8_MEMBER(route16_out1_w); DECLARE_WRITE8_MEMBER(stratvox_sn76477_w); + DECLARE_DRIVER_INIT(route16); DECLARE_DRIVER_INIT(route16a); + DECLARE_MACHINE_START(speakres); + DECLARE_MACHINE_START(ttmahjng); + virtual void video_start(); + UINT32 screen_update_route16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_stratvox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h index 31c86630548..383f9c1b3d8 100644 --- a/src/mame/includes/seta2.h +++ b/src/mame/includes/seta2.h @@ -28,7 +28,7 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; - + optional_shared_ptr<UINT16> m_nvram; optional_shared_ptr<UINT16> m_spriteram; optional_shared_ptr<UINT16> m_vregs; @@ -39,7 +39,7 @@ public: int m_yoffset; int m_keyboard_row; UINT16 *m_buffered_spriteram; - + UINT64 m_funcube_coin_start_cycles; UINT8 m_funcube_hopper_motor; diff --git a/src/mame/includes/shuuz.h b/src/mame/includes/shuuz.h index 715bf59a6ef..45828b0f9e5 100644 --- a/src/mame/includes/shuuz.h +++ b/src/mame/includes/shuuz.h @@ -19,17 +19,17 @@ public: required_device<atari_vad_device> m_vad; int m_cur[2]; - + virtual void update_interrupts(); - + DECLARE_WRITE16_MEMBER(latch_w); DECLARE_READ16_MEMBER(leta_r); DECLARE_READ16_MEMBER(special_port0_r); - + virtual void machine_start(); - + TILE_GET_INFO_MEMBER(get_playfield_tile_info); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; diff --git a/src/mame/includes/sidearms.h b/src/mame/includes/sidearms.h index a46d6259c4e..fc42ebaef5d 100644 --- a/src/mame/includes/sidearms.h +++ b/src/mame/includes/sidearms.h @@ -54,9 +54,9 @@ public: DECLARE_WRITE8_MEMBER(gfxctrl_w); DECLARE_WRITE8_MEMBER(star_scrollx_w); DECLARE_WRITE8_MEMBER(star_scrolly_w); - + DECLARE_READ8_MEMBER(turtship_ports_r); - + DECLARE_WRITE8_MEMBER(whizz_bankswitch_w); DECLARE_DRIVER_INIT(dyger); @@ -64,7 +64,7 @@ public: DECLARE_DRIVER_INIT(whizz); DECLARE_DRIVER_INIT(turtship); virtual void machine_start(); - virtual void video_start(); + virtual void video_start(); TILE_GET_INFO_MEMBER(get_sidearms_bg_tile_info); TILE_GET_INFO_MEMBER(get_philko_bg_tile_info); diff --git a/src/mame/includes/simple_st0016.h b/src/mame/includes/simple_st0016.h index b78fdbb0fa8..9be37168154 100644 --- a/src/mame/includes/simple_st0016.h +++ b/src/mame/includes/simple_st0016.h @@ -12,7 +12,7 @@ public: { } int mux_port; - // UINT32 m_st0016_rom_bank; + // UINT32 m_st0016_rom_bank; optional_device<st0016_cpu_device> m_maincpu; DECLARE_READ8_MEMBER(mux_r); @@ -27,7 +27,7 @@ public: DECLARE_DRIVER_INIT(mayjinsn); DECLARE_DRIVER_INIT(mayjisn2); DECLARE_DRIVER_INIT(renju); - virtual void machine_start(); + virtual void machine_start(); DECLARE_VIDEO_START(st0016); void st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/speedbal.h b/src/mame/includes/speedbal.h index 040335c94be..a6b2f397e66 100644 --- a/src/mame/includes/speedbal.h +++ b/src/mame/includes/speedbal.h @@ -39,7 +39,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_bg); TILE_GET_INFO_MEMBER(get_tile_info_fg); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h index 3c440148725..107b5344e59 100644 --- a/src/mame/includes/srmp2.h +++ b/src/mame/includes/srmp2.h @@ -21,7 +21,7 @@ public: required_device<cpu_device> m_maincpu; required_device<seta001_device> m_seta001; required_device<msm5205_device> m_msm; - + int m_color_bank; int m_gfx_bank; int m_adpcm_bank; @@ -43,7 +43,7 @@ public: DECLARE_WRITE16_MEMBER(mjyuugi_adpcm_bank_w); DECLARE_READ8_MEMBER(mjyuugi_irq2_ack_r); DECLARE_READ8_MEMBER(mjyuugi_irq4_ack_r); - + // rmgoldyh DECLARE_WRITE8_MEMBER(rmgoldyh_rombank_w); diff --git a/src/mame/includes/srumbler.h b/src/mame/includes/srumbler.h index 06dab337b2a..3d85800db5e 100644 --- a/src/mame/includes/srumbler.h +++ b/src/mame/includes/srumbler.h @@ -29,15 +29,15 @@ public: DECLARE_WRITE8_MEMBER(background_w); DECLARE_WRITE8_MEMBER(_4009_w); DECLARE_WRITE8_MEMBER(scroll_w); - + TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); - + virtual void machine_start(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); }; diff --git a/src/mame/includes/ssozumo.h b/src/mame/includes/ssozumo.h index 42771f95f7a..f8c30eb5534 100644 --- a/src/mame/includes/ssozumo.h +++ b/src/mame/includes/ssozumo.h @@ -29,7 +29,7 @@ public: tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; UINT8 m_sound_nmi_mask; - + DECLARE_WRITE8_MEMBER(sh_command_w); DECLARE_WRITE8_MEMBER(sound_nmi_mask_w); DECLARE_WRITE8_MEMBER(videoram_w); @@ -39,18 +39,18 @@ public: DECLARE_WRITE8_MEMBER(paletteram_w); DECLARE_WRITE8_MEMBER(scroll_w); DECLARE_WRITE8_MEMBER(flipscreen_w); - + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - + INTERRUPT_GEN_MEMBER(sound_timer_irq); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(ssozumo); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h index b9175dcc172..d8c61ffed71 100644 --- a/src/mame/includes/ssrj.h +++ b/src/mame/includes/ssrj.h @@ -27,21 +27,21 @@ public: tilemap_t *m_tilemap2; tilemap_t *m_tilemap4; UINT8 *m_buffer_spriteram; - + DECLARE_READ8_MEMBER(wheel_r); DECLARE_WRITE8_MEMBER(vram1_w); DECLARE_WRITE8_MEMBER(vram2_w); DECLARE_WRITE8_MEMBER(vram4_w); - + TILE_GET_INFO_MEMBER(get_tile_info1); TILE_GET_INFO_MEMBER(get_tile_info2); TILE_GET_INFO_MEMBER(get_tile_info4); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(ssrj); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); void draw_objects(bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h index 2d5ac2fa60d..0627c79a39d 100644 --- a/src/mame/includes/ssv.h +++ b/src/mame/includes/ssv.h @@ -106,9 +106,9 @@ public: DECLARE_WRITE16_MEMBER(scroll_w); DECLARE_READ16_MEMBER(gdfs_eeprom_r); DECLARE_WRITE16_MEMBER(gdfs_eeprom_w); - + TILE_GET_INFO_MEMBER(get_tile_info_0); - + DECLARE_DRIVER_INIT(gdfs); DECLARE_DRIVER_INIT(sxyreac2); DECLARE_DRIVER_INIT(hypreac2); @@ -135,16 +135,16 @@ public: virtual void video_start(); DECLARE_VIDEO_START(gdfs); DECLARE_VIDEO_START(eaglshot); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt); void update_irq_state(); IRQ_CALLBACK_MEMBER(irq_callback); - + 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); void draw_row(bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int sy, int scroll); void draw_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, int nr); diff --git a/src/mame/includes/stactics.h b/src/mame/includes/stactics.h index 10d888353e8..ac9934f7aba 100644 --- a/src/mame/includes/stactics.h +++ b/src/mame/includes/stactics.h @@ -12,6 +12,7 @@ class stactics_state : public driver_device public: stactics_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), m_palette_val(*this, "paletteram"), m_motor_on(*this, "motor_on"), m_lamps(*this, "lamps"), @@ -19,13 +20,9 @@ public: m_videoram_b(*this, "videoram_b"), m_videoram_d(*this, "videoram_d"), m_videoram_e(*this, "videoram_e"), - m_videoram_f(*this, "videoram_f"), - m_maincpu(*this, "maincpu") { } + m_videoram_f(*this, "videoram_f") { } - /* machine state */ - int m_vert_pos; - int m_horiz_pos; - /* video state */ + required_device<cpu_device> m_maincpu; required_shared_ptr<UINT8> m_palette_val; required_shared_ptr<UINT8> m_motor_on; @@ -35,7 +32,12 @@ public: required_shared_ptr<UINT8> m_videoram_d; required_shared_ptr<UINT8> m_videoram_e; required_shared_ptr<UINT8> m_videoram_f; - + + /* machine state */ + int m_vert_pos; + int m_horiz_pos; + + /* video state */ UINT8 m_y_scroll_d; UINT8 m_y_scroll_e; UINT8 m_y_scroll_f; @@ -45,30 +47,33 @@ public: UINT16 m_beam_state; UINT16 m_old_beam_state; UINT16 m_beam_states_per_frame; + DECLARE_READ8_MEMBER(vert_pos_r); DECLARE_READ8_MEMBER(horiz_pos_r); - DECLARE_WRITE8_MEMBER(stactics_coin_lockout_w); - DECLARE_WRITE8_MEMBER(stactics_scroll_ram_w); - DECLARE_WRITE8_MEMBER(stactics_speed_latch_w); - DECLARE_WRITE8_MEMBER(stactics_shot_trigger_w); - DECLARE_WRITE8_MEMBER(stactics_shot_flag_clear_w); - DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_frame_count_d3); - DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_shot_standby); - DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_not_shot_arrive); + DECLARE_WRITE8_MEMBER(coinlockout_w); + DECLARE_WRITE8_MEMBER(scroll_ram_w); + DECLARE_WRITE8_MEMBER(speed_latch_w); + DECLARE_WRITE8_MEMBER(shot_trigger_w); + DECLARE_WRITE8_MEMBER(shot_flag_clear_w); + + DECLARE_CUSTOM_INPUT_MEMBER(get_frame_count_d3); + DECLARE_CUSTOM_INPUT_MEMBER(get_shot_standby); + DECLARE_CUSTOM_INPUT_MEMBER(get_not_shot_arrive); DECLARE_CUSTOM_INPUT_MEMBER(get_motor_not_ready); DECLARE_CUSTOM_INPUT_MEMBER(get_rng); + INTERRUPT_GEN_MEMBER(interrupt); + virtual void machine_start(); - DECLARE_VIDEO_START(stactics); + virtual void video_start(); DECLARE_PALETTE_INIT(stactics); - UINT32 screen_update_stactics(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(stactics_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_beam(); inline int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); void set_indicator_leds(int data, const char *output_name, int base_index); void update_artwork(); void move_motor(); - required_device<cpu_device> m_maincpu; }; /*----------- defined in video/stactics.c -----------*/ MACHINE_CONFIG_EXTERN( stactics_video ); diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h index 1b9629a7b29..523512951f2 100644 --- a/src/mame/includes/subs.h +++ b/src/mame/includes/subs.h @@ -42,7 +42,7 @@ public: int m_steering_val2; int m_last_val_1; int m_last_val_2; - + DECLARE_WRITE8_MEMBER(steer_reset_w); DECLARE_READ8_MEMBER(control_r); DECLARE_READ8_MEMBER(coin_r); @@ -56,16 +56,16 @@ public: DECLARE_WRITE8_MEMBER(crash_w); DECLARE_WRITE8_MEMBER(explode_w); DECLARE_WRITE8_MEMBER(noise_reset_w); - + virtual void machine_start(); virtual void machine_reset(); DECLARE_PALETTE_INIT(subs); - + UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + INTERRUPT_GEN_MEMBER(interrupt); - + int steering_1(); int steering_2(); }; diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h index 6ccfc4f4045..7f641552bfe 100644 --- a/src/mame/includes/suna16.h +++ b/src/mame/includes/suna16.h @@ -40,7 +40,7 @@ public: DECLARE_WRITE16_MEMBER(flipscreen_w); DECLARE_WRITE8_MEMBER(DAC1_w); DECLARE_WRITE8_MEMBER(DAC2_w); - + // bestbest specific DECLARE_WRITE16_MEMBER(bestbest_flipscreen_w); DECLARE_WRITE16_MEMBER(bestbest_coin_w); @@ -54,22 +54,22 @@ public: DECLARE_WRITE8_MEMBER(bssoccer_pcm_2_bankswitch_w); DECLARE_WRITE8_MEMBER(bssoccer_DAC3_w); DECLARE_WRITE8_MEMBER(bssoccer_DAC4_w); - + // uballoon specific DECLARE_WRITE16_MEMBER(uballoon_leds_w); DECLARE_WRITE8_MEMBER(uballoon_pcm_1_bankswitch_w); DECLARE_READ8_MEMBER(uballoon_prot_r); DECLARE_WRITE8_MEMBER(uballoon_prot_w); - + TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt); - + DECLARE_DRIVER_INIT(uballoon); virtual void video_start(); DECLARE_MACHINE_START(bestbest); DECLARE_MACHINE_START(bssoccer); - DECLARE_MACHINE_START(uballoon); + DECLARE_MACHINE_START(uballoon); DECLARE_MACHINE_RESET(uballoon); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx); diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h index a04d8166faa..13b534f793d 100644 --- a/src/mame/includes/suprloco.h +++ b/src/mame/includes/suprloco.h @@ -9,7 +9,7 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_scrollram(*this, "scrollram") { } - + required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<gfxdecode_device> m_gfxdecode; @@ -17,7 +17,7 @@ public: required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_scrollram; - + tilemap_t *m_bg_tilemap; int m_control; @@ -26,13 +26,13 @@ public: DECLARE_WRITE8_MEMBER(scrollram_w); DECLARE_WRITE8_MEMBER(control_w); DECLARE_READ8_MEMBER(control_r); - + TILE_GET_INFO_MEMBER(get_tile_info); - + virtual void video_start(); DECLARE_PALETTE_INIT(suprloco); DECLARE_DRIVER_INIT(suprloco); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip); void draw_sprite(bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number); diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h index fe39170bee4..29c34423e4b 100644 --- a/src/mame/includes/suprridr.h +++ b/src/mame/includes/suprridr.h @@ -35,7 +35,7 @@ public: tilemap_t *m_bg_tilemap_noscroll; UINT8 m_flipx; UINT8 m_flipy; - + DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_WRITE8_MEMBER(sound_data_w); DECLARE_WRITE8_MEMBER(sound_irq_ack_w); @@ -48,19 +48,19 @@ public: DECLARE_WRITE8_MEMBER(bgram_w); DECLARE_WRITE8_MEMBER(fgram_w); DECLARE_READ8_MEMBER(sound_data_r); - + DECLARE_CUSTOM_INPUT_MEMBER(control_r); - + TILE_GET_INFO_MEMBER(get_tile_info); TILE_GET_INFO_MEMBER(get_tile_info2); - + INTERRUPT_GEN_MEMBER(main_nmi_gen); TIMER_CALLBACK_MEMBER(delayed_sound_w); - + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(suprridr); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); int is_screen_flipped(); }; diff --git a/src/mame/includes/tankbatt.h b/src/mame/includes/tankbatt.h index c7c9c39646a..d89621127f2 100644 --- a/src/mame/includes/tankbatt.h +++ b/src/mame/includes/tankbatt.h @@ -18,11 +18,11 @@ public: required_shared_ptr<UINT8> m_bulletsram; required_shared_ptr<UINT8> m_videoram; - + int m_nmi_enable; int m_sound_enable; tilemap_t *m_bg_tilemap; - + DECLARE_WRITE8_MEMBER(led_w); DECLARE_READ8_MEMBER(in0_r); DECLARE_READ8_MEMBER(in1_r); @@ -36,17 +36,17 @@ public: DECLARE_WRITE8_MEMBER(coincounter_w); DECLARE_WRITE8_MEMBER(coinlockout_w); DECLARE_WRITE8_MEMBER(videoram_w); - - + + INTERRUPT_GEN_MEMBER(interrupt); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); - + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(tankbatt); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/tankbust.h b/src/mame/includes/tankbust.h index 2bf3f8bcc21..37e88e410de 100644 --- a/src/mame/includes/tankbust.h +++ b/src/mame/includes/tankbust.h @@ -31,7 +31,7 @@ public: UINT8 m_xscroll[2]; UINT8 m_yscroll[2]; UINT8 m_irq_mask; - + DECLARE_WRITE8_MEMBER(soundlatch_w); DECLARE_WRITE8_MEMBER(e0xx_w); DECLARE_READ8_MEMBER(debug_output_area_r); @@ -44,18 +44,18 @@ public: DECLARE_WRITE8_MEMBER(yscroll_w); DECLARE_READ8_MEMBER(soundlatch_r); DECLARE_READ8_MEMBER(soundtimer_r); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_txt_tile_info); - - virtual void machine_start(); - virtual void machine_reset(); + + virtual void machine_start(); + virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(tankbust); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - + INTERRUPT_GEN_MEMBER(vblank_irq); TIMER_CALLBACK_MEMBER(soundlatch_callback); TIMER_CALLBACK_MEMBER(soundirqline_callback); diff --git a/src/mame/includes/taotaido.h b/src/mame/includes/taotaido.h index 56c75aa93a9..f4012287c16 100644 --- a/src/mame/includes/taotaido.h +++ b/src/mame/includes/taotaido.h @@ -21,7 +21,7 @@ public: required_shared_ptr<UINT16> m_spriteram2; required_shared_ptr<UINT16> m_scrollram; required_shared_ptr<UINT16> m_bgram; - + int m_pending_command; UINT16 m_sprite_character_bank_select[8]; UINT16 m_video_bank_select[8]; @@ -30,7 +30,7 @@ public: UINT16 *m_spriteram_older; UINT16 *m_spriteram2_old; UINT16 *m_spriteram2_older; - + DECLARE_READ16_MEMBER(pending_command_r); DECLARE_WRITE16_MEMBER(sound_command_w); DECLARE_WRITE8_MEMBER(pending_command_clear_w); @@ -38,13 +38,13 @@ public: DECLARE_WRITE16_MEMBER(sprite_character_bank_select_w); DECLARE_WRITE16_MEMBER(tileregs_w); DECLARE_WRITE16_MEMBER(bgvideoram_w); - + TILE_GET_INFO_MEMBER(bg_tile_info); TILEMAP_MAPPER_MEMBER(tilemap_scan_rows); - + virtual void machine_start(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); UINT32 tile_callback( UINT32 code ); diff --git a/src/mame/includes/tbowl.h b/src/mame/includes/tbowl.h index c6fbb1e0421..778e273c526 100644 --- a/src/mame/includes/tbowl.h +++ b/src/mame/includes/tbowl.h @@ -62,18 +62,18 @@ public: DECLARE_WRITE8_MEMBER(bg2xscroll_hi); DECLARE_WRITE8_MEMBER(bg2yscroll_lo); DECLARE_WRITE8_MEMBER(bg2yscroll_hi); - + TILE_GET_INFO_MEMBER(get_tx_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_bg2_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - + UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + void adpcm_int(msm5205_device *device, int chip); DECLARE_WRITE_LINE_MEMBER(adpcm_int_1); DECLARE_WRITE_LINE_MEMBER(adpcm_int_2); diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h index 4e7cd0657d1..c3617dc53ca 100644 --- a/src/mame/includes/thepit.h +++ b/src/mame/includes/thepit.h @@ -20,34 +20,43 @@ public: required_shared_ptr<UINT8> m_attributesram; required_shared_ptr<UINT8> m_spriteram; - int m_question_address; - int m_question_rom; - int m_remap_address[16]; UINT8 m_graphics_bank; - UINT8 m_flip_screen_x; - UINT8 m_flip_screen_y; + UINT8 m_flip_x; + UINT8 m_flip_y; tilemap_t *m_solid_tilemap; tilemap_t *m_tilemap; UINT8 *m_dummy_tile; UINT8 m_nmi_mask; - DECLARE_READ8_MEMBER(thepit_colorram_r); - DECLARE_WRITE8_MEMBER(thepit_sound_enable_w); + + int m_question_address; + int m_question_rom; + int m_remap_address[16]; + + DECLARE_WRITE8_MEMBER(sound_enable_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); - DECLARE_READ8_MEMBER(rtriv_question_r); - DECLARE_WRITE8_MEMBER(thepit_videoram_w); - DECLARE_WRITE8_MEMBER(thepit_colorram_w); - DECLARE_WRITE8_MEMBER(thepit_flip_screen_x_w); - DECLARE_WRITE8_MEMBER(thepit_flip_screen_y_w); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_WRITE8_MEMBER(colorram_w); + DECLARE_WRITE8_MEMBER(flip_screen_x_w); + DECLARE_WRITE8_MEMBER(flip_screen_y_w); + DECLARE_READ8_MEMBER(input_port_0_r); + + DECLARE_READ8_MEMBER(intrepid_colorram_mirror_r); DECLARE_WRITE8_MEMBER(intrepid_graphics_bank_w); - DECLARE_READ8_MEMBER(thepit_input_port_0_r); - DECLARE_DRIVER_INIT(rtriv); + + DECLARE_READ8_MEMBER(rtriv_question_r); + TILE_GET_INFO_MEMBER(solid_get_tile_info); TILE_GET_INFO_MEMBER(get_tile_info); + + DECLARE_DRIVER_INIT(rtriv); + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(thepit); DECLARE_PALETTE_INIT(suprmous); - UINT32 screen_update_thepit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_desertdan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_draw); + + INTERRUPT_GEN_MEMBER(vblank_irq); }; diff --git a/src/mame/includes/thunderx.h b/src/mame/includes/thunderx.h index 8e42281322a..41d55201560 100644 --- a/src/mame/includes/thunderx.h +++ b/src/mame/includes/thunderx.h @@ -62,7 +62,7 @@ public: virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); + virtual void video_start(); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_interrupt); diff --git a/src/mame/includes/timelimt.h b/src/mame/includes/timelimt.h index b1390b0fd46..91a2894e0a9 100644 --- a/src/mame/includes/timelimt.h +++ b/src/mame/includes/timelimt.h @@ -33,17 +33,17 @@ public: DECLARE_WRITE8_MEMBER(scroll_x_lsb_w); DECLARE_WRITE8_MEMBER(scroll_x_msb_w); DECLARE_WRITE8_MEMBER(scroll_y_w); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); DECLARE_PALETTE_INIT(timelimt); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - + INTERRUPT_GEN_MEMBER(irq); }; diff --git a/src/mame/includes/tryout.h b/src/mame/includes/tryout.h index 9d06817ef30..d8e63eade36 100644 --- a/src/mame/includes/tryout.h +++ b/src/mame/includes/tryout.h @@ -27,7 +27,7 @@ public: UINT8 m_vram_bank; UINT8 *m_vram; UINT8 *m_vram_gfx; - + DECLARE_WRITE8_MEMBER(nmi_ack_w); DECLARE_WRITE8_MEMBER(sound_w); DECLARE_WRITE8_MEMBER(sound_irq_ack_w); @@ -45,8 +45,8 @@ public: TILEMAP_MAPPER_MEMBER(get_fg_memory_offset); TILEMAP_MAPPER_MEMBER(get_bg_memory_offset); - virtual void machine_start(); - virtual void video_start(); + virtual void machine_start(); + virtual void video_start(); DECLARE_PALETTE_INIT(tryout); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/tsamurai.h b/src/mame/includes/tsamurai.h index 1a43871fea0..62983b0fb4d 100644 --- a/src/mame/includes/tsamurai.h +++ b/src/mame/includes/tsamurai.h @@ -28,26 +28,26 @@ public: tilemap_t *m_background; tilemap_t *m_foreground; - + //common int m_flicker; int m_textbank1; int m_nmi_enabled; - + // tsamurai and m660 specific int m_bgcolor; int m_sound_command1; int m_sound_command2; - + //m660 specific int m_textbank2; int m_sound_command3; - + //vsgongf specific int m_vsgongf_sound_nmi_enabled; int m_vsgongf_color; int m_key_count; //debug only - + // common DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_WRITE8_MEMBER(coincounter_w); @@ -68,27 +68,27 @@ public: DECLARE_WRITE8_MEMBER(sound_command2_w); DECLARE_READ8_MEMBER(sound_command1_r); DECLARE_READ8_MEMBER(sound_command2_r); - + // tsamurai specific DECLARE_READ8_MEMBER(tsamurai_unknown_d803_r); - + // m660 specific DECLARE_WRITE8_MEMBER(m660_textbank2_w); DECLARE_READ8_MEMBER(m660_unknown_d803_r); DECLARE_WRITE8_MEMBER(m660_sound_command3_w); DECLARE_READ8_MEMBER(m660_sound_command3_r); - + // vsgongf specific DECLARE_WRITE8_MEMBER(vsgongf_color_w); DECLARE_WRITE8_MEMBER(vsgongf_sound_nmi_enable_w); DECLARE_READ8_MEMBER(vsgongf_a006_r); DECLARE_READ8_MEMBER(vsgongf_a100_r); DECLARE_WRITE8_MEMBER(vsgongf_sound_command_w); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_vsgongf_tile_info); - + virtual void machine_start(); DECLARE_MACHINE_START(m660); DECLARE_MACHINE_START(tsamurai); @@ -97,11 +97,11 @@ public: DECLARE_VIDEO_START(m660); DECLARE_VIDEO_START(tsamurai); DECLARE_VIDEO_START(vsgongf); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_vsgongf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); - + INTERRUPT_GEN_MEMBER(interrupt); INTERRUPT_GEN_MEMBER(vsgongf_sound_interrupt); }; diff --git a/src/mame/includes/tunhunt.h b/src/mame/includes/tunhunt.h index c63c925a817..29e89a65e95 100644 --- a/src/mame/includes/tunhunt.h +++ b/src/mame/includes/tunhunt.h @@ -3,41 +3,47 @@ class tunhunt_state : public driver_device public: tunhunt_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_workram(*this, "workram"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), + m_workram(*this, "workram"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), m_generic_paletteram_8(*this, "paletteram") { } - UINT8 m_control; + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + required_shared_ptr<UINT8> m_workram; required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_spriteram; + required_shared_ptr<UINT8> m_generic_paletteram_8; + + UINT8 m_control; tilemap_t *m_fg_tilemap; bitmap_ind16 m_tmpbitmap; - DECLARE_WRITE8_MEMBER(tunhunt_control_w); - DECLARE_READ8_MEMBER(tunhunt_button_r); - DECLARE_WRITE8_MEMBER(tunhunt_videoram_w); + + DECLARE_WRITE8_MEMBER(control_w); + DECLARE_READ8_MEMBER(button_r); + DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_READ8_MEMBER(dsw2_0r); DECLARE_READ8_MEMBER(dsw2_1r); DECLARE_READ8_MEMBER(dsw2_2r); DECLARE_READ8_MEMBER(dsw2_3r); DECLARE_READ8_MEMBER(dsw2_4r); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + virtual void video_start(); DECLARE_PALETTE_INIT(tunhunt); - UINT32 screen_update_tunhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void set_pens(); void draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_shell(bitmap_ind16 &bitmap, const rectangle &cliprect, int picture_code, int hposition,int vstart,int vstop,int vstretch,int hstretch); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; - required_shared_ptr<UINT8> m_generic_paletteram_8; }; diff --git a/src/mame/includes/usgames.h b/src/mame/includes/usgames.h index f8f4e5bb83a..51316a7a165 100644 --- a/src/mame/includes/usgames.h +++ b/src/mame/includes/usgames.h @@ -17,8 +17,8 @@ public: DECLARE_WRITE8_MEMBER(usgames_videoram_w); DECLARE_WRITE8_MEMBER(usgames_charram_w); TILE_GET_INFO_MEMBER(get_usgames_tile_info); - virtual void machine_start(); - virtual void video_start(); + virtual void machine_start(); + virtual void video_start(); DECLARE_PALETTE_INIT(usgames); UINT32 screen_update_usgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device<cpu_device> m_maincpu; diff --git a/src/mame/includes/vigilant.h b/src/mame/includes/vigilant.h index 52b88897e7e..e1797090313 100644 --- a/src/mame/includes/vigilant.h +++ b/src/mame/includes/vigilant.h @@ -38,8 +38,8 @@ public: DECLARE_WRITE8_MEMBER(vigilant_horiz_scroll_w); DECLARE_WRITE8_MEMBER(vigilant_rear_horiz_scroll_w); DECLARE_WRITE8_MEMBER(vigilant_rear_color_w); - virtual void machine_start(); - virtual void video_start(); + virtual void machine_start(); + virtual void video_start(); virtual void video_reset(); UINT32 screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_kikcubic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/vulgus.h b/src/mame/includes/vulgus.h index 2c4294cc75f..19383814077 100644 --- a/src/mame/includes/vulgus.h +++ b/src/mame/includes/vulgus.h @@ -48,6 +48,6 @@ public: UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); - + INTERRUPT_GEN_MEMBER(vblank_irq); }; diff --git a/src/mame/includes/wc90b.h b/src/mame/includes/wc90b.h index b81bc70feb5..b5d513d69dc 100644 --- a/src/mame/includes/wc90b.h +++ b/src/mame/includes/wc90b.h @@ -51,14 +51,14 @@ public: DECLARE_WRITE8_MEMBER(txvideoram_w); DECLARE_WRITE8_MEMBER(adpcm_control_w); DECLARE_WRITE_LINE_MEMBER(adpcm_int); - + TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); - + virtual void machine_start(); virtual void video_start(); - + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); }; diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c index 07d0e309e35..f0298b40c40 100644 --- a/src/mame/machine/cps2crpt.c +++ b/src/mame/machine/cps2crpt.c @@ -899,7 +899,8 @@ static const struct game_keys keys_table[] = { "sfz2alj", { 0x99450c88,0xa00a2c4d }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0 { "sfz2alh", { 0x95f15b7c,0x200c08c6 }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0 { "sfz2alb", { 0x73cd4a28,0xff83af1c }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0 - { "spf2t", { 0x706a8750,0x7d0fc185 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0 + { "spf2t", { 0xdde26f09,0x55821ee7 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0 + { "spf2tu", { 0x706a8750,0x7d0fc185 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0 { "spf2xj", { 0xb12c835a,0xe90976ff }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0 { "spf2ta", { 0x9c48e1ab,0xd60f34fb }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0 { "spf2th", { 0x51ed8cab,0x228f85b6 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0 diff --git a/src/mame/machine/hng64_net.c b/src/mame/machine/hng64_net.c index 8fedeccf250..190d992a9b2 100644 --- a/src/mame/machine/hng64_net.c +++ b/src/mame/machine/hng64_net.c @@ -141,4 +141,4 @@ MACHINE_CONFIG_FRAGMENT( hng64_network ) MCFG_CPU_ADD("network", KL5C80A12, HNG64_MASTER_CLOCK / 4) /* KL5C80A12CFP - binary compatible with Z80. */ MCFG_CPU_PROGRAM_MAP(hng_comm_map) MCFG_CPU_IO_MAP(hng_comm_io_map) -MACHINE_CONFIG_END
\ No newline at end of file +MACHINE_CONFIG_END diff --git a/src/mame/machine/iteagle_fpga.c b/src/mame/machine/iteagle_fpga.c index 22f907ddcdd..f72e62a4f26 100644 --- a/src/mame/machine/iteagle_fpga.c +++ b/src/mame/machine/iteagle_fpga.c @@ -35,15 +35,15 @@ void iteagle_fpga_device::device_start() add_map(sizeof(m_ctrl_regs), M_IO, FUNC(iteagle_fpga_device::ctrl_map)); // ctrl defaults to base address 0x00000000 - bank_infos[0].adr = 0x00000000 & (~(bank_infos[0].size - 1)); + bank_infos[0].adr = 0x00000000 & (~(bank_infos[0].size - 1)); add_map(sizeof(m_fpga_regs), M_IO, FUNC(iteagle_fpga_device::fpga_map)); // fpga defaults to base address 0x00000300 - bank_infos[1].adr = 0x00000300 & (~(bank_infos[1].size - 1)); + bank_infos[1].adr = 0x00000300 & (~(bank_infos[1].size - 1)); add_map(sizeof(m_rtc_regs), M_MEM, FUNC(iteagle_fpga_device::rtc_map)); // RTC defaults to base address 0x000c0000 - bank_infos[2].adr = 0x000c0000 & (~(bank_infos[2].size - 1)); + bank_infos[2].adr = 0x000c0000 & (~(bank_infos[2].size - 1)); } void iteagle_fpga_device::device_reset() @@ -106,7 +106,7 @@ READ32_MEMBER( iteagle_fpga_device::fpga_r ) if (LOG_FPGA && (m_prev_reg != offset && m_prev_reg != (0x08/4))) logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); break; - case 0x04/4: + case 0x04/4: result = (result & 0xFF0FFFFF) | (machine().root_device().ioport("SW5")->read()<<20); // Resolution if (LOG_FPGA) logerror("%s:fpga read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); @@ -183,7 +183,7 @@ WRITE32_MEMBER( iteagle_fpga_device::rtc_w ) COMBINE_DATA(&m_rtc_regs[offset]); switch (offset) { - case 0x7F8/4: // M48T02 time + case 0x7F8/4: // M48T02 time if (data & mem_mask & 0x40) { // get the current date/time from the core machine().current_datetime(systime); @@ -191,7 +191,7 @@ WRITE32_MEMBER( iteagle_fpga_device::rtc_w ) raw[1] = dec_2_bcd(systime.local_time.second); raw[2] = dec_2_bcd(systime.local_time.minute); raw[3] = dec_2_bcd(systime.local_time.hour); - + raw[4] = dec_2_bcd((systime.local_time.weekday != 0) ? systime.local_time.weekday : 7); raw[5] = dec_2_bcd(systime.local_time.mday); raw[6] = dec_2_bcd(systime.local_time.month + 1); @@ -199,10 +199,10 @@ WRITE32_MEMBER( iteagle_fpga_device::rtc_w ) m_rtc_regs[0x7F8/4] = (raw[3]<<24) | (raw[2]<<16) | (raw[1]<<8) | (raw[0] <<0); //m_rtc_regs[0x7FC/4] = (raw[7]<<24) | (raw[6]<<16) | (raw[5]<<8) | (raw[4] <<0); m_rtc_regs[0x7FC/4] = (0x95<<24) | (raw[6]<<16) | (raw[5]<<8) | (raw[4] <<0); - } + } if (LOG_RTC) logerror("%s:RTC write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); - + break; default: if (LOG_RTC) @@ -249,7 +249,7 @@ void iteagle_eeprom_device::device_reset() pci_device::device_reset(); } -READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) +READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) { UINT32 result = 0; @@ -257,7 +257,7 @@ READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) case 0xC/4: // I2C Handler if (ACCESSING_BITS_16_23) { result = m_eeprom->do_read()<<(16+3); - } else { + } else { if (LOG_EEPROM) logerror("%s:eeprom read from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); } @@ -270,7 +270,7 @@ READ32_MEMBER( iteagle_eeprom_device::eeprom_r ) return result; } -WRITE32_MEMBER( iteagle_eeprom_device::eeprom_w ) +WRITE32_MEMBER( iteagle_eeprom_device::eeprom_w ) { switch (offset) { case 0xC/4: // I2C Handler @@ -278,7 +278,7 @@ WRITE32_MEMBER( iteagle_eeprom_device::eeprom_w ) m_eeprom->di_write((data & 0x040000) >> (16+2)); m_eeprom->cs_write((data & 0x020000) ? ASSERT_LINE : CLEAR_LINE); m_eeprom->clk_write((data & 0x010000) ? ASSERT_LINE : CLEAR_LINE); - } else { + } else { if (LOG_EEPROM) logerror("%s:eeprom write to offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); } diff --git a/src/mame/machine/iteagle_fpga.h b/src/mame/machine/iteagle_fpga.h index acc4bd85b00..356c6517619 100644 --- a/src/mame/machine/iteagle_fpga.h +++ b/src/mame/machine/iteagle_fpga.h @@ -31,7 +31,7 @@ private: UINT32 m_fpga_regs[0x20]; UINT32 m_rtc_regs[0x800]; UINT32 m_prev_reg; - + DECLARE_ADDRESS_MAP(rtc_map, 32); DECLARE_ADDRESS_MAP(fpga_map, 32); DECLARE_ADDRESS_MAP(ctrl_map, 32); diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index 81a3662b0b4..ed3834707eb 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -23,6 +23,9 @@ n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_ : device_t(mconfig, N64PERIPH, "N64 Periphal Chips", tag, owner, clock, "n64_periphs", __FILE__) , device_video_interface(mconfig, *this) , m_nvram_image(NULL) + , dd_present(false) + , disk_present(false) + , cart_present(false) { } @@ -171,7 +174,6 @@ void n64_periphs::device_reset() pi_bsd_dom2_rls = 0; pi_dma_dir = 0; - dd_int = 0; memset(dd_buffer, 0, sizeof(dd_buffer)); memset(dd_sector_data, 0, sizeof(dd_sector_data)); memset(dd_ram_seq_data, 0, sizeof(dd_ram_seq_data)); @@ -183,6 +185,10 @@ void n64_periphs::device_reset() dd_seq_status_reg = 0; dd_seq_ctrl_reg = 0; dd_int = 0; + dd_bm_reset_held = false; + dd_write = false; + dd_zone = 0; + dd_track_offset = 0; memset(ri_regs, 0, sizeof(ri_regs)); @@ -217,7 +223,6 @@ void n64_periphs::device_reset() pif_ram[0x25] = 0x00; pif_ram[0x26] = 0x3f; pif_ram[0x27] = 0x3f; - dd_present = false; cic_type=2; mem_map->write_dword(0x00000318, 0x800000); @@ -227,7 +232,6 @@ void n64_periphs::device_reset() pif_ram[0x25] = 0x08; pif_ram[0x26] = 0xdd; pif_ram[0x27] = 0x3f; - dd_present = true; cic_type=0xd; } else if (boot_checksum == U64(0x000000cffb830843) || boot_checksum == U64(0x000000d0027fdf31)) @@ -1374,13 +1378,26 @@ TIMER_CALLBACK_MEMBER(n64_periphs::pi_dma_callback) void n64_periphs::pi_dma_tick() { + bool update_bm = false; UINT16 *cart16; UINT16 *dram16 = (UINT16*)rdram; UINT32 cart_addr = (pi_cart_addr & 0x0fffffff) >> 1; UINT32 dram_addr = (pi_dram_addr & 0x007fffff) >> 1; - if((cart_addr & 0x04000000) == 0x04000000) + if(pi_cart_addr == 0x05000000 && dd_present) + { + update_bm = true; + cart16 = (UINT16*)dd_buffer; + cart_addr = (pi_cart_addr & 0x000003ff) >> 1; + } + else if(pi_cart_addr == 0x05000400 && dd_present) + { + update_bm = true; + cart16 = (UINT16*)dd_sector_data; + cart_addr = (pi_cart_addr & 0x000000ff) >> 1; + } + else if((cart_addr & 0x04000000) == 0x04000000) { cart16 = (UINT16*)n64_sram; cart_addr = (pi_cart_addr & 0x0001ffff) >> 1; @@ -1399,6 +1416,7 @@ void n64_periphs::pi_dma_tick() if(pi_dma_dir == 1) { UINT32 dma_length = pi_wr_len + 1; + //logerror("PI Write, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_wr_len); if (dma_length & 7) { dma_length = (dma_length + 7) & ~7; @@ -1418,6 +1436,7 @@ void n64_periphs::pi_dma_tick() else { UINT32 dma_length = pi_rd_len + 1; + //logerror("PI Read, %X, %X, %X\n", pi_cart_addr, pi_dram_addr, pi_rd_len); if (dma_length & 7) { dma_length = (dma_length + 7) & ~7; @@ -1436,7 +1455,10 @@ void n64_periphs::pi_dma_tick() } pi_status &= ~1; // Clear DMA_BUSY - pi_status |= 8; // Set INTERRUPT + //pi_status |= 8; // Set INTERRUPT ?? Does this bit exist ?? + + if(update_bm) + dd_update_bm(); signal_rcp_interrupt(PI_INTERRUPT); @@ -1513,11 +1535,26 @@ WRITE32_MEMBER( n64_periphs::pi_reg_w ) case 0x04/4: // PI_CART_ADDR_REG { pi_cart_addr = data; + if(pi_cart_addr == 0x05000400 && dd_present) + { + dd_status_reg &= ~DD_ASIC_STATUS_DREQ; + dd_status_reg &= ~DD_ASIC_STATUS_BM_INT; + //logerror("Clearing DREQ, INT\n"); + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, CLEAR_LINE); + } + if(pi_cart_addr == 0x05000000 && dd_present) + { + dd_status_reg &= ~DD_ASIC_STATUS_C2_XFER; + dd_status_reg &= ~DD_ASIC_STATUS_BM_INT; + //logerror("Clearing C2, INT\n"); + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, CLEAR_LINE); + } break; } case 0x08/4: // PI_RD_LEN_REG { + //logerror("Start PI Read\n"); pi_rd_len = data; pi_dma_dir = 0; pi_status |= 1; @@ -1530,6 +1567,7 @@ WRITE32_MEMBER( n64_periphs::pi_reg_w ) case 0x0c/4: // PI_WR_LEN_REG { + //logerror("Start PI Write\n"); pi_wr_len = data; pi_dma_dir = 1; pi_status |= 1; @@ -1545,7 +1583,9 @@ WRITE32_MEMBER( n64_periphs::pi_reg_w ) { if (data & 0x2) { - pi_status &= ~8; // Clear INTERRUPT + //pi_status &= ~8; // Clear INTERRUPT ?? Does this bit exist ?? + pi_status = 0; // Reset all bits + pi_dma_timer->adjust(attotime::never); // Cancel Pending Transfer clear_rcp_interrupt(PI_INTERRUPT); } break; @@ -2049,7 +2089,193 @@ WRITE32_MEMBER( n64_periphs::si_reg_w ) } } -#define DD_STATUS_INTR (1 << 25) +void n64_periphs::dd_set_zone_and_track_offset() +{ + UINT16 head = (dd_track_reg & 0x1000) >> 9; // Head * 8 + UINT16 track = dd_track_reg & 0xFFF; + UINT16 tr_off = 0; + + if(track >= 0x425) + { + dd_zone = 7 + head; + tr_off = track - 0x425; + } + else if (track >= 0x390) + { + dd_zone = 6 + head; + tr_off = track - 0x390; + } + else if (track >= 0x2FB) + { + dd_zone = 5 + head; + tr_off = track - 0x2FB; + } + else if (track >= 0x266) + { + dd_zone = 4 + head; + tr_off = track - 0x266; + } + else if (track >= 0x1D1) + { + dd_zone = 3 + head; + tr_off = track - 0x1D1; + } + else if (track >= 0x13C) + { + dd_zone = 2 + head; + tr_off = track - 0x13C; + } + else if (track >= 0x9E) + { + dd_zone = 1 + head; + tr_off = track - 0x9E; + } + else + { + dd_zone = 0 + head; + tr_off = track; + } + + dd_track_offset = ddStartOffset[dd_zone] + tr_off*ddZoneSecSize[dd_zone]*SECTORS_PER_BLOCK*BLOCKS_PER_TRACK; + //logerror("Zone %d, Head %d, Offset %x\n", dd_zone, head/8, dd_track_offset); +} + +void n64_periphs::dd_update_bm() +{ + if(!(dd_buf_status_reg & DD_BMST_RUNNING)) + return; + if(dd_write) // dd write, BM Mode 0 + { + if(dd_current_reg == 0) + { + dd_current_reg += 1; + dd_status_reg |= DD_ASIC_STATUS_DREQ; + } + else if(dd_current_reg < SECTORS_PER_BLOCK) + { + dd_write_sector(); + dd_current_reg += 1; + dd_status_reg |= DD_ASIC_STATUS_DREQ; + } + else if(dd_current_reg < SECTORS_PER_BLOCK + 1) + { + if(dd_buf_status_reg & DD_BMST_BLOCKS) + { + dd_write_sector(); + dd_current_reg += 1; + //logerror("DD Write, Start Next Block\n"); + dd_start_block = 1 - dd_start_block; + dd_current_reg = 1; + dd_buf_status_reg &= ~DD_BMST_BLOCKS; + dd_status_reg |= DD_ASIC_STATUS_DREQ; + } + else + { + dd_write_sector(); + dd_current_reg += 1; + dd_buf_status_reg &= ~DD_BMST_RUNNING; + } + } + else + { + logerror("DD Write, Sector Overrun\n"); + } + //logerror("DD Write, Sending Interrupt\n"); + dd_status_reg |= DD_ASIC_STATUS_BM_INT; + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); + return; + } + else // dd read, BM Mode 1 + { + if(((dd_track_reg & 0xFFF) == 6) && (dd_start_block == 0)) + { + dd_status_reg &= ~DD_ASIC_STATUS_DREQ; + } + else if(dd_current_reg < SECTORS_PER_BLOCK) + { + dd_read_sector(); + dd_current_reg += 1; + dd_status_reg |= DD_ASIC_STATUS_DREQ; + } + else if(dd_current_reg < SECTORS_PER_BLOCK + 4) + { + dd_read_C2(); + dd_current_reg += 1; + if(dd_current_reg == SECTORS_PER_BLOCK + 4) + dd_status_reg |= DD_ASIC_STATUS_C2_XFER; + } + else if(dd_current_reg == SECTORS_PER_BLOCK + 4) // Gap Sector + { + if(dd_buf_status_reg & DD_BMST_BLOCKS) + { + //logerror("DD Read, Start Next Block\n"); + dd_start_block = 1 - dd_start_block; + dd_current_reg = 0; + dd_buf_status_reg &= ~DD_BMST_BLOCKS; + } + else + { + dd_buf_status_reg &= ~DD_BMST_RUNNING; + } + } + else + { + logerror("DD Read, Sector Overrun\n"); + } + //logerror("DD Read, Sending Interrupt\n"); + dd_status_reg |= DD_ASIC_STATUS_BM_INT; + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); + return; + } +} + +void n64_periphs::dd_write_sector() +{ + UINT8* sector; + + sector = (UINT8*)machine().root_device().memregion("disk")->base(); + sector += dd_track_offset; + sector += dd_start_block * SECTORS_PER_BLOCK * ddZoneSecSize[dd_zone]; + sector += (dd_current_reg - 1) * ddZoneSecSize[dd_zone]; + + //logerror("Write Block %d, Sector %d\n", dd_start_block, dd_current_reg - 1); + + for(int i = 0; i < ddZoneSecSize[dd_zone]/4; i++) + { + sector[i*4 + 0] = (dd_sector_data[i] >> 24) & 0xFF; + sector[i*4 + 1] = (dd_sector_data[i] >> 16) & 0xFF; + sector[i*4 + 2] = (dd_sector_data[i] >> 8) & 0xFF; + sector[i*4 + 3] = (dd_sector_data[i] >> 0) & 0xFF; + } + return; +} + +void n64_periphs::dd_read_sector() +{ + UINT8* sector; + + sector = (UINT8*)machine().root_device().memregion("disk")->base(); + sector += dd_track_offset; + sector += dd_start_block * SECTORS_PER_BLOCK * ddZoneSecSize[dd_zone]; + sector += (dd_current_reg) * ddZoneSecSize[dd_zone]; + + //logerror("Read Block %d, Sector %d\n", dd_start_block, dd_current_reg); + + for(int i = 0; i < ddZoneSecSize[dd_zone]/4; i++) + { + dd_sector_data[i] = sector[(i*4 + 0)] << 24 | sector[(i*4 + 1)] << 16 | + sector[(i*4 + 2)] << 8 | sector[(i*4 + 3)]; + } + return; +} + +void n64_periphs::dd_read_C2() +{ + for(int i = 0; i < ddZoneSecSize[dd_zone]/4; i++) + dd_buffer[(dd_current_reg - SECTORS_PER_BLOCK)*0x40 + i] = 0; + //logerror("Read C2, Sector %d", dd_current_reg); + return; +} READ32_MEMBER( n64_periphs::dd_reg_r ) { @@ -2058,14 +2284,14 @@ READ32_MEMBER( n64_periphs::dd_reg_r ) return dd_buffer[offset]; } - if(offset < 0x480/4) + if(offset < 0x500/4) { - return dd_sector_data[(offset - 0x400/4) / 4]; + return dd_sector_data[(offset - 0x400/4)]; } - if(offset < 0x500/4) + if((offset < 0x5C0/4) && (0x580/4 <= offset)) { - return dd_ram_seq_data[(offset - 0x480/4) / 4]; + return dd_ram_seq_data[(offset - 0x580/4)]; } offset -= 0x500/4; @@ -2081,7 +2307,19 @@ READ32_MEMBER( n64_periphs::dd_reg_r ) break; case 0x08/4: // DD Status + if(disk_present) + dd_status_reg |= DD_ASIC_STATUS_DISK; + else + dd_status_reg &= ~DD_ASIC_STATUS_DISK; ret = dd_status_reg; + // For Read, Gap Sector + if((dd_status_reg & DD_ASIC_STATUS_BM_INT) && (SECTORS_PER_BLOCK < dd_current_reg)) + { + dd_status_reg &= ~DD_ASIC_STATUS_BM_INT; + //logerror("DD Read Gap, Clearing INT\n"); + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, CLEAR_LINE); + dd_update_bm(); + } break; case 0x0c/4: // Current Track @@ -2103,6 +2341,9 @@ READ32_MEMBER( n64_periphs::dd_reg_r ) case 0x1c/4: // Sequence Control ret = dd_seq_ctrl_reg; break; + case 0x40/4: // ASIC ID + ret = 0x00030000; // Japan Retail Drive + break; } //logerror("dd_reg_r: %08x (%08x)\n", offset << 2, ret); @@ -2119,15 +2360,15 @@ WRITE32_MEMBER( n64_periphs::dd_reg_w ) return; } - if(offset < 0x480/4) + if(offset < 0x500/4) { - COMBINE_DATA(&dd_sector_data[(offset - 0x400/4) / 4]); + COMBINE_DATA(&dd_sector_data[(offset - 0x400/4)]); return; } - if(offset < 0x500/4) + if((offset < 0x5C0/4) && (0x580/4 <= offset)) { - COMBINE_DATA(&dd_ram_seq_data[(offset - 0x480/4) / 4]); + COMBINE_DATA(&dd_ram_seq_data[(offset - 0x580/4)]); return; } @@ -2143,10 +2384,18 @@ WRITE32_MEMBER( n64_periphs::dd_reg_w ) switch((data >> 16) & 0xff) { case 0x01: // Seek Read - logerror("dd command: Seek Read\n"); + dd_track_reg = dd_data_reg >> 16; + logerror("dd command: Seek Read %d\n", dd_track_reg); + dd_set_zone_and_track_offset(); + dd_track_reg |= DD_TRACK_INDEX_LOCK; + dd_write = false; break; case 0x02: // Seek Write - logerror("dd command: Seek Write\n"); + dd_track_reg = dd_data_reg >> 16; + logerror("dd command: Seek Write %d\n", dd_track_reg); + dd_set_zone_and_track_offset(); + dd_track_reg |= DD_TRACK_INDEX_LOCK; + dd_write = true; break; case 0x03: // Re-Zero / Recalibrate logerror("dd command: Re-Zero\n"); @@ -2157,29 +2406,29 @@ WRITE32_MEMBER( n64_periphs::dd_reg_w ) case 0x05: // Start Motor logerror("dd command: Start Motor\n"); break; - case 0x06: // Standby - logerror("dd command: Standby\n"); + case 0x06: // Set Standby Time + logerror("dd command: Set Standby Time\n"); break; - case 0x07: // Set Sleep Mode - logerror("dd command: Set Sleep Mode\n"); + case 0x07: // Set Sleep Time + logerror("dd command: Set Sleep Time\n"); break; - case 0x08: // Unknown - logerror("dd command: Unknown\n"); + case 0x08: // Clear Disk Change Flag + logerror("dd command: Clear Disk Change Flag\n"); break; - case 0x09: // Initialize Drive(?) - logerror("dd command: Initialize Drive\n"); + case 0x09: // Clear Reset Flag + logerror("dd command: Clear Reset Flag\n"); break; case 0x0B: // Select Disk Type logerror("dd command: Select Disk Type\n"); break; case 0x0C: // ASIC Command Inquiry - logerror("dd command: ASIC Commadn Inquiry\n"); + logerror("dd command: ASIC Command Inquiry\n"); break; case 0x0D: // Standby Mode (?) logerror("dd command: Standby Mode(?)\n"); break; - case 0x0E: // Detect Disk Index - logerror("dd command: Detect Disk Index\n"); + case 0x0E: // (Track Seek) Index Lock Retry + logerror("dd command: Index Lock Retry\n"); break; case 0x0F: // Set RTC Year / Month logerror("dd command: Set RTC Year / Month\n"); @@ -2198,9 +2447,6 @@ WRITE32_MEMBER( n64_periphs::dd_reg_w ) machine().base_datetime(systime); dd_data_reg = (convert_to_bcd(systime.local_time.year % 100) << 24) | (convert_to_bcd(systime.local_time.month + 1) << 16); - - machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); - dd_status_reg |= DD_STATUS_INTR; break; } @@ -2212,9 +2458,6 @@ WRITE32_MEMBER( n64_periphs::dd_reg_w ) machine().base_datetime(systime); dd_data_reg = (convert_to_bcd(systime.local_time.mday) << 24) | (convert_to_bcd(systime.local_time.hour) << 16); - - machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); - dd_status_reg |= DD_STATUS_INTR; break; } @@ -2226,28 +2469,90 @@ WRITE32_MEMBER( n64_periphs::dd_reg_w ) machine().base_datetime(systime); dd_data_reg = (convert_to_bcd(systime.local_time.minute) << 24) | (convert_to_bcd(systime.local_time.second) << 16); - - machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); - dd_status_reg |= DD_STATUS_INTR; break; } - + case 0x15: // Set LED On/Off Time + { + logerror("dd command: Set LED On/Off Time\n"); + break; + } case 0x1B: // Disk Inquiry + { logerror("dd command: Disk Inquiry\n"); + dd_data_reg = 0x00000000; break; + } } - // Do something here + //logerror("Sending MECHA Int\n"); + dd_status_reg |= DD_ASIC_STATUS_MECHA_INT; + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE); break; - case 0x10/4: // Interrupt Clear - logerror("dd interrupt clear\n"); - machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, CLEAR_LINE); - dd_status_reg &= ~DD_STATUS_INTR; + case 0x10/4: // BM Status + logerror("dd BM Status write\n"); + dd_start_sector = (data >> 16) & 0xFF; + if(dd_start_sector == 0x00) + { + dd_start_block = 0; + dd_current_reg = 0; + } + else if (dd_start_sector == 0x5A) + { + dd_start_block = 1; + dd_current_reg = 0; + } + else + { + logerror("dd: start sector not aligned\n"); + } + if(data & DD_BM_XFERBLOCKS) + dd_buf_status_reg |= DD_BMST_BLOCKS; + if(data & DD_BM_MECHA_INT_RESET) + dd_status_reg &= ~DD_ASIC_STATUS_MECHA_INT; + if(data & DD_BM_RESET) + dd_bm_reset_held = true; + if(!(data & DD_BM_RESET) && dd_bm_reset_held) + { + dd_bm_reset_held = false; + dd_status_reg &= ~DD_ASIC_STATUS_BM_INT; + dd_status_reg &= ~DD_ASIC_STATUS_BM_ERROR; + dd_status_reg &= ~DD_ASIC_STATUS_DREQ; + dd_status_reg &= ~DD_ASIC_STATUS_C2_XFER; + dd_buf_status_reg = 0; + dd_current_reg = 0; + dd_start_block = 0; + logerror("dd: BM RESET\n"); + } + if(!(dd_status_reg & DD_ASIC_STATUS_BM_INT) && !(dd_status_reg & DD_ASIC_STATUS_MECHA_INT)) + { + //logerror("DD Status, Clearing INT\n"); + machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ1, CLEAR_LINE); + } + if(data & DD_BM_START) + { + if(dd_write && (data & DD_BM_MODE)) + popmessage("Attempt to write disk with BM Mode 1\n"); + if(!dd_write && !(data & DD_BM_MODE)) + popmessage("Attempt to read disk with BM Mode 0\n"); + dd_buf_status_reg |= DD_BMST_RUNNING; + logerror("dd: Start BM\n"); + dd_update_bm(); + } + break; case 0x1c/4: // Sequence Control dd_seq_ctrl_reg = data; break; + case 0x28/4: // Host Sector Byte + dd_sector_size = (data >> 16) & 0xFF; + if((dd_sector_size + 1) != ddZoneSecSize[dd_zone]) + popmessage("Sector size %d set different than expected %d\n", dd_sector_size + 1, ddZoneSecSize[dd_zone]); + break; + case 0x30/4: // Sector Byte + dd_sectors_per_block = (data >> 24) & 0xFF; + if(dd_sectors_per_block != SECTORS_PER_BLOCK + 4) + popmessage("Sectors per block %d set different than expected %d\n", dd_sectors_per_block, SECTORS_PER_BLOCK + 4); } } @@ -2315,8 +2620,8 @@ void n64_state::machine_start() dynamic_cast<mips3_device *>(machine().device("maincpu"))->mips3drc_set_options(MIPS3DRC_COMPATIBLE_OPTIONS); - /* configure fast RAM regions for DRC */ - dynamic_cast<mips3_device *>(machine().device("maincpu"))->mips3drc_add_fastram(0x00000000, 0x007fffff, FALSE, rdram); + /* configure fast RAM regions */ + dynamic_cast<mips3_device *>(machine().device("maincpu"))->add_fastram(0x00000000, 0x007fffff, FALSE, rdram); rsp_device *rsp = machine().device<rsp_device>("rsp"); rsp->rspdrc_set_options(RSPDRC_STRICT_VERIFY); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index cc31e505792..f8c06697b70 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -336,7 +336,7 @@ froggers // bootleg frogf // bootleg quaak // bootleg froggeram // bootleg -froggerv // bootleg +froggerv // bootleg amidars // GX337 (c) 1982 Konami triplep // (c) 1982 KKI / made by Sanritsu? triplepa // (c) 1982 KKI / made by Sanritsu? @@ -1122,9 +1122,12 @@ zgundm fghtjam sukuinuf zgundmdx +zoidsinf gundzaft soulclb3 soulclb3a +taiko7 +taiko8 qgundam fateulc fateulcb @@ -1139,6 +1142,7 @@ kinniku kinniku2 taiko9 yuyuhaku +zoidiexp taiko10 gdvsgd gdvsgdnx @@ -3435,7 +3439,8 @@ sfz2b // 31/05/1996 (c) 1996 (Brazil) sfz2br1 // 04/03/1996 (c) 1996 (Brazil) sfz2h // 04/03/1996 (c) 1996 (Hispanic) sfz2n // 29/02/1996 (c) 1996 (Oceania) -spf2t // 20/06/1996 (c) 1996 (USA) +spf2t // 29/05/1996 (c) 1996 (Europe) +spf2tu // 20/06/1996 (c) 1996 (USA) spf2xj // 31/05/1996 (c) 1996 (Japan) spf2ta // 29/05/1996 (c) 1996 (Asia) spf2th // 31/05/1996 (c) 1996 (Hispanic) @@ -4899,6 +4904,7 @@ titlefu // 1993.04 Title Fight (US) titlefj // 1993.03 Title Fight (Japan) // 1992.07 Stadium Cross (Japan) scross // 1992.?? Stadium Cross (World) +scrossa // 1992.?? Stadium Cross (World, alt) scrossu // 1992.09 Stadium Cross (US) // Model 1 Games @@ -6350,7 +6356,7 @@ combatsc // GX611 (c) 1988 combatsct // GX611 (c) 1987 combatscj // GX611 (c) 1987 (Japan) bootcamp // GX611 (c) 1987 -bootcampa // GX611 (c) 1987 +bootcampa // GX611 (c) 1987 combatscb // bootleg rockrage // GX620 (c) 1986 (World?) rockragea // GX620 (c) 1986 (Prototype?) @@ -6450,6 +6456,7 @@ chqflag // GX717 (c) 1988 chqflagj // GX717 (c) 1988 (Japan) ultraman // GX910 (c) 1991 Banpresto/Bandai hexion // GX122 (c) 1992 +hexionb // bootleg lethalen // GX191 (c) 1992 lethalenub // GX191 (c) 1992 lethalenua // GX191 (c) 1992 @@ -7713,7 +7720,7 @@ kof2000 // 0257 (c) 2000 SNK kof2000n // 0257 (c) 2000 SNK // 0258 SNK vs. Capcom? bangbead // 0259 (c) 2000 Visco -b2b // 0071 (c) 2000 Visco (released by NCI in 2010) +b2b // 0071 (c) 2000 Visco (released by NCI in 2010) nitd // 0260 (c) 2000 Eleven / Gavaking nitdbl // bootleg sengoku3 // 0261 (c) 2001 Noise Factory / SNK @@ -7910,7 +7917,7 @@ tstrike // East Coast Coin Company (Melbourne) tstrikea // Game Room ctribe // TA-0028 (c) 1990 (US) ctribe1 // TA-0028 (c) 1990 (US) -ctribeo // TA-0028 (c) 1990 (US) +ctribeo // TA-0028 (c) 1990 (US) ctribej // TA-0028 (c) 1990 (Japan) ctribeb // bootleg ctribeb2 // bootleg @@ -8453,7 +8460,7 @@ raiden2ea // (c) 1993 Seibu Kaihatsu raiden2eu // (c) 1993 Seibu Kaihatsu + Fabtek license raiden2eua // (c) 1993 Seibu Kaihatsu + Fabtek license raiden2nl // (c) 1993 Seibu Kaihatsu -raiden2f // (c) 1993 Seibu Kaihatsu +raiden2f // (c) 1993 Seibu Kaihatsu raiden2g // (c) 1993 Seibu Kaihatsu + Tuning license raiden2dx // (c) 1993 Seibu Kaihatsu @@ -8508,6 +8515,7 @@ rdftu // (c) 1996 Seibu Kaihatsu (Fabtek license) rdftau // (c) 1996 Seibu Kaihatsu rdftauge // (c) 1996 Seibu Kaihatsu (Tuning license and text display, but Australia region code) rdftj // (c) 1996 Seibu Kaihatsu +rdftja // (c) 1996 Seibu Kaihatsu rdftadi // (c) 1996 Seibu Kaihatsu (Dream Island license) rdftam // (c) 1996 Seibu Kaihatsu (Metrotainment license) rdftit // (c) 1996 Seibu Kaihatsu @@ -8777,7 +8785,7 @@ gunbird // (c) 1994 gunbirdk // (c) 1994 gunbirdj // (c) 1994 btlkroad // (c) 1994 -btlkroadk // (c) 1994 +btlkroadk // (c) 1994 s1945 // (c) 1995 s1945a // (c) 1995 s1945j // (c) 1995 @@ -9071,6 +9079,7 @@ msgundam1 // (c) 1993 Banpresto daioh // (C) 1993 Athena daioha // (C) 1993 Athena daiohp // (C) 1993 Athena (prototype) +daiohc // (C) 1993 Athena (93111A PCB conversion) oisipuzl // (c) 1993 SunSoft / Atlus triplfun // bootleg utoukond // (c) 1993 Banpresto + Tsuburaya Prod. @@ -9530,7 +9539,8 @@ grdnstrmj // (c) 1998 (Japan) redfoxwp2 // (c) 1998 (China) redfoxwp2a // (c) 1998 (China) bubl2000 // (c) 1998 Tuning -hotbubl // (c) 1998 Pandora +hotbubl // (c) 1998 Pandora (Korea, Nudes) +hotbubla // (c) 1998 Pandora (Korea) popspops // (c) 1999 firehawk // (c) 2001 ESD firehawkv // (c) 2001 ESD diff --git a/src/mame/mame.mak b/src/mame/mame.mak deleted file mode 100644 index edad5da86bd..00000000000 --- a/src/mame/mame.mak +++ /dev/null @@ -1,3008 +0,0 @@ -########################################################################### -# -# mame.mak -# -# MAME target makefile -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - -ifeq ($(TARGET),mame) -# In order to keep dependencies reasonable, we exclude objects in the base of -# $(SRC)/emu, as well as all the OSD objects and anything in the $(OBJ) tree -depend: maketree $(MAKEDEP_TARGET) - @echo Rebuilding depend_emu.mak... - $(MAKEDEP) -I. $(INCPATH) -I$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/emu > depend_emu.mak - @echo Rebuilding depend_$(TARGET).mak... - $(MAKEDEP) -I. $(INCPATH) -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/$(TARGET) > depend_$(TARGET).mak -endif - -MAMESRC = $(SRC)/mame -MAMEOBJ = $(OBJ)/mame - -AUDIO = $(MAMEOBJ)/audio -DRIVERS = $(MAMEOBJ)/drivers -LAYOUT = $(MAMEOBJ)/layout -MACHINE = $(MAMEOBJ)/machine -VIDEO = $(MAMEOBJ)/video - -OBJDIRS += \ - $(AUDIO) \ - $(DRIVERS) \ - $(LAYOUT) \ - $(MACHINE) \ - $(VIDEO) \ - - -#------------------------------------------------- -# specify available CPU cores -#------------------------------------------------- - -CPUS += Z80 -CPUS += Z180 -CPUS += I8085 -CPUS += I8089 -CPUS += M6502 -CPUS += H6280 -CPUS += I86 -CPUS += I386 -CPUS += NEC -CPUS += V30MZ -CPUS += V60 -CPUS += MCS48 -CPUS += MCS51 -CPUS += MCS96 -CPUS += M6800 -CPUS += M6805 -CPUS += HD6309 -CPUS += M6809 -CPUS += KONAMI -CPUS += M680X0 -CPUS += T11 -CPUS += S2650 -CPUS += TMS340X0 -CPUS += TMS9900 -CPUS += TMS9995 -CPUS += TMS9900L -CPUS += Z8000 -CPUS += Z8001 -CPUS += TMS32010 -CPUS += TMS32025 -CPUS += TMS32031 -CPUS += TMS32051 -CPUS += TMS32082 -CPUS += TMS57002 -CPUS += CCPU -CPUS += ADSP21XX -CPUS += ASAP -CPUS += AM29000 -CPUS += UPD7810 -CPUS += ARM -CPUS += ARM7 -CPUS += JAGUAR -CPUS += CUBEQCPU -CPUS += ESRIP -CPUS += MIPS -CPUS += PSX -CPUS += SH2 -CPUS += SH4 -CPUS += DSP16A -CPUS += DSP32C -CPUS += PIC16C5X -CPUS += PIC16C62X -CPUS += G65816 -CPUS += SPC700 -CPUS += E1 -CPUS += I860 -CPUS += I960 -CPUS += H8 -CPUS += V810 -CPUS += M37710 -CPUS += POWERPC -CPUS += SE3208 -CPUS += MC68HC11 -CPUS += ADSP21062 -CPUS += DSP56156 -CPUS += RSP -CPUS += ALPHA8201 -CPUS += COP400 -CPUS += TLCS90 -CPUS += TLCS900 -CPUS += MB88XX -CPUS += MB86233 -CPUS += MB86235 -CPUS += SSP1601 -CPUS += APEXC -CPUS += CP1610 -CPUS += F8 -CPUS += LH5801 -CPUS += PDP1 -CPUS += SATURN -CPUS += SC61860 -CPUS += LR35902 -CPUS += TMS7000 -CPUS += SM8500 -CPUS += MINX -CPUS += SSEM -CPUS += AVR8 -CPUS += TMS0980 -CPUS += I4004 -CPUS += SUPERFX -CPUS += Z8 -CPUS += I8008 -CPUS += SCMP -CPUS += MN10200 -CPUS += COSMAC -CPUS += UNSP -CPUS += HCD62121 -CPUS += PPS4 -CPUS += UPD7725 -CPUS += HD61700 -CPUS += LC8670 -CPUS += SCORE -CPUS += ES5510 -CPUS += SCUDSP -CPUS += IE15 -CPUS += 8X300 -CPUS += ALTO2 -#CPUS += W65816 -CPUS += ARC -CPUS += ARCOMPACT -CPUS += AMIS2000 -CPUS += UCOM4 -CPUS += HMCS40 - -#------------------------------------------------- -# specify available sound cores -#------------------------------------------------- - -SOUNDS += SAMPLES -SOUNDS += DAC -SOUNDS += DMADAC -SOUNDS += SPEAKER -SOUNDS += BEEP -SOUNDS += DISCRETE -SOUNDS += AY8910 -SOUNDS += YM2151 -SOUNDS += YM2203 -SOUNDS += YM2413 -SOUNDS += YM2608 -SOUNDS += YM2610 -SOUNDS += YM2610B -SOUNDS += YM2612 -SOUNDS += YM3438 -SOUNDS += YM3812 -SOUNDS += YM3526 -SOUNDS += Y8950 -SOUNDS += YMF262 -SOUNDS += YMF271 -SOUNDS += YMF278B -SOUNDS += YMZ280B -SOUNDS += SN76477 -SOUNDS += SN76496 -SOUNDS += POKEY -SOUNDS += TIA -SOUNDS += NES_APU -SOUNDS += AMIGA -SOUNDS += ASTROCADE -SOUNDS += NAMCO -SOUNDS += NAMCO_15XX -SOUNDS += NAMCO_CUS30 -SOUNDS += NAMCO_52XX -SOUNDS += NAMCO_63701X -SOUNDS += T6W28 -SOUNDS += SNKWAVE -SOUNDS += C140 -SOUNDS += C352 -SOUNDS += TMS36XX -SOUNDS += TMS3615 -SOUNDS += TMS5110 -SOUNDS += TMS5220 -SOUNDS += VLM5030 -SOUNDS += ADPCM -SOUNDS += MSM5205 -SOUNDS += MSM5232 -SOUNDS += OKIM6258 -SOUNDS += OKIM6295 -SOUNDS += OKIM6376 -SOUNDS += OKIM9810 -#SOUNDS += UPD7752 -SOUNDS += UPD7759 -SOUNDS += HC55516 -SOUNDS += TC8830F -SOUNDS += K005289 -SOUNDS += K007232 -SOUNDS += K051649 -SOUNDS += K053260 -SOUNDS += K054539 -SOUNDS += K056800 -SOUNDS += SEGAPCM -SOUNDS += MULTIPCM -SOUNDS += SCSP -SOUNDS += AICA -SOUNDS += RF5C68 -SOUNDS += RF5C400 -SOUNDS += CEM3394 -SOUNDS += QSOUND -SOUNDS += QS1000 -SOUNDS += SAA1099 -SOUNDS += IREMGA20 -SOUNDS += ES5503 -SOUNDS += ES5505 -SOUNDS += ES5506 -SOUNDS += BSMT2000 -SOUNDS += GAELCO_CG1V -SOUNDS += GAELCO_GAE1 -SOUNDS += C6280 -SOUNDS += SP0250 -SOUNDS += SPU -SOUNDS += CDDA -SOUNDS += ICS2115 -SOUNDS += I5000_SND -SOUNDS += ST0016 -SOUNDS += NILE -SOUNDS += X1_010 -SOUNDS += VRENDER0 -SOUNDS += VOTRAX -SOUNDS += ES8712 -SOUNDS += CDP1869 -SOUNDS += S14001A -SOUNDS += WAVE -SOUNDS += SID6581 -SOUNDS += SID8580 -SOUNDS += SP0256 -SOUNDS += DIGITALKER -SOUNDS += CDP1863 -SOUNDS += CDP1864 -SOUNDS += ZSG2 -SOUNDS += MOS656X -SOUNDS += ASC -SOUNDS += MAS3507D -SOUNDS += SOCRATES -SOUNDS += TMC0285 -SOUNDS += TMS5200 -SOUNDS += CD2801 -SOUNDS += CD2802 -SOUNDS += M58817 -SOUNDS += TMC0281 -SOUNDS += TMS5100 -SOUNDS += TMS5110A -SOUNDS += LMC1992 -SOUNDS += AWACS -SOUNDS += YMZ770 -SOUNDS += T6721A -SOUNDS += MOS7360 -#SOUNDS += ESQPUMP -#SOUNDS += VRC6 -SOUNDS += SB0400 -SOUNDS += AC97 -SOUNDS += ES1373 - -#------------------------------------------------- -# specify available video cores -#------------------------------------------------- - -VIDEOS += SEGA315_5124 -VIDEOS += SEGA315_5313 -VIDEOS += BUFSPRITE -#VIDEOS += CDP1861 -#VIDEOS += CDP1862 -#VIDEOS += CRT9007 -#VIDEOS += CRT9021 -#VIDEOS += CRT9212 -#VIDEOS += CRTC_EGA -#VIDEOS += DL1416 -VIDEOS += DM9368 -#VIDEOS += EF9340_1 -#VIDEOS += EF9345 -#VIDEOS += GF4500 -VIDEOS += GF7600GS -VIDEOS += EPIC12 -VIDEOS += FIXFREQ -VIDEOS += H63484 -#VIDEOS += HD44102 -#VIDEOS += HD44352 -#VIDEOS += HD44780 -VIDEOS += HD61830 -VIDEOS += HD63484 -#VIDEOS += HD66421 -VIDEOS += HUC6202 -VIDEOS += HUC6260 -#VIDEOS += HUC6261 -VIDEOS += HUC6270 -#VIDEOS += HUC6272 -#VIDEOS += I8244 -VIDEOS += I8275 -VIDEOS += M50458 -VIDEOS += MB90082 -VIDEOS += MB_VCU -VIDEOS += MC6845 -#VIDEOS += MC6847 -#VIDEOS += MSM6222B -#VIDEOS += MSM6255 -#VIDEOS += MOS6566 -VIDEOS += PC_VGA -VIDEOS += POLY -VIDEOS += PSX -VIDEOS += RAMDAC -#VIDEOS += S2636 -VIDEOS += SAA5050 -VIDEOS += SCN2674 -#VIDEOS += SED1200 -#VIDEOS += SED1330 -#VIDEOS += SED1520 -VIDEOS += SNES_PPU -VIDEOS += STVVDP -#VIDEOS += T6A04 -VIDEOS += TLC34076 -VIDEOS += TMS34061 -#VIDEOS += TMS3556 -VIDEOS += TMS9927 -VIDEOS += TMS9928A -#VIDEOS += UPD3301 -#VIDEOS += UPD7220 -#VIDEOS += UPD7227 -VIDEOS += V9938 -#VIDEOS += VIC4567 -VIDEOS += VOODOO -VIDEOS += VOODOO_PCI - -#------------------------------------------------- -# specify available machine cores -#------------------------------------------------- - -MACHINES += AKIKO -MACHINES += NCR53C7XX -MACHINES += LSI53C810 -MACHINES += 6522VIA -MACHINES += TPI6525 -MACHINES += RIOT6532 -MACHINES += 6821PIA -MACHINES += 6840PTM -#MACHINES += 68561MPCC -MACHINES += ACIA6850 -MACHINES += 68681 -MACHINES += 7200FIFO -#MACHINES += 8530SCC -MACHINES += TTL74123 -MACHINES += TTL74145 -MACHINES += TTL74148 -MACHINES += TTL74153 -MACHINES += TTL74181 -MACHINES += TTL7474 -MACHINES += KBDC8042 -MACHINES += I8257 -MACHINES += AAKARTDEV -#MACHINES += ACIA6850 -MACHINES += ADC0808 -MACHINES += ADC083X -MACHINES += ADC1038 -MACHINES += ADC1213X -MACHINES += AICARTC -MACHINES += AM53CF96 -MACHINES += AM9517A -MACHINES += AMIGAFDC -#MACHINES += AT_KEYBC -MACHINES += AT28C16 -MACHINES += AT29040 -MACHINES += AT45DBXX -MACHINES += ATAFLASH -MACHINES += AY31015 -MACHINES += BANKDEV -MACHINES += CDP1852 -MACHINES += CDP1871 -#MACHINES += CMOS40105 -MACHINES += CDU76S -MACHINES += COM8116 -MACHINES += CR589 -#MACHINES += CS4031 -#MACHINES += CS8221 -#MACHINES += DP8390 -MACHINES += DS1204 -MACHINES += DS1302 -#MACHINES += DS1315 -MACHINES += DS2401 -MACHINES += DS2404 -MACHINES += DS75160A -MACHINES += DS75161A -MACHINES += E0516 -MACHINES += E05A03 -MACHINES += E05A30 -MACHINES += EEPROMDEV -MACHINES += ER2055 -MACHINES += F3853 -#MACHINES += HD63450 -#MACHINES += HD64610 -MACHINES += I2CMEM -#MACHINES += I80130 -#MACHINES += I8089 -MACHINES += I8155 -MACHINES += I8212 -MACHINES += I8214 -MACHINES += I8243 -MACHINES += I8251 -MACHINES += I8255 -#MACHINES += I8257 -#MACHINES += I8271 -MACHINES += I8279 -MACHINES += I8355 -MACHINES += IDE -MACHINES += IM6402 -MACHINES += INS8154 -MACHINES += INS8250 -MACHINES += INTELFLASH -MACHINES += JVS -MACHINES += K033906 -MACHINES += K053252 -MACHINES += K056230 -#MACHINES += KB3600 -#MACHINES += KBDC8042 -#MACHINES += KR2376 -MACHINES += LATCH8 -MACHINES += LC89510 -MACHINES += LDPR8210 -MACHINES += LDSTUB -MACHINES += LDV1000 -MACHINES += LDVP931 -#MACHINES += LH5810 -MACHINES += LINFLASH -MACHINES += LPCI -#MACHINES += LSI53C810 -#MACHINES += M68307 -#MACHINES += M68340 -MACHINES += M6M80011AP -MACHINES += MATSUCD -MACHINES += MB14241 -MACHINES += MB3773 -MACHINES += MB8421 -MACHINES += MB87078 -#MACHINES += MB8795 -#MACHINES += MB89352 -MACHINES += MB89371 -MACHINES += MC146818 -MACHINES += MC2661 -MACHINES += MC6843 -MACHINES += MC6846 -MACHINES += MC6852 -MACHINES += MC6854 -#MACHINES += MC68328 -MACHINES += MC68901 -MACHINES += MCCS1850 -MACHINES += M68307 -MACHINES += M68340 -MACHINES += MCF5206E -MACHINES += MICROTOUCH -#MACHINES += MIOT6530 -#MACHINES += MM58167 -MACHINES += MM58274C -MACHINES += MM74C922 -MACHINES += MOS6526 -MACHINES += MOS6529 -MACHINES += MIOT6530 -MACHINES += MOS6551 -#MACHINES += MOS6702 -#MACHINES += MOS8706 -#MACHINES += MOS8722 -#MACHINES += MOS8726 -#MACHINES += MPU401 -MACHINES += MSM5832 -MACHINES += MSM58321 -MACHINES += MSM6242 -#MACHINES += NCR5380 -#MACHINES += NCR5380N -#MACHINES += NCR5390 -MACHINES += NCR539x -#MACHINES += NCR53C7XX -MACHINES += NMC9306 -#MACHINES += NSC810 -MACHINES += NSCSI -#MACHINES += PC_FDC -#MACHINES += PC_LPT -#MACHINES += PCCARD -MACHINES += PCF8593 -MACHINES += PCI -MACHINES += PCKEYBRD -MACHINES += PIC8259 -MACHINES += PIT8253 -MACHINES += PLA -#MACHINES += PROFILE -MACHINES += R10696 -MACHINES += R10788 -MACHINES += RA17XX -#MACHINES += R64H156 -MACHINES += RF5C296 -#MACHINES += RIOT6532 -MACHINES += ROC10937 -MACHINES += RP5C01 -MACHINES += RP5C15 -MACHINES += RP5H01 -MACHINES += RTC4543 -MACHINES += RTC65271 -MACHINES += RTC9701 -MACHINES += S2636 -MACHINES += S3520CF -MACHINES += S3C2400 -MACHINES += S3C2410 -MACHINES += S3C2440 -#MACHINES += S3C44B0 -MACHINES += SATURN -MACHINES += SCSI -MACHINES += SCUDSP -#MACHINES += SECFLASH -MACHINES += SERFLASH -MACHINES += SMC91C9X -MACHINES += SMPC -MACHINES += STVCD -MACHINES += TC0091LVC -MACHINES += TIMEKPR -MACHINES += TMP68301 -#MACHINES += TMS5501 -MACHINES += TMS6100 -MACHINES += TMS9901 -MACHINES += TMS9902 -#MACHINES += TPI6525 -#MACHINES += TTL74123 -#MACHINES += TTL74145 -#MACHINES += TTL74148 -#MACHINES += TTL74153 -#MACHINES += TTL74181 -#MACHINES += TTL7474 -MACHINES += UPD1990A -MACHINES += UPD4992 -MACHINES += UPD4701 -MACHINES += UPD7002 -MACHINES += UPD71071 -MACHINES += UPD765 -MACHINES += V3021 -MACHINES += WD_FDC -MACHINES += WD11C00_17 -MACHINES += WD17XX -MACHINES += WD2010 -MACHINES += WD33C93 -MACHINES += X2212 -MACHINES += X76F041 -MACHINES += X76F100 -MACHINES += Z80CTC -MACHINES += Z80DART -MACHINES += Z80DMA -MACHINES += Z80PIO -MACHINES += Z80STI -MACHINES += Z8536 -MACHINES += SECFLASH -MACHINES += PCCARD -MACHINES += FDC37C665GT -#MACHINES += SMC92X4 -#MACHINES += TI99_HD -#MACHINES += STRATA -MACHINES += STEPPERS -#MACHINES += CORVUSHD -#MACHINES += WOZFDC -#MACHINES += DIABLO_HD - - -#------------------------------------------------- -# specify available bus cores -#------------------------------------------------- - -#BUSES += A1BUS -#BUSES += A2BUS -#BUSES += A7800 -#BUSES += A800 -#BUSES += ABCBUS -#BUSES += ABCKB -#BUSES += ADAM -#BUSES += ADAMNET -#BUSES += APF -#BUSES += ARCADIA -#BUSES += ASTROCADE -#BUSES += BML3 -#BUSES += BW2 -#BUSES += C64 -#BUSES += CBM2 -#BUSES += CBMIEC -BUSES += CENTRONICS -#BUSES += CHANNELF -#BUSES += COCO -#BUSES += COLECO -#BUSES += COMPUCOLOR -#BUSES += COMX35 -#BUSES += CPC -#BUSES += CRVISION -#BUSES += DMV -#BUSES += ECBBUS -#BUSES += ECONET -#BUSES += EP64 -#BUSES += EPSON_SIO -#BUSES += GAMEBOY -#BUSES += GBA -BUSES += GENERIC -#BUSES += IEEE488 -#BUSES += IMI7000 -#BUSES += INTV -#BUSES += IQ151 -BUSES += ISA -#BUSES += ISBX -#BUSES += KC -#BUSES += LPCI -#BUSES += MACPDS -#BUSES += MIDI -#BUSES += MEGADRIVE -#BUSES += MSX_SLOT -BUSES += NEOGEO -#BUSES += NES -#BUSES += NUBUS -#BUSES += O2 -#BUSES += ORICEXT -#BUSES += PCE -#BUSES += PC_JOY -#BUSES += PC_KBD -#BUSES += PET -#BUSES += PLUS4 -#BUSES += PSX_CONTROLLER -#BUSES += QL -BUSES += RS232 -#BUSES += S100 -#BUSES += SATURN -BUSES += SCSI -#BUSES += SCV -#BUSES += SEGA8 -#BUSES += SMS_CTRL -#BUSES += SMS_EXP -#BUSES += SNES -#BUSES += SPC1000 -#BUSES += TI99PEB -#BUSES += TVC -#BUSES += VBOY -#BUSES += VC4000 -#BUSES += VCS -#BUSES += VCS_CTRL -BUSES += VECTREX -#BUSES += VIC10 -#BUSES += VIC20 -#BUSES += VIDBRAIN -#BUSES += VIP -#BUSES += VTECH_IOEXP -#BUSES += VTECH_MEMEXP -#BUSES += WANGPC -#BUSES += WSWAN -#BUSES += X68K -#BUSES += Z88 -#BUSES += ZORRO - -#------------------------------------------------- -# this is the list of driver libraries that -# comprise MAME plus mamedriv.o which contains -# the list of drivers -#------------------------------------------------- - -DRVLIBS += \ - $(MAMEOBJ)/acorn.a \ - $(MAMEOBJ)/alba.a \ - $(MAMEOBJ)/alliedl.a \ - $(MAMEOBJ)/alpha.a \ - $(MAMEOBJ)/amiga.a \ - $(MAMEOBJ)/aristocr.a \ - $(MAMEOBJ)/ascii.a \ - $(MAMEOBJ)/atari.a \ - $(MAMEOBJ)/atlus.a \ - $(MAMEOBJ)/barcrest.a \ - $(MAMEOBJ)/bfm.a \ - $(MAMEOBJ)/bmc.a \ - $(MAMEOBJ)/capcom.a \ - $(MAMEOBJ)/cinemat.a \ - $(MAMEOBJ)/comad.a \ - $(MAMEOBJ)/cvs.a \ - $(MAMEOBJ)/dataeast.a \ - $(MAMEOBJ)/dgrm.a \ - $(MAMEOBJ)/dooyong.a \ - $(MAMEOBJ)/dynax.a \ - $(MAMEOBJ)/edevices.a \ - $(MAMEOBJ)/eolith.a \ - $(MAMEOBJ)/excelent.a \ - $(MAMEOBJ)/exidy.a \ - $(MAMEOBJ)/f32.a \ - $(MAMEOBJ)/funworld.a \ - $(MAMEOBJ)/fuuki.a \ - $(MAMEOBJ)/gaelco.a \ - $(MAMEOBJ)/gameplan.a \ - $(MAMEOBJ)/gametron.a \ - $(MAMEOBJ)/gottlieb.a \ - $(MAMEOBJ)/ibmpc.a \ - $(MAMEOBJ)/igs.a \ - $(MAMEOBJ)/irem.a \ - $(MAMEOBJ)/itech.a \ - $(MAMEOBJ)/jaleco.a \ - $(MAMEOBJ)/jpm.a \ - $(MAMEOBJ)/kaneko.a \ - $(MAMEOBJ)/konami.a \ - $(MAMEOBJ)/matic.a \ - $(MAMEOBJ)/maygay.a \ - $(MAMEOBJ)/meadows.a \ - $(MAMEOBJ)/merit.a \ - $(MAMEOBJ)/metro.a \ - $(MAMEOBJ)/midcoin.a \ - $(MAMEOBJ)/midw8080.a \ - $(MAMEOBJ)/midway.a \ - $(MAMEOBJ)/namco.a \ - $(MAMEOBJ)/nasco.a \ - $(MAMEOBJ)/neogeo.a \ - $(MAMEOBJ)/nichibut.a \ - $(MAMEOBJ)/nintendo.a \ - $(MAMEOBJ)/nix.a \ - $(MAMEOBJ)/nmk.a \ - $(MAMEOBJ)/omori.a \ - $(MAMEOBJ)/olympia.a \ - $(MAMEOBJ)/orca.a \ - $(MAMEOBJ)/pacific.a \ - $(MAMEOBJ)/pacman.a \ - $(MAMEOBJ)/pce.a \ - $(MAMEOBJ)/phoenix.a \ - $(MAMEOBJ)/playmark.a \ - $(MAMEOBJ)/psikyo.a \ - $(MAMEOBJ)/ramtek.a \ - $(MAMEOBJ)/rare.a \ - $(MAMEOBJ)/sanritsu.a \ - $(MAMEOBJ)/sega.a \ - $(MAMEOBJ)/seibu.a \ - $(MAMEOBJ)/seta.a \ - $(MAMEOBJ)/sigma.a \ - $(MAMEOBJ)/snk.a \ - $(MAMEOBJ)/sony.a \ - $(MAMEOBJ)/stern.a \ - $(MAMEOBJ)/subsino.a \ - $(MAMEOBJ)/sun.a \ - $(MAMEOBJ)/suna.a \ - $(MAMEOBJ)/sure.a \ - $(MAMEOBJ)/taito.a \ - $(MAMEOBJ)/tatsumi.a \ - $(MAMEOBJ)/tch.a \ - $(MAMEOBJ)/tecfri.a \ - $(MAMEOBJ)/technos.a \ - $(MAMEOBJ)/tehkan.a \ - $(MAMEOBJ)/thepit.a \ - $(MAMEOBJ)/toaplan.a \ - $(MAMEOBJ)/tong.a \ - $(MAMEOBJ)/unico.a \ - $(MAMEOBJ)/univers.a \ - $(MAMEOBJ)/upl.a \ - $(MAMEOBJ)/valadon.a \ - $(MAMEOBJ)/veltmjr.a \ - $(MAMEOBJ)/venture.a \ - $(MAMEOBJ)/vsystem.a \ - $(MAMEOBJ)/yunsung.a \ - $(MAMEOBJ)/zaccaria.a \ - $(MAMEOBJ)/misc.a \ - $(MAMEOBJ)/pinball.a \ - $(MAMEOBJ)/shared.a \ - - - -#------------------------------------------------- -# the following files are general components and -# shared across a number of drivers -#------------------------------------------------- - -$(MAMEOBJ)/shared.a: \ - $(MACHINE)/nmk112.o \ - $(MACHINE)/pcshare.o \ - $(MACHINE)/segacrpt.o \ - $(MACHINE)/segacrp2.o \ - $(MACHINE)/ticket.o \ - $(VIDEO)/avgdvg.o \ - $(AUDIO)/dcs.o \ - $(AUDIO)/decobsmt.o \ - $(AUDIO)/segam1audio.o \ - -#------------------------------------------------- -# manufacturer-specific groupings for drivers -#------------------------------------------------- - -$(MAMEOBJ)/acorn.a: \ - $(DRIVERS)/ertictac.o \ - $(DRIVERS)/ssfindo.o \ - $(DRIVERS)/aristmk5.o \ - $(MACHINE)/archimds.o \ - $(VIDEO)/archimds.o \ - -$(MAMEOBJ)/alba.a: \ - $(DRIVERS)/albazc.o \ - $(DRIVERS)/albazg.o \ - $(DRIVERS)/rmhaihai.o \ - -$(MAMEOBJ)/alliedl.a: \ - $(DRIVERS)/ace.o \ - $(DRIVERS)/aleisttl.o \ - $(DRIVERS)/clayshoo.o \ - -$(MAMEOBJ)/alpha.a: \ - $(DRIVERS)/alpha68k.o $(VIDEO)/alpha68k.o \ - $(DRIVERS)/champbas.o $(VIDEO)/champbas.o \ - $(DRIVERS)/equites.o $(VIDEO)/equites.o \ - $(DRIVERS)/meijinsn.o \ - $(DRIVERS)/shougi.o \ - -$(MAMEOBJ)/amiga.a: \ - $(DRIVERS)/alg.o \ - $(MACHINE)/amiga.o $(VIDEO)/amiga.o $(VIDEO)/amigaaga.o \ - $(DRIVERS)/arcadia.o \ - $(DRIVERS)/cubo.o \ - $(DRIVERS)/mquake.o \ - $(DRIVERS)/upscope.o \ - -$(MAMEOBJ)/aristocr.a: \ - $(DRIVERS)/aristmk4.o \ - $(DRIVERS)/aristmk6.o \ - $(DRIVERS)/caswin.o \ - -$(MAMEOBJ)/ascii.a: \ - $(DRIVERS)/big10.o \ - $(DRIVERS)/forte2.o \ - $(DRIVERS)/pengadvb.o \ - $(DRIVERS)/sangho.o \ - $(DRIVERS)/sfkick.o \ - -$(MAMEOBJ)/atari.a: \ - $(DRIVERS)/arcadecl.o $(VIDEO)/arcadecl.o \ - $(DRIVERS)/asteroid.o $(MACHINE)/asteroid.o $(AUDIO)/asteroid.o $(AUDIO)/llander.o \ - $(DRIVERS)/atarifb.o $(MACHINE)/atarifb.o $(AUDIO)/atarifb.o $(VIDEO)/atarifb.o \ - $(DRIVERS)/atarig1.o $(VIDEO)/atarig1.o \ - $(DRIVERS)/atarig42.o $(VIDEO)/atarig42.o \ - $(DRIVERS)/atarigt.o $(VIDEO)/atarigt.o \ - $(DRIVERS)/atarigx2.o $(VIDEO)/atarigx2.o \ - $(DRIVERS)/atarisy1.o $(VIDEO)/atarisy1.o \ - $(DRIVERS)/atarisy2.o $(VIDEO)/atarisy2.o \ - $(DRIVERS)/atarisy4.o \ - $(DRIVERS)/atarittl.o \ - $(DRIVERS)/atetris.o $(VIDEO)/atetris.o \ - $(DRIVERS)/avalnche.o $(AUDIO)/avalnche.o \ - $(DRIVERS)/badlands.o $(VIDEO)/badlands.o \ - $(DRIVERS)/bartop52.o \ - $(DRIVERS)/batman.o $(VIDEO)/batman.o \ - $(DRIVERS)/beathead.o $(VIDEO)/beathead.o \ - $(DRIVERS)/blstroid.o $(VIDEO)/blstroid.o \ - $(DRIVERS)/boxer.o \ - $(DRIVERS)/bsktball.o $(MACHINE)/bsktball.o $(AUDIO)/bsktball.o $(VIDEO)/bsktball.o \ - $(DRIVERS)/bwidow.o $(AUDIO)/bwidow.o \ - $(DRIVERS)/bzone.o $(AUDIO)/bzone.o \ - $(DRIVERS)/canyon.o $(AUDIO)/canyon.o $(VIDEO)/canyon.o \ - $(DRIVERS)/cball.o \ - $(DRIVERS)/ccastles.o $(VIDEO)/ccastles.o \ - $(DRIVERS)/centiped.o $(VIDEO)/centiped.o \ - $(DRIVERS)/cloak.o $(VIDEO)/cloak.o \ - $(DRIVERS)/cloud9.o $(VIDEO)/cloud9.o \ - $(DRIVERS)/cmmb.o \ - $(DRIVERS)/cops.o \ - $(DRIVERS)/copsnrob.o $(AUDIO)/copsnrob.o $(VIDEO)/copsnrob.o \ - $(DRIVERS)/cyberbal.o $(AUDIO)/cyberbal.o $(VIDEO)/cyberbal.o \ - $(DRIVERS)/destroyr.o \ - $(DRIVERS)/dragrace.o $(AUDIO)/dragrace.o $(VIDEO)/dragrace.o \ - $(DRIVERS)/eprom.o $(VIDEO)/eprom.o \ - $(DRIVERS)/firefox.o \ - $(DRIVERS)/firetrk.o $(AUDIO)/firetrk.o $(VIDEO)/firetrk.o \ - $(DRIVERS)/flyball.o \ - $(DRIVERS)/foodf.o $(VIDEO)/foodf.o \ - $(DRIVERS)/gauntlet.o $(VIDEO)/gauntlet.o \ - $(DRIVERS)/harddriv.o $(MACHINE)/harddriv.o $(AUDIO)/harddriv.o $(VIDEO)/harddriv.o \ - $(DRIVERS)/irobot.o $(MACHINE)/irobot.o $(VIDEO)/irobot.o \ - $(DRIVERS)/jaguar.o $(AUDIO)/jaguar.o $(VIDEO)/jaguar.o \ - $(DRIVERS)/jedi.o $(AUDIO)/jedi.o $(VIDEO)/jedi.o \ - $(DRIVERS)/klax.o $(VIDEO)/klax.o \ - $(DRIVERS)/liberatr.o $(VIDEO)/liberatr.o \ - $(DRIVERS)/mediagx.o \ - $(DRIVERS)/metalmx.o \ - $(DRIVERS)/mgolf.o \ - $(DRIVERS)/mhavoc.o $(MACHINE)/mhavoc.o \ - $(DRIVERS)/missile.o \ - $(DRIVERS)/nitedrvr.o $(MACHINE)/nitedrvr.o $(AUDIO)/nitedrvr.o $(VIDEO)/nitedrvr.o \ - $(DRIVERS)/offtwall.o $(VIDEO)/offtwall.o \ - $(DRIVERS)/orbit.o $(AUDIO)/orbit.o $(VIDEO)/orbit.o \ - $(DRIVERS)/pong.o \ - $(DRIVERS)/nl_pong.o \ - $(DRIVERS)/nl_pongd.o \ - $(DRIVERS)/poolshrk.o $(AUDIO)/poolshrk.o $(VIDEO)/poolshrk.o \ - $(DRIVERS)/quantum.o \ - $(DRIVERS)/quizshow.o \ - $(DRIVERS)/rampart.o $(VIDEO)/rampart.o \ - $(DRIVERS)/relief.o $(VIDEO)/relief.o \ - $(DRIVERS)/runaway.o $(VIDEO)/runaway.o \ - $(DRIVERS)/sbrkout.o \ - $(DRIVERS)/shuuz.o $(VIDEO)/shuuz.o \ - $(DRIVERS)/skullxbo.o $(VIDEO)/skullxbo.o \ - $(DRIVERS)/skydiver.o $(AUDIO)/skydiver.o $(VIDEO)/skydiver.o \ - $(DRIVERS)/skyraid.o $(AUDIO)/skyraid.o $(VIDEO)/skyraid.o \ - $(DRIVERS)/sprint2.o $(AUDIO)/sprint2.o $(VIDEO)/sprint2.o \ - $(DRIVERS)/sprint4.o $(VIDEO)/sprint4.o $(AUDIO)/sprint4.o \ - $(DRIVERS)/sprint8.o $(AUDIO)/sprint8.o $(VIDEO)/sprint8.o \ - $(DRIVERS)/starshp1.o $(AUDIO)/starshp1.o $(VIDEO)/starshp1.o \ - $(DRIVERS)/starwars.o $(MACHINE)/starwars.o $(AUDIO)/starwars.o \ - $(DRIVERS)/subs.o $(MACHINE)/subs.o $(AUDIO)/subs.o $(VIDEO)/subs.o \ - $(DRIVERS)/tank8.o $(AUDIO)/tank8.o $(VIDEO)/tank8.o \ - $(DRIVERS)/tempest.o \ - $(DRIVERS)/thunderj.o $(VIDEO)/thunderj.o \ - $(DRIVERS)/tomcat.o \ - $(DRIVERS)/toobin.o $(VIDEO)/toobin.o \ - $(DRIVERS)/tourtabl.o $(VIDEO)/tia.o \ - $(DRIVERS)/triplhnt.o $(AUDIO)/triplhnt.o $(VIDEO)/triplhnt.o \ - $(DRIVERS)/tunhunt.o $(VIDEO)/tunhunt.o \ - $(DRIVERS)/ultratnk.o $(VIDEO)/ultratnk.o \ - $(DRIVERS)/videopin.o $(AUDIO)/videopin.o $(VIDEO)/videopin.o \ - $(DRIVERS)/vindictr.o $(VIDEO)/vindictr.o \ - $(DRIVERS)/wolfpack.o $(VIDEO)/wolfpack.o \ - $(DRIVERS)/xybots.o $(VIDEO)/xybots.o \ - $(MACHINE)/asic65.o \ - $(MACHINE)/atari_vg.o \ - $(MACHINE)/atarigen.o \ - $(MACHINE)/mathbox.o \ - $(MACHINE)/slapstic.o \ - $(AUDIO)/atarijsa.o \ - $(AUDIO)/cage.o \ - $(AUDIO)/redbaron.o \ - $(VIDEO)/atarimo.o \ - $(VIDEO)/atarirle.o \ - -$(MAMEOBJ)/atlus.a: \ - $(DRIVERS)/blmbycar.o $(VIDEO)/blmbycar.o \ - $(DRIVERS)/ohmygod.o $(VIDEO)/ohmygod.o \ - $(DRIVERS)/powerins.o $(VIDEO)/powerins.o \ - $(DRIVERS)/bowltry.o \ - -$(MAMEOBJ)/barcrest.a: \ - $(DRIVERS)/mpu2.o \ - $(DRIVERS)/mpu3.o \ - $(DRIVERS)/mpu4hw.o $(DRIVERS)/mpu4sw.o $(DRIVERS)/mpu4.o \ - $(DRIVERS)/mpu4mod2sw.o \ - $(DRIVERS)/mpu4mod4yam.o \ - $(DRIVERS)/mpu4plasma.o \ - $(DRIVERS)/mpu4dealem.o \ - $(DRIVERS)/mpu4vid.o \ - $(DRIVERS)/mpu4avan.o \ - $(DRIVERS)/mpu4union.o \ - $(DRIVERS)/mpu4concept.o \ - $(DRIVERS)/mpu4empire.o \ - $(DRIVERS)/mpu4mdm.o \ - $(DRIVERS)/mpu4crystal.o \ - $(DRIVERS)/mpu4bwb.o \ - $(DRIVERS)/mpu4misc.o \ - $(DRIVERS)/mpu5hw.o $(DRIVERS)/mpu5.o \ - $(VIDEO)/awpvid.o \ - $(MACHINE)/meters.o \ - -$(MAMEOBJ)/bfm.a: \ - $(DRIVERS)/bfcobra.o \ - $(MACHINE)/bfm_comn.o \ - $(DRIVERS)/bfm_sc1.o \ - $(DRIVERS)/bfm_sc2.o $(VIDEO)/bfm_adr2.o \ - $(DRIVERS)/bfm_sc4.o \ - $(DRIVERS)/bfm_sc4h.o \ - $(DRIVERS)/bfm_sc5.o \ - $(DRIVERS)/bfm_sc5sw.o \ - $(DRIVERS)/bfm_ad5.o \ - $(DRIVERS)/bfm_ad5sw.o \ - $(DRIVERS)/bfm_sc45_helper.o \ - $(DRIVERS)/bfm_swp.o \ - $(DRIVERS)/bfmsys83.o \ - $(DRIVERS)/bfmsys85.o \ - $(MACHINE)/sec.o \ - $(MACHINE)/bfm_bd1.o $(MACHINE)/bfm_bda.o $(VIDEO)/bfm_dm01.o \ - $(DRIVERS)/rastersp.o \ - -$(MAMEOBJ)/bmc.a: \ - $(DRIVERS)/bmcbowl.o \ - $(DRIVERS)/koftball.o \ - $(DRIVERS)/popobear.o \ - $(DRIVERS)/bmcpokr.o \ - -$(MAMEOBJ)/capcom.a: \ - $(DRIVERS)/1942.o $(VIDEO)/1942.o \ - $(DRIVERS)/1943.o $(VIDEO)/1943.o \ - $(DRIVERS)/alien.o \ - $(DRIVERS)/bionicc.o $(VIDEO)/bionicc.o \ - $(DRIVERS)/supduck.o \ - $(VIDEO)/tigeroad_spr.o \ - $(DRIVERS)/blktiger.o $(VIDEO)/blktiger.o \ - $(DRIVERS)/cbasebal.o $(VIDEO)/cbasebal.o \ - $(DRIVERS)/commando.o $(VIDEO)/commando.o \ - $(DRIVERS)/cps1.o $(VIDEO)/cps1.o \ - $(DRIVERS)/kenseim.o \ - $(DRIVERS)/cps2.o $(MACHINE)/cps2crpt.o \ - $(DRIVERS)/cps3.o $(AUDIO)/cps3.o \ - $(DRIVERS)/egghunt.o \ - $(DRIVERS)/exedexes.o $(VIDEO)/exedexes.o \ - $(DRIVERS)/fcrash.o \ - $(DRIVERS)/gng.o $(VIDEO)/gng.o \ - $(DRIVERS)/gunsmoke.o $(VIDEO)/gunsmoke.o \ - $(DRIVERS)/higemaru.o $(VIDEO)/higemaru.o \ - $(DRIVERS)/lastduel.o $(VIDEO)/lastduel.o \ - $(DRIVERS)/lwings.o $(VIDEO)/lwings.o \ - $(DRIVERS)/mitchell.o $(VIDEO)/mitchell.o \ - $(DRIVERS)/sf.o $(VIDEO)/sf.o \ - $(DRIVERS)/sidearms.o $(VIDEO)/sidearms.o \ - $(DRIVERS)/sonson.o $(VIDEO)/sonson.o \ - $(DRIVERS)/srumbler.o $(VIDEO)/srumbler.o \ - $(DRIVERS)/tigeroad.o $(VIDEO)/tigeroad.o $(MACHINE)/tigeroad.o \ - $(DRIVERS)/vulgus.o $(VIDEO)/vulgus.o \ - $(MACHINE)/kabuki.o \ - -$(MAMEOBJ)/cinemat.a: \ - $(DRIVERS)/ataxx.o \ - $(DRIVERS)/cinemat.o $(AUDIO)/cinemat.o $(VIDEO)/cinemat.o \ - $(DRIVERS)/cchasm.o $(MACHINE)/cchasm.o $(AUDIO)/cchasm.o $(VIDEO)/cchasm.o \ - $(DRIVERS)/dlair.o \ - $(DRIVERS)/dlair2.o \ - $(DRIVERS)/embargo.o \ - $(DRIVERS)/jack.o $(VIDEO)/jack.o \ - $(DRIVERS)/leland.o $(MACHINE)/leland.o $(AUDIO)/leland.o $(VIDEO)/leland.o \ - -$(MAMEOBJ)/comad.a: \ - $(DRIVERS)/funybubl.o $(VIDEO)/funybubl.o \ - $(DRIVERS)/galspnbl.o $(VIDEO)/galspnbl.o \ - $(DRIVERS)/zerozone.o $(VIDEO)/zerozone.o \ - -$(MAMEOBJ)/cvs.a: \ - $(DRIVERS)/cvs.o $(VIDEO)/cvs.o \ - $(DRIVERS)/galaxia.o $(VIDEO)/galaxia.o \ - $(DRIVERS)/quasar.o $(VIDEO)/quasar.o \ - -$(MAMEOBJ)/dataeast.a: \ - $(DRIVERS)/actfancr.o $(VIDEO)/actfancr.o \ - $(DRIVERS)/astrof.o $(AUDIO)/astrof.o \ - $(DRIVERS)/backfire.o \ - $(DRIVERS)/battlera.o $(VIDEO)/battlera.o \ - $(DRIVERS)/boogwing.o $(VIDEO)/boogwing.o \ - $(DRIVERS)/brkthru.o $(VIDEO)/brkthru.o \ - $(DRIVERS)/btime.o $(MACHINE)/btime.o $(VIDEO)/btime.o \ - $(DRIVERS)/bwing.o $(VIDEO)/bwing.o \ - $(DRIVERS)/cbuster.o $(VIDEO)/cbuster.o \ - $(DRIVERS)/chanbara.o \ - $(DRIVERS)/cninja.o $(VIDEO)/cninja.o \ - $(DRIVERS)/cntsteer.o \ - $(DRIVERS)/compgolf.o $(VIDEO)/compgolf.o \ - $(DRIVERS)/darkseal.o $(VIDEO)/darkseal.o \ - $(DRIVERS)/dassault.o $(VIDEO)/dassault.o \ - $(DRIVERS)/dblewing.o \ - $(DRIVERS)/dec0.o $(MACHINE)/dec0.o $(VIDEO)/dec0.o \ - $(DRIVERS)/dec8.o $(VIDEO)/dec8.o \ - $(MACHINE)/deco222.o \ - $(MACHINE)/decocpu7.o \ - $(MACHINE)/decocpu6.o \ - $(DRIVERS)/deco_ld.o \ - $(DRIVERS)/deco_mlc.o $(VIDEO)/deco_mlc.o \ - $(DRIVERS)/deco156.o $(MACHINE)/deco156.o \ - $(DRIVERS)/deco32.o $(VIDEO)/deco32.o $(VIDEO)/dvi.o \ - $(VIDEO)/deco_zoomspr.o \ - $(DRIVERS)/decocass.o $(MACHINE)/decocass.o $(MACHINE)/decocass_tape.o $(VIDEO)/decocass.o \ - $(DRIVERS)/deshoros.o \ - $(DRIVERS)/dietgo.o $(VIDEO)/dietgo.o \ - $(DRIVERS)/dreambal.o \ - $(DRIVERS)/exprraid.o $(VIDEO)/exprraid.o \ - $(DRIVERS)/firetrap.o $(VIDEO)/firetrap.o \ - $(DRIVERS)/funkyjet.o $(VIDEO)/funkyjet.o \ - $(DRIVERS)/karnov.o $(VIDEO)/karnov.o \ - $(DRIVERS)/kchamp.o $(VIDEO)/kchamp.o \ - $(DRIVERS)/kingobox.o $(VIDEO)/kingobox.o \ - $(DRIVERS)/lemmings.o $(VIDEO)/lemmings.o \ - $(DRIVERS)/liberate.o $(VIDEO)/liberate.o \ - $(DRIVERS)/madalien.o $(AUDIO)/madalien.o $(VIDEO)/madalien.o \ - $(DRIVERS)/madmotor.o $(VIDEO)/madmotor.o \ - $(DRIVERS)/metlclsh.o $(VIDEO)/metlclsh.o \ - $(DRIVERS)/mirage.o \ - $(DRIVERS)/pcktgal.o $(VIDEO)/pcktgal.o \ - $(DRIVERS)/pktgaldx.o $(VIDEO)/pktgaldx.o \ - $(DRIVERS)/progolf.o \ - $(DRIVERS)/rohga.o $(VIDEO)/rohga.o \ - $(DRIVERS)/shootout.o $(VIDEO)/shootout.o \ - $(DRIVERS)/sidepckt.o $(VIDEO)/sidepckt.o \ - $(DRIVERS)/simpl156.o $(VIDEO)/simpl156.o \ - $(DRIVERS)/sshangha.o $(VIDEO)/sshangha.o \ - $(DRIVERS)/stadhero.o $(VIDEO)/stadhero.o \ - $(DRIVERS)/supbtime.o $(VIDEO)/supbtime.o \ - $(DRIVERS)/tryout.o $(VIDEO)/tryout.o \ - $(DRIVERS)/tumbleb.o $(VIDEO)/tumbleb.o \ - $(DRIVERS)/tumblep.o $(VIDEO)/tumblep.o \ - $(DRIVERS)/vaportra.o $(VIDEO)/vaportra.o \ - $(MACHINE)/deco102.o \ - $(MACHINE)/decocrpt.o \ - $(MACHINE)/deco104.o \ - $(MACHINE)/deco146.o \ - $(VIDEO)/decbac06.o \ - $(VIDEO)/deco16ic.o \ - $(VIDEO)/decocomn.o \ - $(VIDEO)/decospr.o \ - $(VIDEO)/decmxc06.o \ - $(VIDEO)/deckarn.o \ - -$(MAMEOBJ)/dgrm.a: \ - $(DRIVERS)/blackt96.o \ - $(DRIVERS)/pokechmp.o $(VIDEO)/pokechmp.o \ - -$(MAMEOBJ)/dooyong.a: \ - $(DRIVERS)/dooyong.o $(VIDEO)/dooyong.o \ - $(DRIVERS)/gundealr.o $(VIDEO)/gundealr.o \ - -$(MAMEOBJ)/dynax.a: \ - $(DRIVERS)/ddenlovr.o \ - $(DRIVERS)/dynax.o $(VIDEO)/dynax.o \ - $(DRIVERS)/hnayayoi.o $(VIDEO)/hnayayoi.o \ - $(DRIVERS)/realbrk.o $(VIDEO)/realbrk.o \ - $(DRIVERS)/royalmah.o \ - -$(MAMEOBJ)/edevices.a: \ - $(DRIVERS)/diverboy.o \ - $(DRIVERS)/fantland.o $(VIDEO)/fantland.o \ - $(DRIVERS)/mwarr.o \ - $(DRIVERS)/mugsmash.o $(VIDEO)/mugsmash.o \ - $(DRIVERS)/ppmast93.o \ - $(DRIVERS)/pzletime.o \ - $(DRIVERS)/stlforce.o $(VIDEO)/stlforce.o \ - $(DRIVERS)/twins.o \ - -$(MAMEOBJ)/eolith.a: \ - $(DRIVERS)/eolith.o $(VIDEO)/eolith.o \ - $(DRIVERS)/eolith16.o \ - $(DRIVERS)/eolithsp.o \ - $(DRIVERS)/ghosteo.o \ - $(DRIVERS)/vegaeo.o \ - -$(MAMEOBJ)/excelent.a: \ - $(DRIVERS)/aquarium.o $(VIDEO)/aquarium.o \ - $(DRIVERS)/d9final.o \ - $(DRIVERS)/dblcrown.o \ - $(DRIVERS)/gcpinbal.o $(VIDEO)/gcpinbal.o \ - $(VIDEO)/excellent_spr.o \ - $(DRIVERS)/lastbank.o \ - -$(MAMEOBJ)/exidy.a: \ - $(DRIVERS)/carpolo.o $(MACHINE)/carpolo.o $(VIDEO)/carpolo.o \ - $(DRIVERS)/circus.o $(AUDIO)/circus.o $(VIDEO)/circus.o \ - $(DRIVERS)/exidy.o $(AUDIO)/exidy.o $(VIDEO)/exidy.o $(AUDIO)/targ.o \ - $(DRIVERS)/exidy440.o $(AUDIO)/exidy440.o $(VIDEO)/exidy440.o \ - $(DRIVERS)/exidyttl.o \ - $(DRIVERS)/maxaflex.o $(MACHINE)/atari.o $(VIDEO)/atari.o $(VIDEO)/antic.o $(VIDEO)/gtia.o \ - $(DRIVERS)/starfire.o $(VIDEO)/starfire.o \ - $(DRIVERS)/vertigo.o $(MACHINE)/vertigo.o $(VIDEO)/vertigo.o \ - $(DRIVERS)/victory.o $(VIDEO)/victory.o \ - -$(MAMEOBJ)/f32.a: \ - $(DRIVERS)/crospang.o $(VIDEO)/crospang.o \ - $(DRIVERS)/silvmil.o \ - $(DRIVERS)/f-32.o \ - -$(MAMEOBJ)/funworld.a: \ - $(DRIVERS)/4roses.o \ - $(DRIVERS)/funworld.o $(VIDEO)/funworld.o \ - $(DRIVERS)/snookr10.o $(VIDEO)/snookr10.o \ - -$(MAMEOBJ)/fuuki.a: \ - $(DRIVERS)/fuukifg2.o $(VIDEO)/fuukifg2.o \ - $(DRIVERS)/fuukifg3.o $(VIDEO)/fuukifg3.o \ - $(VIDEO)/fuukifg.o \ - -$(MAMEOBJ)/gaelco.a: \ - $(DRIVERS)/atvtrack.o \ - $(DRIVERS)/gaelco.o $(VIDEO)/gaelco.o $(MACHINE)/gaelcrpt.o \ - $(DRIVERS)/gaelco2.o $(MACHINE)/gaelco2.o $(VIDEO)/gaelco2.o \ - $(DRIVERS)/gaelco3d.o $(VIDEO)/gaelco3d.o $(MACHINE)/gaelco3d.o \ - $(DRIVERS)/glass.o $(VIDEO)/glass.o \ - $(DRIVERS)/mastboy.o \ - $(DRIVERS)/splash.o $(VIDEO)/splash.o \ - $(DRIVERS)/targeth.o $(VIDEO)/targeth.o \ - $(DRIVERS)/thoop2.o $(VIDEO)/thoop2.o \ - $(DRIVERS)/tokyocop.o \ - $(DRIVERS)/wrally.o $(MACHINE)/wrally.o $(VIDEO)/wrally.o \ - $(DRIVERS)/xorworld.o $(VIDEO)/xorworld.o \ - -$(MAMEOBJ)/gameplan.a: \ - $(DRIVERS)/enigma2.o \ - $(DRIVERS)/gameplan.o $(VIDEO)/gameplan.o \ - $(DRIVERS)/toratora.o \ - -$(MAMEOBJ)/gametron.a: \ - $(DRIVERS)/gatron.o $(VIDEO)/gatron.o \ - $(DRIVERS)/gotya.o $(AUDIO)/gotya.o $(VIDEO)/gotya.o \ - $(DRIVERS)/sbugger.o $(VIDEO)/sbugger.o \ - -$(MAMEOBJ)/gottlieb.a: \ - $(DRIVERS)/exterm.o $(VIDEO)/exterm.o \ - $(DRIVERS)/gottlieb.o $(AUDIO)/gottlieb.o $(VIDEO)/gottlieb.o \ - -$(MAMEOBJ)/ibmpc.a: \ - $(DRIVERS)/calchase.o \ - $(DRIVERS)/fruitpc.o \ - $(DRIVERS)/pangofun.o \ - $(DRIVERS)/pcat_dyn.o \ - $(DRIVERS)/pcat_nit.o \ - $(DRIVERS)/pcxt.o \ - $(DRIVERS)/quakeat.o \ - $(DRIVERS)/queen.o \ - $(DRIVERS)/igspc.o \ - -$(MAMEOBJ)/igs.a: \ - $(DRIVERS)/cabaret.o \ - $(DRIVERS)/ddz.o \ - $(DRIVERS)/dunhuang.o \ - $(DRIVERS)/goldstar.o $(VIDEO)/goldstar.o \ - $(DRIVERS)/jackie.o \ - $(DRIVERS)/igspoker.o \ - $(DRIVERS)/igs009.o \ - $(DRIVERS)/igs011.o \ - $(DRIVERS)/igs017.o \ - $(DRIVERS)/igs_m027.o \ - $(DRIVERS)/igs_m036.o \ - $(DRIVERS)/iqblock.o $(VIDEO)/iqblock.o \ - $(DRIVERS)/lordgun.o $(VIDEO)/lordgun.o \ - $(DRIVERS)/pgm.o $(VIDEO)/pgm.o $(MACHINE)/pgmprot_igs027a_type1.o $(MACHINE)/pgmprot_igs027a_type2.o $(MACHINE)/pgmprot_igs027a_type3.o $(MACHINE)/pgmprot_igs025_igs012.o $(MACHINE)/pgmprot_igs025_igs022.o $(MACHINE)/pgmprot_igs025_igs028.o $(MACHINE)/pgmprot_orlegend.o \ - $(DRIVERS)/pgm2.o \ - $(DRIVERS)/spoker.o \ - $(MACHINE)/igs036crypt.o \ - $(MACHINE)/pgmcrypt.o \ - $(MACHINE)/igs025.o \ - $(MACHINE)/igs022.o \ - $(MACHINE)/igs028.o \ - -$(MAMEOBJ)/irem.a: \ - $(DRIVERS)/m10.o $(VIDEO)/m10.o \ - $(DRIVERS)/m14.o \ - $(DRIVERS)/m52.o $(VIDEO)/m52.o \ - $(DRIVERS)/m57.o $(VIDEO)/m57.o \ - $(DRIVERS)/m58.o $(VIDEO)/m58.o \ - $(DRIVERS)/m62.o $(VIDEO)/m62.o \ - $(DRIVERS)/m63.o \ - $(DRIVERS)/m72.o $(AUDIO)/m72.o $(VIDEO)/m72.o \ - $(DRIVERS)/m90.o $(VIDEO)/m90.o \ - $(DRIVERS)/m92.o $(VIDEO)/m92.o \ - $(DRIVERS)/m107.o $(VIDEO)/m107.o \ - $(DRIVERS)/olibochu.o \ - $(DRIVERS)/redalert.o $(AUDIO)/redalert.o $(VIDEO)/redalert.o \ - $(DRIVERS)/shisen.o $(VIDEO)/shisen.o \ - $(DRIVERS)/travrusa.o $(VIDEO)/travrusa.o \ - $(DRIVERS)/vigilant.o $(VIDEO)/vigilant.o \ - $(MACHINE)/irem_cpu.o \ - $(AUDIO)/irem.o \ - -$(MAMEOBJ)/itech.a: \ - $(DRIVERS)/capbowl.o $(VIDEO)/capbowl.o \ - $(DRIVERS)/itech8.o $(MACHINE)/slikshot.o $(VIDEO)/itech8.o \ - $(DRIVERS)/itech32.o $(VIDEO)/itech32.o \ - $(DRIVERS)/iteagle.o $(MACHINE)/iteagle_fpga.o \ - -$(MAMEOBJ)/jaleco.a: \ - $(DRIVERS)/aeroboto.o $(VIDEO)/aeroboto.o \ - $(DRIVERS)/argus.o $(VIDEO)/argus.o \ - $(DRIVERS)/bestleag.o \ - $(DRIVERS)/bigstrkb.o $(VIDEO)/bigstrkb.o \ - $(DRIVERS)/blueprnt.o $(VIDEO)/blueprnt.o \ - $(DRIVERS)/bnstars.o \ - $(DRIVERS)/cischeat.o $(VIDEO)/cischeat.o \ - $(DRIVERS)/citycon.o $(VIDEO)/citycon.o \ - $(DRIVERS)/ddayjlc.o \ - $(DRIVERS)/exerion.o $(VIDEO)/exerion.o \ - $(DRIVERS)/fcombat.o $(VIDEO)/fcombat.o \ - $(DRIVERS)/ginganin.o $(VIDEO)/ginganin.o \ - $(DRIVERS)/homerun.o $(VIDEO)/homerun.o \ - $(DRIVERS)/megasys1.o $(VIDEO)/megasys1.o \ - $(DRIVERS)/momoko.o $(VIDEO)/momoko.o \ - $(DRIVERS)/ms32.o $(VIDEO)/ms32.o \ - $(DRIVERS)/psychic5.o $(VIDEO)/psychic5.o \ - $(DRIVERS)/pturn.o \ - $(DRIVERS)/skyfox.o $(VIDEO)/skyfox.o \ - $(DRIVERS)/tetrisp2.o $(VIDEO)/tetrisp2.o \ - $(MACHINE)/jalcrpt.o \ - $(VIDEO)/jalblend.o \ - -$(MAMEOBJ)/jpm.a: \ - $(DRIVERS)/guab.o \ - $(DRIVERS)/jpmsys5.o \ - $(DRIVERS)/jpmsys5sw.o \ - $(DRIVERS)/jpmmps.o \ - $(DRIVERS)/jpms80.o \ - $(DRIVERS)/jpmsru.o \ - $(DRIVERS)/jpmimpct.o $(VIDEO)/jpmimpct.o \ - $(DRIVERS)/jpmimpctsw.o \ - $(DRIVERS)/pluto5.o \ - $(DRIVERS)/jpmsys7.o \ - $(VIDEO)/awpvid.o \ - $(MACHINE)/meters.o \ - -$(MAMEOBJ)/kaneko.a: \ - $(DRIVERS)/airbustr.o $(VIDEO)/airbustr.o \ - $(DRIVERS)/djboy.o $(VIDEO)/djboy.o \ - $(DRIVERS)/expro02.o \ - $(DRIVERS)/galpanic.o $(VIDEO)/galpanic.o \ - $(DRIVERS)/galpani2.o $(VIDEO)/galpani2.o \ - $(DRIVERS)/galpani3.o \ - $(VIDEO)/kaneko_grap2.o \ - $(DRIVERS)/hvyunit.o \ - $(DRIVERS)/jchan.o \ - $(DRIVERS)/kaneko16.o $(VIDEO)/kaneko16.o \ - $(VIDEO)/kaneko_tmap.o \ - $(VIDEO)/kaneko_spr.o \ - $(MACHINE)/kaneko_hit.o \ - $(MACHINE)/kaneko_calc3.o \ - $(MACHINE)/kaneko_toybox.o \ - $(DRIVERS)/sandscrp.o \ - $(DRIVERS)/suprnova.o $(VIDEO)/suprnova.o \ - $(VIDEO)/sknsspr.o \ - -$(MAMEOBJ)/konami.a: \ - $(DRIVERS)/88games.o $(VIDEO)/88games.o \ - $(DRIVERS)/ajax.o $(MACHINE)/ajax.o $(VIDEO)/ajax.o \ - $(DRIVERS)/aliens.o $(VIDEO)/aliens.o \ - $(DRIVERS)/asterix.o $(VIDEO)/asterix.o \ - $(DRIVERS)/battlnts.o $(VIDEO)/battlnts.o \ - $(DRIVERS)/bishi.o $(VIDEO)/bishi.o \ - $(DRIVERS)/bladestl.o $(VIDEO)/bladestl.o \ - $(DRIVERS)/blockhl.o $(VIDEO)/blockhl.o \ - $(DRIVERS)/bottom9.o $(VIDEO)/bottom9.o \ - $(DRIVERS)/chqflag.o $(VIDEO)/chqflag.o \ - $(DRIVERS)/circusc.o $(VIDEO)/circusc.o \ - $(DRIVERS)/cobra.o \ - $(DRIVERS)/combatsc.o $(VIDEO)/combatsc.o \ - $(DRIVERS)/contra.o $(VIDEO)/contra.o \ - $(DRIVERS)/crimfght.o $(VIDEO)/crimfght.o \ - $(DRIVERS)/dbz.o $(VIDEO)/dbz.o \ - $(DRIVERS)/ddribble.o $(VIDEO)/ddribble.o \ - $(DRIVERS)/djmain.o $(VIDEO)/djmain.o \ - $(DRIVERS)/fastfred.o $(VIDEO)/fastfred.o \ - $(DRIVERS)/fastlane.o $(VIDEO)/fastlane.o \ - $(DRIVERS)/finalizr.o $(VIDEO)/finalizr.o \ - $(DRIVERS)/firebeat.o $(MACHINE)/midikbd.o \ - $(DRIVERS)/flkatck.o $(VIDEO)/flkatck.o \ - $(DRIVERS)/gberet.o $(VIDEO)/gberet.o \ - $(DRIVERS)/gijoe.o $(VIDEO)/gijoe.o \ - $(DRIVERS)/gradius3.o $(VIDEO)/gradius3.o \ - $(DRIVERS)/gticlub.o \ - $(DRIVERS)/gyruss.o $(VIDEO)/gyruss.o \ - $(DRIVERS)/hcastle.o $(VIDEO)/hcastle.o \ - $(DRIVERS)/hexion.o $(VIDEO)/hexion.o \ - $(DRIVERS)/hornet.o $(MACHINE)/konppc.o \ - $(DRIVERS)/hyperspt.o $(AUDIO)/hyprolyb.o $(VIDEO)/hyperspt.o \ - $(DRIVERS)/ironhors.o $(VIDEO)/ironhors.o \ - $(DRIVERS)/jackal.o $(VIDEO)/jackal.o \ - $(DRIVERS)/jailbrek.o $(VIDEO)/jailbrek.o \ - $(DRIVERS)/junofrst.o \ - $(DRIVERS)/konamigq.o \ - $(DRIVERS)/konamigv.o \ - $(DRIVERS)/konamigx.o $(MACHINE)/konamigx.o $(VIDEO)/konamigx.o \ - $(DRIVERS)/konamim2.o \ - $(DRIVERS)/kontest.o \ - $(DRIVERS)/konendev.o \ - $(DRIVERS)/ksys573.o $(MACHINE)/k573cass.o $(MACHINE)/k573dio.o $(MACHINE)/k573mcr.o $(MACHINE)/k573msu.o $(MACHINE)/k573npu.o $(MACHINE)/zs01.o \ - $(DRIVERS)/labyrunr.o $(VIDEO)/labyrunr.o \ - $(DRIVERS)/lethal.o $(VIDEO)/lethal.o \ - $(DRIVERS)/mainevt.o $(VIDEO)/mainevt.o \ - $(DRIVERS)/megazone.o $(VIDEO)/megazone.o \ - $(DRIVERS)/mikie.o $(VIDEO)/mikie.o \ - $(DRIVERS)/mogura.o \ - $(DRIVERS)/moo.o $(VIDEO)/moo.o \ - $(DRIVERS)/mystwarr.o $(VIDEO)/mystwarr.o \ - $(DRIVERS)/nemesis.o $(VIDEO)/nemesis.o \ - $(DRIVERS)/nwk-tr.o \ - $(DRIVERS)/overdriv.o $(VIDEO)/overdriv.o \ - $(DRIVERS)/pandoras.o $(VIDEO)/pandoras.o \ - $(DRIVERS)/parodius.o $(VIDEO)/parodius.o \ - $(DRIVERS)/pingpong.o $(VIDEO)/pingpong.o \ - $(DRIVERS)/plygonet.o $(VIDEO)/plygonet.o \ - $(DRIVERS)/pooyan.o $(VIDEO)/pooyan.o \ - $(DRIVERS)/pyson.o \ - $(DRIVERS)/qdrmfgp.o $(VIDEO)/qdrmfgp.o \ - $(DRIVERS)/rockrage.o $(VIDEO)/rockrage.o \ - $(DRIVERS)/rocnrope.o $(VIDEO)/rocnrope.o \ - $(DRIVERS)/rollerg.o $(VIDEO)/rollerg.o \ - $(DRIVERS)/rungun.o $(VIDEO)/rungun.o \ - $(DRIVERS)/sbasketb.o $(VIDEO)/sbasketb.o \ - $(DRIVERS)/scobra.o \ - $(DRIVERS)/scotrsht.o $(VIDEO)/scotrsht.o \ - $(DRIVERS)/scramble.o $(MACHINE)/scramble.o $(AUDIO)/scramble.o \ - $(DRIVERS)/shaolins.o $(VIDEO)/shaolins.o \ - $(DRIVERS)/simpsons.o $(MACHINE)/simpsons.o $(VIDEO)/simpsons.o \ - $(DRIVERS)/spy.o $(VIDEO)/spy.o \ - $(DRIVERS)/surpratk.o $(VIDEO)/surpratk.o \ - $(DRIVERS)/tasman.o \ - $(DRIVERS)/tgtpanic.o \ - $(DRIVERS)/thunderx.o $(VIDEO)/thunderx.o \ - $(DRIVERS)/timeplt.o $(AUDIO)/timeplt.o $(VIDEO)/timeplt.o \ - $(DRIVERS)/tmnt.o $(VIDEO)/tmnt.o \ - $(DRIVERS)/tp84.o $(VIDEO)/tp84.o \ - $(DRIVERS)/trackfld.o $(MACHINE)/konami1.o $(AUDIO)/trackfld.o $(VIDEO)/trackfld.o \ - $(DRIVERS)/tutankhm.o $(VIDEO)/tutankhm.o \ - $(DRIVERS)/twin16.o $(VIDEO)/twin16.o \ - $(DRIVERS)/twinkle.o \ - $(DRIVERS)/ultrsprt.o \ - $(DRIVERS)/ultraman.o $(VIDEO)/ultraman.o \ - $(DRIVERS)/vendetta.o $(VIDEO)/vendetta.o \ - $(DRIVERS)/viper.o \ - $(DRIVERS)/wecleman.o $(VIDEO)/wecleman.o \ - $(DRIVERS)/xexex.o $(VIDEO)/xexex.o \ - $(DRIVERS)/xmen.o $(VIDEO)/xmen.o \ - $(DRIVERS)/yiear.o $(VIDEO)/yiear.o \ - $(DRIVERS)/zr107.o \ - $(VIDEO)/konami_helper.o \ - $(VIDEO)/k007121.o \ - $(VIDEO)/k007342.o \ - $(VIDEO)/k007420.o \ - $(VIDEO)/k037122.o \ - $(VIDEO)/k051316.o \ - $(VIDEO)/k051733.o \ - $(VIDEO)/k051960.o \ - $(VIDEO)/k052109.o \ - $(VIDEO)/k053250.o \ - $(VIDEO)/k053251.o \ - $(VIDEO)/k054156_k054157_k056832.o \ - $(VIDEO)/k053244_k053245.o \ - $(VIDEO)/k053246_k053247_k055673.o \ - $(VIDEO)/k055555.o \ - $(VIDEO)/k054000.o \ - $(VIDEO)/k054338.o \ - $(VIDEO)/k053936.o \ - $(VIDEO)/k001006.o \ - $(VIDEO)/k001005.o \ - $(VIDEO)/k001604.o \ - -$(MAMEOBJ)/matic.a: \ - $(DRIVERS)/barata.o - -$(MAMEOBJ)/maygay.a: \ - $(DRIVERS)/maygay1b.o \ - $(DRIVERS)/maygay1bsw.o \ - $(DRIVERS)/maygayv1.o \ - $(DRIVERS)/maygayep.o \ - $(DRIVERS)/maygaysw.o \ - $(DRIVERS)/mmm.o \ - -$(MAMEOBJ)/meadows.a: \ - $(DRIVERS)/lazercmd.o $(VIDEO)/lazercmd.o \ - $(DRIVERS)/meadwttl.o \ - $(DRIVERS)/meadows.o $(AUDIO)/meadows.o $(VIDEO)/meadows.o \ - $(DRIVERS)/warpsped.o - -$(MAMEOBJ)/merit.a: \ - $(DRIVERS)/mgames.o \ - $(DRIVERS)/merit.o \ - $(DRIVERS)/meritm.o \ - -$(MAMEOBJ)/metro.a: \ - $(DRIVERS)/hyprduel.o $(VIDEO)/hyprduel.o \ - $(DRIVERS)/metro.o $(VIDEO)/metro.o \ - $(DRIVERS)/rabbit.o \ - $(DRIVERS)/tmmjprd.o \ - -$(MAMEOBJ)/midcoin.a: \ - $(DRIVERS)/wallc.o \ - $(DRIVERS)/wink.o \ - $(DRIVERS)/24cdjuke.o \ - -$(MAMEOBJ)/midw8080.a: \ - $(DRIVERS)/8080bw.o $(AUDIO)/8080bw.o $(VIDEO)/8080bw.o \ - $(DRIVERS)/m79amb.o $(AUDIO)/m79amb.o \ - $(DRIVERS)/mw8080bw.o $(MACHINE)/mw8080bw.o $(AUDIO)/mw8080bw.o $(VIDEO)/mw8080bw.o \ - $(DRIVERS)/rotaryf.o \ - -$(MAMEOBJ)/midway.a: \ - $(DRIVERS)/astrocde.o $(VIDEO)/astrocde.o $(AUDIO)/gorf.o $(AUDIO)/wow.o \ - $(DRIVERS)/atlantis.o \ - $(DRIVERS)/balsente.o $(MACHINE)/balsente.o $(VIDEO)/balsente.o \ - $(DRIVERS)/gridlee.o $(AUDIO)/gridlee.o $(VIDEO)/gridlee.o \ - $(DRIVERS)/mcr.o $(MACHINE)/mcr.o $(VIDEO)/mcr.o \ - $(DRIVERS)/mcr3.o $(VIDEO)/mcr3.o \ - $(DRIVERS)/mcr68.o $(MACHINE)/mcr68.o $(VIDEO)/mcr68.o \ - $(DRIVERS)/midqslvr.o \ - $(DRIVERS)/midtunit.o $(MACHINE)/midtunit.o $(VIDEO)/midtunit.o \ - $(DRIVERS)/midvunit.o $(VIDEO)/midvunit.o \ - $(DRIVERS)/midwunit.o $(MACHINE)/midwunit.o \ - $(DRIVERS)/midxunit.o $(MACHINE)/midxunit.o \ - $(DRIVERS)/midyunit.o $(MACHINE)/midyunit.o $(VIDEO)/midyunit.o \ - $(DRIVERS)/midzeus.o $(VIDEO)/midzeus.o $(VIDEO)/midzeus2.o \ - $(DRIVERS)/mw18w.o \ - $(DRIVERS)/mwsub.o \ - $(DRIVERS)/omegrace.o \ - $(DRIVERS)/pinball2k.o \ - $(DRIVERS)/seattle.o \ - $(DRIVERS)/sspeedr.o $(VIDEO)/sspeedr.o \ - $(DRIVERS)/tmaster.o \ - $(DRIVERS)/vegas.o $(DRIVERS)/wmg.o \ - $(DRIVERS)/williams.o $(MACHINE)/williams.o $(AUDIO)/williams.o $(VIDEO)/williams.o \ - $(MACHINE)/midwayic.o \ - $(AUDIO)/midway.o \ - -$(MAMEOBJ)/namco.a: \ - $(DRIVERS)/20pacgal.o $(VIDEO)/20pacgal.o \ - $(DRIVERS)/30test.o \ - $(DRIVERS)/baraduke.o $(VIDEO)/baraduke.o \ - $(DRIVERS)/cswat.o \ - $(DRIVERS)/dambustr.o \ - $(DRIVERS)/gal3.o \ - $(DRIVERS)/galaga.o $(AUDIO)/galaga.o $(VIDEO)/galaga.o $(VIDEO)/bosco.o $(VIDEO)/digdug.o $(MACHINE)/xevious.o $(VIDEO)/xevious.o \ - $(DRIVERS)/galaxian.o $(AUDIO)/galaxian.o $(VIDEO)/galaxian.o \ - $(DRIVERS)/galaxold.o $(MACHINE)/galaxold.o $(VIDEO)/galaxold.o \ - $(DRIVERS)/gaplus.o $(MACHINE)/gaplus.o $(VIDEO)/gaplus.o \ - $(DRIVERS)/kungfur.o \ - $(DRIVERS)/mappy.o $(VIDEO)/mappy.o \ - $(DRIVERS)/namcofl.o $(VIDEO)/namcofl.o \ - $(DRIVERS)/namcoic.o \ - $(DRIVERS)/namcona1.o $(VIDEO)/namcona1.o \ - $(DRIVERS)/namconb1.o $(VIDEO)/namconb1.o \ - $(DRIVERS)/namcond1.o $(MACHINE)/namcond1.o $(VIDEO)/ygv608.o \ - $(DRIVERS)/namcops2.o \ - $(DRIVERS)/namcos1.o $(MACHINE)/namcos1.o $(VIDEO)/namcos1.o \ - $(DRIVERS)/namcos10.o \ - $(DRIVERS)/namcos11.o $(MACHINE)/ns11prot.o \ - $(DRIVERS)/namcos12.o $(MACHINE)/namco_settings.o \ - $(DRIVERS)/namcos2.o $(MACHINE)/namcos2.o $(VIDEO)/namcos2.o \ - $(DRIVERS)/namcos21.o $(VIDEO)/namcos21.o \ - $(DRIVERS)/namcos22.o $(VIDEO)/namcos22.o \ - $(DRIVERS)/namcos23.o \ - $(DRIVERS)/namcos86.o $(VIDEO)/namcos86.o \ - $(DRIVERS)/pacland.o $(VIDEO)/pacland.o \ - $(DRIVERS)/polepos.o $(AUDIO)/polepos.o $(VIDEO)/polepos.o \ - $(DRIVERS)/rallyx.o $(VIDEO)/rallyx.o \ - $(DRIVERS)/skykid.o $(VIDEO)/skykid.o \ - $(DRIVERS)/tankbatt.o $(VIDEO)/tankbatt.o \ - $(DRIVERS)/tceptor.o $(VIDEO)/tceptor.o \ - $(DRIVERS)/toypop.o $(VIDEO)/toypop.o \ - $(DRIVERS)/turrett.o $(AUDIO)/turrett.o $(VIDEO)/turrett.o \ - $(DRIVERS)/warpwarp.o $(AUDIO)/geebee.o $(AUDIO)/warpwarp.o $(VIDEO)/warpwarp.o \ - $(MACHINE)/c117.o \ - $(MACHINE)/namcoio.o \ - $(MACHINE)/namco06.o \ - $(MACHINE)/namco50.o \ - $(MACHINE)/namco51.o \ - $(MACHINE)/namco53.o \ - $(MACHINE)/namco62.o \ - $(MACHINE)/namcomcu.o \ - $(AUDIO)/namco52.o \ - $(AUDIO)/namco54.o \ - $(VIDEO)/c116.o \ - $(VIDEO)/c45.o \ - -$(MAMEOBJ)/nasco.a: \ - $(DRIVERS)/crgolf.o $(VIDEO)/crgolf.o \ - $(DRIVERS)/suprgolf.o \ - -$(MAMEOBJ)/neogeo.a: \ - $(DRIVERS)/neogeo.o $(VIDEO)/neogeo.o \ - $(DRIVERS)/neogeo_noslot.o \ - $(VIDEO)/neogeo_spr.o \ - $(MACHINE)/neoboot.o \ - $(MACHINE)/neocrypt.o \ - $(MACHINE)/neoprot.o \ - $(MACHINE)/ng_memcard.o \ - -$(MAMEOBJ)/nichibut.a: \ - $(DRIVERS)/armedf.o $(VIDEO)/armedf.o \ - $(DRIVERS)/cclimber.o $(MACHINE)/cclimber.o $(AUDIO)/cclimber.o $(VIDEO)/cclimber.o \ - $(DRIVERS)/clshroad.o $(VIDEO)/clshroad.o \ - $(DRIVERS)/csplayh5.o \ - $(DRIVERS)/cop01.o $(VIDEO)/cop01.o \ - $(DRIVERS)/dacholer.o \ - $(DRIVERS)/galivan.o $(VIDEO)/galivan.o \ - $(DRIVERS)/gomoku.o $(AUDIO)/gomoku.o $(VIDEO)/gomoku.o \ - $(DRIVERS)/hyhoo.o $(VIDEO)/hyhoo.o \ - $(DRIVERS)/jangou.o \ - $(DRIVERS)/magmax.o $(VIDEO)/magmax.o \ - $(DRIVERS)/nbmj8688.o $(VIDEO)/nbmj8688.o \ - $(DRIVERS)/nbmj8891.o $(VIDEO)/nbmj8891.o \ - $(DRIVERS)/nbmj8900.o $(VIDEO)/nbmj8900.o \ - $(DRIVERS)/nbmj8991.o $(VIDEO)/nbmj8991.o \ - $(DRIVERS)/nbmj9195.o $(VIDEO)/nbmj9195.o \ - $(DRIVERS)/nightgal.o \ - $(DRIVERS)/niyanpai.o $(VIDEO)/niyanpai.o \ - $(DRIVERS)/pastelg.o $(VIDEO)/pastelg.o \ - $(DRIVERS)/seicross.o $(VIDEO)/seicross.o \ - $(DRIVERS)/terracre.o $(VIDEO)/terracre.o \ - $(DRIVERS)/tubep.o $(VIDEO)/tubep.o \ - $(DRIVERS)/wiping.o $(AUDIO)/wiping.o $(VIDEO)/wiping.o \ - $(MACHINE)/nb1413m3.o \ - $(MACHINE)/nb1414m4.o \ - -$(MAMEOBJ)/nintendo.a: \ - $(DRIVERS)/cham24.o \ - $(DRIVERS)/dkong.o $(AUDIO)/dkong.o $(VIDEO)/dkong.o \ - $(DRIVERS)/mario.o $(AUDIO)/mario.o $(VIDEO)/mario.o \ - $(DRIVERS)/multigam.o \ - $(DRIVERS)/n8080.o $(AUDIO)/n8080.o $(VIDEO)/n8080.o \ - $(DRIVERS)/nss.o $(MACHINE)/snes.o $(AUDIO)/snes_snd.o \ - $(DRIVERS)/playch10.o $(MACHINE)/playch10.o $(VIDEO)/playch10.o \ - $(DRIVERS)/popeye.o $(VIDEO)/popeye.o \ - $(DRIVERS)/punchout.o $(VIDEO)/punchout.o \ - $(DRIVERS)/famibox.o \ - $(DRIVERS)/sfcbox.o \ - $(DRIVERS)/snesb.o \ - $(DRIVERS)/spacefb.o $(AUDIO)/spacefb.o $(VIDEO)/spacefb.o \ - $(DRIVERS)/vsnes.o $(MACHINE)/vsnes.o $(VIDEO)/vsnes.o \ - $(VIDEO)/ppu2c0x.o \ - - - -$(MAMEOBJ)/nix.a: \ - $(DRIVERS)/fitfight.o $(VIDEO)/fitfight.o \ - $(DRIVERS)/pirates.o $(VIDEO)/pirates.o \ - -$(MAMEOBJ)/nmk.a: \ - $(DRIVERS)/acommand.o \ - $(DRIVERS)/cultures.o \ - $(DRIVERS)/ddealer.o \ - $(DRIVERS)/jalmah.o \ - $(DRIVERS)/macrossp.o $(VIDEO)/macrossp.o \ - $(DRIVERS)/nmk16.o $(MACHINE)/nmk004.o $(VIDEO)/nmk16.o \ - $(DRIVERS)/quizdna.o $(VIDEO)/quizdna.o \ - $(DRIVERS)/quizpani.o $(VIDEO)/quizpani.o \ - -$(MAMEOBJ)/olympia.a: \ - $(DRIVERS)/dday.o $(VIDEO)/dday.o \ - $(DRIVERS)/lbeach.o \ - $(DRIVERS)/monzagp.o \ - $(DRIVERS)/portrait.o $(VIDEO)/portrait.o \ - $(DRIVERS)/vega.o \ - -$(MAMEOBJ)/omori.a: \ - $(DRIVERS)/battlex.o $(VIDEO)/battlex.o \ - $(DRIVERS)/carjmbre.o $(VIDEO)/carjmbre.o \ - $(DRIVERS)/popper.o $(VIDEO)/popper.o \ - $(DRIVERS)/spaceg.o \ - -$(MAMEOBJ)/orca.a: \ - $(DRIVERS)/espial.o $(VIDEO)/espial.o \ - $(DRIVERS)/funkybee.o $(VIDEO)/funkybee.o \ - $(DRIVERS)/marineb.o $(VIDEO)/marineb.o \ - $(DRIVERS)/vastar.o $(VIDEO)/vastar.o \ - $(DRIVERS)/zodiack.o $(VIDEO)/zodiack.o \ - -$(MAMEOBJ)/pacific.a: \ - $(DRIVERS)/mrflea.o $(VIDEO)/mrflea.o \ - $(DRIVERS)/thief.o $(VIDEO)/thief.o \ - -$(MAMEOBJ)/pacman.a: \ - $(DRIVERS)/jrpacman.o \ - $(DRIVERS)/pacman.o $(VIDEO)/pacman.o $(MACHINE)/acitya.o $(MACHINE)/jumpshot.o $(MACHINE)/pacplus.o $(MACHINE)/theglobp.o \ - $(DRIVERS)/pengo.o \ - -$(MAMEOBJ)/pce.a: \ - $(DRIVERS)/ggconnie.o \ - $(DRIVERS)/paranoia.o \ - $(DRIVERS)/tourvis.o \ - $(DRIVERS)/uapce.o \ - $(MACHINE)/pcecommn.o \ - -$(MAMEOBJ)/phoenix.a: \ - $(DRIVERS)/naughtyb.o $(VIDEO)/naughtyb.o \ - $(DRIVERS)/phoenix.o $(AUDIO)/phoenix.o $(VIDEO)/phoenix.o \ - $(DRIVERS)/safarir.o \ - $(AUDIO)/pleiads.o \ - -$(MAMEOBJ)/playmark.a: \ - $(DRIVERS)/drtomy.o \ - $(DRIVERS)/playmark.o $(VIDEO)/playmark.o \ - $(DRIVERS)/powerbal.o \ - $(DRIVERS)/sderby.o $(VIDEO)/sderby.o \ - $(DRIVERS)/sslam.o $(VIDEO)/sslam.o \ - -$(MAMEOBJ)/psikyo.a: \ - $(DRIVERS)/psikyo.o $(VIDEO)/psikyo.o \ - $(DRIVERS)/psikyo4.o $(VIDEO)/psikyo4.o \ - $(DRIVERS)/psikyosh.o $(VIDEO)/psikyosh.o \ - -$(MAMEOBJ)/ramtek.a: \ - $(DRIVERS)/hitme.o $(AUDIO)/hitme.o \ - $(DRIVERS)/ramtek.o \ - $(DRIVERS)/starcrus.o $(VIDEO)/starcrus.o \ - -$(MAMEOBJ)/rare.a: \ - $(DRIVERS)/btoads.o $(VIDEO)/btoads.o \ - $(DRIVERS)/kinst.o \ - $(DRIVERS)/xtheball.o \ - -$(MAMEOBJ)/sanritsu.a: \ - $(DRIVERS)/appoooh.o $(VIDEO)/appoooh.o \ - $(DRIVERS)/bankp.o $(VIDEO)/bankp.o \ - $(DRIVERS)/chinsan.o \ - $(DRIVERS)/drmicro.o $(VIDEO)/drmicro.o \ - $(DRIVERS)/jantotsu.o \ - $(DRIVERS)/mayumi.o \ - $(DRIVERS)/mermaid.o $(VIDEO)/mermaid.o \ - $(DRIVERS)/mjkjidai.o $(VIDEO)/mjkjidai.o \ - -$(MAMEOBJ)/sega.a: \ - $(DRIVERS)/angelkds.o $(VIDEO)/angelkds.o \ - $(DRIVERS)/bingoc.o \ - $(DRIVERS)/blockade.o $(AUDIO)/blockade.o $(VIDEO)/blockade.o \ - $(DRIVERS)/calorie.o \ - $(DRIVERS)/chihiro.o $(VIDEO)/chihiro.o \ - $(DRIVERS)/coolridr.o \ - $(DRIVERS)/deniam.o $(VIDEO)/deniam.o \ - $(DRIVERS)/dotrikun.o \ - $(DRIVERS)/gpworld.o \ - $(DRIVERS)/hikaru.o \ - $(DRIVERS)/hshavoc.o \ - $(DRIVERS)/kopunch.o $(VIDEO)/kopunch.o \ - $(DRIVERS)/lindbergh.o $(MACHINE)/segabb.o \ - $(MACHINE)/megadriv.o \ - $(DRIVERS)/megadrvb.o \ - $(DRIVERS)/megaplay.o \ - $(DRIVERS)/megatech.o \ - $(DRIVERS)/model1.o $(MACHINE)/model1.o $(VIDEO)/model1.o \ - $(AUDIO)/dsbz80.o \ - $(DRIVERS)/model2.o $(VIDEO)/model2.o \ - $(DRIVERS)/model3.o $(VIDEO)/model3.o $(MACHINE)/model3.o \ - $(DRIVERS)/monacogp.o \ - $(DRIVERS)/naomi.o $(MACHINE)/dc.o $(VIDEO)/powervr2.o $(MACHINE)/naomi.o \ - $(MACHINE)/naomig1.o $(MACHINE)/naomibd.o $(MACHINE)/naomirom.o $(MACHINE)/naomigd.o \ - $(MACHINE)/naomim1.o $(MACHINE)/naomim2.o $(MACHINE)/naomim4.o \ - $(MACHINE)/315-5881_crypt.o \ - $(MACHINE)/awboard.o \ - $(MACHINE)/mie.o $(MACHINE)/maple-dc.o $(MACHINE)/mapledev.o $(MACHINE)/dc-ctrl.o $(MACHINE)/jvs13551.o \ - $(DRIVERS)/triforce.o \ - $(DRIVERS)/puckpkmn.o \ - $(DRIVERS)/segac2.o \ - $(DRIVERS)/segae.o \ - $(DRIVERS)/shtzone.o \ - $(DRIVERS)/segacoin.o \ - $(DRIVERS)/segag80r.o $(MACHINE)/segag80.o $(AUDIO)/segag80r.o $(VIDEO)/segag80r.o \ - $(DRIVERS)/segag80v.o $(AUDIO)/segag80v.o $(VIDEO)/segag80v.o \ - $(DRIVERS)/segahang.o $(VIDEO)/segahang.o \ - $(DRIVERS)/segajw.o \ - $(DRIVERS)/segald.o \ - $(DRIVERS)/segaorun.o $(VIDEO)/segaorun.o \ - $(DRIVERS)/segas16a.o $(VIDEO)/segas16a.o \ - $(DRIVERS)/segas16b.o $(VIDEO)/segas16b.o \ - $(DRIVERS)/segas18.o $(VIDEO)/segas18.o \ - $(DRIVERS)/segas24.o $(VIDEO)/segas24.o \ - $(DRIVERS)/segas32.o $(MACHINE)/segas32.o $(VIDEO)/segas32.o \ - $(DRIVERS)/segaufo.o \ - $(DRIVERS)/segaxbd.o $(VIDEO)/segaxbd.o \ - $(DRIVERS)/segaybd.o $(VIDEO)/segaybd.o \ - $(DRIVERS)/sg1000a.o \ - $(DRIVERS)/stactics.o $(VIDEO)/stactics.o \ - $(DRIVERS)/stv.o $(MACHINE)/stvprot.o $(MACHINE)/315-5838_317-0229_comp.o \ - $(DRIVERS)/suprloco.o $(VIDEO)/suprloco.o \ - $(DRIVERS)/system1.o $(VIDEO)/system1.o \ - $(DRIVERS)/system16.o $(VIDEO)/system16.o \ - $(DRIVERS)/timetrv.o \ - $(DRIVERS)/turbo.o $(AUDIO)/turbo.o $(VIDEO)/turbo.o \ - $(DRIVERS)/vicdual.o $(AUDIO)/vicdual.o $(VIDEO)/vicdual.o $(AUDIO)/carnival.o $(AUDIO)/depthch.o $(AUDIO)/invinco.o $(AUDIO)/pulsar.o \ - $(DRIVERS)/zaxxon.o $(AUDIO)/zaxxon.o $(VIDEO)/zaxxon.o \ - $(MACHINE)/315_5296.o \ - $(MACHINE)/fd1089.o \ - $(MACHINE)/fd1094.o \ - $(MACHINE)/fddebug.o \ - $(MACHINE)/mc8123.o \ - $(MACHINE)/segaic16.o \ - $(AUDIO)/segasnd.o \ - $(VIDEO)/segaic16.o \ - $(VIDEO)/segaic16_road.o \ - $(VIDEO)/sega16sp.o \ - $(VIDEO)/segaic24.o \ - $(MACHINE)/gdrom.o \ - -$(MAMEOBJ)/seibu.a: \ - $(DRIVERS)/bloodbro.o $(VIDEO)/bloodbro.o \ - $(DRIVERS)/cabal.o $(VIDEO)/cabal.o \ - $(DRIVERS)/cshooter.o \ - $(DRIVERS)/dcon.o $(VIDEO)/dcon.o \ - $(DRIVERS)/deadang.o $(VIDEO)/deadang.o \ - $(DRIVERS)/dynduke.o $(VIDEO)/dynduke.o \ - $(DRIVERS)/feversoc.o \ - $(DRIVERS)/goal92.o $(VIDEO)/goal92.o \ - $(DRIVERS)/goodejan.o \ - $(DRIVERS)/kncljoe.o $(VIDEO)/kncljoe.o \ - $(DRIVERS)/legionna.o $(VIDEO)/legionna.o \ - $(DRIVERS)/mustache.o $(VIDEO)/mustache.o \ - $(DRIVERS)/panicr.o \ - $(DRIVERS)/raiden.o $(VIDEO)/raiden.o \ - $(DRIVERS)/raiden2.o $(MACHINE)/r2crypt.o \ - $(MACHINE)/raiden2cop.o \ - $(DRIVERS)/r2dx_v33.o \ - $(DRIVERS)/seibuspi.o $(MACHINE)/seibuspi.o $(VIDEO)/seibuspi.o \ - $(DRIVERS)/sengokmj.o \ - $(DRIVERS)/stfight.o $(MACHINE)/stfight.o $(VIDEO)/stfight.o \ - $(DRIVERS)/toki.o $(VIDEO)/toki.o \ - $(DRIVERS)/wiz.o $(VIDEO)/wiz.o \ - $(MACHINE)/seicop.o \ - $(MACHINE)/spisprit.o \ - $(AUDIO)/seibu.o \ - $(VIDEO)/seibu_crtc.o \ - -$(MAMEOBJ)/seta.a: \ - $(DRIVERS)/aleck64.o $(MACHINE)/n64.o $(VIDEO)/n64.o $(VIDEO)/rdpblend.o $(VIDEO)/rdpspn16.o $(VIDEO)/rdptpipe.o \ - $(DRIVERS)/hanaawas.o $(VIDEO)/hanaawas.o \ - $(DRIVERS)/jclub2.o \ - $(DRIVERS)/macs.o \ - $(DRIVERS)/seta.o $(VIDEO)/seta.o \ - $(DRIVERS)/seta2.o $(VIDEO)/seta2.o \ - $(DRIVERS)/speedatk.o $(VIDEO)/speedatk.o \ - $(DRIVERS)/speglsht.o \ - $(DRIVERS)/srmp2.o $(VIDEO)/srmp2.o \ - $(DRIVERS)/srmp5.o \ - $(DRIVERS)/srmp6.o \ - $(DRIVERS)/ssv.o $(VIDEO)/ssv.o \ - $(VIDEO)/st0020.o \ - $(MACHINE)/st0016.o $(DRIVERS)/simple_st0016.o \ - $(VIDEO)/seta001.o \ - -$(MAMEOBJ)/sigma.a: \ - $(DRIVERS)/nyny.o \ - $(DRIVERS)/r2dtank.o \ - $(DRIVERS)/sigmab52.o \ - $(DRIVERS)/sigmab98.o \ - $(DRIVERS)/spiders.o $(AUDIO)/spiders.o \ - $(DRIVERS)/sub.o \ - -$(MAMEOBJ)/snk.a: \ - $(DRIVERS)/bbusters.o $(VIDEO)/bbusters.o \ - $(DRIVERS)/dmndrby.o \ - $(DRIVERS)/hng64.o $(VIDEO)/hng64.o $(AUDIO)/hng64.o $(MACHINE)/hng64_net.o $(VIDEO)/hng64_3d.o $(VIDEO)/hng64_sprite.o \ - $(DRIVERS)/lasso.o $(VIDEO)/lasso.o \ - $(DRIVERS)/mainsnk.o $(VIDEO)/mainsnk.o \ - $(DRIVERS)/munchmo.o $(VIDEO)/munchmo.o \ - $(DRIVERS)/prehisle.o $(VIDEO)/prehisle.o \ - $(DRIVERS)/snk6502.o $(AUDIO)/snk6502.o $(VIDEO)/snk6502.o \ - $(DRIVERS)/snk.o $(VIDEO)/snk.o \ - $(DRIVERS)/snk68.o $(VIDEO)/snk68.o \ - -$(MAMEOBJ)/sony.a: \ - $(DRIVERS)/zn.o $(MACHINE)/zndip.o $(MACHINE)/cat702.o \ - -$(MAMEOBJ)/stern.a: \ - $(DRIVERS)/astinvad.o \ - $(DRIVERS)/berzerk.o \ - $(DRIVERS)/cliffhgr.o $(AUDIO)/cliffhgr.o \ - $(DRIVERS)/mazerbla.o \ - $(DRIVERS)/supdrapo.o \ - -$(MAMEOBJ)/subsino.a: \ - $(DRIVERS)/lastfght.o \ - $(DRIVERS)/subsino.o \ - $(DRIVERS)/subsino2.o \ - $(MACHINE)/subsino.o \ - -$(MAMEOBJ)/sun.a: \ - $(DRIVERS)/arabian.o $(VIDEO)/arabian.o \ - $(DRIVERS)/dai3wksi.o \ - $(DRIVERS)/ikki.o $(VIDEO)/ikki.o \ - $(DRIVERS)/kangaroo.o $(VIDEO)/kangaroo.o \ - $(DRIVERS)/markham.o $(VIDEO)/markham.o \ - $(DRIVERS)/route16.o $(VIDEO)/route16.o \ - $(DRIVERS)/shanghai.o \ - $(DRIVERS)/shangha3.o $(VIDEO)/shangha3.o \ - $(DRIVERS)/strnskil.o $(VIDEO)/strnskil.o \ - $(DRIVERS)/tonton.o \ - -$(MAMEOBJ)/suna.a: \ - $(DRIVERS)/go2000.o \ - $(DRIVERS)/goindol.o $(VIDEO)/goindol.o \ - $(DRIVERS)/suna8.o $(AUDIO)/suna8.o $(VIDEO)/suna8.o \ - $(DRIVERS)/suna16.o $(VIDEO)/suna16.o \ - -$(MAMEOBJ)/sure.a: \ - $(DRIVERS)/mil4000.o \ - - -$(MAMEOBJ)/taito.a: \ - $(DRIVERS)/2mindril.o \ - $(DRIVERS)/40love.o $(VIDEO)/40love.o \ - $(DRIVERS)/arkanoid.o $(MACHINE)/arkanoid.o $(VIDEO)/arkanoid.o \ - $(DRIVERS)/ashnojoe.o $(VIDEO)/ashnojoe.o \ - $(DRIVERS)/asuka.o $(MACHINE)/bonzeadv.o $(VIDEO)/asuka.o \ - $(DRIVERS)/bigevglf.o $(MACHINE)/bigevglf.o $(VIDEO)/bigevglf.o \ - $(DRIVERS)/bking.o $(VIDEO)/bking.o \ - $(DRIVERS)/bublbobl.o $(MACHINE)/bublbobl.o $(VIDEO)/bublbobl.o \ - $(DRIVERS)/buggychl.o $(MACHINE)/buggychl.o $(VIDEO)/buggychl.o \ - $(DRIVERS)/capr1.o \ - $(DRIVERS)/caprcyc.o \ - $(DRIVERS)/cchance.o \ - $(DRIVERS)/chaknpop.o $(MACHINE)/chaknpop.o $(VIDEO)/chaknpop.o \ - $(DRIVERS)/champbwl.o \ - $(DRIVERS)/changela.o $(VIDEO)/changela.o \ - $(DRIVERS)/crbaloon.o $(VIDEO)/crbaloon.o $(AUDIO)/crbaloon.o \ - $(DRIVERS)/cyclemb.o \ - $(DRIVERS)/darius.o $(VIDEO)/darius.o \ - $(DRIVERS)/darkmist.o $(VIDEO)/darkmist.o \ - $(DRIVERS)/exzisus.o $(VIDEO)/exzisus.o \ - $(DRIVERS)/fgoal.o $(VIDEO)/fgoal.o \ - $(DRIVERS)/flstory.o $(MACHINE)/flstory.o $(VIDEO)/flstory.o \ - $(DRIVERS)/galastrm.o $(VIDEO)/galastrm.o \ - $(DRIVERS)/gladiatr.o $(VIDEO)/gladiatr.o \ - $(DRIVERS)/grchamp.o $(AUDIO)/grchamp.o $(VIDEO)/grchamp.o \ - $(DRIVERS)/groundfx.o $(VIDEO)/groundfx.o \ - $(DRIVERS)/gsword.o $(MACHINE)/tait8741.o $(VIDEO)/gsword.o \ - $(DRIVERS)/gunbustr.o $(VIDEO)/gunbustr.o \ - $(DRIVERS)/halleys.o \ - $(DRIVERS)/invqix.o \ - $(DRIVERS)/jollyjgr.o \ - $(DRIVERS)/ksayakyu.o $(VIDEO)/ksayakyu.o \ - $(DRIVERS)/lgp.o \ - $(DRIVERS)/lkage.o $(MACHINE)/lkage.o $(VIDEO)/lkage.o \ - $(DRIVERS)/lsasquad.o $(MACHINE)/lsasquad.o $(VIDEO)/lsasquad.o \ - $(DRIVERS)/marinedt.o \ - $(DRIVERS)/mexico86.o $(MACHINE)/mexico86.o $(VIDEO)/mexico86.o \ - $(DRIVERS)/minivadr.o \ - $(DRIVERS)/missb2.o \ - $(DRIVERS)/mlanding.o \ - $(DRIVERS)/msisaac.o $(VIDEO)/msisaac.o \ - $(DRIVERS)/ninjaw.o $(VIDEO)/ninjaw.o \ - $(DRIVERS)/nycaptor.o $(MACHINE)/nycaptor.o $(VIDEO)/nycaptor.o \ - $(DRIVERS)/opwolf.o $(MACHINE)/opwolf.o $(VIDEO)/opwolf.o \ - $(DRIVERS)/othunder.o $(VIDEO)/othunder.o \ - $(DRIVERS)/pitnrun.o $(MACHINE)/pitnrun.o $(VIDEO)/pitnrun.o \ - $(DRIVERS)/qix.o $(MACHINE)/qix.o $(AUDIO)/qix.o $(VIDEO)/qix.o \ - $(DRIVERS)/rainbow.o $(MACHINE)/rainbow.o $(VIDEO)/rainbow.o \ - $(DRIVERS)/rastan.o $(VIDEO)/rastan.o \ - $(DRIVERS)/retofinv.o $(MACHINE)/retofinv.o $(VIDEO)/retofinv.o \ - $(DRIVERS)/rollrace.o $(VIDEO)/rollrace.o \ - $(DRIVERS)/sbowling.o \ - $(DRIVERS)/slapshot.o $(VIDEO)/slapshot.o \ - $(DRIVERS)/ssrj.o $(VIDEO)/ssrj.o \ - $(DRIVERS)/superchs.o $(VIDEO)/superchs.o \ - $(DRIVERS)/superqix.o $(VIDEO)/superqix.o \ - $(DRIVERS)/taito_b.o $(VIDEO)/taito_b.o \ - $(DRIVERS)/taito_f2.o $(VIDEO)/taito_f2.o \ - $(DRIVERS)/taito_f3.o $(VIDEO)/taito_f3.o $(AUDIO)/taito_en.o \ - $(DRIVERS)/taito_h.o $(VIDEO)/taito_h.o \ - $(DRIVERS)/taito_l.o $(VIDEO)/taito_l.o \ - $(DRIVERS)/taito_x.o $(MACHINE)/cchip.o \ - $(DRIVERS)/taito_z.o $(VIDEO)/taito_z.o \ - $(DRIVERS)/taito_o.o $(VIDEO)/taito_o.o \ - $(DRIVERS)/taitoair.o $(VIDEO)/taitoair.o \ - $(DRIVERS)/taitogn.o \ - $(DRIVERS)/taitojc.o $(VIDEO)/taitojc.o \ - $(DRIVERS)/taitopjc.o $\ - $(DRIVERS)/taitosj.o $(MACHINE)/taitosj.o $(VIDEO)/taitosj.o \ - $(DRIVERS)/taitottl.o \ - $(DRIVERS)/taitotz.o \ - $(DRIVERS)/taitotx.o \ - $(DRIVERS)/taitowlf.o \ - $(DRIVERS)/tnzs.o $(MACHINE)/tnzs.o $(VIDEO)/tnzs.o \ - $(DRIVERS)/topspeed.o $(VIDEO)/topspeed.o \ - $(DRIVERS)/tsamurai.o $(VIDEO)/tsamurai.o \ - $(DRIVERS)/undrfire.o $(VIDEO)/undrfire.o \ - $(DRIVERS)/volfied.o $(MACHINE)/volfied.o $(VIDEO)/volfied.o \ - $(DRIVERS)/warriorb.o $(VIDEO)/warriorb.o \ - $(DRIVERS)/wgp.o $(VIDEO)/wgp.o \ - $(DRIVERS)/wyvernf0.o \ - $(AUDIO)/taitosnd.o \ - $(AUDIO)/taito_zm.o \ - $(AUDIO)/t5182.o \ - $(MACHINE)/taitoio.o \ - $(VIDEO)/taito_helper.o \ - $(VIDEO)/pc080sn.o \ - $(VIDEO)/pc090oj.o \ - $(VIDEO)/tc0080vco.o \ - $(VIDEO)/tc0100scn.o \ - $(VIDEO)/tc0150rod.o \ - $(VIDEO)/tc0280grd.o \ - $(VIDEO)/tc0360pri.o \ - $(VIDEO)/tc0480scp.o \ - $(VIDEO)/tc0110pcr.o \ - $(VIDEO)/tc0180vcu.o \ - -$(MAMEOBJ)/tatsumi.a: \ - $(DRIVERS)/kingdrby.o \ - $(DRIVERS)/lockon.o $(VIDEO)/lockon.o \ - $(DRIVERS)/tatsumi.o $(MACHINE)/tatsumi.o $(VIDEO)/tatsumi.o \ - $(DRIVERS)/tx1.o $(MACHINE)/tx1.o $(AUDIO)/tx1.o $(VIDEO)/tx1.o \ - -$(MAMEOBJ)/tch.a: \ - $(DRIVERS)/kickgoal.o $(VIDEO)/kickgoal.o \ - $(DRIVERS)/littlerb.o \ - $(DRIVERS)/rltennis.o $(VIDEO)/rltennis.o \ - $(DRIVERS)/speedspn.o $(VIDEO)/speedspn.o \ - $(DRIVERS)/wheelfir.o \ - -$(MAMEOBJ)/tecfri.a: \ - $(DRIVERS)/ambush.o $(VIDEO)/ambush.o \ - $(DRIVERS)/holeland.o $(VIDEO)/holeland.o \ - $(DRIVERS)/sauro.o $(VIDEO)/sauro.o \ - $(DRIVERS)/speedbal.o $(VIDEO)/speedbal.o \ - -$(MAMEOBJ)/technos.a: \ - $(DRIVERS)/battlane.o $(VIDEO)/battlane.o \ - $(DRIVERS)/blockout.o $(VIDEO)/blockout.o \ - $(DRIVERS)/bogeyman.o $(VIDEO)/bogeyman.o \ - $(DRIVERS)/chinagat.o \ - $(DRIVERS)/ddragon.o $(VIDEO)/ddragon.o \ - $(DRIVERS)/ddragon3.o $(VIDEO)/ddragon3.o \ - $(DRIVERS)/dogfgt.o $(VIDEO)/dogfgt.o \ - $(DRIVERS)/matmania.o $(VIDEO)/matmania.o \ - $(DRIVERS)/mystston.o $(VIDEO)/mystston.o \ - $(DRIVERS)/renegade.o $(VIDEO)/renegade.o \ - $(DRIVERS)/scregg.o \ - $(DRIVERS)/shadfrce.o $(VIDEO)/shadfrce.o \ - $(DRIVERS)/spdodgeb.o $(VIDEO)/spdodgeb.o \ - $(DRIVERS)/ssozumo.o $(VIDEO)/ssozumo.o \ - $(DRIVERS)/tagteam.o $(VIDEO)/tagteam.o \ - $(DRIVERS)/vball.o $(VIDEO)/vball.o \ - $(DRIVERS)/wwfsstar.o $(VIDEO)/wwfsstar.o \ - $(DRIVERS)/xain.o $(VIDEO)/xain.o \ - -$(MAMEOBJ)/tehkan.a: \ - $(VIDEO)/tecmo_spr.o \ - $(VIDEO)/tecmo_mix.o \ - $(DRIVERS)/bombjack.o $(VIDEO)/bombjack.o \ - $(DRIVERS)/gaiden.o $(VIDEO)/gaiden.o \ - $(DRIVERS)/lvcards.o $(VIDEO)/lvcards.o \ - $(DRIVERS)/pbaction.o $(VIDEO)/pbaction.o \ - $(DRIVERS)/senjyo.o $(AUDIO)/senjyo.o $(VIDEO)/senjyo.o \ - $(DRIVERS)/solomon.o $(VIDEO)/solomon.o \ - $(DRIVERS)/spbactn.o $(VIDEO)/spbactn.o \ - $(DRIVERS)/tbowl.o $(VIDEO)/tbowl.o \ - $(DRIVERS)/tecmo.o $(VIDEO)/tecmo.o \ - $(DRIVERS)/tecmo16.o $(VIDEO)/tecmo16.o \ - $(DRIVERS)/tecmosys.o $(MACHINE)/tecmosys.o $(VIDEO)/tecmosys.o \ - $(DRIVERS)/tehkanwc.o $(VIDEO)/tehkanwc.o \ - $(DRIVERS)/wc90.o $(VIDEO)/wc90.o \ - $(DRIVERS)/wc90b.o $(VIDEO)/wc90b.o \ - -$(MAMEOBJ)/thepit.a: \ - $(DRIVERS)/thepit.o $(VIDEO)/thepit.o \ - $(DRIVERS)/timelimt.o $(VIDEO)/timelimt.o \ - -$(MAMEOBJ)/toaplan.a: \ - $(DRIVERS)/mjsister.o \ - $(DRIVERS)/slapfght.o $(MACHINE)/slapfght.o $(VIDEO)/slapfght.o \ - $(DRIVERS)/snowbros.o $(VIDEO)/kan_pand.o $(VIDEO)/kan_panb.o \ - $(DRIVERS)/toaplan1.o $(MACHINE)/toaplan1.o $(VIDEO)/toaplan1.o \ - $(DRIVERS)/toaplan2.o $(VIDEO)/toaplan2.o $(VIDEO)/gp9001.o \ - $(DRIVERS)/twincobr.o $(MACHINE)/twincobr.o $(VIDEO)/twincobr.o \ - $(DRIVERS)/wardner.o \ - $(VIDEO)/toaplan_scu.o \ - -$(MAMEOBJ)/tong.a: \ - $(DRIVERS)/beezer.o $(MACHINE)/beezer.o $(VIDEO)/beezer.o $(AUDIO)/beezer.o \ - -$(MAMEOBJ)/unico.a: \ - $(DRIVERS)/drgnmst.o $(VIDEO)/drgnmst.o \ - $(DRIVERS)/silkroad.o $(VIDEO)/silkroad.o \ - $(DRIVERS)/unico.o $(VIDEO)/unico.o \ - -$(MAMEOBJ)/univers.a: \ - $(DRIVERS)/cheekyms.o $(VIDEO)/cheekyms.o \ - $(DRIVERS)/cosmic.o $(VIDEO)/cosmic.o \ - $(DRIVERS)/docastle.o $(MACHINE)/docastle.o $(VIDEO)/docastle.o \ - $(DRIVERS)/ladybug.o $(VIDEO)/ladybug.o \ - $(DRIVERS)/mrdo.o $(VIDEO)/mrdo.o \ - $(DRIVERS)/redclash.o $(VIDEO)/redclash.o \ - $(DRIVERS)/superdq.o - -$(MAMEOBJ)/upl.a: \ - $(DRIVERS)/mouser.o $(VIDEO)/mouser.o \ - $(DRIVERS)/ninjakd2.o $(VIDEO)/ninjakd2.o \ - $(DRIVERS)/nova2001.o $(VIDEO)/nova2001.o \ - $(DRIVERS)/xxmissio.o $(VIDEO)/xxmissio.o \ - -$(MAMEOBJ)/valadon.a: \ - $(DRIVERS)/bagman.o $(MACHINE)/bagman.o $(VIDEO)/bagman.o \ - $(DRIVERS)/tankbust.o $(VIDEO)/tankbust.o \ - -$(MAMEOBJ)/veltmjr.a: \ - $(DRIVERS)/cardline.o \ - $(DRIVERS)/witch.o \ - -$(MAMEOBJ)/venture.a: \ - $(DRIVERS)/looping.o \ - $(DRIVERS)/spcforce.o $(VIDEO)/spcforce.o \ - $(DRIVERS)/suprridr.o $(VIDEO)/suprridr.o \ - -$(MAMEOBJ)/vsystem.a: \ - $(VIDEO)/vsystem_spr.o \ - $(VIDEO)/vsystem_spr2.o \ - $(DRIVERS)/aerofgt.o $(VIDEO)/aerofgt.o \ - $(DRIVERS)/crshrace.o $(VIDEO)/crshrace.o \ - $(DRIVERS)/f1gp.o $(VIDEO)/f1gp.o \ - $(DRIVERS)/fromance.o $(VIDEO)/fromance.o \ - $(DRIVERS)/fromanc2.o $(VIDEO)/fromanc2.o \ - $(DRIVERS)/gstriker.o $(VIDEO)/gstriker.o \ - $(VIDEO)/mb60553.o $(VIDEO)/vs920a.o \ - $(DRIVERS)/inufuku.o $(VIDEO)/inufuku.o \ - $(DRIVERS)/ojankohs.o $(VIDEO)/ojankohs.o \ - $(DRIVERS)/pipedrm.o \ - $(DRIVERS)/rpunch.o $(VIDEO)/rpunch.o \ - $(DRIVERS)/suprslam.o $(VIDEO)/suprslam.o \ - $(DRIVERS)/tail2nos.o $(VIDEO)/tail2nos.o \ - $(DRIVERS)/taotaido.o $(VIDEO)/taotaido.o \ - $(DRIVERS)/welltris.o $(VIDEO)/welltris.o \ - -$(MAMEOBJ)/yunsung.a: \ - $(DRIVERS)/nmg5.o \ - $(DRIVERS)/paradise.o $(VIDEO)/paradise.o \ - $(DRIVERS)/yunsung8.o $(VIDEO)/yunsung8.o \ - $(DRIVERS)/yunsun16.o $(VIDEO)/yunsun16.o \ - -$(MAMEOBJ)/zaccaria.a: \ - $(DRIVERS)/laserbat.o $(AUDIO)/laserbat.o \ - $(DRIVERS)/seabattl.o \ - $(DRIVERS)/zac2650.o $(VIDEO)/zac2650.o \ - $(DRIVERS)/zaccaria.o $(VIDEO)/zaccaria.o \ - -#------------------------------------------------- -# pinball drivers -#------------------------------------------------- -$(MAMEOBJ)/pinball.a: \ - $(DRIVERS)/allied.o \ - $(DRIVERS)/alvg.o \ - $(DRIVERS)/atari_s1.o \ - $(DRIVERS)/atari_s2.o \ - $(DRIVERS)/bingo.o \ - $(DRIVERS)/by17.o \ - $(DRIVERS)/by35.o \ - $(DRIVERS)/by6803.o \ - $(DRIVERS)/by68701.o \ - $(DRIVERS)/byvid.o \ - $(DRIVERS)/capcom.o \ - $(DRIVERS)/de_2.o \ - $(DRIVERS)/de_3.o \ - $(MACHINE)/decopincpu.o \ - $(VIDEO)/decodmd1.o \ - $(VIDEO)/decodmd2.o \ - $(VIDEO)/decodmd3.o \ - $(DRIVERS)/de_3b.o \ - $(DRIVERS)/flicker.o \ - $(DRIVERS)/g627.o \ - $(DRIVERS)/gp_1.o \ - $(MACHINE)/genpin.o \ - $(DRIVERS)/gp_2.o \ - $(DRIVERS)/gts1.o \ - $(DRIVERS)/gts3.o \ - $(DRIVERS)/gts3a.o \ - $(DRIVERS)/gts80.o \ - $(DRIVERS)/gts80a.o \ - $(DRIVERS)/gts80b.o \ - $(DRIVERS)/hankin.o \ - $(DRIVERS)/icecold.o \ - $(DRIVERS)/inder.o \ - $(DRIVERS)/jeutel.o \ - $(DRIVERS)/jp.o \ - $(DRIVERS)/jvh.o \ - $(DRIVERS)/kissproto.o \ - $(DRIVERS)/ltd.o \ - $(DRIVERS)/micropin.o \ - $(DRIVERS)/mephisto.o \ - $(DRIVERS)/mrgame.o \ - $(DRIVERS)/nsm.o \ - $(DRIVERS)/peyper.o \ - $(DRIVERS)/play_1.o \ - $(DRIVERS)/play_2.o \ - $(DRIVERS)/play_3.o \ - $(DRIVERS)/play_5.o \ - $(DRIVERS)/rowamet.o \ - $(DRIVERS)/s11.o \ - $(DRIVERS)/s11a.o \ - $(DRIVERS)/s11b.o \ - $(DRIVERS)/s11c.o \ - $(AUDIO)/s11c_bg.o \ - $(DRIVERS)/s3.o \ - $(DRIVERS)/s4.o \ - $(DRIVERS)/s6.o \ - $(DRIVERS)/s6a.o \ - $(DRIVERS)/s7.o \ - $(DRIVERS)/s8.o \ - $(DRIVERS)/s8a.o \ - $(DRIVERS)/s9.o \ - $(DRIVERS)/sam.o \ - $(DRIVERS)/sleic.o \ - $(DRIVERS)/spectra.o \ - $(DRIVERS)/spinb.o \ - $(DRIVERS)/st_mp100.o \ - $(DRIVERS)/st_mp200.o \ - $(DRIVERS)/taito.o \ - $(DRIVERS)/techno.o \ - $(DRIVERS)/vd.o \ - $(DRIVERS)/whitestar.o \ - $(DRIVERS)/white_mod.o \ - $(DRIVERS)/wico.o \ - $(DRIVERS)/wpc_95.o \ - $(DRIVERS)/wpc_an.o \ - $(DRIVERS)/wpc_dcs.o \ - $(DRIVERS)/wpc_dot.o \ - $(DRIVERS)/wpc_flip1.o \ - $(DRIVERS)/wpc_flip2.o \ - $(DRIVERS)/wpc_s.o \ - $(MACHINE)/wpc.o \ - $(AUDIO)/wpcsnd.o \ - $(VIDEO)/wpc_dmd.o \ - $(MACHINE)/wpc_pic.o \ - $(MACHINE)/wpc_lamp.o \ - $(MACHINE)/wpc_out.o \ - $(MACHINE)/wpc_shift.o \ - $(DRIVERS)/zac_1.o \ - $(DRIVERS)/zac_2.o \ - $(DRIVERS)/zac_proto.o \ - -#------------------------------------------------- -# remaining drivers -#------------------------------------------------- - -$(MAMEOBJ)/misc.a: \ - $(DRIVERS)/1945kiii.o \ - $(DRIVERS)/39in1.o \ - $(DRIVERS)/3do.o $(MACHINE)/3do.o \ - $(DRIVERS)/3x3puzzl.o \ - $(DRIVERS)/4enraya.o $(VIDEO)/4enraya.o \ - $(DRIVERS)/4enlinea.o \ - $(DRIVERS)/5clown.o \ - $(DRIVERS)/a1supply.o \ - $(DRIVERS)/acefruit.o \ - $(DRIVERS)/aces1.o \ - $(DRIVERS)/acesp.o \ - $(DRIVERS)/adp.o \ - $(DRIVERS)/alinvade.o \ - $(DRIVERS)/amaticmg.o \ - $(DRIVERS)/ampoker2.o $(VIDEO)/ampoker2.o \ - $(DRIVERS)/amspdwy.o $(VIDEO)/amspdwy.o \ - $(DRIVERS)/amusco.o \ - $(DRIVERS)/arachnid.o \ - $(DRIVERS)/artmagic.o $(VIDEO)/artmagic.o \ - $(DRIVERS)/astrafr.o \ - $(DRIVERS)/astrcorp.o \ - $(DRIVERS)/astropc.o \ - $(DRIVERS)/atronic.o \ - $(DRIVERS)/attckufo.o \ - $(DRIVERS)/avt.o \ - $(DRIVERS)/aztarac.o $(AUDIO)/aztarac.o $(VIDEO)/aztarac.o \ - $(DRIVERS)/bailey.o \ - $(DRIVERS)/beaminv.o \ - $(DRIVERS)/belatra.o \ - $(DRIVERS)/bgt.o \ - $(DRIVERS)/bingoman.o \ - $(DRIVERS)/bingor.o \ - $(DRIVERS)/blitz.o \ - $(DRIVERS)/blitz68k.o \ - $(DRIVERS)/buster.o \ - $(DRIVERS)/calomega.o $(VIDEO)/calomega.o \ - $(DRIVERS)/carrera.o \ - $(DRIVERS)/castle.o \ - $(DRIVERS)/cave.o $(VIDEO)/cave.o \ - $(DRIVERS)/cavepc.o \ - $(DRIVERS)/cv1k.o \ - $(DRIVERS)/cb2001.o \ - $(DRIVERS)/cdi.o $(VIDEO)/mcd212.o $(MACHINE)/cdi070.o $(MACHINE)/cdislave.o $(MACHINE)/cdicdic.o \ - $(DRIVERS)/cesclass.o \ - $(DRIVERS)/chance32.o \ - $(DRIVERS)/chicago.o \ - $(DRIVERS)/chsuper.o \ - $(DRIVERS)/cidelsa.o $(VIDEO)/cidelsa.o \ - $(DRIVERS)/cocoloco.o \ - $(DRIVERS)/coinmstr.o \ - $(DRIVERS)/coinmvga.o \ - $(DRIVERS)/comebaby.o \ - $(DRIVERS)/cupidon.o \ - $(DRIVERS)/bntyhunt.o \ - $(DRIVERS)/coolpool.o \ - $(DRIVERS)/megaphx.o \ - $(MACHINE)/inder_sb.o \ - $(MACHINE)/inder_vid.o \ - $(DRIVERS)/corona.o \ - $(DRIVERS)/crystal.o $(VIDEO)/vrender0.o \ - $(DRIVERS)/cubeqst.o \ - $(DRIVERS)/cybertnk.o \ - $(DRIVERS)/dcheese.o $(VIDEO)/dcheese.o \ - $(DRIVERS)/dfruit.o \ - $(DRIVERS)/dgpix.o \ - $(DRIVERS)/discoboy.o \ - $(DRIVERS)/dominob.o \ - $(DRIVERS)/dorachan.o \ - $(DRIVERS)/dreamwld.o \ - $(DRIVERS)/dribling.o $(VIDEO)/dribling.o \ - $(DRIVERS)/drw80pkr.o \ - $(DRIVERS)/dwarfd.o \ - $(DRIVERS)/dynadice.o \ - $(DRIVERS)/ecoinfr.o \ - $(DRIVERS)/ecoinf1.o \ - $(DRIVERS)/ecoinf2.o \ - $(DRIVERS)/ecoinf3.o \ - $(DRIVERS)/electra.o \ - $(DRIVERS)/epos.o $(VIDEO)/epos.o \ - $(DRIVERS)/esd16.o $(VIDEO)/esd16.o \ - $(DRIVERS)/esh.o \ - $(DRIVERS)/esripsys.o $(VIDEO)/esripsys.o \ - $(DRIVERS)/ettrivia.o \ - $(DRIVERS)/extrema.o \ - $(DRIVERS)/fireball.o \ - $(DRIVERS)/flipjack.o \ - $(DRIVERS)/flower.o $(AUDIO)/flower.o $(VIDEO)/flower.o \ - $(DRIVERS)/fortecar.o \ - $(DRIVERS)/fresh.o \ - $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \ - $(DRIVERS)/fungames.o \ - $(DRIVERS)/funkball.o \ - $(DRIVERS)/gambl186.o \ - $(DRIVERS)/galaxi.o \ - $(DRIVERS)/galgame.o \ - $(DRIVERS)/gamecstl.o \ - $(DRIVERS)/gammagic.o \ - $(DRIVERS)/gamtor.o \ - $(DRIVERS)/gei.o \ - $(DRIVERS)/globalfr.o \ - $(DRIVERS)/globalvr.o \ - $(DRIVERS)/gluck2.o \ - $(DRIVERS)/goldngam.o \ - $(DRIVERS)/goldnpkr.o \ - $(DRIVERS)/good.o \ - $(DRIVERS)/gotcha.o $(VIDEO)/gotcha.o \ - $(DRIVERS)/gstream.o \ - $(DRIVERS)/gumbo.o $(VIDEO)/gumbo.o \ - $(DRIVERS)/gunpey.o \ - $(DRIVERS)/hideseek.o \ - $(DRIVERS)/hazelgr.o \ - $(DRIVERS)/headonb.o \ - $(DRIVERS)/highvdeo.o \ - $(DRIVERS)/himesiki.o $(VIDEO)/himesiki.o \ - $(DRIVERS)/hitpoker.o \ - $(DRIVERS)/homedata.o $(VIDEO)/homedata.o \ - $(DRIVERS)/hotblock.o \ - $(DRIVERS)/hotstuff.o \ - $(DRIVERS)/ichiban.o \ - $(DRIVERS)/imolagp.o \ - $(DRIVERS)/intrscti.o \ - $(DRIVERS)/istellar.o \ - $(DRIVERS)/itgambl2.o \ - $(DRIVERS)/itgambl3.o \ - $(DRIVERS)/itgamble.o \ - $(DRIVERS)/jackpool.o \ - $(DRIVERS)/jankenmn.o \ - $(DRIVERS)/jokrwild.o \ - $(DRIVERS)/jongkyo.o \ - $(DRIVERS)/jubilee.o \ - $(DRIVERS)/kas89.o \ - $(DRIVERS)/kingpin.o \ - $(DRIVERS)/koikoi.o \ - $(DRIVERS)/kurukuru.o \ - $(DRIVERS)/kyugo.o $(VIDEO)/kyugo.o \ - $(DRIVERS)/ladyfrog.o $(VIDEO)/ladyfrog.o \ - $(DRIVERS)/laserbas.o \ - $(DRIVERS)/lethalj.o $(VIDEO)/lethalj.o \ - $(DRIVERS)/limenko.o \ - $(DRIVERS)/ltcasino.o \ - $(DRIVERS)/lucky74.o $(VIDEO)/lucky74.o \ - $(DRIVERS)/luckgrln.o \ - $(DRIVERS)/magic10.o \ - $(DRIVERS)/magicard.o \ - $(DRIVERS)/magicfly.o \ - $(DRIVERS)/magictg.o \ - $(DRIVERS)/magtouch.o \ - $(DRIVERS)/majorpkr.o \ - $(DRIVERS)/malzak.o $(VIDEO)/malzak.o \ - $(DRIVERS)/manohman.o \ - $(DRIVERS)/mcatadv.o $(VIDEO)/mcatadv.o \ - $(DRIVERS)/mgavegas.o \ - $(DRIVERS)/meyc8080.o \ - $(DRIVERS)/meyc8088.o \ - $(DRIVERS)/micro3d.o $(MACHINE)/micro3d.o $(VIDEO)/micro3d.o $(AUDIO)/micro3d.o \ - $(DRIVERS)/midas.o \ - $(DRIVERS)/miniboy7.o \ - $(DRIVERS)/mirax.o \ - $(DRIVERS)/mole.o \ - $(DRIVERS)/mosaic.o $(VIDEO)/mosaic.o \ - $(DRIVERS)/mpu12wbk.o \ - $(DRIVERS)/mrjong.o $(VIDEO)/mrjong.o \ - $(DRIVERS)/multfish.o \ - $(DRIVERS)/multfish_boot.o \ - $(DRIVERS)/multfish_ref.o \ - $(DRIVERS)/murogem.o \ - $(DRIVERS)/murogmbl.o \ - $(DRIVERS)/neoprint.o \ - $(DRIVERS)/neptunp2.o \ - $(DRIVERS)/news.o $(VIDEO)/news.o \ - $(DRIVERS)/nexus3d.o \ - $(DRIVERS)/norautp.o $(AUDIO)/norautp.o \ - $(DRIVERS)/nsmpoker.o \ - $(DRIVERS)/oneshot.o $(VIDEO)/oneshot.o \ - $(DRIVERS)/onetwo.o \ - $(DRIVERS)/othello.o \ - $(DRIVERS)/pachifev.o \ - $(DRIVERS)/pasha2.o \ - $(DRIVERS)/pass.o $(VIDEO)/pass.o \ - $(DRIVERS)/peplus.o \ - $(DRIVERS)/photon.o $(VIDEO)/pk8000.o \ - $(DRIVERS)/photon2.o \ - $(DRIVERS)/photoply.o \ - $(DRIVERS)/pinkiri8.o \ - $(DRIVERS)/pipeline.o \ - $(DRIVERS)/pkscram.o \ - $(DRIVERS)/pntnpuzl.o \ - $(DRIVERS)/policetr.o $(VIDEO)/policetr.o \ - $(DRIVERS)/polyplay.o $(AUDIO)/polyplay.o $(VIDEO)/polyplay.o \ - $(DRIVERS)/poker72.o \ - $(DRIVERS)/potgoldu.o \ - $(DRIVERS)/proconn.o \ - $(DRIVERS)/psattack.o \ - $(DRIVERS)/pse.o \ - $(DRIVERS)/quizo.o \ - $(DRIVERS)/quizpun2.o \ - $(DRIVERS)/rbmk.o \ - $(DRIVERS)/rcorsair.o \ - $(DRIVERS)/re900.o \ - $(DRIVERS)/rgum.o \ - $(DRIVERS)/roul.o \ - $(DRIVERS)/savquest.o \ - $(DRIVERS)/sanremo.o \ - $(DRIVERS)/sfbonus.o \ - $(DRIVERS)/shangkid.o $(VIDEO)/shangkid.o \ - $(DRIVERS)/skeetsht.o \ - $(DRIVERS)/skimaxx.o \ - $(DRIVERS)/skyarmy.o \ - $(DRIVERS)/skylncr.o \ - $(DRIVERS)/sliver.o \ - $(DRIVERS)/slotcarn.o \ - $(DRIVERS)/smsmcorp.o \ - $(DRIVERS)/sothello.o \ - $(DRIVERS)/splus.o \ - $(DRIVERS)/spool99.o \ - $(DRIVERS)/sprcros2.o $(VIDEO)/sprcros2.o \ - $(DRIVERS)/sshot.o \ - $(DRIVERS)/ssingles.o \ - $(DRIVERS)/sstrangr.o \ - $(DRIVERS)/statriv2.o \ - $(DRIVERS)/stellafr.o \ - $(DRIVERS)/stuntair.o \ - $(DRIVERS)/su2000.o \ - $(DRIVERS)/summit.o \ - $(DRIVERS)/sumt8035.o \ - $(DRIVERS)/supercrd.o \ - $(DRIVERS)/supertnk.o \ - $(DRIVERS)/superwng.o \ - $(DRIVERS)/tapatune.o \ - $(DRIVERS)/tattack.o \ - $(DRIVERS)/taxidriv.o $(VIDEO)/taxidriv.o \ - $(DRIVERS)/tcl.o \ - $(DRIVERS)/thayers.o \ - $(DRIVERS)/thedeep.o $(VIDEO)/thedeep.o \ - $(DRIVERS)/tiamc1.o $(VIDEO)/tiamc1.o $(AUDIO)/tiamc1.o \ - $(DRIVERS)/tickee.o \ - $(DRIVERS)/tmspoker.o \ - $(DRIVERS)/truco.o $(VIDEO)/truco.o \ - $(DRIVERS)/trucocl.o $(VIDEO)/trucocl.o \ - $(DRIVERS)/trvmadns.o \ - $(DRIVERS)/trvquest.o \ - $(DRIVERS)/ttchamp.o \ - $(DRIVERS)/tugboat.o \ - $(DRIVERS)/umipoker.o \ - $(DRIVERS)/unkfr.o \ - $(DRIVERS)/unkhorse.o \ - $(DRIVERS)/usgames.o $(VIDEO)/usgames.o \ - $(DRIVERS)/vamphalf.o \ - $(DRIVERS)/vcombat.o \ - $(DRIVERS)/vectrex.o $(VIDEO)/vectrex.o $(MACHINE)/vectrex.o \ - $(DRIVERS)/videopkr.o \ - $(DRIVERS)/vlc.o \ - $(DRIVERS)/voyager.o \ - $(DRIVERS)/vp101.o \ - $(DRIVERS)/vpoker.o \ - $(DRIVERS)/vroulet.o \ - $(DRIVERS)/wildpkr.o \ - $(DRIVERS)/wms.o \ - $(DRIVERS)/xtom3d.o \ - $(DRIVERS)/xyonix.o $(VIDEO)/xyonix.o \ - - -#------------------------------------------------- -# layout dependencies -#------------------------------------------------- - -$(DRIVERS)/24cdjuke.o: $(LAYOUT)/24cdjuke.lh - -$(DRIVERS)/30test.o: $(LAYOUT)/30test.lh - -$(DRIVERS)/8080bw.o: $(LAYOUT)/attackfc.lh \ - $(LAYOUT)/cosmicm.lh \ - $(LAYOUT)/galactic.lh \ - $(LAYOUT)/gunchamp.lh \ - $(LAYOUT)/shuttlei.lh \ - $(LAYOUT)/spacecom.lh - -$(DRIVERS)/ace.o: $(LAYOUT)/ace.lh - -$(DRIVERS)/aces1.o: $(LAYOUT)/aces1.lh - -$(DRIVERS)/acefruit.o: $(LAYOUT)/sidewndr.lh - -$(DRIVERS)/alinvade.o: $(LAYOUT)/alinvade.lh - -$(DRIVERS)/allied.o: $(LAYOUT)/allied.lh - -$(DRIVERS)/amaticmg.o: $(LAYOUT)/suprstar.lh - -$(DRIVERS)/ampoker2.o: $(LAYOUT)/ampoker2.lh \ - $(LAYOUT)/sigmapkr.lh \ - -$(DRIVERS)/aristmk4.o: $(LAYOUT)/aristmk4.lh \ - $(LAYOUT)/arimk4nz.lh \ - $(LAYOUT)/3bagflnz.lh \ - $(LAYOUT)/3bagflvt.lh \ - $(LAYOUT)/arcwins.lh \ - $(LAYOUT)/cgold2.lh \ - $(LAYOUT)/eforest.lh \ - $(LAYOUT)/fhunter.lh \ - $(LAYOUT)/goldenc.lh \ - $(LAYOUT)/kgbird.lh \ - $(LAYOUT)/topgear.lh \ - $(LAYOUT)/wildone.lh \ - $(LAYOUT)/gunnrose.lh \ - $(LAYOUT)/gldnpkr.lh \ - -$(DRIVERS)/asteroid.o: $(LAYOUT)/astdelux.lh - -$(DRIVERS)/astrocde.o: $(LAYOUT)/gorf.lh \ - $(LAYOUT)/seawolf2.lh \ - $(LAYOUT)/spacezap.lh \ - $(LAYOUT)/tenpindx.lh - -$(DRIVERS)/atarifb.o: $(LAYOUT)/atarifb.lh \ - $(LAYOUT)/atarifb4.lh \ - $(LAYOUT)/abaseb.lh - -$(DRIVERS)/atari_s1.o: $(LAYOUT)/atari_s1.lh - -$(DRIVERS)/atari_s2.o: $(LAYOUT)/atari_s2.lh - -$(DRIVERS)/avalnche.o: $(LAYOUT)/avalnche.lh - -$(DRIVERS)/balsente.o: $(LAYOUT)/stocker.lh - -$(DRIVERS)/barata.o: $(LAYOUT)/barata.lh - -$(DRIVERS)/beaminv.o: $(LAYOUT)/beaminv.lh - -$(DRIVERS)/bfm_sc1.o: $(LAYOUT)/sc1_vfd.lh \ - $(LAYOUT)/sc1_vid.lh - -$(DRIVERS)/bfm_sc2.o: $(LAYOUT)/sc2_vfd.lh \ - $(LAYOUT)/sc2_dmd.lh \ - $(LAYOUT)/sc2_vid.lh \ - $(LAYOUT)/drwho.lh \ - $(LAYOUT)/gldncrwn.lh \ - $(LAYOUT)/quintoon.lh \ - $(LAYOUT)/paradice.lh \ - $(LAYOUT)/pyramid.lh \ - $(LAYOUT)/pokio.lh \ - $(LAYOUT)/slots.lh \ - $(LAYOUT)/sltblgpo.lh \ - $(LAYOUT)/sltblgtk.lh - -$(DRIVERS)/bfm_sc4.o: $(LAYOUT)/bfm_sc4.lh \ - $(LAYOUT)/sc4_dmd.lh \ - $(LAYOUT)/sc4dnd.lh \ - $(LAYOUT)/sc4dndtp.lh \ - $(LAYOUT)/sc4dnddw.lh - -$(DRIVERS)/bfm_sc5.o: $(LAYOUT)/bfm_sc5.lh - -$(DRIVERS)/bfmsys85.o: $(LAYOUT)/bfmsys85.lh - -$(DRIVERS)/blockade.o: $(LAYOUT)/blockade.lh - -$(DRIVERS)/buggychl.o: $(LAYOUT)/buggychl.lh - -$(DRIVERS)/by17.o: $(LAYOUT)/by17.lh -$(DRIVERS)/by35.o: $(LAYOUT)/by35.lh - -$(DRIVERS)/bzone.o: $(LAYOUT)/bzone.lh \ - $(LAYOUT)/redbaron.lh - -$(DRIVERS)/cardline.o: $(LAYOUT)/cardline.lh - -$(DRIVERS)/cave.o: $(LAYOUT)/ppsatan.lh - -$(DRIVERS)/cdi.o: $(LAYOUT)/cdi.lh - -$(DRIVERS)/chance32.o: $(LAYOUT)/chance32.lh - -$(DRIVERS)/changela.o: $(LAYOUT)/changela.lh - -$(DRIVERS)/chqflag.o: $(LAYOUT)/chqflag.lh - -$(DRIVERS)/cinemat.o: $(LAYOUT)/armora.lh \ - $(LAYOUT)/barrier.lh \ - $(LAYOUT)/demon.lh \ - $(LAYOUT)/solarq.lh \ - $(LAYOUT)/starcas.lh \ - $(LAYOUT)/sundance.lh \ - $(LAYOUT)/tailg.lh \ - $(LAYOUT)/wotw.lh - -$(DRIVERS)/cischeat.o: $(LAYOUT)/cischeat.lh \ - $(LAYOUT)/f1gpstar.lh - -$(DRIVERS)/circus.o: $(LAYOUT)/circus.lh \ - $(LAYOUT)/crash.lh - -$(DRIVERS)/cops.o: $(LAYOUT)/cops.lh - -$(DRIVERS)/copsnrob.o: $(LAYOUT)/copsnrob.lh - -$(DRIVERS)/corona.o: $(LAYOUT)/re800.lh \ - $(LAYOUT)/luckyrlt.lh - -$(DRIVERS)/cps3.o: $(LAYOUT)/sfiii2.lh - -$(DRIVERS)/darius.o: $(LAYOUT)/darius.lh - -$(DRIVERS)/dblcrown.o: $(LAYOUT)/dblcrown.lh - -$(DRIVERS)/de_2.o: $(LAYOUT)/de2.lh \ - $(LAYOUT)/de2a3.lh - -$(DRIVERS)/destroyr.o: $(LAYOUT)/destroyr.lh - -$(DRIVERS)/dlair.o: $(LAYOUT)/dlair.lh - -$(DRIVERS)/dragrace.o: $(LAYOUT)/dragrace.lh - -$(DRIVERS)/ecoinfr.o: $(LAYOUT)/ecoinfr.lh - -$(DRIVERS)/ecoinf2.o: $(LAYOUT)/ecoinf2.lh - -$(DRIVERS)/ecoinf3.o: $(LAYOUT)/ecoinf3.lh - -$(DRIVERS)/fireball.o: $(LAYOUT)/fireball.lh - -$(DRIVERS)/firebeat.o: $(LAYOUT)/firebeat.lh - -$(DRIVERS)/firetrk.o: $(LAYOUT)/superbug.lh - -$(DRIVERS)/flicker.o: $(LAYOUT)/flicker.lh - -$(DRIVERS)/fortecar.o: $(LAYOUT)/fortecrd.lh - -$(DRIVERS)/funworld.o: $(LAYOUT)/jollycrd.lh \ - $(LAYOUT)/bonuscrd.lh \ - $(LAYOUT)/novoplay.lh \ - $(LAYOUT)/royalcrd.lh - -$(DRIVERS)/g627.o: $(LAYOUT)/g627.lh -$(DRIVERS)/gp_1.o: $(LAYOUT)/gp_1.lh -$(DRIVERS)/gp_2.o: $(LAYOUT)/gp_2.lh - -$(DRIVERS)/galaxi.o: $(LAYOUT)/galaxi.lh - -$(DRIVERS)/gatron.o: $(LAYOUT)/poker41.lh \ - $(LAYOUT)/pulltabs.lh \ - $(LAYOUT)/bingo.lh - -$(DRIVERS)/globalfr.o: $(LAYOUT)/globalfr.lh - -$(DRIVERS)/goldnpkr.o: $(LAYOUT)/goldnpkr.lh \ - $(LAYOUT)/pmpoker.lh \ - $(LAYOUT)/upndown.lh - -$(DRIVERS)/gts1.o: $(LAYOUT)/gts1.lh -$(DRIVERS)/gts3.o: $(LAYOUT)/gts3.lh -$(DRIVERS)/gts80.o: $(LAYOUT)/gts80.lh -$(DRIVERS)/gts80a.o: $(LAYOUT)/gts80a.lh \ - $(LAYOUT)/gts80a_caveman.lh -$(DRIVERS)/gts80b.o: $(LAYOUT)/gts80b.lh - -$(DRIVERS)/lbeach.o: $(LAYOUT)/lbeach.lh - -$(DRIVERS)/goldstar.o: $(LAYOUT)/goldstar.lh \ - $(LAYOUT)/bingowng.lh \ - $(LAYOUT)/cherryb3.lh \ - $(LAYOUT)/chrygld.lh \ - $(LAYOUT)/cmaster.lh \ - $(LAYOUT)/cmasterb.lh \ - $(LAYOUT)/cmasterc.lh \ - $(LAYOUT)/cmpacman.lh \ - $(LAYOUT)/cmv4.lh \ - $(LAYOUT)/crazybon.lh \ - $(LAYOUT)/lucky8.lh \ - $(LAYOUT)/nfb96.lh \ - $(LAYOUT)/nfb96tx.lh \ - $(LAYOUT)/pokonl97.lh \ - $(LAYOUT)/roypok96.lh \ - $(LAYOUT)/skill98.lh \ - $(LAYOUT)/tonypok.lh \ - $(LAYOUT)/unkch.lh - -$(DRIVERS)/grchamp.o: $(LAYOUT)/grchamp.lh - -$(DRIVERS)/harddriv.o: $(LAYOUT)/racedrivpan.lh - -$(DRIVERS)/highvdeo.o: $(LAYOUT)/fashion.lh - -$(DRIVERS)/hankin.o: $(LAYOUT)/hankin.lh - -$(DRIVERS)/hitme.o: $(LAYOUT)/barricad.lh - -$(DRIVERS)/icecold.o: $(LAYOUT)/icecold.lh - -$(DRIVERS)/igspoker.o: $(LAYOUT)/igspoker.lh - -$(DRIVERS)/imolagp.o: $(LAYOUT)/imolagp.lh - -$(DRIVERS)/inder.o: $(LAYOUT)/inder.lh - -$(DRIVERS)/jankenmn.o: $(LAYOUT)/jankenmn.lh - -$(DRIVERS)/jeutel.o: $(LAYOUT)/jeutel.lh -$(DRIVERS)/jp.o: $(LAYOUT)/jp.lh - -$(DRIVERS)/jpmimpct.o: $(LAYOUT)/jpmimpct.lh - -$(DRIVERS)/jpmmps.o: $(LAYOUT)/jpmmps.lh - -$(DRIVERS)/jpms80.o: $(LAYOUT)/jpms80.lh - -$(DRIVERS)/jpmsru.o: $(LAYOUT)/jpmsru.lh - -$(DRIVERS)/jpmsys5.o: $(LAYOUT)/jpmsys5.lh - -$(DRIVERS)/kas89.o: $(LAYOUT)/kas89.lh - -$(DRIVERS)/kenseim.o: $(LAYOUT)/kenseim.lh - -$(DRIVERS)/kingdrby.o: $(LAYOUT)/kingdrby.lh - -$(DRIVERS)/kungfur.o: $(LAYOUT)/kungfur.lh - -$(DRIVERS)/lazercmd.o: $(LAYOUT)/lazercmd.lh \ - $(LAYOUT)/medlanes.lh - -$(DRIVERS)/ltd.o: $(LAYOUT)/ltd.lh - -$(DRIVERS)/luckgrln.o: $(LAYOUT)/luckgrln.lh - -$(DRIVERS)/lucky74.o: $(LAYOUT)/lucky74.lh - -$(DRIVERS)/magic10.o: $(LAYOUT)/sgsafari.lh \ - $(LAYOUT)/musicsrt.lh - -$(DRIVERS)/majorpkr.o: $(LAYOUT)/majorpkr.lh - -$(DRIVERS)/maxaflex.o: $(LAYOUT)/maxaflex.lh - -$(DRIVERS)/maygay1b.o: $(LAYOUT)/maygay1b.lh - -$(DRIVERS)/micropin.o: $(LAYOUT)/micropin.lh - -$(DRIVERS)/mcr.o: $(LAYOUT)/dpoker.lh - -$(DRIVERS)/mcr3.o: $(LAYOUT)/spyhunt.lh \ - $(LAYOUT)/turbotag.lh - -$(DRIVERS)/mgames.o: $(LAYOUT)/mgames.lh - -$(DRIVERS)/mgavegas.o: $(LAYOUT)/mgavegas.lh - -$(DRIVERS)/mpu3.o: $(LAYOUT)/mpu3.lh - -$(DRIVERS)/mpu4mod2sw.o: $(LAYOUT)/connect4.lh \ - -$(DRIVERS)/mpu4mod4yam.o: $(LAYOUT)/gamball.lh \ - -$(DRIVERS)/mpu4hw.o: $(LAYOUT)/mpu4.lh \ - $(LAYOUT)/mpu4ext.lh - -$(DRIVERS)/mpu4vid.o: $(LAYOUT)/crmaze2p.lh \ - $(LAYOUT)/crmaze4p.lh - -$(DRIVERS)/mpu4plasma.o: $(LAYOUT)/mpu4plasma.lh \ - -$(DRIVERS)/mpu5hw.o: $(LAYOUT)/mpu5.lh - -$(DRIVERS)/mw18w.o: $(LAYOUT)/18w.lh - -$(DRIVERS)/mw8080bw.o: $(LAYOUT)/280zzzap.lh \ - $(LAYOUT)/clowns.lh \ - $(LAYOUT)/gunfight.lh \ - $(LAYOUT)/invaders.lh \ - $(LAYOUT)/invad2ct.lh \ - $(LAYOUT)/lagunar.lh \ - $(LAYOUT)/maze.lh \ - $(LAYOUT)/phantom2.lh \ - $(LAYOUT)/seawolf.lh \ - $(LAYOUT)/spacwalk.lh \ - $(LAYOUT)/spcenctr.lh - -$(DRIVERS)/mwsub.o: $(LAYOUT)/submar.lh - -$(DRIVERS)/meadows.o: $(LAYOUT)/deadeye.lh \ - $(LAYOUT)/gypsyjug.lh \ - $(LAYOUT)/minferno.lh - -$(DRIVERS)/meyc8080.o: $(LAYOUT)/wldarrow.lh \ - $(LAYOUT)/mdrawpkr.lh \ - $(LAYOUT)/meybjack.lh - -$(DRIVERS)/meyc8088.o: $(LAYOUT)/gldarrow.lh - -$(DRIVERS)/midzeus.o: $(LAYOUT)/crusnexo.lh - -$(DRIVERS)/mil4000.o: $(LAYOUT)/mil4000.lh - -$(DRIVERS)/namcofl.o: $(LAYOUT)/namcofl.lh - -$(DRIVERS)/model1.o: $(LAYOUT)/vr.lh - -$(DRIVERS)/nbmj8688.o: $(LAYOUT)/nbmj8688.lh - -$(DRIVERS)/namcos2.o: $(LAYOUT)/finallap.lh - -$(DRIVERS)/nemesis.o: $(LAYOUT)/konamigt.lh - -$(DRIVERS)/neogeo.o: $(LAYOUT)/neogeo.lh - -$(DRIVERS)/norautp.o: $(LAYOUT)/noraut11.lh \ - $(LAYOUT)/noraut12.lh - -$(DRIVERS)/nsm.o: $(LAYOUT)/nsm.lh - -$(DRIVERS)/omegrace.o: $(LAYOUT)/omegrace.lh - -$(DRIVERS)/overdriv.o: $(LAYOUT)/overdriv.lh - -$(DRIVERS)/peplus.o: $(LAYOUT)/peplus.lh \ - $(LAYOUT)/pe_schip.lh \ - $(LAYOUT)/pe_poker.lh \ - $(LAYOUT)/pe_bjack.lh \ - $(LAYOUT)/pe_keno.lh \ - $(LAYOUT)/pe_slots.lh - -$(DRIVERS)/polepos.o: $(LAYOUT)/polepos.lh \ - $(LAYOUT)/topracer.lh - -$(DRIVERS)/proconn.o: $(LAYOUT)/proconn.lh - -$(DRIVERS)/qix.o: $(LAYOUT)/elecyoyo.lh - -$(DRIVERS)/quizshow.o: $(LAYOUT)/quizshow.lh - -$(DRIVERS)/re900.o: $(LAYOUT)/re900.lh - -$(DRIVERS)/roul.o: $(LAYOUT)/roul.lh - -$(DRIVERS)/rowamet.o: $(LAYOUT)/rowamet.lh - -$(DRIVERS)/s3.o: $(LAYOUT)/s3.lh -$(DRIVERS)/s4.o: $(LAYOUT)/s4.lh -$(DRIVERS)/s6.o: $(LAYOUT)/s6.lh -$(DRIVERS)/s6a.o: $(LAYOUT)/s6a.lh -$(DRIVERS)/s7.o: $(LAYOUT)/s7.lh -$(DRIVERS)/s8.o: $(LAYOUT)/s8.lh -$(DRIVERS)/s8a.o: $(LAYOUT)/s8a.lh -$(DRIVERS)/s9.o: $(LAYOUT)/s9.lh -$(DRIVERS)/s11.o: $(LAYOUT)/s11.lh -$(DRIVERS)/s11a.o: $(LAYOUT)/s11a.lh -$(DRIVERS)/s11b.o: $(LAYOUT)/s11b.lh -$(DRIVERS)/s11c.o: $(LAYOUT)/s11c.lh - -$(DRIVERS)/sanremo.o: $(LAYOUT)/sanremo.lh - -$(DRIVERS)/sbrkout.o: $(LAYOUT)/sbrkout.lh - -$(DRIVERS)/sderby.o: $(LAYOUT)/sderby.lh \ - $(LAYOUT)/spacewin.lh \ - $(LAYOUT)/pmroulet.lh - -$(DRIVERS)/seabattl.o: $(LAYOUT)/seabattl.lh - -$(DRIVERS)/segajw.o: $(LAYOUT)/segajw.lh - -$(DRIVERS)/segaorun.o: $(LAYOUT)/outrun.lh - -$(DRIVERS)/segas32.o: $(LAYOUT)/radr.lh - -$(DRIVERS)/segaufo.o: $(LAYOUT)/newufo.lh \ - $(LAYOUT)/ufomini.lh \ - $(LAYOUT)/ufo21.lh \ - $(LAYOUT)/ufo800.lh - -$(DRIVERS)/segaybd.o: $(LAYOUT)/pdrift.lh - -$(DRIVERS)/sigmab52.o: $(LAYOUT)/sigmab52.lh - -$(DRIVERS)/skydiver.o: $(LAYOUT)/skydiver.lh - -$(DRIVERS)/snookr10.o: $(LAYOUT)/snookr10.lh - -$(DRIVERS)/spectra.o: $(LAYOUT)/spectra.lh - -$(DRIVERS)/splus.o: $(LAYOUT)/splus.lh - -$(DRIVERS)/speedbal.o: $(LAYOUT)/speedbal.lh - -$(DRIVERS)/sspeedr.o: $(LAYOUT)/sspeedr.lh - -$(DRIVERS)/stactics.o: $(LAYOUT)/stactics.lh - -$(DRIVERS)/sshot.o: $(LAYOUT)/gunchamps.lh - -$(DRIVERS)/sstrangr.o: $(LAYOUT)/sstrangr.lh - -$(DRIVERS)/st_mp100.o: $(LAYOUT)/st_mp100.lh -$(DRIVERS)/st_mp200.o: $(LAYOUT)/st_mp200.lh - -$(DRIVERS)/subsino.o: $(LAYOUT)/victor5.lh \ - $(LAYOUT)/victor21.lh \ - $(LAYOUT)/tisub.lh \ - $(LAYOUT)/stisub.lh \ - $(LAYOUT)/crsbingo.lh \ - $(LAYOUT)/sharkpy.lh \ - $(LAYOUT)/sharkpye.lh \ - $(LAYOUT)/smoto.lh - -$(DRIVERS)/superchs.o: $(LAYOUT)/superchs.lh - -$(DRIVERS)/sfbonus.o: $(LAYOUT)/pirpok2.lh - -$(DRIVERS)/taito.o: $(LAYOUT)/taito.lh - -$(DRIVERS)/taito_z.o: $(LAYOUT)/contcirc.lh \ - $(LAYOUT)/dblaxle.lh - -$(DRIVERS)/taitojc.o: $(LAYOUT)/dendego.lh - -$(DRIVERS)/tatsumi.o: $(LAYOUT)/roundup5.lh - -$(DRIVERS)/tceptor.o: $(LAYOUT)/tceptor2.lh - -$(DRIVERS)/techno.o: $(LAYOUT)/techno.lh - -$(DRIVERS)/tehkanwc.o: $(LAYOUT)/gridiron.lh - -$(DRIVERS)/tetrisp2.o: $(LAYOUT)/rocknms.lh \ - $(LAYOUT)/stepstag.lh - -$(DRIVERS)/thayers.o: $(LAYOUT)/dlair.lh - -$(DRIVERS)/topspeed.o: $(LAYOUT)/topspeed.lh - -$(DRIVERS)/turbo.o: $(LAYOUT)/turbo.lh \ - $(LAYOUT)/subroc3d.lh \ - $(LAYOUT)/buckrog.lh - -$(DRIVERS)/tx1.o: $(LAYOUT)/buggybjr.lh \ - $(LAYOUT)/buggyboy.lh \ - $(LAYOUT)/tx1.lh - -$(DRIVERS)/umipoker.o: $(LAYOUT)/saiyukip.lh - -$(DRIVERS)/undrfire.o: $(LAYOUT)/cbombers.lh - -$(DRIVERS)/vd.o: $(LAYOUT)/vd.lh - -$(DRIVERS)/vicdual.o: $(LAYOUT)/depthch.lh - -$(DRIVERS)/videopin.o: $(LAYOUT)/videopin.lh - -$(DRIVERS)/videopkr.o: $(LAYOUT)/videopkr.lh \ - $(LAYOUT)/blckjack.lh \ - $(LAYOUT)/videodad.lh \ - $(LAYOUT)/videocba.lh \ - $(LAYOUT)/babypkr.lh \ - $(LAYOUT)/babydad.lh - -$(DRIVERS)/warpwarp.o: $(LAYOUT)/geebee.lh \ - $(LAYOUT)/navarone.lh - -$(DRIVERS)/wpc_an.o: $(LAYOUT)/wpc_an.lh - -$(DRIVERS)/wecleman.o: $(LAYOUT)/wecleman.lh - -$(DRIVERS)/wico.o: $(LAYOUT)/wico.lh - -$(DRIVERS)/zac2650.o: $(LAYOUT)/tinv2650.lh - -$(DRIVERS)/zac_1.o: $(LAYOUT)/zac_1.lh - -$(DRIVERS)/zac_2.o: $(LAYOUT)/zac_2.lh - -$(DRIVERS)/zac_proto.o: $(LAYOUT)/zac_proto.lh - -$(DRIVERS)/peyper.o: $(LAYOUT)/peyper.lh - -#------------------------------------------------- -# misc dependencies -#------------------------------------------------- - -$(VIDEO)/jaguar.o: $(MAMESRC)/video/jagobj.inc \ - $(MAMESRC)/video/jagblit.inc -$(DRIVERS)/model1.o: $(MAMESRC)/includes/model1.h $(MAMESRC)/audio/dsbz80.h -$(VIDEO)/model1.o: $(MAMESRC)/includes/model1.h $(MAMESRC)/audio/dsbz80.h -$(MACHINE)/model1.o: $(MAMESRC)/includes/model1.h $(MAMESRC)/audio/dsbz80.h -$(VIDEO)/model2.o: $(MAMESRC)/video/model2rd.inc -$(VIDEO)/n64.o: $(MAMESRC)/video/rdpfiltr.inc -$(DRIVERS)/bfm_sc4.o: $(MAMESRC)/includes/bfm_sc45.h -$(DRIVERS)/bfm_sc5.o: $(MAMESRC)/includes/bfm_sc45.h -$(DRIVERS)/namcos2.o: $(MAMESRC)/includes/namcos2.h -$(MACHINE)/namcos2.o: $(MAMESRC)/includes/namcos2.h -$(VIDEO)/namcos2.o: $(MAMESRC)/includes/namcos2.h diff --git a/src/mame/tiny.mak b/src/mame/tiny.mak deleted file mode 100644 index 1c724be0f43..00000000000 --- a/src/mame/tiny.mak +++ /dev/null @@ -1,128 +0,0 @@ -########################################################################### -# -# tiny.mak -# -# Small driver-specific example makefile -# Use make SUBTARGET=tiny to build -# -# Copyright Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - -MAMESRC = $(SRC)/mame -MAMEOBJ = $(OBJ)/mame - -AUDIO = $(MAMEOBJ)/audio -DRIVERS = $(MAMEOBJ)/drivers -LAYOUT = $(MAMEOBJ)/layout -MACHINE = $(MAMEOBJ)/machine -VIDEO = $(MAMEOBJ)/video - -OBJDIRS += \ - $(AUDIO) \ - $(DRIVERS) \ - $(LAYOUT) \ - $(MACHINE) \ - $(VIDEO) \ - - - -#------------------------------------------------- -# Specify all the CPU cores necessary for the -# drivers referenced in tiny.c. -#------------------------------------------------- - -CPUS += Z80 -CPUS += M6502 -CPUS += MCS48 -CPUS += MCS51 -CPUS += M6800 -CPUS += M6809 -CPUS += M680X0 -CPUS += TMS9900 -CPUS += COP400 - - - -#------------------------------------------------- -# Specify all the sound cores necessary for the -# drivers referenced in tiny.c. -#------------------------------------------------- - -SOUNDS += SAMPLES -SOUNDS += DAC -SOUNDS += DISCRETE -SOUNDS += AY8910 -SOUNDS += YM2151 -SOUNDS += ASTROCADE -SOUNDS += TMS5220 -SOUNDS += OKIM6295 -SOUNDS += HC55516 -SOUNDS += YM3812 -SOUNDS += CEM3394 -SOUNDS += VOTRAX - - -#------------------------------------------------- -# specify available video cores -#------------------------------------------------- - -#------------------------------------------------- -# specify available machine cores -#------------------------------------------------- - -MACHINES += 6821PIA -MACHINES += TTL74148 -MACHINES += TTL74153 -MACHINES += TTL7474 -MACHINES += RIOT6532 -MACHINES += PIT8253 -MACHINES += Z80CTC -MACHINES += 68681 -MACHINES += BANKDEV - -#------------------------------------------------- -# specify available bus cores -#------------------------------------------------- -BUSES += CENTRONICS - - -#------------------------------------------------- -# This is the list of files that are necessary -# for building all of the drivers referenced -# in tiny.c -#------------------------------------------------- - -DRVLIBS = \ - $(MACHINE)/ticket.o \ - $(DRIVERS)/carpolo.o $(MACHINE)/carpolo.o $(VIDEO)/carpolo.o \ - $(DRIVERS)/circus.o $(AUDIO)/circus.o $(VIDEO)/circus.o \ - $(DRIVERS)/exidy.o $(AUDIO)/exidy.o $(VIDEO)/exidy.o \ - $(AUDIO)/exidy440.o \ - $(DRIVERS)/starfire.o $(VIDEO)/starfire.o \ - $(DRIVERS)/vertigo.o $(MACHINE)/vertigo.o $(VIDEO)/vertigo.o \ - $(DRIVERS)/victory.o $(VIDEO)/victory.o \ - $(AUDIO)/targ.o \ - $(DRIVERS)/astrocde.o $(VIDEO)/astrocde.o \ - $(DRIVERS)/gridlee.o $(AUDIO)/gridlee.o $(VIDEO)/gridlee.o \ - $(DRIVERS)/williams.o $(MACHINE)/williams.o $(AUDIO)/williams.o $(VIDEO)/williams.o \ - $(AUDIO)/gorf.o \ - $(AUDIO)/wow.o \ - $(DRIVERS)/gaelco.o $(VIDEO)/gaelco.o $(MACHINE)/gaelcrpt.o \ - $(DRIVERS)/wrally.o $(MACHINE)/wrally.o $(VIDEO)/wrally.o \ - $(DRIVERS)/looping.o \ - $(DRIVERS)/supertnk.o \ - - - -#------------------------------------------------- -# layout dependencies -#------------------------------------------------- - -$(DRIVERS)/astrocde.o: $(LAYOUT)/gorf.lh \ - $(LAYOUT)/seawolf2.lh \ - $(LAYOUT)/spacezap.lh \ - $(LAYOUT)/tenpindx.lh -$(DRIVERS)/circus.o: $(LAYOUT)/circus.lh \ - $(LAYOUT)/crash.lh diff --git a/src/mame/video/bbusters.c b/src/mame/video/bbusters.c index 77c90356759..dcc064e8037 100644 --- a/src/mame/video/bbusters.c +++ b/src/mame/video/bbusters.c @@ -76,7 +76,7 @@ VIDEO_START_MEMBER(bbusters_state,bbuster) m_pf1_tilemap->set_transparent_pen(15); m_fix_tilemap->set_transparent_pen(15); - + save_item(NAME(m_scale_line_count)); } @@ -88,7 +88,7 @@ VIDEO_START_MEMBER(bbusters_state,mechatt) m_pf1_tilemap->set_transparent_pen(15); m_fix_tilemap->set_transparent_pen(15); - + save_item(NAME(m_scale_line_count)); } diff --git a/src/mame/video/deadang.c b/src/mame/video/deadang.c index 606a7f08e8b..f1f9360798d 100644 --- a/src/mame/video/deadang.c +++ b/src/mame/video/deadang.c @@ -77,7 +77,7 @@ void deadang_state::video_start() m_pf2_layer->set_transparent_pen(15); m_pf1_layer->set_transparent_pen(15); m_text_layer->set_transparent_pen(15); - + save_item(NAME(m_tilebank)); save_item(NAME(m_oldtilebank)); } diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c index 61cc9d03d93..e8c7a5972a8 100644 --- a/src/mame/video/decmxc06.c +++ b/src/mame/video/decmxc06.c @@ -110,14 +110,14 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli else mult = -16; - + // thedeep strongly suggests that this check goes here, otherwise the radar breaks if (!(spriteram[offs] & 0x8000)) { offs += 4; continue; } - + for (x = 0; x < w; x++) { @@ -173,7 +173,7 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli offs += 4; if (offs >= m_ramsize / 2) return; - + } } diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index 86994063971..f588a436d2c 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -122,8 +122,8 @@ WRITE8_MEMBER(dynax_state::tenkai_blit_dest_w) } /* -mjelctrn: 7 d e -> 1 - 4 8 -mjembase: b d e -> - 2 4 8 +mjelctrn: 7 d e -> 1 - 4 8 +mjembase: b d e -> - 2 4 8 */ WRITE8_MEMBER(dynax_state::mjembase_blit_dest_w) { @@ -381,7 +381,7 @@ void dynax_state::blitter_plot_pixel( int layer, int mask, int x, int y, int pen } /* - Flags: + Flags: 7654 ---- - ---- 3--- Rotation = SWAPXY + FLIPY @@ -1223,9 +1223,9 @@ WRITE8_MEMBER(dynax_state::tenkai_priority_w) } /* -mjembase: priority: 00 08 10 18 20 28; enable: 1,2,4 +mjembase: priority: 00 08 10 18 20 28; enable: 1,2,4 Convert to: -mjelctrn: priority: 00 20 10 40 30 50; enable: 1,2,8 +mjelctrn: priority: 00 20 10 40 30 50; enable: 1,2,8 */ WRITE8_MEMBER(dynax_state::mjembase_priority_w) { diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c index 74564860689..9739ae6e2a1 100644 --- a/src/mame/video/hng64.c +++ b/src/mame/video/hng64.c @@ -660,7 +660,7 @@ void hng64_state::hng64_drawtilemap(screen_device &screen, bitmap_rgb32 &bitmap, // xrally's pink tilemaps make me think this is a tilemap enable bit. // fatfurwa makes me think otherwise. -// if (!(tileregs & 0x0040)) return; +// if (!(tileregs & 0x0040)) return; // set the transmask so our manual copy is correct if (tileregs & 0x0400) @@ -1020,17 +1020,34 @@ UINT32 hng64_state::screen_update_hng64(screen_device &screen, bitmap_rgb32 &bit UINT32 animbits; UINT16 tileflags[4]; -#if 0 +#if 1 // press in sams64_2 attract mode for a nice debug screen from the game // not sure how functional it is, and it doesn't appear to test everything (rowscroll modes etc.) // but it could be useful if ( machine().input().code_pressed_once(KEYCODE_L) ) { address_space &space = m_maincpu->space(AS_PROGRAM); - space.write_byte(0x2f27c8, 0x2); + + if (!strcmp(machine().system().name, "sams64_2")) + { + space.write_byte(0x2f27c8, 0x2); + } + else if (!strcmp(machine().system().name, "roadedge")) // hack to get test mode (useful for sound test) + { + space.write_byte(0xcfb53, 0x1); + } + else if (!strcmp(machine().system().name, "xrally")) // hack to get test mode (useful for sound test) + { + space.write_byte(0xa2363, 0x1); + } + } #endif + + + + bitmap.fill(hng64_tcram[0x50/4] & 0x10000 ? m_palette->black_pen() : m_palette->pen(0), cliprect); //FIXME: Is the register correct? check with HW tests screen.priority().fill(0x00, cliprect); @@ -1251,4 +1268,3 @@ void hng64_state::video_start() m_vertsrom = (UINT16*)memregion("verts")->base(); m_vertsrom_size = memregion("verts")->bytes(); } - diff --git a/src/mame/video/hng64_3d.c b/src/mame/video/hng64_3d.c index 0dbca3d24f7..3945a70dd4f 100644 --- a/src/mame/video/hng64_3d.c +++ b/src/mame/video/hng64_3d.c @@ -68,7 +68,7 @@ TIMER_CALLBACK_MEMBER(hng64_state::hng64_3dfifo_processed ) /* Note: Samurai Shodown games never calls bit 1, so it can't be framebuffer clear. It also calls bit 3 at start-up, meaning unknown */ WRITE32_MEMBER(hng64_state::dl_control_w) // This handles framebuffers { -// printf("dl_control_w %08x %08x\n", data, mem_mask); +// printf("dl_control_w %08x %08x\n", data, mem_mask); //if(data & 2) // swap buffers //{ @@ -540,7 +540,7 @@ void hng64_state::recoverPolygonBlock(const UINT16* packet, struct polygon* poly #if 0 if (((chunkOffset[2] & 0xc000) == 0x4000) && (m_screen->frame_number() & 1)) { - // if (chunkOffset[2] == 0xd870) + // if (chunkOffset[2] == 0xd870) { polys[*numPolys].debugColor = 0xffff0000; printf("%d (%08x) : %04x %04x %04x\n", k, address[k] * 3 * 2, chunkOffset[0], chunkOffset[1], chunkOffset[2]); @@ -863,13 +863,12 @@ void hng64_state::recoverPolygonBlock(const UINT16* packet, struct polygon* poly void hng64_state::hng64_command3d(const UINT16* packet) { - /* A temporary place to put some polygons. This will optimize away if the compiler's any good. */ int numPolys = 0; dynamic_array<polygon> polys(1024*5); //printf("packet type : %04x %04x|%04x %04x|%04x %04x|%04x %04x | %04x %04x %04x %04x %04x %04x %04x %04x\n", packet[0],packet[1],packet[2],packet[3],packet[4],packet[5],packet[6],packet[7], packet[8], packet[9], packet[10], packet[11], packet[12], packet[13], packet[14], packet[15]); - + switch (packet[0]) { case 0x0000: // Appears to be a NOP. @@ -1239,7 +1238,7 @@ inline void hng64_state::FillSmoothTexPCHorizontalLine( UINT8 paletteEntry = 0; float t_coord, s_coord; - const UINT8 *gfx = m_texturerom; + const UINT8 *gfx = m_texturerom; const UINT8 *textureOffset = &gfx[prOptions.texIndex * 1024 * 1024]; for (; x_start <= x_end; x_start++) @@ -1702,4 +1701,3 @@ void hng64_state::drawShaded( struct polygon *p) prOptions); } } - diff --git a/src/mame/video/hng64_sprite.c b/src/mame/video/hng64_sprite.c index 0c6f6e37fc3..39827c4c79e 100644 --- a/src/mame/video/hng64_sprite.c +++ b/src/mame/video/hng64_sprite.c @@ -222,4 +222,3 @@ void hng64_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, cons if (!chaini) source +=8; } } - diff --git a/src/mame/video/jalblend.c b/src/mame/video/jalblend.c index 6b6e6f8917a..1d96bc6dbbe 100644 --- a/src/mame/video/jalblend.c +++ b/src/mame/video/jalblend.c @@ -35,7 +35,7 @@ jaleco_blend_device::jaleco_blend_device(const machine_config &mconfig, const ch void jaleco_blend_device::device_start() { m_table = auto_alloc_array_clear(machine(), UINT8, 0xc00); - + save_pointer(NAME(m_table), 0xc00); } diff --git a/src/mame/video/jalblend.h b/src/mame/video/jalblend.h index 2fb6a20b32e..f382d63ac9c 100644 --- a/src/mame/video/jalblend.h +++ b/src/mame/video/jalblend.h @@ -3,7 +3,7 @@ class jaleco_blend_device : public device_t public: jaleco_blend_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~jaleco_blend_device() {} - + void set(int color, UINT8 val); rgb_t func(rgb_t dest, rgb_t addMe, UINT8 alpha); void drawgfx(palette_device &palette,bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx, @@ -18,14 +18,14 @@ protected: virtual void device_start(); virtual void device_reset(); -private: +private: /* each palette entry contains a fourth 'alpha' value */ UINT8 *m_table; - + template<class _BitmapClass> void drawgfx_common(palette_device &palette,_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, int transparent_color); }; -extern const device_type JALECO_BLEND;
\ No newline at end of file +extern const device_type JALECO_BLEND; diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c index ca7dde7f667..d1fa9dd0567 100644 --- a/src/mame/video/m107.c +++ b/src/mame/video/m107.c @@ -62,7 +62,7 @@ TILE_GET_INFO_MEMBER(m107_state::get_pf_tile_info) /*****************************************************************************/ -WRITE16_MEMBER(m107_state::m107_vram_w) +WRITE16_MEMBER(m107_state::vram_w) { int laynum; @@ -74,7 +74,7 @@ WRITE16_MEMBER(m107_state::m107_vram_w) /*****************************************************************************/ -WRITE16_MEMBER(m107_state::m107_control_w) +WRITE16_MEMBER(m107_state::control_w) { UINT16 old = m_control[offset]; pf_layer_info *layer; @@ -141,6 +141,16 @@ void m107_state::video_start() } m_buffered_spriteram = auto_alloc_array_clear(machine(), UINT16, 0x1000/2); + + save_item(NAME(m_sprite_display)); + save_item(NAME(m_raster_irq_position)); + save_item(NAME(m_control)); + save_pointer(NAME(m_buffered_spriteram), 0x1000/2); + + for (int i = 0; i < 4; i++) + { + save_item(NAME(m_pf_layer[i].vram_base), i); + } } /*****************************************************************************/ @@ -267,7 +277,7 @@ void m107_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const /*****************************************************************************/ -void m107_state::m107_update_scroll_positions() +void m107_state::update_scroll_positions() { int laynum; int i; @@ -306,7 +316,7 @@ void m107_state::m107_update_scroll_positions() /*****************************************************************************/ -void m107_state::m107_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int laynum, int category,int opaque) +void m107_state::tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int laynum, int category,int opaque) { int line; rectangle clip; @@ -331,25 +341,25 @@ void m107_state::m107_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, } -void m107_state::m107_screenrefresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void m107_state::screenrefresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); if ((~m_control[0x0b] >> 7) & 1) { - m107_tilemap_draw(screen, bitmap, cliprect, 3, 0,0); - m107_tilemap_draw(screen, bitmap, cliprect, 3, 1,0); + tilemap_draw(screen, bitmap, cliprect, 3, 0,0); + tilemap_draw(screen, bitmap, cliprect, 3, 1,0); } else bitmap.fill(0, cliprect); /* note: the opaque flag is used if layer 3 is disabled, noticeable in World PK Soccer title and gameplay screens */ - m107_tilemap_draw(screen, bitmap, cliprect, 2, 0,(((m_control[0x0b] >> 7) & 1) ? TILEMAP_DRAW_OPAQUE : 0)); - m107_tilemap_draw(screen, bitmap, cliprect, 1, 0,0); - m107_tilemap_draw(screen, bitmap, cliprect, 0, 0,0); - m107_tilemap_draw(screen, bitmap, cliprect, 2, 1,0); - m107_tilemap_draw(screen, bitmap, cliprect, 1, 1,0); - m107_tilemap_draw(screen, bitmap, cliprect, 0, 1,0); + tilemap_draw(screen, bitmap, cliprect, 2, 0,(((m_control[0x0b] >> 7) & 1) ? TILEMAP_DRAW_OPAQUE : 0)); + tilemap_draw(screen, bitmap, cliprect, 1, 0,0); + tilemap_draw(screen, bitmap, cliprect, 0, 0,0); + tilemap_draw(screen, bitmap, cliprect, 2, 1,0); + tilemap_draw(screen, bitmap, cliprect, 1, 1,0); + tilemap_draw(screen, bitmap, cliprect, 0, 1,0); if(m_sprite_display) draw_sprites(screen, bitmap, cliprect); @@ -360,7 +370,7 @@ void m107_state::m107_screenrefresh(screen_device &screen, bitmap_ind16 &bitmap, /*****************************************************************************/ -WRITE16_MEMBER(m107_state::m107_spritebuffer_w) +WRITE16_MEMBER(m107_state::spritebuffer_w) { if (ACCESSING_BITS_0_7) { /* @@ -375,9 +385,9 @@ WRITE16_MEMBER(m107_state::m107_spritebuffer_w) /*****************************************************************************/ -UINT32 m107_state::screen_update_m107(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 m107_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - m107_update_scroll_positions(); - m107_screenrefresh(screen, bitmap, cliprect); + update_scroll_positions(); + screenrefresh(screen, bitmap, cliprect); return 0; } diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c index 228d4ab7d33..99948b6c601 100644 --- a/src/mame/video/m72.c +++ b/src/mame/video/m72.c @@ -7,7 +7,7 @@ ***************************************************************************/ -inline void m72_state::m72_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum) +inline void m72_state::get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum) { int code,attr,color,pri; @@ -54,19 +54,19 @@ inline void m72_state::rtype2_get_tile_info(tile_data &tileinfo,int tile_index,c } -TILE_GET_INFO_MEMBER(m72_state::m72_get_bg_tile_info) +TILE_GET_INFO_MEMBER(m72_state::get_bg_tile_info) { - m72_get_tile_info(tileinfo,tile_index,m_videoram2,2); + get_tile_info(tileinfo,tile_index,m_videoram2,2); } -TILE_GET_INFO_MEMBER(m72_state::m72_get_fg_tile_info) +TILE_GET_INFO_MEMBER(m72_state::get_fg_tile_info) { - m72_get_tile_info(tileinfo,tile_index,m_videoram1,1); + get_tile_info(tileinfo,tile_index,m_videoram1,1); } TILE_GET_INFO_MEMBER(m72_state::hharry_get_bg_tile_info) { - m72_get_tile_info(tileinfo,tile_index,m_videoram2,1); + get_tile_info(tileinfo,tile_index,m_videoram2,1); } TILE_GET_INFO_MEMBER(m72_state::rtype2_get_bg_tile_info) @@ -107,8 +107,8 @@ void m72_state::register_savestate() VIDEO_START_MEMBER(m72_state,m72) { - m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::m72_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64); - m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64); + m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64); + m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64); m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2); @@ -178,6 +178,9 @@ VIDEO_START_MEMBER(m72_state,poundfor) m_bg_tilemap->set_scrolldx(6,0); m_fg_tilemap->set_scrolldy(-128,-128); m_bg_tilemap->set_scrolldy(-128,-128); + + save_item(NAME(m_prev)); + save_item(NAME(m_diff)); } VIDEO_START_MEMBER(m72_state,hharryu) @@ -218,12 +221,13 @@ VIDEO_START_MEMBER(m72_state,majtitle) m_bg_tilemap->set_scrolldy(-128,-128); register_savestate(); + save_item(NAME(m_majtitle_rowscroll)); } VIDEO_START_MEMBER(m72_state,hharry) { m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::hharry_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64); - m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64); + m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,8,8,64,64); m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2); @@ -253,7 +257,7 @@ VIDEO_START_MEMBER(m72_state,hharry) ***************************************************************************/ -READ16_MEMBER(m72_state::m72_palette1_r) +READ16_MEMBER(m72_state::palette1_r) { /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */ offset &= ~0x100; @@ -261,7 +265,7 @@ READ16_MEMBER(m72_state::m72_palette1_r) return m_generic_paletteram_16[offset] | 0xffe0; /* only D0-D4 are connected */ } -READ16_MEMBER(m72_state::m72_palette2_r) +READ16_MEMBER(m72_state::palette2_r) { /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */ offset &= ~0x100; @@ -274,7 +278,7 @@ inline void m72_state::changecolor(int color,int r,int g,int b) m_palette->set_pen_color(color,pal5bit(r),pal5bit(g),pal5bit(b)); } -WRITE16_MEMBER(m72_state::m72_palette1_w) +WRITE16_MEMBER(m72_state::palette1_w) { /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */ offset &= ~0x100; @@ -287,7 +291,7 @@ WRITE16_MEMBER(m72_state::m72_palette1_w) m_generic_paletteram_16[offset + 0x400]); } -WRITE16_MEMBER(m72_state::m72_palette2_w) +WRITE16_MEMBER(m72_state::palette2_w) { /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */ offset &= ~0x100; @@ -300,51 +304,51 @@ WRITE16_MEMBER(m72_state::m72_palette2_w) m_generic_paletteram2_16[offset + 0x400]); } -WRITE16_MEMBER(m72_state::m72_videoram1_w) +WRITE16_MEMBER(m72_state::videoram1_w) { COMBINE_DATA(&m_videoram1[offset]); m_fg_tilemap->mark_tile_dirty(offset/2); } -WRITE16_MEMBER(m72_state::m72_videoram2_w) +WRITE16_MEMBER(m72_state::videoram2_w) { COMBINE_DATA(&m_videoram2[offset]); m_bg_tilemap->mark_tile_dirty(offset/2); } -WRITE16_MEMBER(m72_state::m72_irq_line_w) +WRITE16_MEMBER(m72_state::irq_line_w) { COMBINE_DATA(&m_raster_irq_position); } -WRITE16_MEMBER(m72_state::m72_scrollx1_w) +WRITE16_MEMBER(m72_state::scrollx1_w) { COMBINE_DATA(&m_scrollx1); } -WRITE16_MEMBER(m72_state::m72_scrollx2_w) +WRITE16_MEMBER(m72_state::scrollx2_w) { COMBINE_DATA(&m_scrollx2); } -WRITE16_MEMBER(m72_state::m72_scrolly1_w) +WRITE16_MEMBER(m72_state::scrolly1_w) { COMBINE_DATA(&m_scrolly1); } -WRITE16_MEMBER(m72_state::m72_scrolly2_w) +WRITE16_MEMBER(m72_state::scrolly2_w) { COMBINE_DATA(&m_scrolly2); } -WRITE16_MEMBER(m72_state::m72_dmaon_w) +WRITE16_MEMBER(m72_state::dmaon_w) { if (ACCESSING_BITS_0_7) memcpy(m_buffered_spriteram, m_spriteram, m_spriteram.bytes()); } -WRITE16_MEMBER(m72_state::m72_port02_w) +WRITE16_MEMBER(m72_state::port02_w) { if (ACCESSING_BITS_0_7) { @@ -409,7 +413,7 @@ WRITE16_MEMBER(m72_state::majtitle_gfx_ctrl_w) ***************************************************************************/ -void m72_state::m72_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) +void m72_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) { UINT16 *spriteram = m_buffered_spriteram; int offs; @@ -512,7 +516,7 @@ void m72_state::majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &clip } } -UINT32 m72_state::screen_update_m72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 m72_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_video_off) { @@ -528,7 +532,7 @@ UINT32 m72_state::screen_update_m72(screen_device &screen, bitmap_ind16 &bitmap, m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0); m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0); - m72_draw_sprites(bitmap,cliprect); + draw_sprites(bitmap,cliprect); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0); m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0); return 0; @@ -565,7 +569,7 @@ UINT32 m72_state::screen_update_majtitle(screen_device &screen, bitmap_ind16 &bi m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0); m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0); majtitle_draw_sprites(bitmap,cliprect); - m72_draw_sprites(bitmap,cliprect); + draw_sprites(bitmap,cliprect); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0); m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0); return 0; diff --git a/src/mame/video/mainsnk.c b/src/mame/video/mainsnk.c index 78d4ff14e09..6d7a212f0fd 100644 --- a/src/mame/video/mainsnk.c +++ b/src/mame/video/mainsnk.c @@ -76,10 +76,12 @@ void mainsnk_state::video_start() m_bg_tilemap->set_scrolldx(16, 16); m_bg_tilemap->set_scrolldy(8, 8); + + save_item(NAME(m_bg_tile_offset)); } -WRITE8_MEMBER(mainsnk_state::mainsnk_c600_w) +WRITE8_MEMBER(mainsnk_state::c600_w) { int bank; int total_elements = m_gfxdecode->gfx(0)->elements(); @@ -102,13 +104,13 @@ WRITE8_MEMBER(mainsnk_state::mainsnk_c600_w) } } -WRITE8_MEMBER(mainsnk_state::mainsnk_fgram_w) +WRITE8_MEMBER(mainsnk_state::fgram_w) { m_fgram[offset] = data; m_tx_tilemap->mark_tile_dirty(offset); } -WRITE8_MEMBER(mainsnk_state::mainsnk_bgram_w) +WRITE8_MEMBER(mainsnk_state::bgram_w) { m_bgram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); @@ -158,7 +160,7 @@ void mainsnk_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } -UINT32 mainsnk_state::screen_update_mainsnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 mainsnk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect, 0, 0); diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c index cd9a7bf3b82..9e0d06c5b6a 100644 --- a/src/mame/video/niyanpai.c +++ b/src/mame/video/niyanpai.c @@ -13,12 +13,12 @@ ******************************************************************************/ -READ16_MEMBER(niyanpai_state::niyanpai_palette_r) +READ16_MEMBER(niyanpai_state::palette_r) { return m_palette_ptr[offset]; } -WRITE16_MEMBER(niyanpai_state::niyanpai_palette_w) +WRITE16_MEMBER(niyanpai_state::palette_w) { int r, g, b; int offs_h, offs_l; @@ -57,7 +57,7 @@ WRITE16_MEMBER(niyanpai_state::niyanpai_palette_w) ******************************************************************************/ -int niyanpai_state::niyanpai_blitter_r(int vram, int offset) +int niyanpai_state::blitter_r(int vram, int offset) { int ret; UINT8 *GFXROM = memregion("gfx1")->base(); @@ -72,7 +72,7 @@ int niyanpai_state::niyanpai_blitter_r(int vram, int offset) return ret; } -void niyanpai_state::niyanpai_blitter_w(int vram, int offset, UINT8 data) +void niyanpai_state::blitter_w(int vram, int offset, UINT8 data) { switch (offset) { @@ -84,7 +84,7 @@ void niyanpai_state::niyanpai_blitter_w(int vram, int offset, UINT8 data) // if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)"); m_flipscreen[vram] = (data & 0x40) ? 0 : 1; m_dispflag[vram] = (data & 0x80) ? 1 : 0; - niyanpai_vramflip(vram); + vramflip(vram); break; case 0x01: m_scrollx[vram] = (m_scrollx[vram] & 0x0100) | data; break; case 0x02: m_scrollx[vram] = (m_scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100); break; @@ -99,18 +99,18 @@ void niyanpai_state::niyanpai_blitter_w(int vram, int offset, UINT8 data) case 0x0b: m_blitter_destx[vram] = (m_blitter_destx[vram] & 0x00ff) | (data << 8); break; case 0x0c: m_blitter_desty[vram] = (m_blitter_desty[vram] & 0xff00) | data; break; case 0x0d: m_blitter_desty[vram] = (m_blitter_desty[vram] & 0x00ff) | (data << 8); - niyanpai_gfxdraw(vram); + gfxdraw(vram); break; default: break; } } -void niyanpai_state::niyanpai_clutsel_w(int vram, UINT8 data) +void niyanpai_state::clutsel_w(int vram, UINT8 data) { m_clutsel[vram] = data; } -void niyanpai_state::niyanpai_clut_w(int vram, int offset, UINT8 data) +void niyanpai_state::clut_w(int vram, int offset, UINT8 data) { m_clut[vram][((m_clutsel[vram] & 0xff) * 0x10) + (offset & 0x0f)] = data; } @@ -119,7 +119,7 @@ void niyanpai_state::niyanpai_clut_w(int vram, int offset, UINT8 data) ******************************************************************************/ -void niyanpai_state::niyanpai_vramflip(int vram) +void niyanpai_state::vramflip(int vram) { int x, y; UINT16 color1, color2; @@ -172,7 +172,7 @@ void niyanpai_state::device_timer(emu_timer &timer, device_timer_id id, int para } } -void niyanpai_state::niyanpai_gfxdraw(int vram) +void niyanpai_state::gfxdraw(int vram) { UINT8 *GFX = memregion("gfx1")->base(); int width = m_screen->width(); @@ -324,28 +324,28 @@ void niyanpai_state::niyanpai_gfxdraw(int vram) } m_nb19010_busyflag = 0; - timer_set(attotime::from_nsec(1000 * m_nb19010_busyctr), TIMER_BLITTER); + m_blitter_timer->adjust(attotime::from_nsec(1000 * m_nb19010_busyctr)); } /****************************************************************************** ******************************************************************************/ -WRITE8_MEMBER(niyanpai_state::niyanpai_blitter_0_w){ niyanpai_blitter_w(0, offset, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_blitter_1_w){ niyanpai_blitter_w(1, offset, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_blitter_2_w){ niyanpai_blitter_w(2, offset, data); } +WRITE8_MEMBER(niyanpai_state::blitter_0_w){ blitter_w(0, offset, data); } +WRITE8_MEMBER(niyanpai_state::blitter_1_w){ blitter_w(1, offset, data); } +WRITE8_MEMBER(niyanpai_state::blitter_2_w){ blitter_w(2, offset, data); } -READ8_MEMBER(niyanpai_state::niyanpai_blitter_0_r){ return niyanpai_blitter_r(0, offset); } -READ8_MEMBER(niyanpai_state::niyanpai_blitter_1_r){ return niyanpai_blitter_r(1, offset); } -READ8_MEMBER(niyanpai_state::niyanpai_blitter_2_r){ return niyanpai_blitter_r(2, offset); } +READ8_MEMBER(niyanpai_state::blitter_0_r){ return blitter_r(0, offset); } +READ8_MEMBER(niyanpai_state::blitter_1_r){ return blitter_r(1, offset); } +READ8_MEMBER(niyanpai_state::blitter_2_r){ return blitter_r(2, offset); } -WRITE8_MEMBER(niyanpai_state::niyanpai_clut_0_w){ niyanpai_clut_w(0, offset, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_clut_1_w){ niyanpai_clut_w(1, offset, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_clut_2_w){ niyanpai_clut_w(2, offset, data); } +WRITE8_MEMBER(niyanpai_state::clut_0_w){ clut_w(0, offset, data); } +WRITE8_MEMBER(niyanpai_state::clut_1_w){ clut_w(1, offset, data); } +WRITE8_MEMBER(niyanpai_state::clut_2_w){ clut_w(2, offset, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_clutsel_0_w){ niyanpai_clutsel_w(0, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_clutsel_1_w){ niyanpai_clutsel_w(1, data); } -WRITE8_MEMBER(niyanpai_state::niyanpai_clutsel_2_w){ niyanpai_clutsel_w(2, data); } +WRITE8_MEMBER(niyanpai_state::clutsel_0_w){ clutsel_w(0, data); } +WRITE8_MEMBER(niyanpai_state::clutsel_1_w){ clutsel_w(1, data); } +WRITE8_MEMBER(niyanpai_state::clutsel_2_w){ clutsel_w(2, data); } /****************************************************************************** @@ -370,13 +370,46 @@ void niyanpai_state::video_start() m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000); m_clut[2] = auto_alloc_array(machine(), UINT8, 0x1000); m_nb19010_busyflag = 1; + m_blitter_timer = timer_alloc(TIMER_BLITTER); + + save_item(NAME(m_scrollx)); + save_item(NAME(m_scrolly)); + save_item(NAME(m_blitter_destx)); + save_item(NAME(m_blitter_desty)); + save_item(NAME(m_blitter_sizex)); + save_item(NAME(m_blitter_sizey)); + save_item(NAME(m_blitter_src_addr)); + save_item(NAME(m_blitter_direction_x)); + save_item(NAME(m_blitter_direction_y)); + save_item(NAME(m_dispflag)); + save_item(NAME(m_flipscreen)); + save_item(NAME(m_clutmode)); + save_item(NAME(m_transparency)); + save_item(NAME(m_clutsel)); + save_item(NAME(m_screen_refresh)); + save_item(NAME(m_nb19010_busyctr)); + save_item(NAME(m_nb19010_busyflag)); + save_item(NAME(m_flipscreen_old)); + save_pointer(NAME(m_palette_ptr), 0x480); + save_pointer(NAME(m_videoram[0]), width * height); + save_pointer(NAME(m_videoram[1]), width * height); + save_pointer(NAME(m_videoram[2]), width * height); + save_pointer(NAME(m_videoworkram[0]), width * height); + save_pointer(NAME(m_videoworkram[1]), width * height); + save_pointer(NAME(m_videoworkram[2]), width * height); + save_pointer(NAME(m_clut[0]), 0x1000); + save_pointer(NAME(m_clut[1]), 0x1000); + save_pointer(NAME(m_clut[2]), 0x1000); + save_item(NAME(m_tmpbitmap[0])); + save_item(NAME(m_tmpbitmap[1])); + save_item(NAME(m_tmpbitmap[2])); } /****************************************************************************** ******************************************************************************/ -UINT32 niyanpai_state::screen_update_niyanpai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 niyanpai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; int x, y; diff --git a/src/mame/video/pc080sn.c b/src/mame/video/pc080sn.c index d0d3cbb5560..61e8ff45fbe 100644 --- a/src/mame/video/pc080sn.c +++ b/src/mame/video/pc080sn.c @@ -62,7 +62,7 @@ pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, d { for (int i = 0; i < 8; i++) m_ctrl[i] = 0; - + for (int i = 0; i < 2; i++) { m_bg_ram[i] = NULL; diff --git a/src/mame/video/portrait.c b/src/mame/video/portrait.c index c5ce2224f2c..9a2a0a0512d 100644 --- a/src/mame/video/portrait.c +++ b/src/mame/video/portrait.c @@ -9,13 +9,13 @@ #include "includes/portrait.h" -WRITE8_MEMBER(portrait_state::portrait_bgvideo_write) +WRITE8_MEMBER(portrait_state::bgvideo_write) { m_background->mark_tile_dirty(offset/2); m_bgvideoram[offset] = data; } -WRITE8_MEMBER(portrait_state::portrait_fgvideo_write) +WRITE8_MEMBER(portrait_state::fgvideo_write) { m_foreground->mark_tile_dirty(offset/2); m_fgvideoram[offset] = data; @@ -67,7 +67,9 @@ void portrait_state::video_start() m_background = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(portrait_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32 ); m_foreground = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(portrait_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32 ); - m_foreground->set_transparent_pen(7 ); + m_foreground->set_transparent_pen(7); + + save_item(NAME(m_scroll)); } @@ -180,7 +182,7 @@ void portrait_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 portrait_state::screen_update_portrait(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 portrait_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { rectangle cliprect_scroll, cliprect_no_scroll; diff --git a/src/mame/video/powerins.c b/src/mame/video/powerins.c index a60e84c90d8..92528699fa1 100644 --- a/src/mame/video/powerins.c +++ b/src/mame/video/powerins.c @@ -12,7 +12,7 @@ Note: if MAME_DEBUG is defined, pressing Z with: W shows layer 2 A shows the sprites - Keys can be used togheter! + Keys can be used together! [ 2 Scrolling Layers ] @@ -48,26 +48,21 @@ Note: if MAME_DEBUG is defined, pressing Z with: ***************************************************************************/ -WRITE16_MEMBER(powerins_state::powerins_flipscreen_w) +WRITE8_MEMBER(powerins_state::flipscreen_w) { - if (ACCESSING_BITS_0_7) flip_screen_set(data & 1 ); + flip_screen_set(data & 1 ); } -WRITE16_MEMBER(powerins_state::powerins_tilebank_w) +WRITE8_MEMBER(powerins_state::tilebank_w) { - if (ACCESSING_BITS_0_7) + if (data != m_tile_bank) { - if (data != m_tile_bank) - { - m_tile_bank = data; // Tiles Bank (VRAM 0) - m_tilemap_0->mark_all_dirty(); - } + m_tile_bank = data; // Tiles Bank (VRAM 0) + m_tilemap_0->mark_all_dirty(); } } - - /*************************************************************************** Callbacks for the TileMap code @@ -105,13 +100,13 @@ TILE_GET_INFO_MEMBER(powerins_state::get_tile_info_0) 0); } -WRITE16_MEMBER(powerins_state::powerins_vram_0_w) +WRITE16_MEMBER(powerins_state::vram_0_w) { COMBINE_DATA(&m_vram_0[offset]); m_tilemap_0->mark_tile_dirty(offset); } -TILEMAP_MAPPER_MEMBER(powerins_state::powerins_get_memory_offset_0) +TILEMAP_MAPPER_MEMBER(powerins_state::get_memory_offset_0) { return (col * TILES_PER_PAGE_Y) + @@ -144,7 +139,7 @@ TILE_GET_INFO_MEMBER(powerins_state::get_tile_info_1) 0); } -WRITE16_MEMBER(powerins_state::powerins_vram_1_w) +WRITE16_MEMBER(powerins_state::vram_1_w) { COMBINE_DATA(&m_vram_1[offset]); m_tilemap_1->mark_tile_dirty(offset); @@ -157,14 +152,14 @@ WRITE16_MEMBER(powerins_state::powerins_vram_1_w) /*************************************************************************** - Vh_Start + video_start ***************************************************************************/ void powerins_state::video_start() { - m_tilemap_0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(powerins_state::powerins_get_memory_offset_0),this),16,16,DIM_NX_0, DIM_NY_0 ); + m_tilemap_0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(powerins_state::get_memory_offset_0),this),16,16,DIM_NX_0, DIM_NY_0 ); m_tilemap_1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(powerins_state::get_tile_info_1),this),TILEMAP_SCAN_COLS,8,8,DIM_NX_1, DIM_NY_1 ); m_tilemap_0->set_scroll_rows(1); @@ -173,13 +168,11 @@ void powerins_state::video_start() m_tilemap_1->set_scroll_rows(1); m_tilemap_1->set_scroll_cols(1); m_tilemap_1->set_transparent_pen(15); + + save_item(NAME(m_tile_bank)); } - - - - /*************************************************************************** @@ -300,7 +293,7 @@ void powerins_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect ***************************************************************************/ -UINT32 powerins_state::screen_update_powerins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 powerins_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; diff --git a/src/mame/video/psychic5.c b/src/mame/video/psychic5.c index 6a0b56d3931..40403564aac 100644 --- a/src/mame/video/psychic5.c +++ b/src/mame/video/psychic5.c @@ -24,10 +24,10 @@ void psychic5_state::change_palette(int offset, UINT8* palram, int palbase) UINT8 hi = palram[(offset) | 1]; int color = offset >> 1; - + if (m_blend) m_blend->set(palbase + color, hi & 0x0f); - + m_palette->set_pen_color(palbase + color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4)); } @@ -188,11 +188,11 @@ void psychic5_state::video_start() VIDEO_START_MEMBER(psychic5_state,psychic5) { video_start(); - + m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 64, 32); m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32); m_fg_tilemap->set_transparent_pen(15); - + save_item(NAME(m_title_screen)); } @@ -200,11 +200,11 @@ VIDEO_START_MEMBER(psychic5_state,psychic5) VIDEO_START_MEMBER(psychic5_state,bombsa) { video_start(); - + m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 32); m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(psychic5_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32); m_fg_tilemap->set_transparent_pen(15); - + save_item(NAME(m_bombsa_unknown)); } diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c index 0e17ba65769..683c38bc173 100644 --- a/src/mame/video/realbrk.c +++ b/src/mame/video/realbrk.c @@ -154,7 +154,7 @@ void realbrk_state::video_start() m_tmpbitmap0 = auto_bitmap_ind16_alloc(machine(),32,32); m_tmpbitmap1 = auto_bitmap_ind16_alloc(machine(),32,32); - + save_item(NAME(m_disable_video)); } diff --git a/src/mame/video/rltennis.c b/src/mame/video/rltennis.c index 993e719d08a..e736e90a58d 100644 --- a/src/mame/video/rltennis.c +++ b/src/mame/video/rltennis.c @@ -224,7 +224,7 @@ void rltennis_state::video_start() m_tmp_bitmap[BITMAP_FG_1] = auto_bitmap_ind16_alloc(machine(), 512, 256); m_tmp_bitmap[BITMAP_FG_2] = auto_bitmap_ind16_alloc(machine(), 512, 256); m_tmp_bitmap[BITMAP_FG_DISPLAY] = auto_bitmap_ind16_alloc(machine(), 512, 256); - + save_item(NAME(m_blitter)); } diff --git a/src/mame/video/route16.c b/src/mame/video/route16.c index 3a1e153cc9e..13c1fffb67d 100644 --- a/src/mame/video/route16.c +++ b/src/mame/video/route16.c @@ -1,6 +1,6 @@ /*************************************************************************** - video.c + route16.c Functions to emulate the video hardware of the machine. @@ -9,6 +9,12 @@ #include "emu.h" #include "includes/route16.h" +void route16_state::video_start() +{ + save_item(NAME(m_flipscreen)); + save_item(NAME(m_palette_1)); + save_item(NAME(m_palette_2)); +} /************************************* * @@ -16,7 +22,7 @@ * *************************************/ -WRITE8_MEMBER(route16_state::route16_out0_w) +WRITE8_MEMBER(route16_state::out0_w) { m_palette_1 = data & 0x1f; @@ -24,7 +30,7 @@ WRITE8_MEMBER(route16_state::route16_out0_w) } -WRITE8_MEMBER(route16_state::route16_out1_w) +WRITE8_MEMBER(route16_state::out1_w) { m_palette_2 = data & 0x1f; diff --git a/src/mame/video/seta001.c b/src/mame/video/seta001.c index 796efafbd4a..9a5468e3857 100644 --- a/src/mame/video/seta001.c +++ b/src/mame/video/seta001.c @@ -84,7 +84,7 @@ void seta001_device::device_start() m_spritelimit = 0x1ff; m_bgflag = 0x00; - + m_gfxbank_cb.bind_relative_to(*owner()); save_item(NAME(m_bgflag)); diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c index 333bf9daa0d..32a4e5055d1 100644 --- a/src/mame/video/seta2.c +++ b/src/mame/video/seta2.c @@ -457,14 +457,14 @@ void seta2_state::video_start() VIDEO_START_MEMBER(seta2_state,xoffset) { video_start(); - + m_xoffset = 0x200; } VIDEO_START_MEMBER(seta2_state,yoffset) { video_start(); - + m_yoffset = 0x10; } diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c index 65daee439a9..5dbbc87cc74 100644 --- a/src/mame/video/sidearms.c +++ b/src/mame/video/sidearms.c @@ -159,7 +159,7 @@ void sidearms_state::video_start() m_latch_374 = m_vcount_191 = m_hcount_191 = 0; m_flipon = m_charon = m_staron = m_objon = m_bgon = 0; - + save_item(NAME(m_bgon)); save_item(NAME(m_objon)); save_item(NAME(m_staron)); diff --git a/src/mame/video/srumbler.c b/src/mame/video/srumbler.c index 61fa910b92c..4c3d722bc68 100644 --- a/src/mame/video/srumbler.c +++ b/src/mame/video/srumbler.c @@ -52,7 +52,7 @@ void srumbler_state::video_start() m_bg_tilemap->set_transmask(0,0xffff,0x0000); /* split type 0 is totally transparent in front half */ m_bg_tilemap->set_transmask(1,0x07ff,0xf800); /* split type 1 has pens 0-10 transparent in front half */ - + save_item(NAME(m_scroll)); } diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c index ab7b33888d9..6b48449c7af 100644 --- a/src/mame/video/ssv.c +++ b/src/mame/video/ssv.c @@ -194,7 +194,7 @@ void ssv_state::drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_ele void ssv_state::video_start() { m_gfxdecode->gfx(0)->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */ - + save_item(NAME(m_enable_video)); save_item(NAME(m_shadow_pen_mask)); save_item(NAME(m_shadow_pen_shift)); @@ -208,7 +208,7 @@ VIDEO_START_MEMBER(ssv_state,eaglshot) m_gfxdecode->gfx(0)->set_source((UINT8 *)m_eaglshot_gfxram); m_gfxdecode->gfx(1)->set_source((UINT8 *)m_eaglshot_gfxram); - + save_pointer(NAME(m_eaglshot_gfxram), 16 * 0x40000 / 2); } diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c index f1ee7a4f8d2..d7f1e37a40f 100644 --- a/src/mame/video/stactics.c +++ b/src/mame/video/stactics.c @@ -90,7 +90,7 @@ PALETTE_INIT_MEMBER(stactics_state,stactics) * *************************************/ -WRITE8_MEMBER(stactics_state::stactics_scroll_ram_w) +WRITE8_MEMBER(stactics_state::scroll_ram_w) { if (data & 0x01) { @@ -111,7 +111,7 @@ WRITE8_MEMBER(stactics_state::stactics_scroll_ram_w) * *************************************/ -CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_frame_count_d3) +CUSTOM_INPUT_MEMBER(stactics_state::get_frame_count_d3) { return (m_frame_count >> 3) & 0x01; } @@ -124,7 +124,7 @@ CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_frame_count_d3) * *************************************/ -WRITE8_MEMBER(stactics_state::stactics_speed_latch_w) +WRITE8_MEMBER(stactics_state::speed_latch_w) { /* This writes to a shift register which is clocked by */ /* a 555 oscillator. This value determines the speed of */ @@ -149,25 +149,25 @@ WRITE8_MEMBER(stactics_state::stactics_speed_latch_w) } -WRITE8_MEMBER(stactics_state::stactics_shot_trigger_w) +WRITE8_MEMBER(stactics_state::shot_trigger_w) { m_shot_standby = 0; } -WRITE8_MEMBER(stactics_state::stactics_shot_flag_clear_w) +WRITE8_MEMBER(stactics_state::shot_flag_clear_w) { m_shot_arrive = 0; } -CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_shot_standby) +CUSTOM_INPUT_MEMBER(stactics_state::get_shot_standby) { return m_shot_standby; } -CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_not_shot_arrive) +CUSTOM_INPUT_MEMBER(stactics_state::get_not_shot_arrive) { return !m_shot_arrive; } @@ -352,7 +352,7 @@ void stactics_state::update_artwork() * *************************************/ -VIDEO_START_MEMBER(stactics_state,stactics) +void stactics_state::video_start() { m_y_scroll_d = 0; m_y_scroll_e = 0; @@ -363,6 +363,16 @@ VIDEO_START_MEMBER(stactics_state,stactics) m_shot_arrive = 0; m_beam_state = 0; m_old_beam_state = 0; + + save_item(NAME(m_y_scroll_d)); + save_item(NAME(m_y_scroll_e)); + save_item(NAME(m_y_scroll_f)); + save_item(NAME(m_frame_count)); + save_item(NAME(m_shot_standby)); + save_item(NAME(m_shot_arrive)); + save_item(NAME(m_beam_state)); + save_item(NAME(m_old_beam_state)); + save_item(NAME(m_beam_states_per_frame)); } @@ -373,7 +383,7 @@ VIDEO_START_MEMBER(stactics_state,stactics) * *************************************/ -UINT32 stactics_state::screen_update_stactics(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 stactics_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { update_beam(); draw_background(bitmap, cliprect); @@ -399,11 +409,10 @@ MACHINE_CONFIG_FRAGMENT( stactics_video ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(stactics_state, screen_update_stactics) + MCFG_SCREEN_UPDATE_DRIVER(stactics_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x400) MCFG_PALETTE_INIT_OWNER(stactics_state,stactics) - MCFG_VIDEO_START_OVERRIDE(stactics_state,stactics) MACHINE_CONFIG_END diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index e58ce304103..777cfff419c 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -92,7 +92,7 @@ WRITE16_MEMBER(suna16_state::bestbest_flipscreen_w) void suna16_state::video_start() { m_paletteram = auto_alloc_array(machine(), UINT16, m_palette->entries()); - + save_item(NAME(m_color_bank)); } diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c index 6021a01a2bc..1c60380f5c9 100644 --- a/src/mame/video/suprloco.c +++ b/src/mame/video/suprloco.c @@ -98,7 +98,7 @@ void suprloco_state::video_start() m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suprloco_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32); m_bg_tilemap->set_scroll_rows(32); - + save_item(NAME(m_control)); } diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c index adaa1f4673f..de72518a1ce 100644 --- a/src/mame/video/suprridr.c +++ b/src/mame/video/suprridr.c @@ -44,7 +44,7 @@ void suprridr_state::video_start() m_bg_tilemap_noscroll = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suprridr_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32); m_fg_tilemap->set_transparent_pen(0); - + save_item(NAME(m_flipx)); save_item(NAME(m_flipy)); } diff --git a/src/mame/video/tankbust.c b/src/mame/video/tankbust.c index f2b747881d0..e26cf97887f 100644 --- a/src/mame/video/tankbust.c +++ b/src/mame/video/tankbust.c @@ -83,7 +83,7 @@ void tankbust_state::video_start() m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tankbust_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_txt_tilemap->set_transparent_pen(0); - + save_item(NAME(m_xscroll)); save_item(NAME(m_yscroll)); } diff --git a/src/mame/video/tbowl.c b/src/mame/video/tbowl.c index 293f562f876..8d5b1a0c796 100644 --- a/src/mame/video/tbowl.c +++ b/src/mame/video/tbowl.c @@ -116,7 +116,7 @@ void tbowl_state::video_start() m_tx_tilemap->set_transparent_pen(0); m_bg_tilemap->set_transparent_pen(0); m_bg2_tilemap->set_transparent_pen(0); - + save_item(NAME(m_xscroll)); save_item(NAME(m_yscroll)); save_item(NAME(m_bg2xscroll)); diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c index 2c081a9a05b..9397957fe3c 100644 --- a/src/mame/video/thedeep.c +++ b/src/mame/video/thedeep.c @@ -134,4 +134,3 @@ UINT32 thedeep_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, m_tilemap_1->draw(screen, bitmap, cliprect, 0,0); return 0; } - diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c index 2f5354ee250..3d441f7cb2f 100644 --- a/src/mame/video/thepit.c +++ b/src/mame/video/thepit.c @@ -1,6 +1,6 @@ /*************************************************************************** - video.c + thepit.c Functions to emulate the video hardware of the machine. @@ -136,6 +136,10 @@ void thepit_state::video_start() m_dummy_tile = auto_alloc_array_clear(machine(), UINT8, 8*8); m_graphics_bank = 0; /* only used in intrepid */ + + save_item(NAME(m_graphics_bank)); + save_item(NAME(m_flip_x)); + save_item(NAME(m_flip_y)); } @@ -146,14 +150,14 @@ void thepit_state::video_start() * *************************************/ -WRITE8_MEMBER(thepit_state::thepit_videoram_w) +WRITE8_MEMBER(thepit_state::videoram_w) { m_videoram[offset] = data; m_tilemap->mark_tile_dirty(offset); } -WRITE8_MEMBER(thepit_state::thepit_colorram_w) +WRITE8_MEMBER(thepit_state::colorram_w) { m_colorram[offset] = data; m_tilemap->mark_tile_dirty(offset); @@ -161,14 +165,14 @@ WRITE8_MEMBER(thepit_state::thepit_colorram_w) } -WRITE8_MEMBER(thepit_state::thepit_flip_screen_x_w) +WRITE8_MEMBER(thepit_state::flip_screen_x_w) { int flip; - m_flip_screen_x = data & 0x01; + m_flip_x = data & 0x01; - flip = m_flip_screen_x ? TILEMAP_FLIPX : 0; - if (m_flip_screen_y) + flip = m_flip_x ? TILEMAP_FLIPX : 0; + if (m_flip_y) flip |= TILEMAP_FLIPY ; m_tilemap->set_flip(flip); @@ -177,14 +181,14 @@ WRITE8_MEMBER(thepit_state::thepit_flip_screen_x_w) } -WRITE8_MEMBER(thepit_state::thepit_flip_screen_y_w) +WRITE8_MEMBER(thepit_state::flip_screen_y_w) { int flip; - m_flip_screen_y = data & 0x01; + m_flip_y = data & 0x01; - flip = m_flip_screen_x ? TILEMAP_FLIPX : 0; - if (m_flip_screen_y) + flip = m_flip_x ? TILEMAP_FLIPX : 0; + if (m_flip_y) flip |= TILEMAP_FLIPY ; m_tilemap->set_flip(flip); @@ -204,11 +208,11 @@ WRITE8_MEMBER(thepit_state::intrepid_graphics_bank_w) } -READ8_MEMBER(thepit_state::thepit_input_port_0_r) +READ8_MEMBER(thepit_state::input_port_0_r) { /* Read either the real or the fake input ports depending on the horizontal flip switch. (This is how the real PCB does it) */ - if (m_flip_screen_x) + if (m_flip_x) { return ioport("IN2")->read(); } @@ -245,13 +249,13 @@ void thepit_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, flipx = m_spriteram[offs + 1] & 0x40; flipy = m_spriteram[offs + 1] & 0x80; - if (m_flip_screen_y) + if (m_flip_y) { y = 240 - y; flipy = !flipy; } - if (m_flip_screen_x) + if (m_flip_x) { x = 242 - x; flipx = !flipx; @@ -277,7 +281,7 @@ void thepit_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, } -UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 thepit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle spritevisiblearea(2*8+1, 32*8-1, 2*8, 30*8-1); const rectangle spritevisibleareaflipx(0*8, 30*8-2, 2*8, 30*8-1); @@ -286,8 +290,8 @@ UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &b for (offs = 0; offs < 32; offs++) { - int xshift = m_flip_screen_x ? 128 : 0; - int yshift = m_flip_screen_y ? -8 : 0; + int xshift = m_flip_x ? 128 : 0; + int yshift = m_flip_y ? -8 : 0; m_tilemap->set_scrollx(offs, xshift); m_solid_tilemap->set_scrollx(offs, xshift); @@ -301,13 +305,13 @@ UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &b m_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* low priority sprites */ - draw_sprites(bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 0); + draw_sprites(bitmap, m_flip_x ? spritevisibleareaflipx : spritevisiblearea, 0); /* high priority tiles */ m_solid_tilemap->draw(screen, bitmap, cliprect, 1, 1); /* high priority sprites */ - draw_sprites(bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 1); + draw_sprites(bitmap, m_flip_x ? spritevisibleareaflipx : spritevisiblearea, 1); return 0; } @@ -320,8 +324,8 @@ UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16 for (offs = 0; offs < 32; offs++) { - int xshift = m_flip_screen_x ? 128 : 0; - int yshift = m_flip_screen_y ? -8 : 0; + int xshift = m_flip_x ? 128 : 0; + int yshift = m_flip_y ? -8 : 0; m_tilemap->set_scrollx(offs, xshift); m_solid_tilemap->set_scrollx(offs, xshift); @@ -337,7 +341,7 @@ UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16 /* low priority sprites */ m_graphics_bank = 1; - draw_sprites(bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 0); + draw_sprites(bitmap, m_flip_y ? spritevisibleareaflipx : spritevisiblearea, 0); /* high priority tiles */ // not sure about this, draws a white block over the title logo sprite, looks like it should be behind? m_graphics_bank = 0; @@ -345,7 +349,7 @@ UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16 /* high priority sprites */ m_graphics_bank = 1; - draw_sprites(bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 1); + draw_sprites(bitmap, m_flip_y ? spritevisibleareaflipx : spritevisiblearea, 1); return 0; } diff --git a/src/mame/video/timelimt.c b/src/mame/video/timelimt.c index 31412c8000e..282c85155b3 100644 --- a/src/mame/video/timelimt.c +++ b/src/mame/video/timelimt.c @@ -73,7 +73,7 @@ void timelimt_state::video_start() 8, 8, 32, 32); m_fg_tilemap->set_transparent_pen(0); - + save_item(NAME(m_scrollx)); save_item(NAME(m_scrolly)); } diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c index 1b7f1fb841e..f7f284adc10 100644 --- a/src/mame/video/tryout.c +++ b/src/mame/video/tryout.c @@ -12,7 +12,7 @@ PALETTE_INIT_MEMBER(tryout_state, tryout) { const UINT8 *color_prom = memregion("proms")->base(); - + for (int i = 0;i < palette.entries();i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/tsamurai.c b/src/mame/video/tsamurai.c index 1fb47e835b2..eede6d28503 100644 --- a/src/mame/video/tsamurai.c +++ b/src/mame/video/tsamurai.c @@ -55,7 +55,7 @@ VIDEO_START_MEMBER(tsamurai_state, tsamurai) m_background->set_transparent_pen(0); m_foreground->set_transparent_pen(0); - + save_item(NAME(m_bgcolor)); video_start(); } @@ -63,7 +63,7 @@ VIDEO_START_MEMBER(tsamurai_state, tsamurai) VIDEO_START_MEMBER(tsamurai_state, m660) { VIDEO_START_CALL_MEMBER(tsamurai); - + save_item(NAME(m_textbank2)); } @@ -256,7 +256,7 @@ TILE_GET_INFO_MEMBER(tsamurai_state::get_vsgongf_tile_info) VIDEO_START_MEMBER(tsamurai_state,vsgongf) { m_foreground = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tsamurai_state::get_vsgongf_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32); - + save_item(NAME(m_vsgongf_color)); video_start(); } diff --git a/src/mame/video/tunhunt.c b/src/mame/video/tunhunt.c index 01827fe1b4f..007222050ac 100644 --- a/src/mame/video/tunhunt.c +++ b/src/mame/video/tunhunt.c @@ -48,7 +48,7 @@ /****************************************************************************************/ -WRITE8_MEMBER(tunhunt_state::tunhunt_videoram_w) +WRITE8_MEMBER(tunhunt_state::videoram_w) { m_videoram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset); @@ -78,19 +78,19 @@ void tunhunt_state::video_start() m_fg_tilemap->set_transparent_pen(0); m_fg_tilemap->set_scrollx(0, 64); + + save_item(NAME(m_control)); } PALETTE_INIT_MEMBER(tunhunt_state, tunhunt) { - int i; - /* Tunnel Hunt uses a combination of color proms and palette RAM to specify a 16 color * palette. Here, we manage only the mappings for alphanumeric characters and SHELL * graphics, which are unpacked ahead of time and drawn using MAME's drawgfx primitives. */ /* motion objects/box */ - for (i = 0; i < 0x10; i++) + for (int i = 0; i < 0x10; i++) palette.set_pen_indirect(i, i); /* AlphaNumerics (1bpp) @@ -152,10 +152,9 @@ void tunhunt_state::set_pens() //const UINT8 *color_prom = memregion( "proms" )->base(); int color; int shade; - int i; int red,green,blue; - for( i=0; i<16; i++ ) + for( int i=0; i<16; i++ ) { color = m_generic_paletteram_8[i]; shade = 0xf^(color>>4); @@ -207,11 +206,9 @@ void tunhunt_state::draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cl */ bitmap_ind16 &tmpbitmap = m_tmpbitmap; - UINT8 *spriteram = m_spriteram; - UINT8 *tunhunt_ram = m_workram; - //int skip = tunhunt_ram[MOBST]; - int x0 = 255-tunhunt_ram[MOBJV]; - int y0 = 255-tunhunt_ram[MOBJH]; + //int skip = m_workram[MOBST]; + int x0 = 255-m_workram[MOBJV]; + int y0 = 255-m_workram[MOBJH]; int scalex,scaley; int line,span; int x,span_data; @@ -222,7 +219,7 @@ void tunhunt_state::draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cl for( line=0; line<64; line++ ) { x = 0; - source = &spriteram[line*0x10]; + source = &m_spriteram[line*0x10]; for( span=0; span<0x10; span++ ) { span_data = source[span]; @@ -236,7 +233,7 @@ void tunhunt_state::draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cl tmpbitmap.pix16(line, x++) = 0; } /* next line */ - switch( tunhunt_ram[VSTRLO] ) + switch( m_workram[VSTRLO] ) { case 0x01: scaley = (1<<16)*0.33; /* seems correct */ @@ -247,7 +244,7 @@ void tunhunt_state::draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cl break; default: - scaley = (1<<16)*tunhunt_ram[VSTRLO]/4; /* ??? */ + scaley = (1<<16)*m_workram[VSTRLO]/4; /* ??? */ break; } scalex = (1<<16); @@ -284,7 +281,6 @@ void tunhunt_state::draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect) 1280: 07 03 00 01 07 06 04 05 02 07 03 00 09 0a 0b 0c palette select ->hue 06 02 ff 60 06 05 03 04 01 06 02 ff d2 00 c2 ff */ - UINT8 *tunhunt_ram = m_workram; int span,x,y; int color; // rectangle bbox; @@ -300,13 +296,13 @@ void tunhunt_state::draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect) z = 0; for( span=3; span<16; span++ ) { - x0 = tunhunt_ram[span+0x1080]; - y0 = tunhunt_ram[span+0x1480]; - y1 = tunhunt_ram[span+0x1400]; + x0 = m_workram[span+0x1080]; + y0 = m_workram[span+0x1480]; + y1 = m_workram[span+0x1400]; if( y>=y0 && y<=y1 && x>=x0 && x0>=z ) { - color = tunhunt_ram[span+0x1280]&0xf; + color = m_workram[span+0x1280]&0xf; z = x0; /* give priority to rightmost spans */ } } @@ -365,7 +361,7 @@ void tunhunt_state::draw_shell(bitmap_ind16 &bitmap, 255-hposition-16,vstart-32,0 ); } -UINT32 tunhunt_state::screen_update_tunhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 tunhunt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { set_pens(); diff --git a/src/mame/video/vulgus.c b/src/mame/video/vulgus.c index 1c99617e85b..4cd5bdbe100 100644 --- a/src/mame/video/vulgus.c +++ b/src/mame/video/vulgus.c @@ -113,7 +113,7 @@ void vulgus_state::video_start() m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(vulgus_state::get_bg_tile_info),this),TILEMAP_SCAN_COLS,16,16,32,32); m_fg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 47); - + save_item(NAME(m_palette_bank)); } diff --git a/src/mame/video/xain.c b/src/mame/video/xain.c index fdd210c0640..810923e96f4 100644 --- a/src/mame/video/xain.c +++ b/src/mame/video/xain.c @@ -89,7 +89,7 @@ void xain_state::video_start() m_bgram0_tilemap->set_transparent_pen(0); m_bgram1_tilemap->set_transparent_pen(0); m_char_tilemap->set_transparent_pen(0); - + save_item(NAME(m_pri)); save_item(NAME(m_scrollxP0)); save_item(NAME(m_scrollyP0)); diff --git a/src/mess/audio/gamate.c b/src/mess/audio/gamate.c index c49aeb72680..7e6a03c7be8 100644 --- a/src/mess/audio/gamate.c +++ b/src/mess/audio/gamate.c @@ -38,7 +38,7 @@ gamate_sound_device::gamate_sound_device(const machine_config &mconfig, const ch void gamate_sound_device::device_start() { // bind callbacks -// m_irq_cb.bind_relative_to(*owner()); +// m_irq_cb.bind_relative_to(*owner()); memset(m_channels, 0, sizeof(m_channels)); memset(reg, 0, sizeof(reg)); @@ -56,7 +56,7 @@ void gamate_sound_device::sound_stream_update(sound_stream &stream, stream_sampl stream_sample_t *left=outputs[0], *right=outputs[1]; int i, j; Tone *channel; - + for (i = 0; i < samples; i++, left++, right++) { noise.pos += noise.step; @@ -77,7 +77,7 @@ void gamate_sound_device::sound_stream_update(sound_stream &stream, stream_sampl { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: - case 8: case 9: case 0xb: + case 8: case 9: case 0xb: case 0xd: case 0xf: if (envelope.index>=ARRAY_LENGTH(EnvelopeVolumes)/2) { diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c index cffcd9c747b..4602c3ce941 100644 --- a/src/mess/drivers/a7800.c +++ b/src/mess/drivers/a7800.c @@ -286,11 +286,11 @@ static ADDRESS_MAP_START( a7800_mem, AS_PROGRAM, 8, a7800_state ) AM_RANGE(0x0480, 0x04ff) AM_RAM AM_SHARE("riot_ram") AM_MIRROR(0x100) AM_RANGE(0x1800, 0x1fff) AM_RAM AM_SHARE("6116_1") AM_RANGE(0x2000, 0x27ff) AM_RAM AM_SHARE("6116_2") AM_MIRROR(0x0800) - // According to the official Software Guide, the RAM at 0x2000 is - // repeatedly mirrored up to 0x3fff, but this is evidently incorrect - // because the High Score Cartridge maps ROM at 0x3000-0x3fff - // Hardware tests show that only the mirror at 0x2800-0x2fff actually - // exists, and only on some hardware (MARIA? motherboard?) revisions + // According to the official Software Guide, the RAM at 0x2000 is + // repeatedly mirrored up to 0x3fff, but this is evidently incorrect + // because the High Score Cartridge maps ROM at 0x3000-0x3fff + // Hardware tests show that only the mirror at 0x2800-0x2fff actually + // exists, and only on some hardware (MARIA? motherboard?) revisions AM_RANGE(0x4000, 0xffff) AM_DEVWRITE("cartslot", a78_cart_slot_device, write_40xx) AM_RANGE(0x4000, 0xbfff) AM_DEVREAD("cartslot", a78_cart_slot_device, read_40xx) AM_RANGE(0xc000, 0xffff) AM_READ(bios_or_cart_r) // here also the BIOS can be accessed diff --git a/src/mess/drivers/abc80.c b/src/mess/drivers/abc80.c index f3937b0a964..fd20868e73e 100644 --- a/src/mess/drivers/abc80.c +++ b/src/mess/drivers/abc80.c @@ -79,17 +79,6 @@ Notes: #include "includes/abc80.h" -#define KEYBOARD_TAG "keyboard" - -//************************************************************************** -// MACROS / CONSTANTS -//************************************************************************** - -#define MMU_XM 0x01 -#define MMU_ROM 0x02 -#define MMU_VRAMS 0x04 -#define MMU_RAM 0x08 - //************************************************************************** @@ -395,6 +384,14 @@ WRITE8_MEMBER( abc80_state::kbd_w ) timer_set(attotime::from_msec(50), TIMER_ID_FAKE_KEYBOARD_CLEAR); } + +DEVICE_INPUT_DEFAULTS_START( abc830_slow ) + DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03) + DEVICE_INPUT_DEFAULTS("S1", 0x01, 0x01) +DEVICE_INPUT_DEFAULTS_END + + + //************************************************************************** // MACHINE INITIALIZATION //************************************************************************** @@ -476,11 +473,6 @@ void abc80_state::machine_start() // MACHINE DRIVERS //************************************************************************** -DEVICE_INPUT_DEFAULTS_START( abc830_slow ) - DEVICE_INPUT_DEFAULTS("SW1", 0x0f, 0x03) - DEVICE_INPUT_DEFAULTS("S1", 0x01, 0x01) -DEVICE_INPUT_DEFAULTS_END - //------------------------------------------------- // MACHINE_CONFIG( abc80 ) //------------------------------------------------- @@ -509,6 +501,9 @@ static MACHINE_CONFIG_START( abc80, abc80_state ) MCFG_SN76477_ONESHOT_PARAMS(CAP_U(0.1), RES_K(330)) // oneshot caps + res: C53 0.1u - R25 330k MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + // devices MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL_11_9808MHz/2/2) MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0)) @@ -516,8 +511,9 @@ static MACHINE_CONFIG_START( abc80, abc80_state ) MCFG_Z80PIO_IN_PB_CB(READ8(abc80_state, pio_pb_r)) MCFG_Z80PIO_OUT_PB_CB(WRITE8(abc80_state, pio_pb_w)) - MCFG_CASSETTE_ADD("cassette") - MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) + MCFG_CASSETTE_ADD(CASSETTE_TAG) + MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) + MCFG_CASSETTE_INTERFACE("abc80_cass") MCFG_DEVICE_ADD(ABC80_KEYBOARD_TAG, ABC80_KEYBOARD, 0) MCFG_ABC80_KEYBOARD_KEYDOWN_CALLBACK(WRITELINE(abc80_state, keydown_w)) @@ -532,7 +528,8 @@ static MACHINE_CONFIG_START( abc80, abc80_state ) MCFG_RAM_DEFAULT_SIZE("16K") // software list - MCFG_SOFTWARE_LIST_ADD("flop_list", "abc80") + MCFG_SOFTWARE_LIST_ADD("cass_list", "abc80_cass") + MCFG_SOFTWARE_LIST_ADD("flop_list", "abc80_flop") MACHINE_CONFIG_END diff --git a/src/mess/drivers/alesis.c b/src/mess/drivers/alesis.c index 2859a19ae79..6b72c21ed86 100644 --- a/src/mess/drivers/alesis.c +++ b/src/mess/drivers/alesis.c @@ -478,8 +478,8 @@ DRIVER_INIT_MEMBER(alesis_state,hr16) } /* Driver */ -/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ -SYST( 1987, hr16, 0, 0, hr16, hr16, alesis_state, hr16, "Alesis", "HR-16", GAME_NOT_WORKING | GAME_NO_SOUND) -SYST( 1987, mmt8, 0, 0, mmt8, mmt8, driver_device, 0, "Alesis", "MMT-8", GAME_NOT_WORKING | GAME_NO_SOUND) -SYST( 1989, hr16b, hr16, 0, hr16, hr16, alesis_state, hr16, "Alesis", "HR-16B", GAME_NOT_WORKING | GAME_NO_SOUND) -SYST( 1990, sr16, 0, 0, sr16, sr16, driver_device, 0, "Alesis", "SR-16", GAME_NOT_WORKING | GAME_NO_SOUND) +/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ +SYST( 1987, hr16, 0, 0, hr16, hr16, alesis_state, hr16, "Alesis", "HR-16", GAME_NOT_WORKING | GAME_NO_SOUND) +SYST( 1987, mmt8, 0, 0, mmt8, mmt8, driver_device, 0, "Alesis", "MMT-8", GAME_NOT_WORKING | GAME_NO_SOUND) +SYST( 1989, hr16b, hr16, 0, hr16, hr16, alesis_state, hr16, "Alesis", "HR-16B", GAME_NOT_WORKING | GAME_NO_SOUND) +SYST( 1990, sr16, 0, 0, sr16, sr16, driver_device, 0, "Alesis", "SR-16 (Alesis)", GAME_NOT_WORKING | GAME_NO_SOUND) diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c index 15bbbc06559..4c06eac3b7b 100644 --- a/src/mess/drivers/apple2.c +++ b/src/mess/drivers/apple2.c @@ -1229,9 +1229,9 @@ static SLOT_INTERFACE_START(apple2_cards) SLOT_INTERFACE("dx1", A2BUS_DX1) /* Decillonix DX-1 sampler card */ SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */ SLOT_INTERFACE("mouse", A2BUS_MOUSE) /* Apple II Mouse Card */ - SLOT_INTERFACE("ezcgi", A2BUS_EZCGI) /* E-Z Color Graphics Interface */ - SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938) /* E-Z Color Graphics Interface (TMS9938) */ - SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */ + SLOT_INTERFACE("ezcgi", A2BUS_EZCGI) /* E-Z Color Graphics Interface */ + SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938) /* E-Z Color Graphics Interface (TMS9938) */ + SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */ // SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */ SLOT_INTERFACE_END diff --git a/src/mess/drivers/apple2e.c b/src/mess/drivers/apple2e.c index 84b41de961a..e270fa4d6fa 100644 --- a/src/mess/drivers/apple2e.c +++ b/src/mess/drivers/apple2e.c @@ -3036,9 +3036,9 @@ static SLOT_INTERFACE_START(apple2_cards) SLOT_INTERFACE("dx1", A2BUS_DX1) /* Decillonix DX-1 sampler card */ SLOT_INTERFACE("tm2ho", A2BUS_TIMEMASTERHO) /* Applied Engineering TimeMaster II H.O. */ SLOT_INTERFACE("mouse", A2BUS_MOUSE) /* Apple II Mouse Card */ - SLOT_INTERFACE("ezcgi", A2BUS_EZCGI) /* E-Z Color Graphics Interface */ - SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938) /* E-Z Color Graphics Interface (TMS9938) */ - SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */ + SLOT_INTERFACE("ezcgi", A2BUS_EZCGI) /* E-Z Color Graphics Interface */ + SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938) /* E-Z Color Graphics Interface (TMS9938) */ + SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */ // SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */ SLOT_INTERFACE_END diff --git a/src/mess/drivers/gamate.c b/src/mess/drivers/gamate.c index 3953bc5b060..67cf8c29d91 100644 --- a/src/mess/drivers/gamate.c +++ b/src/mess/drivers/gamate.c @@ -4,7 +4,7 @@ Morten Shearman Kirkegaard morten+gamate@afdelingp.dk Juan F??lix Mateos vectrex@hackermesh.org - nmi unknown + nmi unknown bomb blast top status line missing ******************************************************************************/ @@ -84,7 +84,7 @@ private: WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) { logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); - + switch (offset) { case 0: @@ -118,7 +118,7 @@ READ8_MEMBER( gamate_state::gamate_cart_protection_r ) ret=(card_protection.cartridge_byte&0x80) ? 2 : 0; if (card_protection.bit_shifter==7 && !card_protection.failed) { // now protection chip on cartridge activates cartridge chip select on cpu accesses -// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working +// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working } card_protection.cartridge_byte<<=1; } @@ -318,12 +318,12 @@ void gamate_state::machine_start() m_cart_ptr = memregion("maincpu")->base() + 0x6000; if (m_cart->exists()) { -// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); +// m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); m_cart_ptr = m_cart->get_rom_base(); membank("bankmulti")->set_base(m_cart->get_rom_base()+1); membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset } -// m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback +// m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback card_protection.set=false; bank_multi=0; card_protection.unprotected=false; @@ -400,4 +400,3 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ CONS( 19??, gamate, 0, 0, gamate, gamate, gamate_state, gamate, "Bit Corp", "Gamate", 0) - diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c index 4b482b13ae9..3788f0631cc 100644 --- a/src/mess/drivers/gba.c +++ b/src/mess/drivers/gba.c @@ -161,7 +161,7 @@ void gba_state::dma_exec(FPTR ch) else { // if (dst >= 0x6000000 && dst <= 0x6017fff) -// printf("DMA exec: ch %d from %08x to %08x, mode %04x, count %04x (PC %x) (%s)\n", (int)ch, src, dst, ctrl, cnt, activecpu_get_pc(), ((ctrl>>10) & 1) ? "32" : "16"); +// printf("DMA exec: ch %d from %08x to %08x, mode %04x, count %04x (%s)\n", (int)ch, src, dst, ctrl, cnt, ((ctrl>>10) & 1) ? "32" : "16"); } for (int i = 0; i < cnt; i++) @@ -1559,7 +1559,7 @@ WRITE32_MEMBER(gba_state::gba_io_w) ch = offset / 3; -// printf("%08x: DMA(%d): %x to reg %d (mask %08x)\n", activecpu_get_pc(), ch, data, offset%3, ~mem_mask); +// printf("%08x: DMA(%d): %x to reg %d (mask %08x)\n", space.device().safe_pc(), ch, data, offset%3, ~mem_mask); if (((offset % 3) == 2) && ((~mem_mask & 0xffff0000) == 0)) { @@ -1961,23 +1961,25 @@ TIMER_CALLBACK_MEMBER(gba_state::perform_hbl) if (scanline < 160) { draw_scanline(scanline); + + for (ch = 0; ch < 4; ch++) + { + ctrl = m_dma_regs[(ch*3)+2]>>16; + + // HBL-triggered DMA? + if ((ctrl & 0x8000) && ((ctrl & 0x3000) == 0x2000)) + { + dma_exec(ch); + } + } } - m_DISPSTAT |= DISPSTAT_HBL; + if ((m_DISPSTAT & DISPSTAT_HBL_IRQ_EN ) != 0) { request_irq(INT_HBL); } - for (ch = 0; ch < 4; ch++) - { - ctrl = m_dma_regs[(ch*3)+2]>>16; - - // HBL-triggered DMA? - if ((ctrl & 0x8000) && ((ctrl & 0x3000) == 0x2000)) - { - dma_exec(ch); - } - } + m_DISPSTAT |= DISPSTAT_HBL; m_hbl_timer->adjust(attotime::never); } @@ -1995,6 +1997,28 @@ TIMER_CALLBACK_MEMBER(gba_state::perform_scan) if (scanline >= 160 && scanline < 227) { m_DISPSTAT |= DISPSTAT_VBL; + + // VBL IRQ and DMA on line 160 + if (scanline == 160) + { + int ch, ctrl; + + if (m_DISPSTAT & DISPSTAT_VBL_IRQ_EN) + { + request_irq(INT_VBL); + } + + for (ch = 0; ch < 4; ch++) + { + ctrl = m_dma_regs[(ch*3)+2]>>16; + + // VBL-triggered DMA? + if ((ctrl & 0x8000) && ((ctrl & 0x3000) == 0x1000)) + { + dma_exec(ch); + } + } + } } else { @@ -2011,50 +2035,6 @@ TIMER_CALLBACK_MEMBER(gba_state::perform_scan) } } - // exiting VBL, handle interrupts and DMA triggers - if (scanline == 224) - { - // FIXME: some games are very picky with this trigger! - // * Mario & Luigi SuperStar Saga loses pieces of gfx for 225-227. - // * Driver 2 does not work with values > 217. - // * Prince of Persia Sands of Time, Rayman Hoodlum's Revenge, Rayman 3 breaks for large - // values (say > 200, but exact threshold varies). - // * Scooby-Doo Unmasked and Mystery Mayhem have problems with large values (missing dialogue - // text). - // * Nicktoons Racign does not start with 227; and it resets before going to the race with - // values > 206. - // * Phil of Future does not start for values > 221. - // * Sabrina Teenage Witch does not even reach the Ubi Soft logo if we use the VBL exit value - // 227; it does not display title screen graphics when using 225-226; the intro is broken - // with anything between 207-224. - // * Anstoss Action and Ueki no Housoku have broken graphics for values > 223. - // However, taking smaller values breaks raster effects in a LOT of games (e.g. Castlevania - // series, Final Fantasy series, Tales of Phantasia, Banjo Pilot, NES 'collections' by Hudson, - // Jaleco and Technos, plus tons of racing games, which show garbage in the lower half of the - // screen with smaller values). - // Already choosing 224 instead of 227 makes some glitches to appear in the bottom scanlines. - // Other test cases are EA Sport games (like FIFA or Madden) which have various degrees of - // glitchness depending on the value used here. - // More work on IRQs is definitely necessary! - int ch, ctrl; - - if (m_DISPSTAT & DISPSTAT_VBL_IRQ_EN) - { - request_irq(INT_VBL); - } - - for (ch = 0; ch < 4; ch++) - { - ctrl = m_dma_regs[(ch*3)+2]>>16; - - // VBL-triggered DMA? - if ((ctrl & 0x8000) && ((ctrl & 0x3000) == 0x1000)) - { - dma_exec(ch); - } - } - } - m_hbl_timer->adjust(machine().first_screen()->time_until_pos(scanline, 240)); m_scan_timer->adjust(machine().first_screen()->time_until_pos(( scanline + 1 ) % 228, 0)); } diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index 45bd3f76bc7..f7e6011a608 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -66,43 +66,99 @@ public: required_device<cpu_device> m_maincpu; optional_ioport_array<7> m_inp_matrix; // max 7 optional_device<speaker_sound_device> m_speaker; - + // misc common + UINT8 m_r[8]; // MCU R ports write data + UINT16 m_d; // MCU D port write data + UINT8 m_int[2]; // MCU INT0/1 pins state UINT16 m_inp_mux; // multiplexed inputs mask UINT16 read_inputs(int columns); - - virtual void machine_start(); + void refresh_interrupts(void); + void set_interrupt(int line, int state); + DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line); // display common int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns - + UINT32 m_grid; // VFD current row data UINT64 m_plate; // VFD current column data - - UINT64 m_display_state[0x20]; // display matrix rows data + + UINT64 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments UINT64 m_display_cache[0x20]; // (internal use) UINT8 m_display_decay[0x20][0x40]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); + void set_display_size(int maxx, int maxy); void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety); // game-specific handlers + DECLARE_WRITE8_MEMBER(bambball_plate_w); + DECLARE_WRITE16_MEMBER(bambball_grid_w); + DECLARE_READ8_MEMBER(bambball_input_r); + DECLARE_WRITE8_MEMBER(alnattck_plate_w); - DECLARE_WRITE16_MEMBER(alnattck_d_w); - DECLARE_READ16_MEMBER(alnattck_d_r); - + DECLARE_WRITE16_MEMBER(alnattck_grid_w); + DECLARE_READ16_MEMBER(alnattck_input_r); + + DECLARE_WRITE8_MEMBER(packmon_plate_w); + DECLARE_WRITE16_MEMBER(packmon_grid_w); + DECLARE_READ16_MEMBER(packmon_input_r); + + DECLARE_WRITE8_MEMBER(zackman_plate_w); + DECLARE_WRITE16_MEMBER(zackman_grid_w); + void zackman_update_int0(); + DECLARE_INPUT_CHANGED_MEMBER(zackman_input_changed); + + void cdkong_display(); + DECLARE_WRITE8_MEMBER(cdkong_plate_w); + DECLARE_WRITE16_MEMBER(cdkong_grid_w); + + void cgalaxn_display(); + DECLARE_WRITE16_MEMBER(cgalaxn_plate_w); + DECLARE_WRITE8_MEMBER(cgalaxn_grid_w); + DECLARE_READ8_MEMBER(cgalaxn_input_r); + + DECLARE_WRITE8_MEMBER(cpacman_plate_w); + DECLARE_WRITE16_MEMBER(cpacman_grid_w); + DECLARE_READ8_MEMBER(cpacman_input_r); + + DECLARE_WRITE8_MEMBER(cmspacmn_plate_w); + DECLARE_WRITE16_MEMBER(cmspacmn_grid_w); + DECLARE_READ8_MEMBER(cmspacmn_input_r); + void egalaxn2_display(); DECLARE_WRITE8_MEMBER(egalaxn2_plate_w); DECLARE_WRITE16_MEMBER(egalaxn2_grid_w); DECLARE_READ8_MEMBER(egalaxn2_input_r); + + DECLARE_WRITE8_MEMBER(pbqbert_plate_w); + DECLARE_WRITE16_MEMBER(pbqbert_grid_w); + + void kingman_display(); + DECLARE_WRITE8_MEMBER(kingman_plate_w); + DECLARE_WRITE16_MEMBER(kingman_grid_w); + void kingman_update_int0(); + DECLARE_INPUT_CHANGED_MEMBER(kingman_input_changed); + + void tmtron_display(); + DECLARE_WRITE8_MEMBER(tmtron_plate_w); + DECLARE_WRITE16_MEMBER(tmtron_grid_w); + void tmtron_update_int1(); + DECLARE_INPUT_CHANGED_MEMBER(tmtron_input_changed); + +protected: + virtual void machine_start(); + virtual void machine_reset(); }; +// machine start/reset + void hh_hmcs40_state::machine_start() { // zerofill @@ -110,7 +166,10 @@ void hh_hmcs40_state::machine_start() memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); - + + memset(m_r, 0, sizeof(m_r)); + memset(m_int, 0, sizeof(m_int)); + m_d = 0; m_inp_mux = 0; m_grid = 0; m_plate = 0; @@ -125,11 +184,19 @@ void hh_hmcs40_state::machine_start() save_item(NAME(m_display_decay)); save_item(NAME(m_display_segmask)); + save_item(NAME(m_r)); + save_item(NAME(m_int)); + save_item(NAME(m_d)); save_item(NAME(m_inp_mux)); save_item(NAME(m_grid)); save_item(NAME(m_plate)); } +void hh_hmcs40_state::machine_reset() +{ + refresh_interrupts(); +} + /*************************************************************************** @@ -149,7 +216,7 @@ void hh_hmcs40_state::display_update() { active_state[y] = 0; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { // turn on powered segments if (m_display_state[y] >> x & 1) @@ -169,15 +236,25 @@ void hh_hmcs40_state::display_update() output_set_digit_value(y, active_state[y] & m_display_segmask[y]); const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { int state = active_state[y] >> x & 1; - output_set_lamp_value(y * mul + x, state); - - // bit coords for svg2lay - char buf[10]; - sprintf(buf, "%d.%d", y, x); - output_set_value(buf, state); + char buf1[0x10]; // lampyx + char buf2[0x10]; // y.x + + if (x == m_display_maxx) + { + // always-on if selected + sprintf(buf1, "lamp%da", y); + sprintf(buf2, "%d.a", y); + } + else + { + sprintf(buf1, "lamp%d", y * mul + x); + sprintf(buf2, "%d.%d", y, x); + } + output_set_value(buf1, state); + output_set_value(buf2, state); } } @@ -188,23 +265,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(hh_hmcs40_state::display_decay_tick) { // slowly turn off unpowered segments for (int y = 0; y < m_display_maxy; y++) - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; - + display_update(); } -void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety) +void hh_hmcs40_state::set_display_size(int maxx, int maxy) { m_display_maxx = maxx; m_display_maxy = maxy; +} + +void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety) +{ + set_display_size(maxx, maxy); // update current state UINT64 mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) - m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; - + m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; + display_update(); } @@ -222,6 +304,33 @@ UINT16 hh_hmcs40_state::read_inputs(int columns) } +// interrupt handling + +void hh_hmcs40_state::refresh_interrupts() +{ + for (int i = 0; i < 2; i++) + m_maincpu->set_input_line(i, m_int[i] ? ASSERT_LINE : CLEAR_LINE); +} + +void hh_hmcs40_state::set_interrupt(int line, int state) +{ + line = line ? 1 : 0; + state = state ? 1 : 0; + + if (state != m_int[line]) + { + if (machine().phase() >= MACHINE_PHASE_RESET) + m_maincpu->set_input_line(line, state ? ASSERT_LINE : CLEAR_LINE); + m_int[line] = state; + } +} + +INPUT_CHANGED_MEMBER(hh_hmcs40_state::single_interrupt_line) +{ + set_interrupt((int)(FPTR)param, newval); +} + + /*************************************************************************** @@ -231,16 +340,74 @@ UINT16 hh_hmcs40_state::read_inputs(int columns) /*************************************************************************** - Bambino Basketball (manufactured in Japan) + Bambino Basketball - Dribble Away (manufactured in Japan) * boards are labeled Emix Corp. ET-05 * Hitachi HD38750A08 MCU - * green VFD display Emix-106 + * green VFD display Emix-106, with bezel overlay NOTE!: MESS external artwork is recommended ***************************************************************************/ +WRITE8_MEMBER(hh_hmcs40_state::bambball_plate_w) +{ + // R1x-R3x, D0-D3: vfd matrix plate + int shift = (offset - HMCS40_PORT_R1X) * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + UINT16 plate = BITSWAP16(m_plate,13,8,4,12,9,10,14,1,7,0,15,11,6,3,5,2); + + display_matrix(16, 9, plate, m_grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::bambball_grid_w) +{ + // D4: speaker out + m_speaker->level_w(data >> 4 & 1); + + // D7-D10: input mux + m_inp_mux = data >> 7 & 0xf; + + // D7-D15: vfd matrix grid + m_grid = data >> 7 & 0x1ff; + + // D0-D3: plates (update display there) + bambball_plate_w(space, 3 + HMCS40_PORT_R1X, data & 0xf); +} + +READ8_MEMBER(hh_hmcs40_state::bambball_input_r) +{ + // R0x: inputs + return read_inputs(4); +} + + static INPUT_PORTS_START( bambball ) + PORT_START("IN.0") // D7 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Dribble Low") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Dribble Medium") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Dribble High") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_NAME("Shoot") + + PORT_START("IN.1") // D8 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // " + PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.2") // D9 port R0x + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Display") + + PORT_START("IN.3") // D10 port R0x + PORT_CONFNAME( 0x07, 0x01, "Skill Level") + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_CONFNAME( 0x08, 0x08, "Players" ) + PORT_CONFSETTING( 0x08, "1" ) + PORT_CONFSETTING( 0x00, "2" ) INPUT_PORTS_END @@ -248,8 +415,13 @@ static MACHINE_CONFIG_START( bambball, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38750, 400000) // approximation - RC osc. + MCFG_HMCS40_READ_R_CB(0, READ8(hh_hmcs40_state, bambball_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, bambball_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, bambball_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, bambball_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, bambball_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -269,13 +441,62 @@ MACHINE_CONFIG_END Bandai Packri Monster (manufactured in Japan) * board label DM-21ZA2 * Hitachi HD38800A27 MCU - * cyan/red/green VFD display Futaba DM-21ZK 2B + * cyan/red/green VFD display Futaba DM-21ZK 2B, with bezel overlay NOTE!: MESS external artwork is recommended ***************************************************************************/ +WRITE8_MEMBER(hh_hmcs40_state::packmon_plate_w) +{ + // R0x-R3x, D0-D3: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); + UINT32 plate = BITSWAP24(m_plate,23,22,21,20,0,1,2,3,4,5,6,19,18,17,16,15,14,13,12,11,10,9,8,7); + + display_matrix(20, 10, plate, grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::packmon_grid_w) +{ + // D4: speaker out + m_speaker->level_w(data >> 4 & 1); + + // D11-D15: input mux + m_inp_mux = data >> 11 & 0x1f; + + // D6-D15: vfd matrix grid + m_grid = data >> 6 & 0x3ff; + + // D0-D3: plate 9-12 (update display there) + packmon_plate_w(space, 4, data & 0xf); +} + +READ16_MEMBER(hh_hmcs40_state::packmon_input_r) +{ + // D5: multiplexed inputs + return read_inputs(5); +} + + static INPUT_PORTS_START( packmon ) + PORT_START("IN.0") // D11 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START ) + + PORT_START("IN.1") // D12 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + + PORT_START("IN.2") // D13 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("IN.3") // D14 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + + PORT_START("IN.4") // D15 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) INPUT_PORTS_END @@ -283,8 +504,14 @@ static MACHINE_CONFIG_START( packmon, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation - RC osc. + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(hh_hmcs40_state, packmon_plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, packmon_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, packmon_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, packmon_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, packmon_grid_w)) + MCFG_HMCS40_READ_D_CB(READ16(hh_hmcs40_state, packmon_input_r)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -309,7 +536,66 @@ MACHINE_CONFIG_END ***************************************************************************/ +WRITE8_MEMBER(hh_hmcs40_state::zackman_plate_w) +{ + // R0x-R6x,D0,D1: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + UINT32 plate = BITSWAP32(m_plate,31,30,27,0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,29,28,23,22,21,20,19,18,17,16,15,14,13,12); + + display_matrix(29, 8, plate, grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::zackman_grid_w) +{ + // D2: speaker out + m_speaker->level_w(data >> 2 & 1); + + // D11-D14: input mux + UINT8 inp_mux = data >> 11 & 0xf; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + zackman_update_int0(); + } + + // D8-D15: vfd matrix grid + m_grid = data >> 8 & 0xff; + + // D0,D1: plate 12,13 (update display there) + zackman_plate_w(space, 7, data & 3); +} + +void hh_hmcs40_state::zackman_update_int0() +{ + // INT0 on multiplexed inputs + set_interrupt(0, read_inputs(4)); +} + + +INPUT_CHANGED_MEMBER(hh_hmcs40_state::zackman_input_changed) +{ + zackman_update_int0(); +} + static INPUT_PORTS_START( zackman ) + PORT_START("IN.0") // D11 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, zackman_input_changed, NULL) + + PORT_START("IN.1") // D12 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, zackman_input_changed, NULL) + + PORT_START("IN.2") // D13 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, zackman_input_changed, NULL) + + PORT_START("IN.3") // D14 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, zackman_input_changed, NULL) + + PORT_START("IN.4") // INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, (void *)1) INPUT_PORTS_END @@ -317,8 +603,16 @@ static MACHINE_CONFIG_START( zackman, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, zackman_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, zackman_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -351,55 +645,55 @@ WRITE8_MEMBER(hh_hmcs40_state::alnattck_plate_w) // update display UINT32 plate = BITSWAP16(m_plate,11,9,8,10,7,2,0,1,3,4,5,6,12,13,14,15) | (m_plate & 0xf0000); - + display_matrix(20, 10, plate, m_grid); } -WRITE16_MEMBER(hh_hmcs40_state::alnattck_d_w) +WRITE16_MEMBER(hh_hmcs40_state::alnattck_grid_w) { // D4: speaker out m_speaker->level_w(data >> 4 & 1); - + // D7-D13: input mux m_inp_mux = data >> 7 & 0x7f; // D6-D15: vfd matrix grid m_grid = data >> 6 & 0x3ff; - + // D0-D3: plate 16-19 (update display there) alnattck_plate_w(space, 4, data & 0xf); } -READ16_MEMBER(hh_hmcs40_state::alnattck_d_r) +READ16_MEMBER(hh_hmcs40_state::alnattck_input_r) { - // D5: inputs - return (read_inputs(7) & 1) << 5; + // D5: multiplexed inputs + return read_inputs(7); } static INPUT_PORTS_START( alnattck ) PORT_START("IN.0") // D5 D7 - PORT_CONFNAME( 0x01, 0x00, "Skill" ) + PORT_CONFNAME( 0x20, 0x00, "Skill Level" ) PORT_CONFSETTING( 0x00, "1" ) - PORT_CONFSETTING( 0x01, "2" ) + PORT_CONFSETTING( 0x20, "2" ) - PORT_START("IN.1") // D5 D8 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_START("IN.1") // D8 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) - PORT_START("IN.2") // D5 D9 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_START("IN.2") // D9 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) - PORT_START("IN.3") // D5 D10 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_START("IN.3") // D10 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) - PORT_START("IN.4") // D5 D11 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_START("IN.4") // D11 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) - PORT_START("IN.5") // D5 D12 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Move") + PORT_START("IN.5") // D12 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Move") - PORT_START("IN.6") // D5 D13 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Fire") + PORT_START("IN.6") // D13 line D5 + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Fire") INPUT_PORTS_END @@ -411,8 +705,8 @@ static MACHINE_CONFIG_START( alnattck, hh_hmcs40_state ) MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, alnattck_plate_w)) MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, alnattck_plate_w)) MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, alnattck_plate_w)) - MCFG_HMCS40_READ_D_CB(READ16(hh_hmcs40_state, alnattck_d_r)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, alnattck_d_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, alnattck_grid_w)) + MCFG_HMCS40_READ_D_CB(READ16(hh_hmcs40_state, alnattck_input_r)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) @@ -440,7 +734,56 @@ MACHINE_CONFIG_END ***************************************************************************/ +void hh_hmcs40_state::cdkong_display() +{ + UINT32 plate = BITSWAP32(m_plate,31,30,29,24,0,16,8,1,23,17,9,2,18,10,25,27,26,3,15,27,11,11,14,22,6,13,21,5,19,12,20,4); + + display_matrix(29, 11, plate, m_grid); +} + +WRITE8_MEMBER(hh_hmcs40_state::cdkong_plate_w) +{ + // R13: speaker on? + if (offset == HMCS40_PORT_R1X) + { + //strobes at the start of a sound.. on+slow decay? + //printf("%d",data>>3&1); + data &= 7; + } + + // R0x-R6x: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + cdkong_display(); + + // 12 + // 16,15,17,28,nc, 8, 5, 1, 3,19,22,26,13, 9, 6, 2,10,18,21,25,sp, 7, 4, 0,14,20,24,27 + // 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + // , , ,24, 0,16, 8, 1, ,17, 9, 2,18,10,25,27,26, 3,15,27, ,11,14,22, 6,13,21, 5,19,12,20, 4 + +} + +WRITE16_MEMBER(hh_hmcs40_state::cdkong_grid_w) +{ + // D3: speaker out + m_speaker->level_w(data >> 3 & 1); + + // D4-D14: vfd matrix grid + m_grid = data >> 4 & 0x7ff; + cdkong_display(); +} + + static INPUT_PORTS_START( cdkong ) + PORT_START("IN.0") // port D + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x7ff8, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + + PORT_START("IN.1") // INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, (void *)0) INPUT_PORTS_END @@ -448,8 +791,17 @@ static MACHINE_CONFIG_START( cdkong, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, cdkong_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, cdkong_grid_w)) + MCFG_HMCS40_READ_D_CB(IOPORT("IN.0")) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -475,7 +827,79 @@ MACHINE_CONFIG_END ***************************************************************************/ +void hh_hmcs40_state::cgalaxn_display() +{ + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,1,2,0,11,10,9,8,7,6,5,4,3); + UINT16 plate = BITSWAP16(m_plate,15,14,5,4,3,2,1,0,7,11,12,9,8,10,6,13); + + //display_matrix(14, 12, plate, grid); + + grid<<=1; //todo -1 + display_matrix(14, 13, plate, grid); +} + +WRITE8_MEMBER(hh_hmcs40_state::cgalaxn_grid_w) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D1: speaker on? + + // D2-D15: vfd matrix plate + m_plate = data >> 2 & 0x3fff; + cgalaxn_display(); + + // a, f, g, c, e, d, h, b, p, o, n, m, k, i + + // 0, 5, 6, 2, 4, 3, 7, 1,13,12,11,10, 9, 8 + // 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + // 15,14, 5, 4, 3, 2, 1, 0, 7,11,12, 9, 8,10, 6,13 +} + +WRITE16_MEMBER(hh_hmcs40_state::cgalaxn_plate_w) +{ + // R10,R11: input mux + if (offset == HMCS40_PORT_R1X) + m_inp_mux = data & 3; + + // R1x-R3x: vfd matrix grid + int shift = (offset - HMCS40_PORT_R1X) * 4; + m_grid = (m_grid & ~(0xf << shift)) | (data << shift); + + cgalaxn_display(); + + // 9, 8, 7, 6, 5, 4, 3, 2, 1,11,12,10 + + // 8, 7, 6, 5, 4, 3, 2, 1, 0,10,11, 9 + // 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + // 15,14,13,12, 1, 2, 0,11,10, 9, 8, 7, 6, 5, 4, 3 +} + +READ8_MEMBER(hh_hmcs40_state::cgalaxn_input_r) +{ + // R0x: multiplexed inputs + return read_inputs(2); +} + + static INPUT_PORTS_START( cgalaxn ) + PORT_START("IN.0") // R10 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("IN.1") // R11 port R0x + PORT_CONFNAME( 0x01, 0x01, "Players" ) + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x00, "2" ) + PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.2") // INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, (void *)0) + + PORT_START("IN.3") // INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, (void *)1) INPUT_PORTS_END @@ -483,8 +907,13 @@ static MACHINE_CONFIG_START( cgalaxn, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation - RC osc. + MCFG_HMCS40_READ_R_CB(0, READ8(hh_hmcs40_state, cgalaxn_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, cgalaxn_grid_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, cgalaxn_grid_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, cgalaxn_grid_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, cgalaxn_plate_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -507,10 +936,68 @@ MACHINE_CONFIG_END * cyan/red VFD display Futaba DM-34Z 2A, with color overlay NOTE!: MESS external artwork is recommended + + The game is started by pushing a P1 joystick direction, selecting a game mode: + - Right: Pac-Man (default game) + - Left: Head-to-Head Pac-Man (2-player mode) + - Up: Eat & Run + - Down: Demo ***************************************************************************/ +WRITE8_MEMBER(hh_hmcs40_state::cpacman_plate_w) +{ + // R1x-R6x, D1,D2: vfd matrix plate + int shift = (offset - HMCS40_PORT_R1X) * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10); + UINT32 plate = BITSWAP32(m_plate,31,30,29,28,27,0,1,2,3,8,9,10,11,16,17,18,19,25,26,23,22,21,20,24,15,14,13,12,4,5,6,7); + + display_matrix(27, 11, plate, grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::cpacman_grid_w) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D13-D15: input mux + m_inp_mux = data >> 13 & 7; + + // D5-D15: vfd matrix grid + m_grid = data >> 5 & 0x7ff; + + // D1,D2: plate 8,14 (update display there) + cpacman_plate_w(space, 6 + HMCS40_PORT_R1X, data >> 1 & 3); +} + +READ8_MEMBER(hh_hmcs40_state::cpacman_input_r) +{ + // R0x: multiplexed inputs + return read_inputs(3); +} + + static INPUT_PORTS_START( cpacman ) + PORT_START("IN.0") // D13 port R0x + PORT_CONFNAME( 0x01, 0x01, "Skill Level" ) + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x00, "2" ) + PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // D14 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + + PORT_START("IN.2") // D15 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) INPUT_PORTS_END @@ -518,8 +1005,16 @@ static MACHINE_CONFIG_START( cpacman, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + MCFG_HMCS40_READ_R_CB(0, READ8(hh_hmcs40_state, cpacman_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, cpacman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, cpacman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, cpacman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, cpacman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, cpacman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, cpacman_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, cpacman_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -545,7 +1040,64 @@ MACHINE_CONFIG_END ***************************************************************************/ +WRITE8_MEMBER(hh_hmcs40_state::cmspacmn_plate_w) +{ + // R1x-R6x, D0,D1: vfd matrix plate + int shift = (offset - HMCS40_PORT_R1X) * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + // 22,17 18,13 + // 6,11,23,21,20,19,15, 2, 1, 0,32,31,30,29,12, 9, 4, 8,25,26,27,28,16,10, 3, 5 + // 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + // 14,13,12, 4, 5, 6, 7,24,23,25,22,21,20,13,24, 3,19,14,12,11,24, 2,10, 8, 7,25, 0, 9, 1,18,17,16 + + UINT16 grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,1,0); + UINT64 plate = BIT(m_plate,15)<<32 | BITSWAP32(m_plate,14,13,12,4,5,6,7,24,23,25,22,21,20,13,24,3,19,14,12,11,24,2,10,8,7,25,0,9,1,18,17,16); + + display_matrix(33, 12, plate, grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::cmspacmn_grid_w) +{ + // D2: speaker out + m_speaker->level_w(data >> 2 & 1); + + // D13-D15: input mux + m_inp_mux = data >> 13 & 7; + + // D5-D15: vfd matrix grid + m_grid = data >> 5 & 0x7ff; + + // D0,D1: plate 11+17,6+22 (update display there) + cmspacmn_plate_w(space, 6 + HMCS40_PORT_R1X, data & 3); +} + +READ8_MEMBER(hh_hmcs40_state::cmspacmn_input_r) +{ + // R0x: multiplexed inputs + return read_inputs(3); +} + + static INPUT_PORTS_START( cmspacmn ) + PORT_START("IN.0") // D13 port R0x + PORT_CONFNAME( 0x01, 0x01, "Skill Level" ) + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x00, "2" ) + PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // D14 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + + PORT_START("IN.2") // D15 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) INPUT_PORTS_END @@ -553,8 +1105,16 @@ static MACHINE_CONFIG_START( cmspacmn, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + MCFG_HMCS40_READ_R_CB(0, READ8(hh_hmcs40_state, cmspacmn_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, cmspacmn_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, cmspacmn_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, cmspacmn_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, cmspacmn_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, cmspacmn_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, cmspacmn_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, cmspacmn_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -581,9 +1141,9 @@ MACHINE_CONFIG_END void hh_hmcs40_state::egalaxn2_display() { - UINT32 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); + UINT16 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); UINT32 plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8); - + display_matrix(24, 15, plate, grid); } @@ -591,10 +1151,10 @@ WRITE16_MEMBER(hh_hmcs40_state::egalaxn2_grid_w) { // D0: speaker out m_speaker->level_w(data & 1); - + // D1-D4: input mux m_inp_mux = data >> 1 & 0xf; - + // D1-D15: vfd matrix grid m_grid = data >> 1; egalaxn2_display(); @@ -602,7 +1162,7 @@ WRITE16_MEMBER(hh_hmcs40_state::egalaxn2_grid_w) WRITE8_MEMBER(hh_hmcs40_state::egalaxn2_plate_w) { - // R10-R63: vfd matrix plate + // R1x-R6x: vfd matrix plate int shift = (offset - HMCS40_PORT_R1X) * 4; m_plate = (m_plate & ~(0xf << shift)) | (data << shift); @@ -637,7 +1197,7 @@ static INPUT_PORTS_START( egalaxn2 ) PORT_START("IN.3") // D4 port R0x PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_CONFNAME( 0x02, 0x02, "Skill" ) + PORT_CONFNAME( 0x02, 0x02, "Skill Level" ) PORT_CONFSETTING( 0x02, "1" ) PORT_CONFSETTING( 0x00, "2" ) PORT_CONFNAME( 0x0c, 0x00, "Players" ) @@ -685,8 +1245,7 @@ MACHINE_CONFIG_END ***************************************************************************/ -// hardware is identical to Galaxian 2, so we can use those handlers -// note: plate numbers are 0-23, not 1-24(with 0 always-on) +// i/o hookup is identical to Galaxian 2, so we can use those handlers static INPUT_PORTS_START( epacman2 ) PORT_START("IN.0") // D1 port R0x @@ -709,7 +1268,7 @@ static INPUT_PORTS_START( epacman2 ) PORT_START("IN.3") // D4 port R0x PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_CONFNAME( 0x02, 0x02, "Skill" ) + PORT_CONFNAME( 0x02, 0x02, "Skill Level" ) PORT_CONFSETTING( 0x00, "1" ) PORT_CONFSETTING( 0x02, "2" ) PORT_CONFNAME( 0x0c, 0x04, "Players" ) @@ -757,7 +1316,38 @@ MACHINE_CONFIG_END ***************************************************************************/ +WRITE8_MEMBER(hh_hmcs40_state::pbqbert_plate_w) +{ + // R0x-R6x,D8: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // update display + UINT32 plate = BITSWAP32(m_plate,31,30,24,25,26,27,28,15,14,29,13,12,11,10,9,8,7,6,5,4,3,2,1,0,16,17,18,19,20,21,22,23); + + display_matrix(30, 8, plate, m_grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::pbqbert_grid_w) +{ + // D14: speaker out + m_speaker->level_w(data >> 14 & 1); + + // D0-D7: vfd matrix grid + m_grid = data & 0xff; + + // D8: plate 25 (update display there) + pbqbert_plate_w(space, 7, data >> 8 & 1); +} + + static INPUT_PORTS_START( pbqbert ) + PORT_START("IN.0") // port D + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // up-left + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) // up-right + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) // down-right + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) // down-left + PORT_BIT( 0xe1ff, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END @@ -765,8 +1355,17 @@ static MACHINE_CONFIG_START( pbqbert, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, pbqbert_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, pbqbert_grid_w)) + MCFG_HMCS40_READ_D_CB(IOPORT("IN.0")) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -787,12 +1386,83 @@ MACHINE_CONFIG_END * boards are labeled THF-01II 2E138E01/2E128E02 * Hitachi HD38800B23 MCU * cyan/red/blue VFD display Futaba DM-65ZK 3A - + NOTE!: MESS external artwork is recommended ***************************************************************************/ +void hh_hmcs40_state::kingman_display() +{ + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); + UINT32 plate = BITSWAP24(m_plate,23,6,7,5,4,3,2,1,0,13,12,20,19,18,17,16,10,11,9,8,14,15,13,12); + + display_matrix(23, 9, plate, grid); +} + +WRITE8_MEMBER(hh_hmcs40_state::kingman_plate_w) +{ + // R0x-R3x: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + // 14,13 + // 12,11,10, 9, 8, 2, 3, 1, 0, 6, 7, 5, 4,21,22,20,19,18,17,16,15 + // 23,22,21,20,19,18,17,16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + // 23, 6, 7, 5, 4, 3, 2, 1, 0,13,12,20,19,18,17,16,10,11, 9, 8,14,15,13,12 + + kingman_display(); +} + +WRITE16_MEMBER(hh_hmcs40_state::kingman_grid_w) +{ + // D6: speaker out + m_speaker->level_w(data >> 6 & 1); + + // D12-D15: input mux + UINT8 inp_mux = data >> 12 & 0xf; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + kingman_update_int0(); + } + + // D7-D15: vfd matrix grid + m_grid = data >> 7 & 0x1ff; + + // D0-D4: more plates + m_plate = (m_plate & 0x00ffff) | (data << 16 & 0x1f0000); + kingman_display(); +} + +void hh_hmcs40_state::kingman_update_int0() +{ + // INT0 on multiplexed inputs + set_interrupt(0, read_inputs(4)); +} + + +INPUT_CHANGED_MEMBER(hh_hmcs40_state::kingman_input_changed) +{ + kingman_update_int0(); +} + static INPUT_PORTS_START( kingman ) + PORT_START("IN.0") // D12 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, kingman_input_changed, NULL) + + PORT_START("IN.1") // D13 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, kingman_input_changed, NULL) + + PORT_START("IN.2") // D14 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, kingman_input_changed, NULL) + + PORT_START("IN.3") // D15 INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, kingman_input_changed, NULL) + + PORT_START("IN.4") // INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, (void *)1) + + INPUT_PORTS_END @@ -800,8 +1470,13 @@ static MACHINE_CONFIG_START( kingman, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation - RC osc. + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(hh_hmcs40_state, kingman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, kingman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, kingman_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, kingman_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, kingman_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -827,7 +1502,71 @@ MACHINE_CONFIG_END ***************************************************************************/ +void hh_hmcs40_state::tmtron_display() +{ + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,1,2,3,4,5,6,7,8,9,0); + UINT32 plate = BITSWAP24(m_plate,23,5,2,21,1,6,7,9,10,11,21,0,19,3,4,8,3,18,17,16,12,13,14,15); + + display_matrix(23, 10, plate, grid); +} + +WRITE8_MEMBER(hh_hmcs40_state::tmtron_plate_w) +{ + // R0x-R3x: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + tmtron_display(); +} + +WRITE16_MEMBER(hh_hmcs40_state::tmtron_grid_w) +{ + // D4: speaker out + m_speaker->level_w(data >> 4 & 1); + + // D12-D15: input mux + UINT8 inp_mux = data >> 12 & 0xf; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + tmtron_update_int1(); + } + + // D6-D15: vfd matrix grid + m_grid = data >> 6 & 0x3ff; + + // D0-D3,D5: more plates + m_plate = (m_plate & 0x00ffff) | (data << 16 & 0x2f0000); + tmtron_display(); +} + + +void hh_hmcs40_state::tmtron_update_int1() +{ + // INT1 on multiplexed inputs + set_interrupt(1, read_inputs(4)); +} + +INPUT_CHANGED_MEMBER(hh_hmcs40_state::tmtron_input_changed) +{ + tmtron_update_int1(); +} + static INPUT_PORTS_START( tmtron ) + PORT_START("IN.0") // D12 INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, tmtron_input_changed, NULL) PORT_16WAY // separate directional buttons, hence 16way + + PORT_START("IN.1") // D13 INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, tmtron_input_changed, NULL) PORT_16WAY // " + + PORT_START("IN.2") // D14 INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, tmtron_input_changed, NULL) PORT_16WAY // " + + PORT_START("IN.3") // D15 INT1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, tmtron_input_changed, NULL) PORT_16WAY // " + + PORT_START("IN.4") // INT0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_hmcs40_state, single_interrupt_line, (void *)0) INPUT_PORTS_END @@ -835,8 +1574,13 @@ static MACHINE_CONFIG_START( tmtron, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38800, 400000) // approximation - RC osc. + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(hh_hmcs40_state, tmtron_plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, tmtron_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, tmtron_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, tmtron_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, tmtron_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ @@ -956,22 +1700,22 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ -CONS( 1979, bambball, 0, 0, bambball, bambball, driver_device, 0, "Bambino", "Basketball (Bambino)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1979, bambball, 0, 0, bambball, bambball, driver_device, 0, "Bambino", "Basketball - Dribble Away", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) -CONS( 1981, packmon, 0, 0, packmon, packmon, driver_device, 0, "Bandai", "Packri Monster", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1983, zackman, 0, 0, zackman, zackman, driver_device, 0, "Bandai", "Zackman", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1981, packmon, 0, 0, packmon, packmon, driver_device, 0, "Bandai", "Packri Monster", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1983, zackman, 0, 0, zackman, zackman, driver_device, 0, "Bandai", "Zackman", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1981, alnattck, 0, 0, alnattck, alnattck, driver_device, 0, "Coleco", "Alien Attack", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1982, cdkong, 0, 0, cdkong, cdkong, driver_device, 0, "Coleco", "Donkey Kong (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1982, cgalaxn, 0, 0, cgalaxn, cgalaxn, driver_device, 0, "Coleco", "Galaxian (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1981, cpacman, 0, 0, cpacman, cpacman, driver_device, 0, "Coleco", "Pac-Man (Coleco, Rev. 29)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, driver_device, 0, "Coleco", "Pac-Man (Coleco, Rev. 28)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1981, cpacman, 0, 0, cpacman, cpacman, driver_device, 0, "Gakken (Coleco license)", "Pac-Man (Coleco, Rev. 29)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) // original version is Super Puck Monster, by Gakken +CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, driver_device, 0, "Gakken (Coleco license)", "Pac-Man (Coleco, Rev. 28)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) // " CONS( 1983, cmspacmn, 0, 0, cmspacmn, cmspacmn, driver_device, 0, "Coleco", "Ms. Pac-Man (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) CONS( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, driver_device, 0, "Entex", "Galaxian 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1981, epacman2, 0, 0, epacman2, epacman2, driver_device, 0, "Entex", "Pac Man 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) -CONS( 1983, pbqbert, 0, 0, pbqbert, pbqbert, driver_device, 0, "Parker Brothers", "Q*Bert (Parker Brothers)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1983, pbqbert, 0, 0, pbqbert, pbqbert, driver_device, 0, "Parker Brothers", "Q*Bert (Parker Brothers)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) -CONS( 1982, kingman, 0, 0, kingman, kingman, driver_device, 0, "Tomy", "Kingman", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) -CONS( 1984, tmtron, 0, 0, tmtron, tmtron, driver_device, 0, "Tomy", "Tron (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) +CONS( 1982, kingman, 0, 0, kingman, kingman, driver_device, 0, "Tomy", "Kingman", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1984, tmtron, 0, 0, tmtron, tmtron, driver_device, 0, "Tomy", "Tron (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) diff --git a/src/mess/drivers/hh_pic16.c b/src/mess/drivers/hh_pic16.c index b8281a737e0..638918e841b 100644 --- a/src/mess/drivers/hh_pic16.c +++ b/src/mess/drivers/hh_pic16.c @@ -57,14 +57,15 @@ public: int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns - - UINT32 m_display_state[0x20]; // display matrix rows data + + UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments UINT32 m_display_cache[0x20]; // (internal use) UINT8 m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); + void set_display_size(int maxx, int maxy); void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); // game-specific handlers @@ -79,7 +80,7 @@ void hh_pic16_state::machine_start() memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); - + m_b = 0; m_c = 0; @@ -116,7 +117,7 @@ void hh_pic16_state::display_update() { active_state[y] = 0; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { // turn on powered segments if (m_display_state[y] >> x & 1) @@ -136,15 +137,25 @@ void hh_pic16_state::display_update() output_set_digit_value(y, active_state[y] & m_display_segmask[y]); const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { int state = active_state[y] >> x & 1; - output_set_lamp_value(y * mul + x, state); - - // bit coords for svg2lay - char buf[10]; - sprintf(buf, "%d.%d", y, x); - output_set_value(buf, state); + char buf1[0x10]; // lampyx + char buf2[0x10]; // y.x + + if (x == m_display_maxx) + { + // always-on if selected + sprintf(buf1, "lamp%da", y); + sprintf(buf2, "%d.a", y); + } + else + { + sprintf(buf1, "lamp%d", y * mul + x); + sprintf(buf2, "%d.%d", y, x); + } + output_set_value(buf1, state); + output_set_value(buf2, state); } } @@ -155,23 +166,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(hh_pic16_state::display_decay_tick) { // slowly turn off unpowered segments for (int y = 0; y < m_display_maxy; y++) - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; - + display_update(); } -void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +void hh_pic16_state::set_display_size(int maxx, int maxy) { m_display_maxx = maxx; m_display_maxy = maxy; +} + +void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +{ + set_display_size(maxx, maxy); // update current state UINT32 mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) - m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; - + m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; + display_update(); } @@ -199,16 +215,15 @@ WRITE8_MEMBER(hh_pic16_state::maniac_output_w) m_c = data; else m_b = data; - + // d7: speaker out m_speaker->level_w((m_b >> 7 & 1) | (m_c >> 6 & 2)); // d0-d6: 7seg - m_display_maxx = 7; - m_display_maxy = 2; - m_display_segmask[offset] = 0x7f; m_display_state[offset] = ~data & 0x7f; + + set_display_size(7, 2); display_update(); } diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index 83d83023ef0..8937ce30f21 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -5,9 +5,9 @@ This driver is a collection of simple dedicated handheld and tabletop toys based around the TMS1000 MCU series. Anything more complex or clearly part of a series is (or will be) in its own driver. - + Let's use this driver for a list of known devices and their serials, - excluding TI's own products (see for example ticalc1x.c, tispeak.c) + excluding TI's own products (see ticalc1x.c, tispeak.c) serial device etc. -------------------------------------------------------------------- @@ -17,12 +17,13 @@ @MP0914 TMS1000 1979, Entex Baseball 1 @MP0923 TMS1000 1979, Entex Baseball 2 @MP1030 TMS1100 1980, APF Mathemagician - *MP1133 TMS1470 1979, Kosmos Astro + @MP1133 TMS1470 1979, Kosmos Astro @MP1204 TMS1100 1980, Entex Baseball 3 *MP1221 TMS1100 1980, Entex Raise The Devil *MP1312 TMS1100 198?, Tandy/RadioShack Science Fair Microcomputer Trainer - *MP2139 ? 1982, Gakken Galaxy Invader 1000 - *MP2788 ? 1980, Bandai Flight Time + *MP2105 TMS1370 1979, Gakken Poker, Entex Electronic Poker + *MP2139 TMS1370? 1982, Gakken Galaxy Invader 1000 + *MP2788 ? 1980, Bandai Flight Time (? note: VFD-capable) @MP3226 TMS1000 1978, Milton Bradley Simon *MP3301 TMS1000 1979, Milton Bradley Bigtrak *MP3320A TMS1000 1979, Coleco Head to Head Basketball @@ -45,15 +46,19 @@ M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster @MP6100A TMS0980 1979, Ideal Electronic Detective @MP6101B TMS0980 1979, Parker Brothers Stop Thief - *MP6361 ? 1983, Defender Strikes + *MP6361 ? 1983, Defender Strikes (? note: VFD-capable) *MP7303 TMS1400? 19??, Tiger 7-in-1 Sports Stadium @MP7313 TMS1400 1980, Parker Brothers Bank Shot @MP7314 TMS1400 1980, Parker Brothers Split Second + *MP7324 TMS1400? 1985, Coleco Talking Teacher MP7332 TMS1400 1981, Milton Bradley Dark Tower -> mbdtower.c @MP7334 TMS1400 1981, Coleco Total Control 4 + *MP7573 ? 1981, Entex Select-a-Game cartridge: Football (? note: 40-pin, VFD-capable) inconsistent: - + + *MPF553 TMS1670 1980, Entex Jackpot Gin Rummy Black Jack + *M95041 ? 1983, Tsukuda Game Pachinko (? note: 40-pin, VFD-capable) @CD7282SL TMS1100 1981, Tandy/RadioShack Tandy-12 (serial is similar to TI Speak & Spell series?) (* denotes not yet emulated by MESS, @ denotes it's in this driver) @@ -75,6 +80,7 @@ // internal artwork #include "amaztron.lh" +#include "astro.lh" #include "bankshot.lh" #include "cnsector.lh" #include "ebball.lh" @@ -85,7 +91,7 @@ #include "mathmagi.lh" #include "merlin.lh" // clickable #include "simon.lh" // clickable -#include "ssimon.lh" +#include "ssimon.lh" // clickable #include "splitsec.lh" #include "starwbc.lh" #include "stopthie.lh" @@ -102,7 +108,7 @@ void hh_tms1k_state::machine_start() memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); - + m_o = 0; m_r = 0; m_inp_mux = 0; @@ -148,7 +154,7 @@ void hh_tms1k_state::display_update() { active_state[y] = 0; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { // turn on powered segments if (m_power_on && m_display_state[y] >> x & 1) @@ -168,15 +174,25 @@ void hh_tms1k_state::display_update() output_set_digit_value(y, active_state[y] & m_display_segmask[y]); const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { int state = active_state[y] >> x & 1; - output_set_lamp_value(y * mul + x, state); - - // bit coords for svg2lay - char buf[10]; - sprintf(buf, "%d.%d", y, x); - output_set_value(buf, state); + char buf1[0x10]; // lampyx + char buf2[0x10]; // y.x + + if (x == m_display_maxx) + { + // always-on if selected + sprintf(buf1, "lamp%da", y); + sprintf(buf2, "%d.a", y); + } + else + { + sprintf(buf1, "lamp%d", y * mul + x); + sprintf(buf2, "%d.%d", y, x); + } + output_set_value(buf1, state); + output_set_value(buf2, state); } } @@ -187,23 +203,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(hh_tms1k_state::display_decay_tick) { // slowly turn off unpowered segments for (int y = 0; y < m_display_maxy; y++) - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; - + display_update(); } -void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +void hh_tms1k_state::set_display_size(int maxx, int maxy) { m_display_maxx = maxx; m_display_maxy = maxy; +} + +void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +{ + set_display_size(maxx, maxy); // update current state UINT32 mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) - m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; - + m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; + display_update(); } @@ -252,6 +273,7 @@ INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button) * TMS1100 MCU, labeled MP1030 * 2 x DS8870N - Hex LED Digit Driver * 2 x DS8861N - MOS-to-LED 5-Segment Driver + * 10-digit 7seg LED display(2 custom ones) + 4 LEDs, no sound This is a tabletop educational calculator. It came with plastic overlays for playing different kind of games. Refer to the manual on how to use it. @@ -270,9 +292,6 @@ INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button) void hh_tms1k_state::mathmagi_display() { - m_display_maxx = 8; - m_display_maxy = 11; - // R0-R7: 7seg leds for (int y = 0; y < 8; y++) { @@ -286,6 +305,7 @@ void hh_tms1k_state::mathmagi_display() for (int y = 8; y < 11; y++) m_display_state[y] = (m_r >> y & 1) ? m_o : 0; + set_display_size(8, 11); display_update(); } @@ -293,7 +313,7 @@ WRITE16_MEMBER(hh_tms1k_state::mathmagi_write_r) { // R3,R5-R7,R9,R10: input mux m_inp_mux = (data >> 3 & 1) | (data >> 4 & 0xe) | (data >> 5 & 0x30); - + // +others: m_r = data; mathmagi_display(); @@ -424,6 +444,8 @@ MACHINE_CONFIG_END Coleco Amaze-A-Tron, by Ralph Baer * TMS1100 MCU, labeled MP3405(die label too) + * 2-digit 7seg LED display + 2 LEDs(one red, one green), 1bit sound + * 5x5 pressure-sensitive playing board This is an electronic board game with a selection of 8 maze games, most of them for 2 players. A 5x5 playing grid and four markers are @@ -433,19 +455,17 @@ MACHINE_CONFIG_END void hh_tms1k_state::amaztron_display() { - m_display_maxx = 8; - m_display_maxy = 3; - // R8,R9: select digit for (int y = 0; y < 2; y++) { m_display_segmask[y] = 0x7f; m_display_state[y] = (m_r >> (y + 8) & 1) ? m_o : 0; } - + // R6,R7: lamps (-> lamp20,21) m_display_state[2] = m_r >> 6 & 3; - + + set_display_size(8, 3); display_update(); } @@ -453,7 +473,7 @@ WRITE16_MEMBER(hh_tms1k_state::amaztron_write_r) { // R0-R5: input mux m_inp_mux = data & 0x3f; - + // R10: speaker out m_speaker->level_w(data >> 10 & 1); @@ -552,6 +572,7 @@ MACHINE_CONFIG_END Coleco Total Control 4 * TMS1400NLL MP7334-N2 (die labeled MP7334) + * 2x2-digit 7seg LED display + 4 LEDs, LED grid display, 1bit sound This is a head to head electronic tabletop LED-display sports console. One cartridge(Football) was included with the console, the other three were @@ -582,12 +603,12 @@ MACHINE_CONFIG_END void hh_tms1k_state::tc4_display() { m_display_wait = 50; - + // R5,7,8,9 are 7segs for (int y = 0; y < 10; y++) if (y >= 5 && y <= 9 && y != 6) m_display_segmask[y] = 0x7f; - + // update current state (note: R6 as extra column!) display_matrix(9, 10, (m_o | (m_r << 2 & 0x100)), m_r); } @@ -600,7 +621,7 @@ WRITE16_MEMBER(hh_tms1k_state::tc4_write_r) // R0-R5: input mux // R9: to cartridge slot m_inp_mux = data & 0x23f; - + // R6: led column 8 // +other columns m_r = data; @@ -699,13 +720,14 @@ MACHINE_CONFIG_END Entex Electronic Baseball (1) * TMS1000NLP MP0914 (die labeled MP0914A) - + * 1 7seg LED, and other LEDs behind bezel, 1bit sound + This is a handheld LED baseball game. One player controls the batter, the CPU or other player controls the pitcher. Pitcher throw buttons are on a 'joypad' obtained from a compartment in the back. Player scores are supposed to be written down manually, the game doesn't save scores or innings (this annoyance was resolved in the sequel). For more information, refer to the official manual. - + The overlay graphic is known to have 2 versions: one where the field players are denoted by words ("left", "center", "short", etc), and an alternate one with little guys drawn next to the LEDs. @@ -730,7 +752,7 @@ void hh_tms1k_state::ebball_display() { // R8 is a 7seg m_display_segmask[8] = 0x7f; - + display_matrix(7, 9, ~m_o, m_r); } @@ -738,10 +760,10 @@ WRITE16_MEMBER(hh_tms1k_state::ebball_write_r) { // R1-R5: input mux m_inp_mux = data >> 1 & 0x1f; - + // R9: speaker out m_speaker->level_w(data >> 9 & 1); - + // R0-R8: led columns m_r = data; ebball_display(); @@ -821,15 +843,16 @@ MACHINE_CONFIG_END Entex Electronic Baseball 2 * boards are labeled: ZENY * TMS1000 MCU, MP0923 (die labeled MP0923) - + * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound + The Japanese version was published by Gakken, black casing instead of white. - + The sequel to Entex Baseball, this version keeps up with score and innings. As its predecessor, the pitcher controls are on a separate joypad. lamp translation table: led zz from game PCB = MESS lampyx: - + 00 = - 10 = lamp94 20 = lamp74 30 = lamp50 01 = lamp53 11 = lamp93 21 = lamp75 31 = lamp51 02 = lamp7 12 = lamp92 22 = lamp80 32 = lamp52 @@ -848,7 +871,7 @@ void hh_tms1k_state::ebball2_display() // the first 3 are 7segs for (int y = 0; y < 3; y++) m_display_segmask[y] = 0x7f; - + display_matrix(8, 10, ~m_o, m_r ^ 0x7f); } @@ -856,10 +879,10 @@ WRITE16_MEMBER(hh_tms1k_state::ebball2_write_r) { // R3-R6: input mux m_inp_mux = data >> 3 & 0xf; - + // R10: speaker out m_speaker->level_w(data >> 10 & 1); - + // R0-R9: led columns m_r = data; ebball2_display(); @@ -932,14 +955,15 @@ MACHINE_CONFIG_END * boards are labeled: ZENY * TMS1100NLL 6007 MP1204 (die labeled MP1204) * 2*SN75492N LED display driver - + * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound + This is another improvement over Entex Baseball, where gameplay is a bit more varied. Like the others, the pitcher controls are on a separate joypad. lamp translation table: led zz from game PCB = MESS lampyx: note: unlabeled panel leds are listed here as Sz, Bz, Oz, Iz, z left-to-right - + 00 = - 10 = lamp75 20 = lamp72 01 = lamp60 11 = lamp65 21 = lamp84 02 = lamp61 12 = lamp55 22 = lamp85 @@ -960,21 +984,19 @@ MACHINE_CONFIG_END void hh_tms1k_state::ebball3_display() { - m_display_maxx = 7; - m_display_maxy = 10+2; - // update current state for (int y = 0; y < 10; y++) m_display_state[y] = (m_r >> y & 1) ? m_o : 0; // R0,R1 are normal 7segs m_display_segmask[0] = m_display_segmask[1] = 0x7f; - + // R4,R7 contain segments(only F and B) for the two other digits m_display_state[10] = (m_display_state[4] & 0x20) | (m_display_state[7] & 0x02); m_display_state[11] = ((m_display_state[4] & 0x10) | (m_display_state[7] & 0x01)) << 1; m_display_segmask[10] = m_display_segmask[11] = 0x22; - + + set_display_size(7, 10+2); display_update(); } @@ -982,10 +1004,10 @@ WRITE16_MEMBER(hh_tms1k_state::ebball3_write_r) { // R0-R2: input mux m_inp_mux = data & 7; - + // R10: speaker out m_speaker->level_w(data >> 10 & 1); - + // R0-R9: led columns m_r = data; ebball3_display(); @@ -1050,7 +1072,7 @@ void hh_tms1k_state::ebball3_set_clock() // MCU clock is from an RC circuit(R=47K, C=33pf) oscillating by default at ~340kHz, // but on PRO, the difficulty switch adds an extra 150K resistor to Vdd to speed // it up to around ~440kHz. - m_maincpu->set_unscaled_clock(m_inp_matrix[3]->read() & 1 ? 440000 : 340000); + m_maincpu->set_unscaled_clock((m_inp_matrix[3]->read() & 1) ? 440000 : 340000); } INPUT_CHANGED_MEMBER(hh_tms1k_state::ebball3_difficulty_switch) @@ -1093,6 +1115,8 @@ MACHINE_CONFIG_END Ideal Electronic Detective * TMS0980NLL MP6100A (die labeled 0980B-00) + * 10-digit 7seg LED display, 1bit sound + hardware (and concept) is very similar to Parker Bros Stop Thief This is an electronic board game. It requires game cards with suspect info, @@ -1118,7 +1142,7 @@ WRITE16_MEMBER(hh_tms1k_state::elecdet_write_o) { // O0,O1,O4,O6: input mux m_inp_mux = (data & 3) | (data >> 2 & 4) | (data >> 3 & 8); - + // O0-O6: led segments A-G // O7: speaker out m_o = data; @@ -1207,6 +1231,7 @@ MACHINE_CONFIG_END Kenner Star Wars - Electronic Battle Command * TMS1100 MCU, labeled MP3438A + * 4x4 LED grid display + 2 separate LEDs and 2-digit 7segs, 1bit sound This is a small tabletop space-dogfighting game. To start the game, press BASIC/INTER/ADV and enter P#(number of players), then @@ -1218,7 +1243,7 @@ void hh_tms1k_state::starwbc_display() { // R6,R8 are 7segs m_display_segmask[6] = m_display_segmask[8] = 0x7f; - + display_matrix(8, 10, m_o, m_r); } @@ -1315,8 +1340,121 @@ MACHINE_CONFIG_END /*************************************************************************** + Kosmos Astro + * TMS1470NLHL MP1133 (die labeled TMS1400 MP1133) + * 9digit 7seg VFD display + 8 LEDs(4 green, 4 yellow), no sound + + This is an astrological calculator, and also supports 4-function + calculations. Refer to the official manual on how to use this device. + +***************************************************************************/ + +void hh_tms1k_state::astro_display() +{ + // declare 7segs + for (int y = 0; y < 9; y++) + m_display_segmask[y] = 0xff; + + display_matrix(8, 10, m_o, m_r); +} + +WRITE16_MEMBER(hh_tms1k_state::astro_write_r) +{ + // R0-R7: input mux + m_inp_mux = data & 0xff; + + // R0-R9: select digit/leds + m_r = data; + astro_display(); +} + +WRITE16_MEMBER(hh_tms1k_state::astro_write_o) +{ + // O0-O7: digit segments/leds + m_o = data; + astro_display(); +} + +READ8_MEMBER(hh_tms1k_state::astro_read_k) +{ + return read_inputs(8); +} + + +static INPUT_PORTS_START( astro ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE"/Sun") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY"/Mercury") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-/Venus") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // R3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+/Mars") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.4") // R4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=/Astro") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.5") // R5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_NAME("B1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("B2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.6") // R6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("C") + PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.7") // R7 + PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_CONFNAME( 0x08, 0x08, "Mode" ) + PORT_CONFSETTING( 0x00, "Calculator" ) + PORT_CONFSETTING( 0x08, "Astro" ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( astro, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1470, 450000) // approximation - RC osc. R=4.7K, C=33pf, but unknown RC curve + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, astro_read_k)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, astro_write_r)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, astro_write_o)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_astro) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + Milton Bradley Comp IV * TMC0904NL CP0904A (die labeled 4A0970D-04A) + * 10 LEDs behind bezel, no sound This is small tabletop Mastermind game; a code-breaking game where the player needs to find out the correct sequence of colours (numbers in our case). @@ -1325,7 +1463,6 @@ MACHINE_CONFIG_END Press the R key to start, followed by a set of unique numbers and E. Refer to the official manual for more information. - ***************************************************************************/ WRITE16_MEMBER(hh_tms1k_state::comp4_write_r) @@ -1403,7 +1540,7 @@ MACHINE_CONFIG_END Revision A hardware: * TMS1000 (die labeled MP3226) - * DS75494 lamp driver + * DS75494 lamp driver, 4 big lamps, 1bit sound Newer revisions (also Pocket Simon) have a smaller 16-pin MB4850 chip instead of the TMS1000. This one has been decapped too, but we couldn't @@ -1421,10 +1558,10 @@ WRITE16_MEMBER(hh_tms1k_state::simon_write_r) // R7 -> 75494 IN2 -> blue lamp display_matrix(4, 1, data >> 4, 1); - // R8 -> 75494 IN0 -> speaker + // R8 -> 75494 IN0 -> speaker out m_speaker->level_w(data >> 8 & 1); - // R0,R1,R2,R9: input mux + // R0-R2,R9: input mux // R3: GND // other bits: N/C m_inp_mux = (data & 7) | (data >> 6 & 8); @@ -1450,19 +1587,19 @@ static INPUT_PORTS_START( simon ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Green Button") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Red Button") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Yellow Button") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Blue Button") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Green Button") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Red Button") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Yellow Button") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Blue Button") PORT_START("IN.2") // R2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Start") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Last") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Longest") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Last") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Longest") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("IN.3") // R9 - PORT_CONFNAME( 0x0f, 0x01, "Skill Level") + PORT_CONFNAME( 0x0f, 0x02, "Skill Level") PORT_CONFSETTING( 0x02, "1" ) PORT_CONFSETTING( 0x04, "2" ) PORT_CONFSETTING( 0x08, "3" ) @@ -1497,13 +1634,26 @@ MACHINE_CONFIG_END Milton Bradley Super Simon * TMS1100 MP3476NLL (die labeled MP3476) + * 8 big lamps(2 turn on at same time), 1bit sound - x + The semi-squel to Simon, not as popular. It includes more game variations + and a 2-player head-to-head mode. ***************************************************************************/ WRITE16_MEMBER(hh_tms1k_state::ssimon_write_r) { + // R0-R3,R9,R10: input mux + m_inp_mux = (data & 0xf) | (data >> 5 & 0x30); + + // R4: yellow lamps + // R5: green lamps + // R6: blue lamps + // R7: red lamps + display_matrix(4, 1, data >> 4, 1); + + // R8: speaker out + m_speaker->level_w(data >> 8 & 1); } WRITE16_MEMBER(hh_tms1k_state::ssimon_write_o) @@ -1513,18 +1663,83 @@ WRITE16_MEMBER(hh_tms1k_state::ssimon_write_o) READ8_MEMBER(hh_tms1k_state::ssimon_read_k) { - return 0; + return read_inputs(6); } static INPUT_PORTS_START( ssimon ) + PORT_START("IN.0") // R0 + PORT_CONFNAME( 0x0f, 0x01, "Game Select") + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_CONFSETTING( 0x08, "4" ) + PORT_CONFSETTING( 0x00, "5" ) + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Yellow Button") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Green Button") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Blue Button") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Red Button") + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Last") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Longest") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Decision") + + PORT_START("IN.3") // R3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Yellow Button") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Green Button") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Blue Button") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Red Button") + + PORT_START("IN.4") // R9 + PORT_CONFNAME( 0x0f, 0x02, "Skill Level") + PORT_CONFSETTING( 0x00, "Head-to-Head" ) // this sets R10 K2, see below + PORT_CONFSETTING( 0x02, "1" ) + PORT_CONFSETTING( 0x04, "2" ) + PORT_CONFSETTING( 0x08, "3" ) + PORT_CONFSETTING( 0x01, "4" ) + + PORT_START("IN.5") // R10 + PORT_BIT( 0x02, 0x02, IPT_SPECIAL ) PORT_CONDITION("IN.4", 0x0f, EQUALS, 0x00) + PORT_BIT( 0x02, 0x00, IPT_SPECIAL ) PORT_CONDITION("IN.4", 0x0f, NOTEQUALS, 0x00) + PORT_BIT( 0x0d, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.6") // fake + PORT_CONFNAME( 0x03, 0x01, "Speed" ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, ssimon_speed_switch, NULL) + PORT_CONFSETTING( 0x00, "Simple" ) + PORT_CONFSETTING( 0x01, "Normal" ) + PORT_CONFSETTING( 0x02, "Super" ) INPUT_PORTS_END +void hh_tms1k_state::ssimon_set_clock() +{ + // MCU clock is from an RC circuit with C=100pf, R=x depending on speed switch: + // 0 Simple: R=51K -> ~200kHz + // 1 Normal: R=37K -> ~275kHz + // 2 Super: R=22K -> ~400kHz + UINT8 inp = m_inp_matrix[6]->read(); + m_maincpu->set_unscaled_clock((inp & 2) ? 400000 : ((inp & 1) ? 275000 : 200000)); +} + +INPUT_CHANGED_MEMBER(hh_tms1k_state::ssimon_speed_switch) +{ + ssimon_set_clock(); +} + +MACHINE_RESET_MEMBER(hh_tms1k_state, ssimon) +{ + machine_reset(); + ssimon_set_clock(); +} + static MACHINE_CONFIG_START( ssimon, hh_tms1k_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1000, 350000) // x + MCFG_CPU_ADD("maincpu", TMS1100, 275000) // see ssimon_set_clock MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, ssimon_read_k)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, ssimon_write_r)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, ssimon_write_o)) @@ -1532,6 +1747,8 @@ static MACHINE_CONFIG_START( ssimon, hh_tms1k_state ) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_ssimon) + MCFG_MACHINE_RESET_OVERRIDE(hh_tms1k_state, ssimon) + /* no video! */ /* sound hardware */ @@ -1548,6 +1765,7 @@ MACHINE_CONFIG_END Parker Brothers Code Name: Sector, by Bob Doyle * TMS0970 MCU, MP0905BNL ZA0379 (die labeled 0970F-05B) + * 6-digit 7seg LED display + 4 LEDs for compass, no sound This is a tabletop submarine pursuit game. A grid board and small toy boats are used to remember your locations (a Paint app should be ok too). @@ -1557,9 +1775,6 @@ MACHINE_CONFIG_END WRITE16_MEMBER(hh_tms1k_state::cnsector_write_r) { - m_display_maxx = 8; - m_display_maxy = 7; - // R0-R5: select digit (right-to-left) for (int y = 0; y < 6; y++) { @@ -1569,7 +1784,8 @@ WRITE16_MEMBER(hh_tms1k_state::cnsector_write_r) // R6-R9: direction leds (-> lamp60-63) m_display_state[6] = data >> 6 & 0xf; - + + set_display_size(8, 7); display_update(); } @@ -1577,7 +1793,7 @@ WRITE16_MEMBER(hh_tms1k_state::cnsector_write_o) { // O0-O4: input mux m_inp_mux = data & 0x1f; - + // O0-O7: digit segments m_o = data; } @@ -1645,8 +1861,8 @@ MACHINE_CONFIG_END Parker Bros Merlin handheld game, by Bob Doyle * TMS1100NLL MP3404A-N2 - * red LEDs and 1-bit sound - + * 11 LEDs behind buttons, 1bit sound + Also published in Japan by Tomy as "Dr. Smith", white case instead of red. The one with dark-blue case is the rare sequel Master Merlin. More sequels followed too, but on other hardware. @@ -1750,6 +1966,7 @@ MACHINE_CONFIG_END Parker Brothers Stop Thief, by Bob Doyle * TMS0980NLL MP6101B (die labeled 0980B-01A) + * 3-digit 7seg LED display, 1bit sound Stop Thief is actually a board game, the electronic device emulated here (called Electronic Crime Scanner) is an accessory. To start a game, press @@ -1759,17 +1976,15 @@ MACHINE_CONFIG_END WRITE16_MEMBER(hh_tms1k_state::stopthief_write_r) { - m_display_maxx = 7; - m_display_maxy = 3; - // R0-R2: select digit UINT8 o = BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f; - for (int y = 0; y < m_display_maxy; y++) + for (int y = 0; y < 3; y++) { m_display_segmask[y] = 0x7f; m_display_state[y] = (data >> y & 1) ? o : 0; } + set_display_size(7, 3); display_update(); // R3-R8: speaker on @@ -1780,7 +1995,7 @@ WRITE16_MEMBER(hh_tms1k_state::stopthief_write_o) { // O0,O6: input mux m_inp_mux = (data & 1) | (data >> 5 & 2); - + // O3: speaker out // O0-O2,O4-O7: led segments A-G m_o = data; @@ -1854,6 +2069,7 @@ MACHINE_CONFIG_END Parker Brothers Bank Shot (known as Cue Ball in the UK), by Garry Kitchen * TMS1400NLL MP7313-N2 (die labeled MP7313) + * LED grid display, 1bit sound Bank Shot is an electronic pool game. To select a game, repeatedly press the [SELECT] button, then press [CUE UP] to start. Refer to the official @@ -1945,6 +2161,7 @@ MACHINE_CONFIG_END Parker Brothers Split Second * TMS1400NLL MP7314-N2 (die labeled MP7314) + * LED grid display(default round LEDs, and rectangular shape ones), 1bit sound This is an electronic handheld reflex gaming device, it's straightforward to use. The included mini-games are: @@ -2040,6 +2257,7 @@ MACHINE_CONFIG_END Tandy Radio Shack Computerized Arcade (1981, 1982, 1995) * TMS1100 MCU, labeled CD7282SL + * 12 lamps behind buttons, 1bit sound This handheld contains 12 minigames. It looks and plays like "Fabulous Fred" by the Japanese company Mego Corp. in 1980, which in turn is a mix of Merlin @@ -2286,6 +2504,17 @@ ROM_START( starwbcp ) ROM_END +ROM_START( astro ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "mp1133", 0x0000, 0x1000, CRC(bc21109c) SHA1(05a433cce587d5c0c2d28b5fda5f0853ea6726bf) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1400_astro_mpla.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) + ROM_REGION( 557, "maincpu:opla", 0 ) + ROM_LOAD( "tms1400_astro_opla.pla", 0, 557, CRC(eb08957e) SHA1(62ae0d13a1eaafb34f1b27d7df51441b400ccd56) ) +ROM_END + + ROM_START( comp4 ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "tmc0904nl_cp0904a", 0x0000, 0x0400, CRC(6233ee1b) SHA1(738e109b38c97804b4ec52bed80b00a8634ad453) ) @@ -2413,7 +2642,7 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ -CONS( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", GAME_SUPPORTS_SAVE ) CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) @@ -2427,9 +2656,11 @@ CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ide CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", GAME_SUPPORTS_SAVE ) CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (prototype)", GAME_SUPPORTS_SAVE ) +COMP( 1979, astro, 0, 0, astro, astro, driver_device, 0, "Kosmos", "Astro", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) + CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", GAME_SUPPORTS_SAVE ) -CONS( 1979, ssimon, 0, 0, ssimon, ssimon, driver_device, 0, "Milton Bradley", "Super Simon", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) +CONS( 1979, ssimon, 0, 0, ssimon, ssimon, driver_device, 0, "Milton Bradley", "Super Simon", GAME_SUPPORTS_SAVE ) CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) // *** CONS( 1978, merlin, 0, 0, merlin, merlin, driver_device, 0, "Parker Brothers", "Merlin - The Electronic Wizard", GAME_SUPPORTS_SAVE ) diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c index b258c942942..bf7d5cda012 100644 --- a/src/mess/drivers/hh_ucom4.c +++ b/src/mess/drivers/hh_ucom4.c @@ -6,7 +6,7 @@ known chips: - + serial device etc. ---------------------------------------------------------------- @031 uPD553C 1979, Bambino Superstar Football (ET-03) @@ -52,7 +52,7 @@ public: required_device<cpu_device> m_maincpu; optional_ioport_array<5> m_inp_matrix; // max 5 optional_device<speaker_sound_device> m_speaker; - + // misc common UINT8 m_port[9]; // MCU port A-I write data UINT16 m_inp_mux; // multiplexed inputs mask @@ -65,17 +65,18 @@ public: int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns - + UINT32 m_grid; // VFD current row data UINT32 m_plate; // VFD current column data - - UINT32 m_display_state[0x20]; // display matrix rows data + + UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments UINT32 m_display_cache[0x20]; // (internal use) UINT8 m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); + void set_display_size(int maxx, int maxy); void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); // game-specific handlers @@ -95,7 +96,7 @@ public: DECLARE_WRITE8_MEMBER(edracula_grid_w); DECLARE_WRITE8_MEMBER(edracula_plate_w); - + DECLARE_WRITE8_MEMBER(tmtennis_grid_w); DECLARE_WRITE8_MEMBER(tmtennis_plate_w); DECLARE_WRITE8_MEMBER(tmtennis_port_e_w); @@ -107,7 +108,7 @@ public: void tmpacman_display(); DECLARE_WRITE8_MEMBER(tmpacman_grid_w); DECLARE_WRITE8_MEMBER(tmpacman_plate_w); - + DECLARE_WRITE8_MEMBER(alnchase_output_w); DECLARE_READ8_MEMBER(alnchase_input_r); }; @@ -120,7 +121,7 @@ void hh_ucom4_state::machine_start() memset(m_display_cache, ~0, sizeof(m_display_cache)); memset(m_display_decay, 0, sizeof(m_display_decay)); memset(m_display_segmask, 0, sizeof(m_display_segmask)); - + memset(m_port, 0, sizeof(m_port)); m_inp_mux = 0; m_grid = 0; @@ -161,7 +162,7 @@ void hh_ucom4_state::display_update() { active_state[y] = 0; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { // turn on powered segments if (m_display_state[y] >> x & 1) @@ -181,15 +182,25 @@ void hh_ucom4_state::display_update() output_set_digit_value(y, active_state[y] & m_display_segmask[y]); const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) { int state = active_state[y] >> x & 1; - output_set_lamp_value(y * mul + x, state); - - // bit coords for svg2lay - char buf[10]; - sprintf(buf, "%d.%d", y, x); - output_set_value(buf, state); + char buf1[0x10]; // lampyx + char buf2[0x10]; // y.x + + if (x == m_display_maxx) + { + // always-on if selected + sprintf(buf1, "lamp%da", y); + sprintf(buf2, "%d.a", y); + } + else + { + sprintf(buf1, "lamp%d", y * mul + x); + sprintf(buf2, "%d.%d", y, x); + } + output_set_value(buf1, state); + output_set_value(buf2, state); } } @@ -200,23 +211,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(hh_ucom4_state::display_decay_tick) { // slowly turn off unpowered segments for (int y = 0; y < m_display_maxy; y++) - for (int x = 0; x < m_display_maxx; x++) + for (int x = 0; x <= m_display_maxx; x++) if (m_display_decay[y][x] != 0) m_display_decay[y][x]--; - + display_update(); } -void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +void hh_ucom4_state::set_display_size(int maxx, int maxy) { m_display_maxx = maxx; m_display_maxy = maxy; +} + +void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) +{ + set_display_size(maxx, maxy); // update current state UINT32 mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) - m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; - + m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; + display_update(); } @@ -247,7 +263,7 @@ UINT8 hh_ucom4_state::read_inputs(int columns) * PCB label Emix Corp. ET-03 * NEC uCOM-43 MCU, labeled D553C 031 * green VFD display Emix-102 - + Press the Kick button to start the game, an automatic sequence follows. Then choose a formation(A,B,C) and either pass the ball, and/or start running. For more information, refer to the official manual. @@ -259,6 +275,7 @@ UINT8 hh_ucom4_state::read_inputs(int columns) void hh_ucom4_state::ssfball_display() { UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,10,9,8,0,1,2,4,5,6); + display_matrix(16, 9, plate, m_grid); } @@ -274,15 +291,15 @@ WRITE8_MEMBER(hh_ucom4_state::ssfball_grid_w) WRITE8_MEMBER(hh_ucom4_state::ssfball_plate_w) { m_port[offset] = data; - + // E,F,G,H,I(not all!): vfd matrix plate int shift = (offset - NEC_UCOM4_PORTE) * 4; m_plate = (m_plate & ~(0xf << shift)) | (data << shift); - + // F3,G3: input mux + speaker m_inp_mux = (m_port[NEC_UCOM4_PORTF] >> 3 & 1) | (m_port[NEC_UCOM4_PORTG] >> 2 & 2); m_speaker->level_w(m_inp_mux); - + // E3: vfd matrix grid 8 if (offset == NEC_UCOM4_PORTE) ssfball_grid_w(space, offset, data >> 3 & 1); @@ -304,21 +321,21 @@ static INPUT_PORTS_START( ssfball ) PORT_START("IN.1") // G3 port B3 PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_CONFNAME( 0x08, 0x00, DEF_STR( Difficulty ) ) + PORT_CONFNAME( 0x08, 0x00, "Skill Level" ) PORT_CONFSETTING( 0x00, "1" ) PORT_CONFSETTING( 0x08, "2" ) PORT_START("IN.2") // port B - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Kick/Display") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Formation C") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Formation B") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Kick/Display") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Formation C") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Formation B") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) // multiplexed, handled in ssfball_input_b_r PORT_START("IN.3") // port A PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Left/Right") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_UP) PORT_NAME("Up") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Down") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Pass") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Pass") INPUT_PORTS_END @@ -368,6 +385,7 @@ MACHINE_CONFIG_END void hh_ucom4_state::splasfgt_display() { UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,13,1,0,8,6,0,10,11,14,15,16,9,5,7,4,2,3); + display_matrix(16, 9, plate, m_grid); } @@ -376,10 +394,10 @@ WRITE8_MEMBER(hh_ucom4_state::splasfgt_grid_w) // G,H,I0: vfd matrix grid int shift = (offset - NEC_UCOM4_PORTG) * 4; m_grid = (m_grid & ~(0xf << shift)) | (data << shift); - + // G(grid 0-3): input mux m_inp_mux = m_grid & 0xf; - + // I2: vfd matrix plate 6 if (offset == NEC_UCOM4_PORTI) m_plate = (m_plate & 0xffff) | (data << 14 & 0x10000); @@ -392,11 +410,11 @@ WRITE8_MEMBER(hh_ucom4_state::splasfgt_plate_w) // C,D,E,F23: vfd matrix plate int shift = (offset - NEC_UCOM4_PORTC) * 4; m_plate = (m_plate & ~(0xf << shift)) | (data << shift); - + // F01: speaker out if (offset == NEC_UCOM4_PORTF) m_speaker->level_w(data & 3); - + ssfball_display(); } @@ -408,7 +426,7 @@ READ8_MEMBER(hh_ucom4_state::splasfgt_input_b_r) /* physical button layout and labels is like this: - + * left = P1 side * * right = P2 side * (note: in 1P mode, switch sides between turns) [ JUMP ] [ HIGH ] (players sw) [ HIGH ] [ JUMP ] @@ -447,7 +465,7 @@ static INPUT_PORTS_START( splasfgt ) PORT_CONFNAME( 0x01, 0x00, "Players" ) PORT_CONFSETTING( 0x00, "1" ) PORT_CONFSETTING( 0x01, "2" ) - PORT_CONFNAME( 0x02, 0x00, DEF_STR( Difficulty ) ) + PORT_CONFNAME( 0x02, 0x00, "Skill Level" ) PORT_CONFSETTING( 0x00, "1" ) PORT_CONFSETTING( 0x02, "2" ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START ) @@ -505,7 +523,7 @@ MACHINE_CONFIG_END void hh_ucom4_state::astrocmd_display() { - UINT32 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,4,5,6,7,0,1,2,3); + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,4,5,6,7,0,1,2,3); UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,3,2,12,13,14,15,16,17,18,0,1,4,8,5,9,7,11,6,10); display_matrix(17, 9, plate, grid); @@ -530,7 +548,7 @@ WRITE8_MEMBER(hh_ucom4_state::astrocmd_plate_w) { // E2: speaker out m_speaker->level_w(data >> 2 & 1); - + // E3: vfd matrix grid 8 astrocmd_grid_w(space, offset, data >> 3 & 1); } @@ -605,7 +623,7 @@ WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w) int shift = (offset - NEC_UCOM4_PORTC) * 4; m_grid = (m_grid & ~(0xf << shift)) | (data << shift); - display_matrix(18, 8, m_plate, m_grid); + display_matrix(18+1, 8, m_plate, m_grid); } WRITE8_MEMBER(hh_ucom4_state::edracula_plate_w) @@ -719,7 +737,7 @@ READ8_MEMBER(hh_ucom4_state::tmtennis_input_r) /* Pro-Tennis physical button layout and labels is like this: - + * left = P2/CPU side * * right = P1 side * [SERVE] [1] [2] [3] [3] [2] [1] [SERVE] @@ -761,7 +779,7 @@ void hh_ucom4_state::tmtennis_set_clock() // MCU clock is from an LC circuit oscillating by default at ~360kHz, // but on PRO1, the difficulty switch puts a capacitor across the LC circuit // to slow it down to ~260kHz. - m_maincpu->set_unscaled_clock(m_inp_matrix[1]->read() & 0x100 ? 260000 : 360000); + m_maincpu->set_unscaled_clock((m_inp_matrix[1]->read() & 0x100) ? 260000 : 360000); } INPUT_CHANGED_MEMBER(hh_ucom4_state::tmtennis_difficulty_switch) @@ -818,7 +836,7 @@ MACHINE_CONFIG_END - USA: Pac Man - UK: Puckman (Tomy), and also published by Grandstand as Munchman - Australia: Pac Man-1, published by Futuretronics - + The game will start automatically after turning it on. This Pac Man refuses to eat dots with his butt, you can only eat them going right-to-left. @@ -828,10 +846,10 @@ MACHINE_CONFIG_END void hh_ucom4_state::tmpacman_display() { - UINT32 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + UINT16 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15); - - display_matrix(19, 8, plate | 0x100, grid); // plate 8 (maze) is always on + + display_matrix(19, 8, plate, grid); } WRITE8_MEMBER(hh_ucom4_state::tmpacman_grid_w) @@ -930,7 +948,7 @@ WRITE8_MEMBER(hh_ucom4_state::alnchase_output_w) // C0(grid 0): input enable PL1 // D0(grid 4): input enable PL2 m_inp_mux = (m_grid & 1) | (m_grid >> 3 & 2); - + // E1: speaker out if (offset == NEC_UCOM4_PORTE) m_speaker->level_w(data >> 1 & 1); diff --git a/src/mess/drivers/imds2.c b/src/mess/drivers/imds2.c index cf192dd63e8..89de9892f3b 100644 --- a/src/mess/drivers/imds2.c +++ b/src/mess/drivers/imds2.c @@ -73,6 +73,22 @@ // Huge thanks to Dave Mabry for dumping IOC firmware, KB firmware and character generator. This driver would not // exist without his dumps. // (https://web.archive.org/web/20080509062332/http://www.s100-manuals.com/intel/IOC_iMDX_511_Upgrade.zip) +// +// Basic usage / test info: +// To use the system set DIP switches to: +// Floppy present +// IOC mode Diagnostic +// Keyboard present +// and reset the system. The built-in diagnostic mode should start. +// +// Another test is loading ISIS-II (the Intel OS for this system). Floppy image +// 9500007-07_ISIS-II_OPERATING_SYSTEM_DISKETTE_Ver_4.3.IMD +// To load it, the "IOC mode" should be set to "On line", the floppy image +// should be mounted and the system reset. After a few seconds the ISIS-II +// prompt should appear. A command that could be tried is "DIR" that lists +// the content of floppy disk. +// Please note that the message "FAILURE -- PIO NOT RESPONDING" is normal +// as the support for PIO isn't implemented yet #include "includes/imds2.h" @@ -89,543 +105,543 @@ #define IOC_BEEP_FREQ 3300 static ADDRESS_MAP_START(ipc_mem_map , AS_PROGRAM , 8 , imds2_state) - AM_RANGE(0x0000 , 0xffff) AM_READWRITE(ipc_mem_read, ipc_mem_write) + AM_RANGE(0x0000 , 0xffff) AM_READWRITE(ipc_mem_read, ipc_mem_write) ADDRESS_MAP_END static ADDRESS_MAP_START(ipc_io_map , AS_IO , 8 , imds2_state) - ADDRESS_MAP_UNMAP_LOW - AM_RANGE(0xc0 , 0xc0) AM_READWRITE(imds2_ipc_dbbout_r , imds2_ipc_dbbin_data_w) - AM_RANGE(0xc1 , 0xc1) AM_READWRITE(imds2_ipc_status_r , imds2_ipc_dbbin_cmd_w) - AM_RANGE(0xfa , 0xfb) AM_READWRITE(imds2_ipclocpic_r , imds2_ipclocpic_w) - AM_RANGE(0xfc , 0xfd) AM_READWRITE(imds2_ipcsyspic_r , imds2_ipcsyspic_w) - AM_RANGE(0xff , 0xff) AM_WRITE(imds2_ipc_control_w) + ADDRESS_MAP_UNMAP_LOW + AM_RANGE(0xc0 , 0xc0) AM_READWRITE(imds2_ipc_dbbout_r , imds2_ipc_dbbin_data_w) + AM_RANGE(0xc1 , 0xc1) AM_READWRITE(imds2_ipc_status_r , imds2_ipc_dbbin_cmd_w) + AM_RANGE(0xfa , 0xfb) AM_READWRITE(imds2_ipclocpic_r , imds2_ipclocpic_w) + AM_RANGE(0xfc , 0xfd) AM_READWRITE(imds2_ipcsyspic_r , imds2_ipcsyspic_w) + AM_RANGE(0xff , 0xff) AM_WRITE(imds2_ipc_control_w) ADDRESS_MAP_END - static ADDRESS_MAP_START(ioc_mem_map , AS_PROGRAM , 8 , imds2_state) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x0000 , 0x1fff) AM_ROM - AM_RANGE(0x4000 , 0x5fff) AM_RAM + static ADDRESS_MAP_START(ioc_mem_map , AS_PROGRAM , 8 , imds2_state) + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x0000 , 0x1fff) AM_ROM + AM_RANGE(0x4000 , 0x5fff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START(ioc_io_map , AS_IO , 8 , imds2_state) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x00 , 0x0f) AM_WRITE(imds2_ioc_dbbout_w) - AM_RANGE(0x20 , 0x2f) AM_WRITE(imds2_ioc_f0_w) - AM_RANGE(0x30 , 0x3f) AM_WRITE(imds2_ioc_set_f1_w) - AM_RANGE(0x40 , 0x4f) AM_WRITE(imds2_ioc_reset_f1_w) - AM_RANGE(0x50 , 0x5f) AM_WRITE(imds2_start_timer_w) - AM_RANGE(0x60 , 0x6f) AM_WRITE(imds2_miscout_w) - AM_RANGE(0x80 , 0x8f) AM_READ(imds2_miscin_r) - AM_RANGE(0x90 , 0x9f) AM_READ(imds2_kb_read) - AM_RANGE(0xa0 , 0xaf) AM_READ(imds2_ioc_status_r) - AM_RANGE(0xb0 , 0xbf) AM_READ(imds2_ioc_dbbin_r) - AM_RANGE(0xc0 , 0xcf) AM_DEVREADWRITE("iocfdc" , i8271_device , read , write) - AM_RANGE(0xd0 , 0xdf) AM_DEVREADWRITE("ioccrtc" , i8275_device , read , write) - AM_RANGE(0xe0 , 0xef) AM_DEVREADWRITE("ioctimer" , pit8253_device , read , write); + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x00 , 0x0f) AM_WRITE(imds2_ioc_dbbout_w) + AM_RANGE(0x20 , 0x2f) AM_WRITE(imds2_ioc_f0_w) + AM_RANGE(0x30 , 0x3f) AM_WRITE(imds2_ioc_set_f1_w) + AM_RANGE(0x40 , 0x4f) AM_WRITE(imds2_ioc_reset_f1_w) + AM_RANGE(0x50 , 0x5f) AM_WRITE(imds2_start_timer_w) + AM_RANGE(0x60 , 0x6f) AM_WRITE(imds2_miscout_w) + AM_RANGE(0x80 , 0x8f) AM_READ(imds2_miscin_r) + AM_RANGE(0x90 , 0x9f) AM_READ(imds2_kb_read) + AM_RANGE(0xa0 , 0xaf) AM_READ(imds2_ioc_status_r) + AM_RANGE(0xb0 , 0xbf) AM_READ(imds2_ioc_dbbin_r) + AM_RANGE(0xc0 , 0xcf) AM_DEVREADWRITE("iocfdc" , i8271_device , read , write) + AM_RANGE(0xd0 , 0xdf) AM_DEVREADWRITE("ioccrtc" , i8275_device , read , write) + AM_RANGE(0xe0 , 0xef) AM_DEVREADWRITE("ioctimer" , pit8253_device , read , write); // DMA controller range doesn't extend to 0xff because register 0xfd needs to be read as 0xff // This register is used by IOC firmware to detect DMA controller model (either 8237 or 8257) - AM_RANGE(0xf0 , 0xf8) AM_DEVREADWRITE("iocdma" , i8257_device , read , write) + AM_RANGE(0xf0 , 0xf8) AM_DEVREADWRITE("iocdma" , i8257_device , read , write) ADDRESS_MAP_END - + static ADDRESS_MAP_START(kb_io_map , AS_IO , 8 , imds2_state) - AM_RANGE(MCS48_PORT_P1 , MCS48_PORT_P1) AM_WRITE(imds2_kb_port_p1_w) - AM_RANGE(MCS48_PORT_P2 , MCS48_PORT_P2) AM_READ(imds2_kb_port_p2_r) - AM_RANGE(MCS48_PORT_T0 , MCS48_PORT_T0) AM_READ(imds2_kb_port_t0_r) - AM_RANGE(MCS48_PORT_T1 , MCS48_PORT_T1) AM_READ(imds2_kb_port_t1_r) + AM_RANGE(MCS48_PORT_P1 , MCS48_PORT_P1) AM_WRITE(imds2_kb_port_p1_w) + AM_RANGE(MCS48_PORT_P2 , MCS48_PORT_P2) AM_READ(imds2_kb_port_p2_r) + AM_RANGE(MCS48_PORT_T0 , MCS48_PORT_T0) AM_READ(imds2_kb_port_t0_r) + AM_RANGE(MCS48_PORT_T1 , MCS48_PORT_T1) AM_READ(imds2_kb_port_t1_r) ADDRESS_MAP_END - + imds2_state::imds2_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig , type , tag), - m_ipccpu(*this , "ipccpu"), - m_ipcsyspic(*this , "ipcsyspic"), - m_ipclocpic(*this , "ipclocpic"), - m_ioccpu(*this , "ioccpu"), - m_iocdma(*this , "iocdma"), - m_ioccrtc(*this , "ioccrtc"), - m_iocbeep(*this , "iocbeep"), - m_ioctimer(*this , "ioctimer"), - m_iocfdc(*this , "iocfdc"), - m_kbcpu(*this , "kbcpu"), - m_palette(*this , "palette"), - m_gfxdecode(*this, "gfxdecode"), - m_floppy0(*this , FLOPPY_0), - m_io_key0(*this , "KEY0"), - m_io_key1(*this , "KEY1"), - m_io_key2(*this , "KEY2"), - m_io_key3(*this , "KEY3"), - m_io_key4(*this , "KEY4"), - m_io_key5(*this , "KEY5"), - m_io_key6(*this , "KEY6"), - m_io_key7(*this , "KEY7"), - m_ioc_options(*this , "IOC_OPTS") + : driver_device(mconfig , type , tag), + m_ipccpu(*this , "ipccpu"), + m_ipcsyspic(*this , "ipcsyspic"), + m_ipclocpic(*this , "ipclocpic"), + m_ioccpu(*this , "ioccpu"), + m_iocdma(*this , "iocdma"), + m_ioccrtc(*this , "ioccrtc"), + m_iocbeep(*this , "iocbeep"), + m_ioctimer(*this , "ioctimer"), + m_iocfdc(*this , "iocfdc"), + m_kbcpu(*this , "kbcpu"), + m_palette(*this , "palette"), + m_gfxdecode(*this, "gfxdecode"), + m_floppy0(*this , FLOPPY_0), + m_io_key0(*this , "KEY0"), + m_io_key1(*this , "KEY1"), + m_io_key2(*this , "KEY2"), + m_io_key3(*this , "KEY3"), + m_io_key4(*this , "KEY4"), + m_io_key5(*this , "KEY5"), + m_io_key6(*this , "KEY6"), + m_io_key7(*this , "KEY7"), + m_ioc_options(*this , "IOC_OPTS") { } READ8_MEMBER(imds2_state::ipc_mem_read) { - if (imds2_in_ipc_rom(offset)) { - return m_ipc_rom[ (offset & 0x07ff) | ((offset & 0x1000) >> 1) ]; - } else { - return m_ipc_ram[ offset ]; - } + if (imds2_in_ipc_rom(offset)) { + return m_ipc_rom[ (offset & 0x07ff) | ((offset & 0x1000) >> 1) ]; + } else { + return m_ipc_ram[ offset ]; + } } WRITE8_MEMBER(imds2_state::ipc_mem_write) { - if (!imds2_in_ipc_rom(offset)) { - m_ipc_ram[ offset ] = data; - } + if (!imds2_in_ipc_rom(offset)) { + m_ipc_ram[ offset ] = data; + } } WRITE8_MEMBER(imds2_state::imds2_ipc_control_w) { - // See A84, pg 28 of [1] - // b3 is ~(bit to be written) - // b2-b0 is ~(no. of bit to be written) - UINT8 mask = (1U << (~data & 0x07)); + // See A84, pg 28 of [1] + // b3 is ~(bit to be written) + // b2-b0 is ~(no. of bit to be written) + UINT8 mask = (1U << (~data & 0x07)); - if (BIT(data , 3)) { - m_ipc_control &= ~mask; - } else { - m_ipc_control |= mask; - } + if (BIT(data , 3)) { + m_ipc_control &= ~mask; + } else { + m_ipc_control |= mask; + } } WRITE_LINE_MEMBER(imds2_state::imds2_ipc_intr) { - m_ipccpu->set_input_line(I8085_INTR_LINE , (state != 0) && BIT(m_ipc_control , 2)); + m_ipccpu->set_input_line(I8085_INTR_LINE , (state != 0) && BIT(m_ipc_control , 2)); } READ8_MEMBER(imds2_state::imds2_ipcsyspic_r) { - return m_ipcsyspic->read(space , offset == 0); + return m_ipcsyspic->read(space , offset == 0); } READ8_MEMBER(imds2_state::imds2_ipclocpic_r) { - return m_ipclocpic->read(space , offset == 0); + return m_ipclocpic->read(space , offset == 0); } WRITE8_MEMBER(imds2_state::imds2_ipcsyspic_w) { - m_ipcsyspic->write(space , offset == 0 , data); + m_ipcsyspic->write(space , offset == 0 , data); } WRITE8_MEMBER(imds2_state::imds2_ipclocpic_w) { - m_ipclocpic->write(space , offset == 0 , data); + m_ipclocpic->write(space , offset == 0 , data); } WRITE8_MEMBER(imds2_state::imds2_miscout_w) { - m_miscout = data; - imds2_update_beeper(); - // Send INTR to IPC - m_ipclocpic->ir6_w(BIT(m_miscout , 1)); + m_miscout = data; + imds2_update_beeper(); + // Send INTR to IPC + m_ipclocpic->ir6_w(BIT(m_miscout , 1)); } READ8_MEMBER(imds2_state::imds2_miscin_r) { - UINT8 res = m_ioc_options->read(); - return res | ((m_beeper_timer == 0) << 2); + UINT8 res = m_ioc_options->read(); + return res | ((m_beeper_timer == 0) << 2); } WRITE_LINE_MEMBER(imds2_state::imds2_beep_timer_w) { - m_beeper_timer = state; - imds2_update_beeper(); + m_beeper_timer = state; + imds2_update_beeper(); } WRITE8_MEMBER(imds2_state::imds2_start_timer_w) { - // Trigger timer 2 of ioctimer - m_ioctimer->write_gate2(0); - m_ioctimer->write_gate2(1); + // Trigger timer 2 of ioctimer + m_ioctimer->write_gate2(0); + m_ioctimer->write_gate2(1); } READ8_MEMBER(imds2_state::imds2_kb_read) { - return m_kbcpu->upi41_master_r(space , (offset & 2) >> 1); + return m_kbcpu->upi41_master_r(space , (offset & 2) >> 1); } READ8_MEMBER(imds2_state::imds2_kb_port_p2_r) { - if ((m_kb_p1 & 3) == 0) { - // Row selected - // Row number is encoded on bits P15..P12, they are "backwards" (P15 is LSB) and keyboard rows are encoded starting with value 2 on these bits (see A4, pg 56 of [1]) - unsigned row = (m_kb_p1 >> 2) & 0x0f; - ioport_value data; - - switch (row) { - case 4: - // Row 0 - data = m_io_key0->read(); - break; - - case 12: - // Row 1 - data = m_io_key1->read(); - break; - - case 2: - // Row 2 - data = m_io_key2->read(); - break; - - case 10: - // Row 3 - data = m_io_key3->read(); - break; - - case 6: - // Row 4 - data = m_io_key4->read(); - break; - - case 14: - // Row 5 - data = m_io_key5->read(); - break; - - case 1: - // Row 6 - data = m_io_key6->read(); - break; - - case 9: - // Row 7 - data = m_io_key7->read(); - break; - - default: - data = 0xff; - break; - } - return data & 0xff; - } else { - // No row selected - return 0xff; - } + if ((m_kb_p1 & 3) == 0) { + // Row selected + // Row number is encoded on bits P15..P12, they are "backwards" (P15 is LSB) and keyboard rows are encoded starting with value 2 on these bits (see A4, pg 56 of [1]) + unsigned row = (m_kb_p1 >> 2) & 0x0f; + ioport_value data; + + switch (row) { + case 4: + // Row 0 + data = m_io_key0->read(); + break; + + case 12: + // Row 1 + data = m_io_key1->read(); + break; + + case 2: + // Row 2 + data = m_io_key2->read(); + break; + + case 10: + // Row 3 + data = m_io_key3->read(); + break; + + case 6: + // Row 4 + data = m_io_key4->read(); + break; + + case 14: + // Row 5 + data = m_io_key5->read(); + break; + + case 1: + // Row 6 + data = m_io_key6->read(); + break; + + case 9: + // Row 7 + data = m_io_key7->read(); + break; + + default: + data = 0xff; + break; + } + return data & 0xff; + } else { + // No row selected + return 0xff; + } } WRITE8_MEMBER(imds2_state::imds2_kb_port_p1_w) { - m_kb_p1 = data; + m_kb_p1 = data; } READ8_MEMBER(imds2_state::imds2_kb_port_t0_r) { - // T0 tied low - // It appears to be some kind of strapping option on kb hw - return 0; + // T0 tied low + // It appears to be some kind of strapping option on kb hw + return 0; } READ8_MEMBER(imds2_state::imds2_kb_port_t1_r) { - // T1 tied low - // It appears to be some kind of strapping option on kb hw - return 0; + // T1 tied low + // It appears to be some kind of strapping option on kb hw + return 0; } WRITE8_MEMBER(imds2_state::imds2_ioc_dbbout_w) { - m_ioc_obf = ~data; - // Set/reset OBF flag (b0) - m_ipc_ioc_status = ((offset & 1) == 0) | (m_ipc_ioc_status & ~0x01); + m_ioc_obf = ~data; + // Set/reset OBF flag (b0) + m_ipc_ioc_status = ((offset & 1) == 0) | (m_ipc_ioc_status & ~0x01); } WRITE8_MEMBER(imds2_state::imds2_ioc_f0_w) { - // Set/reset F0 flag (b2) - m_ipc_ioc_status = ((offset & 1) << 2) | (m_ipc_ioc_status & ~0x04); + // Set/reset F0 flag (b2) + m_ipc_ioc_status = ((offset & 1) << 2) | (m_ipc_ioc_status & ~0x04); } WRITE8_MEMBER(imds2_state::imds2_ioc_set_f1_w) { - // Set F1 flag (b3) - m_ipc_ioc_status |= 0x08; + // Set F1 flag (b3) + m_ipc_ioc_status |= 0x08; } WRITE8_MEMBER(imds2_state::imds2_ioc_reset_f1_w) { - // Reset F1 flag (b3) - m_ipc_ioc_status &= ~0x08; + // Reset F1 flag (b3) + m_ipc_ioc_status &= ~0x08; } READ8_MEMBER(imds2_state::imds2_ioc_status_r) { - return (~m_ipc_ioc_status & 0x0f) | 0xf0; + return (~m_ipc_ioc_status & 0x0f) | 0xf0; } READ8_MEMBER(imds2_state::imds2_ioc_dbbin_r) { - // Reset IBF flag (b1) - m_ipc_ioc_status &= ~0x02; - return ~m_ioc_ibf; + // Reset IBF flag (b1) + m_ipc_ioc_status &= ~0x02; + return ~m_ioc_ibf; } READ8_MEMBER(imds2_state::imds2_ipc_dbbout_r) { - // Reset OBF flag (b0) - m_ipc_ioc_status &= ~0x01; - return m_ioc_obf; + // Reset OBF flag (b0) + m_ipc_ioc_status &= ~0x01; + return m_ioc_obf; } READ8_MEMBER(imds2_state::imds2_ipc_status_r) { - return m_ipc_ioc_status; + return m_ipc_ioc_status; } WRITE8_MEMBER(imds2_state::imds2_ipc_dbbin_data_w) { - // Set IBF flag (b1) - m_ipc_ioc_status |= 0x02; - // Reset F1 flag (b3) - m_ipc_ioc_status &= ~0x08; - m_ioc_ibf = data; + // Set IBF flag (b1) + m_ipc_ioc_status |= 0x02; + // Reset F1 flag (b3) + m_ipc_ioc_status &= ~0x08; + m_ioc_ibf = data; } WRITE8_MEMBER(imds2_state::imds2_ipc_dbbin_cmd_w) { - // Set IBF flag (b1) - m_ipc_ioc_status |= 0x02; - // Set F1 flag (b3) - m_ipc_ioc_status |= 0x08; - m_ioc_ibf = data; + // Set IBF flag (b1) + m_ipc_ioc_status |= 0x02; + // Set F1 flag (b3) + m_ipc_ioc_status |= 0x08; + m_ioc_ibf = data; } WRITE_LINE_MEMBER(imds2_state::imds2_hrq_w) { - // Should be propagated to HOLD input of IOC CPU - m_iocdma->hlda_w(state); + // Should be propagated to HOLD input of IOC CPU + m_iocdma->hlda_w(state); } READ8_MEMBER(imds2_state::imds2_ioc_mem_r) { - address_space& prog_space = m_ioccpu->space(AS_PROGRAM); - return prog_space.read_byte(offset); + address_space& prog_space = m_ioccpu->space(AS_PROGRAM); + return prog_space.read_byte(offset); } WRITE8_MEMBER(imds2_state::imds2_ioc_mem_w) { - address_space& prog_space = m_ioccpu->space(AS_PROGRAM); - return prog_space.write_byte(offset , data); + address_space& prog_space = m_ioccpu->space(AS_PROGRAM); + return prog_space.write_byte(offset , data); } I8275_DRAW_CHARACTER_MEMBER(imds2_state::crtc_display_pixels) { - unsigned i; - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chargen_byte = m_chargen[ (linecount & 7) | ((unsigned)charcode << 3) ]; - UINT16 pixels; - - if (lten) { - pixels = ~0; - } else if (vsp != 0 || (linecount & 8) != 0) { - pixels = 0; - } else { - // See [2], pg 58 for the very peculiar way of generating character images - // Here each half-pixel is translated into a full pixel - UINT16 exp_pix_l; - UINT16 exp_pix_r; - - exp_pix_l = (UINT16)chargen_byte; - exp_pix_l = ((exp_pix_l & 0x80) << 5) | - ((exp_pix_l & 0x40) << 4) | - ((exp_pix_l & 0x20) << 3) | - ((exp_pix_l & 0x10) << 2) | - ((exp_pix_l & 0x08) << 1) | - (exp_pix_l & 0x04); - exp_pix_l |= (exp_pix_l << 1); - exp_pix_r = exp_pix_l; - - // Layout of exp_pix_l/r: - // Bit # : F E D C B A 9 8 7 6 5 4 3 2 1 0 - // Bit of chargen_byte: 0 0 b7 b7 b6 b6 b5 b5 b4 b4 b3 b3 b2 b2 0 0 - if ((chargen_byte & 2) == 0) { - exp_pix_l >>= 1; - } - exp_pix_l &= 0x3fc0; - - if ((chargen_byte & 1) == 0) { - exp_pix_r >>= 1; - } - exp_pix_r &= 0x003e; - - pixels = exp_pix_l | exp_pix_r; - } - - if (rvv) { - pixels = ~pixels; - } - - for (i = 0; i < 14; i++) { - bitmap.pix32(y, x + i) = palette[ (pixels & (1U << (13 - i))) != 0 ]; - } + unsigned i; + const rgb_t *palette = m_palette->palette()->entry_list_raw(); + UINT8 chargen_byte = m_chargen[ (linecount & 7) | ((unsigned)charcode << 3) ]; + UINT16 pixels; + + if (lten) { + pixels = ~0; + } else if (vsp != 0 || (linecount & 8) != 0) { + pixels = 0; + } else { + // See [2], pg 58 for the very peculiar way of generating character images + // Here each half-pixel is translated into a full pixel + UINT16 exp_pix_l; + UINT16 exp_pix_r; + + exp_pix_l = (UINT16)chargen_byte; + exp_pix_l = ((exp_pix_l & 0x80) << 5) | + ((exp_pix_l & 0x40) << 4) | + ((exp_pix_l & 0x20) << 3) | + ((exp_pix_l & 0x10) << 2) | + ((exp_pix_l & 0x08) << 1) | + (exp_pix_l & 0x04); + exp_pix_l |= (exp_pix_l << 1); + exp_pix_r = exp_pix_l; + + // Layout of exp_pix_l/r: + // Bit # : F E D C B A 9 8 7 6 5 4 3 2 1 0 + // Bit of chargen_byte: 0 0 b7 b7 b6 b6 b5 b5 b4 b4 b3 b3 b2 b2 0 0 + if ((chargen_byte & 2) == 0) { + exp_pix_l >>= 1; + } + exp_pix_l &= 0x3fc0; + + if ((chargen_byte & 1) == 0) { + exp_pix_r >>= 1; + } + exp_pix_r &= 0x003e; + + pixels = exp_pix_l | exp_pix_r; + } + + if (rvv) { + pixels = ~pixels; + } + + for (i = 0; i < 14; i++) { + bitmap.pix32(y, x + i) = palette[ (pixels & (1U << (13 - i))) != 0 ]; + } } void imds2_state::driver_start() { - // Allocate 64k for IPC RAM - m_ipc_ram.resize(0x10000); + // Allocate 64k for IPC RAM + m_ipc_ram.resize(0x10000); - memory_region *ipcrom = memregion("ipcrom"); - if (ipcrom == NULL) { - fatalerror("Unable to find IPC ROM region\n"); - } else { - m_ipc_rom = ipcrom->base(); - } + memory_region *ipcrom = memregion("ipcrom"); + if (ipcrom == NULL) { + fatalerror("Unable to find IPC ROM region\n"); + } else { + m_ipc_rom = ipcrom->base(); + } } void imds2_state::machine_start() { - m_floppy0->floppy_mon_w(0); - m_floppy0->floppy_drive_set_ready_state(1 , 0); + m_floppy0->floppy_mon_w(0); + m_floppy0->floppy_drive_set_ready_state(1 , 0); } void imds2_state::video_start() { - m_chargen = memregion("gfx1")->base(); + m_chargen = memregion("gfx1")->base(); } void imds2_state::machine_reset() { - m_iocbeep->set_frequency(IOC_BEEP_FREQ); - m_ipc_control = 0x00; - m_ipc_ioc_status = 0x0f; + m_iocbeep->set_frequency(IOC_BEEP_FREQ); + m_ipc_control = 0x00; + m_ipc_ioc_status = 0x0f; } bool imds2_state::imds2_in_ipc_rom(offs_t offset) const { - offs_t masked_offset = offset & 0xf800; + offs_t masked_offset = offset & 0xf800; - // Region 0000-07ff is in ROM when START_UP/ == 0 && SEL_BOOT/ == 0 - if (masked_offset == 0x0000 && (m_ipc_control & 0x28) == 0) { - return true; - } + // Region 0000-07ff is in ROM when START_UP/ == 0 && SEL_BOOT/ == 0 + if (masked_offset == 0x0000 && (m_ipc_control & 0x28) == 0) { + return true; + } - // Region e800-efff is in ROM when SEL_BOOT/ == 0 - if (masked_offset == 0xe800 && (m_ipc_control & 0x08) == 0) { - return true; - } + // Region e800-efff is in ROM when SEL_BOOT/ == 0 + if (masked_offset == 0xe800 && (m_ipc_control & 0x08) == 0) { + return true; + } - // Region f800-ffff is always in ROM - if (masked_offset == 0xf800) { - return true; - } + // Region f800-ffff is always in ROM + if (masked_offset == 0xf800) { + return true; + } - return false; + return false; } - + void imds2_state::imds2_update_beeper(void) { - m_iocbeep->set_state(m_beeper_timer == 0 && BIT(m_miscout , 0) == 0); + m_iocbeep->set_state(m_beeper_timer == 0 && BIT(m_miscout , 0) == 0); } static INPUT_PORTS_START(imds2) - // See [1], pg 56 for key matrix layout - // See [1], pg 57 for keyboard layout - PORT_START("KEY0") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`') - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') // ' - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // . - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - - PORT_START("KEY1") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') // OK - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_UNUSED) - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') // OK - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') // OK - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') // OK - - PORT_START("KEY2") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('~') // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') // OK - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') // OK - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') // OK - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') - - PORT_START("KEY3") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') // OK - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // OK - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') // OK - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') // OK - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') // OK - - PORT_START("KEY4") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') // OK - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') // OK - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') // OK - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') // OK - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') // OK - - PORT_START("KEY5") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') // OK - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') // OK - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') // OK - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') // OK - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') // OK - - PORT_START("KEY6") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) // BS - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) // OK - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') // OK - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) // OK - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // OK - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // OK - - PORT_START("KEY7") - PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) // OK - PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // OK - PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('_') PORT_CHAR('^') - PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // OK - PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) // OK - PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) - PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_UNUSED) - PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_UNUSED) - - // Options on IOC: see [1], pg 40 - PORT_START("IOC_OPTS") - PORT_DIPNAME(0x80 , 0x80 , "Keyboard present") - PORT_DIPSETTING(0x80 , DEF_STR(Yes)) - PORT_DIPSETTING(0x00 , DEF_STR(No)) - PORT_DIPNAME(0x28 , 0x00 , "IOC mode") - PORT_DIPSETTING(0x00 , "On line") - PORT_DIPSETTING(0x08 , "Local") - PORT_DIPSETTING(0x20 , "Diagnostic") - PORT_DIPNAME(0x02 , 0x00 , "Floppy present") - PORT_DIPSETTING(0x02 , DEF_STR(Yes)) - PORT_DIPSETTING(0x00 , DEF_STR(No)) - PORT_DIPNAME(0x01 , 0x01 , "CRT frame frequency") - PORT_DIPSETTING(0x01 , "50 Hz") - PORT_DIPSETTING(0x00 , "60 Hz") + // See [1], pg 56 for key matrix layout + // See [1], pg 57 for keyboard layout + PORT_START("KEY0") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`') + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') // ' + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // . + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + + PORT_START("KEY1") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') // OK + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_UNUSED) + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') // OK + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') // OK + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') // OK + + PORT_START("KEY2") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('~') // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') // OK + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') // OK + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') // OK + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + + PORT_START("KEY3") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') // OK + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // OK + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') // OK + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') // OK + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') // OK + + PORT_START("KEY4") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') // OK + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') // OK + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') // OK + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') // OK + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') // OK + + PORT_START("KEY5") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') // OK + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') // OK + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') // OK + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') // OK + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') // OK + + PORT_START("KEY6") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) // BS + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) // OK + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') // OK + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) // OK + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // OK + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // OK + + PORT_START("KEY7") + PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) // OK + PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // OK + PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('_') PORT_CHAR('^') + PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // OK + PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) // OK + PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_UNUSED) + PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_UNUSED) + + // Options on IOC: see [1], pg 40 + PORT_START("IOC_OPTS") + PORT_DIPNAME(0x80 , 0x80 , "Keyboard present") + PORT_DIPSETTING(0x80 , DEF_STR(Yes)) + PORT_DIPSETTING(0x00 , DEF_STR(No)) + PORT_DIPNAME(0x28 , 0x00 , "IOC mode") + PORT_DIPSETTING(0x00 , "On line") + PORT_DIPSETTING(0x08 , "Local") + PORT_DIPSETTING(0x20 , "Diagnostic") + PORT_DIPNAME(0x02 , 0x00 , "Floppy present") + PORT_DIPSETTING(0x02 , DEF_STR(Yes)) + PORT_DIPSETTING(0x00 , DEF_STR(No)) + PORT_DIPNAME(0x01 , 0x01 , "CRT frame frequency") + PORT_DIPSETTING(0x01 , "50 Hz") + PORT_DIPSETTING(0x00 , "60 Hz") INPUT_PORTS_END static GFXLAYOUT_RAW(imds2_charlayout , 8 , 8 , 8 , 64) static GFXDECODE_START(imds2) - GFXDECODE_ENTRY("gfx1" , 0x0000 , imds2_charlayout , 0 , 1) + GFXDECODE_ENTRY("gfx1" , 0x0000 , imds2_charlayout , 0 , 1) GFXDECODE_END static LEGACY_FLOPPY_OPTIONS_START(imds2) @@ -633,106 +649,106 @@ LEGACY_FLOPPY_OPTIONS_END static const floppy_interface imds2_floppy_interface = { - FLOPPY_STANDARD_8_SSSD, - LEGACY_FLOPPY_OPTIONS_NAME(imds2), - "floppy_8" + FLOPPY_STANDARD_8_SSSD, + LEGACY_FLOPPY_OPTIONS_NAME(imds2), + "floppy_8" }; static MACHINE_CONFIG_START(imds2 , imds2_state) - MCFG_CPU_ADD("ipccpu" , I8085A , IPC_XTAL_Y2 / 2) // 4 MHz - MCFG_CPU_PROGRAM_MAP(ipc_mem_map) - MCFG_CPU_IO_MAP(ipc_io_map) - MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("ipcsyspic" , pic8259_device , inta_cb) - MCFG_QUANTUM_TIME(attotime::from_hz(100)) - - MCFG_PIC8259_ADD("ipcsyspic" , WRITELINE(imds2_state , imds2_ipc_intr) , VCC , NULL) - MCFG_PIC8259_ADD("ipclocpic" , DEVWRITELINE("ipcsyspic" , pic8259_device , ir7_w) , VCC , NULL) - - MCFG_CPU_ADD("ioccpu" , I8080A , IOC_XTAL_Y2 / 9) // 2.448 MHz - MCFG_CPU_PROGRAM_MAP(ioc_mem_map) - MCFG_CPU_IO_MAP(ioc_io_map) - MCFG_QUANTUM_TIME(attotime::from_hz(100)) - - // The IOC CRT hw is a bit complex, as the character clock (CCLK) to i8275 - // is varied according to the part of the video frame being scanned and according to - // the 50/60 Hz option jumper (W8). - // The basic clock (BCLK) runs at 22.032 MHz. - // CCLK = BCLK / 14 when in the active region of video - // CCLK = BCLK / 12 when in horizontal retrace (HRTC=1) - // CCLK = BCLK / 10 when in horizontal retrace of "short scan lines" (50 Hz only) - // - // ***** 50 Hz timings ***** - // 80 chars/row, 26 chars/h. retrace, 11 scan lines/row, 25 active rows, 3 vertical retrace rows - // Scan line: 80 chars * 14 BCLK + 26 chars * 12 BCLK = 1432 BCLK (64.996 usec) - // Scan row: 11 * scan lines = 15752 BCLK (714.960 usec) - // "Short" scan line: 80 chars * 14 BCLK + 26 chars * 10 BCLK = 1380 BCLK (62.636 usec) - // Frame: 28 scan rows (8 scan lines of 27th row are short): 27 * scan row + 3 * scan line + 8 * short scan line: 440640 BCLK (20 msec) - // - // ***** 60 Hz timings ***** - // 80 chars/row, 20 chars/h. retrace, 10 scan lines/row, 25 active rows, 2 vertical retrace rows - // Scan line: 80 chars * 14 BCLK + 20 chars * 12 BCLK = 1360 BCLK (61.728 usec) - // Scan row: 10 * scan lines = 13600 BCLK (617.284 usec) - // Frame: 27 scan rows : 367200 BCLK (16.667 msec) - // - // Clock here is semi-bogus: it gives the correct frame frequency at 50 Hz (with the incorrect - // assumption that CCLK is fixed at BCLK / 14) - MCFG_DEVICE_ADD("ioccrtc" , I8275 , 22853600 / 14) - MCFG_I8275_CHARACTER_WIDTH(14) - MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(imds2_state , crtc_display_pixels) - MCFG_I8275_DRQ_CALLBACK(DEVWRITELINE("iocdma" , i8257_device , dreq2_w)) - MCFG_I8275_IRQ_CALLBACK(INPUTLINE("ioccpu" , I8085_INTR_LINE)) - - MCFG_SCREEN_ADD("screen" , RASTER) - MCFG_SCREEN_UPDATE_DEVICE("ioccrtc" , i8275_device , screen_update) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_GFXDECODE_ADD("gfxdecode" , "palette" , imds2) - MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") - - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("iocbeep" , BEEP , 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS , "mono" , 1.00) - - MCFG_DEVICE_ADD("iocdma" , I8257 , IOC_XTAL_Y2 / 9) - MCFG_I8257_OUT_HRQ_CB(WRITELINE(imds2_state, imds2_hrq_w)) - MCFG_I8257_IN_MEMR_CB(READ8(imds2_state , imds2_ioc_mem_r)) - MCFG_I8257_OUT_MEMW_CB(WRITE8(imds2_state , imds2_ioc_mem_w)) - MCFG_I8257_IN_IOR_1_CB(DEVREAD8("iocfdc" , i8271_device , dack_r)) - MCFG_I8257_OUT_IOW_1_CB(DEVWRITE8("iocfdc" , i8271_device , dack_w)) - MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("ioccrtc" , i8275_device , dack_w)) - - MCFG_DEVICE_ADD("ioctimer" , PIT8253 , 0) - MCFG_PIT8253_CLK0(IOC_XTAL_Y1 / 4) - MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("ioctimer" , pit8253_device , write_clk2)); - MCFG_PIT8253_OUT2_HANDLER(WRITELINE(imds2_state , imds2_beep_timer_w)); - - MCFG_DEVICE_ADD("iocfdc" , I8271 , IOC_XTAL_Y1 / 2) - MCFG_I8271_DRQ_CALLBACK(DEVWRITELINE("iocdma" , i8257_device , dreq1_w)) - MCFG_I8271_FLOPPIES(FLOPPY_0 , FLOPPY_1) - - MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, imds2_floppy_interface) - - MCFG_CPU_ADD("kbcpu", I8741, XTAL_3_579545MHz) /* 3.579545 MHz */ - MCFG_CPU_IO_MAP(kb_io_map) - MCFG_QUANTUM_TIME(attotime::from_hz(100)) + MCFG_CPU_ADD("ipccpu" , I8085A , IPC_XTAL_Y2 / 2) // 4 MHz + MCFG_CPU_PROGRAM_MAP(ipc_mem_map) + MCFG_CPU_IO_MAP(ipc_io_map) + MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("ipcsyspic" , pic8259_device , inta_cb) + MCFG_QUANTUM_TIME(attotime::from_hz(100)) + + MCFG_PIC8259_ADD("ipcsyspic" , WRITELINE(imds2_state , imds2_ipc_intr) , VCC , NULL) + MCFG_PIC8259_ADD("ipclocpic" , DEVWRITELINE("ipcsyspic" , pic8259_device , ir7_w) , VCC , NULL) + + MCFG_CPU_ADD("ioccpu" , I8080A , IOC_XTAL_Y2 / 9) // 2.448 MHz + MCFG_CPU_PROGRAM_MAP(ioc_mem_map) + MCFG_CPU_IO_MAP(ioc_io_map) + MCFG_QUANTUM_TIME(attotime::from_hz(100)) + + // The IOC CRT hw is a bit complex, as the character clock (CCLK) to i8275 + // is varied according to the part of the video frame being scanned and according to + // the 50/60 Hz option jumper (W8). + // The basic clock (BCLK) runs at 22.032 MHz. + // CCLK = BCLK / 14 when in the active region of video + // CCLK = BCLK / 12 when in horizontal retrace (HRTC=1) + // CCLK = BCLK / 10 when in horizontal retrace of "short scan lines" (50 Hz only) + // + // ***** 50 Hz timings ***** + // 80 chars/row, 26 chars/h. retrace, 11 scan lines/row, 25 active rows, 3 vertical retrace rows + // Scan line: 80 chars * 14 BCLK + 26 chars * 12 BCLK = 1432 BCLK (64.996 usec) + // Scan row: 11 * scan lines = 15752 BCLK (714.960 usec) + // "Short" scan line: 80 chars * 14 BCLK + 26 chars * 10 BCLK = 1380 BCLK (62.636 usec) + // Frame: 28 scan rows (8 scan lines of 27th row are short): 27 * scan row + 3 * scan line + 8 * short scan line: 440640 BCLK (20 msec) + // + // ***** 60 Hz timings ***** + // 80 chars/row, 20 chars/h. retrace, 10 scan lines/row, 25 active rows, 2 vertical retrace rows + // Scan line: 80 chars * 14 BCLK + 20 chars * 12 BCLK = 1360 BCLK (61.728 usec) + // Scan row: 10 * scan lines = 13600 BCLK (617.284 usec) + // Frame: 27 scan rows : 367200 BCLK (16.667 msec) + // + // Clock here is semi-bogus: it gives the correct frame frequency at 50 Hz (with the incorrect + // assumption that CCLK is fixed at BCLK / 14) + MCFG_DEVICE_ADD("ioccrtc" , I8275 , 22853600 / 14) + MCFG_I8275_CHARACTER_WIDTH(14) + MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(imds2_state , crtc_display_pixels) + MCFG_I8275_DRQ_CALLBACK(DEVWRITELINE("iocdma" , i8257_device , dreq2_w)) + MCFG_I8275_IRQ_CALLBACK(INPUTLINE("ioccpu" , I8085_INTR_LINE)) + + MCFG_SCREEN_ADD("screen" , RASTER) + MCFG_SCREEN_UPDATE_DEVICE("ioccrtc" , i8275_device , screen_update) + MCFG_SCREEN_REFRESH_RATE(50) + MCFG_GFXDECODE_ADD("gfxdecode" , "palette" , imds2) + MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") + + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("iocbeep" , BEEP , 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS , "mono" , 1.00) + + MCFG_DEVICE_ADD("iocdma" , I8257 , IOC_XTAL_Y2 / 9) + MCFG_I8257_OUT_HRQ_CB(WRITELINE(imds2_state, imds2_hrq_w)) + MCFG_I8257_IN_MEMR_CB(READ8(imds2_state , imds2_ioc_mem_r)) + MCFG_I8257_OUT_MEMW_CB(WRITE8(imds2_state , imds2_ioc_mem_w)) + MCFG_I8257_IN_IOR_1_CB(DEVREAD8("iocfdc" , i8271_device , dack_r)) + MCFG_I8257_OUT_IOW_1_CB(DEVWRITE8("iocfdc" , i8271_device , dack_w)) + MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("ioccrtc" , i8275_device , dack_w)) + + MCFG_DEVICE_ADD("ioctimer" , PIT8253 , 0) + MCFG_PIT8253_CLK0(IOC_XTAL_Y1 / 4) + MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("ioctimer" , pit8253_device , write_clk2)); + MCFG_PIT8253_OUT2_HANDLER(WRITELINE(imds2_state , imds2_beep_timer_w)); + + MCFG_DEVICE_ADD("iocfdc" , I8271 , IOC_XTAL_Y1 / 2) + MCFG_I8271_DRQ_CALLBACK(DEVWRITELINE("iocdma" , i8257_device , dreq1_w)) + MCFG_I8271_FLOPPIES(FLOPPY_0 , FLOPPY_1) + + MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, imds2_floppy_interface) + + MCFG_CPU_ADD("kbcpu", I8741, XTAL_3_579545MHz) /* 3.579545 MHz */ + MCFG_CPU_IO_MAP(kb_io_map) + MCFG_QUANTUM_TIME(attotime::from_hz(100)) MACHINE_CONFIG_END ROM_START(imds2) - // ROM definition of IPC cpu (8085A) - ROM_REGION(0x1000 , "ipcrom" , 0) - ROM_LOAD("ipc_a82.bin" , 0x0000 , 0x1000 , CRC(0889394f) SHA1(b7525baf1884a7d67402dea4b5566016a9861ef2)) - - // ROM definition of IOC cpu (8080A) - ROM_REGION(0x2000 , "ioccpu" , 0) - ROM_LOAD("ioc_a50.bin" , 0x0000 , 0x0800 , CRC(d9f926a1) SHA1(bd9d0f7458acc2806120a6dbaab9c48be315b060)) - ROM_LOAD("ioc_a51.bin" , 0x0800 , 0x0800 , CRC(6aa2f86c) SHA1(d3a5314d86e3366545b4c97b29e323dfab383d5f)) - ROM_LOAD("ioc_a52.bin" , 0x1000 , 0x0800 , CRC(b88a38d5) SHA1(934716a1daec852f4d1f846510f42408df0c9584)) - ROM_LOAD("ioc_a53.bin" , 0x1800 , 0x0800 , CRC(c8df4bb9) SHA1(2dfb921e94ae7033a7182457b2f00657674d1b77)) - // ROM definition of keyboard controller (8741) - ROM_REGION(0x400 , "kbcpu" , 0) - ROM_LOAD("kbd511.bin" , 0 , 0x400 , CRC(ba7c4303) SHA1(19899af732d0ae1247bfc79979b1ee5f339ee5cf)) - // ROM definition of character generator (2708, A19 on IOC) - ROM_REGION(0x400 , "gfx1" , 0) - ROM_LOAD ("ioc_a19.bin" , 0x0000 , 0x0400 , CRC(47487d0f) SHA1(0ed98f9f06622949ee3cc2ffc572fb9702db0f81)) + // ROM definition of IPC cpu (8085A) + ROM_REGION(0x1000 , "ipcrom" , 0) + ROM_LOAD("ipc_a82.bin" , 0x0000 , 0x1000 , CRC(0889394f) SHA1(b7525baf1884a7d67402dea4b5566016a9861ef2)) + + // ROM definition of IOC cpu (8080A) + ROM_REGION(0x2000 , "ioccpu" , 0) + ROM_LOAD("ioc_a50.bin" , 0x0000 , 0x0800 , CRC(d9f926a1) SHA1(bd9d0f7458acc2806120a6dbaab9c48be315b060)) + ROM_LOAD("ioc_a51.bin" , 0x0800 , 0x0800 , CRC(6aa2f86c) SHA1(d3a5314d86e3366545b4c97b29e323dfab383d5f)) + ROM_LOAD("ioc_a52.bin" , 0x1000 , 0x0800 , CRC(b88a38d5) SHA1(934716a1daec852f4d1f846510f42408df0c9584)) + ROM_LOAD("ioc_a53.bin" , 0x1800 , 0x0800 , CRC(c8df4bb9) SHA1(2dfb921e94ae7033a7182457b2f00657674d1b77)) + // ROM definition of keyboard controller (8741) + ROM_REGION(0x400 , "kbcpu" , 0) + ROM_LOAD("kbd511.bin" , 0 , 0x400 , CRC(ba7c4303) SHA1(19899af732d0ae1247bfc79979b1ee5f339ee5cf)) + // ROM definition of character generator (2708, A19 on IOC) + ROM_REGION(0x400 , "gfx1" , 0) + ROM_LOAD ("ioc_a19.bin" , 0x0000 , 0x0400 , CRC(47487d0f) SHA1(0ed98f9f06622949ee3cc2ffc572fb9702db0f81)) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ diff --git a/src/mess/drivers/mbdtower.c b/src/mess/drivers/mbdtower.c index 802db8e59dd..70aa569678a 100644 --- a/src/mess/drivers/mbdtower.c +++ b/src/mess/drivers/mbdtower.c @@ -14,7 +14,7 @@ The emulated part is the centerpiece, a black tower with a rotating card panel and LED digits for displaying health, amount of gold, etc. As far as MESS is concerned, the game works fine. - + To start up the game, first press [MOVE], the machine now does a self-test. Then select level and number of players and the game will start. Read the official manual on how to play the game. @@ -61,10 +61,9 @@ protected: void mbdtower_state::mbdtower_display() { // declare display matrix size and the 2 7segs - m_display_maxx = 7; - m_display_maxy = 3; + set_display_size(7, 3); m_display_segmask[1] = m_display_segmask[2] = 0x7f; - + // update current state if (~m_r & 0x10) { @@ -89,10 +88,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(mbdtower_state::motor_sim_tick) if (m_motor_on) { m_motor_pos = (m_motor_pos - 1) & 0x7f; - + // give it some time to spin out when it's turned off if (m_r & 0x200) - m_motor_decay += (m_motor_decay < 6); + m_motor_decay += (m_motor_decay < 4); else if (m_motor_decay > 0) m_motor_decay--; else @@ -105,23 +104,23 @@ TIMER_DEVICE_CALLBACK_MEMBER(mbdtower_state::motor_sim_tick) m_sensor_blind = false; else m_sensor_blind = true; - + // on change, output info if (m_motor_pos != m_motor_pos_prev) output_set_value("motor_pos", 100 * (m_motor_pos / (float)0x80)); - + /* 3 display cards per hole, like this: - - (0) <---- display increments this way <---- (7) - VICTORY WIZARD DRAGON GOLD KEY SCOUT WARRIOR (void) CURSED - WARRIORS BAZAAR CLOSED SWORD SILVER KEY HEALER FOOD (void) LOST - BRIGANDS KEY MISSING PEGASUS BRASS KEY GOLD BEAST (void) PLAGUE + (0) <---- display increments this way <---- (7) + + CURSED VICTORY WIZARD DRAGON GOLD KEY SCOUT WARRIOR (void) + LOST WARRIORS BAZAAR CLOSED SWORD SILVER KEY HEALER FOOD (void) + PLAGUE BRIGANDS KEY MISSING PEGASUS BRASS KEY GOLD BEAST (void) */ int card_pos = m_motor_pos >> 4 & 7; if (card_pos != (m_motor_pos_prev >> 4 & 7)) output_set_value("card_pos", card_pos); - + m_motor_pos_prev = m_motor_pos; } @@ -137,7 +136,7 @@ WRITE16_MEMBER(mbdtower_state::write_r) { // R0-R2: input mux m_inp_mux = data & 7; - + // R9: motor on if ((m_r ^ data) & 0x200) output_set_value("motor_on", data >> 9 & 1); @@ -150,7 +149,7 @@ WRITE16_MEMBER(mbdtower_state::write_r) // R8: rotation sensor led m_r = data; mbdtower_display(); - + // R10: speaker out m_speaker->level_w(~data >> 4 & data >> 10 & 1); } @@ -182,14 +181,14 @@ READ8_MEMBER(mbdtower_state::read_k) (green) (l.blue) (red) [YES/ [REPEAT] [NO/ BUY] END] - + (yellow) (blue) (white) [HAGGLE] [BAZAAR] [CLEAR] - + (blue) (blue) (blue) [TOMB/ [MOVE] [SANCTUARY/ RUIN] CITADEL] - + (orange) (blue) (d.yellow) [DARK [FRONTIER] [INVENTORY] TOWER] @@ -233,7 +232,7 @@ void mbdtower_state::machine_start() m_motor_decay = 0; m_motor_on = false; m_sensor_blind = false; - + save_item(NAME(m_motor_pos)); /* save_item(NAME(m_motor_pos_prev)); */ // don't save! save_item(NAME(m_motor_decay)); @@ -281,4 +280,4 @@ ROM_START( mbdtower ) ROM_END -CONS( 1981, mbdtower, 0, 0, mbdtower, mbdtower, driver_device, 0, "Milton Bradley", "Dark Tower (Milton Bradley)", GAME_SUPPORTS_SAVE | GAME_MECHANICAL | GAME_NOT_WORKING ) +CONS( 1981, mbdtower, 0, 0, mbdtower, mbdtower, driver_device, 0, "Milton Bradley", "Dark Tower (Milton Bradley)", GAME_SUPPORTS_SAVE | GAME_MECHANICAL ) diff --git a/src/mess/drivers/mpf1.c b/src/mess/drivers/mpf1.c index d4231678325..583eddf0e3f 100644 --- a/src/mess/drivers/mpf1.c +++ b/src/mess/drivers/mpf1.c @@ -12,6 +12,26 @@ /* + Keys: + 0-9,A-F : hexadecimal numbers + ADR : enter an address to work with. After the 4 digits are entered, + the data at that address shows, and you can modify the data. + + : Enter the data into memory, and increment the address by 1. + GO : execute the program located at the current address. + + Pasting: + 0-F : as is + + : ^ + - : V + ADDR : - + DATA : = + GO : X + PC : P + + Test Paste: + -1800=11^22^33^44^55^66^77^88^99^-1800 + Now press up-arrow to confirm the data has been entered. + TODO: - remove halt callback @@ -19,6 +39,10 @@ - speech board - printers - clickable artwork + - video board (has 6845) + - mpf1p has 49-key keyboard + - computer can't keep up with paste + - paste only set up for mpf1 */ @@ -33,7 +57,6 @@ static ADDRESS_MAP_START( mpf1_map, AS_PROGRAM, 8, mpf1_state ) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x0000, 0x0fff) AM_ROM AM_RANGE(0x1800, 0x1fff) AM_RAM - AM_RANGE(0x2000, 0x2fff) AM_ROM ADDRESS_MAP_END static ADDRESS_MAP_START( mpf1b_map, AS_PROGRAM, 8, mpf1_state ) @@ -87,53 +110,58 @@ INPUT_CHANGED_MEMBER( mpf1_state::trigger_irq ) m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? CLEAR_LINE : ASSERT_LINE); } +INPUT_CHANGED_MEMBER( mpf1_state::trigger_res ) +{ + m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); +} + static INPUT_PORTS_START( mpf1 ) PORT_START("PC0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3 HL") PORT_CODE(KEYCODE_3) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7 HL'") PORT_CODE(KEYCODE_7) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B I*IF") PORT_CODE(KEYCODE_B) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F *PNC'") PORT_CODE(KEYCODE_F) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3 HL") PORT_CODE(KEYCODE_3) PORT_CHAR('3') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7 HL'") PORT_CODE(KEYCODE_7) PORT_CHAR('7') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B I*IF") PORT_CODE(KEYCODE_B) PORT_CHAR('B') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F *PNC'") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2 DE") PORT_CODE(KEYCODE_2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6 DE'") PORT_CODE(KEYCODE_6) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A SP") PORT_CODE(KEYCODE_A) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E SZ*H'") PORT_CODE(KEYCODE_E) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2 DE") PORT_CODE(KEYCODE_2) PORT_CHAR('2') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6 DE'") PORT_CODE(KEYCODE_6) PORT_CHAR('6') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A SP") PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E SZ*H'") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1 BC") PORT_CODE(KEYCODE_1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5 BC'") PORT_CODE(KEYCODE_5) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9 IY") PORT_CODE(KEYCODE_9) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D *PNC") PORT_CODE(KEYCODE_D) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1 BC") PORT_CODE(KEYCODE_1) PORT_CHAR('1') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5 BC'") PORT_CODE(KEYCODE_5) PORT_CHAR('5') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9 IY") PORT_CODE(KEYCODE_9) PORT_CHAR('9') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D *PNC") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("STEP") PORT_CODE(KEYCODE_F1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAPE RD") PORT_CODE(KEYCODE_F5) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0 AF") PORT_CODE(KEYCODE_0) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4 AF'") PORT_CODE(KEYCODE_4) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8 IX") PORT_CODE(KEYCODE_8) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C SZ*H") PORT_CODE(KEYCODE_C) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GO") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0 AF") PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4 AF'") PORT_CODE(KEYCODE_4) PORT_CHAR('4') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8 IX") PORT_CODE(KEYCODE_8) PORT_CHAR('8') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C SZ*H") PORT_CODE(KEYCODE_C) PORT_CHAR('C') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GO") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAPE WR") PORT_CODE(KEYCODE_F6) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CBR") PORT_CODE(KEYCODE_N) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PC") PORT_CODE(KEYCODE_M) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PC") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("REG") PORT_CODE(KEYCODE_COMMA) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ADDR") PORT_CODE(KEYCODE_STOP) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ADDR") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DEL") PORT_CODE(KEYCODE_SLASH) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RELA") PORT_CODE(KEYCODE_RCONTROL) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SBR") PORT_CODE(KEYCODE_H) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_J) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DATA") PORT_CODE(KEYCODE_K) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("+") PORT_CODE(KEYCODE_L) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_DOWN) PORT_CHAR('V') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DATA") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("+") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INS") PORT_CODE(KEYCODE_COLON) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MOVE") PORT_CODE(KEYCODE_QUOTE) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -142,38 +170,39 @@ static INPUT_PORTS_START( mpf1 ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("USER KEY") PORT_CODE(KEYCODE_U) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MONI") PORT_CODE(KEYCODE_M) PORT_CHANGED_MEMBER(DEVICE_SELF, mpf1_state, trigger_nmi, 0) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INTR") PORT_CODE(KEYCODE_I) PORT_CHANGED_MEMBER(DEVICE_SELF, mpf1_state, trigger_irq, 0) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESET") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, mpf1_state, trigger_res, 0) INPUT_PORTS_END static INPUT_PORTS_START( mpf1b ) PORT_START("PC0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3 /") PORT_CODE(KEYCODE_3) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7 >") PORT_CODE(KEYCODE_7) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B STOP") PORT_CODE(KEYCODE_B) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F LET") PORT_CODE(KEYCODE_F) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3 /") PORT_CODE(KEYCODE_3) PORT_CHAR('3') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7 >") PORT_CODE(KEYCODE_7) PORT_CHAR('7') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B STOP") PORT_CODE(KEYCODE_B) PORT_CHAR('B') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F LET") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2 *") PORT_CODE(KEYCODE_2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6 <") PORT_CODE(KEYCODE_6) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A CALL") PORT_CODE(KEYCODE_A) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E INPUT") PORT_CODE(KEYCODE_E) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2 *") PORT_CODE(KEYCODE_2) PORT_CHAR('2') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6 <") PORT_CODE(KEYCODE_6) PORT_CHAR('6') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A CALL") PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E INPUT") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1 -") PORT_CODE(KEYCODE_1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5 =") PORT_CODE(KEYCODE_5) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9 P") PORT_CODE(KEYCODE_9) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D PRINT") PORT_CODE(KEYCODE_D) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1 -") PORT_CODE(KEYCODE_1) PORT_CHAR('1') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5 =") PORT_CODE(KEYCODE_5) PORT_CHAR('5') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9 P") PORT_CODE(KEYCODE_9) PORT_CHAR('9') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D PRINT") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CONT") PORT_CODE(KEYCODE_F1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOAD") PORT_CODE(KEYCODE_F5) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PC3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0 +") PORT_CODE(KEYCODE_0) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4 * *") PORT_CODE(KEYCODE_4) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8 M") PORT_CODE(KEYCODE_8) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C NEXT") PORT_CODE(KEYCODE_C) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUN") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0 +") PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4 * *") PORT_CODE(KEYCODE_4) PORT_CHAR('4') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8 M") PORT_CODE(KEYCODE_8) PORT_CHAR('8') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C NEXT") PORT_CODE(KEYCODE_C) PORT_CHAR('C') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUN") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SAVE") PORT_CODE(KEYCODE_F6) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -199,6 +228,7 @@ static INPUT_PORTS_START( mpf1b ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MONI") PORT_CODE(KEYCODE_M) PORT_CHANGED_MEMBER(DEVICE_SELF, mpf1_state, trigger_nmi, 0) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INTR") PORT_CODE(KEYCODE_I) PORT_CHANGED_MEMBER(DEVICE_SELF, mpf1_state, trigger_irq, 0) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESET") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, mpf1_state, trigger_res, 0) INPUT_PORTS_END /* Intel 8255A Interface */ @@ -229,7 +259,7 @@ READ8_MEMBER( mpf1_state::ppi_pa_r ) data &= m_special->read() & 1 ? 0xff : 0xbf; /* bit 7, tape input */ - data |= ((m_cassette)->input() > 0 ? 1 : 0) << 7; + data |= ((m_cassette)->input() > 0) ? 0x80 : 0; return data; } @@ -261,7 +291,7 @@ WRITE8_MEMBER( mpf1_state::ppi_pc_w ) /* bit 7, tape output, tone and led */ set_led_status(machine(), 0, !BIT(data, 7)); m_speaker->level_w(BIT(data, 7)); - m_cassette->output( BIT(data, 7)); + m_cassette->output( BIT(data, 7) ? 1.0 : -1.0); } /* Z80 Daisy Chain */ @@ -420,7 +450,7 @@ ROM_END ROM_START( mpf1p ) ROM_REGION( 0x10000, Z80_TAG, 0 ) - ROM_LOAD( "mpf1pmon.bin", 0x0000, 0x2000, CRC(91ace7d3) SHA1(22e3c16a81ac09f37741ad1b526a4456b2ba9493) ) + ROM_LOAD( "mpf1pmon.bin", 0x0000, 0x2000, BAD_DUMP CRC(91ace7d3) SHA1(22e3c16a81ac09f37741ad1b526a4456b2ba9493) ) // A9 stuck low when dumped ROM_LOAD( "prt-mpf-ip.u5", 0x6000, 0x1000, CRC(4dd2a4eb) SHA1(6a3e7daa7834d67fd572261ed4a9a62c4594fe3f) ) ROM_END @@ -438,7 +468,7 @@ DIRECT_UPDATE_MEMBER(mpf1_state::mpf1_direct_update_handler) } } - return 0; + return address; } DRIVER_INIT_MEMBER(mpf1_state,mpf1) diff --git a/src/mess/drivers/n64.c b/src/mess/drivers/n64.c index a25a2780689..2c05e376674 100644 --- a/src/mess/drivers/n64.c +++ b/src/mess/drivers/n64.c @@ -16,6 +16,7 @@ #include "includes/n64.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" +#include "imagedev/snapquik.h" class n64_mess_state : public n64_state { @@ -29,6 +30,8 @@ public: INTERRUPT_GEN_MEMBER(n64_reset_poll); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(n64_cart); void mempak_format(UINT8* pak); + int quickload(device_image_interface &image, const char *file_type, int quickload_size); + DECLARE_QUICKLOAD_LOAD_MEMBER( n64dd ); }; READ32_MEMBER(n64_mess_state::dd_null_r) @@ -254,7 +257,7 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) MACHINE_START_MEMBER(n64_mess_state,n64dd) { machine_start(); - + machine().device<n64_periphs>("rcp")->dd_present = true; UINT8 *ipl = memregion("ddipl")->base(); for (int i = 0; i < 0x400000; i += 4) @@ -270,6 +273,20 @@ MACHINE_START_MEMBER(n64_mess_state,n64dd) } } +QUICKLOAD_LOAD_MEMBER(n64_mess_state,n64dd) +{ + return quickload(image, file_type, quickload_size); +} + +int n64_mess_state::quickload(device_image_interface &image, const char *file_type, int quickload_size) +{ + image.fseek(0, SEEK_SET); + image.fread(memregion("disk")->base(), quickload_size); + machine().device<n64_periphs>("rcp")->disk_present = true; + return IMAGE_INIT_PASS; +} + + INTERRUPT_GEN_MEMBER(n64_mess_state::n64_reset_poll) { n64_periphs *periphs = machine().device<n64_periphs>("rcp"); @@ -322,7 +339,7 @@ static MACHINE_CONFIG_START( n64, n64_mess_state ) MCFG_GENERIC_LOAD(n64_mess_state, n64_cart) /* software lists */ - MCFG_SOFTWARE_LIST_ADD("cart_list","n64") + MCFG_SOFTWARE_LIST_ADD("cart_list", "n64") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( n64dd, n64 ) @@ -336,6 +353,10 @@ static MACHINE_CONFIG_DERIVED( n64dd, n64 ) MCFG_GENERIC_EXTENSIONS("v64,z64,rom,n64,bin") MCFG_GENERIC_LOAD(n64_mess_state, n64_cart) + MCFG_QUICKLOAD_ADD("quickload", n64_mess_state, n64dd, "bin,dsk", 0) + MCFG_QUICKLOAD_INTERFACE("n64dd_disk") + + MCFG_SOFTWARE_LIST_ADD("dd_list", "n64dd") MACHINE_CONFIG_END ROM_START( n64 ) @@ -364,6 +385,8 @@ ROM_START( n64dd ) ROM_REGION32_BE( 0x400000, "ddipl", ROMREGION_ERASEFF) ROM_LOAD( "64ddipl.bin", 0x000000, 0x400000, CRC(7f933ce2) SHA1(bf861922dcb78c316360e3e742f4f70ff63c9bc3) ) + ROM_REGION32_LE( 0x4400000, "disk", ROMREGION_ERASEFF) + ROM_REGION16_BE( 0x80, "normpoint", 0 ) ROM_LOAD( "normpnt.rom", 0x00, 0x80, CRC(e7f2a005) SHA1(c27b4a364a24daeee6e99fd286753fd6216362b4) ) diff --git a/src/mess/drivers/ngen.c b/src/mess/drivers/ngen.c index fe3114b0bee..f89bb6366d9 100644 --- a/src/mess/drivers/ngen.c +++ b/src/mess/drivers/ngen.c @@ -129,7 +129,7 @@ public: DECLARE_WRITE8_MEMBER( dma_3_dack_w ){ popmessage("IOW3: data %02x",data); } DECLARE_WRITE16_MEMBER(hfd_w); - DECLARE_READ16_MEMBER(fhd_r); + DECLARE_READ16_MEMBER(hfd_r); DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); DECLARE_WRITE8_MEMBER(fdc_control_w); @@ -429,7 +429,7 @@ WRITE16_MEMBER(ngen_state::xbus_w) switch(m_xbus_current) { case 0x00: // Floppy/Hard disk module - io.install_readwrite_handler(addr,addr+0xff,0,0,read16_delegate(FUNC(ngen_state::fhd_r),this),write16_delegate(FUNC(ngen_state::hfd_w),this)); + io.install_readwrite_handler(addr,addr+0xff,read16_delegate(FUNC(ngen_state::hfd_r),this),write16_delegate(FUNC(ngen_state::hfd_w),this),0xffffffff); break; default: cpu->set_input_line(INPUT_LINE_NMI,PULSE_LINE); // reached end of the modules @@ -526,7 +526,7 @@ WRITE16_MEMBER(ngen_state::hfd_w) } } -READ16_MEMBER(ngen_state::fhd_r) +READ16_MEMBER(ngen_state::hfd_r) { UINT16 ret = 0xffff; diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c index 99af5b8e920..cd9c2e54f3d 100644 --- a/src/mess/drivers/pc88va.c +++ b/src/mess/drivers/pc88va.c @@ -34,7 +34,9 @@ #include "machine/upd765.h" #include "sound/2203intf.h" #include "formats/xdf_dsk.h" -#include "machine/upd71071.h" +//#include "machine/upd71071.h" +#include "machine/am9517a.h" + /* Note: for the time being, just disable FDC CPU, it's for PC-8801 compatibility mode anyway ... */ #define TEST_SUBFDC 0 @@ -79,7 +81,7 @@ public: required_device<cpu_device> m_maincpu; required_device<upd765a_device> m_fdc; - required_device<upd71071_device> m_dmac; + required_device<am9517a_device> m_dmac; required_shared_ptr<UINT16> m_palram; UINT16 m_bank_reg; UINT16 m_screen_ctrl_reg; @@ -158,8 +160,8 @@ public: // void m_fdc_dma_w(UINT16 data); DECLARE_WRITE_LINE_MEMBER(pc88va_hlda_w); DECLARE_WRITE_LINE_MEMBER(pc88va_tc_w); - DECLARE_READ16_MEMBER(fdc_dma_r); - DECLARE_WRITE16_MEMBER(fdc_dma_w); + DECLARE_READ8_MEMBER(fdc_dma_r); + DECLARE_WRITE8_MEMBER(fdc_dma_w); DECLARE_WRITE_LINE_MEMBER(fdc_irq); DECLARE_WRITE_LINE_MEMBER(fdc_drq); @@ -1146,7 +1148,7 @@ WRITE8_MEMBER(pc88va_state::pc88va_fdc_w) timer_set(attotime::from_msec(100), TIMER_PC88VA_FDC_TIMER); if((m_fdc_ctrl_2 & 0x10) != (data & 0x10)) - m_dmac->dmarq(1, 2); + m_dmac->dreq2_w(1); if(data & 0x80) // correct? machine().device<upd765a_device>("upd765")->reset(); @@ -1283,7 +1285,7 @@ static ADDRESS_MAP_START( pc88va_io_map, AS_IO, 16, pc88va_state ) AM_RANGE(0x0156, 0x0157) AM_READ8(rom_bank_r,0x00ff) // ROM bank status // AM_RANGE(0x0158, 0x0159) Interruption Mode Modification // AM_RANGE(0x015c, 0x015f) NMI mask port (strobe port) - AM_RANGE(0x0160, 0x016f) AM_DEVREADWRITE8("dmac", upd71071_device, read, write, 0xffff) // DMA Controller + AM_RANGE(0x0160, 0x016f) AM_DEVREADWRITE8("dmac", am9517a_device, read, write, 0xffff) // DMA Controller AM_RANGE(0x0184, 0x0187) AM_DEVREADWRITE8("pic8259_slave", pic8259_device, read, write, 0x00ff) AM_RANGE(0x0188, 0x018b) AM_DEVREADWRITE8("pic8259_master", pic8259_device, read, write, 0x00ff) // ICU, also controls 8214 emulation // AM_RANGE(0x0190, 0x0191) System Port 5 @@ -1704,7 +1706,7 @@ WRITE_LINE_MEMBER(pc88va_state::pc88va_pit_out0_changed) WRITE_LINE_MEMBER( pc88va_state::fdc_drq ) { printf("%02x DRQ\n",state); - m_dmac->dmarq(state, 2); + m_dmac->dreq2_w(state); } WRITE_LINE_MEMBER( pc88va_state::fdc_irq ) @@ -1723,9 +1725,9 @@ WRITE_LINE_MEMBER( pc88va_state::fdc_irq ) WRITE_LINE_MEMBER(pc88va_state::pc88va_hlda_w) { - m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); +// m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); -// m_dmac->hack_w(state); + m_dmac->hack_w(state); // printf("%02x HLDA\n",state); } @@ -1739,13 +1741,13 @@ WRITE_LINE_MEMBER( pc88va_state::pc88va_tc_w ) } -READ16_MEMBER(pc88va_state::fdc_dma_r) +READ8_MEMBER(pc88va_state::fdc_dma_r) { printf("R DMA\n"); return m_fdc->dma_r(); } -WRITE16_MEMBER(pc88va_state::fdc_dma_w) +WRITE8_MEMBER(pc88va_state::fdc_dma_w) { printf("W DMA %08x\n",data); m_fdc->dma_w(data); @@ -1809,14 +1811,13 @@ static MACHINE_CONFIG_START( pc88va, pc88va_state ) MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NULL ) - MCFG_DEVICE_ADD("dmac", UPD71071, 0) /* ch2 is FDC, ch0/3 are "user". ch1 is unused */ - MCFG_UPD71071_CPU("maincpu") - MCFG_UPD71071_CLOCK(8000000) - MCFG_UPD71071_OUT_HREQ_CB(WRITELINE(pc88va_state, pc88va_hlda_w)) - MCFG_UPD71071_OUT_EOP_CB(WRITELINE(pc88va_state, pc88va_tc_w)) - MCFG_UPD71071_DMA_READ_2_CB(READ16(pc88va_state, fdc_dma_r)) - MCFG_UPD71071_DMA_WRITE_2_CB(WRITE16(pc88va_state, fdc_dma_w)) + MCFG_DEVICE_ADD("dmac", AM9517A, 8000000) /* ch2 is FDC, ch0/3 are "user". ch1 is unused */ + MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(pc88va_state, pc88va_hlda_w)) + MCFG_AM9517A_OUT_EOP_CB(WRITELINE(pc88va_state, pc88va_tc_w)) + MCFG_AM9517A_IN_IOR_2_CB(READ8(pc88va_state, fdc_dma_r)) + MCFG_AM9517A_OUT_IOW_2_CB(WRITE8(pc88va_state, fdc_dma_w)) + MCFG_UPD765A_ADD("upd765", false, true) MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(pc88va_state, fdc_irq)) MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(pc88va_state, fdc_drq)) diff --git a/src/mess/drivers/snes.c b/src/mess/drivers/snes.c index aff5e20e5f0..1703d126789 100644 --- a/src/mess/drivers/snes.c +++ b/src/mess/drivers/snes.c @@ -1005,9 +1005,9 @@ WRITE8_MEMBER( snes_console_state::pfest94_lo_w ) *************************************/ static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, snes_console_state ) -// AM_RANGE(0x000000, 0x7dffff) AM_READWRITE(snes20_lo_r, snes20_lo_w) +// AM_RANGE(0x000000, 0x7dffff) AM_READWRITE(snes20_lo_r, snes20_lo_w) AM_RANGE(0x7e0000, 0x7fffff) AM_RAM /* 8KB Low RAM, 24KB High RAM, 96KB Expanded RAM */ -// AM_RANGE(0x800000, 0xffffff) AM_READWRITE(snes20_hi_r, snes20_hi_w) +// AM_RANGE(0x800000, 0xffffff) AM_READWRITE(snes20_hi_r, snes20_hi_w) ADDRESS_MAP_END static ADDRESS_MAP_START( spc_map, AS_PROGRAM, 8, snes_console_state ) @@ -1196,7 +1196,7 @@ void snes_console_state::machine_start() m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snes_console_state::snes20_lo_r),this), write8_delegate(FUNC(snes_console_state::snes20_lo_w),this)); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snes_console_state::snes20_hi_r),this), write8_delegate(FUNC(snes_console_state::snes20_hi_w),this)); m_maincpu->set_5a22_map(); - + m_type = m_cartslot->get_type(); switch (m_type) diff --git a/src/mess/drivers/ticalc1x.c b/src/mess/drivers/ticalc1x.c index 37d90600162..b0e06af609d 100644 --- a/src/mess/drivers/ticalc1x.c +++ b/src/mess/drivers/ticalc1x.c @@ -2,6 +2,8 @@ // copyright-holders:hap, Sean Riddle /*************************************************************************** + ** subclass of hh_tms1k_state (includes/hh_tms1k.h, drivers/hh_tms1k.c) ** + Texas Instruments TMS1xxx/0970/0980 handheld calculators (mostly single-chip) Refer to their official manuals on how to use them. @@ -13,9 +15,7 @@ ***************************************************************************/ -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" +#include "includes/hh_tms1k.h" // internal artwork #include "ti1270.lh" @@ -24,51 +24,15 @@ #include "wizatron.lh" -class ticalc1x_state : public driver_device +class ticalc1x_state : public hh_tms1k_state { public: ticalc1x_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_inp_matrix(*this, "IN"), - m_speaker(*this, "speaker"), - m_display_wait(33), - m_display_maxy(1), - m_display_maxx(0) + : hh_tms1k_state(mconfig, type, tag) { } - // devices - required_device<cpu_device> m_maincpu; - optional_ioport_array<11> m_inp_matrix; // max 11 - optional_device<speaker_sound_device> m_speaker; - - // misc common - UINT16 m_r; // MCU R-pins data - UINT16 m_o; // MCU O-pins data - UINT16 m_inp_mux; // multiplexed inputs mask - bool m_power_on; - - UINT8 read_inputs(int columns); - DECLARE_INPUT_CHANGED_MEMBER(power_button); - DECLARE_WRITE_LINE_MEMBER(auto_power_off); - - virtual void machine_reset(); - virtual void machine_start(); - - // display common - int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) - int m_display_maxy; // display matrix number of rows - int m_display_maxx; // display matrix number of columns - - UINT32 m_display_state[0x20]; // display matrix rows data - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) - - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); void display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask); - + // calculator-specific handlers void tisr16_display(); DECLARE_WRITE16_MEMBER(tisr16_write_o); @@ -79,6 +43,10 @@ public: DECLARE_WRITE16_MEMBER(ti1270_write_r); DECLARE_READ8_MEMBER(ti1270_read_k); + DECLARE_WRITE16_MEMBER(ti1000_write_o); + DECLARE_WRITE16_MEMBER(ti1000_write_r); + DECLARE_READ8_MEMBER(ti1000_read_k); + DECLARE_WRITE16_MEMBER(wizatron_write_o); DECLARE_WRITE16_MEMBER(wizatron_write_r); DECLARE_READ8_MEMBER(wizatron_read_k); @@ -93,155 +61,24 @@ public: DECLARE_WRITE16_MEMBER(ti30_write_o); DECLARE_WRITE16_MEMBER(ti30_write_r); DECLARE_READ8_MEMBER(ti30_read_k); -}; +protected: + virtual void machine_start(); +}; -// machine_start/reset void ticalc1x_state::machine_start() { - // zerofill - memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, ~0, sizeof(m_display_cache)); - memset(m_display_decay, 0, sizeof(m_display_decay)); + hh_tms1k_state::machine_start(); memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // ! - - m_o = 0; - m_r = 0; - m_inp_mux = 0; - m_power_on = false; - - // register for savestates - save_item(NAME(m_display_maxy)); - save_item(NAME(m_display_maxx)); - save_item(NAME(m_display_wait)); - - save_item(NAME(m_display_state)); - /* save_item(NAME(m_display_cache)); */ // don't save! - save_item(NAME(m_display_decay)); - save_item(NAME(m_display_segmask)); - - save_item(NAME(m_o)); - save_item(NAME(m_r)); - save_item(NAME(m_inp_mux)); - save_item(NAME(m_power_on)); -} - -void ticalc1x_state::machine_reset() -{ - m_power_on = true; -} - - - -/*************************************************************************** - - Helper Functions - -***************************************************************************/ - -// The device may strobe the outputs very fast, it is unnoticeable to the user. -// To prevent flickering here, we need to simulate a decay. - -void ticalc1x_state::display_update() -{ - UINT32 active_state[0x20]; - - for (int y = 0; y < m_display_maxy; y++) - { - active_state[y] = 0; - - for (int x = 0; x < m_display_maxx; x++) - { - // turn on powered segments - if (m_power_on && m_display_state[y] >> x & 1) - m_display_decay[y][x] = m_display_wait; - - // determine active state - int ds = (m_display_decay[y][x] != 0) ? 1 : 0; - active_state[y] |= (ds << x); - } - } - - // on difference, send to output - for (int y = 0; y < m_display_maxy; y++) - if (m_display_cache[y] != active_state[y]) - { - if (m_display_segmask[y] != 0) - output_set_digit_value(y, active_state[y] & m_display_segmask[y]); - - const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x < m_display_maxx; x++) - { - int state = active_state[y] >> x & 1; - output_set_lamp_value(y * mul + x, state); - - // bit coords for svg2lay - char buf[10]; - sprintf(buf, "%d.%d", y, x); - output_set_value(buf, state); - } - } - - memcpy(m_display_cache, active_state, sizeof(m_display_cache)); -} - -TIMER_DEVICE_CALLBACK_MEMBER(ticalc1x_state::display_decay_tick) -{ - // slowly turn off unpowered segments - for (int y = 0; y < m_display_maxy; y++) - for (int x = 0; x < m_display_maxx; x++) - if (m_display_decay[y][x] != 0) - m_display_decay[y][x]--; - - display_update(); } void ticalc1x_state::display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask) { - m_display_maxx = maxx; - m_display_maxy = maxy; - - // update current state - UINT32 colmask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) - { m_display_segmask[y] &= segmask; - m_display_state[y] = (sety >> y & 1) ? (setx & colmask) : 0; - } - - display_update(); -} - -UINT8 ticalc1x_state::read_inputs(int columns) -{ - UINT8 ret = 0; - - // read selected input rows - for (int i = 0; i < columns; i++) - if (m_inp_mux >> i & 1) - ret |= m_inp_matrix[i]->read(); - - return ret; -} - - -// devices with a TMS0980 can auto power-off - -WRITE_LINE_MEMBER(ticalc1x_state::auto_power_off) -{ - if (state) - { - m_power_on = false; - m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - } -} - -INPUT_CHANGED_MEMBER(ticalc1x_state::power_button) -{ - m_power_on = (bool)(FPTR)param; - m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); + display_matrix(maxx, maxy, setx, sety); } @@ -255,7 +92,8 @@ INPUT_CHANGED_MEMBER(ticalc1x_state::power_button) /*************************************************************************** TI SR-16 - * TMS1000 MCU labeled TMS1001NL. die labeled 1001A + * TMS1000 MCU labeled TMS1001NL. die labeled 1000, 1001A + * 12-digit 7seg LED display ***************************************************************************/ @@ -265,11 +103,11 @@ void ticalc1x_state::tisr16_display() for (int y = 0; y < 11; y++) m_display_state[y] = (m_r >> y & 1) ? m_o : 0; - // exponent sign (not 100% sure this is correct) - m_display_state[11] = (m_display_state[0] || m_display_state[1]) ? 0x40 : 0; - - m_display_maxx = 8; - m_display_maxy = 12; + // exponent sign is from R10 O1, and R10 itself only uses segment G + m_display_state[11] = m_display_state[10] << 5 & 0x40; + m_display_state[10] &= 0x40; + + set_display_size(8, 12); display_update(); } @@ -366,12 +204,12 @@ INPUT_PORTS_END static MACHINE_CONFIG_START( tisr16, ticalc1x_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1000, 250000) // guessed + MCFG_CPU_ADD("maincpu", TMS1000, 300000) // RC osc. R=43K, C=68pf -> ~300kHz MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, tisr16_read_k)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, tisr16_write_o)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, tisr16_write_r)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_tisr16) /* no video! */ @@ -385,8 +223,100 @@ MACHINE_CONFIG_END /*************************************************************************** + TI SR-16 II + * TMS1000 MCU labeled TMS1016NL. die labeled 1000B, 1016A + * 12-digit 7seg LED display + + A cost-reduced 'sequel', [10^x] was removed, and [pi] was added. + +***************************************************************************/ + +// hardware is nearly identical to TI SR-16 above, so we simply use those handlers + +static INPUT_PORTS_START( tisr16ii ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("C") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CD") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + + PORT_START("IN.3") // R3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + + PORT_START("IN.4") // R4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("x" UTF8_POW_2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + + PORT_START("IN.5") // R5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_NAME("log") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_NAME("EE") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + + PORT_START("IN.6") // R6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME(UTF8_SQUAREROOT"x") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + + PORT_START("IN.7") // R7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("ln(x)") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("STO") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + + PORT_START("IN.8") // R8 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("1/x") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_NAME("RCL") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + + PORT_START("IN.9") // R9 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("e" UTF8_POW_X) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME(UTF8_CAPITAL_SIGMA) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + + PORT_START("IN.10") // R10 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("y" UTF8_POW_X) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME(UTF8_SMALL_PI) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") +INPUT_PORTS_END + + +static MACHINE_CONFIG_DERIVED( tisr16ii, tisr16 ) + + /* basic machine hardware */ + // the MCU RC osc. is different: R=30K, C=100pf -> ~300kHz(same freq as tisr16, no change needed) +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + TI-1270 * TMS0970 MCU labeled TMC0974NL ZA0355, DP0974A. die labeled 0970D-74A + * 8-digit 7seg LED display ***************************************************************************/ @@ -438,7 +368,7 @@ static INPUT_PORTS_START( ti1270 ) PORT_START("IN.4") // O5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("STO") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_NAME("RCL") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CODE(KEYCODE_I) PORT_NAME(UTF8_SMALL_PI) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_NAME(UTF8_SMALL_PI) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) PORT_START("IN.5") // O7 @@ -457,7 +387,90 @@ static MACHINE_CONFIG_START( ti1270, ticalc1x_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, ti1270_write_o)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, ti1270_write_r)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_ti1270) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + TI-1000 + * TMS1990 MCU labeled TMC1991NL, die labeled 1991-91A + * 8-digit 7seg LED display + +***************************************************************************/ + +WRITE16_MEMBER(ticalc1x_state::ti1000_write_r) +{ + // R0-R7: select digit (right-to-left) + UINT8 o = BITSWAP8(m_o,7,4,3,2,1,0,6,5); + display_matrix_seg(8, 8, o, data, 0xff); +} + +WRITE16_MEMBER(ticalc1x_state::ti1000_write_o) +{ + // O0-O3,O5(?): input mux + // O0-O7: digit segments + m_inp_mux = (data & 0xf) | (data >> 1 & 0x10); + m_o = data; +} + +READ8_MEMBER(ticalc1x_state::ti1000_read_k) +{ + return read_inputs(5); +} + + +static INPUT_PORTS_START( ti1000 ) + PORT_START("IN.0") // O0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + + PORT_START("IN.1") // O1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + + PORT_START("IN.2") // O2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) + + // note: even though power buttons are on the matrix, they are not CPU-controlled + PORT_START("IN.3") // O3 or O4? + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)false) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("+/-") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("%") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) + + PORT_START("IN.4") // O5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("On/C") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME(".") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( ti1000, ticalc1x_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1990, 250000) // guessed + MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, ti1000_read_k)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, ti1000_write_o)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, ti1000_write_r)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_ti1270) /* no video! */ @@ -473,6 +486,7 @@ MACHINE_CONFIG_END TI WIZ-A-TRON * TMS0970 MCU labeled TMC0907NL ZA0379, DP0907BS. die labeled 0970F-07B + * 9-digit 7seg LED display(one custom digit) ***************************************************************************/ @@ -482,11 +496,11 @@ WRITE16_MEMBER(ticalc1x_state::wizatron_write_r) // \./ GAB // --- F // /.\ EDC - + // 3rd digit only has A and G for =, though some newer hardware revisions // (goes for both wizatron and lilprof) use a custom equals-sign digit here m_display_segmask[3] = 0x41; - + // R0-R8: select digit (right-to-left) display_matrix_seg(7, 9, m_o, data, 0x7f); } @@ -508,28 +522,28 @@ READ8_MEMBER(ticalc1x_state::wizatron_read_k) static INPUT_PORTS_START( wizatron ) PORT_START("IN.0") // O1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") PORT_START("IN.1") // O2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") PORT_START("IN.2") // O3 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) PORT_START("IN.3") // O4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) INPUT_PORTS_END @@ -541,7 +555,7 @@ static MACHINE_CONFIG_START( wizatron, ticalc1x_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, wizatron_write_o)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, wizatron_write_r)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_wizatron) /* no video! */ @@ -557,7 +571,8 @@ MACHINE_CONFIG_END TI Little Professor (1976 version) * TMS0970 MCU labeled TMS0975NL ZA0356, GP0975CS. die labeled 0970D-75C - + * 9-digit 7seg LED display(one custom digit) + The hardware is nearly identical to Wiz-A-Tron (or vice versa, since this one is older). @@ -581,8 +596,8 @@ static INPUT_PORTS_START( lilprof ) PORT_INCLUDE( wizatron ) PORT_MODIFY("IN.0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CODE(KEYCODE_DEL) PORT_NAME("Set") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Go") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_CODE(KEYCODE_DEL) PORT_NAME("Set") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Go") PORT_START("IN.4") // O7 PORT_CONFNAME( 0x0f, 0x01, "Level") @@ -601,7 +616,7 @@ static MACHINE_CONFIG_START( lilprof, ticalc1x_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, lilprof_write_o)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, wizatron_write_r)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_wizatron) /* no video! */ @@ -615,8 +630,12 @@ MACHINE_CONFIG_END /*************************************************************************** - TI Little Professor (1978 version, same as 1980 version) + TI Little Professor (1978 version) * TMS1990 MCU labeled TMC1993NL. die labeled 1990C-c3C + * 9-digit 7seg LED display(one custom digit) + + 1978 re-release, with on/off and level select on buttons instead of + switches. The casing was slightly revised in 1980 again, but same rom. ***************************************************************************/ @@ -631,18 +650,17 @@ WRITE16_MEMBER(ticalc1x_state::lilprof78_write_r) // 3rd digit A/G(equals sign) is from O7 m_display_state[3] = (m_o & 0x80) ? 0x41 : 0; - + // 6th digit is a custom 7seg for math symbols (see wizatron_write_r) m_display_state[6] = BITSWAP8(m_display_state[6],7,6,1,4,2,3,5,0); - m_display_maxx = 7; - m_display_maxy = 9; + set_display_size(7, 9); display_update(); } WRITE16_MEMBER(ticalc1x_state::lilprof78_write_o) { - // O0-O3,O5: input mux + // O0-O3,O5(?): input mux // O0-O6: digit segments A-G // O7: 6th digit m_inp_mux = (data & 0xf) | (data >> 1 & 0x10); @@ -657,35 +675,35 @@ READ8_MEMBER(ticalc1x_state::lilprof78_read_k) static INPUT_PORTS_START( lilprof78 ) PORT_START("IN.0") // O0 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") PORT_START("IN.1") // O1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) PORT_START("IN.2") // O2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) // note: even though power buttons are on the matrix, they are not CPU-controlled PORT_START("IN.3") // O3 or O4? - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)false) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)false) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Set") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("Level") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Set") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_START("IN.4") // O5 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Go") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Go") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") INPUT_PORTS_END @@ -697,7 +715,7 @@ static MACHINE_CONFIG_START( lilprof78, ticalc1x_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, lilprof78_write_o)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, lilprof78_write_r)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_wizatron) /* no video! */ @@ -715,6 +733,7 @@ MACHINE_CONFIG_END * TI-30(aka SR-40): TMS0980 MCU labeled TMC0981NL. die labeled 0980B-81F * TI Programmer: TMS0980 MCU labeled ZA0675NL, JP0983AT. die labeled 0980B-83 * TI Business Analyst-I: TMS0980 MCU labeled TMC0982NL. die labeled 0980B-82F + * 9-digit 7seg LED display ***************************************************************************/ @@ -724,7 +743,8 @@ WRITE16_MEMBER(ticalc1x_state::ti30_write_r) m_display_segmask[0] = 0xe2; // R0-R8: select digit - display_matrix_seg(8, 9, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data, 0xff); + UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3); + display_matrix_seg(8, 9, o, data, 0xff); } WRITE16_MEMBER(ticalc1x_state::ti30_write_o) @@ -932,7 +952,7 @@ static MACHINE_CONFIG_START( ti30, ticalc1x_state ) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, ti30_write_r)) MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(ticalc1x_state, auto_power_off)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", ticalc1x_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_ti30) /* no video! */ @@ -961,6 +981,17 @@ ROM_START( tisr16 ) ROM_END +ROM_START( tisr16ii ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "tms1016nl", 0x0000, 0x0400, CRC(c07a7b27) SHA1(34ea4d3b59871e08db74f8c5bfb7ff00d1f0adc7) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1000_sr16ii_mpla.pla", 0, 867, CRC(31b43e95) SHA1(6864e4c20f3affffcd3810dcefbc9484dd781547) ) + ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_LOAD( "tms1000_sr16ii_opla.pla", 0, 365, CRC(c45dfbd0) SHA1(5d588c1abc317134b51eb08ac3953f1009d80056) ) +ROM_END + + ROM_START( ti1270 ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "za0355", 0x0000, 0x0400, CRC(48e09b4b) SHA1(17f27167164df223f9f06082ece4c3fc3900eda3) ) @@ -976,6 +1007,21 @@ ROM_START( ti1270 ) ROM_END +ROM_START( ti1000 ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "tmc1991nl", 0x0000, 0x0400, CRC(2da5381d) SHA1(b5dc14553db2068ed48e130e5ec9109930d8cda9) ) + + ROM_REGION( 782, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0970_ti1000_ipla.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) + ROM_REGION( 860, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0970_ti1000_mpla.pla", 0, 860, CRC(7f50ab2e) SHA1(bff3be9af0e322986f6e545b567c97d70e135c93) ) + ROM_REGION( 352, "maincpu:opla", 0 ) + ROM_LOAD( "tms0970_ti1000_opla.pla", 0, 352, CRC(1d82061a) SHA1(90e4a4b0fb3b4ae5965da90479b7fed737ad8831) ) + ROM_REGION( 157, "maincpu:spla", 0 ) + ROM_LOAD( "tms0970_ti1000_spla.pla", 0, 157, CRC(234ca3a8) SHA1(76844dd87cb380a07c8fcbef143038087e98f138) ) +ROM_END + + ROM_START( wizatron ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "za0379", 0x0000, 0x0400, CRC(5a6af094) SHA1(b1f27e1f13f4db3b052dd50fb08dbf9c4d8db26e) ) @@ -996,28 +1042,27 @@ ROM_START( lilprof ) ROM_LOAD( "za0356", 0x0000, 0x0400, CRC(fef9dd39) SHA1(5c9614c9c5092d55dabeee2d6e0387d50d6ad4d5) ) ROM_REGION( 782, "maincpu:ipla", 0 ) - ROM_LOAD( "tms0970_lilprof_ipla.pla", 0, 782, BAD_DUMP CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) // not verified + ROM_LOAD( "tms0970_lilprof_ipla.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) ROM_REGION( 860, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0970_lilprof_mpla.pla", 0, 860, BAD_DUMP CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) // not verified + ROM_LOAD( "tms0970_lilprof_mpla.pla", 0, 860, CRC(6ff5d51d) SHA1(59d3e5de290ba57694068ddba78d21a0c1edf427) ) ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0970_lilprof_opla.pla", 0, 352, BAD_DUMP CRC(c74daf97) SHA1(c4948000196171b34d4fe9cdd2962a945da9883d) ) // not verified + ROM_LOAD( "tms0970_lilprof_opla.pla", 0, 352, CRC(c74daf97) SHA1(c4948000196171b34d4fe9cdd2962a945da9883d) ) ROM_REGION( 157, "maincpu:spla", 0 ) ROM_LOAD( "tms0970_lilprof_spla.pla", 0, 157, CRC(56c37a4f) SHA1(18ecc20d2666e89673739056483aed5a261ae927) ) ROM_END - ROM_START( lilprof78 ) ROM_REGION( 0x0400, "maincpu", 0 ) ROM_LOAD( "tmc1993nl", 0x0000, 0x0400, CRC(e941316b) SHA1(7e1542045d1e731cea81a639c9ac9e91bb233b15) ) ROM_REGION( 782, "maincpu:ipla", 0 ) - ROM_LOAD( "tms0970_lilprof_ipla.pla", 0, 782, BAD_DUMP CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) // not verified + ROM_LOAD( "tms0970_lilprof78_ipla.pla", 0, 782, CRC(05306ef8) SHA1(60a0a3c49ce330bce0c27f15f81d61461d0432ce) ) ROM_REGION( 860, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0970_lilprof_mpla.pla", 0, 860, CRC(7f50ab2e) SHA1(bff3be9af0e322986f6e545b567c97d70e135c93) ) + ROM_LOAD( "tms0970_lilprof78_mpla.pla", 0, 860, CRC(7f50ab2e) SHA1(bff3be9af0e322986f6e545b567c97d70e135c93) ) ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0970_lilprof_opla.pla", 0, 352, CRC(03f509c4) SHA1(691554a55db0c5950df848077095f23a991b1909) ) + ROM_LOAD( "tms0970_lilprof78_opla.pla", 0, 352, CRC(03f509c4) SHA1(691554a55db0c5950df848077095f23a991b1909) ) ROM_REGION( 157, "maincpu:spla", 0 ) - ROM_LOAD( "tms0970_lilprof_spla.pla", 0, 157, CRC(234ca3a8) SHA1(76844dd87cb380a07c8fcbef143038087e98f138) ) + ROM_LOAD( "tms0970_lilprof78_spla.pla", 0, 157, CRC(234ca3a8) SHA1(76844dd87cb380a07c8fcbef143038087e98f138) ) ROM_END @@ -1068,9 +1113,11 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ -COMP( 1974, tisr16, 0, 0, tisr16, tisr16, driver_device, 0, "Texas Instruments", "SR-16 (Texas Instruments)", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1974, tisr16, 0, 0, tisr16, tisr16, driver_device, 0, "Texas Instruments", "SR-16", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1975, tisr16ii, 0, 0, tisr16ii, tisr16ii, driver_device, 0, "Texas Instruments", "SR-16 II", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) COMP( 1976, ti1270, 0, 0, ti1270, ti1270, driver_device, 0, "Texas Instruments", "TI-1270", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +COMP( 1977, ti1000, 0, 0, ti1000, ti1000, driver_device, 0, "Texas Instruments", "TI-1000", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) COMP( 1977, wizatron, 0, 0, wizatron, wizatron, driver_device, 0, "Texas Instruments", "Wiz-A-Tron", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) COMP( 1976, lilprof, 0, 0, lilprof, lilprof, driver_device, 0, "Texas Instruments", "Little Professor (1976 version)", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) COMP( 1978, lilprof78, lilprof, 0, lilprof78, lilprof78, driver_device, 0, "Texas Instruments", "Little Professor (1978 version)", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c index cc2b432106f..b206220f654 100644 --- a/src/mess/drivers/tispeak.c +++ b/src/mess/drivers/tispeak.c @@ -2,6 +2,8 @@ // copyright-holders:hap, Lord Nightmare /*************************************************************************** + ** subclass of hh_tms1k_state (includes/hh_tms1k.h, drivers/hh_tms1k.c) ** + Texas Instruments 1st-gen. handheld speech devices, These devices, mostly edu-toys, are based around an MCU(TMS0270/TMS1100), @@ -135,7 +137,7 @@ Speak & Math: Apparently QA never found out and it ended up in the final product. Speak & Math (US), 1986 - - MCU: CD2708 + - MCU: CD2708, labeled CD2708N2L (die labeled TMC0270F 2708A) - TMS51xx(1/2): 16KB CD2381 - TMS51xx(2/2): 4KB CD2614 @@ -149,7 +151,7 @@ Speak & Math: Speak & Read: Speak & Read (US), 1980 - - MCU: CD2705** + - MCU: CD2705, labeled CD2705B-N2L (die labeled TMC0270E 2705B) - 2nd revision? - TMS51xx(1/2): 16KB CD2394 (rev.A) - TMS51xx(2/2): 16KB CD2395 (rev.A) @@ -275,13 +277,13 @@ Other devices: ***************************************************************************/ -#include "emu.h" -#include "cpu/tms0980/tms0980.h" +#include "includes/hh_tms1k.h" #include "sound/tms5110.h" #include "machine/tms6100.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" +// internal artwork #include "lantutor.lh" #include "snspell.lh" @@ -294,47 +296,20 @@ Other devices: #define MASTER_CLOCK (640000) -class tispeak_state : public driver_device +class tispeak_state : public hh_tms1k_state { public: tispeak_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), + : hh_tms1k_state(mconfig, type, tag), m_tms5100(*this, "tms5100"), m_tms6100(*this, "tms6100"), - m_cart(*this, "cartslot"), - m_button_matrix(*this, "IN"), - m_display_wait(33), - m_display_maxy(1), - m_display_maxx(0) + m_cart(*this, "cartslot") { } // devices - required_device<tms0270_cpu_device> m_maincpu; required_device<tms5100_device> m_tms5100; required_device<tms6100_device> m_tms6100; optional_device<generic_slot_device> m_cart; - required_ioport_array<9> m_button_matrix; - - // misc common - UINT16 m_r; // MCU R-pins data - UINT16 m_o; // MCU O-pins data - int m_power_on; - int m_filament_on; - - // display common - int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) - int m_display_maxy; // display matrix number of rows - int m_display_maxx; // display matrix number of columns - - UINT32 m_display_state[0x20]; // display matrix rows data - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) - - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); - void display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask); // cartridge UINT32 m_cart_max_size; @@ -349,10 +324,11 @@ public: DECLARE_WRITE16_MEMBER(snspell_write_r); DECLARE_WRITE16_MEMBER(lantutor_write_r); - DECLARE_INPUT_CHANGED_MEMBER(power_button); - void power_off(); + DECLARE_INPUT_CHANGED_MEMBER(snspell_power_button); + void snspell_power_off(); + void snspell_display(); - virtual void machine_reset(); +protected: virtual void machine_start(); }; @@ -397,119 +373,37 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor) /*************************************************************************** - VFD Display + I/O ***************************************************************************/ -// The device may strobe the outputs very fast, it is unnoticeable to the user. -// To prevent flickering here, we need to simulate a decay. - -void tispeak_state::display_update() -{ - UINT32 active_state[0x20]; - - for (int y = 0; y < m_display_maxy; y++) - { - active_state[y] = 0; - - for (int x = 0; x < m_display_maxx; x++) - { - // turn on powered segments - if (m_power_on && m_filament_on && m_display_state[y] >> x & 1) - m_display_decay[y][x] = m_display_wait; - - // determine active state - int ds = (m_display_decay[y][x] != 0) ? 1 : 0; - active_state[y] |= (ds << x); - } - } - - // on difference, send to output - for (int y = 0; y < m_display_maxy; y++) - if (m_display_cache[y] != active_state[y]) - { - if (m_display_segmask[y] != 0) - output_set_digit_value(y, active_state[y] & m_display_segmask[y]); - - const int mul = (m_display_maxx <= 10) ? 10 : 100; - for (int x = 0; x < m_display_maxx; x++) - { - int state = active_state[y] >> x & 1; - output_set_lamp_value(y * mul + x, state); - - // bit coords for svg2lay - char buf[10]; - sprintf(buf, "%d.%d", y, x); - output_set_value(buf, state); - } - } - - memcpy(m_display_cache, active_state, sizeof(m_display_cache)); -} - -TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::display_decay_tick) -{ - // slowly turn off unpowered segments - for (int y = 0; y < m_display_maxy; y++) - for (int x = 0; x < m_display_maxx; x++) - if (m_display_decay[y][x] != 0) - m_display_decay[y][x]--; - - display_update(); -} +// common/snspell -void tispeak_state::display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask) +void tispeak_state::snspell_display() { - m_display_maxx = maxx; - m_display_maxy = maxy; + for (int y = 0; y < 16; y++) + m_display_segmask[y] = 0x3fff; - // update current state - UINT32 colmask = (1 << maxx) - 1; - for (int y = 0; y < maxy; y++) - { - m_display_segmask[y] &= segmask; - m_display_state[y] = (sety >> y & 1) ? (setx & colmask) : 0; - } - - display_update(); + display_matrix(16, 16, m_o, (m_r & 0x8000) ? (m_r & 0x21ff) : 0); } - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -// common/snspell - READ8_MEMBER(tispeak_state::snspell_read_k) { - // the Vss row is always on - UINT8 k = m_button_matrix[8]->read(); - - // read selected button rows - for (int i = 0; i < 8; i++) - if (m_r >> i & 1) - k |= m_button_matrix[i]->read(); - - return k; + // note: the Vss row is always on + return m_inp_matrix[8]->read() | read_inputs(8); } WRITE16_MEMBER(tispeak_state::snspell_write_r) { - // R15: filament on - m_filament_on = data & 0x8000; - // R13: power-off request, on falling edge if ((m_r >> 13 & 1) && !(data >> 13 & 1)) - power_off(); + snspell_power_off(); // R0-R7: input mux and select digit (+R8 if the device has 9 digits) + // R15: filament on // other bits: MCU internal use - m_r = data & 0x21ff; - display_matrix_seg(16, 16, m_o, m_r, 0x3fff); + m_r = m_inp_mux = data; + snspell_display(); } WRITE16_MEMBER(tispeak_state::snspell_write_o) @@ -517,17 +411,17 @@ WRITE16_MEMBER(tispeak_state::snspell_write_o) // reorder opla to led14seg, plus DP as d14 and AP as d15: // E,D,C,G,B,A,I,M,L,K,N,J,[AP],H,F,[DP] (sidenote: TI KLMN = MAME MLNK) m_o = BITSWAP16(data,12,15,10,7,8,9,11,6,13,3,14,0,1,2,4,5); - display_matrix_seg(16, 16, m_o, m_r, 0x3fff); + snspell_display(); } -void tispeak_state::power_off() +void tispeak_state::snspell_power_off() { m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); m_tms5100->reset(); m_tms6100->reset(); - m_power_on = 0; + m_power_on = false; } @@ -538,7 +432,7 @@ WRITE16_MEMBER(tispeak_state::snmath_write_o) // reorder opla to led14seg, plus DP as d14 and AP as d15: // [DP],D,C,H,F,B,I,M,L,K,N,J,[AP],E,G,A (sidenote: TI KLMN = MAME MLNK) m_o = BITSWAP16(data,12,0,10,7,8,9,11,6,3,14,4,13,1,2,5,15); - display_matrix_seg(16, 16, m_o, m_r, 0x3fff); + snspell_display(); } @@ -547,9 +441,8 @@ WRITE16_MEMBER(tispeak_state::snmath_write_o) WRITE16_MEMBER(tispeak_state::lantutor_write_r) { // same as default, except R13 is used for an extra digit - m_filament_on = data & 0x8000; - m_r = data & 0x21ff; - display_matrix_seg(16, 16, m_o, m_r, 0x3fff); + m_r = m_inp_mux = data; + snspell_display(); } @@ -560,17 +453,17 @@ WRITE16_MEMBER(tispeak_state::lantutor_write_r) ***************************************************************************/ -INPUT_CHANGED_MEMBER(tispeak_state::power_button) +INPUT_CHANGED_MEMBER(tispeak_state::snspell_power_button) { int on = (int)(FPTR)param; if (on && !m_power_on) { - m_power_on = 1; + m_power_on = true; m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } else if (!on && m_power_on) - power_off(); + snspell_power_off(); } static INPUT_PORTS_START( snspell ) @@ -631,7 +524,7 @@ static INPUT_PORTS_START( snspell ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Secret Code") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Letter") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Say It") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Spell/On") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, power_button, (void *)1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Spell/On") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, snspell_power_button, (void *)true) INPUT_PORTS_END @@ -683,7 +576,7 @@ static INPUT_PORTS_START( snmath ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_NAME("Write It") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Greater/Less") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Word Problems") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Solve It/On") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, power_button, (void *)1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Solve It/On") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, snspell_power_button, (void *)true) PORT_START("IN.7") PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -693,28 +586,44 @@ static INPUT_PORTS_START( snmath ) INPUT_PORTS_END +static INPUT_PORTS_START( snread ) + PORT_INCLUDE( snspell ) + + PORT_MODIFY("IN.7") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("Word Zapper") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("Word Maker") + + PORT_MODIFY("IN.8") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_NAME("Read It") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("Picture Read") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("Letter Stumper") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("Hear It") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Word Zap/On") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, snspell_power_button, (void *)true) +INPUT_PORTS_END + + static INPUT_PORTS_START( lantutor ) PORT_INCLUDE( snspell ) - PORT_MODIFY("IN.5") // R5 + PORT_MODIFY("IN.5") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Diacritical") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Space") - PORT_MODIFY("IN.6") // R6 + PORT_MODIFY("IN.6") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_NAME("1") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_NAME("2") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_NAME("3") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_NAME("4") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_NAME("5") - PORT_MODIFY("IN.7") // R7 + PORT_MODIFY("IN.7") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_NAME("6") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_NAME("7") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_NAME("8") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_NAME("9") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_NAME("0") - PORT_MODIFY("IN.8") // Vss! + PORT_MODIFY("IN.8") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_NAME("Translate") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Learn") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Phrase") @@ -730,38 +639,9 @@ INPUT_PORTS_END ***************************************************************************/ -void tispeak_state::machine_reset() -{ - m_power_on = 1; -} - void tispeak_state::machine_start() { - // zerofill - memset(m_display_state, 0, sizeof(m_display_state)); - memset(m_display_cache, ~0, sizeof(m_display_cache)); - memset(m_display_decay, 0, sizeof(m_display_decay)); - memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // ! - - m_r = 0; - m_o = 0; - m_power_on = 0; - m_filament_on = 0; - - // register for savestates - save_item(NAME(m_display_maxy)); - save_item(NAME(m_display_maxx)); - save_item(NAME(m_display_wait)); - - save_item(NAME(m_display_state)); - /* save_item(NAME(m_display_cache)); */ // don't save! - save_item(NAME(m_display_decay)); - save_item(NAME(m_display_segmask)); - - save_item(NAME(m_r)); - save_item(NAME(m_o)); - save_item(NAME(m_power_on)); - save_item(NAME(m_filament_on)); + hh_tms1k_state::machine_start(); // init cartridge if (m_cart != NULL && m_cart->exists()) @@ -786,7 +666,7 @@ static MACHINE_CONFIG_START( snmath, tispeak_state ) MCFG_TMS0270_WRITE_CTL_CB(DEVWRITE8("tms5100", tms5100_device, ctl_w)) MCFG_TMS0270_WRITE_PDC_CB(DEVWRITELINE("tms5100", tms5100_device, pdc_w)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", tispeak_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_snspell) // max 9 digits /* no video! */ @@ -818,6 +698,20 @@ static MACHINE_CONFIG_DERIVED( snspell, snmath ) MCFG_SOFTWARE_LIST_ADD("cart_list", "snspell") MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( snread, snmath ) + + /* basic machine hardware */ + MCFG_CPU_MODIFY("maincpu") + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snspell_write_o)) + + /* cartridge */ + MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snread") + MCFG_GENERIC_EXTENSIONS("vsm") + MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge) + + MCFG_SOFTWARE_LIST_ADD("cart_list", "snread") +MACHINE_CONFIG_END + static MACHINE_CONFIG_DERIVED( lantutor, snmath ) /* basic machine hardware */ @@ -851,13 +745,13 @@ ROM_START( snspell ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as tmc0271 + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge - ROM_LOAD( "tmc0351.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) ) // cd2300 - ROM_LOAD( "tmc0352.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) ) // cd2301 + ROM_LOAD( "tmc0351nl.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) ) + ROM_LOAD( "tmc0352nl.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) ) ROM_END ROM_START( snspella ) @@ -867,7 +761,23 @@ ROM_START( snspella ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // placeholder, use the one we have + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified + ROM_REGION( 1246, "maincpu:opla", 0 ) + ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) + + ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_LOAD( "tmc0351n2l.vsm", 0x0000, 0x4000, CRC(2d03b292) SHA1(a3e9a365307ae936c7472f720a7a8240741531d6) ) + ROM_LOAD( "tmc0352n2l.vsm", 0x4000, 0x4000, CRC(a6d56883) SHA1(eebf9c07f2f9001679dec06c2367d4a50596d04b) ) +ROM_END + +ROM_START( snspellb ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, BAD_DUMP CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // placeholder, use the one we have + + ROM_REGION( 1246, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) + ROM_REGION( 2127, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) @@ -882,7 +792,7 @@ ROM_START( snspelluk ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as tmc0271 + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) @@ -898,7 +808,7 @@ ROM_START( snspelluka ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // placeholder, use the one we have + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) @@ -913,7 +823,7 @@ ROM_START( snspelljp ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as tmc0271 + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) @@ -929,7 +839,7 @@ ROM_START( ladictee ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // placeholder, use the one we have + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, BAD_DUMP CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) // placeholder, use the one we have @@ -945,7 +855,7 @@ ROM_START( snmath ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) @@ -966,9 +876,9 @@ ROM_START( snmathp ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as cd2704 + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) - ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // " + ROM_LOAD( "tms0270_cd2708_opla.pla", 0, 1246, BAD_DUMP CRC(1abad753) SHA1(53d20b519ed73ce248368047a056836afbe3cd46) ) // taken from cd2708, need to verify if it's same as cd2704 ROM_REGION( 0x8000, "tms6100", 0 ) ROM_LOAD( "cd2392.vsm", 0x0000, 0x4000, CRC(4ed2e920) SHA1(8896f29e25126c1e4d9a47c9a325b35dddecc61f) ) @@ -976,6 +886,23 @@ ROM_START( snmathp ) ROM_END +ROM_START( snread ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "cd2705b-n2l", 0x0000, 0x1000, CRC(c235636e) SHA1(57b24dd8414bf76ec786a51d10cb8a5898b60e18) ) + + ROM_REGION( 1246, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) + ROM_REGION( 2127, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) + ROM_REGION( 1246, "maincpu:opla", 0 ) + ROM_LOAD( "tms0270_cd2705_opla.pla", 0, 1246, CRC(bf859848) SHA1(66b297fbf534968fa6db7413b99ef0e81cc35ddc) ) + + ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge + ROM_LOAD( "cd2394a.vsm", 0x0000, 0x4000, CRC(cbb0e2b1) SHA1(5e322c683baf806523de171310258ae371671327) ) + ROM_LOAD( "cd2395a.vsm", 0x4000, 0x4000, CRC(3d519504) SHA1(76b19ba5a9a3486005e09c98e8a6abc8b88288dd) ) +ROM_END + + ROM_START( lantutor ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD( "us4631748_tmc0275", 0x0000, 0x1000, CRC(22818845) SHA1(1a84f15fb18ca66b1f2bf7491d76fbc56068984d) ) // extracted visually from patent 4631748, verified with source code @@ -983,7 +910,7 @@ ROM_START( lantutor ) ROM_REGION( 1246, "maincpu:ipla", 0 ) ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) ROM_REGION( 2127, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0270_cd2708_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // taken from cd2708, need to verify if it's same as tmc0275 + ROM_LOAD( "tms0270_default_mpla.pla", 0, 2127, BAD_DUMP CRC(504b96bb) SHA1(67b691e7c0b97239410587e50e5182bf46475b43) ) // not verified ROM_REGION( 1246, "maincpu:opla", 0 ) ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, BAD_DUMP CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) ) // taken from snspell, mostly looks correct @@ -993,7 +920,8 @@ ROM_END COMP( 1978, snspell, 0, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1978 version/prototype)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) -COMP( 1980, snspella, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1980 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM +COMP( 1979, snspella, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1979 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM +COMP( 1980, snspellb, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1980 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM COMP( 1978, snspelluk, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1978 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM COMP( 1981, snspelluka, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1981 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM COMP( 1979, snspelljp, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM @@ -1002,4 +930,6 @@ COMP( 1980, ladictee, snspell, 0, snspell, snspell, tispeak_state, snspell, COMP( 1986, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1986 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) COMP( 1980, snmathp, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1980 version/prototype)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +COMP( 1980, snread, 0, 0, snread, snread, tispeak_state, snspell, "Texas Instruments", "Speak & Read (US)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) + COMP( 1979, lantutor, 0, 0, lantutor, lantutor, tispeak_state, lantutor, "Texas Instruments", "Language Tutor (prototype)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h index d58d508545f..aeb248bbf6d 100644 --- a/src/mess/includes/abc80.h +++ b/src/mess/includes/abc80.h @@ -21,6 +21,7 @@ #include "machine/ram.h" #include "machine/z80pio.h" #include "sound/sn76477.h" +#include "sound/wave.h" #define ABC80_HTOTAL 384 #define ABC80_HBEND 35 @@ -56,32 +57,34 @@ #define Z80PIO_TAG "cd67" #define SN76477_TAG "g8" #define RS232_TAG "ser" +#define CASSETTE_TAG "cassette" +#define KEYBOARD_TAG "keyboard" #define TIMER_CASSETTE_TAG "cass" class abc80_state : public driver_device { public: - abc80_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, Z80_TAG), - m_pio(*this, Z80PIO_TAG), - m_psg(*this, SN76477_TAG), - m_cassette(*this, "cassette"), - m_bus(*this, ABCBUS_TAG), - m_kb(*this, ABC80_KEYBOARD_TAG), - m_ram(*this, RAM_TAG), - m_rs232(*this, RS232_TAG), - m_palette(*this, "palette"), - m_rom(*this, Z80_TAG), - m_mmu_rom(*this, "mmu"), - m_char_rom(*this, "chargen"), - m_hsync_prom(*this, "hsync"), - m_vsync_prom(*this, "vsync"), - m_line_prom(*this, "line"), - m_attr_prom(*this, "attr"), - m_video_ram(*this, "video_ram"), - m_tape_in(1), - m_tape_in_latch(1) + abc80_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, Z80_TAG), + m_pio(*this, Z80PIO_TAG), + m_psg(*this, SN76477_TAG), + m_cassette(*this, "cassette"), + m_bus(*this, ABCBUS_TAG), + m_kb(*this, ABC80_KEYBOARD_TAG), + m_ram(*this, RAM_TAG), + m_rs232(*this, RS232_TAG), + m_palette(*this, "palette"), + m_rom(*this, Z80_TAG), + m_mmu_rom(*this, "mmu"), + m_char_rom(*this, "chargen"), + m_hsync_prom(*this, "hsync"), + m_vsync_prom(*this, "vsync"), + m_line_prom(*this, "line"), + m_attr_prom(*this, "attr"), + m_video_ram(*this, "video_ram"), + m_tape_in(1), + m_tape_in_latch(1) { } required_device<cpu_device> m_maincpu; @@ -133,6 +136,14 @@ public: DECLARE_WRITE_LINE_MEMBER( keydown_w ); DECLARE_WRITE8_MEMBER( kbd_w ); + enum + { + MMU_XM = 0x01, + MMU_ROM = 0x02, + MMU_VRAMS = 0x04, + MMU_RAM = 0x08 + }; + // keyboard state int m_key_data; int m_key_strobe; diff --git a/src/mess/includes/hh_tms1k.h b/src/mess/includes/hh_tms1k.h index 1e10012bce0..00e26d5fa81 100644 --- a/src/mess/includes/hh_tms1k.h +++ b/src/mess/includes/hh_tms1k.h @@ -30,9 +30,9 @@ public: // devices required_device<cpu_device> m_maincpu; - optional_ioport_array<7> m_inp_matrix; // max 7 + optional_ioport_array<11> m_inp_matrix; // max 11 optional_device<speaker_sound_device> m_speaker; - + // misc common UINT16 m_r; // MCU R-pins data UINT16 m_o; // MCU O-pins data @@ -47,14 +47,15 @@ public: int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns - - UINT32 m_display_state[0x20]; // display matrix rows data + + UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments UINT32 m_display_cache[0x20]; // (internal use) UINT8 m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); + void set_display_size(int maxx, int maxy); void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); // game-specific handlers @@ -100,6 +101,11 @@ public: DECLARE_WRITE16_MEMBER(starwbc_write_o); DECLARE_READ8_MEMBER(starwbc_read_k); + void astro_display(); + DECLARE_WRITE16_MEMBER(astro_write_r); + DECLARE_WRITE16_MEMBER(astro_write_o); + DECLARE_READ8_MEMBER(astro_read_k); + DECLARE_WRITE16_MEMBER(comp4_write_r); DECLARE_WRITE16_MEMBER(comp4_write_o); DECLARE_READ8_MEMBER(comp4_read_k); @@ -111,6 +117,9 @@ public: DECLARE_WRITE16_MEMBER(ssimon_write_r); DECLARE_WRITE16_MEMBER(ssimon_write_o); DECLARE_READ8_MEMBER(ssimon_read_k); + void ssimon_set_clock(); + DECLARE_INPUT_CHANGED_MEMBER(ssimon_speed_switch); + DECLARE_MACHINE_RESET(ssimon); DECLARE_WRITE16_MEMBER(cnsector_write_r); DECLARE_WRITE16_MEMBER(cnsector_write_o); diff --git a/src/mess/includes/imds2.h b/src/mess/includes/imds2.h index 62887b4b34e..5fb1b513ecf 100644 --- a/src/mess/includes/imds2.h +++ b/src/mess/includes/imds2.h @@ -18,105 +18,105 @@ class imds2_state : public driver_device { - public: - imds2_state(const machine_config &mconfig, device_type type, const char *tag); - - DECLARE_READ8_MEMBER(ipc_mem_read); - DECLARE_WRITE8_MEMBER(ipc_mem_write); - DECLARE_WRITE8_MEMBER(imds2_ipc_control_w); - DECLARE_WRITE_LINE_MEMBER(imds2_ipc_intr); - DECLARE_READ8_MEMBER(imds2_ipcsyspic_r); - DECLARE_READ8_MEMBER(imds2_ipclocpic_r); - DECLARE_WRITE8_MEMBER(imds2_ipcsyspic_w); - DECLARE_WRITE8_MEMBER(imds2_ipclocpic_w); - - DECLARE_WRITE8_MEMBER(imds2_miscout_w); - DECLARE_READ8_MEMBER(imds2_miscin_r); - DECLARE_WRITE_LINE_MEMBER(imds2_beep_timer_w); - DECLARE_WRITE8_MEMBER(imds2_start_timer_w); - DECLARE_READ8_MEMBER(imds2_kb_read); - DECLARE_READ8_MEMBER(imds2_kb_port_p2_r); - DECLARE_WRITE8_MEMBER(imds2_kb_port_p1_w); - DECLARE_READ8_MEMBER(imds2_kb_port_t0_r); - DECLARE_READ8_MEMBER(imds2_kb_port_t1_r); - DECLARE_WRITE8_MEMBER(imds2_ioc_dbbout_w); - DECLARE_WRITE8_MEMBER(imds2_ioc_f0_w); - DECLARE_WRITE8_MEMBER(imds2_ioc_set_f1_w); - DECLARE_WRITE8_MEMBER(imds2_ioc_reset_f1_w); - DECLARE_READ8_MEMBER(imds2_ioc_status_r); - DECLARE_READ8_MEMBER(imds2_ioc_dbbin_r); - DECLARE_READ8_MEMBER(imds2_ipc_dbbout_r); - DECLARE_READ8_MEMBER(imds2_ipc_status_r); - DECLARE_WRITE8_MEMBER(imds2_ipc_dbbin_data_w); - DECLARE_WRITE8_MEMBER(imds2_ipc_dbbin_cmd_w); - DECLARE_WRITE_LINE_MEMBER(imds2_hrq_w); - - DECLARE_READ8_MEMBER(imds2_ioc_mem_r); - DECLARE_WRITE8_MEMBER(imds2_ioc_mem_w); - - I8275_DRAW_CHARACTER_MEMBER(crtc_display_pixels); - - virtual void driver_start(); - virtual void machine_start(); - virtual void video_start(); - virtual void machine_reset(); - - private: - required_device<i8085a_cpu_device> m_ipccpu; - required_device<pic8259_device> m_ipcsyspic; - required_device<pic8259_device> m_ipclocpic; - required_device<i8080a_cpu_device> m_ioccpu; - required_device<i8257_device> m_iocdma; - required_device<i8275_device> m_ioccrtc; - required_device<beep_device> m_iocbeep; - required_device<pit8253_device> m_ioctimer; - required_device<i8271_device> m_iocfdc; - required_device<i8741_device> m_kbcpu; - required_device<palette_device> m_palette; - required_device<gfxdecode_device> m_gfxdecode; - required_device<legacy_floppy_image_device> m_floppy0; - required_ioport m_io_key0; - required_ioport m_io_key1; - required_ioport m_io_key2; - required_ioport m_io_key3; - required_ioport m_io_key4; - required_ioport m_io_key5; - required_ioport m_io_key6; - required_ioport m_io_key7; - required_ioport m_ioc_options; - - dynamic_array<UINT8> m_ipc_ram; - - bool imds2_in_ipc_rom(offs_t offset) const; - - void imds2_update_beeper(void); - - // IPC control port - UINT8 m_ipc_control; - - // IPC ROM content - const UINT8 *m_ipc_rom; - - // Character generator - const UINT8 *m_chargen; - - // MISCOUT state - UINT8 m_miscout; - - // Beeper timer line - int m_beeper_timer; - - // Keyboard state - UINT8 m_kb_p1; - - // IPC to IOC buffer - UINT8 m_ioc_ibf; - - // IOC to IPC buffer - UINT8 m_ioc_obf; - - // IPC/IOC status - UINT8 m_ipc_ioc_status; + public: + imds2_state(const machine_config &mconfig, device_type type, const char *tag); + + DECLARE_READ8_MEMBER(ipc_mem_read); + DECLARE_WRITE8_MEMBER(ipc_mem_write); + DECLARE_WRITE8_MEMBER(imds2_ipc_control_w); + DECLARE_WRITE_LINE_MEMBER(imds2_ipc_intr); + DECLARE_READ8_MEMBER(imds2_ipcsyspic_r); + DECLARE_READ8_MEMBER(imds2_ipclocpic_r); + DECLARE_WRITE8_MEMBER(imds2_ipcsyspic_w); + DECLARE_WRITE8_MEMBER(imds2_ipclocpic_w); + + DECLARE_WRITE8_MEMBER(imds2_miscout_w); + DECLARE_READ8_MEMBER(imds2_miscin_r); + DECLARE_WRITE_LINE_MEMBER(imds2_beep_timer_w); + DECLARE_WRITE8_MEMBER(imds2_start_timer_w); + DECLARE_READ8_MEMBER(imds2_kb_read); + DECLARE_READ8_MEMBER(imds2_kb_port_p2_r); + DECLARE_WRITE8_MEMBER(imds2_kb_port_p1_w); + DECLARE_READ8_MEMBER(imds2_kb_port_t0_r); + DECLARE_READ8_MEMBER(imds2_kb_port_t1_r); + DECLARE_WRITE8_MEMBER(imds2_ioc_dbbout_w); + DECLARE_WRITE8_MEMBER(imds2_ioc_f0_w); + DECLARE_WRITE8_MEMBER(imds2_ioc_set_f1_w); + DECLARE_WRITE8_MEMBER(imds2_ioc_reset_f1_w); + DECLARE_READ8_MEMBER(imds2_ioc_status_r); + DECLARE_READ8_MEMBER(imds2_ioc_dbbin_r); + DECLARE_READ8_MEMBER(imds2_ipc_dbbout_r); + DECLARE_READ8_MEMBER(imds2_ipc_status_r); + DECLARE_WRITE8_MEMBER(imds2_ipc_dbbin_data_w); + DECLARE_WRITE8_MEMBER(imds2_ipc_dbbin_cmd_w); + DECLARE_WRITE_LINE_MEMBER(imds2_hrq_w); + + DECLARE_READ8_MEMBER(imds2_ioc_mem_r); + DECLARE_WRITE8_MEMBER(imds2_ioc_mem_w); + + I8275_DRAW_CHARACTER_MEMBER(crtc_display_pixels); + + virtual void driver_start(); + virtual void machine_start(); + virtual void video_start(); + virtual void machine_reset(); + + private: + required_device<i8085a_cpu_device> m_ipccpu; + required_device<pic8259_device> m_ipcsyspic; + required_device<pic8259_device> m_ipclocpic; + required_device<i8080a_cpu_device> m_ioccpu; + required_device<i8257_device> m_iocdma; + required_device<i8275_device> m_ioccrtc; + required_device<beep_device> m_iocbeep; + required_device<pit8253_device> m_ioctimer; + required_device<i8271_device> m_iocfdc; + required_device<i8741_device> m_kbcpu; + required_device<palette_device> m_palette; + required_device<gfxdecode_device> m_gfxdecode; + required_device<legacy_floppy_image_device> m_floppy0; + required_ioport m_io_key0; + required_ioport m_io_key1; + required_ioport m_io_key2; + required_ioport m_io_key3; + required_ioport m_io_key4; + required_ioport m_io_key5; + required_ioport m_io_key6; + required_ioport m_io_key7; + required_ioport m_ioc_options; + + dynamic_array<UINT8> m_ipc_ram; + + bool imds2_in_ipc_rom(offs_t offset) const; + + void imds2_update_beeper(void); + + // IPC control port + UINT8 m_ipc_control; + + // IPC ROM content + const UINT8 *m_ipc_rom; + + // Character generator + const UINT8 *m_chargen; + + // MISCOUT state + UINT8 m_miscout; + + // Beeper timer line + int m_beeper_timer; + + // Keyboard state + UINT8 m_kb_p1; + + // IPC to IOC buffer + UINT8 m_ioc_ibf; + + // IOC to IPC buffer + UINT8 m_ioc_obf; + + // IPC/IOC status + UINT8 m_ipc_ioc_status; }; #endif /* _IMDS2_H_ */ diff --git a/src/mess/includes/mpf1.h b/src/mess/includes/mpf1.h index 577fce5c55a..f6d16912519 100644 --- a/src/mess/includes/mpf1.h +++ b/src/mess/includes/mpf1.h @@ -59,6 +59,7 @@ public: DECLARE_WRITE8_MEMBER( ppi_pc_w ); DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi ); DECLARE_INPUT_CHANGED_MEMBER( trigger_irq ); + DECLARE_INPUT_CHANGED_MEMBER( trigger_res ); DECLARE_DIRECT_UPDATE_MEMBER(mpf1_direct_update_handler); int m_break; diff --git a/src/mess/layout/astro.lay b/src/mess/layout/astro.lay new file mode 100644 index 00000000000..978e522d543 --- /dev/null +++ b/src/mess/layout/astro.lay @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<mamelayout version="2"> + +<!-- define elements --> + + <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> + + <element name="text_sun"><text string="SUN"><color red="0.66" green="0.66" blue="0.7" /></text></element> + <element name="text_mercury"><text string="MERCURY"><color red="0.66" green="0.66" blue="0.7" /></text></element> + <element name="text_venus"><text string="VENUS"><color red="0.66" green="0.66" blue="0.7" /></text></element> + <element name="text_mars"><text string="MARS"><color red="0.66" green="0.66" blue="0.7" /></text></element> + + <element name="led_g" defstate="0"> + <disk state="1"><color red="0.25" green="1.0" blue="0.25" /></disk> + <disk state="0"><color red="0.05" green="0.2" blue="0.05" /></disk> + </element> + <element name="led_y" defstate="0"> + <disk state="1"><color red="1.0" green="1.0" blue="0.25" /></disk> + <disk state="0"><color red="0.2" green="0.2" blue="0.05" /></disk> + </element> + + <element name="digit" defstate="0"> + <led7seg><color red="0.2" green="1.0" blue="0.85" /></led7seg> + </element> + + +<!-- build screen --> + + <view name="Internal Layout"> + <bounds left="0" right="90" top="0" bottom="32" /> + <bezel element="static_black"> + <bounds left="0" right="90" top="0" bottom="32" /> + </bezel> + + <bezel name="digit0" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel> + <bezel name="digit1" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel> + <bezel name="digit2" element="digit"><bounds x="20" y="0" width="10" height="15" /></bezel> + <bezel name="digit3" element="digit"><bounds x="30" y="0" width="10" height="15" /></bezel> + <bezel name="digit4" element="digit"><bounds x="40" y="0" width="10" height="15" /></bezel> + <bezel name="digit5" element="digit"><bounds x="50" y="0" width="10" height="15" /></bezel> + <bezel name="digit6" element="digit"><bounds x="60" y="0" width="10" height="15" /></bezel> + <bezel name="digit7" element="digit"><bounds x="70" y="0" width="10" height="15" /></bezel> + <bezel name="digit8" element="digit"><bounds x="80" y="0" width="10" height="15" /></bezel> + + <bezel element="text_sun"><bounds x="10" y="22" width="10" height="3" /></bezel> + <bezel element="text_mercury"><bounds x="30" y="22" width="10" height="3" /></bezel> + <bezel element="text_venus"><bounds x="50" y="22" width="10" height="3" /></bezel> + <bezel element="text_mars"><bounds x="70" y="22" width="10" height="3" /></bezel> + + <bezel name="lamp90" element="led_g"><bounds x="10" y="27" width="4" height="4" /></bezel> + <bezel name="lamp91" element="led_y"><bounds x="15" y="27" width="4" height="4" /></bezel> + + <bezel name="lamp92" element="led_g"><bounds x="30" y="27" width="4" height="4" /></bezel> + <bezel name="lamp93" element="led_y"><bounds x="35" y="27" width="4" height="4" /></bezel> + + <bezel name="lamp94" element="led_g"><bounds x="50" y="27" width="4" height="4" /></bezel> + <bezel name="lamp95" element="led_y"><bounds x="55" y="27" width="4" height="4" /></bezel> + + <bezel name="lamp96" element="led_g"><bounds x="70" y="27" width="4" height="4" /></bezel> + <bezel name="lamp97" element="led_y"><bounds x="75" y="27" width="4" height="4" /></bezel> + + + </view> +</mamelayout> diff --git a/src/mess/layout/mbdtower.lay b/src/mess/layout/mbdtower.lay index aff46ef4eff..7dc9b1b61e7 100644 --- a/src/mess/layout/mbdtower.lay +++ b/src/mess/layout/mbdtower.lay @@ -4,22 +4,111 @@ <!-- define elements --> <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> + <element name="static_white"><rect><color red="1.0" green="1.0" blue="1.0" /></rect></element> + + <element name="mask" defstate="0"> + <text string=" "><color red="0.0" green="0.0" blue="0.0" /></text> + <rect state="0"><color red="0.0" green="0.0" blue="0.0" /></rect> + </element> + + <element name="card1" defstate="0"> + <rect><color red="1.0" green="1.0" blue="1.0" /></rect> + <text state="0" string="CURSED"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="1" string="VICTORY"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="2" string="WIZARD"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="3" string="DRAGON"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="4" string="GOLD KEY"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="5" string="SCOUT"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="6" string="WARRIOR"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="7" string=" "><color red="0.0" green="0.0" blue="0.0" /></text> + </element> + + <element name="card2" defstate="0"> + <rect><color red="1.0" green="1.0" blue="1.0" /></rect> + <text state="0" string="LOST"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="1" string="WARRIORS"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="2" string="BAZAAR CLOSED"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="3" string="SWORD"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="4" string="SILVER KEY"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="5" string="HEALER"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="6" string="FOOD"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="7" string=" "><color red="0.0" green="0.0" blue="0.0" /></text> + </element> + + <element name="card3" defstate="0"> + <rect><color red="1.0" green="1.0" blue="1.0" /></rect> + <text state="0" string="PLAGUE"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="1" string="BRIGANDS"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="2" string="KEY MISSING"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="3" string="PEGASUS"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="4" string="BRASS KEY"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="5" string="GOLD"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="6" string="BEAST"><color red="0.0" green="0.0" blue="0.0" /></text> + <text state="7" string=" "><color red="0.0" green="0.0" blue="0.0" /></text> + </element> + + <element name="text_m1"><text string="(motor pos: 0." align="1"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="text_m2"><text string=")" align="1"><color red="0.95" green="0.95" blue="0.95" /></text></element> + <element name="counter" defstate="0"> + <simplecounter maxstate="99" digits="2" align="1"> + <color red="0.95" green="0.95" blue="0.95" /> + </simplecounter> + </element> <element name="digit" defstate="0"> <led7seg><color red="1.0" green="0.20" blue="0.22" /></led7seg> </element> + <element name="led" defstate="0"> + <disk state="0"><color red="0.2" green="0.04" blue="0.05" /></disk> + <disk state="1"><color red="1.0" green="0.20" blue="0.22" /></disk> + </element> + + <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="64" top="0" bottom="64" /> + <bounds left="0" right="40" top="0" bottom="118" /> <bezel element="static_black"> - <bounds left="0" right="64" top="0" bottom="64" /> + <bounds left="0" right="40" top="0" bottom="118" /> + </bezel> + + <bezel name="digit1" element="digit"><bounds x="10" y="3" width="10" height="15" /></bezel> + <bezel name="digit2" element="digit"><bounds x="20" y="3" width="10" height="15" /></bezel> + + <!-- card lamps --> + + <bezel element="static_white"><bounds x="1" y="28" width="38" height="25" /></bezel> + <bezel name="card_pos" element="card1"><bounds x="1" y="38" width="38" height="5" /></bezel> + <bezel name="lamp3" element="mask"> + <bounds x="1" y="28" width="38" height="25" /> + <color alpha="0.8" /> </bezel> - <bezel name="digit1" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel> - <bezel name="digit2" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel> + <bezel element="static_white"><bounds x="1" y="56" width="38" height="25" /></bezel> + <bezel name="card_pos" element="card2"><bounds x="1" y="66" width="38" height="5" /></bezel> + <bezel name="lamp2" element="mask"> + <bounds x="1" y="56" width="38" height="25" /> + <color alpha="0.8" /> + </bezel> + + <bezel element="static_white"><bounds x="1" y="84" width="38" height="25" /></bezel> + <bezel name="card_pos" element="card3"><bounds x="1" y="94" width="38" height="5" /></bezel> + <bezel name="lamp1" element="mask"> + <bounds x="1" y="84" width="38" height="25" /> + <color alpha="0.8" /> + </bezel> + + <!-- motor status info --> + + <bezel element="text_m1"><bounds x="7" y="112" width="22" height="4" /></bezel> + <bezel name="motor_pos" element="counter"><bounds x="27.6" y="112" width="10" height="4" /></bezel> + <bezel element="text_m2"><bounds x="31.4" y="112" width="5" height="4" /></bezel> + <bezel name="motor_on" element="mask"> + <bounds x="1" y="111" width="38" height="6" /> + <color alpha="0.75" /> + </bezel> </view> diff --git a/src/mess/layout/ssimon.lay b/src/mess/layout/ssimon.lay index 940ef1a955e..d2d43002475 100644 --- a/src/mess/layout/ssimon.lay +++ b/src/mess/layout/ssimon.lay @@ -4,14 +4,148 @@ <!-- define elements --> <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> + <element name="static_grey"><rect><color red="0.6" green="0.6" blue="0.6" /></rect></element> + + <element name="text_tie"> + <rect><color red="0.6" green="0.6" blue="0.6" /></rect> + <text string="TIE"><color red="0.0" green="0.0" blue="0.0" /></text> + </element> + <element name="text_win"> + <rect><color red="0.6" green="0.6" blue="0.6" /></rect> + <text string="WIN"><color red="0.0" green="0.0" blue="0.0" /></text> + </element> + <element name="text_lose"> + <rect><color red="0.6" green="0.6" blue="0.6" /></rect> + <text string="LOSE"><color red="0.0" green="0.0" blue="0.0" /></text> + </element> + + <element name="text_decision"> + <rect><color red="0.0" green="0.0" blue="0.0" /></rect> + <text string="DECISION"><color red="0.6" green="0.6" blue="0.6" /></text> + </element> + <element name="text_longest"> + <rect><color red="0.0" green="0.0" blue="0.0" /></rect> + <text string="LONGEST"><color red="0.6" green="0.6" blue="0.6" /></text> + </element> + <element name="text_last"> + <rect><color red="0.0" green="0.0" blue="0.0" /></rect> + <text string="LAST"><color red="0.6" green="0.6" blue="0.6" /></text> + </element> + <element name="text_start"> + <rect><color red="0.0" green="0.0" blue="0.0" /></rect> + <text string="START"><color red="0.6" green="0.6" blue="0.6" /></text> + </element> + + <element name="button" defstate="0"> + <rect> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0" width="1.6" height="1" /> + </rect> + <rect state="0"> + <color red="0.4" green="0.4" blue="0.06" /> + <bounds x="0.2" y="0.2" width="1.2" height="0.6" /> + </rect> + <rect state="0"> + <color red="0.6" green="0.6" blue="0.1" /> + <bounds x="0.3" y="0.1" width="1.2" height="0.6" /> + </rect> + <rect state="1"> + <color red="0.6" green="0.6" blue="0.1" /> + <bounds x="0.2" y="0.2" width="1.2" height="0.6" /> + </rect> + </element> + + <element name="lamp_r" defstate="0"> + <rect state="0"><color red="0.5" green="0.15" blue="0.1" /></rect> + <rect state="1"><color red="1.0" green="0.4" blue="0.28" /></rect> + </element> + <element name="lamp_b" defstate="0"> + <rect state="0"><color red="0.1" green="0.15" blue="0.5" /></rect> + <rect state="1"><color red="0.3" green="0.42" blue="1.0" /></rect> + </element> + <element name="lamp_g" defstate="0"> + <rect state="0"><color red="0.15" green="0.5" blue="0.1" /></rect> + <rect state="1"><color red="0.52" green="1.0" blue="0.4" /></rect> + </element> + <element name="lamp_y" defstate="0"> + <rect state="0"><color red="0.5" green="0.45" blue="0.1" /></rect> + <rect state="1"><color red="1.0" green="0.93" blue="0.4" /></rect> + </element> + <!-- build screen --> <view name="Internal Layout"> - <bounds left="0" right="64" top="0" bottom="64" /> + <bounds left="0" right="47" top="0" bottom="53" /> <bezel element="static_black"> - <bounds left="0" right="64" top="0" bottom="64" /> + <bounds left="0" right="47" top="0" bottom="53" /> + </bezel> + + <!-- lamps --> + + <bezel name="lamp3" element="lamp_r" inputtag="IN.1" inputmask="0x08"> + <bounds x="1" y="1" width="10" height="20" /> + </bezel> + <bezel name="lamp2" element="lamp_b" inputtag="IN.1" inputmask="0x04"> + <bounds x="12" y="1" width="10" height="20" /> + </bezel> + <bezel name="lamp1" element="lamp_g" inputtag="IN.1" inputmask="0x02"> + <bounds x="25" y="1" width="10" height="20" /> + </bezel> + <bezel name="lamp0" element="lamp_y" inputtag="IN.1" inputmask="0x01"> + <bounds x="36" y="1" width="10" height="20" /> + </bezel> + + <bezel name="lamp3" element="lamp_r" inputtag="IN.3" inputmask="0x08"> + <bounds x="1" y="32" width="10" height="20" /> + </bezel> + <bezel name="lamp2" element="lamp_b" inputtag="IN.3" inputmask="0x04"> + <bounds x="12" y="32" width="10" height="20" /> + </bezel> + <bezel name="lamp1" element="lamp_g" inputtag="IN.3" inputmask="0x02"> + <bounds x="25" y="32" width="10" height="20" /> + </bezel> + <bezel name="lamp0" element="lamp_y" inputtag="IN.3" inputmask="0x01"> + <bounds x="36" y="32" width="10" height="20" /> + </bezel> + + <!-- middle bezel --> + + <bezel element="static_grey"><bounds x="1" y="22" width="45" height="9" /></bezel> + + <bezel element="text_tie"><bounds x="1" y="22.2" width="10" height="0.6" /></bezel> + <bezel element="text_lose"><bounds x="12" y="22.2" width="10" height="0.6" /></bezel> + <bezel element="text_win"><bounds x="25" y="22.2" width="10" height="0.6" /></bezel> + <bezel element="text_lose"><bounds x="36" y="22.2" width="10" height="0.6" /></bezel> + + <bezel element="text_tie"><bounds x="1" y="30.2" width="10" height="0.6" /></bezel> + <bezel element="text_win"><bounds x="12" y="30.2" width="10" height="0.6" /></bezel> + <bezel element="text_lose"><bounds x="25" y="30.2" width="10" height="0.6" /></bezel> + <bezel element="text_lose"><bounds x="36" y="30.2" width="10" height="0.6" /></bezel> + + <bezel element="static_black"><bounds x="2" y="24" width="7" height="2" /></bezel> + <bezel element="text_decision"><bounds x="2" y="24.3" width="7" height="1.4" /></bezel> + <bezel element="button" inputtag="IN.2" inputmask="0x08"> + <bounds x="9.5" y="24" width="3.2" height="2" /> + </bezel> + + <bezel element="static_black"><bounds x="2" y="27" width="7" height="2" /></bezel> + <bezel element="text_longest"><bounds x="2" y="27.3" width="7" height="1.4" /></bezel> + <bezel element="button" inputtag="IN.2" inputmask="0x04"> + <bounds x="9.5" y="27" width="3.2" height="2" /> + </bezel> + + <bezel element="static_black"><bounds x="38" y="24" width="7" height="2" /></bezel> + <bezel element="text_last"><bounds x="38" y="24.3" width="7" height="1.4" /></bezel> + <bezel element="button" inputtag="IN.2" inputmask="0x02"> + <bounds x="34.3" y="24" width="3.2" height="2" /> + </bezel> + + <bezel element="static_black"><bounds x="38" y="27" width="7" height="2" /></bezel> + <bezel element="text_start"><bounds x="38" y="27.3" width="7" height="1.4" /></bezel> + <bezel element="button" inputtag="IN.2" inputmask="0x01"> + <bounds x="34.3" y="27" width="3.2" height="2" /> </bezel> diff --git a/src/mess/mess.lst b/src/mess/mess.lst index 643bd5452b8..b385b9910f8 100644 --- a/src/mess/mess.lst +++ b/src/mess/mess.lst @@ -1070,17 +1070,21 @@ avigo_it // 1997 Avigo (Italian) // TI Speak & Spell snspell snspella +snspellb snspelluk snspelluka snspelljp ladictee snmath snmathp +snread lantutor // Texas Instruments Calculators tisr16 // 1974 SR-16 +tisr16ii ti1270 +ti1000 ti30 // 1976 TI-30 tiprog tibusan1 @@ -2204,9 +2208,10 @@ ebball3 // Entex elecdet // Ideal starwbc // Kenner starwbcp // Kenner (prototype) +astro // Kosmos comp4 // Milton Bradley simon // Milton Bradley -//ssimon // Milton Bradley +ssimon // Milton Bradley cnsector // Parker Bros merlin // Parker Bros stopthie // Parker Bros diff --git a/src/mess/mess.mak b/src/mess/mess.mak index 69845afe992..ec5d2c2dd92 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -1,2250 +1,13 @@ ########################################################################### # -# mess.mak +# makefile # -# MESS target makefile +# Additional makefile for building MESS # -########################################################################### - -ifeq ($(TARGET),mess) -# In order to keep dependencies reasonable, we exclude objects in the base of -# $(SRC)/emu, as well as all the OSD objects and anything in the $(OBJ) tree -depend: maketree $(MAKEDEP_TARGET) - @echo Rebuilding depend_emu.mak... - $(MAKEDEP) -I. $(INCPATH) -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/emu > depend_emu.mak - @echo Rebuilding depend_$(TARGET).mak... - $(MAKEDEP) -I. $(INCPATH) -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/$(TARGET) > depend_$(TARGET).mak -endif - -# include MESS core defines -include $(SRC)/mess/messcore.mak - - -#------------------------------------------------- -# specify available CPU cores -#------------------------------------------------- - -CPUS += Z80 -CPUS += Z180 -CPUS += I8085 -CPUS += I8089 -CPUS += M6502 -CPUS += H6280 -CPUS += I86 -CPUS += I386 -CPUS += NEC -CPUS += V30MZ -CPUS += V60 -CPUS += MCS48 -CPUS += MCS51 -CPUS += MCS96 -CPUS += M6800 -CPUS += M6805 -CPUS += HD6309 -CPUS += M6809 -CPUS += KONAMI -CPUS += M680X0 -CPUS += T11 -CPUS += S2650 -CPUS += TMS340X0 -CPUS += TMS9900 -CPUS += TMS9995 -CPUS += TMS9900L -CPUS += Z8000 -CPUS += Z8001 -CPUS += TMS32010 -CPUS += TMS32025 -CPUS += TMS32031 -CPUS += TMS32051 -CPUS += TMS32082 -CPUS += TMS57002 -CPUS += CCPU -CPUS += ADSP21XX -CPUS += ASAP -CPUS += AM29000 -CPUS += UPD7810 -CPUS += ARM -CPUS += ARM7 -CPUS += JAGUAR -CPUS += CUBEQCPU -CPUS += ESRIP -CPUS += MIPS -CPUS += PSX -CPUS += SH2 -CPUS += SH4 -CPUS += DSP16A -CPUS += DSP32C -CPUS += PIC16C5X -CPUS += PIC16C62X -CPUS += G65816 -CPUS += SPC700 -CPUS += E1 -CPUS += I860 -CPUS += I960 -CPUS += H8 -CPUS += V810 -CPUS += M37710 -CPUS += POWERPC -CPUS += SE3208 -CPUS += MC68HC11 -CPUS += ADSP21062 -CPUS += DSP56156 -CPUS += RSP -CPUS += ALPHA8201 -CPUS += COP400 -CPUS += TLCS90 -CPUS += TLCS900 -CPUS += MB88XX -CPUS += MB86233 -CPUS += MB86235 -CPUS += SSP1601 -CPUS += APEXC -CPUS += CP1610 -CPUS += F8 -CPUS += LH5801 -CPUS += PDP1 -CPUS += SATURN -CPUS += SC61860 -CPUS += LR35902 -CPUS += TMS7000 -CPUS += SM8500 -CPUS += MINX -CPUS += SSEM -CPUS += AVR8 -CPUS += TMS0980 -CPUS += I4004 -CPUS += SUPERFX -CPUS += Z8 -CPUS += I8008 -CPUS += SCMP -CPUS += MN10200 -CPUS += COSMAC -CPUS += UNSP -CPUS += HCD62121 -CPUS += PPS4 -CPUS += UPD7725 -CPUS += HD61700 -CPUS += LC8670 -CPUS += SCORE -CPUS += ES5510 -CPUS += SCUDSP -CPUS += IE15 -CPUS += 8X300 -CPUS += ALTO2 -#CPUS += W65816 -CPUS += ARC -CPUS += ARCOMPACT -CPUS += AMIS2000 -CPUS += UCOM4 -CPUS += HMCS40 - -#------------------------------------------------- -# specify available sound cores; some of these are -# only for MAME and so aren't included -#------------------------------------------------- - -#SOUNDS += SAMPLES -SOUNDS += DAC -SOUNDS += DMADAC -SOUNDS += SPEAKER -SOUNDS += BEEP -SOUNDS += DISCRETE -SOUNDS += AY8910 -SOUNDS += YM2151 -SOUNDS += YM2203 -SOUNDS += YM2413 -SOUNDS += YM2608 -SOUNDS += YM2610 -SOUNDS += YM2610B -SOUNDS += YM2612 -#SOUNDS += YM3438 -SOUNDS += YM3812 -SOUNDS += YM3526 -SOUNDS += Y8950 -SOUNDS += YMF262 -#SOUNDS += YMF271 -#SOUNDS += YMF278B -#SOUNDS += YMZ280B -SOUNDS += SN76477 -SOUNDS += SN76496 -SOUNDS += POKEY -SOUNDS += TIA -SOUNDS += NES_APU -SOUNDS += AMIGA -SOUNDS += ASTROCADE -#SOUNDS += NAMCO -#SOUNDS += NAMCO_15XX -#SOUNDS += NAMCO_CUS30 -#SOUNDS += NAMCO_52XX -#SOUNDS += NAMCO_63701X -SOUNDS += T6W28 -#SOUNDS += SNKWAVE -#SOUNDS += C140 -#SOUNDS += C352 -#SOUNDS += TMS36XX -#SOUNDS += TMS3615 -SOUNDS += TMS5110 -SOUNDS += TMS5220 -SOUNDS += VLM5030 -#SOUNDS += ADPCM -SOUNDS += MSM5205 -#SOUNDS += MSM5232 -SOUNDS += OKIM6258 -SOUNDS += OKIM6295 -#SOUNDS += OKIM6376 -#SOUNDS += OKIM9810 -SOUNDS += UPD7752 -SOUNDS += UPD7759 -SOUNDS += HC55516 -#SOUNDS += TC8830F -#SOUNDS += K005289 -#SOUNDS += K007232 -SOUNDS += K051649 -#SOUNDS += K053260 -#SOUNDS += K054539 -#SOUNDS += K056800 -#SOUNDS += SEGAPCM -#SOUNDS += MULTIPCM -SOUNDS += SCSP -SOUNDS += AICA -SOUNDS += RF5C68 -#SOUNDS += RF5C400 -#SOUNDS += CEM3394 -SOUNDS += QSOUND -#SOUNDS += QS1000 -SOUNDS += SAA1099 -#SOUNDS += IREMGA20 -SOUNDS += ES5503 -SOUNDS += ES5505 -SOUNDS += ES5506 -#SOUNDS += BSMT2000 -#SOUNDS += GAELCO_CG1V -#SOUNDS += GAELCO_GAE1 -SOUNDS += C6280 -#SOUNDS += SP0250 -SOUNDS += SPU -SOUNDS += CDDA -#SOUNDS += ICS2115 -#SOUNDS += I5000_SND -#SOUNDS += ST0016 -#SOUNDS += NILE -#SOUNDS += X1_010 -#SOUNDS += VRENDER0 -SOUNDS += VOTRAX -#SOUNDS += ES8712 -SOUNDS += CDP1869 -SOUNDS += S14001A -SOUNDS += WAVE -SOUNDS += SID6581 -SOUNDS += SID8580 -SOUNDS += SP0256 -#SOUNDS += DIGITALKER -SOUNDS += CDP1863 -SOUNDS += CDP1864 -#SOUNDS += ZSG2 -SOUNDS += MOS656X -SOUNDS += ASC -#SOUNDS += MAS3507D -SOUNDS += SOCRATES -SOUNDS += TMC0285 -SOUNDS += TMS5200 -SOUNDS += CD2801 -SOUNDS += CD2802 -#SOUNDS += M58817 -SOUNDS += TMC0281 -SOUNDS += TMS5100 -SOUNDS += TMS5110A -SOUNDS += LMC1992 -SOUNDS += AWACS -#SOUNDS += YMZ770 -SOUNDS += T6721A -SOUNDS += MOS7360 -SOUNDS += ESQPUMP -SOUNDS += VRC6 - -#------------------------------------------------- -# specify available video cores -#------------------------------------------------- - -VIDEOS += SEGA315_5124 -VIDEOS += SEGA315_5313 -#VIDEOS += BUFSPRITE -VIDEOS += CDP1861 -VIDEOS += CDP1862 -VIDEOS += CRT9007 -VIDEOS += CRT9021 -VIDEOS += CRT9212 -VIDEOS += CRTC_EGA -VIDEOS += DL1416 -VIDEOS += DM9368 -VIDEOS += EF9340_1 -VIDEOS += EF9345 -VIDEOS += GF4500 -#VIDEOS += EPIC12 -#VIDEOS += FIXFREQ -#VIDEOS += H63484 -VIDEOS += HD44102 -VIDEOS += HD44352 -VIDEOS += HD44780 -VIDEOS += HD61830 -#VIDEOS += HD63484 -VIDEOS += HD66421 -VIDEOS += HUC6202 -VIDEOS += HUC6260 -VIDEOS += HUC6261 -VIDEOS += HUC6270 -VIDEOS += HUC6272 -VIDEOS += I8244 -VIDEOS += I8275 -#VIDEOS += M50458 -#VIDEOS += MB90082 -#VIDEOS += MB_VCU -VIDEOS += MC6845 -VIDEOS += MC6847 -VIDEOS += MSM6222B -VIDEOS += MSM6255 -VIDEOS += MOS6566 -VIDEOS += PC_VGA -#VIDEOS += POLY -VIDEOS += PSX -VIDEOS += RAMDAC -VIDEOS += S2636 -VIDEOS += SAA5050 -VIDEOS += SED1200 -VIDEOS += SED1330 -VIDEOS += SED1520 -VIDEOS += SNES_PPU -VIDEOS += STVVDP -VIDEOS += T6A04 -VIDEOS += TEA1002 -#VIDEOS += TLC34076 -#VIDEOS += TMS34061 -VIDEOS += TMS3556 -VIDEOS += TMS9927 -VIDEOS += TMS9928A -VIDEOS += UPD3301 -VIDEOS += UPD7220 -VIDEOS += UPD7227 -VIDEOS += V9938 -VIDEOS += VIC4567 -#VIDEOS += VOODOO -VIDEOS += SCN2674 - -#------------------------------------------------- -# specify available machine cores -#------------------------------------------------- - -MACHINES += AKIKO -MACHINES += AUTOCONFIG -MACHINES += CR511B -MACHINES += DMAC -MACHINES += GAYLE -#MACHINES += NCR53C7XX -#MACHINES += LSI53C810 -MACHINES += 6522VIA -#MACHINES += TPI6525 -#MACHINES += RIOT6532 -MACHINES += 6821PIA -MACHINES += 6840PTM -MACHINES += 68561MPCC -#MACHINES += ACIA6850 -MACHINES += 68681 -MACHINES += 7200FIFO -MACHINES += 8530SCC -#MACHINES += TTL74123 -#MACHINES += TTL74145 -#MACHINES += TTL74148 -#MACHINES += TTL74153 -#MACHINES += TTL74181 -#MACHINES += TTL7474 -#MACHINES += KBDC8042 -#MACHINES += I8257 -MACHINES += AAKARTDEV -MACHINES += ACIA6850 -MACHINES += ADC0808 -MACHINES += ADC083X -MACHINES += ADC1038 -MACHINES += ADC1213X -MACHINES += AICARTC -MACHINES += AM53CF96 -MACHINES += AM9517A -MACHINES += AMIGAFDC -MACHINES += AT_KEYBC -MACHINES += AT28C16 -MACHINES += AT29040 -MACHINES += AT45DBXX -MACHINES += ATAFLASH -MACHINES += AY31015 -MACHINES += BANKDEV -MACHINES += CDP1852 -MACHINES += CDP1871 -MACHINES += CMOS40105 -#MACHINES += CDU76S -MACHINES += COM8116 -MACHINES += CR589 -MACHINES += CS4031 -MACHINES += CS8221 -MACHINES += DP8390 -#MACHINES += DS1204 -MACHINES += DS1302 -MACHINES += DS1315 -MACHINES += DS2401 -MACHINES += DS2404 -MACHINES += DS75160A -MACHINES += DS75161A -MACHINES += E0516 -MACHINES += E05A03 -MACHINES += E05A30 -MACHINES += EEPROMDEV -MACHINES += ER2055 -MACHINES += F3853 -MACHINES += HD63450 -MACHINES += HD64610 -MACHINES += I2CMEM -MACHINES += I80130 -MACHINES += I8089 -MACHINES += I8155 -MACHINES += I8212 -MACHINES += I8214 -MACHINES += I8243 -MACHINES += I8251 -MACHINES += I8255 -MACHINES += I8257 -MACHINES += I8271 -MACHINES += I8279 -MACHINES += I8355 -MACHINES += IDE -MACHINES += IM6402 -MACHINES += INS8154 -MACHINES += INS8250 -MACHINES += INTELFLASH -MACHINES += JVS -MACHINES += K033906 -MACHINES += K053252 -MACHINES += K056230 -MACHINES += KB3600 -MACHINES += KBDC8042 -MACHINES += KR2376 -MACHINES += LATCH8 -MACHINES += LC89510 -MACHINES += LDPR8210 -MACHINES += LDSTUB -MACHINES += LDV1000 -MACHINES += LDVP931 -MACHINES += LH5810 -MACHINES += LINFLASH -#MACHINES += LPCI -MACHINES += LSI53C810 -MACHINES += M68307 -MACHINES += M68340 -MACHINES += M6M80011AP -MACHINES += MATSUCD -MACHINES += MB14241 -MACHINES += MB3773 -MACHINES += MB8421 -MACHINES += MB87078 -MACHINES += MB8795 -MACHINES += MB89352 -MACHINES += MB89371 -MACHINES += MC146818 -MACHINES += MC2661 -MACHINES += MC6843 -MACHINES += MC6846 -MACHINES += MC6852 -MACHINES += MC6854 -MACHINES += MC68328 -MACHINES += MC68901 -MACHINES += MCCS1850 -#MACHINES += M68307 -#MACHINES += M68340 -MACHINES += MCF5206E -MACHINES += MICROTOUCH -MACHINES += MIOT6530 -MACHINES += MM58167 -MACHINES += MM58274C -MACHINES += MM74C922 -MACHINES += MOS6526 -MACHINES += MOS6529 -#MACHINES += MIOT6530 -MACHINES += MOS6551 -MACHINES += MOS6702 -MACHINES += MOS8706 -MACHINES += MOS8722 -MACHINES += MOS8726 -MACHINES += MPU401 -MACHINES += MSM5832 -MACHINES += MSM58321 -MACHINES += MSM6242 -MACHINES += NCR5380 -MACHINES += NCR5380N -MACHINES += NCR5390 -MACHINES += NCR539x -MACHINES += NCR53C7XX -MACHINES += NMC9306 -MACHINES += NSC810 -MACHINES += NSCSI -MACHINES += OMTI5100 -MACHINES += PC_FDC -MACHINES += PC_LPT -MACHINES += PCCARD -MACHINES += PCF8593 -MACHINES += PCKEYBRD -MACHINES += PIC8259 -MACHINES += PIT8253 -MACHINES += PLA -#MACHINES += PROFILE -MACHINES += R64H156 -MACHINES += RF5C296 -MACHINES += RIOT6532 -MACHINES += ROC10937 -MACHINES += RP5C01 -MACHINES += RP5C15 -MACHINES += RP5H01 -MACHINES += RTC4543 -MACHINES += RTC65271 -MACHINES += RTC9701 -#MACHINES += S2636 -MACHINES += S3520CF -MACHINES += S3C2400 -MACHINES += S3C2410 -MACHINES += S3C2440 -MACHINES += S3C44B0 -MACHINES += SATURN -#MACHINES += SCSI -MACHINES += SCUDSP -MACHINES += SECFLASH -MACHINES += SEIBU_COP -#MACHINES += SERFLASH -MACHINES += SMC91C9X -MACHINES += SMPC -MACHINES += STVCD -MACHINES += TC0091LVC -MACHINES += TIMEKPR -MACHINES += TMP68301 -MACHINES += TMS5501 -MACHINES += TMS6100 -MACHINES += TMS9901 -MACHINES += TMS9902 -MACHINES += TPI6525 -MACHINES += TTL74123 -MACHINES += TTL74145 -MACHINES += TTL74148 -MACHINES += TTL74153 -MACHINES += TTL74181 -MACHINES += TTL7474 -MACHINES += UPD1990A -#MACHINES += UPD4992 -MACHINES += UPD4701 -MACHINES += UPD7002 -MACHINES += UPD71071 -MACHINES += UPD765 -MACHINES += V3021 -MACHINES += WD_FDC -MACHINES += WD11C00_17 -MACHINES += WD17XX -MACHINES += WD2010 -MACHINES += WD33C93 -MACHINES += WD7600 -MACHINES += X2212 -MACHINES += X76F041 -MACHINES += X76F100 -MACHINES += YM2148 -MACHINES += Z80CTC -MACHINES += Z80DART -MACHINES += Z80DMA -MACHINES += Z80PIO -MACHINES += Z80STI -MACHINES += Z8536 -#MACHINES += SECFLASH -#MACHINES += PCCARD -MACHINES += SMC92X4 -MACHINES += HDC9234 -MACHINES += TI99_HD -MACHINES += STRATA -MACHINES += STEPPERS -MACHINES += CORVUSHD -MACHINES += WOZFDC -MACHINES += DIABLO_HD - -#------------------------------------------------- -# specify available bus cores -#------------------------------------------------- - -BUSES += A1BUS -BUSES += A2BUS -BUSES += A7800 -BUSES += A800 -BUSES += A8SIO -BUSES += ABCBUS -BUSES += ABCKB -BUSES += ADAM -BUSES += ADAMNET -BUSES += APF -BUSES += ARCADIA -BUSES += ASTROCADE -BUSES += BML3 -BUSES += BW2 -BUSES += C64 -BUSES += CBM2 -BUSES += CBMIEC -BUSES += CENTRONICS -BUSES += CHANNELF -BUSES += COCO -BUSES += COLECO -BUSES += COMPUCOLOR -BUSES += COMX35 -BUSES += CPC -BUSES += CRVISION -BUSES += DMV -BUSES += ECBBUS -BUSES += ECONET -BUSES += EP64 -BUSES += EPSON_SIO -BUSES += GAMEBOY -BUSES += GAMEGEAR -BUSES += GBA -BUSES += GENERIC -BUSES += IEEE488 -BUSES += IMI7000 -BUSES += INTV -BUSES += IQ151 -BUSES += ISA -BUSES += ISBX -BUSES += KC -BUSES += LPCI -BUSES += MACPDS -BUSES += MIDI -BUSES += MEGADRIVE -BUSES += MSX_SLOT -BUSES += NEOGEO -BUSES += NES -BUSES += NES_CTRL -BUSES += NUBUS -BUSES += O2 -BUSES += ORICEXT -BUSES += PCE -BUSES += PC_JOY -BUSES += PC_KBD -BUSES += PET -BUSES += PLUS4 -BUSES += PSX_CONTROLLER -BUSES += QL -BUSES += RS232 -BUSES += S100 -BUSES += SATURN -BUSES += SCSI -BUSES += SCV -BUSES += SEGA8 -BUSES += SMS_CTRL -BUSES += SMS_EXP -BUSES += SNES -BUSES += SNES_CTRL -BUSES += SPC1000 -BUSES += TI99PEB -BUSES += TVC -BUSES += VBOY -BUSES += VC4000 -BUSES += VCS -BUSES += VCS_CTRL -BUSES += VECTREX -BUSES += VIC10 -BUSES += VIC20 -BUSES += VIDBRAIN -BUSES += VIP -BUSES += VTECH_IOEXP -BUSES += VTECH_MEMEXP -BUSES += WANGPC -BUSES += WSWAN -BUSES += X68K -BUSES += Z88 -BUSES += ZORRO - -#------------------------------------------------- -# this is the list of driver libraries that -# comprise MESS plus messdriv.o which contains -# the list of drivers -#------------------------------------------------- - -DRVLIBS += \ - $(MESSOBJ)/acorn.a \ - $(MESSOBJ)/act.a \ - $(MESSOBJ)/adc.a \ - $(MESSOBJ)/alesis.a \ - $(MESSOBJ)/altos.a \ - $(MESSOBJ)/amiga.a \ - $(MESSOBJ)/amstrad.a \ - $(MESSOBJ)/apf.a \ - $(MESSOBJ)/apollo.a \ - $(MESSOBJ)/apple.a \ - $(MESSOBJ)/applied.a \ - $(MESSOBJ)/arcadia.a \ - $(MESSOBJ)/ascii.a \ - $(MESSOBJ)/at.a \ - $(MESSOBJ)/atari.a \ - $(MESSOBJ)/att.a \ - $(MESSOBJ)/bally.a \ - $(MESSOBJ)/bandai.a \ - $(MESSOBJ)/banctec.a \ - $(MESSOBJ)/be.a \ - $(MESSOBJ)/bnpo.a \ - $(MESSOBJ)/bondwell.a \ - $(MESSOBJ)/booth.a \ - $(MESSOBJ)/camputers.a \ - $(MESSOBJ)/canon.a \ - $(MESSOBJ)/cantab.a \ - $(MESSOBJ)/casio.a \ - $(MESSOBJ)/cbm.a \ - $(MESSOBJ)/cccp.a \ - $(MESSOBJ)/cce.a \ - $(MESSOBJ)/ccs.a \ - $(MESSOBJ)/chromatics.a \ - $(MESSOBJ)/coleco.a \ - $(MESSOBJ)/cromemco.a \ - $(MESSOBJ)/comx.a \ - $(MESSOBJ)/concept.a \ - $(MESSOBJ)/conitec.a \ - $(MESSOBJ)/cybiko.a \ - $(MESSOBJ)/dai.a \ - $(MESSOBJ)/ddr.a \ - $(MESSOBJ)/dec.a \ - $(MESSOBJ)/dicksmth.a \ - $(MESSOBJ)/dms.a \ - $(MESSOBJ)/dragon.a \ - $(MESSOBJ)/drc.a \ - $(MESSOBJ)/eaca.a \ - $(MESSOBJ)/einis.a \ - $(MESSOBJ)/elektor.a \ - $(MESSOBJ)/elektrka.a \ - $(MESSOBJ)/ensoniq.a \ - $(MESSOBJ)/enterprise.a \ - $(MESSOBJ)/entex.a \ - $(MESSOBJ)/epoch.a \ - $(MESSOBJ)/epson.a \ - $(MESSOBJ)/exidy.a \ - $(MESSOBJ)/fairch.a \ - $(MESSOBJ)/fidelity.a \ - $(MESSOBJ)/fujitsu.a \ - $(MESSOBJ)/funtech.a \ - $(MESSOBJ)/galaxy.a \ - $(MESSOBJ)/gamepark.a \ - $(MESSOBJ)/gi.a \ - $(MESSOBJ)/grundy.a \ - $(MESSOBJ)/hartung.a \ - $(MESSOBJ)/heathkit.a \ - $(MESSOBJ)/hec2hrp.a \ - $(MESSOBJ)/hegener.a \ - $(MESSOBJ)/hitachi.a \ - $(MESSOBJ)/homebrew.a \ - $(MESSOBJ)/homelab.a \ - $(MESSOBJ)/hp.a \ - $(MESSOBJ)/imp.a \ - $(MESSOBJ)/intel.a \ - $(MESSOBJ)/interton.a \ - $(MESSOBJ)/intv.a \ - $(MESSOBJ)/isc.a \ - $(MESSOBJ)/kaypro.a \ - $(MESSOBJ)/koei.a \ - $(MESSOBJ)/kyocera.a \ - $(MESSOBJ)/luxor.a \ - $(MESSOBJ)/magnavox.a \ - $(MESSOBJ)/makerbot.a \ - $(MESSOBJ)/marx.a \ - $(MESSOBJ)/matsushi.a \ - $(MESSOBJ)/mattel.a \ - $(MESSOBJ)/mb.a \ - $(MESSOBJ)/mchester.a \ - $(MESSOBJ)/memotech.a \ - $(MESSOBJ)/mgu.a \ - $(MESSOBJ)/microkey.a \ - $(MESSOBJ)/mit.a \ - $(MESSOBJ)/mits.a \ - $(MESSOBJ)/mitsubishi.a \ - $(MESSOBJ)/morrow.a \ - $(MESSOBJ)/mos.a \ - $(MESSOBJ)/motorola.a \ - $(MESSOBJ)/multitch.a \ - $(MESSOBJ)/nakajima.a \ - $(MESSOBJ)/nascom.a \ - $(MESSOBJ)/ne.a \ - $(MESSOBJ)/nec.a \ - $(MESSOBJ)/netronic.a \ - $(MESSOBJ)/next.a \ - $(MESSOBJ)/nintendo.a \ - $(MESSOBJ)/nokia.a \ - $(MESSOBJ)/northstar.a \ - $(MESSOBJ)/novag.a \ - $(MESSOBJ)/olivetti.a \ - $(MESSOBJ)/omnibyte.a \ - $(MESSOBJ)/orion.a \ - $(MESSOBJ)/osborne.a \ - $(MESSOBJ)/osi.a \ - $(MESSOBJ)/palm.a \ - $(MESSOBJ)/parker.a \ - $(MESSOBJ)/pc.a \ - $(MESSOBJ)/pdp1.a \ - $(MESSOBJ)/pel.a \ - $(MESSOBJ)/philips.a \ - $(MESSOBJ)/pitronic.a \ - $(MESSOBJ)/poly88.a \ - $(MESSOBJ)/psion.a \ - $(MESSOBJ)/radio.a \ - $(MESSOBJ)/rca.a \ - $(MESSOBJ)/rm.a \ - $(MESSOBJ)/robotron.a \ - $(MESSOBJ)/rockwell.a \ - $(MESSOBJ)/roland.a \ - $(MESSOBJ)/sage.a \ - $(MESSOBJ)/samcoupe.a \ - $(MESSOBJ)/samsung.a \ - $(MESSOBJ)/sanyo.a \ - $(MESSOBJ)/sega.a \ - $(MESSOBJ)/sgi.a \ - $(MESSOBJ)/sharp.a \ - $(MESSOBJ)/siemens.a \ - $(MESSOBJ)/sinclair.a \ - $(MESSOBJ)/skeleton.a \ - $(MESSOBJ)/slicer.a \ - $(MESSOBJ)/snk.a \ - $(MESSOBJ)/sony.a \ - $(MESSOBJ)/sord.a \ - $(MESSOBJ)/special.a \ - $(MESSOBJ)/sun.a \ - $(MESSOBJ)/svi.a \ - $(MESSOBJ)/svision.a \ - $(MESSOBJ)/swtpc09.a \ - $(MESSOBJ)/synertec.a \ - $(MESSOBJ)/ta.a \ - $(MESSOBJ)/tandberg.a \ - $(MESSOBJ)/tangerin.a \ - $(MESSOBJ)/tatung.a \ - $(MESSOBJ)/teamconc.a \ - $(MESSOBJ)/tektroni.a \ - $(MESSOBJ)/telenova.a \ - $(MESSOBJ)/telercas.a \ - $(MESSOBJ)/televideo.a \ - $(MESSOBJ)/tem.a \ - $(MESSOBJ)/tesla.a \ - $(MESSOBJ)/test.a \ - $(MESSOBJ)/thomson.a \ - $(MESSOBJ)/ti.a \ - $(MESSOBJ)/tiger.a \ - $(MESSOBJ)/tigertel.a \ - $(MESSOBJ)/tiki.a \ - $(MESSOBJ)/tomy.a \ - $(MESSOBJ)/toshiba.a \ - $(MESSOBJ)/trainer.a \ - $(MESSOBJ)/trs.a \ - $(MESSOBJ)/ultratec.a \ - $(MESSOBJ)/unisys.a \ - $(MESSOBJ)/veb.a \ - $(MESSOBJ)/vidbrain.a \ - $(MESSOBJ)/videoton.a \ - $(MESSOBJ)/visual.a \ - $(MESSOBJ)/votrax.a \ - $(MESSOBJ)/vtech.a \ - $(MESSOBJ)/wang.a \ - $(MESSOBJ)/wavemate.a \ - $(MESSOBJ)/xerox.a \ - $(MESSOBJ)/xussrpc.a \ - $(MESSOBJ)/yamaha.a \ - $(MESSOBJ)/zenith.a \ - $(MESSOBJ)/zpa.a \ - $(MESSOBJ)/zvt.a \ - $(MESSOBJ)/shared.a \ - $(MESSOBJ)/mame.a - -#------------------------------------------------- -# the following files are MAME components and -# shared across a number of drivers +# Copyright (c) Nicola Salmoria and the MAME Team. +# Visit http://mamedev.org for licensing and usage restrictions. # -# a310.c (MESS), aristmk5.c, ertictac.c (MAME) -# amiga.c (MESS), alg.c, arcadia.c, cubo.c, mquake.c, upscope.c (MAME) -# a2600.c (MESS), tourtabl.c (MAME) -# atari400.c (MESS), bartop52.c, maxaflex.c (MAME) -# jaguar.c (MAME) -# astrocde.c (MAME+MESS), g627.c -# cps1.c (MAME + MESS), cbaseball.c, mitchell.c (MAME) -# pk8000.c (MESS), photon.c (MAME) -# nes.c (MESS), cham23.c, famibox.c, multigam.c, playch10.c, vsnes.c (MAME) -# snes.c (MESS), nss.c, sfcbox.c, snesb.c (MAME) -# n64.c (MESS), aleck64.c (MAME) -# megadriv.c, segapico.c (MESS), hshavoc.c, megadrvb.c, megaplay.c, megatech.c, puckpkmn.c, segac2.c, segas18.c (MAME) -# dccons.c (MESS), naomi.c (MAME) -# ng_aes.c (MESS), midas.c, neogeo.c, neogeo_noslot.c, neoprint.c (MAME) -# cdi.c (MESS + MAME) -# 3do.c (MESS + MAME), konamim2.c (MAME) -# vectrex.c (MESS + MAME) -# cps1.c (MESS + MAME) -#------------------------------------------------- - -$(MESSOBJ)/mame.a: \ - $(MAME_MACHINE)/archimds.o \ - $(MAME_VIDEO)/archimds.o \ - $(MAME_MACHINE)/amiga.o \ - $(MAME_VIDEO)/amiga.o \ - $(MAME_VIDEO)/amigaaga.o \ - $(MAME_VIDEO)/tia.o \ - $(MAME_MACHINE)/atari.o \ - $(MAME_VIDEO)/atari.o \ - $(MAME_VIDEO)/antic.o \ - $(MAME_VIDEO)/gtia.o \ - $(MAME_DRIVERS)/jaguar.o \ - $(MAME_AUDIO)/jaguar.o \ - $(MAME_VIDEO)/jaguar.o \ - $(MAME_VIDEO)/astrocde.o \ - $(MAME_MACHINE)/kabuki.o \ - $(MAME_VIDEO)/pk8000.o \ - $(MAME_VIDEO)/ppu2c0x.o \ - $(MAME_MACHINE)/snes.o \ - $(MAME_AUDIO)/snes_snd.o \ - $(MAME_MACHINE)/n64.o \ - $(MAME_VIDEO)/n64.o \ - $(MAME_VIDEO)/rdpblend.o \ - $(MAME_VIDEO)/rdptpipe.o \ - $(MAME_VIDEO)/rdpspn16.o \ - $(MAME_MACHINE)/megadriv.o \ - $(MAME_DRIVERS)/naomi.o \ - $(MAME_MACHINE)/awboard.o \ - $(MAME_MACHINE)/dc.o \ - $(MAME_MACHINE)/dc-ctrl.o \ - $(MAME_MACHINE)/gdrom.o \ - $(MAME_MACHINE)/jvs13551.o \ - $(MAME_MACHINE)/maple-dc.o \ - $(MAME_MACHINE)/mapledev.o \ - $(MAME_MACHINE)/mie.o \ - $(MAME_MACHINE)/naomi.o \ - $(MAME_MACHINE)/naomibd.o \ - $(MAME_MACHINE)/naomig1.o \ - $(MAME_MACHINE)/naomigd.o \ - $(MAME_MACHINE)/naomim1.o \ - $(MAME_MACHINE)/naomim2.o \ - $(MAME_MACHINE)/naomim4.o \ - $(MAME_MACHINE)/naomirom.o \ - $(MAME_MACHINE)/315-5881_crypt.o \ - $(MAME_VIDEO)/powervr2.o \ - $(MAME_DRIVERS)/neogeo.o \ - $(MAME_MACHINE)/neoboot.o \ - $(MAME_MACHINE)/neocrypt.o \ - $(MAME_MACHINE)/neoprot.o \ - $(MAME_MACHINE)/ng_memcard.o\ - $(MAME_VIDEO)/neogeo.o \ - $(MAME_VIDEO)/neogeo_spr.o \ - $(MAME_DRIVERS)/cdi.o \ - $(MAME_MACHINE)/cdi070.o \ - $(MAME_MACHINE)/cdicdic.o \ - $(MAME_MACHINE)/cdislave.o \ - $(MAME_VIDEO)/mcd212.o \ - $(MAME_DRIVERS)/3do.o \ - $(MAME_MACHINE)/3do.o \ - $(MAME_DRIVERS)/konamim2.o \ - $(MAME_DRIVERS)/vectrex.o \ - $(MAME_MACHINE)/vectrex.o \ - $(MAME_VIDEO)/vectrex.o \ - $(MAME_DRIVERS)/cps1.o \ - $(MAME_VIDEO)/cps1.o \ - - -#------------------------------------------------- -# the following files are general components and -# shared across a number of drivers -#------------------------------------------------- - -$(MESSOBJ)/shared.a: \ - $(MESS_AUDIO)/mea8000.o \ - $(MESS_MACHINE)/appldriv.o \ - $(MESS_MACHINE)/applefdc.o \ - $(MESS_MACHINE)/microdrv.o \ - $(MESS_MACHINE)/smartmed.o \ - $(MESS_MACHINE)/sonydriv.o \ - $(MESS_MACHINE)/teleprinter.o \ - $(MESS_MACHINE)/z80bin.o \ - -#------------------------------------------------- -# manufacturer-specific groupings for drivers -#------------------------------------------------- - -$(MESSOBJ)/acorn.a: \ - $(MESS_DRIVERS)/a310.o \ - $(MESS_DRIVERS)/a6809.o \ - $(MESS_DRIVERS)/acrnsys1.o \ - $(MESS_DRIVERS)/atom.o \ - $(MESS_DRIVERS)/bbc.o $(MESS_MACHINE)/bbc.o $(MESS_VIDEO)/bbc.o \ - $(MESS_DRIVERS)/bbcbc.o \ - $(MESS_DRIVERS)/electron.o $(MESS_MACHINE)/electron.o $(MESS_VIDEO)/electron.o \ - $(MESS_DRIVERS)/riscpc.o \ - $(MESS_DRIVERS)/z88.o $(MESS_MACHINE)/upd65031.o $(MESS_VIDEO)/z88.o \ - -$(MESSOBJ)/act.a: \ - $(MESS_DRIVERS)/apricot.o \ - $(MESS_DRIVERS)/apricotf.o \ - $(MESS_DRIVERS)/apricotp.o \ - $(MESS_MACHINE)/apricotkb.o \ - $(MESS_DRIVERS)/victor9k.o $(MESS_MACHINE)/victor9kb.o $(MESS_MACHINE)/victor9k_fdc.o \ - -$(MESSOBJ)/adc.a: \ - $(MESS_DRIVERS)/super6.o \ - $(MESS_DRIVERS)/superslave.o\ - -$(MESSOBJ)/alesis.a: \ - $(MESS_DRIVERS)/alesis.o $(MESS_AUDIO)/alesis.o $(MESS_VIDEO)/alesis.o \ - -$(MESSOBJ)/altos.a: \ - $(MESS_DRIVERS)/altos5.o \ - -$(MESSOBJ)/amiga.a: \ - $(MESS_DRIVERS)/amiga.o $(MESS_MACHINE)/amigakbd.o \ - -$(MESSOBJ)/amstrad.a: \ - $(MESS_DRIVERS)/amstrad.o $(MESS_MACHINE)/amstrad.o \ - $(MESS_DRIVERS)/amstr_pc.o \ - $(MESS_DRIVERS)/nc.o $(MESS_MACHINE)/nc.o $(MESS_VIDEO)/nc.o \ - $(MESS_DRIVERS)/pc1512.o $(MESS_MACHINE)/pc1512kb.o $(MESS_VIDEO)/pc1512.o \ - $(MESS_DRIVERS)/pcw.o $(MESS_VIDEO)/pcw.o \ - $(MESS_DRIVERS)/pcw16.o $(MESS_VIDEO)/pcw16.o \ - $(MESS_DRIVERS)/pda600.o \ - -$(MESSOBJ)/apf.a: \ - $(MESS_DRIVERS)/apf.o \ - -$(MESSOBJ)/apollo.a: \ - $(MESS_DRIVERS)/apollo.o $(MESS_MACHINE)/apollo.o $(MESS_MACHINE)/apollo_dbg.o $(MESS_MACHINE)/apollo_kbd.o $(MESS_VIDEO)/apollo.o \ - -$(MESSOBJ)/apple.a: \ - $(MESS_DRIVERS)/apple1.o $(MESS_MACHINE)/apple1.o $(MESS_VIDEO)/apple1.o \ - $(MESS_DRIVERS)/apple2.o $(MESS_DRIVERS)/apple2e.o $(MESS_MACHINE)/apple2.o $(MESS_VIDEO)/apple2.o \ - $(MESS_DRIVERS)/tk2000.o \ - $(MESS_DRIVERS)/apple2gs.o $(MESS_MACHINE)/apple2gs.o $(MESS_VIDEO)/apple2gs.o \ - $(MESS_DRIVERS)/apple3.o $(MESS_MACHINE)/apple3.o $(MESS_VIDEO)/apple3.o \ - $(MESS_DRIVERS)/lisa.o $(MESS_MACHINE)/lisa.o \ - $(MESS_DRIVERS)/mac.o $(MESS_AUDIO)/mac.o $(MESS_MACHINE)/egret.o $(MESS_MACHINE)/mac.o $(MESS_MACHINE)/macadb.o $(MESS_MACHINE)/macrtc.o $(MESS_MACHINE)/mackbd.o $(MESS_MACHINE)/swim.o $(MESS_VIDEO)/mac.o \ - $(MESS_DRIVERS)/macpci.o $(MESS_MACHINE)/macpci.o \ - $(MESS_MACHINE)/cuda.o \ - -$(MESSOBJ)/applied.a: \ - $(MESS_DRIVERS)/mbee.o $(MESS_MACHINE)/mbee.o $(MESS_VIDEO)/mbee.o \ - -$(MESSOBJ)/arcadia.a: \ - $(MESS_DRIVERS)/arcadia.o $(MESS_AUDIO)/arcadia.o $(MESS_VIDEO)/arcadia.o \ - -$(MESSOBJ)/ascii.a: \ - $(MESS_DRIVERS)/msx.o $(MESS_MACHINE)/msx.o $(MESS_MACHINE)/msx_matsushita.o $(MESS_MACHINE)/msx_s1985.o $(MESS_MACHINE)/msx_switched.o $(MESS_MACHINE)/msx_systemflags.o \ - -$(MESSOBJ)/at.a: \ - $(MESS_DRIVERS)/at.o $(MESS_MACHINE)/at.o \ - $(MESS_DRIVERS)/ct486.o \ - -$(MESSOBJ)/atari.a: \ - $(MESS_DRIVERS)/a2600.o \ - $(MESS_DRIVERS)/a7800.o $(MESS_VIDEO)/maria.o \ - $(MESS_DRIVERS)/atari400.o $(MESS_MACHINE)/atarifdc.o \ - $(MESS_DRIVERS)/atarist.o $(MESS_VIDEO)/atarist.o \ - $(MESS_DRIVERS)/lynx.o $(MESS_AUDIO)/lynx.o $(MESS_MACHINE)/lynx.o \ - $(MESS_DRIVERS)/portfoli.o \ - -$(MESSOBJ)/att.a: \ - $(MESS_DRIVERS)/unixpc.o \ - -$(MESSOBJ)/bally.a: \ - $(MESS_DRIVERS)/astrocde.o \ - -$(MESSOBJ)/banctec.a: \ - $(MESS_DRIVERS)/banctec.o \ - -$(MESSOBJ)/bandai.a: \ - $(MESS_DRIVERS)/sv8000.o \ - $(MESS_DRIVERS)/rx78.o \ - $(MESS_DRIVERS)/wswan.o $(MESS_AUDIO)/wswan_snd.o $(MESS_MACHINE)/wswan.o $(MESS_VIDEO)/wswan_video.o \ - -$(MESSOBJ)/be.a: \ - $(MESS_DRIVERS)/bebox.o $(MESS_MACHINE)/bebox.o \ - -$(MESSOBJ)/bnpo.a: \ - $(MESS_DRIVERS)/b2m.o $(MESS_MACHINE)/b2m.o $(MESS_VIDEO)/b2m.o \ - -$(MESSOBJ)/bondwell.a: \ - $(MESS_DRIVERS)/bw12.o \ - $(MESS_DRIVERS)/bw2.o \ - -$(MESSOBJ)/booth.a: \ - $(MESS_DRIVERS)/apexc.o \ - -$(MESSOBJ)/camputers.a: \ - $(MESS_DRIVERS)/camplynx.o \ - -$(MESSOBJ)/canon.a: \ - $(MESS_DRIVERS)/cat.o \ - $(MESS_DRIVERS)/x07.o \ - -$(MESSOBJ)/cantab.a: \ - $(MESS_DRIVERS)/ace.o \ - -$(MESSOBJ)/casio.a: \ - $(MESS_DRIVERS)/casloopy.o \ - $(MESS_DRIVERS)/cfx9850.o \ - $(MESS_DRIVERS)/fp200.o \ - $(MESS_DRIVERS)/fp1100.o \ - $(MESS_DRIVERS)/fp6000.o \ - $(MESS_DRIVERS)/pb1000.o \ - $(MESS_DRIVERS)/pv1000.o \ - $(MESS_DRIVERS)/pv2000.o \ - -$(MESSOBJ)/cbm.a: \ - $(MESS_DRIVERS)/c128.o \ - $(MESS_DRIVERS)/c64.o \ - $(MESS_DRIVERS)/c64dtv.o \ - $(MESS_DRIVERS)/c65.o \ - $(MESS_DRIVERS)/c900.o \ - $(MESS_DRIVERS)/cbm2.o \ - $(MESS_DRIVERS)/clcd.o \ - $(MESS_DRIVERS)/pet.o \ - $(MESS_DRIVERS)/plus4.o \ - $(MESS_DRIVERS)/vic10.o \ - $(MESS_DRIVERS)/vic20.o \ - $(MESS_MACHINE)/cbm_snqk.o \ - -$(MESSOBJ)/cccp.a: \ - $(MESS_DRIVERS)/argo.o \ - $(MESS_DRIVERS)/cm1800.o \ - $(MESS_DRIVERS)/lviv.o $(MESS_MACHINE)/lviv.o $(MESS_VIDEO)/lviv.o \ - $(MESS_DRIVERS)/mikro80.o $(MESS_MACHINE)/mikro80.o $(MESS_VIDEO)/mikro80.o \ - $(MESS_DRIVERS)/pk8000.o \ - $(MESS_DRIVERS)/pk8020.o $(MESS_MACHINE)/pk8020.o $(MESS_VIDEO)/pk8020.o \ - $(MESS_DRIVERS)/pyl601.o \ - $(MESS_DRIVERS)/sm1800.o \ - $(MESS_DRIVERS)/uknc.o \ - $(MESS_DRIVERS)/unior.o \ - $(MESS_DRIVERS)/ut88.o $(MESS_MACHINE)/ut88.o $(MESS_VIDEO)/ut88.o \ - $(MESS_DRIVERS)/vector06.o $(MESS_MACHINE)/vector06.o $(MESS_VIDEO)/vector06.o \ - $(MESS_DRIVERS)/vta2000.o \ - -$(MESSOBJ)/cce.a: \ - $(MESS_DRIVERS)/mc1000.o \ - -$(MESSOBJ)/ccs.a: \ - $(MESS_DRIVERS)/ccs2810.o \ - $(MESS_DRIVERS)/ccs300.o \ - -$(MESSOBJ)/chromatics.a: \ - $(MESS_DRIVERS)/cgc7900.o $(MESS_VIDEO)/cgc7900.o \ - -$(MESSOBJ)/coleco.a: \ - $(MESS_DRIVERS)/adam.o \ - $(MESS_DRIVERS)/coleco.o \ - $(MESS_MACHINE)/coleco.o \ - -$(MESSOBJ)/cromemco.a: \ - $(MESS_DRIVERS)/c10.o \ - $(MESS_DRIVERS)/mcb216.o \ - -$(MESSOBJ)/comx.a: \ - $(MESS_DRIVERS)/comx35.o $(MESS_VIDEO)/comx35.o \ - -$(MESSOBJ)/concept.a: \ - $(MESS_DRIVERS)/concept.o $(MESS_MACHINE)/concept.o \ - -$(MESSOBJ)/conitec.a: \ - $(MESS_DRIVERS)/prof180x.o \ - $(MESS_DRIVERS)/prof80.o $(MESS_MACHINE)/prof80mmu.o \ - -$(MESSOBJ)/cybiko.a: \ - $(MESS_DRIVERS)/cybiko.o $(MESS_MACHINE)/cybiko.o \ - -$(MESSOBJ)/dai.a: \ - $(MESS_DRIVERS)/dai.o $(MESS_AUDIO)/dai_snd.o $(MESS_MACHINE)/dai.o $(MESS_VIDEO)/dai.o \ - -$(MESSOBJ)/ddr.a: \ - $(MESS_DRIVERS)/ac1.o $(MESS_MACHINE)/ac1.o $(MESS_VIDEO)/ac1.o \ - $(MESS_DRIVERS)/bcs3.o \ - $(MESS_DRIVERS)/c80.o \ - $(MESS_DRIVERS)/huebler.o \ - $(MESS_DRIVERS)/jtc.o \ - $(MESS_DRIVERS)/kramermc.o $(MESS_MACHINE)/kramermc.o $(MESS_VIDEO)/kramermc.o \ - $(MESS_DRIVERS)/llc.o $(MESS_MACHINE)/llc.o $(MESS_VIDEO)/llc.o \ - $(MESS_DRIVERS)/nanos.o \ - $(MESS_DRIVERS)/pcm.o \ - $(MESS_DRIVERS)/vcs80.o \ - $(MESS_MACHINE)/k7659kb.o \ - -$(MESSOBJ)/dec.a: \ - $(MESS_DRIVERS)/dct11em.o \ - $(MESS_DRIVERS)/dectalk.o \ - $(MESS_DRIVERS)/pdp11.o \ - $(MESS_DRIVERS)/vax11.o \ - $(MESS_DRIVERS)/rainbow.o \ - $(MESS_DRIVERS)/vk100.o \ - $(MESS_DRIVERS)/vt100.o \ - $(MESS_DRIVERS)/vt220.o \ - $(MESS_DRIVERS)/vt240.o \ - $(MESS_DRIVERS)/vt320.o \ - $(MESS_DRIVERS)/vt520.o \ - $(MESS_MACHINE)/dec_lk201.o \ - $(MESS_MACHINE)/rx01.o \ - $(MESS_VIDEO)/vtvideo.o \ - -$(MESSOBJ)/dicksmth.a: \ - $(MESS_DRIVERS)/super80.o $(MESS_MACHINE)/super80.o $(MESS_VIDEO)/super80.o \ - -$(MESSOBJ)/dms.a: \ - $(MESS_DRIVERS)/dms5000.o \ - $(MESS_DRIVERS)/dms86.o \ - $(MESS_DRIVERS)/zsbc3.o \ - -$(MESSOBJ)/dragon.a: \ - $(MESS_DRIVERS)/dgn_beta.o $(MESS_MACHINE)/dgn_beta.o $(MESS_VIDEO)/dgn_beta.o \ - -$(MESSOBJ)/drc.a: \ - $(MESS_DRIVERS)/zrt80.o \ - -$(MESSOBJ)/eaca.a: \ - $(MESS_DRIVERS)/cgenie.o $(MESS_MACHINE)/cgenie.o $(MESS_VIDEO)/cgenie.o \ - -$(MESSOBJ)/einis.a: \ - $(MESS_DRIVERS)/pecom.o $(MESS_MACHINE)/pecom.o $(MESS_VIDEO)/pecom.o \ - -$(MESSOBJ)/elektrka.a: \ - $(MESS_DRIVERS)/bk.o $(MESS_MACHINE)/bk.o $(MESS_VIDEO)/bk.o \ - $(MESS_DRIVERS)/dvk_ksm.o $(MESS_MACHINE)/ms7004.o \ - $(MESS_DRIVERS)/mk85.o \ - $(MESS_DRIVERS)/mk90.o \ - -$(MESSOBJ)/elektor.a: \ - $(MESS_DRIVERS)/ec65.o \ - $(MESS_DRIVERS)/elekscmp.o \ - $(MESS_DRIVERS)/junior.o \ - -$(MESSOBJ)/ensoniq.a: \ - $(MESS_DRIVERS)/esq1.o \ - $(MESS_DRIVERS)/esq5505.o \ - $(MESS_DRIVERS)/esqasr.o \ - $(MESS_DRIVERS)/esqkt.o \ - $(MESS_DRIVERS)/esqmr.o \ - $(MESS_DRIVERS)/mirage.o \ - $(MESS_MACHINE)/esqpanel.o \ - $(MESS_MACHINE)/esqvfd.o \ - -$(MESSOBJ)/enterprise.a: \ - $(MESS_DRIVERS)/ep64.o $(MESS_AUDIO)/dave.o $(MESS_VIDEO)/nick.o \ - -$(MESSOBJ)/entex.a: \ - $(MESS_DRIVERS)/advision.o $(MESS_MACHINE)/advision.o $(MESS_VIDEO)/advision.o \ - -$(MESSOBJ)/epoch.a: \ - $(MESS_DRIVERS)/gamepock.o $(MESS_MACHINE)/gamepock.o \ - $(MESS_DRIVERS)/scv.o $(MESS_AUDIO)/upd1771.o \ - -$(MESSOBJ)/epson.a: \ - $(MESS_DRIVERS)/hx20.o \ - $(MESS_DRIVERS)/px4.o \ - $(MESS_DRIVERS)/px8.o \ - $(MESS_DRIVERS)/qx10.o $(MESS_MACHINE)/qx10kbd.o \ - -$(MESSOBJ)/exidy.a: \ - $(MESS_MACHINE)/sorcerer.o $(MESS_DRIVERS)/sorcerer.o \ - $(MESS_MACHINE)/micropolis.o\ - -$(MESSOBJ)/fairch.a: \ - $(MESS_DRIVERS)/channelf.o $(MESS_AUDIO)/channelf.o $(MESS_VIDEO)/channelf.o \ - -$(MESSOBJ)/fidelity.a: \ - $(MESS_DRIVERS)/csc.o \ - $(MESS_DRIVERS)/fidelz80.o \ - -$(MESSOBJ)/fujitsu.a: \ - $(MESS_DRIVERS)/fmtowns.o $(MESS_VIDEO)/fmtowns.o $(MESS_MACHINE)/fm_scsi.o \ - $(MESS_DRIVERS)/fm7.o $(MESS_VIDEO)/fm7.o \ - -$(MESSOBJ)/funtech.a: \ - $(MESS_DRIVERS)/supracan.o \ - -$(MESSOBJ)/galaxy.a: \ - $(MESS_DRIVERS)/galaxy.o $(MESS_MACHINE)/galaxy.o $(MESS_VIDEO)/galaxy.o \ - -$(MESSOBJ)/gamepark.a: \ - $(MESS_DRIVERS)/gp2x.o \ - $(MESS_DRIVERS)/gp32.o \ - -$(MESSOBJ)/gi.a: \ - $(MESS_DRIVERS)/hh_pic16.o \ - -$(MESSOBJ)/grundy.a: \ - $(MESS_DRIVERS)/newbrain.o $(MESS_VIDEO)/newbrain.o \ - -$(MESSOBJ)/hartung.a: \ - $(MESS_DRIVERS)/gmaster.o \ - -$(MESSOBJ)/heathkit.a: \ - $(MESS_DRIVERS)/et3400.o \ - $(MESS_DRIVERS)/h8.o \ - $(MESS_DRIVERS)/h19.o \ - $(MESS_DRIVERS)/h89.o \ - -$(MESSOBJ)/hegener.a: \ - $(MESS_DRIVERS)/glasgow.o \ - $(MESS_DRIVERS)/mephisto.o \ - $(MESS_DRIVERS)/mmodular.o \ - $(MESS_DRIVERS)/stratos.o \ - $(MESS_MACHINE)/mboard.o \ - -$(MESSOBJ)/hitachi.a: \ - $(MESS_DRIVERS)/b16.o \ - $(MESS_DRIVERS)/bmjr.o \ - $(MESS_DRIVERS)/bml3.o \ - $(MESS_DRIVERS)/hh_hmcs40.o \ - -$(MESSOBJ)/homebrew.a: \ - $(MESS_DRIVERS)/4004clk.o \ - $(MESS_DRIVERS)/68ksbc.o \ - $(MESS_DRIVERS)/craft.o \ - $(MESS_DRIVERS)/homez80.o \ - $(MESS_DRIVERS)/p112.o \ - $(MESS_DRIVERS)/phunsy.o \ - $(MESS_DRIVERS)/pimps.o \ - $(MESS_DRIVERS)/ravens.o \ - $(MESS_DRIVERS)/sbc6510.o \ - $(MESS_DRIVERS)/sitcom.o \ - $(MESS_DRIVERS)/slc1.o \ - $(MESS_DRIVERS)/uzebox.o \ - $(MESS_DRIVERS)/z80dev.o \ - -$(MESSOBJ)/homelab.a: \ - $(MESS_DRIVERS)/homelab.o \ - -$(MESSOBJ)/hp.a: \ - $(MESS_DRIVERS)/hp16500.o \ - $(MESS_DRIVERS)/hp48.o \ - $(MESS_MACHINE)/hp48.o \ - $(MESS_VIDEO)/hp48.o \ - $(MESS_DRIVERS)/hp49gp.o \ - $(MESS_DRIVERS)/hp9845.o \ - $(MESS_DRIVERS)/hp9k.o \ - $(MESS_DRIVERS)/hp9k_3xx.o \ - -$(MESSOBJ)/hec2hrp.a: \ - $(MESS_DRIVERS)/hec2hrp.o \ - $(MESS_MACHINE)/hec2hrp.o \ - $(MESS_MACHINE)/hecdisk2.o \ - $(MESS_VIDEO)/hec2video.o \ - $(MESS_DRIVERS)/interact.o \ - -$(MESSOBJ)/intel.a: \ - $(MESS_DRIVERS)/basic52.o \ - $(MESS_DRIVERS)/imds.o \ - $(MESS_DRIVERS)/ipc.o \ - $(MESS_DRIVERS)/ipds.o \ - $(MESS_DRIVERS)/isbc.o $(MESS_MACHINE)/isbc_215g.o \ - $(MESS_DRIVERS)/rex6000.o \ - $(MESS_DRIVERS)/sdk85.o \ - $(MESS_DRIVERS)/sdk86.o \ - $(MESS_DRIVERS)/imds2.o \ - -$(MESSOBJ)/imp.a: \ - $(MESS_DRIVERS)/tim011.o \ - $(MESS_DRIVERS)/tim100.o \ - -$(MESSOBJ)/interton.a: \ - $(MESS_DRIVERS)/vc4000.o $(MESS_AUDIO)/vc4000snd.o $(MESS_VIDEO)/vc4000.o \ - -$(MESSOBJ)/intv.a: \ - $(MESS_DRIVERS)/intv.o $(MESS_MACHINE)/intv.o $(MESS_VIDEO)/intv.o $(MESS_VIDEO)/stic.o \ - -$(MESSOBJ)/isc.a: \ - $(MESS_DRIVERS)/compucolor.o\ - -$(MESSOBJ)/kaypro.a: \ - $(MESS_DRIVERS)/kaypro.o $(MESS_MACHINE)/kaypro.o $(MESS_MACHINE)/kay_kbd.o $(MESS_VIDEO)/kaypro.o \ - -$(MESSOBJ)/koei.a: \ - $(MESS_DRIVERS)/pasogo.o \ - -$(MESSOBJ)/kyocera.a: \ - $(MESS_DRIVERS)/kyocera.o $(MESS_VIDEO)/kyocera.o \ - -$(MESSOBJ)/luxor.a: \ - $(MESS_DRIVERS)/abc80.o $(MESS_MACHINE)/abc80kb.o $(MESS_VIDEO)/abc80.o \ - $(MESS_DRIVERS)/abc80x.o $(MESS_VIDEO)/abc800.o $(MESS_VIDEO)/abc802.o $(MESS_VIDEO)/abc806.o \ - $(MESS_DRIVERS)/abc1600.o $(MESS_MACHINE)/abc1600mac.o $(MESS_VIDEO)/abc1600.o \ - -$(MESSOBJ)/magnavox.a: \ - $(MESS_DRIVERS)/odyssey2.o \ - -$(MESSOBJ)/makerbot.a: \ - $(MESS_DRIVERS)/replicator.o\ - -$(MESSOBJ)/marx.a: \ - $(MESS_DRIVERS)/elecbowl.o \ - -$(MESSOBJ)/mattel.a: \ - $(MESS_DRIVERS)/aquarius.o $(MESS_VIDEO)/aquarius.o \ - $(MESS_DRIVERS)/juicebox.o \ - $(MESS_DRIVERS)/hyperscan.o \ - -$(MESSOBJ)/matsushi.a: \ - $(MESS_DRIVERS)/jr100.o \ - $(MESS_DRIVERS)/jr200.o \ - $(MESS_DRIVERS)/myb3k.o \ - -$(MESSOBJ)/mb.a: \ - $(MESS_DRIVERS)/mbdtower.o \ - $(MESS_DRIVERS)/microvsn.o \ - -$(MESSOBJ)/mchester.a: \ - $(MESS_DRIVERS)/ssem.o \ - -$(MESSOBJ)/memotech.a: \ - $(MESS_DRIVERS)/mtx.o $(MESS_MACHINE)/mtx.o \ - -$(MESSOBJ)/mgu.a: \ - $(MESS_DRIVERS)/irisha.o \ - -$(MESSOBJ)/microkey.a: \ - $(MESS_DRIVERS)/primo.o $(MESS_MACHINE)/primo.o $(MESS_VIDEO)/primo.o \ - -$(MESSOBJ)/mit.a: \ - $(MESS_DRIVERS)/tx0.o $(MESS_VIDEO)/crt.o $(MESS_VIDEO)/tx0.o \ - -$(MESSOBJ)/mits.a: \ - $(MESS_DRIVERS)/altair.o \ - $(MESS_DRIVERS)/mits680b.o \ - -$(MESSOBJ)/mitsubishi.a: \ - $(MESS_DRIVERS)/multi8.o \ - $(MESS_DRIVERS)/multi16.o \ - -$(MESSOBJ)/morrow.a: \ - $(MESS_DRIVERS)/microdec.o \ - $(MESS_DRIVERS)/mpz80.o \ - $(MESS_DRIVERS)/tricep.o \ - -$(MESSOBJ)/mos.a: \ - $(MESS_DRIVERS)/kim1.o \ - -$(MESSOBJ)/motorola.a: \ - $(MESS_DRIVERS)/m6805evs.o \ - $(MESS_DRIVERS)/mekd2.o \ - -$(MESSOBJ)/multitch.a: \ - $(MESS_DRIVERS)/mkit09.o \ - $(MESS_DRIVERS)/mpf1.o \ - -$(MESSOBJ)/nakajima.a: \ - $(MESS_DRIVERS)/nakajies.o \ - -$(MESSOBJ)/nascom.a: \ - $(MESS_DRIVERS)/nascom1.o $(MESS_MACHINE)/nascom1.o $(MESS_VIDEO)/nascom1.o \ - -$(MESSOBJ)/ne.a: \ - $(MESS_DRIVERS)/z80ne.o $(MESS_MACHINE)/z80ne.o \ - -$(MESSOBJ)/nec.a: \ - $(MESS_DRIVERS)/apc.o \ - $(MESS_DRIVERS)/pce.o $(MESS_MACHINE)/pce.o $(MESS_MACHINE)/pce_cd.o \ - $(MESS_DRIVERS)/pcfx.o \ - $(MESS_DRIVERS)/pc6001.o \ - $(MESS_DRIVERS)/pc8401a.o $(MESS_VIDEO)/pc8401a.o $(MESS_DRIVERS)/pc8001.o \ - $(MESS_DRIVERS)/pc8801.o \ - $(MESS_DRIVERS)/pc88va.o \ - $(MESS_DRIVERS)/pc100.o \ - $(MESS_DRIVERS)/pc9801.o $(MESS_MACHINE)/pc9801_26.o $(MESS_MACHINE)/pc9801_86.o $(MESS_MACHINE)/pc9801_118.o $(MESS_MACHINE)/pc9801_cbus.o $(MESS_MACHINE)/pc9801_kbd.o \ - $(MESS_DRIVERS)/tk80bs.o \ - $(MESS_DRIVERS)/hh_ucom4.o \ - -$(MESSOBJ)/netronic.a: \ - $(MESS_DRIVERS)/elf.o \ - $(MESS_DRIVERS)/exp85.o \ - -$(MESSOBJ)/next.a: \ - $(MESS_DRIVERS)/next.o $(MESS_MACHINE)/nextkbd.o $(MESS_MACHINE)/nextmo.o \ - -$(MESSOBJ)/nintendo.a: \ - $(MESS_DRIVERS)/gb.o $(MESS_AUDIO)/gb.o $(MESS_MACHINE)/gb.o $(MESS_VIDEO)/gb_lcd.o \ - $(MESS_DRIVERS)/gba.o $(MESS_VIDEO)/gba.o \ - $(MESS_DRIVERS)/n64.o \ - $(MESS_DRIVERS)/nes.o $(MESS_MACHINE)/nes.o $(MESS_VIDEO)/nes.o \ - $(MESS_DRIVERS)/pokemini.o \ - $(MESS_DRIVERS)/snes.o $(MESS_MACHINE)/snescx4.o \ - $(MESS_DRIVERS)/vboy.o $(MESS_AUDIO)/vboy.o \ - -$(MESSOBJ)/nokia.a: \ - $(MESS_DRIVERS)/mikromik.o $(MESS_MACHINE)/mm1kb.o $(MESS_VIDEO)/mikromik.o \ - -$(MESSOBJ)/northstar.a: \ - $(MESS_DRIVERS)/horizon.o \ - -$(MESSOBJ)/novag.a: \ - $(MESS_DRIVERS)/mk1.o \ - $(MESS_DRIVERS)/mk2.o \ - $(MESS_DRIVERS)/ssystem3.o $(MESS_VIDEO)/ssystem3.o \ - $(MESS_DRIVERS)/supercon.o \ - -$(MESSOBJ)/olivetti.a: \ - $(MESS_DRIVERS)/m20.o \ - $(MESS_DRIVERS)/m24.o \ - $(MESS_MACHINE)/m24_kbd.o \ - -$(MESSOBJ)/omnibyte.a: \ - $(MESS_DRIVERS)/msbc1.o \ - $(MESS_DRIVERS)/ob68k1a.o \ - -$(MESSOBJ)/orion.a: \ - $(MESS_DRIVERS)/orion.o $(MESS_MACHINE)/orion.o $(MESS_VIDEO)/orion.o \ - -$(MESSOBJ)/osborne.a: \ - $(MESS_DRIVERS)/osborne1.o $(MESS_MACHINE)/osborne1.o \ - $(MESS_DRIVERS)/osbexec.o \ - $(MESS_DRIVERS)/vixen.o \ - -$(MESSOBJ)/osi.a: \ - $(MESS_DRIVERS)/osi.o $(MESS_VIDEO)/osi.o \ - -$(MESSOBJ)/palm.a: \ - $(MESS_DRIVERS)/palm.o \ - $(MESS_DRIVERS)/palmz22.o \ - -$(MESSOBJ)/parker.a: \ - $(MESS_DRIVERS)/wildfire.o \ - -$(MESSOBJ)/pitronic.a: \ - $(MESS_DRIVERS)/beta.o \ - -$(MESSOBJ)/pc.a: \ - $(MESS_DRIVERS)/asst128.o \ - $(MESS_DRIVERS)/europc.o \ - $(MESS_DRIVERS)/genpc.o $(MESS_MACHINE)/genpc.o \ - $(MESS_DRIVERS)/ibmpc.o \ - $(MESS_DRIVERS)/ibmpcjr.o \ - $(MESS_DRIVERS)/pc.o \ - $(MESS_DRIVERS)/tandy1t.o $(MESS_VIDEO)/pc_t1t.o \ - -$(MESSOBJ)/pdp1.a: \ - $(MESS_DRIVERS)/pdp1.o $(MESS_VIDEO)/pdp1.o \ - -$(MESSOBJ)/pel.a: \ - $(MESS_DRIVERS)/galeb.o $(MESS_VIDEO)/galeb.o \ - $(MESS_DRIVERS)/orao.o $(MESS_MACHINE)/orao.o $(MESS_VIDEO)/orao.o \ - -$(MESSOBJ)/philips.a: \ - $(MESS_DRIVERS)/p2000t.o $(MESS_MACHINE)/p2000t.o $(MESS_VIDEO)/p2000m.o \ - $(MESS_DRIVERS)/vg5k.o \ - -$(MESSOBJ)/poly88.a: \ - $(MESS_DRIVERS)/poly88.o $(MESS_MACHINE)/poly88.o $(MESS_VIDEO)/poly88.o \ - -$(MESSOBJ)/psion.a: \ - $(MESS_DRIVERS)/psion.o $(MESS_MACHINE)/psion_pack.o \ - -$(MESSOBJ)/radio.a: \ - $(MESS_DRIVERS)/apogee.o \ - $(MESS_DRIVERS)/mikrosha.o \ - $(MESS_DRIVERS)/partner.o $(MESS_MACHINE)/partner.o \ - $(MESS_DRIVERS)/radio86.o $(MESS_MACHINE)/radio86.o \ - -$(MESSOBJ)/rca.a: \ - $(MESS_DRIVERS)/microkit.o \ - $(MESS_DRIVERS)/studio2.o \ - $(MESS_DRIVERS)/vip.o \ - -$(MESSOBJ)/rm.a: \ - $(MESS_DRIVERS)/rm380z.o $(MESS_MACHINE)/rm380z.o $(MESS_VIDEO)/rm380z.o \ - $(MESS_DRIVERS)/rmnimbus.o $(MESS_MACHINE)/rmnimbus.o $(MESS_VIDEO)/rmnimbus.o $(MESS_MACHINE)/rmnkbd.o \ - -$(MESSOBJ)/robotron.a: \ - $(MESS_DRIVERS)/a5105.o \ - $(MESS_DRIVERS)/a51xx.o \ - $(MESS_DRIVERS)/a7150.o \ - $(MESS_DRIVERS)/k1003.o \ - $(MESS_DRIVERS)/k8915.o \ - $(MESS_DRIVERS)/rt1715.o \ - $(MESS_DRIVERS)/z1013.o \ - $(MESS_DRIVERS)/z9001.o \ - -$(MESSOBJ)/roland.a: \ - $(MESS_DRIVERS)/rmt32.o \ - $(MESS_DRIVERS)/rd110.o \ - $(MESS_DRIVERS)/rsc55.o \ - $(MESS_DRIVERS)/tb303.o \ - -$(MESSOBJ)/rockwell.a: \ - $(MESS_DRIVERS)/aim65.o $(MESS_MACHINE)/aim65.o \ - $(MESS_DRIVERS)/aim65_40.o \ - -$(MESSOBJ)/sage.a: \ - $(MESS_DRIVERS)/sage2.o \ - -$(MESSOBJ)/samcoupe.a: \ - $(MESS_DRIVERS)/samcoupe.o $(MESS_MACHINE)/samcoupe.o $(MESS_VIDEO)/samcoupe.o \ - -$(MESSOBJ)/samsung.a: \ - $(MESS_DRIVERS)/spc1000.o \ - -$(MESSOBJ)/sanyo.a: \ - $(MESS_DRIVERS)/mbc200.o \ - $(MESS_DRIVERS)/mbc55x.o \ - $(MESS_MACHINE)/mbc55x.o \ - $(MESS_VIDEO)/mbc55x.o \ - $(MESS_DRIVERS)/phc25.o \ - -$(MESSOBJ)/sega.a: \ - $(MESS_DRIVERS)/dccons.o $(MESS_MACHINE)/dccons.o \ - $(MESS_DRIVERS)/megadriv.o \ - $(MESS_DRIVERS)/saturn.o \ - $(MESS_DRIVERS)/segapico.o \ - $(MESS_DRIVERS)/sg1000.o \ - $(MESS_DRIVERS)/sms.o $(MESS_MACHINE)/sms.o \ - $(MESS_DRIVERS)/svmu.o \ - $(MESS_MACHINE)/mega32x.o \ - $(MESS_MACHINE)/megacd.o \ - $(MESS_MACHINE)/megacdcd.o \ - -$(MESSOBJ)/sgi.a: \ - $(MESS_MACHINE)/sgi.o \ - $(MESS_DRIVERS)/sgi_ip2.o \ - $(MESS_DRIVERS)/sgi_ip6.o \ - $(MESS_DRIVERS)/ip20.o \ - $(MESS_DRIVERS)/ip22.o \ - $(MESS_VIDEO)/newport.o \ - -$(MESSOBJ)/sharp.a: \ - $(MESS_VIDEO)/mz700.o \ - $(MESS_DRIVERS)/mz700.o \ - $(MESS_DRIVERS)/pc1500.o \ - $(MESS_DRIVERS)/pocketc.o \ - $(MESS_VIDEO)/pc1401.o \ - $(MESS_MACHINE)/pc1401.o \ - $(MESS_VIDEO)/pc1403.o \ - $(MESS_MACHINE)/pc1403.o \ - $(MESS_VIDEO)/pc1350.o \ - $(MESS_MACHINE)/pc1350.o \ - $(MESS_VIDEO)/pc1251.o \ - $(MESS_MACHINE)/pc1251.o \ - $(MESS_VIDEO)/pocketc.o \ - $(MESS_MACHINE)/mz700.o \ - $(MESS_DRIVERS)/x68k.o \ - $(MESS_VIDEO)/x68k.o \ - $(MESS_MACHINE)/x68k_hdc.o \ - $(MESS_MACHINE)/x68k_kbd.o \ - $(MESS_DRIVERS)/mz80.o \ - $(MESS_VIDEO)/mz80.o \ - $(MESS_MACHINE)/mz80.o \ - $(MESS_DRIVERS)/mz2000.o \ - $(MESS_DRIVERS)/x1.o \ - $(MESS_MACHINE)/x1.o \ - $(MESS_DRIVERS)/x1twin.o \ - $(MESS_DRIVERS)/mz2500.o \ - $(MESS_DRIVERS)/mz3500.o \ - $(MESS_DRIVERS)/pce220.o \ - $(MESS_MACHINE)/pce220_ser.o\ - $(MESS_DRIVERS)/mz6500.o \ - $(MESS_DRIVERS)/zaurus.o \ - -$(MESSOBJ)/sinclair.a: \ - $(MESS_VIDEO)/spectrum.o \ - $(MESS_VIDEO)/timex.o \ - $(MESS_VIDEO)/zx.o \ - $(MESS_DRIVERS)/zx.o \ - $(MESS_MACHINE)/zx.o \ - $(MESS_DRIVERS)/spectrum.o \ - $(MESS_DRIVERS)/spec128.o \ - $(MESS_DRIVERS)/timex.o \ - $(MESS_DRIVERS)/specpls3.o \ - $(MESS_DRIVERS)/scorpion.o \ - $(MESS_DRIVERS)/atm.o \ - $(MESS_DRIVERS)/pentagon.o \ - $(MESS_MACHINE)/beta.o \ - $(MESS_MACHINE)/spec_snqk.o \ - $(MESS_DRIVERS)/ql.o \ - $(MESS_MACHINE)/qimi.o \ - $(MESS_VIDEO)/zx8301.o \ - $(MESS_MACHINE)/zx8302.o \ - -$(MESSOBJ)/siemens.a: \ - $(MESS_DRIVERS)/pcd.o \ - $(MESS_MACHINE)/pcd_kbd.o \ - -$(MESSOBJ)/slicer.a: \ - $(MESS_DRIVERS)/slicer.o \ - -$(MESSOBJ)/snk.a: \ - $(MESS_DRIVERS)/ng_aes.o \ - $(MESS_DRIVERS)/ngp.o $(MESS_VIDEO)/k1ge.o \ - -$(MESSOBJ)/sony.a: \ - $(MESS_DRIVERS)/pockstat.o $(MESS_DRIVERS)/psx.o $(MESS_MACHINE)/psxcd.o \ - $(MESS_DRIVERS)/pve500.o \ - $(MESS_DRIVERS)/smc777.o \ - -$(MESSOBJ)/sord.a: \ - $(MESS_DRIVERS)/m5.o \ - -$(MESSOBJ)/special.a: \ - $(MESS_DRIVERS)/special.o $(MESS_AUDIO)/specimx_snd.o $(MESS_MACHINE)/special.o $(MESS_VIDEO)/special.o \ - -$(MESSOBJ)/sun.a: \ - $(MESS_DRIVERS)/sun1.o \ - $(MESS_DRIVERS)/sun2.o \ - $(MESS_DRIVERS)/sun3.o \ - $(MESS_DRIVERS)/sun4.o \ - -$(MESSOBJ)/svi.a: \ - $(MESS_DRIVERS)/svi318.o $(MESS_MACHINE)/svi318.o \ - -$(MESSOBJ)/svision.a: \ - $(MESS_DRIVERS)/svision.o $(MESS_AUDIO)/svis_snd.o \ - -$(MESSOBJ)/swtpc09.a: \ - $(MESS_DRIVERS)/swtpc09.o $(MESS_MACHINE)/swtpc09.o \ - -$(MESSOBJ)/synertec.a: \ - $(MESS_DRIVERS)/sym1.o \ - -$(MESSOBJ)/ta.a: \ - $(MESS_DRIVERS)/alphatro.o \ - -$(MESSOBJ)/tandberg.a: \ - $(MESS_DRIVERS)/tdv2324.o \ - -$(MESSOBJ)/tangerin.a: \ - $(MESS_DRIVERS)/microtan.o $(MESS_MACHINE)/microtan.o $(MESS_VIDEO)/microtan.o \ - $(MESS_DRIVERS)/oric.o - -$(MESSOBJ)/tatung.a: \ - $(MESS_DRIVERS)/einstein.o $(MESS_MACHINE)/einstein.o \ - -$(MESSOBJ)/teamconc.a: \ - $(MESS_DRIVERS)/comquest.o $(MESS_VIDEO)/comquest.o \ - -$(MESSOBJ)/tektroni.a: \ - $(MESS_DRIVERS)/tek405x.o \ - $(MESS_DRIVERS)/tek410x.o \ - -$(MESSOBJ)/telenova.a: \ - $(MESS_DRIVERS)/compis.o $(MESS_MACHINE)/compiskb.o \ - -$(MESSOBJ)/telercas.a: \ - $(MESS_DRIVERS)/tmc1800.o $(MESS_VIDEO)/tmc1800.o \ - $(MESS_DRIVERS)/tmc600.o $(MESS_VIDEO)/tmc600.o \ - $(MESS_DRIVERS)/tmc2000e.o \ - -$(MESSOBJ)/televideo.a: \ - $(MESS_DRIVERS)/ts802.o \ - $(MESS_DRIVERS)/ts803.o \ - $(MESS_DRIVERS)/ts816.o \ - $(MESS_DRIVERS)/tv950.o \ - -$(MESSOBJ)/tem.a: \ - $(MESS_DRIVERS)/tec1.o \ - -$(MESSOBJ)/tesla.a: \ - $(MESS_DRIVERS)/ondra.o $(MESS_MACHINE)/ondra.o $(MESS_VIDEO)/ondra.o \ - $(MESS_DRIVERS)/pmd85.o $(MESS_MACHINE)/pmd85.o $(MESS_VIDEO)/pmd85.o \ - $(MESS_DRIVERS)/pmi80.o \ - $(MESS_DRIVERS)/sapi1.o \ - -$(MESSOBJ)/test.a: \ - $(MESS_DRIVERS)/test_t400.o \ - $(MESS_DRIVERS)/zexall.o \ - -$(MESSOBJ)/thomson.a: \ - $(MESS_DRIVERS)/thomson.o $(MESS_MACHINE)/thomson.o $(MESS_MACHINE)/thomflop.o $(MESS_VIDEO)/thomson.o \ - -$(MESSOBJ)/ti.a: \ - $(MESS_DRIVERS)/avigo.o $(MESS_VIDEO)/avigo.o \ - $(MESS_DRIVERS)/cc40.o \ - $(MESS_DRIVERS)/evmbug.o \ - $(MESS_DRIVERS)/exelv.o \ - $(MESS_DRIVERS)/geneve.o \ - $(MESS_DRIVERS)/ticalc1x.o \ - $(MESS_DRIVERS)/tispeak.o \ - $(MESS_DRIVERS)/ti74.o \ - $(MESS_DRIVERS)/ti85.o $(MESS_MACHINE)/ti85.o $(MESS_VIDEO)/ti85.o \ - $(MESS_DRIVERS)/ti89.o \ - $(MESS_DRIVERS)/ti99_2.o \ - $(MESS_DRIVERS)/ti99_4x.o \ - $(MESS_DRIVERS)/ti99_4p.o \ - $(MESS_DRIVERS)/ti99_8.o \ - $(MESS_DRIVERS)/ti990_4.o \ - $(MESS_DRIVERS)/ti990_10.o \ - $(MESS_DRIVERS)/tm990189.o \ - $(MESS_MACHINE)/ti99/990_dk.o \ - $(MESS_MACHINE)/ti99/990_hd.o \ - $(MESS_MACHINE)/ti99/990_tap.o \ - $(MESS_MACHINE)/ti99/datamux.o \ - $(MESS_MACHINE)/ti99/genboard.o \ - $(MESS_MACHINE)/ti99/grom.o \ - $(MESS_MACHINE)/ti99/gromport.o \ - $(MESS_MACHINE)/ti99/handset.o \ - $(MESS_MACHINE)/ti99/joyport.o \ - $(MESS_MACHINE)/ti99/mapper8.o \ - $(MESS_MACHINE)/ti99/mecmouse.o \ - $(MESS_MACHINE)/ti99/speech8.o \ - $(MESS_MACHINE)/ti99/videowrp.o \ - $(MESS_VIDEO)/733_asr.o \ - $(MESS_VIDEO)/911_vdt.o \ - $(MESS_DRIVERS)/hh_tms1k.o \ - -$(MESSOBJ)/tiger.a: \ - $(MESS_DRIVERS)/gamecom.o $(MESS_MACHINE)/gamecom.o $(MESS_VIDEO)/gamecom.o \ - -$(MESSOBJ)/tigertel.a: \ - $(MESS_DRIVERS)/gizmondo.o $(MESS_MACHINE)/docg3.o \ - -$(MESSOBJ)/tiki.a: \ - $(MESS_DRIVERS)/tiki100.o \ - -$(MESSOBJ)/tomy.a: \ - $(MESS_DRIVERS)/tutor.o \ - -$(MESSOBJ)/toshiba.a: \ - $(MESS_DRIVERS)/pasopia.o \ - $(MESS_DRIVERS)/pasopia7.o \ - $(MESS_DRIVERS)/paso1600.o \ - -$(MESSOBJ)/trainer.a: \ - $(MESS_DRIVERS)/amico2k.o \ - $(MESS_DRIVERS)/babbage.o \ - $(MESS_DRIVERS)/bob85.o \ - $(MESS_DRIVERS)/cvicny.o \ - $(MESS_DRIVERS)/dolphunk.o \ - $(MESS_DRIVERS)/instruct.o \ - $(MESS_DRIVERS)/mk14.o \ - $(MESS_DRIVERS)/pro80.o \ - $(MESS_DRIVERS)/savia84.o \ - $(MESS_DRIVERS)/selz80.o \ - $(MESS_DRIVERS)/tk80.o \ - -$(MESSOBJ)/trs.a: \ - $(MESS_DRIVERS)/coco12.o \ - $(MESS_DRIVERS)/coco3.o \ - $(MESS_DRIVERS)/dragon.o \ - $(MESS_DRIVERS)/mc10.o \ - $(MESS_MACHINE)/6883sam.o \ - $(MESS_MACHINE)/coco.o \ - $(MESS_MACHINE)/coco12.o \ - $(MESS_MACHINE)/coco3.o \ - $(MESS_MACHINE)/coco_vhd.o \ - $(MESS_MACHINE)/dragon.o \ - $(MESS_MACHINE)/dgnalpha.o \ - $(MESS_VIDEO)/gime.o \ - $(MESS_DRIVERS)/trs80.o $(MESS_MACHINE)/trs80.o $(MESS_VIDEO)/trs80.o \ - $(MESS_DRIVERS)/trs80m2.o $(MESS_MACHINE)/trs80m2kb.o \ - $(MESS_DRIVERS)/tandy2k.o $(MESS_MACHINE)/tandy2kb.o \ - -$(MESSOBJ)/ultratec.a: \ - $(MESS_DRIVERS)/minicom.o \ - -$(MESSOBJ)/unisys.a: \ - $(MESS_DRIVERS)/univac.o \ - -$(MESSOBJ)/veb.a: \ - $(MESS_DRIVERS)/chessmst.o \ - $(MESS_DRIVERS)/kc.o $(MESS_MACHINE)/kc.o $(MESS_MACHINE)/kc_keyb.o $(MESS_VIDEO)/kc.o \ - $(MESS_DRIVERS)/lc80.o \ - $(MESS_DRIVERS)/mc80.o $(MESS_MACHINE)/mc80.o $(MESS_VIDEO)/mc80.o \ - $(MESS_DRIVERS)/poly880.o \ - $(MESS_DRIVERS)/sc1.o \ - $(MESS_DRIVERS)/sc2.o \ - -$(MESSOBJ)/vidbrain.a: \ - $(MESS_DRIVERS)/vidbrain.o $(MESS_VIDEO)/uv201.o \ - -$(MESSOBJ)/videoton.a: \ - $(MESS_DRIVERS)/tvc.o $(MESS_AUDIO)/tvc_snd.o \ - -$(MESSOBJ)/visual.a: \ - $(MESS_DRIVERS)/v1050.o $(MESS_MACHINE)/v1050kb.o $(MESS_VIDEO)/v1050.o \ - -$(MESSOBJ)/votrax.a: \ - $(MESS_DRIVERS)/votrpss.o \ - $(MESS_DRIVERS)/votrtnt.o \ - -$(MESSOBJ)/vtech.a: \ - $(MESS_DRIVERS)/crvision.o \ - $(MESS_DRIVERS)/geniusiq.o \ - $(MESS_DRIVERS)/laser3k.o \ - $(MESS_DRIVERS)/lcmate2.o \ - $(MESS_DRIVERS)/pc4.o $(MESS_VIDEO)/pc4.o \ - $(MESS_DRIVERS)/pc2000.o \ - $(MESS_DRIVERS)/pitagjr.o \ - $(MESS_DRIVERS)/prestige.o \ - $(MESS_DRIVERS)/vtech1.o \ - $(MESS_DRIVERS)/vtech2.o $(MESS_MACHINE)/vtech2.o $(MESS_VIDEO)/vtech2.o \ - $(MESS_DRIVERS)/socrates.o $(MESS_AUDIO)/socrates.o \ - -$(MESSOBJ)/wang.a: \ - $(MESS_DRIVERS)/wangpc.o $(MESS_MACHINE)/wangpckb.o \ - -$(MESSOBJ)/wavemate.a: \ - $(MESS_DRIVERS)/bullet.o \ - $(MESS_DRIVERS)/jupiter.o \ - -$(MESSOBJ)/xerox.a: \ - $(MESS_DRIVERS)/xerox820.o $(MESS_MACHINE)/x820kb.o \ - $(MESS_DRIVERS)/bigbord2.o \ - $(MESS_DRIVERS)/alto2.o \ - -$(MESSOBJ)/xussrpc.a: \ - $(MESS_DRIVERS)/ec184x.o \ - $(MESS_DRIVERS)/iskr103x.o \ - $(MESS_DRIVERS)/mc1502.o \ - $(MESS_DRIVERS)/poisk1.o $(MESS_VIDEO)/poisk1.o \ - -$(MESSOBJ)/yamaha.a: \ - $(MESS_DRIVERS)/ymmu100.o \ - $(MESS_DRIVERS)/fb01.o \ - -$(MESS_DRIVERS)/ymmu100.o: $(MESS_DRIVERS)/ymmu100.inc -$(MESS_DRIVERS)/ymmu100.inc: $(MESSSRC)/drivers/ymmu100.ppm $(SRC)/build/file2str.py - @echo Converting $<... - @$(PYTHON) $(SRC)/build/file2str.py $(MESSSRC)/drivers/ymmu100.ppm $@ ymmu100_bkg UINT8 - -$(MESSOBJ)/zenith.a: \ - $(MESS_DRIVERS)/z100.o \ - -$(MESSOBJ)/zpa.a: \ - $(MESS_DRIVERS)/iq151.o \ - -$(MESSOBJ)/zvt.a: \ - $(MESS_DRIVERS)/pp01.o $(MESS_MACHINE)/pp01.o $(MESS_VIDEO)/pp01.o \ - -$(MESSOBJ)/skeleton.a: \ - $(MESS_DRIVERS)/alphasma.o \ - $(MESS_DRIVERS)/ampro.o \ - $(MESS_DRIVERS)/amust.o \ - $(MESS_DRIVERS)/applix.o \ - $(MESS_DRIVERS)/attache.o \ - $(MESS_DRIVERS)/ax20.o \ - $(MESS_DRIVERS)/beehive.o \ - $(MESS_DRIVERS)/binbug.o \ - $(MESS_DRIVERS)/besta.o \ - $(MESS_DRIVERS)/bitgraph.o \ - $(MESS_DRIVERS)/br8641.o \ - $(MESS_DRIVERS)/busicom.o $(MESS_VIDEO)/busicom.o \ - $(MESS_DRIVERS)/chaos.o \ - $(MESS_DRIVERS)/chesstrv.o \ - $(MESS_DRIVERS)/cd2650.o \ - $(MESS_DRIVERS)/cdc721.o \ - $(MESS_DRIVERS)/codata.o \ - $(MESS_DRIVERS)/cortex.o \ - $(MESS_DRIVERS)/cosmicos.o \ - $(MESS_DRIVERS)/cp1.o \ - $(MESS_DRIVERS)/cxhumax.o \ - $(MESS_DRIVERS)/czk80.o \ - $(MESS_DRIVERS)/d6800.o \ - $(MESS_DRIVERS)/d6809.o \ - $(MESS_DRIVERS)/digel804.o \ - $(MESS_DRIVERS)/dim68k.o \ - $(MESS_DRIVERS)/dm7000.o \ - $(MESS_DRIVERS)/dmv.o $(MESS_MACHINE)/dmv_keyb.o \ - $(MESS_DRIVERS)/dps1.o \ - $(MESS_DRIVERS)/dsb46.o \ - $(MESS_DRIVERS)/dual68.o \ - $(MESS_DRIVERS)/eacc.o \ - $(MESS_DRIVERS)/elwro800.o \ - $(MESS_DRIVERS)/eti660.o \ - $(MESS_DRIVERS)/excali64.o \ - $(MESS_DRIVERS)/fanucs15.o \ - $(MESS_DRIVERS)/fanucspmg.o \ - $(MESS_DRIVERS)/fc100.o \ - $(MESS_DRIVERS)/fk1.o \ - $(MESS_DRIVERS)/ft68m.o \ - $(MESS_DRIVERS)/gamate.o $(MESS_AUDIO)/gamate.o \ - $(MESS_DRIVERS)/gameking.o \ - $(MESS_DRIVERS)/gimix.o \ - $(MESS_DRIVERS)/grfd2301.o \ - $(MESS_DRIVERS)/harriet.o \ - $(MESS_DRIVERS)/hprot1.o \ - $(MESS_DRIVERS)/hpz80unk.o \ - $(MESS_DRIVERS)/ht68k.o \ - $(MESS_DRIVERS)/hunter2.o $(EMU_MACHINE)/nsc810.o \ - $(MESS_DRIVERS)/ibm6580.o \ - $(MESS_DRIVERS)/ie15.o $(MESS_MACHINE)/ie15_kbd.o \ - $(MESS_DRIVERS)/if800.o \ - $(MESS_DRIVERS)/imsai.o \ - $(MESS_DRIVERS)/indiana.o \ - $(MESS_DRIVERS)/itt3030.o \ - $(MESS_DRIVERS)/jade.o \ - $(MESS_DRIVERS)/jonos.o \ - $(MESS_DRIVERS)/konin.o \ - $(MESS_DRIVERS)/leapster.o \ - $(MESS_DRIVERS)/lft.o \ - $(MESS_DRIVERS)/lola8a.o \ - $(MESS_DRIVERS)/m79152pc.o \ - $(MESS_DRIVERS)/mccpm.o \ - $(MESS_DRIVERS)/mes.o \ - $(MESS_DRIVERS)/mice.o \ - $(MESS_DRIVERS)/micronic.o \ - $(MESS_DRIVERS)/mini2440.o \ - $(MESS_DRIVERS)/mmd1.o \ - $(MESS_DRIVERS)/mod8.o \ - $(MESS_DRIVERS)/modellot.o \ - $(MESS_DRIVERS)/molecular.o \ - $(MESS_DRIVERS)/ms0515.o \ - $(MESS_DRIVERS)/ms9540.o \ - $(MESS_DRIVERS)/mstation.o \ - $(MESS_DRIVERS)/mx2178.o \ - $(MESS_DRIVERS)/mycom.o \ - $(MESS_DRIVERS)/myvision.o \ - $(MESS_DRIVERS)/ngen.o $(MESS_MACHINE)/ngen_kb.o \ - $(MESS_DRIVERS)/octopus.o \ - $(MESS_DRIVERS)/onyx.o \ - $(MESS_DRIVERS)/okean240.o \ - $(MESS_DRIVERS)/p8k.o \ - $(MESS_DRIVERS)/pegasus.o \ - $(MESS_DRIVERS)/pencil2.o \ - $(MESS_DRIVERS)/pes.o \ - $(MESS_DRIVERS)/pipbug.o \ - $(MESS_DRIVERS)/plan80.o \ - $(MESS_DRIVERS)/pm68k.o \ - $(MESS_DRIVERS)/poly.o \ - $(MESS_DRIVERS)/pt68k4.o \ - $(MESS_DRIVERS)/ptcsol.o \ - $(MESS_DRIVERS)/pulsar.o \ - $(MESS_DRIVERS)/pv9234.o \ - $(MESS_DRIVERS)/qtsbc.o \ - $(MESS_DRIVERS)/rvoice.o \ - $(MESS_DRIVERS)/sacstate.o \ - $(MESS_DRIVERS)/sbrain.o \ - $(MESS_DRIVERS)/seattle.o \ - $(MESS_DRIVERS)/sh4robot.o \ - $(MESS_DRIVERS)/softbox.o \ - $(MESS_DRIVERS)/swtpc.o \ - $(MESS_DRIVERS)/sys2900.o \ - $(MESS_DRIVERS)/systec.o \ - $(MESS_DRIVERS)/tavernie.o \ - $(MESS_DRIVERS)/tecnbras.o \ - $(MESS_DRIVERS)/terak.o \ - $(MESS_DRIVERS)/ti630.o \ - $(MESS_DRIVERS)/tsispch.o \ - $(MESS_DRIVERS)/unistar.o \ - $(MESS_DRIVERS)/v6809.o \ - $(MESS_DRIVERS)/vector4.o \ - $(MESS_DRIVERS)/vii.o \ - $(MESS_DRIVERS)/wicat.o \ - $(MESS_DRIVERS)/xor100.o \ - $(MESS_DRIVERS)/xavix.o \ - $(MESS_DRIVERS)/zorba.o \ - - - - -#------------------------------------------------- -# miscellaneous dependencies -#------------------------------------------------- - -$(MESS_MACHINE)/snescx4.o: $(MESSSRC)/machine/cx4ops.inc \ - $(MESSSRC)/machine/cx4oam.inc \ - $(MESSSRC)/machine/cx4fn.inc \ - $(MESSSRC)/machine/cx4data.inc \ - -$(MESS_MACHINE)/nes_slot.o: $(MESSSRC)/machine/nes_ines.inc \ - $(MESSSRC)/machine/nes_pcb.inc \ - $(MESSSRC)/machine/nes_unif.inc \ - -$(MESS_AUDIO)/mac.o: $(MESSSRC)/audio/mac.c \ - $(MESSSRC)/includes/mac.h $(MESSSRC)/machine/egret.h $(MESSSRC)/machine/cuda.h - -$(MESS_VIDEO)/mac.o: $(MESSSRC)/video/mac.c \ - $(MESSSRC)/includes/mac.h $(MESSSRC)/machine/egret.h $(MESSSRC)/machine/cuda.h - -$(MESS_MACHINE)/mac.o: $(MESSSRC)/machine/mac.c \ - $(MESSSRC)/includes/mac.h $(MESSSRC)/machine/egret.h $(MESSSRC)/machine/cuda.h - -$(MESS_MACHINE)/macadb.o: $(MESSSRC)/machine/macadb.c \ - $(MESSSRC)/includes/mac.h $(MESSSRC)/machine/egret.h $(MESSSRC)/machine/cuda.h - -$(MESS_MACHINE)/macrtc.o: $(MESSSRC)/machine/macrtc.c \ - $(MESSSRC)/includes/mac.h $(MESSSRC)/machine/egret.h $(MESSSRC)/machine/cuda.h - -$(MESS_DRIVERS)/mac.o: $(MESSSRC)/drivers/mac.c \ - $(MESSSRC)/includes/mac.h $(MESSSRC)/machine/egret.h $(MESSSRC)/machine/cuda.h - -$(MESS_MACHINE)/egret.o: $(MESSSRC)/machine/egret.c\ - $(MESSSRC)/machine/egret.h - -$(MESS_DRIVERS)/apple2.o: $(MESSSRC)/video/apple2.h -$(MESS_DRIVERS)/apple2e.o: $(MESSSRC)/video/apple2.h -$(MESS_MACHINE)/apple2.o: $(MESSSRC)/includes/apple2.h -$(MESS_VIDEO)/apple2.o: $(MESSSRC)/includes/apple2.h $(MESSSRC)/video/apple2.h -$(MESS_DRIVERS)/apple2gs.o: $(MESSSRC)/includes/apple2.h $(MESSSRC)/includes/apple2gs.h -$(MESS_MACHINE)/apple2gs.o: $(MESSSRC)/includes/apple2.h $(MESSSRC)/includes/apple2gs.h -$(MESS_VIDEO)/apple2gs.o: $(MESSSRC)/includes/apple2.h $(MESSSRC)/includes/apple2gs.h -$(MESS_DRIVERS)/apple3.o: $(MESSSRC)/includes/apple3.h -$(MESS_MACHINE)/apple3.o: $(MESSSRC)/includes/apple3.h -$(MESS_VIDEO)/apple3.o: $(MESSSRC)/includes/apple3.h - - -# $(MESSSRC)/drivers/apollo.c includes m68kcpu.h and m68kcpu.h now includes m68kops.h -$(MESS_DRIVERS)/apollo.o: $(EMUSRC)/cpu/m68000/m68kcpu.h -$(MESS_MACHINE)/apollo_dbg.o: $(EMUSRC)/cpu/m68000/m68kcpu.h - -# when we compile source files we need to include generated files from the OBJ directory -$(MESS_DRIVERS)/apollo.o: $(MESSSRC)/drivers/apollo.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -I$(CPUOBJ)/m68000 -c $< -o $@ - -$(MESS_MACHINE)/apollo_dbg.o: $(MESSSRC)/machine/apollo_dbg.c | $(OSPREBUILD) - @echo Compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -I$(CPUOBJ)/m68000 -c $< -o $@ - -#------------------------------------------------- -# layout dependencies -#------------------------------------------------- - -$(MESS_DRIVERS)/4004clk.o: $(MESS_LAYOUT)/4004clk.lh -$(MESS_VIDEO)/abc1600.o: $(MESS_LAYOUT)/abc1600.lh -$(MESS_DRIVERS)/acrnsys1.o: $(MESS_LAYOUT)/acrnsys1.lh -$(MESS_DRIVERS)/aim65.o: $(MESS_LAYOUT)/aim65.lh -$(MESS_DRIVERS)/aim65_40.o: $(MESS_LAYOUT)/aim65_40.lh -$(MESS_DRIVERS)/alesis.o: $(MESS_LAYOUT)/sr16.lh -$(MESS_DRIVERS)/amico2k.o: $(MESS_LAYOUT)/amico2k.lh -$(MESS_DRIVERS)/amiga.o: $(MESS_LAYOUT)/amiga.lh -$(MESS_VIDEO)/apollo.o: $(MESS_LAYOUT)/apollo.lh \ - $(MESS_LAYOUT)/apollo_15i.lh -$(MESS_DRIVERS)/apollo.o: $(MESS_LAYOUT)/apollo_dsp.lh -$(MESS_DRIVERS)/apricotp.o: $(MESS_LAYOUT)/apricotp.lh -$(MESS_DRIVERS)/avigo.o: $(MESS_LAYOUT)/avigo.lh -$(MESS_DRIVERS)/babbage.o: $(MESS_LAYOUT)/babbage.lh -$(MESS_DRIVERS)/bbc.o: $(MESS_LAYOUT)/bbc.lh -$(MESS_DRIVERS)/beta.o: $(MESS_LAYOUT)/beta.lh -$(MESS_DRIVERS)/bitgraph.o: $(MESS_LAYOUT)/bitgrpha.lh $(MESS_LAYOUT)/bitgrphb.lh -$(MESS_DRIVERS)/bob85.o: $(MESS_LAYOUT)/bob85.lh -$(MESS_DRIVERS)/cc40.o: $(MESS_LAYOUT)/cc40.lh -$(MAME_DRIVERS)/cdi.o: $(MAME_LAYOUT)/cdi.lh -$(MESS_DRIVERS)/chessmst.o: $(MESS_LAYOUT)/chessmst.lh -$(MESS_DRIVERS)/chesstrv.o: $(MESS_LAYOUT)/chesstrv.lh \ - $(MESS_LAYOUT)/borisdpl.lh -$(MESS_DRIVERS)/cp1.o: $(MESS_LAYOUT)/cp1.lh -$(MESS_DRIVERS)/cvicny.o: $(MESS_LAYOUT)/cvicny.lh -$(MESS_DRIVERS)/coco3.o: $(MESS_LAYOUT)/coco3.lh -$(MESS_DRIVERS)/cosmicos.o: $(MESS_LAYOUT)/cosmicos.lh -$(MESS_DRIVERS)/c80.o: $(MESS_LAYOUT)/c80.lh -$(MESS_DRIVERS)/digel804.o: $(MESS_LAYOUT)/digel804.lh -$(MESS_DRIVERS)/dmv.o: $(MESS_LAYOUT)/dmv.lh -$(MESS_DRIVERS)/dolphunk.o: $(MESS_LAYOUT)/dolphunk.lh -$(MESS_DRIVERS)/eacc.o: $(MESS_LAYOUT)/eacc.lh -$(MESS_DRIVERS)/elecbowl.o: $(MESS_LAYOUT)/elecbowl.lh -$(MESS_DRIVERS)/elekscmp.o: $(MESS_LAYOUT)/elekscmp.lh -$(MESS_DRIVERS)/elf.o: $(MESS_LAYOUT)/elf2.lh -$(MESS_MACHINE)/esqvfd.o: $(MESS_LAYOUT)/esq2by40.lh \ - $(MESS_LAYOUT)/esq1by22.lh -$(MESS_DRIVERS)/et3400.o: $(MESS_LAYOUT)/et3400.lh -$(MESS_DRIVERS)/fb01.o: $(MESS_LAYOUT)/fb01.lh -$(MESS_DRIVERS)/fidelz80.o: $(MESS_LAYOUT)/fidelz80.lh \ - $(MESS_LAYOUT)/bridgec3.lh \ - $(MESS_LAYOUT)/vsc.lh -$(MESS_DRIVERS)/gamecom.o: $(MESS_LAYOUT)/gamecom.lh -$(MESS_DRIVERS)/glasgow.o: $(MESS_LAYOUT)/glasgow.lh -$(MESS_DRIVERS)/h8.o: $(MESS_LAYOUT)/h8.lh -$(MESS_DRIVERS)/hh_hmcs40.o:$(MESS_LAYOUT)/hh_hmcs40_test.lh -$(MESS_DRIVERS)/hh_pic16.o: $(MESS_LAYOUT)/maniac.lh -$(MESS_DRIVERS)/hh_tms1k.o: $(MESS_LAYOUT)/amaztron.lh \ - $(MESS_LAYOUT)/bankshot.lh \ - $(MESS_LAYOUT)/cnsector.lh \ - $(MESS_LAYOUT)/comp4.lh \ - $(MESS_LAYOUT)/ebball.lh \ - $(MESS_LAYOUT)/ebball2.lh \ - $(MESS_LAYOUT)/ebball3.lh \ - $(MESS_LAYOUT)/elecdet.lh \ - $(MESS_LAYOUT)/mathmagi.lh \ - $(MESS_LAYOUT)/merlin.lh \ - $(MESS_LAYOUT)/simon.lh \ - $(MESS_LAYOUT)/ssimon.lh \ - $(MESS_LAYOUT)/splitsec.lh \ - $(MESS_LAYOUT)/starwbc.lh \ - $(MESS_LAYOUT)/stopthie.lh \ - $(MESS_LAYOUT)/tandy12.lh \ - $(MESS_LAYOUT)/tc4.lh -$(MESS_DRIVERS)/hh_ucom4.o: $(MESS_LAYOUT)/hh_ucom4_test.lh -$(MESS_DRIVERS)/ie15.o: $(MESS_LAYOUT)/ie15.lh -$(MESS_DRIVERS)/instruct.o: $(MESS_LAYOUT)/instruct.lh -$(MESS_DRIVERS)/k1003.o: $(MESS_LAYOUT)/k1003.lh -$(MESS_DRIVERS)/kim1.o: $(MESS_LAYOUT)/kim1.lh -$(MESS_DRIVERS)/junior.o: $(MESS_LAYOUT)/junior.lh -$(MESS_DRIVERS)/lc80.o: $(MESS_LAYOUT)/lc80.lh -$(MESS_DRIVERS)/llc.o: $(MESS_LAYOUT)/llc1.lh -$(MESS_DRIVERS)/lynx.o: $(MESS_LAYOUT)/lynx.lh -$(MESS_DRIVERS)/mac.o: $(MESS_LAYOUT)/mac.lh -$(MESS_DRIVERS)/mbdtower.o: $(MESS_LAYOUT)/mbdtower.lh -$(MESS_MACHINE)/megacd.o: $(MESS_LAYOUT)/megacd.lh -$(MESS_DRIVERS)/mekd2.o: $(MESS_LAYOUT)/mekd2.lh -$(MESS_DRIVERS)/mephisto.o: $(MESS_LAYOUT)/mephisto.lh -$(MESS_DRIVERS)/minicom.o: $(MESS_LAYOUT)/minicom.lh -$(MESS_DRIVERS)/mirage.o: $(MESS_LAYOUT)/mirage.lh -$(MESS_DRIVERS)/mk1.o: $(MESS_LAYOUT)/mk1.lh -$(MESS_DRIVERS)/mk14.o: $(MESS_LAYOUT)/mk14.lh -$(MESS_DRIVERS)/mk2.o: $(MESS_LAYOUT)/mk2.lh -$(MESS_DRIVERS)/mkit09.o: $(MESS_LAYOUT)/mkit09.lh -$(MESS_DRIVERS)/mmd1.o: $(MESS_LAYOUT)/mmd1.lh \ - $(MESS_LAYOUT)/mmd2.lh -$(MESS_DRIVERS)/mpf1.o: $(MESS_LAYOUT)/mpf1.lh \ - $(MESS_LAYOUT)/mpf1b.lh \ - $(MESS_LAYOUT)/mpf1p.lh -$(MESS_VIDEO)/newbrain.o: $(MESS_LAYOUT)/newbrain.lh -$(MAME_DRIVERS)/neogeo.o: $(MAME_LAYOUT)/neogeo.lh -$(MESS_DRIVERS)/pc1500.o: $(MESS_LAYOUT)/pc1500.lh -$(MESS_DRIVERS)/pc2000.o: $(MESS_LAYOUT)/gl3000s.lh -$(MESS_VIDEO)/pc8401a.o: $(MESS_LAYOUT)/pc8500.lh -$(MESS_DRIVERS)/pcw.o: $(MESS_LAYOUT)/pcw.lh -$(MESS_DRIVERS)/pmi80.o: $(MESS_LAYOUT)/pmi80.lh -$(MESS_DRIVERS)/poly880.o: $(MESS_LAYOUT)/poly880.lh -$(MESS_DRIVERS)/pro80.o: $(MESS_LAYOUT)/pro80.lh -$(MESS_DRIVERS)/pve500.o: $(MESS_LAYOUT)/pve500.lh -$(MESS_DRIVERS)/px4.o: $(MESS_LAYOUT)/px4.lh -$(MESS_DRIVERS)/px8.o: $(MESS_LAYOUT)/px8.lh -$(MESS_DRIVERS)/ravens.o: $(MESS_LAYOUT)/ravens.lh -$(MESS_DRIVERS)/rainbow.o: $(MESS_LAYOUT)/rainbow.lh -$(MESS_DRIVERS)/savia84.o: $(MESS_LAYOUT)/savia84.lh -$(MESS_DRIVERS)/sc1.o: $(MESS_LAYOUT)/sc1.lh -$(MESS_DRIVERS)/sc2.o: $(MESS_LAYOUT)/sc2.lh -$(MESS_DRIVERS)/sdk85.o: $(MESS_LAYOUT)/sdk85.lh -$(MESS_DRIVERS)/sdk86.o: $(MESS_LAYOUT)/sdk86.lh -$(MESS_DRIVERS)/selz80.o: $(MESS_LAYOUT)/selz80.lh -$(MESS_DRIVERS)/sitcom.o: $(MESS_LAYOUT)/sitcom.lh -$(MESS_DRIVERS)/slc1.o: $(MESS_LAYOUT)/slc1.lh -$(MESS_DRIVERS)/sms.o: $(MESS_LAYOUT)/sms1.lh -$(MESS_DRIVERS)/super80.o: $(MESS_LAYOUT)/super80.lh -$(MESS_DRIVERS)/supercon.o: $(MESS_LAYOUT)/supercon.lh -$(MESS_DRIVERS)/svision.o: $(MESS_LAYOUT)/svision.lh -$(MESS_DRIVERS)/svmu.o: $(MESS_LAYOUT)/svmu.lh -$(MESS_DRIVERS)/sym1.o: $(MESS_LAYOUT)/sym1.lh -$(MESS_DRIVERS)/tavernie.o: $(MESS_LAYOUT)/tavernie.lh -$(MESS_DRIVERS)/tb303.o: $(MESS_LAYOUT)/tb303.lh -$(MESS_DRIVERS)/tc4.o: $(MESS_LAYOUT)/tc4.lh -$(MESS_DRIVERS)/tec1.o: $(MESS_LAYOUT)/tec1.lh -$(MESS_DRIVERS)/tecnbras.o: $(MESS_LAYOUT)/tecnbras.lh -$(MESS_DRIVERS)/ti74.o: $(MESS_LAYOUT)/ti74.lh \ - $(MESS_LAYOUT)/ti95.lh -$(MESS_DRIVERS)/ticalc1x.o: $(MESS_LAYOUT)/ti1270.lh \ - $(MESS_LAYOUT)/ti30.lh \ - $(MESS_LAYOUT)/tisr16.lh \ - $(MESS_LAYOUT)/wizatron.lh -$(MESS_DRIVERS)/tispeak.o: $(MESS_LAYOUT)/lantutor.lh \ - $(MESS_LAYOUT)/snspell.lh -$(MESS_DRIVERS)/tk80.o: $(MESS_LAYOUT)/tk80.lh -$(MESS_DRIVERS)/tm990189.o: $(MESS_LAYOUT)/tm990189.lh \ - $(MESS_LAYOUT)/tm990189v.lh -$(MESS_DRIVERS)/unixpc.o: $(MESS_LAYOUT)/unixpc.lh -$(MESS_DRIVERS)/ut88.o: $(MESS_LAYOUT)/ut88mini.lh -$(MESS_DRIVERS)/vboy.o: $(MESS_LAYOUT)/vboy.lh -$(MESS_DRIVERS)/vcs80.o: $(MESS_LAYOUT)/vcs80.lh -$(MESS_DRIVERS)/vidbrain.o: $(MESS_LAYOUT)/vidbrain.lh -$(MESS_DRIVERS)/votrpss.o: $(MESS_LAYOUT)/votrpss.lh -$(MESS_DRIVERS)/votrtnt.o: $(MESS_LAYOUT)/votrtnt.lh -$(MESS_DRIVERS)/vk100.o: $(MESS_LAYOUT)/vk100.lh -$(MESS_DRIVERS)/vt100.o: $(MESS_LAYOUT)/vt100.lh -$(MESS_DRIVERS)/wicat.o: $(MESS_LAYOUT)/wicat.lh -$(MESS_DRIVERS)/wildfire.o: $(MESS_LAYOUT)/wildfire.lh -$(MESS_DRIVERS)/wswan.o: $(MESS_LAYOUT)/wswan.lh -$(MESS_DRIVERS)/x68k.o: $(MESS_LAYOUT)/x68000.lh -$(MESS_DRIVERS)/z80dev.o: $(MESS_LAYOUT)/z80dev.lh -$(MESS_DRIVERS)/z80ne.o: $(MESS_LAYOUT)/z80ne.lh \ - $(MESS_LAYOUT)/z80net.lh \ - $(MESS_LAYOUT)/z80netb.lh \ - $(MESS_LAYOUT)/z80netf.lh - - -#------------------------------------------------- -# MESS-specific tools -#------------------------------------------------- - -include $(MESSSRC)/tools/tools.mak +########################################################################### +GEN_FOLDERS += $(GENDIR)/mame/layout/ +LAYOUTS += $(SRC)/mame/layout/cdi.lay $(SRC)/mame/layout/neogeo.lay diff --git a/src/mess/messcore.mak b/src/mess/messcore.mak deleted file mode 100644 index d0f9e077f20..00000000000 --- a/src/mess/messcore.mak +++ /dev/null @@ -1,71 +0,0 @@ -########################################################################### -# -# messcore.mak -# -# MESS emulation core makefile -# -########################################################################### - - -#------------------------------------------------- -# MESS core defines -#------------------------------------------------- - -# add some additional include libraries for the mame files -INCPATH += \ - -I$(SRC)/mame \ - -I$(OBJ)/mame/layout \ - -I$(SRC)/mess/osd \ - -I$(SRC)/mess/osd/$(OSD) - - -# Root object directories -MAMESRC = $(SRC)/mame -MAMEOBJ = $(OBJ)/mame -MESSSRC = $(SRC)/mess -MESSOBJ = $(OBJ)/mess -EMUSRC = $(SRC)/emu -EMUOBJ = $(OBJ)/emu - -# MAME directories -EMU_MACHINE = $(EMUOBJ)/machine -EMU_VIDEO = $(EMUOBJ)/video -MAME_AUDIO = $(MAMEOBJ)/audio -MAME_MACHINE = $(MAMEOBJ)/machine -MAME_DRIVERS = $(MAMEOBJ)/drivers -MAME_VIDEO = $(MAMEOBJ)/video -MAME_LAYOUT = $(MAMEOBJ)/layout - -# MESS directories -MESS_AUDIO = $(MESSOBJ)/audio -MESS_DRIVERS = $(MESSOBJ)/drivers -MESS_LAYOUT = $(MESSOBJ)/layout -MESS_MACHINE = $(MESSOBJ)/machine -MESS_VIDEO = $(MESSOBJ)/video - -OBJDIRS += \ - $(EMU_MACHINE) \ - $(EMU_VIDEO) \ - $(MAME_AUDIO) \ - $(MAME_DRIVERS) \ - $(MAME_LAYOUT) \ - $(MAME_MACHINE) \ - $(MAME_VIDEO) \ - $(MESS_AUDIO) \ - $(MESS_DRIVERS) \ - $(MESS_LAYOUT) \ - $(MESS_MACHINE) \ - $(MESS_VIDEO) \ - -# System-specific directories - -OBJDIRS += \ - $(MESS_MACHINE)/c64 \ - $(MESS_MACHINE)/ti99 \ - - -#------------------------------------------------- -# MESS core objects -#------------------------------------------------- - -LIBOCORE_NOMAIN = $(OBJ)/libocore_nomain.a diff --git a/src/mess/osd/windows/windows.mak b/src/mess/osd/windows/windows.mak deleted file mode 100644 index 0c7ca6125e1..00000000000 --- a/src/mess/osd/windows/windows.mak +++ /dev/null @@ -1,41 +0,0 @@ -########################################################################### -# -# windows.mak -# -# MESS Windows-specific makefile -# -########################################################################### - -MESS_WINSRC = src/mess/osd/windows -MESS_WINOBJ = $(OBJ)/mess/osd/windows - -OBJDIRS += \ - $(MESSOBJ)/osd \ - $(MESSOBJ)/osd/windows - -RESFILE = $(MESS_WINOBJ)/mess.res - -$(LIBOSD): $(OSDOBJS) - -$(LIBOCORE): $(OSDCOREOBJS) - -$(LIBOCORE_NOMAIN): $(OSDCOREOBJS:$(WINOBJ)/main.o=) - -#------------------------------------------------- -# generic rules for the resource compiler -#------------------------------------------------- - -$(MESS_WINOBJ)/%.res: $(MESS_WINSRC)/%.rc - @echo Compiling resources $<... - $(RC) $(RCDEFS) $(RCFLAGS) --include-dir $(MESS_WINOBJ) -o $@ -i $< - - -#------------------------------------------------- -# rules for resource file -#------------------------------------------------- - -$(RESFILE): $(MESS_WINSRC)/mess.rc $(MESS_WINOBJ)/messvers.rc - -$(MESS_WINOBJ)/messvers.rc: $(SRC)/build/verinfo.py $(SRC)/version.c - @echo Emitting $@... - $(PYTHON) $(SRC)/build/verinfo.py -b mess -o $@ $(SRC)/version.c diff --git a/src/mess/tiny.mak b/src/mess/tiny.mak deleted file mode 100644 index 0979e44cb07..00000000000 --- a/src/mess/tiny.mak +++ /dev/null @@ -1,65 +0,0 @@ -########################################################################### -# -# tiny.mak -# -# Small driver-specific example makefile -# Use make TARGET=mess SUBTARGET=tiny to build -# -# As an example this makefile builds MESS with the three Colecovision -# drivers enabled only. -# -# Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - -# include MESS core defines -include $(SRC)/mess/messcore.mak - -#------------------------------------------------- -# Specify all the CPU cores necessary for the -# drivers referenced in tiny.c. -#------------------------------------------------- - -CPUS += Z80 - - - -#------------------------------------------------- -# Specify all the sound cores necessary for the -# drivers referenced in tiny.c. -#------------------------------------------------- - -SOUNDS += SN76496 - - - -#------------------------------------------------- -# specify available video cores -#------------------------------------------------- - -VIDEOS += TMS9928A - - -#------------------------------------------------- -# specify available machine cores -#------------------------------------------------- - - - -#------------------------------------------------- -# specify available bus cores -#------------------------------------------------- - -BUSES += COLECO - -#------------------------------------------------- -# This is the list of files that are necessary -# for building all of the drivers referenced -# in tiny.c -#------------------------------------------------- - -DRVLIBS = \ - $(MESS_DRIVERS)/coleco.o \ - $(MESS_MACHINE)/coleco.o \ - diff --git a/src/mess/tools/castool/castool.mak b/src/mess/tools/castool/castool.mak deleted file mode 100644 index ac8f9e7b760..00000000000 --- a/src/mess/tools/castool/castool.mak +++ /dev/null @@ -1,39 +0,0 @@ -########################################################################### -# -# castool.mak -# -# MESS castool makefile -# -########################################################################### - - -# castool executable name -CASTOOL = $(BIN)castool$(EXE) - -# add path to castool headers -INCPATH += -I$(SRC)/$(TARGET)/tools/castool - -# castool directories -CASTOOLOBJ = $(MESS_TOOLS)/castool - - -#------------------------------------------------- -# castool objects -#------------------------------------------------- - -OBJDIRS += \ - $(CASTOOLOBJ) - -CASTOOL_OBJS = \ - $(CASTOOLOBJ)/main.o \ - - - -#------------------------------------------------- -# rules to build the castool executable -#------------------------------------------------- - -# TODO: Visual Studio wants $(FLAC_LIB) and $(7Z_LIB) during linking... -$(CASTOOL): $(CASTOOL_OBJS) $(FORMATS_LIB) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(FLAC_LIB) $(7Z_LIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ diff --git a/src/mess/tools/floptool/floptool.mak b/src/mess/tools/floptool/floptool.mak deleted file mode 100644 index 19fa39bdc82..00000000000 --- a/src/mess/tools/floptool/floptool.mak +++ /dev/null @@ -1,39 +0,0 @@ -########################################################################### -# -# floptool.mak -# -# MESS floptool makefile -# -########################################################################### - - -# floptool executable name -FLOPTOOL = $(BIN)floptool$(EXE) - -# add path to floptool headers -INCPATH += -I$(SRC)/$(TARGET)/tools/floptool - -# floptool directories -FLOPTOOLOBJ = $(MESS_TOOLS)/floptool - - -#------------------------------------------------- -# floptool objects -#------------------------------------------------- - -OBJDIRS += \ - $(FLOPTOOLOBJ) - -FLOPTOOL_OBJS = \ - $(FLOPTOOLOBJ)/main.o \ - - - -#------------------------------------------------- -# rules to build the floptool executable -#------------------------------------------------- - -# TODO: Visual Studio wants $(FLAC_LIB) and $(7Z_LIB) during linking... -$(FLOPTOOL): $(FLOPTOOL_OBJS) $(FORMATS_LIB) $(LIBEMU) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(FLAC_LIB) $(7Z_LIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ diff --git a/src/mess/tools/imgtool/imgtool.mak b/src/mess/tools/imgtool/imgtool.mak deleted file mode 100644 index abccc4e2ce7..00000000000 --- a/src/mess/tools/imgtool/imgtool.mak +++ /dev/null @@ -1,79 +0,0 @@ -########################################################################### -# -# imgtool.mak -# -# MESS imgtool makefile -# -########################################################################### - - -# imgtool executable name -IMGTOOL = $(BIN)imgtool$(EXE) - -# add path to imgtool headers -INCPATH += -I$(MESSSRC)/tools/imgtool - -# imgtool directories -IMGTOOLOBJ = $(MESS_TOOLS)/imgtool -IMGTOOL_MODULES = $(IMGTOOLOBJ)/modules - - - -#------------------------------------------------- -# imgtool objects -#------------------------------------------------- - -OBJDIRS += \ - $(IMGTOOLOBJ) \ - $(IMGTOOL_MODULES) - -LIBIMGTOOL = $(OBJ)/libimgtool.a - -# imgtool lib objects -IMGTOOL_LIB_OBJS = \ - $(IMGTOOLOBJ)/stream.o \ - $(IMGTOOLOBJ)/library.o \ - $(IMGTOOLOBJ)/modules.o \ - $(IMGTOOLOBJ)/iflopimg.o \ - $(IMGTOOLOBJ)/filter.o \ - $(IMGTOOLOBJ)/filteoln.o \ - $(IMGTOOLOBJ)/filtbas.o \ - $(IMGTOOLOBJ)/imgtool.o \ - $(IMGTOOLOBJ)/imgterrs.o \ - $(IMGTOOLOBJ)/imghd.o \ - $(IMGTOOLOBJ)/charconv.o \ - $(IMGTOOL_MODULES)/amiga.o \ - $(IMGTOOL_MODULES)/macbin.o \ - $(IMGTOOL_MODULES)/rsdos.o \ - $(IMGTOOL_MODULES)/os9.o \ - $(IMGTOOL_MODULES)/mac.o \ - $(IMGTOOL_MODULES)/ti99.o \ - $(IMGTOOL_MODULES)/ti990hd.o \ - $(IMGTOOL_MODULES)/concept.o \ - $(IMGTOOL_MODULES)/fat.o \ - $(IMGTOOL_MODULES)/pc_flop.o \ - $(IMGTOOL_MODULES)/pc_hard.o \ - $(IMGTOOL_MODULES)/prodos.o \ - $(IMGTOOL_MODULES)/vzdos.o \ - $(IMGTOOL_MODULES)/thomson.o \ - $(IMGTOOL_MODULES)/macutil.o \ - $(IMGTOOL_MODULES)/cybiko.o \ - $(IMGTOOL_MODULES)/cybikoxt.o \ - $(IMGTOOL_MODULES)/psion.o \ - $(IMGTOOL_MODULES)/bml3.o \ - $(IMGTOOL_MODULES)/hp48.o \ - -$(LIBIMGTOOL): $(IMGTOOL_LIB_OBJS) - -IMGTOOL_OBJS = \ - $(IMGTOOLOBJ)/main.o \ - - - -#------------------------------------------------- -# rules to build the imgtool executable -#------------------------------------------------- - -$(IMGTOOL): $(IMGTOOL_OBJS) $(LIBIMGTOOL) $(FORMATS_LIB) $(LIBEMU) $(LIBUTIL) $(EXPAT) $(ZLIB) $(FLAC_LIB) $(7Z_LIB) $(LIBOCORE) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ diff --git a/src/mess/tools/tools.mak b/src/mess/tools/tools.mak deleted file mode 100644 index f7b8a6c2f1a..00000000000 --- a/src/mess/tools/tools.mak +++ /dev/null @@ -1,23 +0,0 @@ -########################################################################### -# -# tools.mak -# -# MESS tools makefile -# -########################################################################### - - -# add include path to tools directory -INCPATH += -I$(MESSSRC)/tools - -# tools object directory -MESS_TOOLS = $(MESSOBJ)/tools - -include $(MESSSRC)/tools/imgtool/imgtool.mak -TOOLS += $(IMGTOOL) - -include $(MESSSRC)/tools/castool/castool.mak -TOOLS += $(CASTOOL) - -include $(MESSSRC)/tools/floptool/floptool.mak -TOOLS += $(FLOPTOOL) diff --git a/src/osd/windows/eivc.h b/src/osd/eivc.h index 93927b1712b..93927b1712b 100644 --- a/src/osd/windows/eivc.h +++ b/src/osd/eivc.h diff --git a/src/osd/windows/eivcx86.h b/src/osd/eivcx86.h index b834bc2aa25..b834bc2aa25 100644 --- a/src/osd/windows/eivcx86.h +++ b/src/osd/eivcx86.h diff --git a/src/osd/eminline.h b/src/osd/eminline.h index 3e3f8398e5a..3fca94af079 100644 --- a/src/osd/eminline.h +++ b/src/osd/eminline.h @@ -13,21 +13,131 @@ #ifndef __EMINLINE__ #define __EMINLINE__ -#if !defined(SDLMAME_NOASM) +#if !defined(MAME_NOASM) /* we come with implementations for GCC x86 and PPC */ #if defined(__GNUC__) #if defined(__i386__) || defined(__x86_64__) + + +INLINE void ATTR_FORCE_INLINE +osd_yield_processor(void) +{ + __asm__ __volatile__ ( " rep ; nop ;" ); +} + + +#if defined(__x86_64__) + +//============================================================ +// osd_exchange64 +//============================================================ + +INLINE INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE +_osd_exchange64(INT64 volatile *ptr, INT64 exchange) +{ + register INT64 ret; + __asm__ __volatile__ ( + " lock ; xchg %[exchange], %[ptr] ;" + : [ptr] "+m" (*ptr) + , [ret] "=r" (ret) + : [exchange] "1" (exchange) + ); + return ret; +} +#define osd_exchange64 _osd_exchange64 + +#endif /* __x86_64__ */ + + +#elif defined(__ppc__) || defined (__PPC__) || defined(__ppc64__) || defined(__PPC64__) + + +INLINE void ATTR_FORCE_INLINE +osd_yield_processor(void) +{ + __asm__ __volatile__ ( " nop \n nop \n" ); +} + + + +#if defined(__ppc64__) || defined(__PPC64__) + +//============================================================ +// osd_exchange64 +//============================================================ + +INLINE INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE +_osd_exchange64(INT64 volatile *ptr, INT64 exchange) +{ + register INT64 ret; + __asm__ __volatile__ ( + "1: ldarx %[ret], 0, %[ptr] \n" + " stdcx. %[exchange], 0, %[ptr] \n" + " bne- 1b \n" + : [ret] "=&r" (ret) + : [ptr] "r" (ptr) + , [exchange] "r" (exchange) + : "cr0" + ); + return ret; +} +#define osd_exchange64 _osd_exchange64 + +#endif /* __ppc64__ || __PPC64__ */ + +#endif + +#if defined(__i386__) || defined(__x86_64__) #include "eigccx86.h" #elif defined(__ppc__) || defined (__PPC__) || defined(__ppc64__) || defined(__PPC64__) #include "eigccppc.h" #else -#include "osinline.h" +#error "no matching assembler implementations found - please compile with NOASM=1" +#endif + +#else + +#if defined(_MSC_VER) + +#if (defined(_M_IX86) || defined(_M_X64)) +#include "eivcx86.h" +#endif + +#include "eivc.h" + +INT32 win_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange); +INT32 win_atomic_exchange32(INT32 volatile *ptr, INT32 exchange); +INT32 win_atomic_add32(INT32 volatile *ptr, INT32 delta); + +#ifdef PTR64 +INT64 win_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange); #endif + +#ifndef compare_exchange32 +#define compare_exchange32 win_compare_exchange32 +#endif /* compare_exchange32 */ + +#ifdef PTR64 +#ifndef compare_exchange64 +#define compare_exchange64 win_compare_exchange64 +#endif /* compare_exchange64 */ +#endif + +#ifndef atomic_exchange32 +#define atomic_exchange32 win_atomic_exchange32 +#endif /* atomic_exchange32 */ + + +#ifndef atomic_add32 +#define atomic_add32 win_atomic_add32 +#endif /* atomic_add32 */ #else -#include "osinline.h" +#error "no matching assembler implementations found - please compile with NOASM=1" + +#endif #endif #endif diff --git a/src/osd/modules/debugger/debugosx.m b/src/osd/modules/debugger/debugosx.m index d57d82826bc..27104a1b462 100644 --- a/src/osd/modules/debugger/debugosx.m +++ b/src/osd/modules/debugger/debugosx.m @@ -82,6 +82,7 @@ int debugger_osx::init() void debugger_osx::exit() { + NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init]; if (m_console) { NSDictionary *info = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:m_machine] @@ -93,6 +94,7 @@ void debugger_osx::exit() m_console = nil; m_machine = NULL; } + [pool release]; } //============================================================ @@ -110,6 +112,8 @@ void debugger_osx::init_debugger(running_machine &machine) void debugger_osx::wait_for_debugger(device_t &device, bool firststop) { + NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init]; + // create a console window if (m_console == nil) m_console = [[MAMEDebugConsole alloc] initWithMachine:*m_machine]; @@ -134,6 +138,8 @@ void debugger_osx::wait_for_debugger(device_t &device, bool firststop) dequeue:YES]; if (ev != nil) [NSApp sendEvent:ev]; + + [pool release]; } diff --git a/src/osd/modules/debugger/osx/debugview.m b/src/osd/modules/debugger/osx/debugview.m index 6ed888fd53d..e46e814da4f 100644 --- a/src/osd/modules/debugger/osx/debugview.m +++ b/src/osd/modules/debugger/osx/debugview.m @@ -36,7 +36,9 @@ static NSCharacterSet *NonWhiteCharacters; static void debugwin_view_update(debug_view &view, void *osdprivate) { + NSAutoreleasePool *const pool = [[NSAutoreleasePool alloc] init]; [(MAMEDebugView *)osdprivate update]; + [pool release]; } diff --git a/src/osd/modules/lib/osdobj_common.c b/src/osd/modules/lib/osdobj_common.c index f9ce3321cbf..7a5411d9a58 100644 --- a/src/osd/modules/lib/osdobj_common.c +++ b/src/osd/modules/lib/osdobj_common.c @@ -170,10 +170,12 @@ void osd_common_t::register_options() #ifdef SDLMAME_MACOSX REGISTER_MODULE(m_mod_man, DEBUG_OSX); #endif +#ifndef OSD_MINI REGISTER_MODULE(m_mod_man, DEBUG_WINDOWS); REGISTER_MODULE(m_mod_man, DEBUG_QT); REGISTER_MODULE(m_mod_man, DEBUG_INTERNAL); REGISTER_MODULE(m_mod_man, DEBUG_NONE); +#endif REGISTER_MODULE(m_mod_man, NETDEV_TAPTUN); REGISTER_MODULE(m_mod_man, NETDEV_PCAP); diff --git a/src/osd/modules/netdev/pcap.c b/src/osd/modules/netdev/pcap.c index 756a51f39b8..29e642490bb 100644 --- a/src/osd/modules/netdev/pcap.c +++ b/src/osd/modules/netdev/pcap.c @@ -1,4 +1,4 @@ -#ifdef SDLMAME_NET_PCAP +#if defined(OSD_NET_USE_PCAP) #if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) diff --git a/src/osd/modules/netdev/taptun.c b/src/osd/modules/netdev/taptun.c index cfe6ef6702b..f5be386b870 100644 --- a/src/osd/modules/netdev/taptun.c +++ b/src/osd/modules/netdev/taptun.c @@ -1,4 +1,4 @@ -#if defined(SDLMAME_NET_TAPTUN) +#if defined(OSD_NET_USE_TAPTUN) #include <unistd.h> #include <fcntl.h> diff --git a/src/osd/modules/opengl/gl_shader_mgr.c b/src/osd/modules/opengl/gl_shader_mgr.c index 75d4b777cca..46fbc825aa6 100644 --- a/src/osd/modules/opengl/gl_shader_mgr.c +++ b/src/osd/modules/opengl/gl_shader_mgr.c @@ -1,6 +1,7 @@ #include <stdio.h> /* snprintf */ #include <stdlib.h> /* malloc */ +#include "osdcomm.h" #include "osd_opengl.h" #include "gl_shader_mgr.h" diff --git a/src/osd/modules/opengl/osd_opengl.h b/src/osd/modules/opengl/osd_opengl.h index 829cad43bf5..0113694951d 100644 --- a/src/osd/modules/opengl/osd_opengl.h +++ b/src/osd/modules/opengl/osd_opengl.h @@ -22,9 +22,9 @@ #else #include "GL/gl.h" #include "GL/glext.h" - #endif - #ifndef USE_DISPATCH_GL - #include "GL/wglext.h" + #ifndef USE_DISPATCH_GL + #include "GL/wglext.h" + #endif #endif #else #if (SDLMAME_SDL2) @@ -61,11 +61,11 @@ virtual const char *LastErrorMsg() = 0; virtual void *getProcAddress(const char *proc) = 0; /* - * 0 for immediate updates, - * 1 for updates synchronized with the vertical retrace, - * -1 for late swap tearing + * 0 for immediate updates, + * 1 for updates synchronized with the vertical retrace, + * -1 for late swap tearing * - * returns -1 if swap interval is not supported + * returns -1 if swap interval is not supported * */ virtual int SetSwapInterval(const int swap) = 0; @@ -99,7 +99,7 @@ #undef GET_GLFUNC }; #ifdef _MSC_VER - } + } #endif #undef OSD_GL diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h index 993866984a2..edafeb303ca 100644 --- a/src/osd/modules/osdwindow.h +++ b/src/osd/modules/osdwindow.h @@ -78,9 +78,9 @@ public: #endif render_primitive_list *m_primlist; - osd_window_config m_win_config; + osd_window_config m_win_config; protected: - int m_prescale; + int m_prescale; }; class osd_renderer @@ -131,7 +131,7 @@ protected: private: osd_window *m_window; - int m_flags; + int m_flags; }; diff --git a/src/osd/modules/render/blit13.h b/src/osd/modules/render/blit13.h index 3fd229e93da..e394efc744a 100644 --- a/src/osd/modules/render/blit13.h +++ b/src/osd/modules/render/blit13.h @@ -51,7 +51,7 @@ inline UINT32 pixel_ycc_to_rgb_pal(const UINT16 *pixel, const rgb_t *palette) #define FUNC_DEF(source) op(const source &src, const rgb_t *palbase) const -#define FUNCTOR(name, x...) \ +#define FUNCTOR(name, x) \ template<typename _source, typename _dest> \ struct name { _dest FUNC_DEF(_source) { x } }; diff --git a/src/osd/modules/render/draw13.c b/src/osd/modules/render/draw13.c index acc64a1f982..fb52a725562 100644 --- a/src/osd/modules/render/draw13.c +++ b/src/osd/modules/render/draw13.c @@ -118,7 +118,7 @@ public: private: Uint32 m_sdl_access; - sdl_info13 * m_renderer; + sdl_info13 * m_renderer; render_texinfo m_texinfo; // copy of the texture info HashT m_hash; // hash value for the texture (must be >= pointer size) UINT32 m_flags; // rendering flags diff --git a/src/osd/modules/render/drawbgfx.c b/src/osd/modules/render/drawbgfx.c index 2edb0c74517..84dbb716b18 100644 --- a/src/osd/modules/render/drawbgfx.c +++ b/src/osd/modules/render/drawbgfx.c @@ -5,12 +5,12 @@ // drawbgfx.c - BGFX drawer // //============================================================ - -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) -// standard windows headers #define __STDC_LIMIT_MACROS #define __STDC_FORMAT_MACROS #define __STDC_CONSTANT_MACROS + +#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) +// standard windows headers #define WIN32_LEAN_AND_MEAN #include <windows.h> #else diff --git a/src/osd/modules/render/drawogl.c b/src/osd/modules/render/drawogl.c index 328310ba9c6..4a3bf4d1e45 100644 --- a/src/osd/modules/render/drawogl.c +++ b/src/osd/modules/render/drawogl.c @@ -281,50 +281,50 @@ private: int setupPixelFormat(HDC hDC) { - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), /* size */ - 1, /* version */ - PFD_SUPPORT_OPENGL | - PFD_DRAW_TO_WINDOW | - PFD_DOUBLEBUFFER, /* support double-buffering */ - PFD_TYPE_RGBA, /* color type */ - 32, /* prefered color depth */ - 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ - 0, /* no alpha buffer */ - 0, /* alpha bits (ignored) */ - 0, /* no accumulation buffer */ - 0, 0, 0, 0, /* accum bits (ignored) */ - 16, /* depth buffer */ - 0, /* no stencil buffer */ - 0, /* no auxiliary buffers */ - PFD_MAIN_PLANE, /* main layer */ - 0, /* reserved */ - 0, 0, 0, /* no layer, visible, damage masks */ - }; - int pixelFormat; - - pixelFormat = ChoosePixelFormat(hDC, &pfd); - if (pixelFormat == 0) { - strcpy(m_error, "ChoosePixelFormat failed"); - return 1; - } - - if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) { - strcpy(m_error, "SetPixelFormat failed."); - return 1; - } - return 0; + PIXELFORMATDESCRIPTOR pfd = { + sizeof(PIXELFORMATDESCRIPTOR), /* size */ + 1, /* version */ + PFD_SUPPORT_OPENGL | + PFD_DRAW_TO_WINDOW | + PFD_DOUBLEBUFFER, /* support double-buffering */ + PFD_TYPE_RGBA, /* color type */ + 32, /* prefered color depth */ + 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ + 0, /* no alpha buffer */ + 0, /* alpha bits (ignored) */ + 0, /* no accumulation buffer */ + 0, 0, 0, 0, /* accum bits (ignored) */ + 16, /* depth buffer */ + 0, /* no stencil buffer */ + 0, /* no auxiliary buffers */ + PFD_MAIN_PLANE, /* main layer */ + 0, /* reserved */ + 0, 0, 0, /* no layer, visible, damage masks */ + }; + int pixelFormat; + + pixelFormat = ChoosePixelFormat(hDC, &pfd); + if (pixelFormat == 0) { + strcpy(m_error, "ChoosePixelFormat failed"); + return 1; + } + + if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE) { + strcpy(m_error, "SetPixelFormat failed."); + return 1; + } + return 0; } bool WGLExtensionSupported(const char *extension_name) { - //if (pfn_wglGetExtensionsStringEXT != NULL) - // printf("%s\n", this->pfn_wglGetExtensionsStringEXT()); + //if (pfn_wglGetExtensionsStringEXT != NULL) + // printf("%s\n", this->pfn_wglGetExtensionsStringEXT()); - if (pfn_wglGetExtensionsStringEXT != NULL && strstr(pfn_wglGetExtensionsStringEXT(), extension_name) != NULL) - return true; - else - return false; + if (pfn_wglGetExtensionsStringEXT != NULL && strstr(pfn_wglGetExtensionsStringEXT(), extension_name) != NULL) + return true; + else + return false; } HGLRC m_context; @@ -589,7 +589,7 @@ private: int m_height; osd_dim m_blit_dim; - osd_gl_context *m_gl_context; + osd_gl_context *m_gl_context; int m_initialized; // is everything well initialized, i.e. all GL stuff etc. // 3D info (GL mode only) diff --git a/src/osd/modules/render/drawsdl.c b/src/osd/modules/render/drawsdl.c index df979c35911..32753ef79b9 100644 --- a/src/osd/modules/render/drawsdl.c +++ b/src/osd/modules/render/drawsdl.c @@ -129,7 +129,7 @@ struct sdl_scale_mode #if (!SDLMAME_SDL2) int m_extra_flags; /* Texture/surface flags */ #else - const char *sdl_scale_mode; /* what to use as a hint ? */ + const char *sdl_scale_mode_hint; /* what to use as a hint ? */ #endif int pixel_format; /* Pixel/Overlay format */ void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height); @@ -435,7 +435,7 @@ int sdl_info::create() // create renderer /* set hints ... */ - SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode); + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode_hint); if (video_config.waitvsync) diff --git a/src/osd/modules/sync/sync_ntc.c b/src/osd/modules/sync/sync_ntc.c index 9da576b5149..025e5b37713 100644 --- a/src/osd/modules/sync/sync_ntc.c +++ b/src/osd/modules/sync/sync_ntc.c @@ -31,7 +31,6 @@ // MAME headers #include "osdcore.h" -#include "osinline.h" #include "osdsync.h" #include "eminline.h" diff --git a/src/osd/modules/sync/sync_os2.c b/src/osd/modules/sync/sync_os2.c index 5526b26cf3b..75164c517c5 100644 --- a/src/osd/modules/sync/sync_os2.c +++ b/src/osd/modules/sync/sync_os2.c @@ -21,7 +21,6 @@ // MAME headers #include "osdcore.h" -#include "osinline.h" #include "osdsync.h" #include "eminline.h" diff --git a/src/osd/modules/sync/sync_sdl.c b/src/osd/modules/sync/sync_sdl.c index cea1337c7f8..56e2ad15639 100644 --- a/src/osd/modules/sync/sync_sdl.c +++ b/src/osd/modules/sync/sync_sdl.c @@ -18,7 +18,6 @@ // MAME headers #include "osdcore.h" -#include "osinline.h" #include "osdsync.h" #include "eminline.h" diff --git a/src/osd/modules/sync/sync_windows.c b/src/osd/modules/sync/sync_windows.c index 85ee4f35fd7..c3d93c75fc9 100644 --- a/src/osd/modules/sync/sync_windows.c +++ b/src/osd/modules/sync/sync_windows.c @@ -14,7 +14,7 @@ // MAME headers #include "osdcore.h" -#include "osinline.h" +#include "eminline.h" #include "osdsync.h" diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index 4c7835579ac..ca3cfd6b94f 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -223,4 +223,29 @@ typedef UINT32 FPTR; #define __has_feature(x) 0 #endif +#ifdef _MSC_VER +#include <malloc.h> +#if _MSC_VER < 1900 // < VS2015 +#define snprintf _snprintf +#if _MSC_VER < 1800 // VS2013 or earlier +#define alloca _alloca +#define round(x) floor((x) + 0.5) +#define strtoll _strtoi64 +#define _USE_MATH_DEFINES +#include <math.h> +static __inline double fmin(double x, double y){ return (x < y) ? x : y; } +static __inline double fmax(double x, double y){ return (x > y) ? x : y; } +static __inline double log2(double x) { return log(x) * M_LOG2E; } +#endif // VS2013 +#else // VS2015 +#define _CRT_STDIO_LEGACY_WIDE_SPECIFIERS +#endif +#endif + +#ifdef __GNUC__ +#ifndef alloca +#define alloca __builtin_alloca +#endif +#endif + #endif /* __OSDCOMM_H__ */ diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h index ceb0cb45dbc..c7ae389db03 100644 --- a/src/osd/osdcore.h +++ b/src/osd/osdcore.h @@ -28,8 +28,12 @@ /* Make sure we have a path separator (default to /) */ #ifndef PATH_SEPARATOR +#if defined(_WIN32) || defined (__OS2__) +#define PATH_SEPARATOR "\\" +#else #define PATH_SEPARATOR "/" #endif +#endif /* flags controlling file access */ #define OPEN_FLAG_READ 0x0001 /* open for read */ diff --git a/src/osd/osdmini/minimisc.c b/src/osd/osdmini/minimisc.c index 0fd8162f179..21d658ace5b 100644 --- a/src/osd/osdmini/minimisc.c +++ b/src/osd/osdmini/minimisc.c @@ -81,3 +81,21 @@ char *osd_get_clipboard_text(void) // can't support clipboards generically return NULL; } + +//============================================================ +// osd_getenv +//============================================================ + +const char *osd_getenv(const char *name) +{ + return NULL; +} + +//============================================================ +// osd_setenv +//============================================================ + +int osd_setenv(const char *name, const char *value, int overwrite) +{ + return 0; +} diff --git a/src/osd/osdmini/osdmini.mak b/src/osd/osdmini/osdmini.mak deleted file mode 100644 index 58a4d348778..00000000000 --- a/src/osd/osdmini/osdmini.mak +++ /dev/null @@ -1,110 +0,0 @@ -########################################################################### -# -# osdmini.mak -# -# Minimal OSD makefile -# -########################################################################### -# -# Copyright Aaron Giles -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name 'MAME' nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -########################################################################### - -# add a define identifying the target osd -DEFS += -DOSD_MINI -DEFS += -DUSE_QTDEBUG=0 -DEFS += -DUSE_SDL=0 -#------------------------------------------------- -# object and source roots -#------------------------------------------------- - -MINISRC = $(SRC)/osd/$(OSD) -MINIOBJ = $(OBJ)/osd/$(OSD) - -OSDSRC = $(SRC)/osd -OSDOBJ = $(OBJ)/osd - -OBJDIRS += $(MINIOBJ) \ - $(OSDOBJ)/modules/sync \ - $(OSDOBJ)/modules/lib \ - $(OSDOBJ)/modules/sound \ - $(OSDOBJ)/modules/midi \ - $(OSDOBJ)/modules/font \ - $(OSDOBJ)/modules/netdev - -#------------------------------------------------- -# OSD core library -#------------------------------------------------- - -OSDCOREOBJS = \ - $(MINIOBJ)/minidir.o \ - $(MINIOBJ)/minifile.o \ - $(MINIOBJ)/minimisc.o \ - $(MINIOBJ)/minisync.o \ - $(MINIOBJ)/minitime.o \ - $(OSDOBJ)/modules/sync/work_mini.o \ - $(OSDOBJ)/modules/osdmodule.o \ - -#------------------------------------------------- -# OSD mini library -#------------------------------------------------- - -OSDOBJS = \ - $(MINIOBJ)/minimain.o \ - $(OSDOBJ)/modules/lib/osdobj_common.o \ - $(OSDOBJ)/modules/midi/portmidi.o \ - $(OSDOBJ)/modules/midi/none.o \ - $(OSDOBJ)/modules/lib/osdobj_common.o \ - $(OSDOBJ)/modules/sound/js_sound.o \ - $(OSDOBJ)/modules/sound/direct_sound.o \ - $(OSDOBJ)/modules/sound/sdl_sound.o \ - $(OSDOBJ)/modules/sound/none.o \ - $(OSDOBJ)/modules/font/font_sdl.o \ - $(OSDOBJ)/modules/font/font_windows.o \ - $(OSDOBJ)/modules/font/font_osx.o \ - $(OSDOBJ)/modules/font/font_none.o \ - $(OSDOBJ)/modules/netdev/pcap.o \ - $(OSDOBJ)/modules/netdev/taptun.o \ - $(OSDOBJ)/modules/netdev/none.o \ - $(OSDOBJ)/modules/debugger/debugwin.o \ - $(OSDOBJ)/modules/debugger/debugint.o \ - $(OSDOBJ)/modules/debugger/debugqt.o \ - $(OSDOBJ)/modules/debugger/none.o \ - -ifeq ($(OS),Windows_NT) -LIBS += -lwinmm -lwsock32 -endif -#------------------------------------------------- -# rules for building the libaries -#------------------------------------------------- - -$(LIBOCORE): $(OSDCOREOBJS) - -$(LIBOSD): $(OSDOBJS) diff --git a/src/osd/sdl/build.mak b/src/osd/sdl/build.mak deleted file mode 100644 index 181fdaefc2b..00000000000 --- a/src/osd/sdl/build.mak +++ /dev/null @@ -1,13 +0,0 @@ -########################################################################### -# -# build.mak -# -# Specific rules for compile time targets -# -# Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -########################################################################### - -# Nothing to do here - diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h index 8527639a461..66cea9a964e 100644 --- a/src/osd/sdl/osdsdl.h +++ b/src/osd/sdl/osdsdl.h @@ -30,12 +30,6 @@ #define SDL13_COMBINE_RESIZE (0) #endif -#if defined(NO_DEBUGGER) -#define SDLMAME_HAS_DEBUGGER (0) -#else -#define SDLMAME_HAS_DEBUGGER (1) -#endif - //============================================================ // Defines //============================================================ diff --git a/src/osd/sdl/osinline.h b/src/osd/sdl/osinline.h deleted file mode 100644 index 20a5ad62509..00000000000 --- a/src/osd/sdl/osinline.h +++ /dev/null @@ -1,92 +0,0 @@ -//============================================================ -// -// osinline.h - GNU C inline functions -// -//============================================================ - -#ifndef __OSINLINE__ -#define __OSINLINE__ - -#include "eminline.h" - - -//============================================================ -// INLINE FUNCTIONS -//============================================================ - -#if defined(__i386__) || defined(__x86_64__) - - -INLINE void ATTR_FORCE_INLINE -osd_yield_processor(void) -{ - __asm__ __volatile__ ( " rep ; nop ;" ); -} - - -#if defined(__x86_64__) - -//============================================================ -// osd_exchange64 -//============================================================ - -INLINE INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE -_osd_exchange64(INT64 volatile *ptr, INT64 exchange) -{ - register INT64 ret; - __asm__ __volatile__ ( - " lock ; xchg %[exchange], %[ptr] ;" - : [ptr] "+m" (*ptr) - , [ret] "=r" (ret) - : [exchange] "1" (exchange) - ); - return ret; -} -#define osd_exchange64 _osd_exchange64 - -#endif /* __x86_64__ */ - - -#elif defined(__ppc__) || defined (__PPC__) || defined(__ppc64__) || defined(__PPC64__) - - -INLINE void ATTR_FORCE_INLINE -osd_yield_processor(void) -{ - __asm__ __volatile__ ( " nop \n nop \n" ); -} - - - -#if defined(__ppc64__) || defined(__PPC64__) - -//============================================================ -// osd_exchange64 -//============================================================ - -INLINE INT64 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE -_osd_exchange64(INT64 volatile *ptr, INT64 exchange) -{ - register INT64 ret; - __asm__ __volatile__ ( - "1: ldarx %[ret], 0, %[ptr] \n" - " stdcx. %[exchange], 0, %[ptr] \n" - " bne- 1b \n" - : [ret] "=&r" (ret) - : [ptr] "r" (ptr) - , [exchange] "r" (exchange) - : "cr0" - ); - return ret; -} -#define osd_exchange64 _osd_exchange64 - -#endif /* __ppc64__ || __PPC64__ */ - -#else - -#error "no matching assembler implementations found - please compile with NOASM=1" - -#endif - -#endif /* __OSINLINE__ */ diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak deleted file mode 100644 index 2f188762da5..00000000000 --- a/src/osd/sdl/sdl.mak +++ /dev/null @@ -1,993 +0,0 @@ -########################################################################### -# -# sdl.mak -# -# SDL-specific makefile -# -# Copyright (c) 1996-2013, Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# -# SDLMAME by Olivier Galibert and R. Belmont -# -########################################################################### - -########################################################################### -################# BEGIN USER-CONFIGURABLE OPTIONS ##################### -########################################################################### - - -#------------------------------------------------- -# specify build options; see each option below -# for details -#------------------------------------------------- - -# uncomment and edit next line to specify a distribution -# supported debian-stable, ubuntu-intrepid - -# DISTRO = debian-stable -# DISTRO = ubuntu-intrepid -# DISTRO = gcc44-generic - -# uncomment next line to build without OpenGL support - -# NO_OPENGL = 1 - -# uncomment next line to build without X11 support (TARGETOS=unix only) -# this also implies, that no debugger will be builtin. - -# NO_X11 = 1 - -# uncomment next line to disable XInput support for e.g. multiple lightguns and mice on X11 systems -# using Wiimote driver (see http://spritesmods.com/?art=wiimote-mamegun for more info) -# enabling NO_X11 also implies no XInput support, of course. -# (currently defaults disabled due to causing issues with mouse capture, esp. in MESS) - -NO_USE_XINPUT = 1 - -# uncomment and adapt next line to link against specific GL-Library -# this will also add a rpath to the executable -# MESA_INSTALL_ROOT = /usr/local/dfb_GL - -# uncomment the next line to build a binary using GL-dispatching. -# This option takes precedence over MESA_INSTALL_ROOT - -USE_DISPATCH_GL = 1 - -# The following settings are currently supported for unix only. -# There is no need to play with this option unless you are doing -# active development on sdlmame or SDL. - -# uncomment the next line to use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release) -# SDL2_MULTIAPI = 1 - -# uncomment the next line to specify where you have installed -# SDL. Equivalent to the ./configure --prefix=<path> -# SDL_INSTALL_ROOT = /usr/local/sdl20 - -# uncomment to disable the Qt debugger (on non-OSX this disables all debugging) -# NO_USE_QTDEBUG = 1 - -# uncomment to disable MIDI -# NO_USE_MIDI = 1 - -# uncomment to disable implementations based on assembler code -# NOASM = 1 - -# change for custom OS X installations -SDL_FRAMEWORK_PATH = /Library/Frameworks/ - -# uncomment to use SDL1.2 (depracated) -# SDL_LIBVER = sdl - -# uncomment to use BGFX - -# USE_BGFX = 1 - -########################################################################### -################## END USER-CONFIGURABLE OPTIONS ###################### -########################################################################### -OSDSRC = $(SRC)/osd -OSDOBJ = $(OBJ)/osd - -# add a define identifying the target osd -DEFS += -DOSD_SDL - -# default to SDL2 for non-OS/2 builds now -ifndef SDL_LIBVER -ifneq ($(TARGETOS),os2) -SDL_LIBVER = sdl2 -else -SDL_LIBVER = sdl -endif -endif - -ifndef NO_USE_QTDEBUG -OBJDIRS += $(OSDOBJ)/modules/debugger/qt -endif - -ifdef SDL_INSTALL_ROOT -SDL_CONFIG = $(SDL_INSTALL_ROOT)/bin/$(SDL_LIBVER)-config -else -SDL_CONFIG = $(SDL_LIBVER)-config -endif - -ifeq ($(SDL_LIBVER),sdl2) -DEFS += -DSDLMAME_SDL2=1 - ifeq ($(SDL2_MULTIAPI),1) - DEFS += -DSDL2_MULTIAPI - endif -else -DEFS += -DSDLMAME_SDL2=0 -endif - -# minimal preliminary ARM support -ifeq ($(findstring arm,$(UNAME)),arm) - NOASM = 1 - DEFS += -DSDLMAME_ARM -endif - -ifdef NOASM -DEFS += -DSDLMAME_NOASM -endif - -# patch up problems with new zlib -DEFS += -D_LFS64_LARGEFILE=0 - -# bring in external flags for RPM build -CCOMFLAGS += $(OPT_FLAGS) - -#------------------------------------------------- -# distribution may change things -#------------------------------------------------- - -ifeq ($(DISTRO),) -DISTRO = generic -else -ifeq ($(DISTRO),debian-stable) -DEFS += -DNO_AFFINITY_NP -else -ifeq ($(DISTRO),ubuntu-intrepid) -# Force gcc-4.2 on ubuntu-intrepid -CC = @gcc -V 4.2 -LD = @g++-4.2 -else -ifeq ($(DISTRO),gcc44-generic) -CC = @gcc-4.4 -LD = @g++-4.4 -else -ifeq ($(DISTRO),gcc45-generic) -CC = @gcc-4.5 -LD = @g++-4.5 -else -ifeq ($(DISTRO),gcc46-generic) -CC = @gcc-4.6 -LD = @g++-4.6 -else -ifeq ($(DISTRO),gcc47-generic) -CC = @gcc-4.7 -LD = @g++-4.7 -else -$(error DISTRO $(DISTRO) unknown) -endif -endif -endif -endif -endif -endif -endif - -DEFS += -DDISTRO=$(DISTRO) - -#------------------------------------------------- -# sanity check the configuration -#------------------------------------------------- - -ifdef BIGENDIAN -X86_MIPS3_DRC = -X86_PPC_DRC = -FORCE_DRC_C_BACKEND = 1 -endif - -ifdef NOASM -X86_MIPS3_DRC = -X86_PPC_DRC = -FORCE_DRC_C_BACKEND = 1 -endif - -#------------------------------------------------- -# compile and linking flags -#------------------------------------------------- - -# add SDLMAME BASE_TARGETOS definitions - -ifeq ($(TARGETOS),unix) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = tc -endif - -ifeq ($(TARGETOS),linux) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = tc -SDL_NETWORK = taptun - -ifndef NO_USE_MIDI -ALSACFLAGS := $(shell pkg-config --cflags alsa) -ALSALIBS := $(shell pkg-config --libs alsa) - -INCPATH += $(ALSACFLAGS) -LIBS += $(ALSALIBS) -endif - -endif - -ifeq ($(TARGETOS),freebsd) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = tc -DEFS += -DNO_AFFINITY_NP -LIBS += -lutil -# /usr/local/include is not considered a system include directory -# on FreeBSD. GL.h resides there and throws warnings -CCOMFLAGS += -isystem /usr/local/include -NO_USE_MIDI = 1 -endif - -ifeq ($(TARGETOS),openbsd) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = ntc -LIBS += -lutil -NO_USE_MIDI = 1 -endif - -ifeq ($(TARGETOS),netbsd) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = ntc -LIBS += -lutil -NO_USE_MIDI = 1 -SDL_NETWORK = pcap -endif - -ifeq ($(TARGETOS),solaris) -BASE_TARGETOS = unix -#DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf -DEFS += -DNO_AFFINITY_NP -SYNC_IMPLEMENTATION = tc -NO_USE_MIDI = 1 -NO_USE_QTDEBUG = 1 -endif - -ifeq ($(TARGETOS),haiku) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = ntc -NO_X11 = 1 -NO_USE_XINPUT = 1 -NO_USE_MIDI = 1 -NO_USE_QTDEBUG = 1 -LIBS += -lnetwork -lbsd -endif - -ifeq ($(TARGETOS),emscripten) -BASE_TARGETOS = unix -SYNC_IMPLEMENTATION = mini -NO_DEBUGGER = 1 -NO_X11 = 1 -NO_USE_XINPUT = 1 -NO_USE_MIDI = 1 -NO_USE_QTDEBUG = 1 -DONT_USE_NETWORK = 1 -endif - -ifeq ($(TARGETOS),macosx) -NO_USE_QTDEBUG = 1 -BASE_TARGETOS = unix -DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX -DSDLMAME_DARWIN - -ifndef NO_USE_MIDI -LIBS += -framework CoreAudio -framework CoreMIDI -endif - -ifdef NO_USE_QTDEBUG - -OBJDIRS += $(OSDOBJ)/modules/debugger/osx - -DEBUGOBJS = \ - $(OSDOBJ)/modules/debugger/debugosx.o \ - $(OSDOBJ)/modules/debugger/osx/breakpointsview.o \ - $(OSDOBJ)/modules/debugger/osx/consoleview.o \ - $(OSDOBJ)/modules/debugger/osx/debugcommandhistory.o \ - $(OSDOBJ)/modules/debugger/osx/debugconsole.o \ - $(OSDOBJ)/modules/debugger/osx/debugview.o \ - $(OSDOBJ)/modules/debugger/osx/debugwindowhandler.o \ - $(OSDOBJ)/modules/debugger/osx/deviceinfoviewer.o \ - $(OSDOBJ)/modules/debugger/osx/devicesviewer.o \ - $(OSDOBJ)/modules/debugger/osx/disassemblyview.o \ - $(OSDOBJ)/modules/debugger/osx/disassemblyviewer.o \ - $(OSDOBJ)/modules/debugger/osx/errorlogview.o \ - $(OSDOBJ)/modules/debugger/osx/errorlogviewer.o \ - $(OSDOBJ)/modules/debugger/osx/memoryview.o \ - $(OSDOBJ)/modules/debugger/osx/memoryviewer.o \ - $(OSDOBJ)/modules/debugger/osx/pointsviewer.o \ - $(OSDOBJ)/modules/debugger/osx/registersview.o \ - $(OSDOBJ)/modules/debugger/osx/watchpointsview.o - -endif - -SYNC_IMPLEMENTATION = ntc - -# SDLMain_tmpl isn't necessary for SDL2 -ifneq ($(SDL_LIBVER),sdl2) -SDLMAIN = $(SDLOBJ)/SDLMain_tmpl.o -SDLUTILMAIN = $(SDLOBJ)/SDLMain_tmpl.o -endif - -SDL_NETWORK = pcap -MAINLDFLAGS = -Xlinker -all_load -NO_X11 = 1 -NO_USE_XINPUT = 1 - -ifdef BIGENDIAN -DEFS += -DOSX_PPC=1 -CCOMFLAGS += -Wno-unused-label -ifdef SYMBOLS -CCOMFLAGS += -mlong-branch -endif # SYMBOLS -ifeq ($(PTR64),1) -CCOMFLAGS += -arch ppc64 -LDFLAGS += -arch ppc64 -else -CCOMFLAGS += -arch ppc -LDFLAGS += -arch ppc -endif -$(OBJ)/emu/cpu/tms57002/tms57002.o : CCOMFLAGS += -O0 -else # BIGENDIAN -ifeq ($(PTR64),1) -CCOMFLAGS += -arch x86_64 -LDFLAGS += -arch x86_64 -else -CCOMFLAGS += -m32 -arch i386 -LDFLAGS += -m32 -arch i386 -endif -endif # BIGENDIAN - -endif - -ifeq ($(TARGETOS),win32) -BASE_TARGETOS = win32 -SYNC_IMPLEMENTATION = windows -NO_X11 = 1 -NO_USE_XINPUT = 1 -DEFS += -DSDLMAME_WIN32 -DX64_WINDOWS_ABI -LIBGL = -lopengl32 -SDLMAIN = $(SDLOBJ)/main.o -# needed for unidasm -LDFLAGS += -Wl,--allow-multiple-definition -SDL_NETWORK = pcap -INCPATH += -I$(3RDPARTY)/winpcap/Include - -# enable UNICODE -DEFS += -Dmain=utf8_main -DUNICODE -D_UNICODE -LDFLAGS += -municode - -# Qt -ifndef NO_USE_QTDEBUG -QT_INSTALL_HEADERS = $(shell qmake -query QT_INSTALL_HEADERS) -INCPATH += -I$(QT_INSTALL_HEADERS)/QtCore -I$(QT_INSTALL_HEADERS)/QtGui -I$(QT_INSTALL_HEADERS) -BASELIBS += -lcomdlg32 -loleaut32 -limm32 -lwinspool -lmsimg32 -lole32 -luuid -lws2_32 -lshell32 -lkernel32 -LIBS += -L$(shell qmake -query QT_INSTALL_LIBS) -lqtmain -lQtGui4 -lQtCore4 -lcomdlg32 -loleaut32 -limm32 -lwinspool -lmsimg32 -lole32 -luuid -lws2_32 -lshell32 -lkernel32 -endif -endif - -ifeq ($(TARGETOS),macosx) -ifndef NO_USE_QTDEBUG -MOC = @moc - -QT_INSTALL_LIBS = $(shell qmake -query QT_INSTALL_LIBS) -INCPATH += -I$(QT_INSTALL_LIBS)/QtGui.framework/Versions/4/Headers -I$(QT_INSTALL_LIBS)/QtCore.framework/Versions/4/Headers -F$(QT_INSTALL_LIBS) -LIBS += -L$(QT_INSTALL_LIBS) -F$(QT_INSTALL_LIBS) -framework QtCore -framework QtGui -endif -endif - -ifeq ($(TARGETOS),os2) -BASE_TARGETOS = os2 -DEFS += -DSDLMAME_OS2 -SYNC_IMPLEMENTATION = os2 -NO_DEBUGGER = 1 -NO_X11 = 1 -NO_USE_XINPUT = 1 -NO_USE_MIDI = 1 -NO_USE_QTDEBUG = 1 -# OS/2 can't have OpenGL (aww) -NO_OPENGL = 1 -endif - -#------------------------------------------------- -# Sanity checks -#------------------------------------------------- - -ifeq ($(BASE_TARGETOS),) -$(error $(TARGETOS) not supported !) -endif - -# if no Qt and not OS X, no debugger -ifneq ($(TARGETOS),macosx) -ifdef NO_USE_QTDEBUG -NO_DEBUGGER = 1 -endif -endif - -#------------------------------------------------- -# object and source roots -#------------------------------------------------- - -SDLSRC = $(SRC)/osd/$(OSD) -SDLOBJ = $(OBJ)/osd/$(OSD) - -OBJDIRS += $(SDLOBJ) \ - $(OSDOBJ)/modules/sync \ - $(OSDOBJ)/modules/lib \ - $(OSDOBJ)/modules/midi \ - $(OSDOBJ)/modules/font \ - $(OSDOBJ)/modules/netdev \ - $(OSDOBJ)/modules/opengl \ - $(OSDOBJ)/modules/render - -#------------------------------------------------- -# OSD core library -#------------------------------------------------- - -OSDCOREOBJS = \ - $(SDLOBJ)/strconv.o \ - $(SDLOBJ)/sdldir.o \ - $(SDLOBJ)/sdlfile.o \ - $(SDLOBJ)/sdlptty_$(BASE_TARGETOS).o \ - $(SDLOBJ)/sdlsocket.o \ - $(SDLOBJ)/sdlos_$(SDLOS_TARGETOS).o \ - $(OSDOBJ)/modules/lib/osdlib_$(SDLOS_TARGETOS).o \ - $(OSDOBJ)/modules/sync/sync_$(SYNC_IMPLEMENTATION).o \ - $(OSDOBJ)/modules/osdmodule.o \ - -ifdef NOASM -OSDCOREOBJS += $(OSDOBJ)/modules/sync/work_mini.o -else -OSDCOREOBJS += $(OSDOBJ)/modules/sync/work_osd.o -endif - -# any "main" must be in LIBOSD or else the build will fail! -# for the windows build, we just add it to libocore as well. -OSDOBJS = \ - $(SDLMAIN) \ - $(SDLOBJ)/sdlmain.o \ - $(SDLOBJ)/input.o \ - $(OSDOBJ)/modules/sound/js_sound.o \ - $(OSDOBJ)/modules/sound/direct_sound.o \ - $(OSDOBJ)/modules/sound/sdl_sound.o \ - $(OSDOBJ)/modules/sound/none.o \ - $(SDLOBJ)/video.o \ - $(SDLOBJ)/window.o \ - $(SDLOBJ)/output.o \ - $(SDLOBJ)/watchdog.o \ - $(OSDOBJ)/modules/lib/osdobj_common.o \ - $(OSDOBJ)/modules/font/font_sdl.o \ - $(OSDOBJ)/modules/font/font_windows.o \ - $(OSDOBJ)/modules/font/font_osx.o \ - $(OSDOBJ)/modules/font/font_none.o \ - $(OSDOBJ)/modules/netdev/taptun.o \ - $(OSDOBJ)/modules/netdev/pcap.o \ - $(OSDOBJ)/modules/netdev/none.o \ - $(OSDOBJ)/modules/midi/portmidi.o \ - $(OSDOBJ)/modules/midi/none.o \ - $(OSDOBJ)/modules/render/drawsdl.o \ - -ifdef NO_USE_MIDI - DEFS += -DNO_USE_MIDI -else -endif - -# Add SDL2.0 support - -ifeq ($(SDL_LIBVER),sdl2) -OSDOBJS += $(OSDOBJ)/modules/render/draw13.o -endif - -# add an ARCH define -DEFS += -DSDLMAME_ARCH="$(ARCHOPTS)" -DSYNC_IMPLEMENTATION=$(SYNC_IMPLEMENTATION) - -#------------------------------------------------- -# Generic defines and additions -#------------------------------------------------- - -OSDCLEAN = sdlclean - -# copy off the include paths before the sdlprefix & sdl-config stuff shows up -MOCINCPATH := $(INCPATH) - -# add the prefix file -INCPATH += -include $(SDLSRC)/sdlprefix.h - - -#------------------------------------------------- -# BASE_TARGETOS specific configurations -#------------------------------------------------- - -SDLOS_TARGETOS = $(BASE_TARGETOS) - -#------------------------------------------------- -# TEST_GCC for GCC version-specific stuff -#------------------------------------------------- - -ifneq ($(TARGETOS),emscripten) -TEST_GCC = $(shell gcc --version) - -# Ubuntu 12.10 GCC 4.7.2 autodetect -ifeq ($(findstring 4.7.2-2ubuntu1,$(TEST_GCC)),4.7.2-2ubuntu1) -GCC46TST = $(shell which g++-4.6 2>/dev/null) -ifeq '$(GCC46TST)' '' -$(error Ubuntu 12.10 detected. Please install the gcc-4.6 and g++-4.6 packages) -endif -CC = @gcc-4.6 -LD = @g++-4.6 -endif -endif - -include $(SRC)/build/cc_detection.mak - -#------------------------------------------------- -# Unix -#------------------------------------------------- -ifeq ($(BASE_TARGETOS),unix) - -#------------------------------------------------- -# Mac OS X -#------------------------------------------------- - -ifeq ($(TARGETOS),macosx) -OSDCOREOBJS += $(SDLOBJ)/osxutils.o -SDLOS_TARGETOS = macosx - -ifeq ($(TARGET),mame) -MACOSX_EMBED_INFO_PLIST = 1 -endif -ifeq ($(TARGET),mess) -MACOSX_EMBED_INFO_PLIST = 1 -endif -ifeq ($(TARGET),ume) -MACOSX_EMBED_INFO_PLIST = 1 -endif -ifdef MACOSX_EMBED_INFO_PLIST -INFOPLIST = $(SDLOBJ)/$(TARGET)-Info.plist -LDFLAGSEMULATOR += -sectcreate __TEXT __info_plist $(INFOPLIST) -$(EMULATOR): $(INFOPLIST) -$(INFOPLIST): $(SRC)/build/verinfo.py $(SRC)/version.c - @echo Emitting $@... - $(PYTHON) $(SRC)/build/verinfo.py -b $(TARGET) -p -o $@ $(SRC)/version.c -endif - -ifndef MACOSX_USE_LIBSDL -# Compile using framework (compile using libSDL is the exception) -ifeq ($(SDL_LIBVER),sdl2) -LIBS += -F$(SDL_FRAMEWORK_PATH) -framework SDL2 -framework Cocoa -framework OpenGL -lpthread -BASELIBS += -F$(SDL_FRAMEWORK_PATH) -framework SDL2 -framework Cocoa -framework OpenGL -lpthread -else -LIBS += -F$(SDL_FRAMEWORK_PATH) -framework SDL -framework Cocoa -framework OpenGL -lpthread -BASELIBS += -F$(SDL_FRAMEWORK_PATH) -framework SDL -framework Cocoa -framework OpenGL -lpthread -endif -INCPATH += -F$(SDL_FRAMEWORK_PATH) -else -# Compile using installed libSDL (Fink or MacPorts): -# -# Remove the "/SDL" component from the include path so that we can compile - -# files (header files are #include "SDL/something.h", so the extra "/SDL" -# causes a significant problem) -SDLCFLAGS := $(shell $(SDL_CONFIG) --cflags | sed 's:/SDL::') -# Remove libSDLmain, as its symbols conflict with SDLMain_tmpl.m -SDLLIBS := $(shell $(SDL_CONFIG) --libs | sed 's/-lSDLmain//') - -INCPATH += $(SDLCFLAGS) -CCOMFLAGS += -DNO_SDL_GLEXT -LIBS += $(SDLLIBS) -lpthread -framework Cocoa -framework OpenGL -BASELIBS += $(SDLLIBS) -lpthread -framework Cocoa -framework OpenGL -DEFS += -DMACOSX_USE_LIBSDL -endif # MACOSX_USE_LIBSDL - -else # ifeq ($(TARGETOS),macosx) - -DEFS += -DSDLMAME_UNIX - -ifndef NO_USE_QTDEBUG -MOCTST = $(shell which moc-qt4 2>/dev/null) -ifeq '$(MOCTST)' '' -MOCTST = $(shell which moc 2>/dev/null) -ifeq '$(MOCTST)' '' -$(error Qt's Meta Object Compiler (moc) wasn't found!) -else -MOC = @$(MOCTST) -endif -else -MOC = @$(MOCTST) -endif -# Qt on Linux/UNIX -QMAKE = $(shell which qmake-qt4 2>/dev/null) -ifeq '$(QMAKE)' '' -QMAKE = $(shell which qmake 2>/dev/null) -ifeq '$(QMAKE)' '' -$(error qmake wasn't found!) -endif -endif -QT_INSTALL_HEADERS = $(shell $(QMAKE) -query QT_INSTALL_HEADERS) -INCPATH += -I$(QT_INSTALL_HEADERS)/QtCore -I$(QT_INSTALL_HEADERS)/QtGui -I$(QT_INSTALL_HEADERS) -LIBS += -L$(shell $(QMAKE) -query QT_INSTALL_LIBS) -lQtGui -lQtCore -endif - -LIBGL = -lGL - -ifeq ($(NO_X11),1) -NO_DEBUGGER = 1 -endif - -SDLINCLUDES := $(shell $(SDL_CONFIG) --cflags | sed -e 's:/SDL[2]*::' -e 's:\(-D[^ ]*\)::g') -SDLDEFINES := $(shell $(SDL_CONFIG) --cflags | sed -e 's:/SDL[2]*::' -e 's:\(-I[^ ]*\)::g') -SDLLIBS := $(shell $(SDL_CONFIG) --libs) - -INCPATH += $(SDLINCLUDES) -CCOMFLAGS += $(SDLDEFINES) -BASELIBS += $(SDLLIBS) -LIBS += $(SDLLIBS) - -ifeq ($(SDL_LIBVER),sdl2) -ifdef SDL_INSTALL_ROOT -# FIXME: remove the directfb ref. later. This is just there for now to work around an issue with SDL1.3 and SDL2.0 -INCPATH += -I$(SDL_INSTALL_ROOT)/include/directfb -endif -endif - -FONTCONFIGCFLAGS := $(shell pkg-config --cflags fontconfig) -FONTCONFIGLIBS := $(shell pkg-config --libs fontconfig) - -ifneq ($(TARGETOS),emscripten) -INCPATH += $(FONTCONFIGCFLAGS) -endif -LIBS += $(FONTCONFIGLIBS) - -ifeq ($(SDL_LIBVER),sdl2) -LIBS += -lSDL2_ttf -else -LIBS += -lSDL_ttf -endif - -# FIXME: should be dealt with elsewhere -# libs that Haiku doesn't want but are mandatory on *IX -ifneq ($(TARGETOS),haiku) -BASELIBS += -lm -lpthread -LIBS += -lm -lpthread -ifneq ($(TARGETOS),solaris) -BASELIBS += -lutil -LIBS += -lutil -else -SUPPORTSM32M64 = 1 -BASELIBS += -lsocket -lnsl -LIBS += -lsocket -lnsl -endif -endif - - -endif # not Mac OS X - -ifneq (,$(findstring ppc,$(UNAME))) -# override for preprocessor weirdness on PPC Linux -CFLAGS += -Upowerpc -SUPPORTSM32M64 = 1 -endif - -ifneq (,$(findstring amd64,$(UNAME))) -SUPPORTSM32M64 = 1 -endif -ifneq (,$(findstring x86_64,$(UNAME))) -SUPPORTSM32M64 = 1 -endif -ifneq (,$(findstring i386,$(UNAME))) -SUPPORTSM32M64 = 1 -endif - -ifeq ($(SUPPORTSM32M64),1) -ifeq ($(PTR64),1) -CCOMFLAGS += -m64 -LDFLAGS += -m64 -else -CCOMFLAGS += -m32 -LDFLAGS += -m32 -endif -endif - -endif # Unix - -#------------------------------------------------- -# Windows -#------------------------------------------------- - -# Win32: add the necessary libraries -ifeq ($(BASE_TARGETOS),win32) - -# Add to osdcoreobjs so tools will build -OSDCOREOBJS += $(SDLMAIN) - -ifdef SDL_INSTALL_ROOT -INCPATH += -I$(SDL_INSTALL_ROOT)/include -LIBS += -L$(SDL_INSTALL_ROOT)/lib -#-Wl,-rpath,$(SDL_INSTALL_ROOT)/lib -endif - -# LIBS += -lmingw32 -lSDL -# Static linking - -LDFLAGS += -static-libgcc -ifeq (,$(findstring clang,$(CC))) -ifeq ($(findstring 4.4,$(TEST_GCC)),) - #if we use new tools - LDFLAGS += -static-libstdc++ -endif -endif - -ifndef NO_USE_QTDEBUG -MOC = @moc -endif - -ifeq ($(SDL_LIBVER),sdl2) -LIBS += -lSDL2 -limm32 -lversion -lole32 -loleaut32 -lws2_32 -static -BASELIBS += -lSDL2 -limm32 -lversion -lole32 -loleaut32 -lws2_32 -static -else -LIBS += -lSDL -lws2_32 -static -BASELIBS += -lSDL -lws2_32 -static -endif -LIBS += -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi -BASELIBS += -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi -endif # Win32 - -#------------------------------------------------- -# OS/2 -#------------------------------------------------- - -ifeq ($(BASE_TARGETOS),os2) - -SDLCFLAGS := $(shell sdl-config --cflags) -SDLLIBS := $(shell sdl-config --libs) - -INCPATH += $(SDLCFLAGS) -LIBS += $(SDLLIBS) -lpthread -BASELIBS += $(SDLLIBS) -lpthread - -endif # OS2 - -#------------------------------------------------- -# Debugging -#------------------------------------------------- - -ifndef NO_USE_QTDEBUG -$(OSDOBJ)/%.moc.c: $(OSDSRC)/%.h - $(MOC) $(MOCINCPATH) $< -o $@ - -DEBUGOBJS = \ - $(OSDOBJ)/modules/debugger/qt/debuggerview.o \ - $(OSDOBJ)/modules/debugger/qt/windowqt.o \ - $(OSDOBJ)/modules/debugger/qt/logwindow.o \ - $(OSDOBJ)/modules/debugger/qt/dasmwindow.o \ - $(OSDOBJ)/modules/debugger/qt/mainwindow.o \ - $(OSDOBJ)/modules/debugger/qt/memorywindow.o \ - $(OSDOBJ)/modules/debugger/qt/breakpointswindow.o \ - $(OSDOBJ)/modules/debugger/qt/deviceswindow.o \ - $(OSDOBJ)/modules/debugger/qt/deviceinformationwindow.o \ - $(OSDOBJ)/modules/debugger/qt/debuggerview.moc.o \ - $(OSDOBJ)/modules/debugger/qt/windowqt.moc.o \ - $(OSDOBJ)/modules/debugger/qt/logwindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/dasmwindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/mainwindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/memorywindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/breakpointswindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/deviceswindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/deviceinformationwindow.moc.o - -DEFS += -DUSE_QTDEBUG=1 - -else -DEFS += -DUSE_QTDEBUG=0 -endif - -ifeq ($(NO_DEBUGGER),1) -DEFS += -DNO_DEBUGGER -else -OSDOBJS += $(DEBUGOBJS) -endif # NO_DEBUGGER - -# Always add these -OSDOBJS += \ - $(OSDOBJ)/modules/debugger/none.o \ - $(OSDOBJ)/modules/debugger/debugint.o \ - $(OSDOBJ)/modules/debugger/debugwin.o \ - $(OSDOBJ)/modules/debugger/debugqt.o - -#------------------------------------------------- -# BGFX -#------------------------------------------------- - -ifdef USE_BGFX -DEFS += -DUSE_BGFX -OSDOBJS += $(OSDOBJ)/modules/render/drawbgfx.o -INCPATH += -I$(3RDPARTY)/bgfx/include -I$(3RDPARTY)/bx/include -USE_DISPATCH_GL = 0 -BGFX_LIB = $(OBJ)/libbgfx.a -endif - -#------------------------------------------------- -# OPENGL -#------------------------------------------------- - -ifeq ($(NO_OPENGL),1) -DEFS += -DUSE_OPENGL=0 -else -OSDOBJS += \ - $(OSDOBJ)/modules/render/drawogl.o \ - $(OSDOBJ)/modules/opengl/gl_shader_tool.o \ - $(OSDOBJ)/modules/opengl/gl_shader_mgr.o - -DEFS += -DUSE_OPENGL=1 -ifeq ($(USE_DISPATCH_GL),1) -DEFS += -DUSE_DISPATCH_GL=1 -else -LIBS += $(LIBGL) -endif -endif - -ifneq ($(USE_DISPATCH_GL),1) -ifdef MESA_INSTALL_ROOT -LIBS += -L$(MESA_INSTALL_ROOT)/lib -LDFLAGS += -Wl,-rpath=$(MESA_INSTALL_ROOT)/lib -INCPATH += -I$(MESA_INSTALL_ROOT)/include -endif -endif - -#------------------------------------------------- -# X11 -#------------------------------------------------- - -ifeq ($(NO_X11),1) -DEFS += -DSDLMAME_NO_X11 -else -# Default libs -DEFS += -DSDLMAME_X11 -LIBS += -lX11 -lXinerama -ifneq ($(SDL_LIBVER),sdl2) -BASELIBS += -lX11 -endif - -# The newer debugger uses QT -ifndef NO_USE_QTDEBUG -QTCFLAGS := $(shell pkg-config --cflags QtGui) -QTLIBS := $(shell pkg-config --libs QtGui) - -INCPATH += $(QTCFLAGS) -LIBS += $(QTLIBS) -endif - -# some systems still put important things in a different prefix -LIBS += -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/openwin/lib -# make sure we can find X headers -INCPATH += -I/usr/X11/include -I/usr/X11R6/include -I/usr/openwin/include -endif # NO_X11 - -# can't use native libs with emscripten -ifeq ($(TARGETOS),emscripten) -LIBS = -endif - -#------------------------------------------------- -# XInput -#------------------------------------------------- - -ifeq ($(NO_USE_XINPUT),1) -DEFS += -DUSE_XINPUT=0 -else -DEFS += -DUSE_XINPUT=1 -DUSE_XINPUT_DEBUG=0 -LIBS += -lXext -lXi -endif # USE_XINPUT - -#------------------------------------------------- -# Network (TAP/TUN) -#------------------------------------------------- - -ifndef DONT_USE_NETWORK - -ifeq ($(SDL_NETWORK),taptun) - -DEFS += -DSDLMAME_NET_TAPTUN -endif - -ifeq ($(SDL_NETWORK),pcap) - -DEFS += -DSDLMAME_NET_PCAP - -# dynamically linked ... -#ifneq ($(TARGETOS),win32) -#LIBS += -lpcap -#endif - -endif # ifeq ($(SDL_NETWORK),pcap) - -endif # ifndef DONT_USE_NETWORK - -#------------------------------------------------- -# Dependencies -#------------------------------------------------- - -# due to quirks of using /bin/sh, we need to explicitly specify the current path -CURPATH = ./ - -ifeq ($(BASE_TARGETOS),os2) -# to avoid name clash of '_brk' -$(OBJ)/emu/cpu/h6280/6280dasm.o : CDEFS += -D__STRICT_ANSI__ -endif # OS2 - -ifeq ($(TARGETOS),solaris) -# solaris only has gcc-4.3 by default and is reporting a false positive -$(OBJ)/emu/video/tms9927.o : CCOMFLAGS += -Wno-error -endif # solaris - -# drawSDL depends on the core software renderer, so make sure it exists -$(OSDOBJ)/modules/render/drawsdl.o : $(SRC)/emu/rendersw.inc $(OSDSRC)/modules/render/drawogl.c - -# draw13 depends on blit13.h -$(OSDOBJ)/modules/render/draw13.o : $(OSDSRC)/modules/render/blit13.h - -#$(OSDCOREOBJS): $(SDLSRC)/sdl.mak - -#$(OSDOBJS): $(SDLSRC)/sdl.mak - - -$(LIBOCORE): $(OSDCOREOBJS) - -$(LIBOSD): $(OSDOBJS) - - -#------------------------------------------------- -# Tools -#------------------------------------------------- - -TOOLS += \ - $(BIN)testkeys$(EXE) - -$(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c - @echo Compiling $<... - $(CC) $(CFLAGS) $(DEFS) -c $< -o $@ - -TESTKEYSOBJS = \ - $(SDLOBJ)/testkeys.o \ - -$(BIN)testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - -#------------------------------------------------- -# clean up -#------------------------------------------------- - -$(OSDCLEAN): - @rm -f .depend_* - -#------------------------------------------------- -# various support targets -#------------------------------------------------- - -testlib: - @echo LIBS: $(LIBS) - @echo INCPATH: $(INCPATH) - @echo DEFS: $(DEFS) - @echo CORE: $(OSDCOREOBJS) - -ifneq ($(TARGETOS),win32) -BUILD_VERSION = $(shell grep 'build_version\[\] =' src/version.c | sed -e "s/.*= \"//g" -e "s/ .*//g") -DISTFILES = test_dist.sh whatsnew.txt whatsnew_$(BUILD_VERSION).txt makefile docs/ src/ -EXCLUDES = -x "*/.svn/*" - -zip: - zip -rq ../mame_$(BUILD_VERSION).zip $(DISTFILES) $(EXCLUDES) - -endif - diff --git a/src/osd/sdl/sdlfile.c b/src/osd/sdl/sdlfile.c index a010c02776a..e7293342ede 100644 --- a/src/osd/sdl/sdlfile.c +++ b/src/osd/sdl/sdlfile.c @@ -471,7 +471,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN static int osd_is_path_separator(char c) { - return (c == '/') || (c == '\\'); + return (c == PATHSEPCH) || (c == INVPATHSEPCH); } //============================================================ diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c index ac4729166e2..af9a6976ce9 100644 --- a/src/osd/sdl/sdlmain.c +++ b/src/osd/sdl/sdlmain.c @@ -389,18 +389,16 @@ static void defines_verbose(void) MACRO_VERBOSE(SDLMAME_DARWIN); MACRO_VERBOSE(SDLMAME_LINUX); MACRO_VERBOSE(SDLMAME_SOLARIS); - MACRO_VERBOSE(SDLMAME_NOASM); MACRO_VERBOSE(SDLMAME_IRIX); MACRO_VERBOSE(SDLMAME_BSD); osd_printf_verbose("\n"); osd_printf_verbose("Build defines 1: "); MACRO_VERBOSE(LSB_FIRST); MACRO_VERBOSE(PTR64); + MACRO_VERBOSE(MAME_NOASM); MACRO_VERBOSE(MAME_DEBUG); - MACRO_VERBOSE(NO_DEBUGBER); MACRO_VERBOSE(BIGENDIAN); MACRO_VERBOSE(CPP_COMPILE); - MACRO_VERBOSE(DISTRO); MACRO_VERBOSE(SYNC_IMPLEMENTATION); osd_printf_verbose("\n"); osd_printf_verbose("SDL/OpenGL defines: "); @@ -600,14 +598,6 @@ void sdl_osd_interface::init(running_machine &machine) defines_verbose(); - if (!SDLMAME_HAS_DEBUGGER) - if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED) - { - osd_printf_error("sdlmame: -debug not supported on X11-less builds\n\n"); - osd_exit(); - exit(-1); - } - osd_common_t::init_subsystems(); if (options().oslog()) @@ -633,44 +623,3 @@ void sdl_osd_interface::init(running_machine &machine) SDL_EnableUNICODE(SDL_TRUE); #endif } - -#ifdef SDLMAME_WIN32 - -//============================================================ -// wstring_from_utf8 -//============================================================ - -WCHAR *wstring_from_utf8(const char *utf8string) -{ - int char_count; - WCHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); - result = (WCHAR *)osd_malloc_array(char_count * sizeof(*result)); - if (result != NULL) - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); - - return result; -} - - -//============================================================ -// utf8_from_wstring -//============================================================ - -char *utf8_from_wstring(const WCHAR *wstring) -{ - int char_count; - char *result; - - // convert UTF-16 to MAME string (UTF-8) - char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (char *)osd_malloc_array(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL); - - return result; -} - -#endif diff --git a/src/osd/sdl/sdlprefix.h b/src/osd/sdl/sdlprefix.h index 9aff11e17f0..ed1b2e11204 100644 --- a/src/osd/sdl/sdlprefix.h +++ b/src/osd/sdl/sdlprefix.h @@ -14,7 +14,8 @@ //============================================================ /* Only problems ... */ -#ifdef SDLMAME_WIN32 +#if defined(_WIN32) +#define SDLMAME_WIN32 #define _SDL_main_h #endif @@ -27,6 +28,7 @@ #if defined(__sun__) && defined(__svr4__) #define SDLMAME_SOLARIS 1 +#define NO_AFFINITY_NP 1 //#undef _XOPEN_SOURCE //#undef _XOPEN_VERSION //#undef _XOPEN_SOURCE_EXTENDED @@ -45,6 +47,7 @@ #elif defined(__FreeBSD__) #define SDLMAME_FREEBSD 1 +#define NO_AFFINITY_NP 1 #elif defined(__DragonFly__) #define SDLMAME_DRAGONFLY 1 #elif defined(__OpenBSD__) @@ -57,6 +60,10 @@ #define SDLMAME_BSD 1 #endif +#if defined(__OS2__) +#define SDLMAME_OS2 1 +#endif + #if defined(__HAIKU__) #define SDLMAME_HAIKU 1 #define SDLMAME_NO64BITIO 1 @@ -65,8 +72,6 @@ #if defined(EMSCRIPTEN) #define SDLMAME_EMSCRIPTEN 1 #define SDLMAME_NO64BITIO 1 -#define NOASM 1 -#define SDLMAME_NOASM 1 struct _IO_FILE {}; //_IO_FILE is an opaque type in the emscripten libc which makes clang cranky #endif @@ -77,17 +82,3 @@ struct _IO_FILE {}; //_IO_FILE is an opaque type in the emscripten libc which m #endif /* SDLMAME_UNIX */ -#ifdef _MSC_VER -void *__cdecl _alloca(size_t); -#define alloca _alloca -#endif - -#ifdef __GNUC__ -#define alloca __builtin_alloca -#endif - -//============================================================ -// misc. -//============================================================ - -#define PATH_SEPARATOR "/" diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h index 4a3d8b69f9d..913116f6b62 100644 --- a/src/osd/sdl/video.h +++ b/src/osd/sdl/video.h @@ -131,9 +131,9 @@ public: osd_monitor_info *m_next; // pointer to next monitor in list protected: virtual void refresh() = 0; - osd_rect m_pos_size; - osd_rect m_usuable_pos_size; - bool m_is_primary; + osd_rect m_pos_size; + osd_rect m_usuable_pos_size; + bool m_is_primary; char m_name[64]; private: @@ -185,7 +185,7 @@ struct osd_video_config int syncrefresh; // sync only to refresh rate int switchres; // switch resolutions - int fullstretch; // FXIME: implement in windows! + int fullstretch; // FXIME: implement in windows! // ddraw options int hwstretch; // stretch using the hardware diff --git a/src/osd/sdl/watchdog.c b/src/osd/sdl/watchdog.c index d8456cdb15a..fa7ead22224 100644 --- a/src/osd/sdl/watchdog.c +++ b/src/osd/sdl/watchdog.c @@ -11,11 +11,7 @@ #include "osdcomm.h" #include "osdcore.h" -#ifdef SDLMAME_NOASM #include "eminline.h" -#else -#include "osinline.h" -#endif #include "watchdog.h" #include "modules/lib/osdlib.h" diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c index 2f183ef447b..e77fa480bb0 100644 --- a/src/osd/sdl/window.c +++ b/src/osd/sdl/window.c @@ -20,7 +20,9 @@ // standard C headers #include <math.h> +#ifndef _MSC_VER #include <unistd.h> +#endif // MAME headers @@ -1153,8 +1155,8 @@ OSDWORK_CALLBACK( sdl_window_info::complete_create_wt ) #ifdef SDLMAME_MACOSX /* FIMXE: On OSX, SDL_WINDOW_FULLSCREEN_DESKTOP seems to be more reliable. - * It however creates issues with white borders, i.e. the screen clear - * does not work. This happens both with opengl and accel. + * It however creates issues with white borders, i.e. the screen clear + * does not work. This happens both with opengl and accel. */ #endif diff --git a/src/osd/sdl/strconv.c b/src/osd/strconv.c index 3eedf040127..3eedf040127 100644 --- a/src/osd/sdl/strconv.c +++ b/src/osd/strconv.c diff --git a/src/osd/sdl/strconv.h b/src/osd/strconv.h index 4ad7e1e2e48..4ad7e1e2e48 100644 --- a/src/osd/sdl/strconv.h +++ b/src/osd/strconv.h diff --git a/src/osd/windows/osinline.h b/src/osd/windows/osinline.h deleted file mode 100644 index 3e28c982cf3..00000000000 --- a/src/osd/windows/osinline.h +++ /dev/null @@ -1,51 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// osinline.h -// -// Inline implementations for non-GCC Win32 compilers -// -//============================================================ - -#ifndef __OSINLINE__ -#define __OSINLINE__ - -#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) -#include "eivcx86.h" -#endif - -#if defined(_MSC_VER) -#include "eivc.h" -#endif - -INT32 win_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange); -INT32 win_atomic_exchange32(INT32 volatile *ptr, INT32 exchange); -INT32 win_atomic_add32(INT32 volatile *ptr, INT32 delta); - -#ifdef PTR64 -INT64 win_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange); -#endif - - -#ifndef compare_exchange32 -#define compare_exchange32 win_compare_exchange32 -#endif /* compare_exchange32 */ - -#ifdef PTR64 -#ifndef compare_exchange64 -#define compare_exchange64 win_compare_exchange64 -#endif /* compare_exchange64 */ -#endif - -#ifndef atomic_exchange32 -#define atomic_exchange32 win_atomic_exchange32 -#endif /* atomic_exchange32 */ - - -#ifndef atomic_add32 -#define atomic_add32 win_atomic_add32 -#endif /* atomic_add32 */ - - -#endif /* __OSINLINE__ */ diff --git a/src/osd/windows/strconv.c b/src/osd/windows/strconv.c deleted file mode 100644 index 3eedf040127..00000000000 --- a/src/osd/windows/strconv.c +++ /dev/null @@ -1,141 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// strconv.c - Win32 string conversion -// -//============================================================ - -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - -// MAMEOS headers -#include "strconv.h" -#include "unicode.h" - -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) -//============================================================ -// astring_from_utf8 -//============================================================ - -CHAR *astring_from_utf8(const char *utf8string) -{ - WCHAR *wstring; - int char_count; - CHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); - wstring = (WCHAR *)alloca(char_count * sizeof(*wstring)); - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, wstring, char_count); - - // convert UTF-16 to "ANSI code page" string - char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (CHAR *)osd_malloc_array(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, NULL, NULL); - - return result; -} - - -//============================================================ -// utf8_from_astring -//============================================================ - -char *utf8_from_astring(const CHAR *astring) -{ - WCHAR *wstring; - int char_count; - CHAR *result; - - // convert "ANSI code page" string to UTF-16 - char_count = MultiByteToWideChar(CP_ACP, 0, astring, -1, NULL, 0); - wstring = (WCHAR *)alloca(char_count * sizeof(*wstring)); - MultiByteToWideChar(CP_ACP, 0, astring, -1, wstring, char_count); - - // convert UTF-16 to MAME string (UTF-8) - char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (CHAR *)osd_malloc_array(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL); - - return result; -} - - -//============================================================ -// wstring_from_utf8 -//============================================================ - -WCHAR *wstring_from_utf8(const char *utf8string) -{ - int char_count; - WCHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); - result = (WCHAR *)osd_malloc_array(char_count * sizeof(*result)); - if (result != NULL) - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); - - return result; -} - - -//============================================================ -// utf8_from_wstring -//============================================================ - -char *utf8_from_wstring(const WCHAR *wstring) -{ - int char_count; - char *result; - - // convert UTF-16 to MAME string (UTF-8) - char_count = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, NULL, 0, NULL, NULL); - result = (char *)osd_malloc_array(char_count * sizeof(*result)); - if (result != NULL) - WideCharToMultiByte(CP_UTF8, 0, wstring, -1, result, char_count, NULL, NULL); - - return result; -} - -//============================================================ -// osd_uchar_from_osdchar -//============================================================ - -int osd_uchar_from_osdchar(UINT32 *uchar, const char *osdchar, size_t count) -{ - WCHAR wch; - - count = MIN(count, IsDBCSLeadByte(*osdchar) ? 2 : 1); - if (MultiByteToWideChar(CP_ACP, 0, osdchar, (DWORD)count, &wch, 1) != 0) - *uchar = wch; - else - *uchar = 0; - return (int) count; -} - -#else - -//============================================================ -// osd_uchar_from_osdchar -//============================================================ - -int osd_uchar_from_osdchar(unicode_char *uchar, const char *osdchar, size_t count) -{ - wchar_t wch; - - count = mbstowcs(&wch, (char *)osdchar, 1); - if (count != -1) - *uchar = wch; - else - *uchar = 0; - - return count; -} - -#endif diff --git a/src/osd/windows/strconv.h b/src/osd/windows/strconv.h deleted file mode 100644 index 4ad7e1e2e48..00000000000 --- a/src/osd/windows/strconv.h +++ /dev/null @@ -1,52 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// strconv.h - String conversion -// -// Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. -// Visit http://mamedev.org for licensing and usage restrictions. -// -//============================================================ - -#ifndef __OSD_STRCONV__ -#define __OSD_STRCONV__ - -#include "osdcore.h" - - - -//============================================================ -// FUNCTION PROTOTYPES -//============================================================ - -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) - -#if defined(SDLMAME_WIN32) -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif -// the result of these functions has to be released with osd_free() - -CHAR *astring_from_utf8(const char *s); -char *utf8_from_astring(const CHAR *s); - -WCHAR *wstring_from_utf8(const char *s); -char *utf8_from_wstring(const WCHAR *s); - -#ifdef UNICODE -#define tstring_from_utf8 wstring_from_utf8 -#define utf8_from_tstring utf8_from_wstring -#else // !UNICODE -#define tstring_from_utf8 astring_from_utf8 -#define utf8_from_tstring utf8_from_astring -#endif // UNICODE - -#if defined(SDLMAME_WIN32) -#define _tcsncpy wcsncpy -#endif - -#endif //SDLMAME_WIN32 - - -#endif // __OSD_STRCONV__ diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h index ba00c6bf368..87ce0d8527c 100644 --- a/src/osd/windows/video.h +++ b/src/osd/windows/video.h @@ -131,9 +131,9 @@ public: osd_monitor_info *m_next; // pointer to next monitor in list protected: virtual void refresh() = 0; - osd_rect m_pos_size; - osd_rect m_usuable_pos_size; - bool m_is_primary; + osd_rect m_pos_size; + osd_rect m_usuable_pos_size; + bool m_is_primary; char m_name[64]; private: @@ -175,7 +175,7 @@ struct osd_video_config int syncrefresh; // sync only to refresh rate int switchres; // switch resolutions - int fullstretch; // FXIME: implement in windows! + int fullstretch; // FXIME: implement in windows! // ddraw options int hwstretch; // stretch using the hardware diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak deleted file mode 100644 index 53d8be9518a..00000000000 --- a/src/osd/windows/windows.mak +++ /dev/null @@ -1,548 +0,0 @@ -########################################################################### -# -# windows.mak -# -# Windows-specific makefile -# -########################################################################### -# -# Copyright Aaron Giles -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name 'MAME' nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -########################################################################### - - -########################################################################### -################# BEGIN USER-CONFIGURABLE OPTIONS ##################### -########################################################################### - - -#------------------------------------------------- -# specify build options; see each option below -# for details -#------------------------------------------------- - -# uncomment next line to enable a build using Microsoft tools -# MSVC_BUILD = 1 - -# uncomment next line to use ICL with MSVC -# USE_ICL = 1 - -# uncomment next line to enable code analysis using Microsoft tools -# MSVC_ANALYSIS = 1 - -# uncomment next line to use cygwin compiler -# CYGWIN_BUILD = 1 - -# set this to the minimum DirectInput version to support (7 or 8) -DIRECTINPUT = 8 - -# uncomment next line to use SDL library for sound and video output -# USE_SDL = 1 - -# uncomment next line to compile OpenGL video renderer -USE_OPENGL = 1 - -# uncomment the next line to build a binary using GL-dispatching. -USE_DISPATCH_GL = 1 - -# uncomment next line to use QT debugger -# USE_QTDEBUG = 1 - -########################################################################### -################## END USER-CONFIGURABLE OPTIONS ###################### -########################################################################### - -# add a define identifying the target osd -DEFS += -DOSD_WINDOWS - - -#------------------------------------------------- -# object and source roots -#------------------------------------------------- - -WINSRC = $(SRC)/osd/$(OSD) -WINOBJ = $(OBJ)/osd/$(OSD) - -OSDSRC = $(SRC)/osd -OSDOBJ = $(OBJ)/osd - -OBJDIRS += $(WINOBJ) \ - $(OSDOBJ)/modules/sync \ - $(OSDOBJ)/modules/lib \ - $(OSDOBJ)/modules/midi \ - $(OSDOBJ)/modules/font \ - $(OSDOBJ)/modules/netdev \ - $(OSDOBJ)/modules/render \ - $(OSDOBJ)/modules/render/d3d \ - $(OSDOBJ)/modules/debugger/win - -ifdef USE_QTDEBUG -OBJDIRS += $(OSDOBJ)/modules/debugger/qt -DEFS += -DUSE_QTDEBUG=1 -else -DEFS += -DUSE_QTDEBUG=0 -endif - -ifdef USE_SDL -DEFS += -DSDLMAME_SDL2=0 -DEFS += -DUSE_XINPUT=0 -DEFS += -DUSE_OPENGL=0 -DEFS += -DUSE_SDL=1 -else -DEFS += -DUSE_SDL=0 -endif - -#------------------------------------------------- -# configure the resource compiler -#------------------------------------------------- - -RC = @windres --use-temp-file - -RCDEFS = -DNDEBUG -D_WIN32_IE=0x0501 - -RCFLAGS = -O coff -I $(WINSRC) -I $(WINOBJ) - - - -#------------------------------------------------- -# overrides for the CYGWIN compiler -#------------------------------------------------- - -ifdef CYGWIN_BUILD -CCOMFLAGS += -mno-cygwin -LDFLAGS += -mno-cygwin -endif - - - -#------------------------------------------------- -# overrides for the MSVC compiler -#------------------------------------------------- - -ifdef MSVC_BUILD - -OSPREBUILD = $(VCONV_TARGET) - -# append a 'v' prefix if nothing specified -ifndef PREFIX -ifdef USE_ICL -PREFIX = vi -else -PREFIX = v -endif -endif - -# replace the various compilers with vconv.exe prefixes -ifdef USE_ICL -CC = @$(VCONV) gcc -icl -I. -LD = @$(VCONV) ld -icl /profile -AR = @$(VCONV) ar -icl -else -CC = @$(VCONV) gcc -I. -LD = @$(VCONV) ld /profile -AR = @$(VCONV) ar -endif -RC = @$(VCONV) windres - -# make sure we use the multithreaded runtime -ifdef DEBUG -CCOMFLAGS += /MTd -else -CCOMFLAGS += /MT -endif - -# use link-time optimizations when enabled -ifneq ($(OPTIMIZE),0) -ifdef LTO -AR += /LTCG -endif -endif - -# disable warnings and link against bufferoverflowu for 64-bit targets -ifeq ($(PTR64),1) -CCOMFLAGS += /wd4267 -#LIBS += -lbufferoverflowu -endif - -# enable basic run-time checks in non-optimized build -ifeq ($(OPTIMIZE),0) -ifndef FASTDEBUG -CCOMFLAGS += /RTC1 -else -# disable the stack check since it has quite a speed impact -CCOMFLAGS += /RTCu -endif -endif - -ifdef MSVC_ANALYSIS -CCOMFLAGS += /analyze /wd6011 /wd6328 /wd6204 /wd6244 /wd6385 /wd6308 /wd6246 /wd6031 /wd6326 /wd6255 /wd6330 /wd28251 /wd6054 /wd6340 /wd28125 /wd6053 /wd6001 /wd6386 /wd28278 /wd6297 /wd28183 /wd28159 /wd28182 /wd6237 /wd6239 /wd6240 /wd6323 /wd28199 /wd6235 /wd6285 /wd6286 /wd6384 /wd6293 /analyze:stacksize1070232 -endif - -# enable exception handling for C++ -CPPONLYFLAGS += /EHsc - -# disable function pointer warnings in C++ which are evil to work around -CPPONLYFLAGS += /wd4191 /wd4060 /wd4065 /wd4640 - -# disable warning about exception specifications and using this in constructors -CPPONLYFLAGS += /wd4290 /wd4355 - -# disable performance warnings about casting ints to bools -CPPONLYFLAGS += /wd4800 - -# disable better packing warning -CPPONLYFLAGS += /wd4371 - -# disable side effects warning in STL headers -CPPONLYFLAGS += /wd4548 - -# disable macro redefinition warning -CCOMFLAGS += /wd4005 - -# disable behavior change: 'member1' called instead of 'member2' warning -CCOMFLAGS += /wd4350 - -# only show deprecation warnings when enabled -ifndef DEPRECATED -CCOMFLAGS += /wd4996 -endif - -# explicitly set the entry point for UNICODE builds -LDFLAGS += /ENTRY:wmainCRTStartup - -ifdef DEBUG -LDFLAGS += /NODEFAULTLIB:LIBCMT -endif - -# add some VC++-specific defines -DEFS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DXML_STATIC -DWIN32 - -OSDCLEAN = msvcclean - -msvcclean: - @echo Deleting Visual Studio specific files... - $(RM) *.pdb - $(RM) *.lib - $(RM) *.exp - -endif # MSVC_BUILD - - -#------------------------------------------------- -# build VCONV -#------------------------------------------------- - -VCONV_TARGET = $(BUILDOUT)/vconv$(BUILD_EXE) -VCONV = $(subst /,\,$(VCONV_TARGET)) - -ifneq ($(CROSS_BUILD),1) -BUILD += \ - $(VCONV_TARGET) -endif - -$(VCONV_TARGET): $(WINOBJ)/vconv.o - @echo Linking $@... - @gcc.exe -static-libgcc $^ $(LIBS) -lversion -o $@ - -$(WINOBJ)/vconv.o: $(WINSRC)/vconv.c - @echo Compiling $<... - @gcc.exe -O3 -c $< -o $@ - - - -#------------------------------------------------- -# due to quirks of using /bin/sh, we need to -# explicitly specify the current path -#------------------------------------------------- - -CURPATH = ./ - - - -#------------------------------------------------- -# Windows-specific debug objects and flags -#------------------------------------------------- - -# define the x64 ABI to be Windows -DEFS += -DX64_WINDOWS_ABI - -# enable UNICODE flags -DEFS += -DUNICODE -D_UNICODE -LDFLAGS += -municode - -# map all instances of "main" to "utf8_main" -DEFS += -Dmain=utf8_main - -# debug build: enable guard pages on all memory allocations -ifdef DEBUG -DEFS += -DMALLOC_DEBUG -endif - - - -#------------------------------------------------- -# Windows-specific flags and libraries -#------------------------------------------------- - -# add our prefix files to the mix -CCOMFLAGS += -include $(WINSRC)/winprefix.h - -include $(SRC)/build/cc_detection.mak - -# ensure we statically link the gcc runtime lib -LDFLAGS += -static-libgcc - -ifeq ($(CROSS_BUILD),1) - LDFLAGS += -static -endif - -# TODO: needs to use $(CC) -TEST_GCC := $(shell gcc --version) -ifeq ($(findstring 4.4.,$(TEST_GCC)),) - #if we use new tools - LDFLAGS += -static-libstdc++ -endif - -# add the windows libraries -BASELIBS += -luser32 -lgdi32 -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi -lwsock32 -LIBS += -luser32 -lgdi32 -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi -lwsock32 - -ifdef USE_SDL -LIBS += -lSDL.dll -endif - -ifeq ($(DIRECTINPUT),8) -LIBS += -ldinput8 -CCOMFLAGS += -DDIRECTINPUT_VERSION=0x0800 -else -LIBS += -ldinput -CCOMFLAGS += -DDIRECTINPUT_VERSION=0x0700 -endif - -LIBS += -lcomdlg32 - -#------------------------------------------------- -# OSD core library -#------------------------------------------------- - -OSDCOREOBJS = \ - $(WINOBJ)/main.o \ - $(WINOBJ)/strconv.o \ - $(WINOBJ)/windir.o \ - $(WINOBJ)/winfile.o \ - $(OSDOBJ)/modules/sync/sync_windows.o \ - $(WINOBJ)/winutf8.o \ - $(WINOBJ)/winutil.o \ - $(WINOBJ)/winclip.o \ - $(WINOBJ)/winsocket.o \ - $(OSDOBJ)/modules/sync/work_osd.o \ - $(OSDOBJ)/modules/lib/osdlib_win32.o \ - $(OSDOBJ)/modules/osdmodule.o \ - $(WINOBJ)/winptty.o \ - - -#------------------------------------------------- -# OSD Windows library -#------------------------------------------------- - -OSDOBJS = \ - $(OSDOBJ)/modules/render/drawd3d.o \ - $(OSDOBJ)/modules/render/d3d/d3d9intf.o \ - $(OSDOBJ)/modules/render/d3d/d3dhlsl.o \ - $(OSDOBJ)/modules/render/drawdd.o \ - $(OSDOBJ)/modules/render/drawgdi.o \ - $(OSDOBJ)/modules/render/drawbgfx.o \ - $(OSDOBJ)/modules/render/drawnone.o \ - $(WINOBJ)/input.o \ - $(WINOBJ)/output.o \ - $(OSDOBJ)/modules/sound/js_sound.o \ - $(OSDOBJ)/modules/sound/direct_sound.o \ - $(OSDOBJ)/modules/sound/sdl_sound.o \ - $(OSDOBJ)/modules/sound/none.o \ - $(WINOBJ)/video.o \ - $(WINOBJ)/window.o \ - $(WINOBJ)/winmenu.o \ - $(WINOBJ)/winmain.o \ - $(OSDOBJ)/modules/midi/portmidi.o \ - $(OSDOBJ)/modules/midi/none.o \ - $(OSDOBJ)/modules/lib/osdobj_common.o \ - $(OSDOBJ)/modules/font/font_sdl.o \ - $(OSDOBJ)/modules/font/font_windows.o \ - $(OSDOBJ)/modules/font/font_osx.o \ - $(OSDOBJ)/modules/font/font_none.o \ - $(OSDOBJ)/modules/netdev/pcap.o \ - $(OSDOBJ)/modules/netdev/taptun.o \ - $(OSDOBJ)/modules/netdev/none.o \ - -ifdef USE_OPENGL -OSDOBJS += \ - $(OSDOBJ)/modules/render/drawogl.o \ - $(OSDOBJ)/modules/opengl/gl_shader_tool.o \ - $(OSDOBJ)/modules/opengl/gl_shader_mgr.o - -OBJDIRS += \ - $(OSDOBJ)/modules/opengl - -DEFS += -DUSE_OPENGL=1 - -ifdef USE_DISPATCH_GL -DEFS += -DUSE_DISPATCH_GL=1 -else -LIBS += -lopengl32 -endif - -else -DEFS += -DUSE_OPENGL=0 -endif - -ifdef USE_SDL -DEFS += -DUSE_SDL_SOUND -endif - -ifndef DONT_USE_NETWORK -DEFS += -DSDLMAME_NET_PCAP -endif - -CCOMFLAGS += -DDIRECT3D_VERSION=0x0900 - -# extra dependencies -$(WINOBJ)/drawdd.o : $(SRC)/emu/rendersw.inc -$(WINOBJ)/drawgdi.o : $(SRC)/emu/rendersw.inc - -# add debug-specific files -OSDOBJS += \ - $(OSDOBJ)/modules/debugger/debugwin.o \ - $(OSDOBJ)/modules/debugger/win/consolewininfo.o \ - $(OSDOBJ)/modules/debugger/win/debugbaseinfo.o \ - $(OSDOBJ)/modules/debugger/win/debugviewinfo.o \ - $(OSDOBJ)/modules/debugger/win/debugwininfo.o \ - $(OSDOBJ)/modules/debugger/win/disasmbasewininfo.o \ - $(OSDOBJ)/modules/debugger/win/disasmviewinfo.o \ - $(OSDOBJ)/modules/debugger/win/disasmwininfo.o \ - $(OSDOBJ)/modules/debugger/win/editwininfo.o \ - $(OSDOBJ)/modules/debugger/win/logwininfo.o \ - $(OSDOBJ)/modules/debugger/win/memoryviewinfo.o \ - $(OSDOBJ)/modules/debugger/win/memorywininfo.o \ - $(OSDOBJ)/modules/debugger/win/pointswininfo.o \ - $(OSDOBJ)/modules/debugger/win/uimetrics.o \ - $(OSDOBJ)/modules/debugger/debugint.o \ - $(OSDOBJ)/modules/debugger/debugqt.o \ - $(OSDOBJ)/modules/debugger/none.o - -# add a stub resource file -RESFILE = $(WINOBJ)/mame.res - -BGFX_LIB = $(OBJ)/libbgfx.a -INCPATH += -I$(3RDPARTY)/bgfx/include -I$(3RDPARTY)/bx/include - -#------------------------------------------------- -# QT Debug library -#------------------------------------------------- -ifdef USE_QTDEBUG -QT_INSTALL_HEADERS := $(shell qmake -query QT_INSTALL_HEADERS) -QT_LIBS := -L$(shell qmake -query QT_INSTALL_LIBS) -LIBS += $(QT_LIBS) -lqtmain -lQtGui4 -lQtCore4 -INCPATH += -I$(QT_INSTALL_HEADERS)/QtCore -I$(QT_INSTALL_HEADERS)/QtGui -I$(QT_INSTALL_HEADERS) - -MOC = @moc -$(OSDOBJ)/%.moc.c: $(OSDSRC)/%.h - $(MOC) $(INCPATH) $< -o $@ - -OSDOBJS += \ - $(OSDOBJ)/modules/debugger/qt/debuggerview.o \ - $(OSDOBJ)/modules/debugger/qt/windowqt.o \ - $(OSDOBJ)/modules/debugger/qt/logwindow.o \ - $(OSDOBJ)/modules/debugger/qt/dasmwindow.o \ - $(OSDOBJ)/modules/debugger/qt/mainwindow.o \ - $(OSDOBJ)/modules/debugger/qt/memorywindow.o \ - $(OSDOBJ)/modules/debugger/qt/breakpointswindow.o \ - $(OSDOBJ)/modules/debugger/qt/deviceswindow.o \ - $(OSDOBJ)/modules/debugger/qt/deviceinformationwindow.o \ - $(OSDOBJ)/modules/debugger/qt/debuggerview.moc.o \ - $(OSDOBJ)/modules/debugger/qt/windowqt.moc.o \ - $(OSDOBJ)/modules/debugger/qt/logwindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/dasmwindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/mainwindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/memorywindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/breakpointswindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/deviceswindow.moc.o \ - $(OSDOBJ)/modules/debugger/qt/deviceinformationwindow.moc.o -endif - -#------------------------------------------------- -# WinPCap -#------------------------------------------------- -INCPATH += -I$(3RDPARTY)/winpcap/Include - -#------------------------------------------------- -# rules for building the libaries -#------------------------------------------------- - -$(LIBOCORE): $(OSDCOREOBJS) - -$(LIBOSD): $(OSDOBJS) - - - -#------------------------------------------------- -# rule for making the ledutil sample -#------------------------------------------------- - -LEDUTIL = $(BIN)ledutil$(EXE) -TOOLS += $(LEDUTIL) - -LEDUTILOBJS = \ - $(WINOBJ)/ledutil.o - -$(LEDUTIL): $(LEDUTILOBJS) $(LIBOCORE) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - - - -#------------------------------------------------- -# generic rule for the resource compiler -#------------------------------------------------- - -$(WINOBJ)/%.res: $(WINSRC)/%.rc | $(OSPREBUILD) - @echo Compiling resources $<... - $(RC) $(RCDEFS) $(RCFLAGS) -o $@ -i $< - - - -#------------------------------------------------- -# rules for resource file -#------------------------------------------------- - -$(RESFILE): $(WINSRC)/mame.rc $(WINOBJ)/mamevers.rc - -$(WINOBJ)/mamevers.rc: $(SRC)/build/verinfo.py $(SRC)/version.c - @echo Emitting $@... - $(PYTHON) $(SRC)/build/verinfo.py -b mame -o $@ $(SRC)/version.c diff --git a/src/osd/windows/winfile.c b/src/osd/windows/winfile.c index 9f02a547523..795840231b1 100644 --- a/src/osd/windows/winfile.c +++ b/src/osd/windows/winfile.c @@ -48,15 +48,10 @@ extern const char *winfile_ptty_identifier; file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize) { - DWORD disposition, access, sharemode; file_error filerr = FILERR_NONE; - const TCHAR *src; - DWORD upper; - TCHAR *t_path; - TCHAR *dst; // convert path to TCHAR - t_path = tstring_from_utf8(path); + TCHAR *t_path = tstring_from_utf8(path); if (t_path == NULL) { filerr = FILERR_OUT_OF_MEMORY; @@ -89,17 +84,15 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64 (*file)->type = WINFILE_FILE; // convert the path into something Windows compatible - dst = (*file)->filename; -#if defined(SDLMAME_WIN32) || defined(SDLMAME_OS2) - for (src = t_path; *src != 0; src++) - *dst++ = (*src == '/') ? '\\' : *src; -#else - for (src = t_path; *src != 0; src++) - *dst++ = *src;//(*src == '/') ? '\\' : *src; -#endif - *dst++ = 0; + { + TCHAR *dst = (*file)->filename; + for (TCHAR const *src = t_path; *src != 0; src++) + *dst++ = *src;//(*src == '/') ? '\\' : *src; + *dst++ = 0; + } // select the file open modes + DWORD disposition, access, sharemode; if (openflags & OPEN_FLAG_WRITE) { disposition = (!is_path_to_physical_drive(path) && (openflags & OPEN_FLAG_CREATE)) ? CREATE_ALWAYS : OPEN_EXISTING; @@ -149,6 +142,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64 } // get the file size + DWORD upper; *filesize = GetFileSize((*file)->handle, &upper); *filesize |= (UINT64)upper << 32; diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h deleted file mode 100644 index e506403e7b5..00000000000 --- a/src/osd/windows/winprefix.h +++ /dev/null @@ -1,49 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// winprefix.h - Win32 prefix file, included by ALL files -// -//============================================================ - -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 // Windows XP -#endif - -#ifdef _MSC_VER -#include <malloc.h> -#if _MSC_VER < 1900 // < VS2015 -#define snprintf _snprintf -#if _MSC_VER < 1800 // VS2013 or earlier -#define alloca _alloca -#define round(x) floor((x) + 0.5) -#define strtoll _strtoi64 -#define _USE_MATH_DEFINES -#include <math.h> -static __inline double fmin(double x, double y){ return (x < y) ? x : y; } -static __inline double fmax(double x, double y){ return (x > y) ? x : y; } -static __inline double log2(double x) { return log(x) * M_LOG2E; } -#if _MSC_VER < 1500 // VS2008 or earlier -#define vsnprintf _vsnprintf -#endif // VS2008 -#endif // VS2013 -#else // VS2015 -#pragma warning (disable: 4091) -#pragma warning (disable: 4267) -#pragma warning (disable: 4456 4457 4458 4459) -#pragma warning (disable: 4463) -#pragma warning (disable: 4838) -#pragma warning (disable: 5025 5026 5027) -#define _CRT_STDIO_LEGACY_WIDE_SPECIFIERS -#endif -#endif - -#ifdef __GNUC__ -#ifndef alloca -#define alloca __builtin_alloca -#endif -#define min(x,y) fmin(x,y) -#define max(x,y) fmax(x,y) -#endif - -#define PATH_SEPARATOR "\\" diff --git a/src/targets/mame.lst b/src/targets/mame.lst deleted file mode 100644 index 0069bc5505b..00000000000 --- a/src/targets/mame.lst +++ /dev/null @@ -1,1528 +0,0 @@ -/****************************************************************************** - - mame.lst - - List of all enabled drivers in the system. This file is parsed by - makemak.exe, sorted, and output as C code describing the drivers. - -**************************************************************************** - - Copyright Aaron Giles - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name 'MAME' nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -******************************************************************************/ - -// 28628 drivers found - -@acorn -/mame/drivers/ertictac -/mame/drivers/ssfindo -/mame/drivers/aristmk5 - -@alba -/mame/drivers/albazc -/mame/drivers/albazg -/mame/drivers/rmhaihai - -@alliedl -/mame/drivers/ace -/mame/drivers/clayshoo - -@alpha -/mame/drivers/alpha68k -/mame/drivers/champbas -/mame/drivers/equites -/mame/drivers/meijinsn -/mame/drivers/shougi - -@amiga -/mame/drivers/alg -/mame/drivers/arcadia -/mame/drivers/cd32 -/mame/drivers/mquake -/mame/drivers/upscope - -@aristocr -/mame/drivers/aristmk4 -/mame/drivers/aristmk6 -/mame/drivers/caswin - -@ascii -/mame/drivers/big10 -/mame/drivers/forte2 -/mame/drivers/pengadvb -/mame/drivers/sangho -/mame/drivers/sfkick - -@atari -/mame/drivers/arcadecl -/mame/drivers/asteroid -/mame/drivers/atarifb -/mame/drivers/atarig1 -/mame/drivers/atarig42 -/mame/drivers/atarigt -/mame/drivers/atarigx2 -/mame/drivers/atarisy1 -/mame/drivers/atarisy2 -/mame/drivers/atarisy4 -/mame/drivers/atetris -/mame/drivers/avalnche -/mame/drivers/badlands -/mame/drivers/bartop52 -/mame/drivers/batman -/mame/drivers/beathead -/mame/drivers/blstroid -/mame/drivers/boxer -/mame/drivers/bsktball -/mame/drivers/bwidow -/mame/drivers/bzone -/mame/drivers/canyon -/mame/drivers/cball -/mame/drivers/ccastles -/mame/drivers/centiped -/mame/drivers/cloak -/mame/drivers/cloud9 -/mame/drivers/cmmb -/mame/drivers/cops -/mame/drivers/copsnrob -/mame/drivers/cyberbal -/mame/drivers/destroyr -/mame/drivers/dragrace -/mame/drivers/eprom -/mame/drivers/firefox -/mame/drivers/firetrk -/mame/drivers/flyball -/mame/drivers/foodf -/mame/drivers/gauntlet -/mame/drivers/harddriv -/mame/drivers/irobot -/mame/drivers/jaguar -/mame/drivers/jedi -/mame/drivers/klax -/mame/drivers/liberatr -/mame/drivers/mediagx -/mame/drivers/metalmx -/mame/drivers/mgolf -/mame/drivers/mhavoc -/mame/drivers/missile -/mame/drivers/nitedrvr -/mame/drivers/offtwall -/mame/drivers/orbit -/mame/drivers/pong -/mame/drivers/poolshrk -/mame/drivers/quantum -/mame/drivers/quizshow -/mame/drivers/rampart -/mame/drivers/relief -/mame/drivers/runaway -/mame/drivers/sbrkout -/mame/drivers/shuuz -/mame/drivers/skullxbo -/mame/drivers/skydiver -/mame/drivers/skyraid -/mame/drivers/sprint2 -/mame/drivers/sprint4 -/mame/drivers/sprint8 -/mame/drivers/starshp1 -/mame/drivers/starwars -/mame/drivers/subs -/mame/drivers/tank8 -/mame/drivers/tempest -/mame/drivers/thunderj -/mame/drivers/tomcat -/mame/drivers/toobin -/mame/drivers/tourtabl -/mame/drivers/triplhnt -/mame/drivers/tunhunt -/mame/drivers/ultratnk -/mame/drivers/videopin -/mame/drivers/vindictr -/mame/drivers/wolfpack -/mame/drivers/xybots - -@atlus -/mame/drivers/blmbycar -/mame/drivers/ohmygod -/mame/drivers/powerins -/mame/drivers/bowltry - -@barcrest -/mame/drivers/mpu2 -/mame/drivers/mpu3 -/mame/drivers/mpu4hw -/mame/drivers/mpu4sw -/mame/drivers/mpu4 -/mame/drivers/mpu4mod2sw -/mame/drivers/mpu4mod4yam -/mame/drivers/mpu4plasma -/mame/drivers/mpu4dealem -/mame/drivers/mpu4vid -/mame/drivers/mpu4avan -/mame/drivers/mpu4union -/mame/drivers/mpu4concept -/mame/drivers/mpu4empire -/mame/drivers/mpu4mdm -/mame/drivers/mpu4crystal -/mame/drivers/mpu4bwb -/mame/drivers/mpu4misc -/mame/drivers/mpu5hw -/mame/drivers/mpu5 - -@bfm -/mame/drivers/bfcobra -/mame/drivers/bfm_sc1 -/mame/drivers/bfm_sc2 -/mame/drivers/bfm_sc4 -/mame/drivers/bfm_sc4h -/mame/drivers/bfm_sc5 -/mame/drivers/bfm_sc5sw -/mame/drivers/bfm_ad5 -/mame/drivers/bfm_ad5sw -/mame/drivers/bfm_swp -/mame/drivers/bfmsys83 -/mame/drivers/bfmsys85 -/mame/drivers/rastersp - -@bmc -/mame/drivers/bmcbowl -/mame/drivers/koftball -/mame/drivers/popobear -/mame/drivers/bmcpokr - -@capcom -/mame/drivers/1942 -/mame/drivers/1943 -/mame/drivers/alien -/mame/drivers/bionicc -/mame/drivers/blktiger -/mame/drivers/cbasebal -/mame/drivers/commando -/mame/drivers/cps1 -/mame/drivers/cps2 -/mame/drivers/cps3 -/mame/drivers/egghunt -/mame/drivers/exedexes -/mame/drivers/fcrash -/mame/drivers/gng -/mame/drivers/gunsmoke -/mame/drivers/higemaru -/mame/drivers/lastduel -/mame/drivers/lwings -/mame/drivers/mitchell -/mame/drivers/sf -/mame/drivers/sidearms -/mame/drivers/sonson -/mame/drivers/srumbler -/mame/drivers/tigeroad -/mame/drivers/vulgus - - -@cinemat -/mame/drivers/ataxx -/mame/drivers/cinemat -/mame/drivers/cchasm -/mame/drivers/dlair -/mame/drivers/dlair2 -/mame/drivers/embargo -/mame/drivers/jack -/mame/drivers/leland - -@comad -/mame/drivers/funybubl -/mame/drivers/galspnbl -/mame/drivers/pushman -/mame/drivers/zerozone - -@cvs -/mame/drivers/cvs -/mame/drivers/galaxia -/mame/drivers/quasar - -@dataeast -/mame/drivers/actfancr -/mame/drivers/astrof -/mame/drivers/backfire -/mame/drivers/battlera -/mame/drivers/boogwing -/mame/drivers/brkthru -/mame/drivers/btime -/mame/drivers/bwing -/mame/drivers/cbuster -/mame/drivers/chanbara -/mame/drivers/cninja -/mame/drivers/cntsteer -/mame/drivers/compgolf -/mame/drivers/darkseal -/mame/drivers/dassault -/mame/drivers/dblewing -/mame/drivers/dec0 -/mame/drivers/dec8 -/mame/drivers/deco_ld -/mame/drivers/deco_mlc -/mame/drivers/deco156 -/mame/drivers/deco32 -/mame/drivers/decocass -/mame/drivers/deshoros -/mame/drivers/dietgo -/mame/drivers/dreambal -/mame/drivers/exprraid -/mame/drivers/firetrap -/mame/drivers/funkyjet -/mame/drivers/karnov -/mame/drivers/kchamp -/mame/drivers/kingobox -/mame/drivers/lemmings -/mame/drivers/liberate -/mame/drivers/madalien -/mame/drivers/madmotor -/mame/drivers/metlclsh -/mame/drivers/mirage -/mame/drivers/pcktgal -/mame/drivers/pktgaldx -/mame/drivers/progolf -/mame/drivers/rohga -/mame/drivers/shootout -/mame/drivers/sidepckt -/mame/drivers/simpl156 -/mame/drivers/sshangha -/mame/drivers/stadhero -/mame/drivers/supbtime -/mame/drivers/tryout -/mame/drivers/tumbleb -/mame/drivers/tumblep -/mame/drivers/vaportra - - -@dgrm -/mame/drivers/blackt96 -/mame/drivers/pokechmp - -@dooyong -/mame/drivers/dooyong -/mame/drivers/gundealr - -@dynax -/mame/drivers/ddenlovr -/mame/drivers/dynax -/mame/drivers/hnayayoi -/mame/drivers/realbrk -/mame/drivers/royalmah - -@edevices -/mame/drivers/diverboy -/mame/drivers/fantland -/mame/drivers/mwarr -/mame/drivers/mugsmash -/mame/drivers/ppmast93 -/mame/drivers/pzletime -/mame/drivers/stlforce -/mame/drivers/twins - -@eolith -/mame/drivers/eolith -/mame/drivers/eolith16 -/mame/drivers/eolithsp -/mame/drivers/ghosteo -/mame/drivers/vegaeo - -@excelent -/mame/drivers/aquarium -/mame/drivers/d9final -/mame/drivers/dblcrown -/mame/drivers/gcpinbal -/mame/drivers/lastbank - -@exidy -/mame/drivers/carpolo -/mame/drivers/circus -/mame/drivers/exidy -/mame/drivers/exidy440 -/mame/drivers/maxaflex -/mame/drivers/starfire -/mame/drivers/vertigo -/mame/drivers/victory - - -@f32 -/mame/drivers/crospang -/mame/drivers/silvmil -/mame/drivers/f-32 - -@funworld -/mame/drivers/4roses -/mame/drivers/funworld -/mame/drivers/snookr10 - -@fuuki -/mame/drivers/fuukifg2 -/mame/drivers/fuukifg3 - -@gaelco -/mame/drivers/atvtrack -/mame/drivers/gaelco -/mame/drivers/gaelco2 -/mame/drivers/gaelco3d -/mame/drivers/glass -/mame/drivers/mastboy -/mame/drivers/splash -/mame/drivers/targeth -/mame/drivers/thoop2 -/mame/drivers/tokyocop -/mame/drivers/wrally -/mame/drivers/xorworld - -@gameplan -/mame/drivers/enigma2 -/mame/drivers/gameplan -/mame/drivers/toratora - -@gametron -/mame/drivers/gatron -/mame/drivers/gotya -/mame/drivers/sbugger - -@gottlieb -/mame/drivers/exterm -/mame/drivers/gottlieb - -@ibmpc -/mame/drivers/calchase -/mame/drivers/fruitpc -/mame/drivers/pangofun -/mame/drivers/pcat_dyn -/mame/drivers/pcat_nit -/mame/drivers/pcxt -/mame/drivers/quakeat -/mame/drivers/queen -/mame/drivers/igspc - -@igs -/mame/drivers/cabaret -/mame/drivers/ddz -/mame/drivers/dunhuang -/mame/drivers/goldstar -/mame/drivers/jackie -/mame/drivers/igspoker -/mame/drivers/igs009 -/mame/drivers/igs011 -/mame/drivers/igs017 -/mame/drivers/igs_m027 -/mame/drivers/igs_m036 -/mame/drivers/iqblock -/mame/drivers/lordgun -/mame/drivers/pgm -/mame/drivers/pgm2 -/mame/drivers/spoker - - -@irem -/mame/drivers/m10 -/mame/drivers/m14 -/mame/drivers/m52 -/mame/drivers/m57 -/mame/drivers/m58 -/mame/drivers/m62 -/mame/drivers/m63 -/mame/drivers/m72 -/mame/drivers/m90 -/mame/drivers/m92 -/mame/drivers/m107 -/mame/drivers/olibochu -/mame/drivers/redalert -/mame/drivers/shisen -/mame/drivers/travrusa -/mame/drivers/vigilant - - - -@itech -/mame/drivers/capbowl -/mame/drivers/itech8 -/mame/drivers/itech32 -/mame/drivers/iteagle - -@jaleco -/mame/drivers/aeroboto -/mame/drivers/argus -/mame/drivers/bestleag -/mame/drivers/bigstrkb -/mame/drivers/blueprnt -/mame/drivers/bnstars -/mame/drivers/cischeat -/mame/drivers/citycon -/mame/drivers/ddayjlc -/mame/drivers/exerion -/mame/drivers/fcombat -/mame/drivers/ginganin -/mame/drivers/homerun -/mame/drivers/megasys1 -/mame/drivers/momoko -/mame/drivers/ms32 -/mame/drivers/psychic5 -/mame/drivers/pturn -/mame/drivers/skyfox -/mame/drivers/tetrisp2 - - - -@jpm -/mame/drivers/guab -/mame/drivers/jpmsys5 -/mame/drivers/jpmsys5sw -/mame/drivers/jpmmps -/mame/drivers/jpms80 -/mame/drivers/jpmsru -/mame/drivers/jpmimpct -/mame/drivers/jpmimpctsw -/mame/drivers/pluto5 -/mame/drivers/jpmsys7 - - -@kaneko -/mame/drivers/airbustr -/mame/drivers/djboy -/mame/drivers/expro02 -/mame/drivers/galpanic -/mame/drivers/galpani2 -/mame/drivers/galpani3 -/mame/drivers/hvyunit -/mame/drivers/jchan -/mame/drivers/kaneko16 -/mame/drivers/sandscrp -/mame/drivers/suprnova - - -@konami -/mame/drivers/88games -/mame/drivers/ajax -/mame/drivers/aliens -/mame/drivers/asterix -/mame/drivers/battlnts -/mame/drivers/bishi -/mame/drivers/bladestl -/mame/drivers/blockhl -/mame/drivers/bottom9 -/mame/drivers/chqflag -/mame/drivers/circusc -/mame/drivers/cobra -/mame/drivers/combatsc -/mame/drivers/contra -/mame/drivers/crimfght -/mame/drivers/dbz -/mame/drivers/ddribble -/mame/drivers/djmain -/mame/drivers/fastfred -/mame/drivers/fastlane -/mame/drivers/finalizr -/mame/drivers/firebeat -/mame/drivers/flkatck -/mame/drivers/gberet -/mame/drivers/gbusters -/mame/drivers/gijoe -/mame/drivers/gradius3 -/mame/drivers/gticlub -/mame/drivers/gyruss -/mame/drivers/hcastle -/mame/drivers/hexion -/mame/drivers/hornet -/mame/drivers/hyperspt -/mame/drivers/ironhors -/mame/drivers/jackal -/mame/drivers/jailbrek -/mame/drivers/junofrst -/mame/drivers/konamigq -/mame/drivers/konamigv -/mame/drivers/konamigx -/mame/drivers/konamim2 -/mame/drivers/kontest -/mame/drivers/konendev -/mame/drivers/ksys573 -/mame/drivers/labyrunr -/mame/drivers/lethal -/mame/drivers/mainevt -/mame/drivers/megazone -/mame/drivers/mikie -/mame/drivers/mogura -/mame/drivers/moo -/mame/drivers/mystwarr -/mame/drivers/nemesis -/mame/drivers/nwk-tr -/mame/drivers/overdriv -/mame/drivers/pandoras -/mame/drivers/parodius -/mame/drivers/pingpong -/mame/drivers/plygonet -/mame/drivers/pooyan -/mame/drivers/pyson -/mame/drivers/qdrmfgp -/mame/drivers/rockrage -/mame/drivers/rocnrope -/mame/drivers/rollerg -/mame/drivers/rungun -/mame/drivers/sbasketb -/mame/drivers/scobra -/mame/drivers/scotrsht -/mame/drivers/scramble -/mame/drivers/shaolins -/mame/drivers/simpsons -/mame/drivers/spy -/mame/drivers/surpratk -/mame/drivers/tasman -/mame/drivers/tgtpanic -/mame/drivers/thunderx -/mame/drivers/timeplt -/mame/drivers/tmnt -/mame/drivers/tp84 -/mame/drivers/trackfld -/mame/drivers/tutankhm -/mame/drivers/twin16 -/mame/drivers/twinkle -/mame/drivers/ultrsprt -/mame/drivers/ultraman -/mame/drivers/vendetta -/mame/drivers/viper -/mame/drivers/wecleman -/mame/drivers/xexex -/mame/drivers/xmen -/mame/drivers/yiear -/mame/drivers/zr107 - - -@maygay -/mame/drivers/maygay1b -/mame/drivers/maygay1bsw -/mame/drivers/maygayv1 -/mame/drivers/maygayep -/mame/drivers/maygaysw -/mame/drivers/mmm - -@meadows -/mame/drivers/lazercmd -/mame/drivers/meadows -/mame/drivers/warpsped - -@merit -/mame/drivers/mpoker -/mame/drivers/merit -/mame/drivers/meritm - -@metro -/mame/drivers/hyprduel -/mame/drivers/metro -/mame/drivers/rabbit -/mame/drivers/tmmjprd - -@midcoin -/mame/drivers/wallc -/mame/drivers/wink -/mame/drivers/24cdjuke - -@midw8080 -/mame/drivers/8080bw -/mame/drivers/m79amb -/mame/drivers/mw18w -/mame/drivers/mw8080bw -/mame/drivers/rotaryf -/mame/drivers/sspeedr - -@midway -/mame/drivers/astrocde -/mame/drivers/atlantis -/mame/drivers/balsente -/mame/drivers/gridlee -/mame/drivers/mcr -/mame/drivers/mcr3 -/mame/drivers/mcr68 -/mame/drivers/midqslvr -/mame/drivers/midtunit -/mame/drivers/midvunit -/mame/drivers/midwunit -/mame/drivers/midxunit -/mame/drivers/midyunit -/mame/drivers/midzeus -/mame/drivers/omegrace -/mame/drivers/pinball2k -/mame/drivers/seattle -/mame/drivers/tmaster -/mame/drivers/vegas -/mame/drivers/wmg -/mame/drivers/williams - -@namco -/mame/drivers/20pacgal -/mame/drivers/30test -/mame/drivers/baraduke -/mame/drivers/dambustr -/mame/drivers/gal3 -/mame/drivers/galaga -/mame/drivers/galaxian -/mame/drivers/galaxold -/mame/drivers/gaplus -/mame/drivers/kungfur -/mame/drivers/mappy -/mame/drivers/namcofl -/mame/drivers/namcoic -/mame/drivers/namcona1 -/mame/drivers/namconb1 -/mame/drivers/namcond1 -/mame/drivers/namcops2 -/mame/drivers/namcos1 -/mame/drivers/namcos10 -/mame/drivers/namcos11 -/mame/drivers/namcos12 -/mame/drivers/namcos2 -/mame/drivers/namcos21 -/mame/drivers/namcos22 -/mame/drivers/namcos23 -/mame/drivers/namcos86 -/mame/drivers/pacland -/mame/drivers/polepos -/mame/drivers/rallyx -/mame/drivers/skykid -/mame/drivers/tankbatt -/mame/drivers/tceptor -/mame/drivers/toypop -/mame/drivers/turrett -/mame/drivers/warpwarp - - -@nasco -/mame/drivers/crgolf -/mame/drivers/suprgolf - -@neogeo -/mame/drivers/neogeo - -@nichibut -/mame/drivers/armedf -/mame/drivers/cclimber -/mame/drivers/clshroad -/mame/drivers/csplayh5 -/mame/drivers/cop01 -/mame/drivers/dacholer -/mame/drivers/galivan -/mame/drivers/gomoku -/mame/drivers/hyhoo -/mame/drivers/jangou -/mame/drivers/magmax -/mame/drivers/nbmj8688 -/mame/drivers/nbmj8891 -/mame/drivers/nbmj8900 -/mame/drivers/nbmj8991 -/mame/drivers/nbmj9195 -/mame/drivers/nightgal -/mame/drivers/niyanpai -/mame/drivers/pastelg -/mame/drivers/seicross -/mame/drivers/terracre -/mame/drivers/tubep -/mame/drivers/wiping - - -@nintendo -/mame/drivers/cham24 -/mame/drivers/dkong -/mame/drivers/mario -/mame/drivers/multigam -/mame/drivers/n8080 -/mame/drivers/nss -/mame/drivers/playch10 -/mame/drivers/popeye -/mame/drivers/punchout -/mame/drivers/famibox -/mame/drivers/sfcbox -/mame/drivers/snesb -/mame/drivers/spacefb -/mame/drivers/vsnes - - - - -@nix -/mame/drivers/fitfight -/mame/drivers/pirates - -@nmk -/mame/drivers/acommand -/mame/drivers/cultures -/mame/drivers/ddealer -/mame/drivers/jalmah -/mame/drivers/macrossp -/mame/drivers/nmk16 -/mame/drivers/quizdna -/mame/drivers/quizpani - -@olympia -/mame/drivers/dday -/mame/drivers/monzagp -/mame/drivers/portrait -/mame/drivers/vega - -@omori -/mame/drivers/battlex -/mame/drivers/carjmbre -/mame/drivers/popper -/mame/drivers/spaceg - -@orca -/mame/drivers/espial -/mame/drivers/funkybee -/mame/drivers/marineb -/mame/drivers/vastar -/mame/drivers/zodiack - -@pacific -/mame/drivers/mrflea -/mame/drivers/thief - -@pacman -/mame/drivers/jrpacman -/mame/drivers/pacman -/mame/drivers/pengo - - -@pce -/mame/drivers/ggconnie -/mame/drivers/paranoia -/mame/drivers/tourvis -/mame/drivers/uapce - - -@phoenix -/mame/drivers/naughtyb -/mame/drivers/phoenix -/mame/drivers/safarir - - -@playmark -/mame/drivers/drtomy -/mame/drivers/playmark -/mame/drivers/powerbal -/mame/drivers/sderby -/mame/drivers/sslam - -@psikyo -/mame/drivers/psikyo -/mame/drivers/psikyo4 -/mame/drivers/psikyosh - -@ramtek -/mame/drivers/hitme -/mame/drivers/starcrus - -@rare -/mame/drivers/btoads -/mame/drivers/kinst -/mame/drivers/xtheball - -@sanritsu -/mame/drivers/appoooh -/mame/drivers/bankp -/mame/drivers/chinsan -/mame/drivers/drmicro -/mame/drivers/jantotsu -/mame/drivers/mayumi -/mame/drivers/mermaid -/mame/drivers/mjkjidai - -@sega -/mame/drivers/angelkds -/mame/drivers/bingoc -/mame/drivers/blockade -/mame/drivers/calorie -/mame/drivers/chihiro -/mame/drivers/coolridr -/mame/drivers/deniam -/mame/drivers/dotrikun -/mame/drivers/gpworld -/mame/drivers/hikaru -/mame/drivers/hshavoc -/mame/drivers/kopunch -/mame/drivers/megadrvb -/mame/drivers/megaplay -/mame/drivers/megatech -/mame/drivers/model1 -/mame/drivers/model2 -/mame/drivers/model3 -/mame/drivers/naomi -/mame/drivers/triforce -/mame/drivers/puckpkmn -/mame/drivers/segac2 -/mame/drivers/segae -/mame/drivers/shtzone -/mame/drivers/segag80r -/mame/drivers/segag80v -/mame/drivers/segahang -/mame/drivers/segajw -/mame/drivers/segald -/mame/drivers/segaorun -/mame/drivers/segas16a -/mame/drivers/segas16b -/mame/drivers/segas18 -/mame/drivers/segas24 -/mame/drivers/segas32 -/mame/drivers/segaxbd -/mame/drivers/segaybd -/mame/drivers/sg1000a -/mame/drivers/stactics -/mame/drivers/stv -/mame/drivers/suprloco -/mame/drivers/system1 -/mame/drivers/system16 -/mame/drivers/timetrv -/mame/drivers/turbo -/mame/drivers/vicdual -/mame/drivers/zaxxon - - -@seibu -/mame/drivers/bloodbro -/mame/drivers/cabal -/mame/drivers/cshooter -/mame/drivers/dcon -/mame/drivers/deadang -/mame/drivers/dynduke -/mame/drivers/feversoc -/mame/drivers/goal92 -/mame/drivers/goodejan -/mame/drivers/kncljoe -/mame/drivers/legionna -/mame/drivers/mustache -/mame/drivers/panicr -/mame/drivers/raiden -/mame/drivers/raiden2 -/mame/drivers/r2dx_v33 -/mame/drivers/seibuspi -/mame/drivers/sengokmj -/mame/drivers/stfight -/mame/drivers/toki -/mame/drivers/wiz - -@seta -/mame/drivers/aleck64 -/mame/drivers/hanaawas -/mame/drivers/jclub2 -/mame/drivers/macs -/mame/drivers/seta -/mame/drivers/seta2 -/mame/drivers/speedatk -/mame/drivers/speglsht -/mame/drivers/srmp2 -/mame/drivers/srmp5 -/mame/drivers/srmp6 -/mame/drivers/ssv -/mame/drivers/st0016 - - -@sigma -/mame/drivers/nyny -/mame/drivers/r2dtank -/mame/drivers/sigmab52 -/mame/drivers/sigmab98 -/mame/drivers/spiders -/mame/drivers/sub - -@snk -/mame/drivers/bbusters -/mame/drivers/dmndrby -/mame/drivers/hng64 -/mame/drivers/lasso -/mame/drivers/mainsnk -/mame/drivers/munchmo -/mame/drivers/prehisle -/mame/drivers/snk6502 -/mame/drivers/snk -/mame/drivers/snk68 - -@sony -/mame/drivers/zn - -@stern -/mame/drivers/astinvad -/mame/drivers/berzerk -/mame/drivers/cliffhgr -/mame/drivers/mazerbla -/mame/drivers/supdrapo - -@subsino -/mame/drivers/lastfght -/mame/drivers/subsino -/mame/drivers/subsino2 - - -@sun -/mame/drivers/arabian -/mame/drivers/dai3wksi -/mame/drivers/ikki -/mame/drivers/kangaroo -/mame/drivers/markham -/mame/drivers/route16 -/mame/drivers/shanghai -/mame/drivers/shangha3 -/mame/drivers/strnskil -/mame/drivers/tonton - -@suna -/mame/drivers/go2000 -/mame/drivers/goindol -/mame/drivers/suna8 -/mame/drivers/suna16 - -@sure -/mame/drivers/mil4000 - - -@taito -/mame/drivers/2mindril -/mame/drivers/40love -/mame/drivers/arkanoid -/mame/drivers/ashnojoe -/mame/drivers/asuka -/mame/drivers/bigevglf -/mame/drivers/bking -/mame/drivers/bublbobl -/mame/drivers/buggychl -/mame/drivers/cchance -/mame/drivers/chaknpop -/mame/drivers/champbwl -/mame/drivers/changela -/mame/drivers/crbaloon -/mame/drivers/cyclemb -/mame/drivers/darius -/mame/drivers/darkmist -/mame/drivers/exzisus -/mame/drivers/fgoal -/mame/drivers/flstory -/mame/drivers/galastrm -/mame/drivers/gladiatr -/mame/drivers/grchamp -/mame/drivers/groundfx -/mame/drivers/gsword -/mame/drivers/gunbustr -/mame/drivers/halleys -/mame/drivers/invqix -/mame/drivers/jollyjgr -/mame/drivers/ksayakyu -/mame/drivers/lgp -/mame/drivers/lkage -/mame/drivers/lsasquad -/mame/drivers/marinedt -/mame/drivers/mexico86 -/mame/drivers/minivadr -/mame/drivers/missb2 -/mame/drivers/mlanding -/mame/drivers/msisaac -/mame/drivers/ninjaw -/mame/drivers/nycaptor -/mame/drivers/opwolf -/mame/drivers/othunder -/mame/drivers/pitnrun -/mame/drivers/qix -/mame/drivers/rainbow -/mame/drivers/rastan -/mame/drivers/retofinv -/mame/drivers/rollrace -/mame/drivers/sbowling -/mame/drivers/slapshot -/mame/drivers/ssrj -/mame/drivers/superchs -/mame/drivers/superqix -/mame/drivers/taito_b -/mame/drivers/taito_f2 -/mame/drivers/taito_f3 -/mame/drivers/taito_h -/mame/drivers/taito_l -/mame/drivers/taito_x -/mame/drivers/taito_z -/mame/drivers/taito_o -/mame/drivers/taitoair -/mame/drivers/taitogn -/mame/drivers/taitojc -/mame/drivers/taitopjc -/mame/drivers/taitosj -/mame/drivers/taitotz -/mame/drivers/taitowlf -/mame/drivers/tnzs -/mame/drivers/topspeed -/mame/drivers/tsamurai -/mame/drivers/undrfire -/mame/drivers/volfied -/mame/drivers/warriorb -/mame/drivers/wgp - - -@tatsumi -/mame/drivers/kingdrby -/mame/drivers/lockon -/mame/drivers/tatsumi -/mame/drivers/tx1 - -@tch -/mame/drivers/kickgoal -/mame/drivers/littlerb -/mame/drivers/rltennis -/mame/drivers/speedspn -/mame/drivers/wheelfir - -@tecfri -/mame/drivers/ambush -/mame/drivers/holeland -/mame/drivers/sauro -/mame/drivers/speedbal - -@technos -/mame/drivers/battlane -/mame/drivers/blockout -/mame/drivers/bogeyman -/mame/drivers/chinagat -/mame/drivers/ddragon -/mame/drivers/ddragon3 -/mame/drivers/dogfgt -/mame/drivers/matmania -/mame/drivers/mystston -/mame/drivers/renegade -/mame/drivers/scregg -/mame/drivers/shadfrce -/mame/drivers/spdodgeb -/mame/drivers/ssozumo -/mame/drivers/tagteam -/mame/drivers/vball -/mame/drivers/wwfsstar -/mame/drivers/wwfwfest -/mame/drivers/xain - -@tehkan -/mame/drivers/bombjack -/mame/drivers/gaiden -/mame/drivers/lvcards -/mame/drivers/pbaction -/mame/drivers/senjyo -/mame/drivers/solomon -/mame/drivers/spbactn -/mame/drivers/tbowl -/mame/drivers/tecmo -/mame/drivers/tecmo16 -/mame/drivers/tecmosys -/mame/drivers/tehkanwc -/mame/drivers/wc90 -/mame/drivers/wc90b - -@thepit -/mame/drivers/thepit -/mame/drivers/timelimt - -@toaplan -/mame/drivers/mjsister -/mame/drivers/slapfght -/mame/drivers/snowbros -/mame/drivers/toaplan1 -/mame/drivers/toaplan2 -/mame/drivers/twincobr -/mame/drivers/wardner - -@tong -/mame/drivers/beezer - -@unico -/mame/drivers/drgnmst -/mame/drivers/silkroad -/mame/drivers/unico - -@univers -/mame/drivers/cheekyms -/mame/drivers/cosmic -/mame/drivers/docastle -/mame/drivers/ladybug -/mame/drivers/mrdo -/mame/drivers/redclash -/mame/drivers/superdq - -@upl -/mame/drivers/mouser -/mame/drivers/ninjakd2 -/mame/drivers/nova2001 -/mame/drivers/xxmissio - -@valadon -/mame/drivers/bagman -/mame/drivers/tankbust - -@veltmjr -/mame/drivers/cardline -/mame/drivers/witch - -@venture -/mame/drivers/looping -/mame/drivers/spcforce -/mame/drivers/suprridr - -@vsystem -/mame/drivers/aerofgt -/mame/drivers/crshrace -/mame/drivers/f1gp -/mame/drivers/fromance -/mame/drivers/fromanc2 -/mame/drivers/gstriker -/mame/drivers/inufuku -/mame/drivers/ojankohs -/mame/drivers/pipedrm -/mame/drivers/rpunch -/mame/drivers/suprslam -/mame/drivers/tail2nos -/mame/drivers/taotaido -/mame/drivers/welltris - -@yunsung -/mame/drivers/nmg5 -/mame/drivers/paradise -/mame/drivers/yunsung8 -/mame/drivers/yunsun16 - -@zaccaria -/mame/drivers/laserbat -/mame/drivers/seabattl -/mame/drivers/zac2650 -/mame/drivers/zaccaria - -@pinball -/mame/drivers/allied -/mame/drivers/alvg -/mame/drivers/atari_s1 -/mame/drivers/atari_s2 -/mame/drivers/bingo -/mame/drivers/by17 -/mame/drivers/by35 -/mame/drivers/by6803 -/mame/drivers/by68701 -/mame/drivers/byvid -/mame/drivers/capcom -/mame/drivers/de_2 -/mame/drivers/de_3 -/mame/drivers/de_3b -/mame/drivers/flicker -/mame/drivers/g627 -/mame/drivers/gp_1 -/mame/drivers/gp_2 -/mame/drivers/gts1 -/mame/drivers/gts3 -/mame/drivers/gts80 -/mame/drivers/gts80a -/mame/drivers/gts80b -/mame/drivers/hankin -/mame/drivers/icecold -/mame/drivers/inder -/mame/drivers/jeutel -/mame/drivers/jp -/mame/drivers/jvh -/mame/drivers/kissproto -/mame/drivers/ltd -/mame/drivers/micropin -/mame/drivers/mephisto -/mame/drivers/mrgame -/mame/drivers/nsm -/mame/drivers/peyper -/mame/drivers/play_1 -/mame/drivers/play_2 -/mame/drivers/play_3 -/mame/drivers/play_5 -/mame/drivers/rowamet -/mame/drivers/s11 -/mame/drivers/s11a -/mame/drivers/s11b -/mame/drivers/s11c -/mame/drivers/s3 -/mame/drivers/s4 -/mame/drivers/s6 -/mame/drivers/s6a -/mame/drivers/s7 -/mame/drivers/s8 -/mame/drivers/s9 -/mame/drivers/sleic -/mame/drivers/spectra -/mame/drivers/spinb -/mame/drivers/st_mp100 -/mame/drivers/st_mp200 -/mame/drivers/taito -/mame/drivers/techno -/mame/drivers/vd -/mame/drivers/whitestar -/mame/drivers/white_mod -/mame/drivers/wico -/mame/drivers/wpc_95 -/mame/drivers/wpc_an -/mame/drivers/wpc_dcs -/mame/drivers/wpc_dot -/mame/drivers/wpc_flip1 -/mame/drivers/wpc_flip2 -/mame/drivers/wpc_s -/mame/drivers/zac_1 -/mame/drivers/zac_2 -/mame/drivers/zac_proto - -@misc -/mame/drivers/1945kiii -/mame/drivers/39in1 -/mame/drivers/3do -/mame/drivers/3x3puzzl -/mame/drivers/4enraya -/mame/drivers/5clown -/mame/drivers/acefruit -/mame/drivers/aces1 -/mame/drivers/acesp -/mame/drivers/adp -/mame/drivers/amaticmg -/mame/drivers/ampoker2 -/mame/drivers/amspdwy -/mame/drivers/artmagic -/mame/drivers/astrafr -/mame/drivers/astrocorp -/mame/drivers/astropc -/mame/drivers/atronic -/mame/drivers/attckufo -/mame/drivers/avt -/mame/drivers/aztarac -/mame/drivers/beaminv -/mame/drivers/belatra -/mame/drivers/bgt -/mame/drivers/bingoman -/mame/drivers/bingor -/mame/drivers/blitz -/mame/drivers/blitz68k -/mame/drivers/buster -/mame/drivers/calomega -/mame/drivers/carrera -/mame/drivers/castle -/mame/drivers/cave -/mame/drivers/cb2001 -/mame/drivers/cdi -/mame/drivers/cesclass -/mame/drivers/chance32 -/mame/drivers/chsuper -/mame/drivers/cidelsa -/mame/drivers/coinmstr -/mame/drivers/coinmvga -/mame/drivers/comebaby -/mame/drivers/cupidon -/mame/drivers/bntyhunt -/mame/drivers/coolpool -/mame/drivers/corona -/mame/drivers/crystal -/mame/drivers/cubeqst -/mame/drivers/cybertnk -/mame/drivers/dcheese -/mame/drivers/dfruit -/mame/drivers/dgpix -/mame/drivers/discoboy -/mame/drivers/dominob -/mame/drivers/dorachan -/mame/drivers/dreamwld -/mame/drivers/dribling -/mame/drivers/drw80pkr -/mame/drivers/dwarfd -/mame/drivers/dynadice -/mame/drivers/ecoinfr -/mame/drivers/ecoinf1 -/mame/drivers/ecoinf2 -/mame/drivers/ecoinf3 -/mame/drivers/epos -/mame/drivers/esd16 -/mame/drivers/esh -/mame/drivers/esripsys -/mame/drivers/ettrivia -/mame/drivers/extrema -/mame/drivers/flipjack -/mame/drivers/flower -/mame/drivers/fortecar -/mame/drivers/fresh -/mame/drivers/freekick -/mame/drivers/funkball -/mame/drivers/gambl186 -/mame/drivers/galaxi -/mame/drivers/galgame -/mame/drivers/gamecstl -/mame/drivers/gammagic -/mame/drivers/gamtor -/mame/drivers/gei -/mame/drivers/globalfr -/mame/drivers/globalvr -/mame/drivers/gluck2 -/mame/drivers/goldngam -/mame/drivers/goldnpkr -/mame/drivers/good -/mame/drivers/gotcha -/mame/drivers/gstream -/mame/drivers/gumbo -/mame/drivers/gunpey -/mame/drivers/hazelgr -/mame/drivers/headonb -/mame/drivers/highvdeo -/mame/drivers/himesiki -/mame/drivers/hitpoker -/mame/drivers/homedata -/mame/drivers/hotblock -/mame/drivers/hotstuff -/mame/drivers/ichiban -/mame/drivers/imolagp -/mame/drivers/intrscti -/mame/drivers/istellar -/mame/drivers/itgambl2 -/mame/drivers/itgambl3 -/mame/drivers/itgamble -/mame/drivers/jackpool -/mame/drivers/jankenmn -/mame/drivers/jokrwild -/mame/drivers/jongkyo -/mame/drivers/jubilee -/mame/drivers/kas89 -/mame/drivers/kingpin -/mame/drivers/koikoi -/mame/drivers/kurukuru -/mame/drivers/kyugo -/mame/drivers/ladyfrog -/mame/drivers/laserbas -/mame/drivers/lethalj -/mame/drivers/limenko -/mame/drivers/ltcasino -/mame/drivers/lucky74 -/mame/drivers/luckgrln -/mame/drivers/magic10 -/mame/drivers/magicard -/mame/drivers/magicfly -/mame/drivers/magictg -/mame/drivers/magtouch -/mame/drivers/majorpkr -/mame/drivers/malzak -/mame/drivers/manohman -/mame/drivers/mcatadv -/mame/drivers/meyc8080 -/mame/drivers/meyc8088 -/mame/drivers/micro3d -/mame/drivers/midas -/mame/drivers/miniboy7 -/mame/drivers/mirax -/mame/drivers/mole -/mame/drivers/mosaic -/mame/drivers/mpu12wbk -/mame/drivers/mrjong -/mame/drivers/multfish -/mame/drivers/murogem -/mame/drivers/murogmbl -/mame/drivers/neoprint -/mame/drivers/neptunp2 -/mame/drivers/news -/mame/drivers/nexus3d -/mame/drivers/norautp -/mame/drivers/nsmpoker -/mame/drivers/oneshot -/mame/drivers/onetwo -/mame/drivers/othello -/mame/drivers/othldrby -/mame/drivers/pachifev -/mame/drivers/pasha2 -/mame/drivers/pass -/mame/drivers/peplus -/mame/drivers/photon -/mame/drivers/photon2 -/mame/drivers/photoply -/mame/drivers/pinkiri8 -/mame/drivers/pipeline -/mame/drivers/pkscram -/mame/drivers/pntnpuzl -/mame/drivers/policetr -/mame/drivers/polyplay -/mame/drivers/poker72 -/mame/drivers/potgoldu -/mame/drivers/proconn -/mame/drivers/psattack -/mame/drivers/quizo -/mame/drivers/quizpun2 -/mame/drivers/rbmk -/mame/drivers/rcorsair -/mame/drivers/re900 -/mame/drivers/rgum -/mame/drivers/roul -/mame/drivers/savquest -/mame/drivers/sanremo -/mame/drivers/sfbonus -/mame/drivers/shangkid -/mame/drivers/skeetsht -/mame/drivers/skimaxx -/mame/drivers/skyarmy -/mame/drivers/skylncr -/mame/drivers/sliver -/mame/drivers/slotcarn -/mame/drivers/smsmcorp -/mame/drivers/sothello -/mame/drivers/splus -/mame/drivers/spool99 -/mame/drivers/sprcros2 -/mame/drivers/sshot -/mame/drivers/ssingles -/mame/drivers/sstrangr -/mame/drivers/statriv2 -/mame/drivers/stellafr -/mame/drivers/stuntair -/mame/drivers/su2000 -/mame/drivers/summit -/mame/drivers/sumt8035 -/mame/drivers/supercrd -/mame/drivers/supertnk -/mame/drivers/superwng -/mame/drivers/tapatune -/mame/drivers/tattack -/mame/drivers/taxidriv -/mame/drivers/tcl -/mame/drivers/thayers -/mame/drivers/thedeep -/mame/drivers/tiamc1 -/mame/drivers/tickee -/mame/drivers/tmspoker -/mame/drivers/truco -/mame/drivers/trucocl -/mame/drivers/trvmadns -/mame/drivers/trvquest -/mame/drivers/ttchamp -/mame/drivers/tugboat -/mame/drivers/umipoker -/mame/drivers/unkfr -/mame/drivers/unkhorse -/mame/drivers/usgames -/mame/drivers/vamphalf -/mame/drivers/vcombat -/mame/drivers/vectrex -/mame/drivers/videopkr -/mame/drivers/vlc -/mame/drivers/voyager -/mame/drivers/vp101 -/mame/drivers/vpoker -/mame/drivers/vroulet -/mame/drivers/wildpkr -/mame/drivers/wms -/mame/drivers/xtom3d -/mame/drivers/xyonix diff --git a/src/targets/mess.lst b/src/targets/mess.lst deleted file mode 100644 index a1649c51b1f..00000000000 --- a/src/targets/mess.lst +++ /dev/null @@ -1,904 +0,0 @@ -/****************************************************************************** - - mess.lst - - List of all enabled drivers in the system. This file is parsed by - makemak.exe, sorted, and output as C code describing the drivers. - -**************************************************************************** - - Copyright Aaron Giles - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name 'MAME' nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -******************************************************************************/ - -@acorn -/mess/drivers/a310 -/mess/drivers/a6809 -/mess/drivers/a7000 -/mess/drivers/acrnsys1 -/mess/drivers/atom -/mess/drivers/bbc -/mess/drivers/bbcbc -/mess/drivers/electron -/mess/drivers/z88 - -@act -/mess/drivers/apricot -/mess/drivers/apricotf -/mess/drivers/apricotp -/mess/drivers/victor9k - -@adc -/mess/drivers/super6 -/mess/drivers/superslave - -@alesis -/mess/drivers/alesis - -@amiga -/mess/drivers/amiga - -@amstrad -/mess/drivers/amstrad -/mess/drivers/amstr_pc -/mess/drivers/pc1512 -/mess/drivers/nc -/mess/drivers/pcw -/mess/drivers/pda600 -/mess/drivers/pcw16 - -@apf -/mess/drivers/apf - -@apollo -/mess/drivers/apollo - -@apple -/mess/drivers/apple2 -/mess/drivers/apple2gs -/mess/drivers/lisa -/mess/drivers/mac -/mess/drivers/macpci -/mess/drivers/apple1 -/mess/drivers/apple3 - -@applied -/mess/drivers/mbee - -@arcadia -/mess/drivers/arcadia - -@ascii -/mess/drivers/msx - -@at -/mess/drivers/at -/mess/drivers/ct486 - -@atari -/mess/drivers/atari400 -/mess/drivers/a7800 -/mess/drivers/a2600 -/mess/drivers/atarist -/mess/drivers/lynx -/mess/drivers/portfoli - -@att -/mess/drivers/unixpc - -@bally -/mess/drivers/astrocde - -@bandai -/mess/drivers/rx78 -/mess/drivers/wswan - -@be -/mess/drivers/bebox - -@bnpo -/mess/drivers/b2m - -@bondwell -/mess/drivers/bw2 -/mess/drivers/bw12 - -@booth -/mess/drivers/apexc - -@camputers -/mess/drivers/camplynx - -@canon -/mess/drivers/cat -/mess/drivers/x07 - -@cantab -/mess/drivers/ace - -@casio -/mess/drivers/casloopy -/mess/drivers/cfx9850 -/mess/drivers/fp200 -/mess/drivers/fp1100 -/mess/drivers/pv1000 -/mess/drivers/pv2000 -/mess/drivers/pb1000 -/mess/drivers/fp6000 - -@cbm -/mess/drivers/pet -/mess/drivers/c64 -/mess/drivers/c64dtv -/mess/drivers/vic10 -/mess/drivers/vic20 -/mess/drivers/plus4 -/mess/drivers/cbm2 -/mess/drivers/c65 -/mess/drivers/c128 -/mess/drivers/clcd -/mess/drivers/c900 - -@cccp -/mess/drivers/argo -/mess/drivers/cm1800 -/mess/drivers/lviv -/mess/drivers/mikro80 -/mess/drivers/pk8000 -/mess/drivers/pk8020 -/mess/drivers/pyl601 -/mess/drivers/sm1800 -/mess/drivers/uknc -/mess/drivers/ut88 -/mess/drivers/vector06 - -@cce -/mess/drivers/mc1000 - -@ccs -/mess/drivers/ccs2422 -/mess/drivers/ccs2810 - -@chromatics -/mess/drivers/cgc7900 - -@coleco -/mess/drivers/coleco -/mess/drivers/adam - -@cromemco -/mess/drivers/c10 - -@comx -/mess/drivers/comx35 - -@concept -/mess/drivers/concept - -@conitec -/mess/drivers/prof80 -/mess/drivers/prof180x - -@cybiko -/mess/drivers/cybiko - -@dai -/mess/drivers/dai - -@ddr -/mess/drivers/ac1 -/mess/drivers/bcs3 -/mess/drivers/c80 -/mess/drivers/huebler -/mess/drivers/jtc -/mess/drivers/kramermc -/mess/drivers/llc -/mess/drivers/nanos -/mess/drivers/pcm -/mess/drivers/vcs80 - -@dec -/mess/drivers/dct11em -/mess/drivers/dectalk -/mess/drivers/pdp11 -/mess/drivers/vax11 -/mess/drivers/rainbow -/mess/drivers/vk100 -/mess/drivers/vt100 -/mess/drivers/vt220 -/mess/drivers/vt240 -/mess/drivers/vt320 -/mess/drivers/vt520 - -@dicksmth -/mess/drivers/super80 - -@dms -/mess/drivers/dms5000 -/mess/drivers/dms86 -/mess/drivers/zsbc3 - -@dragon -/mess/drivers/dgn_beta - -@drc -/mess/drivers/zrt80 - -@eaca -/mess/drivers/cgenie - -@einis -/mess/drivers/pecom - -@elektrka -/mess/drivers/bk -/mess/drivers/mk85 -/mess/drivers/mk90 - -@elektor -/mess/drivers/ec65 -/mess/drivers/elekscmp -/mess/drivers/junior - -@ensoniq -/mess/drivers/esq1 -/mess/drivers/mirage -/mess/drivers/esq5505 -/mess/drivers/esqkt -/mess/drivers/esqmr - -@entex -/mess/drivers/advision - -@epoch -/mess/drivers/gamepock -/mess/drivers/scv - -@epson -/mess/drivers/ex800 -/mess/drivers/hx20 -/mess/drivers/lx800 -/mess/drivers/lx810l -/mess/drivers/px4 -/mess/drivers/px8 -/mess/drivers/qx10 - -@exeltel -/mess/drivers/exelv - -@exidy -/mess/drivers/sorcerer - -@fairch -/mess/drivers/channelf - -@fujitsu -/mess/drivers/fmtowns -/mess/drivers/fm7 - -@funtech -/mess/drivers/supracan - -@galaxy -/mess/drivers/galaxy - -@gamepark -/mess/drivers/gp32 -/mess/drivers/gp2x - -@grundy -/mess/drivers/newbrain - -@hartung -/mess/drivers/gmaster - -@heathkit -/mess/drivers/et3400 -/mess/drivers/h8 -/mess/drivers/h19 -/mess/drivers/h89 - -@hegener -/mess/drivers/glasgow -/mess/drivers/mephisto -/mess/drivers/mmodular - - -@hitachi -/mess/drivers/bmjr -/mess/drivers/bml3 -/mess/drivers/b16 - -@homebrew -/mess/drivers/4004clk -/mess/drivers/68ksbc -/mess/drivers/craft -/mess/drivers/homez80 -/mess/drivers/p112 -/mess/drivers/phunsy -/mess/drivers/pimps -/mess/drivers/ravens -/mess/drivers/sbc6510 -/mess/drivers/sitcom -/mess/drivers/slc1 -/mess/drivers/uzebox -/mess/drivers/z80dev - -@homelab -/mess/drivers/homelab - -@hp -/mess/drivers/hp48 -/mess/drivers/hp16500 -/mess/drivers/hp49gp -/mess/drivers/hp9k - -@hec2hrp -/mess/drivers/hec2hrp -/mess/drivers/interact - -@intel -/mess/drivers/basic52 -/mess/drivers/isbc -/mess/drivers/ipc -/mess/drivers/ipds -/mess/drivers/imds -/mess/drivers/sdk85 -/mess/drivers/sdk86 -/mess/drivers/rex6000 - -@intelgnt -/mess/drivers/ep64 - -@interton -/mess/drivers/vc4000 - -@intv -/mess/drivers/intv - -@kaypro -/mess/drivers/kaypro - -@koei -/mess/drivers/pasogo - -@kyocera -/mess/drivers/kyocera - -@luxor -/mess/drivers/abc80 -/mess/drivers/abc80x -/mess/drivers/abc1600 - -@magnavox -/mess/drivers/odyssey2 - -@makerbot -/mess/drivers/replicator - -@mattel -/mess/drivers/aquarius -/mess/drivers/juicebox - -@matsushi -/mess/drivers/jr100 -/mess/drivers/jr200 -/mess/drivers/myb3k - -@mb -/mess/drivers/microvsn - -@mchester -/mess/drivers/ssem - -@memotech -/mess/drivers/mtx - -@mgu -/mess/drivers/irisha - -@microkey -/mess/drivers/primo - -@mit -/mess/drivers/tx0 - -@mits -/mess/drivers/altair -/mess/drivers/mits680b - -@mitsubishi -/mess/drivers/multi8 -/mess/drivers/multi16 - -@morrow -/mess/drivers/mpz80 - -@mos -/mess/drivers/kim1 - -@motorola -/mess/drivers/mekd2 - -@multitch -/mess/drivers/mpf1 - -@nakajima -/mess/drivers/nakajies - -@nascom -/mess/drivers/nascom1 - -@ne -/mess/drivers/z80ne - -@nec -/mess/drivers/apc -/mess/drivers/pce -/mess/drivers/pcfx -/mess/drivers/pc6001 -/mess/drivers/pc8401a -/mess/drivers/pc8001 -/mess/drivers/pc8801 -/mess/drivers/pc88va -/mess/drivers/pc100 -/mess/drivers/pc9801 -/mess/drivers/tk80bs - -@netronic -/mess/drivers/elf -/mess/drivers/exp85 - -@next -/mess/drivers/next - -@nintendo -/mess/drivers/nes -/mess/drivers/snes -/mess/drivers/n64 -/mess/drivers/gb -/mess/drivers/pokemini -/mess/drivers/vboy -/mess/drivers/gba - -@nokia -/mess/drivers/mikromik - -@northstar -/mess/drivers/horizon - -@novag -/mess/drivers/mk1 -/mess/drivers/mk2 -/mess/drivers/ssystem3 -/mess/drivers/supercon - -@olivetti -/mess/drivers/m20 - -@omnibyte -/mess/drivers/msbc1 -/mess/drivers/ob68k1a - -@orion -/mess/drivers/orion - -@osborne -/mess/drivers/osborne1 -/mess/drivers/osbexec -/mess/drivers/vixen - -@osi -/mess/drivers/osi - -@palm -/mess/drivers/palm -/mess/drivers/palmz22 - -@parker -/mess/drivers/merlin -/mess/drivers/stopthie - -@pitronic -/mess/drivers/beta - -@pc -/mess/drivers/pc -/mess/drivers/genpc -/mess/drivers/ibmpc - -@pdp1 -/mess/drivers/pdp1 - -@pel -/mess/drivers/galeb -/mess/drivers/orao - -@philips -/mess/drivers/p2000t -/mess/drivers/vg5k - -@poly88 -/mess/drivers/poly88 - -@psion -/mess/drivers/psion - -@radio -/mess/drivers/radio86 -/mess/drivers/apogee -/mess/drivers/partner -/mess/drivers/mikrosha - -@rca -/mess/drivers/microkit -/mess/drivers/studio2 -/mess/drivers/vip - -@rm -/mess/drivers/rm380z -/mess/drivers/rmnimbus - -@robotron -/mess/drivers/a5105 -/mess/drivers/a51xx -/mess/drivers/a7150 -/mess/drivers/k1003 -/mess/drivers/k8915 -/mess/drivers/rt1715 -/mess/drivers/z1013 -/mess/drivers/z9001 - -@roland -/mess/drivers/rmt32 -/mess/drivers/rd110 - -@rockwell -/mess/drivers/aim65 -/mess/drivers/aim65_40 - -@samcoupe -/mess/drivers/samcoupe - -@samsung -/mess/drivers/spc1000 - -@sanyo -/mess/drivers/phc25 -/mess/drivers/mbc55x - -@sega -/mess/drivers/sg1000 -/mess/drivers/megadriv -/mess/drivers/dccons -/mess/drivers/saturn -/mess/drivers/sms -/mess/drivers/svmu - -@sgi -/mess/drivers/sgi_ip2 -/mess/drivers/sgi_ip6 -/mess/drivers/ip20 -/mess/drivers/ip22 - -@sharp -/mess/drivers/mz700 -/mess/drivers/pc1500 -/mess/drivers/pocketc -/mess/drivers/x68k -/mess/drivers/mz80 -/mess/drivers/mz2000 -/mess/drivers/x1 -/mess/drivers/x1twin -/mess/drivers/mz2500 -/mess/drivers/mz3500 -/mess/drivers/pce220 -/mess/drivers/mz6500 - -@sinclair -/mess/drivers/zx -/mess/drivers/spectrum -/mess/drivers/spec128 -/mess/drivers/timex -/mess/drivers/specpls3 -/mess/drivers/scorpion -/mess/drivers/atm -/mess/drivers/pentagon -/mess/drivers/ql - - -@snk -/mess/drivers/ng_aes -/mame/drivers/neogeo -/mess/drivers/ngp - -@sony -/mess/drivers/psx -/mess/drivers/pockstat -/mess/drivers/smc777 - -@sord -/mess/drivers/m5 - -@special -/mess/drivers/special - -@sun -/mess/drivers/sun1 -/mess/drivers/sun2 -/mess/drivers/sun3 -/mess/drivers/sun4 - -@svi -/mess/drivers/svi318 - -@svision -/mess/drivers/svision - -@synertec -/mess/drivers/sym1 - -@tandberg -/mess/drivers/tdv2324 - -@tangerin -/mess/drivers/microtan -/mess/drivers/oric - -@tatung -/mess/drivers/einstein - -@teamconc -/mess/drivers/comquest - -@tektroni -/mess/drivers/tek405x -/mess/drivers/tek410x - -@telenova -/mess/drivers/compis - -@telercas -/mess/drivers/tmc1800 -/mess/drivers/tmc600 -/mess/drivers/tmc2000e - -@tem -/mess/drivers/tec1 - -@tesla -/mess/drivers/ondra -/mess/drivers/pmd85 -/mess/drivers/pmi80 -/mess/drivers/sapi1 - -@test -/mess/drivers/test_t400 -/mess/drivers/zexall - -@thomson -/mess/drivers/thomson - -@ti -/mess/drivers/ti85 -/mess/drivers/ti89 -/mess/drivers/ti990_4 -/mess/drivers/ti99_4x -/mess/drivers/ti99_4p -/mess/drivers/ti99_8 -/mess/drivers/geneve -/mess/drivers/tm990189 -/mess/drivers/ti990_10 -/mess/drivers/ti99_2 -/mess/drivers/avigo -/mess/drivers/evmbug - -@tiger -/mess/drivers/gamecom - -@tigertel -/mess/drivers/gizmondo - -@tiki -/mess/drivers/tiki100 - -@tomy -/mess/drivers/tutor - -@toshiba -/mess/drivers/pasopia -/mess/drivers/pasopia7 -/mess/drivers/paso1600 - -@trainer -/mess/drivers/amico2k -/mess/drivers/babbage -/mess/drivers/bob85 -/mess/drivers/cvicny -/mess/drivers/instruct -/mess/drivers/dolphunk -/mess/drivers/mk14 -/mess/drivers/pro80 -/mess/drivers/savia84 -/mess/drivers/selz80 - -@trs -/mess/drivers/coco12 -/mess/drivers/coco3 -/mess/drivers/dragon -/mess/drivers/mc10 -/mess/drivers/trs80 -/mess/drivers/trs80m2 -/mess/drivers/tandy2k - -@unisys -/mess/drivers/univac - -@veb -/mess/drivers/chessmst -/mess/drivers/kc -/mess/drivers/lc80 -/mess/drivers/mc80 -/mess/drivers/poly880 -/mess/drivers/sc1 -/mess/drivers/sc2 - -@vidbrain -/mess/drivers/vidbrain - -@videoton -/mess/drivers/tvc - -@visual -/mess/drivers/v1050 - -@votrax -/mess/drivers/votrpss -/mess/drivers/votrtnt - -@vtech -/mess/drivers/lcmate2 -/mess/drivers/pc4 -/mess/drivers/vtech1 -/mess/drivers/vtech2 -/mess/drivers/crvision -/mess/drivers/socrates -/mess/drivers/pc2000 -/mess/drivers/prestige -/mess/drivers/geniusiq - -@wang -/mess/drivers/wangpc - -@wavemate -/mess/drivers/bullet -/mess/drivers/jupiter - -@xerox -/mess/drivers/xerox820 -/mess/drivers/bigbord2 - -@yamaha -/mess/drivers/ymmu100 - -@zpa -/mess/drivers/iq151 - -@zvt -/mess/drivers/pp01 - -@skeleton -/mess/drivers/altos5 -/mess/drivers/alphasma -/mess/drivers/alphatro -/mess/drivers/applix -/mess/drivers/attache -/mess/drivers/ax20 -/mess/drivers/beehive -/mess/drivers/binbug -/mess/drivers/besta -/mess/drivers/br8641 -/mess/drivers/busicom -/mess/drivers/chaos -/mess/drivers/chesstrv -/mess/drivers/cd2650 -/mess/drivers/codata -/mess/drivers/cortex -/mess/drivers/cosmicos -/mess/drivers/cp1 -/mess/drivers/csc -/mess/drivers/cxhumax -/mess/drivers/czk80 -/mess/drivers/d6800 -/mess/drivers/d6809 -/mess/drivers/digel804 -/mess/drivers/dim68k -/mess/drivers/dm7000 -/mess/drivers/dmv -/mess/drivers/dual68 -/mess/drivers/eacc -/mess/drivers/elwro800 -/mess/drivers/eti660 -/mess/drivers/fk1 -/mess/drivers/fidelz80 -/mess/drivers/hpz80unk -/mess/drivers/ht68k -/mess/drivers/ie15 -/mess/drivers/if800 -/mess/drivers/indiana -/mess/drivers/itt3030 -/mess/drivers/konin -/mess/drivers/m79152pc -/mess/drivers/mbc200 -/mess/drivers/mccpm -/mess/drivers/mes -/mess/drivers/microdec -/mess/drivers/micronic -/mess/drivers/mini2440 -/mess/drivers/mmd1 -/mess/drivers/mod8 -/mess/drivers/modellot -/mess/drivers/ms0515 -/mess/drivers/mstation -/mess/drivers/mycom -/mess/drivers/okean240 -/mess/drivers/p8k -/mess/drivers/pegasus -/mess/drivers/pencil2 -/mess/drivers/pes -/mess/drivers/pipbug -/mess/drivers/plan80 -/mess/drivers/poly -/mess/drivers/pt68k4 -/mess/drivers/ptcsol -/mess/drivers/pv9234 -/mess/drivers/qtsbc -/mess/drivers/rvoice -/mess/drivers/sacstate -/mess/drivers/sage2 -/mess/drivers/softbox -/mess/drivers/swtpc -/mess/drivers/sys2900 -/mess/drivers/systec -/mess/drivers/terak -/mess/drivers/tim011 -/mess/drivers/tim100 -/mess/drivers/tricep -/mess/drivers/ts802 -/mess/drivers/ts803 -/mess/drivers/tsispch -/mess/drivers/unior -/mess/drivers/unistar -/mess/drivers/v6809 -/mess/drivers/vector4 -/mess/drivers/vii -/mess/drivers/vta2000 -/mess/drivers/xor100 -/mess/drivers/z100 diff --git a/src/tools/tools.mak b/src/tools/tools.mak deleted file mode 100644 index ada7c290a49..00000000000 --- a/src/tools/tools.mak +++ /dev/null @@ -1,224 +0,0 @@ -########################################################################### -# -# tools.mak -# -# MAME tools makefile -# -########################################################################### -# -# Copyright Aaron Giles -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name 'MAME' nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -########################################################################### - - -TOOLSSRC = $(SRC)/tools -TOOLSOBJ = $(OBJ)/tools - -OBJDIRS += \ - $(TOOLSOBJ) \ - - - -#------------------------------------------------- -# set of tool targets -#------------------------------------------------- - -TOOLS += \ - $(BIN)romcmp$(EXE) \ - $(BIN)chdman$(EXE) \ - $(BIN)jedutil$(EXE) \ - $(BIN)unidasm$(EXE) \ - $(BIN)ldresample$(EXE) \ - $(BIN)ldverify$(EXE) \ - $(BIN)regrep$(EXE) \ - $(BIN)srcclean$(EXE) \ - $(BIN)src2html$(EXE) \ - $(BIN)split$(EXE) \ - $(BIN)pngcmp$(EXE) \ - $(BIN)nltool$(EXE) \ - - -#------------------------------------------------- -# romcmp -#------------------------------------------------- - -ROMCMPOBJS = \ - $(TOOLSOBJ)/romcmp.o \ - -$(BIN)romcmp$(EXE): $(ROMCMPOBJS) $(LIBUTIL) $(ZLIB) $(EXPAT) $(LIBOCORE) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# chdman -#------------------------------------------------- - -CHDMANOBJS = \ - $(TOOLSOBJ)/chdman.o \ - -$(BIN)chdman$(EXE): $(CHDMANOBJS) $(LIBUTIL) $(ZLIB) $(EXPAT) $(FLAC_LIB) $(7Z_LIB) $(LIBOCORE) - $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ) - @echo Linking $@... - $(LD) $(LDFLAGS) $(VERSIONOBJ) $^ $(BASELIBS) $(FLAC_LIB) -o $@ - - - -#------------------------------------------------- -# jedutil -#------------------------------------------------- - -JEDUTILOBJS = \ - $(TOOLSOBJ)/jedutil.o \ - -$(BIN)jedutil$(EXE): $(JEDUTILOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# unidasm -#------------------------------------------------- - -UNIDASMOBJS = \ - $(TOOLSOBJ)/unidasm.o \ - -# TODO: Visual Studio wants $(FLAC_LIB) and $(7Z_LIB) during linking... -$(BIN)unidasm$(EXE): $(UNIDASMOBJS) $(LIBDASM) $(LIBEMU) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) $(FLAC_LIB) $(7Z_LIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# ldresample -#------------------------------------------------- - -LDRESAMPLEOBJS = \ - $(TOOLSOBJ)/ldresample.o \ - -$(BIN)ldresample$(EXE): $(LDRESAMPLEOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(FLAC_LIB) $(7Z_LIB) $(EXPAT) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) $(FLAC_LIB) -o $@ - - - -#------------------------------------------------- -# ldverify -#------------------------------------------------- - -LDVERIFYOBJS = \ - $(TOOLSOBJ)/ldverify.o \ - -$(BIN)ldverify$(EXE): $(LDVERIFYOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(FLAC_LIB) $(7Z_LIB) $(EXPAT) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) $(FLAC_LIB) -o $@ - - - -#------------------------------------------------- -# regrep -#------------------------------------------------- - -REGREPOBJS = \ - $(TOOLSOBJ)/regrep.o \ - -$(BIN)regrep$(EXE): $(REGREPOBJS) $(LIBUTIL) $(FLAC_LIB) $(LIBOCORE) $(ZLIB) $(EXPAT) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# srcclean -#------------------------------------------------- - -SRCCLEANOBJS = \ - $(TOOLSOBJ)/srcclean.o \ - -$(BIN)srcclean$(EXE): $(SRCCLEANOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# src2html -#------------------------------------------------- - -SRC2HTMLOBJS = \ - $(TOOLSOBJ)/src2html.o \ - -$(BIN)src2html$(EXE): $(SRC2HTMLOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# split -#------------------------------------------------- - -SPLITOBJS = \ - $(TOOLSOBJ)/split.o \ - -# TODO: Visual Studio wants $(FLAC_LIB) and $(7Z_LIB) during linking... -$(BIN)split$(EXE): $(SPLITOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) $(FLAC_LIB) $(7Z_LIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - - - -#------------------------------------------------- -# pngcmp -#------------------------------------------------- - -PNGCMPOBJS = \ - $(TOOLSOBJ)/pngcmp.o \ - -$(BIN)pngcmp$(EXE): $(PNGCMPOBJS) $(LIBUTIL) $(FLAC_LIB) $(LIBOCORE) $(ZLIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - -#------------------------------------------------- -# nltool -#------------------------------------------------- - -NLTOOLOBJS = \ - $(TOOLSOBJ)/nltool.o \ - $(NETLISTOBJS) \ - -# TODO: Visual Studio wants $(FLAC_LIB) and $(7Z_LIB) during linking... -$(BIN)nltool$(EXE): $(NLTOOLOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT) $(FLAC_LIB) $(7Z_LIB) - @echo Linking $@... - $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ - diff --git a/src/ume/osd/windows/windows.mak b/src/ume/osd/windows/windows.mak deleted file mode 100644 index 894595b0cbe..00000000000 --- a/src/ume/osd/windows/windows.mak +++ /dev/null @@ -1,41 +0,0 @@ -########################################################################### -# -# windows.mak -# -# UME Windows-specific makefile -# -########################################################################### - -UME_WINSRC = src/ume/osd/windows -UME_WINOBJ = $(OBJ)/ume/osd/windows - -OBJDIRS += \ - $(UMEOBJ)/osd \ - $(UMEOBJ)/osd/windows - -RESFILE = $(UME_WINOBJ)/ume.res - -$(LIBOSD): $(OSDOBJS) - -$(LIBOCORE): $(OSDCOREOBJS) - -$(LIBOCORE_NOMAIN): $(OSDCOREOBJS:$(WINOBJ)/main.o=) - -#------------------------------------------------- -# generic rules for the resource compiler -#------------------------------------------------- - -$(UME_WINOBJ)/%.res: $(UME_WINSRC)/%.rc - @echo Compiling resources $<... - $(RC) $(RCDEFS) $(RCFLAGS) --include-dir $(UME_WINOBJ) -o $@ -i $< - - -#------------------------------------------------- -# rules for resource file -#------------------------------------------------- - -$(RESFILE): $(UME_WINSRC)/ume.rc $(UME_WINOBJ)/umevers.rc - -$(UME_WINOBJ)/umevers.rc: $(SRC)/build/verinfo.py $(SRC)/version.c - @echo Emitting $@... - $(PYTHON) $(SRC)/build/verinfo.py -b ume -o $@ $(SRC)/version.c diff --git a/src/targets/ume.lst b/src/ume/tiny.lst index 506e5c80434..cfd6af9e92f 100644 --- a/src/targets/ume.lst +++ b/src/ume/tiny.lst @@ -3,9 +3,9 @@ ume.lst List of all enabled drivers in the system. This file is parsed by - makemak.exe, sorted, and output as C code describing the drivers. + makelist.exe, sorted, and output as C code describing the drivers. ******************************************************************************/ -#src/targets/mame.lst -#src/targets/mess.lst +#src/mame/tiny.lst +#src/mess/tiny.lst diff --git a/src/ume/ume.mak b/src/ume/ume.mak index 673c3567717..d319b666311 100644 --- a/src/ume/ume.mak +++ b/src/ume/ume.mak @@ -1,33 +1,13 @@ ########################################################################### # -# ume.mak +# makefile # -# Universal target makefile +# Additional makefile for building UME +# +# Copyright (c) Nicola Salmoria and the MAME Team. +# Visit http://mamedev.org for licensing and usage restrictions. # ########################################################################### -CFLAGS += \ - -I$(SRC)/ume \ - -I$(SRC)/mame \ - -I$(OBJ)/mame/layout \ - -I$(SRC)/mess \ - -I$(OBJ)/mess/layout \ - -I$(SRC)/mess/osd \ - -I$(SRC)/mess/osd/$(OSD) - -UMEOBJ = $(OBJ)/ume -OBJDIRS += $(UMEOBJS) - -$(DRIVLISTSRC): $(SRC)/mame/mame.lst $(SRC)/mess/mess.lst - -include $(SRC)/mame/mame.mak -include $(SRC)/mess/mess.mak - -depend: maketree $(MAKEDEP_TARGET) - @echo Rebuilding depend_$(TARGET).mak... - $(MAKEDEP) -I. $(INCPATH) -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/emu > depend_emu.mak - $(MAKEDEP) -I. $(INCPATH) -I$(SRC)/mame -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/mame > depend_mame.mak - $(MAKEDEP) -I. $(INCPATH) -I$(SRC)/mess -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... $(SRC)/mess > depend_mess.mak - @echo -include depend_emu.mak > depend_ume.mak - @echo -include depend_mame.mak >> depend_ume.mak - @echo -include depend_mess.mak >> depend_ume.mak +GEN_FOLDERS += $(GENDIR)/mame/layout/ $(GENDIR)/mess/layout/ +LAYOUTS += $(wildcard $(SRC)/mame/layout/*.lay) $(wildcard $(SRC)/mess/layout/*.lay) diff --git a/src/version.c b/src/version.c index 5707b25f031..da26f7e0bbe 100644 --- a/src/version.c +++ b/src/version.c @@ -8,7 +8,7 @@ ***************************************************************************/ -#define BARE_BUILD_VERSION "0.159" +#define BARE_BUILD_VERSION "0.160" extern const char bare_build_version[]; extern const char build_version[]; |